wifi: rtw89: mcc: improve user experience of P2P concurrency
Ping-Ke Shih
maintainercover wifi: rtw89: mcc: improve user experience of P2P concurrency
Since concurrency is based on time slot assignment method, the TBTT of STA and P2P could be very close, and beacon loss occurs on STA or GC role. Add more rules to consider that cases.
Zong-Zhe Yang (6):
wifi: rtw89: mcc: pass whom to stop at when pausing chanctx
wifi: rtw89: mcc: drop queued chanctx changes when stopping
wifi: rtw89: mcc: add courtesy mechanism conditions to P2P roles
wifi: rtw89: mcc: introduce calculation of anchor pattern
wifi: rtw89: mcc: deal with non-periodic NoA
wifi: rtw89: mcc: avoid redundant recalculations if no chance to
improve
drivers/net/wireless/realtek/rtw89/chan.c | 176 ++++++++++++++++-- drivers/net/wireless/realtek/rtw89/chan.h | 7 +- drivers/net/wireless/realtek/rtw89/core.c | 9 +- drivers/net/wireless/realtek/rtw89/core.h | 9 + drivers/net/wireless/realtek/rtw89/fw.c | 6 +- drivers/net/wireless/realtek/rtw89/mac.c | 3 +- drivers/net/wireless/realtek/rtw89/mac80211.c | 4 + drivers/net/wireless/realtek/rtw89/ps.c | 147 +++++++++++++++ drivers/net/wireless/realtek/rtw89/ps.h | 3 + drivers/net/wireless/realtek/rtw89/ser.c | 2 + 10 files changed, 348 insertions(+), 18 deletions(-)
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 1/6 wifi: rtw89: mcc: pass whom to stop at when pausing chanctx
From: Zong-Zhe Yang <[email protected]>
When stopping MCC, FW can stop at a given MCC role following H2C command. When pausing chanctx during MCC, in general, the caller expects to process things with its chanctx. So, pass the caller as target and let FW stop MCC at it.
--- drivers/net/wireless/realtek/rtw89/chan.c | 35 +++++++++++++++++------ drivers/net/wireless/realtek/rtw89/chan.h | 7 ++++- drivers/net/wireless/realtek/rtw89/core.c | 6 +++- drivers/net/wireless/realtek/rtw89/fw.c | 6 +++- 4 files changed, 43 insertions(+), 11 deletions(-)
drivers/net/wireless/realtek/rtw89/chan.c +27 -8
@@ -2107,6 +2107,12 @@ static int rtw89_mcc_start(struct rtw89_dev *rtwdev) }struct rtw89_mcc_stop_sel { +struct { +const struct rtw89_vif_link *target; + } hint; + +/* selection content */ +bool filled;u8 mac_id;u8 slot_idx; };
@@ -2116,6 +2122,7 @@ static void rtw89_mcc_stop_sel_fill(struct rtw89_mcc_stop_sel *sel, { sel->mac_id = mcc_role->rtwvif_link->mac_id; sel->slot_idx = mcc_role->slot_idx; + sel->filled = true; } static int rtw89_mcc_stop_sel_iterator(struct rtw89_dev *rtwdev,
@@ -2125,23 +2132,35 @@ static int rtw89_mcc_stop_sel_iterator(struct rtw89_dev *rtwdev, {struct rtw89_mcc_stop_sel *sel = data; +if (mcc_role->rtwvif_link == sel->hint.target) { +rtw89_mcc_stop_sel_fill (sel, mcc_role); +return 1 ;/* break iteration */ + } + +if (sel->filled) +return 0 ; +if (!mcc_role->rtwvif_link->chanctx_assigned)return 0 ;rtw89_mcc_stop_sel_fill (sel, mcc_role); -return 1 ;/* break iteration */ +return 0 ; } -static void rtw89_mcc_stop (struct rtw89_dev *rtwdev) +static void rtw89_mcc_stop (struct rtw89_dev *rtwdev, +const struct rtw89_chanctx_pause_parm *pause) {struct rtw89_mcc_info *mcc = &rtwdev->mcc;struct rtw89_mcc_role *ref = &mcc->role_ref; -struct rtw89_mcc_stop_sel sel; +struct rtw89_mcc_stop_sel sel = { + .hint.target = pause ? pause->trigger :NULL , + };int ret;/* by default, stop at ref */ -rtw89_mcc_stop_sel_fill (&sel, ref);rtw89_iterate_mcc_roles (rtwdev, rtw89_mcc_stop_sel_iterator, &sel); +if (!sel.filled) +rtw89_mcc_stop_sel_fill (&sel, ref);rtw89_debug (rtwdev,RTW89_DBG_CHAN ,"MCC stop at <macid %d>\n" , sel.mac_id);
@@ -2492,7 +2511,7 @@ void rtw89_chanctx_track(struct rtw89_dev *rtwdev) }void rtw89_chanctx_pause (struct rtw89_dev *rtwdev, -enum rtw89_chanctx_pause_reasons rsn) +const struct rtw89_chanctx_pause_parm *pause_parm) {struct rtw89_hal *hal = &rtwdev->hal;enum rtw89_entity_mode mode;
@@ -2502,12 +2521,12 @@ void rtw89_chanctx_pause(struct rtw89_dev *rtwdev,if (hal->entity_pause)return ; -rtw89_debug (rtwdev,RTW89_DBG_CHAN ,"chanctx pause (rsn: %d)\n" , rsn); +rtw89_debug (rtwdev,RTW89_DBG_CHAN ,"chanctx pause (rsn: %d)\n" , pause_parm->rsn); mode =rtw89_get_entity_mode (rtwdev);switch (mode) {case RTW89_ENTITY_MODE_MCC : -rtw89_mcc_stop (rtwdev); +rtw89_mcc_stop (rtwdev, pause_parm);break ;default :break ;
@@ -2732,7 +2751,7 @@ void rtw89_chanctx_ops_unassign_vif(struct rtw89_dev *rtwdev, cur =rtw89_get_entity_mode (rtwdev);switch (cur) {case RTW89_ENTITY_MODE_MCC : -rtw89_mcc_stop (rtwdev); +rtw89_mcc_stop (rtwdev,NULL );break ;default :break ;
drivers/net/wireless/realtek/rtw89/chan.h +6 -1
@@ -46,6 +46,11 @@ enum rtw89_chanctx_pause_reasons { RTW89_CHANCTX_PAUSE_REASON_ROC, }; +struct rtw89_chanctx_pause_parm { +const struct rtw89_vif_link *trigger; +enum rtw89_chanctx_pause_reasons rsn; +}; +struct rtw89_chanctx_cb_parm {int (*cb)(struct rtw89_dev *rtwdev,void *data);void *data;
@@ -113,7 +118,7 @@ void rtw89_queue_chanctx_change(struct rtw89_dev *rtwdev, enum rtw89_chanctx_changes change);void rtw89_chanctx_track (struct rtw89_dev *rtwdev);void rtw89_chanctx_pause (struct rtw89_dev *rtwdev, -enum rtw89_chanctx_pause_reasons rsn); +const struct rtw89_chanctx_pause_parm *parm);void rtw89_chanctx_proceed (struct rtw89_dev *rtwdev,const struct rtw89_chanctx_cb_parm *cb_parm);
drivers/net/wireless/realtek/rtw89/core.c +5 -1
@@ -3389,6 +3389,9 @@ static int rtw89_core_send_nullfunc(struct rtw89_dev *rtwdev,void rtw89_roc_start (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif) {const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def; +struct rtw89_chanctx_pause_parm pause_parm = { + .rsn =RTW89_CHANCTX_PAUSE_REASON_ROC , + };struct ieee80211_hw *hw = rtwdev->hw;struct rtw89_roc *roc = &rtwvif->roc;struct rtw89_vif_link *rtwvif_link;
@@ -3410,7 +3413,8 @@ void rtw89_roc_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) roc->link_id = rtwvif_link->link_id; -rtw89_chanctx_pause (rtwdev,RTW89_CHANCTX_PAUSE_REASON_ROC ); + pause_parm.trigger = rtwvif_link; +rtw89_chanctx_pause (rtwdev, &pause_parm); ret =rtw89_core_send_nullfunc (rtwdev, rtwvif_link, true, true);if (ret)
drivers/net/wireless/realtek/rtw89/fw.c +5 -1
@@ -7446,6 +7446,10 @@ int rtw89_hw_scan_start(struct rtw89_dev *rtwdev,const struct rtw89_chan *chan =rtw89_chan_get (rtwdev, rtwvif_link->chanctx_idx);struct rtw89_vif *rtwvif = rtwvif_link->rtwvif; +struct rtw89_chanctx_pause_parm pause_parm = { + .rsn =RTW89_CHANCTX_PAUSE_REASON_HW_SCAN , + .trigger = rtwvif_link, + };u32 rx_fltr = rtwdev->hal.rx_fltr;u8 mac_addr[ETH_ALEN ];u32 reg;
@@ -7484,7 +7488,7 @@ int rtw89_hw_scan_start(struct rtw89_dev *rtwdev, reg =rtw89_mac_reg_by_idx (rtwdev, mac->rx_fltr, rtwvif_link->mac_idx);rtw89_write32_mask (rtwdev, reg,B_AX_RX_FLTR_CFG_MASK , rx_fltr); -rtw89_chanctx_pause (rtwdev,RTW89_CHANCTX_PAUSE_REASON_HW_SCAN ); +rtw89_chanctx_pause (rtwdev, &pause_parm);if (mode ==RTW89_ENTITY_MODE_MCC )rtw89_hw_scan_update_beacon_noa (rtwdev, req);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerRe: [PATCH rtw-next 1/6] wifi: rtw89: mcc: pass whom to stop at when pausing chanctx
Quoted 9 lines · Ping-Ke Shih
From: Zong-Zhe Yang <[email protected]>
When stopping MCC, FW can stop at a given MCC role following H2C command. When pausing chanctx during MCC, in general, the caller expects to process things with its chanctx. So, pass the caller as target and let FW stop MCC at it.
Signed-off-by Zong-Zhe Yang <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
6 patch(es) applied to rtw-next branch of rtw.git, thanks.
46b607974866 wifi: rtw89: mcc: pass whom to stop at when pausing chanctx 8ee99b998fc4 wifi: rtw89: mcc: drop queued chanctx changes when stopping 7662708c00af wifi: rtw89: mcc: add courtesy mechanism conditions to P2P roles eec9dfad1b21 wifi: rtw89: mcc: introduce calculation of anchor pattern 122b74ac9b9d wifi: rtw89: mcc: deal with non-periodic NoAb178c1a23c5f wifi: rtw89: mcc: avoid redundant recalculations if no chance to improve
Ping-Ke Shih
maintainerPATCH 2/6 wifi: rtw89: mcc: drop queued chanctx changes when stopping
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
When MCC is about to stop, there may be some chanctx changes which are queued for work but have not yet been run. To avoid these changes from being processed in a wrong state (e.g. next new MCC instance), cancel the queued work and drop queued changes.
--- drivers/net/wireless/realtek/rtw89/chan.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/realtek/rtw89/chan.c +6 -0
@@ -2150,6 +2150,7 @@ static int rtw89_mcc_stop_sel_iterator(struct rtw89_dev *rtwdev,static void rtw89_mcc_stop (struct rtw89_dev *rtwdev,const struct rtw89_chanctx_pause_parm *pause) { +struct rtw89_hal *hal = &rtwdev->hal;struct rtw89_mcc_info *mcc = &rtwdev->mcc;struct rtw89_mcc_role *ref = &mcc->role_ref;struct rtw89_mcc_stop_sel sel = {
@@ -2157,6 +2158,11 @@ static void rtw89_mcc_stop(struct rtw89_dev *rtwdev, };int ret; +if (!pause) { +wiphy_delayed_work_cancel (rtwdev->hw->wiphy, &rtwdev->chanctx_work); +bitmap_zero (hal->changes,NUM_OF_RTW89_CHANCTX_CHANGES ); + } +/* by default, stop at ref */ rtw89_iterate_mcc_roles (rtwdev, rtw89_mcc_stop_sel_iterator, &sel);if (!sel.filled)
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 3/6 wifi: rtw89: mcc: add courtesy mechanism conditions to P2P roles
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
In one enablement of courtesy mechanism, there is one provider and one receiver. And, receiver can use the provider's time in a given period. But, to make P2P NoA protocol work as expected as possible, GO should be present at the time it doesn't announce absent, and GC should not use the time when GO announces absent. So, don't enable courtesy mechanism if provider is GO or receiver is GC.
--- drivers/net/wireless/realtek/rtw89/chan.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw89/chan.c +11 -2
@@ -961,6 +961,15 @@ static int rtw89_mcc_fill_all_roles(struct rtw89_dev *rtwdev)return 0 ; } +static bool rtw89_mcc_can_courtesy (const struct rtw89_mcc_role *provider, +const struct rtw89_mcc_role *receiver) +{ +if (provider->is_go || receiver->is_gc) +return false; + +return true; +} +static void rtw89_mcc_assign_pattern (struct rtw89_dev *rtwdev,const struct rtw89_mcc_pattern *new) {
@@ -980,7 +989,7 @@ static void rtw89_mcc_assign_pattern(struct rtw89_dev *rtwdev, *pattern = *new;memset (&pattern->courtesy,0 ,sizeof (pattern->courtesy)); -if (RTW89_MCC_REQ_COURTESY (pattern, aux)) { +if (RTW89_MCC_REQ_COURTESY (pattern, aux) &&rtw89_mcc_can_courtesy (ref, aux)) { crtz = &pattern->courtesy.ref; ref->crtz = crtz;
@@ -994,7 +1003,7 @@ static void rtw89_mcc_assign_pattern(struct rtw89_dev *rtwdev, ref->crtz =NULL ; } -if (RTW89_MCC_REQ_COURTESY (pattern, ref)) { +if (RTW89_MCC_REQ_COURTESY (pattern, ref) &&rtw89_mcc_can_courtesy (aux, ref)) { crtz = &pattern->courtesy.aux; aux->crtz = crtz;
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 4/6 wifi: rtw89: mcc: introduce calculation of anchor pattern
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
In the cases that two MCC roles' TBTTs are too close or too far, original MCC pattern calculation logic will lead to a result that both roles might not cover its TBTT with sufficient time. Introduce a new calculation logic called anchor pattern for these corner cases. It allows to choose one role as anchor to put its TBTT in the middle of its duration directly. For now, a P2P role has a higher priority to be chosen as an anchor. Then, if able, another role might need to depend on courtesy mechanism to take time from anchor.
--- drivers/net/wireless/realtek/rtw89/chan.c | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+)
drivers/net/wireless/realtek/rtw89/chan.c +105 -0
@@ -1185,6 +1185,107 @@ static int __rtw89_mcc_calc_pattern_strict(struct rtw89_dev *rtwdev,return 0 ; } +static void __rtw89_mcc_fill_ptrn_anchor_ref (struct rtw89_dev *rtwdev, +struct rtw89_mcc_pattern *ptrn, +bool small_bcn_ofst) +{ +struct rtw89_mcc_info *mcc = &rtwdev->mcc; +struct rtw89_mcc_role *ref = &mcc->role_ref; +struct rtw89_mcc_role *aux = &mcc->role_aux; +struct rtw89_mcc_config *config = &mcc->config; +u16 bcn_ofst = config->beacon_offset; +u16 ref_tob; +u16 ref_toa; + +if (ref->limit.enable) { + ref_tob = ref->limit.max_tob; + ref_toa = ref->limit.max_toa; + }else { + ref_tob = ref->duration /2 ; + ref_toa = ref->duration /2 ; + } + +if (small_bcn_ofst) { + ptrn->toa_ref = ref_toa; + ptrn->tob_ref = ref->duration - ptrn->toa_ref; + }else { + ptrn->tob_ref = ref_tob; + ptrn->toa_ref = ref->duration - ptrn->tob_ref; + } + + ptrn->tob_aux = bcn_ofst - ptrn->toa_ref; + ptrn->toa_aux = aux->duration - ptrn->tob_aux; +} + +static void __rtw89_mcc_fill_ptrn_anchor_aux (struct rtw89_dev *rtwdev, +struct rtw89_mcc_pattern *ptrn, +bool small_bcn_ofst) +{ +struct rtw89_mcc_info *mcc = &rtwdev->mcc; +struct rtw89_mcc_role *ref = &mcc->role_ref; +struct rtw89_mcc_role *aux = &mcc->role_aux; +struct rtw89_mcc_config *config = &mcc->config; +u16 bcn_ofst = config->beacon_offset; +u16 aux_tob; +u16 aux_toa; + +if (aux->limit.enable) { + aux_tob = aux->limit.max_tob; + aux_toa = aux->limit.max_toa; + }else { + aux_tob = aux->duration /2 ; + aux_toa = aux->duration /2 ; + } + +if (small_bcn_ofst) { + ptrn->tob_aux = aux_tob; + ptrn->toa_aux = aux->duration - ptrn->tob_aux; + }else { + ptrn->toa_aux = aux_toa; + ptrn->tob_aux = aux->duration - ptrn->toa_aux; + } + + ptrn->toa_ref = bcn_ofst - ptrn->tob_aux; + ptrn->tob_ref = ref->duration - ptrn->toa_ref; +} + +static int __rtw89_mcc_calc_pattern_anchor (struct rtw89_dev *rtwdev, +struct rtw89_mcc_pattern *ptrn, +bool hdl_bt) +{ +struct rtw89_mcc_info *mcc = &rtwdev->mcc; +struct rtw89_mcc_role *ref = &mcc->role_ref; +struct rtw89_mcc_role *aux = &mcc->role_aux; +struct rtw89_mcc_config *config = &mcc->config; +u16 mcc_intvl = config->mcc_interval; +u16 bcn_ofst = config->beacon_offset; +bool small_bcn_ofst; + +if (bcn_ofst <RTW89_MCC_MIN_RX_BCN_TIME ) + small_bcn_ofst = true; +else if (mcc_intvl - bcn_ofst <RTW89_MCC_MIN_RX_BCN_TIME ) + small_bcn_ofst = false; +else +return -EPERM ; + + *ptrn = (typeof(*ptrn)){ + .plan = hdl_bt ?RTW89_MCC_PLAN_TAIL_BT :RTW89_MCC_PLAN_NO_BT , + }; + +rtw89_debug (rtwdev,RTW89_DBG_CHAN , +"MCC calc ptrn_ac: plan %d, bcn_ofst %d\n" , + ptrn->plan, bcn_ofst); + +if (ref->is_go || ref->is_gc) +__rtw89_mcc_fill_ptrn_anchor_ref (rtwdev, ptrn, small_bcn_ofst); +else if (aux->is_go || aux->is_gc) +__rtw89_mcc_fill_ptrn_anchor_aux (rtwdev, ptrn, small_bcn_ofst); +else +__rtw89_mcc_fill_ptrn_anchor_ref (rtwdev, ptrn, small_bcn_ofst); + +return 0 ; +} +static int rtw89_mcc_calc_pattern (struct rtw89_dev *rtwdev,bool hdl_bt) {struct rtw89_mcc_info *mcc = &rtwdev->mcc;
@@ -1238,6 +1339,10 @@ static int rtw89_mcc_calc_pattern(struct rtw89_dev *rtwdev, bool hdl_bt) goto done; } + ret =__rtw89_mcc_calc_pattern_anchor (rtwdev, &ptrn, hdl_bt); +if (!ret) + goto done; +__rtw89_mcc_calc_pattern_loose (rtwdev, &ptrn, hdl_bt); done:
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 5/6 wifi: rtw89: mcc: deal with non-periodic NoA
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
Originally, MCC just took periodic NoA into account. When the connected GO announces non-periodic NoA and GC side is during MCC, sometimes GC cannot receive beacons well if the MCC scheduling conflicts with the non-periodic NoA planning. After the loss exceeds the tolerable amount, beacon filter will report connection loss. However, in this case, the loss is acceptable. So now, MCC will calculate the range of non-periodic NoA. And then, don't care beacon loss during the range.
Besides, rtw89_mcc_fill_role_limit() only makes sense for GC. Remove the redundant check of GO.
--- drivers/net/wireless/realtek/rtw89/chan.c | 4 +- drivers/net/wireless/realtek/rtw89/core.c | 3 + drivers/net/wireless/realtek/rtw89/core.h | 9 ++ drivers/net/wireless/realtek/rtw89/mac.c | 3 +- drivers/net/wireless/realtek/rtw89/mac80211.c | 4 + drivers/net/wireless/realtek/rtw89/ps.c | 147 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/ps.h | 3 + drivers/net/wireless/realtek/rtw89/ser.c | 2 + 8 files changed, 173 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw89/chan.c +3 -1
@@ -776,9 +776,11 @@ static void rtw89_mcc_fill_role_limit(struct rtw89_dev *rtwdev,int ret;int i; -if (!mcc_role->is_go && !mcc_role->is_gc) +if (!mcc_role->is_gc)return ; +rtw89_p2p_noa_once_recalc (rtwvif_link); +rcu_read_lock (); bss_conf =rtw89_vif_rcu_dereference_link (rtwvif_link, true);
drivers/net/wireless/realtek/rtw89/core.c +3 -0
@@ -4004,6 +4004,9 @@ int rtw89_core_sta_link_disassoc(struct rtw89_dev *rtwdev,if (vif->type ==NL80211_IFTYPE_STATION )rtw89_fw_h2c_set_bcn_fltr_cfg (rtwdev, rtwvif_link, false); +if (rtwvif_link->wifi_role ==RTW89_WIFI_ROLE_P2P_CLIENT ) +rtw89_p2p_noa_once_deinit (rtwvif_link); +return 0 ; }
drivers/net/wireless/realtek/rtw89/core.h +9 -0
@@ -3485,6 +3485,14 @@ struct rtw89_p2p_noa_setter {u8 noa_index; }; +struct rtw89_ps_noa_once_handler { +bool in_duration; +u64 tsf_begin; +u64 tsf_end; +struct wiphy_delayed_work set_work; +struct wiphy_delayed_work clr_work; +}; +struct rtw89_vif_link {struct rtw89_vif *rtwvif;struct list_head dlink_schd;
@@ -3531,6 +3539,7 @@ struct rtw89_vif_link {struct rtw89_phy_rate_pattern rate_pattern;struct list_head general_pkt_list;struct rtw89_p2p_noa_setter p2p_noa; +struct rtw89_ps_noa_once_handler noa_once; };enum rtw89_lv1_rcvy_step {
drivers/net/wireless/realtek/rtw89/mac.c +2 -1
@@ -5025,7 +5025,8 @@ rtw89_mac_bcn_fltr_rpt(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvif_lswitch (type) {case RTW89_BCN_FLTR_BEACON_LOSS : -if (!rtwdev->scanning && !rtwvif->offchan) +if (!rtwdev->scanning && !rtwvif->offchan && + !rtwvif_link->noa_once.in_duration)ieee80211_connection_loss (vif);else rtw89_fw_h2c_set_bcn_fltr_cfg (rtwdev, rtwvif_link, true);
drivers/net/wireless/realtek/rtw89/mac80211.c +4 -0
@@ -114,6 +114,8 @@ static int __rtw89_ops_add_iface_link(struct rtw89_dev *rtwdev,wiphy_work_init (&rtwvif_link->update_beacon_work, rtw89_core_update_beacon_work);INIT_LIST_HEAD (&rtwvif_link->general_pkt_list); +rtw89_p2p_noa_once_init (rtwvif_link); + rtwvif_link->hit_rule =0 ; rtwvif_link->bcn_hit_cond =0 ; rtwvif_link->chanctx_assigned = false;
@@ -143,6 +145,8 @@ static void __rtw89_ops_remove_iface_link(struct rtw89_dev *rtwdev,wiphy_work_cancel (rtwdev->hw->wiphy, &rtwvif_link->update_beacon_work); +rtw89_p2p_noa_once_deinit (rtwvif_link); +rtw89_leave_ps_mode (rtwdev);rtw89_btc_ntfy_role_info (rtwdev, rtwvif_link,NULL ,BTC_ROLE_STOP );
drivers/net/wireless/realtek/rtw89/ps.c +147 -0
150 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/ps.h +3 -0
@@ -22,6 +22,9 @@ void rtw89_p2p_noa_renew(struct rtw89_vif_link *rtwvif_link);void rtw89_p2p_noa_append (struct rtw89_vif_link *rtwvif_link,const struct ieee80211_p2p_noa_desc *desc);u8 rtw89_p2p_noa_fetch (struct rtw89_vif_link *rtwvif_link,void **data); +void rtw89_p2p_noa_once_init (struct rtw89_vif_link *rtwvif_link); +void rtw89_p2p_noa_once_deinit (struct rtw89_vif_link *rtwvif_link); +void rtw89_p2p_noa_once_recalc (struct rtw89_vif_link *rtwvif_link);static inline void rtw89_leave_ips_by_hwflags (struct rtw89_dev *rtwdev) {
drivers/net/wireless/realtek/rtw89/ser.c +2 -0
@@ -310,6 +310,8 @@ static void ser_reset_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) rtwvif_link->net_type =RTW89_NET_TYPE_NO_LINK ; rtwvif_link->trigger = false; rtwvif_link->rand_tsf_done = false; + +rtw89_p2p_noa_once_deinit (rtwvif_link); } }
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 6/6 wifi: rtw89: mcc: avoid redundant recalculations if no chance to improve
In reply to Ping-Ke ShihFrom: Zong-Zhe Yang <[email protected]>
MCC will track the changes of beacon offset, and trigger a recalculation when the difference is larger than the tolerance. It means that a better pattern is expected after recalculating. However, in the cases which get a worse beacon offset, there is no chance to improve the pattern even if recalculating. So, bypass them.
--- drivers/net/wireless/realtek/rtw89/chan.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtw89/chan.c +10 -3
@@ -2367,7 +2367,7 @@ static void rtw89_mcc_track(struct rtw89_dev *rtwdev)struct rtw89_mcc_info *mcc = &rtwdev->mcc;struct rtw89_mcc_config *config = &mcc->config;struct rtw89_mcc_pattern *pattern = &config->pattern; -s16 tolerance; +u16 tolerance;u16 bcn_ofst;u16 diff;
@@ -2375,18 +2375,25 @@ static void rtw89_mcc_track(struct rtw89_dev *rtwdev)return ; bcn_ofst =rtw89_mcc_get_bcn_ofst (rtwdev); +if (bcn_ofst == config->beacon_offset) +return ; +if (bcn_ofst > config->beacon_offset) { diff = bcn_ofst - config->beacon_offset;if (pattern->tob_aux <0 ) tolerance = -pattern->tob_aux; -else +else if (pattern->toa_aux >0 ) tolerance = pattern->toa_aux; +else +return ;/* no chance to improve */ }else { diff = config->beacon_offset - bcn_ofst;if (pattern->toa_aux <0 ) tolerance = -pattern->toa_aux; -else +else if (pattern->tob_aux >0 ) tolerance = pattern->tob_aux; +else +return ;/* no chance to improve */ }if (diff <= tolerance)
Signature · 1 line
2.25.1