diff options
author | Michael Brown | 2005-04-13 03:31:44 +0200 |
---|---|---|
committer | Michael Brown | 2005-04-13 03:31:44 +0200 |
commit | f39cc6d978e29b7371f94d38de231a0d534e8d86 (patch) | |
tree | ee4885e45d688e995760cdd663feaa3abe37285b /src/drivers/net/eepro100.c | |
parent | Fix type of dummy_irq() (diff) | |
download | ipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.tar.gz ipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.tar.xz ipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.zip |
Finished by hand
Diffstat (limited to 'src/drivers/net/eepro100.c')
-rw-r--r-- | src/drivers/net/eepro100.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/drivers/net/eepro100.c b/src/drivers/net/eepro100.c index 7798c2ea..bccb9190 100644 --- a/src/drivers/net/eepro100.c +++ b/src/drivers/net/eepro100.c @@ -258,6 +258,9 @@ struct RxFD { /* Receive frame descriptor. */ char packet[1518]; }; +static struct nic_operations eepro100_operations; +static struct pci_driver eepro100_driver; + #define RXFD_COUNT 4 static struct RxFD rxfds[RXFD_COUNT]; static unsigned int rxfd = 0; @@ -601,9 +604,7 @@ static void eepro100_disable ( struct nic *nic __unused ) { */ static int eepro100_probe ( struct dev *dev ) { - struct nic *nic = nic_device ( dev ); - struct pci_device *p = pci_device ( dev ); unsigned short sum = 0; int i; @@ -615,13 +616,14 @@ static int eepro100_probe ( struct dev *dev ) { be careful not to access beyond this array */ unsigned short eeprom[16]; + if ( ! find_pci_device ( p, &eepro100_driver ) ) + return 0; + if (p->ioaddr == 0) return 0; - ioaddr = p->ioaddr & ~3; /* Mask the bit that says "this is an io addr" */ + ioaddr = p->ioaddr; nic->ioaddr = ioaddr; - adjust_pci_device(p); - /* Copy IRQ from PCI information */ nic->irqno = p->irq; @@ -764,17 +766,9 @@ static int eepro100_probe ( struct dev *dev ) { */ if (!(mdio_read(eeprom[6] & 0x1f, 1) & (1 << 2))) { printf("Valid link not established\n"); - eepro100_disable(dev); + eepro100_disable(nic); return 0; } -static struct nic_operations eepro100_operations; -static struct nic_operations eepro100_operations = { - .connect = dummy_connect, - .poll = eepro100_poll, - .transmit = eepro100_transmit, - .irq = eepro100_irq, - .disable = eepro100_disable, -}; nic->nic_op = &eepro100_operations; return 1; } @@ -799,6 +793,14 @@ void hd (void *where, int n) } #endif +static struct nic_operations eepro100_operations = { + .connect = dummy_connect, + .poll = eepro100_poll, + .transmit = eepro100_transmit, + .irq = eepro100_irq, + .disable = eepro100_disable, +}; + static struct pci_id eepro100_nics[] = { PCI_ROM(0x8086, 0x1029, "id1029", "Intel EtherExpressPro100 ID1029"), PCI_ROM(0x8086, 0x1030, "id1030", "Intel EtherExpressPro100 ID1030"), |