ath9k: Filter out beacons from other BSS in STA mode
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Thu, 19 Feb 2009 10:11:52 +0000 (15:41 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:52:47 +0000 (14:52 -0500)
Passing beacons received from other BSS to s/w in non-scanning
state is unnecessary in STA mode. This patch filters them out in
h/w.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/mac.h
drivers/net/wireless/ath9k/recv.c

index 74b660a..862a63f 100644 (file)
@@ -566,8 +566,9 @@ enum ath9k_rx_filter {
        ATH9K_RX_FILTER_BEACON = 0x00000010,
        ATH9K_RX_FILTER_PROM = 0x00000020,
        ATH9K_RX_FILTER_PROBEREQ = 0x00000080,
-       ATH9K_RX_FILTER_PSPOLL = 0x00004000,
        ATH9K_RX_FILTER_PHYERR = 0x00000100,
+       ATH9K_RX_FILTER_MYBEACON = 0x00000200,
+       ATH9K_RX_FILTER_PSPOLL = 0x00004000,
        ATH9K_RX_FILTER_PHYRADAR = 0x00002000,
 };
 
index 28ad1d5..23b6f54 100644 (file)
@@ -375,14 +375,15 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
        if (sc->rx.rxfilter & FIF_CONTROL)
                rfilt |= ATH9K_RX_FILTER_CONTROL;
 
-       if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION ||
-           sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)
+       if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) &&
+           !(sc->rx.rxfilter & FIF_BCN_PRBRESP_PROMISC))
+               rfilt |= ATH9K_RX_FILTER_MYBEACON;
+       else
                rfilt |= ATH9K_RX_FILTER_BEACON;
 
-       /* If in HOSTAP mode, want to enable reception of PSPOLL frames
-          & beacon frames */
+       /* If in HOSTAP mode, want to enable reception of PSPOLL frames */
        if (sc->sc_ah->opmode == NL80211_IFTYPE_AP)
-               rfilt |= (ATH9K_RX_FILTER_BEACON | ATH9K_RX_FILTER_PSPOLL);
+               rfilt |= ATH9K_RX_FILTER_PSPOLL;
 
        return rfilt;