mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 06:14:27 +00:00
Fix the RSSI calculation.
This commit is contained in:
parent
b584d2b3f4
commit
d718126e58
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252405
|
@ -80,6 +80,7 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debug, CTLFLAG_RW, &urtwn_debug, 0,
|
|||
"Debug level");
|
||||
#endif
|
||||
|
||||
#define URTWN_RSSI((r)) (r) - 110
|
||||
#define IEEE80211_HAS_ADDR4(wh) \
|
||||
(((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
|
||||
|
||||
|
@ -610,6 +611,11 @@ urtwn_rx_frame(struct urtwn_softc *sc, uint8_t *buf, int pktlen, int *rssi_p)
|
|||
rssi = urtwn_get_rssi(sc, rate, &stat[1]);
|
||||
/* Update our average RSSI. */
|
||||
urtwn_update_avgrssi(sc, rate, rssi);
|
||||
/*
|
||||
* Convert the RSSI to a range that will be accepted
|
||||
* by net80211.
|
||||
*/
|
||||
rssi = URTWN_RSSI(rssi);
|
||||
}
|
||||
|
||||
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
|
||||
|
|
Loading…
Reference in a new issue