This source file includes following definitions.
- el16_probe
- el16_probe1
- el16_open
- el16_send_packet
- el16_interrupt
- el16_close
- el16_get_stats
- init_rx_bufs
- init_82586_mem
- hardware_send_packet
- el16_rx
- init_module
- cleanup_module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 static const char *version =
27 "3c507.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
28
29
30 #ifdef MODULE
31 #include <linux/module.h>
32 #include <linux/version.h>
33 #endif
34
35 #include <linux/config.h>
36
37
38
39
40
41
42
43
44
45
46
47
48 #include <linux/kernel.h>
49 #include <linux/sched.h>
50 #include <linux/types.h>
51 #include <linux/fcntl.h>
52 #include <linux/interrupt.h>
53 #include <linux/ptrace.h>
54 #include <linux/ioport.h>
55 #include <linux/in.h>
56 #include <linux/string.h>
57 #include <asm/system.h>
58 #include <asm/bitops.h>
59 #include <asm/io.h>
60 #include <asm/dma.h>
61 #include <linux/errno.h>
62
63 #include <linux/netdevice.h>
64 #include <linux/etherdevice.h>
65 #include <linux/skbuff.h>
66 #include <linux/malloc.h>
67
68 extern struct device *init_etherdev(struct device *dev, int sizeof_private,
69 unsigned long *mem_startp);
70
71
72
73 #ifndef NET_DEBUG
74 #define NET_DEBUG 1
75 #endif
76 static unsigned int net_debug = NET_DEBUG;
77
78
79 static unsigned int netcard_portlist[] =
80 { 0x300, 0x320, 0x340, 0x280, 0};
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 #define CUC_START 0x0100
98 #define CUC_RESUME 0x0200
99 #define CUC_SUSPEND 0x0300
100 #define RX_START 0x0010
101 #define RX_RESUME 0x0020
102 #define RX_SUSPEND 0x0030
103
104
105
106
107
108
109
110
111
112
113
114
115
116 #define CMD_EOL 0x8000
117 #define CMD_SUSP 0x4000
118 #define CMD_INTR 0x2000
119
120 enum commands {
121 CmdNOp = 0, CmdSASetup = 1, CmdConfigure = 2, CmdMulticastList = 3,
122 CmdTx = 4, CmdTDR = 5, CmdDump = 6, CmdDiagnose = 7};
123
124
125 struct net_local {
126 struct enet_statistics stats;
127 int last_restart;
128 ushort rx_head;
129 ushort rx_tail;
130 ushort tx_head;
131 ushort tx_cmd_link;
132 ushort tx_reap;
133 };
134
135
136
137
138
139
140
141
142
143 #define SA_DATA 0
144 #define MISC_CTRL 6
145 #define RESET_IRQ 10
146 #define SIGNAL_CA 11
147 #define ROM_CONFIG 13
148 #define MEM_CONFIG 14
149 #define IRQ_CONFIG 15
150 #define EL16_IO_EXTENT 16
151
152
153 #define ID_PORT 0x100
154
155
156 #define iSCB_STATUS 0x8
157 #define iSCB_CMD 0xA
158 #define iSCB_CBL 0xC
159 #define iSCB_RFA 0xE
160
161
162
163
164
165
166
167
168
169
170 #define SCB_BASE ((unsigned)64*1024 - (dev->mem_end - dev->mem_start))
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188 #define CONFIG_CMD 0x0018
189 #define SET_SA_CMD 0x0024
190 #define SA_OFFSET 0x002A
191 #define IDLELOOP 0x30
192 #define TDR_CMD 0x38
193 #define TDR_TIME 0x3C
194 #define DUMP_CMD 0x40
195 #define DIAG_CMD 0x48
196 #define SET_MC_CMD 0x4E
197 #define DUMP_DATA 0x56
198
199 #define TX_BUF_START 0x0100
200 #define NUM_TX_BUFS 4
201 #define TX_BUF_SIZE (1518+14+20+16)
202
203 #define RX_BUF_START 0x2000
204 #define RX_BUF_SIZE (1518+14+18)
205 #define RX_BUF_END (dev->mem_end - dev->mem_start)
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240 unsigned short init_words[] = {
241
242 0x0000,
243 0,0,
244 0x0000,0x0000,
245
246
247 0x0001,
248 0x0008,0,0,
249
250
251 0,0xf000|RX_START|CUC_START,
252 CONFIG_CMD,
253 RX_BUF_START,
254 0,0,0,0,
255
256
257 0, CmdConfigure,
258 SET_SA_CMD,
259 0x0804,
260 0x2e40,
261 0,
262
263
264 0, CmdSASetup,
265 SET_MC_CMD,
266 0xaa00,0xb000,0x0bad,
267
268
269 0, CmdNOp, IDLELOOP, 0 ,
270
271
272 0, CmdTDR, IDLELOOP, 0,
273
274
275 0, CmdDump, IDLELOOP, DUMP_DATA,
276
277
278 0, CmdDiagnose, IDLELOOP,
279
280
281 0, CmdMulticastList, IDLELOOP, 0,
282 };
283
284
285
286 extern int el16_probe(struct device *dev);
287
288 static int el16_probe1(struct device *dev, int ioaddr);
289 static int el16_open(struct device *dev);
290 static int el16_send_packet(struct sk_buff *skb, struct device *dev);
291 static void el16_interrupt(int irq, struct pt_regs *regs);
292 static void el16_rx(struct device *dev);
293 static int el16_close(struct device *dev);
294 static struct enet_statistics *el16_get_stats(struct device *dev);
295
296 static void hardware_send_packet(struct device *dev, void *buf, short length);
297 void init_82586_mem(struct device *dev);
298
299
300 #ifdef HAVE_DEVLIST
301 struct netdev_entry netcard_drv =
302 {"3c507", el16_probe1, EL16_IO_EXTENT, netcard_portlist};
303 #endif
304
305
306
307
308
309
310
311 int
312 el16_probe(struct device *dev)
313 {
314 int base_addr = dev ? dev->base_addr : 0;
315 int i;
316
317 if (base_addr > 0x1ff)
318 return el16_probe1(dev, base_addr);
319 else if (base_addr != 0)
320 return ENXIO;
321
322 for (i = 0; netcard_portlist[i]; i++) {
323 int ioaddr = netcard_portlist[i];
324 if (check_region(ioaddr, EL16_IO_EXTENT))
325 continue;
326 if (el16_probe1(dev, ioaddr) == 0)
327 return 0;
328 }
329
330 return ENODEV;
331 }
332
333 int el16_probe1(struct device *dev, int ioaddr)
334 {
335 static unsigned char init_ID_done = 0, version_printed = 0;
336 int i, irq, irqval;
337
338 if (init_ID_done == 0) {
339 ushort lrs_state = 0xff;
340
341 outb(0x00, ID_PORT);
342 for(i = 0; i < 255; i++) {
343 outb(lrs_state, ID_PORT);
344 lrs_state <<= 1;
345 if (lrs_state & 0x100)
346 lrs_state ^= 0xe7;
347 }
348 outb(0x00, ID_PORT);
349 init_ID_done = 1;
350 }
351
352 if (inb(ioaddr) == '*' && inb(ioaddr+1) == '3'
353 && inb(ioaddr+2) == 'C' && inb(ioaddr+3) == 'O')
354 ;
355 else
356 return ENODEV;
357
358
359 if (dev == NULL)
360 dev = init_etherdev(0, sizeof(struct net_local), 0);
361
362 if (net_debug && version_printed++ == 0)
363 printk(version);
364
365 printk("%s: 3c507 at %#x,", dev->name, ioaddr);
366
367
368
369
370 irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
371
372 irqval = request_irq(irq, &el16_interrupt, 0, "3c507");
373 if (irqval) {
374 printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval);
375 return EAGAIN;
376 }
377
378
379 request_region(ioaddr, EL16_IO_EXTENT,"3c507");
380 dev->base_addr = ioaddr;
381
382 outb(0x01, ioaddr + MISC_CTRL);
383 for (i = 0; i < 6; i++) {
384 dev->dev_addr[i] = inb(ioaddr + i);
385 printk(" %02x", dev->dev_addr[i]);
386 }
387
388 if ((dev->mem_start & 0xf) > 0)
389 net_debug = dev->mem_start & 7;
390
391 #ifdef MEM_BASE
392 dev->mem_start = MEM_BASE;
393 dev->mem_end = dev->mem_start + 0x10000;
394 #else
395 {
396 int base;
397 int size;
398 char mem_config = inb(ioaddr + MEM_CONFIG);
399 if (mem_config & 0x20) {
400 size = 64*1024;
401 base = 0xf00000 + (mem_config & 0x08 ? 0x080000
402 : ((mem_config & 3) << 17));
403 } else {
404 size = ((mem_config & 3) + 1) << 14;
405 base = 0x0c0000 + ( (mem_config & 0x18) << 12);
406 }
407 dev->mem_start = base;
408 dev->mem_end = base + size;
409 }
410 #endif
411
412 dev->if_port = (inb(ioaddr + ROM_CONFIG) & 0x80) ? 1 : 0;
413 dev->irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
414
415 printk(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq,
416 dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1);
417
418 if (net_debug)
419 printk(version);
420
421
422 if (dev->priv == NULL)
423 dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
424 memset(dev->priv, 0, sizeof(struct net_local));
425
426 dev->open = el16_open;
427 dev->stop = el16_close;
428 dev->hard_start_xmit = el16_send_packet;
429 dev->get_stats = el16_get_stats;
430
431 ether_setup(dev);
432
433 return 0;
434 }
435
436
437
438 static int
439 el16_open(struct device *dev)
440 {
441 irq2dev_map[dev->irq] = dev;
442
443
444 init_82586_mem(dev);
445
446 dev->tbusy = 0;
447 dev->interrupt = 0;
448 dev->start = 1;
449
450 #ifdef MODULE
451 MOD_INC_USE_COUNT;
452 #endif
453
454 return 0;
455 }
456
457 static int
458 el16_send_packet(struct sk_buff *skb, struct device *dev)
459 {
460 struct net_local *lp = (struct net_local *)dev->priv;
461 int ioaddr = dev->base_addr;
462 short *shmem = (short*)dev->mem_start;
463
464 if (dev->tbusy) {
465
466
467 int tickssofar = jiffies - dev->trans_start;
468 if (tickssofar < 5)
469 return 1;
470 if (net_debug > 1)
471 printk("%s: transmit timed out, %s? ", dev->name,
472 shmem[iSCB_STATUS>>1] & 0x8000 ? "IRQ conflict" :
473 "network cable problem");
474
475 if (lp->last_restart == lp->stats.tx_packets) {
476 if (net_debug > 1) printk("Resetting board.\n");
477
478 init_82586_mem(dev);
479 } else {
480
481 if (net_debug > 1) printk("Kicking board.\n");
482 shmem[iSCB_CMD>>1] = 0xf000|CUC_START|RX_START;
483 outb(0, ioaddr + SIGNAL_CA);
484 lp->last_restart = lp->stats.tx_packets;
485 }
486 dev->tbusy=0;
487 dev->trans_start = jiffies;
488 }
489
490
491
492
493 if (skb == NULL) {
494 dev_tint(dev);
495 return 0;
496 }
497
498
499 if (set_bit(0, (void*)&dev->tbusy) != 0)
500 printk("%s: Transmitter access conflict.\n", dev->name);
501 else {
502 short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
503 unsigned char *buf = skb->data;
504
505
506 outb(0x80, ioaddr + MISC_CTRL);
507 hardware_send_packet(dev, buf, length);
508 dev->trans_start = jiffies;
509
510 outb(0x84, ioaddr + MISC_CTRL);
511 }
512
513 dev_kfree_skb (skb, FREE_WRITE);
514
515
516
517 return 0;
518 }
519
520
521
522 static void
523 el16_interrupt(int irq, struct pt_regs *regs)
524 {
525 struct device *dev = (struct device *)(irq2dev_map[irq]);
526 struct net_local *lp;
527 int ioaddr, status, boguscount = 0;
528 ushort ack_cmd = 0;
529 ushort *shmem;
530
531 if (dev == NULL) {
532 printk ("net_interrupt(): irq %d for unknown device.\n", irq);
533 return;
534 }
535 dev->interrupt = 1;
536
537 ioaddr = dev->base_addr;
538 lp = (struct net_local *)dev->priv;
539 shmem = ((ushort*)dev->mem_start);
540
541 status = shmem[iSCB_STATUS>>1];
542
543 if (net_debug > 4) {
544 printk("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status);
545 }
546
547
548 outb(0x80, ioaddr + MISC_CTRL);
549
550
551 while (lp->tx_reap != lp->tx_head) {
552 unsigned short tx_status = shmem[lp->tx_reap>>1];
553
554 if (tx_status == 0) {
555 if (net_debug > 5) printk("Couldn't reap %#x.\n", lp->tx_reap);
556 break;
557 }
558 if (tx_status & 0x2000) {
559 lp->stats.tx_packets++;
560 lp->stats.collisions += tx_status & 0xf;
561 dev->tbusy = 0;
562 mark_bh(NET_BH);
563 } else {
564 lp->stats.tx_errors++;
565 if (tx_status & 0x0600) lp->stats.tx_carrier_errors++;
566 if (tx_status & 0x0100) lp->stats.tx_fifo_errors++;
567 if (!(tx_status & 0x0040)) lp->stats.tx_heartbeat_errors++;
568 if (tx_status & 0x0020) lp->stats.tx_aborted_errors++;
569 }
570 if (net_debug > 5)
571 printk("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status);
572 lp->tx_reap += TX_BUF_SIZE;
573 if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE)
574 lp->tx_reap = TX_BUF_START;
575 if (++boguscount > 4)
576 break;
577 }
578
579 if (status & 0x4000) {
580 if (net_debug > 5)
581 printk("Received packet, rx_head %04x.\n", lp->rx_head);
582 el16_rx(dev);
583 }
584
585
586 ack_cmd = status & 0xf000;
587
588 if ((status & 0x0700) != 0x0200 && dev->start) {
589 if (net_debug)
590 printk("%s: Command unit stopped, status %04x, restarting.\n",
591 dev->name, status);
592
593
594
595 ack_cmd |= CUC_RESUME;
596 }
597
598 if ((status & 0x0070) != 0x0040 && dev->start) {
599 static void init_rx_bufs(struct device *);
600
601
602 if (net_debug)
603 printk("%s: Rx unit stopped, status %04x, restarting.\n",
604 dev->name, status);
605 init_rx_bufs(dev);
606 shmem[iSCB_RFA >> 1] = RX_BUF_START;
607 ack_cmd |= RX_START;
608 }
609
610 shmem[iSCB_CMD>>1] = ack_cmd;
611 outb(0, ioaddr + SIGNAL_CA);
612
613
614 outb(0, ioaddr + RESET_IRQ);
615
616
617 outb(0x84, ioaddr + MISC_CTRL);
618
619 return;
620 }
621
622 static int
623 el16_close(struct device *dev)
624 {
625 int ioaddr = dev->base_addr;
626 ushort *shmem = (short*)dev->mem_start;
627
628 dev->tbusy = 1;
629 dev->start = 0;
630
631
632 shmem[iSCB_CMD >> 1] = RX_SUSPEND | CUC_SUSPEND;
633 outb(0, ioaddr + SIGNAL_CA);
634
635
636 outb(0x80, ioaddr + MISC_CTRL);
637
638
639
640
641 irq2dev_map[dev->irq] = 0;
642
643
644
645 #ifdef MODULE
646 MOD_DEC_USE_COUNT;
647 #endif
648
649 return 0;
650 }
651
652
653
654 static struct enet_statistics *
655 el16_get_stats(struct device *dev)
656 {
657 struct net_local *lp = (struct net_local *)dev->priv;
658
659
660
661 return &lp->stats;
662 }
663
664
665 static void
666 init_rx_bufs(struct device *dev)
667 {
668 struct net_local *lp = (struct net_local *)dev->priv;
669 unsigned short *write_ptr;
670 unsigned short SCB_base = SCB_BASE;
671
672 int cur_rxbuf = lp->rx_head = RX_BUF_START;
673
674
675 do {
676
677 write_ptr = (unsigned short *)(dev->mem_start + cur_rxbuf);
678
679 *write_ptr++ = 0x0000;
680 *write_ptr++ = 0x0000;
681 *write_ptr++ = cur_rxbuf + RX_BUF_SIZE;
682 *write_ptr++ = cur_rxbuf + 22;
683 *write_ptr++ = 0x0000;
684 *write_ptr++ = 0x0000;
685 *write_ptr++ = 0x0000;
686 *write_ptr++ = 0x0000;
687 *write_ptr++ = 0x0000;
688 *write_ptr++ = 0x0000;
689 *write_ptr++ = 0x0000;
690
691 *write_ptr++ = 0x0000;
692 *write_ptr++ = -1;
693 *write_ptr++ = cur_rxbuf + 0x20 + SCB_base;
694 *write_ptr++ = 0x0000;
695
696 *write_ptr++ = 0x8000 + RX_BUF_SIZE-0x20;
697
698 lp->rx_tail = cur_rxbuf;
699 cur_rxbuf += RX_BUF_SIZE;
700 } while (cur_rxbuf <= RX_BUF_END - RX_BUF_SIZE);
701
702
703
704 write_ptr = (unsigned short *)
705 (dev->mem_start + lp->rx_tail + 2);
706 *write_ptr++ = 0xC000;
707 *write_ptr++ = lp->rx_head;
708
709 }
710
711 void
712 init_82586_mem(struct device *dev)
713 {
714 struct net_local *lp = (struct net_local *)dev->priv;
715 short ioaddr = dev->base_addr;
716 ushort *shmem = (short*)dev->mem_start;
717
718
719
720 outb(0x20, ioaddr + MISC_CTRL);
721
722
723 init_words[3] = SCB_BASE;
724 init_words[7] = SCB_BASE;
725
726
727 memcpy((void*)dev->mem_end-10, init_words, 10);
728
729
730 memcpy((char*)dev->mem_start, init_words + 5, sizeof(init_words) - 10);
731
732
733 memcpy((char*)dev->mem_start+SA_OFFSET, dev->dev_addr,
734 sizeof(dev->dev_addr));
735
736
737 lp->tx_cmd_link = IDLELOOP + 4;
738 lp->tx_head = lp->tx_reap = TX_BUF_START;
739
740 init_rx_bufs(dev);
741
742
743 outb(0xA0, ioaddr + MISC_CTRL);
744
745
746
747 outb(0, ioaddr + SIGNAL_CA);
748
749 {
750 int boguscnt = 50;
751 while (shmem[iSCB_STATUS>>1] == 0)
752 if (--boguscnt == 0) {
753 printk("%s: i82586 initialization timed out with status %04x,"
754 "cmd %04x.\n", dev->name,
755 shmem[iSCB_STATUS>>1], shmem[iSCB_CMD>>1]);
756 break;
757 }
758
759 outb(0, ioaddr + SIGNAL_CA);
760 }
761
762
763 outb(0x84, ioaddr + MISC_CTRL);
764 if (net_debug > 4)
765 printk("%s: Initialized 82586, status %04x.\n", dev->name,
766 shmem[iSCB_STATUS>>1]);
767 return;
768 }
769
770 static void
771 hardware_send_packet(struct device *dev, void *buf, short length)
772 {
773 struct net_local *lp = (struct net_local *)dev->priv;
774 short ioaddr = dev->base_addr;
775 ushort tx_block = lp->tx_head;
776 ushort *write_ptr = (ushort *)(dev->mem_start + tx_block);
777
778
779 *write_ptr++ = 0x0000;
780 *write_ptr++ = CMD_INTR|CmdTx;
781 *write_ptr++ = tx_block+16;
782 *write_ptr++ = tx_block+8;
783
784
785 *write_ptr++ = length | 0x8000;
786 *write_ptr++ = -1;
787 *write_ptr++ = tx_block+22+SCB_BASE;
788 *write_ptr++ = 0x0000;
789
790
791 *write_ptr++ = 0x0000;
792 *write_ptr++ = CmdNOp;
793 *write_ptr++ = tx_block+16;
794
795
796 memcpy(write_ptr, buf, length);
797
798
799 *(ushort*)(dev->mem_start + lp->tx_cmd_link) = tx_block;
800 lp->tx_cmd_link = tx_block + 20;
801
802
803 lp->tx_head = tx_block + TX_BUF_SIZE;
804 if (lp->tx_head > RX_BUF_START - TX_BUF_SIZE)
805 lp->tx_head = TX_BUF_START;
806
807 if (net_debug > 4) {
808 printk("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n",
809 dev->name, ioaddr, length, tx_block, lp->tx_head);
810 }
811
812 if (lp->tx_head != lp->tx_reap)
813 dev->tbusy = 0;
814 }
815
816 static void
817 el16_rx(struct device *dev)
818 {
819 struct net_local *lp = (struct net_local *)dev->priv;
820 short *shmem = (short*)dev->mem_start;
821 ushort rx_head = lp->rx_head;
822 ushort rx_tail = lp->rx_tail;
823 ushort boguscount = 10;
824 short frame_status;
825
826 while ((frame_status = shmem[rx_head>>1]) < 0) {
827 ushort *read_frame = (short *)(dev->mem_start + rx_head);
828 ushort rfd_cmd = read_frame[1];
829 ushort next_rx_frame = read_frame[2];
830 ushort data_buffer_addr = read_frame[3];
831 ushort *data_frame = (short *)(dev->mem_start + data_buffer_addr);
832 ushort pkt_len = data_frame[0];
833
834 if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22
835 || pkt_len & 0xC000 != 0xC000) {
836 printk("%s: Rx frame at %#x corrupted, status %04x cmd %04x"
837 "next %04x data-buf @%04x %04x.\n", dev->name, rx_head,
838 frame_status, rfd_cmd, next_rx_frame, data_buffer_addr,
839 pkt_len);
840 } else if ((frame_status & 0x2000) == 0) {
841
842 lp->stats.rx_errors++;
843 if (frame_status & 0x0800) lp->stats.rx_crc_errors++;
844 if (frame_status & 0x0400) lp->stats.rx_frame_errors++;
845 if (frame_status & 0x0200) lp->stats.rx_fifo_errors++;
846 if (frame_status & 0x0100) lp->stats.rx_over_errors++;
847 if (frame_status & 0x0080) lp->stats.rx_length_errors++;
848 } else {
849
850 struct sk_buff *skb;
851
852 pkt_len &= 0x3fff;
853 skb = dev_alloc_skb(pkt_len+2);
854 if (skb == NULL) {
855 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
856 lp->stats.rx_dropped++;
857 break;
858 }
859
860 skb_reserve(skb,2);
861 skb->dev = dev;
862
863
864 memcpy(skb_put(skb,pkt_len), data_frame + 5, pkt_len);
865
866 skb->protocol=eth_type_trans(skb,dev);
867 netif_rx(skb);
868 lp->stats.rx_packets++;
869 }
870
871
872 read_frame[0] = 0;
873 read_frame[1] = 0xC000;
874
875 *(short*)(dev->mem_start + rx_tail + 2) = 0x0000;
876
877 rx_tail = rx_head;
878 rx_head = next_rx_frame;
879 if (--boguscount == 0)
880 break;
881 }
882
883 lp->rx_head = rx_head;
884 lp->rx_tail = rx_tail;
885 }
886 #ifdef MODULE
887 char kernel_version[] = UTS_RELEASE;
888 static struct device dev_3c507 = {
889 " " , 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el16_probe };
890
891 int io = 0x300;
892 int irq = 0;
893
894 int init_module(void)
895 {
896 if (io == 0)
897 printk("3c507: You should not use auto-probing with insmod!\n");
898 dev_3c507.base_addr = io;
899 dev_3c507.irq = irq;
900 if (register_netdev(&dev_3c507) != 0) {
901 printk("3c507: register_netdev() returned non-zero.\n");
902 return -EIO;
903 }
904 return 0;
905 }
906
907 void
908 cleanup_module(void)
909 {
910 if (MOD_IN_USE)
911 printk("3c507: device busy, remove delayed\n");
912 else
913 {
914 unregister_netdev(&dev_3c507);
915 }
916 }
917 #endif
918
919
920
921
922
923
924
925
926
927
928