aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPurushottam Kushwaha <pkushwah@qti.qualcomm.com>2017-03-06 07:53:10 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-09 13:44:26 (GMT)
commitd0330d57f3d320719c1f8fc8478a6dc5ef613946 (patch)
tree4bb6f7226f56455bfb427c961ef19a703bfae540 /src
parentb696f791ac011a7d9bed73db11c16199b56aa2b1 (diff)
downloadhostap-d0330d57f3d320719c1f8fc8478a6dc5ef613946.zip
hostap-d0330d57f3d320719c1f8fc8478a6dc5ef613946.tar.gz
hostap-d0330d57f3d320719c1f8fc8478a6dc5ef613946.tar.bz2
nl80211: Add option to delay start of schedule scan plans
The userspace may want to delay the the first scheduled scan. This enhances sched_scan to add initial delay (in seconds) before starting first scan cycle. The driver may optionally choose to ignore this parameter and start immediately (or at any other time). This uses NL80211_ATTR_SCHED_SCAN_DELAY to add this via user global configurable option: sched_scan_start_delay. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h9
-rw-r--r--src/drivers/driver_nl80211_scan.c5
2 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 1d2dff9..9018c08 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -483,6 +483,15 @@ struct wpa_driver_scan_params {
unsigned int sched_scan_plans_num;
/**
+ * sched_scan_start_delay - Delay to use before starting the first scan
+ *
+ * Delay (in seconds) before scheduling first scan plan cycle. The
+ * driver may ignore this parameter and start immediately (or at any
+ * other time), if this feature is not supported.
+ */
+ u32 sched_scan_start_delay;
+
+ /**
* bssid - Specific BSSID to scan for
*
* This optional parameter can be used to replace the default wildcard
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 4417721..10517e4 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -595,6 +595,11 @@ int wpa_driver_nl80211_sched_scan(void *priv,
}
}
+ if (params->sched_scan_start_delay &&
+ nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_DELAY,
+ params->sched_scan_start_delay))
+ goto fail;
+
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
/* TODO: if we get an error here, we should fall back to normal scan */