Date: Tue, 19 May 2026 00:43:38 +0000 From: Bjoern A. Zeeb <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 7e74f27a5af8 - stable/15 - wtap: use typed rssi and noise floor values Message-ID: <6a0bb23a.26aa1.3b95cf72@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7e74f27a5af86c0e2ff23f8ca52a226b8907865c commit 7e74f27a5af86c0e2ff23f8ca52a226b8907865c Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2026-05-13 21:14:39 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2026-05-19 00:43:15 +0000 wtap: use typed rssi and noise floor values Adjust the rssi and nf arguments to typed int8_t and adjust the maths for rssi to be consistant with what net80211 expects. Sponsored by: The FreeBSD Foundation Reviewed by: lwhsu, adrian Differential Revision: https://reviews.freebsd.org/D57020 (cherry picked from commit d201e4e8491901d1de6bcaeb581a0bf958bf86f2) --- sys/dev/wtap/if_wtap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index dd332c538c8f..376b63e38f2b 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -495,6 +495,7 @@ wtap_rx_proc(void *arg, int npending) struct mbuf *m; struct ieee80211_node *ni; struct wtap_buf *bf; + int8_t rssi, nf; #if 0 DWTAP_PRINTF("%s\n", __func__); @@ -528,6 +529,15 @@ wtap_rx_proc(void *arg, int npending) ieee80211_dump_pkt(ic, mtod(m, caddr_t), 0,0,0); #endif + /* + * Use arbitrary but sane values, and do the correct conversion + * for net80211 using 0.5 dBm values relative to the noise floor. + */ + nf = -95; + rssi = 42; + rssi -= nf; + rssi *= 2; + /* * Locate the node for sender, track state, and then * pass the (referenced) node up to the 802.11 layer @@ -540,10 +550,10 @@ wtap_rx_proc(void *arg, int npending) /* * Sending station is known, dispatch directly. */ - ieee80211_input(ni, m, 1<<7, 10); + ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else { - ieee80211_input_all(ic, m, 1<<7, 10); + ieee80211_input_all(ic, m, rssi, nf); } /* The mbufs are freed by the Net80211 stack */home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a0bb23a.26aa1.3b95cf72>
