[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180718213513.GA23800@lunn.ch>
Date: Wed, 18 Jul 2018 23:35:13 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Bryan Whitehead <Bryan.Whitehead@...rochip.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v3 net-next 6/8] lan743x: Add power management support
> +#ifdef CONFIG_PM
> +static void lan743x_ethtool_get_wol(struct net_device *netdev,
> + struct ethtool_wolinfo *wol)
> +{
> + struct lan743x_adapter *adapter = netdev_priv(netdev);
> +
> + wol->supported = 0;
> + wol->wolopts = 0;
> + phy_ethtool_get_wol(netdev->phydev, wol);
> +
> + wol->supported &= WAKE_BCAST | WAKE_UCAST | WAKE_MCAST |
> + WAKE_MAGIC | WAKE_PHY | WAKE_ARP;
Hi Bryan
Say the PHY set WAKE_MAGICSECURE, because it supports that. This AND
then wipes it out, making the call to phy_ethtool_get_wol() pointless.
In fact, should this AND be an OR?
> +
> +#ifdef CONFIG_PM
> +static int lan743x_ethtool_set_wol(struct net_device *netdev,
> + struct ethtool_wolinfo *wol)
> +{
> + struct lan743x_adapter *adapter = netdev_priv(netdev);
> +
> + if (wol->wolopts & WAKE_MAGICSECURE)
> + return -EOPNOTSUPP;
The PHY might support this. Since you call phy_ethtool_set_wol(), you
should give it the chance.
Andrew
Powered by blists - more mailing lists