2 /* This header only makes send when included in a 2.0 compile */
9 #include <linux/bios32.h> /* pcibios_* */
10 #include <linux/pci.h> /* pcibios_* */
11 #include <linux/malloc.h> /* kmalloc */
13 /* fake the new pci interface based on the old one: encapsulate bus/devfn */
19 #define pci_dev pci_fake_dev /* the other pci_dev is unused by 2.0 drivers */
21 extern inline struct pci_dev *pci_find_device(unsigned int vendorid,
25 struct pci_dev *pptr = kmalloc(sizeof(*pptr), GFP_KERNEL);
29 if (!pptr) return NULL;
30 if (from) index = pptr->index + 1;
31 ret = pcibios_find_device(vendorid, devid, index,
32 &pptr->bus, &pptr->devfn);
33 if (ret) { kfree(pptr); return NULL; }
37 extern inline struct pci_dev *pci_find_class(unsigned int class,
40 return NULL; /* FIXME */
43 extern inline void pci_release_device(struct pci_dev *dev)
48 /* struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); */
50 #define pci_present pcibios_present
53 pci_read_config_byte(struct pci_dev *dev, u8 where, u8 *val)
55 return pcibios_read_config_byte(dev->bus, dev->devfn, where, val);
59 pci_read_config_word(struct pci_dev *dev, u8 where, u16 *val)
61 return pcibios_read_config_word(dev->bus, dev->devfn, where, val);
65 pci_read_config_dword(struct pci_dev *dev, u8 where, u32 *val)
67 return pcibios_read_config_dword(dev->bus, dev->devfn, where, val);
71 pci_write_config_byte(struct pci_dev *dev, u8 where, u8 val)
73 return pcibios_write_config_byte(dev->bus, dev->devfn, where, val);
77 pci_write_config_word(struct pci_dev *dev, u8 where, u16 val)
79 return pcibios_write_config_word(dev->bus, dev->devfn, where, val);
83 pci_write_config_dword(struct pci_dev *dev, u8 where, u32 val)
85 return pcibios_write_config_dword(dev->bus, dev->devfn, where, val);
88 extern inline void pci_set_master(struct pci_dev *dev)
91 pcibios_read_config_word(dev->bus, dev->devfn, PCI_COMMAND, &cmd);
92 cmd |= PCI_COMMAND_MASTER;
93 pcibios_write_config_word(dev->bus, dev->devfn, PCI_COMMAND, cmd);
96 #endif /* __KERNEL__ */
97 #endif /* _PCI_COMPAT_H_ */