rtw88: coex: fix and update settings to enhance coex performance
Subsystems (2)
[email protected]
maintainerPATCH 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
@@ -1062,6 +1062,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 ;
@@ -1157,8 +1158,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 );
@@ -1173,8 +1174,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 );
@@ -1205,7 +1206,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 2/11 rtw88: coex: remove unnecessary feature/function
In reply to [email protected]From: Ching-Te Ku <[email protected]>
It is redundant to update WLAN RSSI, remove the update WLAN RSSI part. Remove unused function.
--- drivers/net/wireless/realtek/rtw88/coex.c | 33 +++++++---------------- 1 file changed, 10 insertions(+), 23 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +10 -23
@@ -398,15 +398,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; + } } }
@@ -613,15 +614,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;
@@ -992,7 +984,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,3 );else rtw_coex_tdma_timer_base (rtwdev,0 );
@@ -2865,11 +2857,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 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
@@ -2593,8 +2593,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 ;
@@ -2616,15 +2614,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 1/11 rtw88: coex: update TDMA settings for different beacon interval
In reply to [email protected]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.
--- drivers/net/wireless/realtek/rtw88/coex.c | 24 +++++++++++++++++-- drivers/net/wireless/realtek/rtw88/mac80211.c | 7 ++++++ drivers/net/wireless/realtek/rtw88/main.h | 1 + 3 files changed, 30 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +22 -2
@@ -225,6 +225,7 @@ 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 }; +u16 tbtt_interval = coex_stat->wl_beacon_interval;if (coex_stat->tdma_timer_base == type)return ;
@@ -233,10 +234,29 @@ 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 ==3 ) {/* 4-slot */ para[1 ] =PARA1_H2C69_TDMA_4SLOT ;/* 4-slot */ -else /* 2-slot */ + }else if (tbtt_interval <80 && tbtt_interval >0 ) { + para[1 ] = (100 / tbtt_interval); + +if (100 % tbtt_interval !=0 ) + para[1 ] = para[1 ] +1 ; + + para[1 ] = para[1 ] &0x3f ; + }else if (tbtt_interval >=180 ) { + para[1 ] = (tbtt_interval /100 ); + +if (tbtt_interval %100 <=80 ) + para[1 ] = para[1 ] -1 ; + + para[1 ] = para[1 ] &0x3f ; + para[1 ] = para[1 ] |0x80 ; + }else { para[1 ] =PARA1_H2C69_TDMA_2SLOT ; + }rtw_fw_bt_wifi_control (rtwdev, para[0 ], ¶[1 ]);
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
[email protected]
maintainerPATCH 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
@@ -2883,7 +2883,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
[email protected]
maintainerPATCH 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
@@ -852,9 +852,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 );
@@ -864,7 +874,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;
@@ -877,13 +887,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); }
@@ -1332,7 +1342,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); }
@@ -1376,7 +1386,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 ); }
@@ -1401,7 +1411,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); }
@@ -1426,7 +1436,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); }
@@ -1457,7 +1467,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 ; }
@@ -1491,7 +1501,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); }
@@ -1586,7 +1596,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); }
@@ -1622,7 +1632,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); }
@@ -1695,7 +1705,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); }
@@ -1737,7 +1747,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); }
@@ -1776,7 +1786,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); }
@@ -1813,7 +1823,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); }
@@ -1857,7 +1867,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); }
@@ -1895,7 +1905,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); }
@@ -1930,7 +1940,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); }
@@ -1964,7 +1974,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); }
@@ -1991,7 +2001,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); }
@@ -2015,7 +2025,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); }
@@ -2044,7 +2054,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); }
@@ -2082,7 +2092,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); }
@@ -2106,7 +2116,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); }
@@ -2338,7 +2348,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]
maintainercover 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.
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 | 197 +++++++++++------- drivers/net/wireless/realtek/rtw88/mac80211.c | 7 + drivers/net/wireless/realtek/rtw88/main.h | 1 + 3 files changed, 129 insertions(+), 76 deletions(-)
Signature · 1 line
2.21.0
[email protected]
maintainerPATCH 3/11 rtw88: coex: add write scoreboard action when WLAN in critical procedure
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
@@ -461,6 +461,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 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
@@ -2369,19 +2369,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); }
@@ -2389,6 +2389,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__);
@@ -2405,6 +2406,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 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 renamed from drivers/net/wireless/realt8Ilc4dc/coe|.c +32 -1
@@ -1390,6 +1390,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;
@@ -2180,6 +2205,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);
@@ -2235,7 +2261,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 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
@@ -929,7 +929,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 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
@@ -2489,10 +2489,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,
@@ -2549,8 +2546,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
Re: [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon interval
In reply to [email protected]Quoted 9 lines · <[email protected]> writes:
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]>
[...]
Quoted 5 lines
drivers/net/wireless/realtek/rtw88/coex.c +5
-0+ }else if (tbtt_interval <80 && tbtt_interval >0 ) { + para[1 ] = (100 / tbtt_interval); + +if (100 % tbtt_interval !=0 ) + para[1 ] = para[1 ] +1 ;
drivers/net/wireless/realtek/rtw88/coex.c static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwdev, u8 type) · line 256
Quoted 10 lines
drivers/net/wireless/realtek/rtw88/coex.c +10
-0+ + para[1 ] = para[1 ] &0x3f ; + }else if (tbtt_interval >=180 ) { + para[1 ] = (tbtt_interval /100 ); + +if (tbtt_interval %100 <=80 ) + para[1 ] = para[1 ] -1 ; + + para[1 ] = para[1 ] &0x3f ; + para[1 ] = para[1 ] |0x80 ;
Magic numbers 0x3f and 0x80, GENMASK() & FIELD_PREP() is the modern way to handle bitmasks like these. And there's also the operator '|='
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH 02/11] rtw88: coex: remove unnecessary feature/function
In reply to [email protected]Quoted 4 lines · <[email protected]> writes:
From: Ching-Te Ku <[email protected]>
It is redundant to update WLAN RSSI, remove the update WLAN RSSI part. Remove unused function.
Why is it redundant? The "Why?" is the most important part of the commit log.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH 08/11] rtw88: coex: fix BT performance drop during initial/power-on step
In reply to [email protected]drivers/net/wireless/realtek/rtw88/coex.c8Ilex.cc7216245557..6ec3f45a64c1 100644
Quoted 16 lines · <[email protected]> writes:
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.
Signed-off-by Ching-Te Ku <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>--- drivers/net/wireless/realtek/rtw88/coex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/net/wireless/realtek/rtw88/coex.c8Ilex.cc7216245557..6ec3f45a64c1 100644 renamed from drivers/net/wireless/realtek/rtw88/coTÔÈ +0
-0
Something is wrong here, the new lines are replaced with '^H' control character.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Pkshih
maintainerRE: [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon interval
In reply to Kalle ValoQuoted 34 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kalle Valo
Sent: Wednesday, November 11, 2020 4:34 PM
To: Pkshih
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon intervalQuoted 9 lines · <[email protected]> writes:
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]>[...]
Quoted 10 lines
drivers/net/wireless/realtek/rtw88/coex.c +10
-0+ }else if (tbtt_interval <80 && tbtt_interval >0 ) { + para[1 ] = (100 / tbtt_interval); + +if (100 % tbtt_interval !=0 ) + para[1 ] = para[1 ] +1 ; + + para[1 ] = para[1 ] &0x3f ; + }else if (tbtt_interval >=180 ) { + para[1 ] = (tbtt_interval /100 ); +
Quoted 9 lines
drivers/net/wireless/realtek/rtw88/coex.c static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwdev, u8 type) · line 256
Quoted 5 lines
drivers/net/wireless/realtek/rtw88/coex.c +5
-0+if (tbtt_interval %100 <=80 ) + para[1 ] = para[1 ] -1 ; + + para[1 ] = para[1 ] &0x3f ; + para[1 ] = para[1 ] |0x80 ;Magic numbers
0x3fand0x80,GENMASK()&FIELD_PREP()is the modern way to handle bitmasks like these. And there's also the operator '|='
I'll give proper names and use suggested macros it in v2. Thank you.
---
Ping-Ke
Pkshih
maintainerRE: [PATCH 02/11] rtw88: coex: remove unnecessary feature/function
In reply to Kalle ValoQuoted 12 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kalle Valo
Sent: Wednesday, November 11, 2020 4:36 PM
To: Pkshih
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 02/11] rtw88: coex: remove unnecessary feature/function<[email protected]> writes:
Quoted 8 lines
Quoted 4 lines
From: Ching-Te Ku <[email protected]>
It is redundant to update WLAN RSSI, remove the update WLAN RSSI part. Remove unused function.
Why is it redundant? The "Why?" is the most important part of the commit log.
Will describe "why' in v2. Thanks.
---
Ping-Ke
Pkshih
maintainerRE: [PATCH 08/11] rtw88: coex: fix BT performance drop during initial/power-on step
In reply to Kalle ValoQuoted 27 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kalle Valo
Sent: Wednesday, November 11, 2020 4:38 PM
To: Pkshih
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 08/11] rtw88: coex: fix BT performance drop during initial/power-on stepQuoted 15 lines · <[email protected]> writes:
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.
Signed-off-by Ching-Te Ku <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>--- drivers/net/wireless/realtek/rtw88/coex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0b/drivers/net/wireless/realtek/rtw88/coex.c8Ilex.cc7216245557..6ec3f45a64c1 100644
Something is wrong here, the new lines are replaced with '^H' control character.
I don't know why it goes wrong, my patch source looks ok. I'll pay attention to this patch while sending v2.
---
Ping-Ke