aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2015-10-12 02:51:34 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-10-13 04:35:26 -0400
commit3b06d277957c7af705a9c0cdda4b371759efb717 (patch)
treea2d059d6b230c264351c4d5d44dc756595cf3208 /drivers/net/wireless/ti
parentaf61426187cd854bffe013ca8547bd8fa3c4dfbf (diff)
cfg80211: Add multiple scan plans for scheduled scan
Add the option to configure multiple 'scan plans' for scheduled scan. Each 'scan plan' defines the number of scan cycles and the interval between scans. The scan plans are executed in the order they were configured. The last scan plan will always run infinitely and thus defines only the interval between scans. The maximum number of scan plans supported by the device and the maximum number of iterations in a single scan plan are advertised to userspace so it can configure the scan plans appropriately. When scheduled scan results are received there is no way to know which scan plan is being currently executed, so there is no way to know when the next scan iteration will start. This is not a problem, however. The scan start timestamp is only used for flushing old scan results, and there is no difference between flushing all results received until the end of the previous iteration or the start of the current one, since no results will be received in between. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wl12xx/scan.c3
-rw-r--r--drivers/net/wireless/ti/wl18xx/scan.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c
index 7c355fff2c5e..ebed13af9852 100644
--- a/drivers/net/wireless/ti/wl12xx/scan.c
+++ b/drivers/net/wireless/ti/wl12xx/scan.c
@@ -350,7 +350,8 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
350 cfg->bss_type = SCAN_BSS_TYPE_ANY; 350 cfg->bss_type = SCAN_BSS_TYPE_ANY;
351 /* currently NL80211 supports only a single interval */ 351 /* currently NL80211 supports only a single interval */
352 for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++) 352 for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
353 cfg->intervals[i] = cpu_to_le32(req->interval); 353 cfg->intervals[i] = cpu_to_le32(req->scan_plans[0].interval *
354 MSEC_PER_SEC);
354 355
355 cfg->ssid_len = 0; 356 cfg->ssid_len = 0;
356 ret = wlcore_scan_sched_scan_ssid_list(wl, wlvif, req); 357 ret = wlcore_scan_sched_scan_ssid_list(wl, wlvif, req);
diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c
index c938c494c785..bc15aa2c3efa 100644
--- a/drivers/net/wireless/ti/wl18xx/scan.c
+++ b/drivers/net/wireless/ti/wl18xx/scan.c
@@ -228,13 +228,15 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
228 wl18xx_adjust_channels(cmd, cmd_channels); 228 wl18xx_adjust_channels(cmd, cmd_channels);
229 229
230 if (c->num_short_intervals && c->long_interval && 230 if (c->num_short_intervals && c->long_interval &&
231 c->long_interval > req->interval) { 231 c->long_interval > req->scan_plans[0].interval * MSEC_PER_SEC) {
232 cmd->short_cycles_msec = cpu_to_le16(req->interval); 232 cmd->short_cycles_msec =
233 cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
233 cmd->long_cycles_msec = cpu_to_le16(c->long_interval); 234 cmd->long_cycles_msec = cpu_to_le16(c->long_interval);
234 cmd->short_cycles_count = c->num_short_intervals; 235 cmd->short_cycles_count = c->num_short_intervals;
235 } else { 236 } else {
236 cmd->short_cycles_msec = 0; 237 cmd->short_cycles_msec = 0;
237 cmd->long_cycles_msec = cpu_to_le16(req->interval); 238 cmd->long_cycles_msec =
239 cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
238 cmd->short_cycles_count = 0; 240 cmd->short_cycles_count = 0;
239 } 241 }
240 wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d", 242 wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d",