diff mbox series

[13/14] wifi: iwlwifi: support PPAG in China for older FW cmd version

Message ID 20230524203151.3cc19e799eeb.I9054b1d63fd7ae2b5f0e416825b4b1dc9f79cc80@changeid
State New
Headers show
Series [01/14] wifi: iwlwifi: cfg: freeze 22500 devices FW API | expand

Commit Message

Greenman, Gregory May 24, 2023, 5:42 p.m. UTC
From: Alon Giladi <alon.giladi@intel.com>

Allows the China bit in the ppag flags to turn on also when
FW cmd version is 1 (if FW has the capability).

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 10 +++++++++-
 drivers/net/wireless/intel/iwlwifi/fw/file.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index 9dfd2497d495..e6abd16f8677 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -1155,7 +1155,15 @@  int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
                         IWL_DEBUG_RADIO(fwrt,
                                         "PPAG table rev is %d but FW supports v1, sending truncated table\n",
                                         fwrt->ppag_ver);
-                        cmd->v1.flags &= cpu_to_le32(IWL_PPAG_ETSI_MASK);
+			if (!fw_has_capa(&fwrt->fw->ucode_capa,
+					 IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) {
+				cmd->v1.flags &= cpu_to_le32(IWL_PPAG_ETSI_MASK);
+				IWL_DEBUG_RADIO(fwrt,
+						"FW doesn't support ppag China bit\n");
+			} else {
+				IWL_DEBUG_RADIO(fwrt,
+						"FW supports ppag China bit\n");
+			}
 		}
 	} else if (cmd_ver >= 2 && cmd_ver <= 4) {
                 num_sub_bands = IWL_NUM_SUB_BANDS_V2;
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index cddf09d6be1c..ef2ff7517534 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -462,6 +462,7 @@  enum iwl_ucode_tlv_capa {
 	IWL_UCODE_TLV_CAPA_BIGTK_TX_SUPPORT		= (__force iwl_ucode_tlv_capa_t)109,
 	IWL_UCODE_TLV_CAPA_MLD_API_SUPPORT		= (__force iwl_ucode_tlv_capa_t)110,
 	IWL_UCODE_TLV_CAPA_SCAN_DONT_TOGGLE_ANT         = (__force iwl_ucode_tlv_capa_t)111,
+	IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT	= (__force iwl_ucode_tlv_capa_t)112,
 
 #ifdef __CHECKER__
 	/* sparse says it cannot increment the previous enum member */