* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / net / Space.c
bloba10d519f58138e92575b17bd58a3ee0719f0f5bd
1 /*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
6 * Holds initial configuration information for devices.
8 * Version: @(#)Space.c 1.0.7 08/12/93
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu>
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Donald J. Becker, <becker@super.org>
14 * Changelog:
15 * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 09/1999
16 * - fix sbni: s/device/net_device/
17 * Paul Gortmaker (06/98):
18 * - sort probes in a sane way, make sure all (safe) probes
19 * get run once & failed autoprobes don't autoprobe again.
21 * FIXME:
22 * Phase out placeholder dev entries put in the linked list
23 * here in favour of drivers using init_etherdev(NULL, ...)
24 * combined with a single find_all_devs() function (for 2.3)
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version
29 * 2 of the License, or (at your option) any later version.
31 #include <linux/config.h>
32 #include <linux/netdevice.h>
33 #include <linux/errno.h>
34 #include <linux/init.h>
35 #include <linux/netlink.h>
37 #define NEXT_DEV NULL
40 /* A unified ethernet device probe. This is the easiest way to have every
41 ethernet adaptor have the name "eth[0123...]".
44 extern int ne2_probe(struct net_device *dev);
45 extern int tulip_probe(struct net_device *dev);
46 extern int hp100_probe(struct net_device *dev);
47 extern int ultra_probe(struct net_device *dev);
48 extern int ultra32_probe(struct net_device *dev);
49 extern int ultramca_probe(struct net_device *dev);
50 extern int wd_probe(struct net_device *dev);
51 extern int el2_probe(struct net_device *dev);
52 extern int ne2k_pci_probe(struct net_device *dev);
53 extern int ne_probe(struct net_device *dev);
54 extern int hp_probe(struct net_device *dev);
55 extern int hp_plus_probe(struct net_device *dev);
56 extern int znet_probe(struct net_device *);
57 extern int express_probe(struct net_device *);
58 extern int eepro_probe(struct net_device *);
59 extern int eepro100_probe(struct net_device *);
60 extern int el3_probe(struct net_device *);
61 extern int at1500_probe(struct net_device *);
62 extern int pcnet32_probe(struct net_device *);
63 extern int at1700_probe(struct net_device *);
64 extern int fmv18x_probe(struct net_device *);
65 extern int eth16i_probe(struct net_device *);
66 extern int depca_probe(struct net_device *);
67 extern int i82596_probe(struct net_device *);
68 extern int ewrk3_probe(struct net_device *);
69 extern int de4x5_probe(struct net_device *);
70 extern int el1_probe(struct net_device *);
71 extern int wavelan_probe(struct net_device *);
72 extern int arlan_probe(struct net_device *);
73 extern int el16_probe(struct net_device *);
74 extern int elmc_probe(struct net_device *);
75 extern int skmca_probe(struct net_device *);
76 extern int elplus_probe(struct net_device *);
77 extern int ac3200_probe(struct net_device *);
78 extern int es_probe(struct net_device *);
79 extern int lne390_probe(struct net_device *);
80 extern int ne3210_probe(struct net_device *);
81 extern int e2100_probe(struct net_device *);
82 extern int ni5010_probe(struct net_device *);
83 extern int ni52_probe(struct net_device *);
84 extern int ni65_probe(struct net_device *);
85 extern int sonic_probe(struct net_device *);
86 extern int SK_init(struct net_device *);
87 extern int seeq8005_probe(struct net_device *);
88 extern int tc59x_probe(struct net_device *);
89 extern int dgrs_probe(struct net_device *);
90 extern int smc_init( struct net_device * );
91 extern int sparc_lance_probe(struct net_device *);
92 extern int happy_meal_probe(struct net_device *);
93 extern int qec_probe(struct net_device *);
94 extern int bigmac_probe(struct net_device *);
95 extern int myri_sbus_probe(struct net_device *);
96 extern int sgiseeq_probe(struct net_device *);
97 extern int atarilance_probe(struct net_device *);
98 extern int sun3lance_probe(struct net_device *);
99 extern int a2065_probe(struct net_device *);
100 extern int ariadne_probe(struct net_device *);
101 extern int ariadne2_probe(struct net_device *);
102 extern int hydra_probe(struct net_device *);
103 extern int apne_probe(struct net_device *);
104 extern int bionet_probe(struct net_device *);
105 extern int pamsnet_probe(struct net_device *);
106 extern int tlan_probe(struct net_device *);
107 extern int mace_probe(struct net_device *);
108 extern int bmac_probe(struct net_device *);
109 extern int ncr885e_probe(struct net_device *);
110 extern int cs89x0_probe(struct net_device *dev);
111 extern int ethertap_probe(struct net_device *dev);
112 extern int ether1_probe (struct net_device *dev);
113 extern int ether3_probe (struct net_device *dev);
114 extern int etherh_probe (struct net_device *dev);
115 extern int am79c961_probe(struct net_device *dev);
116 extern int epic100_probe(struct net_device *dev);
117 extern int rtl8139_probe(struct net_device *dev);
118 extern int sis900_probe(struct net_device *dev);
119 extern int hplance_probe(struct net_device *dev);
120 extern int bagetlance_probe(struct net_device *);
121 extern int dec_lance_probe(struct net_device *);
122 extern int mvme147lance_probe(struct net_device *dev);
123 extern int via_rhine_probe(struct net_device *dev);
124 extern int tc515_probe(struct net_device *dev);
125 extern int lance_probe(struct net_device *dev);
126 extern int starfire_probe(struct net_device *dev);
127 extern int rcpci_probe(struct net_device *);
128 extern int mac_onboard_sonic_probe(struct net_device *dev);
129 extern int dmfe_reg_board(struct net_device *);
131 /* Gigabit Ethernet adapters */
132 extern int yellowfin_probe(struct net_device *dev);
133 extern int acenic_probe(struct net_device *dev);
135 /* Detachable devices ("pocket adaptors") */
136 extern int atp_init(struct net_device *);
137 extern int de600_probe(struct net_device *);
138 extern int de620_probe(struct net_device *);
140 /* FDDI adapters */
141 extern int dfx_probe(struct net_device *dev);
142 extern int apfddi_init(struct net_device *dev);
144 /* HIPPI boards */
145 extern int rr_hippi_probe(struct net_device *);
147 /* Fibre Channel adapters */
148 extern int iph5526_probe(struct net_device *dev);
150 /* SBNI adapters */
151 extern int sbni_probe(struct net_device *);
153 struct devprobe
155 int (*probe)(struct net_device *dev);
156 int status; /* non-zero if autoprobe has failed */
160 * probe_list walks a list of probe functions and calls each so long
161 * as a non-zero ioaddr is given, or as long as it hasn't already failed
162 * to find a card in the past (as recorded by "status") when asked to
163 * autoprobe (i.e. a probe that fails to find a card when autoprobing
164 * will not be asked to autoprobe again). It exits when a card is found.
166 static int __init probe_list(struct net_device *dev, struct devprobe *plist)
168 struct devprobe *p = plist;
169 unsigned long base_addr = dev->base_addr;
171 while (p->probe != NULL) {
172 if (base_addr && p->probe(dev) == 0) /* probe given addr */
173 return 0;
174 else if (p->status == 0) { /* has autoprobe failed yet? */
175 p->status = p->probe(dev); /* no, try autoprobe */
176 if (p->status == 0)
177 return 0;
179 p++;
181 return -ENODEV;
185 * If your probe touches ISA ports (<0x400) in addition to
186 * looking for PCI cards, then put it in the isa_probes
187 * list instead.
189 struct devprobe pci_probes[] __initdata = {
190 #ifdef CONFIG_DGRS
191 {dgrs_probe, 0},
192 #endif
193 #ifdef CONFIG_RCPCI
194 {rcpci_probe, 0},
195 #endif
196 #ifdef CONFIG_VORTEX
197 {tc59x_probe, 0},
198 #endif
199 #ifdef CONFIG_NE2K_PCI
200 {ne2k_pci_probe, 0},
201 #endif
202 #ifdef CONFIG_PCNET32
203 {pcnet32_probe, 0},
204 #endif
205 #ifdef CONFIG_EEXPRESS_PRO100 /* Intel EtherExpress Pro/100 */
206 {eepro100_probe, 0},
207 #endif
208 #ifdef CONFIG_DEC_ELCP
209 {tulip_probe, 0},
210 #endif
211 #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */
212 {de4x5_probe, 0},
213 #endif
214 #ifdef CONFIG_TLAN
215 {tlan_probe, 0},
216 #endif
217 #ifdef CONFIG_EPIC100
218 {epic100_probe, 0},
219 #endif
220 #ifdef CONFIG_RTL8139
221 {rtl8139_probe, 0},
222 #endif
223 #ifdef CONFIG_SIS900
224 {sis900_probe, 0},
225 #endif
227 #ifdef CONFIG_DM9102
228 {dmfe_reg_board, 0},
229 #endif
231 #ifdef CONFIG_YELLOWFIN
232 {yellowfin_probe, 0},
233 #endif
234 #ifdef CONFIG_ACENIC
235 {acenic_probe, 0},
236 #endif
237 #ifdef CONFIG_VIA_RHINE
238 {via_rhine_probe, 0},
239 #endif
240 #ifdef CONFIG_ADAPTEC_STARFIRE
241 {starfire_probe, 0},
242 #endif
243 {NULL, 0},
247 * This is a bit of an artificial separation as there are PCI drivers
248 * that also probe for EISA cards (in the PCI group) and there are ISA
249 * drivers that probe for EISA cards (in the ISA group). These are the
250 * EISA only driver probes.
252 struct devprobe eisa_probes[] __initdata = {
253 #ifdef CONFIG_ULTRA32
254 {ultra32_probe, 0},
255 #endif
256 #ifdef CONFIG_AC3200
257 {ac3200_probe, 0},
258 #endif
259 #ifdef CONFIG_ES3210
260 {es_probe, 0},
261 #endif
262 #ifdef CONFIG_LNE390
263 {lne390_probe, 0},
264 #endif
265 #ifdef CONFIG_NE3210
266 {ne3210_probe, 0},
267 #endif
268 {NULL, 0},
271 struct devprobe sparc_probes[] __initdata = {
272 #ifdef CONFIG_HAPPYMEAL
273 {happy_meal_probe, 0},
274 #endif
275 #ifdef CONFIG_SUNLANCE
276 {sparc_lance_probe, 0},
277 #endif
278 #ifdef CONFIG_SUNQE
279 {qec_probe, 0},
280 #endif
281 #ifdef CONFIG_SUNBMAC
282 {bigmac_probe, 0},
283 #endif
284 #ifdef CONFIG_MYRI_SBUS
285 {myri_sbus_probe, 0},
286 #endif
287 {NULL, 0},
290 struct devprobe mca_probes[] __initdata = {
291 #ifdef CONFIG_ULTRAMCA
292 {ultramca_probe, 0},
293 #endif
294 #ifdef CONFIG_NE2_MCA
295 {ne2_probe, 0},
296 #endif
297 #ifdef CONFIG_ELMC /* 3c523 */
298 {elmc_probe, 0},
299 #endif
300 #ifdef CONFIG_SKMC /* SKnet Microchannel */
301 {skmca_probe, 0},
302 #endif
303 {NULL, 0},
307 * ISA probes that touch addresses < 0x400 (including those that also
308 * look for EISA/PCI/MCA cards in addition to ISA cards).
310 struct devprobe isa_probes[] __initdata = {
311 #ifdef CONFIG_EL3 /* ISA, EISA, MCA 3c5x9 */
312 {el3_probe, 0},
313 #endif
314 #ifdef CONFIG_HP100 /* ISA, EISA & PCI */
315 {hp100_probe, 0},
316 #endif
317 #ifdef CONFIG_3C515
318 {tc515_probe, 0},
319 #endif
320 #ifdef CONFIG_ULTRA
321 {ultra_probe, 0},
322 #endif
323 #ifdef CONFIG_WD80x3
324 {wd_probe, 0},
325 #endif
326 #ifdef CONFIG_EL2 /* 3c503 */
327 {el2_probe, 0},
328 #endif
329 #ifdef CONFIG_HPLAN
330 {hp_probe, 0},
331 #endif
332 #ifdef CONFIG_HPLAN_PLUS
333 {hp_plus_probe, 0},
334 #endif
335 #ifdef CONFIG_E2100 /* Cabletron E21xx series. */
336 {e2100_probe, 0},
337 #endif
338 #ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */
339 {ne_probe, 0},
340 #endif
341 #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
342 {lance_probe, 0},
343 #endif
344 #ifdef CONFIG_SMC9194
345 {smc_init, 0},
346 #endif
347 #ifdef CONFIG_SEEQ8005
348 {seeq8005_probe, 0},
349 #endif
350 #ifdef CONFIG_AT1500
351 {at1500_probe, 0},
352 #endif
353 #ifdef CONFIG_CS89x0
354 {cs89x0_probe, 0},
355 #endif
356 #ifdef CONFIG_AT1700
357 {at1700_probe, 0},
358 #endif
359 #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */
360 {fmv18x_probe, 0},
361 #endif
362 #ifdef CONFIG_ETH16I
363 {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */
364 #endif
365 #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */
366 {znet_probe, 0},
367 #endif
368 #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */
369 {express_probe, 0},
370 #endif
371 #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
372 {eepro_probe, 0},
373 #endif
374 #ifdef CONFIG_DEPCA /* DEC DEPCA */
375 {depca_probe, 0},
376 #endif
377 #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
378 {ewrk3_probe, 0},
379 #endif
380 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
381 {i82596_probe, 0},
382 #endif
383 #ifdef CONFIG_EL1 /* 3c501 */
384 {el1_probe, 0},
385 #endif
386 #ifdef CONFIG_WAVELAN /* WaveLAN */
387 {wavelan_probe, 0},
388 #endif
389 #ifdef CONFIG_ARLAN /* Aironet */
390 {arlan_probe, 0},
391 #endif
392 #ifdef CONFIG_EL16 /* 3c507 */
393 {el16_probe, 0},
394 #endif
395 #ifdef CONFIG_ELPLUS /* 3c505 */
396 {elplus_probe, 0},
397 #endif
398 #ifdef CONFIG_SK_G16
399 {SK_init, 0},
400 #endif
401 #ifdef CONFIG_NI5010
402 {ni5010_probe, 0},
403 #endif
404 #ifdef CONFIG_NI52
405 {ni52_probe, 0},
406 #endif
407 #ifdef CONFIG_NI65
408 {ni65_probe, 0},
409 #endif
410 {NULL, 0},
413 struct devprobe parport_probes[] __initdata = {
414 #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
415 {de600_probe, 0},
416 #endif
417 #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
418 {de620_probe, 0},
419 #endif
420 #ifdef CONFIG_ATP /* AT-LAN-TEC (RealTek) pocket adaptor. */
421 {atp_init, 0},
422 #endif
423 {NULL, 0},
426 struct devprobe m68k_probes[] __initdata = {
427 #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
428 {atarilance_probe, 0},
429 #endif
430 #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
431 {sun3lance_probe, 0},
432 #endif
433 #ifdef CONFIG_A2065 /* Commodore/Ameristar A2065 Ethernet Board */
434 {a2065_probe, 0},
435 #endif
436 #ifdef CONFIG_ARIADNE /* Village Tronic Ariadne Ethernet Board */
437 {ariadne_probe, 0},
438 #endif
439 #ifdef CONFIG_ARIADNE2 /* Village Tronic Ariadne II Ethernet Board */
440 {ariadne2_probe, 0},
441 #endif
442 #ifdef CONFIG_HYDRA /* Hydra Systems Amiganet Ethernet board */
443 {hydra_probe, 0},
444 #endif
445 #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */
446 {apne_probe, 0},
447 #endif
448 #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */
449 {bionet_probe, 0},
450 #endif
451 #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */
452 {pamsnet_probe, 0},
453 #endif
454 #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */
455 {hplance_probe, 0},
456 #endif
457 #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
458 {mvme147lance_probe, 0},
459 #endif
460 #ifdef CONFIG_MACSONIC /* Mac 68k Quadra builtin Ethernet */
461 {mac_onboard_sonic_probe, 0},
462 #endif
463 {NULL, 0},
466 struct devprobe ppc_probes[] __initdata = {
467 #ifdef CONFIG_MACE
468 {mace_probe, 0},
469 #endif
470 #ifdef CONFIG_BMAC
471 {bmac_probe, 0},
472 #endif
473 #ifdef CONFIG_NCR885E
474 {ncr885e_probe, 0},
475 #endif
476 {NULL, 0},
479 struct devprobe sgi_probes[] __initdata = {
480 #ifdef CONFIG_SGISEEQ
481 {sgiseeq_probe, 0},
482 #endif
483 {NULL, 0},
486 struct devprobe mips_probes[] __initdata = {
487 #ifdef CONFIG_MIPS_JAZZ_SONIC
488 {sonic_probe, 0},
489 #endif
490 #ifdef CONFIG_DECLANCE /* DECstation on-board controller */
491 {dec_lance_probe, 0}, /* and maybe TURBOchannel option boards */
492 #endif
493 #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
494 {bagetlance_probe, 0},
495 #endif
496 {NULL, 0},
499 struct devprobe arm_probes[] __initdata = {
500 #ifdef CONFIG_ARM_ETHERH
501 {etherh_probe , 0},
502 #endif
503 #ifdef CONFIG_ARM_ETHER3
504 {ether3_probe , 0},
505 #endif
506 #ifdef CONFIG_ARM_ETHER1
507 {ether1_probe , 0},
508 #endif
509 #ifdef CONFIG_ARM_AM79C961A
510 {am79c961_probe, 0},
511 #endif
512 {NULL, 0},
516 * Unified ethernet device probe, segmented per architecture and
517 * per bus interface.
519 static int __init ethif_probe(struct net_device *dev)
521 unsigned long base_addr = dev->base_addr;
524 * Backwards compatibility - historically an I/O base of 1 was
525 * used to indicate not to probe for this ethN interface
527 if (base_addr == 1)
528 return 1; /* ENXIO */
531 * The arch specific probes are 1st so that any on-board ethernet
532 * will be probed before other ISA/EISA/MCA/PCI bus cards.
534 if (probe_list(dev, arm_probes) == 0)
535 return 0;
536 if (probe_list(dev, m68k_probes) == 0)
537 return 0;
538 if (probe_list(dev, mips_probes) == 0)
539 return 0;
540 if (probe_list(dev, ppc_probes) == 0)
541 return 0;
542 if (probe_list(dev, sgi_probes) == 0)
543 return 0;
544 if (probe_list(dev, sparc_probes) == 0)
545 return 0;
546 if (probe_list(dev, pci_probes) == 0)
547 return 0;
548 if (probe_list(dev, eisa_probes) == 0)
549 return 0;
550 if (probe_list(dev, mca_probes) == 0)
551 return 0;
553 * Backwards compatibility - an I/O of 0xffe0 was used to indicate
554 * that we shouldn't do a bunch of potentially risky ISA probes
555 * for ethN (N>1). Since the widespread use of modules, *nobody*
556 * compiles a kernel with all the ISA drivers built in anymore,
557 * and so we should delete this check in linux 2.3 - Paul G.
559 if (base_addr != 0xffe0 && probe_list(dev, isa_probes) == 0)
560 return 0;
561 if (probe_list(dev, parport_probes) == 0)
562 return 0;
563 return -ENODEV;
566 #ifdef CONFIG_FDDI
567 static int __init fddiif_probe(struct net_device *dev)
569 unsigned long base_addr = dev->base_addr;
571 if (base_addr == 1)
572 return 1; /* ENXIO */
574 if (1
575 #ifdef CONFIG_DEFXX
576 && dfx_probe(dev)
577 #endif
578 #ifdef CONFIG_APFDDI
579 && apfddi_init(dev)
580 #endif
581 && 1 ) {
582 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
584 return 0;
586 #endif
588 #ifdef CONFIG_HIPPI
589 static int hippi_probe(struct net_device *dev)
592 * Damn this is ugly.
594 * Why the heck would we want to determine this from the base
595 * address? Stupid PC'ism .... grrrrr.
597 if (dev->base_addr == -1)
598 return 1;
600 if (1
601 #ifdef CONFIG_ROADRUNNER
602 && rr_hippi_probe(dev)
603 #endif
604 && 1 ) {
605 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
607 return 0;
609 #endif
611 /* Pad device name to IFNAMSIZ=16. F.e. __PAD6 is tring of 9 zeros. */
612 #define __PAD6 "\0\0\0\0\0\0\0\0\0"
613 #define __PAD5 __PAD6 "\0"
614 #define __PAD4 __PAD5 "\0"
615 #define __PAD3 __PAD4 "\0"
616 #define __PAD2 __PAD3 "\0"
619 #ifdef CONFIG_NET_FC
620 static int fcif_probe(struct net_device *dev)
622 if (dev->base_addr == -1)
623 return 1;
625 if (1
626 #ifdef CONFIG_IPHASE5526
627 && iph5526_probe(dev)
628 #endif
629 && 1 ) {
630 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
632 return 0;
634 #endif /* CONFIG_NET_FC */
637 #ifdef CONFIG_ETHERTAP
638 static struct net_device tap0_dev = { "tap0" __PAD4, 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
639 # undef NEXT_DEV
640 # define NEXT_DEV (&tap0_dev)
641 #endif
643 #ifdef CONFIG_SDLA
644 extern int sdla_init(struct net_device *);
645 static struct net_device sdla0_dev = { "sdla0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
647 # undef NEXT_DEV
648 # define NEXT_DEV (&sdla0_dev)
649 #endif
651 #if defined(CONFIG_LTPC)
652 extern int ltpc_probe(struct net_device *);
653 static struct net_device dev_ltpc = {
654 "lt0" __PAD3,
655 0, 0, 0, 0,
656 0x0, 0,
657 0, 0, 0, NEXT_DEV, ltpc_probe };
658 # undef NEXT_DEV
659 # define NEXT_DEV (&dev_ltpc)
660 #endif /* LTPC */
662 #if defined(CONFIG_COPS)
663 extern int cops_probe(struct net_device *);
664 static struct net_device cops2_dev = { "lt2" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
665 static struct net_device cops1_dev = { "lt1" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
666 static struct net_device cops0_dev = { "lt0" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
667 # undef NEXT_DEV
668 # define NEXT_DEV (&cops0_dev)
669 #endif /* COPS */
671 #if defined(CONFIG_IPDDP)
672 extern int ipddp_init(struct net_device *dev);
673 static struct net_device dev_ipddp = {
674 "ipddp0" __PAD6,
675 0, 0, 0, 0,
676 0x0, 0,
677 0, 0, 0, NEXT_DEV, ipddp_init };
678 # undef NEXT_DEV
679 # define NEXT_DEV (&dev_ipddp)
680 #endif /* CONFIG_IPDDP */
682 /* The first device defaults to I/O base '0', which means autoprobe. */
683 #ifndef ETH0_ADDR
684 # define ETH0_ADDR 0
685 #endif
686 #ifndef ETH0_IRQ
687 # define ETH0_IRQ 0
688 #endif
690 /* "eth0" defaults to autoprobe (== 0), other use a base of 0xffe0 (== -0x20),
691 which means "don't do ISA probes". Distributions don't ship kernels with
692 all ISA drivers compiled in anymore, so its probably no longer an issue. */
694 #define ETH_NOPROBE_ADDR 0xffe0
696 static struct net_device eth7_dev = {
697 "eth7" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
698 static struct net_device eth6_dev = {
699 "eth6" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth7_dev, ethif_probe };
700 static struct net_device eth5_dev = {
701 "eth5" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth6_dev, ethif_probe };
702 static struct net_device eth4_dev = {
703 "eth4" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth5_dev, ethif_probe };
704 static struct net_device eth3_dev = {
705 "eth3" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth4_dev, ethif_probe };
706 static struct net_device eth2_dev = {
707 "eth2" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
708 static struct net_device eth1_dev = {
709 "eth1" __PAD4, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth2_dev, ethif_probe };
711 static struct net_device eth0_dev = {
712 "eth0" __PAD4, 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, &eth1_dev, ethif_probe };
714 # undef NEXT_DEV
715 # define NEXT_DEV (&eth0_dev)
717 #if defined(SLIP) || defined(CONFIG_SLIP)
718 /* To be exact, this node just hooks the initialization
719 routines to the device structures. */
720 extern int slip_init_ctrl_dev(struct net_device *);
721 static struct net_device slip_bootstrap = {
722 "slip_proto", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, slip_init_ctrl_dev, };
723 #undef NEXT_DEV
724 #define NEXT_DEV (&slip_bootstrap)
725 #endif /* SLIP */
727 #if defined(X25_ASY) || defined(CONFIG_X25_ASY)
728 /* To be exact, this node just hooks the initialization
729 routines to the device structures. */
730 extern int x25_asy_init_ctrl_dev(struct net_device *);
731 static struct net_device x25_asy_bootstrap = {
732 "x25_proto", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, x25_asy_init_ctrl_dev, };
733 #undef NEXT_DEV
734 #define NEXT_DEV (&x25_asy_bootstrap)
735 #endif /* X25_ASY */
737 #if defined(CONFIG_MKISS)
738 /* To be exact, this node just hooks the initialization
739 routines to the device structures. */
740 extern int mkiss_init_ctrl_dev(struct net_device *);
741 static struct net_device mkiss_bootstrap = {
742 "mkiss_proto", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, mkiss_init_ctrl_dev, };
743 #undef NEXT_DEV
744 #define NEXT_DEV (&mkiss_bootstrap)
745 #endif /* MKISS */
747 #if defined(CONFIG_YAM)
748 extern int yam_init(struct net_device *);
749 static struct net_device yam_bootstrap = {
750 "yam", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, yam_init, };
751 #undef NEXT_DEV
752 #define NEXT_DEV (&yam_bootstrap)
753 #endif /* CONFIG_YAM */
755 #if defined(CONFIG_STRIP)
756 extern int strip_init_ctrl_dev(struct net_device *);
757 static struct net_device strip_bootstrap = {
758 "strip_proto", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, strip_init_ctrl_dev, };
759 #undef NEXT_DEV
760 #define NEXT_DEV (&strip_bootstrap)
761 #endif /* STRIP */
763 #if defined(CONFIG_PPP)
764 extern int ppp_init(struct net_device *);
765 static struct net_device ppp_bootstrap = {
766 "ppp_proto", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, ppp_init, };
767 #undef NEXT_DEV
768 #define NEXT_DEV (&ppp_bootstrap)
769 #endif /* PPP */
771 #ifdef CONFIG_DUMMY
772 extern int dummy_init(struct net_device *dev);
773 static struct net_device dummy_dev = {
774 "dummy" __PAD5, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, dummy_init, };
775 # undef NEXT_DEV
776 # define NEXT_DEV (&dummy_dev)
777 #endif
779 #ifdef CONFIG_EQUALIZER
780 extern int eql_init(struct net_device *dev);
781 struct net_device eql_dev = {
782 "eql" __PAD3, /* Master device for IP traffic load
783 balancing */
784 0x0, 0x0, 0x0, 0x0, /* recv end/start; mem end/start */
785 0, /* base I/O address */
786 0, /* IRQ */
787 0, 0, 0, /* flags */
788 NEXT_DEV, /* next device */
789 eql_init /* set up the rest */
791 # undef NEXT_DEV
792 # define NEXT_DEV (&eql_dev)
793 #endif
795 #ifdef CONFIG_TR
796 /* Token-ring device probe */
797 extern int ibmtr_probe(struct net_device *);
798 extern int olympic_probe(struct net_device *);
799 extern int sktr_probe(struct net_device *);
801 static int
802 trif_probe(struct net_device *dev)
804 if (1
805 #ifdef CONFIG_IBMTR
806 && ibmtr_probe(dev)
807 #endif
808 #ifdef CONFIG_IBMOL
809 && olympic_probe(dev)
810 #endif
811 #ifdef CONFIG_SKTR
812 && sktr_probe(dev)
813 #endif
814 #ifdef CONFIG_SMCTR
815 && smctr_probe(dev)
816 #endif
817 && 1 ) {
818 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
820 return 0;
822 static struct net_device tr7_dev = {
823 "tr7" __PAD3,0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
824 static struct net_device tr6_dev = {
825 "tr6" __PAD3,0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
826 static struct net_device tr5_dev = {
827 "tr5" __PAD3,0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
828 static struct net_device tr4_dev = {
829 "tr4" __PAD3,0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
830 static struct net_device tr3_dev = {
831 "tr3" __PAD3,0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
832 static struct net_device tr2_dev = {
833 "tr2" __PAD3,0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
834 static struct net_device tr1_dev = {
835 "tr1" __PAD3,0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
836 static struct net_device tr0_dev = {
837 "tr0" __PAD3,0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
838 # undef NEXT_DEV
839 # define NEXT_DEV (&tr0_dev)
841 #endif
843 #ifdef CONFIG_FDDI
844 static struct net_device fddi7_dev =
845 {"fddi7" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
846 static struct net_device fddi6_dev =
847 {"fddi6" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
848 static struct net_device fddi5_dev =
849 {"fddi5" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
850 static struct net_device fddi4_dev =
851 {"fddi4" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
852 static struct net_device fddi3_dev =
853 {"fddi3" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
854 static struct net_device fddi2_dev =
855 {"fddi2" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
856 static struct net_device fddi1_dev =
857 {"fddi1" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
858 static struct net_device fddi0_dev =
859 {"fddi0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
860 #undef NEXT_DEV
861 #define NEXT_DEV (&fddi0_dev)
862 #endif
864 #ifdef CONFIG_HIPPI
865 static struct net_device hip3_dev =
866 {"hip3" __PAD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, hippi_probe};
867 static struct net_device hip2_dev =
868 {"hip2" __PAD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, &hip3_dev, hippi_probe};
869 static struct net_device hip1_dev =
870 {"hip1" __PAD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, &hip2_dev, hippi_probe};
871 static struct net_device hip0_dev =
872 {"hip0" __PAD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, &hip1_dev, hippi_probe};
874 #undef NEXT_DEV
875 #define NEXT_DEV (&hip0_dev)
876 #endif
878 #ifdef CONFIG_APBIF
879 extern int bif_init(struct net_device *dev);
880 static struct net_device bif_dev = {
881 "bif" __PAD3, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, bif_init };
882 # undef NEXT_DEV
883 # define NEXT_DEV (&bif_dev)
884 #endif
887 #ifdef CONFIG_NET_FC
888 static struct net_device fc1_dev = {
889 "fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe};
890 static struct net_device fc0_dev = {
891 "fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};
892 # undef NEXT_DEV
893 # define NEXT_DEV (&fc0_dev)
894 #endif
897 #ifdef CONFIG_SBNI
898 static struct net_device sbni7_dev =
899 {"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe};
900 static struct net_device sbni6_dev =
901 {"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe};
902 static struct net_device sbni5_dev =
903 {"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe};
904 static struct net_device sbni4_dev =
905 {"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe};
906 static struct net_device sbni3_dev =
907 {"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe};
908 static struct net_device sbni2_dev =
909 {"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe};
910 static struct net_device sbni1_dev =
911 {"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe};
912 static struct net_device sbni0_dev =
913 {"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};
915 #undef NEXT_DEV
916 #define NEXT_DEV (&sbni0_dev)
917 #endif
920 #ifdef CONFIG_NET_SB1000
921 extern int sb1000_probe(struct net_device *dev);
922 static struct net_device sb1000_dev = {
923 "cm0", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, sb1000_probe };
924 # undef NEXT_DEV
925 # define NEXT_DEV (&sb1000_dev)
926 #endif
928 extern int loopback_init(struct net_device *dev);
929 struct net_device loopback_dev = {
930 "lo" __PAD2, /* Software Loopback interface */
931 0x0, /* recv memory end */
932 0x0, /* recv memory start */
933 0x0, /* memory end */
934 0x0, /* memory start */
935 0, /* base I/O address */
936 0, /* IRQ */
937 0, 0, 0, /* flags */
938 NEXT_DEV, /* next device */
939 loopback_init /* loopback_init should set up the rest */
942 struct net_device *dev_base = &loopback_dev;
943 rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;