Use signal_poll noise information for roaming, if available

Using average signal strength from the driver and hardcoded noise floor
does not look like an ideal design since there can be significant
differences in the driver-reported noise floor values. Furthermore, even
though the current noise floor is a snapshot from the driver, it is
common for drivers to use a noise floor value from a longer calibration
step and that should not prevent the driver provided value from being
used. This makes the comparisons of the signal strengths between the
current AP (signal_poll) and other APs (scan) more accurate.

As an example, test runs in home environment showed 5 dB difference
between the driver reported noise floor and the hardcoded value and this
could result in significant differences in estimated throughput
calculation.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-01-01 13:38:11 +02:00
parent f97baef254
commit f4f7600adf
1 changed files with 6 additions and 11 deletions

View File

@ -1672,17 +1672,11 @@ static void wpa_supplicant_rsn_preauth_scan_results(
}
static int wpas_get_snr_signal_info(u32 frequency, int avg_signal)
static int wpas_get_snr_signal_info(u32 frequency, int avg_signal, int noise)
{
int noise = IS_5GHZ(frequency) ?
DEFAULT_NOISE_FLOOR_5GHZ :
DEFAULT_NOISE_FLOOR_2GHZ;
/*
* Since we take the average beacon signal, we can't use
* the current noise measurement (average vs. snapshot),
* so use the default values instead.
*/
if (noise == WPA_INVALID_NOISE)
noise = IS_5GHZ(frequency) ? DEFAULT_NOISE_FLOOR_5GHZ :
DEFAULT_NOISE_FLOOR_2GHZ;
return avg_signal - noise;
}
@ -1784,7 +1778,8 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
cur_level = si.avg_beacon_signal ? si.avg_beacon_signal :
si.avg_signal;
snr = wpas_get_snr_signal_info(si.frequency, cur_level);
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,