Commit 2380a220 authored by Ching-Te Ku's avatar Ching-Te Ku Committed by Kalle Valo

wifi: rtw89: coex: Update function to get BT RSSI and hardware counter

Correct Bluetooth RSSI count method. The 6dB is the gap between hardware
packet sampled value and real RSSI value.
Signed-off-by: default avatarChing-Te Ku <ku920601@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230412012831.10519-4-pkshih@realtek.com
parent 9fde3056
...@@ -1832,7 +1832,8 @@ rtw8852a_btc_set_wl_txpwr_ctrl(struct rtw89_dev *rtwdev, u32 txpwr_val) ...@@ -1832,7 +1832,8 @@ rtw8852a_btc_set_wl_txpwr_ctrl(struct rtw89_dev *rtwdev, u32 txpwr_val)
static static
s8 rtw8852a_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val) 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[] = { static struct rtw89_btc_rf_trx_para rtw89_btc_8852a_rf_ul[] = {
......
...@@ -2279,7 +2279,8 @@ do { \ ...@@ -2279,7 +2279,8 @@ do { \
static static
s8 rtw8852b_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val) 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 static
......
...@@ -2533,7 +2533,8 @@ do { \ ...@@ -2533,7 +2533,8 @@ do { \
static static
s8 rtw8852c_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val) 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[] = { static const struct rtw89_btc_rf_trx_para rtw89_btc_8852c_rf_ul[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment