linux-bk/drivers/net/Space.c
<<
>>
Prefs
   1/*
   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 *              Paul Gortmaker (03/2002)
  16                - struct init cleanup, enable multiple ISA autoprobes.
  17 *              Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 09/1999
  18 *              - fix sbni: s/device/net_device/
  19 *              Paul Gortmaker (06/98): 
  20 *               - sort probes in a sane way, make sure all (safe) probes
  21 *                 get run once & failed autoprobes don't autoprobe again.
  22 *
  23 *      FIXME:
  24 *              Phase out placeholder dev entries put in the linked list
  25 *              here in favour of drivers using init_etherdev(NULL, ...)
  26 *              combined with a single find_all_devs() function (for 2.3)
  27 *
  28 *              This program is free software; you can redistribute it and/or
  29 *              modify it under the terms of the GNU General Public License
  30 *              as published by the Free Software Foundation; either version
  31 *              2 of the License, or (at your option) any later version.
  32 */
  33#include <linux/config.h>
  34#include <linux/netdevice.h>
  35#include <linux/errno.h>
  36#include <linux/init.h>
  37#include <linux/netlink.h>
  38#include <linux/divert.h>
  39
  40#define NEXT_DEV        NULL
  41
  42
  43/* A unified ethernet device probe.  This is the easiest way to have every
  44   ethernet adaptor have the name "eth[0123...]".
  45   */
  46
  47extern int ne2_probe(struct net_device *dev);
  48extern int hp100_probe(struct net_device *dev);
  49extern int ultra_probe(struct net_device *dev);
  50extern int ultra32_probe(struct net_device *dev);
  51extern int ultramca_probe(struct net_device *dev);
  52extern int wd_probe(struct net_device *dev);
  53extern int el2_probe(struct net_device *dev);
  54extern int ne_probe(struct net_device *dev);
  55extern int hp_probe(struct net_device *dev);
  56extern int hp_plus_probe(struct net_device *dev);
  57extern int znet_probe(struct net_device *);
  58extern int express_probe(struct net_device *);
  59extern int eepro_probe(struct net_device *);
  60extern int el3_probe(struct net_device *);
  61extern int at1500_probe(struct net_device *);
  62extern int at1700_probe(struct net_device *);
  63extern int fmv18x_probe(struct net_device *);
  64extern int eth16i_probe(struct net_device *);
  65extern int depca_probe(struct net_device *);
  66extern int i82596_probe(struct net_device *);
  67extern int ewrk3_probe(struct net_device *);
  68extern int de4x5_probe(struct net_device *);
  69extern int el1_probe(struct net_device *);
  70extern int wavelan_probe(struct net_device *);
  71extern int arlan_probe(struct net_device *);
  72extern int el16_probe(struct net_device *);
  73extern int elmc_probe(struct net_device *);
  74extern int skmca_probe(struct net_device *);
  75extern int elplus_probe(struct net_device *);
  76extern int ac3200_probe(struct net_device *);
  77extern int es_probe(struct net_device *);
  78extern int lne390_probe(struct net_device *);
  79extern int ne3210_probe(struct net_device *);
  80extern int e2100_probe(struct net_device *);
  81extern int ni5010_probe(struct net_device *);
  82extern int ni52_probe(struct net_device *);
  83extern int ni65_probe(struct net_device *);
  84extern int sonic_probe(struct net_device *);
  85extern int SK_init(struct net_device *);
  86extern int seeq8005_probe(struct net_device *);
  87extern int smc_init( struct net_device * );
  88extern int sgiseeq_probe(struct net_device *);
  89extern int atarilance_probe(struct net_device *);
  90extern int sun3lance_probe(struct net_device *);
  91extern int sun3_82586_probe(struct net_device *);
  92extern int apne_probe(struct net_device *);
  93extern int bionet_probe(struct net_device *);
  94extern int pamsnet_probe(struct net_device *);
  95extern int cs89x0_probe(struct net_device *dev);
  96extern int ethertap_probe(struct net_device *dev);
  97extern int hplance_probe(struct net_device *dev);
  98extern int bagetlance_probe(struct net_device *);
  99extern int mvme147lance_probe(struct net_device *dev);
 100extern int tc515_probe(struct net_device *dev);
 101extern int lance_probe(struct net_device *dev);
 102extern int mace_probe(struct net_device *dev);
 103extern int macsonic_probe(struct net_device *dev);
 104extern int mac8390_probe(struct net_device *dev);
 105extern int mac89x0_probe(struct net_device *dev);
 106extern int mc32_probe(struct net_device *dev);
 107  
 108/* Detachable devices ("pocket adaptors") */
 109extern int de600_probe(struct net_device *);
 110extern int de620_probe(struct net_device *);
 111
 112/* FDDI adapters */
 113extern int skfp_probe(struct net_device *dev);
 114
 115/* Fibre Channel adapters */
 116extern int iph5526_probe(struct net_device *dev);
 117
 118/* SBNI adapters */
 119extern int sbni_probe(struct net_device *);
 120
 121struct devprobe
 122{
 123        int (*probe)(struct net_device *dev);
 124        int status;     /* non-zero if autoprobe has failed */
 125};
 126
 127/*
 128 * probe_list walks a list of probe functions and calls each so long
 129 * as a non-zero ioaddr is given, or as long as it hasn't already failed 
 130 * to find a card in the past (as recorded by "status") when asked to
 131 * autoprobe (i.e. a probe that fails to find a card when autoprobing
 132 * will not be asked to autoprobe again).  It exits when a card is found.
 133 */
 134static int __init probe_list(struct net_device *dev, struct devprobe *plist)
 135{
 136        struct devprobe *p = plist;
 137        unsigned long base_addr = dev->base_addr;
 138#ifdef CONFIG_NET_DIVERT
 139        int ret;
 140#endif /* CONFIG_NET_DIVERT */
 141
 142        while (p->probe != NULL) {
 143                if (base_addr && p->probe(dev) == 0) {  /* probe given addr */
 144#ifdef CONFIG_NET_DIVERT
 145                        ret = alloc_divert_blk(dev);
 146                        if (ret)
 147                                return ret;
 148#endif /* CONFIG_NET_DIVERT */
 149                        return 0;
 150                } else if (p->status == 0) {            /* has autoprobe failed yet? */
 151                        p->status = p->probe(dev);      /* no, try autoprobe */
 152                        if (p->status == 0) {
 153#ifdef CONFIG_NET_DIVERT
 154                                ret = alloc_divert_blk(dev);
 155                                if (ret)
 156                                        return ret;
 157#endif /* CONFIG_NET_DIVERT */
 158                                return 0;
 159                        }
 160                }
 161                p++;
 162        }
 163        return -ENODEV;
 164}
 165
 166/*
 167 * This is a bit of an artificial separation as there are PCI drivers
 168 * that also probe for EISA cards (in the PCI group) and there are ISA
 169 * drivers that probe for EISA cards (in the ISA group).  These are the
 170 * EISA only driver probes, and also the legacy PCI probes
 171 */
 172static struct devprobe eisa_probes[] __initdata = {
 173#ifdef CONFIG_DE4X5             /* DEC DE425, DE434, DE435 adapters */
 174        {de4x5_probe, 0},
 175#endif
 176#ifdef CONFIG_ULTRA32 
 177        {ultra32_probe, 0},     
 178#endif
 179#ifdef CONFIG_AC3200    
 180        {ac3200_probe, 0},
 181#endif
 182#ifdef CONFIG_ES3210
 183        {es_probe, 0},
 184#endif
 185#ifdef CONFIG_LNE390
 186        {lne390_probe, 0},
 187#endif
 188#ifdef CONFIG_NE3210
 189        {ne3210_probe, 0},
 190#endif
 191        {NULL, 0},
 192};
 193
 194
 195static struct devprobe mca_probes[] __initdata = {
 196#ifdef CONFIG_ULTRAMCA 
 197        {ultramca_probe, 0},
 198#endif
 199#ifdef CONFIG_NE2_MCA
 200        {ne2_probe, 0},
 201#endif
 202#ifdef CONFIG_ELMC              /* 3c523 */
 203        {elmc_probe, 0},
 204#endif
 205#ifdef CONFIG_ELMC_II           /* 3c527 */
 206        {mc32_probe, 0},
 207#endif
 208#ifdef CONFIG_SKMC              /* SKnet Microchannel */
 209        {skmca_probe, 0},
 210#endif
 211        {NULL, 0},
 212};
 213
 214/*
 215 * ISA probes that touch addresses < 0x400 (including those that also
 216 * look for EISA/PCI/MCA cards in addition to ISA cards).
 217 */
 218static struct devprobe isa_probes[] __initdata = {
 219#ifdef CONFIG_EL3               /* ISA, EISA, MCA 3c5x9 */
 220        {el3_probe, 0},
 221#endif
 222#ifdef CONFIG_HP100             /* ISA, EISA & PCI */
 223        {hp100_probe, 0},
 224#endif  
 225#ifdef CONFIG_3C515
 226        {tc515_probe, 0},
 227#endif
 228#ifdef CONFIG_ULTRA 
 229        {ultra_probe, 0},
 230#endif
 231#ifdef CONFIG_WD80x3 
 232        {wd_probe, 0},
 233#endif
 234#ifdef CONFIG_EL2               /* 3c503 */
 235        {el2_probe, 0},
 236#endif
 237#ifdef CONFIG_HPLAN
 238        {hp_probe, 0},
 239#endif
 240#ifdef CONFIG_HPLAN_PLUS
 241        {hp_plus_probe, 0},
 242#endif
 243#ifdef CONFIG_E2100             /* Cabletron E21xx series. */
 244        {e2100_probe, 0},
 245#endif
 246#ifdef CONFIG_NE2000            /* ISA (use ne2k-pci for PCI cards) */
 247        {ne_probe, 0},
 248#endif
 249#ifdef CONFIG_LANCE             /* ISA/VLB (use pcnet32 for PCI cards) */
 250        {lance_probe, 0},
 251#endif
 252#ifdef CONFIG_SMC9194
 253        {smc_init, 0},
 254#endif
 255#ifdef CONFIG_SEEQ8005 
 256        {seeq8005_probe, 0},
 257#endif
 258#ifdef CONFIG_AT1500
 259        {at1500_probe, 0},
 260#endif
 261#ifdef CONFIG_CS89x0
 262        {cs89x0_probe, 0},
 263#endif
 264#ifdef CONFIG_AT1700
 265        {at1700_probe, 0},
 266#endif
 267#ifdef CONFIG_FMV18X            /* Fujitsu FMV-181/182 */
 268        {fmv18x_probe, 0},
 269#endif
 270#ifdef CONFIG_ETH16I
 271        {eth16i_probe, 0},      /* ICL EtherTeam 16i/32 */
 272#endif
 273#ifdef CONFIG_ZNET              /* Zenith Z-Note and some IBM Thinkpads. */
 274        {znet_probe, 0},
 275#endif
 276#ifdef CONFIG_EEXPRESS          /* Intel EtherExpress */
 277        {express_probe, 0},
 278#endif
 279#ifdef CONFIG_EEXPRESS_PRO      /* Intel EtherExpress Pro/10 */
 280        {eepro_probe, 0},
 281#endif
 282#ifdef CONFIG_DEPCA             /* DEC DEPCA */
 283        {depca_probe, 0},
 284#endif
 285#ifdef CONFIG_EWRK3             /* DEC EtherWORKS 3 */
 286        {ewrk3_probe, 0},
 287#endif
 288#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET)      /* Intel I82596 */
 289        {i82596_probe, 0},
 290#endif
 291#ifdef CONFIG_EL1               /* 3c501 */
 292        {el1_probe, 0},
 293#endif
 294#ifdef CONFIG_WAVELAN           /* WaveLAN */
 295        {wavelan_probe, 0},
 296#endif
 297#ifdef CONFIG_ARLAN             /* Aironet */
 298        {arlan_probe, 0},
 299#endif
 300#ifdef CONFIG_EL16              /* 3c507 */
 301        {el16_probe, 0},
 302#endif
 303#ifdef CONFIG_ELPLUS            /* 3c505 */
 304        {elplus_probe, 0},
 305#endif
 306#ifdef CONFIG_SK_G16
 307        {SK_init, 0},
 308#endif
 309#ifdef CONFIG_NI5010
 310        {ni5010_probe, 0},
 311#endif
 312#ifdef CONFIG_NI52
 313        {ni52_probe, 0},
 314#endif
 315#ifdef CONFIG_NI65
 316        {ni65_probe, 0},
 317#endif
 318        {NULL, 0},
 319};
 320
 321static struct devprobe parport_probes[] __initdata = {
 322#ifdef CONFIG_DE600             /* D-Link DE-600 adapter */
 323        {de600_probe, 0},
 324#endif
 325#ifdef CONFIG_DE620             /* D-Link DE-620 adapter */
 326        {de620_probe, 0},
 327#endif
 328        {NULL, 0},
 329};
 330
 331static struct devprobe m68k_probes[] __initdata = {
 332#ifdef CONFIG_ATARILANCE        /* Lance-based Atari ethernet boards */
 333        {atarilance_probe, 0},
 334#endif
 335#ifdef CONFIG_SUN3LANCE         /* sun3 onboard Lance chip */
 336        {sun3lance_probe, 0},
 337#endif
 338#ifdef CONFIG_SUN3_82586        /* sun3 onboard Intel 82586 chip */
 339        {sun3_82586_probe, 0},
 340#endif
 341#ifdef CONFIG_APNE              /* A1200 PCMCIA NE2000 */
 342        {apne_probe, 0},
 343#endif
 344#ifdef CONFIG_ATARI_BIONET      /* Atari Bionet Ethernet board */
 345        {bionet_probe, 0},
 346#endif
 347#ifdef CONFIG_ATARI_PAMSNET     /* Atari PAMsNet Ethernet board */
 348        {pamsnet_probe, 0},
 349#endif
 350#ifdef CONFIG_HPLANCE           /* HP300 internal Ethernet */
 351        {hplance_probe, 0},
 352#endif
 353#ifdef CONFIG_MVME147_NET       /* MVME147 internal Ethernet */
 354        {mvme147lance_probe, 0},
 355#endif
 356#ifdef CONFIG_MACMACE           /* Mac 68k Quadra AV builtin Ethernet */
 357        {mace_probe, 0},
 358#endif
 359#ifdef CONFIG_MACSONIC          /* Mac SONIC-based Ethernet of all sorts */ 
 360        {macsonic_probe, 0},
 361#endif
 362#ifdef CONFIG_MAC8390           /* NuBus NS8390-based cards */
 363        {mac8390_probe, 0},
 364#endif
 365#ifdef CONFIG_MAC89x0
 366        {mac89x0_probe, 0},
 367#endif
 368        {NULL, 0},
 369};
 370
 371
 372static struct devprobe sgi_probes[] __initdata = {
 373#ifdef CONFIG_SGISEEQ
 374        {sgiseeq_probe, 0},
 375#endif
 376        {NULL, 0},
 377};
 378
 379static struct devprobe mips_probes[] __initdata = {
 380#ifdef CONFIG_MIPS_JAZZ_SONIC
 381        {sonic_probe, 0},
 382#endif
 383#ifdef CONFIG_BAGETLANCE        /* Lance-based Baget ethernet boards */
 384        {bagetlance_probe, 0},
 385#endif
 386        {NULL, 0},
 387};
 388
 389/*
 390 * Unified ethernet device probe, segmented per architecture and
 391 * per bus interface. This drives the legacy devices only for now.
 392 */
 393 
 394static int __init ethif_probe(struct net_device *dev)
 395{
 396        unsigned long base_addr = dev->base_addr;
 397
 398        /* 
 399         * Backwards compatibility - historically an I/O base of 1 was 
 400         * used to indicate not to probe for this ethN interface 
 401         */
 402        if (base_addr == 1)
 403                return 1;               /* ENXIO */
 404
 405        /* 
 406         * The arch specific probes are 1st so that any on-board ethernet
 407         * will be probed before other ISA/EISA/MCA/PCI bus cards.
 408         */
 409        if (probe_list(dev, m68k_probes) == 0)
 410                return 0;
 411        if (probe_list(dev, mips_probes) == 0)
 412                return 0;
 413        if (probe_list(dev, sgi_probes) == 0)
 414                return 0;
 415        if (probe_list(dev, eisa_probes) == 0)
 416                return 0;
 417        if (probe_list(dev, mca_probes) == 0)
 418                return 0;
 419        if (probe_list(dev, isa_probes) == 0) 
 420                return 0;
 421        if (probe_list(dev, parport_probes) == 0)
 422                return 0;
 423        return -ENODEV;
 424}
 425
 426#ifdef CONFIG_FDDI
 427static int __init fddiif_probe(struct net_device *dev)
 428{
 429    unsigned long base_addr = dev->base_addr;
 430
 431    if (base_addr == 1)
 432            return 1;           /* ENXIO */
 433
 434    if (1
 435#ifdef CONFIG_APFDDI
 436        && apfddi_init(dev)
 437#endif
 438#ifdef CONFIG_SKFP
 439        && skfp_probe(dev)
 440#endif
 441        && 1 ) {
 442            return 1;   /* -ENODEV or -EAGAIN would be more accurate. */
 443    }
 444    return 0;
 445}
 446#endif
 447
 448
 449#ifdef CONFIG_NET_FC
 450static int fcif_probe(struct net_device *dev)
 451{
 452        if (dev->base_addr == -1)
 453                return 1;
 454
 455        if (1
 456#ifdef CONFIG_IPHASE5526
 457            && iph5526_probe(dev)
 458#endif
 459            && 1 ) {
 460                return 1; /* -ENODEV or -EAGAIN would be more accurate. */
 461        }
 462        return 0;
 463}
 464#endif  /* CONFIG_NET_FC */
 465
 466
 467#ifdef CONFIG_ETHERTAP
 468static struct net_device tap0_dev = {
 469        .name           = "tap0",
 470        .base_addr      = NETLINK_TAPBASE,
 471        .next           = NEXT_DEV,
 472        .init           = ethertap_probe,
 473};
 474#undef NEXT_DEV
 475#define NEXT_DEV        (&tap0_dev)
 476#endif
 477
 478#ifdef CONFIG_SDLA
 479extern int sdla_init(struct net_device *);
 480static struct net_device sdla0_dev = {
 481        .name           =  "sdla0",
 482        .next           =  NEXT_DEV,
 483        .init           =  sdla_init,
 484};
 485#undef NEXT_DEV
 486#define NEXT_DEV        (&sdla0_dev)
 487#endif
 488
 489#if defined(CONFIG_LTPC)
 490extern int ltpc_probe(struct net_device *);
 491static struct net_device dev_ltpc = {
 492        .name           = "lt0",
 493        .next           = NEXT_DEV,
 494        .init           = ltpc_probe
 495};
 496#undef NEXT_DEV
 497#define NEXT_DEV        (&dev_ltpc)
 498#endif  /* LTPC */
 499
 500#if defined(CONFIG_COPS)
 501extern int cops_probe(struct net_device *);
 502static struct net_device cops2_dev = {
 503        .name           = "lt2",
 504        .next           = NEXT_DEV,
 505        .init           = cops_probe,
 506};
 507static struct net_device cops1_dev = {
 508        .name           = "lt1",
 509        .next           = &cops2_dev,
 510        .init           = cops_probe,
 511};
 512static struct net_device cops0_dev = {
 513        .name           = "lt0",
 514        .next           = &cops1_dev,
 515        .init           = cops_probe,
 516};
 517#undef NEXT_DEV
 518#define NEXT_DEV     (&cops0_dev)
 519#endif  /* COPS */
 520
 521static struct net_device eth7_dev = {
 522        .name           = "eth%d",
 523        .next           = NEXT_DEV,
 524        .init           = ethif_probe,
 525};
 526static struct net_device eth6_dev = {
 527        .name           = "eth%d",
 528        .next           = &eth7_dev,
 529        .init           = ethif_probe,
 530};
 531static struct net_device eth5_dev = {
 532        .name           = "eth%d",
 533        .next           = &eth6_dev,
 534        .init           = ethif_probe,
 535};
 536static struct net_device eth4_dev = {
 537        .name           = "eth%d",
 538        .next           = &eth5_dev,
 539        .init           = ethif_probe,
 540};
 541static struct net_device eth3_dev = {
 542        .name           = "eth%d",
 543        .next           = &eth4_dev,
 544        .init           = ethif_probe,
 545};
 546static struct net_device eth2_dev = {
 547        .name           = "eth%d",
 548        .next           = &eth3_dev,
 549        .init           = ethif_probe,
 550};
 551static struct net_device eth1_dev = {
 552        .name           = "eth%d",
 553        .next           = &eth2_dev,
 554        .init           = ethif_probe,
 555};
 556static struct net_device eth0_dev = {
 557        .name           = "eth%d",
 558        .next           = &eth1_dev,
 559        .init           = ethif_probe,
 560};
 561
 562#undef NEXT_DEV
 563#define NEXT_DEV        (&eth0_dev)
 564
 565
 566
 567#ifdef CONFIG_TR
 568/* Token-ring device probe */
 569extern int ibmtr_probe(struct net_device *);
 570extern int smctr_probe(struct net_device *);
 571
 572static int
 573trif_probe(struct net_device *dev)
 574{
 575    if (1
 576#ifdef CONFIG_IBMTR
 577        && ibmtr_probe(dev)
 578#endif
 579#ifdef CONFIG_SMCTR
 580        && smctr_probe(dev)
 581#endif
 582        && 1 ) {
 583        return 1;       /* -ENODEV or -EAGAIN would be more accurate. */
 584    }
 585    return 0;
 586}
 587static struct net_device tr7_dev = {
 588        .name           = "tr%d",
 589        .next           = NEXT_DEV,
 590        .init           = trif_probe,
 591};
 592static struct net_device tr6_dev = {
 593        .name           = "tr%d",
 594        .next           = &tr7_dev,
 595        .init           = trif_probe,
 596};
 597static struct net_device tr5_dev = {
 598        .name           = "tr%d",
 599        .next           = &tr6_dev,
 600        .init           = trif_probe,
 601};
 602static struct net_device tr4_dev = {
 603        .name           = "tr%d",
 604        .next           = &tr5_dev,
 605        .init           = trif_probe,
 606};
 607static struct net_device tr3_dev = {
 608        .name           = "tr%d",
 609        .next           = &tr4_dev,
 610        .init           = trif_probe,
 611};
 612static struct net_device tr2_dev = {
 613        .name           = "tr%d",
 614        .next           = &tr3_dev,
 615        .init           = trif_probe,
 616};
 617static struct net_device tr1_dev = {
 618        .name           = "tr%d",
 619        .next           = &tr2_dev,
 620        .init           = trif_probe,
 621};
 622static struct net_device tr0_dev = {
 623        .name           = "tr%d",
 624        .next           = &tr1_dev,
 625        .init           = trif_probe,
 626};
 627#undef       NEXT_DEV
 628#define      NEXT_DEV        (&tr0_dev)
 629
 630#endif 
 631
 632#ifdef CONFIG_FDDI
 633static struct net_device fddi7_dev = {
 634        .name           = "fddi7",
 635        .next           =  NEXT_DEV,
 636        .init           = fddiif_probe
 637};
 638static struct net_device fddi6_dev = {
 639        .name           = "fddi6",
 640        .next           = &fddi7_dev,
 641        .init           = fddiif_probe
 642};
 643static struct net_device fddi5_dev = {
 644        .name           = "fddi5",
 645        .next           = &fddi6_dev,
 646        .init           = fddiif_probe
 647};
 648static struct net_device fddi4_dev = {
 649        .name           = "fddi4",
 650        .next           = &fddi5_dev,
 651        .init           = fddiif_probe
 652};
 653static struct net_device fddi3_dev = {
 654        .name           = "fddi3",
 655        .next           = &fddi4_dev,
 656        .init           = fddiif_probe
 657};
 658static struct net_device fddi2_dev = {
 659        .name           = "fddi2",
 660        .next           = &fddi3_dev,
 661        .init           = fddiif_probe
 662};
 663static struct net_device fddi1_dev = {
 664        .name           = "fddi1",
 665        .next           = &fddi2_dev,
 666        .init           = fddiif_probe
 667};
 668static struct net_device fddi0_dev = {
 669        .name           = "fddi0",
 670        .next           = &fddi1_dev,
 671        .init           = fddiif_probe
 672};
 673#undef  NEXT_DEV
 674#define NEXT_DEV        (&fddi0_dev)
 675#endif 
 676
 677
 678#ifdef CONFIG_NET_FC
 679static struct net_device fc1_dev = {
 680        .name           = "fc1",
 681        .next           = NEXT_DEV,
 682        .init           = fcif_probe
 683};
 684static struct net_device fc0_dev = {
 685        .name           = "fc0",
 686        .next           =  &fc1_dev,
 687        .init           = fcif_probe
 688};
 689#undef       NEXT_DEV
 690#define      NEXT_DEV        (&fc0_dev)
 691#endif
 692
 693
 694#ifdef CONFIG_SBNI
 695static struct net_device sbni7_dev = {
 696        .name           = "sbni7",
 697        .next           = NEXT_DEV,
 698        .init           = sbni_probe,
 699};
 700static struct net_device sbni6_dev = {
 701        .name           = "sbni6",
 702        .next           = &sbni7_dev,
 703        .init           = sbni_probe,
 704};
 705static struct net_device sbni5_dev = {
 706        .name           = "sbni5",
 707        .next           = &sbni6_dev,
 708        .init           = sbni_probe,
 709};
 710static struct net_device sbni4_dev = {
 711        .name           = "sbni4",
 712        .next           = &sbni5_dev,
 713        .init           = sbni_probe,
 714};
 715static struct net_device sbni3_dev = {
 716        .name           = "sbni3",
 717        .next           = &sbni4_dev,
 718        .init           = sbni_probe,
 719};
 720static struct net_device sbni2_dev = {
 721        .name           = "sbni2",
 722        .next           = &sbni3_dev,
 723        .init           = sbni_probe,
 724};
 725static struct net_device sbni1_dev = {
 726        .name           = "sbni1",
 727        .next           = &sbni2_dev,
 728        .init           = sbni_probe,
 729};
 730static struct net_device sbni0_dev = {
 731        .name           = "sbni0",
 732        .next           = &sbni1_dev,
 733        .init           = sbni_probe,
 734};
 735
 736#undef  NEXT_DEV
 737#define NEXT_DEV        (&sbni0_dev)
 738#endif 
 739        
 740/*
 741 *      The loopback device is global so it can be directly referenced
 742 *      by the network code. Also, it must be first on device list.
 743 */
 744
 745extern int loopback_init(struct net_device *dev);
 746struct net_device loopback_dev = {
 747        .name           = "lo",
 748        .next           = NEXT_DEV,
 749        .init           = loopback_init
 750};
 751
 752/*
 753 * The @dev_base list is protected by @dev_base_lock and the rtln
 754 * semaphore.
 755 *
 756 * Pure readers hold dev_base_lock for reading.
 757 *
 758 * Writers must hold the rtnl semaphore while they loop through the
 759 * dev_base list, and hold dev_base_lock for writing when they do the
 760 * actual updates.  This allows pure readers to access the list even
 761 * while a writer is preparing to update it.
 762 *
 763 * To put it another way, dev_base_lock is held for writing only to
 764 * protect against pure readers; the rtnl semaphore provides the
 765 * protection against other writers.
 766 *
 767 * See, for example usages, register_netdevice() and
 768 * unregister_netdevice(), which must be called with the rtnl
 769 * semaphore held.
 770 */
 771struct net_device *dev_base = &loopback_dev;
 772rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
 773
 774
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.