Index | Thread | Search

From:
Peter Hessler <phessler@theapt.org>
Subject:
Re: qwx(4): RSSI oscillation fix
To:
Greg Steuck <gnezdo@openbsd.org>
Cc:
tech@openbsd.org, stsp@openbsd.org
Date:
Thu, 29 Jan 2026 16:08:53 +0100

Download raw body.

Thread
On 2026 Jan 28 (Wed) at 23:11:16 -0800 (-0800), Greg Steuck wrote:
:Hi,
:
:qwx(4) only extracts RSSI from management frames (qwx_mgmt_rx_event), 
:not data frames (qwx_dp_rx_h_rate is TODO). This causes ifconfig to 
:oscillate between 0dBm (after data frames) and actual values (after 
:beacons) on a certain school network.
:
:ieee80211_inputm() unconditionally updates ni_rssi from rxi_rssi at 
:line 427, overwriting good beacon RSSI with 0 from data frames.
:
:Fix: skip update when rxi_rssi == 0 (invalid for WiFi, precedent exists 
:at line 2023).
:
:diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
:index be6bf54f576..1e108c440e8 100644
:--- a/sys/net80211/ieee80211_input.c
:+++ b/sys/net80211/ieee80211_input.c
:@@ -424,7 +424,13 @@ ieee80211_inputm(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
: 		*orxseq = nrxseq;
: 	}
: 	if (ic->ic_state > IEEE80211_S_SCAN) {
:-		ni->ni_rssi = rxi->rxi_rssi;
:+		/*
:+		 * Only update RSSI if driver provided a valid value.
:+		 */
:+		if (rxi->rxi_rssi != 0)
:+			ni->ni_rssi = rxi->rxi_rssi;
: 		ni->ni_rstamp = rxi->rxi_tstamp;
: 		ni->ni_inact = 0;
:
:Tested on qwx0, eliminates oscillation. 0dBm impossible for WiFi signals,
:safe sentinel.
:
:ok?
:

that's been irritating me for a while, thanks for the diff!

OK


-- 
Make it myself?  But I'm a physical organic chemist!