src/dpdk/drivers/net/txgbe/base/txgbe_mng.c
s32 txgbe_hic_set_drv_ver(struct txgbe_hw *hw, u8 maj, u8 min,
				 u8 build, u8 sub, u16 len,
				 const char *driver_ver)
{
	struct txgbe_hic_drv_info fw_cmd;
	int i;
	s32 ret_val = 0;

	DEBUGFUNC("txgbe_hic_set_drv_ver");
	UNREFERENCED_PARAMETER(len, driver_ver);

	fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
	fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_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;
	fw_cmd.pad = 0;
	fw_cmd.pad2 = 0;
	fw_cmd.hdr.checksum = txgbe_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 = txgbe_host_interface_command(hw, (u32 *)&fw_cmd,
						       sizeof(fw_cmd),
						       TXGBE_HI_COMMAND_TIMEOUT,
						       true);
		if (ret_val != 0)
			continue;

		if (fw_cmd.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS)
			ret_val = 0;
		else
			ret_val = TXGBE_ERR_HOST_INTERFACE_COMMAND;

		break;
	}

	return ret_val;
}
/**
 *  txgbe_hic_set_drv_ver - 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: unused
 *  @driver_ver: unused
 *
 *  Sends driver version number to firmware through the manageability
 *  block.  On success return 0
 *  else returns TXGBE_ERR_SWFW_SYNC when encountering an error acquiring
 *  semaphore or TXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
 **/


Sends driver version number to firmware through the manageability
block.  On success return 0
else returns TXGBE_ERR_SWFW_SYNC when encountering an error acquiring
semaphore or TXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
Sends driver version number to firmware through the manageability block . On success return 0 else returns TXGBE_ERR_SWFW_SYNC when encountering an error acquiring semaphore or TXGBE_ERR_HOST_INTERFACE_COMMAND when command fails .
s32 txgbe_hic_set_drv_ver(struct txgbe_hw *hw, u8 maj, u8 min,
				 u8 build, u8 sub, u16 len,
				 const char *driver_ver)
{
	struct txgbe_hic_drv_info fw_cmd;
	int i;
	s32 ret_val = 0;
	DEBUGFUNC("txgbe_hic_set_drv_ver");
	UNREFERENCED_PARAMETER(len, driver_ver);
	fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
	fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_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;
	fw_cmd.pad = 0;
	fw_cmd.pad2 = 0;
	fw_cmd.hdr.checksum = txgbe_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 = txgbe_host_interface_command(hw, (u32 *)&fw_cmd,
						       sizeof(fw_cmd),
						       TXGBE_HI_COMMAND_TIMEOUT,
						       true);
		if (ret_val != 0)
			continue;
		if (fw_cmd.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS)
			ret_val = 0;
		else
			ret_val = TXGBE_ERR_HOST_INTERFACE_COMMAND;
		break;
	}
	return ret_val;
}
s32 txgbe_hic_set_drv_ver ( struct txgbe_hw * hw , u8 maj , u8 min , u8 build , u8 sub , u16 len , const char * driver_ver ) { struct txgbe_hic_drv_info fw_cmd ; int i ; s32 ret_val = 0 ; DEBUGFUNC ( " " ) ; UNREFERENCED_PARAMETER ( len , driver_ver ) ; fw_cmd . hdr . cmd = FW_CEM_CMD_DRIVER_INFO ; fw_cmd . hdr . buf_len = FW_CEM_CMD_DRIVER_INFO_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 ; fw_cmd . pad = 0 ; fw_cmd . pad2 = 0 ; fw_cmd . hdr . checksum = txgbe_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 = txgbe_host_interface_command ( hw , ( u32 * ) & fw_cmd , sizeof ( fw_cmd ) , TXGBE_HI_COMMAND_TIMEOUT , true ) ; if ( ret_val != 0 ) continue ; if ( fw_cmd . hdr . cmd_or_resp . ret_status == FW_CEM_RESP_STATUS_SUCCESS ) ret_val = 0 ; else ret_val = TXGBE_ERR_HOST_INTERFACE_COMMAND ; break ; } return ret_val ; }
txgbe_hic_set_drv_ver - 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: unused
  @driver_ver: unused
txgbe_hic_set_drv_ver - 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 : unused @driver_ver : unused