src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity,
			  u32 (*data)[FW_PHY_ACT_DATA_COUNT])
{
	union {
		struct ixgbe_hic_phy_activity_req cmd;
		struct ixgbe_hic_phy_activity_resp rsp;
	} hic;
	u16 retries = FW_PHY_ACT_RETRIES;
	s32 rc;
	u16 i;

	do {
		memset(&hic, 0, sizeof(hic));
		hic.cmd.hdr.cmd = FW_PHY_ACT_REQ_CMD;
		hic.cmd.hdr.buf_len = FW_PHY_ACT_REQ_LEN;
		hic.cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
		hic.cmd.port_number = hw->bus.lan_id;
		hic.cmd.activity_id = IXGBE_CPU_TO_LE16(activity);
		for (i = 0; i < FW_PHY_ACT_DATA_COUNT; ++i)
			hic.cmd.data[i] = IXGBE_CPU_TO_BE32((*data)[i]);

		rc = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd,
						  sizeof(hic.cmd),
						  IXGBE_HI_COMMAND_TIMEOUT,
						  true);
		if (rc != IXGBE_SUCCESS)
			return rc;
		if (hic.rsp.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS) {
			for (i = 0; i < FW_PHY_ACT_DATA_COUNT; ++i)
				(*data)[i] = IXGBE_BE32_TO_CPU(hic.rsp.data[i]);
			return IXGBE_SUCCESS;
		}
		usec_delay(20);
		--retries;
	} while (retries > 0);

	return IXGBE_ERR_HOST_INTERFACE_COMMAND;
}
/**
 * ixgbe_fw_phy_activity - Perform an activity on a PHY
 * @hw: pointer to hardware structure
 * @activity: activity to perform
 * @data: Pointer to 4 32-bit words of data
 */
Perform an activity on a PHY
@hw: pointer to hardware structure
@activity: activity to perform
@data: Pointer to 4 32-bit words of data
Perform an activity on a PHY @hw : pointer to hardware structure @activity : activity to perform @data : Pointer to 4 32 - bit words of data
s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity,
			  u32 (*data)[FW_PHY_ACT_DATA_COUNT])
{
	union {
		struct ixgbe_hic_phy_activity_req cmd;
		struct ixgbe_hic_phy_activity_resp rsp;
	} hic;
	u16 retries = FW_PHY_ACT_RETRIES;
	s32 rc;
	u16 i;
	do {
		memset(&hic, 0, sizeof(hic));
		hic.cmd.hdr.cmd = FW_PHY_ACT_REQ_CMD;
		hic.cmd.hdr.buf_len = FW_PHY_ACT_REQ_LEN;
		hic.cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
		hic.cmd.port_number = hw->bus.lan_id;
		hic.cmd.activity_id = IXGBE_CPU_TO_LE16(activity);
		for (i = 0; i < FW_PHY_ACT_DATA_COUNT; ++i)
			hic.cmd.data[i] = IXGBE_CPU_TO_BE32((*data)[i]);
		rc = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd,
						  sizeof(hic.cmd),
						  IXGBE_HI_COMMAND_TIMEOUT,
						  true);
		if (rc != IXGBE_SUCCESS)
			return rc;
		if (hic.rsp.hdr.cmd_or_resp.ret_status ==
		    FW_CEM_RESP_STATUS_SUCCESS) {
			for (i = 0; i < FW_PHY_ACT_DATA_COUNT; ++i)
				(*data)[i] = IXGBE_BE32_TO_CPU(hic.rsp.data[i]);
			return IXGBE_SUCCESS;
		}
		usec_delay(20);
		--retries;
	} while (retries > 0);
	return IXGBE_ERR_HOST_INTERFACE_COMMAND;
}
s32 ixgbe_fw_phy_activity ( struct ixgbe_hw * hw , u16 activity , u32 ( * data ) [ FW_PHY_ACT_DATA_COUNT ] ) { union { struct ixgbe_hic_phy_activity_req cmd ; struct ixgbe_hic_phy_activity_resp rsp ; } hic ; u16 retries = FW_PHY_ACT_RETRIES ; s32 rc ; u16 i ; do { memset ( & hic , 0 , sizeof ( hic ) ) ; hic . cmd . hdr . cmd = FW_PHY_ACT_REQ_CMD ; hic . cmd . hdr . buf_len = FW_PHY_ACT_REQ_LEN ; hic . cmd . hdr . checksum = FW_DEFAULT_CHECKSUM ; hic . cmd . port_number = hw -> bus . lan_id ; hic . cmd . activity_id = IXGBE_CPU_TO_LE16 ( activity ) ; for ( i = 0 ; i < FW_PHY_ACT_DATA_COUNT ; ++ i ) hic . cmd . data [ i ] = IXGBE_CPU_TO_BE32 ( ( * data ) [ i ] ) ; rc = ixgbe_host_interface_command ( hw , ( u32 * ) & hic . cmd , sizeof ( hic . cmd ) , IXGBE_HI_COMMAND_TIMEOUT , true ) ; if ( rc != IXGBE_SUCCESS ) return rc ; if ( hic . rsp . hdr . cmd_or_resp . ret_status == FW_CEM_RESP_STATUS_SUCCESS ) { for ( i = 0 ; i < FW_PHY_ACT_DATA_COUNT ; ++ i ) ( * data ) [ i ] = IXGBE_BE32_TO_CPU ( hic . rsp . data [ i ] ) ; return IXGBE_SUCCESS ; } usec_delay ( 20 ) ; -- retries ; } while ( retries > 0 ) ; return IXGBE_ERR_HOST_INTERFACE_COMMAND ; }
ixgbe_fw_phy_activity - Perform an activity on a PHY
 @hw: pointer to hardware structure
 @activity: activity to perform
 @data: Pointer to 4 32-bit words of data
ixgbe_fw_phy_activity - Perform an activity on a PHY @hw : pointer to hardware structure @activity : activity to perform @data : Pointer to 4 32 - bit words of data