Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eliad Peller and committed by
Kalle Valo
8698a3a4 6d5c8987

+34 -6
+2
drivers/net/wireless/ti/wl18xx/main.c
··· 422 422 .num_probe_reqs = 2, 423 423 .rssi_threshold = -90, 424 424 .snr_threshold = 0, 425 + .num_short_intervals = SCAN_MAX_SHORT_INTERVALS, 426 + .long_interval = 30000, 425 427 }, 426 428 .ht = { 427 429 .rx_ba_win_size = 32,
+14 -3
drivers/net/wireless/ti/wl18xx/scan.c
··· 223 223 SCAN_TYPE_PERIODIC); 224 224 wl18xx_adjust_channels(cmd, cmd_channels); 225 225 226 - cmd->short_cycles_sec = 0; 227 - cmd->long_cycles_sec = cpu_to_le16(req->interval); 228 - cmd->short_cycles_count = 0; 226 + if (c->num_short_intervals && c->long_interval && 227 + c->long_interval > req->interval) { 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 241 cmd->total_cycles = 0; 231 242
+2 -2
drivers/net/wireless/ti/wl18xx/scan.h
··· 74 74 u8 dfs; /* number of dfs channels in 5ghz */ 75 75 u8 passive_active; /* number of passive before active channels 2.4ghz */ 76 76 77 - __le16 short_cycles_sec; 78 - __le16 long_cycles_sec; 77 + __le16 short_cycles_msec; 78 + __le16 long_cycles_msec; 79 79 u8 short_cycles_count; 80 80 u8 total_cycles; /* 0 - infinite */ 81 81 u8 padding[2];
+10 -1
drivers/net/wireless/ti/wlcore/conf.h
··· 1186 1186 1187 1187 /* SNR threshold to be used for filtering */ 1188 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 1198 } __packed; 1190 1199 1191 1200 struct conf_ht_setting { ··· 1361 1352 * version, the two LSB are the lower driver's private conf 1362 1353 * version. 1363 1354 */ 1364 - #define WLCORE_CONF_VERSION (0x0006 << 16) 1355 + #define WLCORE_CONF_VERSION (0x0007 << 16) 1365 1356 #define WLCORE_CONF_MASK 0xffff0000 1366 1357 #define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ 1367 1358 sizeof(struct wlcore_conf))
+6
drivers/net/wireless/ti/wlcore/scan.h
··· 83 83 #define MAX_CHANNELS_5GHZ 42 84 84 85 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 92 #define SCAN_MAX_BANDS 3 87 93 88 94 enum {