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

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

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 
  2 /*
  3  *      New style setup code for the network devices
  4  */
  5  
  6 #include <linux/config.h>
  7 #include <linux/netdevice.h>
  8 #include <linux/errno.h>
  9 #include <linux/init.h>
 10 #include <linux/netlink.h>
 11 
 12 extern int slip_init_ctrl_dev(void);
 13 extern int strip_init_ctrl_dev(void);
 14 extern int x25_asy_init_ctrl_dev(void);
 15   
 16 extern int dmascc_init(void);
 17 
 18 extern int awc4500_pci_probe(void);
 19 extern int awc4500_isa_probe(void);
 20 extern int awc4500_pnp_probe(void);
 21 extern int awc4500_365_probe(void);
 22 extern int arcnet_init(void); 
 23 extern int scc_enet_init(void); 
 24 extern int fec_enet_init(void); 
 25 extern int dlci_setup(void); 
 26 extern int lapbeth_init(void);
 27 extern int sdla_setup(void); 
 28 extern int sdla_c_setup(void); 
 29 extern int comx_init(void);
 30 extern int lmc_setup(void);
 31 
 32 extern int madgemc_probe(void);
 33 
 34 /* Pad device name to IFNAMSIZ=16. F.e. __PAD6 is string of 9 zeros. */
 35 #define __PAD6 "\0\0\0\0\0\0\0\0\0"
 36 #define __PAD5 __PAD6 "\0"
 37 #define __PAD4 __PAD5 "\0"
 38 #define __PAD3 __PAD4 "\0"
 39 #define __PAD2 __PAD3 "\0"
 40 
 41 
 42 /*
 43  *      Devices in this list must do new style probing. That is they must
 44  *      allocate their own device objects and do their own bus scans.
 45  */
 46 
 47 struct net_probe
 48 {
 49         int (*probe)(void);
 50         int status;     /* non-zero if autoprobe has failed */
 51 };
 52  
 53 struct net_probe pci_probes[] __initdata = {
 54         /*
 55          *      Early setup devices
 56          */
 57 
 58 #if defined(CONFIG_DMASCC)
 59         {dmascc_init, 0},
 60 #endif  
 61 #if defined(CONFIG_DLCI)
 62         {dlci_setup, 0},
 63 #endif
 64 #if defined(CONFIG_SDLA)
 65         {sdla_c_setup, 0},
 66 #endif
 67 #if defined(CONFIG_LAPBETHER)
 68         {lapbeth_init, 0},
 69 #endif
 70 #if defined(CONFIG_ARCNET)
 71         {arcnet_init, 0},
 72 #endif
 73 #if defined(CONFIG_SCC_ENET)
 74         {scc_enet_init, 0},
 75 #endif
 76 #if defined(CONFIG_FEC_ENET)
 77         {fec_enet_init, 0},
 78 #endif
 79 #if defined(CONFIG_COMX)
 80         {comx_init, 0},
 81 #endif
 82          
 83 #if defined(CONFIG_LANMEDIA)
 84         {lmc_setup, 0},
 85 #endif
 86          
 87 /*
 88 *
 89 *       Wireless non-HAM
 90 *
 91 */
 92 #ifdef CONFIG_AIRONET4500_NONCS
 93 
 94 #ifdef CONFIG_AIRONET4500_PCI
 95         {awc4500_pci_probe,0},
 96 #endif
 97 
 98 #ifdef CONFIG_AIRONET4500_PNP
 99         {awc4500_pnp_probe,0},
100 #endif
101 
102 #endif
103 
104 /*
105  *      Token Ring Drivers
106  */  
107 #ifdef CONFIG_MADGEMC
108         {madgemc_probe, 0},
109 #endif
110         {NULL, 0},
111 };
112 
113 
114 /*
115  *      Run the updated device probes. These do not need a device passed
116  *      into them.
117  */
118  
119 static void __init network_probe(void)
120 {
121         struct net_probe *p = pci_probes;
122 
123         while (p->probe != NULL)
124         {
125                 p->status = p->probe();
126                 p++;
127         }
128 }
129 
130 
131 /*
132  *      Initialise the line discipline drivers
133  */
134  
135 static void __init network_ldisc_init(void)
136 {
137 #if defined(CONFIG_SLIP)
138         slip_init_ctrl_dev();
139 #endif
140 #if defined(CONFIG_X25_ASY)
141         x25_asy_init_ctrl_dev();
142 #endif
143 #if defined(CONFIG_STRIP)
144         strip_init_ctrl_dev();
145 #endif
146 }
147 
148 
149 static void __init special_device_init(void)
150 {
151 #ifdef CONFIG_NET_SB1000
152         {
153                 extern int sb1000_probe(struct net_device *dev);
154                 static struct net_device sb1000_dev = 
155                 {
156                         "cm0" __PAD3, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, sb1000_probe 
157                 };
158                 register_netdev(&sb1000_dev);
159         }
160 #endif
161 }
162 
163 /*
164  *      Initialise network devices
165  */
166  
167 void __init net_device_init(void)
168 {
169         /* Devices supporting the new probing API */
170         network_probe();
171         /* Line disciplines */
172         network_ldisc_init();
173         /* Special devices */
174         special_device_init();
175         /* That kicks off the legacy init functions */
176 }
177 

~ [ 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.