All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Rompf <srompf@isg.de>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb
Date: Fri, 20 Feb 2004 17:21:24 +0100	[thread overview]
Message-ID: <200402201721.24047.srompf@isg.de> (raw)
In-Reply-To: <4033FAF6.2090200@pobox.com>

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

Hi,

> Please resend patches that may be applied with "patch -p1",
> not "patch -p0".

ok., here's the first, suspend/resume

[-- Attachment #2: xircom_tulip_cb_pm.diff --]
[-- Type: text/x-diff, Size: 1519 bytes --]

--- jeffdir/drivers/net/tulip/xircom_tulip_cb.c.old	2004-02-14 14:33:03.000000000 +0100
+++ jeffdir/drivers/net/tulip/xircom_tulip_cb.c	2004-02-15 13:07:49.000000000 +0100
@@ -329,6 +329,9 @@ struct xircom_private {
 	int saved_if_port;
 	struct pci_dev *pdev;
 	spinlock_t lock;
+#ifdef CONFIG_PM
+	u32 pci_state[16];
+#endif
 };
 
 static int mdio_read(struct net_device *dev, int phy_id, int location);
@@ -749,6 +752,7 @@ xircom_up(struct net_device *dev)
 	long ioaddr = dev->base_addr;
 	int i;
 
+	xircom_init_ring(dev);
 	/* Clear the tx ring */
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		tp->tx_skbuff[i] = 0;
@@ -801,8 +805,6 @@ xircom_open(struct net_device *dev)
 	if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev))
 		return -EAGAIN;
 
-	xircom_init_ring(dev);
-
 	xircom_up(dev);
 	tp->open = 1;
 
@@ -1668,6 +1670,11 @@ static int xircom_suspend(struct pci_dev
 	printk(KERN_INFO "xircom_suspend(%s)\n", dev->name);
 	if (tp->open)
 		xircom_down(dev);
+
+	pci_save_state(pdev, tp->pci_state);
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, 3);
+
 	return 0;
 }
 
@@ -1678,6 +1685,10 @@ static int xircom_resume(struct pci_dev 
 	struct xircom_private *tp = dev->priv;
 	printk(KERN_INFO "xircom_resume(%s)\n", dev->name);
 
+	pci_set_power_state(pdev,0);
+	pci_enable_device(pdev);
+	pci_restore_state(pdev, tp->pci_state);
+
 	/* Bring the chip out of sleep mode.
 	   Caution: Snooze mode does not work with some boards! */
 	if (xircom_tbl[tp->chip_id].flags & HAS_ACPI)

  reply	other threads:[~2004-02-20 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-15 14:04 Patch: netif_carrier_on()/off() for xircom_tulip_cb Stefan Rompf
2004-02-18 23:53 ` Jeff Garzik
2004-02-20 16:21   ` Stefan Rompf [this message]
2004-02-25  1:01     ` Jeff Garzik
2004-02-20 16:21   ` Stefan Rompf
2004-02-20 16:23   ` Stefan Rompf

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=200402201721.24047.srompf@isg.de \
    --to=srompf@isg.de \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.