aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-09-05 14:32:59 (GMT)
committerJouni Malinen <j@w1.fi>2016-10-02 16:38:57 (GMT)
commit14f34a73031e2878101be473d8416f7c09d37833 (patch)
tree52bf5c2f6b7ad7944c1d00161dff5b7cb8671969 /wpa_supplicant/scan.c
parent1ac388633a3639d55ed9aaf91f6cd7863faba40d (diff)
downloadhostap-14f34a73031e2878101be473d8416f7c09d37833.zip
hostap-14f34a73031e2878101be473d8416f7c09d37833.tar.gz
hostap-14f34a73031e2878101be473d8416f7c09d37833.tar.bz2
Continue scanning if sched_scan stops unexpectedly
When scheduled scan stops without the interface request (for example, driver stopped it unexpectedly), start a regular scan to continue scanning for networks and avoid being left with no scan at all. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 60e7b68..5f84b21 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1256,6 +1256,8 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
if (max_sched_scan_ssids < 1 || wpa_s->conf->disable_scan_offload)
return -1;
+ wpa_s->sched_scan_stop_req = 0;
+
if (wpa_s->sched_scanning) {
wpa_dbg(wpa_s, MSG_DEBUG, "Already sched scanning");
return 0;
@@ -1554,6 +1556,9 @@ void wpa_supplicant_cancel_sched_scan(struct wpa_supplicant *wpa_s)
if (!wpa_s->sched_scanning)
return;
+ if (wpa_s->sched_scanning)
+ wpa_s->sched_scan_stop_req = 1;
+
wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling sched scan");
eloop_cancel_timeout(wpa_supplicant_sched_scan_timeout, wpa_s, NULL);
wpa_supplicant_stop_sched_scan(wpa_s);
@@ -2530,6 +2535,7 @@ int wpas_stop_pno(struct wpa_supplicant *wpa_s)
return 0;
ret = wpa_supplicant_stop_sched_scan(wpa_s);
+ wpa_s->sched_scan_stop_req = 1;
wpa_s->pno = 0;
wpa_s->pno_sched_pending = 0;