Back to home page

OSCL-LXR

 
 

    


0001 /* orinoco_pci.h
0002  *
0003  * Common code for all Orinoco drivers for PCI devices, including
0004  * both native PCI and PCMCIA-to-PCI bridges.
0005  *
0006  * Copyright (C) 2005, Pavel Roskin.
0007  * See main.c for license.
0008  */
0009 
0010 #ifndef _ORINOCO_PCI_H
0011 #define _ORINOCO_PCI_H
0012 
0013 #include <linux/netdevice.h>
0014 
0015 /* Driver specific data */
0016 struct orinoco_pci_card {
0017     void __iomem *bridge_io;
0018     void __iomem *attr_io;
0019 };
0020 
0021 static int __maybe_unused orinoco_pci_suspend(struct device *dev_d)
0022 {
0023     struct pci_dev *pdev = to_pci_dev(dev_d);
0024     struct orinoco_private *priv = pci_get_drvdata(pdev);
0025 
0026     orinoco_down(priv);
0027     free_irq(pdev->irq, priv);
0028 
0029     return 0;
0030 }
0031 
0032 static int __maybe_unused orinoco_pci_resume(struct device *dev_d)
0033 {
0034     struct pci_dev *pdev = to_pci_dev(dev_d);
0035     struct orinoco_private *priv = pci_get_drvdata(pdev);
0036     struct net_device *dev = priv->ndev;
0037     int err;
0038 
0039     err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
0040               dev->name, priv);
0041     if (err) {
0042         printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n",
0043                dev->name);
0044         return -EBUSY;
0045     }
0046 
0047     return orinoco_up(priv);
0048 }
0049 
0050 static SIMPLE_DEV_PM_OPS(orinoco_pci_pm_ops,
0051              orinoco_pci_suspend,
0052              orinoco_pci_resume);
0053 
0054 #endif /* _ORINOCO_PCI_H */