iwlwifi: dbg_ini: change memory range base address to u64
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Sun, 17 Feb 2019 12:13:12 +0000 (14:13 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 3 Apr 2019 08:20:00 +0000 (11:20 +0300)
AX210 devices will use u64 for the base address to the DRAM monitor
buffer. To support this, change the structure for all device families
so both address sizes fit.

Also move range_data_size to the top of the struct to ease the parsing
of the memory range.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h

index a1d6765..1b6a850 100644 (file)
@@ -1053,7 +1053,7 @@ static int iwl_dump_ini_prph_iter(struct iwl_fw_runtime *fwrt,
        u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
        int i;
 
-       range->start_addr = cpu_to_le32(addr);
+       range->start_addr = cpu_to_le64(addr);
        range->range_data_size = reg->internal.range_data_size;
        for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) {
                prph_val = iwl_read_prph(fwrt->trans, addr + i);
@@ -1074,7 +1074,7 @@ static int iwl_dump_ini_csr_iter(struct iwl_fw_runtime *fwrt,
        u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
        int i;
 
-       range->start_addr = cpu_to_le32(addr);
+       range->start_addr = cpu_to_le64(addr);
        range->range_data_size = reg->internal.range_data_size;
        for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4)
                *val++ = cpu_to_le32(iwl_trans_read32(fwrt->trans, addr + i));
@@ -1089,7 +1089,7 @@ static int iwl_dump_ini_dev_mem_iter(struct iwl_fw_runtime *fwrt,
        struct iwl_fw_ini_error_dump_range *range = range_ptr;
        u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
 
-       range->start_addr = cpu_to_le32(addr);
+       range->start_addr = cpu_to_le64(addr);
        range->range_data_size = reg->internal.range_data_size;
        iwl_trans_read_mem_bytes(fwrt->trans, addr, range->data,
                                 le32_to_cpu(reg->internal.range_data_size));
@@ -1105,7 +1105,7 @@ iwl_dump_ini_paging_gen2_iter(struct iwl_fw_runtime *fwrt,
        struct iwl_fw_ini_error_dump_range *range = range_ptr;
        u32 page_size = fwrt->trans->init_dram.paging[idx].size;
 
-       range->start_addr = cpu_to_le32(idx);
+       range->start_addr = cpu_to_le64(idx);
        range->range_data_size = cpu_to_le32(page_size);
        memcpy(range->data, fwrt->trans->init_dram.paging[idx].block,
               page_size);
@@ -1125,7 +1125,7 @@ static int iwl_dump_ini_paging_iter(struct iwl_fw_runtime *fwrt,
        dma_addr_t addr = fwrt->fw_paging_db[idx].fw_paging_phys;
        u32 page_size = fwrt->fw_paging_db[idx].fw_paging_size;
 
-       range->start_addr = cpu_to_le32(idx);
+       range->start_addr = cpu_to_le64(idx);
        range->range_data_size = cpu_to_le32(page_size);
        dma_sync_single_for_cpu(fwrt->trans->dev, addr, page_size,
                                DMA_BIDIRECTIONAL);
@@ -1148,7 +1148,7 @@ iwl_dump_ini_mon_dram_iter(struct iwl_fw_runtime *fwrt,
        if (start_addr == 0x5a5a5a5a)
                return -EBUSY;
 
-       range->start_addr = cpu_to_le32(start_addr);
+       range->start_addr = cpu_to_le64(start_addr);
        range->range_data_size = cpu_to_le32(fwrt->trans->fw_mon[idx].size);
 
        memcpy(range->data, fwrt->trans->fw_mon[idx].block,
index d6c6796..0df72a9 100644 (file)
@@ -284,13 +284,13 @@ struct iwl_fw_error_dump_mem {
 
 /**
  * struct iwl_fw_ini_error_dump_range - range of memory
- * @start_addr: the start address of this range
  * @range_data_size: the size of this range, in bytes
+ * @start_addr: the start address of this range
  * @data: the actual memory
  */
 struct iwl_fw_ini_error_dump_range {
-       __le32 start_addr;
        __le32 range_data_size;
+       __le64 start_addr;
        __le32 data[];
 } __packed;