Commit 3a530d1b3e947c09e882dda8883aa608458a598c
Committed by
Joe Hershberger
1 parent
c583ee16cb
Exists in
master
and in
50 other branches
phy: Use supported field during autonegotiation
The current code incorrectly detects gigabit capabilities for some 100Mbit/s phys. (lan8720a) Signed-off-by: David Dueck <davidcdueck@googlemail.com>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
drivers/net/phy/phy.c
... | ... | @@ -275,13 +275,14 @@ |
275 | 275 | int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); |
276 | 276 | |
277 | 277 | /* We're using autonegotiation */ |
278 | - if (mii_reg & BMSR_ANEGCAPABLE) { | |
278 | + if (phydev->supported & SUPPORTED_Autoneg) { | |
279 | 279 | u32 lpa = 0; |
280 | 280 | int gblpa = 0; |
281 | 281 | u32 estatus = 0; |
282 | 282 | |
283 | 283 | /* Check for gigabit capability */ |
284 | - if (mii_reg & BMSR_ERCAP) { | |
284 | + if (phydev->supported & (SUPPORTED_1000baseT_Full | | |
285 | + SUPPORTED_1000baseT_Half)) { | |
285 | 286 | /* We want a list of states supported by |
286 | 287 | * both PHYs in the link |
287 | 288 | */ |