src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data)
{
	const u32 mask = IXGBE_GSSR_SW_MNG_SM | IXGBE_GSSR_EEP_SM;
	struct ixgbe_hic_read_shadow_ram buffer;
	s32 status;

	DEBUGFUNC("ixgbe_read_ee_hostif_X550");
	buffer.hdr.req.cmd = FW_READ_SHADOW_RAM_CMD;
	buffer.hdr.req.buf_lenh = 0;
	buffer.hdr.req.buf_lenl = FW_READ_SHADOW_RAM_LEN;
	buffer.hdr.req.checksum = FW_DEFAULT_CHECKSUM;

	/* convert offset from words to bytes */
	buffer.address = IXGBE_CPU_TO_BE32(offset * 2);
	/* one word */
	buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16));
	buffer.pad2 = 0;
	buffer.data = 0;
	buffer.pad3 = 0;

	status = hw->mac.ops.acquire_swfw_sync(hw, mask);
	if (status)
		return status;

	status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),
				    IXGBE_HI_COMMAND_TIMEOUT);
	if (!status) {
		*data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
						  FW_NVM_DATA_OFFSET);
	}

	hw->mac.ops.release_swfw_sync(hw, mask);
	return status;
}
/**
 * ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command
 * assuming that the semaphore is already obtained.
 * @hw: pointer to hardware structure
 * @offset: offset of  word in the EEPROM to read
 * @data: word read from the EEPROM
 *
 * Reads a 16 bit word from the EEPROM using the hostif.
 **/
Read EEPROM word using a host interface command
assuming that the semaphore is already obtained.
@hw: pointer to hardware structure
@offset: offset of  word in the EEPROM to read
@data: word read from the EEPROM

Reads a 16 bit word from the EEPROM using the hostif.
Read EEPROM word using a host interface command assuming that the semaphore is already obtained . @hw : pointer to hardware structure @offset : offset of word in the EEPROM to read @data : word read from the EEPROM Reads a 16 bit word from the EEPROM using the hostif .
s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data)
{
	const u32 mask = IXGBE_GSSR_SW_MNG_SM | IXGBE_GSSR_EEP_SM;
	struct ixgbe_hic_read_shadow_ram buffer;
	s32 status;
	DEBUGFUNC("ixgbe_read_ee_hostif_X550");
	buffer.hdr.req.cmd = FW_READ_SHADOW_RAM_CMD;
	buffer.hdr.req.buf_lenh = 0;
	buffer.hdr.req.buf_lenl = FW_READ_SHADOW_RAM_LEN;
	buffer.hdr.req.checksum = FW_DEFAULT_CHECKSUM;
	buffer.address = IXGBE_CPU_TO_BE32(offset * 2);
	buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16));
	buffer.pad2 = 0;
	buffer.data = 0;
	buffer.pad3 = 0;
	status = hw->mac.ops.acquire_swfw_sync(hw, mask);
	if (status)
		return status;
	status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),
				    IXGBE_HI_COMMAND_TIMEOUT);
	if (!status) {
		*data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
						  FW_NVM_DATA_OFFSET);
	}
	hw->mac.ops.release_swfw_sync(hw, mask);
	return status;
}
s32 ixgbe_read_ee_hostif_X550 ( struct ixgbe_hw * hw , u16 offset , u16 * data ) { const u32 mask = IXGBE_GSSR_SW_MNG_SM | IXGBE_GSSR_EEP_SM ; struct ixgbe_hic_read_shadow_ram buffer ; s32 status ; DEBUGFUNC ( " " ) ; buffer . hdr . req . cmd = FW_READ_SHADOW_RAM_CMD ; buffer . hdr . req . buf_lenh = 0 ; buffer . hdr . req . buf_lenl = FW_READ_SHADOW_RAM_LEN ; buffer . hdr . req . checksum = FW_DEFAULT_CHECKSUM ; buffer . address = IXGBE_CPU_TO_BE32 ( offset * 2 ) ; buffer . length = IXGBE_CPU_TO_BE16 ( sizeof ( u16 ) ) ; buffer . pad2 = 0 ; buffer . data = 0 ; buffer . pad3 = 0 ; status = hw -> mac . ops . acquire_swfw_sync ( hw , mask ) ; if ( status ) return status ; status = ixgbe_hic_unlocked ( hw , ( u32 * ) & buffer , sizeof ( buffer ) , IXGBE_HI_COMMAND_TIMEOUT ) ; if ( ! status ) { * data = ( u16 ) IXGBE_READ_REG_ARRAY ( hw , IXGBE_FLEX_MNG , FW_NVM_DATA_OFFSET ) ; } hw -> mac . ops . release_swfw_sync ( hw , mask ) ; return status ; }
ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command
 assuming that the semaphore is already obtained.
ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command assuming that the semaphore is already obtained .
/* convert offset from words to bytes */ /* one word */