Skip to contentSkip to conversation

brcmfmac: check all combinations when setting wiphy's addresses

PATCH Applied Rafał Miłecki 2 participants 2 messages Aug 19, 2015 – Aug 25, 2015 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: check all combinations when setting wiphy's addresses

Broadcom is working on better reflection of interface combinations. With upcoming patches we may have 1st combination supporting less interfaces than others.
To don't run out of addresses check all combinations to find the one with the greatest max_interfaces value.

---
I believe this patch should be applied before:
brcmfmac: correct interface combination info

---
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +9 -2
index ffe5260..c85e2db 100644
@@ -5786,7 +5786,9 @@ 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;
+	const struct ieee80211_iface_combination *combo;
 	struct ieee80211_supported_band *band;
+	u16 max_interfaces = 0;
 	__le32 bandlist[3];
 	u32 n_bands;
 	int err, i;
@@ -5799,8 +5801,13 @@ 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++) {
+	for (i = 0, combo = wiphy->iface_combinations;
+	     i < wiphy->n_iface_combinations; i++, combo++) {
+		max_interfaces = max(max_interfaces, combo->max_interfaces);
+	}
+
+	for (i = 0; i < max_interfaces && i < ARRAY_SIZE(drvr->addresses);
+	     i++) {
 		u8 *addr = drvr->addresses[i].addr;
 
 		memcpy(addr, drvr->mac, ETH_ALEN);
Signature · 1 line
1.8.4.5
Applied
#1 lore raw
Quoted 7 lines · Rafał Miłecki

Broadcom is working on better reflection of interface combinations. With upcoming patches we may have 1st combination supporting less interfaces than others.
To don't run out of addresses check all combinations to find the one with the greatest max_interfaces value.

Thanks, applied manually.

Signature · 1 line
Kalle Valo