]> Pileus Git - ~andy/linux/commitdiff
[PATCH] zd1211rw: Fixes radiotap header
authorUlrich Kunitz <kune@deine-taler.de>
Tue, 1 Aug 2006 21:43:30 +0000 (23:43 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 2 Aug 2006 18:26:50 +0000 (14:26 -0400)
There has been a problem in the radiotap header. Monitor mode
works now with tcpdump 3.94 + libpcap 0.9.4. ethereal 0.99.0 +
libpcap 0.9.4 is broken, because it doesn't find the right offset
for the IEEE 802.11 header.

Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_mac.c

index 3bdc54d128d0613cb5ead20e81a1b642b4f0efd4..b3943038ff83773e2cdc67ab6005734034e29e08 100644 (file)
@@ -713,10 +713,10 @@ static int zd_mac_tx(struct zd_mac *mac, struct ieee80211_txb *txb, int pri)
 struct zd_rt_hdr {
        struct ieee80211_radiotap_header rt_hdr;
        u8  rt_flags;
+       u8  rt_rate;
        u16 rt_channel;
        u16 rt_chbitmask;
-       u16 rt_rate;
-};
+} __attribute__((packed));
 
 static void fill_rt_header(void *buffer, struct zd_mac *mac,
                           const struct ieee80211_rx_stats *stats,
@@ -735,14 +735,14 @@ static void fill_rt_header(void *buffer, struct zd_mac *mac,
        if (status->decryption_type & (ZD_RX_WEP64|ZD_RX_WEP128|ZD_RX_WEP256))
                hdr->rt_flags |= IEEE80211_RADIOTAP_F_WEP;
 
+       hdr->rt_rate = stats->rate / 5;
+
        /* FIXME: 802.11a */
        hdr->rt_channel = cpu_to_le16(ieee80211chan2mhz(
                                             _zd_chip_get_channel(&mac->chip)));
        hdr->rt_chbitmask = cpu_to_le16(IEEE80211_CHAN_2GHZ |
                ((status->frame_status & ZD_RX_FRAME_MODULATION_MASK) ==
                ZD_RX_OFDM ? IEEE80211_CHAN_OFDM : IEEE80211_CHAN_CCK));
-
-       hdr->rt_rate = stats->rate / 5;
 }
 
 /* Returns 1 if the data packet is for us and 0 otherwise. */