src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_check_for_copper_link_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	s32 ret_val;
	bool link;

	DEBUGFUNC("igc_check_for_copper_link");

	/* We only want to go out to the PHY registers to see if Auto-Neg
	 * has completed and/or if our link status has changed.  The
	 * get_link_status flag is set upon receiving a Link Status
	 * Change or Rx Sequence Error interrupt.
	 */
	if (!mac->get_link_status)
		return IGC_SUCCESS;

	/* First we want to see if the MII Status Register reports
	 * link.  If so, then we want to get the current speed/duplex
	 * of the PHY.
	 */
	ret_val = igc_phy_has_link_generic(hw, 1, 0, &link);
	if (ret_val)
		return ret_val;

	if (!link)
		return IGC_SUCCESS; /* No link detected */

	mac->get_link_status = false;

	/* Check if there was DownShift, must be checked
	 * immediately after link-up
	 */
	igc_check_downshift_generic(hw);

	/* If we are forcing speed/duplex, then we simply return since
	 * we have already determined whether we have link or not.
	 */
	if (!mac->autoneg)
		return -IGC_ERR_CONFIG;

	/* Auto-Neg is enabled.  Auto Speed Detection takes care
	 * of MAC speed/duplex configuration.  So we only need to
	 * configure Collision Distance in the MAC.
	 */
	mac->ops.config_collision_dist(hw);

	/* Configure Flow Control now that Auto-Neg has completed.
	 * First, we need to restore the desired flow control
	 * settings because we may have had to re-autoneg with a
	 * different link partner.
	 */
	ret_val = igc_config_fc_after_link_up_generic(hw);
	if (ret_val)
		DEBUGOUT("Error configuring flow control\n");

	return ret_val;
}
/**
 *  igc_check_for_copper_link_generic - Check for link (Copper)
 *  @hw: pointer to the HW structure
 *
 *  Checks to see of the link status of the hardware has changed.  If a
 *  change in link status has been detected, then we read the PHY registers
 *  to get the current speed/duplex if link exists.
 **/
Check for link (Copper)
@hw: pointer to the HW structure

Checks to see of the link status of the hardware has changed.  If a
change in link status has been detected, then we read the PHY registers
to get the current speed/duplex if link exists.
Check for link ( Copper ) @hw : pointer to the HW structure Checks to see of the link status of the hardware has changed . If a change in link status has been detected then we read the PHY registers to get the current speed / duplex if link exists .
s32 igc_check_for_copper_link_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	s32 ret_val;
	bool link;
	DEBUGFUNC("igc_check_for_copper_link");
	if (!mac->get_link_status)
		return IGC_SUCCESS;
	ret_val = igc_phy_has_link_generic(hw, 1, 0, &link);
	if (ret_val)
		return ret_val;
	if (!link)
		return IGC_SUCCESS; 
	mac->get_link_status = false;
	igc_check_downshift_generic(hw);
	if (!mac->autoneg)
		return -IGC_ERR_CONFIG;
	mac->ops.config_collision_dist(hw);
	ret_val = igc_config_fc_after_link_up_generic(hw);
	if (ret_val)
		DEBUGOUT("Error configuring flow control\n");
	return ret_val;
}
s32 igc_check_for_copper_link_generic ( struct igc_hw * hw ) { struct igc_mac_info * mac = & hw -> mac ; s32 ret_val ; bool link ; DEBUGFUNC ( " " ) ; if ( ! mac -> get_link_status ) return IGC_SUCCESS ; ret_val = igc_phy_has_link_generic ( hw , 1 , 0 , & link ) ; if ( ret_val ) return ret_val ; if ( ! link ) return IGC_SUCCESS ; mac -> get_link_status = false ; igc_check_downshift_generic ( hw ) ; if ( ! mac -> autoneg ) return - IGC_ERR_CONFIG ; mac -> ops . config_collision_dist ( hw ) ; ret_val = igc_config_fc_after_link_up_generic ( hw ) ; if ( ret_val ) DEBUGOUT ( " \n " ) ; return ret_val ; }
igc_check_for_copper_link_generic - Check for link (Copper)
  @hw: pointer to the HW structure
igc_check_for_copper_link_generic - Check for link ( Copper ) @hw : pointer to the HW structure
/* We only want to go out to the PHY registers to see if Auto-Neg
	 * has completed and/or if our link status has changed.  The
	 * get_link_status flag is set upon receiving a Link Status
	 * Change or Rx Sequence Error interrupt.
	 */ /* First we want to see if the MII Status Register reports
	 * link.  If so, then we want to get the current speed/duplex
	 * of the PHY.
	 */ /* No link detected */ /* Check if there was DownShift, must be checked
	 * immediately after link-up
	 */ /* If we are forcing speed/duplex, then we simply return since
	 * we have already determined whether we have link or not.
	 */ /* Auto-Neg is enabled.  Auto Speed Detection takes care
	 * of MAC speed/duplex configuration.  So we only need to
	 * configure Collision Distance in the MAC.
	 */ /* Configure Flow Control now that Auto-Neg has completed.
	 * First, we need to restore the desired flow control
	 * settings because we may have had to re-autoneg with a
	 * different link partner.
	 */