| 1 |
Thanks to Weedy who did an awesome work tracking this down |
| 2 |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c |
| 3 |
index c4adf98..5056410 100644 |
| 4 |
--- a/drivers/net/wireless/ath/ath5k/base.c |
| 5 |
+++ b/drivers/net/wireless/ath/ath5k/base.c |
| 6 |
@@ -2918,8 +2918,6 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, |
| 7 |
struct ath5k_hw *ah = sc->ah; |
| 8 |
u32 mfilt[2], rfilt; |
| 9 |
|
| 10 |
- mutex_lock(&sc->lock); |
| 11 |
- |
| 12 |
mfilt[0] = multicast; |
| 13 |
mfilt[1] = multicast >> 32; |
| 14 |
|
| 15 |
@@ -2970,25 +2968,22 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, |
| 16 |
|
| 17 |
/* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ |
| 18 |
|
| 19 |
- switch (sc->opmode) { |
| 20 |
- case NL80211_IFTYPE_MESH_POINT: |
| 21 |
- case NL80211_IFTYPE_MONITOR: |
| 22 |
- rfilt |= AR5K_RX_FILTER_CONTROL | |
| 23 |
- AR5K_RX_FILTER_BEACON | |
| 24 |
- AR5K_RX_FILTER_PROBEREQ | |
| 25 |
- AR5K_RX_FILTER_PROM; |
| 26 |
- break; |
| 27 |
- case NL80211_IFTYPE_AP: |
| 28 |
- case NL80211_IFTYPE_ADHOC: |
| 29 |
- rfilt |= AR5K_RX_FILTER_PROBEREQ | |
| 30 |
- AR5K_RX_FILTER_BEACON; |
| 31 |
- break; |
| 32 |
- case NL80211_IFTYPE_STATION: |
| 33 |
- if (sc->assoc) |
| 34 |
- rfilt |= AR5K_RX_FILTER_BEACON; |
| 35 |
- default: |
| 36 |
- break; |
| 37 |
- } |
| 38 |
+ if (sc->opmode == NL80211_IFTYPE_MONITOR) |
| 39 |
+ rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | |
| 40 |
+ AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; |
| 41 |
+ if (sc->opmode != NL80211_IFTYPE_STATION) |
| 42 |
+ rfilt |= AR5K_RX_FILTER_PROBEREQ; |
| 43 |
+ if (sc->opmode != NL80211_IFTYPE_AP && |
| 44 |
+ sc->opmode != NL80211_IFTYPE_MESH_POINT && |
| 45 |
+ test_bit(ATH_STAT_PROMISC, sc->status)) |
| 46 |
+ rfilt |= AR5K_RX_FILTER_PROM; |
| 47 |
+ if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) || |
| 48 |
+ sc->opmode == NL80211_IFTYPE_ADHOC || |
| 49 |
+ sc->opmode == NL80211_IFTYPE_AP) |
| 50 |
+ rfilt |= AR5K_RX_FILTER_BEACON; |
| 51 |
+ if (sc->opmode == NL80211_IFTYPE_MESH_POINT) |
| 52 |
+ rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | |
| 53 |
+ AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; |
| 54 |
|
| 55 |
/* Set filters */ |
| 56 |
ath5k_hw_set_rx_filter(ah, rfilt); |
| 57 |
@@ -2998,8 +2993,6 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, |
| 58 |
/* Set the cached hw filter flags, this will alter actually |
| 59 |
* be set in HW */ |
| 60 |
sc->filter_flags = rfilt; |
| 61 |
- |
| 62 |
- mutex_unlock(&sc->lock); |
| 63 |
} |
| 64 |
|
| 65 |
static int |