diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 5056410d788a..c4adf9846410 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2918,6 +2918,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2918 | struct ath5k_hw *ah = sc->ah; | 2918 | struct ath5k_hw *ah = sc->ah; |
2919 | u32 mfilt[2], rfilt; | 2919 | u32 mfilt[2], rfilt; |
2920 | 2920 | ||
2921 | mutex_lock(&sc->lock); | ||
2922 | |||
2921 | mfilt[0] = multicast; | 2923 | mfilt[0] = multicast; |
2922 | mfilt[1] = multicast >> 32; | 2924 | mfilt[1] = multicast >> 32; |
2923 | 2925 | ||
@@ -2968,22 +2970,25 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2968 | 2970 | ||
2969 | /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ | 2971 | /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ |
2970 | 2972 | ||
2971 | if (sc->opmode == NL80211_IFTYPE_MONITOR) | 2973 | switch (sc->opmode) { |
2972 | rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | | 2974 | case NL80211_IFTYPE_MESH_POINT: |
2973 | AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; | 2975 | case NL80211_IFTYPE_MONITOR: |
2974 | if (sc->opmode != NL80211_IFTYPE_STATION) | 2976 | rfilt |= AR5K_RX_FILTER_CONTROL | |
2975 | rfilt |= AR5K_RX_FILTER_PROBEREQ; | 2977 | AR5K_RX_FILTER_BEACON | |
2976 | if (sc->opmode != NL80211_IFTYPE_AP && | 2978 | AR5K_RX_FILTER_PROBEREQ | |
2977 | sc->opmode != NL80211_IFTYPE_MESH_POINT && | 2979 | AR5K_RX_FILTER_PROM; |
2978 | test_bit(ATH_STAT_PROMISC, sc->status)) | 2980 | break; |
2979 | rfilt |= AR5K_RX_FILTER_PROM; | 2981 | case NL80211_IFTYPE_AP: |
2980 | if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) || | 2982 | case NL80211_IFTYPE_ADHOC: |
2981 | sc->opmode == NL80211_IFTYPE_ADHOC || | 2983 | rfilt |= AR5K_RX_FILTER_PROBEREQ | |
2982 | sc->opmode == NL80211_IFTYPE_AP) | 2984 | AR5K_RX_FILTER_BEACON; |
2983 | rfilt |= AR5K_RX_FILTER_BEACON; | 2985 | break; |
2984 | if (sc->opmode == NL80211_IFTYPE_MESH_POINT) | 2986 | case NL80211_IFTYPE_STATION: |
2985 | rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | | 2987 | if (sc->assoc) |
2986 | AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; | 2988 | rfilt |= AR5K_RX_FILTER_BEACON; |
2989 | default: | ||
2990 | break; | ||
2991 | } | ||
2987 | 2992 | ||
2988 | /* Set filters */ | 2993 | /* Set filters */ |
2989 | ath5k_hw_set_rx_filter(ah, rfilt); | 2994 | ath5k_hw_set_rx_filter(ah, rfilt); |
@@ -2993,6 +2998,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2993 | /* Set the cached hw filter flags, this will alter actually | 2998 | /* Set the cached hw filter flags, this will alter actually |
2994 | * be set in HW */ | 2999 | * be set in HW */ |
2995 | sc->filter_flags = rfilt; | 3000 | sc->filter_flags = rfilt; |
3001 | |||
3002 | mutex_unlock(&sc->lock); | ||
2996 | } | 3003 | } |
2997 | 3004 | ||
2998 | static int | 3005 | static int |