1 |
1275 |
phoenix |
/*
|
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 |
|
|
extern int oeth_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 |
|
|
static struct devprobe mips_probes[] __initdata = {
|
370 |
|
|
#ifdef CONFIG_MIPS_JAZZ_SONIC
|
371 |
|
|
{sonic_probe, 0},
|
372 |
|
|
#endif
|
373 |
|
|
#ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */
|
374 |
|
|
{bagetlance_probe, 0},
|
375 |
|
|
#endif
|
376 |
|
|
{NULL, 0},
|
377 |
|
|
};
|
378 |
|
|
|
379 |
|
|
static struct devprobe or32_probes[] __initdata = {
|
380 |
|
|
#ifdef CONFIG_OETH
|
381 |
|
|
{oeth_probe, 0},
|
382 |
|
|
#endif
|
383 |
|
|
{NULL, 0},
|
384 |
|
|
};
|
385 |
|
|
|
386 |
|
|
/*
|
387 |
|
|
* Unified ethernet device probe, segmented per architecture and
|
388 |
|
|
* per bus interface. This drives the legacy devices only for now.
|
389 |
|
|
*/
|
390 |
|
|
|
391 |
|
|
static int __init ethif_probe(struct net_device *dev)
|
392 |
|
|
{
|
393 |
|
|
unsigned long base_addr = dev->base_addr;
|
394 |
|
|
|
395 |
|
|
/*
|
396 |
|
|
* Backwards compatibility - historically an I/O base of 1 was
|
397 |
|
|
* used to indicate not to probe for this ethN interface
|
398 |
|
|
*/
|
399 |
|
|
if (base_addr == 1)
|
400 |
|
|
return 1; /* ENXIO */
|
401 |
|
|
|
402 |
|
|
/*
|
403 |
|
|
* The arch specific probes are 1st so that any on-board ethernet
|
404 |
|
|
* will be probed before other ISA/EISA/MCA/PCI bus cards.
|
405 |
|
|
*/
|
406 |
|
|
if (probe_list(dev, m68k_probes) == 0)
|
407 |
|
|
return 0;
|
408 |
|
|
if (probe_list(dev, mips_probes) == 0)
|
409 |
|
|
return 0;
|
410 |
|
|
if (probe_list(dev, or32_probes) == 0)
|
411 |
|
|
return 0;
|
412 |
|
|
if (probe_list(dev, eisa_probes) == 0)
|
413 |
|
|
return 0;
|
414 |
|
|
if (probe_list(dev, mca_probes) == 0)
|
415 |
|
|
return 0;
|
416 |
|
|
/*
|
417 |
|
|
* Backwards compatibility - an I/O of 0xffe0 was used to indicate
|
418 |
|
|
* that we shouldn't do a bunch of potentially risky ISA probes
|
419 |
|
|
* for ethN (N>1). Since the widespread use of modules, *nobody*
|
420 |
|
|
* compiles a kernel with all the ISA drivers built in anymore,
|
421 |
|
|
* and so we should delete this check in linux 2.3 - Paul G.
|
422 |
|
|
*/
|
423 |
|
|
if (base_addr != 0xffe0 && probe_list(dev, isa_probes) == 0)
|
424 |
|
|
return 0;
|
425 |
|
|
if (probe_list(dev, parport_probes) == 0)
|
426 |
|
|
return 0;
|
427 |
|
|
return -ENODEV;
|
428 |
|
|
}
|
429 |
|
|
|
430 |
|
|
#ifdef CONFIG_FDDI
|
431 |
|
|
static int __init fddiif_probe(struct net_device *dev)
|
432 |
|
|
{
|
433 |
|
|
unsigned long base_addr = dev->base_addr;
|
434 |
|
|
|
435 |
|
|
if (base_addr == 1)
|
436 |
|
|
return 1; /* ENXIO */
|
437 |
|
|
|
438 |
|
|
if (1
|
439 |
|
|
#ifdef CONFIG_APFDDI
|
440 |
|
|
&& apfddi_init(dev)
|
441 |
|
|
#endif
|
442 |
|
|
#ifdef CONFIG_SKFP
|
443 |
|
|
&& skfp_probe(dev)
|
444 |
|
|
#endif
|
445 |
|
|
&& 1 ) {
|
446 |
|
|
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
|
447 |
|
|
}
|
448 |
|
|
return 0;
|
449 |
|
|
}
|
450 |
|
|
#endif
|
451 |
|
|
|
452 |
|
|
|
453 |
|
|
#ifdef CONFIG_NET_FC
|
454 |
|
|
static int fcif_probe(struct net_device *dev)
|
455 |
|
|
{
|
456 |
|
|
if (dev->base_addr == -1)
|
457 |
|
|
return 1;
|
458 |
|
|
|
459 |
|
|
if (1
|
460 |
|
|
#ifdef CONFIG_IPHASE5526
|
461 |
|
|
&& iph5526_probe(dev)
|
462 |
|
|
#endif
|
463 |
|
|
&& 1 ) {
|
464 |
|
|
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
|
465 |
|
|
}
|
466 |
|
|
return 0;
|
467 |
|
|
}
|
468 |
|
|
#endif /* CONFIG_NET_FC */
|
469 |
|
|
|
470 |
|
|
|
471 |
|
|
#ifdef CONFIG_ETHERTAP
|
472 |
|
|
static struct net_device tap0_dev = { "tap0", 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };
|
473 |
|
|
# undef NEXT_DEV
|
474 |
|
|
# define NEXT_DEV (&tap0_dev)
|
475 |
|
|
#endif
|
476 |
|
|
|
477 |
|
|
#ifdef CONFIG_SDLA
|
478 |
|
|
extern int sdla_init(struct net_device *);
|
479 |
|
|
static struct net_device sdla0_dev = { "sdla0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };
|
480 |
|
|
|
481 |
|
|
# undef NEXT_DEV
|
482 |
|
|
# define NEXT_DEV (&sdla0_dev)
|
483 |
|
|
#endif
|
484 |
|
|
|
485 |
|
|
#if defined(CONFIG_LTPC)
|
486 |
|
|
extern int ltpc_probe(struct net_device *);
|
487 |
|
|
static struct net_device dev_ltpc = {
|
488 |
|
|
"lt0",
|
489 |
|
|
0, 0, 0, 0,
|
490 |
|
|
0x0, 0,
|
491 |
|
|
0, 0, 0, NEXT_DEV, ltpc_probe };
|
492 |
|
|
# undef NEXT_DEV
|
493 |
|
|
# define NEXT_DEV (&dev_ltpc)
|
494 |
|
|
#endif /* LTPC */
|
495 |
|
|
|
496 |
|
|
#if defined(CONFIG_COPS)
|
497 |
|
|
extern int cops_probe(struct net_device *);
|
498 |
|
|
static struct net_device cops2_dev = { "lt2", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe };
|
499 |
|
|
static struct net_device cops1_dev = { "lt1", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe };
|
500 |
|
|
static struct net_device cops0_dev = { "lt0", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };
|
501 |
|
|
# undef NEXT_DEV
|
502 |
|
|
# define NEXT_DEV (&cops0_dev)
|
503 |
|
|
#endif /* COPS */
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
/* The first device defaults to I/O base '0', which means autoprobe. */
|
507 |
|
|
#ifndef ETH0_ADDR
|
508 |
|
|
# define ETH0_ADDR 0
|
509 |
|
|
#endif
|
510 |
|
|
#ifndef ETH0_IRQ
|
511 |
|
|
# define ETH0_IRQ 0
|
512 |
|
|
#endif
|
513 |
|
|
|
514 |
|
|
/* "eth0" defaults to autoprobe (== 0), other use a base of 0xffe0 (== -0x20),
|
515 |
|
|
which means "don't do ISA probes". Distributions don't ship kernels with
|
516 |
|
|
all ISA drivers compiled in anymore, so its probably no longer an issue. */
|
517 |
|
|
|
518 |
|
|
#define ETH_NOPROBE_ADDR 0xffe0
|
519 |
|
|
|
520 |
|
|
static struct net_device eth7_dev = {
|
521 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
|
522 |
|
|
static struct net_device eth6_dev = {
|
523 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð7_dev, ethif_probe };
|
524 |
|
|
static struct net_device eth5_dev = {
|
525 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð6_dev, ethif_probe };
|
526 |
|
|
static struct net_device eth4_dev = {
|
527 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð5_dev, ethif_probe };
|
528 |
|
|
static struct net_device eth3_dev = {
|
529 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð4_dev, ethif_probe };
|
530 |
|
|
static struct net_device eth2_dev = {
|
531 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð3_dev, ethif_probe };
|
532 |
|
|
static struct net_device eth1_dev = {
|
533 |
|
|
"eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð2_dev, ethif_probe };
|
534 |
|
|
|
535 |
|
|
static struct net_device eth0_dev = {
|
536 |
|
|
"eth%d", 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, ð1_dev, ethif_probe };
|
537 |
|
|
|
538 |
|
|
# undef NEXT_DEV
|
539 |
|
|
# define NEXT_DEV (ð0_dev)
|
540 |
|
|
|
541 |
|
|
|
542 |
|
|
|
543 |
|
|
#ifdef CONFIG_TR
|
544 |
|
|
/* Token-ring device probe */
|
545 |
|
|
extern int ibmtr_probe(struct net_device *);
|
546 |
|
|
extern int smctr_probe(struct net_device *);
|
547 |
|
|
|
548 |
|
|
static int
|
549 |
|
|
trif_probe(struct net_device *dev)
|
550 |
|
|
{
|
551 |
|
|
if (1
|
552 |
|
|
#ifdef CONFIG_IBMTR
|
553 |
|
|
&& ibmtr_probe(dev)
|
554 |
|
|
#endif
|
555 |
|
|
#ifdef CONFIG_SMCTR
|
556 |
|
|
&& smctr_probe(dev)
|
557 |
|
|
#endif
|
558 |
|
|
&& 1 ) {
|
559 |
|
|
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
|
560 |
|
|
}
|
561 |
|
|
return 0;
|
562 |
|
|
}
|
563 |
|
|
static struct net_device tr7_dev = {
|
564 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };
|
565 |
|
|
static struct net_device tr6_dev = {
|
566 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };
|
567 |
|
|
static struct net_device tr5_dev = {
|
568 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };
|
569 |
|
|
static struct net_device tr4_dev = {
|
570 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };
|
571 |
|
|
static struct net_device tr3_dev = {
|
572 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };
|
573 |
|
|
static struct net_device tr2_dev = {
|
574 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };
|
575 |
|
|
static struct net_device tr1_dev = {
|
576 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };
|
577 |
|
|
static struct net_device tr0_dev = {
|
578 |
|
|
"tr%d",0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };
|
579 |
|
|
# undef NEXT_DEV
|
580 |
|
|
# define NEXT_DEV (&tr0_dev)
|
581 |
|
|
|
582 |
|
|
#endif
|
583 |
|
|
|
584 |
|
|
#ifdef CONFIG_FDDI
|
585 |
|
|
static struct net_device fddi7_dev =
|
586 |
|
|
{"fddi7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe};
|
587 |
|
|
static struct net_device fddi6_dev =
|
588 |
|
|
{"fddi6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe};
|
589 |
|
|
static struct net_device fddi5_dev =
|
590 |
|
|
{"fddi5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe};
|
591 |
|
|
static struct net_device fddi4_dev =
|
592 |
|
|
{"fddi4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe};
|
593 |
|
|
static struct net_device fddi3_dev =
|
594 |
|
|
{"fddi3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe};
|
595 |
|
|
static struct net_device fddi2_dev =
|
596 |
|
|
{"fddi2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe};
|
597 |
|
|
static struct net_device fddi1_dev =
|
598 |
|
|
{"fddi1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe};
|
599 |
|
|
static struct net_device fddi0_dev =
|
600 |
|
|
{"fddi0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};
|
601 |
|
|
#undef NEXT_DEV
|
602 |
|
|
#define NEXT_DEV (&fddi0_dev)
|
603 |
|
|
#endif
|
604 |
|
|
|
605 |
|
|
|
606 |
|
|
#ifdef CONFIG_NET_FC
|
607 |
|
|
static struct net_device fc1_dev = {
|
608 |
|
|
"fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe};
|
609 |
|
|
static struct net_device fc0_dev = {
|
610 |
|
|
"fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};
|
611 |
|
|
# undef NEXT_DEV
|
612 |
|
|
# define NEXT_DEV (&fc0_dev)
|
613 |
|
|
#endif
|
614 |
|
|
|
615 |
|
|
|
616 |
|
|
#ifdef CONFIG_SBNI
|
617 |
|
|
static struct net_device sbni7_dev =
|
618 |
|
|
{"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe};
|
619 |
|
|
static struct net_device sbni6_dev =
|
620 |
|
|
{"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe};
|
621 |
|
|
static struct net_device sbni5_dev =
|
622 |
|
|
{"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe};
|
623 |
|
|
static struct net_device sbni4_dev =
|
624 |
|
|
{"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe};
|
625 |
|
|
static struct net_device sbni3_dev =
|
626 |
|
|
{"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe};
|
627 |
|
|
static struct net_device sbni2_dev =
|
628 |
|
|
{"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe};
|
629 |
|
|
static struct net_device sbni1_dev =
|
630 |
|
|
{"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe};
|
631 |
|
|
static struct net_device sbni0_dev =
|
632 |
|
|
{"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};
|
633 |
|
|
|
634 |
|
|
#undef NEXT_DEV
|
635 |
|
|
#define NEXT_DEV (&sbni0_dev)
|
636 |
|
|
#endif
|
637 |
|
|
|
638 |
|
|
/*
|
639 |
|
|
* The loopback device is global so it can be directly referenced
|
640 |
|
|
* by the network code. Also, it must be first on device list.
|
641 |
|
|
*/
|
642 |
|
|
|
643 |
|
|
extern int loopback_init(struct net_device *dev);
|
644 |
|
|
struct net_device loopback_dev =
|
645 |
|
|
{"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};
|
646 |
|
|
|
647 |
|
|
/*
|
648 |
|
|
* The @dev_base list is protected by @dev_base_lock and the rtln
|
649 |
|
|
* semaphore.
|
650 |
|
|
*
|
651 |
|
|
* Pure readers hold dev_base_lock for reading.
|
652 |
|
|
*
|
653 |
|
|
* Writers must hold the rtnl semaphore while they loop through the
|
654 |
|
|
* dev_base list, and hold dev_base_lock for writing when they do the
|
655 |
|
|
* actual updates. This allows pure readers to access the list even
|
656 |
|
|
* while a writer is preparing to update it.
|
657 |
|
|
*
|
658 |
|
|
* To put it another way, dev_base_lock is held for writing only to
|
659 |
|
|
* protect against pure readers; the rtnl semaphore provides the
|
660 |
|
|
* protection against other writers.
|
661 |
|
|
*
|
662 |
|
|
* See, for example usages, register_netdevice() and
|
663 |
|
|
* unregister_netdevice(), which must be called with the rtnl
|
664 |
|
|
* semaphore held.
|
665 |
|
|
*/
|
666 |
|
|
struct net_device *dev_base = &loopback_dev;
|
667 |
|
|
rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
|
668 |
|
|
|