summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers/net/undi.c
diff options
context:
space:
mode:
authorMichael Brown2015-02-02 15:31:18 +0100
committerMichael Brown2015-02-02 15:31:18 +0100
commit072d656a2fe0b0d89ded610d11257889fc35e0f1 (patch)
tree85fae6d01c78dad2ebaeba914eb606bd77de14a4 /src/arch/i386/drivers/net/undi.c
parent[build] Include Hyper-V driver in the all-drivers build (diff)
downloadipxe-072d656a2fe0b0d89ded610d11257889fc35e0f1.tar.gz
ipxe-072d656a2fe0b0d89ded610d11257889fc35e0f1.tar.xz
ipxe-072d656a2fe0b0d89ded610d11257889fc35e0f1.zip
[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/i386/drivers/net/undi.c')
-rw-r--r--src/arch/i386/drivers/net/undi.c7
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,
};