Decrease cross-threshold roam difficulty with bgscan_simple

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>
This commit is contained in:
Matthew Wang 2023-12-28 21:03:42 +00:00 committed by Jouni Malinen
parent 9aa82da229
commit 05474b34bf
3 changed files with 8 additions and 1 deletions

View file

@ -189,6 +189,7 @@ static void * bgscan_simple_init(struct wpa_supplicant *wpa_s,
data->scan_interval = data->short_interval; data->scan_interval = data->short_interval;
data->max_short_scans = data->long_interval / data->short_interval + 1; data->max_short_scans = data->long_interval / data->short_interval + 1;
if (data->signal_threshold) { if (data->signal_threshold) {
wpa_s->signal_threshold = data->signal_threshold;
/* Poll for signal info to set initial scan interval */ /* Poll for signal info to set initial scan interval */
struct wpa_signal_info siginfo; struct wpa_signal_info siginfo;
if (wpa_drv_signal_poll(wpa_s, &siginfo) == 0 && 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; struct bgscan_simple_data *data = priv;
eloop_cancel_timeout(bgscan_simple_timeout, data, NULL); 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); wpa_drv_signal_monitor(data->wpa_s, 0, 0);
}
os_free(data); os_free(data);
} }

View file

@ -2281,6 +2281,9 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
min_diff -= 2; min_diff -= 2;
if (to_6ghz) if (to_6ghz)
min_diff -= 2; 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; diff = sel_level - cur_level;
if (diff < min_diff) { if (diff < min_diff) {
wpa_dbg(wpa_s, MSG_DEBUG, wpa_dbg(wpa_s, MSG_DEBUG,

View file

@ -1193,6 +1193,7 @@ struct wpa_supplicant {
struct wpa_ssid *bgscan_ssid; struct wpa_ssid *bgscan_ssid;
const struct bgscan_ops *bgscan; const struct bgscan_ops *bgscan;
void *bgscan_priv; void *bgscan_priv;
int signal_threshold;
const struct autoscan_ops *autoscan; const struct autoscan_ops *autoscan;
struct wpa_driver_scan_params *autoscan_params; struct wpa_driver_scan_params *autoscan_params;