]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: support V13 of iwl_lari_config_change_cmd
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 11 Jan 2026 17:39:23 +0000 (19:39 +0200)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 21 Jan 2026 12:23:03 +0000 (14:23 +0200)
This command is getting a new field for UNII-9 and ieee80211bn
enablement.
We must read the relevant DSM values and pass them to the firmware,
Remember whether we have ACPI or UEFI available in the firmware runtime
object and remember the DSM function revision.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260111193638.9577f0cade21.I82b26f082f152a83eb9990dddf68d7dcc549f227@changeid
drivers/net/wireless/intel/iwlwifi/fw/acpi.c
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
drivers/net/wireless/intel/iwlwifi/fw/regulatory.h
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
drivers/net/wireless/intel/iwlwifi/fw/uefi.c
drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index 3899dc3915bfb5a0db033cdfbc924fad32de5d3e..de9aef0d924c95c7793d914143d756f6a4f390b3 100644 (file)
@@ -28,6 +28,8 @@ static const size_t acpi_dsm_size[DSM_FUNC_NUM_FUNCS] = {
        [DSM_FUNC_ENERGY_DETECTION_THRESHOLD] = sizeof(u32),
        [DSM_FUNC_RFI_CONFIG] =                 sizeof(u32),
        [DSM_FUNC_ENABLE_11BE] =                sizeof(u32),
+       [DSM_FUNC_ENABLE_UNII_9] =              sizeof(u32),
+       [DSM_FUNC_ENABLE_11BN] =                sizeof(u32),
 };
 
 static int iwl_acpi_get_handle(struct device *dev, acpi_string method,
@@ -177,6 +179,9 @@ static int iwl_acpi_load_dsm_values(struct iwl_fw_runtime *fwrt)
                return ret;
        }
 
+       fwrt->dsm_revision = ACPI_DSM_REV;
+       fwrt->dsm_source = BIOS_SOURCE_ACPI;
+
        IWL_DEBUG_RADIO(fwrt, "ACPI DSM validity bitmap 0x%x\n",
                        (u32)query_func_val);
 
index 48f407baed39b8f2e964610ded400df1cf55c32e..f6b59e0090362c6ded1f789fded0f9e6893c170f 100644 (file)
@@ -658,6 +658,10 @@ struct iwl_lari_config_change_cmd_v8 {
  *     bit0: enable 11be in China(CB/CN).
  *     bit1: enable 11be in South Korea.
  *     bit 2 - 31: reserved.
+ * @oem_11bn_allow_bitmap: Bitmap of 11bn allowed MCCs. The firmware expects to
+ *     get the data from the BIOS.
+ * @oem_unii9_enable: UNII-9 enablement as read from the BIOS
+ * @bios_hdr: bios config header
  */
 struct iwl_lari_config_change_cmd {
        __le32 config_bitmap;
@@ -669,8 +673,16 @@ struct iwl_lari_config_change_cmd {
        __le32 edt_bitmap;
        __le32 oem_320mhz_allow_bitmap;
        __le32 oem_11be_allow_bitmap;
+       /* since version 13 */
+       __le32 oem_11bn_allow_bitmap;
+       /* since version 13 */
+       __le32 oem_unii9_enable;
+       /* since version 13 */
+       struct iwl_bios_config_hdr bios_hdr;
 } __packed;
-/* LARI_CHANGE_CONF_CMD_S_VER_12 */
+/* LARI_CHANGE_CONF_CMD_S_VER_12
+ * LARI_CHANGE_CONF_CMD_S_VER_13
+ */
 
 /* Activate UNII-1 (5.2GHz) for World Wide */
 #define ACTIVATE_5G2_IN_WW_MASK                        BIT(4)
index 26c1d3fad4df2f3bb37f403b43af0fdb61e6a9ca..1489031687b78cad4e0ab8bb27449db645e1c01e 100644 (file)
@@ -125,7 +125,9 @@ enum iwl_dsm_funcs {
        DSM_FUNC_ENERGY_DETECTION_THRESHOLD = 10,
        DSM_FUNC_RFI_CONFIG = 11,
        DSM_FUNC_ENABLE_11BE = 12,
-       DSM_FUNC_NUM_FUNCS = 13,
+       DSM_FUNC_ENABLE_11BN = 13,
+       DSM_FUNC_ENABLE_UNII_9 = 14,
+       DSM_FUNC_NUM_FUNCS,
 };
 
 enum iwl_dsm_values_srd {
index a655bca753010bdea049f129fa5e08c998d7d8f5..ff186fb2e0da1de323987f0b7439688f8f07d50f 100644 (file)
@@ -141,6 +141,8 @@ struct iwl_txf_iter_data {
  * @timestamp.seq: timestamp marking sequence
  * @timestamp.delay: timestamp marking worker delay
  * @tpc_enabled: TPC enabled
+ * @dsm_source: one of &enum bios_source. UEFI, ACPI or NONE
+ * @dsm_revision: the revision of the DSM table
  */
 struct iwl_fw_runtime {
        struct iwl_trans *trans;
@@ -215,6 +217,8 @@ struct iwl_fw_runtime {
        bool uats_valid;
        u8 uefi_tables_lock_status;
        struct iwl_phy_specific_cfg phy_filters;
+       enum bios_source dsm_source;
+       u8 dsm_revision;
 
 #if defined(CONFIG_ACPI) || defined(CONFIG_EFI)
        u32 dsm_funcs_valid;
index acccb22a833c9c35cf85d90220848b97ab30129d..b7532494d4e031a8031391036762a80d62f29244 100644 (file)
@@ -738,6 +738,8 @@ static int iwl_uefi_load_dsm_values(struct iwl_fw_runtime *fwrt)
                                data->revision);
                goto out;
        }
+       fwrt->dsm_revision = data->revision;
+       fwrt->dsm_source = BIOS_SOURCE_UEFI;
 
        fwrt->dsm_funcs_valid = data->functions[DSM_FUNC_QUERY];
 
index 7d11036f9e04abcfd76aa51927a679d2486ea15c..6ab5a34103532c417cbb420d5146c53a8a0636ac 100644 (file)
@@ -281,6 +281,14 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
        if (!ret)
                cmd.oem_11be_allow_bitmap = cpu_to_le32(value);
 
+       ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_11BN, &value);
+       if (!ret)
+               cmd.oem_11bn_allow_bitmap = cpu_to_le32(value);
+
+       ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII_9, &value);
+       if (!ret)
+               cmd.oem_unii9_enable = cpu_to_le32(value);
+
        if (!cmd.config_bitmap &&
            !cmd.oem_uhb_allow_bitmap &&
            !cmd.oem_11ax_allow_bitmap &&
@@ -289,9 +297,14 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
            !cmd.force_disable_channels_bitmap &&
            !cmd.edt_bitmap &&
            !cmd.oem_320mhz_allow_bitmap &&
-           !cmd.oem_11be_allow_bitmap)
+           !cmd.oem_11be_allow_bitmap &&
+           !cmd.oem_11bn_allow_bitmap &&
+           !cmd.oem_unii9_enable)
                return;
 
+       cmd.bios_hdr.table_source = fwrt->dsm_source;
+       cmd.bios_hdr.table_revision = fwrt->dsm_revision;
+
        IWL_DEBUG_RADIO(mld,
                        "sending LARI_CONFIG_CHANGE, config_bitmap=0x%x, oem_11ax_allow_bitmap=0x%x\n",
                        le32_to_cpu(cmd.config_bitmap),
@@ -311,9 +324,28 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
        IWL_DEBUG_RADIO(mld,
                        "sending LARI_CONFIG_CHANGE, oem_11be_allow_bitmap=0x%x\n",
                        le32_to_cpu(cmd.oem_11be_allow_bitmap));
-
-       ret = iwl_mld_send_cmd_pdu(mld, WIDE_ID(REGULATORY_AND_NVM_GROUP,
-                                               LARI_CONFIG_CHANGE), &cmd);
+       IWL_DEBUG_RADIO(mld,
+                       "sending LARI_CONFIG_CHANGE, oem_11bn_allow_bitmap=0x%x\n",
+                       le32_to_cpu(cmd.oem_11bn_allow_bitmap));
+       IWL_DEBUG_RADIO(mld,
+                       "sending LARI_CONFIG_CHANGE, oem_unii9_enable=0x%x\n",
+                       le32_to_cpu(cmd.oem_unii9_enable));
+
+       if (iwl_fw_lookup_cmd_ver(mld->fw,
+                                 WIDE_ID(REGULATORY_AND_NVM_GROUP,
+                                         LARI_CONFIG_CHANGE), 12) == 12) {
+               int cmd_size = offsetof(typeof(cmd), oem_11bn_allow_bitmap);
+
+               ret = iwl_mld_send_cmd_pdu(mld,
+                                          WIDE_ID(REGULATORY_AND_NVM_GROUP,
+                                                  LARI_CONFIG_CHANGE),
+                                          &cmd, cmd_size);
+       } else {
+               ret = iwl_mld_send_cmd_pdu(mld,
+                                          WIDE_ID(REGULATORY_AND_NVM_GROUP,
+                                                  LARI_CONFIG_CHANGE),
+                                          &cmd);
+       }
        if (ret)
                IWL_DEBUG_RADIO(mld,
                                "Failed to send LARI_CONFIG_CHANGE (%d)\n",
index a34ca8073ca89829bfbe6eb658cddb598ff95003..43cf94c9a36bdfe773957b781727df861781a443 100644 (file)
@@ -1220,7 +1220,8 @@ static size_t iwl_mvm_get_lari_config_cmd_size(u8 cmd_ver)
 
        switch (cmd_ver) {
        case 12:
-               cmd_size = sizeof(struct iwl_lari_config_change_cmd);
+               cmd_size = offsetof(struct iwl_lari_config_change_cmd,
+                                   oem_11bn_allow_bitmap);
                break;
        case 8:
                cmd_size = sizeof(struct iwl_lari_config_change_cmd_v8);