49 "es3210.c: Driver revision v0.03, 14/09/96\n";
51 #include <linux/module.h>
53 #include <linux/kernel.h>
54 #include <linux/errno.h>
55 #include <linux/string.h>
58 #include <linux/netdevice.h>
71 static void es_block_output(
struct net_device *
dev,
int count,
const unsigned char *
buf,
int start_page);
73 #define ES_START_PG 0x00
74 #define ES_STOP_PG 0x40
76 #define ES_IO_EXTENT 0x37
77 #define ES_ID_PORT 0xc80
78 #define ES_SA_PROM 0xc90
79 #define ES_RESET_PORT 0xc84
80 #define ES_NIC_OFFSET 0xca0
92 #define ES_EISA_ID1 0x01012949
93 #define ES_EISA_ID2 0x02012949
100 #define ES_CFG6 0xc84
108 #define ES_D_PROBE 0x01
109 #define ES_D_RX_PKT 0x02
110 #define ES_D_TX_PKT 0x04
111 #define ED_D_IRQ 0x08
115 static unsigned char lo_irq_map[]
__initdata = {3, 4, 5, 6, 7, 9, 10};
116 static unsigned char hi_irq_map[]
__initdata = {11, 12, 0, 14, 0, 0, 0, 15};
131 return es_probe1(dev, ioaddr);
136 #if ES_DEBUG & ES_D_PROBE
137 printk(
"es3210.c: Not EISA bus. Not probing high ports.\n");
143 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
144 if (es_probe1(dev, ioaddr) == 0)
165 err = do_es_probe(dev);
178 unsigned long eisa_id;
183 #if ES_DEBUG & ES_D_PROBE
185 printk(
"es3210.c: config regs: %#x %#x %#x %#x %#x %#x\n",
204 printk(
"es3210.c: card not found %pM (invalid_prefix).\n",
210 printk(
"es3210.c: ES3210 rev. %ld at %#x, node %pM",
211 eisa_id>>24, ioaddr, dev->
dev_addr);
215 unsigned char hi_irq =
inb(ioaddr +
ES_CFG2) & 0x07;
216 unsigned char lo_irq =
inb(ioaddr +
ES_CFG1) & 0xfe;
219 dev->
irq = hi_irq_map[hi_irq - 1];
222 while (lo_irq > (1<<i)) i++;
223 dev->
irq = lo_irq_map[
i];
226 #if ES_DEBUG & ES_D_PROBE
227 printk(
"es3210.c: hi_irq %#x, lo_irq %#x, dev->irq = %d\n",
228 hi_irq, lo_irq, dev->
irq);
237 printk (
" unable to get IRQ %d.\n", dev->
irq);
243 unsigned char mem_enabled =
inb(ioaddr +
ES_CFG2) & 0xc0;
244 unsigned char mem_bits =
inb(ioaddr +
ES_CFG3) & 0x07;
246 if (mem_enabled != 0x80) {
247 printk(
" shared mem disabled - giving up\n");
251 dev->
mem_start = 0xC0000 + mem_bits*0x4000;
259 printk(
"ioremap failed - giving up\n");
268 #if ES_DEBUG & ES_D_PROBE
270 printk(
"es3210: Warning - DMA channel enabled, but not used here.\n");
286 ei_status.block_output = &es_block_output;
287 ei_status.get_8390_hdr = &es_get_8390_hdr;
308 static void es_reset_8390(
struct net_device *dev)
317 while ((
signed)(end - jiffies) > 0)
continue;
370 static void es_block_output(
struct net_device *dev,
int count,
371 const unsigned char *
buf,
int start_page)
375 count = (count + 3) & ~3;
380 #define MAX_ES_CARDS 4
382 static struct net_device *dev_es3210[MAX_ES_CARDS];
383 static int io[MAX_ES_CARDS];
384 static int irq[MAX_ES_CARDS];
385 static int mem[MAX_ES_CARDS];
399 int this_dev, found = 0;
401 for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) {
402 if (io[this_dev] == 0 && this_dev != 0)
404 dev = alloc_ei_netdev();
407 dev->
irq = irq[this_dev];
410 if (do_es_probe(dev) == 0) {
411 dev_es3210[found++] =
dev;
423 static void cleanup_card(
struct net_device *dev)
435 for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) {
436 struct net_device *dev = dev_es3210[this_dev];