src/dpdk/drivers/net/qede/qede_debug.c
static enum dbg_status qed_find_nvram_image(struct ecore_hwfn *p_hwfn,
					    struct ecore_ptt *p_ptt,
					    u32 image_type,
					    u32 *nvram_offset_bytes,
					    u32 *nvram_size_bytes)
{
	u32 ret_mcp_resp, ret_mcp_param, ret_txn_size;
	struct mcp_file_att file_att;
	int nvm_result;

	/* Call NVRAM get file command */
	nvm_result = ecore_mcp_nvm_rd_cmd(p_hwfn,
					p_ptt,
					DRV_MSG_CODE_NVM_GET_FILE_ATT,
					image_type,
					&ret_mcp_resp,
					&ret_mcp_param,
					&ret_txn_size, (u32 *)&file_att);

	/* Check response */
	if (nvm_result ||
	    (ret_mcp_resp & FW_MSG_CODE_MASK) != FW_MSG_CODE_NVM_OK)
		return DBG_STATUS_NVRAM_GET_IMAGE_FAILED;

	/* Update return values */
	*nvram_offset_bytes = file_att.nvm_start_addr;
	*nvram_size_bytes = file_att.len;

	DP_VERBOSE(p_hwfn->p_dev,
		   ECORE_MSG_DEBUG,
		   "find_nvram_image: found NVRAM image of type %d in NVRAM offset %d bytes with size %d bytes\n",
		   image_type, *nvram_offset_bytes, *nvram_size_bytes);

	/* Check alignment */
	if (*nvram_size_bytes & 0x3)
		return DBG_STATUS_NON_ALIGNED_NVRAM_IMAGE;

	return DBG_STATUS_OK;
}
/* Finds the meta data image in NVRAM */
Finds the meta data image in NVRAM
Finds the meta data image in NVRAM
static enum dbg_status qed_find_nvram_image(struct ecore_hwfn *p_hwfn,
					    struct ecore_ptt *p_ptt,
					    u32 image_type,
					    u32 *nvram_offset_bytes,
					    u32 *nvram_size_bytes)
{
	u32 ret_mcp_resp, ret_mcp_param, ret_txn_size;
	struct mcp_file_att file_att;
	int nvm_result;
	nvm_result = ecore_mcp_nvm_rd_cmd(p_hwfn,
					p_ptt,
					DRV_MSG_CODE_NVM_GET_FILE_ATT,
					image_type,
					&ret_mcp_resp,
					&ret_mcp_param,
					&ret_txn_size, (u32 *)&file_att);
	if (nvm_result ||
	    (ret_mcp_resp & FW_MSG_CODE_MASK) != FW_MSG_CODE_NVM_OK)
		return DBG_STATUS_NVRAM_GET_IMAGE_FAILED;
	*nvram_offset_bytes = file_att.nvm_start_addr;
	*nvram_size_bytes = file_att.len;
	DP_VERBOSE(p_hwfn->p_dev,
		   ECORE_MSG_DEBUG,
		   "find_nvram_image: found NVRAM image of type %d in NVRAM offset %d bytes with size %d bytes\n",
		   image_type, *nvram_offset_bytes, *nvram_size_bytes);
	if (*nvram_size_bytes & 0x3)
		return DBG_STATUS_NON_ALIGNED_NVRAM_IMAGE;
	return DBG_STATUS_OK;
}
static enum dbg_status qed_find_nvram_image ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 image_type , u32 * nvram_offset_bytes , u32 * nvram_size_bytes ) { u32 ret_mcp_resp , ret_mcp_param , ret_txn_size ; struct mcp_file_att file_att ; int nvm_result ; nvm_result = ecore_mcp_nvm_rd_cmd ( p_hwfn , p_ptt , DRV_MSG_CODE_NVM_GET_FILE_ATT , image_type , & ret_mcp_resp , & ret_mcp_param , & ret_txn_size , ( u32 * ) & file_att ) ; if ( nvm_result || ( ret_mcp_resp & FW_MSG_CODE_MASK ) != FW_MSG_CODE_NVM_OK ) return DBG_STATUS_NVRAM_GET_IMAGE_FAILED ; * nvram_offset_bytes = file_att . nvm_start_addr ; * nvram_size_bytes = file_att . len ; DP_VERBOSE ( p_hwfn -> p_dev , ECORE_MSG_DEBUG , " \n " , image_type , * nvram_offset_bytes , * nvram_size_bytes ) ; if ( * nvram_size_bytes & 0x3 ) return DBG_STATUS_NON_ALIGNED_NVRAM_IMAGE ; return DBG_STATUS_OK ; }
Finds the meta data image in NVRAM
Finds the meta data image in NVRAM
/* Call NVRAM get file command */ /* Check response */ /* Update return values */ /* Check alignment */