aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c59x.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2005-11-07 03:58:03 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:24 -0500
commit106427e65d2b6f3a519ab5d14a3586007e7e0f20 (patch)
tree97c882ac0ffc0e039b26c0b414fcdf382b31d8fd /drivers/net/3c59x.c
parent62afe595de7aaac6c140103a34dc8c208afa34e7 (diff)
[PATCH] 3c59x: cleanup of mdio_read routines to use MII_* macros
Clean up mdio_read routines in 3c59x.c to use the MII_* macros defined in include/linux/mii.h Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/3c59x.c')
-rw-r--r--drivers/net/3c59x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 2bad41bebd1b..88ce4c43fd4f 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1457,7 +1457,7 @@ static int __devinit vortex_probe1(struct device *gendev,
1457 if (vp->drv_flags & EXTRA_PREAMBLE) 1457 if (vp->drv_flags & EXTRA_PREAMBLE)
1458 mii_preamble_required++; 1458 mii_preamble_required++;
1459 mdio_sync(ioaddr, 32); 1459 mdio_sync(ioaddr, 32);
1460 mdio_read(dev, 24, 1); 1460 mdio_read(dev, 24, MII_BMSR);
1461 for (phy = 0; phy < 32 && phy_idx < 1; phy++) { 1461 for (phy = 0; phy < 32 && phy_idx < 1; phy++) {
1462 int mii_status, phyx; 1462 int mii_status, phyx;
1463 1463
@@ -1471,7 +1471,7 @@ static int __devinit vortex_probe1(struct device *gendev,
1471 phyx = phy - 1; 1471 phyx = phy - 1;
1472 else 1472 else
1473 phyx = phy; 1473 phyx = phy;
1474 mii_status = mdio_read(dev, phyx, 1); 1474 mii_status = mdio_read(dev, phyx, MII_BMSR);
1475 if (mii_status && mii_status != 0xffff) { 1475 if (mii_status && mii_status != 0xffff) {
1476 vp->phys[phy_idx++] = phyx; 1476 vp->phys[phy_idx++] = phyx;
1477 if (print_info) { 1477 if (print_info) {
@@ -1487,7 +1487,7 @@ static int __devinit vortex_probe1(struct device *gendev,
1487 printk(KERN_WARNING" ***WARNING*** No MII transceivers found!\n"); 1487 printk(KERN_WARNING" ***WARNING*** No MII transceivers found!\n");
1488 vp->phys[0] = 24; 1488 vp->phys[0] = 24;
1489 } else { 1489 } else {
1490 vp->advertising = mdio_read(dev, vp->phys[0], 4); 1490 vp->advertising = mdio_read(dev, vp->phys[0], MII_ADVERTISE);
1491 if (vp->full_duplex) { 1491 if (vp->full_duplex) {
1492 /* Only advertise the FD media types. */ 1492 /* Only advertise the FD media types. */
1493 vp->advertising &= ~0x02A0; 1493 vp->advertising &= ~0x02A0;
@@ -1661,8 +1661,8 @@ vortex_up(struct net_device *dev)
1661 int mii_reg1, mii_reg5; 1661 int mii_reg1, mii_reg5;
1662 EL3WINDOW(4); 1662 EL3WINDOW(4);
1663 /* Read BMSR (reg1) only to clear old status. */ 1663 /* Read BMSR (reg1) only to clear old status. */
1664 mii_reg1 = mdio_read(dev, vp->phys[0], 1); 1664 mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
1665 mii_reg5 = mdio_read(dev, vp->phys[0], 5); 1665 mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
1666 if (mii_reg5 == 0xffff || mii_reg5 == 0x0000) { 1666 if (mii_reg5 == 0xffff || mii_reg5 == 0x0000) {
1667 netif_carrier_off(dev); /* No MII device or no link partner report */ 1667 netif_carrier_off(dev); /* No MII device or no link partner report */
1668 } else { 1668 } else {
@@ -1892,14 +1892,14 @@ vortex_timer(unsigned long data)
1892 case XCVR_MII: case XCVR_NWAY: 1892 case XCVR_MII: case XCVR_NWAY:
1893 { 1893 {
1894 spin_lock_bh(&vp->lock); 1894 spin_lock_bh(&vp->lock);
1895 mii_status = mdio_read(dev, vp->phys[0], 1); 1895 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
1896 mii_status = mdio_read(dev, vp->phys[0], 1); 1896 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
1897 ok = 1; 1897 ok = 1;
1898 if (vortex_debug > 2) 1898 if (vortex_debug > 2)
1899 printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n", 1899 printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",
1900 dev->name, mii_status); 1900 dev->name, mii_status);
1901 if (mii_status & BMSR_LSTATUS) { 1901 if (mii_status & BMSR_LSTATUS) {
1902 int mii_reg5 = mdio_read(dev, vp->phys[0], 5); 1902 int mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
1903 if (! vp->force_fd && mii_reg5 != 0xffff) { 1903 if (! vp->force_fd && mii_reg5 != 0xffff) {
1904 int duplex; 1904 int duplex;
1905 1905