Fix the RSSI calculation.

This commit is contained in:
Rui Paulo 2013-06-30 06:04:00 +00:00
parent b584d2b3f4
commit d718126e58

View File

@ -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);