aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index d80d5be2ccb..1caaf922ba9 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -19,6 +19,9 @@
19#include "ath9k.h" 19#include "ath9k.h"
20#include "btcoex.h" 20#include "btcoex.h"
21 21
22static void ath9k_set_assoc_state(struct ath_softc *sc,
23 struct ieee80211_vif *vif);
24
22u8 ath9k_parse_mpdudensity(u8 mpdudensity) 25u8 ath9k_parse_mpdudensity(u8 mpdudensity)
23{ 26{
24 /* 27 /*
@@ -878,6 +881,18 @@ static void ath9k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
878 } 881 }
879} 882}
880 883
884static void ath9k_sta_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
885{
886 struct ath_softc *sc = data;
887 struct ath_vif *avp = (void *)vif->drv_priv;
888
889 if (vif->type != NL80211_IFTYPE_STATION)
890 return;
891
892 if (avp->primary_sta_vif)
893 ath9k_set_assoc_state(sc, vif);
894}
895
881/* Called with sc->mutex held. */ 896/* Called with sc->mutex held. */
882void ath9k_calculate_iter_data(struct ieee80211_hw *hw, 897void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
883 struct ieee80211_vif *vif, 898 struct ieee80211_vif *vif,
@@ -911,6 +926,7 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
911 struct ath_hw *ah = sc->sc_ah; 926 struct ath_hw *ah = sc->sc_ah;
912 struct ath_common *common = ath9k_hw_common(ah); 927 struct ath_common *common = ath9k_hw_common(ah);
913 struct ath9k_vif_iter_data iter_data; 928 struct ath9k_vif_iter_data iter_data;
929 enum nl80211_iftype old_opmode = ah->opmode;
914 930
915 ath9k_calculate_iter_data(hw, vif, &iter_data); 931 ath9k_calculate_iter_data(hw, vif, &iter_data);
916 932
@@ -941,6 +957,17 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
941 ah->imask &= ~ATH9K_INT_TSFOOR; 957 ah->imask &= ~ATH9K_INT_TSFOOR;
942 958
943 ath9k_hw_set_interrupts(ah); 959 ath9k_hw_set_interrupts(ah);
960
961 /*
962 * If we are changing the opmode to STATION,
963 * a beacon sync needs to be done.
964 */
965 if (ah->opmode == NL80211_IFTYPE_STATION &&
966 old_opmode == NL80211_IFTYPE_AP &&
967 test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
968 ieee80211_iterate_active_interfaces_atomic(sc->hw,
969 ath9k_sta_vif_iter, sc);
970 }
944} 971}
945 972
946static int ath9k_add_interface(struct ieee80211_hw *hw, 973static int ath9k_add_interface(struct ieee80211_hw *hw,