@@ -6236,8 +6236,14 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
brcmf_err("not a ISO3166 code\n");
return;
}
+
memset(&ccreq, 0, sizeof(ccreq));
- ccreq.rev = cpu_to_le32(-1);
+ if (brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq))) {
+ brcmf_err("could not obtain country info\n");
+ return;
+ }
+
+ memset(ccreq.country_abbrev, 0, sizeof(ccreq.country_abbrev));
memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2));
if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) {
brcmf_err("firmware rejected country setting\n");
When changing country driver has to submit two values: alpha2 and rev(ision). We don't want to change revision as it's device specific. So far we were submitting value -1 in hope firmware will treat it as invalid and will simply keep using the old one. It doesn't work however, firmware treats -1 as 0 which may result in setting wrong revision. Solve it by reading current value and submit it back with changed country. Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com> --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)