ath9k: Split ath9k_hw_btcoex_enable() into two logical pieces
This function currently does initialization + enable the
btcoex support. Split it into two logical functions which
does the above operations separately. Btcoex initialization
is done during attach time and enabling this feature is done
in start(). Also, add code to disable btcoex support in stop().
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index eb8d673..878d3be 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1509,8 +1509,8 @@
ARRAY_SIZE(ath9k_5ghz_chantable);
}
- if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX)
- ath9k_hw_btcoex_enable(sc->sc_ah);
+ if (ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX)
+ ath9k_hw_btcoex_init(ah);
return 0;
bad2:
@@ -1992,6 +1992,10 @@
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
+ if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) &&
+ !(sc->sc_flags & SC_OP_BTCOEX_ENABLED))
+ ath9k_hw_btcoex_enable(sc->sc_ah);
+
mutex_unlock:
mutex_unlock(&sc->mutex);
@@ -2138,6 +2142,9 @@
wiphy_rfkill_stop_polling(sc->hw->wiphy);
+ if (sc->sc_flags & SC_OP_BTCOEX_ENABLED)
+ ath9k_hw_btcoex_disable(sc->sc_ah);
+
/* disable HAL and put h/w to sleep */
ath9k_hw_disable(sc->sc_ah);
ath9k_hw_configpcipowersave(sc->sc_ah, 1);