8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/types.h>
13 #include <linux/string.h>
16 #include <linux/errno.h>
18 #include <linux/socket.h>
21 #include <linux/netdevice.h>
26 #include <asm/pgtable.h>
34 #define LANCE_LOG_TX_BUFFERS 1
35 #define LANCE_LOG_RX_BUFFERS 3
49 static int __devinit hplance_init_one(
struct dio_dev *
d,
50 const struct dio_device_id *
ent);
53 static void __devexit hplance_remove_one(
struct dio_dev *
d);
54 static void hplance_writerap(
void *
priv,
unsigned short value);
55 static void hplance_writerdp(
void *
priv,
unsigned short value);
56 static unsigned short hplance_readrdp(
void *
priv);
60 static struct dio_device_id hplance_dio_tbl[] = {
65 static struct dio_driver hplance_driver = {
67 .id_table = hplance_dio_tbl,
68 .probe = hplance_init_one,
73 .ndo_open = hplance_open,
74 .ndo_stop = hplance_close,
80 #ifdef CONFIG_NET_POLL_CONTROLLER
81 .ndo_poll_controller = lance_poll,
86 static int __devinit hplance_init_one(
struct dio_dev *
d,
87 const struct dio_device_id *
ent)
98 dio_resource_len(d), d->name))
101 hplance_init(dev, d);
104 goto out_release_mem_region;
106 dio_set_drvdata(d, dev);
113 out_release_mem_region:
121 static void __devexit hplance_remove_one(
struct dio_dev *d)
133 unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
138 out_8(va+DIO_IDOFF, 0xff);
146 for (i=0; i<6; i++) {
154 lp = netdev_priv(dev);
155 lp->
lance.name = (
char*)d->name;
160 lp->
lance.irq = d->ipl;
161 lp->
lance.writerap = hplance_writerap;
162 lp->
lance.writerdp = hplance_writerdp;
163 lp->
lance.readrdp = hplance_readrdp;
173 static void hplance_writerap(
void *
priv,
unsigned short value)
181 static void hplance_writerdp(
void *priv,
unsigned short value)
189 static unsigned short hplance_readrdp(
void *priv)
199 static int hplance_open(
struct net_device *dev)
213 static int hplance_close(
struct net_device *dev)
222 static int __init hplance_init_module(
void)
227 static void __exit hplance_cleanup_module(
void)