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

iwlwifi: dbg_ini: give better naming to region struct fields

Some of the region struct fields have misleading naming
change those fields to have an informative naming
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 56ea8e3b
...@@ -138,11 +138,13 @@ struct iwl_fw_ini_debug_flow_tlv { ...@@ -138,11 +138,13 @@ struct iwl_fw_ini_debug_flow_tlv {
* @region_id: ID of this dump configuration * @region_id: ID of this dump configuration
* @region_type: &enum iwl_fw_ini_region_type * @region_type: &enum iwl_fw_ini_region_type
* @num_regions: amount of regions in the address array. * @num_regions: amount of regions in the address array.
* @allocation_id: For DRAM type field substitutes for allocation_id.
* @name_len: name length * @name_len: name length
* @name: file name to use for this region * @name: file name to use for this region
* @size: size of the data, in bytes.(unused for IWL_FW_INI_REGION_DRAM_BUFFER) * @num_of_range: the amount of ranges in the region.
* @start_addr: array of addresses. (unused for IWL_FW_INI_REGION_DRAM_BUFFER) * @allocation_id: For DRAM type field substitutes for allocation_id
* @range_data_size: size of the data to read per range, in bytes.
* @start_addr: array of addresses. for type IWL_FW_INI_REGION_DRAM_BUFFER,
* 1 entry. For any other case, num_of_ranges entries.
*/ */
struct iwl_fw_ini_region_cfg { struct iwl_fw_ini_region_cfg {
__le32 region_id; __le32 region_id;
...@@ -150,10 +152,10 @@ struct iwl_fw_ini_region_cfg { ...@@ -150,10 +152,10 @@ struct iwl_fw_ini_region_cfg {
__le32 name_len; __le32 name_len;
u8 name[IWL_FW_INI_MAX_NAME]; u8 name[IWL_FW_INI_MAX_NAME];
union { union {
__le32 num_regions; __le32 num_of_ranges;
__le32 allocation_id; __le32 allocation_id;
}; };
__le32 size; __le32 range_data_size;
__le32 start_addr[]; __le32 start_addr[];
} __packed; /* FW_DEBUG_TLV_REGION_CONFIG_S */ } __packed; /* FW_DEBUG_TLV_REGION_CONFIG_S */
......
...@@ -1065,7 +1065,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans, ...@@ -1065,7 +1065,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans,
{ {
struct iwl_fw_error_dump_prph *prph; struct iwl_fw_error_dump_prph *prph;
unsigned long flags; unsigned long flags;
u32 i, size = le32_to_cpu(reg->num_regions); u32 i, size = le32_to_cpu(reg->num_of_ranges);
IWL_DEBUG_INFO(trans, "WRT PRPH dump\n"); IWL_DEBUG_INFO(trans, "WRT PRPH dump\n");
...@@ -1074,7 +1074,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans, ...@@ -1074,7 +1074,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans,
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
(*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PRPH); (*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PRPH);
(*data)->len = cpu_to_le32(le32_to_cpu(reg->size) + (*data)->len = cpu_to_le32(le32_to_cpu(reg->range_data_size) +
sizeof(*prph)); sizeof(*prph));
prph = (void *)(*data)->data; prph = (void *)(*data)->data;
prph->prph_start = reg->start_addr[i]; prph->prph_start = reg->start_addr[i];
...@@ -1089,8 +1089,8 @@ static void iwl_dump_csr_ini(struct iwl_trans *trans, ...@@ -1089,8 +1089,8 @@ static void iwl_dump_csr_ini(struct iwl_trans *trans,
struct iwl_fw_error_dump_data **data, struct iwl_fw_error_dump_data **data,
struct iwl_fw_ini_region_cfg *reg) struct iwl_fw_ini_region_cfg *reg)
{ {
int i, num = le32_to_cpu(reg->num_regions); int i, num = le32_to_cpu(reg->num_of_ranges);
u32 size = le32_to_cpu(reg->size); u32 size = le32_to_cpu(reg->range_data_size);
IWL_DEBUG_INFO(trans, "WRT CSR dump\n"); IWL_DEBUG_INFO(trans, "WRT CSR dump\n");
...@@ -1133,13 +1133,13 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt, ...@@ -1133,13 +1133,13 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,
continue; continue;
type = le32_to_cpu(reg->region_type); type = le32_to_cpu(reg->region_type);
num_entries = le32_to_cpu(reg->num_regions); num_entries = le32_to_cpu(reg->num_of_ranges);
switch (type) { switch (type) {
case IWL_FW_INI_REGION_DEVICE_MEMORY: case IWL_FW_INI_REGION_DEVICE_MEMORY:
size += hdr_len + size += hdr_len +
sizeof(struct iwl_fw_error_dump_named_mem) + sizeof(struct iwl_fw_error_dump_named_mem) +
le32_to_cpu(reg->size); le32_to_cpu(reg->range_data_size);
break; break;
case IWL_FW_INI_REGION_PERIPHERY_MAC: case IWL_FW_INI_REGION_PERIPHERY_MAC:
case IWL_FW_INI_REGION_PERIPHERY_PHY: case IWL_FW_INI_REGION_PERIPHERY_PHY:
...@@ -1165,7 +1165,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt, ...@@ -1165,7 +1165,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,
break; break;
case IWL_FW_INI_REGION_CSR: case IWL_FW_INI_REGION_CSR:
size += num_entries * size += num_entries *
(hdr_len + le32_to_cpu(reg->size)); (hdr_len + le32_to_cpu(reg->range_data_size));
break; break;
case IWL_FW_INI_REGION_DRAM_BUFFER: case IWL_FW_INI_REGION_DRAM_BUFFER:
/* Transport takes care of DRAM dumping */ /* Transport takes care of DRAM dumping */
...@@ -1202,10 +1202,10 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1202,10 +1202,10 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
type = le32_to_cpu(reg->region_type); type = le32_to_cpu(reg->region_type);
switch (type) { switch (type) {
case IWL_FW_INI_REGION_DEVICE_MEMORY: case IWL_FW_INI_REGION_DEVICE_MEMORY:
if (WARN_ON(le32_to_cpu(reg->num_regions) > 1)) if (WARN_ON(le32_to_cpu(reg->num_of_ranges) > 1))
continue; continue;
iwl_fw_dump_named_mem(fwrt, data, iwl_fw_dump_named_mem(fwrt, data,
le32_to_cpu(reg->size), le32_to_cpu(reg->range_data_size),
le32_to_cpu(reg->start_addr[0]), le32_to_cpu(reg->start_addr[0]),
reg->name, reg->name,
le32_to_cpu(reg->name_len)); le32_to_cpu(reg->name_len));
...@@ -1773,7 +1773,8 @@ static void iwl_fw_dbg_update_regions(struct iwl_fw_runtime *fwrt, ...@@ -1773,7 +1773,8 @@ static void iwl_fw_dbg_update_regions(struct iwl_fw_runtime *fwrt,
if (le32_to_cpu(reg->region_type) != if (le32_to_cpu(reg->region_type) !=
IWL_FW_INI_REGION_DRAM_BUFFER) IWL_FW_INI_REGION_DRAM_BUFFER)
iter += le32_to_cpu(reg->num_regions) * sizeof(__le32); iter += le32_to_cpu(reg->num_of_ranges) *
sizeof(__le32);
iter += sizeof(*reg); iter += sizeof(*reg);
} }
......
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