/* Configures collision distance and flow control for fiber and serdes links. Upon successful setup, poll for link.  */
s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
/* Configures collision distance and flow control for fiber and serdes links. Upon successful setup, poll for link.  */
s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
{
	u32 ctrl;
	s32 ret_val;
	ctrl = er32(CTRL);
	ctrl &= ~E1000_CTRL_LRST;
	e1000e_config_collision_dist(hw);
	ret_val = e1000_commit_fc_settings_generic(hw);
	if (ret_val)
		return ret_val;
	e_dbg("Auto-negotiation enabled\n");
	ew32(CTRL, ctrl);
	e1e_flush();
	msleep(1);
	if (hw->phy.media_type == e1000_media_type_internal_serdes ||
	    (er32(CTRL) & E1000_CTRL_SWDPIN1)) {
		ret_val = e1000_poll_fiber_serdes_link_generic(hw);
	} else {
		e_dbg("No signal detected\n");
	}
	return 0;
}