Apply bias towards 6 GHz in roaming

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.4
GHz to higher band, but doesn't apply bias if the roam is from a lower
band to 6 GHz. Add bias towards 6 GHz, as 6 GHz networks usually provide
higher throughput.

Signed-off-by: Kaidong Wang <kaidong@chromium.org>
This commit is contained in:
Kaidong Wang 2023-02-03 02:05:40 +00:00 committed by Jouni Malinen
parent 217d5e4796
commit 1ffc7d1c65

View file

@ -1971,7 +1971,7 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
struct wpa_bss *selected) struct wpa_bss *selected)
{ {
int min_diff, diff; int min_diff, diff;
int to_5ghz; int to_5ghz, to_6ghz;
int cur_level; int cur_level;
unsigned int cur_est, sel_est; unsigned int cur_est, sel_est;
struct wpa_signal_info si; struct wpa_signal_info si;
@ -2038,8 +2038,11 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
} }
to_5ghz = selected->freq > 4000 && current_bss->freq < 4000; 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) { sel_est < cur_est * 1.2) {
wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better " wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better "
"signal level"); "signal level");
@ -2091,6 +2094,8 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
if (to_5ghz) if (to_5ghz)
min_diff -= 2; min_diff -= 2;
if (to_6ghz)
min_diff -= 2;
diff = selected->level - cur_level; diff = selected->level - cur_level;
if (diff < min_diff) { if (diff < min_diff) {
wpa_dbg(wpa_s, MSG_DEBUG, wpa_dbg(wpa_s, MSG_DEBUG,