while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) { 
while (!emac_phy_done(in_be32(&p->stacr))) { 
static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg){	struct emac_regs *p = dev->emacp;	u32 r;	int n;	DBG2("%d: mdio_read(%02x,%02x)" NL, dev->def->index, id, reg);	/* Enable proper MDIO port */	zmii_enable_mdio(dev->zmii_dev, dev->zmii_input);	/* Wait for management interface to become idle */	n = 10;	while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {		udelay(1);		if (!--n)			goto to;	}	/* Issue read command */	out_be32(&p->stacr,		 EMAC_STACR_BASE(emac_opb_mhz()) | EMAC_STACR_STAC_READ |		 (reg & EMAC_STACR_PRA_MASK)		 | ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT));	/* Wait for read to complete */	n = 100;	while (!((r = in_be32(&p->stacr)) & EMAC_STACR_OC)) {		udelay(1);		if (!--n)			goto to;	}	if (unlikely(r & EMAC_STACR_PHYE)) {		DBG("%d: mdio_read(%02x, %02x) failed" NL, dev->def->index,		    id, reg);		return -EREMOTEIO;	}	r = ((r >> EMAC_STACR_PHYD_SHIFT) & EMAC_STACR_PHYD_MASK);	DBG2("%d: mdio_read -> %04x" NL, dev->def->index, r);	return r;      to:	DBG("%d: MII management interface timeout (read)" NL, dev->def->index);	return -ETIMEDOUT;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7ad8a89c2e8a930a902cb0622956b27796c027e5/ibm_emac_core.c/buggy/drivers/net/ibm_emac/ibm_emac_core.c