iwlwifi: dbg: move trans debug fields to a separate struct
Unite iwl_trans debug related fields under iwl_trans_debug struct to increase readability and keep iwl_trans clean. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
committed by
Luca Coelho
parent
1d45a700df
commit
91c28b83da
@ -1155,10 +1155,10 @@ iwl_dump_ini_mon_dram_iter(struct iwl_fw_runtime *fwrt,
|
||||
return -EBUSY;
|
||||
|
||||
range->dram_base_addr = cpu_to_le64(start_addr);
|
||||
range->range_data_size = cpu_to_le32(fwrt->trans->fw_mon[idx].size);
|
||||
range->range_data_size = cpu_to_le32(fwrt->trans->dbg.fw_mon[idx].size);
|
||||
|
||||
memcpy(range->data, fwrt->trans->fw_mon[idx].block,
|
||||
fwrt->trans->fw_mon[idx].size);
|
||||
memcpy(range->data, fwrt->trans->dbg.fw_mon[idx].block,
|
||||
fwrt->trans->dbg.fw_mon[idx].size);
|
||||
|
||||
return sizeof(*range) + le32_to_cpu(range->range_data_size);
|
||||
}
|
||||
@ -1581,8 +1581,8 @@ static u32 iwl_dump_ini_mon_dram_get_size(struct iwl_fw_runtime *fwrt,
|
||||
u32 size = sizeof(struct iwl_fw_ini_monitor_dump) +
|
||||
sizeof(struct iwl_fw_ini_error_dump_range);
|
||||
|
||||
if (fwrt->trans->num_blocks)
|
||||
size += fwrt->trans->fw_mon[0].size;
|
||||
if (fwrt->trans->dbg.num_blocks)
|
||||
size += fwrt->trans->dbg.fw_mon[0].size;
|
||||
|
||||
return size;
|
||||
}
|
||||
@ -1735,7 +1735,8 @@ static void iwl_dump_ini_info(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
dump->version = cpu_to_le32(IWL_INI_DUMP_VER);
|
||||
dump->trigger_id = trigger->trigger_id;
|
||||
dump->is_external_cfg = cpu_to_le32(fwrt->trans->external_ini_loaded);
|
||||
dump->is_external_cfg =
|
||||
cpu_to_le32(fwrt->trans->dbg.external_ini_loaded);
|
||||
|
||||
dump->ver_type = cpu_to_le32(fwrt->dump.fw_ver.type);
|
||||
dump->ver_subtype = cpu_to_le32(fwrt->dump.fw_ver.subtype);
|
||||
@ -1842,7 +1843,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,
|
||||
ret_size += hdr_len + size;
|
||||
break;
|
||||
case IWL_FW_INI_REGION_DRAM_BUFFER:
|
||||
if (!fwrt->trans->num_blocks)
|
||||
if (!fwrt->trans->dbg.num_blocks)
|
||||
break;
|
||||
size = iwl_dump_ini_mon_dram_get_size(fwrt, reg);
|
||||
if (size)
|
||||
@ -2097,7 +2098,7 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt,
|
||||
u32 trig_type = le32_to_cpu(desc->trig_desc.type);
|
||||
int ret;
|
||||
|
||||
if (fwrt->trans->ini_valid) {
|
||||
if (fwrt->trans->dbg.ini_valid) {
|
||||
ret = iwl_fw_dbg_ini_collect(fwrt, trig_type);
|
||||
if (!ret)
|
||||
iwl_fw_free_dump_desc(fwrt);
|
||||
@ -2374,7 +2375,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
|
||||
iwl_fw_dbg_stop_recording(fwrt, ¶ms);
|
||||
|
||||
IWL_DEBUG_FW_INFO(fwrt, "WRT: data collection start\n");
|
||||
if (fwrt->trans->ini_valid)
|
||||
if (fwrt->trans->dbg.ini_valid)
|
||||
iwl_fw_error_ini_dump(fwrt, wk_idx);
|
||||
else
|
||||
iwl_fw_error_dump(fwrt);
|
||||
@ -2474,7 +2475,8 @@ iwl_fw_dbg_buffer_allocation(struct iwl_fw_runtime *fwrt, u32 size)
|
||||
void *virtual_addr = NULL;
|
||||
dma_addr_t phys_addr;
|
||||
|
||||
if (WARN_ON_ONCE(trans->num_blocks == ARRAY_SIZE(trans->fw_mon)))
|
||||
if (WARN_ON_ONCE(trans->dbg.num_blocks ==
|
||||
ARRAY_SIZE(trans->dbg.fw_mon)))
|
||||
return;
|
||||
|
||||
virtual_addr =
|
||||
@ -2488,12 +2490,12 @@ iwl_fw_dbg_buffer_allocation(struct iwl_fw_runtime *fwrt, u32 size)
|
||||
|
||||
IWL_DEBUG_FW(trans,
|
||||
"Allocated DRAM buffer[%d], size=0x%x\n",
|
||||
trans->num_blocks, size);
|
||||
trans->dbg.num_blocks, size);
|
||||
|
||||
trans->fw_mon[trans->num_blocks].block = virtual_addr;
|
||||
trans->fw_mon[trans->num_blocks].physical = phys_addr;
|
||||
trans->fw_mon[trans->num_blocks].size = size;
|
||||
trans->num_blocks++;
|
||||
trans->dbg.fw_mon[trans->dbg.num_blocks].block = virtual_addr;
|
||||
trans->dbg.fw_mon[trans->dbg.num_blocks].physical = phys_addr;
|
||||
trans->dbg.fw_mon[trans->dbg.num_blocks].size = size;
|
||||
trans->dbg.num_blocks++;
|
||||
}
|
||||
|
||||
static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
|
||||
@ -2511,7 +2513,7 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
|
||||
.data[0] = &ldbg_cmd,
|
||||
.len[0] = sizeof(ldbg_cmd),
|
||||
};
|
||||
int block_idx = trans->num_blocks;
|
||||
int block_idx = trans->dbg.num_blocks;
|
||||
u32 buf_location = le32_to_cpu(alloc->tlv.buffer_location);
|
||||
|
||||
if (buf_location == IWL_FW_INI_LOCATION_SRAM_PATH) {
|
||||
@ -2529,13 +2531,13 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
|
||||
if (!alloc->is_alloc) {
|
||||
iwl_fw_dbg_buffer_allocation(fwrt,
|
||||
le32_to_cpu(alloc->tlv.size));
|
||||
if (block_idx == trans->num_blocks)
|
||||
if (block_idx == trans->dbg.num_blocks)
|
||||
return;
|
||||
alloc->is_alloc = 1;
|
||||
}
|
||||
|
||||
/* First block is assigned via registers / context info */
|
||||
if (trans->num_blocks == 1)
|
||||
if (trans->dbg.num_blocks == 1)
|
||||
return;
|
||||
|
||||
IWL_DEBUG_FW(trans,
|
||||
@ -2543,7 +2545,7 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
cmd->num_frags = cpu_to_le32(1);
|
||||
cmd->fragments[0].address =
|
||||
cpu_to_le64(trans->fw_mon[block_idx].physical);
|
||||
cpu_to_le64(trans->dbg.fw_mon[block_idx].physical);
|
||||
cmd->fragments[0].size = alloc->tlv.size;
|
||||
cmd->allocation_id = alloc->tlv.allocation_id;
|
||||
cmd->buffer_location = alloc->tlv.buffer_location;
|
||||
@ -2835,7 +2837,7 @@ static void iwl_fw_dbg_ini_reset_cfg(struct iwl_fw_runtime *fwrt)
|
||||
void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
|
||||
enum iwl_fw_ini_apply_point apply_point)
|
||||
{
|
||||
void *data = &fwrt->trans->apply_points[apply_point];
|
||||
void *data = &fwrt->trans->dbg.apply_points[apply_point];
|
||||
|
||||
IWL_DEBUG_FW(fwrt, "WRT: enabling apply point %d\n", apply_point);
|
||||
|
||||
@ -2844,7 +2846,7 @@ void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
_iwl_fw_dbg_apply_point(fwrt, data, apply_point, false);
|
||||
|
||||
data = &fwrt->trans->apply_points_ext[apply_point];
|
||||
data = &fwrt->trans->dbg.apply_points_ext[apply_point];
|
||||
_iwl_fw_dbg_apply_point(fwrt, data, apply_point, true);
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_fw_dbg_apply_point);
|
||||
|
@ -202,7 +202,7 @@ _iwl_fw_dbg_trigger_on(struct iwl_fw_runtime *fwrt,
|
||||
{
|
||||
struct iwl_fw_dbg_trigger_tlv *trig;
|
||||
|
||||
if (fwrt->trans->ini_valid)
|
||||
if (fwrt->trans->dbg.ini_valid)
|
||||
return NULL;
|
||||
|
||||
if (!iwl_fw_dbg_trigger_enabled(fwrt->fw, id))
|
||||
@ -229,7 +229,7 @@ iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt,
|
||||
struct iwl_fw_ini_trigger *trig;
|
||||
u32 usec;
|
||||
|
||||
if (!fwrt->trans->ini_valid || id == IWL_FW_TRIGGER_ID_INVALID ||
|
||||
if (!fwrt->trans->dbg.ini_valid || id == IWL_FW_TRIGGER_ID_INVALID ||
|
||||
id >= IWL_FW_TRIGGER_ID_NUM || !fwrt->dump.active_trigs[id].active)
|
||||
return false;
|
||||
|
||||
@ -301,7 +301,7 @@ _iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
|
||||
usleep_range(700, 1000);
|
||||
iwl_write_umac_prph(trans, DBGC_OUT_CTRL, 0);
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
trans->dbg_rec_on = false;
|
||||
trans->dbg.rec_on = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ _iwl_fw_dbg_restart_recording(struct iwl_trans *trans,
|
||||
static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
if (fwrt->fw->dbg.dest_tlv && fwrt->cur_fw_img == IWL_UCODE_REGULAR)
|
||||
fwrt->trans->dbg_rec_on = true;
|
||||
fwrt->trans->dbg.rec_on = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -452,28 +452,28 @@ void iwl_fwrt_stop_device(struct iwl_fw_runtime *fwrt);
|
||||
static inline void iwl_fw_lmac1_set_alive_err_table(struct iwl_trans *trans,
|
||||
u32 lmac_error_event_table)
|
||||
{
|
||||
if (!(trans->error_event_table_tlv_status &
|
||||
if (!(trans->dbg.error_event_table_tlv_status &
|
||||
IWL_ERROR_EVENT_TABLE_LMAC1) ||
|
||||
WARN_ON(trans->lmac_error_event_table[0] !=
|
||||
WARN_ON(trans->dbg.lmac_error_event_table[0] !=
|
||||
lmac_error_event_table))
|
||||
trans->lmac_error_event_table[0] = lmac_error_event_table;
|
||||
trans->dbg.lmac_error_event_table[0] = lmac_error_event_table;
|
||||
}
|
||||
|
||||
static inline void iwl_fw_umac_set_alive_err_table(struct iwl_trans *trans,
|
||||
u32 umac_error_event_table)
|
||||
{
|
||||
if (!(trans->error_event_table_tlv_status &
|
||||
if (!(trans->dbg.error_event_table_tlv_status &
|
||||
IWL_ERROR_EVENT_TABLE_UMAC) ||
|
||||
WARN_ON(trans->umac_error_event_table !=
|
||||
WARN_ON(trans->dbg.umac_error_event_table !=
|
||||
umac_error_event_table))
|
||||
trans->umac_error_event_table = umac_error_event_table;
|
||||
trans->dbg.umac_error_event_table = umac_error_event_table;
|
||||
}
|
||||
|
||||
static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
if (fwrt->trans->ini_valid && fwrt->trans->hw_error) {
|
||||
if (fwrt->trans->dbg.ini_valid && fwrt->trans->dbg.hw_error) {
|
||||
_iwl_fw_dbg_ini_collect(fwrt, IWL_FW_TRIGGER_ID_FW_HW_ERROR);
|
||||
fwrt->trans->hw_error = false;
|
||||
fwrt->trans->dbg.hw_error = false;
|
||||
} else {
|
||||
iwl_fw_dbg_collect_desc(fwrt, &iwl_dump_desc_assert, false, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user