Skip to contentSkip to conversation

eepro100 pm fix (fwd)

DISCUSSION Andrey Savochkin 1 participant 1 message Nov 12, 2001

lore
Share & tools
lore
#0 lore raw

Linus,

Could you apply it, please?

Andrey

----- Forwarded message from Jens Axboe <[email protected]> -----

Date: Mon, 12 Nov 2001 13:24:53 +0100
From: Jens Axboe <[email protected]>
To: [email protected]
Subject: eepro100 pm fix
Message-ID: <[email protected]>

Hi Andrey,

This patch posted by Andrew Morton makes the eepro100 actually survive a apm suspend and resume without totally croaking (a problem I reported probably a year or so ago :-). Any chance you could include it?

Signature · 36 lines
Jens Axboe


--- /opt/kernel/linux-2.4.15-pre3/drivers/net/eepro100.c	Mon Nov 12 13:21:27 2001
+++ linux/drivers/net/eepro100.c	Mon Nov 12 13:20:47 2001
@@ -499,6 +499,9 @@
 	unsigned short phy[2];				/* PHY media interfaces available. */
 	unsigned short advertising;			/* Current PHY advertised caps. */
 	unsigned short partner;				/* Link partner caps. */
+#ifdef CONFIG_PM
+	u32 pm_state[16];
+#endif
 };
 
 /* The parameters for a CmdConfigure operation.
@@ -2193,8 +2196,11 @@
 static int eepro100_suspend(struct pci_dev *pdev, u32 state)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
+	struct speedo_private *sp = (struct speedo_private *)dev->priv;
 	long ioaddr = dev->base_addr;
 
+	pci_save_state(pdev, sp->pm_state);
+
 	if (!netif_running(dev))
 		return 0;
 
@@ -2210,6 +2216,8 @@
 	struct net_device *dev = pci_get_drvdata (pdev);
 	struct speedo_private *sp = (struct speedo_private *)dev->priv;
 	long ioaddr = dev->base_addr;
+
+	pci_restore_state(pdev, sp->pm_state);
 
 	if (!netif_running(dev))
 		return 0;