src/dpdk/drivers/net/qede/qede_debug.c
static enum dbg_status qed_mcp_trace_read_meta(struct ecore_hwfn *p_hwfn,
					       struct ecore_ptt *p_ptt,
					       u32 nvram_offset_in_bytes,
					       u32 size_in_bytes, u32 *buf)
{
	u8 modules_num, module_len, i, *byte_buf = (u8 *)buf;
	enum dbg_status status;
	u32 signature;

	/* Read meta data from NVRAM */
	status = qed_nvram_read(p_hwfn,
				p_ptt,
				nvram_offset_in_bytes, size_in_bytes, buf);
	if (status != DBG_STATUS_OK)
		return status;

	/* Extract and check first signature */
	signature = qed_read_unaligned_dword(byte_buf);
	byte_buf += sizeof(signature);
	if (signature != NVM_MAGIC_VALUE)
		return DBG_STATUS_INVALID_TRACE_SIGNATURE;

	/* Extract number of modules */
	modules_num = *(byte_buf++);

	/* Skip all modules */
	for (i = 0; i < modules_num; i++) {
		module_len = *(byte_buf++);
		byte_buf += module_len;
	}

	/* Extract and check second signature */
	signature = qed_read_unaligned_dword(byte_buf);
	byte_buf += sizeof(signature);
	if (signature != NVM_MAGIC_VALUE)
		return DBG_STATUS_INVALID_TRACE_SIGNATURE;

	return DBG_STATUS_OK;
}
/* Reads the MCP Trace meta data from NVRAM into the specified buffer */
Reads the MCP Trace meta data from NVRAM into the specified buffer
Reads the MCP Trace meta data from NVRAM into the specified buffer
static enum dbg_status qed_mcp_trace_read_meta(struct ecore_hwfn *p_hwfn,
					       struct ecore_ptt *p_ptt,
					       u32 nvram_offset_in_bytes,
					       u32 size_in_bytes, u32 *buf)
{
	u8 modules_num, module_len, i, *byte_buf = (u8 *)buf;
	enum dbg_status status;
	u32 signature;
	status = qed_nvram_read(p_hwfn,
				p_ptt,
				nvram_offset_in_bytes, size_in_bytes, buf);
	if (status != DBG_STATUS_OK)
		return status;
	signature = qed_read_unaligned_dword(byte_buf);
	byte_buf += sizeof(signature);
	if (signature != NVM_MAGIC_VALUE)
		return DBG_STATUS_INVALID_TRACE_SIGNATURE;
	modules_num = *(byte_buf++);
	for (i = 0; i < modules_num; i++) {
		module_len = *(byte_buf++);
		byte_buf += module_len;
	}
	signature = qed_read_unaligned_dword(byte_buf);
	byte_buf += sizeof(signature);
	if (signature != NVM_MAGIC_VALUE)
		return DBG_STATUS_INVALID_TRACE_SIGNATURE;
	return DBG_STATUS_OK;
}
static enum dbg_status qed_mcp_trace_read_meta ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 nvram_offset_in_bytes , u32 size_in_bytes , u32 * buf ) { u8 modules_num , module_len , i , * byte_buf = ( u8 * ) buf ; enum dbg_status status ; u32 signature ; status = qed_nvram_read ( p_hwfn , p_ptt , nvram_offset_in_bytes , size_in_bytes , buf ) ; if ( status != DBG_STATUS_OK ) return status ; signature = qed_read_unaligned_dword ( byte_buf ) ; byte_buf += sizeof ( signature ) ; if ( signature != NVM_MAGIC_VALUE ) return DBG_STATUS_INVALID_TRACE_SIGNATURE ; modules_num = * ( byte_buf ++ ) ; for ( i = 0 ; i < modules_num ; i ++ ) { module_len = * ( byte_buf ++ ) ; byte_buf += module_len ; } signature = qed_read_unaligned_dword ( byte_buf ) ; byte_buf += sizeof ( signature ) ; if ( signature != NVM_MAGIC_VALUE ) return DBG_STATUS_INVALID_TRACE_SIGNATURE ; return DBG_STATUS_OK ; }
Reads the MCP Trace meta data from NVRAM into the specified buffer
Reads the MCP Trace meta data from NVRAM into the specified buffer
/* Read meta data from NVRAM */ /* Extract and check first signature */ /* Extract number of modules */ /* Skip all modules */ /* Extract and check second signature */