* [PATCH] ath6kl: use custom MAC address for newly created interfaces
@ 2012-07-10 20:20 Aarthi Thiruvengadam
2012-07-11 15:58 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Aarthi Thiruvengadam @ 2012-07-10 20:20 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
Firmware and driver generate MAC addresses for the second and third interfaces.
In addition to the existing algorithm, flip bit 7 of 5th octet. Since both
firmware and driver individually generate the MAC addresses, introduce a new
firmware capability bit to keep them compatible.
Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++++-
drivers/net/wireless/ath/ath6kl/core.h | 3 +++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 230e35b..fc14d0e 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -3628,9 +3628,13 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
vif->htcap[IEEE80211_BAND_5GHZ].ht_enable = true;
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
- if (fw_vif_idx != 0)
+ if (fw_vif_idx != 0) {
ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) |
0x2;
+ if (test_bit(ATH6KL_FW_CAPABILITY_CUSTOM_MAC_ADDR,
+ ar->fw_capabilities))
+ ndev->dev_addr[4] ^= 0x80;
+ }
init_netdev(ndev);
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index f36da4a..867c966 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -126,6 +126,9 @@ enum ath6kl_fw_capability {
*/
ATH6KL_FW_CAPABILITY_SCHED_SCAN_MATCH_LIST,
+ /* FW sets mac_addr[4] ^= 0x80 for newly created interfaces */
+ ATH6KL_FW_CAPABILITY_CUSTOM_MAC_ADDR,
+
/* this needs to be last */
ATH6KL_FW_CAPABILITY_MAX,
};
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ath6kl: use custom MAC address for newly created interfaces
2012-07-10 20:20 [PATCH] ath6kl: use custom MAC address for newly created interfaces Aarthi Thiruvengadam
@ 2012-07-11 15:58 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2012-07-11 15:58 UTC (permalink / raw)
To: Aarthi Thiruvengadam; +Cc: ath6kl-devel, linux-wireless
On 07/10/2012 11:20 PM, Aarthi Thiruvengadam wrote:
> Firmware and driver generate MAC addresses for the second and third interfaces.
> In addition to the existing algorithm, flip bit 7 of 5th octet. Since both
> firmware and driver individually generate the MAC addresses, introduce a new
> firmware capability bit to keep them compatible.
>
> Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Thanks, applied. Oddly enough I had conflicts so please check that I
didn't break anything.
Kalle
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-11 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-10 20:20 [PATCH] ath6kl: use custom MAC address for newly created interfaces Aarthi Thiruvengadam
2012-07-11 15:58 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).