- pre3:
[davej-history.git] / drivers / net / Space.c
blob1edf7383392a9dc8f0682af3f2fd80d6ab54620c
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>
36 #include <linux/divert.h>
38 #define NEXT_DEV NULL
41 /* A unified ethernet device probe. This is the easiest way to have every
42 ethernet adaptor have the name "eth[0123...]".
45 extern int ne2_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 ne_probe(struct net_device *dev);
53 extern int hp_probe(struct net_device *dev);
54 extern int hp_plus_probe(struct net_device *dev);
55 extern int znet_probe(struct net_device *);
56 extern int express_probe(struct net_device *);
57 extern int eepro_probe(struct net_device *);
58 extern int el3_probe(struct net_device *);
59 extern int at1500_probe(struct net_device *);
60 extern int at1700_probe(struct net_device *);
61 extern int fmv18x_probe(struct net_device *);
62 extern int eth16i_probe(struct net_device *);
63 extern int depca_probe(struct net_device *);
64 extern int i82596_probe(struct net_device *);
65 extern int ewrk3_probe(struct net_device *);
66 extern int de4x5_probe(struct net_device *);
67 extern int el1_probe(struct net_device *);
68 extern int wavelan_probe(struct net_device *);
69 extern int arlan_probe(struct net_device *);
70 extern int el16_probe(struct net_device *);
71 extern int elmc_probe(struct net_device *);
72 extern int skmca_probe(struct net_device *);
73 extern int elplus_probe(struct net_device *);
74 extern int ac3200_probe(struct net_device *);
75 extern int es_probe(struct net_device *);
76 extern int lne390_probe(struct net_device *);
77 extern int ne3210_probe(struct net_device *);
78 extern int e2100_probe(struct net_device *);
79 extern int ni5010_probe(struct net_device *);
80 extern int ni52_probe(struct net_device *);
81 extern int ni65_probe(struct net_device *);
82 extern int sonic_probe(struct net_device *);
83 extern int SK_init(struct net_device *);
84 extern int seeq8005_probe(struct net_device *);
85 extern int smc_init( struct net_device * );
86 extern int sgiseeq_probe(struct net_device *);
87 extern int atarilance_probe(struct net_device *);
88 extern int sun3lance_probe(struct net_device *);
89 extern int ariadne2_probe(struct net_device *);
90 extern int hydra_probe(struct net_device *);
91 extern int apne_probe(struct net_device *);
92 extern int bionet_probe(struct net_device *);
93 extern int pamsnet_probe(struct net_device *);
94 extern int cs89x0_probe(struct net_device *dev);
95 extern int ethertap_probe(struct net_device *dev);
96 extern int hplance_probe(struct net_device *dev);
97 extern int bagetlance_probe(struct net_device *);
98 extern int mvme147lance_probe(struct net_device *dev);
99 extern int tc515_probe(struct net_device *dev);
100 extern int lance_probe(struct net_device *dev);
101 extern int mace68k_probe(struct net_device *dev);
102 extern int macsonic_probe(struct net_device *dev);
103 extern int mac8390_probe(struct net_device *dev);
104 extern int mac89x0_probe(struct net_device *dev);
105 extern int mc32_probe(struct net_device *dev);
107 /* Gigabit Ethernet adapters */
108 extern int yellowfin_probe(struct net_device *dev);
110 /* Detachable devices ("pocket adaptors") */
111 extern int de600_probe(struct net_device *);
112 extern int de620_probe(struct net_device *);
114 /* FDDI adapters */
115 extern int apfddi_init(struct net_device *dev);
116 extern int skfp_probe(struct net_device *dev);
118 /* Fibre Channel adapters */
119 extern int iph5526_probe(struct net_device *dev);
121 /* SBNI adapters */
122 extern int sbni_probe(struct net_device *);
124 struct devprobe
126 int (*probe)(struct net_device *dev);
127 int status; /* non-zero if autoprobe has failed */
131 * probe_list walks a list of probe functions and calls each so long
132 * as a non-zero ioaddr is given, or as long as it hasn't already failed
133 * to find a card in the past (as recorded by "status") when asked to
134 * autoprobe (i.e. a probe that fails to find a card when autoprobing
135 * will not be asked to autoprobe again). It exits when a card is found.
137 static int __init probe_list(struct net_device *dev, struct devprobe *plist)
139 struct devprobe *p = plist;
140 unsigned long base_addr = dev->base_addr;
141 #ifdef CONFIG_NET_DIVERT
142 int ret;
143 #endif /* CONFIG_NET_DIVERT */
145 while (p->probe != NULL) {
146 if (base_addr && p->probe(dev) == 0) { /* probe given addr */
147 #ifdef CONFIG_NET_DIVERT
148 ret = alloc_divert_blk(dev);
149 if (ret)
150 return ret;
151 #endif /* CONFIG_NET_DIVERT */
152 return 0;
153 } else if (p->status == 0) { /* has autoprobe failed yet? */
154 p->status = p->probe(dev); /* no, try autoprobe */
155 if (p->status == 0) {
156 #ifdef CONFIG_NET_DIVERT
157 ret = alloc_divert_blk(dev);
158 if (ret)
159 return ret;
160 #endif /* CONFIG_NET_DIVERT */
161 return 0;
164 p++;
166 return -ENODEV;
170 * This is a bit of an artificial separation as there are PCI drivers
171 * that also probe for EISA cards (in the PCI group) and there are ISA
172 * drivers that probe for EISA cards (in the ISA group). These are the
173 * EISA only driver probes, and also the legacy PCI probes
175 struct devprobe eisa_probes[] __initdata = {
176 #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */
177 {de4x5_probe, 0},
178 #endif
179 #ifdef CONFIG_ULTRA32
180 {ultra32_probe, 0},
181 #endif
182 #ifdef CONFIG_AC3200
183 {ac3200_probe, 0},
184 #endif
185 #ifdef CONFIG_ES3210
186 {es_probe, 0},
187 #endif
188 #ifdef CONFIG_LNE390
189 {lne390_probe, 0},
190 #endif
191 #ifdef CONFIG_NE3210
192 {ne3210_probe, 0},
193 #endif
194 {NULL, 0},
198 struct devprobe mca_probes[] __initdata = {
199 #ifdef CONFIG_ULTRAMCA
200 {ultramca_probe, 0},
201 #endif
202 #ifdef CONFIG_NE2_MCA
203 {ne2_probe, 0},
204 #endif
205 #ifdef CONFIG_ELMC /* 3c523 */
206 {elmc_probe, 0},
207 #endif
208 #ifdef CONFIG_ELMC_II /* 3c527 */
209 {mc32_probe, 0},
210 #endif
211 #ifdef CONFIG_SKMC /* SKnet Microchannel */
212 {skmca_probe, 0},
213 #endif
214 {NULL, 0},
218 * ISA probes that touch addresses < 0x400 (including those that also
219 * look for EISA/PCI/MCA cards in addition to ISA cards).
221 struct devprobe isa_probes[] __initdata = {
222 #ifdef CONFIG_EL3 /* ISA, EISA, MCA 3c5x9 */
223 {el3_probe, 0},
224 #endif
225 #ifdef CONFIG_HP100 /* ISA, EISA & PCI */
226 {hp100_probe, 0},
227 #endif
228 #ifdef CONFIG_3C515
229 {tc515_probe, 0},
230 #endif
231 #ifdef CONFIG_ULTRA
232 {ultra_probe, 0},
233 #endif
234 #ifdef CONFIG_WD80x3
235 {wd_probe, 0},
236 #endif
237 #ifdef CONFIG_EL2 /* 3c503 */
238 {el2_probe, 0},
239 #endif
240 #ifdef CONFIG_HPLAN
241 {hp_probe, 0},
242 #endif
243 #ifdef CONFIG_HPLAN_PLUS
244 {hp_plus_probe, 0},
245 #endif
246 #ifdef CONFIG_E2100 /* Cabletron E21xx series. */
247 {e2100_probe, 0},
248 #endif
249 #ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */
250 {ne_probe, 0},
251 #endif
252 #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
253 {lance_probe, 0},
254 #endif
255 #ifdef CONFIG_SMC9194
256 {smc_init, 0},
257 #endif
258 #ifdef CONFIG_SEEQ8005
259 {seeq8005_probe, 0},
260 #endif
261 #ifdef CONFIG_AT1500
262 {at1500_probe, 0},
263 #endif
264 #ifdef CONFIG_CS89x0
265 {cs89x0_probe, 0},
266 #endif
267 #ifdef CONFIG_AT1700
268 {at1700_probe, 0},
269 #endif
270 #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */
271 {fmv18x_probe, 0},
272 #endif
273 #ifdef CONFIG_ETH16I
274 {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */
275 #endif
276 #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */
277 {znet_probe, 0},
278 #endif
279 #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */
280 {express_probe, 0},
281 #endif
282 #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
283 {eepro_probe, 0},
284 #endif
285 #ifdef CONFIG_DEPCA /* DEC DEPCA */
286 {depca_probe, 0},
287 #endif
288 #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
289 {ewrk3_probe, 0},
290 #endif
291 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
292 {i82596_probe, 0},
293 #endif
294 #ifdef CONFIG_EL1 /* 3c501 */
295 {el1_probe, 0},
296 #endif
297 #ifdef CONFIG_WAVELAN /* WaveLAN */
298 {wavelan_probe, 0},
299 #endif
300 #ifdef CONFIG_ARLAN /* Aironet */
301 {arlan_probe, 0},
302 #endif
303 #ifdef CONFIG_EL16 /* 3c507 */
304 {el16_probe, 0},
305 #endif
306 #ifdef CONFIG_ELPLUS /* 3c505 */
307 {elplus_probe, 0},
308 #endif
309 #ifdef CONFIG_SK_G16
310 {SK_init, 0},
311 #endif
312 #ifdef CONFIG_NI5010
313 {ni5010_probe, 0},
314 #endif
315 #ifdef CONFIG_NI52
316 {ni52_probe, 0},
317 #endif
318 #ifdef CONFIG_NI65
319 {ni65_probe, 0},
320 #endif
321 {NULL, 0},
324 struct devprobe parport_probes[] __initdata = {
325 #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
326 {de600_probe, 0},
327 #endif
328 #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
329 {de620_probe, 0},
330 #endif
331 {NULL, 0},
334 struct devprobe m68k_probes[] __initdata = {
335 #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
336 {atarilance_probe, 0},
337 #endif
338 #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
339 {sun3lance_probe, 0},
340 #endif
341 #ifdef CONFIG_ARIADNE2 /* Village Tronic Ariadne II Ethernet Board */
342 {ariadne2_probe, 0},
343 #endif
344 #ifdef CONFIG_HYDRA /* Hydra Systems Amiganet Ethernet board */
345 {hydra_probe, 0},
346 #endif
347 #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */
348 {apne_probe, 0},
349 #endif
350 #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */
351 {bionet_probe, 0},
352 #endif
353 #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */
354 {pamsnet_probe, 0},
355 #endif
356 #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */
357 {hplance_probe, 0},
358 #endif
359 #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
360 {mvme147lance_probe, 0},
361 #endif
362 #ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */
363 {mace68k_probe, 0},
364 #endif
365 #ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */
366 {macsonic_probe, 0},
367 #endif
368 #ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */
369 {mac8390_probe, 0},
370 #endif
371 #ifdef CONFIG_MAC89x0
372 {mac89x0_probe, 0},
373 #endif
374 {NULL, 0},
378 struct devprobe sgi_probes[] __initdata = {
379 #ifdef CONFIG_SGISEEQ
380 {sgiseeq_probe, 0},
381 #endif
382 {NULL, 0},
385 struct devprobe mips_probes[] __initdata = {
386 #ifdef CONFIG_MIPS_JAZZ_SONIC
387 {sonic_probe, 0},
388 #endif
389 #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
390 {bagetlance_probe, 0},
391 #endif
392 {NULL, 0},
396 * Unified ethernet device probe, segmented per architecture and
397 * per bus interface. This drives the legacy devices only for now.
400 static int __init ethif_probe(struct net_device *dev)
402 unsigned long base_addr = dev->base_addr;
405 * Backwards compatibility - historically an I/O base of 1 was
406 * used to indicate not to probe for this ethN interface
408 if (base_addr == 1)
409 return 1; /* ENXIO */
412 * The arch specific probes are 1st so that any on-board ethernet
413 * will be probed before other ISA/EISA/MCA/PCI bus cards.
415 if (probe_list(dev, m68k_probes) == 0)
416 return 0;
417 if (probe_list(dev, mips_probes) == 0)
418 return 0;
419 if (probe_list(dev, sgi_probes) == 0)
420 return 0;
421 if (probe_list(dev, eisa_probes) == 0)
422 return 0;
423 if (probe_list(dev, mca_probes) == 0)
424 return 0;
426 * Backwards compatibility - an I/O of 0xffe0 was used to indicate
427 * that we shouldn't do a bunch of potentially risky ISA probes
428 * for ethN (N>1). Since the widespread use of modules, *nobody*
429 * compiles a kernel with all the ISA drivers built in anymore,
430 * and so we should delete this check in linux 2.3 - Paul G.
432 if (base_addr != 0xffe0 && probe_list(dev, isa_probes) == 0)
433 return 0;
434 if (probe_list(dev, parport_probes) == 0)
435 return 0;
436 return -ENODEV;
439 #ifdef CONFIG_FDDI
440 static int __init fddiif_probe(struct net_device *dev)
442 unsigned long base_addr = dev->base_addr;
444 if (base_addr == 1)
445 return 1; /* ENXIO */
447 if (1
448 #ifdef CONFIG_APFDDI
449 && apfddi_init(dev)
450 #endif
451 #ifdef CONFIG_SKFP
452 && skfp_probe(dev)
453 #endif
454 && 1 ) {
455 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
457 return 0;
459 #endif
462 /* Pad device name to IFNAMSIZ=16. F.e. __PAD6 is string of 9 zeros. */
463 #define __PAD6 "\0\0\0\0\0\0\0\0\0"
464 #define __PAD5 __PAD6 "\0"
465 #define __PAD4 __PAD5 "\0"
466 #define __PAD3 __PAD4 "\0"
467 #define __PAD2 __PAD3 "\0"
470 #ifdef CONFIG_NET_FC
471 static int fcif_probe(struct net_device *dev)
473 if (dev->base_addr == -1)
474 return 1;
476 if (1
477 #ifdef CONFIG_IPHASE5526
478 && iph5526_probe(dev)
479 #endif
480 && 1 ) {
481 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
483 return 0;
485 #endif /* CONFIG_NET_FC */
488 #ifdef CONFIG_ETHERTAP
489 static struct net_device tap0_dev = { "tap0" __PAD4, 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
490 # undef NEXT_DEV
491 # define NEXT_DEV (&tap0_dev)
492 #endif
494 #ifdef CONFIG_SDLA
495 extern int sdla_init(struct net_device *);
496 static struct net_device sdla0_dev = { "sdla0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
498 # undef NEXT_DEV
499 # define NEXT_DEV (&sdla0_dev)
500 #endif
502 #if defined(CONFIG_LTPC)
503 extern int ltpc_probe(struct net_device *);
504 static struct net_device dev_ltpc = {
505 "lt0" __PAD3,
506 0, 0, 0, 0,
507 0x0, 0,
508 0, 0, 0, NEXT_DEV, ltpc_probe };
509 # undef NEXT_DEV
510 # define NEXT_DEV (&dev_ltpc)
511 #endif /* LTPC */
513 #if defined(CONFIG_COPS)
514 extern int cops_probe(struct net_device *);
515 static struct net_device cops2_dev = { "lt2" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
516 static struct net_device cops1_dev = { "lt1" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
517 static struct net_device cops0_dev = { "lt0" __PAD3, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
518 # undef NEXT_DEV
519 # define NEXT_DEV (&cops0_dev)
520 #endif /* COPS */
523 /* The first device defaults to I/O base '0', which means autoprobe. */
524 #ifndef ETH0_ADDR
525 # define ETH0_ADDR 0
526 #endif
527 #ifndef ETH0_IRQ
528 # define ETH0_IRQ 0
529 #endif
531 /* "eth0" defaults to autoprobe (== 0), other use a base of 0xffe0 (== -0x20),
532 which means "don't do ISA probes". Distributions don't ship kernels with
533 all ISA drivers compiled in anymore, so its probably no longer an issue. */
535 #define ETH_NOPROBE_ADDR 0xffe0
537 static struct net_device eth7_dev = {
538 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
539 static struct net_device eth6_dev = {
540 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth7_dev, ethif_probe };
541 static struct net_device eth5_dev = {
542 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth6_dev, ethif_probe };
543 static struct net_device eth4_dev = {
544 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth5_dev, ethif_probe };
545 static struct net_device eth3_dev = {
546 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth4_dev, ethif_probe };
547 static struct net_device eth2_dev = {
548 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
549 static struct net_device eth1_dev = {
550 "eth%d" __PAD5, 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, &eth2_dev, ethif_probe };
552 static struct net_device eth0_dev = {
553 "eth%d" __PAD5, 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, &eth1_dev, ethif_probe };
555 # undef NEXT_DEV
556 # define NEXT_DEV (&eth0_dev)
560 #ifdef CONFIG_TR
561 /* Token-ring device probe */
562 extern int ibmtr_probe(struct net_device *);
563 extern int olympic_probe(struct net_device *);
564 extern int smctr_probe(struct net_device *);
566 static int
567 trif_probe(struct net_device *dev)
569 if (1
570 #ifdef CONFIG_IBMTR
571 && ibmtr_probe(dev)
572 #endif
573 #ifdef CONFIG_IBMOL
574 && olympic_probe(dev)
575 #endif
576 #ifdef CONFIG_SMCTR
577 && smctr_probe(dev)
578 #endif
579 && 1 ) {
580 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
582 return 0;
584 static struct net_device tr7_dev = {
585 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
586 static struct net_device tr6_dev = {
587 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
588 static struct net_device tr5_dev = {
589 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
590 static struct net_device tr4_dev = {
591 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
592 static struct net_device tr3_dev = {
593 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
594 static struct net_device tr2_dev = {
595 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
596 static struct net_device tr1_dev = {
597 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
598 static struct net_device tr0_dev = {
599 "tr%d" __PAD3,0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
600 # undef NEXT_DEV
601 # define NEXT_DEV (&tr0_dev)
603 #endif
605 #ifdef CONFIG_FDDI
606 static struct net_device fddi7_dev =
607 {"fddi7" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
608 static struct net_device fddi6_dev =
609 {"fddi6" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
610 static struct net_device fddi5_dev =
611 {"fddi5" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
612 static struct net_device fddi4_dev =
613 {"fddi4" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
614 static struct net_device fddi3_dev =
615 {"fddi3" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
616 static struct net_device fddi2_dev =
617 {"fddi2" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
618 static struct net_device fddi1_dev =
619 {"fddi1" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
620 static struct net_device fddi0_dev =
621 {"fddi0" __PAD5, 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
622 #undef NEXT_DEV
623 #define NEXT_DEV (&fddi0_dev)
624 #endif
627 #ifdef CONFIG_NET_FC
628 static struct net_device fc1_dev = {
629 "fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe};
630 static struct net_device fc0_dev = {
631 "fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};
632 # undef NEXT_DEV
633 # define NEXT_DEV (&fc0_dev)
634 #endif
637 #ifdef CONFIG_SBNI
638 static struct net_device sbni7_dev =
639 {"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe};
640 static struct net_device sbni6_dev =
641 {"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe};
642 static struct net_device sbni5_dev =
643 {"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe};
644 static struct net_device sbni4_dev =
645 {"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe};
646 static struct net_device sbni3_dev =
647 {"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe};
648 static struct net_device sbni2_dev =
649 {"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe};
650 static struct net_device sbni1_dev =
651 {"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe};
652 static struct net_device sbni0_dev =
653 {"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};
655 #undef NEXT_DEV
656 #define NEXT_DEV (&sbni0_dev)
657 #endif
659 /* S/390 channels */
660 #ifdef CONFIG_CTC
661 extern int ctc_probe(struct net_device *dev);
662 static struct net_device ctc7_dev =
663 {"ctc7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, ctc_probe};
664 static struct net_device ctc6_dev =
665 {"ctc6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc7_dev, ctc_probe};
666 static struct net_device ctc5_dev =
667 {"ctc5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc6_dev, ctc_probe};
668 static struct net_device ctc4_dev =
669 {"ctc4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc5_dev, ctc_probe};
670 static struct net_device ctc3_dev =
671 {"ctc3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc4_dev, ctc_probe};
672 static struct net_device ctc2_dev =
673 {"ctc2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc3_dev, ctc_probe};
674 static struct net_device ctc1_dev =
675 {"ctc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc2_dev, ctc_probe};
676 static struct net_device ctc0_dev =
677 {"ctc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc1_dev, ctc_probe};
679 static struct net_device escon7_dev =
680 {"escon7", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc0_dev, ctc_probe};
681 static struct net_device escon6_dev =
682 {"escon6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon7_dev, ctc_probe};
683 static struct net_device escon5_dev =
684 {"escon5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon6_dev, ctc_probe};
685 static struct net_device escon4_dev =
686 {"escon4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon5_dev, ctc_probe};
687 static struct net_device escon3_dev =
688 {"escon3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon4_dev, ctc_probe};
689 static struct net_device escon2_dev =
690 {"escon2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon3_dev, ctc_probe};
691 static struct net_device escon1_dev =
692 {"escon1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon2_dev, ctc_probe};
693 static struct net_device escon0_dev =
694 {"escon0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon1_dev, ctc_probe};
696 #undef NEXT_DEV
697 #define NEXT_DEV (&escon0_dev)
698 #endif
701 * The loopback device is global so it can be directly referenced
702 * by the network code. Also, it must be first on device list.
705 extern int loopback_init(struct net_device *dev);
706 struct net_device loopback_dev =
707 {"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};
710 * The @dev_base list is protected by @dev_base_lock and the rtln
711 * semaphore.
713 * Pure readers hold dev_base_lock for reading.
715 * Writers must hold the rtnl semaphore while they loop through the
716 * dev_base list, and hold dev_base_lock for writing when they do the
717 * actual updates. This allows pure readers to access the list even
718 * while a writer is preparing to update it.
720 * To put it another way, dev_base_lock is held for writing only to
721 * protect against pure readers; the rtnl semaphore provides the
722 * protection against other writers.
724 * See, for example usages, register_netdevice() and
725 * unregister_netdevice(), which must be called with the rtnl
726 * semaphore held.
728 struct net_device *dev_base = &loopback_dev;
729 rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;