src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_poll_fiber_serdes_link_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	u32 i, status;
	s32 ret_val;

	DEBUGFUNC("igc_poll_fiber_serdes_link_generic");

	/* If we have a signal (the cable is plugged in, or assumed true for
	 * serdes media) then poll for a "Link-Up" indication in the Device
	 * Status Register.  Time-out if a link isn't seen in 500 milliseconds
	 * seconds (Auto-negotiation should complete in less than 500
	 * milliseconds even if the other end is doing it in SW).
	 */
	for (i = 0; i < FIBER_LINK_UP_LIMIT; i++) {
		msec_delay(10);
		status = IGC_READ_REG(hw, IGC_STATUS);
		if (status & IGC_STATUS_LU)
			break;
	}
	if (i == FIBER_LINK_UP_LIMIT) {
		DEBUGOUT("Never got a valid link from auto-neg!!!\n");
		mac->autoneg_failed = true;
		/* AutoNeg failed to achieve a link, so we'll call
		 * mac->check_for_link. This routine will force the
		 * link up if we detect a signal. This will allow us to
		 * communicate with non-autonegotiating link partners.
		 */
		ret_val = mac->ops.check_for_link(hw);
		if (ret_val) {
			DEBUGOUT("Error while checking for link\n");
			return ret_val;
		}
		mac->autoneg_failed = false;
	} else {
		mac->autoneg_failed = false;
		DEBUGOUT("Valid Link Found\n");
	}

	return IGC_SUCCESS;
}
/**
 *  igc_poll_fiber_serdes_link_generic - Poll for link up
 *  @hw: pointer to the HW structure
 *
 *  Polls for link up by reading the status register, if link fails to come
 *  up with auto-negotiation, then the link is forced if a signal is detected.
 **/
Poll for link up
@hw: pointer to the HW structure

Polls for link up by reading the status register, if link fails to come
up with auto-negotiation, then the link is forced if a signal is detected.
Poll for link up @hw : pointer to the HW structure Polls for link up by reading the status register if link fails to come up with auto - negotiation then the link is forced if a signal is detected .
s32 igc_poll_fiber_serdes_link_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	u32 i, status;
	s32 ret_val;
	DEBUGFUNC("igc_poll_fiber_serdes_link_generic");
	for (i = 0; i < FIBER_LINK_UP_LIMIT; i++) {
		msec_delay(10);
		status = IGC_READ_REG(hw, IGC_STATUS);
		if (status & IGC_STATUS_LU)
			break;
	}
	if (i == FIBER_LINK_UP_LIMIT) {
		DEBUGOUT("Never got a valid link from auto-neg!!!\n");
		mac->autoneg_failed = true;
		ret_val = mac->ops.check_for_link(hw);
		if (ret_val) {
			DEBUGOUT("Error while checking for link\n");
			return ret_val;
		}
		mac->autoneg_failed = false;
	} else {
		mac->autoneg_failed = false;
		DEBUGOUT("Valid Link Found\n");
	}
	return IGC_SUCCESS;
}
s32 igc_poll_fiber_serdes_link_generic ( struct igc_hw * hw ) { struct igc_mac_info * mac = & hw -> mac ; u32 i , status ; s32 ret_val ; DEBUGFUNC ( " " ) ; for ( i = 0 ; i < FIBER_LINK_UP_LIMIT ; i ++ ) { msec_delay ( 10 ) ; status = IGC_READ_REG ( hw , IGC_STATUS ) ; if ( status & IGC_STATUS_LU ) break ; } if ( i == FIBER_LINK_UP_LIMIT ) { DEBUGOUT ( " \n " ) ; mac -> autoneg_failed = true ; ret_val = mac -> ops . check_for_link ( hw ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; return ret_val ; } mac -> autoneg_failed = false ; } else { mac -> autoneg_failed = false ; DEBUGOUT ( " \n " ) ; } return IGC_SUCCESS ; }
igc_poll_fiber_serdes_link_generic - Poll for link up
  @hw: pointer to the HW structure
igc_poll_fiber_serdes_link_generic - Poll for link up @hw : pointer to the HW structure
/* If we have a signal (the cable is plugged in, or assumed true for
	 * serdes media) then poll for a "Link-Up" indication in the Device
	 * Status Register.  Time-out if a link isn't seen in 500 milliseconds
	 * seconds (Auto-negotiation should complete in less than 500
	 * milliseconds even if the other end is doing it in SW).
	 */ /* AutoNeg failed to achieve a link, so we'll call
		 * mac->check_for_link. This routine will force the
		 * link up if we detect a signal. This will allow us to
		 * communicate with non-autonegotiating link partners.
		 */