Make it a bit easier to roam from 2.4 GHz to 5 GHz within ESS
authorJouni Malinen <j@w1.fi>
Fri, 25 Mar 2016 09:53:59 +0000 (11:53 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 25 Mar 2016 10:12:48 +0000 (12:12 +0200)
The initial connection to an ESS was already explicitly increasing the
likelihood of picking a 5 GHz BSS. While the throughput estimation is
likely to do same for the roaming decision, it might be possible that
that does not cover all cases. Add couple of dB extra preference for 5
GHz in case the roaming decision falls back to comparing signal levels.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/events.c

index 1483ad4..3c3f626 100644 (file)
@@ -1346,6 +1346,7 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
        struct wpa_bss *current_bss = NULL;
 #ifndef CONFIG_NO_ROAMING
        int min_diff;
+       int to_5ghz;
 #endif /* CONFIG_NO_ROAMING */
 
        if (wpa_s->reassociate)
@@ -1401,7 +1402,10 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
                return 1;
        }
 
-       if (current_bss->level < 0 && current_bss->level > selected->level) {
+       to_5ghz = selected->freq > 4000 && current_bss->freq < 4000;
+
+       if (current_bss->level < 0 &&
+           current_bss->level > selected->level + to_5ghz * 2) {
                wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better "
                        "signal level");
                return 0;
@@ -1420,6 +1424,13 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
                else
                        min_diff = 5;
        }
+       if (to_5ghz) {
+               /* Make it easier to move to 5 GHz band */
+               if (min_diff > 2)
+                       min_diff -= 2;
+               else
+                       min_diff = 0;
+       }
        if (abs(current_bss->level - selected->level) < min_diff) {
                wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - too small difference "
                        "in signal level");