summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-01-08 04:23:38 +0100
committerMichael Brown2007-01-08 04:23:38 +0100
commit5af4918356a224735b7a2d5034d714e1ebedb49e (patch)
tree5f5f0f849e484cd0234b3b0691cb464ab445c5ca
parentRemove types and prototypes now provided in the undi*.h headers. (diff)
downloadipxe-5af4918356a224735b7a2d5034d714e1ebedb49e.tar.gz
ipxe-5af4918356a224735b7a2d5034d714e1ebedb49e.tar.xz
ipxe-5af4918356a224735b7a2d5034d714e1ebedb49e.zip
Added support for wildcard device/vendor ID matches
-rw-r--r--src/drivers/bus/pci.c5
-rw-r--r--src/include/gpxe/pci.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c
index 0abc1e9cd..e7528e3ce 100644
--- a/src/drivers/bus/pci.c
+++ b/src/drivers/bus/pci.c
@@ -187,7 +187,10 @@ static int pci_probe ( struct pci_device *pci ) {
for ( driver = pci_drivers ; driver < pci_drivers_end ; driver++ ) {
for ( i = 0 ; i < driver->id_count ; i++ ) {
id = &driver->ids[i];
- if ( ( id->vendor != pci->vendor ) ||
+ if ( ( id->vendor != PCI_ANY_ID ) &&
+ ( id->vendor != pci->vendor ) )
+ continue;
+ if ( ( id->device != PCI_ANY_ID ) &&
( id->device != pci->device ) )
continue;
pci->driver = driver;
diff --git a/src/include/gpxe/pci.h b/src/include/gpxe/pci.h
index 5fc210095..801bf2ccd 100644
--- a/src/include/gpxe/pci.h
+++ b/src/include/gpxe/pci.h
@@ -239,6 +239,9 @@ struct pci_device_id {
uint16_t device;
};
+/** Match-anything ID */
+#define PCI_ANY_ID 0xffff
+
/** A PCI device */
struct pci_device {
/** Generic device */