Skip to content

Commit

Permalink
Automatically updated with the program
Browse files Browse the repository at this point in the history
#!/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;
  • Loading branch information
Michael Brown committed Apr 21, 2005
1 parent cfe3a66 commit 614c39a
Show file tree
Hide file tree
Showing 26 changed files with 225 additions and 162 deletions.
18 changes: 11 additions & 7 deletions src/drivers/net/3c515.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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" );
15 changes: 9 additions & 6 deletions src/drivers/net/3c595.c
Expand Up @@ -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);
Expand All @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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[] = {
Expand All @@ -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:
Expand Down
13 changes: 8 additions & 5 deletions src/drivers/net/3c90x.c
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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 );
19 changes: 11 additions & 8 deletions src/drivers/net/davicom.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand All @@ -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 */
Expand Down Expand Up @@ -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[] = {
Expand All @@ -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 );
15 changes: 9 additions & 6 deletions src/drivers/net/depca.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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" );
12 changes: 7 additions & 5 deletions src/drivers/net/dmfe.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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[] = {
Expand All @@ -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 );
11 changes: 6 additions & 5 deletions src/drivers/net/e1000.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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 );
15 changes: 9 additions & 6 deletions src/drivers/net/eepro.c
Expand Up @@ -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);
Expand Down Expand Up @@ -534,21 +535,22 @@ 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];
unsigned short saddr[ETH_ALEN/2];
} station_addr;

nic->irqno = 0;
isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;

station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
Expand Down Expand Up @@ -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" );
11 changes: 6 additions & 5 deletions src/drivers/net/eepro100.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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 );

0 comments on commit 614c39a

Please sign in to comment.