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.
5 *
6 * Holds initial configuration information for devices.
7 *
8 * Version: @(#)Space.c 1.0.7 08/12/93
9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu>
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Donald J. Becker, <becker@scyld.com>
13 *
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.
20 *
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)
25 *
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.
30 */
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>
37
38 #define NEXT_DEV NULL
39
40
41 /* A unified ethernet device probe. This is the easiest way to have every
42 ethernet adaptor have the name "eth[0123...]".
43 */
44
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 atarilance_probe(struct net_device *);
87 extern int sun3lance_probe(struct net_device *);
88 extern int sun3_82586_probe(struct net_device *);
89 extern int apne_probe(struct net_device *);
90 extern int bionet_probe(struct net_device *);
91 extern int pamsnet_probe(struct net_device *);
92 extern int cs89x0_probe(struct net_device *dev);
93 extern int ethertap_probe(struct net_device *dev);
94 extern int hplance_probe(struct net_device *dev);
95 extern int bagetlance_probe(struct net_device *);
96 extern int mvme147lance_probe(struct net_device *dev);
97 extern int tc515_probe(struct net_device *dev);
98 extern int lance_probe(struct net_device *dev);
99 extern int mace_probe(struct net_device *dev);
100 extern int macsonic_probe(struct net_device *dev);
101 extern int mac8390_probe(struct net_device *dev);
102 extern int mac89x0_probe(struct net_device *dev);
103 extern int mc32_probe(struct net_device *dev);
104
105 /* Detachable devices ("pocket adaptors") */
106 extern int de600_probe(struct net_device *);
107 extern int de620_probe(struct net_device *);
108
109 /* FDDI adapters */
110 extern int skfp_probe(struct net_device *dev);
111
112 /* Fibre Channel adapters */
113 extern int iph5526_probe(struct net_device *dev);
114
115 /* SBNI adapters */
116 extern int sbni_probe(struct net_device *);
117
118 struct devprobe
119 {
120 int (*probe)(struct net_device *dev);
121 int status; /* non-zero if autoprobe has failed */
122 };
123
124 /*
125 * probe_list walks a list of probe functions and calls each so long
126 * as a non-zero ioaddr is given, or as long as it hasn't already failed
127 * to find a card in the past (as recorded by "status") when asked to
128 * autoprobe (i.e. a probe that fails to find a card when autoprobing
129 * will not be asked to autoprobe again). It exits when a card is found.
130 */
probe_list(struct net_device * dev,struct devprobe * plist)131 static int __init probe_list(struct net_device *dev, struct devprobe *plist)
132 {
133 struct devprobe *p = plist;
134 unsigned long base_addr = dev->base_addr;
135 #ifdef CONFIG_NET_DIVERT
136 int ret;
137 #endif /* CONFIG_NET_DIVERT */
138
139 while (p->probe != NULL) {
140 if (base_addr && p->probe(dev) == 0) { /* probe given addr */
141 #ifdef CONFIG_NET_DIVERT
142 ret = alloc_divert_blk(dev);
143 if (ret)
144 return ret;
145 #endif /* CONFIG_NET_DIVERT */
146 return 0;
147 } else if (p->status == 0) { /* has autoprobe failed yet? */
148 p->status = p->probe(dev); /* no, try autoprobe */
149 if (p->status == 0) {
150 #ifdef CONFIG_NET_DIVERT
151 ret = alloc_divert_blk(dev);
152 if (ret)
153 return ret;
154 #endif /* CONFIG_NET_DIVERT */
155 return 0;
156 }
157 }
158 p++;
159 }
160 return -ENODEV;
161 }
162
163 /*
164 * This is a bit of an artificial separation as there are PCI drivers
165 * that also probe for EISA cards (in the PCI group) and there are ISA
166 * drivers that probe for EISA cards (in the ISA group). These are the
167 * EISA only driver probes, and also the legacy PCI probes
168 */
169 static struct devprobe eisa_probes[] __initdata = {
170 #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */
171 {de4x5_probe, 0},
172 #endif
173 #ifdef CONFIG_ULTRA32
174 {ultra32_probe, 0},
175 #endif
176 #ifdef CONFIG_AC3200
177 {ac3200_probe, 0},
178 #endif
179 #ifdef CONFIG_ES3210
180 {es_probe, 0},
181 #endif
182 #ifdef CONFIG_LNE390
183 {lne390_probe, 0},
184 #endif
185 #ifdef CONFIG_NE3210
186 {ne3210_probe, 0},
187 #endif
188 {NULL, 0},
189 };
190
191
192 static struct devprobe mca_probes[] __initdata = {
193 #ifdef CONFIG_ULTRAMCA
194 {ultramca_probe, 0},
195 #endif
196 #ifdef CONFIG_NE2_MCA
197 {ne2_probe, 0},
198 #endif
199 #ifdef CONFIG_ELMC /* 3c523 */
200 {elmc_probe, 0},
201 #endif
202 #ifdef CONFIG_ELMC_II /* 3c527 */
203 {mc32_probe, 0},
204 #endif
205 #ifdef CONFIG_SKMC /* SKnet Microchannel */
206 {skmca_probe, 0},
207 #endif
208 {NULL, 0},
209 };
210
211 /*
212 * ISA probes that touch addresses < 0x400 (including those that also
213 * look for EISA/PCI/MCA cards in addition to ISA cards).
214 */
215 static struct devprobe isa_probes[] __initdata = {
216 #ifdef CONFIG_EL3 /* ISA, EISA, MCA 3c5x9 */
217 {el3_probe, 0},
218 #endif
219 #ifdef CONFIG_HP100 /* ISA, EISA & PCI */
220 {hp100_probe, 0},
221 #endif
222 #ifdef CONFIG_3C515
223 {tc515_probe, 0},
224 #endif
225 #ifdef CONFIG_ULTRA
226 {ultra_probe, 0},
227 #endif
228 #ifdef CONFIG_WD80x3
229 {wd_probe, 0},
230 #endif
231 #ifdef CONFIG_EL2 /* 3c503 */
232 {el2_probe, 0},
233 #endif
234 #ifdef CONFIG_HPLAN
235 {hp_probe, 0},
236 #endif
237 #ifdef CONFIG_HPLAN_PLUS
238 {hp_plus_probe, 0},
239 #endif
240 #ifdef CONFIG_E2100 /* Cabletron E21xx series. */
241 {e2100_probe, 0},
242 #endif
243 #ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */
244 {ne_probe, 0},
245 #endif
246 #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
247 {lance_probe, 0},
248 #endif
249 #ifdef CONFIG_SMC9194
250 {smc_init, 0},
251 #endif
252 #ifdef CONFIG_SEEQ8005
253 {seeq8005_probe, 0},
254 #endif
255 #ifdef CONFIG_AT1500
256 {at1500_probe, 0},
257 #endif
258 #ifdef CONFIG_CS89x0
259 {cs89x0_probe, 0},
260 #endif
261 #ifdef CONFIG_AT1700
262 {at1700_probe, 0},
263 #endif
264 #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */
265 {fmv18x_probe, 0},
266 #endif
267 #ifdef CONFIG_ETH16I
268 {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */
269 #endif
270 #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */
271 {znet_probe, 0},
272 #endif
273 #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */
274 {express_probe, 0},
275 #endif
276 #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
277 {eepro_probe, 0},
278 #endif
279 #ifdef CONFIG_DEPCA /* DEC DEPCA */
280 {depca_probe, 0},
281 #endif
282 #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
283 {ewrk3_probe, 0},
284 #endif
285 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
286 {i82596_probe, 0},
287 #endif
288 #ifdef CONFIG_EL1 /* 3c501 */
289 {el1_probe, 0},
290 #endif
291 #ifdef CONFIG_WAVELAN /* WaveLAN */
292 {wavelan_probe, 0},
293 #endif
294 #ifdef CONFIG_ARLAN /* Aironet */
295 {arlan_probe, 0},
296 #endif
297 #ifdef CONFIG_EL16 /* 3c507 */
298 {el16_probe, 0},
299 #endif
300 #ifdef CONFIG_ELPLUS /* 3c505 */
301 {elplus_probe, 0},
302 #endif
303 #ifdef CONFIG_SK_G16
304 {SK_init, 0},
305 #endif
306 #ifdef CONFIG_NI5010
307 {ni5010_probe, 0},
308 #endif
309 #ifdef CONFIG_NI52
310 {ni52_probe, 0},
311 #endif
312 #ifdef CONFIG_NI65
313 {ni65_probe, 0},
314 #endif
315 {NULL, 0},
316 };
317
318 static struct devprobe parport_probes[] __initdata = {
319 #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
320 {de600_probe, 0},
321 #endif
322 #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
323 {de620_probe, 0},
324 #endif
325 {NULL, 0},
326 };
327
328 static struct devprobe m68k_probes[] __initdata = {
329 #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
330 {atarilance_probe, 0},
331 #endif
332 #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
333 {sun3lance_probe, 0},
334 #endif
335 #ifdef CONFIG_SUN3_82586 /* sun3 onboard Intel 82586 chip */
336 {sun3_82586_probe, 0},
337 #endif
338 #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */
339 {apne_probe, 0},
340 #endif
341 #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */
342 {bionet_probe, 0},
343 #endif
344 #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */
345 {pamsnet_probe, 0},
346 #endif
347 #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */
348 {hplance_probe, 0},
349 #endif
350 #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
351 {mvme147lance_probe, 0},
352 #endif
353 #ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */
354 {mace_probe, 0},
355 #endif
356 #ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */
357 {macsonic_probe, 0},
358 #endif
359 #ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */
360 {mac8390_probe, 0},
361 #endif
362 #ifdef CONFIG_MAC89x0
363 {mac89x0_probe, 0},
364 #endif
365 {NULL, 0},
366 };
367
368 static struct devprobe mips_probes[] __initdata = {
369 #ifdef CONFIG_MIPS_JAZZ_SONIC
370 {sonic_probe, 0},
371 #endif
372 #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
373 {bagetlance_probe, 0},
374 #endif
375 {NULL, 0},
376 };
377
378 /*
379 * Unified ethernet device probe, segmented per architecture and
380 * per bus interface. This drives the legacy devices only for now.
381 */
382
ethif_probe(struct net_device * dev)383 static int __init ethif_probe(struct net_device *dev)
384 {
385 unsigned long base_addr = dev->base_addr;
386
387 /*
388 * Backwards compatibility - historically an I/O base of 1 was
389 * used to indicate not to probe for this ethN interface
390 */
391 if (base_addr == 1)
392 return 1; /* ENXIO */
393
394 /*
395 * The arch specific probes are 1st so that any on-board ethernet
396 * will be probed before other ISA/EISA/MCA/PCI bus cards.
397 */
398 if (probe_list(dev, m68k_probes) == 0)
399 return 0;
400 if (probe_list(dev, mips_probes) == 0)
401 return 0;
402 if (probe_list(dev, eisa_probes) == 0)
403 return 0;
404 if (probe_list(dev, mca_probes) == 0)
405 return 0;
406 /*
407 * Backwards compatibility - an I/O of 0xffe0 was used to indicate
408 * that we shouldn't do a bunch of potentially risky ISA probes
409 * for ethN (N>1). Since the widespread use of modules, *nobody*
410 * compiles a kernel with all the ISA drivers built in anymore,
411 * and so we should delete this check in linux 2.3 - Paul G.
412 */
413 if (base_addr != 0xffe0 && probe_list(dev, isa_probes) == 0)
414 return 0;
415 if (probe_list(dev, parport_probes) == 0)
416 return 0;
417 return -ENODEV;
418 }
419
420 #ifdef CONFIG_FDDI
fddiif_probe(struct net_device * dev)421 static int __init fddiif_probe(struct net_device *dev)
422 {
423 unsigned long base_addr = dev->base_addr;
424
425 if (base_addr == 1)
426 return 1; /* ENXIO */
427
428 if (1
429 #ifdef CONFIG_APFDDI
430 && apfddi_init(dev)
431 #endif
432 #ifdef CONFIG_SKFP
433 && skfp_probe(dev)
434 #endif
435 && 1 ) {
436 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
437 }
438 return 0;
439 }
440 #endif
441
442
443 #ifdef CONFIG_NET_FC
fcif_probe(struct net_device * dev)444 static int fcif_probe(struct net_device *dev)
445 {
446 if (dev->base_addr == -1)
447 return 1;
448
449 if (1
450 #ifdef CONFIG_IPHASE5526
451 && iph5526_probe(dev)
452 #endif
453 && 1 ) {
454 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
455 }
456 return 0;
457 }
458 #endif /* CONFIG_NET_FC */
459
460
461 #ifdef CONFIG_ETHERTAP
462 static struct net_device tap0_dev = { "tap0", 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
463 # undef NEXT_DEV
464 # define NEXT_DEV (&tap0_dev)
465 #endif
466
467 #ifdef CONFIG_SDLA
468 extern int sdla_init(struct net_device *);
469 static struct net_device sdla0_dev = { "sdla0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
470
471 # undef NEXT_DEV
472 # define NEXT_DEV (&sdla0_dev)
473 #endif
474
475 #if defined(CONFIG_LTPC)
476 extern int ltpc_probe(struct net_device *);
477 static struct net_device dev_ltpc = {
478 "lt0",
479 0, 0, 0, 0,
480 0x0, 0,
481 0, 0, 0, NEXT_DEV, ltpc_probe };
482 # undef NEXT_DEV
483 # define NEXT_DEV (&dev_ltpc)
484 #endif /* LTPC */
485
486 #if defined(CONFIG_COPS)
487 extern int cops_probe(struct net_device *);
488 static struct net_device cops2_dev = { "lt2", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
489 static struct net_device cops1_dev = { "lt1", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
490 static struct net_device cops0_dev = { "lt0", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
491 # undef NEXT_DEV
492 # define NEXT_DEV (&cops0_dev)
493 #endif /* COPS */
494
495
496 /* The first device defaults to I/O base '0', which means autoprobe. */
497 #ifndef ETH0_ADDR
498 # define ETH0_ADDR 0
499 #endif
500 #ifndef ETH0_IRQ
501 # define ETH0_IRQ 0
502 #endif
503
504 /* "eth0" defaults to autoprobe (== 0), other use a base of 0xffe0 (== -0x20),
505 which means "don't do ISA probes". Distributions don't ship kernels with
506 all ISA drivers compiled in anymore, so its probably no longer an issue. */
507
508 #define ETH_NOPROBE_ADDR 0xffe0
509
510 static struct net_device eth7_dev = {
511 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
512 static struct net_device eth6_dev = {
513 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð7_dev, ethif_probe };
514 static struct net_device eth5_dev = {
515 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð6_dev, ethif_probe };
516 static struct net_device eth4_dev = {
517 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð5_dev, ethif_probe };
518 static struct net_device eth3_dev = {
519 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð4_dev, ethif_probe };
520 static struct net_device eth2_dev = {
521 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð3_dev, ethif_probe };
522 static struct net_device eth1_dev = {
523 "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð2_dev, ethif_probe };
524
525 static struct net_device eth0_dev = {
526 "eth%d", 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, ð1_dev, ethif_probe };
527
528 # undef NEXT_DEV
529 # define NEXT_DEV (ð0_dev)
530
531
532
533 #ifdef CONFIG_TR
534 /* Token-ring device probe */
535 extern int ibmtr_probe(struct net_device *);
536 extern int smctr_probe(struct net_device *);
537
538 static int
trif_probe(struct net_device * dev)539 trif_probe(struct net_device *dev)
540 {
541 if (1
542 #ifdef CONFIG_IBMTR
543 && ibmtr_probe(dev)
544 #endif
545 #ifdef CONFIG_SMCTR
546 && smctr_probe(dev)
547 #endif
548 && 1 ) {
549 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
550 }
551 return 0;
552 }
553 static struct net_device tr7_dev = {
554 "tr%d",0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
555 static struct net_device tr6_dev = {
556 "tr%d",0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
557 static struct net_device tr5_dev = {
558 "tr%d",0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
559 static struct net_device tr4_dev = {
560 "tr%d",0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
561 static struct net_device tr3_dev = {
562 "tr%d",0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
563 static struct net_device tr2_dev = {
564 "tr%d",0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
565 static struct net_device tr1_dev = {
566 "tr%d",0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
567 static struct net_device tr0_dev = {
568 "tr%d",0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
569 # undef NEXT_DEV
570 # define NEXT_DEV (&tr0_dev)
571
572 #endif
573
574 #ifdef CONFIG_FDDI
575 static struct net_device fddi7_dev =
576 {"fddi7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
577 static struct net_device fddi6_dev =
578 {"fddi6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
579 static struct net_device fddi5_dev =
580 {"fddi5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
581 static struct net_device fddi4_dev =
582 {"fddi4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
583 static struct net_device fddi3_dev =
584 {"fddi3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
585 static struct net_device fddi2_dev =
586 {"fddi2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
587 static struct net_device fddi1_dev =
588 {"fddi1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
589 static struct net_device fddi0_dev =
590 {"fddi0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
591 #undef NEXT_DEV
592 #define NEXT_DEV (&fddi0_dev)
593 #endif
594
595
596 #ifdef CONFIG_NET_FC
597 static struct net_device fc1_dev = {
598 "fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe};
599 static struct net_device fc0_dev = {
600 "fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};
601 # undef NEXT_DEV
602 # define NEXT_DEV (&fc0_dev)
603 #endif
604
605
606 #ifdef CONFIG_SBNI
607 static struct net_device sbni7_dev =
608 {"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe};
609 static struct net_device sbni6_dev =
610 {"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe};
611 static struct net_device sbni5_dev =
612 {"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe};
613 static struct net_device sbni4_dev =
614 {"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe};
615 static struct net_device sbni3_dev =
616 {"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe};
617 static struct net_device sbni2_dev =
618 {"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe};
619 static struct net_device sbni1_dev =
620 {"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe};
621 static struct net_device sbni0_dev =
622 {"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};
623
624 #undef NEXT_DEV
625 #define NEXT_DEV (&sbni0_dev)
626 #endif
627
628 /*
629 * The loopback device is global so it can be directly referenced
630 * by the network code. Also, it must be first on device list.
631 */
632
633 extern int loopback_init(struct net_device *dev);
634 struct net_device loopback_dev =
635 {"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};
636
637 /*
638 * The @dev_base list is protected by @dev_base_lock and the rtln
639 * semaphore.
640 *
641 * Pure readers hold dev_base_lock for reading.
642 *
643 * Writers must hold the rtnl semaphore while they loop through the
644 * dev_base list, and hold dev_base_lock for writing when they do the
645 * actual updates. This allows pure readers to access the list even
646 * while a writer is preparing to update it.
647 *
648 * To put it another way, dev_base_lock is held for writing only to
649 * protect against pure readers; the rtnl semaphore provides the
650 * protection against other writers.
651 *
652 * See, for example usages, register_netdevice() and
653 * unregister_netdevice(), which must be called with the rtnl
654 * semaphore held.
655 */
656 struct net_device *dev_base = &loopback_dev;
657 rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
658
659