Some drivers (e.g. Marvell WiFi) don't report avg_beacon_signal, but it's still useful to poll for the signal again when a roaming decision needs to be made. Use si.avg_signal when si.avg_beacon_signal is not available. Signed-off-by: Matthew Wang <matthewmwang@xxxxxxxxxxxx> --- wpa_supplicant/events.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index cf0aa2b57..c87011297 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1667,7 +1667,7 @@ static void wpa_supplicant_rsn_preauth_scan_results( static int wpas_get_snr_signal_info(const struct wpa_signal_info *si) { - int noise = IS_5GHZ(si->frequency) ? + int noise = IS_5GHZ(frequency) ? DEFAULT_NOISE_FLOOR_5GHZ : DEFAULT_NOISE_FLOOR_2GHZ; @@ -1676,7 +1676,7 @@ static int wpas_get_snr_signal_info(const struct wpa_signal_info *si) * the current noise measurement (average vs. snapshot), * so use the default values instead. */ - return si->avg_beacon_signal - noise; + return avg_signal - noise; } @@ -1772,10 +1772,10 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s, * get fresh information about our own AP, do that. */ if (!wpa_drv_signal_poll(wpa_s, &si)) { - if (si.avg_beacon_signal) { - int snr = wpas_get_snr_signal_info(&si); + if (si.avg_beacon_signal || si.avg_signal) { + cur_level = si.avg_beacon_signal ? si.avg_beacon_signal : si.avg_signal; + int snr = wpas_get_snr_signal_info(si.frequency, cur_level); - cur_level = si.avg_beacon_signal; cur_est = wpas_get_est_throughput_from_bss_snr(wpa_s, current_bss, snr); -- 2.24.0.393.g34dc348eaf-goog _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap