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