[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>
This commit is contained in:
Michael Brown
2011-02-10 13:43:58 +00:00
parent 5bde349e55
commit 4f4c214621
2 changed files with 112 additions and 52 deletions

View File

@@ -381,9 +381,37 @@ 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
*