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>
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.
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>
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
*);
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
);
122 extern int sbni_probe(struct net_device
*);
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
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
);
151 #endif /* CONFIG_NET_DIVERT */
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
);
160 #endif /* CONFIG_NET_DIVERT */
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 */
179 #ifdef CONFIG_ULTRA32
198 struct devprobe mca_probes
[] __initdata
= {
199 #ifdef CONFIG_ULTRAMCA
202 #ifdef CONFIG_NE2_MCA
205 #ifdef CONFIG_ELMC /* 3c523 */
208 #ifdef CONFIG_ELMC_II /* 3c527 */
211 #ifdef CONFIG_SKMC /* SKnet Microchannel */
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 */
225 #ifdef CONFIG_HP100 /* ISA, EISA & PCI */
237 #ifdef CONFIG_EL2 /* 3c503 */
243 #ifdef CONFIG_HPLAN_PLUS
246 #ifdef CONFIG_E2100 /* Cabletron E21xx series. */
249 #ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */
252 #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
255 #ifdef CONFIG_SMC9194
258 #ifdef CONFIG_SEEQ8005
270 #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */
274 {eth16i_probe
, 0}, /* ICL EtherTeam 16i/32 */
276 #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */
279 #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */
282 #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
285 #ifdef CONFIG_DEPCA /* DEC DEPCA */
288 #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
291 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
294 #ifdef CONFIG_EL1 /* 3c501 */
297 #ifdef CONFIG_WAVELAN /* WaveLAN */
300 #ifdef CONFIG_ARLAN /* Aironet */
303 #ifdef CONFIG_EL16 /* 3c507 */
306 #ifdef CONFIG_ELPLUS /* 3c505 */
324 struct devprobe parport_probes
[] __initdata
= {
325 #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
328 #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
334 struct devprobe m68k_probes
[] __initdata
= {
335 #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
336 {atarilance_probe
, 0},
338 #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
339 {sun3lance_probe
, 0},
341 #ifdef CONFIG_ARIADNE2 /* Village Tronic Ariadne II Ethernet Board */
344 #ifdef CONFIG_HYDRA /* Hydra Systems Amiganet Ethernet board */
347 #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */
350 #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */
353 #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */
356 #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */
359 #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
360 {mvme147lance_probe
, 0},
362 #ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */
365 #ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */
368 #ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */
371 #ifdef CONFIG_MAC89x0
378 struct devprobe sgi_probes
[] __initdata
= {
379 #ifdef CONFIG_SGISEEQ
385 struct devprobe mips_probes
[] __initdata
= {
386 #ifdef CONFIG_MIPS_JAZZ_SONIC
389 #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
390 {bagetlance_probe
, 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
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)
417 if (probe_list(dev
, mips_probes
) == 0)
419 if (probe_list(dev
, sgi_probes
) == 0)
421 if (probe_list(dev
, eisa_probes
) == 0)
423 if (probe_list(dev
, mca_probes
) == 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)
434 if (probe_list(dev
, parport_probes
) == 0)
440 static int __init
fddiif_probe(struct net_device
*dev
)
442 unsigned long base_addr
= dev
->base_addr
;
445 return 1; /* ENXIO */
455 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
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"
471 static int fcif_probe(struct net_device
*dev
)
473 if (dev
->base_addr
== -1)
477 #ifdef CONFIG_IPHASE5526
478 && iph5526_probe(dev
)
481 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
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
, };
491 # define NEXT_DEV (&tap0_dev)
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
, };
499 # define NEXT_DEV (&sdla0_dev)
502 #if defined(CONFIG_LTPC)
503 extern int ltpc_probe(struct net_device
*);
504 static struct net_device dev_ltpc
= {
508 0, 0, 0, NEXT_DEV
, ltpc_probe
};
510 # define NEXT_DEV (&dev_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
};
519 # define NEXT_DEV (&cops0_dev)
523 /* The first device defaults to I/O base '0', which means autoprobe. */
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, ð7_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, ð6_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, ð5_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, ð4_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, ð3_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, ð2_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, ð1_dev
, ethif_probe
};
556 # define NEXT_DEV (ð0_dev)
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
*);
567 trif_probe(struct net_device
*dev
)
574 && olympic_probe(dev
)
580 return 1; /* -ENODEV or -EAGAIN would be more accurate. */
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
};
601 # define NEXT_DEV (&tr0_dev)
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
};
623 #define NEXT_DEV (&fddi0_dev)
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
};
633 # define NEXT_DEV (&fc0_dev)
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
};
656 #define NEXT_DEV (&sbni0_dev)
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
};
697 #define NEXT_DEV (&escon0_dev)
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
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
728 struct net_device
*dev_base
= &loopback_dev
;
729 rwlock_t dev_base_lock
= RW_LOCK_UNLOCKED
;