aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-07-14 20:28:47 -0400
committerLennert Buytenhek <buytenh@marvell.com>2008-07-24 00:22:58 -0400
commit7f106c1d050c085c84d148ba56293e60b2c4e756 (patch)
tree6816788bfa3b97628be74bf43eba31001132e93e /drivers/net/mv643xx_eth.c
parentcd4ccf76bfd2c36d351e68be7e6a597268f98a1a (diff)
mv643xx_eth: use symbolic MII register addresses and values
Instead of hardcoding MII register addresses and values, use the symbolic constants defined in linux/mii.h. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 9d200568d88a..5bed6b33c7bc 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1831,14 +1831,14 @@ static void phy_reset(struct mv643xx_eth_private *mp)
1831{ 1831{
1832 unsigned int data; 1832 unsigned int data;
1833 1833
1834 smi_reg_read(mp, mp->phy_addr, 0, &data); 1834 smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
1835 data |= 0x8000; 1835 data |= BMCR_RESET;
1836 smi_reg_write(mp, mp->phy_addr, 0, data); 1836 smi_reg_write(mp, mp->phy_addr, MII_BMCR, data);
1837 1837
1838 do { 1838 do {
1839 udelay(1); 1839 udelay(1);
1840 smi_reg_read(mp, mp->phy_addr, 0, &data); 1840 smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
1841 } while (data & 0x8000); 1841 } while (data & BMCR_RESET);
1842} 1842}
1843 1843
1844static void port_start(struct mv643xx_eth_private *mp) 1844static void port_start(struct mv643xx_eth_private *mp)
@@ -2385,14 +2385,14 @@ static int phy_detect(struct mv643xx_eth_private *mp)
2385 unsigned int data; 2385 unsigned int data;
2386 unsigned int data2; 2386 unsigned int data2;
2387 2387
2388 smi_reg_read(mp, mp->phy_addr, 0, &data); 2388 smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data);
2389 smi_reg_write(mp, mp->phy_addr, 0, data ^ 0x1000); 2389 smi_reg_write(mp, mp->phy_addr, MII_BMCR, data ^ BMCR_ANENABLE);
2390 2390
2391 smi_reg_read(mp, mp->phy_addr, 0, &data2); 2391 smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data2);
2392 if (((data ^ data2) & 0x1000) == 0) 2392 if (((data ^ data2) & BMCR_ANENABLE) == 0)
2393 return -ENODEV; 2393 return -ENODEV;
2394 2394
2395 smi_reg_write(mp, mp->phy_addr, 0, data); 2395 smi_reg_write(mp, mp->phy_addr, MII_BMCR, data);
2396 2396
2397 return 0; 2397 return 0;
2398} 2398}