2 * New style setup code for the network devices
5 #include <linux/config.h>
6 #include <linux/netdevice.h>
7 #include <linux/errno.h>
8 #include <linux/init.h>
9 #include <linux/netlink.h>
11 extern int mkiss_init_ctrl_dev(void);
12 extern int ppp_init(void);
13 extern int slip_init_ctrl_dev(void);
14 extern int strip_init_ctrl_dev(void);
15 extern int x25_asy_init_ctrl_dev(void);
17 extern int bpq_init(void);
18 extern int dmascc_init(void);
19 extern int scc_init(void);
20 extern int yam_init(void);
22 extern int acenic_probe(void);
23 extern int arcnet_init(void);
24 extern int bigmac_probe(void);
25 extern int bmac_probe(void);
26 extern int cpm_enet_init(void);
27 extern int dlci_setup(void);
28 extern int dgrs_probe(void);
29 extern int dmfe_reg_board(void);
30 extern int eepro100_probe(void);
31 extern int epic100_probe(void);
32 extern int happy_meal_probe(void);
33 extern int lapbeth_init(void);
34 extern int mace_probe(void);
35 extern int myri_sbus_probe(void);
36 extern int ncr885e_probe(void);
37 extern int ne2k_pci_probe(void);
38 extern int pcnet32_probe(void);
39 extern int qec_probe(void);
40 extern int rcpci_probe(void);
41 extern int rr_hippi_probe(void);
42 extern int rtl8139_probe(void);
43 extern int sdla_setup(void);
44 extern int sis900_probe(void);
45 extern int sparc_lance_probe(void);
46 extern int starfire_probe(void);
47 extern int tc59x_probe(void);
48 extern int tulip_probe(void);
49 extern int via_rhine_probe(void);
50 extern int yellowfin_probe(void);
52 /* Pad device name to IFNAMSIZ=16. F.e. __PAD6 is tring of 9 zeros. */
53 #define __PAD6 "\0\0\0\0\0\0\0\0\0"
54 #define __PAD5 __PAD6 "\0"
55 #define __PAD4 __PAD5 "\0"
56 #define __PAD3 __PAD4 "\0"
57 #define __PAD2 __PAD3 "\0"
61 * Devices in this list must do new style probing. That is they must
62 * allocate their own device objects and do their own bus scans.
68 int status
; /* non-zero if autoprobe has failed */
71 struct net_probe pci_probes
[] __initdata
= {
76 #if defined(CONFIG_SCC)
79 #if defined(CONFIG_DMASCC)
82 #if defined(CONFIG_BPQETHER)
85 #if defined(CONFIG_DLCI)
88 #if defined(CONFIG_SDLA)
91 #if defined(CONFIG_LAPBETHER)
94 #if defined(CONFIG_PLIP)
97 #if defined(CONFIG_ARCNET)
100 #if defined(CONFIG_8xx)
104 * SLHC if present needs attaching so other people see it
105 * even if not opened.
109 #if (defined(CONFIG_SLIP) && defined(CONFIG_SLIP_COMPRESSED)) \
110 || defined(CONFIG_PPP) \
111 || (defined(CONFIG_ISDN) && defined(CONFIG_ISDN_PPP))
118 #ifdef CONFIG_ROADRUNNER
130 #ifdef CONFIG_HAPPYMEAL
131 {happy_meal_probe
, 0},
133 #ifdef CONFIG_SUNLANCE
134 {sparc_lance_probe
, 0},
139 #ifdef CONFIG_SUNBMAC
142 #ifdef CONFIG_MYRI_SBUS
143 {myri_sbus_probe
, 0},
156 #ifdef CONFIG_NCR885E
172 #ifdef CONFIG_NE2K_PCI
175 #ifdef CONFIG_PCNET32
178 #ifdef CONFIG_EEXPRESS_PRO100 /* Intel EtherExpress Pro/100 */
181 #ifdef CONFIG_DEC_ELCP
184 #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */
187 #ifdef CONFIG_EPIC100
190 #ifdef CONFIG_RTL8139
201 #ifdef CONFIG_YELLOWFIN
202 {yellowfin_probe
, 0},
207 #ifdef CONFIG_VIA_RHINE
208 {via_rhine_probe
, 0},
210 #ifdef CONFIG_ADAPTEC_STARFIRE
215 * Amateur Radio Drivers
220 #endif /* CONFIG_YAM */
228 * Run the updated device probes. These do not need a device passed
232 static void __init
network_probe(void)
234 struct net_probe
*p
= pci_probes
;
236 while (p
->probe
!= NULL
)
238 p
->status
= p
->probe();
245 * Initialise the line discipline drivers
248 static void __init
network_ldisc_init(void)
250 #if defined(CONFIG_SLIP)
251 slip_init_ctrl_dev();
253 #if defined(CONFIG_X25_ASY)
254 x25_asy_init_ctrl_dev();
256 #if defined(CONFIG_MKISS)
257 mkiss_init_ctrl_dev();
259 #if defined(CONFIG_STRIP)
260 strip_init_ctrl_dev();
262 #if defined(CONFIG_PPP)
268 static void __init
appletalk_device_init(void)
270 #if defined(CONFIG_IPDDP)
271 extern int ipddp_init(struct net_device
*dev
);
272 static struct net_device dev_ipddp
= {
276 0, 0, 0, NULL
, ipddp_init
279 dev_ipddp
.init(&dev_ipddp
);
280 #endif /* CONFIG_IPDDP */
285 * The loopback device is global so it can be directly referenced
286 * by the network code.
289 extern int loopback_init(struct net_device
*dev
);
290 struct net_device loopback_dev
=
292 "lo" __PAD2
, /* Software Loopback interface */
293 0x0, /* recv memory end */
294 0x0, /* recv memory start */
295 0x0, /* memory end */
296 0x0, /* memory start */
297 0, /* base I/O address */
300 NULL
, /* next device */
301 loopback_init
/* loopback_init should set up the rest */
304 static void special_device_init(void)
308 extern int dummy_init(struct net_device
*dev
);
309 static struct net_device dummy_dev
= {
310 "dummy" __PAD5
, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL
, dummy_init
,
312 register_netdev(&sb1000_dev
);
315 #ifdef CONFIG_EQUALIZER
317 extern int eql_init(struct net_device
*dev
);
318 static struct net_device eql_dev
=
320 "eql" __PAD3
, /* Master device for IP traffic load balancing */
321 0x0, 0x0, 0x0, 0x0, /* recv end/start; mem end/start */
322 0, /* base I/O address */
325 NULL
, /* next device */
326 eql_init
/* set up the rest */
328 register_netdev(&sb1000_dev
);
333 extern int bif_init(struct net_device
*dev
);
334 static struct net_device bif_dev
=
336 "bif" __PAD3
, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL
, bif_init
338 register_netdev(&sb1000_dev
);
341 #ifdef CONFIG_NET_SB1000
343 extern int sb1000_probe(struct net_device
*dev
);
344 static struct net_device sb1000_dev
=
346 "cm0", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL
, sb1000_probe
348 register_netdev(&sb1000_dev
);
351 register_netdev(&loopback_dev
);
355 * Initialise network devices
358 void __init
net_device_init(void)
360 /* Devices supporting the new probing API */
362 /* Line disciplines */
363 network_ldisc_init();
365 appletalk_device_init();
366 /* Special devices */
367 special_device_init();
368 /* That kicks off the legacy init functions */