aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-04-24 05:45:35 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-04 18:27:06 (GMT)
commit57f93d68894f7d5ae58cd1b592bb56a78f5fb5ca (patch)
tree80cf3d36dfd1adaca9b788241a1f24505a852ed0 /wpa_supplicant
parenta1fce3911f4b04e67b4ecd9f91af8e5e0b8b72c1 (diff)
downloadhostap-57f93d68894f7d5ae58cd1b592bb56a78f5fb5ca.zip
hostap-57f93d68894f7d5ae58cd1b592bb56a78f5fb5ca.tar.gz
hostap-57f93d68894f7d5ae58cd1b592bb56a78f5fb5ca.tar.bz2
Defer scans while PNO is in progress instead of skipping them
Skipping the scan altogether will hurt auto-reconnect. Also move the PNO check down since the scan might be canceled for other reasons before we defer it. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/scan.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index dafd8b5..272e633 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -714,11 +714,6 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
size_t max_ssids;
int connect_without_scan = 0;
- if (wpa_s->pno || wpa_s->pno_sched_pending) {
- wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - PNO is in progress");
- return;
- }
-
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - interface disabled");
return;
@@ -779,6 +774,21 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
return;
}
+ /*
+ * Don't cancel the scan based on ongoing PNO; defer it. Some scans are
+ * used for changing modes inside wpa_supplicant (roaming,
+ * auto-reconnect, etc). Discarding the scan might hurt these processes.
+ * The normal use case for PNO is to suspend the host immediately after
+ * starting PNO, so the periodic 100 ms attempts to run the scan do not
+ * normally happen in practice multiple times, i.e., this is simply
+ * restarting scanning once the host is woken up and PNO stopped.
+ */
+ if (wpa_s->pno || wpa_s->pno_sched_pending) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Defer scan - PNO is in progress");
+ wpa_supplicant_req_scan(wpa_s, 0, 100000);
+ return;
+ }
+
if (wpa_s->conf->ap_scan == 2)
max_ssids = 1;
else {