diff options
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r-- | drivers/net/e100.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 679965c2bb8..3c29a20b751 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -151,6 +151,7 @@ | |||
151 | #include <linux/moduleparam.h> | 151 | #include <linux/moduleparam.h> |
152 | #include <linux/kernel.h> | 152 | #include <linux/kernel.h> |
153 | #include <linux/types.h> | 153 | #include <linux/types.h> |
154 | #include <linux/sched.h> | ||
154 | #include <linux/slab.h> | 155 | #include <linux/slab.h> |
155 | #include <linux/delay.h> | 156 | #include <linux/delay.h> |
156 | #include <linux/init.h> | 157 | #include <linux/init.h> |
@@ -1426,19 +1427,31 @@ static int e100_phy_init(struct nic *nic) | |||
1426 | } else | 1427 | } else |
1427 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); | 1428 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); |
1428 | 1429 | ||
1429 | /* Isolate all the PHY ids */ | ||
1430 | for (addr = 0; addr < 32; addr++) | ||
1431 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | ||
1432 | /* Select the discovered PHY */ | ||
1433 | bmcr &= ~BMCR_ISOLATE; | ||
1434 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); | ||
1435 | |||
1436 | /* Get phy ID */ | 1430 | /* Get phy ID */ |
1437 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); | 1431 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); |
1438 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); | 1432 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); |
1439 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; | 1433 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; |
1440 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); | 1434 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); |
1441 | 1435 | ||
1436 | /* Select the phy and isolate the rest */ | ||
1437 | for (addr = 0; addr < 32; addr++) { | ||
1438 | if (addr != nic->mii.phy_id) { | ||
1439 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | ||
1440 | } else if (nic->phy != phy_82552_v) { | ||
1441 | bmcr = mdio_read(netdev, addr, MII_BMCR); | ||
1442 | mdio_write(netdev, addr, MII_BMCR, | ||
1443 | bmcr & ~BMCR_ISOLATE); | ||
1444 | } | ||
1445 | } | ||
1446 | /* | ||
1447 | * Workaround for 82552: | ||
1448 | * Clear the ISOLATE bit on selected phy_id last (mirrored on all | ||
1449 | * other phy_id's) using bmcr value from addr discovery loop above. | ||
1450 | */ | ||
1451 | if (nic->phy == phy_82552_v) | ||
1452 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, | ||
1453 | bmcr & ~BMCR_ISOLATE); | ||
1454 | |||
1442 | /* Handle National tx phys */ | 1455 | /* Handle National tx phys */ |
1443 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF | 1456 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF |
1444 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { | 1457 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { |