[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90A7E81AE28BAE4CBDDB3B35F187D2644073B198@CHN-SV-EXMX02.mchp-main.com>
Date: Wed, 18 Jul 2018 21:55:24 +0000
From: <Bryan.Whitehead@...rochip.com>
To: <andrew@...n.ch>
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?
Hi Andrew,
I assumed that "supported" means that it is supported by both the phy and mac driver, which is why I used the AND operator.
Am I mistaken? Is WAKE_MAGICSECURE a special case not requiring mac driver support?
>
> > +
> > +#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.
>
Again, does WAKE_MAGICSECURE require mac driver support?
If so then it does not matter if the phy driver supports it.
If I misunderstand, can you explain, or direct me to documents.
Thanks,
Bryan
Powered by blists - more mailing lists