aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sk98lin
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sk98lin')
-rw-r--r--drivers/net/sk98lin/skge.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 05b827f79f54..7bfaef9305b2 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5134,6 +5134,67 @@ static void __devexit skge_remove_one(struct pci_dev *pdev)
5134 kfree(pAC); 5134 kfree(pAC);
5135} 5135}
5136 5136
5137#ifdef CONFIG_PM
5138static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
5139{
5140 struct net_device *dev = pci_get_drvdata(pdev);
5141 DEV_NET *pNet = netdev_priv(dev);
5142 SK_AC *pAC = pNet->pAC;
5143 struct net_device *otherdev = pAC->dev[1];
5144
5145 if (pNet->Up) {
5146 pAC->WasIfUp[0] = SK_TRUE;
5147 DoPrintInterfaceChange = SK_FALSE;
5148 SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */
5149 }
5150 if (otherdev != dev) {
5151 pNet = netdev_priv(otherdev);
5152 if (pNet->Up) {
5153 pAC->WasIfUp[1] = SK_TRUE;
5154 DoPrintInterfaceChange = SK_FALSE;
5155 SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */
5156 }
5157 }
5158
5159 pci_save_state(pdev);
5160 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
5161 if (pAC->AllocFlag & SK_ALLOC_IRQ) {
5162 free_irq(dev->irq, dev);
5163 }
5164 pci_disable_device(pdev);
5165 pci_set_power_state(pdev, pci_choose_state(pdev, state));
5166
5167 return 0;
5168}
5169
5170static int skge_resume(struct pci_dev *pdev)
5171{
5172 struct net_device *dev = pci_get_drvdata(pdev);
5173 DEV_NET *pNet = netdev_priv(dev);
5174 SK_AC *pAC = pNet->pAC;
5175
5176 pci_set_power_state(pdev, PCI_D0);
5177 pci_restore_state(pdev);
5178 pci_enable_device(pdev);
5179 pci_set_master(pdev);
5180 if (pAC->GIni.GIMacsFound == 2)
5181 request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev);
5182 else
5183 request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev);
5184
5185 if (pAC->WasIfUp[0] == SK_TRUE) {
5186 DoPrintInterfaceChange = SK_FALSE;
5187 SkDrvInitAdapter(pAC, 0); /* first device */
5188 }
5189 if (pAC->dev[1] != dev && pAC->WasIfUp[1] == SK_TRUE) {
5190 DoPrintInterfaceChange = SK_FALSE;
5191 SkDrvInitAdapter(pAC, 1); /* first device */
5192 }
5193
5194 return 0;
5195}
5196#endif
5197
5137static struct pci_device_id skge_pci_tbl[] = { 5198static struct pci_device_id skge_pci_tbl[] = {
5138 { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 5199 { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
5139 { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 5200 { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
@@ -5159,6 +5220,8 @@ static struct pci_driver skge_driver = {
5159 .id_table = skge_pci_tbl, 5220 .id_table = skge_pci_tbl,
5160 .probe = skge_probe_one, 5221 .probe = skge_probe_one,
5161 .remove = __devexit_p(skge_remove_one), 5222 .remove = __devexit_p(skge_remove_one),
5223 .suspend = skge_suspend,
5224 .resume = skge_resume,
5162}; 5225};
5163 5226
5164static int __init skge_init(void) 5227static int __init skge_init(void)