aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2005-07-30 16:12:18 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-30 16:37:51 -0400
commit035a4a4f8976bdf12aab992c630d3a6cfba90ea8 (patch)
treeea85d8ae9186f300489217eb4c8ee4f253b79fab /drivers
parent6a1caa21d66bcb9ba9892435a0a54fc32cd9eeab (diff)
[PATCH] sk98lin: basic suspend/resume support fixes
An early version of the sk98lin patch was merged via Len's tree. But there were subsequent updates as a result of review from Jeff. THis fixes things up. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sk98lin/skge.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 074521a36341..49bd8c7c3f7d 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5141,17 +5141,18 @@ static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
5141 SK_AC *pAC = pNet->pAC; 5141 SK_AC *pAC = pNet->pAC;
5142 struct net_device *otherdev = pAC->dev[1]; 5142 struct net_device *otherdev = pAC->dev[1];
5143 5143
5144 if (pNet->Up) { 5144 if (netif_running(dev)) {
5145 pAC->WasIfUp[0] = SK_TRUE; 5145 netif_carrier_off(dev);
5146 DoPrintInterfaceChange = SK_FALSE; 5146 DoPrintInterfaceChange = SK_FALSE;
5147 SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */ 5147 SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */
5148 netif_device_detach(dev);
5148 } 5149 }
5149 if (otherdev != dev) { 5150 if (otherdev != dev) {
5150 pNet = netdev_priv(otherdev); 5151 if (netif_running(otherdev)) {
5151 if (pNet->Up) { 5152 netif_carrier_off(otherdev);
5152 pAC->WasIfUp[1] = SK_TRUE;
5153 DoPrintInterfaceChange = SK_FALSE; 5153 DoPrintInterfaceChange = SK_FALSE;
5154 SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */ 5154 SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */
5155 netif_device_detach(otherdev);
5155 } 5156 }
5156 } 5157 }
5157 5158
@@ -5171,23 +5172,36 @@ static int skge_resume(struct pci_dev *pdev)
5171 struct net_device *dev = pci_get_drvdata(pdev); 5172 struct net_device *dev = pci_get_drvdata(pdev);
5172 DEV_NET *pNet = netdev_priv(dev); 5173 DEV_NET *pNet = netdev_priv(dev);
5173 SK_AC *pAC = pNet->pAC; 5174 SK_AC *pAC = pNet->pAC;
5175 struct net_device *otherdev = pAC->dev[1];
5176 int ret;
5174 5177
5175 pci_set_power_state(pdev, PCI_D0); 5178 pci_set_power_state(pdev, PCI_D0);
5176 pci_restore_state(pdev); 5179 pci_restore_state(pdev);
5177 pci_enable_device(pdev); 5180 pci_enable_device(pdev);
5178 pci_set_master(pdev); 5181 pci_set_master(pdev);
5179 if (pAC->GIni.GIMacsFound == 2) 5182 if (pAC->GIni.GIMacsFound == 2)
5180 request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); 5183 ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev);
5181 else 5184 else
5182 request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev); 5185 ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev);
5186 if (ret) {
5187 printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq);
5188 pAC->AllocFlag &= ~SK_ALLOC_IRQ;
5189 dev->irq = 0;
5190 pci_disable_device(pdev);
5191 return -EBUSY;
5192 }
5183 5193
5184 if (pAC->WasIfUp[0] == SK_TRUE) { 5194 netif_device_attach(dev);
5195 if (netif_running(dev)) {
5185 DoPrintInterfaceChange = SK_FALSE; 5196 DoPrintInterfaceChange = SK_FALSE;
5186 SkDrvInitAdapter(pAC, 0); /* first device */ 5197 SkDrvInitAdapter(pAC, 0); /* first device */
5187 } 5198 }
5188 if (pAC->dev[1] != dev && pAC->WasIfUp[1] == SK_TRUE) { 5199 if (otherdev != dev) {
5189 DoPrintInterfaceChange = SK_FALSE; 5200 netif_device_attach(otherdev);
5190 SkDrvInitAdapter(pAC, 1); /* first device */ 5201 if (netif_running(otherdev)) {
5202 DoPrintInterfaceChange = SK_FALSE;
5203 SkDrvInitAdapter(pAC, 1); /* second device */
5204 }
5191 } 5205 }
5192 5206
5193 return 0; 5207 return 0;