brcmfmac: update wiphy band information upon updating regulatory domain
authorArend van Spriel <arend@broadcom.com>
Tue, 14 Apr 2015 18:10:25 +0000 (20:10 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 9 May 2015 13:26:47 +0000 (16:26 +0300)
When change the country code the available channels may change. So
the wiphy bands should be updated accordingly.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c

index 76dff0e114746173ae2cd06556d0723f383df631..84d9ab1d4da7629e9dbaa8adc228703c8bc47d0b 100644 (file)
@@ -6023,7 +6023,11 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
        memset(&ccreq, 0, sizeof(ccreq));
        ccreq.rev = cpu_to_le32(-1);
        memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2));
-       brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
+       if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) {
+               brcmf_err("firmware rejected country setting\n");
+               return;
+       }
+       brcmf_setup_wiphybands(wiphy);
 }
 
 static void brcmf_free_wiphy(struct wiphy *wiphy)