[RFC 2/3] scan: Make scan-on-channel and min-scan-gap work more often.

greearb at candelatech.com greearb at candelatech.com
Tue May 13 01:27:51 EDT 2014


From: Ben Greear <greearb at candelatech.com>

Optimizing this breaks ath10k though, so keep it disabled on
when system is not configured for concurrent connections, even
though this logic should only increase the speed at which we can
connect, not actually do concurrent connections.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 wpa_supplicant/events.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0a1d50d..4f95acc 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1341,17 +1341,6 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 
 	os_get_reltime(&t);
 	wpa_s->last_scan_rx_sec = t.sec;
-	/* Now, *if* we have (another) scan scheduled, and a min-scan-gap
-	 * configured, make sure it happens after the minimum time.  Since
-	 * one STA's scan results can be propagated to other STA on the
-	 * same radio, this is actually a common case.
-	 */
-	if (wpa_s->conf->min_scan_gap &&
-	    eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL)) {
-		/* Min gap will be applied as needed */
-		wpa_dbg(wpa_s, MSG_DEBUG, "Re-requesting scan to apply min-gap");
-		wpa_supplicant_req_scan(wpa_s, 1, 0);
-	}
 
 	wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available (own=%u ext=%u)",
 		wpa_s->own_scan_running, wpa_s->external_scan_running);
@@ -1367,6 +1356,25 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 
 	wpas_notify_scan_done(wpa_s, 1);
 
+	/* Now, *if* we have (another) scan scheduled, and a min-scan-gap
+	 * configured, make sure it happens after the minimum time.  Since
+	 * one STA's scan results can be propagated to other STA on the
+	 * same radio, this is actually a common case.
+	 */
+	if (wpa_s->conf->min_scan_gap &&
+	    eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL)) {
+		/* Min gap will be applied as needed */
+		wpa_dbg(wpa_s, MSG_DEBUG, "Re-requesting scan to apply min-gap/scan-on-freq");
+		/* To temporarily work around ath10k bug, only cancel existing
+		 * if we are configured to allow concurrent associations.
+		 */
+		if (wpa_s->conf->concurrent_assoc_ok) {
+			/* Cancel any existing scan request */
+			wpa_supplicant_cancel_scan(wpa_s);
+		}
+		wpa_supplicant_req_scan(wpa_s, 1, 0);
+	}
+
 	if (!wpa_s->own_scan_running && wpa_s->external_scan_running) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "Do not use results from externally requested scan operation for network selection");
 		wpa_scan_results_free(scan_res);
-- 
1.7.3.4



More information about the HostAP mailing list