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>
This commit is contained in:
Arik Nemtsov 2014-04-24 08:45:35 +03:00 committed by Jouni Malinen
parent a1fce3911f
commit 57f93d6889

View file

@ -714,11 +714,6 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
size_t max_ssids; size_t max_ssids;
int connect_without_scan = 0; 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) { if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - interface disabled"); wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - interface disabled");
return; return;
@ -779,6 +774,21 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
return; 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) if (wpa_s->conf->ap_scan == 2)
max_ssids = 1; max_ssids = 1;
else { else {