Date: Sun, 30 Jun 2013 06:04:01 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252405 - head/sys/dev/usb/wlan Message-ID: <201306300604.r5U641cZ069904@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpaulo Date: Sun Jun 30 06:04:00 2013 New Revision: 252405 URL: http://svnweb.freebsd.org/changeset/base/252405 Log: Fix the RSSI calculation. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 05:56:13 2013 (r252404) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 06:04:00 2013 (r252405) @@ -80,6 +80,7 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu "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, u 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306300604.r5U641cZ069904>