From 4f4c21462114cb4e397377d8ea59c4204a4e33f7 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 10 Feb 2011 13:43:58 +0000 Subject: [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 --- src/include/ipxe/pci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/include') 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,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 * -- cgit v1.2.3-55-g7522