src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
{
	s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
	u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
	ixgbe_link_speed speed;
	bool link_up;

	/* 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) {
		ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED,
			     "Flow control autoneg is disabled");
		goto out;
	}

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

	/* Check if auto-negotiation has completed */
	status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
	if (status != IXGBE_SUCCESS ||
	    !(info[0] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE)) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		status = IXGBE_ERR_FC_NOT_NEGOTIATED;
		goto out;
	}

	/* Negotiate the flow control */
	status = ixgbe_negotiate_fc(hw, info[0], info[0],
				    FW_PHY_ACT_GET_LINK_INFO_FC_RX,
				    FW_PHY_ACT_GET_LINK_INFO_FC_TX,
				    FW_PHY_ACT_GET_LINK_INFO_LP_FC_RX,
				    FW_PHY_ACT_GET_LINK_INFO_LP_FC_TX);

out:
	if (status == IXGBE_SUCCESS) {
		hw->fc.fc_was_autonegged = true;
	} else {
		hw->fc.fc_was_autonegged = false;
		hw->fc.current_mode = hw->fc.requested_mode;
	}
}
/**
 * ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37
 * @hw: pointer to hardware structure
 *
 * Enable flow control according to IEEE clause 37.
 **/
Enable flow control IEEE clause 37
@hw: pointer to hardware structure

Enable flow control according to IEEE clause 37.
Enable flow control IEEE clause 37 @hw : pointer to hardware structure Enable flow control according to IEEE clause 37 .
void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
{
	s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
	u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
	ixgbe_link_speed speed;
	bool link_up;
	if (hw->fc.disable_fc_autoneg) {
		ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED,
			     "Flow control autoneg is disabled");
		goto out;
	}
	hw->mac.ops.check_link(hw, &speed, &link_up, false);
	if (!link_up) {
		ERROR_REPORT1(IXGBE_ERROR_SOFTWARE, "The link is down");
		goto out;
	}
	status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
	if (status != IXGBE_SUCCESS ||
	    !(info[0] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE)) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		status = IXGBE_ERR_FC_NOT_NEGOTIATED;
		goto out;
	}
	status = ixgbe_negotiate_fc(hw, info[0], info[0],
				    FW_PHY_ACT_GET_LINK_INFO_FC_RX,
				    FW_PHY_ACT_GET_LINK_INFO_FC_TX,
				    FW_PHY_ACT_GET_LINK_INFO_LP_FC_RX,
				    FW_PHY_ACT_GET_LINK_INFO_LP_FC_TX);
out:
	if (status == IXGBE_SUCCESS) {
		hw->fc.fc_was_autonegged = true;
	} else {
		hw->fc.fc_was_autonegged = false;
		hw->fc.current_mode = hw->fc.requested_mode;
	}
}
void ixgbe_fc_autoneg_sgmii_x550em_a ( struct ixgbe_hw * hw ) { s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED ; u32 info [ FW_PHY_ACT_DATA_COUNT ] = { 0 } ; ixgbe_link_speed speed ; bool link_up ; if ( hw -> fc . disable_fc_autoneg ) { ERROR_REPORT1 ( IXGBE_ERROR_UNSUPPORTED , " " ) ; goto out ; } hw -> mac . ops . check_link ( hw , & speed , & link_up , false ) ; if ( ! link_up ) { ERROR_REPORT1 ( IXGBE_ERROR_SOFTWARE , " " ) ; goto out ; } status = ixgbe_fw_phy_activity ( hw , FW_PHY_ACT_GET_LINK_INFO , & info ) ; if ( status != IXGBE_SUCCESS || ! ( info [ 0 ] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE ) ) { DEBUGOUT ( " \n " ) ; status = IXGBE_ERR_FC_NOT_NEGOTIATED ; goto out ; } status = ixgbe_negotiate_fc ( hw , info [ 0 ] , info [ 0 ] , FW_PHY_ACT_GET_LINK_INFO_FC_RX , FW_PHY_ACT_GET_LINK_INFO_FC_TX , FW_PHY_ACT_GET_LINK_INFO_LP_FC_RX , FW_PHY_ACT_GET_LINK_INFO_LP_FC_TX ) ; out : if ( status == IXGBE_SUCCESS ) { hw -> fc . fc_was_autonegged = true ; } else { hw -> fc . fc_was_autonegged = false ; hw -> fc . current_mode = hw -> fc . requested_mode ; } }
ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37
 @hw: pointer to hardware structure
ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37 @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.
	 */ /* Check if auto-negotiation has completed */ /* Negotiate the flow control */