Commit c42d9df9 authored by Ayaz Abdulla's avatar Ayaz Abdulla Committed by Jeff Garzik

[PATCH] forcedeth config: wol

This patch fixes configuration bugs when modifying wol settings.
Signed-Off-By: default avatarAyaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f9430a01
...@@ -2492,17 +2492,19 @@ static int nv_set_wol(struct net_device *dev, struct ethtool_wolinfo *wolinfo) ...@@ -2492,17 +2492,19 @@ static int nv_set_wol(struct net_device *dev, struct ethtool_wolinfo *wolinfo)
{ {
struct fe_priv *np = netdev_priv(dev); struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev); u8 __iomem *base = get_hwbase(dev);
u32 flags = 0;
spin_lock_irq(&np->lock);
if (wolinfo->wolopts == 0) { if (wolinfo->wolopts == 0) {
writel(0, base + NvRegWakeUpFlags);
np->wolenabled = 0; np->wolenabled = 0;
} } else if (wolinfo->wolopts & WAKE_MAGIC) {
if (wolinfo->wolopts & WAKE_MAGIC) {
writel(NVREG_WAKEUPFLAGS_ENABLE, base + NvRegWakeUpFlags);
np->wolenabled = 1; np->wolenabled = 1;
flags = NVREG_WAKEUPFLAGS_ENABLE;
}
if (netif_running(dev)) {
spin_lock_irq(&np->lock);
writel(flags, base + NvRegWakeUpFlags);
spin_unlock_irq(&np->lock);
} }
spin_unlock_irq(&np->lock);
return 0; return 0;
} }
...@@ -3284,7 +3286,8 @@ static int nv_open(struct net_device *dev) ...@@ -3284,7 +3286,8 @@ static int nv_open(struct net_device *dev)
base + NvRegAdapterControl); base + NvRegAdapterControl);
writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed); writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed);
writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4); writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4);
writel(NVREG_WAKEUPFLAGS_VAL, base + NvRegWakeUpFlags); if (np->wolenabled)
writel(NVREG_WAKEUPFLAGS_ENABLE , base + NvRegWakeUpFlags);
i = readl(base + NvRegPowerState); i = readl(base + NvRegPowerState);
if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment