--- src/sys/dev/netif/ural/if_ural.c 2006/12/24 05:18:22 1.4 +++ src/sys/dev/netif/ural/if_ural.c 2007/02/06 13:50:25 1.5 @@ -51,8 +51,8 @@ #include #include -#include "if_uralreg.h" -#include "if_uralvar.h" +#include +#include #ifdef USB_DEBUG #define DPRINTF(x) do { if (uraldebug > 0) logprintf x; } while (0) @@ -66,6 +66,10 @@ SYSCTL_INT(_hw_usb_ural, OID_AUTO, debug #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 }, @@ -998,7 +1002,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_p 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_ptap(sc->sc_drvbpf, m, tap, sc->sc_rxtap_len); } @@ -1010,7 +1014,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_p 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, 0); + ieee80211_input(ic, m, ni, URAL_RSSI(desc->rssi), 0); /* node is no longer needed */ ieee80211_free_node(ni);