diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2010-08-26 18:33:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-08-27 14:36:03 +0200 |
commit | 12f396a8b02e57f579d2863299948b5172ffdf6f (patch) | |
tree | dd354d4cf966925422d20f5796a134d148d39693 /drivers/net/smc91111.c | |
parent | f2283c2057b28d81b9060ba3fde68f24f2eb2922 (diff) | |
download | barebox-12f396a8b02e57f579d2863299948b5172ffdf6f.tar.gz barebox-12f396a8b02e57f579d2863299948b5172ffdf6f.tar.xz |
net: rework the mii support
this rework is done in order to add a phylib and allow to have phy driver support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/smc91111.c')
-rw-r--r-- | drivers/net/smc91111.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c index 58ebaa9b18..605a7d8613 100644 --- a/drivers/net/smc91111.c +++ b/drivers/net/smc91111.c @@ -67,7 +67,7 @@ #include <command.h> #include <net.h> -#include <miiphy.h> +#include <miidev.h> #include <malloc.h> #include <init.h> #include <xfuncs.h> @@ -451,7 +451,7 @@ struct accessors { }; struct smc91c111_priv { - struct miiphy_device miiphy; + struct mii_device miidev; struct accessors a; unsigned long base; }; @@ -621,8 +621,8 @@ static void smc_wait_mmu_release_complete(struct smc91c111_priv *priv) } } -static int smc91c111_phy_write(struct miiphy_device *mdev, uint8_t phyaddr, - uint8_t phyreg, uint16_t phydata) +static int smc91c111_phy_write(struct mii_device *mdev, int phyaddr, + int phyreg, int phydata) { struct eth_device *edev = mdev->edev; struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv; @@ -723,8 +723,7 @@ static int smc91c111_phy_write(struct miiphy_device *mdev, uint8_t phyaddr, return 0; } -static int smc91c111_phy_read(struct miiphy_device *mdev, uint8_t phyaddr, - uint8_t phyreg, uint16_t * val) +static int smc91c111_phy_read(struct mii_device *mdev, int phyaddr, int phyreg) { struct eth_device *edev = mdev->edev; struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv; @@ -827,8 +826,7 @@ static int smc91c111_phy_read(struct miiphy_device *mdev, uint8_t phyaddr, phydata |= 0x0001; } - *val = phydata; - return 0; + return phydata; } static void smc91c111_reset(struct eth_device *edev) @@ -896,8 +894,8 @@ static int smc91c111_eth_open(struct eth_device *edev) struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv; smc91c111_enable(edev); - miiphy_wait_aneg(&priv->miiphy); - miiphy_print_status(&priv->miiphy); + miidev_wait_aneg(&priv->miidev); + miidev_print_status(&priv->miidev); return 0; } @@ -1287,7 +1285,7 @@ static int smc91c111_init_dev(struct eth_device *edev) SMC_SELECT_BANK(priv, 0); SMC_outw(priv, RPC_DEFAULT, RPC_REG); - miiphy_restart_aneg(&priv->miiphy); + miidev_restart_aneg(&priv->miidev); return 0; } @@ -1314,16 +1312,16 @@ static int smc91c111_probe(struct device_d *dev) edev->get_ethaddr = smc91c111_get_ethaddr; edev->set_ethaddr = smc91c111_set_ethaddr; - priv->miiphy.read = smc91c111_phy_read; - priv->miiphy.write = smc91c111_phy_write; - priv->miiphy.address = 0; - priv->miiphy.flags = 0; - priv->miiphy.edev = edev; + priv->miidev.read = smc91c111_phy_read; + priv->miidev.write = smc91c111_phy_write; + priv->miidev.address = 0; + priv->miidev.flags = 0; + priv->miidev.edev = edev; priv->base = dev->map_base; smc91c111_reset(edev); - miiphy_register(&priv->miiphy); + mii_register(&priv->miidev); eth_register(edev); return 0; |