Skip roaming based on signal level difference if current SNR is good

If the current SNR with the associated BSS is sufficiently good (better
than GREAT_SNR = 25), there is limited benefit from moving to another
BSS even if that BSS were to have a higher signal level. As such, skip
roaming based on the signal level difference between the selected BSS
from scan results and the current BSS for such cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-01-01 16:56:40 +02:00
parent cc7f85ca72
commit 9fafefb9e5

View file

@ -1704,6 +1704,7 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
int cur_level;
unsigned int cur_est, sel_est;
struct wpa_signal_info si;
int cur_snr = 0;
#endif /* CONFIG_NO_ROAMING */
if (wpa_s->reassociate)
@ -1774,19 +1775,17 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
*/
if (wpa_drv_signal_poll(wpa_s, &si) == 0 &&
(si.avg_beacon_signal || si.avg_signal)) {
int snr;
cur_level = si.avg_beacon_signal ? si.avg_beacon_signal :
si.avg_signal;
snr = wpas_get_snr_signal_info(si.frequency, cur_level,
si.current_noise);
cur_snr = wpas_get_snr_signal_info(si.frequency, cur_level,
si.current_noise);
cur_est = wpas_get_est_throughput_from_bss_snr(wpa_s,
current_bss,
snr);
cur_snr);
wpa_dbg(wpa_s, MSG_DEBUG,
"Using signal poll values for the current BSS: level=%d snr=%d est_throughput=%u",
cur_level, snr, cur_est);
cur_level, cur_snr, cur_est);
}
if (selected->est_throughput > cur_est + 5000) {
@ -1809,6 +1808,13 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
return 0;
}
if (cur_snr > GREAT_SNR) {
wpa_dbg(wpa_s, MSG_DEBUG,
"Skip roam - Current BSS has good SNR (%u > %u)",
cur_snr, GREAT_SNR);
return 0;
}
sel_est = selected->est_throughput;
min_diff = 2;
if (cur_level < 0) {