ath9k: fix fullsleep power consumption when BTCOEX is enabled
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Sun, 1 Jul 2012 14:23:53 +0000 (19:53 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Jul 2012 20:36:19 +0000 (16:36 -0400)
As soon as the interface brought up, btcoex timer starts running
eventhough the interface is in idle state and WLAN chip is moved
to full sleep mode. There is no point in running btcoex timer when
the wlan interface is in sleep mode and also it might consumes
more power on WLAN idle unassociated state. So lets stop the
btcoex when wlan is idle state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index e4e73f061a221e6c0eb30f7df2e2360164becd6b..6ce012815ba6e84f422647622c43b9409c5e6c35 100644 (file)
@@ -666,8 +666,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
 
        spin_unlock_bh(&sc->sc_pcu_lock);
 
-       ath9k_start_btcoex(sc);
-
        if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en)
                common->bus_ops->extn_synch_en(common);
 
@@ -774,8 +772,6 @@ static void ath9k_stop(struct ieee80211_hw *hw)
        /* Ensure HW is awake when we try to shut it down. */
        ath9k_ps_wakeup(sc);
 
-       ath9k_stop_btcoex(sc);
-
        spin_lock_bh(&sc->sc_pcu_lock);
 
        /* prevent tasklets to enable interrupts once we disable them */
@@ -1139,14 +1135,17 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 
        if (changed & IEEE80211_CONF_CHANGE_IDLE) {
                sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
-               if (sc->ps_idle)
+               if (sc->ps_idle) {
                        ath_cancel_work(sc);
-               else
+                       ath9k_stop_btcoex(sc);
+               } else {
+                       ath9k_start_btcoex(sc);
                        /*
                         * The chip needs a reset to properly wake up from
                         * full sleep
                         */
                        reset_channel = ah->chip_fullsleep;
+               }
        }
 
        /*