Search Linux Wireless

[PATCH 3/7] mac80211: Radiotap rx to use fallback rate calc if ieee80211_get_rate fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Green <andy@xxxxxxxxxxx>

Michael Wu's radiotap rx code gave me a rate of 0 on zd1211rw-mac80211, perhaps
because no interface to the physical device was associated.  Added some fallback
code so that if the rate could not be computed by ieee80211_get_rate it uses
Michael's original method (which always worked for me).

Signed-off-by: Andy Green <andy@xxxxxxxxxxx>



diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index e8c5f8d..211886c 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -2821,6 +2821,8 @@ ieee80211_rx_monitor(struct net_device *dev, struct sk_buff *skb,
 	rate = ieee80211_get_rate(local, status->phymode, status->rate);
 	if (rate)
 		rthdr->rate = rate->rate / 5;
+	else
+		rthdr->rate = status->rate / 5;
 	rthdr->chan_freq = cpu_to_le16(status->freq);
 	rthdr->chan_flags =
 		status->phymode == MODE_IEEE80211A ?

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux