Commit 0bcafc42 authored by Andrew Morton's avatar Andrew Morton Committed by Jeff Garzik

[PATCH] EMAC: fix ibm_emac autonegotiation result parsing

From: Matt Porter <mporter@kernel.crashing.org>

Fix aneg result parsing in ibm_emac driver.
Signed-off-by: default avatarEugene Surovegin <ebs@ebshome.net>
Signed-off-by: default avatarMatt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 87475e1f
...@@ -191,17 +191,18 @@ static int genmii_read_link(struct mii_phy *phy) ...@@ -191,17 +191,18 @@ static int genmii_read_link(struct mii_phy *phy)
u16 lpa; u16 lpa;
if (phy->autoneg) { if (phy->autoneg) {
lpa = phy_read(phy, MII_LPA); lpa = phy_read(phy, MII_LPA) & phy_read(phy, MII_ADVERTISE);
if (lpa & (LPA_10FULL | LPA_100FULL)) phy->speed = SPEED_10;
phy->duplex = DUPLEX_FULL; phy->duplex = DUPLEX_HALF;
else
phy->duplex = DUPLEX_HALF;
if (lpa & (LPA_100FULL | LPA_100HALF))
phy->speed = SPEED_100;
else
phy->speed = SPEED_10;
phy->pause = 0; phy->pause = 0;
if (lpa & (LPA_100FULL | LPA_100HALF)) {
phy->speed = SPEED_100;
if (lpa & LPA_100FULL)
phy->duplex = DUPLEX_FULL;
} else if (lpa & LPA_10FULL)
phy->duplex = DUPLEX_FULL;
} }
/* On non-aneg, we assume what we put in BMCR is the speed, /* On non-aneg, we assume what we put in BMCR is the speed,
* though magic-aneg shouldn't prevent this case from occurring * though magic-aneg shouldn't prevent this case from occurring
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment