diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2013-06-30 06:04:00 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2013-06-30 06:04:00 +0000 |
commit | 9b28e27d1797c06d960d6b4a0aa6b5b40df61763 (patch) | |
tree | 30f79fbade99b672b9dd995b26c41dded9ffeef8 /sys/dev | |
parent | 0435e2e5c9c18836c261ee11f1a33a0019f5adca (diff) | |
download | FreeBSD-src-9b28e27d1797c06d960d6b4a0aa6b5b40df61763.zip FreeBSD-src-9b28e27d1797c06d960d6b4a0aa6b5b40df61763.tar.gz |
Fix the RSSI calculation.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/wlan/if_urtwn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index f84ef4b..fa8d5b3 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -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); |