29 #include <linux/module.h>
31 #include <linux/kernel.h>
32 #include <linux/errno.h>
33 #include <linux/string.h>
37 #include <linux/netdevice.h>
45 #define DRV_NAME "ne3210"
51 static void ne3210_block_output(
struct net_device *
dev,
int count,
const unsigned char *
buf,
const int start_page);
53 #define NE3210_START_PG 0x00
54 #define NE3210_STOP_PG 0x80
56 #define NE3210_IO_EXTENT 0x20
57 #define NE3210_SA_PROM 0x16
58 #define NE3210_RESET_PORT 0xc84
59 #define NE3210_NIC_OFFSET 0x00
61 #define NE3210_ADDR0 0x00
62 #define NE3210_ADDR1 0x00
63 #define NE3210_ADDR2 0x1b
65 #define NE3210_CFG1 0xc84
66 #define NE3210_CFG2 0xc90
67 #define NE3210_CFG_EXTENT (NE3210_CFG2 - NE3210_CFG1 + 1)
75 #define NE3210_D_PROBE 0x01
76 #define NE3210_D_RX_PKT 0x02
77 #define NE3210_D_TX_PKT 0x04
78 #define NE3210_D_IRQ 0x08
80 #define NE3210_DEBUG 0x0
83 static unsigned int shmem_map[]
__initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0};
94 unsigned long ioaddr, phys_mem;
100 if (!(dev = alloc_ei_netdev ())) {
101 printk (
"ne3210.c: unable to allocate memory for dev!\n");
120 #if NE3210_DEBUG & NE3210_D_PROBE
121 printk(
"ne3210-debug: probe at %#x, ID %s\n", ioaddr, edev->
id.sig);
122 printk(
"ne3210-debug: config regs: %#x %#x\n",
129 printk(
"ne3210.c: NE3210 in EISA slot %d, media: %s, addr: %pM.\n",
134 printk(
"ne3210.c: using IRQ %d, ", dev->
irq);
138 printk (
" unable to get IRQ %d.\n", dev->
irq);
148 if (phys_mem > 1024*1024) {
150 printk(
KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n");
151 printk(
KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n");
161 printk (
"ne3210.c: Unable to request shared memory at physical address %#lx\n",
166 printk(
"%dkB memory at physical address %#lx\n",
176 printk(
"ne3210.c: remapped %dkB card memory to virtual address %p\n",
192 printk(
"ne3210 loaded.\n");
194 ei_status.reset_8390 = &ne3210_reset_8390;
195 ei_status.block_input = &ne3210_block_input;
196 ei_status.block_output = &ne3210_block_output;
197 ei_status.get_8390_hdr = &ne3210_get_8390_hdr;
201 dev->
if_port = ifmap_val[port_index];
225 static int __devexit ne3210_eisa_remove (
struct device *device)
245 static void ne3210_reset_8390(
struct net_device *dev)
306 static void ne3210_block_output(
struct net_device *dev,
int count,
307 const unsigned char *
buf,
int start_page)
311 count = (count + 3) & ~3;
323 .id_table = ne3210_ids,
326 .probe = ne3210_eisa_probe,
335 static int ne3210_init(
void)
340 static void ne3210_cleanup(
void)