Merge remote-tracking branches 'asoc/fix/tlv320aic3x' and 'asoc/fix/wm8962' into...
[linux-drm-fsl-dcu.git] / drivers / net / phy / marvell.c
index e6897b6a8a53190dd0cea06d863fb88f397fd197..5de8d5827536b1c196b4dabe95f3815964dd0296 100644 (file)
@@ -785,6 +785,7 @@ static int marvell_read_status(struct phy_device *phydev)
        int adv;
        int err;
        int lpa;
+       int lpagb;
        int status = 0;
 
        /* Update the link, but return if there
@@ -802,10 +803,17 @@ static int marvell_read_status(struct phy_device *phydev)
                if (lpa < 0)
                        return lpa;
 
+               lpagb = phy_read(phydev, MII_STAT1000);
+               if (lpagb < 0)
+                       return lpagb;
+
                adv = phy_read(phydev, MII_ADVERTISE);
                if (adv < 0)
                        return adv;
 
+               phydev->lp_advertising = mii_stat1000_to_ethtool_lpa_t(lpagb) |
+                                        mii_lpa_to_ethtool_lpa_t(lpa);
+
                lpa &= adv;
 
                if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
@@ -853,6 +861,7 @@ static int marvell_read_status(struct phy_device *phydev)
                        phydev->speed = SPEED_10;
 
                phydev->pause = phydev->asym_pause = 0;
+               phydev->lp_advertising = 0;
        }
 
        return 0;