src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
			      u8 build, u8 sub, u16 len, const char *driver_ver)
{
	struct ixgbe_hic_drv_info2 fw_cmd;
	s32 ret_val = IXGBE_SUCCESS;
	int i;

	DEBUGFUNC("ixgbe_set_fw_drv_ver_x550");

	if ((len == 0) || (driver_ver == NULL) ||
	   (len > sizeof(fw_cmd.driver_string)))
		return IXGBE_ERR_INVALID_ARGUMENT;

	fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
	fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len;
	fw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;
	fw_cmd.port_num = (u8)hw->bus.func;
	fw_cmd.ver_maj = maj;
	fw_cmd.ver_min = min;
	fw_cmd.ver_build = build;
	fw_cmd.ver_sub = sub;
	fw_cmd.hdr.checksum = 0;
	memcpy(fw_cmd.driver_string, driver_ver, len);
	fw_cmd.hdr.checksum = ixgbe_calculate_checksum((u8 *)&fw_cmd,
				(FW_CEM_HDR_LEN + fw_cmd.hdr.buf_len));

	for (i = 0; i <= FW_CEM_MAX_RETRIES; i++) {
		ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,
						       sizeof(fw_cmd),
						       IXGBE_HI_COMMAND_TIMEOUT,
						       true);
		if (ret_val != IXGBE_SUCCESS)
			continue;

		if (fw_cmd.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS)
			ret_val = IXGBE_SUCCESS;
		else
			ret_val = IXGBE_ERR_HOST_INTERFACE_COMMAND;

		break;
	}

	return ret_val;
}
/**
 * ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware
 * @hw: pointer to the HW structure
 * @maj: driver version major number
 * @min: driver version minor number
 * @build: driver version build number
 * @sub: driver version sub build number
 * @len: length of driver_ver string
 * @driver_ver: driver string
 *
 * Sends driver version number to firmware through the manageability
 * block.  On success return IXGBE_SUCCESS
 * else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring
 * semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
 **/


Sends driver version number to firmware through the manageability
block.  On success return IXGBE_SUCCESS
else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring
semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
Sends driver version number to firmware through the manageability block . On success return IXGBE_SUCCESS else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails .
s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
			      u8 build, u8 sub, u16 len, const char *driver_ver)
{
	struct ixgbe_hic_drv_info2 fw_cmd;
	s32 ret_val = IXGBE_SUCCESS;
	int i;
	DEBUGFUNC("ixgbe_set_fw_drv_ver_x550");
	if ((len == 0) || (driver_ver == NULL) ||
	   (len > sizeof(fw_cmd.driver_string)))
		return IXGBE_ERR_INVALID_ARGUMENT;
	fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
	fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len;
	fw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;
	fw_cmd.port_num = (u8)hw->bus.func;
	fw_cmd.ver_maj = maj;
	fw_cmd.ver_min = min;
	fw_cmd.ver_build = build;
	fw_cmd.ver_sub = sub;
	fw_cmd.hdr.checksum = 0;
	memcpy(fw_cmd.driver_string, driver_ver, len);
	fw_cmd.hdr.checksum = ixgbe_calculate_checksum((u8 *)&fw_cmd,
				(FW_CEM_HDR_LEN + fw_cmd.hdr.buf_len));
	for (i = 0; i <= FW_CEM_MAX_RETRIES; i++) {
		ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,
						       sizeof(fw_cmd),
						       IXGBE_HI_COMMAND_TIMEOUT,
						       true);
		if (ret_val != IXGBE_SUCCESS)
			continue;
		if (fw_cmd.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS)
			ret_val = IXGBE_SUCCESS;
		else
			ret_val = IXGBE_ERR_HOST_INTERFACE_COMMAND;
		break;
	}
	return ret_val;
}
s32 ixgbe_set_fw_drv_ver_x550 ( struct ixgbe_hw * hw , u8 maj , u8 min , u8 build , u8 sub , u16 len , const char * driver_ver ) { struct ixgbe_hic_drv_info2 fw_cmd ; s32 ret_val = IXGBE_SUCCESS ; int i ; DEBUGFUNC ( " " ) ; if ( ( len == 0 ) || ( driver_ver == NULL ) || ( len > sizeof ( fw_cmd . driver_string ) ) ) return IXGBE_ERR_INVALID_ARGUMENT ; fw_cmd . hdr . cmd = FW_CEM_CMD_DRIVER_INFO ; fw_cmd . hdr . buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len ; fw_cmd . hdr . cmd_or_resp . cmd_resv = FW_CEM_CMD_RESERVED ; fw_cmd . port_num = ( u8 ) hw -> bus . func ; fw_cmd . ver_maj = maj ; fw_cmd . ver_min = min ; fw_cmd . ver_build = build ; fw_cmd . ver_sub = sub ; fw_cmd . hdr . checksum = 0 ; memcpy ( fw_cmd . driver_string , driver_ver , len ) ; fw_cmd . hdr . checksum = ixgbe_calculate_checksum ( ( u8 * ) & fw_cmd , ( FW_CEM_HDR_LEN + fw_cmd . hdr . buf_len ) ) ; for ( i = 0 ; i <= FW_CEM_MAX_RETRIES ; i ++ ) { ret_val = ixgbe_host_interface_command ( hw , ( u32 * ) & fw_cmd , sizeof ( fw_cmd ) , IXGBE_HI_COMMAND_TIMEOUT , true ) ; if ( ret_val != IXGBE_SUCCESS ) continue ; if ( fw_cmd . hdr . cmd_or_resp . ret_status == FW_CEM_RESP_STATUS_SUCCESS ) ret_val = IXGBE_SUCCESS ; else ret_val = IXGBE_ERR_HOST_INTERFACE_COMMAND ; break ; } return ret_val ; }
ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware
 @hw: pointer to the HW structure
 @maj: driver version major number
 @min: driver version minor number
 @build: driver version build number
 @sub: driver version sub build number
 @len: length of driver_ver string
 @driver_ver: driver string
ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware @hw : pointer to the HW structure @maj : driver version major number @min : driver version minor number @build : driver version build number @sub : driver version sub build number @len : length of driver_ver string @driver_ver : driver string