2 * Amiga Linux/68k A2065 Ethernet Driver
4 * (C) Copyright 1995-2003 by Geert Uytterhoeven <geert@linux-m68k.org>
7 * - Janos Farkas (CHEXUM@sparta.banki.hu)
8 * - Jes Degn Soerensen (jds@kom.auc.dk)
9 * - Matt Domsch (Matt_Domsch@dell.com)
11 * ----------------------------------------------------------------------------
13 * This program is based on
15 * ariadne.?: Amiga Linux/68k Ariadne Ethernet Driver
16 * (C) Copyright 1995 by Geert Uytterhoeven,
19 * lance.c: An AMD LANCE ethernet driver for linux.
20 * Written 1993-94 by Donald Becker.
22 * Am79C960: PCnet(tm)-ISA Single-Chip Ethernet Controller
23 * Advanced Micro Devices
24 * Publication #16907, Rev. B, Amendment/0, May 1994
26 * ----------------------------------------------------------------------------
28 * This file is subject to the terms and conditions of the GNU General Public
29 * License. See the file COPYING in the main directory of the Linux
30 * distribution for more details.
32 * ----------------------------------------------------------------------------
34 * The A2065 is a Zorro-II board made by Commodore/Ameristar. It contains:
36 * - an Am7990 Local Area Network Controller for Ethernet (LANCE) with
37 * both 10BASE-2 (thin coax) and AUI (DB-15) connectors
40 #include <linux/errno.h>
41 #include <linux/netdevice.h>
42 #include <linux/etherdevice.h>
43 #include <linux/module.h>
44 #include <linux/stddef.h>
45 #include <linux/kernel.h>
46 #include <linux/interrupt.h>
47 #include <linux/ioport.h>
48 #include <linux/skbuff.h>
49 #include <linux/slab.h>
50 #include <linux/string.h>
51 #include <linux/config.h>
52 #include <linux/init.h>
53 #include <linux/crc32.h>
54 #include <linux/zorro.h>
55 #include <linux/bitops.h>
58 #include <asm/amigaints.h>
59 #include <asm/amigahw.h>
65 * Transmit/Receive Ring Definitions
68 #define LANCE_LOG_TX_BUFFERS (2)
69 #define LANCE_LOG_RX_BUFFERS (4)
71 #define TX_RING_SIZE (1<<LANCE_LOG_TX_BUFFERS)
72 #define RX_RING_SIZE (1<<LANCE_LOG_RX_BUFFERS)
74 #define TX_RING_MOD_MASK (TX_RING_SIZE-1)
75 #define RX_RING_MOD_MASK (RX_RING_SIZE-1)
77 #define PKT_BUF_SIZE (1544)
78 #define RX_BUFF_SIZE PKT_BUF_SIZE
79 #define TX_BUFF_SIZE PKT_BUF_SIZE
83 * Layout of the Lance's RAM Buffer
87 struct lance_init_block {
88 unsigned short mode; /* Pre-set mode (reg. 15) */
89 unsigned char phys_addr[6]; /* Physical ethernet address */
90 unsigned filter[2]; /* Multicast filter. */
92 /* Receive and transmit ring base, along with extra bits. */
93 unsigned short rx_ptr; /* receive descriptor addr */
94 unsigned short rx_len; /* receive len and high addr */
95 unsigned short tx_ptr; /* transmit descriptor addr */
96 unsigned short tx_len; /* transmit len and high addr */
98 /* The Tx and Rx ring entries must aligned on 8-byte boundaries. */
99 struct lance_rx_desc brx_ring[RX_RING_SIZE];
100 struct lance_tx_desc btx_ring[TX_RING_SIZE];
102 char rx_buf [RX_RING_SIZE][RX_BUFF_SIZE];
103 char tx_buf [TX_RING_SIZE][TX_BUFF_SIZE];
108 * Private Device Data
111 struct lance_private {
113 volatile struct lance_regs *ll;
114 volatile struct lance_init_block *init_block; /* Hosts view */
115 volatile struct lance_init_block *lance_init_block; /* Lance view */
120 int lance_log_rx_bufs, lance_log_tx_bufs;
121 int rx_ring_mod_mask, tx_ring_mod_mask;
123 struct net_device_stats stats;
124 int tpe; /* cable-selection is TPE */
125 int auto_select; /* cable-selection by carrier */
126 unsigned short busmaster_regval;
128 #ifdef CONFIG_SUNLANCE
129 struct Linux_SBus_DMA *ledma; /* if set this points to ledma and arch=4m */
130 int burst_sizes; /* ledma SBus burst sizes */
132 struct timer_list multicast_timer;
135 #define TX_BUFFS_AVAIL ((lp->tx_old<=lp->tx_new)?\
136 lp->tx_old+lp->tx_ring_mod_mask-lp->tx_new:\
137 lp->tx_old - lp->tx_new-1)
140 #define LANCE_ADDR(x) ((int)(x) & ~0xff000000)
142 /* Load the CSR registers */
143 static void load_csrs (struct lance_private *lp)
145 volatile struct lance_regs *ll = lp->ll;
146 volatile struct lance_init_block *aib = lp->lance_init_block;
149 leptr = LANCE_ADDR (aib);
152 ll->rdp = (leptr & 0xFFFF);
154 ll->rdp = leptr >> 16;
156 ll->rdp = lp->busmaster_regval;
158 /* Point back to csr0 */
164 /* Setup the Lance Rx and Tx rings */
165 static void lance_init_ring (struct net_device *dev)
167 struct lance_private *lp = netdev_priv(dev);
168 volatile struct lance_init_block *ib = lp->init_block;
169 volatile struct lance_init_block *aib; /* for LANCE_ADDR computations */
173 aib = lp->lance_init_block;
175 /* Lock out other processes while setting up hardware */
176 netif_stop_queue(dev);
177 lp->rx_new = lp->tx_new = 0;
178 lp->rx_old = lp->tx_old = 0;
182 /* Copy the ethernet address to the lance init block
183 * Note that on the sparc you need to swap the ethernet address.
185 ib->phys_addr [0] = dev->dev_addr [1];
186 ib->phys_addr [1] = dev->dev_addr [0];
187 ib->phys_addr [2] = dev->dev_addr [3];
188 ib->phys_addr [3] = dev->dev_addr [2];
189 ib->phys_addr [4] = dev->dev_addr [5];
190 ib->phys_addr [5] = dev->dev_addr [4];
193 printk(KERN_DEBUG "TX rings:\n");
195 /* Setup the Tx ring entries */
196 for (i = 0; i <= (1<<lp->lance_log_tx_bufs); i++) {
197 leptr = LANCE_ADDR(&aib->tx_buf[i][0]);
198 ib->btx_ring [i].tmd0 = leptr;
199 ib->btx_ring [i].tmd1_hadr = leptr >> 16;
200 ib->btx_ring [i].tmd1_bits = 0;
201 ib->btx_ring [i].length = 0xf000; /* The ones required by tmd2 */
202 ib->btx_ring [i].misc = 0;
204 printk(KERN_DEBUG "%d: 0x%8.8x\n", i, leptr);
207 /* Setup the Rx ring entries */
209 printk(KERN_DEBUG "RX rings:\n");
210 for (i = 0; i < (1<<lp->lance_log_rx_bufs); i++) {
211 leptr = LANCE_ADDR(&aib->rx_buf[i][0]);
213 ib->brx_ring [i].rmd0 = leptr;
214 ib->brx_ring [i].rmd1_hadr = leptr >> 16;
215 ib->brx_ring [i].rmd1_bits = LE_R1_OWN;
216 ib->brx_ring [i].length = -RX_BUFF_SIZE | 0xf000;
217 ib->brx_ring [i].mblength = 0;
219 printk(KERN_DEBUG "%d: 0x%8.8x\n", i, leptr);
222 /* Setup the initialization block */
224 /* Setup rx descriptor pointer */
225 leptr = LANCE_ADDR(&aib->brx_ring);
226 ib->rx_len = (lp->lance_log_rx_bufs << 13) | (leptr >> 16);
229 printk(KERN_DEBUG "RX ptr: %8.8x\n", leptr);
231 /* Setup tx descriptor pointer */
232 leptr = LANCE_ADDR(&aib->btx_ring);
233 ib->tx_len = (lp->lance_log_tx_bufs << 13) | (leptr >> 16);
236 printk(KERN_DEBUG "TX ptr: %8.8x\n", leptr);
238 /* Clear the multicast filter */
243 static int init_restart_lance (struct lance_private *lp)
245 volatile struct lance_regs *ll = lp->ll;
249 ll->rdp = LE_C0_INIT;
251 /* Wait for the lance to complete initialization */
252 for (i = 0; (i < 100) && !(ll->rdp & (LE_C0_ERR | LE_C0_IDON)); i++)
254 if ((i == 100) || (ll->rdp & LE_C0_ERR)) {
255 printk(KERN_ERR "LANCE unopened after %d ticks, csr0=%4.4x.\n",
260 /* Clear IDON by writing a "1", enable interrupts and start lance */
261 ll->rdp = LE_C0_IDON;
262 ll->rdp = LE_C0_INEA | LE_C0_STRT;
267 static int lance_rx (struct net_device *dev)
269 struct lance_private *lp = netdev_priv(dev);
270 volatile struct lance_init_block *ib = lp->init_block;
271 volatile struct lance_regs *ll = lp->ll;
272 volatile struct lance_rx_desc *rd;
274 int len = 0; /* XXX shut up gcc warnings */
275 struct sk_buff *skb = 0; /* XXX shut up gcc warnings */
279 printk(KERN_DEBUG "[");
280 for (i = 0; i < RX_RING_SIZE; i++) {
283 ib->brx_ring [i].rmd1_bits & LE_R1_OWN ? "_" : "X");
286 ib->brx_ring [i].rmd1_bits & LE_R1_OWN ? "." : "1");
291 ll->rdp = LE_C0_RINT|LE_C0_INEA;
292 for (rd = &ib->brx_ring [lp->rx_new];
293 !((bits = rd->rmd1_bits) & LE_R1_OWN);
294 rd = &ib->brx_ring [lp->rx_new]) {
296 /* We got an incomplete frame? */
297 if ((bits & LE_R1_POK) != LE_R1_POK) {
298 lp->stats.rx_over_errors++;
299 lp->stats.rx_errors++;
301 } else if (bits & LE_R1_ERR) {
302 /* Count only the end frame as a rx error,
305 if (bits & LE_R1_BUF) lp->stats.rx_fifo_errors++;
306 if (bits & LE_R1_CRC) lp->stats.rx_crc_errors++;
307 if (bits & LE_R1_OFL) lp->stats.rx_over_errors++;
308 if (bits & LE_R1_FRA) lp->stats.rx_frame_errors++;
309 if (bits & LE_R1_EOP) lp->stats.rx_errors++;
311 len = (rd->mblength & 0xfff) - 4;
312 skb = dev_alloc_skb (len+2);
315 printk(KERN_WARNING "%s: Memory squeeze, "
316 "deferring packet.\n", dev->name);
317 lp->stats.rx_dropped++;
319 rd->rmd1_bits = LE_R1_OWN;
320 lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask;
325 skb_reserve (skb, 2); /* 16 byte align */
326 skb_put (skb, len); /* make room */
327 eth_copy_and_sum(skb,
328 (unsigned char *)&(ib->rx_buf [lp->rx_new][0]),
330 skb->protocol = eth_type_trans (skb, dev);
332 dev->last_rx = jiffies;
333 lp->stats.rx_packets++;
334 lp->stats.rx_bytes += len;
337 /* Return the packet to the pool */
339 rd->rmd1_bits = LE_R1_OWN;
340 lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask;
345 static int lance_tx (struct net_device *dev)
347 struct lance_private *lp = netdev_priv(dev);
348 volatile struct lance_init_block *ib = lp->init_block;
349 volatile struct lance_regs *ll = lp->ll;
350 volatile struct lance_tx_desc *td;
355 ll->rdp = LE_C0_TINT | LE_C0_INEA;
359 for (i = j; i != lp->tx_new; i = j) {
360 td = &ib->btx_ring [i];
362 /* If we hit a packet not owned by us, stop */
363 if (td->tmd1_bits & LE_T1_OWN)
366 if (td->tmd1_bits & LE_T1_ERR) {
369 lp->stats.tx_errors++;
370 if (status & LE_T3_RTY) lp->stats.tx_aborted_errors++;
371 if (status & LE_T3_LCOL) lp->stats.tx_window_errors++;
373 if (status & LE_T3_CLOS) {
374 lp->stats.tx_carrier_errors++;
375 if (lp->auto_select) {
376 lp->tpe = 1 - lp->tpe;
377 printk(KERN_ERR "%s: Carrier Lost, "
378 "trying %s\n", dev->name,
379 lp->tpe?"TPE":"AUI");
382 ll->rdp = LE_C0_STOP;
383 lance_init_ring (dev);
385 init_restart_lance (lp);
390 /* buffer errors and underflows turn off the transmitter */
391 /* Restart the adapter */
392 if (status & (LE_T3_BUF|LE_T3_UFL)) {
393 lp->stats.tx_fifo_errors++;
395 printk(KERN_ERR "%s: Tx: ERR_BUF|ERR_UFL, "
396 "restarting\n", dev->name);
399 ll->rdp = LE_C0_STOP;
400 lance_init_ring (dev);
402 init_restart_lance (lp);
405 } else if ((td->tmd1_bits & LE_T1_POK) == LE_T1_POK) {
407 * So we don't count the packet more than once.
409 td->tmd1_bits &= ~(LE_T1_POK);
411 /* One collision before packet was sent. */
412 if (td->tmd1_bits & LE_T1_EONE)
413 lp->stats.collisions++;
415 /* More than one collision, be optimistic. */
416 if (td->tmd1_bits & LE_T1_EMORE)
417 lp->stats.collisions += 2;
419 lp->stats.tx_packets++;
422 j = (j + 1) & lp->tx_ring_mod_mask;
425 ll->rdp = LE_C0_TINT | LE_C0_INEA;
430 lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
432 struct net_device *dev;
433 struct lance_private *lp;
434 volatile struct lance_regs *ll;
437 dev = (struct net_device *) dev_id;
439 lp = netdev_priv(dev);
442 ll->rap = LE_CSR0; /* LANCE Controller Status */
445 if (!(csr0 & LE_C0_INTR)) /* Check if any interrupt has */
446 return IRQ_NONE; /* been generated by the Lance. */
448 /* Acknowledge all the interrupt sources ASAP */
449 ll->rdp = csr0 & ~(LE_C0_INEA|LE_C0_TDMD|LE_C0_STOP|LE_C0_STRT|
452 if ((csr0 & LE_C0_ERR)) {
453 /* Clear the error condition */
454 ll->rdp = LE_C0_BABL|LE_C0_ERR|LE_C0_MISS|LE_C0_INEA;
457 if (csr0 & LE_C0_RINT)
460 if (csr0 & LE_C0_TINT)
463 /* Log misc errors. */
464 if (csr0 & LE_C0_BABL)
465 lp->stats.tx_errors++; /* Tx babble. */
466 if (csr0 & LE_C0_MISS)
467 lp->stats.rx_errors++; /* Missed a Rx frame. */
468 if (csr0 & LE_C0_MERR) {
469 printk(KERN_ERR "%s: Bus master arbitration failure, status "
470 "%4.4x.\n", dev->name, csr0);
471 /* Restart the chip. */
472 ll->rdp = LE_C0_STRT;
475 if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL > 0)
476 netif_wake_queue(dev);
479 ll->rdp = LE_C0_BABL|LE_C0_CERR|LE_C0_MISS|LE_C0_MERR|
480 LE_C0_IDON|LE_C0_INEA;
484 struct net_device *last_dev = 0;
486 static int lance_open (struct net_device *dev)
488 struct lance_private *lp = netdev_priv(dev);
489 volatile struct lance_regs *ll = lp->ll;
496 ll->rdp = LE_C0_STOP;
498 /* Install the Interrupt handler */
499 ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, SA_SHIRQ,
504 lance_init_ring (dev);
506 netif_start_queue(dev);
508 return init_restart_lance (lp);
511 static int lance_close (struct net_device *dev)
513 struct lance_private *lp = netdev_priv(dev);
514 volatile struct lance_regs *ll = lp->ll;
516 netif_stop_queue(dev);
517 del_timer_sync(&lp->multicast_timer);
521 ll->rdp = LE_C0_STOP;
523 free_irq(IRQ_AMIGA_PORTS, dev);
527 static inline int lance_reset (struct net_device *dev)
529 struct lance_private *lp = netdev_priv(dev);
530 volatile struct lance_regs *ll = lp->ll;
535 ll->rdp = LE_C0_STOP;
539 lance_init_ring (dev);
540 dev->trans_start = jiffies;
541 netif_start_queue(dev);
543 status = init_restart_lance (lp);
545 printk(KERN_DEBUG "Lance restart=%d\n", status);
550 static void lance_tx_timeout(struct net_device *dev)
552 struct lance_private *lp = netdev_priv(dev);
553 volatile struct lance_regs *ll = lp->ll;
555 printk(KERN_ERR "%s: transmit timed out, status %04x, reset\n",
558 netif_wake_queue(dev);
561 static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
563 struct lance_private *lp = netdev_priv(dev);
564 volatile struct lance_regs *ll = lp->ll;
565 volatile struct lance_init_block *ib = lp->init_block;
566 int entry, skblen, len;
574 if (len < ETH_ZLEN) {
576 if (skb_padto(skb, ETH_ZLEN))
580 local_irq_save(flags);
582 if (!TX_BUFFS_AVAIL){
583 local_irq_restore(flags);
588 /* dump the packet */
592 for (i = 0; i < 64; i++) {
594 printk("\n" KERN_DEBUG);
595 printk ("%2.2x ", skb->data [i]);
600 entry = lp->tx_new & lp->tx_ring_mod_mask;
601 ib->btx_ring [entry].length = (-len) | 0xf000;
602 ib->btx_ring [entry].misc = 0;
604 memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
606 /* Clear the slack of the packet, do I need this? */
608 memset ((char *) &ib->tx_buf [entry][skblen], 0, len - skblen);
610 /* Now, give the packet to the lance */
611 ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
612 lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
616 if (TX_BUFFS_AVAIL <= 0)
617 netif_stop_queue(dev);
619 /* Kick the lance: transmit now */
620 ll->rdp = LE_C0_INEA | LE_C0_TDMD;
621 dev->trans_start = jiffies;
624 local_irq_restore(flags);
629 static struct net_device_stats *lance_get_stats (struct net_device *dev)
631 struct lance_private *lp = netdev_priv(dev);
636 /* taken from the depca driver */
637 static void lance_load_multicast (struct net_device *dev)
639 struct lance_private *lp = netdev_priv(dev);
640 volatile struct lance_init_block *ib = lp->init_block;
641 volatile u16 *mcast_table = (u16 *)&ib->filter;
642 struct dev_mc_list *dmi=dev->mc_list;
647 /* set all multicast bits */
648 if (dev->flags & IFF_ALLMULTI){
649 ib->filter [0] = 0xffffffff;
650 ib->filter [1] = 0xffffffff;
653 /* clear the multicast filter */
658 for (i = 0; i < dev->mc_count; i++){
659 addrs = dmi->dmi_addr;
662 /* multicast address? */
666 crc = ether_crc_le(6, addrs);
668 mcast_table [crc >> 4] |= 1 << (crc & 0xf);
673 static void lance_set_multicast (struct net_device *dev)
675 struct lance_private *lp = netdev_priv(dev);
676 volatile struct lance_init_block *ib = lp->init_block;
677 volatile struct lance_regs *ll = lp->ll;
679 if (!netif_running(dev))
682 if (lp->tx_old != lp->tx_new) {
683 mod_timer(&lp->multicast_timer, jiffies + 4);
684 netif_wake_queue(dev);
688 netif_stop_queue(dev);
691 ll->rdp = LE_C0_STOP;
692 lance_init_ring (dev);
694 if (dev->flags & IFF_PROMISC) {
695 ib->mode |= LE_MO_PROM;
697 ib->mode &= ~LE_MO_PROM;
698 lance_load_multicast (dev);
701 init_restart_lance (lp);
702 netif_wake_queue(dev);
705 static int __devinit a2065_init_one(struct zorro_dev *z,
706 const struct zorro_device_id *ent);
707 static void __devexit a2065_remove_one(struct zorro_dev *z);
710 static struct zorro_device_id a2065_zorro_tbl[] __devinitdata = {
711 { ZORRO_PROD_CBM_A2065_1 },
712 { ZORRO_PROD_CBM_A2065_2 },
713 { ZORRO_PROD_AMERISTAR_A2065 },
717 static struct zorro_driver a2065_driver = {
719 .id_table = a2065_zorro_tbl,
720 .probe = a2065_init_one,
721 .remove = __devexit_p(a2065_remove_one),
724 static int __devinit a2065_init_one(struct zorro_dev *z,
725 const struct zorro_device_id *ent)
727 struct net_device *dev;
728 struct lance_private *priv;
729 unsigned long board, base_addr, mem_start;
730 struct resource *r1, *r2;
733 board = z->resource.start;
734 base_addr = board+A2065_LANCE;
735 mem_start = board+A2065_RAM;
737 r1 = request_mem_region(base_addr, sizeof(struct lance_regs),
741 r2 = request_mem_region(mem_start, A2065_RAM_SIZE, "RAM");
743 release_resource(r1);
747 dev = alloc_etherdev(sizeof(struct lance_private));
749 release_resource(r1);
750 release_resource(r2);
754 SET_MODULE_OWNER(dev);
755 priv = netdev_priv(dev);
757 r1->name = dev->name;
758 r2->name = dev->name;
760 dev->dev_addr[0] = 0x00;
761 if (z->id != ZORRO_PROD_AMERISTAR_A2065) { /* Commodore */
762 dev->dev_addr[1] = 0x80;
763 dev->dev_addr[2] = 0x10;
764 } else { /* Ameristar */
765 dev->dev_addr[1] = 0x00;
766 dev->dev_addr[2] = 0x9f;
768 dev->dev_addr[3] = (z->rom.er_SerialNumber>>16) & 0xff;
769 dev->dev_addr[4] = (z->rom.er_SerialNumber>>8) & 0xff;
770 dev->dev_addr[5] = z->rom.er_SerialNumber & 0xff;
771 dev->base_addr = ZTWO_VADDR(base_addr);
772 dev->mem_start = ZTWO_VADDR(mem_start);
773 dev->mem_end = dev->mem_start+A2065_RAM_SIZE;
775 priv->ll = (volatile struct lance_regs *)dev->base_addr;
776 priv->init_block = (struct lance_init_block *)dev->mem_start;
777 priv->lance_init_block = (struct lance_init_block *)A2065_RAM;
778 priv->auto_select = 0;
779 priv->busmaster_regval = LE_C3_BSWP;
781 priv->lance_log_rx_bufs = LANCE_LOG_RX_BUFFERS;
782 priv->lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS;
783 priv->rx_ring_mod_mask = RX_RING_MOD_MASK;
784 priv->tx_ring_mod_mask = TX_RING_MOD_MASK;
786 dev->open = &lance_open;
787 dev->stop = &lance_close;
788 dev->hard_start_xmit = &lance_start_xmit;
789 dev->tx_timeout = &lance_tx_timeout;
790 dev->watchdog_timeo = 5*HZ;
791 dev->get_stats = &lance_get_stats;
792 dev->set_multicast_list = &lance_set_multicast;
795 init_timer(&priv->multicast_timer);
796 priv->multicast_timer.data = (unsigned long) dev;
797 priv->multicast_timer.function =
798 (void (*)(unsigned long)) &lance_set_multicast;
800 err = register_netdev(dev);
802 release_resource(r1);
803 release_resource(r2);
807 zorro_set_drvdata(z, dev);
809 printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address "
810 "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, board,
811 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
812 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
818 static void __devexit a2065_remove_one(struct zorro_dev *z)
820 struct net_device *dev = zorro_get_drvdata(z);
822 unregister_netdev(dev);
823 release_mem_region(ZTWO_PADDR(dev->base_addr),
824 sizeof(struct lance_regs));
825 release_mem_region(ZTWO_PADDR(dev->mem_start), A2065_RAM_SIZE);
829 static int __init a2065_init_module(void)
831 return zorro_register_driver(&a2065_driver);
834 static void __exit a2065_cleanup_module(void)
836 zorro_unregister_driver(&a2065_driver);
839 module_init(a2065_init_module);
840 module_exit(a2065_cleanup_module);
842 MODULE_LICENSE("GPL");