PERFORCE change 115111 for review

Sepherosa Ziehau sephe at FreeBSD.org
Tue Feb 27 10:42:35 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=115111

Change 115111 by sephe at sephe_zealot:sam_wifi on 2007/02/27 10:42:17

	Convert RSSI to receive signal strength for ural(4)
	
	Reviewed by:	sam@
	Approved by:	sam@

Affected files ...

.. //depot/projects/wifi/sys/dev/usb/if_ural.c#15 edit
.. //depot/projects/wifi/sys/dev/usb/if_uralreg.h#3 edit

Differences ...

==== //depot/projects/wifi/sys/dev/usb/if_ural.c#15 (text+ko) ====

@@ -78,6 +78,10 @@
 #define DPRINTFN(n, x)
 #endif
 
+#define URAL_RSSI(rssi)					\
+	((rssi) > (RAL_NOISE_FLOOR + RAL_RSSI_CORR) ?	\
+	 ((rssi) - RAL_NOISE_FLOOR + RAL_RSSI_CORR) : 0)
+
 /* various supported device vendors/products */
 static const struct usb_devno ural_devs[] = {
 	{ USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_WL167G },
@@ -986,7 +990,7 @@
 		tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
 		tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
 		tap->wr_antenna = sc->rx_ant;
-		tap->wr_antsignal = desc->rssi;
+		tap->wr_antsignal = URAL_RSSI(desc->rssi);
 
 		bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m);
 	}
@@ -995,7 +999,7 @@
 	ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh);
 
 	/* send the frame to the 802.11 layer */
-	ieee80211_input(ic, m, ni, desc->rssi, -95/*XXX*/, 0);
+	ieee80211_input(ic, m, ni, URAL_RSSI(desc->rssi), RAL_NOISE_FLOOR, 0);
 
 	/* node is no longer needed */
 	ieee80211_free_node(ni);

==== //depot/projects/wifi/sys/dev/usb/if_uralreg.h#3 (text+ko) ====

@@ -17,6 +17,9 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#define RAL_NOISE_FLOOR		-95
+#define RAL_RSSI_CORR		120
+
 #define RAL_RX_DESC_SIZE	(sizeof (struct ural_rx_desc))
 #define RAL_TX_DESC_SIZE	(sizeof (struct ural_tx_desc))
 


More information about the p4-projects mailing list