rtw88: coex: fix and update settings to enhance coex performance
[email protected]
maintainerv2 cover rtw88: coex: fix and update settings to enhance coex performance
From: Ping-Ke Shih <[email protected]>
This is second patchset of my total 32 coex patches, in which we fix and update coex settings to enhance coex performance in field.
v2:
- (01/11) "rtw88: coex: update TDMA settings for different beacon interval" give proper names and use suggested macros.
- (02/11)"rtw88: coex: remove unnecessary feature/function" describe "why" in commit log
Ching-Te Ku (11):
rtw88: coex: update TDMA settings for different beacon interval
rtw88: coex: remove unnecessary feature/function
rtw88: coex: add write scoreboard action when WLAN in critical
procedure
rtw88: coex: Add force flag for coexistence table function
rtw88: coex: add the mechanism for RF4CE
rtw88: coex: update the TDMA parameter when leave LPS
rtw88: coex: Change antenna setting to enhance free-run performance
rtw88: coex: fix BT performance drop during initial/power-on step
rtw88: coex: remove write scan bit to scoreboard in scan and connect
notify
rtw88: coex: remove unnecessary WLAN slot extend
rtw88: coex: change the decode method from firmware
drivers/net/wireless/realtek/rtw88/coex.c | 200 +++++++++++------- drivers/net/wireless/realtek/rtw88/coex.h | 5 + drivers/net/wireless/realtek/rtw88/mac80211.c | 7 + drivers/net/wireless/realtek/rtw88/main.h | 1 + 4 files changed, 135 insertions(+), 78 deletions(-)
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 1/11 rtw88: coex: update TDMA settings for different beacon interval
From: Ching-Te Ku <[email protected]>
Add considering for different WLAN beacon interval in coexistence mechanism.
Because the WLAN beacon period may be not 100 ms, so it's necessary to consider any beacon period and set timer according to the interval.
---
v2: give proper name and use suggested macros
--- drivers/net/wireless/realtek/rtw88/coex.c | 27 ++++++++++++++++--- drivers/net/wireless/realtek/rtw88/coex.h | 5 ++++ drivers/net/wireless/realtek/rtw88/mac80211.c | 7 +++++ drivers/net/wireless/realtek/rtw88/main.h | 1 + 4 files changed, 36 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +23 -4
@@ -225,6 +225,8 @@ static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwdev, u8 type)struct rtw_coex *coex = &rtwdev->coex;struct rtw_coex_stat *coex_stat = &coex->stat;u8 para[2 ] = {0 }; +u8 times; +u16 tbtt_interval = coex_stat->wl_beacon_interval;if (coex_stat->tdma_timer_base == type)return ;
@@ -233,10 +235,27 @@ static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwdev, u8 type) para[0 ] =COEX_H2C69_TDMA_SLOT ; -if (type ==3 )/* 4-slot */ +rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], tbtt_interval = %d\n" , + tbtt_interval); + +if (type ==TDMA_TIMER_TYPE_4SLOT ) { para[1 ] =PARA1_H2C69_TDMA_4SLOT ;/* 4-slot */ -else /* 2-slot */ + }else if (tbtt_interval <80 && tbtt_interval >0 ) { + times =100 / tbtt_interval; +if (100 % tbtt_interval !=0 ) + times++; + + para[1 ] =FIELD_PREP (PARA1_H2C69_TBTT_TIMES , times); + }else if (tbtt_interval >=180 ) { + times = tbtt_interval /100 ; +if (tbtt_interval %100 <=80 ) + times--; + + para[1 ] =FIELD_PREP (PARA1_H2C69_TBTT_TIMES , times) | +FIELD_PREP (PARA1_H2C69_TBTT_DIV100 ,1 ); + }else { para[1 ] =PARA1_H2C69_TDMA_2SLOT ; + }rtw_fw_bt_wifi_control (rtwdev, para[0 ], ¶[1 ]);
@@ -973,9 +992,9 @@ static void rtw_coex_tdma(struct rtw_dev *rtwdev, bool force, u32 tcase)bool wl_busy = false;if (tcase &TDMA_4SLOT )/* 4-slot (50ms) mode */ -rtw_coex_tdma_timer_base (rtwdev,3 ); +rtw_coex_tdma_timer_base (rtwdev,TDMA_TIMER_TYPE_4SLOT );else -rtw_coex_tdma_timer_base (rtwdev,0 ); +rtw_coex_tdma_timer_base (rtwdev,TDMA_TIMER_TYPE_2SLOT ); type = (u8)(tcase &0xff );
drivers/net/wireless/realtek/rtw88/coex.h +5 -0
@@ -21,9 +21,14 @@#define COEX_H2C69_TDMA_SLOT 0xb#define PARA1_H2C69_TDMA_4SLOT 0xc1#define PARA1_H2C69_TDMA_2SLOT 0x1 +#define PARA1_H2C69_TBTT_TIMES GENMASK(5, 0) +#define PARA1_H2C69_TBTT_DIV100 BIT(7)#define TDMA_4SLOT BIT(8) +#define TDMA_TIMER_TYPE_2SLOT 0 +#define TDMA_TIMER_TYPE_4SLOT 3 +#define COEX_RSSI_STEP 4#define COEX_RSSI_HIGH (rssi) \
drivers/net/wireless/realtek/rtw88/mac80211.c +7 -0
@@ -351,6 +351,8 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw, {struct rtw_dev *rtwdev = hw->priv;struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; +struct rtw_coex *coex = &rtwdev->coex; +struct rtw_coex_stat *coex_stat = &coex->stat;u32 config =0 ;mutex_lock (&rtwdev->mutex);
@@ -381,6 +383,11 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw, config |=PORT_SET_BSSID ; } +if (changed &BSS_CHANGED_BEACON_INT ) { +if (ieee80211_vif_type_p2p (vif) ==NL80211_IFTYPE_STATION ) + coex_stat->wl_beacon_interval = conf->beacon_int; + } +if (changed &BSS_CHANGED_BEACON )rtw_fw_download_rsvd_page (rtwdev);
drivers/net/wireless/realtek/rtw88/main.h +1 -0
@@ -1354,6 +1354,7 @@ struct rtw_coex_stat {u8 bt_a2dp_bitpool;u8 bt_iqk_state; +u16 wl_beacon_interval;u8 wl_noisy_level;u8 wl_fw_dbg_info[10 ];u8 wl_fw_dbg_info_pre[10 ];
Signature · 1 line
2.21.0
Re: [PATCH v2 01/11] rtw88: coex: update TDMA settings for different beacon interval
Quoted 9 lines · <[email protected]> wrote:
From: Ching-Te Ku <[email protected]>
Add considering for different WLAN beacon interval in coexistence mechanism.
Because the WLAN beacon period may be not 100 ms, so it's necessary to consider any beacon period and set timer according to the interval.Signed-off-by Ching-Te Ku <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
11 patches applied to wireless-drivers-next.git, thanks.
7ed9e062178d rtw88: coex: update TDMA settings for different beacon interval ca30905b1d6a rtw88: coex: remove unnecessary feature/function513fb27f6a52 rtw88: coex: add write scoreboard action when WLAN in critical procedure 3a6616f96624 rtw88: coex: Add force flag for coexistence table function a9359faaa47d rtw88: coex: add the mechanism for RF4CE22a9dc720f10 rtw88: coex: update the TDMA parameter when leave LPS 65c6861f6382 rtw88: coex: Change antenna setting to enhance free-run performance e098c3c3314e rtw88: coex: fix BT performance drop during initial/power-on step 72b14be75111 rtw88: coex: remove write scan bit to scoreboard in scan and connect notify 2485bc7c7816 rtw88: coex: remove unnecessary WLAN slot extend362c4a5cc886 rtw88: coex: change the decode method from firmware
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
[email protected]
maintainerPATCH v2 2/11 rtw88: coex: remove unnecessary feature/function
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Because the WLAN RSSI report feature had been implemented at WLAN link info update function, it is redundant to update WLAN RSSI while BT is updating link info, so remove the update WLAN RSSI part.
---
v2: describe "why" in log
--- drivers/net/wireless/realtek/rtw88/coex.c | 33 +++++++---------------- 1 file changed, 10 insertions(+), 23 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +10 -23
@@ -397,15 +397,16 @@ static void rtw_coex_monitor_bt_enable(struct rtw_dev *rtwdev) coex_stat->bt_disabled = bt_disabled; coex_stat->bt_ble_scan_type =0 ; coex_dm->cur_bt_lna_lvl =0 ; - } -if (!coex_stat->bt_disabled) { - coex_stat->bt_reenable = true; -ieee80211_queue_delayed_work (rtwdev->hw, - &coex->bt_reenable_work,15 *HZ ); - }else { - coex_stat->bt_mailbox_reply = false; - coex_stat->bt_reenable = false; +if (!coex_stat->bt_disabled) { + coex_stat->bt_reenable = true; +ieee80211_queue_delayed_work (rtwdev->hw, + &coex->bt_reenable_work, +15 *HZ ); + }else { + coex_stat->bt_mailbox_reply = false; + coex_stat->bt_reenable = false; + } } }
@@ -612,15 +613,6 @@ static void rtw_coex_update_bt_link_info(struct rtw_dev *rtwdev) coex_dm->bt_rssi_state[i] = rssi_state; } -for (i =0 ; i <COEX_RSSI_STEP ; i++) { - rssi_state = coex_dm->wl_rssi_state[i]; - rssi_step = chip->wl_rssi_step[i]; - rssi = rtwdev->dm_info.min_rssi; - rssi_state =rtw_coex_next_rssi_state (rtwdev, rssi_state, - rssi, rssi_step); - coex_dm->wl_rssi_state[i] = rssi_state; - } -if (coex_stat->bt_ble_scan_en && coex_stat->cnt_bt[COEX_CNT_BT_INFOUPDATE ] %3 ==0 ) {u8 scan_type;
@@ -991,7 +983,7 @@ static void rtw_coex_tdma(struct rtw_dev *rtwdev, bool force, u32 tcase)bool turn_on;bool wl_busy = false; -if (tcase &TDMA_4SLOT )/* 4-slot (50ms) mode */ +if (tcase &TDMA_4SLOT )/* 4-slot (50ms) mode */ rtw_coex_tdma_timer_base (rtwdev,TDMA_TIMER_TYPE_4SLOT );else rtw_coex_tdma_timer_base (rtwdev,TDMA_TIMER_TYPE_2SLOT );
@@ -2864,11 +2856,6 @@ void rtw_coex_wl_fwdbginfo_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)void rtw_coex_wl_status_change_notify (struct rtw_dev *rtwdev,u32 type) { -struct rtw_coex *coex = &rtwdev->coex; - -if (coex->stop_dm) -return ; -rtw_coex_run_coex (rtwdev,COEX_RSN_WLSTATUS ); }
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 3/11 rtw88: coex: add write scoreboard action when WLAN in critical procedure
In reply to [email protected]From: Ching-Te Ku <[email protected]>
When WLAN in critical procedure, such as connecting, scan and so on, coexistence will notify BT by scoreboard.
While BT firmware received the scoreboard interrupt, it will adjust BT page priority lower to avoid WLAN critical procedure suffering impact.
--- drivers/net/wireless/realtek/rtw88/coex.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/realtek/rtw88/coex.c +6 -0
@@ -460,6 +460,12 @@ static void rtw_coex_update_wl_link_info(struct rtw_dev *rtwdev, u8 reason) coex_dm->wl_rssi_state[i] = rssi_state; } +if (coex_stat->wl_linkscan_proc || coex_stat->wl_hi_pri_task1 || + coex_stat->wl_hi_pri_task2 || coex_stat->wl_gl_busy) +rtw_coex_write_scbd (rtwdev,COEX_SCBD_SCAN , true); +else +rtw_coex_write_scbd (rtwdev,COEX_SCBD_SCAN , false); +switch (reason) {case COEX_RSN_5GSCANSTART :case COEX_RSN_5GSWITCHBAND :
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 4/11 rtw88: coex: Add force flag for coexistence table function
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Because sometimes hardware action may be unpredictable. (Ex: after WLAN LPS...etc)
Add a check mechanism if the action is triggered by some concerned case, it can force to write the table again.
--- drivers/net/wireless/realtek/rtw88/coex.c | 62 +++++++++++++---------- 1 file changed, 36 insertions(+), 26 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +36 -26
@@ -851,9 +851,19 @@ static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state)rtw_coex_write_indirect_reg (rtwdev,LTE_COEX_CTRL ,0x0300 , state); } -static void rtw_coex_set_table (struct rtw_dev *rtwdev,u32 table0,u32 table1) +static void rtw_coex_set_table (struct rtw_dev *rtwdev,bool force,u32 table0, +u32 table1) {#define DEF_BRK_TABLE_VAL 0xf0ffffff +struct rtw_coex *coex = &rtwdev->coex; +struct rtw_coex_dm *coex_dm = &coex->dm; + +/* If last tdma is wl slot toggle, force write table*/ +if (!force && coex_dm->reason !=COEX_RSN_LPS ) { +if (table0 ==rtw_read32 (rtwdev,REG_BT_COEX_TABLE0 ) && + table1 ==rtw_read32 (rtwdev,REG_BT_COEX_TABLE1 )) +return ; + }rtw_write32 (rtwdev,REG_BT_COEX_TABLE0 , table0);rtw_write32 (rtwdev,REG_BT_COEX_TABLE1 , table1);rtw_write32 (rtwdev,REG_BT_COEX_BRK_TABLE ,DEF_BRK_TABLE_VAL );
@@ -863,7 +873,7 @@ static void rtw_coex_set_table(struct rtw_dev *rtwdev, u32 table0, u32 table1) table1); } -static void rtw_coex_table (struct rtw_dev *rtwdev,u8 type) +static void rtw_coex_table (struct rtw_dev *rtwdev,bool force,u8 type) {struct rtw_coex *coex = &rtwdev->coex;struct rtw_coex_dm *coex_dm = &coex->dm;
@@ -876,13 +886,13 @@ static void rtw_coex_table(struct rtw_dev *rtwdev, u8 type)if (efuse->share_ant) {if (type < chip->table_sant_num) -rtw_coex_set_table (rtwdev, +rtw_coex_set_table (rtwdev, force, chip->table_sant[type].bt, chip->table_sant[type].wl); }else { type = type -100 ;if (type < chip->table_nsant_num) -rtw_coex_set_table (rtwdev, +rtw_coex_set_table (rtwdev, force, chip->table_nsant[type].bt, chip->table_nsant[type].wl); }
@@ -1331,7 +1341,7 @@ static void rtw_coex_action_coex_all_off(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1375,7 +1385,7 @@ static void rtw_coex_action_freerun(struct rtw_dev *rtwdev)else rtw_coex_set_rf_para (rtwdev, chip->wl_rf_para_rx[level]); -rtw_coex_table (rtwdev,100 ); +rtw_coex_table (rtwdev, false,100 );rtw_coex_tdma (rtwdev, false,100 ); }
@@ -1400,7 +1410,7 @@ static void rtw_coex_action_bt_whql_test(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1425,7 +1435,7 @@ static void rtw_coex_action_bt_relink(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1456,7 +1466,7 @@ static void rtw_coex_action_bt_idle(struct rtw_dev *rtwdev)if (table_case !=0xff && tdma_case !=0xff ) {rtw_coex_set_ant_path (rtwdev, false,COEX_SET_ANT_2G_FREERUN ); -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case);return ; }
@@ -1490,7 +1500,7 @@ static void rtw_coex_action_bt_idle(struct rtw_dev *rtwdev) } } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1585,7 +1595,7 @@ static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev)rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], wifi hi(%d), bt page(%d)\n" , wl_hi_pri, coex_stat->bt_page); -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case | slot_type); }
@@ -1621,7 +1631,7 @@ static void rtw_coex_action_bt_hfp(struct rtw_dev *rtwdev) } } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1694,7 +1704,7 @@ static void rtw_coex_action_bt_hid(struct rtw_dev *rtwdev) } } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1736,7 +1746,7 @@ static void rtw_coex_action_bt_a2dp(struct rtw_dev *rtwdev) tdma_case =113 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case | slot_type); }
@@ -1775,7 +1785,7 @@ static void rtw_coex_action_bt_a2dpsink(struct rtw_dev *rtwdev) } } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1812,7 +1822,7 @@ static void rtw_coex_action_bt_pan(struct rtw_dev *rtwdev) tdma_case =119 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1856,7 +1866,7 @@ static void rtw_coex_action_bt_a2dp_hid(struct rtw_dev *rtwdev) tdma_case =113 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case | slot_type); }
@@ -1894,7 +1904,7 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev) tdma_case =120 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1929,7 +1939,7 @@ static void rtw_coex_action_bt_pan_hid(struct rtw_dev *rtwdev) tdma_case =119 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1963,7 +1973,7 @@ static void rtw_coex_action_bt_a2dp_pan_hid(struct rtw_dev *rtwdev) tdma_case =120 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -1990,7 +2000,7 @@ static void rtw_coex_action_wl_under5g(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -2014,7 +2024,7 @@ static void rtw_coex_action_wl_only(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -2043,7 +2053,7 @@ static void rtw_coex_action_wl_native_lps(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -2081,7 +2091,7 @@ static void rtw_coex_action_wl_linkscan(struct rtw_dev *rtwdev) } } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case | slot_type); }
@@ -2105,7 +2115,7 @@ static void rtw_coex_action_wl_not_connected(struct rtw_dev *rtwdev) tdma_case =100 ; } -rtw_coex_table (rtwdev, table_case); +rtw_coex_table (rtwdev, false, table_case);rtw_coex_tdma (rtwdev, false, tdma_case); }
@@ -2337,7 +2347,7 @@ static void __rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only) }/* PTA parameter */ -rtw_coex_table (rtwdev,0 ); +rtw_coex_table (rtwdev, false,0 );rtw_coex_tdma (rtwdev, true,0 );rtw_coex_query_bt_info (rtwdev); }
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 5/11 rtw88: coex: add the mechanism for RF4CE
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Add the related coexistence mechanism about RF4CE and WLAN connected flag to decide control packet is whether higher or normal priority.
--- drivers/net/wireless/realtek/rtw88/coex.c | 33 ++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/coex.c +32 -1
@@ -1389,6 +1389,31 @@ static void rtw_coex_action_freerun(struct rtw_dev *rtwdev)rtw_coex_tdma (rtwdev, false,100 ); } +static void rtw_coex_action_rf4ce (struct rtw_dev *rtwdev) +{ +struct rtw_efuse *efuse = &rtwdev->efuse; +struct rtw_chip_info *chip = rtwdev->chip; +u8 table_case, tdma_case; + +rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], %s()\n" , __func__); + +rtw_coex_set_ant_path (rtwdev, false,COEX_SET_ANT_2G ); +rtw_coex_set_rf_para (rtwdev, chip->wl_rf_para_rx[0 ]); + +if (efuse->share_ant) { +/* Shared-Ant */ + table_case =9 ; + tdma_case =16 ; + }else { +/* Non-Shared-Ant */ + table_case =100 ; + tdma_case =100 ; + } + +rtw_coex_table (rtwdev, false, table_case); +rtw_coex_tdma (rtwdev, false, tdma_case); +} +static void rtw_coex_action_bt_whql_test (struct rtw_dev *rtwdev) {struct rtw_efuse *efuse = &rtwdev->efuse;
@@ -2179,6 +2204,7 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)struct rtw_coex *coex = &rtwdev->coex;struct rtw_coex_dm *coex_dm = &coex->dm;struct rtw_coex_stat *coex_stat = &coex->stat; +bool rf4ce_en = false;lockdep_assert_held (&rtwdev->mutex);
@@ -2234,7 +2260,12 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason) coex_stat->wl_coex_mode =COEX_WLINK_2G1PORT ;rtw_coex_write_scbd (rtwdev,COEX_SCBD_FIX2M , false);if (coex_stat->bt_disabled) { -rtw_coex_action_wl_only (rtwdev); +if (coex_stat->wl_connected && rf4ce_en) +rtw_coex_action_rf4ce (rtwdev); +else if (!coex_stat->wl_connected) +rtw_coex_action_wl_not_connected (rtwdev); +else +rtw_coex_action_wl_only (rtwdev); goto exit; }
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 6/11 rtw88: coex: update the TDMA parameter when leave LPS
In reply to [email protected]From: Ching-Te Ku <[email protected]>
The updated parameter and original parameter all means TDMA-OFF. The original setting write 0x8 to firmware, but it only works for some old IC series.
To avoid the confusing, update a proper parameter.
--- drivers/net/wireless/realtek/rtw88/coex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/coex.c +1 -1
@@ -928,7 +928,7 @@ static void rtw_coex_power_save_state(struct rtw_dev *rtwdev, u8 ps_type,case COEX_PS_LPS_OFF : coex_stat->wl_force_lps_ctrl = true;if (lps_mode) -rtw_fw_coex_tdma_type (rtwdev,0x8 ,0 ,0 ,0 ,0 ); +rtw_fw_coex_tdma_type (rtwdev,0 ,0 ,0 ,0 ,0 );rtw_leave_lps (rtwdev); rtw_dbg(rtwdev, RTW_DBG_COEX,
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 7/11 rtw88: coex: Change antenna setting to enhance free-run performance
In reply to [email protected]From: Ching-Te Ku <[email protected]>
While the mechanism goes to 2G_free_run or WL5G_BT2G, set BT to hardware PTA mode to get a more efficiently performance.
Add a flag to indicate antenna switch is supported or not so that the IC serials which has different antenna structure can set antenna correctly.
--- drivers/net/wireless/realtek/rtw88/coex.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +7 -5
@@ -1061,6 +1061,7 @@ static void rtw_coex_set_ant_path(struct rtw_dev *rtwdev, bool force, u8 phase) {struct rtw_coex *coex = &rtwdev->coex;struct rtw_coex_stat *coex_stat = &coex->stat; +struct rtw_coex_rfe *coex_rfe = &coex->rfe;struct rtw_coex_dm *coex_dm = &coex->dm;u8 ctrl_type =COEX_SWITCH_CTRL_MAX ;u8 pos_type =COEX_SWITCH_TO_MAX ;
@@ -1156,8 +1157,8 @@ static void rtw_coex_set_ant_path(struct rtw_dev *rtwdev, bool force, u8 phase)rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], %s() - PHASE_5G_RUNTIME\n" , __func__); -/* set GNT_BT to PTA */ -rtw_coex_set_gnt_bt (rtwdev,COEX_GNT_SET_SW_HIGH ); +/* set GNT_BT to HW PTA */ +rtw_coex_set_gnt_bt (rtwdev,COEX_GNT_SET_HW_PTA );/* set GNT_WL to SW high */ rtw_coex_set_gnt_wl (rtwdev,COEX_GNT_SET_SW_HIGH );
@@ -1172,8 +1173,8 @@ static void rtw_coex_set_ant_path(struct rtw_dev *rtwdev, bool force, u8 phase)rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], %s() - PHASE_2G_FREERUN\n" , __func__); -/* set GNT_BT to SW high */ -rtw_coex_set_gnt_bt (rtwdev,COEX_GNT_SET_SW_HIGH ); +/* set GNT_BT to HW PTA */ +rtw_coex_set_gnt_bt (rtwdev,COEX_GNT_SET_HW_PTA );/* Set GNT_WL to SW high */ rtw_coex_set_gnt_wl (rtwdev,COEX_GNT_SET_SW_HIGH );
@@ -1204,7 +1205,8 @@ static void rtw_coex_set_ant_path(struct rtw_dev *rtwdev, bool force, u8 phase)return ; } -if (ctrl_type <COEX_SWITCH_CTRL_MAX && pos_type <COEX_SWITCH_TO_MAX ) +if (ctrl_type <COEX_SWITCH_CTRL_MAX && pos_type <COEX_SWITCH_TO_MAX && + coex_rfe->ant_switch_exist)rtw_coex_set_ant_switch (rtwdev, ctrl_type, pos_type); }
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 8/11 rtw88: coex: fix BT performance drop during initial/power-on step
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Force set the coexistence to BT high priority during WLAN initial/power-on step. Since the duration the related setting may be not ready yet.
The score board is not related to scan when initialing, remove the scan parameter.
--- drivers/net/wireless/realtek/rtw88/coex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +5 -3
@@ -2368,19 +2368,19 @@ static void __rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only) __func__); }else if (wifi_only) {rtw_coex_set_ant_path (rtwdev, true,COEX_SET_ANT_WONLY ); -rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_SCAN , +rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_ONOFF , true); coex->stop_dm = true; }else {rtw_coex_set_ant_path (rtwdev, true,COEX_SET_ANT_INIT ); -rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_SCAN , +rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_ONOFF , true); coex->stop_dm = false; coex->freeze = true; }/* PTA parameter */ -rtw_coex_table (rtwdev, false,0 ); +rtw_coex_table (rtwdev, true,1 );rtw_coex_tdma (rtwdev, true,0 );rtw_coex_query_bt_info (rtwdev); }
@@ -2388,6 +2388,7 @@ static void __rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only)void rtw_coex_power_on_setting (struct rtw_dev *rtwdev) {struct rtw_coex *coex = &rtwdev->coex; +u8 table_case =1 ;rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], %s()\n" , __func__);
@@ -2404,6 +2405,7 @@ void rtw_coex_power_on_setting(struct rtw_dev *rtwdev)/* set antenna path to BT */ rtw_coex_set_ant_path (rtwdev, true,COEX_SET_ANT_POWERON ); +rtw_coex_table (rtwdev, true, table_case);/* red x issue */ rtw_write8 (rtwdev,0xff1a ,0x0 ); }
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 9/11 rtw88: coex: remove write scan bit to scoreboard in scan and connect notify
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Remove some action which were writing scan bit to scoreboard, since these behaviors are redundant.
It is already done in WLAN info notify.
--- drivers/net/wireless/realtek/rtw88/coex.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +2 -6
@@ -2488,10 +2488,7 @@ void rtw_coex_scan_notify(struct rtw_dev *rtwdev, u8 type)return ; coex->freeze = false; - -if (type !=COEX_SCAN_FINISH ) -rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_SCAN | -COEX_SCBD_ONOFF , true); +rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_ONOFF , true);if (type ==COEX_SCAN_START_5G ) { rtw_dbg(rtwdev, RTW_DBG_COEX,
@@ -2548,8 +2545,7 @@ void rtw_coex_connect_notify(struct rtw_dev *rtwdev, u8 type)if (coex->manual_control || coex->stop_dm)return ; -rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_SCAN | -COEX_SCBD_ONOFF , true); +rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE |COEX_SCBD_ONOFF , true);if (type ==COEX_ASSOCIATE_5G_START ) { rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s(): 5G start\n",
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 10/11 rtw88: coex: remove unnecessary WLAN slot extend
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Remove extend 5 ms related operation at WLAN media status notify. The mechanism should be enable only while DUT connect to a AP that it doesn't follow our power save control or its rate is decreasing unusually sensitive. So we extend a extra slot to save the transmission rate.
The original logic will always extend WLAN slot.
It will lead to BT slot always decrease 5 ms.
Remove write scoreboard action at WLAN media status notify. It has already done in WLAN info notify.
--- drivers/net/wireless/realtek/rtw88/coex.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +0 -9
@@ -2592,8 +2592,6 @@ void rtw_coex_connect_notify(struct rtw_dev *rtwdev, u8 type)void rtw_coex_media_status_notify (struct rtw_dev *rtwdev,u8 type) {struct rtw_coex *coex = &rtwdev->coex; -struct rtw_coex_stat *coex_stat = &coex->stat; -u8 para[6 ] = {0 };if (coex->manual_control || coex->stop_dm)return ;
@@ -2615,15 +2613,8 @@ void rtw_coex_media_status_notify(struct rtw_dev *rtwdev, u8 type)/* Set CCK Rx high Pri */ rtw_coex_set_wl_pri_mask (rtwdev,COEX_WLPRI_RX_CCK ,1 ); - -/* always enable 5ms extend if connect */ - para[0 ] =COEX_H2C69_WL_LEAKAP ; - para[1 ] =PARA1_H2C69_EN_5MS ;/* enable 5ms extend */ -rtw_fw_bt_wifi_control (rtwdev, para[0 ], ¶[1 ]); - coex_stat->wl_slot_extend = true;rtw_coex_run_coex (rtwdev,COEX_RSN_2GMEDIA ); }else { -rtw_coex_write_scbd (rtwdev,COEX_SCBD_ACTIVE , false);rtw_dbg (rtwdev,RTW_DBG_COEX ,"[BTCoex], %s(): disconnect!!\n" , __func__);rtw_coex_set_wl_pri_mask (rtwdev,COEX_WLPRI_RX_CCK ,0 );
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH v2 11/11 rtw88: coex: change the decode method from firmware
In reply to [email protected]From: Ching-Te Ku <[email protected]>
Fix sometimes FW information will be parsed as wrong value, do a correction of sign bit to show the correct information. (Ex, Value should be 20, but it shows 236.)
--- drivers/net/wireless/realtek/rtw88/coex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/coex.c +1 -1
@@ -2882,7 +2882,7 @@ void rtw_coex_wl_fwdbginfo_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)if (buf[i] >= val) coex_stat->wl_fw_dbg_info[i] = buf[i] - val;else - coex_stat->wl_fw_dbg_info[i] = val - buf[i]; + coex_stat->wl_fw_dbg_info[i] =255 - val + buf[i]; coex_stat->wl_fw_dbg_info_pre[i] = buf[i]; }
Signature · 1 line
2.21.0