Skip to contentSkip to conversation

b43(legacy): include full timestamp in beacon frames

PATCH In review Michael Buesch 2 participants 2 messages Feb 18, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43(legacy): include full timestamp in beacon frames

From: Johannes Berg <[email protected]>

Having the full RX timestamp in beacons is necessary for IBSS merge to work properly so extend the 16-bit timestamp to the full 64 bits for beacon frames (as well as when monitor mode is active.)

 drivers/net/wireless/b43/xmit.c       |   14 +++++++++-----
 drivers/net/wireless/b43legacy/xmit.c |   14 +++++++++-----
 2 files changed, 18 insertions(+), 10 deletions(-)
drivers/net/wireless/b43/xmit.c +9 -5
@@ -589,12 +589,16 @@ void b43_rx(struct b43_wldev *dev, struc
 	status.antenna = !!(phystat0 & B43_RX_PHYST0_ANT);
 
 	/*
-	 * If monitors are present get full 64-bit timestamp. This
-	 * code assumes we get to process the packet within 16 bits
-	 * of timestamp, i.e. about 65 milliseconds after the PHY
-	 * received the first symbol.
+	 * All frames on monitor interfaces and beacons always need a full
+	 * 64-bit timestamp. Monitor interfaces need it for diagnostic
+	 * purposes and beacons for IBSS merging.
+	 * This code assumes we get to process the packet within 16 bits
+	 * of timestamp, i.e. about 65 milliseconds after the PHY received
+	 * the first symbol.
 	 */
-	if (dev->wl->radiotap_enabled) {
+	if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
+	    == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
+	    dev->wl->radiotap_enabled) {
 		u16 low_mactime_now;
 
 		b43_tsf_read(dev, &status.mactime);
drivers/net/wireless/b43legacy/xmit.c +9 -5
@@ -546,12 +546,16 @@ void b43legacy_rx(struct b43legacy_wldev
 	status.antenna = !!(phystat0 & B43legacy_RX_PHYST0_ANT);
 
 	/*
-	 * If monitors are present get full 64-bit timestamp. This
-	 * code assumes we get to process the packet within 16 bits
-	 * of timestamp, i.e. about 65 milliseconds after the PHY
-	 * received the first symbol.
+	 * All frames on monitor interfaces and beacons always need a full
+	 * 64-bit timestamp. Monitor interfaces need it for diagnostic
+	 * purposes and beacons for IBSS merging.
+	 * This code assumes we get to process the packet within 16 bits
+	 * of timestamp, i.e. about 65 milliseconds after the PHY received
+	 * the first symbol.
 	 */
-	if (dev->wl->radiotap_enabled) {
+	if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
+	    == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
+	    dev->wl->radiotap_enabled) {
 		u16 low_mactime_now;
 
 		b43legacy_tsf_read(dev, &status.mactime);

-------------------------------------------------------

Signature · 1 line
Greetings Michael.
#1 lore raw
Quoted 21 lines · On Mon, 18 Feb 2008 18:53:55 +0100 Michael Buesch <[email protected]> wrote:

From: Johannes Berg <[email protected]>

Having the full RX timestamp in beacons is necessary for IBSS merge to work properly so extend the 16-bit timestamp to the full 64 bits for beacon frames (as well as when monitor mode is active.)

drivers/net/wireless/b43legacy/xmit.c +4 -4
@@ -546,12 +546,16 @@ void b43legacy_rx(struct b43legacy_wldev
 	status.antenna = !!(phystat0 & B43legacy_RX_PHYST0_ANT);
 
 	/*
-	 * If monitors are present get full 64-bit timestamp. This
-	 * code assumes we get to process the packet within 16 bits
-	 * of timestamp, i.e. about 65 milliseconds after the PHY
-	 * received the first symbol.
+	 * All frames on monitor interfaces and beacons always need a full
+	 * 64-bit timestamp. Monitor interfaces need it for diagnostic
+	 * purposes and beacons for IBSS merging.
+	 * This code assumes we get to process the packet within 16 bits

drivers/net/wireless/b43legacy/xmit.c void b43legacy_rx(struct b43legacy_wldev · line 561

Quoted 10 lines
drivers/net/wireless/b43legacy/xmit.c +5 -1
+	 * of timestamp, i.e. about 65 milliseconds after the PHY received
+	 * the first symbol.
 	 */
-	if (dev->wl->radiotap_enabled) {
+	if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
+	    == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
+	    dev->wl->radiotap_enabled) {
 		u16 low_mactime_now;
 
 		b43legacy_tsf_read(dev, &status.mactime);

--
Ciao
Stefano