]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] zd1211rw: Don't handle broken frames in monitor mode
authorDaniel Drake <dsd@gentoo.org>
Sun, 25 Mar 2007 23:59:47 +0000 (00:59 +0100)
committerJeff Garzik <jeff@garzik.org>
Sat, 28 Apr 2007 15:01:01 +0000 (11:01 -0400)
Using monitor mode, Johannes Berg observed out that lots of corrupted
and otherwise invalid frames were being passed to the host.

When in monitor mode we were disabling the hardware filtering here, but
this is not how monitor mode should work.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_mac.c

index 19172f571524734df56cc0a8f13fa2c33560143c..6753d240c16825f9c0b0c4801f2874e8b57c462f 100644 (file)
@@ -156,17 +156,8 @@ void zd_mac_clear(struct zd_mac *mac)
 static int reset_mode(struct zd_mac *mac)
 {
        struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
-       struct zd_ioreq32 ioreqs[] = {
-               { CR_RX_FILTER, STA_RX_FILTER },
-               { CR_SNIFFER_ON, 0U },
-       };
-
-       if (ieee->iw_mode == IW_MODE_MONITOR) {
-               ioreqs[0].value = 0xffffffff;
-               ioreqs[1].value = 0x1;
-       }
-
-       return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs));
+       u32 filter = (ieee->iw_mode == IW_MODE_MONITOR) ? ~0 : STA_RX_FILTER;
+       return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter);
 }
 
 int zd_mac_open(struct net_device *netdev)