src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
{
	u32 link_s1, lp_an_page_low, an_cntl_1;
	s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
	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 at auto-negotiation has completed */
	status = hw->mac.ops.read_iosf_sb_reg(hw,
					IXGBE_KRM_LINK_S1(hw->bus.lan_id),
					IXGBE_SB_IOSF_TARGET_KR_PHY, &link_s1);

	if (status != IXGBE_SUCCESS ||
	    (link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE) == 0) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		status = IXGBE_ERR_FC_NOT_NEGOTIATED;
		goto out;
	}

	/* Read the 10g AN autoc and LP ability registers and resolve
	 * local flow control settings accordingly
	 */
	status = hw->mac.ops.read_iosf_sb_reg(hw,
				IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
				IXGBE_SB_IOSF_TARGET_KR_PHY, &an_cntl_1);

	if (status != IXGBE_SUCCESS) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		goto out;
	}

	status = hw->mac.ops.read_iosf_sb_reg(hw,
				IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id),
				IXGBE_SB_IOSF_TARGET_KR_PHY, &lp_an_page_low);

	if (status != IXGBE_SUCCESS) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		goto out;
	}

	status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low,
				    IXGBE_KRM_AN_CNTL_1_SYM_PAUSE,
				    IXGBE_KRM_AN_CNTL_1_ASM_PAUSE,
				    IXGBE_KRM_LP_BASE_PAGE_HIGH_SYM_PAUSE,
				    IXGBE_KRM_LP_BASE_PAGE_HIGH_ASM_PAUSE);

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_backplane_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_backplane_x550em_a(struct ixgbe_hw *hw)
{
	u32 link_s1, lp_an_page_low, an_cntl_1;
	s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
	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 = hw->mac.ops.read_iosf_sb_reg(hw,
					IXGBE_KRM_LINK_S1(hw->bus.lan_id),
					IXGBE_SB_IOSF_TARGET_KR_PHY, &link_s1);
	if (status != IXGBE_SUCCESS ||
	    (link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE) == 0) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		status = IXGBE_ERR_FC_NOT_NEGOTIATED;
		goto out;
	}
	status = hw->mac.ops.read_iosf_sb_reg(hw,
				IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
				IXGBE_SB_IOSF_TARGET_KR_PHY, &an_cntl_1);
	if (status != IXGBE_SUCCESS) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		goto out;
	}
	status = hw->mac.ops.read_iosf_sb_reg(hw,
				IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id),
				IXGBE_SB_IOSF_TARGET_KR_PHY, &lp_an_page_low);
	if (status != IXGBE_SUCCESS) {
		DEBUGOUT("Auto-Negotiation did not complete\n");
		goto out;
	}
	status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low,
				    IXGBE_KRM_AN_CNTL_1_SYM_PAUSE,
				    IXGBE_KRM_AN_CNTL_1_ASM_PAUSE,
				    IXGBE_KRM_LP_BASE_PAGE_HIGH_SYM_PAUSE,
				    IXGBE_KRM_LP_BASE_PAGE_HIGH_ASM_PAUSE);
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_backplane_x550em_a ( struct ixgbe_hw * hw ) { u32 link_s1 , lp_an_page_low , an_cntl_1 ; s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED ; 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 = hw -> mac . ops . read_iosf_sb_reg ( hw , IXGBE_KRM_LINK_S1 ( hw -> bus . lan_id ) , IXGBE_SB_IOSF_TARGET_KR_PHY , & link_s1 ) ; if ( status != IXGBE_SUCCESS || ( link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE ) == 0 ) { DEBUGOUT ( " \n " ) ; status = IXGBE_ERR_FC_NOT_NEGOTIATED ; goto out ; } status = hw -> mac . ops . read_iosf_sb_reg ( hw , IXGBE_KRM_AN_CNTL_1 ( hw -> bus . lan_id ) , IXGBE_SB_IOSF_TARGET_KR_PHY , & an_cntl_1 ) ; if ( status != IXGBE_SUCCESS ) { DEBUGOUT ( " \n " ) ; goto out ; } status = hw -> mac . ops . read_iosf_sb_reg ( hw , IXGBE_KRM_LP_BASE_PAGE_HIGH ( hw -> bus . lan_id ) , IXGBE_SB_IOSF_TARGET_KR_PHY , & lp_an_page_low ) ; if ( status != IXGBE_SUCCESS ) { DEBUGOUT ( " \n " ) ; goto out ; } status = ixgbe_negotiate_fc ( hw , an_cntl_1 , lp_an_page_low , IXGBE_KRM_AN_CNTL_1_SYM_PAUSE , IXGBE_KRM_AN_CNTL_1_ASM_PAUSE , IXGBE_KRM_LP_BASE_PAGE_HIGH_SYM_PAUSE , IXGBE_KRM_LP_BASE_PAGE_HIGH_ASM_PAUSE ) ; 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_backplane_x550em_a - Enable flow control IEEE clause 37
 @hw: pointer to hardware structure
ixgbe_fc_autoneg_backplane_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 at auto-negotiation has completed */ /* Read the 10g AN autoc and LP ability registers and resolve
	 * local flow control settings accordingly
	 */