# 2.11BSD#431 - /usr/src/sys/pdpif/if_de.h

##### Macros

    COUNTER_OFFSET    X
    DSF_LOCK          X
    DSF_RUNNING       X
    DSF_SETADDR       X
    INCORE_BASE       X
    INCORE_SIZE       X
    LVAL_OFF          X
    MULTISIZE         X
    MULTI_OFFSET      X
    NMULTI            X
    NRCV              X
    NXMT              X
    PCBB_OFFSET       X
    RRENT_OFFSET      X
    RVAL_OFF          X
    SIOCADDMULTI      X
    SIOCDELMULTI      X
    SIOCDISABLBACK    X
    SIOCENABLBACK     X
    SIOCRDCTRS        X
    SIOCRDZCTRS       X
    SIOCRPHYSADDR     X
    SIOCSPHYSADDR     X
    UDBBUF_OFFSET     X
    XRENT_OFFSET      X
    ds_addr           X
    ds_if             X

##### struct's

    de_m_add          X
    de_softc          X
    deuba             X

       1: /*
       2:  * SCCSID: @(#)if_de.h	1.1	(2.11BSD GTE)	12/31/93
       3:  */
       4:
       5: /* Header files and definitons to support multiple DEUNAs */
       6:
       7: #include "socket.h"
       8: #include "../net/if.h"
       9: #include "../net/netisr.h"
      10: #include "../net/route.h"
      11:
      12: #ifdef INET
      13: #include "../netinet/in.h"
      14: #include "../netinet/in_systm.h"
      15: #include "../netinet/in_var.h"
      16: #include "../netinet/ip.h"
      17: #include "../netinet/if_ether.h"
      18: #endif		/* INET */
      19:
      20: #ifdef NS
      21: #include "../netns/ns.h"
      22: #include "../netns/ns_if.h"
      23: #endif		/* NS */
      24:
      25: #include "../pdpif/if_dereg.h"
      26: #include "../pdpuba/ubavar.h"
      27: #include "../pdpif/if_uba.h"
      28:
      29: /*
      30:  * These numbers are based on the amount of space that is allocated
      31:  * int netinit() to miobase, for 4 + 6, miosize must be 16384 instead
      32:  * of the 8192 allocated originally.  m_ioget() gets a click address
      33:  * within the allocated region.  NOTE: the UMR handling has been fixed
      34:  * in 2.11BSD to allocate only the number of UMRs required by the size
      35:  * of the m_ioget I/O region - a UMR per buffer is NO LONGER THE CASE!
      36:  * Note that the size of a buffer is:
      37:  * 1500 (ETHERMTU) + sizeof(ether_header) + some rounding from btoc() =
      38:  * 1536 bytes or 24 clicks.
      39:  */
      40:
      41: #define NXMT    4   /* number of transmit buffers */
      42: #define NRCV    6   /* number of receive buffers (must be > 1) */
      43:
      44: #ifdef  DE_DO_MULTI
      45: /*
      46:  * Multicast address list structure
      47:  */
      48: struct de_m_add {
      49:     u_char  dm_char[6];
      50: };
      51: #define MULTISIZE   sizeof(struct de_m_add)
      52: #define NMULTI      10  /* # of multicast addrs on the DEUNA */
      53: #endif		/* DE_DO_MULTI */
      54:
      55: /*
      56:  * The deuba structures generalizes the ifuba structure
      57:  * to an arbitrary number of receive and transmit buffers.
      58:  */
      59: struct  deuba {
      60:     u_short ifu_hlen;       /* local net header length */
      61:     struct  ifrw difu_r[NRCV];  /* receive information */
      62:     struct  ifrw difu_w[NXMT];  /* transmit information */
      63:     short   difu_flags;
      64: };
      65: /*
      66:  * Ethernet software status per interface.
      67:  *
      68:  * Each interface is referenced by a network interface structure,
      69:  * ds_if, which the routing code uses to locate the interface.
      70:  * This structure contains the output queue for the interface, its address, ...
      71:  * We also have, for each interface, a UBA interface structure, which
      72:  * contains information about the UNIBUS resources held by the interface:
      73:  * map registers, buffered data paths, etc.  Information is cached in this
      74:  * structure for use by the if_uba.c routines in running the interface
      75:  * efficiently.
      76:  */
      77: struct  de_softc {
      78:     struct  arpcom ds_ac;       /* Ethernet common part */
      79: #define ds_if   ds_ac.ac_if     /* network-visible interface */
      80: #define ds_addr ds_ac.ac_enaddr     /* hardware Ethernet address */
      81:     char    ds_flags;       /* Has the board be initialized? */
      82: #define DSF_LOCK    1
      83: #define DSF_RUNNING 2
      84: #define DSF_SETADDR 4
      85:     char    ds_devid;       /* device id DEUNA=0, DELUA=1 */
      86:     ubadr_t ds_ubaddr;      /* map info for incore structs */
      87:     struct  deuba ds_deuba;     /* unibus resource structure */
      88:     /* the following structures are always mapped in */
      89:     struct  de_pcbb ds_pcbb;    /* port control block */
      90:     struct  de_ring ds_xrent[NXMT]; /* transmit ring entrys */
      91:     struct  de_ring ds_rrent[NRCV]; /* receive ring entrys */
      92:     struct  de_udbbuf ds_udbbuf;    /* UNIBUS data buffer */
      93: #ifdef  DE_DO_MULTI
      94:     struct  de_m_add ds_multicast[NMULTI]; /* multicast addr list */
      95: #endif		/* DE_DO_MULTI */
      96:
      97: #ifdef  DE_DO_BCTRS
      98:     struct  de_counters ds_counters;/* counter block */
      99: #endif		/* DE_DO_BCTRS */
     100:
     101:     /* end mapped area */
     102: #define INCORE_BASE(p)  ((char *)&(p)->ds_pcbb)
     103: #define RVAL_OFF(n) ((char *)&de_softc[0].n - INCORE_BASE(&de_softc[0]))
     104: #define LVAL_OFF(n) ((char *)de_softc[0].n - INCORE_BASE(&de_softc[0]))
     105: #define PCBB_OFFSET RVAL_OFF(ds_pcbb)
     106: #define XRENT_OFFSET    LVAL_OFF(ds_xrent)
     107: #define RRENT_OFFSET    LVAL_OFF(ds_rrent)
     108: #define UDBBUF_OFFSET   RVAL_OFF(ds_udbbuf)
     109:
     110: #ifdef  DE_DO_MULTI
     111: #define MULTI_OFFSET    RVAL_OFF(ds_multicast[0])
     112: #endif		/* DE_DO_MULTI */
     113:
     114: #ifdef  DE_DO_BCTRS
     115: #define COUNTER_OFFSET  RVAL_OFF(ds_counters)
     116: #endif		/* DE_DO_BCTRS */
     117:
     118: #define INCORE_SIZE RVAL_OFF(ds_xindex)
     119:     u_char  ds_xindex;      /* UNA index into transmit chain */
     120:     u_char  ds_rindex;      /* UNA index into receive chain */
     121:     u_char  ds_xfree;       /* index for next transmit buffer */
     122:     u_char  ds_nxmit;       /* # of transmits in progress */
     123:
     124: #ifdef  DE_DO_MULTI
     125:     u_char  ds_muse[NMULTI];    /* multicast address use */
     126: #endif		/* DE_DO_MULTI */
     127:
     128: #ifdef  DE_DO_BCTRS
     129:     long    ds_ztime;       /* time counters were last zeroed */
     130:     u_short ds_unrecog;     /* unrecognized frame destination */
     131: #endif		/* DE_DO_BCTRS */
     132: };
     133:
     134: /*
     135:  * These are the Ultrix ioctl's that are specific to this driver
     136:  */
     137:
     138: #ifdef  DE_DO_PHYSADDR
     139: #define SIOCSPHYSADDR   _IOWR(i,23, struct ifreq)   /* Set phys. ad.*/
     140: #define SIOCRPHYSADDR   _IOWR(i,28, struct ifdevea) /* Read phy. ad.*/
     141: #endif		/* DE_DO_PHYSADDR */
     142:
     143: #ifdef  DE_DO_MULTI
     144: #define SIOCADDMULTI    _IOWR(i,24, struct ifreq)   /* Add m.c. ad. */
     145: #define SIOCDELMULTI    _IOWR(i,25, struct ifreq)   /* Dele. m.c.ad.*/
     146: #endif		/* DE_DO_MULTI */
     147:
     148: #ifdef  DE_DO_BCTRS
     149: #define SIOCRDCTRS  _IOWR(i,26, struct ctrreq)  /* Read if cntr.*/
     150: #define SIOCRDZCTRS _IOWR(i,27, struct ctrreq)  /* Read/0 if c. */
     151: #endif		/* DE_DO_BCTRS */
     152:
     153: #ifdef DE_INT_LOOPBACK
     154: #define SIOCDISABLBACK  _IOW(i,34, struct ifreq)    /* Cl.in.ex.lpb.*/
     155: #define SIOCENABLBACK   _IOW(i,33, struct ifreq)    /* Set in.ex.lb.*/
     156: #endif		/* DE_INT_LOOPBACK */

#### Defined struct's

de_m_add defined in line 48; used 2 times

- in line 94(2)

de_softc defined in line 77; used 24 times

- in /usr/src/sys/pdpif/if_de.c line 74(2), 173(2), 260(2), 389(2), 443(2), 563(2), 619(2), 760(2), 1066(2), 1309(2), 1354(2), 1389(2)

deuba defined in line 59; used 8 times

- in line 87(2)
- in /usr/src/sys/pdpif/if_de.c line 914(2), 968(2), 1039(2)

#### Defined macros

COUNTER_OFFSET defined in line 115; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 1177

DSF_LOCK defined in line 82; used 4 times

- in /usr/src/sys/pdpif/if_de.c line 394, 476, 537, 1262

DSF_RUNNING defined in line 83; used 14 times

- in /usr/src/sys/pdpif/if_de.c line 274, 364, 415, 430, 1101, 1119, 1161, 1181, 1258-1262(2), 1268, 1318, 1340, 1393

DSF_SETADDR defined in line 84; used 2 times

- in /usr/src/sys/pdpif/if_de.c line 366, 1399

INCORE_BASE defined in line 102; used 3 times

- in line 103-104(2)
- in /usr/src/sys/pdpif/if_de.c line 227

INCORE_SIZE defined in line 118; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 227

LVAL_OFF defined in line 104; used 2 times

- in line 106-107(2)

MULTISIZE defined in line 51; used 6 times

- in /usr/src/sys/pdpif/if_de.c line 218, 1135-1145(4), 1154

MULTI_OFFSET defined in line 111; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 1131

NMULTI defined in line 52; used 7 times

- in line 94, 125
- in /usr/src/sys/pdpif/if_de.c line 217, 1134, 1140, 1150, 1160

NRCV defined in line 42; used 7 times

- in line 61, 91
- in /usr/src/sys/pdpif/if_de.c line 321, 348, 607, 929, 948

NXMT defined in line 41; used 10 times

- in line 62, 90
- in /usr/src/sys/pdpif/if_de.c line 316, 341, 397, 410, 417, 534, 938, 951

PCBB_OFFSET defined in line 105; never used
RRENT_OFFSET defined in line 107; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 317

RVAL_OFF defined in line 103; used 5 times

- in line 105-118(5)

SIOCADDMULTI defined in line 144; never used
SIOCDELMULTI defined in line 145; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 1133

SIOCDISABLBACK defined in line 154; never used
SIOCENABLBACK defined in line 155; never used
SIOCRDCTRS defined in line 149; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 1176

SIOCRDZCTRS defined in line 150; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 1207

SIOCRPHYSADDR defined in line 140; never used
SIOCSPHYSADDR defined in line 139; never used
UDBBUF_OFFSET defined in line 108; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 307

XRENT_OFFSET defined in line 106; used 1 times

- in /usr/src/sys/pdpif/if_de.c line 312

ds_addr defined in line 80; used 12 times

- in /usr/src/sys/pdpif/if_de.c line 237-242(3), 367, 595, 874-875(2), 1111, 1121-1122(2), 1234, 1400

ds_if defined in line 79; used 19 times

- in /usr/src/sys/pdpif/if_de.c line 174, 264, 286, 361, 398, 496, 502, 513-521(4), 541, 570-573(2), 579, 675, 709, 716, 736

#### Usage of this include

if_de.h used 1 times

- in /usr/src/sys/pdpif/if_de.c line 56

Last modified: 1994-01-01 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 784 |