/* 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 e1000e_check_for_copper_link(struct e1000_hw *hw)
/* 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 e1000e_check_for_copper_link(struct e1000_hw *hw)
{
	struct e1000_mac_info *mac = &hw->mac;
	s32 ret_val;
	bool link;
	if (!mac->get_link_status)
		return 0;
	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
	if (ret_val)
		return ret_val;
	if (!link)
		return ret_val;
	mac->get_link_status = false;
	e1000e_check_downshift(hw);
	if (!mac->autoneg) {
		ret_val = -E1000_ERR_CONFIG;
		return ret_val;
	}
	e1000e_config_collision_dist(hw);
	ret_val = e1000e_config_fc_after_link_up(hw);
	if (ret_val) {
		e_dbg("Error configuring flow control\n");
	}
	return ret_val;
}