[PATCH] Rescan on regulatory domain change

Nicolas Norvez norvez at chromium.org
Wed Dec 22 18:33:58 PST 2021


On boot or when resuming after suspending, radios use the lowest common
denominator across all geographies to know which channels/bands to scan.
Because of that, the first scan does not detects APs that are present in
bands that are not allowed everywhere, like the 6GHz band.

With this patch, supplicant triggers a new scan when the regulatory
domain has changed to include channels and bands that were not enabled
previously. It allows the station to connect to WiFi 6E APs faster on
resume in case the only known APs are in the 6GHz band. Without the
patch the station doesn't find any known APs after the first scan, then
it has to wait longer for the next scheduled scan.
If the first scan does contain known APs, the second scan is canceled
either way.

Signed-off-by: Nicolas Norvez <norvez at chromium.org>
---
 wpa_supplicant/events.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index f55e1846e..59cfe638b 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4331,6 +4331,14 @@ void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
 			wpa_dbg(ifs, MSG_DEBUG,
 				"Channel list changed - restart sched_scan");
 			wpas_scan_restart_sched_scan(ifs);
+		} else {
+			/*
+			 * Look for APs in bands/channels (e.g. 6GHz) that were
+			 * previously disabled.
+			 */
+			wpa_dbg(ifs, MSG_DEBUG,
+				"Channel list changed - restart scan");
+			wpa_supplicant_req_new_scan(ifs, 0, 0);
 		}
 	}
 
-- 
2.34.1.448.ga2b2bfdf31-goog




More information about the Hostap mailing list