aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/scan.c
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-12-08 02:58:23 +0200
committerLuciano Coelho <coelho@ti.com>2012-12-11 10:25:39 +0200
commit5d3a160365306c4161b7064d482c26a85829f170 (patch)
treea75e43ac714c63d23e0f36edb030138155fdfa48 /drivers/net/wireless/ti/wlcore/scan.c
parentwlcore: remove support for injected Tx (diff)
downloadlinux-dev-5d3a160365306c4161b7064d482c26a85829f170.tar.xz
linux-dev-5d3a160365306c4161b7064d482c26a85829f170.zip
wlcore: increase scan dwell times if no activity
There's a limit on scan dwell times of max 30ms in order to avoid degrading voip traffic which could be going on while scanning. However these dwell times increase the chance of missing out on nearby APs leading to partial scan results. Allow configuration of longer dwell times in case there no active interface (i.e. no STA associated or AP up). [Arik - count started vifs using an in-driver function] [Fixed some new checkpatch warnings regarding comments in the networking subsystem. -- Luca] Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/scan.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c
index 7f42f8a4d90b..6cfdeaea12f0 100644
--- a/drivers/net/wireless/ti/wlcore/scan.c
+++ b/drivers/net/wireless/ti/wlcore/scan.c
@@ -89,6 +89,25 @@ out:
}
+static void wlcore_started_vifs_iter(void *data, u8 *mac,
+ struct ieee80211_vif *vif)
+{
+ int *count = (int *)data;
+
+ if (!vif->bss_conf.idle)
+ (*count)++;
+}
+
+static int wlcore_count_started_vifs(struct wl1271 *wl)
+{
+ int count = 0;
+
+ ieee80211_iterate_active_interfaces_atomic(wl->hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ wlcore_started_vifs_iter, &count);
+ return count;
+}
+
static int
wlcore_scan_get_channels(struct wl1271 *wl,
struct ieee80211_channel *req_channels[],
@@ -109,9 +128,14 @@ wlcore_scan_get_channels(struct wl1271 *wl,
/* configure dwell times according to scan type */
if (scan_type == SCAN_TYPE_SEARCH) {
struct conf_scan_settings *c = &wl->conf.scan;
-
- min_dwell_time_active = c->min_dwell_time_active;
- max_dwell_time_active = c->max_dwell_time_active;
+ bool active_vif_exists = !!wlcore_count_started_vifs(wl);
+
+ min_dwell_time_active = active_vif_exists ?
+ c->min_dwell_time_active :
+ c->min_dwell_time_active_long;
+ max_dwell_time_active = active_vif_exists ?
+ c->max_dwell_time_active :
+ c->max_dwell_time_active_long;
dwell_time_passive = c->dwell_time_passive;
dwell_time_dfs = c->dwell_time_dfs;
} else {