~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/drivers/net/Space.c

Version: ~ [ 2.2.5 ] ~ [ 2.4.1 ] ~ [ 2.4.9 ] ~ [ 2.6.17.10 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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@super.org>
 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 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 mace68k_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 /* Gigabit Ethernet adapters */
106 extern int yellowfin_probe(struct net_device *dev);
107 
108 /* Detachable devices ("pocket adaptors") */
109 extern int de600_probe(struct net_device *);
110 extern int de620_probe(struct net_device *);
111 
112 /* FDDI adapters */
113 extern int apfddi_init(struct net_device *dev);
114 extern int skfp_probe(struct net_device *dev);
115 
116 /* Fibre Channel adapters */
117 extern int iph5526_probe(struct net_device *dev);
118 
119 /* SBNI adapters */
120 extern int sbni_probe(struct net_device *);
121 
122 struct devprobe
123 {
124         int (*probe)(struct net_device *dev);
125         int status;     /* non-zero if autoprobe has failed */
126 };
127 
128 /*
129  * probe_list walks a list of probe functions and calls each so long
130  * as a non-zero ioaddr is given, or as long as it hasn't already failed 
131  * to find a card in the past (as recorded by "status") when asked to
132  * autoprobe (i.e. a probe that fails to find a card when autoprobing
133  * will not be asked to autoprobe again).  It exits when a card is found.
134  */
135 static int __init probe_list(struct net_device *dev, struct devprobe *plist)
136 {
137         struct devprobe *p = plist;
138         unsigned long base_addr = dev->base_addr;
139 #ifdef CONFIG_NET_DIVERT
140         int ret;
141 #endif /* CONFIG_NET_DIVERT */
142 
143         while (p->probe != NULL) {
144                 if (base_addr && p->probe(dev) == 0) {  /* probe given addr */
145 #ifdef CONFIG_NET_DIVERT
146                         ret = alloc_divert_blk(dev);
147                         if (ret)
148                                 return ret;
149 #endif /* CONFIG_NET_DIVERT */
150                         return 0;
151                 } else if (p->status == 0) {            /* has autoprobe failed yet? */
152                         p->status = p->probe(dev);      /* no, try autoprobe */
153                         if (p->status == 0) {
154 #ifdef CONFIG_NET_DIVERT
155                                 ret = alloc_divert_blk(dev);
156                                 if (ret)
157                                         return ret;
158 #endif /* CONFIG_NET_DIVERT */
159                                 return 0;
160                         }
161                 }
162                 p++;
163         }
164         return -ENODEV;
165 }
166 
167 /*
168  * This is a bit of an artificial separation as there are PCI drivers
169  * that also probe for EISA cards (in the PCI group) and there are ISA
170  * drivers that probe for EISA cards (in the ISA group).  These are the
171  * EISA only driver probes, and also the legacy PCI probes
172  */
173 struct devprobe eisa_probes[] __initdata = {
174 #ifdef CONFIG_DE4X5             /* DEC DE425, DE434, DE435 adapters */
175         {de4x5_probe, 0},
176 #endif
177 #ifdef CONFIG_ULTRA32 
178         {ultra32_probe, 0},     
179 #endif
180 #ifdef CONFIG_AC3200    
181         {ac3200_probe, 0},
182 #endif
183 #ifdef CONFIG_ES3210
184         {es_probe, 0},
185 #endif
186 #ifdef CONFIG_LNE390
187         {lne390_probe, 0},
188 #endif
189 #ifdef CONFIG_NE3210
190         {ne3210_probe, 0},
191 #endif
192         {NULL, 0},
193 };
194 
195 
196 struct devprobe mca_probes[] __initdata = {
197 #ifdef CONFIG_ULTRAMCA 
198         {ultramca_probe, 0},
199 #endif
200 #ifdef CONFIG_NE2_MCA
201         {ne2_probe, 0},
202 #endif
203 #ifdef CONFIG_ELMC              /* 3c523 */
204         {elmc_probe, 0},
205 #endif
206 #ifdef CONFIG_ELMC_II           /* 3c527 */
207         {mc32_probe, 0},
208 #endif
209 #ifdef CONFIG_SKMC              /* SKnet Microchannel */
210         {skmca_probe, 0},
211 #endif
212         {NULL, 0},
213 };
214 
215 /*
216  * ISA probes that touch addresses < 0x400 (including those that also
217  * look for EISA/PCI/MCA cards in addition to ISA cards).
218  */
219 struct devprobe isa_probes[] __initdata = {
220 #ifdef CONFIG_EL3               /* ISA, EISA, MCA 3c5x9 */
221         {el3_probe, 0},
222 #endif
223 #ifdef CONFIG_HP100             /* ISA, EISA & PCI */
224         {hp100_probe, 0},
225 #endif  
226 #ifdef CONFIG_3C515
227         {tc515_probe, 0},
228 #endif
229 #ifdef CONFIG_ULTRA 
230         {ultra_probe, 0},
231 #endif
232 #ifdef CONFIG_WD80x3 
233         {wd_probe, 0},
234 #endif
235 #ifdef CONFIG_EL2               /* 3c503 */
236         {el2_probe, 0},
237 #endif
238 #ifdef CONFIG_HPLAN
239         {hp_probe, 0},
240 #endif
241 #ifdef CONFIG_HPLAN_PLUS
242         {hp_plus_probe, 0},
243 #endif
244 #ifdef CONFIG_E2100             /* Cabletron E21xx series. */
245         {e2100_probe, 0},
246 #endif
247 #ifdef CONFIG_NE2000            /* ISA (use ne2k-pci for PCI cards) */
248         {ne_probe, 0},
249 #endif
250 #ifdef CONFIG_LANCE             /* ISA/VLB (use pcnet32 for PCI cards) */
251         {lance_probe, 0},
252 #endif
253 #ifdef CONFIG_SMC9194
254         {smc_init, 0},
255 #endif
256 #ifdef CONFIG_SEEQ8005 
257         {seeq8005_probe, 0},
258 #endif
259 #ifdef CONFIG_AT1500
260         {at1500_probe, 0},
261 #endif
262 #ifdef CONFIG_CS89x0
263         {cs89x0_probe, 0},
264 #endif
265 #ifdef CONFIG_AT1700
266         {at1700_probe, 0},
267 #endif
268 #ifdef CONFIG_FMV18X            /* Fujitsu FMV-181/182 */
269         {fmv18x_probe, 0},
270 #endif
271 #ifdef CONFIG_ETH16I
272         {eth16i_probe, 0},      /* ICL EtherTeam 16i/32 */
273 #endif
274 #ifdef CONFIG_ZNET              /* Zenith Z-Note and some IBM Thinkpads. */
275         {znet_probe, 0},
276 #endif
277 #ifdef CONFIG_EEXPRESS          /* Intel EtherExpress */
278         {express_probe, 0},
279 #endif
280 #ifdef CONFIG_EEXPRESS_PRO      /* Intel EtherExpress Pro/10 */
281         {eepro_probe, 0},
282 #endif
283 #ifdef CONFIG_DEPCA             /* DEC DEPCA */
284         {depca_probe, 0},
285 #endif
286 #ifdef CONFIG_EWRK3             /* DEC EtherWORKS 3 */
287         {ewrk3_probe, 0},
288 #endif
289 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET)      /* Intel I82596 */
290         {i82596_probe, 0},
291 #endif
292 #ifdef CONFIG_EL1               /* 3c501 */
293         {el1_probe, 0},
294 #endif
295 #ifdef CONFIG_WAVELAN           /* WaveLAN */
296         {wavelan_probe, 0},
297 #endif
298 #ifdef CONFIG_ARLAN             /* Aironet */
299         {arlan_probe, 0},
300 #endif
301 #ifdef CONFIG_EL16              /* 3c507 */
302         {el16_probe, 0},
303 #endif
304 #ifdef CONFIG_ELPLUS            /* 3c505 */
305         {elplus_probe, 0},
306 #endif
307 #ifdef CONFIG_SK_G16
308         {SK_init, 0},
309 #endif
310 #ifdef CONFIG_NI5010
311         {ni5010_probe, 0},
312 #endif
313 #ifdef CONFIG_NI52
314         {ni52_probe, 0},
315 #endif
316 #ifdef CONFIG_NI65
317         {ni65_probe, 0},
318 #endif
319         {NULL, 0},
320 };
321 
322 struct devprobe parport_probes[] __initdata = {
323 #ifdef CONFIG_DE600             /* D-Link DE-600 adapter */
324         {de600_probe, 0},
325 #endif
326 #ifdef CONFIG_DE620             /* D-Link DE-620 adapter */
327         {de620_probe, 0},
328 #endif
329         {NULL, 0},
330 };
331 
332 struct devprobe m68k_probes[] __initdata = {
333 #ifdef CONFIG_ATARILANCE        /* Lance-based Atari ethernet boards */
334         {atarilance_probe, 0},
335 #endif
336 #ifdef CONFIG_SUN3LANCE         /* sun3 onboard Lance chip */
337         {sun3lance_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         {mace68k_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 struct devprobe sgi_probes[] __initdata = {
371 #ifdef CONFIG_SGISEEQ
372         {sgiseeq_probe, 0},
373 #endif
374         {NULL, 0},
375 };
376 
377 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 '', 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 olympic_probe(struct net_device *);
548 extern int smctr_probe(struct net_device *);
549 
550 static int
551 trif_probe(struct net_device *dev)
552 {
553     if (1
554 #ifdef CONFIG_IBMTR
555         && ibmtr_probe(dev)
556 #endif
557 #ifdef CONFIG_IBMOL
558         && olympic_probe(dev)
559 #endif
560 #ifdef CONFIG_SMCTR
561         && smctr_probe(dev)
562 #endif
563         && 1 ) {
564         return 1;       /* -ENODEV or -EAGAIN would be more accurate. */
565     }
566     return 0;
567 }
568 static struct net_device tr7_dev = {
569     "tr%d",0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
570 static struct net_device tr6_dev = {
571     "tr%d",0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
572 static struct net_device tr5_dev = {
573     "tr%d",0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
574 static struct net_device tr4_dev = {
575     "tr%d",0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
576 static struct net_device tr3_dev = {
577     "tr%d",0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
578 static struct net_device tr2_dev = {
579     "tr%d",0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
580 static struct net_device tr1_dev = {
581     "tr%d",0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
582 static struct net_device tr0_dev = {
583     "tr%d",0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
584 #   undef       NEXT_DEV
585 #   define      NEXT_DEV        (&tr0_dev)
586 
587 #endif 
588 
589 #ifdef CONFIG_FDDI
590         static struct net_device fddi7_dev =
591                 {"fddi7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
592         static struct net_device fddi6_dev =
593                 {"fddi6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
594         static struct net_device fddi5_dev =
595                 {"fddi5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
596         static struct net_device fddi4_dev =
597                 {"fddi4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
598         static struct net_device fddi3_dev =
599                 {"fddi3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
600         static struct net_device fddi2_dev =
601                 {"fddi2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
602         static struct net_device fddi1_dev =
603                 {"fddi1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
604         static struct net_device fddi0_dev =
605                 {"fddi0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
606 #undef  NEXT_DEV
607 #define NEXT_DEV        (&fddi0_dev)
608 #endif 
609 
610 
611 #ifdef CONFIG_NET_FC
612     static struct net_device fc1_dev = {
613         "fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe};
614         static struct net_device fc0_dev = {
615                 "fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};
616 #   undef       NEXT_DEV
617 #   define      NEXT_DEV        (&fc0_dev)
618 #endif
619 
620 
621 #ifdef CONFIG_SBNI
622         static struct net_device sbni7_dev =
623                 {"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe};
624         static struct net_device sbni6_dev =
625                 {"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe};
626         static struct net_device sbni5_dev =
627                 {"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe};
628         static struct net_device sbni4_dev =
629                 {"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe};
630         static struct net_device sbni3_dev =
631                 {"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe};
632         static struct net_device sbni2_dev =
633                 {"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe};
634         static struct net_device sbni1_dev =
635                 {"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe};
636         static struct net_device sbni0_dev =
637                 {"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};
638 
639 #undef  NEXT_DEV
640 #define NEXT_DEV        (&sbni0_dev)
641 #endif 
642         
643 /* S/390 channels */
644 #ifdef CONFIG_CTC
645     extern int ctc_probe(struct net_device *dev);
646     static struct net_device ctc7_dev =
647        {"ctc7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV,  ctc_probe};
648     static struct net_device ctc6_dev =
649        {"ctc6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc7_dev, ctc_probe};
650     static struct net_device ctc5_dev =
651        {"ctc5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc6_dev, ctc_probe};
652     static struct net_device ctc4_dev =
653        {"ctc4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc5_dev, ctc_probe};
654     static struct net_device ctc3_dev =
655        {"ctc3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc4_dev, ctc_probe};
656     static struct net_device ctc2_dev =
657        {"ctc2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc3_dev, ctc_probe};
658     static struct net_device ctc1_dev =
659        {"ctc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc2_dev, ctc_probe};
660     static struct net_device ctc0_dev =
661        {"ctc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc1_dev, ctc_probe}; 
662 
663     static struct net_device escon7_dev =
664        {"escon7", 0, 0, 0, 0, 0, 0, 0, 0, 0, &ctc0_dev,   ctc_probe};
665     static struct net_device escon6_dev =
666        {"escon6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon7_dev, ctc_probe};
667     static struct net_device escon5_dev =
668        {"escon5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon6_dev, ctc_probe};
669     static struct net_device escon4_dev =
670        {"escon4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon5_dev, ctc_probe};
671     static struct net_device escon3_dev =
672        {"escon3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon4_dev, ctc_probe};
673     static struct net_device escon2_dev =
674        {"escon2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon3_dev, ctc_probe};
675     static struct net_device escon1_dev =
676        {"escon1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon2_dev, ctc_probe};
677     static struct net_device escon0_dev =
678        {"escon0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &escon1_dev, ctc_probe}; 
679 
680 #undef  NEXT_DEV
681 #define NEXT_DEV        (&escon0_dev)                                  
682 #endif  
683 
684 /*
685  *      The loopback device is global so it can be directly referenced
686  *      by the network code. Also, it must be first on device list.
687  */
688 
689 extern int loopback_init(struct net_device *dev);
690 struct net_device loopback_dev = 
691         {"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};
692 
693 /*
694  * The @dev_base list is protected by @dev_base_lock and the rtln
695  * semaphore.
696  *
697  * Pure readers hold dev_base_lock for reading.
698  *
699  * Writers must hold the rtnl semaphore while they loop through the
700  * dev_base list, and hold dev_base_lock for writing when they do the
701  * actual updates.  This allows pure readers to access the list even
702  * while a writer is preparing to update it.
703  *
704  * To put it another way, dev_base_lock is held for writing only to
705  * protect against pure readers; the rtnl semaphore provides the
706  * protection against other writers.
707  *
708  * See, for example usages, register_netdevice() and
709  * unregister_netdevice(), which must be called with the rtnl
710  * semaphore held.
711  */
712 struct net_device *dev_base = &loopback_dev;
713 rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
714 
715 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.