2 * Amiga Linux/68k A2065 Ethernet Driver
4 * (C) Copyright 1995 by Geert Uytterhoeven <geert@linux-m68k.org>
7 * - Janos Farkas (CHEXUM@sparta.banki.hu)
8 * - Jes Degn Soerensen (jds@kom.auc.dk)
10 * ----------------------------------------------------------------------------
12 * This program is based on
14 * ariadne.?: Amiga Linux/68k Ariadne Ethernet Driver
15 * (C) Copyright 1995 by Geert Uytterhoeven,
18 * lance.c: An AMD LANCE ethernet driver for linux.
19 * Written 1993-94 by Donald Becker.
21 * Am79C960: PCnet(tm)-ISA Single-Chip Ethernet Controller
22 * Advanced Micro Devices
23 * Publication #16907, Rev. B, Amendment/0, May 1994
25 * ----------------------------------------------------------------------------
27 * This file is subject to the terms and conditions of the GNU General Public
28 * License. See the file COPYING in the main directory of the Linux
29 * distribution for more details.
31 * ----------------------------------------------------------------------------
33 * The A2065 is a Zorro-II board made by Commodore/Ameristar. It contains:
35 * - an Am7990 Local Area Network Controller for Ethernet (LANCE) with
36 * both 10BASE-2 (thin coax) and AUI (DB-15) connectors
39 #include <linux/module.h>
40 #include <linux/stddef.h>
41 #include <linux/kernel.h>
42 #include <linux/sched.h>
43 #include <linux/interrupt.h>
44 #include <linux/ptrace.h>
45 #include <linux/ioport.h>
46 #include <linux/malloc.h>
47 #include <linux/string.h>
48 #include <linux/config.h>
49 #include <linux/init.h>
51 #include <asm/bitops.h>
54 #include <linux/errno.h>
56 #include <asm/amigaints.h>
57 #include <asm/amigahw.h>
58 #include <linux/zorro.h>
60 #include <linux/netdevice.h>
61 #include <linux/etherdevice.h>
62 #include <linux/skbuff.h>
67 * Transmit/Receive Ring Definitions
70 #define LANCE_LOG_TX_BUFFERS (2)
71 #define LANCE_LOG_RX_BUFFERS (4)
73 #define TX_RING_SIZE (1<<LANCE_LOG_TX_BUFFERS)
74 #define RX_RING_SIZE (1<<LANCE_LOG_RX_BUFFERS)
76 #define TX_RING_MOD_MASK (TX_RING_SIZE-1)
77 #define RX_RING_MOD_MASK (RX_RING_SIZE-1)
79 #define PKT_BUF_SIZE (1544)
80 #define RX_BUFF_SIZE PKT_BUF_SIZE
81 #define TX_BUFF_SIZE PKT_BUF_SIZE
85 * Layout of the Lance's RAM Buffer
89 struct lance_init_block
{
90 unsigned short mode
; /* Pre-set mode (reg. 15) */
91 unsigned char phys_addr
[6]; /* Physical ethernet address */
92 unsigned filter
[2]; /* Multicast filter. */
94 /* Receive and transmit ring base, along with extra bits. */
95 unsigned short rx_ptr
; /* receive descriptor addr */
96 unsigned short rx_len
; /* receive len and high addr */
97 unsigned short tx_ptr
; /* transmit descriptor addr */
98 unsigned short tx_len
; /* transmit len and high addr */
100 /* The Tx and Rx ring entries must aligned on 8-byte boundaries. */
101 struct lance_rx_desc brx_ring
[RX_RING_SIZE
];
102 struct lance_tx_desc btx_ring
[TX_RING_SIZE
];
104 char rx_buf
[RX_RING_SIZE
][RX_BUFF_SIZE
];
105 char tx_buf
[TX_RING_SIZE
][TX_BUFF_SIZE
];
110 * Private Device Data
113 struct lance_private
{
115 volatile struct lance_regs
*ll
;
116 volatile struct lance_init_block
*init_block
; /* Hosts view */
117 volatile struct lance_init_block
*lance_init_block
; /* Lance view */
122 int lance_log_rx_bufs
, lance_log_tx_bufs
;
123 int rx_ring_mod_mask
, tx_ring_mod_mask
;
125 struct net_device_stats stats
;
126 int tpe
; /* cable-selection is TPE */
127 int auto_select
; /* cable-selection by carrier */
128 unsigned short busmaster_regval
;
133 #ifdef CONFIG_SUNLANCE
134 struct Linux_SBus_DMA
*ledma
; /* if set this points to ledma and arch=4m */
135 int burst_sizes
; /* ledma SBus burst sizes */
137 struct timer_list multicast_timer
;
140 #define TX_BUFFS_AVAIL ((lp->tx_old<=lp->tx_new)?\
141 lp->tx_old+lp->tx_ring_mod_mask-lp->tx_new:\
142 lp->tx_old - lp->tx_new-1)
145 #define LANCE_ADDR(x) ((int)(x) & ~0xff000000)
147 /* Load the CSR registers */
148 static void load_csrs (struct lance_private
*lp
)
150 volatile struct lance_regs
*ll
= lp
->ll
;
151 volatile struct lance_init_block
*aib
= lp
->lance_init_block
;
154 leptr
= LANCE_ADDR (aib
);
157 ll
->rdp
= (leptr
& 0xFFFF);
159 ll
->rdp
= leptr
>> 16;
161 ll
->rdp
= lp
->busmaster_regval
;
163 /* Point back to csr0 */
169 /* Setup the Lance Rx and Tx rings */
170 /* Sets dev->tbusy */
171 static void lance_init_ring (struct net_device
*dev
)
173 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
174 volatile struct lance_init_block
*ib
= lp
->init_block
;
175 volatile struct lance_init_block
*aib
; /* for LANCE_ADDR computations */
179 aib
= lp
->lance_init_block
;
181 /* Lock out other processes while setting up hardware */
183 lp
->rx_new
= lp
->tx_new
= 0;
184 lp
->rx_old
= lp
->tx_old
= 0;
188 /* Copy the ethernet address to the lance init block
189 * Note that on the sparc you need to swap the ethernet address.
191 ib
->phys_addr
[0] = dev
->dev_addr
[1];
192 ib
->phys_addr
[1] = dev
->dev_addr
[0];
193 ib
->phys_addr
[2] = dev
->dev_addr
[3];
194 ib
->phys_addr
[3] = dev
->dev_addr
[2];
195 ib
->phys_addr
[4] = dev
->dev_addr
[5];
196 ib
->phys_addr
[5] = dev
->dev_addr
[4];
199 printk ("TX rings:\n");
201 /* Setup the Tx ring entries */
202 for (i
= 0; i
<= (1<<lp
->lance_log_tx_bufs
); i
++) {
203 leptr
= LANCE_ADDR(&aib
->tx_buf
[i
][0]);
204 ib
->btx_ring
[i
].tmd0
= leptr
;
205 ib
->btx_ring
[i
].tmd1_hadr
= leptr
>> 16;
206 ib
->btx_ring
[i
].tmd1_bits
= 0;
207 ib
->btx_ring
[i
].length
= 0xf000; /* The ones required by tmd2 */
208 ib
->btx_ring
[i
].misc
= 0;
210 if (ZERO
) printk ("%d: 0x%8.8x\n", i
, leptr
);
213 /* Setup the Rx ring entries */
215 printk ("RX rings:\n");
216 for (i
= 0; i
< (1<<lp
->lance_log_rx_bufs
); i
++) {
217 leptr
= LANCE_ADDR(&aib
->rx_buf
[i
][0]);
219 ib
->brx_ring
[i
].rmd0
= leptr
;
220 ib
->brx_ring
[i
].rmd1_hadr
= leptr
>> 16;
221 ib
->brx_ring
[i
].rmd1_bits
= LE_R1_OWN
;
222 ib
->brx_ring
[i
].length
= -RX_BUFF_SIZE
| 0xf000;
223 ib
->brx_ring
[i
].mblength
= 0;
225 printk ("%d: 0x%8.8x\n", i
, leptr
);
228 /* Setup the initialization block */
230 /* Setup rx descriptor pointer */
231 leptr
= LANCE_ADDR(&aib
->brx_ring
);
232 ib
->rx_len
= (lp
->lance_log_rx_bufs
<< 13) | (leptr
>> 16);
235 printk ("RX ptr: %8.8x\n", leptr
);
237 /* Setup tx descriptor pointer */
238 leptr
= LANCE_ADDR(&aib
->btx_ring
);
239 ib
->tx_len
= (lp
->lance_log_tx_bufs
<< 13) | (leptr
>> 16);
242 printk ("TX ptr: %8.8x\n", leptr
);
244 /* Clear the multicast filter */
249 static int init_restart_lance (struct lance_private
*lp
)
251 volatile struct lance_regs
*ll
= lp
->ll
;
255 ll
->rdp
= LE_C0_INIT
;
257 /* Wait for the lance to complete initialization */
258 for (i
= 0; (i
< 100) && !(ll
->rdp
& (LE_C0_ERR
| LE_C0_IDON
)); i
++)
260 if ((i
== 100) || (ll
->rdp
& LE_C0_ERR
)) {
261 printk ("LANCE unopened after %d ticks, csr0=%4.4x.\n", i
, ll
->rdp
);
265 /* Clear IDON by writing a "1", enable interrupts and start lance */
266 ll
->rdp
= LE_C0_IDON
;
267 ll
->rdp
= LE_C0_INEA
| LE_C0_STRT
;
272 static int lance_rx (struct net_device
*dev
)
274 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
275 volatile struct lance_init_block
*ib
= lp
->init_block
;
276 volatile struct lance_regs
*ll
= lp
->ll
;
277 volatile struct lance_rx_desc
*rd
;
279 int len
= 0; /* XXX shut up gcc warnings */
280 struct sk_buff
*skb
= 0; /* XXX shut up gcc warnings */
284 for (i
= 0; i
< RX_RING_SIZE
; i
++) {
287 ib
->brx_ring
[i
].rmd1_bits
& LE_R1_OWN
? "_" : "X");
290 ib
->brx_ring
[i
].rmd1_bits
& LE_R1_OWN
? "." : "1");
295 ll
->rdp
= LE_C0_RINT
|LE_C0_INEA
;
296 for (rd
= &ib
->brx_ring
[lp
->rx_new
];
297 !((bits
= rd
->rmd1_bits
) & LE_R1_OWN
);
298 rd
= &ib
->brx_ring
[lp
->rx_new
]) {
300 /* We got an incomplete frame? */
301 if ((bits
& LE_R1_POK
) != LE_R1_POK
) {
302 lp
->stats
.rx_over_errors
++;
303 lp
->stats
.rx_errors
++;
305 } else if (bits
& LE_R1_ERR
) {
306 /* Count only the end frame as a rx error,
309 if (bits
& LE_R1_BUF
) lp
->stats
.rx_fifo_errors
++;
310 if (bits
& LE_R1_CRC
) lp
->stats
.rx_crc_errors
++;
311 if (bits
& LE_R1_OFL
) lp
->stats
.rx_over_errors
++;
312 if (bits
& LE_R1_FRA
) lp
->stats
.rx_frame_errors
++;
313 if (bits
& LE_R1_EOP
) lp
->stats
.rx_errors
++;
315 len
= (rd
->mblength
& 0xfff) - 4;
316 skb
= dev_alloc_skb (len
+2);
319 printk ("%s: Memory squeeze, deferring packet.\n",
321 lp
->stats
.rx_dropped
++;
323 rd
->rmd1_bits
= LE_R1_OWN
;
324 lp
->rx_new
= (lp
->rx_new
+ 1) & lp
->rx_ring_mod_mask
;
329 skb_reserve (skb
, 2); /* 16 byte align */
330 skb_put (skb
, len
); /* make room */
331 eth_copy_and_sum(skb
,
332 (unsigned char *)&(ib
->rx_buf
[lp
->rx_new
][0]),
334 skb
->protocol
= eth_type_trans (skb
, dev
);
336 lp
->stats
.rx_packets
++;
339 /* Return the packet to the pool */
341 rd
->rmd1_bits
= LE_R1_OWN
;
342 lp
->rx_new
= (lp
->rx_new
+ 1) & lp
->rx_ring_mod_mask
;
347 static int lance_tx (struct net_device
*dev
)
349 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
350 volatile struct lance_init_block
*ib
= lp
->init_block
;
351 volatile struct lance_regs
*ll
= lp
->ll
;
352 volatile struct lance_tx_desc
*td
;
357 ll
->rdp
= LE_C0_TINT
| LE_C0_INEA
;
361 for (i
= j
; i
!= lp
->tx_new
; i
= j
) {
362 td
= &ib
->btx_ring
[i
];
364 /* If we hit a packet not owned by us, stop */
365 if (td
->tmd1_bits
& LE_T1_OWN
)
368 if (td
->tmd1_bits
& LE_T1_ERR
) {
371 lp
->stats
.tx_errors
++;
372 if (status
& LE_T3_RTY
) lp
->stats
.tx_aborted_errors
++;
373 if (status
& LE_T3_LCOL
) lp
->stats
.tx_window_errors
++;
375 if (status
& LE_T3_CLOS
) {
376 lp
->stats
.tx_carrier_errors
++;
377 if (lp
->auto_select
) {
378 lp
->tpe
= 1 - lp
->tpe
;
379 printk("%s: Carrier Lost, trying %s\n",
380 dev
->name
, lp
->tpe
?"TPE":"AUI");
383 ll
->rdp
= LE_C0_STOP
;
384 lance_init_ring (dev
);
386 init_restart_lance (lp
);
391 /* buffer errors and underflows turn off the transmitter */
392 /* Restart the adapter */
393 if (status
& (LE_T3_BUF
|LE_T3_UFL
)) {
394 lp
->stats
.tx_fifo_errors
++;
396 printk ("%s: Tx: ERR_BUF|ERR_UFL, restarting\n",
400 ll
->rdp
= LE_C0_STOP
;
401 lance_init_ring (dev
);
403 init_restart_lance (lp
);
406 } else if ((td
->tmd1_bits
& LE_T1_POK
) == LE_T1_POK
) {
408 * So we don't count the packet more than once.
410 td
->tmd1_bits
&= ~(LE_T1_POK
);
412 /* One collision before packet was sent. */
413 if (td
->tmd1_bits
& LE_T1_EONE
)
414 lp
->stats
.collisions
++;
416 /* More than one collision, be optimistic. */
417 if (td
->tmd1_bits
& LE_T1_EMORE
)
418 lp
->stats
.collisions
+= 2;
420 lp
->stats
.tx_packets
++;
423 j
= (j
+ 1) & lp
->tx_ring_mod_mask
;
426 ll
->rdp
= LE_C0_TINT
| LE_C0_INEA
;
430 static void 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
= (struct lance_private
*) dev
->priv
;
442 ll
->rap
= LE_CSR0
; /* LANCE Controller Status */
445 if (!(csr0
& LE_C0_INTR
)) /* Check if any interrupt has */
446 return; /* been generated by the Lance. */
449 printk ("%s: again", dev
->name
);
453 /* Acknowledge all the interrupt sources ASAP */
454 ll
->rdp
= csr0
& ~(LE_C0_INEA
|LE_C0_TDMD
|LE_C0_STOP
|LE_C0_STRT
|
457 if ((csr0
& LE_C0_ERR
)) {
458 /* Clear the error condition */
459 ll
->rdp
= LE_C0_BABL
|LE_C0_ERR
|LE_C0_MISS
|LE_C0_INEA
;
462 if (csr0
& LE_C0_RINT
)
465 if (csr0
& LE_C0_TINT
)
468 /* Log misc errors. */
469 if (csr0
& LE_C0_BABL
)
470 lp
->stats
.tx_errors
++; /* Tx babble. */
471 if (csr0
& LE_C0_MISS
)
472 lp
->stats
.rx_errors
++; /* Missed a Rx frame. */
473 if (csr0
& LE_C0_MERR
) {
474 printk("%s: Bus master arbitration failure, status %4.4x.\n", dev
->name
, csr0
);
475 /* Restart the chip. */
476 ll
->rdp
= LE_C0_STRT
;
479 if ((TX_BUFFS_AVAIL
>= 0) && dev
->tbusy
) {
484 ll
->rdp
= LE_C0_BABL
|LE_C0_CERR
|LE_C0_MISS
|LE_C0_MERR
|
485 LE_C0_IDON
|LE_C0_INEA
;
490 struct net_device
*last_dev
= 0;
492 static int lance_open (struct net_device
*dev
)
494 struct lance_private
*lp
= (struct lance_private
*)dev
->priv
;
495 volatile struct lance_regs
*ll
= lp
->ll
;
500 /* Install the Interrupt handler */
501 if (request_irq(IRQ_AMIGA_PORTS
, lance_interrupt
, SA_SHIRQ
,
502 "a2065 Ethernet", dev
))
507 ll
->rdp
= LE_C0_STOP
;
510 lance_init_ring (dev
);
516 status
= init_restart_lance (lp
);
523 static int lance_close (struct net_device
*dev
)
525 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
526 volatile struct lance_regs
*ll
= lp
->ll
;
530 del_timer(&lp
->multicast_timer
);
534 ll
->rdp
= LE_C0_STOP
;
536 free_irq(IRQ_AMIGA_PORTS
, dev
);
543 static inline int lance_reset (struct net_device
*dev
)
545 struct lance_private
*lp
= (struct lance_private
*)dev
->priv
;
546 volatile struct lance_regs
*ll
= lp
->ll
;
551 ll
->rdp
= LE_C0_STOP
;
554 lance_init_ring (dev
);
555 dev
->trans_start
= jiffies
;
559 status
= init_restart_lance (lp
);
561 printk ("Lance restart=%d\n", status
);
566 static int lance_start_xmit (struct sk_buff
*skb
, struct net_device
*dev
)
568 struct lance_private
*lp
= (struct lance_private
*)dev
->priv
;
569 volatile struct lance_regs
*ll
= lp
->ll
;
570 volatile struct lance_init_block
*ib
= lp
->init_block
;
571 int entry
, skblen
, len
;
576 /* Transmitter timeout, serious problems */
578 int tickssofar
= jiffies
- dev
->trans_start
;
580 if (tickssofar
< 100) {
583 printk ("%s: transmit timed out, status %04x, resetting\n",
590 /* Block a timer-based transmit from overlapping. */
591 if (test_and_set_bit (0, (void *) &dev
->tbusy
) != 0) {
592 printk ("Transmitter access conflict.\n");
601 if (!TX_BUFFS_AVAIL
){
602 restore_flags(flags
);
607 /* dump the packet */
611 for (i
= 0; i
< 64; i
++) {
614 printk ("%2.2x ", skb
->data
[i
]);
618 len
= (skblen
<= ETH_ZLEN
) ? ETH_ZLEN
: skblen
;
619 entry
= lp
->tx_new
& lp
->tx_ring_mod_mask
;
620 ib
->btx_ring
[entry
].length
= (-len
) | 0xf000;
621 ib
->btx_ring
[entry
].misc
= 0;
623 memcpy ((char *)&ib
->tx_buf
[entry
][0], skb
->data
, skblen
);
625 /* Clear the slack of the packet, do I need this? */
627 memset ((char *) &ib
->tx_buf
[entry
][skblen
], 0, len
- skblen
);
629 /* Now, give the packet to the lance */
630 ib
->btx_ring
[entry
].tmd1_bits
= (LE_T1_POK
|LE_T1_OWN
);
631 lp
->tx_new
= (lp
->tx_new
+1) & lp
->tx_ring_mod_mask
;
634 /* Kick the lance: transmit now */
635 ll
->rdp
= LE_C0_INEA
| LE_C0_TDMD
;
636 dev
->trans_start
= jiffies
;
641 restore_flags(flags
);
646 static struct net_device_stats
*lance_get_stats (struct net_device
*dev
)
648 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
653 /* taken from the depca driver */
654 static void lance_load_multicast (struct net_device
*dev
)
656 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
657 volatile struct lance_init_block
*ib
= lp
->init_block
;
658 volatile u16
*mcast_table
= (u16
*)&ib
->filter
;
659 struct dev_mc_list
*dmi
=dev
->mc_list
;
662 u32 crc
, poly
= CRC_POLYNOMIAL_LE
;
664 /* set all multicast bits */
665 if (dev
->flags
& IFF_ALLMULTI
){
666 ib
->filter
[0] = 0xffffffff;
667 ib
->filter
[1] = 0xffffffff;
670 /* clear the multicast filter */
675 for (i
= 0; i
< dev
->mc_count
; i
++){
676 addrs
= dmi
->dmi_addr
;
679 /* multicast address? */
684 for (byte
= 0; byte
< 6; byte
++)
685 for (bit
= *addrs
++, j
= 0; j
< 8; j
++, bit
>>=1)
689 test
= ((bit
^ crc
) & 0x01);
699 mcast_table
[crc
>> 4] |= 1 << (crc
& 0xf);
704 static void lance_set_multicast (struct net_device
*dev
)
706 struct lance_private
*lp
= (struct lance_private
*) dev
->priv
;
707 volatile struct lance_init_block
*ib
= lp
->init_block
;
708 volatile struct lance_regs
*ll
= lp
->ll
;
714 mod_timer(&lp
->multicast_timer
, jiffies
+ 2);
717 set_bit (0, (void *) &dev
->tbusy
);
719 if (lp
->tx_old
!= lp
->tx_new
) {
720 mod_timer(&lp
->multicast_timer
, jiffies
+ 4);
726 ll
->rdp
= LE_C0_STOP
;
727 lance_init_ring (dev
);
729 if (dev
->flags
& IFF_PROMISC
) {
730 ib
->mode
|= LE_MO_PROM
;
732 ib
->mode
&= ~LE_MO_PROM
;
733 lance_load_multicast (dev
);
736 init_restart_lance (lp
);
741 int __init
a2065_probe(struct net_device
*dev
)
743 unsigned int key
, is_cbm
;
744 const struct ConfigDev
*cd
;
747 struct lance_private
*priv
;
748 struct A2065Board
*a2065
;
750 if ((key
= is_cbm
= zorro_find(ZORRO_PROD_CBM_A2065_1
, 0, 0)) ||
751 (key
= is_cbm
= zorro_find(ZORRO_PROD_CBM_A2065_2
, 0, 0)) ||
752 (key
= zorro_find(ZORRO_PROD_AMERISTAR_A2065
, 0, 0))) {
753 cd
= zorro_get_board(key
);
754 if ((board
= (u_long
)cd
->cd_BoardAddr
)) {
755 sn
= cd
->cd_Rom
.er_SerialNumber
;
756 if (is_cbm
) { /* Commodore */
757 dev
->dev_addr
[0] = 0x00;
758 dev
->dev_addr
[1] = 0x80;
759 dev
->dev_addr
[2] = 0x10;
760 } else { /* Ameristar */
761 dev
->dev_addr
[0] = 0x00;
762 dev
->dev_addr
[1] = 0x00;
763 dev
->dev_addr
[2] = 0x9f;
765 dev
->dev_addr
[3] = (sn
>>16) & 0xff;
766 dev
->dev_addr
[4] = (sn
>>8) & 0xff;
767 dev
->dev_addr
[5] = sn
& 0xff;
768 printk("%s: A2065 at 0x%08lx, Ethernet Address %02x:%02x:%02x:%02x:%02x:%02x\n",
769 dev
->name
, board
, dev
->dev_addr
[0],
770 dev
->dev_addr
[1], dev
->dev_addr
[2],
771 dev
->dev_addr
[3], dev
->dev_addr
[4],
774 init_etherdev(dev
, 0);
776 dev
->priv
= kmalloc(sizeof(struct
779 if (dev
->priv
== NULL
)
781 priv
= (struct lance_private
*)dev
->priv
;
782 memset(priv
, 0, sizeof(struct lance_private
));
784 a2065
= (struct A2065Board
*)ZTWO_VADDR(board
);
785 priv
->ll
= &a2065
->Lance
;
787 (struct lance_init_block
*)&a2065
->RAM
;
788 priv
->lance_init_block
= (struct lance_init_block
*)
789 offsetof(struct A2065Board
, RAM
);
790 priv
->auto_select
= 0;
792 priv
->busmaster_regval
= LE_C3_BSWP
;
794 priv
->lance_log_rx_bufs
= LANCE_LOG_RX_BUFFERS
;
795 priv
->lance_log_tx_bufs
= LANCE_LOG_TX_BUFFERS
;
796 priv
->rx_ring_mod_mask
= RX_RING_MOD_MASK
;
797 priv
->tx_ring_mod_mask
= TX_RING_MOD_MASK
;
799 dev
->open
= &lance_open
;
800 dev
->stop
= &lance_close
;
801 dev
->hard_start_xmit
= &lance_start_xmit
;
802 dev
->get_stats
= &lance_get_stats
;
803 dev
->set_multicast_list
= &lance_set_multicast
;
807 init_timer(&priv
->multicast_timer
);
808 priv
->multicast_timer
.data
= (unsigned long) dev
;
809 priv
->multicast_timer
.function
=
810 (void (*)(unsigned long)) &lance_set_multicast
;
812 zorro_config_board(key
, 0);
821 static char devicename
[9] = { 0, };
823 static struct net_device a2065_dev
=
825 devicename
, /* filled in by register_netdev() */
826 0, 0, 0, 0, /* memory */
827 0, 0, /* base, irq */
828 0, 0, 0, NULL
, a2065_probe
,
831 int init_module(void)
835 if ((err
= register_netdev(&a2065_dev
))) {
837 printk("No A2065 board found. Module not loaded.\n");
843 void cleanup_module(void)
845 struct lance_private
*priv
= (struct lance_private
*)a2065_dev
.priv
;
847 unregister_netdev(&a2065_dev
);
848 zorro_unconfig_board(priv
->key
, 0);