public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] suspend/resume for the b44 driver
       [not found]     ` <20030917115048.GA2598@ee.oulu.fi>
@ 2003-09-21  7:41       ` Nicolae Mihalache
  0 siblings, 0 replies; only message in thread
From: Nicolae Mihalache @ 2003-09-21  7:41 UTC (permalink / raw)
  To: Pekka Pietikainen; +Cc: davem, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

Hello,

This patch adds suspend/resume support for the Broadcom 4400 network 
card. It has been tested with 2.6.0-test5-mm1 with suspend to disk 
(suspend to ram does not work even without b44).


mache



[-- Attachment #2: b44.patch --]
[-- Type: text/plain, Size: 1263 bytes --]

--- b44.c.orig	2003-09-20 21:10:13.168315056 +0200
+++ b44.c	2003-09-20 21:13:54.567657240 +0200
@@ -1859,11 +1859,57 @@
 	}
 }
 
+#ifdef CONFIG_PM
+static int b44_suspend(struct pci_dev *pdev, u32 state)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+	struct b44 *bp = dev->priv;
+
+        if (!netif_running(dev))
+                 return 0;
+
+	del_timer_sync(&bp->timer);
+
+	spin_lock_irq(&bp->lock); 
+
+	b44_halt(bp);
+	netif_carrier_off(bp->dev); 
+	netif_device_detach(bp->dev);
+	b44_free_rings(bp);
+
+	spin_unlock_irq(&bp->lock);
+	return 0;
+}
+
+static int b44_resume(struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+	struct b44 *bp = dev->priv;
+
+	if (!netif_running(dev))
+		return 0;
+
+	spin_lock_irq(&bp->lock);
+
+	b44_init_rings(bp);
+	b44_init_hw(bp);
+	netif_device_attach(bp->dev);
+	spin_unlock_irq(&bp->lock);
+
+	b44_enable_ints(bp);
+	return 0;
+}
+#endif /* CONFIG_PM */
+
 static struct pci_driver b44_driver = {
 	.name		= DRV_MODULE_NAME,
 	.id_table	= b44_pci_tbl,
 	.probe		= b44_init_one,
 	.remove		= __devexit_p(b44_remove_one),
+#ifdef CONFIG_PM
+        .suspend        = b44_suspend,
+        .resume         = b44_resume,
+#endif /* CONFIG_PM */
 };
 
 static int __init b44_init(void)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-21  7:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3F6783D9.4070702@abcpages.com>
     [not found] ` <20030917100856.GA29368@ee.oulu.fi>
     [not found]   ` <3F684608.2000707@abcpages.com>
     [not found]     ` <20030917115048.GA2598@ee.oulu.fi>
2003-09-21  7:41       ` [PATCH] suspend/resume for the b44 driver Nicolae Mihalache

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox