ath9k: Add a routine to tear down channel contexts
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Sat, 23 Aug 2014 07:59:07 +0000 (13:29 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 28 Aug 2014 18:49:36 +0000 (14:49 -0400)
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/wow.c

index eb3572f..e88e18d 100644 (file)
@@ -437,6 +437,7 @@ void ath_roc_complete(struct ath_softc *sc, bool abort);
 bool ath9k_is_chanctx_enabled(void);
 void ath9k_fill_chanctx_ops(void);
 void ath9k_init_channel_context(struct ath_softc *sc);
+void ath9k_deinit_channel_context(struct ath_softc *sc);
 int ath9k_init_p2p(struct ath_softc *sc);
 void ath9k_deinit_p2p(struct ath_softc *sc);
 void ath9k_p2p_remove_vif(struct ath_softc *sc,
@@ -456,6 +457,9 @@ static inline void ath9k_fill_chanctx_ops(void)
 static inline void ath9k_init_channel_context(struct ath_softc *sc)
 {
 }
+static inline void ath9k_deinit_channel_context(struct ath_softc *sc)
+{
+}
 static inline int ath9k_init_p2p(struct ath_softc *sc)
 {
        return 0;
index a4366c1..9c2cf90 100644 (file)
@@ -959,6 +959,11 @@ void ath9k_init_channel_context(struct ath_softc *sc)
                    (unsigned long)sc);
 }
 
+void ath9k_deinit_channel_context(struct ath_softc *sc)
+{
+       cancel_work_sync(&sc->chanctx_work);
+}
+
 bool ath9k_is_chanctx_enabled(void)
 {
        return (ath9k_use_chanctx == 1);
index ed281ac..e5c523a 100644 (file)
@@ -822,7 +822,8 @@ static void ath9k_stop(struct ieee80211_hw *hw)
        struct ath_common *common = ath9k_hw_common(ah);
        bool prev_idle;
 
-       cancel_work_sync(&sc->chanctx_work);
+       ath9k_deinit_channel_context(sc);
+
        mutex_lock(&sc->mutex);
 
        ath_cancel_work(sc);
index a4f4f0d..33531d9 100644 (file)
@@ -193,7 +193,8 @@ int ath9k_suspend(struct ieee80211_hw *hw,
        u32 wow_triggers_enabled = 0;
        int ret = 0;
 
-       cancel_work_sync(&sc->chanctx_work);
+       ath9k_deinit_channel_context(sc);
+
        mutex_lock(&sc->mutex);
 
        ath_cancel_work(sc);