diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/forcedeth.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index a7e7be7ed705..d9b7345198c4 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2492,17 +2492,19 @@ static int nv_set_wol(struct net_device *dev, struct ethtool_wolinfo *wolinfo) | |||
2492 | { | 2492 | { |
2493 | struct fe_priv *np = netdev_priv(dev); | 2493 | struct fe_priv *np = netdev_priv(dev); |
2494 | u8 __iomem *base = get_hwbase(dev); | 2494 | u8 __iomem *base = get_hwbase(dev); |
2495 | u32 flags = 0; | ||
2495 | 2496 | ||
2496 | spin_lock_irq(&np->lock); | ||
2497 | if (wolinfo->wolopts == 0) { | 2497 | if (wolinfo->wolopts == 0) { |
2498 | writel(0, base + NvRegWakeUpFlags); | ||
2499 | np->wolenabled = 0; | 2498 | np->wolenabled = 0; |
2500 | } | 2499 | } else if (wolinfo->wolopts & WAKE_MAGIC) { |
2501 | if (wolinfo->wolopts & WAKE_MAGIC) { | ||
2502 | writel(NVREG_WAKEUPFLAGS_ENABLE, base + NvRegWakeUpFlags); | ||
2503 | np->wolenabled = 1; | 2500 | np->wolenabled = 1; |
2501 | flags = NVREG_WAKEUPFLAGS_ENABLE; | ||
2502 | } | ||
2503 | if (netif_running(dev)) { | ||
2504 | spin_lock_irq(&np->lock); | ||
2505 | writel(flags, base + NvRegWakeUpFlags); | ||
2506 | spin_unlock_irq(&np->lock); | ||
2504 | } | 2507 | } |
2505 | spin_unlock_irq(&np->lock); | ||
2506 | return 0; | 2508 | return 0; |
2507 | } | 2509 | } |
2508 | 2510 | ||
@@ -3284,7 +3286,8 @@ static int nv_open(struct net_device *dev) | |||
3284 | base + NvRegAdapterControl); | 3286 | base + NvRegAdapterControl); |
3285 | writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed); | 3287 | writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed); |
3286 | writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4); | 3288 | writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4); |
3287 | writel(NVREG_WAKEUPFLAGS_VAL, base + NvRegWakeUpFlags); | 3289 | if (np->wolenabled) |
3290 | writel(NVREG_WAKEUPFLAGS_ENABLE , base + NvRegWakeUpFlags); | ||
3288 | 3291 | ||
3289 | i = readl(base + NvRegPowerState); | 3292 | i = readl(base + NvRegPowerState); |
3290 | if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) | 3293 | if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) |