diff mbox series

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

Message ID 20230203020540.3822980-1-kaidong@chromium.org
State Accepted
Headers show
Series [1/1] Apply bias towards 6GHz in roaming | expand

Commit Message

Kaidong Wang Feb. 3, 2023, 2:05 a.m. UTC
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@chromium.org>
---
 wpa_supplicant/events.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Feb. 20, 2023, 10:51 p.m. UTC | #1
On Fri, Feb 03, 2023 at 02:05:40AM +0000, Kaidong Wang wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

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,