35 "lne390.c: Driver revision v0.99.1, 01/09/2000\n";
37 #include <linux/module.h>
39 #include <linux/kernel.h>
40 #include <linux/errno.h>
41 #include <linux/string.h>
45 #include <linux/netdevice.h>
52 #define DRV_NAME "lne390"
60 static void lne390_block_output(
struct net_device *
dev,
int count,
const unsigned char *
buf,
const int start_page);
62 #define LNE390_START_PG 0x00
63 #define LNE390_STOP_PG 0x80
65 #define LNE390_ID_PORT 0xc80
66 #define LNE390_IO_EXTENT 0x20
67 #define LNE390_SA_PROM 0x16
68 #define LNE390_RESET_PORT 0xc84
69 #define LNE390_NIC_OFFSET 0x00
71 #define LNE390_ADDR0 0x00
72 #define LNE390_ADDR1 0x80
73 #define LNE390_ADDR2 0xe5
75 #define LNE390_ID0 0x10009835
76 #define LNE390_ID1 0x11009835
78 #define LNE390_CFG1 0xc84
79 #define LNE390_CFG2 0xc90
87 #define LNE390_D_PROBE 0x01
88 #define LNE390_D_RX_PKT 0x02
89 #define LNE390_D_TX_PKT 0x04
90 #define LNE390_D_IRQ 0x08
92 #define LNE390_DEBUG 0
95 static unsigned int shmem_mapA[]
__initdata = {0xff, 0xfe, 0xfd, 0xfff, 0xffe, 0xffc, 0x0d, 0x0};
96 static unsigned int shmem_mapB[]
__initdata = {0xff, 0xfe, 0x0e, 0xfff, 0xffe, 0xffc, 0x0d, 0x0};
111 if (ioaddr > 0x1ff) {
114 ret = lne390_probe1(dev, ioaddr);
123 #if LNE390_DEBUG & LNE390_D_PROBE
124 printk(
"lne390-debug: Not an EISA bus. Not probing high ports.\n");
130 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
133 if (lne390_probe1(dev, ioaddr) == 0)
155 err = do_lne390_probe(dev);
168 unsigned long eisa_id;
172 #if LNE390_DEBUG & LNE390_D_PROBE
174 printk(
"lne390-debug: config regs: %#x %#x\n",
185 revision = (eisa_id >> 24) & 0x01;
192 printk(
"lne390.c: card not found");
195 printk(
" (invalid prefix).\n");
202 printk(
"lne390.c: LNE390%X in EISA slot %d, address %pM.\n",
203 0xa+revision, ioaddr/0x1000, dev->
dev_addr);
214 if (dev->
irq == 2) dev->
irq = 9;
220 printk (
" unable to get IRQ %d.\n", dev->
irq);
228 dev->
mem_start = shmem_mapB[mem_reg] * 0x10000;
230 dev->
mem_start = shmem_mapA[mem_reg] * 0x10000;
238 printk(
"%dkB memory at physical address %#lx\n",
249 printk(
KERN_ERR "lne390.c: Unable to remap card memory above 1MB !!\n");
250 printk(
KERN_ERR "lne390.c: Try using EISA SCU to set memory below 1MB.\n");
255 printk(
"lne390.c: remapped %dkB card memory to virtual address %p\n",
273 ei_status.reset_8390 = &lne390_reset_8390;
274 ei_status.block_input = &lne390_block_input;
275 ei_status.block_output = &lne390_block_output;
276 ei_status.get_8390_hdr = &lne390_get_8390_hdr;
298 static void lne390_reset_8390(
struct net_device *dev)
359 static void lne390_block_output(
struct net_device *dev,
int count,
360 const unsigned char *
buf,
int start_page)
364 count = (count + 3) & ~3;
370 #define MAX_LNE_CARDS 4
371 static struct net_device *dev_lne[MAX_LNE_CARDS];
372 static int io[MAX_LNE_CARDS];
373 static int irq[MAX_LNE_CARDS];
374 static int mem[MAX_LNE_CARDS];
388 int this_dev, found = 0;
390 for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {
391 if (io[this_dev] == 0 && this_dev != 0)
393 dev = alloc_ei_netdev();
396 dev->
irq = irq[this_dev];
399 if (do_lne390_probe(dev) == 0) {
400 dev_lne[found++] =
dev;
412 static void cleanup_card(
struct net_device *dev)
423 for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {