/* Acquires semaphore, if necessary, then reads the PHY register at offset and stores the retrieved information in data. Release any acquired semaphores before exiting.  */
static s32 __e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data, bool locked)
/* Acquires semaphore, if necessary, then reads the PHY register at offset and stores the retrieved information in data. Release any acquired semaphores before exiting.  */
static s32 __e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data, bool locked)
{
	s32 ret_val = 0;
	if (!locked) {
		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 = e1000e_write_phy_reg_mdic(hw,
						    IGP01E1000_PHY_PAGE_SELECT,
						    (u16)offset);
		if (ret_val)
			goto release;
	}
	ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
	                                  data);
release:
	if (!locked)
		hw->phy.ops.release(hw);
out:
	return ret_val;
}