[PATCH 1/1] Apply bias towards 6GHz in roaming

Kaidong Wang kaidong at chromium.org
Thu Feb 2 18:05:40 PST 2023


wpa_supplicant_need_to_roam_within_ess applies bias to the minimum
difference of the signal level required to roam if the roam is from
2.4GHz to higher band, but doesn't apply bias if the roam is from a
lower band to 6GHz. Add bias towards 6GHz, as 6GHz networks usually
provide higher throughput.

Signed-off-by: Kaidong Wang <kaidong at chromium.org>
---
 wpa_supplicant/events.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 64b2bcd1d..4d2a30b0d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1969,7 +1969,7 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
 					   struct wpa_bss *selected)
 {
 	int min_diff, diff;
-	int to_5ghz;
+	int to_5ghz, to_6ghz;
 	int cur_level;
 	unsigned int cur_est, sel_est;
 	struct wpa_signal_info si;
@@ -2036,8 +2036,9 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
 	}
 
 	to_5ghz = selected->freq > 4000 && current_bss->freq < 4000;
+	to_6ghz = is_6ghz_freq(selected->freq) && !is_6ghz_freq(current_bss->freq);
 
-	if (cur_level < 0 && cur_level > selected->level + to_5ghz * 2 &&
+	if (cur_level < 0 && cur_level > selected->level + to_5ghz * 2 + to_6ghz * 2 &&
 	    sel_est < cur_est * 1.2) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better "
 			"signal level");
@@ -2089,6 +2090,8 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
 
 	if (to_5ghz)
 		min_diff -= 2;
+	if (to_6ghz)
+		min_diff -= 2;
 	diff = selected->level - cur_level;
 	if (diff < min_diff) {
 		wpa_dbg(wpa_s, MSG_DEBUG,
-- 
2.39.1.519.gcb327c4b5f-goog




More information about the Hostap mailing list