15 #include <linux/module.h>
16 #include <linux/kernel.h>
17 #include <linux/string.h>
18 #include <linux/errno.h>
21 #include <linux/netdevice.h>
25 #include <linux/bitops.h>
33 #define EI_SHIFT(x) (ei_local->reg_offset[x])
34 #define ei_inb(port) in_8(port)
35 #define ei_outb(val,port) out_8(port,val)
36 #define ei_inb_p(port) in_8(port)
37 #define ei_outb_p(val,port) out_8(port,val)
44 #define NE_EN0_DCFG (0x0e*2)
46 #define NESM_START_PG 0x0
47 #define NESM_STOP_PG 0x40
49 #define HYDRA_NIC_BASE 0xffe1
50 #define HYDRA_ADDRPROM 0xffc0
51 #define HYDRA_VERSION "v3.0alpha"
53 #define WORDSWAP(a) ((((a)>>8)&0xff) | ((a)<<8))
56 static int __devinit hydra_init_one(
struct zorro_dev *z,
67 const unsigned char *
buf,
int start_page);
68 static void __devexit hydra_remove_one(
struct zorro_dev *z);
76 static struct zorro_driver hydra_driver = {
78 .id_table = hydra_zorro_tbl,
79 .probe = hydra_init_one,
83 static int __devinit hydra_init_one(
struct zorro_dev *z,
98 .ndo_open = hydra_open,
99 .ndo_stop = hydra_close,
108 #ifdef CONFIG_NET_POLL_CONTROLLER
118 const char name[] =
"NE2000";
119 int start_page, stop_page;
123 static u32 hydra_offsets[16] = {
124 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
125 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
159 ei_status.block_input = hydra_block_input;
160 ei_status.block_output = hydra_block_output;
161 ei_status.get_8390_hdr = hydra_get_8390_hdr;
174 zorro_set_drvdata(z, dev);
188 static int hydra_close(
struct net_device *dev)
196 static void hydra_reset_8390(
struct net_device *dev)
201 static void hydra_get_8390_hdr(
struct net_device *dev,
210 *(ptrs++) =
z_readw(hdr_start);
211 *((
short *)hdr) =
WORDSWAP(*((
short *)hdr));
213 *(ptrs++) =
z_readw(hdr_start);
214 *((
short *)hdr+1) =
WORDSWAP(*((
short *)hdr+1));
222 unsigned long xfer_start = mem_base + ring_offset - (
NESM_START_PG<<8);
228 int semi_count = (mem_base + (
NESM_STOP_PG<<8)) - xfer_start;
238 static void hydra_block_output(
struct net_device *dev,
int count,
239 const unsigned char *
buf,
int start_page)
250 static void __devexit hydra_remove_one(
struct zorro_dev *z)
252 struct net_device *dev = zorro_get_drvdata(z);
260 static int __init hydra_init_module(
void)
265 static void __exit hydra_cleanup_module(
void)