rtlwifi: btcoex: set correct interface type and parameter.
authorPing-Ke Shih <pkshih@realtek.com>
Sun, 18 Jun 2017 16:12:40 +0000 (11:12 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 21 Jun 2017 15:27:58 +0000 (18:27 +0300)
This commit fixies two problems. The first one is interface types
(e.g. PCI) that are used to switch antenna, and the second is to add
wifi_only parameter to give correct state.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c

index f00d6e6ab69b411755d4e864ccbcc98a10a3ace0..451039ac7b0ad13c4cf5deb7236f7540981a1782 100644 (file)
@@ -803,8 +803,6 @@ bool exhalbtc_initlize_variables(void)
 
        halbtc_dbg_init();
 
-       btcoexist->chip_interface = BTC_INTF_UNKNOWN;
-
        btcoexist->btc_read_1byte = halbtc_read_1byte;
        btcoexist->btc_write_1byte = halbtc_write_1byte;
        btcoexist->btc_write_1byte_bitmask = halbtc_bitmask_write_1byte;
@@ -843,6 +841,18 @@ bool exhalbtc_bind_bt_coex_withadapter(void *adapter)
        if (btcoexist->binded)
                return false;
 
+       switch (rtlpriv->rtlhal.interface) {
+       case INTF_PCI:
+               btcoexist->chip_interface = BTC_INTF_PCI;
+               break;
+       case INTF_USB:
+               btcoexist->chip_interface = BTC_INTF_USB;
+               break;
+       default:
+               btcoexist->chip_interface = BTC_INTF_UNKNOWN;
+               break;
+       }
+
        btcoexist->binded = true;
        btcoexist->statistics.cnt_bind++;
 
@@ -912,10 +922,8 @@ void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist)
        }
 }
 
-void exhalbtc_init_hw_config(struct btc_coexist *btcoexist)
+void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only)
 {
-       bool wifi_only = true;
-
        if (!halbtc_is_bt_coexist_available(btcoexist))
                return;
 
index 21d39973feabdd876366a2bae3e34015ed642c9f..f9b87c12db099abe361bf769d60e770d4a4f2c50 100644 (file)
@@ -601,7 +601,7 @@ extern struct btc_coexist gl_bt_coexist;
 
 bool exhalbtc_initlize_variables(void);
 bool exhalbtc_bind_bt_coex_withadapter(void *adapter);
-void exhalbtc_init_hw_config(struct btc_coexist *btcoexist);
+void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only);
 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist);
 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type);
 void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type);
index 7d4a94efe260516231a2cf65e928d3ceb39f0f37..9635c1478875a6acbcdf5415f19ed0e09032d85c 100644 (file)
@@ -68,7 +68,7 @@ void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv)
        RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
                "%s, bt_exist is %d\n", __func__, bt_exist);
 
-       exhalbtc_init_hw_config(&gl_bt_coexist);
+       exhalbtc_init_hw_config(&gl_bt_coexist, !bt_exist);
        exhalbtc_init_coex_dm(&gl_bt_coexist);
 }