/* return PHY address. If PHY don't fount, returns 255.  */
uint8_t PHY_probe(void)
/* return PHY address. If PHY don't fount, returns 255.  */
uint8_t PHY_probe(void)
{
	uint8_t phy;
	uint8_t phy_found;
	uint16_t reg;
	phy_found = 0;
	for (phy = MSS_PHY_ADDRESS_MIN; phy <= MSS_PHY_ADDRESS_MAX; phy++) {
		g_mss_mac.phy_address = phy;
        reg = MDIO_read( PHYREG_PHYID1R );
        if ((reg != 0x0000ffffUL) && (reg != 0x00000000UL)) {
        	phy_found = 1;
        	phy = MSS_PHY_ADDRESS_MAX + 1;
        }
    }
    if( phy_found == 0 ) {
    	g_mss_mac.phy_address = MSS_PHY_ADDRESS_AUTO_DETECT;
    }
    return g_mss_mac.phy_address;
}