27 #include <linux/module.h>
29 #include <linux/kernel.h>
30 #include <linux/errno.h>
31 #include <linux/string.h>
32 #include <linux/netdevice.h>
42 #define DRV_NAME "ac3200"
45 #define AC_NIC_BASE 0x00
46 #define AC_SA_PROM 0x16
50 #define AC_ID_PORT 0xC80
51 #define AC_EISA_ID 0x0110d305
52 #define AC_RESET_PORT 0xC84
54 #define AC_ENABLE 0x01
55 #define AC_CONFIG 0xC90
57 #define AC_IO_EXTENT 0x20
67 static unsigned char config2irqmap[8]
__initdata = {15, 12, 11, 10, 9, 7, 5, 3};
68 static int addrmap[8] =
69 {0xFF0000, 0xFE0000, 0xFD0000, 0xFFF0000, 0xFFE0000, 0xFFC0000, 0xD0000, 0 };
70 static const char *
port_name[4] = {
"10baseT",
"invalid",
"AUI",
"10base2"};
72 #define config2irq(configval) config2irqmap[((configval) >> 3) & 7]
73 #define config2mem(configval) addrmap[(configval) & 7]
74 #define config2name(configval) port_name[((configval) >> 6) & 3]
77 #define AC_START_PG 0x00
78 #define AC_STOP_PG 0x80
87 const unsigned char *
buf,
const int start_page);
107 return ac_probe1(ioaddr, dev);
114 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
115 if (ac_probe1(ioaddr, dev) == 0)
136 err = do_ac3200_probe(dev);
148 .ndo_stop = ac_close_card,
157 #ifdef CONFIG_NET_POLL_CONTROLLER
158 .ndo_poll_controller = ei_poll,
179 #ifndef final_version
181 " EISA ID %02x %02x %02x %02x.\n",
inb(ioaddr +
AC_CONFIG),
186 for (i = 0; i < 6; i++)
196 printk(
", not found (invalid prefix).\n");
213 printk (
" nothing! Unable to get IRQ %d.\n", dev->
irq);
223 for (i = 0; i < 7; i++)
235 printk(
"%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
246 printk(
KERN_ERR "ac3200.c: Unable to remap card memory above 1MB !!\n");
247 printk(
KERN_ERR "ac3200.c: Try using EISA SCU to set memory below 1MB.\n");
252 printk(
"ac3200.c: remapped %dkB card memory to virtual address %p\n",
269 ei_status.block_output = &ac_block_output;
270 ei_status.get_8390_hdr = &ac_get_8390_hdr;
300 static void ac_reset_8390(
struct net_device *dev)
343 static void ac_block_output(
struct net_device *dev,
int count,
344 const unsigned char *
buf,
int start_page)
351 static int ac_close_card(
struct net_device *dev)
354 printk(
"%s: Shutting down ethercard.\n", dev->
name);
358 outb(0x00, ioaddr + 6);
367 #define MAX_AC32_CARDS 4
368 static struct net_device *dev_ac32[MAX_AC32_CARDS];
369 static int io[MAX_AC32_CARDS];
370 static int irq[MAX_AC32_CARDS];
371 static int mem[MAX_AC32_CARDS];
381 static int __init ac3200_module_init(
void)
384 int this_dev, found = 0;
386 for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {
387 if (io[this_dev] == 0 && this_dev != 0)
389 dev = alloc_ei_netdev();
392 dev->
irq = irq[this_dev];
395 if (do_ac3200_probe(dev) == 0) {
396 dev_ac32[found++] =
dev;
408 static void cleanup_card(
struct net_device *dev)
416 static void __exit ac3200_module_exit(
void)
420 for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {