diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/base.h | 1 |
2 files changed, 35 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index cfd4d052d666..2d14255eb103 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -240,6 +240,10 @@ static u64 ath5k_get_tsf(struct ieee80211_hw *hw); | |||
240 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); | 240 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); |
241 | static int ath5k_beacon_update(struct ieee80211_hw *hw, | 241 | static int ath5k_beacon_update(struct ieee80211_hw *hw, |
242 | struct sk_buff *skb); | 242 | struct sk_buff *skb); |
243 | static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | ||
244 | struct ieee80211_vif *vif, | ||
245 | struct ieee80211_bss_conf *bss_conf, | ||
246 | u32 changes); | ||
243 | 247 | ||
244 | static struct ieee80211_ops ath5k_hw_ops = { | 248 | static struct ieee80211_ops ath5k_hw_ops = { |
245 | .tx = ath5k_tx, | 249 | .tx = ath5k_tx, |
@@ -256,6 +260,7 @@ static struct ieee80211_ops ath5k_hw_ops = { | |||
256 | .get_tx_stats = ath5k_get_tx_stats, | 260 | .get_tx_stats = ath5k_get_tx_stats, |
257 | .get_tsf = ath5k_get_tsf, | 261 | .get_tsf = ath5k_get_tsf, |
258 | .reset_tsf = ath5k_reset_tsf, | 262 | .reset_tsf = ath5k_reset_tsf, |
263 | .bss_info_changed = ath5k_bss_info_changed, | ||
259 | }; | 264 | }; |
260 | 265 | ||
261 | /* | 266 | /* |
@@ -2942,7 +2947,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && | 2947 | sc->opmode != NL80211_IFTYPE_MESH_POINT && |
2943 | test_bit(ATH_STAT_PROMISC, sc->status)) | 2948 | test_bit(ATH_STAT_PROMISC, sc->status)) |
2944 | rfilt |= AR5K_RX_FILTER_PROM; | 2949 | rfilt |= AR5K_RX_FILTER_PROM; |
2945 | if (sc->opmode == NL80211_IFTYPE_STATION || | 2950 | if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) || |
2946 | sc->opmode == NL80211_IFTYPE_ADHOC) { | 2951 | sc->opmode == NL80211_IFTYPE_ADHOC) { |
2947 | rfilt |= AR5K_RX_FILTER_BEACON; | 2952 | rfilt |= AR5K_RX_FILTER_BEACON; |
2948 | } | 2953 | } |
@@ -3083,4 +3088,32 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3083 | end: | 3088 | end: |
3084 | return ret; | 3089 | return ret; |
3085 | } | 3090 | } |
3091 | static void | ||
3092 | set_beacon_filter(struct ieee80211_hw *hw, bool enable) | ||
3093 | { | ||
3094 | struct ath5k_softc *sc = hw->priv; | ||
3095 | struct ath5k_hw *ah = sc->ah; | ||
3096 | u32 rfilt; | ||
3097 | rfilt = ath5k_hw_get_rx_filter(ah); | ||
3098 | if (enable) | ||
3099 | rfilt |= AR5K_RX_FILTER_BEACON; | ||
3100 | else | ||
3101 | rfilt &= ~AR5K_RX_FILTER_BEACON; | ||
3102 | ath5k_hw_set_rx_filter(ah, rfilt); | ||
3103 | sc->filter_flags = rfilt; | ||
3104 | } | ||
3086 | 3105 | ||
3106 | static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | ||
3107 | struct ieee80211_vif *vif, | ||
3108 | struct ieee80211_bss_conf *bss_conf, | ||
3109 | u32 changes) | ||
3110 | { | ||
3111 | struct ath5k_softc *sc = hw->priv; | ||
3112 | if (changes & BSS_CHANGED_ASSOC) { | ||
3113 | mutex_lock(&sc->lock); | ||
3114 | sc->assoc = bss_conf->assoc; | ||
3115 | if (sc->opmode == NL80211_IFTYPE_STATION) | ||
3116 | set_beacon_filter(hw, sc->assoc); | ||
3117 | mutex_unlock(&sc->lock); | ||
3118 | } | ||
3119 | } | ||
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index 06d1054ca94b..facc60ddada2 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
@@ -179,6 +179,7 @@ struct ath5k_softc { | |||
179 | 179 | ||
180 | struct timer_list calib_tim; /* calibration timer */ | 180 | struct timer_list calib_tim; /* calibration timer */ |
181 | int power_level; /* Requested tx power in dbm */ | 181 | int power_level; /* Requested tx power in dbm */ |
182 | bool assoc; /* assocate state */ | ||
182 | }; | 183 | }; |
183 | 184 | ||
184 | #define ath5k_hw_hasbssidmask(_ah) \ | 185 | #define ath5k_hw_hasbssidmask(_ah) \ |