src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
bool txgbe_device_supports_autoneg_fc(struct txgbe_hw *hw)
{
	bool supported = false;
	u32 speed;
	bool link_up;

	DEBUGFUNC("txgbe_device_supports_autoneg_fc");

	switch (hw->phy.media_type) {
	case txgbe_media_type_fiber_qsfp:
	case txgbe_media_type_fiber:
		hw->mac.check_link(hw, &speed, &link_up, false);
		/* if link is down, assume supported */
		if (link_up)
			supported = speed == TXGBE_LINK_SPEED_1GB_FULL ?
			true : false;
		else
			supported = true;

		break;
	case txgbe_media_type_backplane:
		supported = true;
		break;
	case txgbe_media_type_copper:
		/* only some copper devices support flow control autoneg */
		switch (hw->device_id) {
		case TXGBE_DEV_ID_RAPTOR_XAUI:
		case TXGBE_DEV_ID_RAPTOR_SGMII:
			supported = true;
			break;
		default:
			supported = false;
		}
	default:
		break;
	}

	if (!supported)
		DEBUGOUT("Device %x does not support flow control autoneg",
			      hw->device_id);
	return supported;
}
/**
 * txgbe_device_supports_autoneg_fc - Check if device supports autonegotiation
 * of flow control
 * @hw: pointer to hardware structure
 *
 * This function returns true if the device supports flow control
 * autonegotiation, and false if it does not.
 *
 **/
Check if device supports autonegotiation
of flow control
@hw: pointer to hardware structure

This function returns true if the device supports flow control
autonegotiation, and false if it does not.
Check if device supports autonegotiation of flow control @hw : pointer to hardware structure This function returns true if the device supports flow control autonegotiation and false if it does not .
bool txgbe_device_supports_autoneg_fc(struct txgbe_hw *hw)
{
	bool supported = false;
	u32 speed;
	bool link_up;
	DEBUGFUNC("txgbe_device_supports_autoneg_fc");
	switch (hw->phy.media_type) {
	case txgbe_media_type_fiber_qsfp:
	case txgbe_media_type_fiber:
		hw->mac.check_link(hw, &speed, &link_up, false);
		if (link_up)
			supported = speed == TXGBE_LINK_SPEED_1GB_FULL ?
			true : false;
		else
			supported = true;
		break;
	case txgbe_media_type_backplane:
		supported = true;
		break;
	case txgbe_media_type_copper:
		switch (hw->device_id) {
		case TXGBE_DEV_ID_RAPTOR_XAUI:
		case TXGBE_DEV_ID_RAPTOR_SGMII:
			supported = true;
			break;
		default:
			supported = false;
		}
	default:
		break;
	}
	if (!supported)
		DEBUGOUT("Device %x does not support flow control autoneg",
			      hw->device_id);
	return supported;
}
bool txgbe_device_supports_autoneg_fc ( struct txgbe_hw * hw ) { bool supported = false ; u32 speed ; bool link_up ; DEBUGFUNC ( " " ) ; switch ( hw -> phy . media_type ) { case txgbe_media_type_fiber_qsfp : case txgbe_media_type_fiber : hw -> mac . check_link ( hw , & speed , & link_up , false ) ; if ( link_up ) supported = speed == TXGBE_LINK_SPEED_1GB_FULL ? true : false ; else supported = true ; break ; case txgbe_media_type_backplane : supported = true ; break ; case txgbe_media_type_copper : switch ( hw -> device_id ) { case TXGBE_DEV_ID_RAPTOR_XAUI : case TXGBE_DEV_ID_RAPTOR_SGMII : supported = true ; break ; default : supported = false ; } default : break ; } if ( ! supported ) DEBUGOUT ( " " , hw -> device_id ) ; return supported ; }
txgbe_device_supports_autoneg_fc - Check if device supports autonegotiation
 of flow control
 @hw: pointer to hardware structure
txgbe_device_supports_autoneg_fc - Check if device supports autonegotiation of flow control @hw : pointer to hardware structure
/* if link is down, assume supported */ /* only some copper devices support flow control autoneg */