/* Acquires semaphore, if necessary, then reads the PHY register at offset and storing the retrieved information in data. Release any acquired semaphores before exiting.  */
s32 igb_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
/* Acquires semaphore, if necessary, then reads the PHY register at offset and storing the retrieved information in data. Release any acquired semaphores before exiting.  */
s32 igb_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
{
	s32 ret_val = 0;
	if (!(hw->phy.ops.acquire))
		goto out;
	ret_val = hw->phy.ops.acquire(hw);
	if (ret_val)
		goto out;
	if (offset > MAX_PHY_MULTI_PAGE_REG) {
		ret_val = igb_write_phy_reg_mdic(hw,
						   IGP01E1000_PHY_PAGE_SELECT,
						   (u16)offset);
		if (ret_val) {
			hw->phy.ops.release(hw);
			goto out;
		}
	}
	ret_val = igb_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
					data);
	hw->phy.ops.release(hw);
out:
	return ret_val;
}