Commit 8a433cb6 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: fw: fix debug dump data declarations

The debug dump ranges aren't just an array of such ranges
since each range has a variable size. Therefore, the use
of a struct array is misleading at best.

Change it to be a u8 data[] instead of the struct array,
the code doesn't significantly change since it's actually
doing things correctly now.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210819183728.693c9891097d.Idcaab1fd659e8be2f56be647b2534befd61a4460@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 394f4192
......@@ -1547,7 +1547,7 @@ iwl_dump_ini_mem_fill_header(struct iwl_fw_runtime *fwrt,
dump->header.version = cpu_to_le32(IWL_INI_DUMP_VER);
return dump->ranges;
return dump->data;
}
/**
......@@ -1611,7 +1611,7 @@ iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt,
data->header.version = cpu_to_le32(IWL_INI_DUMP_VER);
return data->ranges;
return data->data;
}
static void *
......@@ -1647,7 +1647,7 @@ iwl_dump_ini_err_table_fill_header(struct iwl_fw_runtime *fwrt,
dump->header.version = cpu_to_le32(IWL_INI_DUMP_VER);
dump->version = reg->err_table.version;
return dump->ranges;
return dump->data;
}
static void *
......@@ -1662,7 +1662,7 @@ iwl_dump_ini_special_mem_fill_header(struct iwl_fw_runtime *fwrt,
dump->type = reg->special_mem.type;
dump->version = reg->special_mem.version;
return dump->ranges;
return dump->data;
}
static u32 iwl_dump_ini_mem_ranges(struct iwl_fw_runtime *fwrt,
......
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2014, 2018-2020 Intel Corporation
* Copyright (C) 2014, 2018-2021 Intel Corporation
* Copyright (C) 2014-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
......@@ -305,11 +305,12 @@ struct iwl_fw_ini_error_dump_header {
/**
* struct iwl_fw_ini_error_dump - ini region dump
* @header: the header of this region
* @ranges: the memory ranges of this region
* @data: data of memory ranges in this region,
* see &struct iwl_fw_ini_error_dump_range
*/
struct iwl_fw_ini_error_dump {
struct iwl_fw_ini_error_dump_header header;
struct iwl_fw_ini_error_dump_range ranges[];
u8 data[];
} __packed;
/* This bit is used to differentiate between lmac and umac rxf */
......@@ -399,12 +400,13 @@ struct iwl_fw_ini_dump_info {
* struct iwl_fw_ini_err_table_dump - ini error table dump
* @header: header of the region
* @version: error table version
* @ranges: the memory ranges of this this region
* @data: data of memory ranges in this region,
* see &struct iwl_fw_ini_error_dump_range
*/
struct iwl_fw_ini_err_table_dump {
struct iwl_fw_ini_error_dump_header header;
__le32 version;
struct iwl_fw_ini_error_dump_range ranges[];
u8 data[];
} __packed;
/**
......@@ -427,14 +429,15 @@ struct iwl_fw_error_dump_rb {
* @write_ptr: write pointer position in the buffer
* @cycle_cnt: cycles count
* @cur_frag: current fragment in use
* @ranges: the memory ranges of this this region
* @data: data of memory ranges in this region,
* see &struct iwl_fw_ini_error_dump_range
*/
struct iwl_fw_ini_monitor_dump {
struct iwl_fw_ini_error_dump_header header;
__le32 write_ptr;
__le32 cycle_cnt;
__le32 cur_frag;
struct iwl_fw_ini_error_dump_range ranges[];
u8 data[];
} __packed;
/**
......@@ -442,13 +445,14 @@ struct iwl_fw_ini_monitor_dump {
* @header: header of the region
* @type: type of special memory
* @version: struct special memory version
* @ranges: the memory ranges of this this region
* @data: data of memory ranges in this region,
* see &struct iwl_fw_ini_error_dump_range
*/
struct iwl_fw_ini_special_device_memory {
struct iwl_fw_ini_error_dump_header header;
__le16 type;
__le16 version;
struct iwl_fw_ini_error_dump_range ranges[];
u8 data[];
} __packed;
/**
......
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