FROMLIST: driver_nl80211: report invalid signal and noise when info is unavailable
When the driver sends a CQM RSSI threshold event, wpa_supplicant
queries the driver for the signal and noise values. However, it
is possible that by that time the station has already disconnected
from the AP, so these values are no longer valid. In this case,
indicate that these values are invalid by setting them to
WPA_INVALID_NOISE.
Previously a value of 0 would be reported, which may be confusing as
this is a valid value.
Since nl80211_get_link_signal() and nl80211_get_link_noise() already
set invalid values for a case of failure, just use the value set by
these functions even if they fail.
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
(am from https://patchwork.ozlabs.org/patch/1392696)
(also found at
https://marc.info/?i=20201103075416.14480-1-andrei.otcheretianski@intel.com)
BUG=b:145676492
TEST=emerge-hatch wpa_supplicant-2_9 and 'cros deploy' to hatch
TEST=run powerd_dbus_suspend --suspend_for_sec=5 a few times
TEST=localhost ~ # grep "signal=" /var/log/net.log
<snip>
wpa_supplicant[894]: wlan0: CTRL-EVENT-SIGNAL-CHANGE above=0
signal=-9999 noise=9999 txrate=0
Change-Id: Iaf985d94af7a0a1f43c86d93f9757cb8bfb8c218
Signed-off-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/hostap/+/2432877
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
2 files changed