src/dpdk/drivers/net/txgbe/base/txgbe_phy.c
s32 txgbe_check_phy_link_tnx(struct txgbe_hw *hw, u32 *speed,
			     bool *link_up)
{
	s32 err = 0;
	u32 time_out;
	u32 max_time_out = 10;
	u16 phy_link = 0;
	u16 phy_speed = 0;
	u16 phy_data = 0;

	DEBUGFUNC("txgbe_check_phy_link_tnx");

	/* Initialize speed and link to default case */
	*link_up = false;
	*speed = TXGBE_LINK_SPEED_10GB_FULL;

	/*
	 * Check current speed and link status of the PHY register.
	 * This is a vendor specific register and may have to
	 * be changed for other copper PHYs.
	 */
	for (time_out = 0; time_out < max_time_out; time_out++) {
		usec_delay(10);
		err = hw->phy.read_reg(hw,
					TXGBE_MD_VENDOR_SPECIFIC_1_STATUS,
					TXGBE_MD_DEV_VENDOR_1,
					&phy_data);
		phy_link = phy_data & TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS;
		phy_speed = phy_data &
				 TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS;
		if (phy_link == TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS) {
			*link_up = true;
			if (phy_speed ==
			    TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS)
				*speed = TXGBE_LINK_SPEED_1GB_FULL;
			break;
		}
	}

	return err;
}
/**
 *  txgbe_check_phy_link_tnx - Determine link and speed status
 *  @hw: pointer to hardware structure
 *  @speed: current link speed
 *  @link_up: true is link is up, false otherwise
 *
 *  Reads the VS1 register to determine if link is up and the current speed for
 *  the PHY.
 **/
Determine link and speed status
@hw: pointer to hardware structure
@speed: current link speed
@link_up: true is link is up, false otherwise

Reads the VS1 register to determine if link is up and the current speed for
the PHY.
Determine link and speed status @hw : pointer to hardware structure @speed : current link speed @link_up : true is link is up false otherwise Reads the VS1 register to determine if link is up and the current speed for the PHY .
s32 txgbe_check_phy_link_tnx(struct txgbe_hw *hw, u32 *speed,
			     bool *link_up)
{
	s32 err = 0;
	u32 time_out;
	u32 max_time_out = 10;
	u16 phy_link = 0;
	u16 phy_speed = 0;
	u16 phy_data = 0;
	DEBUGFUNC("txgbe_check_phy_link_tnx");
	*link_up = false;
	*speed = TXGBE_LINK_SPEED_10GB_FULL;
	for (time_out = 0; time_out < max_time_out; time_out++) {
		usec_delay(10);
		err = hw->phy.read_reg(hw,
					TXGBE_MD_VENDOR_SPECIFIC_1_STATUS,
					TXGBE_MD_DEV_VENDOR_1,
					&phy_data);
		phy_link = phy_data & TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS;
		phy_speed = phy_data &
				 TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS;
		if (phy_link == TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS) {
			*link_up = true;
			if (phy_speed ==
			    TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS)
				*speed = TXGBE_LINK_SPEED_1GB_FULL;
			break;
		}
	}
	return err;
}
s32 txgbe_check_phy_link_tnx ( struct txgbe_hw * hw , u32 * speed , bool * link_up ) { s32 err = 0 ; u32 time_out ; u32 max_time_out = 10 ; u16 phy_link = 0 ; u16 phy_speed = 0 ; u16 phy_data = 0 ; DEBUGFUNC ( " " ) ; * link_up = false ; * speed = TXGBE_LINK_SPEED_10GB_FULL ; for ( time_out = 0 ; time_out < max_time_out ; time_out ++ ) { usec_delay ( 10 ) ; err = hw -> phy . read_reg ( hw , TXGBE_MD_VENDOR_SPECIFIC_1_STATUS , TXGBE_MD_DEV_VENDOR_1 , & phy_data ) ; phy_link = phy_data & TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS ; phy_speed = phy_data & TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS ; if ( phy_link == TXGBE_MD_VENDOR_SPECIFIC_1_LINK_STATUS ) { * link_up = true ; if ( phy_speed == TXGBE_MD_VENDOR_SPECIFIC_1_SPEED_STATUS ) * speed = TXGBE_LINK_SPEED_1GB_FULL ; break ; } } return err ; }
txgbe_check_phy_link_tnx - Determine link and speed status
  @hw: pointer to hardware structure
  @speed: current link speed
  @link_up: true is link is up, false otherwise
txgbe_check_phy_link_tnx - Determine link and speed status @hw : pointer to hardware structure @speed : current link speed @link_up : true is link is up false otherwise
/* Initialize speed and link to default case */ /*
	 * Check current speed and link status of the PHY register.
	 * This is a vendor specific register and may have to
	 * be changed for other copper PHYs.
	 */