src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
void txgbe_fc_autoneg(struct txgbe_hw *hw)
{
	s32 err = TXGBE_ERR_FC_NOT_NEGOTIATED;
	u32 speed;
	bool link_up;

	DEBUGFUNC("txgbe_fc_autoneg");

	/*
	 * AN should have completed when the cable was plugged in.
	 * Look for reasons to bail out.  Bail out if:
	 * - FC autoneg is disabled, or if
	 * - link is not up.
	 */
	if (hw->fc.disable_fc_autoneg) {
		DEBUGOUT("Flow control autoneg is disabled");
		goto out;
	}

	hw->mac.check_link(hw, &speed, &link_up, false);
	if (!link_up) {
		DEBUGOUT("The link is down");
		goto out;
	}

	switch (hw->phy.media_type) {
	/* Autoneg flow control on fiber adapters */
	case txgbe_media_type_fiber_qsfp:
	case txgbe_media_type_fiber:
		if (speed == TXGBE_LINK_SPEED_1GB_FULL)
			err = txgbe_fc_autoneg_fiber(hw);
		break;

	/* Autoneg flow control on backplane adapters */
	case txgbe_media_type_backplane:
		err = txgbe_fc_autoneg_backplane(hw);
		break;

	/* Autoneg flow control on copper adapters */
	case txgbe_media_type_copper:
		if (txgbe_device_supports_autoneg_fc(hw))
			err = txgbe_fc_autoneg_copper(hw);
		break;

	default:
		break;
	}

out:
	if (err == 0) {
		hw->fc.fc_was_autonegged = true;
	} else {
		hw->fc.fc_was_autonegged = false;
		hw->fc.current_mode = hw->fc.requested_mode;
	}
}
/**
 *  txgbe_fc_autoneg - Configure flow control
 *  @hw: pointer to hardware structure
 *
 *  Compares our advertised flow control capabilities to those advertised by
 *  our link partner, and determines the proper flow control mode to use.
 **/
Configure flow control
@hw: pointer to hardware structure

Compares our advertised flow control capabilities to those advertised by
our link partner, and determines the proper flow control mode to use.
Configure flow control @hw : pointer to hardware structure Compares our advertised flow control capabilities to those advertised by our link partner and determines the proper flow control mode to use .
void txgbe_fc_autoneg(struct txgbe_hw *hw)
{
	s32 err = TXGBE_ERR_FC_NOT_NEGOTIATED;
	u32 speed;
	bool link_up;
	DEBUGFUNC("txgbe_fc_autoneg");
	if (hw->fc.disable_fc_autoneg) {
		DEBUGOUT("Flow control autoneg is disabled");
		goto out;
	}
	hw->mac.check_link(hw, &speed, &link_up, false);
	if (!link_up) {
		DEBUGOUT("The link is down");
		goto out;
	}
	switch (hw->phy.media_type) {
	case txgbe_media_type_fiber_qsfp:
	case txgbe_media_type_fiber:
		if (speed == TXGBE_LINK_SPEED_1GB_FULL)
			err = txgbe_fc_autoneg_fiber(hw);
		break;
	case txgbe_media_type_backplane:
		err = txgbe_fc_autoneg_backplane(hw);
		break;
	case txgbe_media_type_copper:
		if (txgbe_device_supports_autoneg_fc(hw))
			err = txgbe_fc_autoneg_copper(hw);
		break;
	default:
		break;
	}
out:
	if (err == 0) {
		hw->fc.fc_was_autonegged = true;
	} else {
		hw->fc.fc_was_autonegged = false;
		hw->fc.current_mode = hw->fc.requested_mode;
	}
}
void txgbe_fc_autoneg ( struct txgbe_hw * hw ) { s32 err = TXGBE_ERR_FC_NOT_NEGOTIATED ; u32 speed ; bool link_up ; DEBUGFUNC ( " " ) ; if ( hw -> fc . disable_fc_autoneg ) { DEBUGOUT ( " " ) ; goto out ; } hw -> mac . check_link ( hw , & speed , & link_up , false ) ; if ( ! link_up ) { DEBUGOUT ( " " ) ; goto out ; } switch ( hw -> phy . media_type ) { case txgbe_media_type_fiber_qsfp : case txgbe_media_type_fiber : if ( speed == TXGBE_LINK_SPEED_1GB_FULL ) err = txgbe_fc_autoneg_fiber ( hw ) ; break ; case txgbe_media_type_backplane : err = txgbe_fc_autoneg_backplane ( hw ) ; break ; case txgbe_media_type_copper : if ( txgbe_device_supports_autoneg_fc ( hw ) ) err = txgbe_fc_autoneg_copper ( hw ) ; break ; default : break ; } out : if ( err == 0 ) { hw -> fc . fc_was_autonegged = true ; } else { hw -> fc . fc_was_autonegged = false ; hw -> fc . current_mode = hw -> fc . requested_mode ; } }
txgbe_fc_autoneg - Configure flow control
  @hw: pointer to hardware structure
txgbe_fc_autoneg - Configure flow control @hw : pointer to hardware structure
/*
	 * AN should have completed when the cable was plugged in.
	 * Look for reasons to bail out.  Bail out if:
	 * - FC autoneg is disabled, or if
	 * - link is not up.
	 */ /* Autoneg flow control on fiber adapters */ /* Autoneg flow control on backplane adapters */ /* Autoneg flow control on copper adapters */