From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH v3 net-next 6/8] lan743x: Add power management support Date: Wed, 18 Jul 2018 23:35:13 +0200 Message-ID: <20180718213513.GA23800@lunn.ch> References: <1531947878-9758-1-git-send-email-Bryan.Whitehead@microchip.com> <1531947878-9758-7-git-send-email-Bryan.Whitehead@microchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com To: Bryan Whitehead Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:39167 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729235AbeGRWPF (ORCPT ); Wed, 18 Jul 2018 18:15:05 -0400 Content-Disposition: inline In-Reply-To: <1531947878-9758-7-git-send-email-Bryan.Whitehead@microchip.com> Sender: netdev-owner@vger.kernel.org List-ID: > +#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