aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_scan.h
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2010-07-08 17:50:07 +0300
committerJohn W. Linville <linville@tuxdriver.com>2010-07-08 16:42:09 -0400
commit08688d6b1a85484cc8e4a920afc60ffa6559999d (patch)
tree351ee3682ce623e15627df59aa50935ab6159ffe /drivers/net/wireless/wl12xx/wl1271_scan.h
parentwl1271: moved scan operations to a separate file (diff)
downloadlinux-dev-08688d6b1a85484cc8e4a920afc60ffa6559999d.tar.xz
linux-dev-08688d6b1a85484cc8e4a920afc60ffa6559999d.zip
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 '')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_scan.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.h b/drivers/net/wireless/wl12xx/wl1271_scan.h
index 0002e815cb43..b0e36e30a427 100644
--- a/drivers/net/wireless/wl12xx/wl1271_scan.h
+++ b/drivers/net/wireless/wl12xx/wl1271_scan.h
@@ -27,12 +27,11 @@
#include "wl1271.h"
int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
- struct cfg80211_scan_request *req, u8 active_scan,
- u8 high_prio, u8 band, u8 probe_requests);
+ struct cfg80211_scan_request *req);
int wl1271_scan_build_probe_req(struct wl1271 *wl,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, u8 band);
-int wl1271_scan_complete(struct wl1271 *wl);
+void wl1271_scan_stm(struct wl1271 *wl);
#define WL1271_SCAN_MAX_CHANNELS 24
#define WL1271_SCAN_DEFAULT_TAG 1
@@ -44,7 +43,16 @@ int wl1271_scan_complete(struct wl1271 *wl);
#define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */
#define WL1271_SCAN_BAND_2_4_GHZ 0
#define WL1271_SCAN_BAND_5_GHZ 1
-#define WL1271_SCAN_BAND_DUAL 2
+#define WL1271_SCAN_PROBE_REQS 3
+
+enum {
+ WL1271_SCAN_STATE_IDLE,
+ WL1271_SCAN_STATE_2GHZ_ACTIVE,
+ WL1271_SCAN_STATE_2GHZ_PASSIVE,
+ WL1271_SCAN_STATE_5GHZ_ACTIVE,
+ WL1271_SCAN_STATE_5GHZ_PASSIVE,
+ WL1271_SCAN_STATE_DONE
+};
struct basic_scan_params {
__le32 rx_config_options;
@@ -52,10 +60,10 @@ struct basic_scan_params {
/* Scan option flags (WL1271_SCAN_OPT_*) */
__le16 scan_options;
/* Number of scan channels in the list (maximum 30) */
- u8 num_channels;
+ u8 n_ch;
/* This field indicates the number of probe requests to send
per channel for an active scan */
- u8 num_probe_requests;
+ u8 n_probe_reqs;
/* Rate bit field for sending the probes */
__le32 tx_rate;
u8 tid_trigger;