wifi: rtw89: debug: disable hw_scan for latency-sensitive scenarios

This helps avoid scan-triggered off-channel activity during
latency-sensitive scenarios.

Add RTW89_DM_HW_SCAN to the disabled_dm bitmap via debugfs and
check it in the hw_scan path. When set, the driver rejects hw_scan
requests and returns -EBUSY.

Signed-off-by: Johnson Tsai <wenjie.tsai@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260420034051.17666-4-pkshih@realtek.com
This commit is contained in:
Johnson Tsai 2026-04-20 11:40:38 +08:00 committed by Ping-Ke Shih
parent fdf0eb3551
commit 3da737c777
3 changed files with 9 additions and 0 deletions

View File

@ -5178,6 +5178,7 @@ enum rtw89_dm_type {
RTW89_DM_THERMAL_PROTECT,
RTW89_DM_TAS,
RTW89_DM_MLO,
RTW89_DM_HW_SCAN,
};
#define RTW89_THERMAL_PROT_LV_MAX 5

View File

@ -4347,6 +4347,7 @@ static const struct rtw89_disabled_dm_info {
DM_INFO(THERMAL_PROTECT),
DM_INFO(TAS),
DM_INFO(MLO),
DM_INFO(HW_SCAN),
};
static ssize_t

View File

@ -1241,6 +1241,7 @@ static int rtw89_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
struct rtw89_vif_link *rtwvif_link;
struct rtw89_hal *hal = &rtwdev->hal;
int ret;
lockdep_assert_wiphy(hw->wiphy);
@ -1248,6 +1249,12 @@ static int rtw89_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
return 1;
if (hal->disabled_dm_bitmap & BIT(RTW89_DM_HW_SCAN)) {
rtw89_debug(rtwdev, RTW89_DBG_HW_SCAN,
"reject hw scan due to disabled_dm\n");
return -EBUSY;
}
if (rtwdev->scanning || rtwvif->offchan)
return -EBUSY;