]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
iwlwifi: mvm: add support for version 3 of LARI_CONFIG_CHANGE command.
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 11 Apr 2021 09:46:28 +0000 (12:46 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 14 Apr 2021 09:07:20 +0000 (12:07 +0300)
Add support for version 3 of the LARI_CONFIG_CHANGE command.
This is needed to support FW API change which is needed
to support 11ax enablement in Russia.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.7e68856c8a95.I83acdbe39b63c363cabc04ad42d1d0b9ce98901c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/acpi.c
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index eecc76a6e408cd8cf5b4331e3fc333ef79d41c93..e31bba836c6f70087197c46e3ac40b884f425f30 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
  * Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2019-2020 Intel Corporation
+ * Copyright (C) 2019-2021 Intel Corporation
  */
 #include <linux/uuid.h>
 #include "iwl-drv.h"
@@ -759,14 +759,6 @@ __le32 iwl_acpi_get_lari_config_bitmap(struct iwl_fw_runtime *fwrt)
                config_bitmap |=
                        cpu_to_le32(LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK);
 
-       /*
-        ** Evaluate func 'DSM_FUNC_11AX_ENABLEMENT'
-        */
-       ret = iwl_acpi_eval_dsm_func(fwrt->dev, DSM_FUNC_11AX_ENABLEMENT);
-
-       config_bitmap |=
-               cpu_to_le32((ret &= IWL_11AX_UKRAINE_MASK) << IWL_11AX_UKRAINE_SHIFT);
-
        return config_bitmap;
 }
 IWL_EXPORT_SYMBOL(iwl_acpi_get_lari_config_bitmap);
index 3a358bbdde8e434ab0ed577293c23490d52fa750..dc8f2777e944f78d19b17a059b5d3a77ef4c5f3e 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018-2020 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -437,6 +437,21 @@ struct iwl_lari_config_change_cmd_v2 {
        __le32 oem_uhb_allow_bitmap;
 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_2 */
 
+/**
+ * struct iwl_lari_config_change_cmd_v3 - change LARI configuration
+ * @config_bitmap: bit map of the config commands. each bit will trigger a
+ * different predefined FW config operation
+ * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
+ * @oem_11ax_allow_bitmap: bitmap of 11ax allowed MCCs.
+ * For each supported country, a pair of regulatory override bit and 11ax mode exist
+ * in the bit field.
+ */
+struct iwl_lari_config_change_cmd_v3 {
+       __le32 config_bitmap;
+       __le32 oem_uhb_allow_bitmap;
+       __le32 oem_11ax_allow_bitmap;
+} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_3 */
+
 /**
  * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
  * @status: PNVM image loading status
index 9a3981f430501dedd217a190e6a16fc4a5bb82a2..8aa5f1a2c58cbeec9d956f8c3c324ab07b8ffdbc 100644 (file)
@@ -1140,18 +1140,24 @@ static u8 iwl_mvm_eval_dsm_rfi(struct iwl_mvm *mvm)
 static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
 {
        int cmd_ret;
-       struct iwl_lari_config_change_cmd_v2 cmd = {};
+       struct iwl_lari_config_change_cmd_v3 cmd = {};
 
        cmd.config_bitmap = iwl_acpi_get_lari_config_bitmap(&mvm->fwrt);
 
        /* apply more config masks here */
 
        if (cmd.config_bitmap) {
-               size_t cmd_size = iwl_fw_lookup_cmd_ver(mvm->fw,
-                                                       REGULATORY_AND_NVM_GROUP,
-                                                       LARI_CONFIG_CHANGE, 1) == 2 ?
-                       sizeof(struct iwl_lari_config_change_cmd_v2) :
-                       sizeof(struct iwl_lari_config_change_cmd_v1);
+               size_t cmd_size;
+               u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
+                                                  REGULATORY_AND_NVM_GROUP,
+                                                  LARI_CONFIG_CHANGE, 1);
+               if (cmd_ver == 3)
+                       cmd_size = sizeof(struct iwl_lari_config_change_cmd_v3);
+               else if (cmd_ver == 2)
+                       cmd_size = sizeof(struct iwl_lari_config_change_cmd_v2);
+               else
+                       cmd_size = sizeof(struct iwl_lari_config_change_cmd_v1);
+
                IWL_DEBUG_RADIO(mvm,
                                "sending LARI_CONFIG_CHANGE, config_bitmap=0x%x\n",
                                le32_to_cpu(cmd.config_bitmap));