diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-03 10:44:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-03 10:44:01 -0500 |
commit | a84216e671c724e0920dfad2fb70828d428ff60a (patch) | |
tree | a39f53715c73d267d854653dfe275da5fc60e842 /drivers/net/e100.c | |
parent | 1836d95928a0f41ada0cbb2a6c4e46b027db9491 (diff) | |
parent | bcfe3c2046fc4f16544f2b127f1b159dd1fcad8b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
mac80211: check interface is down before type change
cfg80211: fix NULL ptr deref
libertas if_usb: Fix crash on 64-bit machines
mac80211: fix reason code output endianness
mac80211: fix addba timer
ath9k: fix misplaced semicolon on rate control
b43: Fix DMA TX bounce buffer copying
mac80211: fix BSS leak
rt73usb.c : more ids
ipw2200: fix oops on missing firmware
gre: Fix dev_addr clobbering for gretap
sky2: set carrier off in probe
net: fix sk_forward_alloc corruption
pcnet_cs: add cis of PreMax PE-200 ethernet pcmcia card
r8169: Fix card drop incoming VLAN tagged MTU byte large jumbo frames
ibmtr: possible Read buffer overflow?
net: Fix RPF to work with policy routing
net: fix kmemcheck annotations
e1000e: rework disable K1 at 1000Mbps for 82577/82578
e1000e: config PHY via software after resets
...
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r-- | drivers/net/e100.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 5d2f48f02251..3c29a20b751e 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -1427,19 +1427,31 @@ static int e100_phy_init(struct nic *nic) | |||
1427 | } else | 1427 | } else |
1428 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); | 1428 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); |
1429 | 1429 | ||
1430 | /* Isolate all the PHY ids */ | ||
1431 | for (addr = 0; addr < 32; addr++) | ||
1432 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | ||
1433 | /* Select the discovered PHY */ | ||
1434 | bmcr &= ~BMCR_ISOLATE; | ||
1435 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); | ||
1436 | |||
1437 | /* Get phy ID */ | 1430 | /* Get phy ID */ |
1438 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); | 1431 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); |
1439 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); | 1432 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); |
1440 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; | 1433 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; |
1441 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); | 1434 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); |
1442 | 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 | |||
1443 | /* Handle National tx phys */ | 1455 | /* Handle National tx phys */ |
1444 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF | 1456 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF |
1445 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { | 1457 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { |