aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAndriy Voskoboinyk <avos@FreeBSD.org>2019-03-30 09:24:06 +0000
committerAndriy Voskoboinyk <avos@FreeBSD.org>2019-03-30 09:24:06 +0000
commitcb5d2742ff905e23b4493b916a81a67e5644ad33 (patch)
treefdf92d10c29c08857648c5667b978774e59f8c76 /sys/dev
parentaf4f9e5f0032e15ce0862df2736e13bf52359585 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/wlan/if_urtw.c8
-rw-r--r--sys/dev/usb/wlan/if_urtwvar.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index 818f3b6cf594..cdd561be8766 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -3932,6 +3932,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p,
struct urtw_softc *sc = data->sc;
struct ieee80211com *ic = &sc->sc_ic;
uint8_t noise = 0, rate;
+ uint64_t mactime;
usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
@@ -3951,6 +3952,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p,
/* XXX correct? */
rssi = rx->rssi & URTW_RX_RSSI_MASK;
noise = rx->noise;
+
+ if (ieee80211_radiotap_active(ic))
+ mactime = rx->mactime;
} else {
struct urtw_8187l_rxhdr *rx;
@@ -3967,6 +3971,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p,
/* XXX correct? */
rssi = rx->rssi & URTW_RX_8187L_RSSI_MASK;
noise = rx->noise;
+
+ if (ieee80211_radiotap_active(ic))
+ mactime = rx->mactime;
}
if (flen < IEEE80211_ACK_LEN)
@@ -3986,6 +3993,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p,
if (ieee80211_radiotap_active(ic)) {
struct urtw_rx_radiotap_header *tap = &sc->sc_rxtap;
+ tap->wr_tsf = mactime;
tap->wr_flags = 0;
tap->wr_dbm_antsignal = (int8_t)rssi;
}
diff --git a/sys/dev/usb/wlan/if_urtwvar.h b/sys/dev/usb/wlan/if_urtwvar.h
index b56f13479eb2..87c24d648d4b 100644
--- a/sys/dev/usb/wlan/if_urtwvar.h
+++ b/sys/dev/usb/wlan/if_urtwvar.h
@@ -55,6 +55,7 @@ typedef STAILQ_HEAD(, urtw_data) urtw_datahead;
struct urtw_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
+ uint64_t wr_tsf;
uint8_t wr_flags;
uint8_t wr_pad;
uint16_t wr_chan_freq;
@@ -63,7 +64,8 @@ struct urtw_rx_radiotap_header {
} __packed __aligned(8);
#define URTW_RX_RADIOTAP_PRESENT \
- ((1 << IEEE80211_RADIOTAP_FLAGS) | \
+ ((1 << IEEE80211_RADIOTAP_TSFT) | \
+ (1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_CHANNEL) | \
(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL))