backport forcedeth swsusp support

svn path=/dists/trunk/linux-2.6/; revision=7644
This commit is contained in:
maximilian attems 2006-10-24 15:00:29 +00:00
parent db774a63d4
commit e1d6919d80
3 changed files with 69 additions and 1 deletions

3
debian/changelog vendored
View File

@ -19,8 +19,9 @@ linux-2.6 (2.6.18-4) UNRELEASED; urgency=low
[ maximilian attems ]
* Add netpoll leak fix.
* Add sky2 lookup patch for the Marvell 88E803X Yukon-FE chip.
* Add upstream forcedeth swsusp support.
-- maximilian attems <maks@sternwelten.at> Tue, 24 Oct 2006 16:52:12 +0200
-- maximilian attems <maks@sternwelten.at> Tue, 24 Oct 2006 16:59:20 +0200
linux-2.6 (2.6.18-3) unstable; urgency=low

View File

@ -0,0 +1,66 @@
Francois Romieu:
forcedeth: restore network after swsup/resume or ACPI S3
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 35467e0..c41a886 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -4603,6 +4603,47 @@ static void __devexit nv_remove(struct p
pci_set_drvdata(pci_dev, NULL);
}
+
+static int nv_suspend(struct pci_dev *pdev, pm_message_t state)
+{
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct fe_priv *np = netdev_priv(dev);
+ int rc = 0;
+
+ if (!netif_running(dev))
+ goto out;
+
+ netif_device_detach(dev);
+
+ /* Gross. */
+ rc = nv_close(dev);
+
+ pci_save_state(pdev);
+ pci_enable_wake(pdev, pci_choose_state(pdev, state), np->wolenabled);
+ pci_set_power_state(pdev, pci_choose_state(pdev, state));
+out:
+ return rc;
+}
+
+static int nv_resume(struct pci_dev *pdev)
+{
+ struct net_device *dev = pci_get_drvdata(pdev);
+ int rc = 0;
+
+ if (!netif_running(dev))
+ goto out;
+
+ netif_device_attach(dev);
+
+ pci_set_power_state(pdev, PCI_D0);
+ pci_restore_state(pdev);
+ pci_enable_wake(pdev, PCI_D0, 0);
+
+ rc = nv_open(dev);
+out:
+ return rc;
+}
+
static struct pci_device_id pci_tbl[] = {
{ /* nForce Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_1),
@@ -4704,6 +4745,8 @@ static struct pci_driver driver = {
.id_table = pci_tbl,
.probe = nv_probe,
.remove = __devexit_p(nv_remove),
+ .suspend = nv_suspend,
+ .resume = nv_resume,
};

View File

@ -3,3 +3,4 @@
+ bugfix/sparc/compat-alloc-user-space-alignment.patch
+ bugfix/net-netpoll.patch
+ bugfix/net-sky2-lockup.patch
+ features/net-forcedeth-swsusp.patch