Search Linux Wireless

[PATCH] brcmfmac: set wiphy's addr_mask to force using valid MACs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Broadcom's firmware requires every BSS to use MAC address with unique
last 2 bits. Otherwise it rejects submitted MAC which results in:
brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52

Set addr_mask properly to hint only last 2 bits can be modified. This
isn't exactly true as all bits can be changed but that's the only way
to force unique values in the last 2 bits.

Signed-off-by: Rafał Miłecki <zajec5@xxxxxxxxx>
---
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index d86d1f1..4ab1d92 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -6100,6 +6100,11 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
 		return NULL;
 	}
 	memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN);
+	/* Firmware requires last 2 bits to contain unique value for every BSS.
+	 * Unfortunately this will also disallow changing other bits (firmware
+	 * supports it as long as last 2 bits are unique) but it's the only way.
+	 */
+	wiphy->addr_mask[ETH_ALEN - 1] = 0x02;
 	set_wiphy_dev(wiphy, busdev);
 
 	cfg = wiphy_priv(wiphy);
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux