summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/pnic.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-14 16:31:11 +0200
committerMichael Brown2005-04-14 16:31:11 +0200
commit72fe23a76ebef092273e89dc72fe41c4ade300ba (patch)
tree1336eef04a0b1da19055aaa7800a27b598463ad8 /src/drivers/net/pnic.c
parentFix BOOT_DRIVER to assign unique and meaningful name to structure. (diff)
downloadipxe-72fe23a76ebef092273e89dc72fe41c4ade300ba.tar.gz
ipxe-72fe23a76ebef092273e89dc72fe41c4ade300ba.tar.xz
ipxe-72fe23a76ebef092273e89dc72fe41c4ade300ba.zip
Updated to new device API.
Diffstat (limited to 'src/drivers/net/pnic.c')
-rw-r--r--src/drivers/net/pnic.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c
index 6db4dea3..e79b7647 100644
--- a/src/drivers/net/pnic.c
+++ b/src/drivers/net/pnic.c
@@ -211,28 +211,15 @@ static struct nic_operations pnic_operations = {
.disable = pnic_disable,
};
-static struct pci_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 =
- PCI_DRIVER ( "PNIC", pnic_nics, PCI_NO_CLASS );
-
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int pnic_probe ( struct dev *dev ) {
+static int pnic_probe ( struct dev *dev, struct pci_device *pci ) {
struct nic *nic = nic_device ( dev );
- struct pci_device *pci = pci_device ( dev );
uint16_t api_version;
uint16_t status;
- /* Scan PCI bus for a PNIC device */
- if ( ! find_pci_device ( pci, &pnic_driver ) )
- return 0;
-
/* Retrieve relevant information about PCI device */
nic->ioaddr = pci->ioaddr;
nic->irqno = pci->irq;
@@ -257,4 +244,12 @@ static int pnic_probe ( struct dev *dev ) {
return 1;
}
-BOOT_DRIVER ( "PNIC", pnic_probe );
+static struct pci_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 =
+ PCI_DRIVER ( "PNIC", pnic_nics, PCI_NO_CLASS );
+
+BOOT_DRIVER ( "PNIC", find_pci_boot_device, pnic_driver, pnic_probe );