diff options
author | Michael Brown <mcb30@etherboot.org> | 2006-05-16 15:12:06 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2006-05-16 15:12:06 +0000 |
commit | 15ee09ed10d71969abeea9f578f061e096ef43d0 (patch) | |
tree | fe9465a87de8f62287474b1c2dc85516b868fbf5 /src/drivers/net/pnic.c | |
parent | fcdab6299c1d2714164672f3313523d366b033f8 (diff) | |
download | ipxe-15ee09ed10d71969abeea9f578f061e096ef43d0.tar.gz |
Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting
"membase"; drivers should need to call pci_bar_start() only if they want
to use BARs other than the first memory or I/O BAR.
Split rarely-used PCI functions out into pciextra.c.
Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4).
284 bytes of this saving comes from the pci/pciextra split.
Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to
match the names used in Linux).
Diffstat (limited to 'src/drivers/net/pnic.c')
-rw-r--r-- | src/drivers/net/pnic.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c index d4b19778..18f7b93b 100644 --- a/src/drivers/net/pnic.c +++ b/src/drivers/net/pnic.c @@ -199,13 +199,17 @@ static void pnic_remove ( struct pci_device *pci ) { /************************************************************************** PROBE - Look for an adapter, this routine's visible to the outside ***************************************************************************/ -static int pnic_probe ( struct pci_device *pci ) { +static int pnic_probe ( struct pci_device *pci, + const struct pci_device_id *id __unused ) { struct net_device *netdev; struct pnic *pnic; uint16_t api_version; uint16_t status; int rc; + /* Fix up PCI device */ + adjust_pci_device ( pci ); + /* Allocate net device */ netdev = alloc_etherdev ( sizeof ( *pnic ) ); if ( ! netdev ) { @@ -248,32 +252,14 @@ static int pnic_probe ( struct pci_device *pci ) { return rc; } -static struct pci_id pnic_nics[] = { +static struct pci_device_id pnic_nics[] = { /* genrules.pl doesn't let us use macros for PCI IDs...*/ PCI_ROM ( 0xfefe, 0xefef, "pnic", "Bochs Pseudo NIC Adaptor" ), }; -static struct pci_driver pnic_driver = { +struct pci_driver pnic_driver __pci_driver = { .ids = pnic_nics, .id_count = ( sizeof ( pnic_nics ) / sizeof ( pnic_nics[0] ) ), - .class = PCI_NO_CLASS, - // .probe = pnic_probe, - // .remove = pnic_remove, + .probe = pnic_probe, + .remove = pnic_remove, }; - -// PCI_DRIVER ( pnic_driver ); - - -static int pnic_hack_probe ( void *dummy, struct pci_device *pci ) { - return ( pnic_probe ( pci ) == 0 ); -} - -static void pnic_hack_disable ( void *dummy, struct pci_device *pci ) { - pnic_remove ( pci ); -} - -#include "dev.h" -extern struct type_driver test_driver; - -DRIVER ( "PNIC", test_driver, pci_driver, pnic_driver, - pnic_hack_probe, pnic_hack_disable ); |