OSDN Git Service

wifi: rtw89: coex: Update function to get BT RSSI and hardware counter
authorChing-Te Ku <ku920601@realtek.com>
Wed, 12 Apr 2023 01:28:30 +0000 (09:28 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 17 Apr 2023 09:49:22 +0000 (12:49 +0300)
Correct Bluetooth RSSI count method. The 6dB is the gap between hardware
packet sampled value and real RSSI value.

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://lore.kernel.org/r/20230412012831.10519-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/rtw8852a.c
drivers/net/wireless/realtek/rtw89/rtw8852b.c
drivers/net/wireless/realtek/rtw89/rtw8852c.c

index eb7a834..d7930ef 100644 (file)
@@ -1832,7 +1832,8 @@ rtw8852a_btc_set_wl_txpwr_ctrl(struct rtw89_dev *rtwdev, u32 txpwr_val)
 static
 s8 rtw8852a_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val)
 {
-       return clamp_t(s8, val, -100, 0) + 100;
+       /* +6 for compensate offset */
+       return clamp_t(s8, val + 6, -100, 0) + 100;
 }
 
 static struct rtw89_btc_rf_trx_para rtw89_btc_8852a_rf_ul[] = {
index ea4a4dc..eaa2ea0 100644 (file)
@@ -2279,7 +2279,8 @@ do {                                                              \
 static
 s8 rtw8852b_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val)
 {
-       return clamp_t(s8, val, -100, 0) + 100;
+       /* +6 for compensate offset */
+       return clamp_t(s8, val + 6, -100, 0) + 100;
 }
 
 static
index 31e1650..ceb819a 100644 (file)
@@ -2533,7 +2533,8 @@ do {                                                              \
 static
 s8 rtw8852c_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val)
 {
-       return clamp_t(s8, val, -100, 0) + 100;
+       /* +6 for compensate offset */
+       return clamp_t(s8, val + 6, -100, 0) + 100;
 }
 
 static const struct rtw89_btc_rf_trx_para rtw89_btc_8852c_rf_ul[] = {