]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Update the cfg layer with new channel info
authorShital Jaju <shital.jaju@broadcom.com>
Thu, 14 Aug 2014 17:13:26 +0000 (10:13 -0700)
committerEric Chuang <echuang@nvidia.com>
Wed, 8 Oct 2014 23:22:32 +0000 (16:22 -0700)
The upper layer is not notified of the change in channel after roaming.
This results in AGO creation on incorrect channel (previous AP channel)
after roaming. This change will update the cfg layer with the new channel
info after receiving romaing event.

Bug 200024418

Change-Id: Iabe7b329edc14fcc1491ec99966d06f249468105
Signed-off-by: Shital Jaju <shital.jaju@broadcom.com>
(cherry picked from commit df1e9aa0c460ee38f07a9a2ecd20006bf825c8a3)
Reviewed-on: http://git-master/r/552767
Reviewed-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 12c88db6e1c424b1411b7b5fa7b07f797984754e..328ce79d24adc420968245761a7ee30ece50af96 100644 (file)
@@ -7537,26 +7537,37 @@ static s32 wl_update_bss_info(struct wl_priv *wl, struct net_device *ndev)
        u8 *curbssid;
        s32 err = 0;
        struct wiphy *wiphy;
+       struct ieee80211_supported_band *band;
+       struct ieee80211_channel *channel = NULL;
+       u16 chan;
+       u32 freq;
 
+       mutex_lock(&wl->usr_sync);
        wiphy = wl_to_wiphy(wl);
 
        ssid = (struct wlc_ssid *)wl_read_prof(wl, ndev, WL_PROF_SSID);
        curbssid = wl_read_prof(wl, ndev, WL_PROF_BSSID);
-       bss = cfg80211_get_bss(wiphy, NULL, curbssid,
-               ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS,
-               WLAN_CAPABILITY_ESS);
-
-       mutex_lock(&wl->usr_sync);
+       *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX);
+       err = wldev_ioctl(ndev, WLC_GET_BSS_INFO,
+                               wl->extra_buf, WL_EXTRA_BUF_MAX, false);
+       if (unlikely(err)) {
+               WL_ERR(("Could not get bss info %d\n", err));
+               goto update_bss_info_out;
+       }
+       bi = (struct wl_bss_info *)(wl->extra_buf + 4);
+       chan = bi->ctl_ch ? bi->ctl_ch :
+               CHSPEC_CHANNEL(wl_chspec_driver_to_host(bi->chanspec));
+       if (chan <= CH_MAX_2G_CHANNEL)
+               band = wiphy->bands[IEEE80211_BAND_2GHZ];
+       else
+               band = wiphy->bands[IEEE80211_BAND_5GHZ];
+       freq = ieee80211_channel_to_frequency(chan, band->band);
+       channel = ieee80211_get_channel(wiphy, freq);
+       bss = cfg80211_get_bss(wiphy, channel, curbssid,
+                               ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS,
+                               WLAN_CAPABILITY_ESS);
        if (!bss) {
                WL_DBG(("Could not find the AP\n"));
-               *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX);
-               err = wldev_ioctl(ndev, WLC_GET_BSS_INFO,
-                       wl->extra_buf, WL_EXTRA_BUF_MAX, false);
-               if (unlikely(err)) {
-                       WL_ERR(("Could not get bss info %d\n", err));
-                       goto update_bss_info_out;
-               }
-               bi = (struct wl_bss_info *)(wl->extra_buf + 4);
                if (memcmp(bi->BSSID.octet, curbssid, ETHER_ADDR_LEN)) {
                        WL_ERR(("Bssid doesn't match\n"));
                        err = -EIO;