From b55aca4672f0cf683bade290e51364e104f94c7e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 17 Apr 2012 16:51:09 +0300 Subject: [PATCH] Fix sched_scan for max-num-of-scan_ssid=1 networks When the network configuration includes exactly the number of scan_ssid=1 networks as the driver supports for scan_sched and no networks need wildcard SSID scan, there is no need to use sched_scan timeout. Check this condition and optimize this case to avoid the extra sched_scan start/stop operations. Signed-hostap: Jouni Malinen --- wpa_supplicant/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index ab11f7f6a..4fd129ab5 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -877,6 +877,10 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) params.num_ssids++; if (params.num_ssids >= max_sched_scan_ssids) { wpa_s->prev_sched_ssid = ssid; + do { + ssid = ssid->next; + } while (ssid && + (ssid->disabled || !ssid->scan_ssid)); break; } }