diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-02-10 13:43:58 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2011-02-17 01:59:24 +0000 |
commit | 4f4c21462114cb4e397377d8ea59c4204a4e33f7 (patch) | |
tree | 7c4db0f186c4df0dd4ce18169e3c79783d2ce8f3 /src/include/ipxe/pci.h | |
parent | 5bde349e55640b2d21fbe0f4f53edabe6878eb91 (diff) | |
download | ipxe-4f4c21462114cb4e397377d8ea59c4204a4e33f7.tar.gz |
[pci] Modularise PCI device support
Some operating environments require (or at least prefer) that we do
not perform our own PCI bus scan, but deal only with specified
devices. Modularise the PCI core to allow for this.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/pci.h')
-rw-r--r-- | src/include/ipxe/pci.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/ipxe/pci.h b/src/include/ipxe/pci.h index c116f6e09..90802a3f1 100644 --- a/src/include/ipxe/pci.h +++ b/src/include/ipxe/pci.h @@ -381,10 +381,38 @@ struct pci_driver { extern void adjust_pci_device ( struct pci_device *pci ); extern unsigned long pci_bar_start ( struct pci_device *pci, unsigned int reg ); +extern int pci_read_config ( struct pci_device *pci ); +extern int pci_find_driver ( struct pci_device *pci ); +extern int pci_probe ( struct pci_device *pci ); +extern void pci_remove ( struct pci_device *pci ); extern int pci_find_capability ( struct pci_device *pci, int capability ); extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int reg ); /** + * Initialise PCI device + * + * @v pci PCI device + * @v busdevfn PCI bus:dev.fn address + */ +static inline void pci_init ( struct pci_device *pci, unsigned int busdevfn ) { + pci->busdevfn = busdevfn; +} + +/** + * Set PCI driver + * + * @v pci PCI device + * @v driver PCI driver + * @v id PCI device ID + */ +static inline void pci_set_driver ( struct pci_device *pci, + struct pci_driver *driver, + struct pci_device_id *id ) { + pci->driver = driver; + pci->id = id; +} + +/** * Set PCI driver-private data * * @v pci PCI device |