brcmfmac: keep device specific settings when changing country
RFC PATCH 1/1 brcmfmac: keep device specific settings when changing country
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 <[email protected]>
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +7 -1
@@ -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" );
Signature · 1 line
1.8.4.5