2007-12-05 10:16:39

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] wireless: make drivers include the TSF RX flag where appropriate

These drivers pass full mactime information to the stack, make them
indicate this via the new RX_FLAG_TSFT to get mac80211 to show this
information in monitor mode.

Signed-off-by: Johannes Berg <[email protected]>
---
iwlwifi does own radiotap headers (well, tries, it's broken) so is not
modified.

drivers/net/wireless/b43/xmit.c | 1 +
drivers/net/wireless/b43legacy/xmit.c | 1 +
drivers/net/wireless/p54common.c | 1 +
drivers/net/wireless/rtl8180_dev.c | 1 +
drivers/net/wireless/rtl8187_dev.c | 1 +
5 files changed, 5 insertions(+)

--- everything.orig/drivers/net/wireless/p54common.c 2007-12-04 20:32:32.036952636 +0100
+++ everything/drivers/net/wireless/p54common.c 2007-12-04 20:33:17.886948839 +0100
@@ -314,6 +314,7 @@ static void p54_rx_data(struct ieee80211
rx_status.phymode = MODE_IEEE80211G;
rx_status.antenna = hdr->antenna;
rx_status.mactime = le64_to_cpu(hdr->timestamp);
+ rx_status.flag |= RX_FLAG_TSFT;

skb_pull(skb, sizeof(*hdr));
skb_trim(skb, le16_to_cpu(hdr->len));
--- everything.orig/drivers/net/wireless/b43/xmit.c 2007-12-04 20:32:32.096962565 +0100
+++ everything/drivers/net/wireless/b43/xmit.c 2007-12-04 20:33:11.046949707 +0100
@@ -541,6 +541,7 @@ void b43_rx(struct b43_wldev *dev, struc
status.mactime += mactime;
if (low_mactime_now <= mactime)
status.mactime -= 0x10000;
+ status.flag |= RX_FLAG_TSFT;
}

chanid = (chanstat & B43_RX_CHAN_ID) >> B43_RX_CHAN_ID_SHIFT;
--- everything.orig/drivers/net/wireless/b43legacy/xmit.c 2007-12-04 20:32:32.076950086 +0100
+++ everything/drivers/net/wireless/b43legacy/xmit.c 2007-12-04 20:33:13.996951714 +0100
@@ -548,6 +548,7 @@ void b43legacy_rx(struct b43legacy_wldev
status.mactime += mactime;
if (low_mactime_now <= mactime)
status.mactime -= 0x10000;
+ status.flag |= RX_FLAG_TSFT;
}

chanid = (chanstat & B43legacy_RX_CHAN_ID) >>
--- everything.orig/drivers/net/wireless/rtl8180_dev.c 2007-12-04 20:32:32.136949327 +0100
+++ everything/drivers/net/wireless/rtl8180_dev.c 2007-12-04 20:33:21.696948567 +0100
@@ -103,6 +103,7 @@ static void rtl8180_handle_rx(struct iee
rx_status.channel = dev->conf.channel;
rx_status.phymode = dev->conf.phymode;
rx_status.mactime = le64_to_cpu(entry->tsft);
+ rx_status.flag |= RX_FLAG_TSFT;
ieee80211_rx_irqsafe(dev, skb, &rx_status);

skb = new_skb;
--- everything.orig/drivers/net/wireless/rtl8187_dev.c 2007-12-04 20:32:32.166950629 +0100
+++ everything/drivers/net/wireless/rtl8187_dev.c 2007-12-04 20:33:26.936948459 +0100
@@ -228,6 +228,7 @@ static void rtl8187_rx_cb(struct urb *ur
rx_status.channel = dev->conf.channel;
rx_status.phymode = dev->conf.phymode;
rx_status.mactime = le64_to_cpu(hdr->mac_time);
+ rx_status.flag |= RX_FLAG_TSFT;
if (flags & (1 << 13))
rx_status.flag |= RX_FLAG_FAILED_FCS_CRC;
ieee80211_rx_irqsafe(dev, skb, &rx_status);




2007-12-05 10:19:28

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH] wireless: make drivers include the TSF RX flag where appropriate

On Tuesday 04 December 2007 20:33:40 Johannes Berg wrote:
> These drivers pass full mactime information to the stack, make them
> indicate this via the new RX_FLAG_TSFT to get mac80211 to show this
> information in monitor mode.
>
> Signed-off-by: Johannes Berg <[email protected]>
> ---
> iwlwifi does own radiotap headers (well, tries, it's broken) so is not
> modified.
>
> drivers/net/wireless/b43/xmit.c | 1 +
> drivers/net/wireless/b43legacy/xmit.c | 1 +
> drivers/net/wireless/p54common.c | 1 +
> drivers/net/wireless/rtl8180_dev.c | 1 +
> drivers/net/wireless/rtl8187_dev.c | 1 +
> 5 files changed, 5 insertions(+)

> --- everything.orig/drivers/net/wireless/b43/xmit.c 2007-12-04 20:32:32.096962565 +0100
> +++ everything/drivers/net/wireless/b43/xmit.c 2007-12-04 20:33:11.046949707 +0100
> @@ -541,6 +541,7 @@ void b43_rx(struct b43_wldev *dev, struc
> status.mactime += mactime;
> if (low_mactime_now <= mactime)
> status.mactime -= 0x10000;
> + status.flag |= RX_FLAG_TSFT;
> }
>
> chanid = (chanstat & B43_RX_CHAN_ID) >> B43_RX_CHAN_ID_SHIFT;

Acked-by: Michael Buesch <[email protected]>


--
Greetings Michael.

2007-12-05 11:12:38

by Stefano Brivio

[permalink] [raw]
Subject: Re: [PATCH] wireless: make drivers include the TSF RX flag where appropriate

On Tue, 04 Dec 2007 20:33:40 +0100
Johannes Berg <[email protected]> wrote:

> --- everything.orig/drivers/net/wireless/b43legacy/xmit.c
> 2007-12-04 20:32:32.076950086 +0100 +++
> everything/drivers/net/wireless/b43legacy/xmit.c 2007-12-04
> 20:33:13.996951714 +0100 @@ -548,6 +548,7 @@ void b43legacy_rx(struct
> b43legacy_wldev status.mactime += mactime; if (low_mactime_now <= mactime)
> status.mactime -= 0x10000;
> + status.flag |= RX_FLAG_TSFT;
> }

Acked-by: Stefano Brivio <[email protected]>


--
Ciao
Stefano