diff mbox

[01/14] rtlwifi: btcoex: 21a 1ant: fw settings for softap mode

Message ID 20170410162310.7515-2-Larry.Finger@lwfinger.net (mailing list archive)
State Accepted
Commit 1bdd83392f7f7719e99bf8d2c0ead60639ce6f3b
Delegated to: Kalle Valo
Headers show

Commit Message

Larry Finger April 10, 2017, 4:22 p.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

For ap mode, adjust fw settings to operate properly.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Pkshih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c    | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

Comments

Kalle Valo April 13, 2017, 2:11 p.m. UTC | #1
Larry Finger <Larry.Finger@lwfinger.net> wrote:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> For ap mode, adjust fw settings to operate properly.
> 
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Pkshih <pkshih@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
> Cc: Steven Ting <steventing@realtek.com>

14 patches applied to wireless-drivers-next.git, thanks.

1bdd83392f7f rtlwifi: btcoex: 21a 1ant: fw settings for softap mode
19baccc4561f rtlwifi: btcoex: 21a 1ant: add function to check wifi status
3121b4ddd181 rtlwifi: btcoex: 21a 1ant: coex table setting for new fw
f0c40cf09dd1 rtlwifi: btcoex: 21a 1ant: mask profile bit for connect-ilde
e605103c443e rtlwifi: btcoex: 21a 1ant: remove setting for 2 antennas
4f78287e5ed9 rtlwifi: btcoex: 21a 1ant: set antenna control path for PTA
06a75324d543 rtlwifi: btcoex: 21a 1ant: add multi port action for miracast and P2P
edf8fa7b66f0 rtlwifi: btcoex: 21a 1ant: action when associating/authenticating
bcdffd050c80 rtlwifi: btcoex: 21a 1ant: If wifi only, do not initiate coex mechanism
19afb92222af rtlwifi: btcoex: 21a 1ant: move bt_disabled to global struct
ee828085176e rtlwifi: btcoex: 21a 1ant: consider more cases when bt inquiry
cb52b1185947 rtlwifi: btcoex: 21a 1ant: monitor bt profiling when scan
da0fd9ccb432 rtlwifi: btcoex: 21a 1ant: do not switch antenna when wifi is under 5G channel
4da5e7ea1352 rtlwifi: btcoex: 21a 1ant: avoid LPS/IPS mismatch for pnp notify
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index 6f6ab0738fbb..5b8f4ed5ce62 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -843,18 +843,35 @@  static void btc8821a1ant_set_fw_ps_tdma(struct btc_coexist *btcoexist, u8 byte1,
 {
 	struct rtl_priv *rtlpriv = btcoexist->adapter;
 	u8 h2c_parameter[5] = {0};
+	u8 real_byte1 = byte1, real_byte5 = byte5;
+	bool ap_enable = false;
 
-	h2c_parameter[0] = byte1;
+	btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE,
+			   &ap_enable);
+
+	if (ap_enable) {
+		if (byte1 & BIT4 && !(byte1 & BIT5)) {
+			RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
+				 "[BTCoex], FW for 1Ant AP mode\n");
+			real_byte1 &= ~BIT4;
+			real_byte1 |= BIT5;
+
+			real_byte5 |= BIT5;
+			real_byte5 &= ~BIT6;
+		}
+	}
+
+	h2c_parameter[0] = real_byte1;
 	h2c_parameter[1] = byte2;
 	h2c_parameter[2] = byte3;
 	h2c_parameter[3] = byte4;
-	h2c_parameter[4] = byte5;
+	h2c_parameter[4] = real_byte5;
 
-	coex_dm->ps_tdma_para[0] = byte1;
+	coex_dm->ps_tdma_para[0] = real_byte1;
 	coex_dm->ps_tdma_para[1] = byte2;
 	coex_dm->ps_tdma_para[2] = byte3;
 	coex_dm->ps_tdma_para[3] = byte4;
-	coex_dm->ps_tdma_para[4] = byte5;
+	coex_dm->ps_tdma_para[4] = real_byte5;
 
 	RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
 		 "[BTCoex], PS-TDMA H2C cmd =0x%x%08x\n",