summaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+kernel@tdiedrich.de>2008-05-18 15:02:37 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-05-30 22:18:49 -0400
commitf735a2a1a4f2a0f5cd823ce323e82675990469e2 (patch)
treeff5c6351b31252903fbf318c283e9686c9a11aeb /drivers/net/forcedeth.c
parent2914f3efa7ef80f12ff798cb1aa46af57838f912 (diff)
[netdrvr] forcedeth: setup wake-on-lan before shutting down
When hibernating in 'shutdown' mode, after saving the image the suspend hook is not called again. However, if the device is in promiscous mode, wake-on-lan will not work. This adds a shutdown hook to setup wake-on-lan before the final shutdown. Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 9eca97fb0a5..215d27bbeff 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5827,8 +5827,23 @@ static int nv_resume(struct pci_dev *pdev)
out:
return rc;
}
+
+static void nv_shutdown(struct pci_dev *pdev)
+{
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct fe_priv *np = netdev_priv(dev);
+
+ if (netif_running(dev))
+ nv_close(dev);
+
+ pci_enable_wake(pdev, PCI_D3hot, np->wolenabled);
+ pci_enable_wake(pdev, PCI_D3cold, np->wolenabled);
+ pci_disable_device(pdev);
+ pci_set_power_state(pdev, PCI_D3hot);
+}
#else
#define nv_suspend NULL
+#define nv_shutdown NULL
#define nv_resume NULL
#endif /* CONFIG_PM */
@@ -5999,6 +6014,7 @@ static struct pci_driver driver = {
.remove = __devexit_p(nv_remove),
.suspend = nv_suspend,
.resume = nv_resume,
+ .shutdown = nv_shutdown,
};
static int __init init_nic(void)