netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karol Herbst <git@karolherbst.de>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/2] net/forcedeth: add wol p support
Date: Thu, 10 Mar 2016 17:13:24 +0100 (CET)	[thread overview]
Message-ID: <184411394.167711.1457626404184.JavaMail.open-xchange@www.ud-mail.de> (raw)
In-Reply-To: <1457621884-2479-3-git-send-email-git@karolherbst.de>

one note though:

I am not _really_ sure it is the right flag. I've contacted somebody at nvidia
and asked for documentation regarding this mmio reg.

I still get some random wakeups and I don't know where they are comming from.

> Karol Herbst <git@karolherbst.de> hat am 10. März 2016 um 15:58 geschrieben:
> 
> 
> REd on my mac mini. No idea if that also works on other ethernet cards
> supported by forcedeth, but I doubt anybody cares at all, otherwise somebody
> else would have REd it already.
> 
> Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
> ---
>  drivers/net/ethernet/nvidia/forcedeth.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c
> b/drivers/net/ethernet/nvidia/forcedeth.c
> index bdce33b..8e4e894 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -291,6 +291,7 @@ enum {
>  #define NVREG_WAKEUPFLAGS_ACCEPT_WAKEUPPAT	0x02
>  #define NVREG_WAKEUPFLAGS_ACCEPT_LINKCHANGE	0x04
>  #define NVREG_WAKEUPFLAGS_ENABLE_G	0x01111
> +#define NVREG_WAKEUPFLAGS_ENABLE_P	0x12000
>  
>  	NvRegMgmtUnitGetVersion = 0x204,
>  #define NVREG_MGMTUNITGETVERSION	0x01
> @@ -4216,12 +4217,14 @@ static void nv_get_drvinfo(struct net_device *dev,
> struct ethtool_drvinfo *info)
>  static void nv_get_wol(struct net_device *dev, struct ethtool_wolinfo
> *wolinfo)
>  {
>  	struct fe_priv *np = netdev_priv(dev);
> -	wolinfo->supported = WAKE_MAGIC;
> +	wolinfo->supported = WAKE_MAGIC | WAKE_PHY;
>  
>  	spin_lock_irq(&np->lock);
>  	wolinfo->wolopts = 0;
>  	if (np->wolenabled & WAKE_MAGIC)
>  		wolinfo->wolopts |= WAKE_MAGIC;
> +	if (np->wolenabled & WAKE_PHY)
> +		wolinfo->wolopts |= WAKE_PHY;
>  	spin_unlock_irq(&np->lock);
>  }
>  
> @@ -4236,6 +4239,10 @@ static int nv_set_wol(struct net_device *dev, struct
> ethtool_wolinfo *wolinfo)
>  		np->wolenabled |= WAKE_MAGIC;
>  		np->wol_flags |= NVREG_WAKEUPFLAGS_ENABLE_G;
>  	}
> +	if (wolinfo->wolopts & WAKE_PHY) {
> +		np->wolenabled |= WAKE_PHY;
> +		np->wol_flags |= NVREG_WAKEUPFLAGS_ENABLE_P;
> +	}
>  	if (netif_running(dev)) {
>  		spin_lock_irq(&np->lock);
>  		writel(np->wol_flags, base + NvRegWakeUpFlags);
> -- 
> 2.7.2
>

      reply	other threads:[~2016-03-10 16:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 14:58 [PATCH 0/2] drivers/net/forcedeth: add support for WAKE_PHY Karol Herbst
2016-03-10 14:58 ` [PATCH 1/2] net/forcedeth: refactor wol support to make it easier to add more wol modes Karol Herbst
2016-03-14  2:14   ` David Miller
2016-03-10 14:58 ` [PATCH 2/2] net/forcedeth: add wol p support Karol Herbst
2016-03-10 16:13   ` Karol Herbst [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=184411394.167711.1457626404184.JavaMail.open-xchange@www.ud-mail.de \
    --to=git@karolherbst.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).