diff options
| author | Michael Brown | 2005-04-12 20:04:03 +0200 |
|---|---|---|
| committer | Michael Brown | 2005-04-12 20:04:03 +0200 |
| commit | 762fa9a4787a6594e29cb9f90ec99d7396cc2bad (patch) | |
| tree | 8acdd71ea7414900a91bcbe319f906705071d997 /src/include | |
| parent | Use pci_{vendor,device}_id instead of just pci_{vendor,device}, to avoid (diff) | |
| download | ipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.tar.gz ipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.tar.xz ipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.zip | |
Fix up find_pci_device so that it can be used for scanning for devices
*other* than the main boot device.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/dev.h | 7 | ||||
| -rw-r--r-- | src/include/main.h | 5 | ||||
| -rw-r--r-- | src/include/pci.h | 9 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/include/dev.h b/src/include/dev.h index aa9ccac31..3c029b913 100644 --- a/src/include/dev.h +++ b/src/include/dev.h @@ -3,6 +3,7 @@ #include "stdint.h" #include "nic.h" +#include "pci.h" /* Need to check the packing of this struct if Etherboot is ported */ struct dev_id { @@ -17,9 +18,13 @@ struct dev_id { #define DEV_ID_SIZE 8 struct dev { + struct dev_operations *dev_op; const char *name; struct dev_id devid; /* device ID string (sent to DHCP server) */ - struct dev_operations *dev_op; + /* All possible bus types */ + union { + struct pci_device pci; + }; /* All possible device types */ union { struct nic nic; diff --git a/src/include/main.h b/src/include/main.h index da9624e45..1841abb7b 100644 --- a/src/include/main.h +++ b/src/include/main.h @@ -3,8 +3,9 @@ #include "dev.h" -extern int main ( void ); - extern struct dev dev; +extern int main ( void ); +extern void set_pci_device ( uint16_t busdevfn ); + #endif /* MAIN_H */ diff --git a/src/include/pci.h b/src/include/pci.h index 51393871b..f2ba6c98a 100644 --- a/src/include/pci.h +++ b/src/include/pci.h @@ -237,7 +237,9 @@ * A physical PCI device * */ +struct dev; struct pci_device { + struct dev * dev; uint32_t membase; /* BAR 1 */ uint32_t ioaddr; /* first IO BAR */ uint16_t vendor, dev_id; @@ -245,6 +247,7 @@ struct pci_device { uint16_t busdevfn; uint8_t revision; uint8_t irq; + uint8_t already_tried; }; #define PCI_BUS(busdevfn) ( ( (busdevfn) >> 8 ) & 0xff ) #define PCI_DEV(busdevfn) ( ( (busdevfn) >> 3 ) & 0x1f ) @@ -319,9 +322,9 @@ extern unsigned long pci_bus_base ( struct pci_device *dev ); * Functions in pci.c * */ -extern void set_pci_device ( uint16_t busdevfn ); -extern struct pci_device * find_pci_device ( struct pci_driver *driver, - struct dev *dev ); +extern struct pci_device * pci_device ( struct dev *dev ); +extern int find_pci_device ( struct pci_device *pci, + struct pci_driver *driver ); extern unsigned long pci_bar_start ( struct pci_device *pci, unsigned int bar ); extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int bar ); |
