/* Polls the PHY status register for link, 'iterations' number of times.  */
s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, u32 usec_interval, bool *success)
/* Polls the PHY status register for link, 'iterations' number of times.  */
s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, u32 usec_interval, bool *success)
{
	s32 ret_val = 0;
	u16 i, phy_status;
	for (i = 0; i < iterations; i++) {
		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
		if (ret_val)
			udelay(usec_interval);
		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
		if (ret_val)
			break;
		if (phy_status & MII_SR_LINK_STATUS)
			break;
		if (usec_interval >= 1000)
			mdelay(usec_interval/1000);
		else
			udelay(usec_interval);
	}
	*success = (i < iterations);
	return ret_val;
}