]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: usb: skip ACPI capability check for USB devices
authorDavid Lee <sc.lee@realtek.com>
Mon, 25 May 2026 08:26:36 +0000 (16:26 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 3 Jun 2026 06:44:33 +0000 (14:44 +0800)
Skip the ACPI capability check for all USB devices by default,
allowing them to use their default configurations.

For USB dongles, customers will manage their own compliance and
certification. This initial patch focuses on the generic USB skip
infrastructure; specific customer certifications and localized
configurations will be handled by quirks afterward.

Signed-off-by: David Lee <sc.lee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260525082636.31105-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/regd.c
drivers/net/wireless/realtek/rtw89/sar.c

index 28466cb35ea280178927a8afa0d143cac91ed698..14fab6b1a74a7588ca34979d58397ceacf8023df 100644 (file)
@@ -360,6 +360,7 @@ static void rtw89_regd_setup_unii4(struct rtw89_dev *rtwdev,
                                   struct wiphy *wiphy)
 {
        struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_chip_info *chip = rtwdev->chip;
        struct ieee80211_supported_band *sband;
        struct rtw89_acpi_dsm_result res = {};
@@ -377,6 +378,9 @@ static void rtw89_regd_setup_unii4(struct rtw89_dev *rtwdev,
                return;
        }
 
+       if (skip_acpi_dsm)
+               return;
+
        bitmap_fill(regulatory->block_unii4, RTW89_REGD_MAX_COUNTRY_NUM);
 
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_UNII4_SUP, &res);
@@ -426,6 +430,7 @@ static void __rtw89_regd_setup_policy_6ghz(struct rtw89_dev *rtwdev, bool block,
 static void rtw89_regd_setup_policy_6ghz(struct rtw89_dev *rtwdev)
 {
        struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_acpi_country_code *country;
        const struct rtw89_acpi_policy_6ghz *ptr;
        struct rtw89_acpi_dsm_result res = {};
@@ -433,6 +438,9 @@ static void rtw89_regd_setup_policy_6ghz(struct rtw89_dev *rtwdev)
        int i, j;
        int ret;
 
+       if (skip_acpi_dsm)
+               return;
+
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_6G_BP, &res);
        if (ret) {
                rtw89_debug(rtwdev, RTW89_DBG_REGD,
@@ -478,12 +486,16 @@ out:
 static void rtw89_regd_setup_policy_6ghz_sp(struct rtw89_dev *rtwdev)
 {
        struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_acpi_policy_6ghz_sp *ptr;
        struct rtw89_acpi_dsm_result res = {};
        bool enable;
        u8 index;
        int ret;
 
+       if (skip_acpi_dsm)
+               return;
+
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_6GHZ_SP_SUP, &res);
        if (ret) {
                rtw89_debug(rtwdev, RTW89_DBG_REGD,
@@ -524,6 +536,7 @@ out:
 static void rtw89_regd_setup_policy_6ghz_vlp(struct rtw89_dev *rtwdev)
 {
        struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_acpi_policy_6ghz_vlp *ptr = NULL;
        struct rtw89_acpi_dsm_result res = {};
        bool enable;
@@ -531,6 +544,9 @@ static void rtw89_regd_setup_policy_6ghz_vlp(struct rtw89_dev *rtwdev)
        int ret;
        u8 val;
 
+       if (skip_acpi_dsm)
+               return;
+
        /* By default, allow 6 GHz VLP on all countries except US and CA. */
        val = ~(RTW89_ACPI_CONF_6GHZ_VLP_US | RTW89_ACPI_CONF_6GHZ_VLP_CA);
 
@@ -574,6 +590,7 @@ static void rtw89_regd_setup_6ghz(struct rtw89_dev *rtwdev, struct wiphy *wiphy)
 {
        const struct rtw89_chip_info *chip = rtwdev->chip;
        bool chip_support_6ghz = chip->support_bands & BIT(NL80211_BAND_6GHZ);
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        bool regd_allow_6ghz = chip_support_6ghz;
        struct ieee80211_supported_band *sband;
        struct rtw89_acpi_dsm_result res = {};
@@ -583,6 +600,9 @@ static void rtw89_regd_setup_6ghz(struct rtw89_dev *rtwdev, struct wiphy *wiphy)
        if (!chip_support_6ghz)
                goto bottom;
 
+       if (skip_acpi_dsm)
+               goto bottom;
+
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_6G_DIS, &res);
        if (ret) {
                rtw89_debug(rtwdev, RTW89_DBG_REGD,
@@ -661,10 +681,14 @@ const char *rtw89_regd_get_string(enum rtw89_regulation_type regd)
 static void rtw89_regd_setup_reg_rules(struct rtw89_dev *rtwdev)
 {
        struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_acpi_policy_reg_rules *ptr;
        struct rtw89_acpi_dsm_result res = {};
        int ret;
 
+       if (skip_acpi_dsm)
+               return;
+
        regulatory->txpwr_uk_follow_etsi = true;
 
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_REG_RULES_EN, &res);
index 7886ffaf56957d1b494997fef14777ccdba4f777..6fe3822eb598701da2434478cd7f78c138e83f87 100644 (file)
@@ -693,6 +693,7 @@ static bool rtw89_tas_rolling_average(struct rtw89_dev *rtwdev)
 
 static void rtw89_tas_init(struct rtw89_dev *rtwdev)
 {
+       bool skip_acpi_dsm = rtwdev->hci.type == RTW89_HCI_TYPE_USB;
        const struct rtw89_chip_info *chip = rtwdev->chip;
        struct rtw89_tas_info *tas = &rtwdev->tas;
        const struct rtw89_acpi_policy_tas *ptr;
@@ -702,6 +703,9 @@ static void rtw89_tas_init(struct rtw89_dev *rtwdev)
        if (!chip->support_tas)
                return;
 
+       if (skip_acpi_dsm)
+               return;
+
        ret = rtw89_acpi_evaluate_dsm(rtwdev, RTW89_ACPI_DSM_FUNC_TAS_EN, &res);
        if (ret) {
                rtw89_debug(rtwdev, RTW89_DBG_SAR,