mac80211: radiotap: assume modulation from rates
authorBruno Randolf <br1@einfach.org>
Wed, 30 Jul 2008 15:20:06 +0000 (17:20 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 22 Aug 2008 20:29:50 +0000 (16:29 -0400)
use the rates ERP flag to derive CCK or OFDM modulation for the radiotap
header.

(it might be more correct to get this information from the hardware itself, but it
seems safe to assume this in most practical cases.)

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/rx.c

index ad47a614a2024ecb81b49439b51ad3090b075792..60e9ea11115f742336d2b29910d62203112cc1a2 100644 (file)
@@ -157,8 +157,11 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
        if (status->band == IEEE80211_BAND_5GHZ)
                *(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_OFDM |
                                             IEEE80211_CHAN_5GHZ);
+       else if (rate->flags & IEEE80211_RATE_ERP_G)
+               *(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_OFDM |
+                                            IEEE80211_CHAN_2GHZ);
        else
-               *(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_DYN |
+               *(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_CCK |
                                             IEEE80211_CHAN_2GHZ);
        pos += 2;