diff options
author | Len Brown <len.brown@intel.com> | 2005-07-29 23:31:17 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-29 23:31:17 -0400 |
commit | d6ac1a7910d22626bc77e73db091e00b810715f4 (patch) | |
tree | c8f235b7287056a03bc2bc032902469a331b5e56 /drivers/net | |
parent | 577a4f8102d54b504cb22eb021b89e957e8df18f (diff) | |
parent | 87bec66b9691522414862dd8d41e430b063735ef (diff) |
/home/lenb/src/to-linus branch 'acpi-2.6.12'
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sk98lin/skge.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 82570ec44d8e..074521a36341 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -5133,6 +5133,67 @@ static void __devexit skge_remove_one(struct pci_dev *pdev) | |||
5133 | kfree(pAC); | 5133 | kfree(pAC); |
5134 | } | 5134 | } |
5135 | 5135 | ||
5136 | #ifdef CONFIG_PM | ||
5137 | static int skge_suspend(struct pci_dev *pdev, pm_message_t state) | ||
5138 | { | ||
5139 | struct net_device *dev = pci_get_drvdata(pdev); | ||
5140 | DEV_NET *pNet = netdev_priv(dev); | ||
5141 | SK_AC *pAC = pNet->pAC; | ||
5142 | struct net_device *otherdev = pAC->dev[1]; | ||
5143 | |||
5144 | if (pNet->Up) { | ||
5145 | pAC->WasIfUp[0] = SK_TRUE; | ||
5146 | DoPrintInterfaceChange = SK_FALSE; | ||
5147 | SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */ | ||
5148 | } | ||
5149 | if (otherdev != dev) { | ||
5150 | pNet = netdev_priv(otherdev); | ||
5151 | if (pNet->Up) { | ||
5152 | pAC->WasIfUp[1] = SK_TRUE; | ||
5153 | DoPrintInterfaceChange = SK_FALSE; | ||
5154 | SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */ | ||
5155 | } | ||
5156 | } | ||
5157 | |||
5158 | pci_save_state(pdev); | ||
5159 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | ||
5160 | if (pAC->AllocFlag & SK_ALLOC_IRQ) { | ||
5161 | free_irq(dev->irq, dev); | ||
5162 | } | ||
5163 | pci_disable_device(pdev); | ||
5164 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
5165 | |||
5166 | return 0; | ||
5167 | } | ||
5168 | |||
5169 | static int skge_resume(struct pci_dev *pdev) | ||
5170 | { | ||
5171 | struct net_device *dev = pci_get_drvdata(pdev); | ||
5172 | DEV_NET *pNet = netdev_priv(dev); | ||
5173 | SK_AC *pAC = pNet->pAC; | ||
5174 | |||
5175 | pci_set_power_state(pdev, PCI_D0); | ||
5176 | pci_restore_state(pdev); | ||
5177 | pci_enable_device(pdev); | ||
5178 | pci_set_master(pdev); | ||
5179 | if (pAC->GIni.GIMacsFound == 2) | ||
5180 | request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); | ||
5181 | else | ||
5182 | request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev); | ||
5183 | |||
5184 | if (pAC->WasIfUp[0] == SK_TRUE) { | ||
5185 | DoPrintInterfaceChange = SK_FALSE; | ||
5186 | SkDrvInitAdapter(pAC, 0); /* first device */ | ||
5187 | } | ||
5188 | if (pAC->dev[1] != dev && pAC->WasIfUp[1] == SK_TRUE) { | ||
5189 | DoPrintInterfaceChange = SK_FALSE; | ||
5190 | SkDrvInitAdapter(pAC, 1); /* first device */ | ||
5191 | } | ||
5192 | |||
5193 | return 0; | ||
5194 | } | ||
5195 | #endif | ||
5196 | |||
5136 | static struct pci_device_id skge_pci_tbl[] = { | 5197 | static struct pci_device_id skge_pci_tbl[] = { |
5137 | { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 5198 | { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
5138 | { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 5199 | { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
@@ -5158,6 +5219,8 @@ static struct pci_driver skge_driver = { | |||
5158 | .id_table = skge_pci_tbl, | 5219 | .id_table = skge_pci_tbl, |
5159 | .probe = skge_probe_one, | 5220 | .probe = skge_probe_one, |
5160 | .remove = __devexit_p(skge_remove_one), | 5221 | .remove = __devexit_p(skge_remove_one), |
5222 | .suspend = skge_suspend, | ||
5223 | .resume = skge_resume, | ||
5161 | }; | 5224 | }; |
5162 | 5225 | ||
5163 | static int __init skge_init(void) | 5226 | static int __init skge_init(void) |