wifi: iwlwifi: dbg: add support for DBGC4 on BZ family and above
authorRotem Saado <rotem.saado@intel.com>
Wed, 2 Nov 2022 14:59:49 +0000 (16:59 +0200)
committerGregory Greenman <gregory.greenman@intel.com>
Thu, 10 Nov 2022 11:26:37 +0000 (13:26 +0200)
Update the for loop that iterates over all the DBGCs to include DBGC4.
DBGC4 is only supported staring from the BZ family of devices, so check
the family before accepting it.

Signed-off-by: Rotem Saado <rotem.saado@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20221102165239.0b6050b41060.Id662c716c2e3c2c850740d1f71e2801e02aeddaf@changeid
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c

index 3237d4b528b5d9ed74ce74ce7c1b3a237d848fc1..cd7a84c553e955e49be1437269b86818fc9fbb4d 100644 (file)
@@ -590,6 +590,9 @@ static int iwl_dbg_tlv_alloc_fragments(struct iwl_fw_runtime *fwrt,
                if (alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1)
                        return -EIO;
                num_frags = 1;
+       } else if (fwrt->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ &&
+                          alloc_id > IWL_FW_INI_ALLOCATION_ID_DBGC3) {
+               return -EIO;
        }
 
        remain_pages = DIV_ROUND_UP(le32_to_cpu(fw_mon_cfg->req_size),
@@ -789,7 +792,7 @@ static void iwl_dbg_tlv_update_drams(struct iwl_fw_runtime *fwrt)
        dram_info->second_word = cpu_to_le32(DRAM_INFO_SECOND_MAGIC_WORD);
 
        for (i = IWL_FW_INI_ALLOCATION_ID_DBGC1;
-            i <= IWL_FW_INI_ALLOCATION_ID_DBGC3; i++) {
+            i < IWL_FW_INI_ALLOCATION_NUM; i++) {
                ret = iwl_dbg_tlv_update_dram(fwrt, i, dram_info);
                if (!ret)
                        dram_alloc = true;