Added support for wildcard device/vendor ID matches
authorMichael Brown <mcb30@etherboot.org>
Mon, 8 Jan 2007 03:23:38 +0000 (03:23 +0000)
committerMichael Brown <mcb30@etherboot.org>
Mon, 8 Jan 2007 03:23:38 +0000 (03:23 +0000)
src/drivers/bus/pci.c
src/include/gpxe/pci.h

index 0abc1e9..e7528e3 100644 (file)
@@ -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;
index 5fc2100..801bf2c 100644 (file)
@@ -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 */