> -----Message d'origine----- > De : Johannes Berg [mailto:johan...@sipsolutions.net] > Envoyé : samedi 10 février 2018 22:09 > À : Jean Pierre TOSONI; email@example.com > Objet : Re: mac80211 scan results, signal value not reliable > > On Thu, 2018-02-08 at 09:49 +0000, Jean Pierre TOSONI wrote: > > > In net/mac80211/scan.c, function ieee80211_bss_info_update() > passes > > incoming scan results to the generic wireless layer, with > indication > > of the received signal level, but no indication of signal > validity. > > Well, there is an indication of validity, if the value is 0 then > it's invalid. > > > Before ieee80211_bss_info_update() is called, rx_status->flag can > be > > set to RX_FLAG_NO_SIGNAL_VAL by the ath9k driver and it won't be > taken > > into account in the wireless layer. > > Even later in ieee80211_bss_info_update(), rx_status->flag can > also be > > set to RX_FLAG_NO_SIGNAL_VAL, and the wireless layer won't be > aware of this. > > However, it looks like you're right and ieee80211_bss_info_update() > doesn't take the flag into account. Bit strange that we even have > the flag I guess, since we treat 0 as an invalid value in various > places, being too high power to realistically receive anyway.
The problem is that 0 is invalid as a SIGNAL_DBM value but this is dubious for a SIGNAL_UNSPEC value which appears to be still in use in a couple of drivers. Sure that using 0 will solve my own problem. > > > I stumbled on this because, when using ath9k (WLE350NX) to do a > > passive scan off-channel, the beacons received in a 30ms window > after > > channel change show a signal level +10dB above the real value. So > I > > was looking for a way to tell the above layers that the signal is > > invalid. RX_FLAG_NO_SIGNAL_VAL seems to fit, but is not conveyed > up to iw or wpa_supplicant. > > > > In fact I did not find any such thing in net/wireless/nl80211.c, > > function nl80211_send_bss(). > > > > Any suggestion? Did I miss something? > > Want to send a patch? There seem to be a few more places as well, I am working on a 3.18 kernel; so I can either make the patch from an old compat-wireless, or make the patch from your last tree but I cannot test it; are you interested anyways? > e.g. > in rx.c for cfg80211_report_obss_beacon() and cfg80211_rx_mgmt(). There is also mlme.c, the ifmgd->ave_beacon_signal should not be updated with an invalid signal; and in the last tree, the ibss join passes an uninitialized signal value to cfg80211_inform_bss_frame_data(). > > johannes