15 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17 #include <linux/module.h>
18 #include <linux/kernel.h>
20 #include <linux/net.h>
22 #include <linux/netdevice.h>
23 #include <linux/if_arp.h>
25 #include <linux/hdlc.h>
28 #include <linux/slab.h>
34 #include <asm/byteorder.h>
58 return (
struct slvl_device *)dev_to_hdlc(dev)->priv;
71 skb_reset_mac_header(skb);
115 slvl->
chan->rx_function = sealevel_input;
120 netif_start_queue(d);
124 static int sealevel_close(
struct net_device *d)
166 static int sealevel_attach(
struct net_device *
dev,
unsigned short encoding,
167 unsigned short parity)
175 .ndo_open = sealevel_open,
176 .ndo_stop = sealevel_close,
179 .ndo_do_ioctl = sealevel_ioctl,
188 dev_to_hdlc(dev)->attach = sealevel_attach;
189 dev_to_hdlc(dev)->xmit = sealevel_queue_xmit;
195 pr_err(
"unable to register HDLC device\n");
210 int txdma,
int rxdma,
int slow)
220 pr_warn(
"I/O 0x%X already in use\n", iobase);
229 b->
dev[0].channel = 0;
232 b->
dev[1].channel = 1;
251 dev->
chanA.ctrlio = iobase + 1;
253 dev->
chanB.ctrlio = iobase + 3;
254 dev->
chanB.dataio = iobase + 2;
270 "SeaLevel", dev) < 0) {
271 pr_warn(
"IRQ %d already in use\n", irq);
272 goto err_request_irq;
281 dev->
chanA.txdma = 3;
282 dev->
chanA.rxdma = 1;
296 pr_err(
"Z8530 series device not found\n");
314 if (slvl_setup(&b->
dev[0], iobase, irq))
316 if (slvl_setup(&b->
dev[1], iobase, irq))
345 for (u = 0; u < 2; u++) {
365 static bool slow=
false;
376 MODULE_PARM_DESC(slow,
"Set this for an older Sealevel card such as the 4012");
384 static int __init slvl_init_module(
void)
386 slvl_unit = slvl_init(io, irq, txdma, rxdma, slow);
388 return slvl_unit ? 0 : -
ENODEV;
391 static void __exit slvl_cleanup_module(
void)
394 slvl_shutdown(slvl_unit);