src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_setup_fiber_serdes_link_generic(struct igc_hw *hw)
{
	u32 ctrl;
	s32 ret_val;

	DEBUGFUNC("igc_setup_fiber_serdes_link_generic");

	ctrl = IGC_READ_REG(hw, IGC_CTRL);

	/* Take the link out of reset */
	ctrl &= ~IGC_CTRL_LRST;

	hw->mac.ops.config_collision_dist(hw);

	ret_val = igc_commit_fc_settings_generic(hw);
	if (ret_val)
		return ret_val;

	/* Since auto-negotiation is enabled, take the link out of reset (the
	 * link will be in reset, because we previously reset the chip). This
	 * will restart auto-negotiation.  If auto-negotiation is successful
	 * then the link-up status bit will be set and the flow control enable
	 * bits (RFCE and TFCE) will be set according to their negotiated value.
	 */
	DEBUGOUT("Auto-negotiation enabled\n");

	IGC_WRITE_REG(hw, IGC_CTRL, ctrl);
	IGC_WRITE_FLUSH(hw);
	msec_delay(1);

	/* For these adapters, the SW definable pin 1 is set when the optics
	 * detect a signal.  If we have a signal, then poll for a "Link-Up"
	 * indication.
	 */
	if (hw->phy.media_type == igc_media_type_internal_serdes ||
	    (IGC_READ_REG(hw, IGC_CTRL) & IGC_CTRL_SWDPIN1)) {
		ret_val = igc_poll_fiber_serdes_link_generic(hw);
	} else {
		DEBUGOUT("No signal detected\n");
	}

	return ret_val;
}
/**
 *  igc_setup_fiber_serdes_link_generic - Setup link for fiber/serdes
 *  @hw: pointer to the HW structure
 *
 *  Configures collision distance and flow control for fiber and serdes
 *  links.  Upon successful setup, poll for link.
 **/
Setup link for fiber/serdes
@hw: pointer to the HW structure

Configures collision distance and flow control for fiber and serdes
links.  Upon successful setup, poll for link.
Setup link for fiber / serdes @hw : pointer to the HW structure Configures collision distance and flow control for fiber and serdes links . Upon successful setup poll for link .
s32 igc_setup_fiber_serdes_link_generic(struct igc_hw *hw)
{
	u32 ctrl;
	s32 ret_val;
	DEBUGFUNC("igc_setup_fiber_serdes_link_generic");
	ctrl = IGC_READ_REG(hw, IGC_CTRL);
	ctrl &= ~IGC_CTRL_LRST;
	hw->mac.ops.config_collision_dist(hw);
	ret_val = igc_commit_fc_settings_generic(hw);
	if (ret_val)
		return ret_val;
	DEBUGOUT("Auto-negotiation enabled\n");
	IGC_WRITE_REG(hw, IGC_CTRL, ctrl);
	IGC_WRITE_FLUSH(hw);
	msec_delay(1);
	if (hw->phy.media_type == igc_media_type_internal_serdes ||
	    (IGC_READ_REG(hw, IGC_CTRL) & IGC_CTRL_SWDPIN1)) {
		ret_val = igc_poll_fiber_serdes_link_generic(hw);
	} else {
		DEBUGOUT("No signal detected\n");
	}
	return ret_val;
}
s32 igc_setup_fiber_serdes_link_generic ( struct igc_hw * hw ) { u32 ctrl ; s32 ret_val ; DEBUGFUNC ( " " ) ; ctrl = IGC_READ_REG ( hw , IGC_CTRL ) ; ctrl &= ~ IGC_CTRL_LRST ; hw -> mac . ops . config_collision_dist ( hw ) ; ret_val = igc_commit_fc_settings_generic ( hw ) ; if ( ret_val ) return ret_val ; DEBUGOUT ( " \n " ) ; IGC_WRITE_REG ( hw , IGC_CTRL , ctrl ) ; IGC_WRITE_FLUSH ( hw ) ; msec_delay ( 1 ) ; if ( hw -> phy . media_type == igc_media_type_internal_serdes || ( IGC_READ_REG ( hw , IGC_CTRL ) & IGC_CTRL_SWDPIN1 ) ) { ret_val = igc_poll_fiber_serdes_link_generic ( hw ) ; } else { DEBUGOUT ( " \n " ) ; } return ret_val ; }
igc_setup_fiber_serdes_link_generic - Setup link for fiber/serdes
  @hw: pointer to the HW structure
igc_setup_fiber_serdes_link_generic - Setup link for fiber / serdes @hw : pointer to the HW structure
/* Take the link out of reset */ /* Since auto-negotiation is enabled, take the link out of reset (the
	 * link will be in reset, because we previously reset the chip). This
	 * will restart auto-negotiation.  If auto-negotiation is successful
	 * then the link-up status bit will be set and the flow control enable
	 * bits (RFCE and TFCE) will be set according to their negotiated value.
	 */ /* For these adapters, the SW definable pin 1 is set when the optics
	 * detect a signal.  If we have a signal, then poll for a "Link-Up"
	 * indication.
	 */