src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
{
	struct ixgbe_hic_phy_token_req token_cmd;
	s32 status;

	token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;
	token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;
	token_cmd.hdr.cmd_or_resp.cmd_resv = 0;
	token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
	token_cmd.port_number = hw->bus.lan_id;
	token_cmd.command_type = FW_PHY_TOKEN_REQ;
	token_cmd.pad = 0;
	status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd,
					      sizeof(token_cmd),
					      IXGBE_HI_COMMAND_TIMEOUT,
					      true);
	if (status) {
		DEBUGOUT1("Issuing host interface command failed with Status = %d\n",
			  status);
		return status;
	}
	if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
		return IXGBE_SUCCESS;
	if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY) {
		DEBUGOUT1("Host interface command returned 0x%08x , returning IXGBE_ERR_FW_RESP_INVALID\n",
			  token_cmd.hdr.cmd_or_resp.ret_status);
		return IXGBE_ERR_FW_RESP_INVALID;
	}

	DEBUGOUT("Returning  IXGBE_ERR_TOKEN_RETRY\n");
	return IXGBE_ERR_TOKEN_RETRY;
}
/**
 * ixgbe_get_phy_token - Get the token for shared phy access
 * @hw: Pointer to hardware structure
 */
Get the token for shared phy access
@hw: Pointer to hardware structure
Get the token for shared phy access @hw : Pointer to hardware structure
s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
{
	struct ixgbe_hic_phy_token_req token_cmd;
	s32 status;
	token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;
	token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;
	token_cmd.hdr.cmd_or_resp.cmd_resv = 0;
	token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
	token_cmd.port_number = hw->bus.lan_id;
	token_cmd.command_type = FW_PHY_TOKEN_REQ;
	token_cmd.pad = 0;
	status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd,
					      sizeof(token_cmd),
					      IXGBE_HI_COMMAND_TIMEOUT,
					      true);
	if (status) {
		DEBUGOUT1("Issuing host interface command failed with Status = %d\n",
			  status);
		return status;
	}
	if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
		return IXGBE_SUCCESS;
	if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY) {
		DEBUGOUT1("Host interface command returned 0x%08x , returning IXGBE_ERR_FW_RESP_INVALID\n",
			  token_cmd.hdr.cmd_or_resp.ret_status);
		return IXGBE_ERR_FW_RESP_INVALID;
	}
	DEBUGOUT("Returning  IXGBE_ERR_TOKEN_RETRY\n");
	return IXGBE_ERR_TOKEN_RETRY;
}
s32 ixgbe_get_phy_token ( struct ixgbe_hw * hw ) { struct ixgbe_hic_phy_token_req token_cmd ; s32 status ; token_cmd . hdr . cmd = FW_PHY_TOKEN_REQ_CMD ; token_cmd . hdr . buf_len = FW_PHY_TOKEN_REQ_LEN ; token_cmd . hdr . cmd_or_resp . cmd_resv = 0 ; token_cmd . hdr . checksum = FW_DEFAULT_CHECKSUM ; token_cmd . port_number = hw -> bus . lan_id ; token_cmd . command_type = FW_PHY_TOKEN_REQ ; token_cmd . pad = 0 ; status = ixgbe_host_interface_command ( hw , ( u32 * ) & token_cmd , sizeof ( token_cmd ) , IXGBE_HI_COMMAND_TIMEOUT , true ) ; if ( status ) { DEBUGOUT1 ( " \n " , status ) ; return status ; } if ( token_cmd . hdr . cmd_or_resp . ret_status == FW_PHY_TOKEN_OK ) return IXGBE_SUCCESS ; if ( token_cmd . hdr . cmd_or_resp . ret_status != FW_PHY_TOKEN_RETRY ) { DEBUGOUT1 ( " \n " , token_cmd . hdr . cmd_or_resp . ret_status ) ; return IXGBE_ERR_FW_RESP_INVALID ; } DEBUGOUT ( " \n " ) ; return IXGBE_ERR_TOKEN_RETRY ; }
ixgbe_get_phy_token - Get the token for shared phy access
 @hw: Pointer to hardware structure
ixgbe_get_phy_token - Get the token for shared phy access @hw : Pointer to hardware structure