/* Caller must hold the ioc3_lock ever for MII readers. This is also used to protect the transmitter side but it's low contention.  */
static int ioc3_mdio_read(struct net_device *dev, int phy, int reg)
/* Caller must hold the ioc3_lock ever for MII readers. This is also used to protect the transmitter side but it's low contention.  */
static int ioc3_mdio_read(struct net_device *dev, int phy, int reg)
{
	struct ioc3_private *ip = netdev_priv(dev);
	struct ioc3 *ioc3 = ip->regs;
	while (ioc3_r_micr() & MICR_BUSY);
	ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG);
	while (ioc3_r_micr() & MICR_BUSY);
	return ioc3_r_midr_r() & MIDR_DATA_MASK;
}