]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Apply bias towards 6 GHz in roaming
authorKaidong Wang <kaidong@chromium.org>
Fri, 3 Feb 2023 02:05:40 +0000 (02:05 +0000)
committerJouni Malinen <j@w1.fi>
Mon, 20 Feb 2023 21:52:18 +0000 (23:52 +0200)
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>
wpa_supplicant/events.c

index 146191d03429b2a2d4aa415505cc12958b9acfec..edc392e737913267e6ba3ee5246f80d53ab2a7b3 100644 (file)
@@ -1971,7 +1971,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;
@@ -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_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");
@@ -2091,6 +2094,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,