]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
urtwn(4): add DBM_ANTNOISE radiotap field
authoravos <avos@FreeBSD.org>
Fri, 23 Oct 2015 08:44:40 +0000 (08:44 +0000)
committeravos <avos@FreeBSD.org>
Fri, 23 Oct 2015 08:44:40 +0000 (08:44 +0000)
Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D3839

sys/dev/usb/wlan/if_urtwn.c
sys/dev/usb/wlan/if_urtwnvar.h

index c5039a61085e115b4ead1fd4433c63d61bc5b518..1a713175735001dada25cee8c1a8c1895d815f2f 100644 (file)
@@ -666,6 +666,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, uint8_t *buf, int pktlen, int *rssi_p)
                        tap->wr_rate = 0x80 | (rate - 12);
                }
                tap->wr_dbm_antsignal = rssi;
+               tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR;
                tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
                tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
        }
index 8d08000d4245a377827dead032efd749e277d5cd..f2426ff668deaebb7b1ae3d7b4c3492854251199 100644 (file)
@@ -37,14 +37,16 @@ struct urtwn_rx_radiotap_header {
        uint8_t         wr_rate;
        uint16_t        wr_chan_freq;
        uint16_t        wr_chan_flags;
-       uint8_t         wr_dbm_antsignal;
+       int8_t          wr_dbm_antsignal;
+       int8_t          wr_dbm_antnoise;
 } __packed __aligned(8);
 
 #define URTWN_RX_RADIOTAP_PRESENT                      \
        (1 << IEEE80211_RADIOTAP_FLAGS |                \
         1 << IEEE80211_RADIOTAP_RATE |                 \
         1 << IEEE80211_RADIOTAP_CHANNEL |              \
-        1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL)
+        1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL |        \
+        1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)
 
 struct urtwn_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;