aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-27 02:48:40 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-27 02:48:40 -0500
commit5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (patch)
tree22d29905c148d2d743b3eccb585fbe60fb91e25a /drivers/net/wireless/ath5k/base.c
parent851fd7bd88524bb4e20f3def3127cd9167d6d0cf (diff)
parent3ec192559033ed457f0d7856838654c100fc659f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/hp-plus.c drivers/net/wireless/ath5k/base.c drivers/net/wireless/ath9k/recv.c net/wireless/reg.c
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 4bcea5a9d70b..0e4317010ed0 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -240,7 +240,12 @@ static int ath5k_get_tx_stats(struct ieee80211_hw *hw,
240 struct ieee80211_tx_queue_stats *stats); 240 struct ieee80211_tx_queue_stats *stats);
241static u64 ath5k_get_tsf(struct ieee80211_hw *hw); 241static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
242static void ath5k_reset_tsf(struct ieee80211_hw *hw); 242static void ath5k_reset_tsf(struct ieee80211_hw *hw);
243static int ath5k_beacon_update(struct ath5k_softc *sc, struct sk_buff *skb); 243static int ath5k_beacon_update(struct ath5k_softc *sc,
244 struct sk_buff *skb);
245static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
246 struct ieee80211_vif *vif,
247 struct ieee80211_bss_conf *bss_conf,
248 u32 changes);
244 249
245static struct ieee80211_ops ath5k_hw_ops = { 250static struct ieee80211_ops ath5k_hw_ops = {
246 .tx = ath5k_tx, 251 .tx = ath5k_tx,
@@ -257,6 +262,7 @@ static struct ieee80211_ops ath5k_hw_ops = {
257 .get_tx_stats = ath5k_get_tx_stats, 262 .get_tx_stats = ath5k_get_tx_stats,
258 .get_tsf = ath5k_get_tsf, 263 .get_tsf = ath5k_get_tsf,
259 .reset_tsf = ath5k_reset_tsf, 264 .reset_tsf = ath5k_reset_tsf,
265 .bss_info_changed = ath5k_bss_info_changed,
260}; 266};
261 267
262/* 268/*
@@ -2961,7 +2967,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
2961 sc->opmode != NL80211_IFTYPE_MESH_POINT && 2967 sc->opmode != NL80211_IFTYPE_MESH_POINT &&
2962 test_bit(ATH_STAT_PROMISC, sc->status)) 2968 test_bit(ATH_STAT_PROMISC, sc->status))
2963 rfilt |= AR5K_RX_FILTER_PROM; 2969 rfilt |= AR5K_RX_FILTER_PROM;
2964 if (sc->opmode == NL80211_IFTYPE_STATION || 2970 if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) ||
2965 sc->opmode == NL80211_IFTYPE_ADHOC || 2971 sc->opmode == NL80211_IFTYPE_ADHOC ||
2966 sc->opmode == NL80211_IFTYPE_AP) 2972 sc->opmode == NL80211_IFTYPE_AP)
2967 rfilt |= AR5K_RX_FILTER_BEACON; 2973 rfilt |= AR5K_RX_FILTER_BEACON;
@@ -3101,4 +3107,32 @@ ath5k_beacon_update(struct ath5k_softc *sc, struct sk_buff *skb)
3101 3107
3102 return ret; 3108 return ret;
3103} 3109}
3110static void
3111set_beacon_filter(struct ieee80211_hw *hw, bool enable)
3112{
3113 struct ath5k_softc *sc = hw->priv;
3114 struct ath5k_hw *ah = sc->ah;
3115 u32 rfilt;
3116 rfilt = ath5k_hw_get_rx_filter(ah);
3117 if (enable)
3118 rfilt |= AR5K_RX_FILTER_BEACON;
3119 else
3120 rfilt &= ~AR5K_RX_FILTER_BEACON;
3121 ath5k_hw_set_rx_filter(ah, rfilt);
3122 sc->filter_flags = rfilt;
3123}
3104 3124
3125static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
3126 struct ieee80211_vif *vif,
3127 struct ieee80211_bss_conf *bss_conf,
3128 u32 changes)
3129{
3130 struct ath5k_softc *sc = hw->priv;
3131 if (changes & BSS_CHANGED_ASSOC) {
3132 mutex_lock(&sc->lock);
3133 sc->assoc = bss_conf->assoc;
3134 if (sc->opmode == NL80211_IFTYPE_STATION)
3135 set_beacon_filter(hw, sc->assoc);
3136 mutex_unlock(&sc->lock);
3137 }
3138}