david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Added support for wildcard device/vendor ID matches

This commit is contained in:
Michael Brown 2007-01-08 03:23:38 +00:00
parent 20c9fc407e
commit 5af4918356
2 changed files with 7 additions and 1 deletions

View 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;

View 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 */