aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-07-30 15:38:20 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-08-10 15:16:21 -0400
commit8698a3a4fff2b63831fdc0283da87f9f46c2aeb8 (patch)
treecb65321c3042f01e0c571a34e7ddc33696a673a8 /drivers/net/wireless/ti
parent6d5c898798aca634f493cabd2e7a47407ee5e95d (diff)
wl18xx: use long intervals in sched scan
Add support for long intervals on sched scan. If configured, the original request interval will be used num_short_interval times, and then the long interval will be used. While on it, fix the scan command field names to reflect the expected value is in ms (rather than secs). These values will be taken from the conf file, so bump its version accordingly. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c2
-rw-r--r--drivers/net/wireless/ti/wl18xx/scan.c17
-rw-r--r--drivers/net/wireless/ti/wl18xx/scan.h4
-rw-r--r--drivers/net/wireless/ti/wlcore/conf.h11
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.h6
5 files changed, 34 insertions, 6 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 3da6ac60c65d..f9c9d5cf0854 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -422,6 +422,8 @@ static struct wlcore_conf wl18xx_conf = {
422 .num_probe_reqs = 2, 422 .num_probe_reqs = 2,
423 .rssi_threshold = -90, 423 .rssi_threshold = -90,
424 .snr_threshold = 0, 424 .snr_threshold = 0,
425 .num_short_intervals = SCAN_MAX_SHORT_INTERVALS,
426 .long_interval = 30000,
425 }, 427 },
426 .ht = { 428 .ht = {
427 .rx_ba_win_size = 32, 429 .rx_ba_win_size = 32,
diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c
index 98666f235a12..ec2eb147add3 100644
--- a/drivers/net/wireless/ti/wl18xx/scan.c
+++ b/drivers/net/wireless/ti/wl18xx/scan.c
@@ -223,9 +223,20 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
223 SCAN_TYPE_PERIODIC); 223 SCAN_TYPE_PERIODIC);
224 wl18xx_adjust_channels(cmd, cmd_channels); 224 wl18xx_adjust_channels(cmd, cmd_channels);
225 225
226 cmd->short_cycles_sec = 0; 226 if (c->num_short_intervals && c->long_interval &&
227 cmd->long_cycles_sec = cpu_to_le16(req->interval); 227 c->long_interval > req->interval) {
228 cmd->short_cycles_count = 0; 228 cmd->short_cycles_msec = cpu_to_le16(req->interval);
229 cmd->long_cycles_msec = cpu_to_le16(c->long_interval);
230 cmd->short_cycles_count = c->num_short_intervals;
231 } else {
232 cmd->short_cycles_msec = 0;
233 cmd->long_cycles_msec = cpu_to_le16(req->interval);
234 cmd->short_cycles_count = 0;
235 }
236 wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d",
237 le16_to_cpu(cmd->short_cycles_msec),
238 le16_to_cpu(cmd->long_cycles_msec),
239 cmd->short_cycles_count);
229 240
230 cmd->total_cycles = 0; 241 cmd->total_cycles = 0;
231 242
diff --git a/drivers/net/wireless/ti/wl18xx/scan.h b/drivers/net/wireless/ti/wl18xx/scan.h
index 2e636aa5dba9..66a763f644d2 100644
--- a/drivers/net/wireless/ti/wl18xx/scan.h
+++ b/drivers/net/wireless/ti/wl18xx/scan.h
@@ -74,8 +74,8 @@ struct wl18xx_cmd_scan_params {
74 u8 dfs; /* number of dfs channels in 5ghz */ 74 u8 dfs; /* number of dfs channels in 5ghz */
75 u8 passive_active; /* number of passive before active channels 2.4ghz */ 75 u8 passive_active; /* number of passive before active channels 2.4ghz */
76 76
77 __le16 short_cycles_sec; 77 __le16 short_cycles_msec;
78 __le16 long_cycles_sec; 78 __le16 long_cycles_msec;
79 u8 short_cycles_count; 79 u8 short_cycles_count;
80 u8 total_cycles; /* 0 - infinite */ 80 u8 total_cycles; /* 0 - infinite */
81 u8 padding[2]; 81 u8 padding[2];
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h
index 166add00b50f..52a9d1b14020 100644
--- a/drivers/net/wireless/ti/wlcore/conf.h
+++ b/drivers/net/wireless/ti/wlcore/conf.h
@@ -1186,6 +1186,15 @@ struct conf_sched_scan_settings {
1186 1186
1187 /* SNR threshold to be used for filtering */ 1187 /* SNR threshold to be used for filtering */
1188 s8 snr_threshold; 1188 s8 snr_threshold;
1189
1190 /*
1191 * number of short intervals scheduled scan cycles before
1192 * switching to long intervals
1193 */
1194 u8 num_short_intervals;
1195
1196 /* interval between each long scheduled scan cycle (in ms) */
1197 u16 long_interval;
1189} __packed; 1198} __packed;
1190 1199
1191struct conf_ht_setting { 1200struct conf_ht_setting {
@@ -1352,7 +1361,7 @@ struct conf_recovery_settings {
1352 * version, the two LSB are the lower driver's private conf 1361 * version, the two LSB are the lower driver's private conf
1353 * version. 1362 * version.
1354 */ 1363 */
1355#define WLCORE_CONF_VERSION (0x0006 << 16) 1364#define WLCORE_CONF_VERSION (0x0007 << 16)
1356#define WLCORE_CONF_MASK 0xffff0000 1365#define WLCORE_CONF_MASK 0xffff0000
1357#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ 1366#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \
1358 sizeof(struct wlcore_conf)) 1367 sizeof(struct wlcore_conf))
diff --git a/drivers/net/wireless/ti/wlcore/scan.h b/drivers/net/wireless/ti/wlcore/scan.h
index 4dadd0c62cde..782eb297c196 100644
--- a/drivers/net/wireless/ti/wlcore/scan.h
+++ b/drivers/net/wireless/ti/wlcore/scan.h
@@ -83,6 +83,12 @@ struct wl1271_cmd_trigger_scan_to {
83#define MAX_CHANNELS_5GHZ 42 83#define MAX_CHANNELS_5GHZ 42
84 84
85#define SCAN_MAX_CYCLE_INTERVALS 16 85#define SCAN_MAX_CYCLE_INTERVALS 16
86
87/* The FW intervals can take up to 16 entries.
88 * The 1st entry isn't used (scan is immediate). The last
89 * entry should be used for the long_interval
90 */
91#define SCAN_MAX_SHORT_INTERVALS (SCAN_MAX_CYCLE_INTERVALS - 2)
86#define SCAN_MAX_BANDS 3 92#define SCAN_MAX_BANDS 3
87 93
88enum { 94enum {