aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorMax Stepanov <Max.Stepanov@intel.com>2016-09-05 14:32:58 (GMT)
committerJouni Malinen <j@w1.fi>2016-09-26 21:02:44 (GMT)
commitbe7ebd892ee7c47ff291de4e7802c14758f02a3d (patch)
tree5307eb3d515fd243ac5ea57a0e7afdd405c9c5d4 /wpa_supplicant/scan.c
parent8b7c5b894194f1ac1e852b77912b1204076bf3e1 (diff)
downloadhostap-be7ebd892ee7c47ff291de4e7802c14758f02a3d.zip
hostap-be7ebd892ee7c47ff291de4e7802c14758f02a3d.tar.gz
hostap-be7ebd892ee7c47ff291de4e7802c14758f02a3d.tar.bz2
wpa_supplicant: Cancel sched_scan on SELECT_NETWORK initiated scan
If a scheduled scan is running on select network command, cancel and reset it before kicking off a regular scan request. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 371c16a..24d6080 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2726,3 +2726,22 @@ fail:
wpa_printf(MSG_ERROR, "invalid scan plans list");
return -1;
}
+
+
+/**
+ * wpas_scan_reset_sched_scan - Reset sched_scan state
+ * @wpa_s: Pointer to wpa_supplicant data
+ *
+ * This function is used to cancel a running scheduled scan and to reset an
+ * internal scan state to continue with a regular scan on the following
+ * wpa_supplicant_req_scan() calls.
+ */
+void wpas_scan_reset_sched_scan(struct wpa_supplicant *wpa_s)
+{
+ wpa_s->normal_scans = 0;
+ if (wpa_s->sched_scanning) {
+ wpa_s->sched_scan_timed_out = 0;
+ wpa_s->prev_sched_ssid = NULL;
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+ }
+}