[PATCH 2/2] net/forcedeth: add wol p support
From: Karol Herbst
Date: Thu Mar 10 2016 - 10:04:00 EST
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@xxxxxxxxxxxxxx>
---
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