Commit bbbd317e authored by Pavel Machek's avatar Pavel Machek Committed by Jeff Garzik

[PATCH] swsuspend for ne2k-pci cards

Author: Éric Brunet <Eric.Brunet@lps.ens.fr>
parent 980b00f6
......@@ -653,12 +653,43 @@ static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
pci_set_drvdata(pdev, NULL);
}
#ifdef CONFIG_PM
static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
{
struct net_device *dev = pci_get_drvdata (pdev);
netif_device_detach(dev);
pci_save_state(pdev, pdev->saved_config_space);
pci_set_power_state(pdev, state);
return 0;
}
static int ne2k_pci_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
pci_set_power_state(pdev, 0);
pci_restore_state(pdev, pdev->saved_config_space);
NS8390_init(dev, 1);
netif_device_attach(dev);
return 0;
}
#endif /* CONFIG_PM */
static struct pci_driver ne2k_driver = {
.name = DRV_NAME,
.probe = ne2k_pci_init_one,
.remove = __devexit_p(ne2k_pci_remove_one),
.id_table = ne2k_pci_tbl,
#ifdef CONFIG_PM
.suspend = ne2k_pci_suspend,
.resume = ne2k_pci_resume,
#endif /* CONFIG_PM */
};
......
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