From e596c42adeb8c5dd73e5494a7acd2cd75328ff08 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 22 Apr 2005 11:57:35 +0000 Subject: [PATCH] Updated to current API. --- src/drivers/net/3c509-eisa.c | 18 ++++++++++-------- src/drivers/net/3c509.h | 2 +- src/drivers/net/3c515.c | 13 +++++-------- src/drivers/net/3c529.c | 17 +++++++++++------ src/drivers/net/3c5x9.c | 5 ++--- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/drivers/net/3c509-eisa.c b/src/drivers/net/3c509-eisa.c index a0cda042..33861769 100644 --- a/src/drivers/net/3c509-eisa.c +++ b/src/drivers/net/3c509-eisa.c @@ -13,26 +13,28 @@ * The EISA probe function * */ -static int el3_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) { - struct nic *nic = nic_device ( dev ); +static int el3_eisa_probe ( struct nic *nic, struct eisa_device *eisa ) { enable_eisa_device ( eisa ); - nic->ioaddr = eisa->ioaddr; - nic->irqno = 0; - printf ( "3C5x9 board on EISA at %#hx - ", nic->ioaddr ); + eisa_fill_nic ( nic, eisa ); /* Hand off to generic t5x9 probe routine */ return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK ); } +static void el3_eisa_disable ( struct nic *nic, struct eisa_device *eisa ) { + t5x9_disable ( nic ); + disable_eisa_device ( eisa ); +} + static struct eisa_id el3_eisa_adapters[] = { { "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID }, }; static struct eisa_driver el3_eisa_driver = - EISA_DRIVER ( "3c509 (EISA)", el3_eisa_adapters ); + EISA_DRIVER ( el3_eisa_adapters ); -BOOT_DRIVER ( "3c509 (EISA)", find_eisa_boot_device, el3_eisa_driver, - el3_eisa_probe ); +DRIVER ( "3c509 (EISA)", nic_driver, eisa_driver, el3_eisa_driver, + el3_eisa_probe, el3_eisa_disable ); ISA_ROM ( "3c509-eisa","3c509 (EISA)" ); diff --git a/src/drivers/net/3c509.h b/src/drivers/net/3c509.h index 1f29f1e5..dbc206b4 100644 --- a/src/drivers/net/3c509.h +++ b/src/drivers/net/3c509.h @@ -379,7 +379,7 @@ */ extern int t5x9_probe ( struct nic *nic, uint16_t prod_id_check, uint16_t prod_id_mask ); - +extern void t5x9_disable ( struct nic *nic ); /* * Local variables: diff --git a/src/drivers/net/3c515.c b/src/drivers/net/3c515.c index 4e32ea7e..10157ad2 100644 --- a/src/drivers/net/3c515.c +++ b/src/drivers/net/3c515.c @@ -565,7 +565,8 @@ static void t515_transmit(struct nic *nic, const char *d, /* Destination */ /************************************************************************** DISABLE - Turn off ethernet interface ***************************************************************************/ -static void t515_disable ( struct nic *nic, struct isapnp_device *isapnp __unused ) { +static void t515_disable ( struct nic *nic, + struct isapnp_device *isapnp ) { nic_disable ( nic ); @@ -586,12 +587,8 @@ static void t515_disable ( struct nic *nic, struct isapnp_device *isapnp __unuse outw(SetIntrEnb | 0x0000, nic->ioaddr + EL3_CMD); -#ifdef ISA_PNP - /*Deactivate */ -/* ACTIVATE; - WRITE_DATA(0); - */ -#endif + + deactivate_isapnp_device ( isapnp ); return; } @@ -627,7 +624,7 @@ static int t515_probe ( struct nic *nic, struct isapnp_device *isapnp ) { nic->ioaddr = isapnp->ioaddr; nic->irqno = isapnp->irqno; - activate_isapnp_device ( isapnp, 1 ); + activate_isapnp_device ( isapnp ); /* Check the resource configuration for a matching ioaddr. */ if ((unsigned)(inw(nic->ioaddr + 0x2002) & 0x1f0) diff --git a/src/drivers/net/3c529.c b/src/drivers/net/3c529.c index c8ad99b7..df5e57a0 100644 --- a/src/drivers/net/3c529.c +++ b/src/drivers/net/3c529.c @@ -20,19 +20,23 @@ * */ -static int t529_probe ( struct dev *dev, struct mca_device *mca ) { - struct nic *nic = nic_device ( dev ); +static int t529_probe ( struct nic *nic, struct mca_device *mca ) { /* Retrieve NIC parameters from MCA device parameters */ + mca_fill_nic ( nic, mca ); nic->ioaddr = ( ( mca->pos[4] & 0xfc ) | 0x02 ) << 8; nic->irqno = mca->pos[5] & 0x0f; - printf ( "%s board found on MCA at %#hx IRQ %d -", - dev->name, nic->ioaddr, nic->irqno ); + printf ( "3c529 board found on MCA at %#hx IRQ %d -", + nic->ioaddr, nic->irqno ); /* Hand off to generic t5x9 probe routine */ return t5x9_probe ( nic, MCA_ID ( mca ), 0xffff ); } +static int t529_disable ( struct nic *nic, struct mca_device *mca __unused ) { + t5x9_disable ( nic ); +} + static struct mca_id el3_mca_adapters[] = { { "3Com 3c529 EtherLink III (10base2)", 0x627c }, { "3Com 3c529 EtherLink III (10baseT)", 0x627d }, @@ -42,8 +46,9 @@ static struct mca_id el3_mca_adapters[] = { }; static struct mca_driver t529_driver - = MCA_DRIVER ( "3c529", el3_mca_adapters ); + = MCA_DRIVER ( el3_mca_adapters ); -BOOT_DRIVER ( "3c529", find_mca_boot_device, t529_driver, t529_probe ); +DRIVER ( "3c529", nic_driver, mca_driver, t529_driver, + t529_probe, t529_disable ); ISA_ROM( "3c529", "3c529 == MCA 3c509" ); diff --git a/src/drivers/net/3c5x9.c b/src/drivers/net/3c5x9.c index 414c385e..1e0fad80 100644 --- a/src/drivers/net/3c5x9.c +++ b/src/drivers/net/3c5x9.c @@ -35,7 +35,7 @@ static enum { none, bnc, utp } connector = none; /* for 3C509 */ /************************************************************************** ETH_RESET - Reset adapter ***************************************************************************/ -static void t509_disable ( struct nic *nic ) { +void t5x9_disable ( struct nic *nic ) { /* stop card */ outw(RX_DISABLE, nic->ioaddr + EP_COMMAND); outw(RX_DISCARD_TOP_PACK, nic->ioaddr + EP_COMMAND); @@ -120,7 +120,7 @@ static void t509_enable ( struct nic *nic ) { } static void t509_reset ( struct nic *nic ) { - t509_disable ( nic ); + t5x9_disable ( nic ); t509_enable ( nic ); } @@ -332,7 +332,6 @@ struct nic_operations t509_operations = { .poll = t509_poll, .transmit = t509_transmit, .irq = t509_irq, - .disable = t509_disable, }; /**************************************************************************