ath9k: Initialize MCI params using a helper
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 22 Feb 2012 07:10:15 +0000 (12:40 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Feb 2012 19:06:33 +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/btcoex.c
drivers/net/wireless/ath/ath9k/btcoex.h
drivers/net/wireless/ath/ath9k/init.c

index a6712a95d76a24da330c4d628fc15455afce5536..6566952b08cc1c62aea70f74be25d1ac0ae4da63 100644 (file)
@@ -152,6 +152,30 @@ void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah)
 }
 EXPORT_SYMBOL(ath9k_hw_btcoex_init_3wire);
 
+void ath9k_hw_btcoex_init_mci(struct ath_hw *ah)
+{
+       ah->btcoex_hw.mci.ready = false;
+       ah->btcoex_hw.mci.bt_state = 0;
+       ah->btcoex_hw.mci.bt_ver_major = 3;
+       ah->btcoex_hw.mci.bt_ver_minor = 0;
+       ah->btcoex_hw.mci.bt_version_known = false;
+       ah->btcoex_hw.mci.update_2g5g = true;
+       ah->btcoex_hw.mci.is_2g = true;
+       ah->btcoex_hw.mci.wlan_channels_update = false;
+       ah->btcoex_hw.mci.wlan_channels[0] = 0x00000000;
+       ah->btcoex_hw.mci.wlan_channels[1] = 0xffffffff;
+       ah->btcoex_hw.mci.wlan_channels[2] = 0xffffffff;
+       ah->btcoex_hw.mci.wlan_channels[3] = 0x7fffffff;
+       ah->btcoex_hw.mci.query_bt = true;
+       ah->btcoex_hw.mci.unhalt_bt_gpm = true;
+       ah->btcoex_hw.mci.halted_bt_gpm = false;
+       ah->btcoex_hw.mci.need_flush_btinfo = false;
+       ah->btcoex_hw.mci.wlan_cal_seq = 0;
+       ah->btcoex_hw.mci.wlan_cal_done = 0;
+       ah->btcoex_hw.mci.config = 0x2201;
+}
+EXPORT_SYMBOL(ath9k_hw_btcoex_init_mci);
+
 static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah)
 {
        struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
index 0cb7ce98394bbb705d23cd26198fea0009f1c2d0..0cb15cd85e9214a1d8b7925393bc9996fc36adf6 100644 (file)
@@ -99,6 +99,7 @@ struct ath_btcoex_hw {
 
 void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah);
 void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah);
+void ath9k_hw_btcoex_init_mci(struct ath_hw *ah);
 void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum);
 void ath9k_hw_btcoex_set_weight(struct ath_hw *ah,
                                u32 bt_weight,
index 53a005d288aa53949da6e1317c57e294a092a907..a944fc95f69f9b020402b1c6c1795e740f39753b 100644 (file)
@@ -449,27 +449,8 @@ static int ath9k_init_btcoex(struct ath_softc *sc)
                if (r)
                        return r;
 
-               if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) {
-                       ah->btcoex_hw.mci.ready = false;
-                       ah->btcoex_hw.mci.bt_state = 0;
-                       ah->btcoex_hw.mci.bt_ver_major = 3;
-                       ah->btcoex_hw.mci.bt_ver_minor = 0;
-                       ah->btcoex_hw.mci.bt_version_known = false;
-                       ah->btcoex_hw.mci.update_2g5g = true;
-                       ah->btcoex_hw.mci.is_2g = true;
-                       ah->btcoex_hw.mci.wlan_channels_update = false;
-                       ah->btcoex_hw.mci.wlan_channels[0] = 0x00000000;
-                       ah->btcoex_hw.mci.wlan_channels[1] = 0xffffffff;
-                       ah->btcoex_hw.mci.wlan_channels[2] = 0xffffffff;
-                       ah->btcoex_hw.mci.wlan_channels[3] = 0x7fffffff;
-                       ah->btcoex_hw.mci.query_bt = true;
-                       ah->btcoex_hw.mci.unhalt_bt_gpm = true;
-                       ah->btcoex_hw.mci.halted_bt_gpm = false;
-                       ah->btcoex_hw.mci.need_flush_btinfo = false;
-                       ah->btcoex_hw.mci.wlan_cal_seq = 0;
-                       ah->btcoex_hw.mci.wlan_cal_done = 0;
-                       ah->btcoex_hw.mci.config = 0x2201;
-               }
+               ath9k_hw_btcoex_init_mci(ah);
+
                break;
        default:
                WARN_ON(1);