public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolae Mihalache <mache@abcpages.com>
To: Pekka Pietikainen <pp@ee.oulu.fi>
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH] suspend/resume for the b44 driver
Date: Sun, 21 Sep 2003 09:41:52 +0200	[thread overview]
Message-ID: <3F6D5640.2040904@abcpages.com> (raw)
In-Reply-To: <20030917115048.GA2598@ee.oulu.fi>

[-- 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)

           reply	other threads:[~2003-09-21  7:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20030917115048.GA2598@ee.oulu.fi>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F6D5640.2040904@abcpages.com \
    --to=mache@abcpages.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pp@ee.oulu.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox