mirror of
https://github.com/ipxe/ipxe
synced 2025-12-25 00:17:57 +03:00
[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>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user