dsa: slave: eee: Allow ports to use phylink [Linux 4.18]

This Linux kernel change "dsa: slave: eee: Allow ports to use phylink" is included in the Linux 4.18 release. This change is authored by Andrew Lunn <andrew [at] lunn.ch> on Wed Aug 8 20:56:40 2018 +0200. The commit for this change in Linux stable tree is 1be52e9 (patch).

dsa: slave: eee: Allow ports to use phylink

For a port to be able to use EEE, both the MAC and the PHY must
support EEE. A phy can be provided by both a phydev or phylink. Verify
at least one of these exist, not just phydev.

Fixes: aab9c4067d23 ("net: dsa: Plug in PHYLINK support")
Signed-off-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/dsa/slave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 732369c..9864bcd 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -639,7 +639,7 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
    int ret;

    /* Port's PHY and MAC both need to be EEE capable */
-   if (!dev->phydev)
+   if (!dev->phydev && !dp->pl)
        return -ENODEV;

    if (!ds->ops->set_mac_eee)
@@ -659,7 +659,7 @@ static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e)
    int ret;

    /* Port's PHY and MAC both need to be EEE capable */
-   if (!dev->phydev)
+   if (!dev->phydev && !dp->pl)
        return -ENODEV;

    if (!ds->ops->get_mac_eee)

Leave a Reply

Your email address will not be published. Required fields are marked *