Skip to content

Commit

Permalink
rtlwifi: btcoex: set correct interface type and parameter.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ping-Ke Shih authored and Kalle Valo committed Jun 21, 2017
1 parent 87d8a9f commit 43f5644
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++;

Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 43f5644

Please sign in to comment.