Page MenuHomeFreeBSD

iwx: correct rssi calculations and reporting
AcceptedPublic

Authored by bz on Jun 19 2025, 1:20 AM.
Tags
None
Referenced Files
F136845838: D50929.id.diff
Thu, Nov 20, 1:23 AM
F136845707: D50929.id157293.diff
Thu, Nov 20, 1:22 AM
F136845269: D50929.diff
Thu, Nov 20, 1:16 AM
Unknown Object (File)
Thu, Oct 30, 2:11 PM
Unknown Object (File)
Mon, Oct 27, 11:10 AM
Unknown Object (File)
Wed, Oct 22, 2:27 AM
Unknown Object (File)
Wed, Oct 22, 1:36 AM
Unknown Object (File)
Wed, Oct 22, 1:35 AM
Subscribers

Details

Reviewers
thj
Group Reviewers
wireless
Summary

Overall for the moment when we have to hard code a noise floor use -127.

iwx_rxmq_get_signal_strength(): return a signed value.
iwx_get_noise(): return an nunsigned value and correct maths; seems
c&p from iwm(4) which has this code compiled out in favor of a static
-96 nf.
in iwx_rx_mpdu_mq(): remove the "signal level normilization"; make the
local rssi an int8_t which is enough; if we have a signal normalize it
to the net80211 internal representation; if we have no value report the
noise floor which probably is better than conditionally reprting the
ressi and conditionally setting IEEE80211_R_RSSI.
Make sc_noise an int8_t as it is enough and initialize it during attach
as it will take a few beacons until we get a IWX_STATISTICS_NOTIFICATION
and have any value to use instead. This will get the reports of the
first round of scanning slightly more sensible.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64971
Build 61854: arc lint + arc unit

Event Timeline

bz requested review of this revision.Jun 19 2025, 1:20 AM
This revision is now accepted and ready to land.Jun 19 2025, 11:34 AM

hm, i wonder why iwx used -107 as its "nothing present" value. I wonder what iwlwifi is doing too.

like, -107dBm is a very low thermal noise floor; that's like for a 5MHz wide channel. (The noise floor gets higher as the channel width increases.)
But it's a damn sight better than -127dBm. :-)

also in my poking I found that I'm not seeing any empty airtime RSSI (it's always 0) so it was setting sc->sc_noise to -127. so we still need to clamp that too to a default noise floor.

Also, a lot of net80211 code currently expects nf and rssi to be passed in as parameters into functions, and that deserves to be cleaned up.

hm, i wonder why iwx used -107 as its "nothing present" value. I wonder what iwlwifi is doing too.

like, -107dBm is a very low thermal noise floor; that's like for a 5MHz wide channel. (The noise floor gets higher as the channel width increases.)
But it's a damn sight better than -127dBm. :-)

There is none. You get a signal value. All the values we ever used in iwm/... are arbitrary. I think normally we used to us -96.

In D50929#1228066, @bz wrote:

hm, i wonder why iwx used -107 as its "nothing present" value. I wonder what iwlwifi is doing too.

like, -107dBm is a very low thermal noise floor; that's like for a 5MHz wide channel. (The noise floor gets higher as the channel width increases.)
But it's a damn sight better than -127dBm. :-)

There is none. You get a signal value. All the values we ever used in iwm/... are arbitrary. I think normally we used to us -96.

-96 comes from ath(4), like a lot of net80211 and wifi history :-)

also in my poking I found that I'm not seeing any empty airtime RSSI (it's always 0) so it was setting sc->sc_noise to -127. so we still need to clamp that too to a default noise floor.

It's been a long time since I did this for iwx to compare to LinuxKPI; see the other open stack change which needs more cleanup and dealing as I want to break the ioctls only exactly once and the way this is done now won't help. But I believe once you are assoc you will see them.

Also, a lot of net80211 code currently expects nf and rssi to be passed in as parameters into functions, and that deserves to be cleaned up.

YES