summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-12-28 06:58:52 +0000
committersam <sam@FreeBSD.org>2003-12-28 06:58:52 +0000
commitc93326599e9e90c429b74119001b593b342009f1 (patch)
treed6945b5ad2360f5c2d9dbdb117558ad7a549bfb0 /sys/dev/wi
parent189a9001bd631ed40aba0a47be25fcfa7be6a2b7 (diff)
downloadFreeBSD-src-c93326599e9e90c429b74119001b593b342009f1.zip
FreeBSD-src-c93326599e9e90c429b74119001b593b342009f1.tar.gz
update radiotap support to reflect recent changes:
o add xmit rate o drop rx time o add rx flags
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c12
-rw-r--r--sys/dev/wi/if_wireg.h15
2 files changed, 14 insertions, 13 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index a99f96f..6792136 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -491,8 +491,7 @@ wi_attach(device_t dev)
sc->sc_tx_th.wt_ihdr.it_present = WI_TX_RADIOTAP_PRESENT;
sc->sc_rx_th.wr_ihdr.it_len = sizeof(sc->sc_rx_th);
- sc->sc_rx_th.wr_ihdr.it_present = WI_RX_RADIOTAP_PRESENT0;
- sc->sc_rx_th.wr_present1 = WI_RX_RADIOTAP_PRESENT1;
+ sc->sc_rx_th.wr_ihdr.it_present = WI_RX_RADIOTAP_PRESENT;
#endif
return (0);
}
@@ -947,6 +946,8 @@ wi_start(struct ifnet *ifp)
frmhdr.wi_dat_len = htole16(m0->m_pkthdr.len);
#if NBPFILTER > 0
if (sc->sc_drvbpf) {
+ sc->sc_tx_th.wt_rate =
+ ni->ni_rates.rs_rates[ni->ni_txrate];
bpf_mtap2(sc->sc_drvbpf,
&sc->sc_tx_th, sizeof(sc->sc_tx_th), m0);
}
@@ -1487,14 +1488,15 @@ wi_rx_intr(struct wi_softc *sc)
#if NBPFILTER > 0
if (sc->sc_drvbpf) {
+ /* XXX replace divide by table */
sc->sc_rx_th.wr_rate = frmhdr.wi_rx_rate / 5;
sc->sc_rx_th.wr_antsignal =
WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_signal);
sc->sc_rx_th.wr_antnoise =
WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_silence);
- sc->sc_rx_th.wr_time =
- htole32((frmhdr.wi_rx_tstamp1 << 16) |
- frmhdr.wi_rx_tstamp0);
+ sc->sc_rx_th.wr_flags = 0;
+ if (frmhdr.wi_status & WI_STAT_PCF)
+ sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_CFP;
bpf_mtap2(sc->sc_drvbpf,
&sc->sc_rx_th, sizeof(sc->sc_rx_th), m);
}
diff --git a/sys/dev/wi/if_wireg.h b/sys/dev/wi/if_wireg.h
index 5d17211..03c6e22 100644
--- a/sys/dev/wi/if_wireg.h
+++ b/sys/dev/wi/if_wireg.h
@@ -684,33 +684,32 @@ struct wi_frame {
/*
* Radio capture format for Prism.
*/
-#define WI_RX_RADIOTAP_PRESENT0 \
+#define WI_RX_RADIOTAP_PRESENT \
((1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_RATE) | \
(1 << IEEE80211_RADIOTAP_CHANNEL) | \
(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
- (1 << IEEE80211_RADIOTAP_DB_ANTNOISE) | \
- (1 << IEEE80211_RADIOTAP_EXT))
-
-#define WI_RX_RADIOTAP_PRESENT1 (1 << (IEEE80211_RADIOTAP_TIME - 32))
+ (1 << IEEE80211_RADIOTAP_DB_ANTNOISE))
struct wi_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
- u_int32_t wr_present1;
u_int8_t wr_flags;
u_int8_t wr_rate;
u_int16_t wr_chan_freq;
u_int16_t wr_chan_flags;
u_int8_t wr_antsignal;
u_int8_t wr_antnoise;
- u_int32_t wr_time;
};
#define WI_TX_RADIOTAP_PRESENT \
- ((1 << IEEE80211_RADIOTAP_CHANNEL))
+ ((1 << IEEE80211_RADIOTAP_FLAGS) | \
+ (1 << IEEE80211_RADIOTAP_RATE) | \
+ (1 << IEEE80211_RADIOTAP_CHANNEL))
struct wi_tx_radiotap_header {
struct ieee80211_radiotap_header wt_ihdr;
+ u_int8_t wt_flags;
+ u_int8_t wt_rate;
u_int16_t wt_chan_freq;
u_int16_t wt_chan_flags;
};
OpenPOWER on IntegriCloud