Skip to content

Commit 151a7c1

Browse files
s-mochKalle Valo
authored andcommitted
Revert "brcmfmac: use ISO3166 country code and 0 rev as fallback"
This reverts commit b0b524f. Commit b0b524f ("brcmfmac: use ISO3166 country code and 0 rev as fallback") changes country setup to directly use ISO3166 country codes if no more specific code is configured. This was done under the assumption that brcmfmac firmwares can handle such simple direct mapping from country codes to firmware ccode values. Unfortunately this is not true for all chipset/firmware combinations. E.g. BCM4359/9 devices stop working as access point with this change, so revert the offending commit to avoid the regression. Signed-off-by: Soeren Moch <[email protected]> Cc: [email protected] # 5.14.x Acked-by: Shawn Guo <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fe5c735 commit 151a7c1

File tree

1 file changed

+6
-11
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+6
-11
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7463,23 +7463,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2],
74637463
s32 found_index;
74647464
int i;
74657465

7466+
country_codes = drvr->settings->country_codes;
7467+
if (!country_codes) {
7468+
brcmf_dbg(TRACE, "No country codes configured for device\n");
7469+
return -EINVAL;
7470+
}
7471+
74667472
if ((alpha2[0] == ccreq->country_abbrev[0]) &&
74677473
(alpha2[1] == ccreq->country_abbrev[1])) {
74687474
brcmf_dbg(TRACE, "Country code already set\n");
74697475
return -EAGAIN;
74707476
}
74717477

7472-
country_codes = drvr->settings->country_codes;
7473-
if (!country_codes) {
7474-
brcmf_dbg(TRACE, "No country codes configured for device, using ISO3166 code and 0 rev\n");
7475-
memset(ccreq, 0, sizeof(*ccreq));
7476-
ccreq->country_abbrev[0] = alpha2[0];
7477-
ccreq->country_abbrev[1] = alpha2[1];
7478-
ccreq->ccode[0] = alpha2[0];
7479-
ccreq->ccode[1] = alpha2[1];
7480-
return 0;
7481-
}
7482-
74837478
found_index = -1;
74847479
for (i = 0; i < country_codes->table_size; i++) {
74857480
cc = &country_codes->table[i];

0 commit comments

Comments
 (0)