1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#include <linux/config.h>
31#include <linux/netdevice.h>
32#include <linux/etherdevice.h>
33#include <linux/trdevice.h>
34#include <linux/errno.h>
35#include <linux/init.h>
36#include <linux/netlink.h>
37#include <linux/divert.h>
38
39
40
41
42
43extern int ne2_probe(struct net_device *dev);
44extern int hp100_probe(struct net_device *dev);
45extern int ultra_probe(struct net_device *dev);
46extern int ultra32_probe(struct net_device *dev);
47extern int wd_probe(struct net_device *dev);
48extern int el2_probe(struct net_device *dev);
49extern int ne_probe(struct net_device *dev);
50extern int hp_probe(struct net_device *dev);
51extern int hp_plus_probe(struct net_device *dev);
52extern int express_probe(struct net_device *);
53extern int eepro_probe(struct net_device *);
54extern int at1500_probe(struct net_device *);
55extern int at1700_probe(struct net_device *);
56extern int fmv18x_probe(struct net_device *);
57extern int eth16i_probe(struct net_device *);
58extern int i82596_probe(struct net_device *);
59extern int ewrk3_probe(struct net_device *);
60extern int el1_probe(struct net_device *);
61extern int wavelan_probe(struct net_device *);
62extern int arlan_probe(struct net_device *);
63extern int el16_probe(struct net_device *);
64extern int elmc_probe(struct net_device *);
65extern int skmca_probe(struct net_device *);
66extern int elplus_probe(struct net_device *);
67extern int ac3200_probe(struct net_device *);
68extern int es_probe(struct net_device *);
69extern int lne390_probe(struct net_device *);
70extern int e2100_probe(struct net_device *);
71extern int ni5010_probe(struct net_device *);
72extern int ni52_probe(struct net_device *);
73extern int ni65_probe(struct net_device *);
74extern int sonic_probe(struct net_device *);
75extern int SK_init(struct net_device *);
76extern int seeq8005_probe(struct net_device *);
77extern int smc_init( struct net_device * );
78extern int atarilance_probe(struct net_device *);
79extern int sun3lance_probe(struct net_device *);
80extern int sun3_82586_probe(struct net_device *);
81extern int apne_probe(struct net_device *);
82extern int bionet_probe(struct net_device *);
83extern int pamsnet_probe(struct net_device *);
84extern int cs89x0_probe(struct net_device *dev);
85extern int hplance_probe(struct net_device *dev);
86extern int bagetlance_probe(struct net_device *);
87extern int mvme147lance_probe(struct net_device *dev);
88extern int tc515_probe(struct net_device *dev);
89extern int lance_probe(struct net_device *dev);
90extern int mace_probe(struct net_device *dev);
91extern int macsonic_probe(struct net_device *dev);
92extern int mac8390_probe(struct net_device *dev);
93extern int mac89x0_probe(struct net_device *dev);
94extern int mc32_probe(struct net_device *dev);
95extern struct net_device *cops_probe(int unit);
96extern struct net_device *ltpc_probe(void);
97
98
99extern int de620_probe(struct net_device *);
100
101
102extern int iph5526_probe(struct net_device *dev);
103
104
105extern int sbni_probe(int unit);
106
107struct devprobe
108{
109 int (*probe)(struct net_device *dev);
110 int status;
111};
112
113
114
115
116
117
118
119
120static int __init probe_list(struct net_device *dev, struct devprobe *plist)
121{
122 struct devprobe *p = plist;
123 unsigned long base_addr = dev->base_addr;
124
125 while (p->probe != NULL) {
126 if (base_addr && p->probe(dev) == 0)
127 return 0;
128 else if (p->status == 0) {
129 p->status = p->probe(dev);
130 if (p->status == 0)
131 return 0;
132 }
133 p++;
134 }
135 return -ENODEV;
136}
137
138
139
140
141
142
143
144static struct devprobe eisa_probes[] __initdata = {
145#ifdef CONFIG_ULTRA32
146 {ultra32_probe, 0},
147#endif
148#ifdef CONFIG_AC3200
149 {ac3200_probe, 0},
150#endif
151#ifdef CONFIG_ES3210
152 {es_probe, 0},
153#endif
154#ifdef CONFIG_LNE390
155 {lne390_probe, 0},
156#endif
157 {NULL, 0},
158};
159
160
161static struct devprobe mca_probes[] __initdata = {
162#ifdef CONFIG_NE2_MCA
163 {ne2_probe, 0},
164#endif
165#ifdef CONFIG_ELMC
166 {elmc_probe, 0},
167#endif
168#ifdef CONFIG_ELMC_II
169 {mc32_probe, 0},
170#endif
171#ifdef CONFIG_SKMC
172 {skmca_probe, 0},
173#endif
174 {NULL, 0},
175};
176
177
178
179
180
181static struct devprobe isa_probes[] __initdata = {
182#ifdef CONFIG_HP100
183 {hp100_probe, 0},
184#endif
185#ifdef CONFIG_3C515
186 {tc515_probe, 0},
187#endif
188#ifdef CONFIG_ULTRA
189 {ultra_probe, 0},
190#endif
191#ifdef CONFIG_WD80x3
192 {wd_probe, 0},
193#endif
194#ifdef CONFIG_EL2
195 {el2_probe, 0},
196#endif
197#ifdef CONFIG_HPLAN
198 {hp_probe, 0},
199#endif
200#ifdef CONFIG_HPLAN_PLUS
201 {hp_plus_probe, 0},
202#endif
203#ifdef CONFIG_E2100
204 {e2100_probe, 0},
205#endif
206#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS)
207 {ne_probe, 0},
208#endif
209#ifdef CONFIG_LANCE
210 {lance_probe, 0},
211#endif
212#ifdef CONFIG_SMC9194
213 {smc_init, 0},
214#endif
215#ifdef CONFIG_SEEQ8005
216 {seeq8005_probe, 0},
217#endif
218#ifdef CONFIG_AT1500
219 {at1500_probe, 0},
220#endif
221#ifdef CONFIG_CS89x0
222 {cs89x0_probe, 0},
223#endif
224#ifdef CONFIG_AT1700
225 {at1700_probe, 0},
226#endif
227#ifdef CONFIG_FMV18X
228 {fmv18x_probe, 0},
229#endif
230#ifdef CONFIG_ETH16I
231 {eth16i_probe, 0},
232#endif
233#ifdef CONFIG_EEXPRESS
234 {express_probe, 0},
235#endif
236#ifdef CONFIG_EEXPRESS_PRO
237 {eepro_probe, 0},
238#endif
239#ifdef CONFIG_EWRK3
240 {ewrk3_probe, 0},
241#endif
242#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET)
243 {i82596_probe, 0},
244#endif
245#ifdef CONFIG_EL1
246 {el1_probe, 0},
247#endif
248#ifdef CONFIG_WAVELAN
249 {wavelan_probe, 0},
250#endif
251#ifdef CONFIG_ARLAN
252 {arlan_probe, 0},
253#endif
254#ifdef CONFIG_EL16
255 {el16_probe, 0},
256#endif
257#ifdef CONFIG_ELPLUS
258 {elplus_probe, 0},
259#endif
260#ifdef CONFIG_SK_G16
261 {SK_init, 0},
262#endif
263#ifdef CONFIG_NI5010
264 {ni5010_probe, 0},
265#endif
266#ifdef CONFIG_NI52
267 {ni52_probe, 0},
268#endif
269#ifdef CONFIG_NI65
270 {ni65_probe, 0},
271#endif
272 {NULL, 0},
273};
274
275static struct devprobe parport_probes[] __initdata = {
276#ifdef CONFIG_DE620
277 {de620_probe, 0},
278#endif
279 {NULL, 0},
280};
281
282static struct devprobe m68k_probes[] __initdata = {
283#ifdef CONFIG_ATARILANCE
284 {atarilance_probe, 0},
285#endif
286#ifdef CONFIG_SUN3LANCE
287 {sun3lance_probe, 0},
288#endif
289#ifdef CONFIG_SUN3_82586
290 {sun3_82586_probe, 0},
291#endif
292#ifdef CONFIG_APNE
293 {apne_probe, 0},
294#endif
295#ifdef CONFIG_ATARI_BIONET
296 {bionet_probe, 0},
297#endif
298#ifdef CONFIG_ATARI_PAMSNET
299 {pamsnet_probe, 0},
300#endif
301#ifdef CONFIG_HPLANCE
302 {hplance_probe, 0},
303#endif
304#ifdef CONFIG_MVME147_NET
305 {mvme147lance_probe, 0},
306#endif
307#ifdef CONFIG_MACMACE
308 {mace_probe, 0},
309#endif
310#ifdef CONFIG_MACSONIC
311 {macsonic_probe, 0},
312#endif
313#ifdef CONFIG_MAC8390
314 {mac8390_probe, 0},
315#endif
316#ifdef CONFIG_MAC89x0
317 {mac89x0_probe, 0},
318#endif
319 {NULL, 0},
320};
321
322static struct devprobe mips_probes[] __initdata = {
323#ifdef CONFIG_MIPS_JAZZ_SONIC
324 {sonic_probe, 0},
325#endif
326#ifdef CONFIG_BAGETLANCE
327 {bagetlance_probe, 0},
328#endif
329 {NULL, 0},
330};
331
332
333
334
335
336
337static int __init ethif_probe(int unit)
338{
339 struct net_device *dev;
340 int err = -ENODEV;
341
342 dev = alloc_etherdev(0);
343 if (!dev)
344 return -ENOMEM;
345
346 sprintf(dev->name, "eth%d", unit);
347 netdev_boot_setup_check(dev);
348
349
350
351
352
353 if (dev->base_addr == 1) {
354 free_netdev(dev);
355 return -ENXIO;
356 }
357
358
359
360
361
362 if (probe_list(dev, m68k_probes) == 0 ||
363 probe_list(dev, mips_probes) == 0 ||
364 probe_list(dev, eisa_probes) == 0 ||
365 probe_list(dev, mca_probes) == 0 ||
366 probe_list(dev, isa_probes) == 0 ||
367 probe_list(dev, parport_probes) == 0)
368 err = register_netdev(dev);
369
370 if (err)
371 free_netdev(dev);
372 return err;
373
374}
375
376#ifdef CONFIG_TR
377
378extern int ibmtr_probe(struct net_device *);
379extern int sk_isa_probe(struct net_device *);
380extern int proteon_probe(struct net_device *);
381extern int smctr_probe(struct net_device *);
382
383static __init int trif_probe(int unit)
384{
385 struct net_device *dev;
386 int err = -ENODEV;
387
388 dev = alloc_trdev(0);
389 if (!dev)
390 return -ENOMEM;
391
392 sprintf(dev->name, "tr%d", unit);
393 netdev_boot_setup_check(dev);
394 if (
395#ifdef CONFIG_IBMTR
396 ibmtr_probe(dev) == 0 ||
397#endif
398#ifdef CONFIG_SKISA
399 sk_isa_probe(dev) == 0 ||
400#endif
401#ifdef CONFIG_PROTEON
402 proteon_probe(dev) == 0 ||
403#endif
404#ifdef CONFIG_SMCTR
405 smctr_probe(dev) == 0 ||
406#endif
407 0 )
408 err = register_netdev(dev);
409
410 if (err)
411 free_netdev(dev);
412 return err;
413
414}
415#endif
416
417
418
419
420
421
422extern int loopback_init(void);
423
424
425static int __init net_olddevs_init(void)
426{
427 int num;
428
429 if (loopback_init()) {
430 printk(KERN_ERR "Network loopback device setup failed\n");
431 }
432
433
434#ifdef CONFIG_SBNI
435 for (num = 0; num < 8; ++num)
436 sbni_probe(num);
437#endif
438#ifdef CONFIG_TR
439 for (num = 0; num < 8; ++num)
440 trif_probe(num);
441#endif
442 for (num = 0; num < 8; ++num)
443 ethif_probe(num);
444
445#ifdef CONFIG_COPS
446 cops_probe(0);
447 cops_probe(1);
448 cops_probe(2);
449#endif
450#ifdef CONFIG_LTPC
451 ltpc_probe();
452#endif
453
454 return 0;
455}
456
457device_initcall(net_olddevs_init);
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478struct net_device *dev_base;
479rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
480
481EXPORT_SYMBOL(dev_base);
482EXPORT_SYMBOL(dev_base_lock);
483