Commit f735a2a1 authored by Tobias Diedrich's avatar Tobias Diedrich Committed by Jeff Garzik

[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: default avatarTobias Diedrich <ranma+kernel@tdiedrich.de>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 2914f3ef
...@@ -5827,8 +5827,23 @@ static int nv_resume(struct pci_dev *pdev) ...@@ -5827,8 +5827,23 @@ static int nv_resume(struct pci_dev *pdev)
out: out:
return rc; 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 #else
#define nv_suspend NULL #define nv_suspend NULL
#define nv_shutdown NULL
#define nv_resume NULL #define nv_resume NULL
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
...@@ -5999,6 +6014,7 @@ static struct pci_driver driver = { ...@@ -5999,6 +6014,7 @@ static struct pci_driver driver = {
.remove = __devexit_p(nv_remove), .remove = __devexit_p(nv_remove),
.suspend = nv_suspend, .suspend = nv_suspend,
.resume = nv_resume, .resume = nv_resume,
.shutdown = nv_shutdown,
}; };
static int __init init_nic(void) static int __init init_nic(void)
......
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