summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChing-Te Ku <ku920601@realtek.com>2024-02-29 15:45:13 +0800
committerKalle Valo <kvalo@kernel.org>2024-03-05 20:54:46 +0200
commitbb90a32c3c7d3475dc751b2c0208bd10838d4e31 (patch)
treef297fb2a1e5270a63b788a84b0f1d21a5b8f4341 /drivers
parenteae888cfb73483ccf8175da9bbc8cc2e313c7083 (diff)
wifi: rtw89: coex: When Bluetooth not available don't set power/gain
If Bluetooth is working, it will update their info regularly. And the code will increase the counters while the info updating. Use this counter to judge is Bluetooth working or not. Don't need to set Bluetooth power or gain when it is not working. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240229074514.219276-8-pkshih@realtek.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/realtek/rtw89/coex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
index c74b1b6be2d3..6a1f9a555ce7 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.c
+++ b/drivers/net/wireless/realtek/rtw89/coex.c
@@ -2311,6 +2311,9 @@ static void _set_bt_tx_power(struct rtw89_dev *rtwdev, u8 level)
int ret;
u8 buf;
+ if (btc->cx.cnt_bt[BTC_BCNT_INFOUPDATE] == 0)
+ return;
+
if (bt->rf_para.tx_pwr_freerun == level)
return;
@@ -2333,6 +2336,9 @@ static void _set_bt_rx_gain(struct rtw89_dev *rtwdev, u8 level)
struct rtw89_btc *btc = &rtwdev->btc;
struct rtw89_btc_bt_info *bt = &btc->cx.bt;
+ if (btc->cx.cnt_bt[BTC_BCNT_INFOUPDATE] == 0)
+ return;
+
if ((bt->rf_para.rx_gain_freerun == level ||
level > BTC_BT_RX_NORMAL_LVL) &&
(!rtwdev->chip->scbd || bt->lna_constrain == level))