Commit 9802162f authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: dbg_ini: add memory offset to the base address of a memory region

Add the offset to the base address of a memory region to show the actual
addresses being read.
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 4bdb2676
...@@ -1049,14 +1049,14 @@ static int iwl_dump_ini_prph_iter(struct iwl_fw_runtime *fwrt, ...@@ -1049,14 +1049,14 @@ static int iwl_dump_ini_prph_iter(struct iwl_fw_runtime *fwrt,
{ {
struct iwl_fw_ini_error_dump_range *range = range_ptr; struct iwl_fw_ini_error_dump_range *range = range_ptr;
__le32 *val = range->data; __le32 *val = range->data;
u32 addr, prph_val, offset = le32_to_cpu(reg->offset); u32 prph_val;
u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
int i; int i;
range->start_addr = reg->start_addr[idx]; range->start_addr = cpu_to_le32(addr);
range->range_data_size = reg->internal.range_data_size; range->range_data_size = reg->internal.range_data_size;
for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) { for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) {
addr = le32_to_cpu(range->start_addr) + i; prph_val = iwl_read_prph(fwrt->trans, addr + i);
prph_val = iwl_read_prph(fwrt->trans, addr + offset);
if (prph_val == 0x5a5a5a5a) if (prph_val == 0x5a5a5a5a)
return -EBUSY; return -EBUSY;
*val++ = cpu_to_le32(prph_val); *val++ = cpu_to_le32(prph_val);
...@@ -1071,16 +1071,13 @@ static int iwl_dump_ini_csr_iter(struct iwl_fw_runtime *fwrt, ...@@ -1071,16 +1071,13 @@ static int iwl_dump_ini_csr_iter(struct iwl_fw_runtime *fwrt,
{ {
struct iwl_fw_ini_error_dump_range *range = range_ptr; struct iwl_fw_ini_error_dump_range *range = range_ptr;
__le32 *val = range->data; __le32 *val = range->data;
u32 addr, offset = le32_to_cpu(reg->offset); u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
int i; int i;
range->start_addr = reg->start_addr[idx]; range->start_addr = cpu_to_le32(addr);
range->range_data_size = reg->internal.range_data_size; range->range_data_size = reg->internal.range_data_size;
for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) { for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4)
addr = le32_to_cpu(range->start_addr) + i; *val++ = cpu_to_le32(iwl_trans_read32(fwrt->trans, addr + i));
*val++ = cpu_to_le32(iwl_trans_read32(fwrt->trans,
addr + offset));
}
return sizeof(*range) + le32_to_cpu(range->range_data_size); return sizeof(*range) + le32_to_cpu(range->range_data_size);
} }
...@@ -1090,12 +1087,11 @@ static int iwl_dump_ini_dev_mem_iter(struct iwl_fw_runtime *fwrt, ...@@ -1090,12 +1087,11 @@ static int iwl_dump_ini_dev_mem_iter(struct iwl_fw_runtime *fwrt,
void *range_ptr, int idx) void *range_ptr, int idx)
{ {
struct iwl_fw_ini_error_dump_range *range = range_ptr; struct iwl_fw_ini_error_dump_range *range = range_ptr;
u32 addr, offset = le32_to_cpu(reg->offset); u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset);
range->start_addr = reg->start_addr[idx]; range->start_addr = cpu_to_le32(addr);
addr = le32_to_cpu(range->start_addr);
range->range_data_size = reg->internal.range_data_size; range->range_data_size = reg->internal.range_data_size;
iwl_trans_read_mem_bytes(fwrt->trans, addr + offset, range->data, iwl_trans_read_mem_bytes(fwrt->trans, addr, range->data,
le32_to_cpu(reg->internal.range_data_size)); le32_to_cpu(reg->internal.range_data_size));
return sizeof(*range) + le32_to_cpu(range->range_data_size); return sizeof(*range) + le32_to_cpu(range->range_data_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment