aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-12-07 19:58:23 -0500
committerLuciano Coelho <coelho@ti.com>2012-12-11 03:25:39 -0500
commit5d3a160365306c4161b7064d482c26a85829f170 (patch)
treea75e43ac714c63d23e0f36edb030138155fdfa48 /drivers/net
parentf4d02007cdd56c59bdb9362c699875cb2d02c0fe (diff)
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')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c2
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/conf.h22
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.c30
4 files changed, 53 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 8b4827f47deb..08b67625f7ff 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -269,6 +269,8 @@ static struct wlcore_conf wl12xx_conf = {
269 .scan = { 269 .scan = {
270 .min_dwell_time_active = 7500, 270 .min_dwell_time_active = 7500,
271 .max_dwell_time_active = 30000, 271 .max_dwell_time_active = 30000,
272 .min_dwell_time_active_long = 25000,
273 .max_dwell_time_active_long = 50000,
272 .dwell_time_passive = 100000, 274 .dwell_time_passive = 100000,
273 .dwell_time_dfs = 150000, 275 .dwell_time_dfs = 150000,
274 .num_probe_reqs = 2, 276 .num_probe_reqs = 2,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 55fd46b9628d..62f431a2ed34 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -396,6 +396,8 @@ static struct wlcore_conf wl18xx_conf = {
396 .scan = { 396 .scan = {
397 .min_dwell_time_active = 7500, 397 .min_dwell_time_active = 7500,
398 .max_dwell_time_active = 30000, 398 .max_dwell_time_active = 30000,
399 .min_dwell_time_active_long = 25000,
400 .max_dwell_time_active_long = 50000,
399 .dwell_time_passive = 100000, 401 .dwell_time_passive = 100000,
400 .dwell_time_dfs = 150000, 402 .dwell_time_dfs = 150000,
401 .num_probe_reqs = 2, 403 .num_probe_reqs = 2,
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h
index fd173b9ca46a..2b96ff821341 100644
--- a/drivers/net/wireless/ti/wlcore/conf.h
+++ b/drivers/net/wireless/ti/wlcore/conf.h
@@ -1088,6 +1088,7 @@ struct conf_roam_trigger_settings {
1088struct conf_scan_settings { 1088struct conf_scan_settings {
1089 /* 1089 /*
1090 * The minimum time to wait on each channel for active scans 1090 * The minimum time to wait on each channel for active scans
1091 * This value will be used whenever there's a connected interface.
1091 * 1092 *
1092 * Range: u32 tu/1000 1093 * Range: u32 tu/1000
1093 */ 1094 */
@@ -1095,11 +1096,32 @@ struct conf_scan_settings {
1095 1096
1096 /* 1097 /*
1097 * The maximum time to wait on each channel for active scans 1098 * The maximum time to wait on each channel for active scans
1099 * This value will be currently used whenever there's a
1100 * connected interface. It shouldn't exceed 30000 (~30ms) to avoid
1101 * possible interference of voip traffic going on while scanning.
1098 * 1102 *
1099 * Range: u32 tu/1000 1103 * Range: u32 tu/1000
1100 */ 1104 */
1101 u32 max_dwell_time_active; 1105 u32 max_dwell_time_active;
1102 1106
1107 /* The minimum time to wait on each channel for active scans
1108 * when it's possible to have longer scan dwell times.
1109 * Currently this is used whenever we're idle on all interfaces.
1110 * Longer dwell times improve detection of networks within a
1111 * single scan.
1112 *
1113 * Range: u32 tu/1000
1114 */
1115 u32 min_dwell_time_active_long;
1116
1117 /* The maximum time to wait on each channel for active scans
1118 * when it's possible to have longer scan dwell times.
1119 * See min_dwell_time_active_long
1120 *
1121 * Range: u32 tu/1000
1122 */
1123 u32 max_dwell_time_active_long;
1124
1103 /* time to wait on the channel for passive scans (in TU/1000) */ 1125 /* time to wait on the channel for passive scans (in TU/1000) */
1104 u32 dwell_time_passive; 1126 u32 dwell_time_passive;
1105 1127
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:
89 89
90} 90}
91 91
92static void wlcore_started_vifs_iter(void *data, u8 *mac,
93 struct ieee80211_vif *vif)
94{
95 int *count = (int *)data;
96
97 if (!vif->bss_conf.idle)
98 (*count)++;
99}
100
101static int wlcore_count_started_vifs(struct wl1271 *wl)
102{
103 int count = 0;
104
105 ieee80211_iterate_active_interfaces_atomic(wl->hw,
106 IEEE80211_IFACE_ITER_RESUME_ALL,
107 wlcore_started_vifs_iter, &count);
108 return count;
109}
110
92static int 111static int
93wlcore_scan_get_channels(struct wl1271 *wl, 112wlcore_scan_get_channels(struct wl1271 *wl,
94 struct ieee80211_channel *req_channels[], 113 struct ieee80211_channel *req_channels[],
@@ -109,9 +128,14 @@ wlcore_scan_get_channels(struct wl1271 *wl,
109 /* configure dwell times according to scan type */ 128 /* configure dwell times according to scan type */
110 if (scan_type == SCAN_TYPE_SEARCH) { 129 if (scan_type == SCAN_TYPE_SEARCH) {
111 struct conf_scan_settings *c = &wl->conf.scan; 130 struct conf_scan_settings *c = &wl->conf.scan;
112 131 bool active_vif_exists = !!wlcore_count_started_vifs(wl);
113 min_dwell_time_active = c->min_dwell_time_active; 132
114 max_dwell_time_active = c->max_dwell_time_active; 133 min_dwell_time_active = active_vif_exists ?
134 c->min_dwell_time_active :
135 c->min_dwell_time_active_long;
136 max_dwell_time_active = active_vif_exists ?
137 c->max_dwell_time_active :
138 c->max_dwell_time_active_long;
115 dwell_time_passive = c->dwell_time_passive; 139 dwell_time_passive = c->dwell_time_passive;
116 dwell_time_dfs = c->dwell_time_dfs; 140 dwell_time_dfs = c->dwell_time_dfs;
117 } else { 141 } else {