]> git.karo-electronics.de Git - linux-beck.git/commitdiff
wlcore: increase scan dwell times if no activity
authorEyal Shapira <eyal@wizery.com>
Sat, 8 Dec 2012 00:58:23 +0000 (02:58 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 11 Dec 2012 08:25:39 +0000 (10:25 +0200)
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>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wl18xx/main.c
drivers/net/wireless/ti/wlcore/conf.h
drivers/net/wireless/ti/wlcore/scan.c

index 8b4827f47deb8fd941043cbe905fe47343031767..08b67625f7ff6cd0b8ca2b67bd3ec0c1eef716ea 100644 (file)
@@ -269,6 +269,8 @@ static struct wlcore_conf wl12xx_conf = {
        .scan = {
                .min_dwell_time_active        = 7500,
                .max_dwell_time_active        = 30000,
+               .min_dwell_time_active_long   = 25000,
+               .max_dwell_time_active_long   = 50000,
                .dwell_time_passive           = 100000,
                .dwell_time_dfs               = 150000,
                .num_probe_reqs               = 2,
index 55fd46b9628df47362e4925cd7a515c93ac113fb..62f431a2ed34c2cc4cdee425752654ac34a1f330 100644 (file)
@@ -396,6 +396,8 @@ static struct wlcore_conf wl18xx_conf = {
        .scan = {
                .min_dwell_time_active        = 7500,
                .max_dwell_time_active        = 30000,
+               .min_dwell_time_active_long   = 25000,
+               .max_dwell_time_active_long   = 50000,
                .dwell_time_passive           = 100000,
                .dwell_time_dfs               = 150000,
                .num_probe_reqs               = 2,
index fd173b9ca46a534375fd9238058e4d78cea08793..2b96ff821341103ac935ade4765409b21e142409 100644 (file)
@@ -1088,6 +1088,7 @@ struct conf_roam_trigger_settings {
 struct conf_scan_settings {
        /*
         * The minimum time to wait on each channel for active scans
+        * This value will be used whenever there's a connected interface.
         *
         * Range: u32 tu/1000
         */
@@ -1095,11 +1096,32 @@ struct conf_scan_settings {
 
        /*
         * The maximum time to wait on each channel for active scans
+        * This value will be currently used whenever there's a
+        * connected interface. It shouldn't exceed 30000 (~30ms) to avoid
+        * possible interference of voip traffic going on while scanning.
         *
         * Range: u32 tu/1000
         */
        u32 max_dwell_time_active;
 
+       /* The minimum time to wait on each channel for active scans
+        * when it's possible to have longer scan dwell times.
+        * Currently this is used whenever we're idle on all interfaces.
+        * Longer dwell times improve detection of networks within a
+        * single scan.
+        *
+        * Range: u32 tu/1000
+        */
+       u32 min_dwell_time_active_long;
+
+       /* The maximum time to wait on each channel for active scans
+        * when it's possible to have longer scan dwell times.
+        * See min_dwell_time_active_long
+        *
+        * Range: u32 tu/1000
+        */
+       u32 max_dwell_time_active_long;
+
        /* time to wait on the channel for passive scans (in TU/1000) */
        u32 dwell_time_passive;
 
index 7f42f8a4d90b94562f430419c5d094e250b5ec16..6cfdeaea12f0b65b39259c4e17c1734733f60ed6 100644 (file)
@@ -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 {