From 11f51639726afe44973f2c7ae3ac59cefd3b2cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 9 Jul 2015 18:23:41 +0000 Subject: mac80211: add brcmfmac patch fixing user space picked MACs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki Backport of r46288 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@46290 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...t-wiphy-s-addresses-to-provide-valid-MACs.patch | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 package/kernel/mac80211/patches/863-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch (limited to 'package/kernel/mac80211') diff --git a/package/kernel/mac80211/patches/863-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch b/package/kernel/mac80211/patches/863-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch new file mode 100644 index 0000000000..24ccaddf33 --- /dev/null +++ b/package/kernel/mac80211/patches/863-brcmfmac-set-wiphy-s-addresses-to-provide-valid-MACs.patch @@ -0,0 +1,69 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 9 Jul 2015 16:53:30 +0200 +Subject: [PATCH] brcmfmac: set wiphy's addresses to provide valid MACs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broadcom's firmware requires every BSS to use MAC address with unique +last few bits. The amount of bits may depend on a particular firmware, +it was verified to be 2 for BCM43602 one. +If this condition won't be fulfilled firmware will reject such MAC: +brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 + +We don't want to simply set addr_mask as it would also disallow using +locally administrated bit. Instead let's build a list of addresses +manually enabling 0x2 bit for extra interfaces. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +@@ -5812,6 +5812,7 @@ static void brcmf_wiphy_wowl_params(struct wiphy *wiphy) + + static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) + { ++ struct brcmf_pub *drvr = ifp->drvr; + struct ieee80211_supported_band *band; + __le32 bandlist[3]; + u32 n_bands; +@@ -5825,6 +5826,19 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) + if (err) + return err; + ++ for (i = 0; i < wiphy->iface_combinations->max_interfaces && ++ i < ARRAY_SIZE(drvr->addresses); i++) { ++ u8 *addr = drvr->addresses[i].addr; ++ ++ memcpy(addr, drvr->mac, ETH_ALEN); ++ if (i) { ++ addr[0] |= BIT(1); ++ addr[ETH_ALEN - 1] ^= i; ++ } ++ } ++ wiphy->addresses = drvr->addresses; ++ wiphy->n_addresses = i; ++ + wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; + wiphy->cipher_suites = __wl_cipher_suites; + wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +--- a/drivers/net/wireless/brcm80211/brcmfmac/core.h ++++ b/drivers/net/wireless/brcm80211/brcmfmac/core.h +@@ -21,6 +21,7 @@ + #ifndef BRCMFMAC_CORE_H + #define BRCMFMAC_CORE_H + ++#include + #include "fweh.h" + + #define TOE_TX_CSUM_OL 0x00000001 +@@ -118,6 +119,8 @@ struct brcmf_pub { + /* Multicast data packets sent to dongle */ + unsigned long tx_multicast; + ++ struct mac_address addresses[BRCMF_MAX_IFS]; ++ + struct brcmf_if *iflist[BRCMF_MAX_IFS]; + + struct mutex proto_block; -- cgit v1.2.3