wifi: rtw89: move disabling dynamic mechanism functions to core

Some dynamic mechanism (DM) may need to be disabled during some normal
processes rather than debugging. For example, should not do MLSR switch
during SCAN/ROC or even MCC. So, move the disabling DM functions to core
for impending uses.

No logic changes.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260310080146.31113-6-pkshih@realtek.com
This commit is contained in:
Zong-Zhe Yang 2026-03-10 16:01:38 +08:00 committed by Ping-Ke Shih
parent 84f5e0eaf8
commit be28b2c4ee
3 changed files with 35 additions and 32 deletions

View File

@ -4713,6 +4713,35 @@ static void rtw89_track_work(struct wiphy *wiphy, struct wiphy_work *work)
rtw89_enter_lps_track(rtwdev);
}
void rtw89_core_dm_disable_cfg(struct rtw89_dev *rtwdev, u32 new)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 old = hal->disabled_dm_bitmap;
if (new == old)
return;
hal->disabled_dm_bitmap = new;
rtw89_debug(rtwdev, RTW89_DBG_STATE, "Disable DM: 0x%x -> 0x%x\n", old, new);
}
void rtw89_core_dm_disable_set(struct rtw89_dev *rtwdev, enum rtw89_dm_type type)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 cur = hal->disabled_dm_bitmap;
rtw89_core_dm_disable_cfg(rtwdev, cur | BIT(type));
}
void rtw89_core_dm_disable_clr(struct rtw89_dev *rtwdev, enum rtw89_dm_type type)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 cur = hal->disabled_dm_bitmap;
rtw89_core_dm_disable_cfg(rtwdev, cur & ~BIT(type));
}
u8 rtw89_core_acquire_bit_map(unsigned long *addr, unsigned long size)
{
unsigned long bit;

View File

@ -7862,5 +7862,8 @@ void rtw89_core_update_p2p_ps(struct rtw89_dev *rtwdev,
void rtw89_core_ntfy_btc_event(struct rtw89_dev *rtwdev, enum rtw89_btc_hmsg event);
int rtw89_core_mlsr_switch(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
unsigned int link_id);
void rtw89_core_dm_disable_cfg(struct rtw89_dev *rtwdev, u32 new);
void rtw89_core_dm_disable_set(struct rtw89_dev *rtwdev, enum rtw89_dm_type type);
void rtw89_core_dm_disable_clr(struct rtw89_dev *rtwdev, enum rtw89_dm_type type);
#endif

View File

@ -4333,35 +4333,6 @@ static ssize_t rtw89_debug_priv_stations_get(struct rtw89_dev *rtwdev,
return p - buf;
}
static void rtw89_debug_disable_dm_cfg_bmap(struct rtw89_dev *rtwdev, u32 new)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 old = hal->disabled_dm_bitmap;
if (new == old)
return;
hal->disabled_dm_bitmap = new;
rtw89_debug(rtwdev, RTW89_DBG_STATE, "Disable DM: 0x%x -> 0x%x\n", old, new);
}
static void rtw89_debug_disable_dm_set_flag(struct rtw89_dev *rtwdev, u8 flag)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 cur = hal->disabled_dm_bitmap;
rtw89_debug_disable_dm_cfg_bmap(rtwdev, cur | BIT(flag));
}
static void rtw89_debug_disable_dm_clr_flag(struct rtw89_dev *rtwdev, u8 flag)
{
struct rtw89_hal *hal = &rtwdev->hal;
u32 cur = hal->disabled_dm_bitmap;
rtw89_debug_disable_dm_cfg_bmap(rtwdev, cur & ~BIT(flag));
}
#define DM_INFO(type) {RTW89_DM_ ## type, #type}
static const struct rtw89_disabled_dm_info {
@ -4412,7 +4383,7 @@ rtw89_debug_priv_disable_dm_set(struct rtw89_dev *rtwdev,
if (ret)
return -EINVAL;
rtw89_debug_disable_dm_cfg_bmap(rtwdev, conf);
rtw89_core_dm_disable_cfg(rtwdev, conf);
return count;
}
@ -4475,7 +4446,7 @@ rtw89_debug_priv_mlo_mode_set(struct rtw89_dev *rtwdev,
if (num != 2)
return -EINVAL;
rtw89_debug_disable_dm_set_flag(rtwdev, RTW89_DM_MLO);
rtw89_core_dm_disable_set(rtwdev, RTW89_DM_MLO);
rtw89_debug(rtwdev, RTW89_DBG_STATE, "Set MLO mode to %x\n", mlo_mode);
@ -4485,7 +4456,7 @@ rtw89_debug_priv_mlo_mode_set(struct rtw89_dev *rtwdev,
break;
default:
rtw89_debug(rtwdev, RTW89_DBG_STATE, "Unsupported MLO mode\n");
rtw89_debug_disable_dm_clr_flag(rtwdev, RTW89_DM_MLO);
rtw89_core_dm_disable_clr(rtwdev, RTW89_DM_MLO);
return -EOPNOTSUPP;
}