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