/* Read value stored in a PHY register. Note: MDI interface is assumed to already have been enabled.  */
static void read_phy(unsigned char phy_addr, unsigned char address, unsigned int *value)
/* Read value stored in a PHY register. Note: MDI interface is assumed to already have been enabled.  */
static void read_phy(unsigned char phy_addr, unsigned char address, unsigned int *value)
{
	at91_emac_write(AT91_EMAC_MAN, AT91_EMAC_MAN_802_3 | AT91_EMAC_RW_R
		| ((phy_addr & 0x1f) << 23) | (address << 18));
	at91_phy_wait();
	*value = at91_emac_read(AT91_EMAC_MAN) & AT91_EMAC_DATA;
}