Commit df198b17 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

ath9k: Use proper start/stop routines for BTCOEX

Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5908120f
...@@ -456,7 +456,8 @@ struct ath_btcoex { ...@@ -456,7 +456,8 @@ struct ath_btcoex {
int ath9k_init_btcoex(struct ath_softc *sc); int ath9k_init_btcoex(struct ath_softc *sc);
void ath9k_deinit_btcoex(struct ath_softc *sc); void ath9k_deinit_btcoex(struct ath_softc *sc);
int ath_init_btcoex_timer(struct ath_softc *sc); void ath9k_start_btcoex(struct ath_softc *sc);
void ath9k_stop_btcoex(struct ath_softc *sc);
void ath9k_btcoex_timer_resume(struct ath_softc *sc); void ath9k_btcoex_timer_resume(struct ath_softc *sc);
void ath9k_btcoex_timer_pause(struct ath_softc *sc); void ath9k_btcoex_timer_pause(struct ath_softc *sc);
......
...@@ -245,7 +245,7 @@ static void ath_btcoex_no_stomp_timer(void *arg) ...@@ -245,7 +245,7 @@ static void ath_btcoex_no_stomp_timer(void *arg)
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
} }
int ath_init_btcoex_timer(struct ath_softc *sc) static int ath_init_btcoex_timer(struct ath_softc *sc)
{ {
struct ath_btcoex *btcoex = &sc->btcoex; struct ath_btcoex *btcoex = &sc->btcoex;
...@@ -318,6 +318,35 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc) ...@@ -318,6 +318,35 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
btcoex->hw_timer_enabled = false; btcoex->hw_timer_enabled = false;
} }
void ath9k_start_btcoex(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) &&
!ah->btcoex_hw.enabled) {
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
ath9k_hw_btcoex_enable(ah);
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
ath9k_btcoex_timer_resume(sc);
}
}
void ath9k_stop_btcoex(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
if (ah->btcoex_hw.enabled &&
ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
ath9k_hw_btcoex_disable(ah);
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
ath9k_btcoex_timer_pause(sc);
ath_mci_flush_profile(&sc->btcoex.mci);
}
}
void ath9k_deinit_btcoex(struct ath_softc *sc) void ath9k_deinit_btcoex(struct ath_softc *sc)
{ {
if ((sc->btcoex.no_stomp_timer) && if ((sc->btcoex.no_stomp_timer) &&
......
...@@ -1075,16 +1075,7 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1075,16 +1075,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && ath9k_start_btcoex(sc);
!ah->btcoex_hw.enabled) {
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
ath9k_hw_btcoex_enable(ah);
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
ath9k_btcoex_timer_resume(sc);
}
if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en)
common->bus_ops->extn_synch_en(common); common->bus_ops->extn_synch_en(common);
...@@ -1185,13 +1176,7 @@ static void ath9k_stop(struct ieee80211_hw *hw) ...@@ -1185,13 +1176,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
/* Ensure HW is awake when we try to shut it down. */ /* Ensure HW is awake when we try to shut it down. */
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
if (ah->btcoex_hw.enabled && ath9k_stop_btcoex(sc);
ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
ath9k_hw_btcoex_disable(ah);
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
ath9k_btcoex_timer_pause(sc);
ath_mci_flush_profile(&sc->btcoex.mci);
}
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment