/**************************************************************************
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);
.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 );
};
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" );
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);
/**************************************************************************
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;
eth_nic_base = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
GO_WINDOW(0);
.poll = t595_poll,
.transmit = t595_transmit,
.irq = t595_irq,
- .disable = t595_disable,
+
};
static struct pci_id t595_nics[] = {
};
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:
*** 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;
adjust_pci_device(pci);
+ pci_fill_nic ( nic, pci );
+
nic->ioaddr = pci->ioaddr;
nic->irqno = 0;
.poll = a3c90x_poll,
.transmit = a3c90x_transmit,
.irq = a3c90x_irq,
- .disable = a3c90x_disable,
+
};
static struct pci_id a3c90x_nics[] = {
};
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 );
/*********************************************************************/
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 */
/*********************************************************************/
/* 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);
/*********************************************************************/
/* 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");
ioaddr = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* wakeup chip */
.poll = davicom_poll,
.transmit = davicom_transmit,
.irq = davicom_irq,
- .disable = davicom_disable,
+
};
static struct pci_id davicom_nics[] = {
};
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 );
/**************************************************************************
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);
.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++) {
};
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" );
#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;
dmfe_reset(nic);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* point to NIC specific routines */
.poll = dmfe_poll,
.transmit = dmfe_transmit,
.irq = dmfe_irq,
- .disable = dmfe_disable,
+
};
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 );
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;
.poll = e1000_poll,
.transmit = e1000_transmit,
.irq = e1000_irq,
- .disable = e1000_disable,
+
};
static struct pci_id e1000_nics[] = {
};
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 );
/**************************************************************************
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);
.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];
} station_addr;
nic->irqno = 0;
+ isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;
station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
};
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" );
* 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;
.poll = eepro100_poll,
.transmit = eepro100_transmit,
.irq = eepro100_irq,
- .disable = eepro100_disable,
+
};
static struct pci_id eepro100_nics[] = {
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 );
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);
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;
ioaddr = pci->ioaddr;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* compute all used static epic100 registers address */
.poll = epic100_poll,
.transmit = epic100_transmit,
.irq = epic100_irq,
- .disable = epic100_disable,
+
};
static struct pci_id epic100_nics[] = {
};
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 );
.poll = forcedeth_poll,
.transmit = forcedeth_transmit,
.irq = forcedeth_irq,
- .disable = forcedeth_disable,
+
};
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
#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;
dev->name, pci->vendor, pci->dev_id);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
/* point to private storage */
/* else */
}
-BOOT_DRIVER ( "forcedeth", find_pci_boot_device, forcedeth_driver, forcedeth_probe );
+DRIVER ( "forcedeth", nic_driver, pci_driver, forcedeth_driver,
+ forcedeth_probe, forcedeth_disable );
/**************************************************************************
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);
.poll = mtd_poll,
.transmit = mtd_transmit,
.irq = dummy_irq,
- .disable = mtd_disable,
+
};
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)
}
}
-BOOT_DRIVER ( "MTD80X", find_pci_boot_device, mtd80x_driver, mtd_probe );
+DRIVER ( "MTD80X", nic_driver, pci_driver, mtd80x_driver,
+ mtd_probe, mtd_disable );
/* 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);
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);
/*
*/
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;
/* initialize some commonly used globals */
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
ioaddr = pci->ioaddr;
*/
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);
.poll = natsemi_poll,
.transmit = natsemi_transmit,
.irq = natsemi_irq,
- .disable = natsemi_disable,
+
};
static struct pci_id natsemi_nics[] = {
};
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 );
/**************************************************************************
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
.poll = ns83820_poll,
.transmit = ns83820_transmit,
.irq = ns83820_irq,
- .disable = ns83820_disable,
+
};
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
#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;
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* disable interrupts */
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 );
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;
dev->name, pci->vendor, pci->dev_id);
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* reset the chip */
.poll = pcnet32_poll,
.transmit = pcnet32_transmit,
.irq = pcnet32_irq,
- .disable = pcnet32_disable,
+
};
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 );
.poll = r8169_poll,
.transmit = r8169_transmit,
.irq = r8169_irq,
- .disable = r8169_disable,
+
};
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
#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;
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 );
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;
}
}
-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);
.poll = rtl_poll,
.transmit = rtl_transmit,
.irq = rtl_irq,
- .disable = rtl_disable,
+
};
static struct pci_id rtl8139_nics[] = {
};
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 );
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);
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);
* 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;
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
ioaddr = pci->ioaddr;
vendor = pci->vendor;
*/
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);
.poll = sis900_poll,
.transmit = sis900_transmit,
.irq = sis900_irq,
- .disable = sis900_disable,
+
};
static struct pci_id sis900_nics[] = {
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 );
.poll = skel_poll,
.transmit = skel_transmit,
.irq = skel_irq,
- .disable = skel_disable,
+
};
/**************************************************************************
* 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;
};
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 );
* 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 );
* 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 );
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;
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 */
.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;
int i;
nic->irqno = 0;
+ isa_fill_nic ( nic, isa );
nic->ioaddr = isa->ioaddr;
/*
};
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" );
.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;
/* point to NIC specific routines */
nic->nic_op = &sundance_operations;
+ pci_fill_nic ( nic, pci );
nic->irqno = pci->irq;
nic->ioaddr = BASE;
};
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 );
.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;
};
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 );
.poll = tlan_poll,
.transmit = tlan_transmit,
.irq = tlan_irq,
- .disable = tlan_disable,
+
};
static void TLan_SetMulticastList(struct nic *nic) {
#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;
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr;
BASE = pci->ioaddr;
};
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 );
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);
/*********************************************************************/
/* 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
.poll = tulip_poll,
.transmit = tulip_transmit,
.irq = tulip_irq,
- .disable = tulip_disable,
+
};
\f
/*********************************************************************/
/* 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];
return 0;
ioaddr = pci->ioaddr;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
nic->irqno = 0;
};
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 );
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,
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)
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;
}
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;
.poll = rhine_poll,
.transmit = rhine_transmit,
.irq = rhine_irq,
- .disable = rhine_disable,
+
};
static struct pci_id rhine_nics[] = {
};
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 */
/**************************************************************************
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);
.poll = w89c840_poll,
.transmit = w89c840_transmit,
.irq = w89c840_irq,
- .disable = w89c840_disable,
+
};
static struct pci_id w89c840_nics[] = {
};
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;
}
-BOOT_DRIVER ( "W89C840F", find_pci_boot_device, w89c840_driver, w89c840_probe );
+DRIVER ( "W89C840F", nic_driver, pci_driver, w89c840_driver,
+ w89c840_probe, w89c840_disable );