diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-02-02 14:31:18 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-02-02 14:31:18 +0000 |
commit | 072d656a2fe0b0d89ded610d11257889fc35e0f1 (patch) | |
tree | 85fae6d01c78dad2ebaeba914eb606bd77de14a4 /src/arch | |
parent | d38bac05e7d0eb67fc19f3532a6b4fa00804106e (diff) | |
download | ipxe-072d656a2fe0b0d89ded610d11257889fc35e0f1.tar.gz |
[pci] Allow drivers to specify a PCI class
Allow drivers to specify a supported PCI class code. To save space in
the final binary, make this an attribute of the driver rather than an
attribute of a PCI device ID list entry.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/drivers/net/undi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/arch/i386/drivers/net/undi.c b/src/arch/i386/drivers/net/undi.c index 2bc54824..c4a11c57 100644 --- a/src/arch/i386/drivers/net/undi.c +++ b/src/arch/i386/drivers/net/undi.c @@ -68,10 +68,6 @@ static int undipci_probe ( struct pci_device *pci ) { struct undi_rom *undirom; int rc; - /* Ignore non-network devices */ - if ( PCI_BASE_CLASS ( pci->class ) != PCI_BASE_CLASS_NETWORK ) - return -ENOTTY; - /* Allocate UNDI device structure */ undi = zalloc ( sizeof ( *undi ) ); if ( ! undi ) @@ -138,12 +134,13 @@ static void undipci_remove ( struct pci_device *pci ) { } static struct pci_device_id undipci_nics[] = { -PCI_ROM ( 0xffff, 0xffff, "undipci", "UNDI (PCI)", 0 ), + PCI_ROM ( 0xffff, 0xffff, "undipci", "UNDI (PCI)", 0 ), }; struct pci_driver undipci_driver __pci_driver_fallback = { .ids = undipci_nics, .id_count = ( sizeof ( undipci_nics ) / sizeof ( undipci_nics[0] ) ), + .class = PCI_CLASS ( PCI_CLASS_NETWORK, PCI_ANY_ID, PCI_ANY_ID ), .probe = undipci_probe, .remove = undipci_remove, }; |