ath9k_htc: Start/stop btcoex using a helper
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 22 Feb 2012 07:11:36 +0000 (12:41 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Feb 2012 19:06:37 +0000 (14:06 -0500)
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c

index da5596766d8219791948a2f2ca26c719ec9ee7aa..71e877eb6ddf09e7a705846db7847add1af5c3d6 100644 (file)
@@ -400,6 +400,8 @@ struct ath_btcoex {
        u32 btscan_no_stomp;
 };
 
+void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv);
+void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv);
 void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv);
 void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv);
 void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv);
index 6506e1fd503649ad42246b84c49c618b5b818ad9..82f02f769b510f2dcd15300a8edae509337947b2 100644 (file)
@@ -160,6 +160,30 @@ void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv)
        cancel_delayed_work_sync(&priv->duty_cycle_work);
 }
 
+void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
+{
+       struct ath_hw *ah = priv->ah;
+
+       if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) {
+               ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
+                                          AR_STOMP_LOW_WLAN_WGHT);
+               ath9k_hw_btcoex_enable(ah);
+               ath_htc_resume_btcoex_work(priv);
+       }
+}
+
+void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
+{
+       struct ath_hw *ah = priv->ah;
+
+       if (ah->btcoex_hw.enabled &&
+           ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
+               ath9k_hw_btcoex_disable(ah);
+               if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
+                       ath_htc_cancel_btcoex_work(priv);
+       }
+}
+
 /*******/
 /* LED */
 /*******/
index 06101b6bdeac97777813820e87e53c4e350737ce..2a29a7cdef18f34630098025a916314b7600d9af 100644 (file)
@@ -957,12 +957,8 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
        mod_timer(&priv->tx.cleanup_timer,
                  jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL));
 
-       if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) {
-               ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
-                                          AR_STOMP_LOW_WLAN_WGHT);
-               ath9k_hw_btcoex_enable(ah);
-               ath_htc_resume_btcoex_work(priv);
-       }
+       ath9k_htc_start_btcoex(priv);
+
        mutex_unlock(&priv->mutex);
 
        return ret;
@@ -1009,12 +1005,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
 
        mutex_lock(&priv->mutex);
 
-       if (ah->btcoex_hw.enabled &&
-           ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
-               ath9k_hw_btcoex_disable(ah);
-               if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
-                       ath_htc_cancel_btcoex_work(priv);
-       }
+       ath9k_htc_stop_btcoex(priv);
 
        /* Remove a monitor interface if it's present. */
        if (priv->ah->is_monitoring)