wifi: rtw89: mcc: deal with P2P PS change
MCC fills duration limit of a role according to NoA description. If P2P PS changes during MCC, we don't process P2P PS via normal flow. Instead, we re-fill duration limit of the role for new NoA description, and then we do MCC update. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230908031145.20931-7-pkshih@realtek.com
This commit is contained in:
parent
5f69aabab1
commit
15fe9b7319
@ -1596,6 +1596,26 @@ static void rtw89_mcc_update_macid_bitmap(struct rtw89_dev *rtwdev)
|
||||
rtw89_iterate_mcc_roles(rtwdev, rtw89_mcc_upd_map_iterator, NULL);
|
||||
}
|
||||
|
||||
static int rtw89_mcc_upd_lmt_iterator(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_mcc_role *mcc_role,
|
||||
unsigned int ordered_idx,
|
||||
void *data)
|
||||
{
|
||||
memset(&mcc_role->limit, 0, sizeof(mcc_role->limit));
|
||||
rtw89_mcc_fill_role_limit(rtwdev, mcc_role);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rtw89_mcc_update_limit(struct rtw89_dev *rtwdev)
|
||||
{
|
||||
struct rtw89_mcc_info *mcc = &rtwdev->mcc;
|
||||
|
||||
if (mcc->mode != RTW89_MCC_MODE_GC_STA)
|
||||
return;
|
||||
|
||||
rtw89_iterate_mcc_roles(rtwdev, rtw89_mcc_upd_lmt_iterator, NULL);
|
||||
}
|
||||
|
||||
void rtw89_chanctx_work(struct work_struct *work)
|
||||
{
|
||||
struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev,
|
||||
@ -1625,10 +1645,13 @@ void rtw89_chanctx_work(struct work_struct *work)
|
||||
rtw89_warn(rtwdev, "failed to start MCC: %d\n", ret);
|
||||
break;
|
||||
case RTW89_ENTITY_MODE_MCC:
|
||||
if (changed & BIT(RTW89_CHANCTX_BCN_OFFSET_CHANGE))
|
||||
if (changed & BIT(RTW89_CHANCTX_BCN_OFFSET_CHANGE) ||
|
||||
changed & BIT(RTW89_CHANCTX_P2P_PS_CHANGE))
|
||||
update_mcc_pattern = true;
|
||||
if (changed & BIT(RTW89_CHANCTX_REMOTE_STA_CHANGE))
|
||||
rtw89_mcc_update_macid_bitmap(rtwdev);
|
||||
if (changed & BIT(RTW89_CHANCTX_P2P_PS_CHANGE))
|
||||
rtw89_mcc_update_limit(rtwdev);
|
||||
if (update_mcc_pattern) {
|
||||
ret = rtw89_mcc_update(rtwdev);
|
||||
if (ret)
|
||||
|
@ -2673,6 +2673,16 @@ static void rtw89_core_rfk_track(struct rtw89_dev *rtwdev)
|
||||
rtw89_chip_rfk_track(rtwdev);
|
||||
}
|
||||
|
||||
void rtw89_core_update_p2p_ps(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif)
|
||||
{
|
||||
enum rtw89_entity_mode mode = rtw89_get_entity_mode(rtwdev);
|
||||
|
||||
if (mode == RTW89_ENTITY_MODE_MCC)
|
||||
rtw89_queue_chanctx_change(rtwdev, RTW89_CHANCTX_P2P_PS_CHANGE);
|
||||
else
|
||||
rtw89_process_p2p_ps(rtwdev, vif);
|
||||
}
|
||||
|
||||
void rtw89_traffic_stats_init(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_traffic_stats *stats)
|
||||
{
|
||||
|
@ -3790,6 +3790,7 @@ struct rtw89_chanctx_cfg {
|
||||
enum rtw89_chanctx_changes {
|
||||
RTW89_CHANCTX_REMOTE_STA_CHANGE,
|
||||
RTW89_CHANCTX_BCN_OFFSET_CHANGE,
|
||||
RTW89_CHANCTX_P2P_PS_CHANGE,
|
||||
|
||||
NUM_OF_RTW89_CHANCTX_CHANGES,
|
||||
RTW89_CHANCTX_CHANGE_DFLT = NUM_OF_RTW89_CHANCTX_CHANGES,
|
||||
@ -5526,6 +5527,7 @@ void rtw89_core_scan_complete(struct rtw89_dev *rtwdev,
|
||||
struct ieee80211_vif *vif, bool hw_scan);
|
||||
void rtw89_reg_6ghz_power_recalc(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif *rtwvif, bool active);
|
||||
void rtw89_core_update_p2p_ps(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif);
|
||||
void rtw89_core_ntfy_btc_event(struct rtw89_dev *rtwdev, enum rtw89_btc_hmsg event);
|
||||
|
||||
#endif
|
||||
|
@ -445,7 +445,7 @@ static void rtw89_ops_bss_info_changed(struct ieee80211_hw *hw,
|
||||
rtw89_mac_bf_set_gid_table(rtwdev, vif, conf);
|
||||
|
||||
if (changed & BSS_CHANGED_P2P_PS)
|
||||
rtw89_process_p2p_ps(rtwdev, vif);
|
||||
rtw89_core_update_p2p_ps(rtwdev, vif);
|
||||
|
||||
if (changed & BSS_CHANGED_CQM)
|
||||
rtw89_fw_h2c_set_bcn_fltr_cfg(rtwdev, vif, true);
|
||||
|
Loading…
Reference in New Issue
Block a user