]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Decrease cross-threshold roam difficulty with bgscan_simple
authorMatthew Wang <matthewmwang@chromium.org>
Thu, 28 Dec 2023 21:03:42 +0000 (21:03 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 14 Jan 2024 18:03:31 +0000 (20:03 +0200)
Decrease the roam difficulty when roaming across the short background
scan threshold (i.e., when the current BSS RSSI is below the threshold
and the selected BSS RSSI is above the threshold). This tends to happen
in normal roaming scenarios when moving from the domain of one AP to
the domain of another.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
wpa_supplicant/bgscan_simple.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index cac3049e3e67b23f914a2fdb3eda38529b076e8d..a90cf86e5eaca4f40c0c569941b69ed9fb95c256 100644 (file)
@@ -189,6 +189,7 @@ static void * bgscan_simple_init(struct wpa_supplicant *wpa_s,
        data->scan_interval = data->short_interval;
        data->max_short_scans = data->long_interval / data->short_interval + 1;
        if (data->signal_threshold) {
+               wpa_s->signal_threshold = data->signal_threshold;
                /* Poll for signal info to set initial scan interval */
                struct wpa_signal_info siginfo;
                if (wpa_drv_signal_poll(wpa_s, &siginfo) == 0 &&
@@ -216,8 +217,10 @@ static void bgscan_simple_deinit(void *priv)
 {
        struct bgscan_simple_data *data = priv;
        eloop_cancel_timeout(bgscan_simple_timeout, data, NULL);
-       if (data->signal_threshold)
+       if (data->signal_threshold) {
+               data->wpa_s->signal_threshold = 0;
                wpa_drv_signal_monitor(data->wpa_s, 0, 0);
+       }
        os_free(data);
 }
 
index 6dddcf116205787f40cb5dfe715fbfde44e71620..ee39a6570de5fcae840a80460f20cc34327a3759 100644 (file)
@@ -2281,6 +2281,9 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
                min_diff -= 2;
        if (to_6ghz)
                min_diff -= 2;
+       if (wpa_s->signal_threshold && cur_level <= wpa_s->signal_threshold &&
+           sel_level > wpa_s->signal_threshold)
+               min_diff -= 2;
        diff = sel_level - cur_level;
        if (diff < min_diff) {
                wpa_dbg(wpa_s, MSG_DEBUG,
index 3d4d21f194c84100c4426d5ad9fa57dcef987711..36e682f3e18352aa5132c623f5f47f1dafe745b3 100644 (file)
@@ -1193,6 +1193,7 @@ struct wpa_supplicant {
        struct wpa_ssid *bgscan_ssid;
        const struct bgscan_ops *bgscan;
        void *bgscan_priv;
+       int signal_threshold;
 
        const struct autoscan_ops *autoscan;
        struct wpa_driver_scan_params *autoscan_params;