diff options
Diffstat (limited to 'drivers/net/4xx_enet.c')
-rw-r--r-- | drivers/net/4xx_enet.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index bc52ed35cc..b71848168a 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -283,10 +283,9 @@ static void mal_err (struct eth_device *dev, unsigned long isr, static void emac_err (struct eth_device *dev, unsigned long isr); extern int phy_setup_aneg (char *devname, unsigned char addr); -extern int emac4xx_miiphy_read (const char *devname, unsigned char addr, - unsigned char reg, unsigned short *value); -extern int emac4xx_miiphy_write (const char *devname, unsigned char addr, - unsigned char reg, unsigned short value); +int emac4xx_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg); +int emac4xx_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg, + u16 value); int board_emac_count(void); @@ -2015,8 +2014,17 @@ int ppc_4xx_eth_initialize (bd_t * bis) eth_register(dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) - miiphy_register(dev->name, - emac4xx_miiphy_read, emac4xx_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); + mdiodev->read = emac4xx_miiphy_read; + mdiodev->write = emac4xx_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; #endif if (0 == virgin) { |