aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2010-07-08 10:50:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-08 16:42:09 -0400
commit08688d6b1a85484cc8e4a920afc60ffa6559999d (patch)
tree351ee3682ce623e15627df59aa50935ab6159ffe /drivers/net/wireless/wl12xx/wl1271_main.c
parent34dd2aaac4a4b908c093980a9894fd878aeb6deb (diff)
wl1271: rewritten scanning code
This patch is a complete rewrite of the scanning code. It now includes a state machine to scan all four possible sets of channels independently: 2.4GHz active, 2.4GHz passive, 5GHz active and 5GHz passive. The wl1271 firmware doesn't allow these sets to be mixed, so up to several scan commands have to be issued. This patch also allows scanning more than 24 channels per set, by breaking the sets into smaller parts if needed (the firmware can scan a maximum of 24 channels at a time). Previously, the scanning code was erroneously scanning all channels possible actively, not complying with the CRDA values. This is also fixed with this patch. Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Saravanan Dhanabal <ext-saravanan.dhanabal@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index cdfcc054efe4..d30de58cef90 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -942,10 +942,13 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
942 if (wl->bss_type == BSS_TYPE_STA_BSS) 942 if (wl->bss_type == BSS_TYPE_STA_BSS)
943 ieee80211_enable_dyn_ps(wl->vif); 943 ieee80211_enable_dyn_ps(wl->vif);
944 944
945 if (test_and_clear_bit(WL1271_FLAG_SCANNING, &wl->flags)) { 945 if (wl->scan.state != WL1271_SCAN_STATE_IDLE) {
946 mutex_unlock(&wl->mutex); 946 mutex_unlock(&wl->mutex);
947 ieee80211_scan_completed(wl->hw, true); 947 ieee80211_scan_completed(wl->hw, true);
948 mutex_lock(&wl->mutex); 948 mutex_lock(&wl->mutex);
949 wl->scan.state = WL1271_SCAN_STATE_IDLE;
950 kfree(wl->scan.scanned_ch);
951 wl->scan.scanned_ch = NULL;
949 } 952 }
950 953
951 wl->state = WL1271_STATE_OFF; 954 wl->state = WL1271_STATE_OFF;
@@ -1551,11 +1554,9 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
1551 goto out; 1554 goto out;
1552 1555
1553 if (wl1271_11a_enabled()) 1556 if (wl1271_11a_enabled())
1554 ret = wl1271_scan(hw->priv, ssid, len, req, 1557 ret = wl1271_scan(hw->priv, ssid, len, req);
1555 1, 0, WL1271_SCAN_BAND_DUAL, 3);
1556 else 1558 else
1557 ret = wl1271_scan(hw->priv, ssid, len, req, 1559 ret = wl1271_scan(hw->priv, ssid, len, req);
1558 1, 0, WL1271_SCAN_BAND_2_4_GHZ, 3);
1559 1560
1560 wl1271_ps_elp_sleep(wl); 1561 wl1271_ps_elp_sleep(wl);
1561 1562