Commit d2f299a4 authored by Ching-Te Ku's avatar Ching-Te Ku Committed by Ping-Ke Shih

wifi: rtw89: coex: Add coexistence policy for hardware scan

Add additional policy option to let Bluetooth audio can play well
during Wi-Fi is hardware scanning.
Signed-off-by: default avatarChing-Te Ku <ku920601@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240626023129.7776-1-pkshih@realtek.com
parent d0b4b8ef
...@@ -91,7 +91,7 @@ static const struct rtw89_btc_fbtc_slot s_def[] = { ...@@ -91,7 +91,7 @@ static const struct rtw89_btc_fbtc_slot s_def[] = {
[CXST_BLK] = __DEF_FBTC_SLOT(500, 0x55555555, SLOT_MIX), [CXST_BLK] = __DEF_FBTC_SLOT(500, 0x55555555, SLOT_MIX),
[CXST_E2G] = __DEF_FBTC_SLOT(0, 0xea5a5a5a, SLOT_MIX), [CXST_E2G] = __DEF_FBTC_SLOT(0, 0xea5a5a5a, SLOT_MIX),
[CXST_E5G] = __DEF_FBTC_SLOT(0, 0xffffffff, SLOT_ISO), [CXST_E5G] = __DEF_FBTC_SLOT(0, 0xffffffff, SLOT_ISO),
[CXST_EBT] = __DEF_FBTC_SLOT(0, 0xe5555555, SLOT_MIX), [CXST_EBT] = __DEF_FBTC_SLOT(5, 0xe5555555, SLOT_MIX),
[CXST_ENULL] = __DEF_FBTC_SLOT(0, 0xaaaaaaaa, SLOT_ISO), [CXST_ENULL] = __DEF_FBTC_SLOT(0, 0xaaaaaaaa, SLOT_ISO),
[CXST_WLK] = __DEF_FBTC_SLOT(250, 0xea5a5a5a, SLOT_MIX), [CXST_WLK] = __DEF_FBTC_SLOT(250, 0xea5a5a5a, SLOT_MIX),
[CXST_W1FDD] = __DEF_FBTC_SLOT(50, 0xffffffff, SLOT_ISO), [CXST_W1FDD] = __DEF_FBTC_SLOT(50, 0xffffffff, SLOT_ISO),
...@@ -3617,6 +3617,7 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type) ...@@ -3617,6 +3617,7 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type)
struct rtw89_btc_wl_info *wl = &btc->cx.wl; struct rtw89_btc_wl_info *wl = &btc->cx.wl;
u8 type, null_role; u8 type, null_role;
u32 tbl_w1, tbl_b1, tbl_b4; u32 tbl_w1, tbl_b1, tbl_b4;
u16 dur_2;
type = FIELD_GET(BTC_CXP_MASK, policy_type); type = FIELD_GET(BTC_CXP_MASK, policy_type);
...@@ -3727,7 +3728,21 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type) ...@@ -3727,7 +3728,21 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type)
if (hid->exist || hfp->exist) if (hid->exist || hfp->exist)
tbl_w1 = cxtbl[16]; tbl_w1 = cxtbl[16];
dur_2 = dm->e2g_slot_limit;
switch (policy_type) { switch (policy_type) {
case BTC_CXP_OFFE_2GBWISOB: /* for normal-case */
_slot_set(btc, CXST_E2G, 0, tbl_w1, SLOT_ISO);
_slot_set_le(btc, CXST_EBT, s_def[CXST_EBT].dur,
s_def[CXST_EBT].cxtbl, s_def[CXST_EBT].cxtype);
_slot_set_dur(btc, CXST_EBT, dur_2);
break;
case BTC_CXP_OFFE_2GISOB: /* for bt no-link */
_slot_set(btc, CXST_E2G, 0, cxtbl[1], SLOT_ISO);
_slot_set_le(btc, CXST_EBT, s_def[CXST_EBT].dur,
s_def[CXST_EBT].cxtbl, s_def[CXST_EBT].cxtype);
_slot_set_dur(btc, CXST_EBT, dur_2);
break;
case BTC_CXP_OFFE_DEF: case BTC_CXP_OFFE_DEF:
_slot_set_le(btc, CXST_E2G, s_def[CXST_E2G].dur, _slot_set_le(btc, CXST_E2G, s_def[CXST_E2G].dur,
s_def[CXST_E2G].cxtbl, s_def[CXST_E2G].cxtype); s_def[CXST_E2G].cxtbl, s_def[CXST_E2G].cxtype);
...@@ -3747,6 +3762,15 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type) ...@@ -3747,6 +3762,15 @@ void rtw89_btc_set_policy_v1(struct rtw89_dev *rtwdev, u16 policy_type)
_slot_set_le(btc, CXST_ENULL, s_def[CXST_ENULL].dur, _slot_set_le(btc, CXST_ENULL, s_def[CXST_ENULL].dur,
s_def[CXST_ENULL].cxtbl, s_def[CXST_ENULL].cxtype); s_def[CXST_ENULL].cxtbl, s_def[CXST_ENULL].cxtype);
break; break;
case BTC_CXP_OFFE_2GBWMIXB:
_slot_set(btc, CXST_E2G, 0, 0x55555555, SLOT_MIX);
_slot_set_le(btc, CXST_EBT, s_def[CXST_EBT].dur,
cpu_to_le32(0x55555555), s_def[CXST_EBT].cxtype);
break;
case BTC_CXP_OFFE_WL: /* for 4-way */
_slot_set(btc, CXST_E2G, 0, cxtbl[1], SLOT_MIX);
_slot_set(btc, CXST_EBT, 0, cxtbl[1], SLOT_MIX);
break;
default: default:
break; break;
} }
......
...@@ -1330,6 +1330,7 @@ struct rtw89_btc_wl_smap { ...@@ -1330,6 +1330,7 @@ struct rtw89_btc_wl_smap {
u32 scan: 1; u32 scan: 1;
u32 connecting: 1; u32 connecting: 1;
u32 roaming: 1; u32 roaming: 1;
u32 dbccing: 1;
u32 transacting: 1; u32 transacting: 1;
u32 _4way: 1; u32 _4way: 1;
u32 rf_off: 1; u32 rf_off: 1;
......
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