1 /* 3c503.c: A shared-memory NS8390 ethernet driver for linux. */
3 Written 1992-94 by Donald Becker.
5 Copyright 1993 United States Government as represented by the
6 Director, National Security Agency. This software may be used and
7 distributed according to the terms of the GNU Public License,
8 incorporated herein by reference.
10 The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O
11 Center of Excellence in Space Data and Information Sciences
12 Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
14 This driver should work with the 3c503 and 3c503/16. It should be used
15 in shared memory mode for best performance, although it may also work
16 in programmed-I/O mode.
19 EtherLink II Technical Reference Manual,
20 EtherLink II/16 Technical Reference Manual Supplement,
21 3Com Corporation, 5400 Bayfront Plaza, Santa Clara CA 95052-8145
23 The Crynwr 3c503 packet driver.
27 Paul Gortmaker : add support for the 2nd 8kB of RAM on 16 bit cards.
28 Paul Gortmaker : multiple card support for module users.
29 rjohnson@analogic.com : Fix up PIO interface for efficient operation.
33 static const char *version
=
34 "3c503.c:v1.10 9/23/93 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
36 #include <linux/module.h>
38 #include <linux/kernel.h>
39 #include <linux/sched.h>
40 #include <linux/errno.h>
41 #include <linux/string.h>
42 #include <linux/delay.h>
43 #include <linux/netdevice.h>
44 #include <linux/etherdevice.h>
45 #include <linux/init.h>
48 #include <asm/system.h>
49 #include <asm/byteorder.h>
55 int el2_probe(struct net_device
*dev
);
56 int el2_pio_probe(struct net_device
*dev
);
57 int el2_probe1(struct net_device
*dev
, int ioaddr
);
59 /* A zero-terminated list of I/O addresses to be probed in PIO mode. */
60 static unsigned int netcard_portlist
[] __initdata
=
61 { 0x300,0x310,0x330,0x350,0x250,0x280,0x2a0,0x2e0,0};
63 #define EL2_IO_EXTENT 16
66 /* The 3c503 uses two entries, one for the safe memory-mapped probe and
67 the other for the typical I/O probe. */
68 struct netdev_entry el2_drv
=
69 {"3c503", el2_probe
, EL1_IO_EXTENT
, 0};
70 struct netdev_entry el2pio_drv
=
71 {"3c503pio", el2_pioprobe1
, EL1_IO_EXTENT
, netcard_portlist
};
74 static int el2_open(struct net_device
*dev
);
75 static int el2_close(struct net_device
*dev
);
76 static void el2_reset_8390(struct net_device
*dev
);
77 static void el2_init_card(struct net_device
*dev
);
78 static void el2_block_output(struct net_device
*dev
, int count
,
79 const unsigned char *buf
, int start_page
);
80 static void el2_block_input(struct net_device
*dev
, int count
, struct sk_buff
*skb
,
82 static void el2_get_8390_hdr(struct net_device
*dev
, struct e8390_pkt_hdr
*hdr
,
86 /* This routine probes for a memory-mapped 3c503 board by looking for
87 the "location register" at the end of the jumpered boot PROM space.
88 This works even if a PROM isn't there.
90 If the ethercard isn't found there is an optional probe for
91 ethercard jumpered to programmed-I/O mode.
94 el2_probe(struct net_device
*dev
)
96 int *addr
, addrs
[] = { 0xddffe, 0xd9ffe, 0xcdffe, 0xc9ffe, 0};
97 int base_addr
= dev
->base_addr
;
99 if (base_addr
> 0x1ff) /* Check a single specified location. */
100 return el2_probe1(dev
, base_addr
);
101 else if (base_addr
!= 0) /* Don't probe at all. */
104 for (addr
= addrs
; *addr
; addr
++) {
106 unsigned int base_bits
= readb(*addr
);
107 /* Find first set bit. */
108 for(i
= 7; i
>= 0; i
--, base_bits
>>= 1)
113 if (check_region(netcard_portlist
[i
], EL2_IO_EXTENT
))
115 if (el2_probe1(dev
, netcard_portlist
[i
]) == 0)
118 #if ! defined(no_probe_nonshared_memory) && ! defined (HAVE_DEVLIST)
119 return el2_pio_probe(dev
);
126 /* Try all of the locations that aren't obviously empty. This touches
127 a lot of locations, and is much riskier than the code above. */
129 el2_pio_probe(struct net_device
*dev
)
132 int base_addr
= dev
? dev
->base_addr
: 0;
134 if (base_addr
> 0x1ff) /* Check a single specified location. */
135 return el2_probe1(dev
, base_addr
);
136 else if (base_addr
!= 0) /* Don't probe at all. */
139 for (i
= 0; netcard_portlist
[i
]; i
++) {
140 int ioaddr
= netcard_portlist
[i
];
141 if (check_region(ioaddr
, EL2_IO_EXTENT
))
143 if (el2_probe1(dev
, ioaddr
) == 0)
151 /* Probe for the Etherlink II card at I/O port base IOADDR,
152 returning non-zero on success. If found, set the station
153 address and memory parameters in DEVICE. */
155 el2_probe1(struct net_device
*dev
, int ioaddr
)
157 int i
, iobase_reg
, membase_reg
, saved_406
, wordlength
;
158 static unsigned version_printed
= 0;
159 unsigned long vendor_id
;
161 /* Reset and/or avoid any lurking NE2000 */
162 if (inb(ioaddr
+ 0x408) == 0xff) {
167 /* We verify that it's a 3C503 board by checking the first three octets
168 of its ethernet address. */
169 iobase_reg
= inb(ioaddr
+0x403);
170 membase_reg
= inb(ioaddr
+0x404);
171 /* ASIC location registers should be 0 or have only a single bit set. */
172 if ( (iobase_reg
& (iobase_reg
- 1))
173 || (membase_reg
& (membase_reg
- 1))) {
176 saved_406
= inb_p(ioaddr
+ 0x406);
177 outb_p(ECNTRL_RESET
|ECNTRL_THIN
, ioaddr
+ 0x406); /* Reset it... */
178 outb_p(ECNTRL_THIN
, ioaddr
+ 0x406);
179 /* Map the station addr PROM into the lower I/O ports. We now check
180 for both the old and new 3Com prefix */
181 outb(ECNTRL_SAPROM
|ECNTRL_THIN
, ioaddr
+ 0x406);
182 vendor_id
= inb(ioaddr
)*0x10000 + inb(ioaddr
+ 1)*0x100 + inb(ioaddr
+ 2);
183 if ((vendor_id
!= OLD_3COM_ID
) && (vendor_id
!= NEW_3COM_ID
)) {
184 /* Restore the register we frobbed. */
185 outb(saved_406
, ioaddr
+ 0x406);
189 if (load_8390_module("3c503.c"))
192 /* We should have a "dev" from Space.c or the static module table. */
194 printk("3c503.c: Passed a NULL device.\n");
195 dev
= init_etherdev(0, 0);
198 if (ei_debug
&& version_printed
++ == 0)
201 dev
->base_addr
= ioaddr
;
202 /* Allocate dev->priv and fill in 8390 specific dev fields. */
203 if (ethdev_init(dev
)) {
204 printk ("3c503: unable to allocate memory for dev->priv.\n");
208 printk("%s: 3c503 at i/o base %#3x, node ", dev
->name
, ioaddr
);
210 /* Retrieve and print the ethernet address. */
211 for (i
= 0; i
< 6; i
++)
212 printk(" %2.2x", dev
->dev_addr
[i
] = inb(ioaddr
+ i
));
214 /* Map the 8390 back into the window. */
215 outb(ECNTRL_THIN
, ioaddr
+ 0x406);
217 /* Check for EL2/16 as described in tech. man. */
218 outb_p(E8390_PAGE0
, ioaddr
+ E8390_CMD
);
219 outb_p(0, ioaddr
+ EN0_DCFG
);
220 outb_p(E8390_PAGE2
, ioaddr
+ E8390_CMD
);
221 wordlength
= inb_p(ioaddr
+ EN0_DCFG
) & ENDCFG_WTS
;
222 outb_p(E8390_PAGE0
, ioaddr
+ E8390_CMD
);
224 /* Probe for, turn on and clear the board's shared memory. */
225 if (ei_debug
> 2) printk(" memory jumpers %2.2x ", membase_reg
);
226 outb(EGACFR_NORM
, ioaddr
+ 0x405); /* Enable RAM */
228 /* This should be probed for (or set via an ioctl()) at run-time.
229 Right now we use a sleazy hack to pass in the interface number
230 at boot-time via the low bits of the mem_end field. That value is
231 unused, and the low bits would be discarded even if it was used. */
232 #if defined(EI8390_THICK) || defined(EL2_AUI)
233 ei_status
.interface_num
= 1;
235 ei_status
.interface_num
= dev
->mem_end
& 0xf;
237 printk(", using %sternal xcvr.\n", ei_status
.interface_num
== 0 ? "in" : "ex");
239 if ((membase_reg
& 0xf0) == 0) {
241 ei_status
.name
= "3c503-PIO";
243 dev
->mem_start
= ((membase_reg
& 0xc0) ? 0xD8000 : 0xC8000) +
244 ((membase_reg
& 0xA0) ? 0x4000 : 0);
246 #define EL2_MEMSIZE (EL2_MB1_STOP_PG - EL2_MB1_START_PG)*256
248 /* This has never found an error, but someone might care.
249 Note that it only tests the 2nd 8kB on 16kB 3c503/16
250 cards between card addr. 0x2000 and 0x3fff. */
251 { /* Check the card's memory. */
252 unsigned long mem_base
= dev
->mem_start
;
253 unsigned int test_val
= 0xbbadf00d;
254 writel(0xba5eba5e, mem_base
);
255 for (i
= sizeof(test_val
); i
< EL2_MEMSIZE
; i
+=sizeof(test_val
)) {
256 writel(test_val
, mem_base
+ i
);
257 if (readl(mem_base
) != 0xba5eba5e
258 || readl(mem_base
+ i
) != test_val
) {
259 printk("3c503: memory failure or memory address conflict.\n");
261 ei_status
.name
= "3c503-PIO";
264 test_val
+= 0x55555555;
265 writel(0, mem_base
+ i
);
268 #endif /* EL2MEMTEST */
270 dev
->mem_end
= dev
->rmem_end
= dev
->mem_start
+ EL2_MEMSIZE
;
272 if (wordlength
) { /* No Tx pages to skip over to get to Rx */
273 dev
->rmem_start
= dev
->mem_start
;
274 ei_status
.name
= "3c503/16";
276 dev
->rmem_start
= TX_PAGES
*256 + dev
->mem_start
;
277 ei_status
.name
= "3c503";
282 Divide up the memory on the card. This is the same regardless of
283 whether shared-mem or PIO is used. For 16 bit cards (16kB RAM),
284 we use the entire 8k of bank1 for an Rx ring. We only use 3k
285 of the bank0 for 2 full size Tx packet slots. For 8 bit cards,
286 (8kB RAM) we use 3kB of bank1 for two Tx slots, and the remaining
287 5kB for an Rx ring. */
290 ei_status
.tx_start_page
= EL2_MB0_START_PG
;
291 ei_status
.rx_start_page
= EL2_MB1_START_PG
;
293 ei_status
.tx_start_page
= EL2_MB1_START_PG
;
294 ei_status
.rx_start_page
= EL2_MB1_START_PG
+ TX_PAGES
;
297 /* Finish setting the board's parameters. */
298 ei_status
.stop_page
= EL2_MB1_STOP_PG
;
299 ei_status
.word16
= wordlength
;
300 ei_status
.reset_8390
= &el2_reset_8390
;
301 ei_status
.get_8390_hdr
= &el2_get_8390_hdr
;
302 ei_status
.block_input
= &el2_block_input
;
303 ei_status
.block_output
= &el2_block_output
;
305 request_region(ioaddr
, EL2_IO_EXTENT
, ei_status
.name
);
309 else if (dev
->irq
> 5 && dev
->irq
!= 9) {
310 printk("3c503: configured interrupt %d invalid, will use autoIRQ.\n",
315 ei_status
.saved_irq
= dev
->irq
;
318 dev
->open
= &el2_open
;
319 dev
->stop
= &el2_close
;
322 printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
323 dev
->name
, ei_status
.name
, (wordlength
+1)<<3,
324 dev
->mem_start
, dev
->mem_end
-1);
328 ei_status
.tx_start_page
= EL2_MB1_START_PG
;
329 ei_status
.rx_start_page
= EL2_MB1_START_PG
+ TX_PAGES
;
330 printk("\n%s: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n",
331 dev
->name
, ei_status
.name
, (wordlength
+1)<<3);
337 el2_open(struct net_device
*dev
)
341 int irqlist
[] = {5, 9, 3, 4, 0};
344 outb(EGACFR_NORM
, E33G_GACFR
); /* Enable RAM and interrupts. */
346 if (request_irq (*irqp
, NULL
, 0, "bogus", dev
) != -EBUSY
) {
347 /* Twinkle the interrupt, and check if it's seen. */
349 outb_p(0x04 << ((*irqp
== 9) ? 2 : *irqp
), E33G_IDCFR
);
350 outb_p(0x00, E33G_IDCFR
);
351 if (*irqp
== autoirq_report(0) /* It's a good IRQ line! */
352 && request_irq (dev
->irq
= *irqp
, ei_interrupt
, 0, ei_status
.name
, dev
) == 0)
357 outb(EGACFR_IRQOFF
, E33G_GACFR
); /* disable interrupts. */
361 if (request_irq(dev
->irq
, ei_interrupt
, 0, ei_status
.name
, dev
)) {
373 el2_close(struct net_device
*dev
)
375 free_irq(dev
->irq
, dev
);
376 dev
->irq
= ei_status
.saved_irq
;
377 outb(EGACFR_IRQOFF
, E33G_GACFR
); /* disable interrupts. */
384 /* This is called whenever we have a unrecoverable failure:
386 Bad ring buffer packet header
389 el2_reset_8390(struct net_device
*dev
)
392 printk("%s: Resetting the 3c503 board...", dev
->name
);
393 printk("%#lx=%#02x %#lx=%#02x %#lx=%#02x...", E33G_IDCFR
, inb(E33G_IDCFR
),
394 E33G_CNTRL
, inb(E33G_CNTRL
), E33G_GACFR
, inb(E33G_GACFR
));
396 outb_p(ECNTRL_RESET
|ECNTRL_THIN
, E33G_CNTRL
);
398 outb_p(ei_status
.interface_num
==0 ? ECNTRL_THIN
: ECNTRL_AUI
, E33G_CNTRL
);
400 if (ei_debug
> 1) printk("done\n");
403 /* Initialize the 3c503 GA registers after a reset. */
405 el2_init_card(struct net_device
*dev
)
407 /* Unmap the station PROM and select the DIX or BNC connector. */
408 outb_p(ei_status
.interface_num
==0 ? ECNTRL_THIN
: ECNTRL_AUI
, E33G_CNTRL
);
410 /* Set ASIC copy of rx's first and last+1 buffer pages */
411 /* These must be the same as in the 8390. */
412 outb(ei_status
.rx_start_page
, E33G_STARTPG
);
413 outb(ei_status
.stop_page
, E33G_STOPPG
);
415 /* Point the vector pointer registers somewhere ?harmless?. */
416 outb(0xff, E33G_VP2
); /* Point at the ROM restart location 0xffff0 */
417 outb(0xff, E33G_VP1
);
418 outb(0x00, E33G_VP0
);
419 /* Turn off all interrupts until we're opened. */
420 outb_p(0x00, dev
->base_addr
+ EN0_IMR
);
421 /* Enable IRQs iff started. */
422 outb(EGACFR_NORM
, E33G_GACFR
);
424 /* Set the interrupt line. */
425 outb_p((0x04 << (dev
->irq
== 9 ? 2 : dev
->irq
)), E33G_IDCFR
);
426 outb_p((WRD_COUNT
<< 1), E33G_DRQCNT
); /* Set burst size to 8 */
427 outb_p(0x20, E33G_DMAAH
); /* Put a valid addr in the GA DMA */
428 outb_p(0x00, E33G_DMAAL
);
429 return; /* We always succeed */
433 * Either use the shared memory (if enabled on the board) or put the packet
434 * out through the ASIC FIFO.
437 el2_block_output(struct net_device
*dev
, int count
,
438 const unsigned char *buf
, int start_page
)
440 unsigned short int *wrd
;
441 int boguscount
; /* timeout counter */
442 unsigned short word
; /* temporary for better machine code */
444 if (ei_status
.word16
) /* Tx packets go into bank 0 on EL2/16 card */
445 outb(EGACFR_RSEL
|EGACFR_TCM
, E33G_GACFR
);
447 outb(EGACFR_NORM
, E33G_GACFR
);
449 if (dev
->mem_start
) { /* Shared memory transfer */
450 unsigned long dest_addr
= dev
->mem_start
+
451 ((start_page
- ei_status
.tx_start_page
) << 8);
452 memcpy_toio(dest_addr
, buf
, count
);
453 outb(EGACFR_NORM
, E33G_GACFR
); /* Back to bank1 in case on bank0 */
458 * No shared memory, put the packet out the other way.
459 * Set up then start the internal memory transfer to Tx Start Page
462 word
= (unsigned short)start_page
;
463 outb(word
&0xFF, E33G_DMAAH
);
464 outb(word
>>8, E33G_DMAAL
);
466 outb_p((ei_status
.interface_num
? ECNTRL_AUI
: ECNTRL_THIN
) | ECNTRL_OUTPUT
467 | ECNTRL_START
, E33G_CNTRL
);
470 * Here I am going to write data to the FIFO as quickly as possible.
471 * Note that E33G_FIFOH is defined incorrectly. It is really
472 * E33G_FIFOL, the lowest port address for both the byte and
473 * word write. Variable 'count' is NOT checked. Caller must supply a
474 * valid count. Note that I may write a harmless extra byte to the
475 * 8390 if the byte-count was not even.
477 wrd
= (unsigned short int *) buf
;
478 count
= (count
+ 1) >> 1;
482 while ((inb(E33G_STATUS
) & ESTAT_DPRDY
) == 0)
486 printk("%s: FIFO blocked in el2_block_output.\n", dev
->name
);
491 if(count
> WRD_COUNT
)
493 outsw(E33G_FIFOH
, wrd
, WRD_COUNT
);
499 outsw(E33G_FIFOH
, wrd
, count
);
504 outb_p(ei_status
.interface_num
==0 ? ECNTRL_THIN
: ECNTRL_AUI
, E33G_CNTRL
);
508 /* Read the 4 byte, page aligned 8390 specific header. */
510 el2_get_8390_hdr(struct net_device
*dev
, struct e8390_pkt_hdr
*hdr
, int ring_page
)
513 unsigned long hdr_start
= dev
->mem_start
+ ((ring_page
- EL2_MB1_START_PG
)<<8);
516 if (dev
->mem_start
) { /* Use the shared memory. */
517 memcpy_fromio(hdr
, hdr_start
, sizeof(struct e8390_pkt_hdr
));
522 * No shared memory, use programmed I/O.
525 word
= (unsigned short)ring_page
;
526 outb(word
&0xFF, E33G_DMAAH
);
527 outb(word
>>8, E33G_DMAAL
);
529 outb_p((ei_status
.interface_num
== 0 ? ECNTRL_THIN
: ECNTRL_AUI
) | ECNTRL_INPUT
530 | ECNTRL_START
, E33G_CNTRL
);
532 while ((inb(E33G_STATUS
) & ESTAT_DPRDY
) == 0)
536 printk("%s: FIFO blocked in el2_get_8390_hdr.\n", dev
->name
);
537 memset(hdr
, 0x00, sizeof(struct e8390_pkt_hdr
));
542 insw(E33G_FIFOH
, hdr
, (sizeof(struct e8390_pkt_hdr
))>> 1);
544 outb_p(ei_status
.interface_num
== 0 ? ECNTRL_THIN
: ECNTRL_AUI
, E33G_CNTRL
);
549 el2_block_input(struct net_device
*dev
, int count
, struct sk_buff
*skb
, int ring_offset
)
552 unsigned short int *buf
;
555 int end_of_ring
= dev
->rmem_end
;
557 /* Maybe enable shared memory just be to be safe... nahh.*/
558 if (dev
->mem_start
) { /* Use the shared memory. */
559 ring_offset
-= (EL2_MB1_START_PG
<<8);
560 if (dev
->mem_start
+ ring_offset
+ count
> end_of_ring
) {
561 /* We must wrap the input move. */
562 int semi_count
= end_of_ring
- (dev
->mem_start
+ ring_offset
);
563 memcpy_fromio(skb
->data
, dev
->mem_start
+ ring_offset
, semi_count
);
565 memcpy_fromio(skb
->data
+ semi_count
, dev
->rmem_start
, count
);
567 /* Packet is in one chunk -- we can copy + cksum. */
568 eth_io_copy_and_sum(skb
, dev
->mem_start
+ ring_offset
, count
, 0);
574 * No shared memory, use programmed I/O.
576 word
= (unsigned short) ring_offset
;
577 outb(word
>>8, E33G_DMAAH
);
578 outb(word
&0xFF, E33G_DMAAL
);
580 outb_p((ei_status
.interface_num
== 0 ? ECNTRL_THIN
: ECNTRL_AUI
) | ECNTRL_INPUT
581 | ECNTRL_START
, E33G_CNTRL
);
584 * Here I also try to get data as fast as possible. I am betting that I
585 * can read one extra byte without clobbering anything in the kernel because
586 * this would only occur on an odd byte-count and allocation of skb->data
587 * is word-aligned. Variable 'count' is NOT checked. Caller must check
589 * [This is currently quite safe.... but if one day the 3c503 explodes
590 * you know where to come looking ;)]
593 buf
= (unsigned short int *) skb
->data
;
594 count
= (count
+ 1) >> 1;
598 while ((inb(E33G_STATUS
) & ESTAT_DPRDY
) == 0)
602 printk("%s: FIFO blocked in el2_block_input.\n", dev
->name
);
607 if(count
> WRD_COUNT
)
609 insw(E33G_FIFOH
, buf
, WRD_COUNT
);
615 insw(E33G_FIFOH
, buf
, count
);
620 outb_p(ei_status
.interface_num
== 0 ? ECNTRL_THIN
: ECNTRL_AUI
, E33G_CNTRL
);
624 #define MAX_EL2_CARDS 4 /* Max number of EL2 cards per module */
625 #define NAMELEN 8 /* #of chars for storing dev->name */
627 static char namelist
[NAMELEN
* MAX_EL2_CARDS
] = { 0, };
628 static struct net_device dev_el2
[MAX_EL2_CARDS
] = {
630 NULL
, /* assign a chunk of namelist[] below */
637 static int io
[MAX_EL2_CARDS
] = { 0, };
638 static int irq
[MAX_EL2_CARDS
] = { 0, };
639 static int xcvr
[MAX_EL2_CARDS
] = { 0, }; /* choose int. or ext. xcvr */
640 MODULE_PARM(io
, "1-" __MODULE_STRING(MAX_EL2_CARDS
) "i");
641 MODULE_PARM(irq
, "1-" __MODULE_STRING(MAX_EL2_CARDS
) "i");
642 MODULE_PARM(xcvr
, "1-" __MODULE_STRING(MAX_EL2_CARDS
) "i");
644 /* This is set up so that only a single autoprobe takes place per call.
645 ISA device autoprobes on a running machine are not recommended. */
649 int this_dev
, found
= 0;
651 for (this_dev
= 0; this_dev
< MAX_EL2_CARDS
; this_dev
++) {
652 struct net_device
*dev
= &dev_el2
[this_dev
];
653 dev
->name
= namelist
+(NAMELEN
*this_dev
);
654 dev
->irq
= irq
[this_dev
];
655 dev
->base_addr
= io
[this_dev
];
656 dev
->mem_end
= xcvr
[this_dev
]; /* low 4bits = xcvr sel. */
657 dev
->init
= el2_probe
;
658 if (io
[this_dev
] == 0) {
659 if (this_dev
!= 0) break; /* only autoprobe 1st one */
660 printk(KERN_NOTICE
"3c503.c: Presently autoprobing (not recommended) for a single card.\n");
662 if (register_netdev(dev
) != 0) {
663 printk(KERN_WARNING
"3c503.c: No 3c503 card found (i/o = 0x%x).\n", io
[this_dev
]);
664 if (found
!= 0) { /* Got at least one. */
681 for (this_dev
= 0; this_dev
< MAX_EL2_CARDS
; this_dev
++) {
682 struct net_device
*dev
= &dev_el2
[this_dev
];
683 if (dev
->priv
!= NULL
) {
684 void *priv
= dev
->priv
;
685 /* NB: el2_close() handles free_irq */
686 release_region(dev
->base_addr
, EL2_IO_EXTENT
);
687 unregister_netdev(dev
);
691 unlock_8390_module();
698 * kept-new-versions: 5