summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2005-04-21 21:20:39 +0200
committerMichael Brown2005-04-21 21:20:39 +0200
commit614c39a8a40a32146793bd25906964659d90f95b (patch)
tree9acc979cce4658905d1bffd26d03058435c5d4c5 /src/drivers
parentTweaked API to minimise changes to existing drivers even further. (diff)
downloadipxe-614c39a8a40a32146793bd25906964659d90f95b.tar.gz
ipxe-614c39a8a40a32146793bd25906964659d90f95b.tar.xz
ipxe-614c39a8a40a32146793bd25906964659d90f95b.zip
Automatically updated with the program
#!/usr/bin/perl -w -pi -0777 use strict; ( my $type ) = /find_(\w+?)_boot_device/ or die "Could not find type\n"; ( my $disable ) = /\.disable\s*=\s*(\w+)/ or die "Could not locate disable\n"; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*\{)(\s*)/${1}, struct ${type}_device \*${type} __unused${2}${3}nic_disable ( nic );${3}/s; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*;)/${1}, struct ${type}_device \*${type}${2}/g; s/^\s*.disable\s*=\s*${disable}\s*,\s*?$//m; s/(_probe\s*\(\s*)struct\s+dev\s+\*dev/${1}struct nic \*nic/g; s/^\s*struct\s+nic\s+\*nic\s*=\s*nic_device\s*\(\s*dev\s*\)\s*;\s*?$//m; s/^(\s*)(nic->(ioaddr|irqno)\s*=\s*${type})/${1}${type}_fill_nic ( nic, ${type} );\n${1}${2}/m;
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/3c515.c18
-rw-r--r--src/drivers/net/3c595.c15
-rw-r--r--src/drivers/net/3c90x.c13
-rw-r--r--src/drivers/net/davicom.c19
-rw-r--r--src/drivers/net/depca.c15
-rw-r--r--src/drivers/net/dmfe.c12
-rw-r--r--src/drivers/net/e1000.c11
-rw-r--r--src/drivers/net/eepro.c15
-rw-r--r--src/drivers/net/eepro100.c11
-rw-r--r--src/drivers/net/epic100.c14
-rw-r--r--src/drivers/net/forcedeth.c12
-rw-r--r--src/drivers/net/mtd80x.c14
-rw-r--r--src/drivers/net/natsemi.c18
-rwxr-xr-xsrc/drivers/net/ns83820.c15
-rw-r--r--src/drivers/net/pcnet32.c12
-rw-r--r--src/drivers/net/r8169.c12
-rw-r--r--src/drivers/net/rtl8139.c19
-rw-r--r--src/drivers/net/sis900.c19
-rw-r--r--src/drivers/net/skel.c23
-rw-r--r--src/drivers/net/smc9000.c15
-rw-r--r--src/drivers/net/sundance.c12
-rw-r--r--src/drivers/net/tg3.c11
-rw-r--r--src/drivers/net/tlan.c12
-rw-r--r--src/drivers/net/tulip.c19
-rw-r--r--src/drivers/net/via-rhine.c17
-rw-r--r--src/drivers/net/w89c840.c14
26 files changed, 225 insertions, 162 deletions
diff --git a/src/drivers/net/3c515.c b/src/drivers/net/3c515.c
index 54ef3302..4e32ea7e 100644
--- a/src/drivers/net/3c515.c
+++ b/src/drivers/net/3c515.c
@@ -565,7 +565,9 @@ static void t515_transmit(struct nic *nic, const char *d, /* Destination */
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void t515_disable ( struct nic *nic ) {
+static void t515_disable ( struct nic *nic, struct isapnp_device *isapnp __unused ) {
+
+ nic_disable ( nic );
/* merge reset an disable */
t515_reset(nic);
@@ -610,17 +612,19 @@ static struct nic_operations t515_operations = {
.poll = t515_poll,
.transmit = t515_transmit,
.irq = t515_irq,
- .disable = t515_disable,
+
};
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
You should omit the last argument struct pci_device * for a non-PCI NIC
***************************************************************************/
-static int t515_probe ( struct dev *dev, struct isapnp_device *isapnp ) {
- struct nic *nic = nic_device ( dev );
+static int t515_probe ( struct nic *nic, struct isapnp_device *isapnp ) {
+
/* Direct copy from Beckers 3c515.c removing any ISAPNP sections */
+ isapnp_fill_nic ( nic, isapnp );
+
nic->ioaddr = isapnp->ioaddr;
nic->irqno = isapnp->irqno;
activate_isapnp_device ( isapnp, 1 );
@@ -762,9 +766,9 @@ static struct isapnp_id t515_adapters[] = {
};
static struct isapnp_driver t515_driver =
- ISAPNP_DRIVER ( "3c515", t515_adapters );
+ ISAPNP_DRIVER ( t515_adapters );
-BOOT_DRIVER ( "3c515", find_isapnp_boot_device, t515_driver,
- t515_probe );
+DRIVER ( "3c515", nic_driver, isapnp_driver, t515_driver,
+ t515_probe, t515_disable );
ISA_ROM ( "3c515", "3c515 Fast EtherLink ISAPnP" );
diff --git a/src/drivers/net/3c595.c b/src/drivers/net/3c595.c
index b3b29c49..cc7cfee2 100644
--- a/src/drivers/net/3c595.c
+++ b/src/drivers/net/3c595.c
@@ -443,7 +443,8 @@ vxsetlink(void)
GO_WINDOW(1);
}
-static void t595_disable ( struct nic *nic ) {
+static void t595_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
t595_reset(nic);
outw(STOP_TRANSCEIVER, BASE + VX_COMMAND);
@@ -468,8 +469,8 @@ static void t595_irq(struct nic *nic __unused, irq_action_t action __unused)
/**************************************************************************
ETH_PROBE - Look for an adapter
***************************************************************************/
-static int t595_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int t595_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i;
unsigned short *p;
@@ -478,6 +479,7 @@ static int t595_probe ( struct dev *dev, struct pci_device *pci ) {
eth_nic_base = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
GO_WINDOW(0);
@@ -517,7 +519,7 @@ static struct nic_operations t595_operations = {
.poll = t595_poll,
.transmit = t595_transmit,
.irq = t595_irq,
- .disable = t595_disable,
+
};
static struct pci_id t595_nics[] = {
@@ -538,9 +540,10 @@ PCI_ROM(0x10b7, 0x4500, "3c450-1", "3Com450 HomePNA Tornado"),
};
static struct pci_driver t595_driver =
- PCI_DRIVER ( "3C595", t595_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( t595_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "3C595", find_pci_boot_device, t595_driver, t595_probe );
+DRIVER ( "3C595", nic_driver, pci_driver, t595_driver,
+ t595_probe, t595_disable );
/*
* Local variables:
diff --git a/src/drivers/net/3c90x.c b/src/drivers/net/3c90x.c
index b3aa76bf..061f954c 100644
--- a/src/drivers/net/3c90x.c
+++ b/src/drivers/net/3c90x.c
@@ -690,8 +690,8 @@ static void a3c90x_irq(struct nic *nic __unused, irq_action_t action __unused)
*** initialization. If this routine is called, the pci functions did find the
*** card. We just have to init it here.
***/
-static int a3c90x_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int a3c90x_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i, c;
unsigned short eeprom[0x21];
unsigned int cfg;
@@ -705,6 +705,8 @@ static int a3c90x_probe ( struct dev *dev, struct pci_device *pci ) {
adjust_pci_device(pci);
+ pci_fill_nic ( nic, pci );
+
nic->ioaddr = pci->ioaddr;
nic->irqno = 0;
@@ -960,7 +962,7 @@ static struct nic_operations a3c90x_operations = {
.poll = a3c90x_poll,
.transmit = a3c90x_transmit,
.irq = a3c90x_irq,
- .disable = a3c90x_disable,
+
};
static struct pci_id a3c90x_nics[] = {
@@ -991,6 +993,7 @@ PCI_ROM(0x10b7, 0x1202, "3c982b", "3Com982B"),
};
static struct pci_driver a3c90x_driver =
- PCI_DRIVER ( "3C90X", a3c90x_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( a3c90x_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "3C90X", find_pci_boot_device, a3c90x_driver, a3c90x_probe );
+DRIVER ( "3C90X", nic_driver, pci_driver, a3c90x_driver,
+ a3c90x_probe, a3c90x_disable );
diff --git a/src/drivers/net/davicom.c b/src/drivers/net/davicom.c
index 4fef8f66..755a70e7 100644
--- a/src/drivers/net/davicom.c
+++ b/src/drivers/net/davicom.c
@@ -157,13 +157,13 @@ static int TxPtr;
/*********************************************************************/
static void whereami(const char *str);
static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
-static int davicom_probe(struct dev *dev,struct pci_device *pci);
+static int davicom_probe(struct nic *nic,struct pci_device *pci);
static void davicom_init_chain(struct nic *nic); /* Sten 10/9 */
static void davicom_reset(struct nic *nic);
static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
unsigned int s, const char *p);
static int davicom_poll(struct nic *nic, int retrieve);
-static void davicom_disable(struct nic *nic);
+static void davicom_disable(struct nic *nic, struct pci_device *pci);
#ifdef DAVICOM_DEBUG
static void davicom_more(void);
#endif /* DAVICOM_DEBUG */
@@ -620,7 +620,8 @@ static int davicom_poll(struct nic *nic, int retrieve)
/*********************************************************************/
/* eth_disable - Disable the interface */
/*********************************************************************/
-static void davicom_disable ( struct nic *nic ) {
+static void davicom_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
whereami("davicom_disable\n");
davicom_reset(nic);
@@ -655,8 +656,8 @@ static void davicom_irq(struct nic *nic __unused, irq_action_t action __unused)
/*********************************************************************/
/* eth_probe - Look for an adapter */
/*********************************************************************/
-static int davicom_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int davicom_probe ( struct nic *nic, struct pci_device *pci ) {
+
unsigned int i;
whereami("davicom_probe\n");
@@ -669,6 +670,7 @@ static int davicom_probe ( struct dev *dev, struct pci_device *pci ) {
ioaddr = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* wakeup chip */
@@ -703,7 +705,7 @@ static struct nic_operations davicom_operations = {
.poll = davicom_poll,
.transmit = davicom_transmit,
.irq = davicom_irq,
- .disable = davicom_disable,
+
};
static struct pci_id davicom_nics[] = {
@@ -714,6 +716,7 @@ PCI_ROM(0x1282, 0x9132, "davicom9132", "Davicom 9132"), /* Needs probably some f
};
static struct pci_driver davicom_driver =
- PCI_DRIVER ( "DAVICOM", davicom_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( davicom_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "DAVICOM", find_pci_boot_device, davicom_driver, davicom_probe );
+DRIVER ( "DAVICOM", nic_driver, pci_driver, davicom_driver,
+ davicom_probe, davicom_disable );
diff --git a/src/drivers/net/depca.c b/src/drivers/net/depca.c
index 78339b08..f8fb97ae 100644
--- a/src/drivers/net/depca.c
+++ b/src/drivers/net/depca.c
@@ -648,7 +648,8 @@ static void depca_transmit(
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void depca_disable ( struct nic *nic ) {
+static void depca_disable ( struct nic *nic, struct isa_device *isa __unused ) {
+ nic_disable ( nic );
/* reset and disable merge */
depca_reset(nic);
@@ -736,18 +737,19 @@ static struct nic_operations depca_operations = {
.poll = depca_poll,
.transmit = depca_transmit,
.irq = depca_irq,
- .disable = depca_disable,
+
};
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int depca_probe ( struct dev *dev, struct isa_device *isa ) {
- struct nic *nic = nic_device ( dev );
+static int depca_probe ( struct nic *nic, struct isa_device *isa ) {
+
int i, j;
long sum, chksum;
nic->irqno = 0;
+ isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;
for (i = 0, j = 0, sum = 0; j < 3; j++) {
@@ -792,9 +794,10 @@ static isa_probe_addr_t depca_probe_addrs[] = {
};
static struct isa_driver depca_driver =
- ISA_DRIVER ( "depca", depca_probe_addrs, depca_probe1,
+ ISA_DRIVER ( depca_probe_addrs, depca_probe1,
GENERIC_ISAPNP_VENDOR, 0x80f7 );
-BOOT_DRIVER ( "depce", find_isa_boot_device, depca_driver, depca_probe );
+DRIVER ( "depce", nic_driver, isa_driver, depca_driver,
+ depca_probe, depca_disable );
ISA_ROM ( "depca", "Digital DE100 and DE200" );
diff --git a/src/drivers/net/dmfe.c b/src/drivers/net/dmfe.c
index 8067c6af..65a7fbf1 100644
--- a/src/drivers/net/dmfe.c
+++ b/src/drivers/net/dmfe.c
@@ -459,8 +459,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define board_found 1
#define valid_link 0
-static int dmfe_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
+
uint32_t dev_rev, pci_pmr;
int i;
@@ -508,6 +508,7 @@ static int dmfe_probe ( struct dev *dev, struct pci_device *pci ) {
dmfe_reset(nic);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* point to NIC specific routines */
@@ -1213,7 +1214,7 @@ static struct nic_operations dmfe_operations = {
.poll = dmfe_poll,
.transmit = dmfe_transmit,
.irq = dmfe_irq,
- .disable = dmfe_disable,
+
};
static struct pci_id dmfe_nics[] = {
@@ -1224,6 +1225,7 @@ static struct pci_id dmfe_nics[] = {
};
static struct pci_driver dmfe_driver =
- PCI_DRIVER ( "DMFE/PCI", dmfe_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( dmfe_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "DMFE/PCI", find_pci_boot_device, dmfe_driver, dmfe_probe );
+DRIVER ( "DMFE/PCI", nic_driver, pci_driver, dmfe_driver,
+ dmfe_probe, dmfe_disable );
diff --git a/src/drivers/net/e1000.c b/src/drivers/net/e1000.c
index 5332565f..690ff1f2 100644
--- a/src/drivers/net/e1000.c
+++ b/src/drivers/net/e1000.c
@@ -3582,8 +3582,8 @@ static void e1000_irq(struct nic *nic __unused, irq_action_t action)
PROBE - Look for an adapter, this routine's visible to the outside
You should omit the last argument struct pci_device * for a non-PCI NIC
***************************************************************************/
-static int e1000_probe ( struct dev *dev, struct pci_device *p ) {
- struct nic *nic = nic_device ( dev );
+static int e1000_probe ( struct nic *nic, struct pci_device *p ) {
+
unsigned long mmio_start, mmio_len;
int ret_val, i;
@@ -3671,7 +3671,7 @@ static struct nic_operations e1000_operations = {
.poll = e1000_poll,
.transmit = e1000_transmit,
.irq = e1000_irq,
- .disable = e1000_disable,
+
};
static struct pci_id e1000_nics[] = {
@@ -3708,6 +3708,7 @@ PCI_ROM(0x8086, 0x107b, "e1000-82546gb-serdes", "Intel EtherExpressPro1000
};
static struct pci_driver e1000_driver =
- PCI_DRIVER ( "E1000", e1000_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( e1000_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "E1000", find_pci_boot_device, e1000_driver, e1000_probe );
+DRIVER ( "E1000", nic_driver, pci_driver, e1000_driver,
+ e1000_probe, e1000_disable );
diff --git a/src/drivers/net/eepro.c b/src/drivers/net/eepro.c
index a2b75e0e..ec2c45b4 100644
--- a/src/drivers/net/eepro.c
+++ b/src/drivers/net/eepro.c
@@ -450,7 +450,8 @@ static void eepro_transmit(
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void eepro_disable ( struct nic *nic ) {
+static void eepro_disable ( struct nic *nic, struct isa_device *isa __unused ) {
+ nic_disable ( nic );
eepro_sw2bank0(nic->ioaddr); /* Switch to bank 0 */
/* Flush the Tx and disable Rx */
outb(STOP_RCV_CMD, nic->ioaddr);
@@ -534,14 +535,14 @@ static struct nic_operations eepro_operations = {
.poll = eepro_poll,
.transmit = eepro_transmit,
.irq = eepro_irq,
- .disable = eepro_disable,
+
};
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int eepro_probe ( struct dev *dev, struct isa_device *isa ) {
- struct nic *nic = nic_device ( dev );
+static int eepro_probe ( struct nic *nic, struct isa_device *isa ) {
+
int i, l_eepro = 0;
union {
unsigned char caddr[ETH_ALEN];
@@ -549,6 +550,7 @@ static int eepro_probe ( struct dev *dev, struct isa_device *isa ) {
} station_addr;
nic->irqno = 0;
+ isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;
station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
@@ -605,9 +607,10 @@ static isa_probe_addr_t eepro_probe_addrs[] = {
};
static struct isa_driver eepro_driver =
- ISA_DRIVER ( "eepro", eepro_probe_addrs, eepro_probe1,
+ ISA_DRIVER ( eepro_probe_addrs, eepro_probe1,
GENERIC_ISAPNP_VENDOR, 0x828a );
-BOOT_DRIVER ( "eepro", find_isa_boot_device, eepro_driver, eepro_probe );
+DRIVER ( "eepro", nic_driver, isa_driver, eepro_driver,
+ eepro_probe, eepro_disable );
ISA_ROM ( "eepro", "Intel Etherexpress Pro/10" );
diff --git a/src/drivers/net/eepro100.c b/src/drivers/net/eepro100.c
index b5b5f821..1857a9a1 100644
--- a/src/drivers/net/eepro100.c
+++ b/src/drivers/net/eepro100.c
@@ -603,8 +603,8 @@ static void eepro100_disable ( struct nic *nic __unused ) {
* leaves the 82557 initialized, and ready to recieve packets.
*/
-static int eepro100_probe ( struct dev *dev, struct pci_device *p ) {
- struct nic *nic = nic_device ( dev );
+static int eepro100_probe ( struct nic *nic, struct pci_device *p ) {
+
unsigned short sum = 0;
int i;
int read_cmd, ee_size;
@@ -796,7 +796,7 @@ static struct nic_operations eepro100_operations = {
.poll = eepro100_poll,
.transmit = eepro100_transmit,
.irq = eepro100_irq,
- .disable = eepro100_disable,
+
};
static struct pci_id eepro100_nics[] = {
@@ -837,6 +837,7 @@ PCI_ROM(0x8086, 0x5201, "eepro100-5201", "Intel EtherExpress PRO/100 Intelligent
static struct pci_driver eepro100_driver =
- PCI_DRIVER ( "EEPRO100", eepro100_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( eepro100_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "EEPRO100", find_pci_boot_device, eepro100_driver, eepro100_probe );
+DRIVER ( "EEPRO100", nic_driver, pci_driver, eepro100_driver,
+ eepro100_probe, eepro100_disable );
diff --git a/src/drivers/net/epic100.c b/src/drivers/net/epic100.c
index 32f32b28..ffa2999e 100644
--- a/src/drivers/net/epic100.c
+++ b/src/drivers/net/epic100.c
@@ -50,7 +50,7 @@ struct epic_tx_desc {
static void epic100_open(void);
static void epic100_init_ring(void);
-static void epic100_disable(struct nic *nic);
+static void epic100_disable(struct nic *nic, struct pci_device *pci);
static int epic100_poll(struct nic *nic, int retrieve);
static void epic100_transmit(struct nic *nic, const char *destaddr,
unsigned int type, unsigned int len, const char *data);
@@ -99,8 +99,8 @@ static unsigned char tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
static int
-epic100_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+epic100_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i;
unsigned short* ap;
unsigned int phy, phy_idx;
@@ -115,6 +115,7 @@ epic100_probe ( struct dev *dev, struct pci_device *pci ) {
ioaddr = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* compute all used static epic100 registers address */
@@ -507,7 +508,7 @@ static struct nic_operations epic100_operations = {
.poll = epic100_poll,
.transmit = epic100_transmit,
.irq = epic100_irq,
- .disable = epic100_disable,
+
};
static struct pci_id epic100_nics[] = {
@@ -516,6 +517,7 @@ PCI_ROM(0x10b8, 0x0006, "smc-83c175", "SMC EPIC/C 83c175"),
};
static struct pci_driver epic100_driver =
- PCI_DRIVER ( "EPIC100", epic100_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( epic100_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "EPIC100", find_pci_boot_device, epic100_driver, epic100_probe );
+DRIVER ( "EPIC100", nic_driver, pci_driver, epic100_driver,
+ epic100_probe, epic100_disable );
diff --git a/src/drivers/net/forcedeth.c b/src/drivers/net/forcedeth.c
index 31a5d675..cf2942c6 100644
--- a/src/drivers/net/forcedeth.c
+++ b/src/drivers/net/forcedeth.c
@@ -923,7 +923,7 @@ static struct nic_operations forcedeth_operations = {
.poll = forcedeth_poll,
.transmit = forcedeth_transmit,
.irq = forcedeth_irq,
- .disable = forcedeth_disable,
+
};
static struct pci_id forcedeth_nics[] = {
@@ -933,7 +933,7 @@ static struct pci_id forcedeth_nics[] = {
};
static struct pci_driver forcedeth_driver =
- PCI_DRIVER ( "forcedeth", forcedeth_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( forcedeth_nics, PCI_NO_CLASS );
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
@@ -941,8 +941,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define IORESOURCE_MEM 0x00000200
#define board_found 1
#define valid_link 0
-static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
+
unsigned long addr;
int sz;
u8 *base;
@@ -954,6 +954,7 @@ static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
dev->name, pci->vendor, pci->dev_id);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* point to private storage */
@@ -1035,4 +1036,5 @@ static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
/* else */
}
-BOOT_DRIVER ( "forcedeth", find_pci_boot_device, forcedeth_driver, forcedeth_probe );
+DRIVER ( "forcedeth", nic_driver, pci_driver, forcedeth_driver,
+ forcedeth_probe, forcedeth_disable );
diff --git a/src/drivers/net/mtd80x.c b/src/drivers/net/mtd80x.c
index 26debf06..2bc2f60c 100644
--- a/src/drivers/net/mtd80x.c
+++ b/src/drivers/net/mtd80x.c
@@ -644,7 +644,8 @@ static void mtd_transmit(
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void mtd_disable ( struct nic *nic ) {
+static void mtd_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* put the card in its initial state */
/* Disable Tx Rx*/
outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
@@ -658,7 +659,7 @@ static struct nic_operations mtd_operations = {
.poll = mtd_poll,
.transmit = mtd_transmit,
.irq = dummy_irq,
- .disable = mtd_disable,
+
};
static struct pci_id mtd80x_nics[] = {
@@ -668,14 +669,14 @@ static struct pci_id mtd80x_nics[] = {
};
static struct pci_driver mtd80x_driver =
- PCI_DRIVER ( "MTD80X", mtd80x_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( mtd80x_nics, PCI_NO_CLASS );
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int mtd_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int mtd_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i;
if (pci->ioaddr == 0)
@@ -1086,4 +1087,5 @@ static void getlinktype(struct nic *dev)
}
}
-BOOT_DRIVER ( "MTD80X", find_pci_boot_device, mtd80x_driver, mtd_probe );
+DRIVER ( "MTD80X", nic_driver, pci_driver, mtd80x_driver,
+ mtd_probe, mtd_disable );
diff --git a/src/drivers/net/natsemi.c b/src/drivers/net/natsemi.c
index 6dda7b5b..af5e070e 100644
--- a/src/drivers/net/natsemi.c
+++ b/src/drivers/net/natsemi.c
@@ -213,7 +213,7 @@ static unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE] __attribute__ ((aligned(4)))
/* Function Prototypes */
-static int natsemi_probe(struct dev *dev,struct pci_device *pci);
+static int natsemi_probe(struct nic *nic,struct pci_device *pci);
static int eeprom_read(long addr, int location);
static int mdio_read(int phy_id, int location);
static void natsemi_init(struct nic *nic);
@@ -225,7 +225,7 @@ static void natsemi_set_rx_mode(struct nic *nic);
static void natsemi_check_duplex(struct nic *nic);
static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
static int natsemi_poll(struct nic *nic, int retrieve);
-static void natsemi_disable(struct nic *nic);
+static void natsemi_disable(struct nic *nic, struct pci_device *pci);
static void natsemi_irq(struct nic *nic, irq_action_t action);
/*
@@ -243,9 +243,8 @@ static void natsemi_irq(struct nic *nic, irq_action_t action);
*/
static int
-natsemi_probe ( struct dev *dev, struct pci_device *pci ) {
+natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
int i;
int prev_eedata;
u32 tmp;
@@ -258,6 +257,7 @@ natsemi_probe ( struct dev *dev, struct pci_device *pci ) {
/* initialize some commonly used globals */
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
ioaddr = pci->ioaddr;
@@ -725,7 +725,8 @@ natsemi_poll(struct nic *nic, int retrieve)
*/
static void
-natsemi_disable ( struct nic *nic ) {
+natsemi_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* merge reset and disable */
natsemi_init(nic);
@@ -768,7 +769,7 @@ static struct nic_operations natsemi_operations = {
.poll = natsemi_poll,
.transmit = natsemi_transmit,
.irq = natsemi_irq,
- .disable = natsemi_disable,
+
};
static struct pci_id natsemi_nics[] = {
@@ -776,6 +777,7 @@ PCI_ROM(0x100b, 0x0020, "dp83815", "DP83815"),
};
static struct pci_driver natsemi_driver =
- PCI_DRIVER ( "NATSEMI", natsemi_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( natsemi_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "NATSEMI", find_pci_boot_device, natsemi_driver, natsemi_probe );
+DRIVER ( "NATSEMI", nic_driver, pci_driver, natsemi_driver,
+ natsemi_probe, natsemi_disable );
diff --git a/src/drivers/net/ns83820.c b/src/drivers/net/ns83820.c
index 2df74ac5..6698f4f6 100755
--- a/src/drivers/net/ns83820.c
+++ b/src/drivers/net/ns83820.c
@@ -756,7 +756,8 @@ static void ns83820_transmit(struct nic *nic, const char *d, /* Destination */
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void ns83820_disable ( struct nic *nic ) {
+static void ns83820_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* put the card in its initial state */
/* This function serves 3 purposes.
* This disables DMA and interrupts so we don't receive
@@ -809,7 +810,7 @@ static struct nic_operations ns83820_operations = {
.poll = ns83820_poll,
.transmit = ns83820_transmit,
.irq = ns83820_irq,
- .disable = ns83820_disable,
+
};
static struct pci_id ns83820_nics[] = {
@@ -817,7 +818,7 @@ static struct pci_id ns83820_nics[] = {
};
static struct pci_driver ns83820_driver =
- PCI_DRIVER ( "NS83820/PCI", ns83820_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( ns83820_nics, PCI_NO_CLASS );
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
@@ -825,8 +826,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define board_found 1
#define valid_link 0
-static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
+
int sz;
long addr;
int using_dac = 0;
@@ -852,6 +853,7 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* disable interrupts */
@@ -1016,4 +1018,5 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
return 1;
}
-BOOT_DRIVER ( "NS83820/PCI", find_pci_boot_device, ns83820_driver, ns83820_probe );
+DRIVER ( "NS83820/PCI", nic_driver, pci_driver, ns83820_driver,
+ ns83820_probe, ns83820_disable );
diff --git a/src/drivers/net/pcnet32.c b/src/drivers/net/pcnet32.c
index f0fa0c7b..dfc932e6 100644
--- a/src/drivers/net/pcnet32.c
+++ b/src/drivers/net/pcnet32.c
@@ -666,8 +666,8 @@ static void pcnet32_irq(struct nic *nic __unused, irq_action_t action __unused)
PROBE - Look for an adapter, this routine's visible to the outside
You should omit the last argument struct pci_device * for a non-PCI NIC
***************************************************************************/
-static int pcnet32_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i, media;
int fdx, mii, fset, dxsuflo, ltint;
int chip_version;
@@ -685,6 +685,7 @@ static int pcnet32_probe ( struct dev *dev, struct pci_device *pci ) {
dev->name, pci->vendor, pci->dev_id);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* reset the chip */
@@ -990,7 +991,7 @@ static struct nic_operations pcnet32_operations = {
.poll = pcnet32_poll,
.transmit = pcnet32_transmit,
.irq = pcnet32_irq,
- .disable = pcnet32_disable,
+
};
static struct pci_id pcnet32_nics[] = {
@@ -1000,6 +1001,7 @@ static struct pci_id pcnet32_nics[] = {
};
static struct pci_driver pcnet32_driver =
- PCI_DRIVER ( "PCNET32/PCI", pcnet32_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( pcnet32_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "PCNET32/PCI", find_pci_boot_device, pcnet32_driver, pcnet32_probe );
+DRIVER ( "PCNET32/PCI", nic_driver, pci_driver, pcnet32_driver,
+ pcnet32_probe, pcnet32_disable );
diff --git a/src/drivers/net/r8169.c b/src/drivers/net/r8169.c
index 2ede1976..653489b5 100644
--- a/src/drivers/net/r8169.c
+++ b/src/drivers/net/r8169.c
@@ -707,7 +707,7 @@ static struct nic_operations r8169_operations = {
.poll = r8169_poll,
.transmit = r8169_transmit,
.irq = r8169_irq,
- .disable = r8169_disable,
+
};
static struct pci_id r8169_nics[] = {
@@ -715,7 +715,7 @@ static struct pci_id r8169_nics[] = {
};
static struct pci_driver r8169_driver =
- PCI_DRIVER ( "r8169/PCI", r8169_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( r8169_nics, PCI_NO_CLASS );
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
@@ -723,8 +723,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define board_found 1
#define valid_link 0
-static int r8169_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
+
static int board_idx = -1;
static int printed_version = 0;
int i, rc;
@@ -844,10 +844,12 @@ static int r8169_probe ( struct dev *dev, struct pci_device *pci ) {
r8169_reset(nic);
/* point to NIC specific routines */
nic->nic_op = &r8169_operations;
+ pci_fill_nic ( nic, pci );
nic->irqno = pci->irq;
nic->ioaddr = ioaddr;
return 1;
}
-BOOT_DRIVER ( "r8169/PCI", find_pci_boot_device, r8169_driver, r8169_probe );
+DRIVER ( "r8169/PCI", nic_driver, pci_driver, r8169_driver,
+ r8169_probe, r8169_disable );
diff --git a/src/drivers/net/rtl8139.c b/src/drivers/net/rtl8139.c
index c5fb901b..7aabe93e 100644
--- a/src/drivers/net/rtl8139.c
+++ b/src/drivers/net/rtl8139.c
@@ -172,25 +172,26 @@ static unsigned int cur_rx,cur_tx;
static unsigned char tx_buffer[TX_BUF_SIZE] __attribute__((aligned(4)));
static unsigned char rx_ring[RX_BUF_LEN+16] __attribute__((aligned(4)));
-static int rtl8139_probe(struct dev *dev,struct pci_device *pci);
+static int rtl8139_probe(struct nic *nic,struct pci_device *pci);
static int read_eeprom(struct nic *nic, int location, int addr_len);
static void rtl_reset(struct nic *nic);
static void rtl_transmit(struct nic *nic, const char *destaddr,
unsigned int type, unsigned int len, const char *data);
static int rtl_poll(struct nic *nic, int retrieve);
-static void rtl_disable(struct nic *nic);
+static void rtl_disable(struct nic *nic, struct pci_device *pci);
static void rtl_irq(struct nic *nic, irq_action_t action);
static struct nic_operations rtl_operations;
static struct pci_driver rtl8139_driver;
-static int rtl8139_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int rtl8139_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i;
int speed10, fullduplex;
int addr_len;
unsigned short *ap = (unsigned short*)nic->node_addr;
/* Copy ioaddr and IRQ from PCI information */
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
nic->irqno = pci->irq;
@@ -501,7 +502,8 @@ static void rtl_irq(struct nic *nic, irq_action_t action)
}
}
-static void rtl_disable ( struct nic *nic ) {
+static void rtl_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* merge reset and disable */
rtl_reset(nic);
@@ -519,7 +521,7 @@ static struct nic_operations rtl_operations = {
.poll = rtl_poll,
.transmit = rtl_transmit,
.irq = rtl_irq,
- .disable = rtl_disable,
+
};
static struct pci_id rtl8139_nics[] = {
@@ -540,6 +542,7 @@ PCI_ROM(0xffff, 0x8139, "clone-rtl8139", "Cloned 8139"),
};
static struct pci_driver rtl8139_driver =
- PCI_DRIVER ( "RTL8139", rtl8139_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( rtl8139_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "RTL8139", find_pci_boot_device, rtl8139_driver, rtl8139_probe );
+DRIVER ( "RTL8139", nic_driver, pci_driver, rtl8139_driver,
+ rtl8139_probe, rtl_disable );
diff --git a/src/drivers/net/sis900.c b/src/drivers/net/sis900.c
index 317152e7..ce304eca 100644
--- a/src/drivers/net/sis900.c
+++ b/src/drivers/net/sis900.c
@@ -123,11 +123,11 @@ static struct pci_id pci_isa_bridge_list[] = {
static struct pci_driver sis_bridge_driver =
- PCI_DRIVER ( "sis_bridge", pci_isa_bridge_list, PCI_NO_CLASS );
+ PCI_DRIVER ( pci_isa_bridge_list, PCI_NO_CLASS );
/* Function Prototypes */
-static int sis900_probe(struct dev *dev,struct pci_device *pci);
+static int sis900_probe(struct nic *nic,struct pci_device *pci);
static u16 sis900_read_eeprom(int location);
static void sis900_mdio_reset(long mdio_addr);
@@ -150,7 +150,7 @@ static void sis900_transmit(struct nic *nic, const char *d,
unsigned int t, unsigned int s, const char *p);
static int sis900_poll(struct nic *nic, int retrieve);
-static void sis900_disable(struct nic *nic);
+static void sis900_disable(struct nic *nic, struct pci_device *pci);
static void sis900_irq(struct nic *nic, irq_action_t action);
@@ -309,8 +309,8 @@ static int sis635_get_mac_addr(struct pci_device * pci_dev __unused, struct nic
* Returns: struct nic *: pointer to NIC data structure
*/
-static int sis900_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int sis900_probe ( struct nic *nic, struct pci_device *pci ) {
+
int i;
int found=0;
int phy_addr;
@@ -321,6 +321,7 @@ static int sis900_probe ( struct dev *dev, struct pci_device *pci ) {
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
ioaddr = pci->ioaddr;
vendor = pci->vendor;
@@ -1208,7 +1209,8 @@ sis900_poll(struct nic *nic, int retrieve)
*/
static void
-sis900_disable ( struct nic *nic ) {
+sis900_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* merge reset and disable */
sis900_init(nic);
@@ -1249,7 +1251,7 @@ static struct nic_operations sis900_operations = {
.poll = sis900_poll,
.transmit = sis900_transmit,
.irq = sis900_irq,
- .disable = sis900_disable,
+
};
static struct pci_id sis900_nics[] = {
@@ -1260,4 +1262,5 @@ PCI_ROM(0x1039, 0x7016, "sis7016", "SIS7016"),
static struct pci_driver sis900_driver =
PCI_DRIVER ( "SIS900", sis900_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "SIS900", find_pci_boot_device, sis900_driver, sis900_probe );
+DRIVER ( "SIS900", nic_driver, pci_driver, sis900_driver,
+ sis900_probe, sis900_disable );
diff --git a/src/drivers/net/skel.c b/src/drivers/net/skel.c
index 005295c3..e0ae48fa 100644
--- a/src/drivers/net/skel.c
+++ b/src/drivers/net/skel.c
@@ -163,7 +163,7 @@ static struct nic_operations skel_operations = {
.poll = skel_poll,
.transmit = skel_transmit,
.irq = skel_irq,
- .disable = skel_disable,
+
};
/**************************************************************************
@@ -189,8 +189,11 @@ static struct nic_operations skel_operations = {
* PCI PROBE - Look for an adapter
**************************************************************************
*/
-static int skel_pci_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int skel_pci_probe ( struct nic *nic, struct pci_device *pci ) {
+
+
+ pci_fill_nic ( nic, pci );
+
nic->ioaddr = pci->ioaddr;
nic->irqno = pci->irq;
@@ -213,16 +216,16 @@ PCI_ROM ( 0x0000, 0x0000, "skel-pci", "Skeleton PCI Adapter" ),
};
static struct pci_driver skel_pci_driver =
- PCI_DRIVER ( "SKEL/PCI", skel_pci_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( skel_pci_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "SKEL/PCI", find_pci_boot_device,
- skel_pci_driver, skel_pci_probe );
+DRIVER ( "SKEL/PCI", nic_driver, pci_driver, skel_pci_driver,
+ skel_pci_probe, skel_disable );
/**************************************************************************
* EISA PROBE - Look for an adapter
**************************************************************************
*/
-static int skel_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) {
+static int skel_eisa_probe ( struct nic *nic, struct eisa_device *eisa ) {
struct nic *nic = nic_device ( dev );
enable_eisa_device ( eisa );
@@ -258,7 +261,7 @@ ISA_ROM ( "skel-eisa", "Skeleton EISA Adapter" );
* ISAPnP PROBE - Look for an adapter
**************************************************************************
*/
-static int skel_isapnp_probe ( struct dev *dev,
+static int skel_isapnp_probe ( struct nic *nic,
struct isapnp_device *isapnp ) {
struct nic *nic = nic_device ( dev );
@@ -295,7 +298,7 @@ ISA_ROM ( "skel-isapnp", "Skeleton ISAPnP Adapter" );
* MCA PROBE - Look for an adapter
**************************************************************************
*/
-static int skel_mca_probe ( struct dev *dev,
+static int skel_mca_probe ( struct nic *nic,
struct mca_device *mca __unused ) {
struct nic *nic = nic_device ( dev );
@@ -354,7 +357,7 @@ static int skel_isa_probe_addr ( isa_probe_addr_t ioaddr __unused ) {
return 0;
}
-static int skel_isa_probe ( struct dev *dev, struct isa_device *isa ) {
+static int skel_isa_probe ( struct nic *nic, struct isa_device *isa ) {
struct nic *nic = nic_device ( dev );
nic->ioaddr = isa->ioaddr;
diff --git a/src/drivers/net/smc9000.c b/src/drivers/net/smc9000.c
index 6cadcd0c..c59d9d8e 100644
--- a/src/drivers/net/smc9000.c
+++ b/src/drivers/net/smc9000.c
@@ -346,7 +346,8 @@ static int smc9000_poll(struct nic *nic, int retrieve)
return 0;
}
-static void smc9000_disable ( struct nic *nic ) {
+static void smc9000_disable ( struct nic *nic, struct isa_device *isa __unused ) {
+ nic_disable ( nic );
smc_reset(nic->ioaddr);
/* no more interrupts for me */
@@ -376,15 +377,15 @@ static struct nic_operations smc9000_operations = {
.poll = smc9000_poll,
.transmit = smc9000_transmit,
.irq = smc9000_irq,
- .disable = smc9000_disable,
+
};
/**************************************************************************
* ETH_PROBE - Look for an adapter
***************************************************************************/
-static int smc9000_probe ( struct dev *dev, struct isa_device *isa ) {
- struct nic *nic = nic_device ( dev );
+static int smc9000_probe ( struct nic *nic, struct isa_device *isa ) {
+
unsigned short revision;
int memory;
int media;
@@ -393,6 +394,7 @@ static int smc9000_probe ( struct dev *dev, struct isa_device *isa ) {
int i;
nic->irqno = 0;
+ isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;
/*
@@ -489,10 +491,11 @@ static isa_probe_addr_t smc9000_probe_addrs[] = {
};
static struct isa_driver smc9000_driver =
- ISA_DRIVER ( "SMC9000", smc9000_probe_addrs, smc9000_probe_addr,
+ ISA_DRIVER ( smc9000_probe_addrs, smc9000_probe_addr,
GENERIC_ISAPNP_VENDOR, 0x8228 );
-BOOT_DRIVER ( "SMC9000", find_isa_boot_device, smc9000_driver, smc9000_probe );
+DRIVER ( "SMC9000", nic_driver, isa_driver, smc9000_driver,
+ smc9000_probe, smc9000_disable );
ISA_ROM ( "smc9000", "SMC9000" );
diff --git a/src/drivers/net/sundance.c b/src/drivers/net/sundance.c
index ee7bec55..fc591ec2 100644
--- a/src/drivers/net/sundance.c
+++ b/src/drivers/net/sundance.c
@@ -576,15 +576,15 @@ static struct nic_operations sundance_operations = {
.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 pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
+
u8 ee_data[EEPROM_SIZE];
u16 mii_ctl;
int i;
@@ -740,6 +740,7 @@ static int sundance_probe ( struct dev *dev, struct pci_device *pci ) {
/* point to NIC specific routines */
nic->nic_op = &sundance_operations;
+ pci_fill_nic ( nic, pci );
nic->irqno = pci->irq;
nic->ioaddr = BASE;
@@ -884,6 +885,7 @@ static struct pci_id sundance_nics[] = {
};
static struct pci_driver sundance_driver =
- PCI_DRIVER ( "SUNDANCE/PCI", sundance_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( sundance_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "SUNDANCE/PCI", find_pci_boot_device, sundance_driver, sundance_probe );
+DRIVER ( "SUNDANCE/PCI", nic_driver, pci_driver, sundance_driver,
+ sundance_probe, sundance_disable );
diff --git a/src/drivers/net/tg3.c b/src/drivers/net/tg3.c
index e4e67136..56423391 100644
--- a/src/drivers/net/tg3.c
+++ b/src/drivers/net/tg3.c
@@ -3224,15 +3224,15 @@ static struct nic_operations tg3_operations = {
.poll = tg3_poll,
.transmit = tg3_transmit,
.irq = tg3_irq,
- .disable = tg3_disable,
+
};
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
You should omit the last argument struct pci_device * for a non-PCI NIC
***************************************************************************/
-static int tg3_probe ( struct dev *dev, struct pci_device *pdev ) {
- struct nic *nic = nic_device ( dev );
+static int tg3_probe ( struct nic *nic, struct pci_device *pdev ) {
+
struct tg3 *tp = &tg3;
unsigned long tg3reg_base, tg3reg_len;
int i, err, pm_cap;
@@ -3385,6 +3385,7 @@ PCI_ROM(0x173b, 0x03eb, "tg3-ac1003", "Altima AC1003"),
};
static struct pci_driver tg3_driver =
- PCI_DRIVER ( "TG3", tg3_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( tg3_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "TG3", find_pci_boot_device, tg3_driver, tg3_probe );
+DRIVER ( "TG3", nic_driver, pci_driver, tg3_driver,
+ tg3_probe, tg3_disable );
diff --git a/src/drivers/net/tlan.c b/src/drivers/net/tlan.c
index 3041dcfe..274e3fa5 100644
--- a/src/drivers/net/tlan.c
+++ b/src/drivers/net/tlan.c
@@ -756,7 +756,7 @@ static struct nic_operations tlan_operations = {
.poll = tlan_poll,
.transmit = tlan_transmit,
.irq = tlan_irq,
- .disable = tlan_disable,
+
};
static void TLan_SetMulticastList(struct nic *nic) {
@@ -781,8 +781,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define board_found 1
#define valid_link 0
-static int tlan_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
+
u16 data = 0;
int err;
int i;
@@ -791,6 +791,7 @@ static int tlan_probe ( struct dev *dev, struct pci_device *pci ) {
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
BASE = pci->ioaddr;
@@ -1715,6 +1716,7 @@ static struct pci_id tlan_nics[] = {
};
static struct pci_driver tlan_driver =
- PCI_DRIVER ( "TLAN/PCI", tlan_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( tlan_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "TLAN/PCI", find_pci_boot_device, tlan_driver, tlan_probe );
+DRIVER ( "TLAN/PCI", nic_driver, pci_driver, tlan_driver,
+ tlan_probe, tlan_disable );
diff --git a/src/drivers/net/tulip.c b/src/drivers/net/tulip.c
index ecd5b017..03e039a1 100644
--- a/src/drivers/net/tulip.c
+++ b/src/drivers/net/tulip.c
@@ -486,13 +486,13 @@ static int mdio_read(struct nic *nic, int phy_id, int location);
static void mdio_write(struct nic *nic, int phy_id, int location, int value);
static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
static void parse_eeprom(struct nic *nic);
-static int tulip_probe(struct dev *dev,struct pci_device *pci);
+static int tulip_probe(struct nic *nic,struct pci_device *pci);
static void tulip_init_ring(struct nic *nic);
static void tulip_reset(struct nic *nic);
static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
unsigned int s, const char *p);
static int tulip_poll(struct nic *nic, int retrieve);
-static void tulip_disable(struct nic *nic);
+static void tulip_disable(struct nic *nic, struct pci_device *pci);
static void nway_start(struct nic *nic);
static void pnic_do_nway(struct nic *nic);
static void select_media(struct nic *nic, int startup);
@@ -1180,7 +1180,8 @@ static int tulip_poll(struct nic *nic, int retrieve)
/*********************************************************************/
/* eth_disable - Disable the interface */
/*********************************************************************/
-static void tulip_disable ( struct nic *nic ) {
+static void tulip_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+nic_disable ( nic );
#ifdef TULIP_DEBUG_WHERE
whereami("tulip_disable\n");
#endif
@@ -1218,14 +1219,14 @@ static struct nic_operations tulip_operations = {
.poll = tulip_poll,
.transmit = tulip_transmit,
.irq = tulip_irq,
- .disable = tulip_disable,
+
};
/*********************************************************************/
/* eth_probe - Look for an adapter */
/*********************************************************************/
-static int tulip_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int tulip_probe ( struct nic *nic, struct pci_device *pci ) {
+
u32 i;
u8 chip_rev;
u8 ee_data[EEPROM_SIZE];
@@ -1237,6 +1238,7 @@ static int tulip_probe ( struct dev *dev, struct pci_device *pci ) {
return 0;
ioaddr = pci->ioaddr;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
nic->irqno = 0;
@@ -2074,6 +2076,7 @@ PCI_ROM(0x1737, 0xab09, "tulip-ab09", "Tulip 0x1737 0xab09"),
};
static struct pci_driver tulip_driver =
- PCI_DRIVER ( "Tulip", tulip_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( tulip_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "Tulip", find_pci_boot_device, tulip_driver, tulip_probe );
+DRIVER ( "Tulip", nic_driver, pci_driver, tulip_driver,
+ tulip_probe, tulip_disable );
diff --git a/src/drivers/net/via-rhine.c b/src/drivers/net/via-rhine.c
index f3bfc052..591f24aa 100644
--- a/src/drivers/net/via-rhine.c
+++ b/src/drivers/net/via-rhine.c
@@ -685,7 +685,7 @@ static int ReadMII (int byMIIIndex, int);
static void WriteMII (char, char, char, int);
static void MIIDelay (void);
static void rhine_init_ring (struct nic *dev);
-static void rhine_disable (struct nic *nic);
+static void rhine_disable (struct nic *nic, struct pci_device *pci);
static void rhine_reset (struct nic *nic);
static int rhine_poll (struct nic *nic, int retreive);
static void rhine_transmit (struct nic *nic, const char *d, unsigned int t,
@@ -954,8 +954,8 @@ static struct nic_operations rhine_operations;
static struct pci_driver rhine_driver;
static int
-rhine_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+rhine_probe ( struct nic *nic, struct pci_device *pci ) {
+
struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
if (!pci->ioaddr)
@@ -965,6 +965,7 @@ rhine_probe ( struct dev *dev, struct pci_device *pci ) {
adjust_pci_device ( pci );
rhine_reset (nic);
nic->nic_op = &rhine_operations;
+ pci_fill_nic ( nic, pci );
nic->irqno = pci->irq;
nic->ioaddr = tp->ioaddr;
return 1;
@@ -1157,7 +1158,8 @@ rhine_probe1 (struct nic *nic, struct pci_device *pci, int ioaddr, int chip_id,
}
static void
-rhine_disable ( struct nic *nic ) {
+rhine_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
int ioaddr = tp->ioaddr;
@@ -1406,7 +1408,7 @@ static struct nic_operations rhine_operations = {
.poll = rhine_poll,
.transmit = rhine_transmit,
.irq = rhine_irq,
- .disable = rhine_disable,
+
};
static struct pci_id rhine_nics[] = {
@@ -1418,8 +1420,9 @@ PCI_ROM(0x1106, 0x6100, "via-rhine-old", "VIA 86C100A"), /* Rhine-II */
};
static struct pci_driver rhine_driver =
- PCI_DRIVER ( "VIA 86C100", rhine_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( rhine_nics, PCI_NO_CLASS );
-BOOT_DRIVER ( "VIA 86C100", find_pci_boot_device, rhine_driver, rhine_probe );
+DRIVER ( "VIA 86C100", nic_driver, pci_driver, rhine_driver,
+ rhine_probe, rhine_disable );
/* EOF via-rhine.c */
diff --git a/src/drivers/net/w89c840.c b/src/drivers/net/w89c840.c
index 88f68bb6..d3686d5e 100644
--- a/src/drivers/net/w89c840.c
+++ b/src/drivers/net/w89c840.c
@@ -579,7 +579,8 @@ static void w89c840_transmit(
/**************************************************************************
w89c840_disable - Turn off ethernet interface
***************************************************************************/
-static void w89c840_disable ( struct nic *nic ) {
+static void w89c840_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* merge reset and disable */
w89c840_reset(nic);
@@ -609,7 +610,7 @@ static struct nic_operations w89c840_operations = {
.poll = w89c840_poll,
.transmit = w89c840_transmit,
.irq = w89c840_irq,
- .disable = w89c840_disable,
+
};
static struct pci_id w89c840_nics[] = {
@@ -618,13 +619,13 @@ PCI_ROM(0x11f6, 0x2011, "compexrl100atx", "Compex RL100ATX"),
};
static struct pci_driver w89c840_driver =
- PCI_DRIVER ( "W89C840F", w89c840_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( w89c840_nics, PCI_NO_CLASS );
/**************************************************************************
w89c840_probe - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int w89c840_probe ( struct dev *dev, struct pci_device *p ) {
- struct nic *nic = nic_device ( dev );
+static int w89c840_probe ( struct nic *nic, struct pci_device *p ) {
+
u16 sum = 0;
int i, j;
@@ -954,4 +955,5 @@ static void init_ring(void)
}
-BOOT_DRIVER ( "W89C840F", find_pci_boot_device, w89c840_driver, w89c840_probe );
+DRIVER ( "W89C840F", nic_driver, pci_driver, w89c840_driver,
+ w89c840_probe, w89c840_disable );