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
27
28
29
30
31
32
33#include <linux/config.h>
34#include <linux/netdevice.h>
35#include <linux/errno.h>
36#include <linux/init.h>
37#include <linux/netlink.h>
38#include <linux/divert.h>
39
40#define NEXT_DEV NULL
41
42
43
44
45
46
47extern int ne2_probe(struct net_device *dev);
48extern int hp100_probe(struct net_device *dev);
49extern int ultra_probe(struct net_device *dev);
50extern int ultra32_probe(struct net_device *dev);
51extern int ultramca_probe(struct net_device *dev);
52extern int wd_probe(struct net_device *dev);
53extern int el2_probe(struct net_device *dev);
54extern int ne_probe(struct net_device *dev);
55extern int hp_probe(struct net_device *dev);
56extern int hp_plus_probe(struct net_device *dev);
57extern int znet_probe(struct net_device *);
58extern int express_probe(struct net_device *);
59extern int eepro_probe(struct net_device *);
60extern int el3_probe(struct net_device *);
61extern int at1500_probe(struct net_device *);
62extern int at1700_probe(struct net_device *);
63extern int fmv18x_probe(struct net_device *);
64extern int eth16i_probe(struct net_device *);
65extern int depca_probe(struct net_device *);
66extern int i82596_probe(struct net_device *);
67extern int ewrk3_probe(struct net_device *);
68extern int de4x5_probe(struct net_device *);
69extern int el1_probe(struct net_device *);
70extern int wavelan_probe(struct net_device *);
71extern int arlan_probe(struct net_device *);
72extern int el16_probe(struct net_device *);
73extern int elmc_probe(struct net_device *);
74extern int skmca_probe(struct net_device *);
75extern int elplus_probe(struct net_device *);
76extern int ac3200_probe(struct net_device *);
77extern int es_probe(struct net_device *);
78extern int lne390_probe(struct net_device *);
79extern int ne3210_probe(struct net_device *);
80extern int e2100_probe(struct net_device *);
81extern int ni5010_probe(struct net_device *);
82extern int ni52_probe(struct net_device *);
83extern int ni65_probe(struct net_device *);
84extern int sonic_probe(struct net_device *);
85extern int SK_init(struct net_device *);
86extern int seeq8005_probe(struct net_device *);
87extern int smc_init( struct net_device * );
88extern int sgiseeq_probe(struct net_device *);
89extern int atarilance_probe(struct net_device *);
90extern int sun3lance_probe(struct net_device *);
91extern int sun3_82586_probe(struct net_device *);
92extern int apne_probe(struct net_device *);
93extern int bionet_probe(struct net_device *);
94extern int pamsnet_probe(struct net_device *);
95extern int cs89x0_probe(struct net_device *dev);
96extern int ethertap_probe(struct net_device *dev);
97extern int hplance_probe(struct net_device *dev);
98extern int bagetlance_probe(struct net_device *);
99extern int mvme147lance_probe(struct net_device *dev);
100extern int tc515_probe(struct net_device *dev);
101extern int lance_probe(struct net_device *dev);
102extern int mace_probe(struct net_device *dev);
103extern int macsonic_probe(struct net_device *dev);
104extern int mac8390_probe(struct net_device *dev);
105extern int mac89x0_probe(struct net_device *dev);
106extern int mc32_probe(struct net_device *dev);
107
108
109extern int de600_probe(struct net_device *);
110extern int de620_probe(struct net_device *);
111
112
113extern int skfp_probe(struct net_device *dev);
114
115
116extern int iph5526_probe(struct net_device *dev);
117
118
119extern int sbni_probe(struct net_device *);
120
121struct devprobe
122{
123 int (*probe)(struct net_device *dev);
124 int status;
125};
126
127
128
129
130
131
132
133
134static int __init probe_list(struct net_device *dev, struct devprobe *plist)
135{
136 struct devprobe *p = plist;
137 unsigned long base_addr = dev->base_addr;
138#ifdef CONFIG_NET_DIVERT
139 int ret;
140#endif
141
142 while (p->probe != NULL) {
143 if (base_addr && p->probe(dev) == 0) {
144#ifdef CONFIG_NET_DIVERT
145 ret = alloc_divert_blk(dev);
146 if (ret)
147 return ret;
148#endif
149 return 0;
150 } else if (p->status == 0) {
151 p->status = p->probe(dev);
152 if (p->status == 0) {
153#ifdef CONFIG_NET_DIVERT
154 ret = alloc_divert_blk(dev);
155 if (ret)
156 return ret;
157#endif
158 return 0;
159 }
160 }
161 p++;
162 }
163 return -ENODEV;
164}
165
166
167
168
169
170
171
172static struct devprobe eisa_probes[] __initdata = {
173#ifdef CONFIG_DE4X5
174 {de4x5_probe, 0},
175#endif
176#ifdef CONFIG_ULTRA32
177 {ultra32_probe, 0},
178#endif
179#ifdef CONFIG_AC3200
180 {ac3200_probe, 0},
181#endif
182#ifdef CONFIG_ES3210
183 {es_probe, 0},
184#endif
185#ifdef CONFIG_LNE390
186 {lne390_probe, 0},
187#endif
188#ifdef CONFIG_NE3210
189 {ne3210_probe, 0},
190#endif
191 {NULL, 0},
192};
193
194
195static struct devprobe mca_probes[] __initdata = {
196#ifdef CONFIG_ULTRAMCA
197 {ultramca_probe, 0},
198#endif
199#ifdef CONFIG_NE2_MCA
200 {ne2_probe, 0},
201#endif
202#ifdef CONFIG_ELMC
203 {elmc_probe, 0},
204#endif
205#ifdef CONFIG_ELMC_II
206 {mc32_probe, 0},
207#endif
208#ifdef CONFIG_SKMC
209 {skmca_probe, 0},
210#endif
211 {NULL, 0},
212};
213
214
215
216
217
218static struct devprobe isa_probes[] __initdata = {
219#ifdef CONFIG_EL3
220 {el3_probe, 0},
221#endif
222#ifdef CONFIG_HP100
223 {hp100_probe, 0},
224#endif
225#ifdef CONFIG_3C515
226 {tc515_probe, 0},
227#endif
228#ifdef CONFIG_ULTRA
229 {ultra_probe, 0},
230#endif
231#ifdef CONFIG_WD80x3
232 {wd_probe, 0},
233#endif
234#ifdef CONFIG_EL2
235 {el2_probe, 0},
236#endif
237#ifdef CONFIG_HPLAN
238 {hp_probe, 0},
239#endif
240#ifdef CONFIG_HPLAN_PLUS
241 {hp_plus_probe, 0},
242#endif
243#ifdef CONFIG_E2100
244 {e2100_probe, 0},
245#endif
246#ifdef CONFIG_NE2000
247 {ne_probe, 0},
248#endif
249#ifdef CONFIG_LANCE
250 {lance_probe, 0},
251#endif
252#ifdef CONFIG_SMC9194
253 {smc_init, 0},
254#endif
255#ifdef CONFIG_SEEQ8005
256 {seeq8005_probe, 0},
257#endif
258#ifdef CONFIG_AT1500
259 {at1500_probe, 0},
260#endif
261#ifdef CONFIG_CS89x0
262 {cs89x0_probe, 0},
263#endif
264#ifdef CONFIG_AT1700
265 {at1700_probe, 0},
266#endif
267#ifdef CONFIG_FMV18X
268 {fmv18x_probe, 0},
269#endif
270#ifdef CONFIG_ETH16I
271 {eth16i_probe, 0},
272#endif
273#ifdef CONFIG_ZNET
274 {znet_probe, 0},
275#endif
276#ifdef CONFIG_EEXPRESS
277 {express_probe, 0},
278#endif
279#ifdef CONFIG_EEXPRESS_PRO
280 {eepro_probe, 0},
281#endif
282#ifdef CONFIG_DEPCA
283 {depca_probe, 0},
284#endif
285#ifdef CONFIG_EWRK3
286 {ewrk3_probe, 0},
287#endif
288#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET)
289 {i82596_probe, 0},
290#endif
291#ifdef CONFIG_EL1
292 {el1_probe, 0},
293#endif
294#ifdef CONFIG_WAVELAN
295 {wavelan_probe, 0},
296#endif
297#ifdef CONFIG_ARLAN
298 {arlan_probe, 0},
299#endif
300#ifdef CONFIG_EL16
301 {el16_probe, 0},
302#endif
303#ifdef CONFIG_ELPLUS
304 {elplus_probe, 0},
305#endif
306#ifdef CONFIG_SK_G16
307 {SK_init, 0},
308#endif
309#ifdef CONFIG_NI5010
310 {ni5010_probe, 0},
311#endif
312#ifdef CONFIG_NI52
313 {ni52_probe, 0},
314#endif
315#ifdef CONFIG_NI65
316 {ni65_probe, 0},
317#endif
318 {NULL, 0},
319};
320
321static struct devprobe parport_probes[] __initdata = {
322#ifdef CONFIG_DE600
323 {de600_probe, 0},
324#endif
325#ifdef CONFIG_DE620
326 {de620_probe, 0},
327#endif
328 {NULL, 0},
329};
330
331static struct devprobe m68k_probes[] __initdata = {
332#ifdef CONFIG_ATARILANCE
333 {atarilance_probe, 0},
334#endif
335#ifdef CONFIG_SUN3LANCE
336 {sun3lance_probe, 0},
337#endif
338#ifdef CONFIG_SUN3_82586
339 {sun3_82586_probe, 0},
340#endif
341#ifdef CONFIG_APNE
342 {apne_probe, 0},
343#endif
344#ifdef CONFIG_ATARI_BIONET
345 {bionet_probe, 0},
346#endif
347#ifdef CONFIG_ATARI_PAMSNET
348 {pamsnet_probe, 0},
349#endif
350#ifdef CONFIG_HPLANCE
351 {hplance_probe, 0},
352#endif
353#ifdef CONFIG_MVME147_NET
354 {mvme147lance_probe, 0},
355#endif
356#ifdef CONFIG_MACMACE
357 {mace_probe, 0},
358#endif
359#ifdef CONFIG_MACSONIC
360 {macsonic_probe, 0},
361#endif
362#ifdef CONFIG_MAC8390
363 {mac8390_probe, 0},
364#endif
365#ifdef CONFIG_MAC89x0
366 {mac89x0_probe, 0},
367#endif
368 {NULL, 0},
369};
370
371
372static struct devprobe sgi_probes[] __initdata = {
373#ifdef CONFIG_SGISEEQ
374 {sgiseeq_probe, 0},
375#endif
376 {NULL, 0},
377};
378
379static struct devprobe mips_probes[] __initdata = {
380#ifdef CONFIG_MIPS_JAZZ_SONIC
381 {sonic_probe, 0},
382#endif
383#ifdef CONFIG_BAGETLANCE
384 {bagetlance_probe, 0},
385#endif
386 {NULL, 0},
387};
388
389
390
391
392
393
394static int __init ethif_probe(struct net_device *dev)
395{
396 unsigned long base_addr = dev->base_addr;
397
398
399
400
401
402 if (base_addr == 1)
403 return 1;
404
405
406
407
408
409 if (probe_list(dev, m68k_probes) == 0)
410 return 0;
411 if (probe_list(dev, mips_probes) == 0)
412 return 0;
413 if (probe_list(dev, sgi_probes) == 0)
414 return 0;
415 if (probe_list(dev, eisa_probes) == 0)
416 return 0;
417 if (probe_list(dev, mca_probes) == 0)
418 return 0;
419 if (probe_list(dev, isa_probes) == 0)
420 return 0;
421 if (probe_list(dev, parport_probes) == 0)
422 return 0;
423 return -ENODEV;
424}
425
426#ifdef CONFIG_FDDI
427static int __init fddiif_probe(struct net_device *dev)
428{
429 unsigned long base_addr = dev->base_addr;
430
431 if (base_addr == 1)
432 return 1;
433
434 if (1
435#ifdef CONFIG_APFDDI
436 && apfddi_init(dev)
437#endif
438#ifdef CONFIG_SKFP
439 && skfp_probe(dev)
440#endif
441 && 1 ) {
442 return 1;
443 }
444 return 0;
445}
446#endif
447
448
449#ifdef CONFIG_NET_FC
450static int fcif_probe(struct net_device *dev)
451{
452 if (dev->base_addr == -1)
453 return 1;
454
455 if (1
456#ifdef CONFIG_IPHASE5526
457 && iph5526_probe(dev)
458#endif
459 && 1 ) {
460 return 1;
461 }
462 return 0;
463}
464#endif
465
466
467#ifdef CONFIG_ETHERTAP
468static struct net_device tap0_dev = {
469 .name = "tap0",
470 .base_addr = NETLINK_TAPBASE,
471 .next = NEXT_DEV,
472 .init = ethertap_probe,
473};
474#undef NEXT_DEV
475#define NEXT_DEV (&tap0_dev)
476#endif
477
478#ifdef CONFIG_SDLA
479extern int sdla_init(struct net_device *);
480static struct net_device sdla0_dev = {
481 .name = "sdla0",
482 .next = NEXT_DEV,
483 .init = sdla_init,
484};
485#undef NEXT_DEV
486#define NEXT_DEV (&sdla0_dev)
487#endif
488
489#if defined(CONFIG_LTPC)
490extern int ltpc_probe(struct net_device *);
491static struct net_device dev_ltpc = {
492 .name = "lt0",
493 .next = NEXT_DEV,
494 .init = ltpc_probe
495};
496#undef NEXT_DEV
497#define NEXT_DEV (&dev_ltpc)
498#endif
499
500#if defined(CONFIG_COPS)
501extern int cops_probe(struct net_device *);
502static struct net_device cops2_dev = {
503 .name = "lt2",
504 .next = NEXT_DEV,
505 .init = cops_probe,
506};
507static struct net_device cops1_dev = {
508 .name = "lt1",
509 .next = &cops2_dev,
510 .init = cops_probe,
511};
512static struct net_device cops0_dev = {
513 .name = "lt0",
514 .next = &cops1_dev,
515 .init = cops_probe,
516};
517#undef NEXT_DEV
518#define NEXT_DEV (&cops0_dev)
519#endif
520
521static struct net_device eth7_dev = {
522 .name = "eth%d",
523 .next = NEXT_DEV,
524 .init = ethif_probe,
525};
526static struct net_device eth6_dev = {
527 .name = "eth%d",
528 .next = ð7_dev,
529 .init = ethif_probe,
530};
531static struct net_device eth5_dev = {
532 .name = "eth%d",
533 .next = ð6_dev,
534 .init = ethif_probe,
535};
536static struct net_device eth4_dev = {
537 .name = "eth%d",
538 .next = ð5_dev,
539 .init = ethif_probe,
540};
541static struct net_device eth3_dev = {
542 .name = "eth%d",
543 .next = ð4_dev,
544 .init = ethif_probe,
545};
546static struct net_device eth2_dev = {
547 .name = "eth%d",
548 .next = ð3_dev,
549 .init = ethif_probe,
550};
551static struct net_device eth1_dev = {
552 .name = "eth%d",
553 .next = ð2_dev,
554 .init = ethif_probe,
555};
556static struct net_device eth0_dev = {
557 .name = "eth%d",
558 .next = ð1_dev,
559 .init = ethif_probe,
560};
561
562#undef NEXT_DEV
563#define NEXT_DEV (ð0_dev)
564
565
566
567#ifdef CONFIG_TR
568
569extern int ibmtr_probe(struct net_device *);
570extern int smctr_probe(struct net_device *);
571
572static int
573trif_probe(struct net_device *dev)
574{
575 if (1
576#ifdef CONFIG_IBMTR
577 && ibmtr_probe(dev)
578#endif
579#ifdef CONFIG_SMCTR
580 && smctr_probe(dev)
581#endif
582 && 1 ) {
583 return 1;
584 }
585 return 0;
586}
587static struct net_device tr7_dev = {
588 .name = "tr%d",
589 .next = NEXT_DEV,
590 .init = trif_probe,
591};
592static struct net_device tr6_dev = {
593 .name = "tr%d",
594 .next = &tr7_dev,
595 .init = trif_probe,
596};
597static struct net_device tr5_dev = {
598 .name = "tr%d",
599 .next = &tr6_dev,
600 .init = trif_probe,
601};
602static struct net_device tr4_dev = {
603 .name = "tr%d",
604 .next = &tr5_dev,
605 .init = trif_probe,
606};
607static struct net_device tr3_dev = {
608 .name = "tr%d",
609 .next = &tr4_dev,
610 .init = trif_probe,
611};
612static struct net_device tr2_dev = {
613 .name = "tr%d",
614 .next = &tr3_dev,
615 .init = trif_probe,
616};
617static struct net_device tr1_dev = {
618 .name = "tr%d",
619 .next = &tr2_dev,
620 .init = trif_probe,
621};
622static struct net_device tr0_dev = {
623 .name = "tr%d",
624 .next = &tr1_dev,
625 .init = trif_probe,
626};
627#undef NEXT_DEV
628#define NEXT_DEV (&tr0_dev)
629
630#endif
631
632#ifdef CONFIG_FDDI
633static struct net_device fddi7_dev = {
634 .name = "fddi7",
635 .next = NEXT_DEV,
636 .init = fddiif_probe
637};
638static struct net_device fddi6_dev = {
639 .name = "fddi6",
640 .next = &fddi7_dev,
641 .init = fddiif_probe
642};
643static struct net_device fddi5_dev = {
644 .name = "fddi5",
645 .next = &fddi6_dev,
646 .init = fddiif_probe
647};
648static struct net_device fddi4_dev = {
649 .name = "fddi4",
650 .next = &fddi5_dev,
651 .init = fddiif_probe
652};
653static struct net_device fddi3_dev = {
654 .name = "fddi3",
655 .next = &fddi4_dev,
656 .init = fddiif_probe
657};
658static struct net_device fddi2_dev = {
659 .name = "fddi2",
660 .next = &fddi3_dev,
661 .init = fddiif_probe
662};
663static struct net_device fddi1_dev = {
664 .name = "fddi1",
665 .next = &fddi2_dev,
666 .init = fddiif_probe
667};
668static struct net_device fddi0_dev = {
669 .name = "fddi0",
670 .next = &fddi1_dev,
671 .init = fddiif_probe
672};
673#undef NEXT_DEV
674#define NEXT_DEV (&fddi0_dev)
675#endif
676
677
678#ifdef CONFIG_NET_FC
679static struct net_device fc1_dev = {
680 .name = "fc1",
681 .next = NEXT_DEV,
682 .init = fcif_probe
683};
684static struct net_device fc0_dev = {
685 .name = "fc0",
686 .next = &fc1_dev,
687 .init = fcif_probe
688};
689#undef NEXT_DEV
690#define NEXT_DEV (&fc0_dev)
691#endif
692
693
694#ifdef CONFIG_SBNI
695static struct net_device sbni7_dev = {
696 .name = "sbni7",
697 .next = NEXT_DEV,
698 .init = sbni_probe,
699};
700static struct net_device sbni6_dev = {
701 .name = "sbni6",
702 .next = &sbni7_dev,
703 .init = sbni_probe,
704};
705static struct net_device sbni5_dev = {
706 .name = "sbni5",
707 .next = &sbni6_dev,
708 .init = sbni_probe,
709};
710static struct net_device sbni4_dev = {
711 .name = "sbni4",
712 .next = &sbni5_dev,
713 .init = sbni_probe,
714};
715static struct net_device sbni3_dev = {
716 .name = "sbni3",
717 .next = &sbni4_dev,
718 .init = sbni_probe,
719};
720static struct net_device sbni2_dev = {
721 .name = "sbni2",
722 .next = &sbni3_dev,
723 .init = sbni_probe,
724};
725static struct net_device sbni1_dev = {
726 .name = "sbni1",
727 .next = &sbni2_dev,
728 .init = sbni_probe,
729};
730static struct net_device sbni0_dev = {
731 .name = "sbni0",
732 .next = &sbni1_dev,
733 .init = sbni_probe,
734};
735
736#undef NEXT_DEV
737#define NEXT_DEV (&sbni0_dev)
738#endif
739
740
741
742
743
744
745extern int loopback_init(struct net_device *dev);
746struct net_device loopback_dev = {
747 .name = "lo",
748 .next = NEXT_DEV,
749 .init = loopback_init
750};
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771struct net_device *dev_base = &loopback_dev;
772rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
773
774