Commit 51fa8c02 authored by Mukesh Sisodiya's avatar Mukesh Sisodiya Committed by Johannes Berg

wifi: iwlwifi: yoyo: Add new tlv for dump file name extension

Add tlv in dump file for dump file name extension.
Signed-off-by: default avatarMukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: default avatarGreenman, Gregory <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230314194113.ffc28212994e.Ie5f10709548497061f95c1634d942dd2facf72ec@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 09369983
......@@ -2320,6 +2320,34 @@ static u32 iwl_dump_ini_info(struct iwl_fw_runtime *fwrt,
return entry->size;
}
static u32 iwl_dump_ini_file_name_info(struct iwl_fw_runtime *fwrt,
struct list_head *list)
{
struct iwl_fw_ini_dump_entry *entry;
struct iwl_dump_file_name_info *tlv;
u32 len = strnlen(fwrt->trans->dbg.dump_file_name_ext,
IWL_FW_INI_MAX_NAME);
if (!fwrt->trans->dbg.dump_file_name_ext_valid)
return 0;
entry = vzalloc(sizeof(*entry) + sizeof(*tlv) + len);
if (!entry)
return 0;
entry->size = sizeof(*tlv) + len;
tlv = (void *)entry->data;
tlv->type = cpu_to_le32(IWL_INI_DUMP_NAME_TYPE);
tlv->len = cpu_to_le32(len);
memcpy(tlv->data, fwrt->trans->dbg.dump_file_name_ext, len);
/* add the dump file name extension tlv to the list */
list_add_tail(&entry->list, list);
return entry->size;
}
static const struct iwl_dump_ini_mem_ops iwl_dump_ini_region_ops[] = {
[IWL_FW_INI_REGION_INVALID] = {},
[IWL_FW_INI_REGION_INTERNAL_BUFFER] = {
......@@ -2495,8 +2523,10 @@ static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
size += iwl_dump_ini_mem(fwrt, list, &reg_data,
&iwl_dump_ini_region_ops[IWL_FW_INI_REGION_DRAM_IMR]);
if (size)
if (size) {
size += iwl_dump_ini_file_name_info(fwrt, list);
size += iwl_dump_ini_info(fwrt, trigger, list);
}
return size;
}
......
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2014, 2018-2021 Intel Corporation
* Copyright (C) 2014, 2018-2022 Intel Corporation
* Copyright (C) 2014-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
......@@ -75,6 +75,18 @@ struct iwl_fw_error_dump_data {
__u8 data[];
} __packed;
/**
* struct iwl_dump_file_name_info - data for dump file name addition
* @type: region type with reserved bits
* @len: the length of file name string to be added to dump file
* @data: the string need to be added to dump file
*/
struct iwl_dump_file_name_info {
__le32 type;
__le32 len;
__u8 data[];
} __packed;
/**
* struct iwl_fw_error_dump_file - the layout of the header of the file
* @barker: must be %IWL_FW_ERROR_DUMP_BARKER
......@@ -231,6 +243,9 @@ struct iwl_fw_error_dump_mem {
/* Use bit 31 as dump info type to avoid colliding with region types */
#define IWL_INI_DUMP_INFO_TYPE BIT(31)
/* Use bit 31 and bit 24 as dump name type to avoid colliding with region types */
#define IWL_INI_DUMP_NAME_TYPE (BIT(31) | BIT(24))
/**
* struct iwl_fw_error_dump_data - data for one type
* @type: &enum iwl_fw_ini_region_type
......
......@@ -775,6 +775,8 @@ struct iwl_imr_data {
* @periodic_trig_list: periodic triggers list
* @domains_bitmap: bitmap of active domains other than &IWL_FW_INI_DOMAIN_ALWAYS_ON
* @ucode_preset: preset based on ucode
* @dump_file_name_ext: dump file name extension
* @dump_file_name_ext_valid: dump file name extension if valid or not
*/
struct iwl_trans_debug {
u8 n_dest_reg;
......@@ -813,6 +815,8 @@ struct iwl_trans_debug {
bool restart_required;
u32 last_tp_resetfw;
struct iwl_imr_data imr_data;
u8 dump_file_name_ext[IWL_FW_INI_MAX_NAME];
bool dump_file_name_ext_valid;
};
struct iwl_dma_ptr {
......
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