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

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

parent 09369983
Loading
Loading
Loading
Loading
+31 −1
Original line number Diff line number Diff line
@@ -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;
}
+16 −1
Original line number Diff line number Diff line
/* 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
+4 −0
Original line number Diff line number Diff line
@@ -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 {