Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156685368
D3831.id11227.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D3831.id11227.diff
View Options
Index: head/sys/dev/usb/wlan/if_urtwn.c
===================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c
+++ head/sys/dev/usb/wlan/if_urtwn.c
@@ -259,6 +259,7 @@
static void urtwn_tsf_task_adhoc(void *, int);
static void urtwn_tsf_sync_enable(struct urtwn_softc *,
struct ieee80211vap *);
+static void urtwn_get_tsf(struct urtwn_softc *, uint64_t *);
static void urtwn_set_led(struct urtwn_softc *, int, int);
static void urtwn_set_mode(struct urtwn_softc *, uint8_t);
static void urtwn_ibss_recv_mgmt(struct ieee80211_node *,
@@ -784,6 +785,16 @@
struct urtwn_rx_radiotap_header *tap = &sc->sc_rxtap;
tap->wr_flags = 0;
+
+ urtwn_get_tsf(sc, &tap->wr_tsft);
+ if (__predict_false(le32toh((uint32_t)tap->wr_tsft) <
+ le32toh(stat->rxdw5))) {
+ tap->wr_tsft = le32toh(tap->wr_tsft >> 32) - 1;
+ tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32;
+ } else
+ tap->wr_tsft &= 0xffffffff00000000;
+ tap->wr_tsft += stat->rxdw5;
+
/* Map HW rate index to 802.11 rate. */
if (!(rxdw3 & R92C_RXDW3_HT)) {
tap->wr_rate = ridx2rate[rate];
@@ -2110,6 +2121,12 @@
}
static void
+urtwn_get_tsf(struct urtwn_softc *sc, uint64_t *buf)
+{
+ urtwn_read_region_1(sc, R92C_TSFTR, (uint8_t *)buf, sizeof(*buf));
+}
+
+static void
urtwn_set_led(struct urtwn_softc *sc, int led, int on)
{
uint8_t reg;
@@ -2162,7 +2179,6 @@
(subtype == IEEE80211_FC0_SUBTYPE_BEACON ||
subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) {
ni_tstamp = le64toh(ni->ni_tstamp.tsf);
-#ifdef D3831
URTWN_LOCK(sc);
urtwn_get_tsf(sc, &curr_tstamp);
URTWN_UNLOCK(sc);
@@ -2170,10 +2186,6 @@
if (ni_tstamp >= curr_tstamp)
(void) ieee80211_ibss_merge(ni);
-#else
- (void) sc;
- (void) curr_tstamp;
-#endif
}
}
Index: head/sys/dev/usb/wlan/if_urtwnvar.h
===================================================================
--- head/sys/dev/usb/wlan/if_urtwnvar.h
+++ head/sys/dev/usb/wlan/if_urtwnvar.h
@@ -33,6 +33,7 @@
struct urtwn_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
+ uint64_t wr_tsft;
uint8_t wr_flags;
uint8_t wr_rate;
uint16_t wr_chan_freq;
@@ -42,7 +43,8 @@
} __packed __aligned(8);
#define URTWN_RX_RADIOTAP_PRESENT \
- (1 << IEEE80211_RADIOTAP_FLAGS | \
+ (1 << IEEE80211_RADIOTAP_TSFT | \
+ 1 << IEEE80211_RADIOTAP_FLAGS | \
1 << IEEE80211_RADIOTAP_RATE | \
1 << IEEE80211_RADIOTAP_CHANNEL | \
1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL | \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 4:40 PM (4 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33138238
Default Alt Text
D3831.id11227.diff (2 KB)
Attached To
Mode
D3831: urtwn(4): add TSF field into RX radiotap header
Attached
Detach File
Event Timeline
Log In to Comment