Annotation of 43BSDTahoe/sys/tahoeif/if_enpreg.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  *     @(#)if_enpreg.h 7.1 (Berkeley) 5/31/88
                      3:  */
                      4: 
                      5: /*     Copyright (c) 1984 by Communication Machinery Corporation
                      6:  *
                      7:  *     This file contains material which is proprietary to
                      8:  *     Communication Machinery Corporation (CMC) and which
                      9:  *     may not be divulged without the written permission
                     10:  *     of CMC.
                     11:  *
                     12:  *     ENP-10 Ram Definition
                     13:  *
                     14:  *     3/15/85 Jon Phares
                     15:  *     Update 7/10/85 S. Holmgren
                     16:  *     ENP-10 update 7/21/85 J. Mullen
                     17:  *     ENP-20 update 8/11/85 J. Mullen
                     18:  *     Mods for CCI TAHOE system 8/14/85 J. Mullen
                     19:  */
                     20: 
                     21: #define K              *1024
                     22: 
                     23: struct ether_addr {
                     24:        u_char ea_addr[6];
                     25: };
                     26: 
                     27: typedef struct ethlist {
                     28:        int     e_listsize;             /* active addr entries */
                     29:        struct  ether_addr e_baseaddr;  /* addr lance is working with */
                     30:        struct  ether_addr e_addrs[16]; /* possible addresses */
                     31: } ETHLIST;
                     32: 
                     33: typedef struct {
                     34:        u_long  e_xmit_successful;      /* Successful transmissions */
                     35:        u_long  e_mult_retry;           /* multiple retries on xmit */
                     36:        u_long  e_one_retry;            /* single retries */
                     37:        u_long  e_fail_retry;           /* too many retries */
                     38:        u_long  e_deferrals;            /* xmit delayed 'cuz cable busy */
                     39:        u_long  e_xmit_buff_err;        /* xmit data chaining failed --
                     40:                                                   "can't happen" */
                     41:        u_long  e_silo_underrun;        /* transmit data fetch failed */
                     42:        u_long  e_late_coll;            /* collision after xmit */
                     43:        u_long  e_lost_carrier;
                     44:        u_long  e_babble;               /* xmit length > 1518 */
                     45:        u_long  e_collision;
                     46:        u_long  e_xmit_mem_err;
                     47:        u_long  e_rcv_successful;       /* good receptions */
                     48:        u_long  e_rcv_missed;           /* no recv buff available */
                     49:        u_long  e_crc_err;              /* checksum failed */
                     50:        u_long  e_frame_err;            /* crc error & data length != 0 mod 8 */
                     51:        u_long  e_rcv_buff_err;         /* rcv data chain failure --
                     52:                                                   "can't happen" */
                     53:        u_long  e_silo_overrun;         /* receive data store failed */
                     54:        u_long  e_rcv_mem_err;
                     55: } ENPSTAT;
                     56: 
                     57: typedef struct RING {
                     58:        short   r_rdidx;
                     59:        short   r_wrtidx;
                     60:        short   r_size;
                     61:        short   r_pad;
                     62:        int     r_slot[1];
                     63: } RING;
                     64: 
                     65: typedef struct RING32 {
                     66:        short   r_rdidx;
                     67:        short   r_wrtidx;
                     68:        short   r_size;
                     69:        short   r_pad;                  /* to make VAXen happy */
                     70:        int     r_slot[32];
                     71: } RING32;
                     72: 
                     73: /*
                     74:  * ENP Ram data layout
                     75:  */
                     76: 
                     77: /*
                     78:  * Note: paged window (4 K) is identity mapped by ENP kernel to provide
                     79:  * 124 K contiguous RAM (as reflected in RAM_SIZE)
                     80:  */
                     81: #define RAM_WINDOW     (128 K)
                     82: #define IOACCESS_WINDOW (512)
                     83: #define FIXED_WINDOW   (RAM_WINDOW - IOACCESS_WINDOW)
                     84: #define RAMROM_SWAP    (4 K)
                     85: #define RAM_SIZE       (FIXED_WINDOW - RAMROM_SWAP)
                     86: 
                     87: #define HOST_RAMSIZE   (48 K)
                     88: #define ENP_RAMSIZE    (20 K)
                     89: 
                     90: typedef        struct iow20 {
                     91:        char    pad0;   
                     92:        char    hst2enp_interrupt;
                     93:        char    pad1[510];
                     94: } iow20;
                     95: 
                     96: struct enpdevice {
                     97: #ifdef notdef
                     98:        char    enp_ram_rom[4 K];
                     99: #endif notdef
                    100:        union {
                    101:                char    all_ram[RAM_SIZE];
                    102:                struct {
                    103:                        u_int   t_go;
                    104:                        u_int   t_pstart;
                    105:                } t;
                    106:                struct {
                    107:                        char    nram[RAM_SIZE - (HOST_RAMSIZE + ENP_RAMSIZE)];
                    108:                        char    hram[HOST_RAMSIZE];
                    109:                        char    kram[ENP_RAMSIZE];
                    110:                } u_ram;
                    111:                struct {
                    112:                        char    pad7[0x100];    /* starts 0x1100 - 0x2000 */
                    113:                        short   e_enpstate;     /* 1102 */
                    114:                        short   e_enpmode;      /* 1104 */
                    115:                        int     e_enpbase;      /* 1104 */
                    116:                        int     e_enprun;       /* 1108 */
                    117:                        u_short e_intrvec;
                    118:                        u_short e_dummy[3];
                    119:                        RING32  h_toenp;        /* 110C */
                    120:                        RING32  h_hostfree;             
                    121:                        RING32  e_tohost;               
                    122:                        RING32  e_enpfree;              
                    123:                        ENPSTAT e_stat;
                    124:                        ETHLIST e_netaddr;              
                    125:                } iface;
                    126:        } enp_u;
                    127:        iow20   enp_iow;
                    128: };
                    129: 
                    130: #define        enp_ram         enp_u.all_ram
                    131: #define        enp_nram        enp_u.u_ram.nram
                    132: #define        enp_hram        enp_u.u_ram.hram
                    133: #define        enp_kram        enp_u.u_ram.kram
                    134: #define        enp_go          enp_u.t.t_go
                    135: #define        enp_prog_start  enp_u.t.t_pstart
                    136: #define        enp_intrvec     enp_u.iface.e_intrvec
                    137: #define enp_state      enp_u.iface.e_enpstate
                    138: #define enp_mode       enp_u.iface.e_enpmode
                    139: #define enp_base       enp_u.iface.e_enpbase
                    140: #define enp_enprun     enp_u.iface.e_enprun
                    141: #define enp_toenp      enp_u.iface.h_toenp
                    142: #define enp_hostfree   enp_u.iface.h_hostfree
                    143: #define enp_tohost     enp_u.iface.e_tohost
                    144: #define enp_enpfree    enp_u.iface.e_enpfree
                    145: #define enp_freembuf   enp_u.iface.h_freembuf
                    146: #define enp_stat       enp_u.iface.e_stat
                    147: #define enp_addr       enp_u.iface.e_netaddr
                    148: 
                    149: #define ENPVAL         0xff    /* enp_iow.hst2enp_interrupt poke value */
                    150: #define RESETVAL       0x00    /* enp_iow.enp2hst_clear_intr poke value */
                    151: 
                    152: #define INTR_ENP(addr)         (addr->enp_iow.hst2enp_interrupt = ENPVAL)
                    153: 
                    154: #if ENP == 30
                    155: #define ACK_ENP_INTR(addr)     (addr->enp_iow.enp2hst_clear_intr = RESETVAL)
                    156: #define IS_ENP_INTR(addr)      (addr->enp_iow.enp2hst_clear_intr&0x80)
                    157: #endif
                    158: 
                    159: #ifdef notdef
                    160: #define RESET_ENP(addr)                (addr->enp_iow.hst2enp_reset = 01)
                    161: #else
                    162: #ifdef lint
                    163: #define RESET_ENP(addr)                ((addr) = (addr))
                    164: #else
                    165: #define RESET_ENP(addr)
                    166: #endif lint
                    167: #endif notdef
                    168: 
                    169: #ifdef tahoe
                    170: #define ENP_GO(addr,start) { \
                    171:        int v = start; \
                    172:        enpcopy((u_char *)&v, (u_char *)&addr->enp_prog_start, sizeof(v) ); \
                    173:        v = 0x80800000; \
                    174:        enpcopy((u_char *)&v, (u_char *)&addr->enp_go, sizeof(v) ); \
                    175: }
                    176: #else
                    177: #define ENP_GO(addr,start,intvec ) { \
                    178:        addr->enp_prog_start = (u_int)(start); \
                    179:        addr->enp_intrvec = (u_short) intvec; \
                    180:        addr->enp_go = 0x80800000; \
                    181: }
                    182: #endif tahoe
                    183: 
                    184: /*
                    185:  * State bits
                    186:  */
                    187: #define S_ENPRESET     01              /* enp is in reset state */
                    188: #define S_ENPRUN       02              /* enp is in run state */
                    189: 
                    190: /*
                    191:  * Mode bits
                    192:  */
                    193: #define E_SWAP16       0x1             /* swap two octets within 16 */
                    194: #define E_SWAP32       0x2             /* swap 16s within 32 */
                    195: #define E_SWAPRD       0x4             /* swap on read */
                    196: #define E_SWAPWRT      0x8             /* swap on write */
                    197: #define E_DMA          0x10            /* enp does data moving */
                    198: 
                    199: #define E_EXAM_LIST    0x80000000      /* enp should examine addrlist */
                    200: #define E_ADDR_SUPP    0x40000000      /* enp should use supplied addr */
                    201: 
                    202: /*
                    203:  * Download ioctl definitions
                    204:  */
                    205: #define ENPIOGO                _IO('S',1)              /* start the enp */
                    206: #define ENPIORESET     _IO('S',2)              /* reset the enp */
                    207: 
                    208: /*
                    209:  * The ENP Data Buffer Structure
                    210:  */
                    211: typedef struct BCB {
                    212:        struct  BCB *b_link;
                    213:        short    b_stat;
                    214:        short    b_len;
                    215:        u_char  *b_addr;
                    216:        short    b_msglen;
                    217:        short    b_reserved;
                    218: } BCB;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.