net: wireless: bcmdhd: Re-set country code on CSA completion
Srinivas Ramachandran [Wed, 19 Apr 2017 23:44:56 +0000 (16:44 -0700)]
Issue: Sometimes on disconnection from AP due to channel switch
       announcement on DFS channel, firmware channel flags are
       still in stale active state. This leads to active scanning
       on DFS channel without AP connection, which is not permitted.

Fix:   Re-set the current firmware country code, on CSA completion
       event, to restore the channel flag in fw.

Bug 1883430

Change-Id: I7a05b8a7464ac0a0918d7f519e3042b593cf5ba3
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: http://git-master/r/1466175
GVS: Gerrit_Virtual_Submit
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>

drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 26652f9..aa621ca 100644 (file)
@@ -14471,6 +14471,14 @@ const wl_event_msg_t *e, void *data)
        chanspec_t chanspec;
 
        WL_ERR(("%s\n", __FUNCTION__));
+       /* Re-set existing country code to restore channel
+        * flags on DFS channels
+        */
+       if (cfg && cfgdev) {
+               ndev = cfgdev_to_wlc_ndev(cfgdev, cfg);
+               wldev_set_country(ndev, NULL, true, false);
+       }
+
        if (e->status)
                return -1;
        if (cfgdev) {