]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
phy: Use supported field during autonegotiation
authorDavid Dueck <davidcdueck@googlemail.com>
Tue, 5 Nov 2013 16:23:02 +0000 (17:23 +0100)
committerJoe Hershberger <joe.hershberger@ni.com>
Fri, 22 Nov 2013 23:03:20 +0000 (17:03 -0600)
The current code incorrectly detects gigabit capabilities for some
100Mbit/s phys. (lan8720a)

Signed-off-by: David Dueck <davidcdueck@googlemail.com>
drivers/net/phy/phy.c

index 62925bb2863225056d414c3283fc94a534d8f1b0..c691fbbbc61b6e15cb97e3ef85e7cd47fd6f1edf 100644 (file)
@@ -275,13 +275,14 @@ int genphy_parse_link(struct phy_device *phydev)
        int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
 
        /* We're using autonegotiation */
-       if (mii_reg & BMSR_ANEGCAPABLE) {
+       if (phydev->supported & SUPPORTED_Autoneg) {
                u32 lpa = 0;
                int gblpa = 0;
                u32 estatus = 0;
 
                /* Check for gigabit capability */
-               if (mii_reg & BMSR_ERCAP) {
+               if (phydev->supported & (SUPPORTED_1000baseT_Full |
+                                       SUPPORTED_1000baseT_Half)) {
                        /* We want a list of states supported by
                         * both PHYs in the link
                         */