root/net/inet/Space.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ethif_probe

   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  * NOTE:        This file is a nice idea, but its current format does not work
   9  *              well for drivers that support multiple units, like the SLIP
  10  *              driver.  We should actually have only one pointer to a driver
  11  *              here, with the driver knowing how many units it supports.
  12  *              Currently, the SLIP driver abuses the "base_addr" integer
  13  *              field of the 'device' structure to store the unit number...
  14  *              -FvK
  15  *
  16  * Version:     @(#)Space.c     1.0.7   08/12/93
  17  *
  18  * Authors:     Ross Biro, <bir7@leland.Stanford.Edu>
  19  *              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  20  *              Donald J. Becker, <becker@super.org>
  21  *
  22  *              This program is free software; you can redistribute it and/or
  23  *              modify it under the terms of the GNU General Public License
  24  *              as published by the Free Software Foundation; either version
  25  *              2 of the License, or (at your option) any later version.
  26  */
  27 #include <linux/config.h>
  28 #include <linux/ddi.h>
  29 #include "dev.h"
  30 
  31 #define LOOPBACK                        /* always present, right?       */
  32 
  33 #define NEXT_DEV        NULL
  34 
  35 
  36 /* A unifed ethernet device probe.  This is the easiest way to have every
  37    ethernet adaptor have the name "eth[0123...]".
  38    */
  39 
  40 extern int wd_probe(struct device *dev);
  41 extern int el2_probe(struct device *dev);
  42 extern int ne_probe(struct device *dev);
  43 extern int hp_probe(struct device *dev);
  44 extern int znet_probe(struct device *);
  45 extern int express_probe(struct device *);
  46 extern int el3_probe(struct device *);
  47 extern int atp_probe(struct device *);
  48 extern int at1500_probe(struct device *);
  49 extern int depca_probe(struct device *);
  50 extern int el1_probe(struct device *);
  51 
  52 static int
  53 ethif_probe(struct device *dev)
     /* [previous][next][first][last][top][bottom][index][help] */
  54 {
  55     short base_addr = dev->base_addr;
  56 
  57     if (base_addr < 0  ||  base_addr == 1)
  58         return 1;               /* ENXIO */
  59 
  60     if (1
  61 #if defined(CONFIG_WD80x3) || defined(WD80x3)
  62         && wd_probe(dev)
  63 #endif
  64 #if defined(CONFIG_EL2) || defined(EL2)
  65         && el2_probe(dev)
  66 #endif
  67 #if defined(CONFIG_NE2000) || defined(NE2000)
  68         && ne_probe(dev)
  69 #endif
  70 #if defined(CONFIG_HPLAN) || defined(HPLAN)
  71         && hp_probe(dev)
  72 #endif
  73 #ifdef CONFIG_AT1500
  74         && at1500_probe(dev)
  75 #endif
  76 #ifdef CONFIG_EL3
  77         && el3_probe(dev)
  78 #endif
  79 #ifdef CONFIG_ZNET
  80         && znet_probe(dev)
  81 #endif
  82 #ifdef CONFIG_EEXPRESS
  83         && express_probe(dev)
  84 #endif
  85 #ifdef CONFIG_ATP               /* AT-LAN-TEC (RealTek) pocket adaptor. */
  86         && atp_probe(dev)
  87 #endif
  88 #ifdef CONFIG_DEPCA
  89         && depca_probe(dev)
  90 #endif
  91 #ifdef CONFIG_EL1
  92         && el1_probe(dev)
  93 #endif
  94         && 1 ) {
  95         return 1;       /* -ENODEV or -EAGAIN would be more accurate. */
  96     }
  97     return 0;
  98 }
  99 
 100 
 101 /* This remains seperate because it requires the addr and IRQ to be
 102    set. */
 103 #if defined(D_LINK) || defined(CONFIG_DE600)
 104     extern int d_link_init(struct device *);
 105     static struct device d_link_dev = {
 106         "dl0",
 107         0,
 108         0,
 109         0,
 110         0,
 111         D_LINK_IO,
 112         D_LINK_IRQ,
 113         0, 0, 0,
 114         NEXT_DEV,
 115         d_link_init
 116     };
 117 #   undef NEXT_DEV
 118 #   define NEXT_DEV     (&d_link_dev)
 119 #endif
 120 
 121 /* The first device defaults to I/O base '0', which means autoprobe. */
 122 #ifdef EI8390
 123 # define ETH0_ADDR EI8390
 124 #else
 125 # define ETH0_ADDR 0
 126 #endif
 127 #ifdef EI8390_IRQ
 128 # define ETH0_IRQ EI8390_IRQ
 129 #else
 130 # define ETH0_IRQ 0
 131 #endif
 132 /* "eth0" defaults to autoprobe, other use a base of "-0x20", "don't probe".
 133    Enable these with boot-time setup. 0.99pl13+ can optionally autoprobe. */
 134 
 135 static struct device eth3_dev = {
 136     "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
 137 static struct device eth2_dev = {
 138     "eth2", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
 139 static struct device eth1_dev = {
 140     "eth1", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth2_dev, ethif_probe };
 141 
 142 static struct device eth0_dev = {
 143     "eth0", 0, 0, 0, 0, ETH0_ADDR, ETH0_IRQ, 0, 0, 0, &eth1_dev, ethif_probe };
 144 
 145 #   undef NEXT_DEV
 146 #   define NEXT_DEV     (&eth0_dev)
 147 
 148 #if defined(PLIP) || defined(CONFIG_PLIP)
 149     extern int plip_init(struct device *);
 150     static struct device plip2_dev = {
 151         "plip2", 0, 0, 0, 0, 0x278, 2, 0, 0, 0, NEXT_DEV, plip_init, };
 152     static struct device plip1_dev = {
 153         "plip1", 0, 0, 0, 0, 0x378, 7, 0, 0, 0, &plip2_dev, plip_init, };
 154     static struct device plip0_dev = {
 155         "plip0", 0, 0, 0, 0, 0x3BC, 5, 0, 0, 0, &plip1_dev, plip_init, };
 156 #   undef NEXT_DEV
 157 #   define NEXT_DEV     (&plip0_dev)
 158 #endif  /* PLIP */
 159 
 160 #if defined(SLIP) || defined(CONFIG_SLIP)
 161     extern int slip_init(struct device *);
 162     static struct device slip3_dev = {
 163         "sl3",                  /* Internal SLIP driver, channel 3      */
 164         0x0,                    /* recv memory end                      */
 165         0x0,                    /* recv memory start                    */
 166         0x0,                    /* memory end                           */
 167         0x0,                    /* memory start                         */
 168         0x3,                    /* base I/O address                     */
 169         0,                      /* IRQ                                  */
 170         0, 0, 0,                /* flags                                */
 171         NEXT_DEV,               /* next device                          */
 172         slip_init               /* slip_init should set up the rest     */
 173     };
 174     static struct device slip2_dev = {
 175         "sl2",                  /* Internal SLIP driver, channel 2      */
 176         0x0,                    /* recv memory end                      */
 177         0x0,                    /* recv memory start                    */
 178         0x0,                    /* memory end                           */
 179         0x0,                    /* memory start                         */
 180         0x2,                    /* base I/O address                     */
 181         0,                      /* IRQ                                  */
 182         0, 0, 0,                /* flags                                */
 183         &slip3_dev,             /* next device                          */
 184         slip_init               /* slip_init should set up the rest     */
 185     };
 186     static struct device slip1_dev = {
 187         "sl1",                  /* Internal SLIP driver, channel 1      */
 188         0x0,                    /* recv memory end                      */
 189         0x0,                    /* recv memory start                    */
 190         0x0,                    /* memory end                           */
 191         0x0,                    /* memory start                         */
 192         0x1,                    /* base I/O address                     */
 193         0,                      /* IRQ                                  */
 194         0, 0, 0,                /* flags                                */
 195         &slip2_dev,             /* next device                          */
 196         slip_init               /* slip_init should set up the rest     */
 197     };
 198     static struct device slip0_dev = {
 199         "sl0",                  /* Internal SLIP driver, channel 0      */
 200         0x0,                    /* recv memory end                      */
 201         0x0,                    /* recv memory start                    */
 202         0x0,                    /* memory end                           */
 203         0x0,                    /* memory start                         */
 204         0x0,                    /* base I/O address                     */
 205         0,                      /* IRQ                                  */
 206         0, 0, 0,                /* flags                                */
 207         &slip1_dev,             /* next device                          */
 208         slip_init               /* slip_init should set up the rest     */
 209     };
 210 #   undef       NEXT_DEV
 211 #   define      NEXT_DEV        (&slip0_dev)
 212 #endif  /* SLIP */
 213 
 214 
 215 #ifdef LOOPBACK
 216     extern int loopback_init(struct device *dev);
 217     static struct device loopback_dev = {
 218         "lo",                   /* Software Loopback interface          */
 219         0x0,                    /* recv memory end                      */
 220         0x0,                    /* recv memory start                    */
 221         0x0,                    /* memory end                           */
 222         0x0,                    /* memory start                         */
 223         0,                      /* base I/O address                     */
 224         0,                      /* IRQ                                  */
 225         0, 0, 0,                /* flags                                */
 226         NEXT_DEV,               /* next device                          */
 227         loopback_init           /* loopback_init should set up the rest */
 228     };
 229 #   undef       NEXT_DEV
 230 #   define      NEXT_DEV        (&loopback_dev)
 231 #endif
 232 
 233 
 234 struct device *dev_base = NEXT_DEV;

/* [previous][next][first][last][top][bottom][index][help] */