diff options
author | Michael Brown <mcb30@etherboot.org> | 2005-04-13 01:01:33 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2005-04-13 01:01:33 +0000 |
commit | 984813595051cf2c7da695276134dfc374b50b29 (patch) | |
tree | 08864a7f57da0ef8a7eaffb477ffe7585ac24045 /src/drivers/net/sundance.c | |
parent | 3616de915e5006609a8872924f7cd148b227088d (diff) | |
download | ipxe-984813595051cf2c7da695276134dfc374b50b29.tar.gz |
Finished by hand
Diffstat (limited to 'src/drivers/net/sundance.c')
-rw-r--r-- | src/drivers/net/sundance.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/drivers/net/sundance.c b/src/drivers/net/sundance.c index 7bedeab12..45271f51a 100644 --- a/src/drivers/net/sundance.c +++ b/src/drivers/net/sundance.c @@ -571,28 +571,36 @@ static void sundance_disable ( struct nic *nic __unused ) { outw(TxDisable | RxDisable | StatsDisable, BASE + MACCtrl1); } - +static struct nic_operations sundance_operations = { + .connect = dummy_connect, + .poll = sundance_poll, + .transmit = sundance_transmit, + .irq = sundance_irq, + .disable = sundance_disable, +}; +static struct pci_driver sundance_driver; /************************************************************************** PROBE - Look for an adapter, this routine's visible to the outside ***************************************************************************/ static int sundance_probe ( struct dev *dev ) { - struct nic *nic = nic_device ( dev ); - struct pci_device *pci = pci_device ( dev ); u8 ee_data[EEPROM_SIZE]; u16 mii_ctl; int i; int speed; + if ( ! find_pci_device ( pci, &sundance_driver ) ) + return 0; + if (pci->ioaddr == 0) return 0; /* BASE is used throughout to address the card */ BASE = pci->ioaddr; printf(" sundance.c: Found %s Vendor=0x%hX Device=0x%hX\n", - pci->name, pci->vendor, pci->dev_id); + dev->name, pci->vendor, pci->dev_id); /* Get the MAC Address by reading the EEPROM */ for (i = 0; i < 3; i++) { @@ -614,13 +622,13 @@ static int sundance_probe ( struct dev *dev ) { /* point to private storage */ sdc = &sdx; - sdc->nic_name = pci->name; + sdc->nic_name = dev->name; sdc->mtu = mtu; pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id); dprintf(("Device revision id: %hx\n", sdc->pci_rev_id)); /* Print out some hardware info */ - printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE); + printf("%s: %! at ioaddr %hX, ", dev->name, nic->node_addr, BASE); sdc->mii_preamble_required = 0; if (1) { int phy, phy_idx = 0; @@ -735,14 +743,7 @@ static int sundance_probe ( struct dev *dev ) { sdc->mii_if.full_duplex ? "Full" : "Half"); /* point to NIC specific routines */ -static struct nic_operations sundance_operations; -static struct nic_operations sundance_operations = { - .connect = dummy_connect, - .poll = sundance_poll, - .transmit = sundance_transmit, - .irq = sundance_irq, - .disable = sundance_disable, -}; nic->nic_op = &sundance_operations; + nic->nic_op = &sundance_operations; nic->irqno = pci->irq; nic->ioaddr = BASE; |