From 022c2f963b43baa3fb3f71839c2ff601d0e86424 Mon Sep 17 00:00:00 2001 From: Eyal Shapira Date: Sun, 28 Oct 2012 18:18:06 +0200 Subject: Avoid normal scans before sched scan if max_scan_ssids=1 (UPSTREAM) In the case of max_scan_ssids=1 we may fallback to normal scan if there's a single scan_ssid network. However the normal scan can't add a wildcard SSID to the ssid list as it's limited to a single entry. This delays getting broadcast scan results. Always prefer to do a sched scan in such a case. Signed-off-by: Eyal Shapira --- wpa_supplicant/scan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 66fd60d..e50dcfc 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -888,6 +888,7 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) need_ssids++; if (wpa_s->normal_scans < 3 && + wpa_s->max_scan_ssids > 1 && (need_ssids <= wpa_s->max_scan_ssids || wpa_s->max_scan_ssids >= (int) max_sched_scan_ssids)) { /* @@ -896,6 +897,10 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) * user space sleep more. We do this only if the normal scan * has functionality that is suitable for this or if the * sched_scan does not have better support for multiple SSIDs. + * max_scan_ssids=1 is a special case where we'd like to avoid + * using normal scan as wpa_supplicant_scan handles this case + * differently and doesn't add a wildcard SSID so broadcast scan + * results would be delayed. */ wpa_dbg(wpa_s, MSG_DEBUG, "Use normal scan instead of " "sched_scan for initial scans (normal_scans=%d)", -- cgit v1.1