summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-09-21 21:43:23 -0700
committerJohn W. Linville <linville@tuxdriver.com>2011-09-27 14:34:03 -0400
commit5116f3cef206e7fcd6023ba8595a6321f33c2044 (patch)
tree8742cda80ed3e983442cb64717829fcb6a63e601 /drivers/net/wireless/mwifiex/scan.c
parentd06b7b9e1fd5f2512840a687bd13b50caa42f82b (diff)
mwifiex: update bss band information
In recent commit "mwifiex: use cfg80211 dynamic scan..." (7c6fa2a843..) scan table handling in driver is removed to make use of cfg80211 dynamic scan table. Now driver sends beacon buffers found in scanning directly to stack and parse the buffer for requested BSS only during association. Beacon buffer doesn't contain bss band information. Driver gets it from firmware in separate tlv (chan_band_tlv). Currently since we don't inform stack about bss bandinfo, there is an issue with 5GHz association. Use "priv" field of struct cfg80211_bss to store bandinfo. This fixes 5GHz association issue. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index ecebff681bb..ca3761965e8 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1464,9 +1464,9 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
}
static int
-mwifiex_update_curr_bss_params(struct mwifiex_private *priv,
- u8 *bssid, s32 rssi, const u8 *ie_buf,
- size_t ie_len, u16 beacon_period, u16 cap_info_bitmap)
+mwifiex_update_curr_bss_params(struct mwifiex_private *priv, u8 *bssid,
+ s32 rssi, const u8 *ie_buf, size_t ie_len,
+ u16 beacon_period, u16 cap_info_bitmap, u8 band)
{
struct mwifiex_bssdescriptor *bss_desc = NULL;
int ret;
@@ -1489,7 +1489,7 @@ mwifiex_update_curr_bss_params(struct mwifiex_private *priv,
ret = mwifiex_fill_new_bss_desc(priv, bssid, rssi, beacon_ie,
ie_len, beacon_period,
- cap_info_bitmap, bss_desc);
+ cap_info_bitmap, band, bss_desc);
if (ret)
goto done;
@@ -1533,6 +1533,11 @@ done:
return 0;
}
+static void mwifiex_free_bss_priv(struct cfg80211_bss *bss)
+{
+ kfree(bss->priv);
+}
+
/*
* This function handles the command response of scan.
*
@@ -1571,6 +1576,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
struct chan_band_param_set *chan_band;
u8 is_bgscan_resp;
unsigned long flags;
+ struct cfg80211_bss *bss;
is_bgscan_resp = (le16_to_cpu(resp->command)
== HostCmd_CMD_802_11_BG_SCAN_QUERY);
@@ -1752,10 +1758,12 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
chan = ieee80211_get_channel(priv->wdev->wiphy, freq);
if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
- cfg80211_inform_bss(priv->wdev->wiphy, chan,
- bssid, network_tsf, cap_info_bitmap,
- beacon_period, ie_buf, ie_len, rssi,
- GFP_KERNEL);
+ bss = cfg80211_inform_bss(priv->wdev->wiphy,
+ chan, bssid, network_tsf,
+ cap_info_bitmap, beacon_period,
+ ie_buf, ie_len, rssi, GFP_KERNEL);
+ *(u8 *)bss->priv = band;
+ bss->free_priv = mwifiex_free_bss_priv;
if (priv->media_connected && !memcmp(bssid,
priv->curr_bss_params.bss_descriptor
@@ -1763,7 +1771,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
mwifiex_update_curr_bss_params(priv,
bssid, rssi, ie_buf,
ie_len, beacon_period,
- cap_info_bitmap);
+ cap_info_bitmap, band);
}
} else {
dev_dbg(adapter->dev, "missing BSS channel IE\n");