root/net/inet/Space.c

/* [previous][next][first][last][top][bottom][index][help] */
   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   05/28/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 
  32 #define LOOPBACK                        /* always present, right?       */
  33 
  34 
  35 #define NEXT_DEV        NULL
  36 
  37 
  38 #ifdef D_LINK
  39     extern int d_link_init(struct device *);
  40     static struct device d_link_dev = {
  41         "dl0",
  42         0,
  43         0,
  44         0,
  45         0,
  46         D_LINK_IO,
  47         D_LINK_IRQ,
  48         0, 0, 0,
  49         NEXT_DEV,
  50         d_link_init
  51     };
  52 #   undef NEXT_DEV
  53 #   define NEXT_DEV     (&d_link_dev)
  54 #endif
  55 
  56 
  57 #ifdef EL1
  58 #   ifndef EL1_IRQ
  59 #       define EL1_IRQ 9
  60 #   endif
  61     extern int el1_init(struct device *);
  62     static struct device el1_dev = {
  63         "el0",
  64         0,
  65         0,
  66         0,
  67         0,
  68         EL1,
  69         EL1_IRQ,
  70         0, 0, 0,
  71         NEXT_DEV,
  72         el1_init
  73     };
  74 #   undef NEXT_DEV
  75 #   define NEXT_DEV     (&el1_dev)
  76 #endif  /* EL1 */
  77 
  78 #if defined(EI8390) || defined(EL2) || defined(NE2000) \
  79     || defined(WD80x3) || defined(HPLAN)
  80 #   ifndef EI8390
  81 #       define EI8390 0
  82 #   endif
  83 #   ifndef EI8390_IRQ
  84 #       define EI8390_IRQ 0
  85 #   endif
  86     extern int ethif_init(struct device *);
  87     static struct device ei8390_dev = {
  88         "eth0",
  89         0,                              /* auto-config                  */
  90         0,
  91         0,
  92         0,
  93         EI8390,
  94         EI8390_IRQ,
  95         0, 0, 0,
  96         NEXT_DEV,
  97         ethif_init
  98     };
  99 #   undef NEXT_DEV
 100 #   define NEXT_DEV     (&ei8390_dev)
 101 #endif  /* The EI8390 drivers. */
 102 
 103 #ifdef  PLIP
 104     extern int plip_init(struct device *);
 105     static struct device plip2_dev = {
 106         "plip2",
 107         0,
 108         0,
 109         0,
 110         0,
 111         0x278,
 112         2,
 113         0, 0, 0,
 114         NEXT_DEV,
 115         plip_init
 116     };
 117     static struct device plip1_dev = {
 118         "plip1",
 119         0,
 120         0,
 121         0,
 122         0,
 123         0x378,
 124         7,
 125         0, 0, 0,
 126         &plip2_dev,
 127         plip_init
 128     };
 129     static struct device plip0_dev = {
 130         "plip0",
 131         0,
 132         0,
 133         0,
 134         0,
 135         0x3BC,
 136         5,
 137         0, 0, 0,
 138         &plip1_dev,
 139         plip_init
 140     };
 141 #   undef NEXT_DEV
 142 #   define NEXT_DEV     (&plip0_dev)
 143 #endif  /* PLIP */
 144 
 145 
 146 #ifdef  SLIP
 147     extern int slip_init(struct device *);
 148     static struct device slip3_dev = {
 149         "sl3",                  /* Internal SLIP driver, channel 3      */
 150         0x0,                    /* recv memory end                      */
 151         0x0,                    /* recv memory start                    */
 152         0x0,                    /* memory end                           */
 153         0x0,                    /* memory start                         */
 154         0x3,                    /* base I/O address                     */
 155         0,                      /* IRQ                                  */
 156         0, 0, 0,                /* flags                                */
 157         NEXT_DEV,               /* next device                          */
 158         slip_init               /* slip_init should set up the rest     */
 159     };
 160     static struct device slip2_dev = {
 161         "sl2",                  /* Internal SLIP driver, channel 2      */
 162         0x0,                    /* recv memory end                      */
 163         0x0,                    /* recv memory start                    */
 164         0x0,                    /* memory end                           */
 165         0x0,                    /* memory start                         */
 166         0x2,                    /* base I/O address                     */
 167         0,                      /* IRQ                                  */
 168         0, 0, 0,                /* flags                                */
 169         &slip3_dev,             /* next device                          */
 170         slip_init               /* slip_init should set up the rest     */
 171     };
 172     static struct device slip1_dev = {
 173         "sl1",                  /* Internal SLIP driver, channel 1      */
 174         0x0,                    /* recv memory end                      */
 175         0x0,                    /* recv memory start                    */
 176         0x0,                    /* memory end                           */
 177         0x0,                    /* memory start                         */
 178         0x1,                    /* base I/O address                     */
 179         0,                      /* IRQ                                  */
 180         0, 0, 0,                /* flags                                */
 181         &slip2_dev,             /* next device                          */
 182         slip_init               /* slip_init should set up the rest     */
 183     };
 184     static struct device slip0_dev = {
 185         "sl0",                  /* Internal SLIP driver, channel 0      */
 186         0x0,                    /* recv memory end                      */
 187         0x0,                    /* recv memory start                    */
 188         0x0,                    /* memory end                           */
 189         0x0,                    /* memory start                         */
 190         0x0,                    /* base I/O address                     */
 191         0,                      /* IRQ                                  */
 192         0, 0, 0,                /* flags                                */
 193         &slip1_dev,             /* next device                          */
 194         slip_init               /* slip_init should set up the rest     */
 195     };
 196 #   undef       NEXT_DEV
 197 #   define      NEXT_DEV        (&slip0_dev)
 198 #endif  /* SLIP */
 199 
 200 
 201 #ifdef LOOPBACK
 202     extern int loopback_init(struct device *dev);
 203     static struct device loopback_dev = {
 204         "lo",                   /* Software Loopback interface          */
 205         0x0,                    /* recv memory end                      */
 206         0x0,                    /* recv memory start                    */
 207         0x0,                    /* memory end                           */
 208         0x0,                    /* memory start                         */
 209         0,                      /* base I/O address                     */
 210         0,                      /* IRQ                                  */
 211         0, 0, 0,                /* flags                                */
 212         NEXT_DEV,               /* next device                          */
 213         loopback_init           /* loopback_init should set up the rest */
 214     };
 215 #   undef       NEXT_DEV
 216 #   define      NEXT_DEV        (&loopback_dev)
 217 #endif
 218 
 219 
 220 struct device *dev_base = NEXT_DEV;

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