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@xxxxxxxxx> --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 17658b3..dcd8c8d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -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"); -- 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