/* Reads the PHY registers and stores the PHY ID and possibly the PHY revision in the hardware structure.  */
s32 igb_get_phy_id(struct e1000_hw *hw)
/* Reads the PHY registers and stores the PHY ID and possibly the PHY revision in the hardware structure.  */
s32 igb_get_phy_id(struct e1000_hw *hw)
{
	struct e1000_phy_info *phy = &hw->phy;
	s32 ret_val = 0;
	u16 phy_id;
	ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
	if (ret_val)
		goto out;
	phy->id = (u32)(phy_id << 16);
	udelay(20);
	ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
	if (ret_val)
		goto out;
	phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
	phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
out:
	return ret_val;
}