src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
			      bool *link_up, bool link_up_wait_to_complete)
{
	u32 status;
	u16 i, autoneg_status = 0;

	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
		return IXGBE_ERR_CONFIG;

	status = ixgbe_check_mac_link_generic(hw, speed, link_up,
					      link_up_wait_to_complete);

	/* If check link fails or MAC link is not up, then return */
	if (status != IXGBE_SUCCESS || !(*link_up))
		return status;

	/* MAC link is up, so check external PHY link.
	 * X557 PHY. Link status is latching low, and can only be used to detect
	 * link drop, and not the current status of the link without performing
	 * back-to-back reads.
	 */
	for (i = 0; i < 2; i++) {
		status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
					      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
					      &autoneg_status);

		if (status != IXGBE_SUCCESS)
			return status;
	}

	/* If external PHY link is not up, then indicate link not up */
	if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
		*link_up = false;

	return IXGBE_SUCCESS;
}
/**
 * ixgbe_check_link_t_X550em - Determine link and speed status
 * @hw: pointer to hardware structure
 * @speed: pointer to link speed
 * @link_up: true when link is up
 * @link_up_wait_to_complete: bool used to wait for link up or not
 *
 * Check that both the MAC and X557 external PHY have link.
 **/
Determine link and speed status
@hw: pointer to hardware structure
@speed: pointer to link speed
@link_up: true when link is up
@link_up_wait_to_complete: bool used to wait for link up or not

Check that both the MAC and X557 external PHY have link.
Determine link and speed status @hw : pointer to hardware structure @speed : pointer to link speed @link_up : true when link is up @link_up_wait_to_complete : bool used to wait for link up or not Check that both the MAC and X557 external PHY have link .
s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
			      bool *link_up, bool link_up_wait_to_complete)
{
	u32 status;
	u16 i, autoneg_status = 0;
	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
		return IXGBE_ERR_CONFIG;
	status = ixgbe_check_mac_link_generic(hw, speed, link_up,
					      link_up_wait_to_complete);
	if (status != IXGBE_SUCCESS || !(*link_up))
		return status;
	for (i = 0; i < 2; i++) {
		status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
					      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
					      &autoneg_status);
		if (status != IXGBE_SUCCESS)
			return status;
	}
	if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
		*link_up = false;
	return IXGBE_SUCCESS;
}
s32 ixgbe_check_link_t_X550em ( struct ixgbe_hw * hw , ixgbe_link_speed * speed , bool * link_up , bool link_up_wait_to_complete ) { u32 status ; u16 i , autoneg_status = 0 ; if ( hw -> mac . ops . get_media_type ( hw ) != ixgbe_media_type_copper ) return IXGBE_ERR_CONFIG ; status = ixgbe_check_mac_link_generic ( hw , speed , link_up , link_up_wait_to_complete ) ; if ( status != IXGBE_SUCCESS || ! ( * link_up ) ) return status ; for ( i = 0 ; i < 2 ; i ++ ) { status = hw -> phy . ops . read_reg ( hw , IXGBE_MDIO_AUTO_NEG_STATUS , IXGBE_MDIO_AUTO_NEG_DEV_TYPE , & autoneg_status ) ; if ( status != IXGBE_SUCCESS ) return status ; } if ( ! ( autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS ) ) * link_up = false ; return IXGBE_SUCCESS ; }
ixgbe_check_link_t_X550em - Determine link and speed status
 @hw: pointer to hardware structure
 @speed: pointer to link speed
 @link_up: true when link is up
 @link_up_wait_to_complete: bool used to wait for link up or not
ixgbe_check_link_t_X550em - Determine link and speed status @hw : pointer to hardware structure @speed : pointer to link speed @link_up : true when link is up @link_up_wait_to_complete : bool used to wait for link up or not
/* If check link fails or MAC link is not up, then return */ /* MAC link is up, so check external PHY link.
	 * X557 PHY. Link status is latching low, and can only be used to detect
	 * link drop, and not the current status of the link without performing
	 * back-to-back reads.
	 */ /* If external PHY link is not up, then indicate link not up */