📄 space.c
字号:
#endif#ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */ {sun3lance_probe, 0},#endif#ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */ {apne_probe, 0},#endif#ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ {bionet_probe, 0},#endif#ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */ {pamsnet_probe, 0},#endif#ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */ {hplance_probe, 0},#endif#ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */ {mvme147lance_probe, 0},#endif#ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */ {mace68k_probe, 0},#endif#ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */ {macsonic_probe, 0},#endif#ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */ {mac8390_probe, 0},#endif#ifdef CONFIG_MAC89x0 {mac89x0_probe, 0},#endif {NULL, 0},};static struct devprobe sgi_probes[] __initdata = {#ifdef CONFIG_SGISEEQ {sgiseeq_probe, 0},#endif {NULL, 0},};static struct devprobe mips_probes[] __initdata = {#ifdef CONFIG_MIPS_JAZZ_SONIC {sonic_probe, 0},#endif#ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */ {bagetlance_probe, 0},#endif {NULL, 0},};/* * Unified ethernet device probe, segmented per architecture and * per bus interface. This drives the legacy devices only for now. */ static int __init ethif_probe(struct net_device *dev){ unsigned long base_addr = dev->base_addr; /* * Backwards compatibility - historically an I/O base of 1 was * used to indicate not to probe for this ethN interface */ if (base_addr == 1) return 1; /* ENXIO */ /* * The arch specific probes are 1st so that any on-board ethernet * will be probed before other ISA/EISA/MCA/PCI bus cards. */ if (probe_list(dev, m68k_probes) == 0) return 0; if (probe_list(dev, mips_probes) == 0) return 0; if (probe_list(dev, sgi_probes) == 0) return 0; if (probe_list(dev, eisa_probes) == 0) return 0; if (probe_list(dev, mca_probes) == 0) return 0; /* * Backwards compatibility - an I/O of 0xffe0 was used to indicate * that we shouldn't do a bunch of potentially risky ISA probes * for ethN (N>1). Since the widespread use of modules, *nobody* * compiles a kernel with all the ISA drivers built in anymore, * and so we should delete this check in linux 2.3 - Paul G. */ if (base_addr != 0xffe0 && probe_list(dev, isa_probes) == 0) return 0; if (probe_list(dev, parport_probes) == 0) return 0; return -ENODEV;}#ifdef CONFIG_FDDIstatic int __init fddiif_probe(struct net_device *dev){ unsigned long base_addr = dev->base_addr; if (base_addr == 1) return 1; /* ENXIO */ if (1#ifdef CONFIG_APFDDI && apfddi_init(dev)#endif#ifdef CONFIG_SKFP && skfp_probe(dev)#endif && 1 ) { return 1; /* -ENODEV or -EAGAIN would be more accurate. */ } return 0;}#endif#ifdef CONFIG_NET_FCstatic int fcif_probe(struct net_device *dev){ if (dev->base_addr == -1) return 1; if (1#ifdef CONFIG_IPHASE5526 && iph5526_probe(dev)#endif && 1 ) { return 1; /* -ENODEV or -EAGAIN would be more accurate. */ } return 0;}#endif /* CONFIG_NET_FC */#ifdef CONFIG_ETHERTAP static struct net_device tap0_dev = { "tap0", 0, 0, 0, 0, NETLINK_TAPBASE, 0, 0, 0, 0, NEXT_DEV, ethertap_probe, };# undef NEXT_DEV# define NEXT_DEV (&tap0_dev)#endif#ifdef CONFIG_SDLA extern int sdla_init(struct net_device *); static struct net_device sdla0_dev = { "sdla0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sdla_init, };# undef NEXT_DEV# define NEXT_DEV (&sdla0_dev)#endif#if defined(CONFIG_LTPC) extern int ltpc_probe(struct net_device *); static struct net_device dev_ltpc = { "lt0", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, ltpc_probe };# undef NEXT_DEV# define NEXT_DEV (&dev_ltpc)#endif /* LTPC */#if defined(CONFIG_COPS) extern int cops_probe(struct net_device *); static struct net_device cops2_dev = { "lt2", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NEXT_DEV, cops_probe }; static struct net_device cops1_dev = { "lt1", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops2_dev, cops_probe }; static struct net_device cops0_dev = { "lt0", 0, 0, 0, 0, 0x0, 0, 0, 0, 0, &cops1_dev, cops_probe };# undef NEXT_DEV# define NEXT_DEV (&cops0_dev)#endif /* COPS *//* The first device defaults to I/O base '0', which means autoprobe. */#ifndef ETH0_ADDR# define ETH0_ADDR 0#endif#ifndef ETH0_IRQ# define ETH0_IRQ 0#endif/* "eth0" defaults to autoprobe (== 0), other use a base of 0xffe0 (== -0x20), which means "don't do ISA probes". Distributions don't ship kernels with all ISA drivers compiled in anymore, so its probably no longer an issue. */#define ETH_NOPROBE_ADDR 0xffe0static struct net_device eth7_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };static struct net_device eth6_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð7_dev, ethif_probe };static struct net_device eth5_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð6_dev, ethif_probe };static struct net_device eth4_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð5_dev, ethif_probe };static struct net_device eth3_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð4_dev, ethif_probe };static struct net_device eth2_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð3_dev, ethif_probe };static struct net_device eth1_dev = { "eth%d", 0,0,0,0,ETH_NOPROBE_ADDR /* I/O base*/, 0,0,0,0, ð2_dev, ethif_probe };static struct net_device eth0_dev = { "eth%d", 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, ð1_dev, ethif_probe };# undef NEXT_DEV# define NEXT_DEV (ð0_dev)#ifdef CONFIG_TR/* Token-ring device probe */extern int ibmtr_probe(struct net_device *);extern int smctr_probe(struct net_device *);static inttrif_probe(struct net_device *dev){ if (1#ifdef CONFIG_IBMTR && ibmtr_probe(dev)#endif#ifdef CONFIG_SMCTR && smctr_probe(dev)#endif && 1 ) { return 1; /* -ENODEV or -EAGAIN would be more accurate. */ } return 0;}static struct net_device tr7_dev = { "tr%d",0,0,0,0,0,0,0,0,0, NEXT_DEV, trif_probe };static struct net_device tr6_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr7_dev, trif_probe };static struct net_device tr5_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr6_dev, trif_probe };static struct net_device tr4_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr5_dev, trif_probe };static struct net_device tr3_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr4_dev, trif_probe };static struct net_device tr2_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr3_dev, trif_probe };static struct net_device tr1_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr2_dev, trif_probe };static struct net_device tr0_dev = { "tr%d",0,0,0,0,0,0,0,0,0, &tr1_dev, trif_probe };# undef NEXT_DEV# define NEXT_DEV (&tr0_dev)#endif #ifdef CONFIG_FDDI static struct net_device fddi7_dev = {"fddi7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fddiif_probe}; static struct net_device fddi6_dev = {"fddi6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi7_dev, fddiif_probe}; static struct net_device fddi5_dev = {"fddi5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi6_dev, fddiif_probe}; static struct net_device fddi4_dev = {"fddi4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi5_dev, fddiif_probe}; static struct net_device fddi3_dev = {"fddi3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi4_dev, fddiif_probe}; static struct net_device fddi2_dev = {"fddi2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi3_dev, fddiif_probe}; static struct net_device fddi1_dev = {"fddi1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi2_dev, fddiif_probe}; static struct net_device fddi0_dev = {"fddi0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fddi1_dev, fddiif_probe};#undef NEXT_DEV#define NEXT_DEV (&fddi0_dev)#endif #ifdef CONFIG_NET_FC static struct net_device fc1_dev = { "fc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, fcif_probe}; static struct net_device fc0_dev = { "fc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &fc1_dev, fcif_probe};# undef NEXT_DEV# define NEXT_DEV (&fc0_dev)#endif#ifdef CONFIG_SBNI static struct net_device sbni7_dev = {"sbni7", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, sbni_probe}; static struct net_device sbni6_dev = {"sbni6", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni7_dev, sbni_probe}; static struct net_device sbni5_dev = {"sbni5", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni6_dev, sbni_probe}; static struct net_device sbni4_dev = {"sbni4", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni5_dev, sbni_probe}; static struct net_device sbni3_dev = {"sbni3", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni4_dev, sbni_probe}; static struct net_device sbni2_dev = {"sbni2", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni3_dev, sbni_probe}; static struct net_device sbni1_dev = {"sbni1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni2_dev, sbni_probe}; static struct net_device sbni0_dev = {"sbni0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &sbni1_dev, sbni_probe};#undef NEXT_DEV#define NEXT_DEV (&sbni0_dev)#endif /* * The loopback device is global so it can be directly referenced * by the network code. Also, it must be first on device list. */extern int loopback_init(struct net_device *dev);struct net_device loopback_dev = {"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};/* * The @dev_base list is protected by @dev_base_lock and the rtln * semaphore. * * Pure readers hold dev_base_lock for reading. * * Writers must hold the rtnl semaphore while they loop through the * dev_base list, and hold dev_base_lock for writing when they do the * actual updates. This allows pure readers to access the list even * while a writer is preparing to update it. * * To put it another way, dev_base_lock is held for writing only to * protect against pure readers; the rtnl semaphore provides the * protection against other writers. * * See, for example usages, register_netdevice() and * unregister_netdevice(), which must be called with the rtnl * semaphore held. */struct net_device *dev_base = &loopback_dev;rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -