Annotation of cci/sys/vba/mp_host.h, revision 1.1

1.1     ! root        1: #define MAXMPCC         16              /* max number of MPCCs in system */
        !             2: #define MAXMPCCPRT      32              /* max number of ports on a MPCC */
        !             3: #define MAXASYPRT       32              /* max number of async ports on MPCC */
        !             4: #define MAXASY16PRT     16              /* max async ports on 16 port MPCC */
        !             5: #define MAXSYNCPRT      16              /* max number of sync ports on MPCC */
        !             6: #define MAXBSCPRT       16              /* max number of bsc ports on MPCC */
        !             7: #define MAXPROTOCOL     5               /* max protocols supported by MPCC */
        !             8:                                         /* ASYNC, X25, BSC, SNA, UNUSED */
        !             9: #define MP_INSET        8
        !            10: #define MP_OUTSET       8
        !            11: 
        !            12: #define MPDLBASE        0xa0            /* base vector for download interupt */
        !            13: #define MPHISBASE       0xb0            /* base vector for host interupt */
        !            14: #define MPMAGIC         1969            /* magic number for mblok */
        !            15: 
        !            16: /* Structure for x25 protocol */
        !            17: struct x25ent {
        !            18:         char    *hsp;                   /* Host Structure Pointer       */
        !            19:         short   error;                  /* error code - if any          */
        !            20:         short   count;                  /* number of segments used      */
        !            21:         char    **seg;                  /* ptr to list of ptrs to data  */
        !            22:         short   *size;                  /* ptr to list of sizes of data */
        !            23: };
        !            24: 
        !            25: #define A_HSTXMT 4      /* # of transmit ptrs per ASYNC MP_WRITE event */
        !            26: #define A_MAJ16  27     /* major for first 16 ports */
        !            27: #define A_MAJ32  28     /* major for ports 16-31 for 32 port async */
        !            28: #define LP_MAJ16 37     /* major device for line printer on MPCC 16 */
        !            29: #define LP_MAJ32 38     /* major device for line printer on MPCC 32 */
        !            30: 
        !            31: /* ASYNC host transmit list structure */
        !            32: struct hxmtl {
        !            33:         unsigned char *dblock[A_HSTXMT];        /* ptrs to data blocks */
        !            34:         unsigned short size[A_HSTXMT];          /* size of each block  */
        !            35: };
        !            36: 
        !            37: typedef struct hxmtl HXMTL;
        !            38: 
        !            39: /* Structure for ASYNC Protocol */
        !            40: struct asyevt {
        !            41:         unsigned short error;           /* error status returned        */
        !            42:         unsigned short flags;           /* optional event flags field   */
        !            43:         char *params;                   /* pointer to event parameters  */
        !            44:                                         /* virtual address ptr outbound */
        !            45:         union {
        !            46:                 HXMTL *hxl;             /* pointer to host xmit list    */
        !            47:                 unsigned char *rcvblk;  /* pointer to receive block     */
        !            48:         }un;
        !            49:         unsigned short count;           /* number of ptrs in xmit list  */
        !            50:                                         /* or number of receive chars   */
        !            51:         short unused;                   /* to make event a mult. of 4   */
        !            52: };
        !            53: 
        !            54: 
        !            55: /* structure for BSC protocol */
        !            56: 
        !            57: struct bscent {
        !            58:         short   b_dev;                  /* device passed to level 2     */
        !            59:         short   b_count;                /* data count                   */
        !            60:         short   ioctlcmd;               /* ioctl command                */
        !            61:         char    errflag;                /* error returned from level 2  */
        !            62:         char    type;                   /* multistation of single stn   */
        !            63:         char    *b_data;                /* data pointer                 */
        !            64:         char    *b_mprt;                /* pointer to port struct on host*/
        !            65:         char    *b_ps;                  /* pointer to portstatus on board*/
        !            66: };
        !            67: 
        !            68: /* defines for type */
        !            69: #define MULTI  1
        !            70: #define SINGLE 2
        !            71: #define TRACE  3
        !            72: 
        !            73: 
        !            74: 
        !            75: /* defines for flags (Bisync) */
        !            76: #define PAGAIN 1
        !            77: #define INUSE  2
        !            78: #define DSRWAIT 4
        !            79: #define WAITLST 8
        !            80: 
        !            81: 
        !            82: 
        !            83: /*
        !            84: MPCC Inbound Entry and Queue
        !            85: */
        !            86: 
        !            87: struct mpccinent {
        !            88:         char    go_stat;                /* Go Status                    */
        !            89:         char    op_code;                /* Optional Op-code             */
        !            90:         short   flags;                  /* Optional flags               */
        !            91:         union   {
        !            92:                 struct x25ent x25;
        !            93:                 struct asyevt async;
        !            94:                 struct bscent bsc;
        !            95:                 /* put other protocol structures here */
        !            96:         }un;
        !            97: };
        !            98: 
        !            99: typedef struct mpccinent MPCCINENT;
        !           100: 
        !           101: /*
        !           102: MPCC Outbound Entry and Queue:
        !           103: */
        !           104: 
        !           105: struct mpccoutent {
        !           106:         char    go_stat;                /* Go Status                    */
        !           107:         char    op_code;                /* Optional Op-code             */
        !           108:         short   flags;                  /* Optional flags               */
        !           109:         union   {
        !           110:                 struct x25ent x25;
        !           111:                 struct asyevt async;
        !           112:                 struct bscent bsc;
        !           113:                 /* put other protocol structures here */
        !           114:         }un;
        !           115: };
        !           116: 
        !           117: typedef struct mpccoutent MPCCOUTENT;
        !           118: 
        !           119: /* Defines for go_stat */
        !           120: #define MP_FREE         0
        !           121: #define MP_GO           1
        !           122: #define MP_BUSY         2
        !           123: #define MP_DONE         4
        !           124: 
        !           125: /* Defines for op_code */
        !           126: #define MP_OPEN         1
        !           127: #define MP_CLOSE        2
        !           128: #define MP_RESET        3
        !           129: #define MP_IOCTL        4
        !           130: #define MP_WRITE        5
        !           131: #define MP_READ         6
        !           132: #define MP_STATUS       7
        !           133: #define MP_EVENT        8
        !           134: 
        !           135: /* Defines for events recieved */
        !           136: #define MP_NORBUF       1       /* No recieve buffers */
        !           137: #define MP_NOBUFH       2       /* No recieve buffer headers */
        !           138: #define MP_LNKUP        3       /* Link up */
        !           139: #define MP_LNKDWN       4       /* Link down */
        !           140: #define MP_XMTTO        5       /* Transmitt timeout */
        !           141: 
        !           142: /*
        !           143: The structure for the Host Interface Structure is as follows:
        !           144: */
        !           145: struct his {
        !           146:         char    semaphore;
        !           147:         char    imok;
        !           148:         char    brdnum;         /* Virtual brd number for protocol */
        !           149:         char    unused;
        !           150:         struct {
        !           151:                 char    inbdone[MAXMPCCPRT];  /* Ports with inbound completed */
        !           152:                 char    outbdone[MAXMPCCPRT]; /* Ports with outbound available */
        !           153:                 int     (*incmpl)();        /* Protocol completion routine   */
        !           154:                 int     (*outcmpl)();       /* Protocol completion routine   */
        !           155:         }proto[MAXPROTOCOL];
        !           156: };
        !           157: 
        !           158: typedef struct his HIS;
        !           159: 
        !           160: #define EOL             -1                      /* delimeter for end of ports */
        !           161: 
        !           162: /* defines for imok field of Host Interface Structure */
        !           163: #define MP_ALIVE 0x01
        !           164: #define MP_DEAD  0x80
        !           165: 
        !           166: /* Defines for semaphores */
        !           167: #define MP_NODATA       0
        !           168: #define MP_AVAILABLE    1
        !           169: #define MP_DATA         2
        !           170: #define MP_WORK         4
        !           171: 
        !           172: struct mpccprt {
        !           173:         short   protocol;               /* protocol of port */
        !           174:         char    on;                     /* Next available entry on Host */
        !           175:         char    off;                    /* Next expected 'DONE' entry on Host */
        !           176:         struct mpccinent Inents[MP_INSET];      /* the Inbound Queue Entries */
        !           177:         struct mpccoutent Outents[MP_OUTSET];   /* the Outbound Queue Entries */
        !           178:         char    nextrcv;                /* Next expected 'DONE' entry on Host */
        !           179:         char    flags;                  /* flags for port on host */
        !           180:         char    unused[2];
        !           181:         char    *portdata;              /* pointer to data for port */
        !           182:         };
        !           183: 
        !           184: typedef struct mpccprt MPCCPRT;
        !           185: 
        !           186: /* Defines for protocol */
        !           187: #define MP_UNUSED       0       /* port is not used */
        !           188: #define MP_ASYNC        1       /* port is opened for async */
        !           189: #define MP_X25          2       /* port is opened for x25 */
        !           190: #define MP_BISYNC       3       /* port is opened for bisync */
        !           191: #define MP_SNA          4       /* port is opened for sna */
        !           192: 
        !           193: /* Defines for flags */
        !           194: #define MP_PROGRESS     1       /* Open or Close is in progress */
        !           195: #define MP_PORTUP       2       /* link is up for port          */
        !           196: #define MP_REMBSY       4       /* remote station busy          */
        !           197: 
        !           198: struct  mblok   {
        !           199:         char    status;                 /* MPCC status                  */
        !           200:         char    ivect;                  /* Interrupt vector to Host     */
        !           201:         short   magic;
        !           202:         char    di_swtch[2];            /* run diagnostics/application  */
        !           203:         char    serr;                   /* 'soft' MPCC errors           */
        !           204:         char    herr;                   /* 'hard' MPCC errors           */
        !           205:         struct  dl {
        !           206:         kr      char    go_stat;        /* 'data' is valid              */
        !           207:                 char    op_code;        /* what 'data' is               */
        !           208:                 short   count;          /* size of 'data'               */
        !           209:                 char    *data;
        !           210:         } dlcnf;                        /* download/config interface    */
        !           211:         char    hiport;                 /* Highest Port number on MPCC  */
        !           212:         char    loport;                 /* Lowest Port number on MPCC   */
        !           213:         char    mpcc_num;               /* mpcc number                  */
        !           214:         char    hndshk;                 /* handshaking timer            */
        !           215:         char    *imokclk;               /* handshaking clock            */
        !           216:         char    nointcnt;               /* no interrupt from handshake  */
        !           217:         char    mpintcnt;               /* count of outstanding interupts
        !           218:                                          * to the MPCC                  */
        !           219:         char    unused[2];
        !           220:         char    *mpintclk;              /* MPCC interrupt clock         */
        !           221:         struct his      hostint;        /* To Talk with Host    */
        !           222:         char    protoport[MAXMPCCPRT];  /* protocol for port            */
        !           223:         char    intport[MAXMPCCPRT];    /* used for host to mpcc interrupt */
        !           224:         struct mpccprt  mpccport[MAXMPCCPRT];   /* See Port Interface */
        !           225: };
        !           226: 
        !           227: typedef struct mblok MBLOK;
        !           228: 
        !           229: #define SZ_MPCC (sizeof(struct mblok))
        !           230: 
        !           231: /*      status defines for mblok.status */
        !           232: 
        !           233: #define MP_DLPEND       1
        !           234: #define MP_DLOPEN       2
        !           235: #define MP_DLDONE       3
        !           236: #define MP_OPCLOSE      4
        !           237: #define MP_OPOPEN       5
        !           238: #define MP_DLTIME       6
        !           239: #define MP_DLERROR      (-1)
        !           240: 
        !           241: /* hard error status values loaded into mblock.herr */
        !           242: #define NOHERR 0        /* no error */
        !           243: #define MPBUSERR 1      /* bus error */
        !           244: #define ADDRERR 2       /* address error */
        !           245: #define UNDECC 3        /* undefined ecc interrupt */
        !           246: #define UNDINT 4        /* undefined interrupt */
        !           247: #define PWRFL 5         /* power fail occurred */
        !           248: #define NOXENTRY 6      /* xdone was enterred without an xmit entry on queue */
        !           249: #define TWOFTMRS 7      /* trying to start two fast timers on one port */
        !           250: #define INTQFULL 8      /* interupt queue full */
        !           251: #define INTQERR 9       /* interupt queue ack error */
        !           252: #define CBPERR 10       /* uncorrectable DMA parity error */
        !           253: #define ACPDEAD 11      /* acap has died */
        !           254: 
        !           255: #define PANIC1  101     /* clk_rem: timer not in queue */
        !           256: #define PANIC2  102     /* clk_res: illegal time value */
        !           257: #define PANIC3  103     /* clk_set: illegal tix */
        !           258: #define PANIC4  104     /* clkgetb: VRTX allocation error */
        !           259: #define PANIC5  105     /* clkgetb: Too many clocks */
        !           260: #define PANIC6  106     /* clkrelb: release error */
        !           261: #define PANIC7  107     /* Bad queue */
        !           262: #define PANIC8  108     /* mp_scan: VRTX sc_post error */
        !           263: #define PANIC9  109     /* mp_ipool: Buffer pools too big\n */
        !           264: #define PANIC10 110     /* xl_preprocess:VRTX sc_pend error */
        !           265: #define PANIC11 111     /* xl_1tompcc: unknown entry type\n */
        !           266: #define PANIC12 112     /* xl_ercv: unknown error status */
        !           267: #define PANIC13 113     /* xl_rxidtst:entry not busy */
        !           268: #define PANIC14 114     /* xl_3tompcc: undefined op_code */
        !           269: #define PANIC15 115     /* xl_ses: no buffer headers. */
        !           270: #define PANIC16 116     /* xl_ses:Unrecognized command */
        !           271: #define PANIC17 117     /* xl_seu: no data buffers. */
        !           272: #define PANIC18 118     /* xl_seu: no buffer headers. */
        !           273: #define PANIC19 119     /* xl_seu: Unrecognized command */
        !           274: #define PANIC20 120     /* xl_stch: Data error  */
        !           275: #define PANIC21 121     /* xl_xidtst:entry not busy */
        !           276: #define PANIC22 122     /* xl_guframe: no uframes\n */
        !           277: #define PANIC23 123     /* xl_ruframe: not a uframe\n */
        !           278: #define PANIC24 124     /* xl_clkstr: Data error. */
        !           279: #define PANIC25 125     /* xl_clkstr:no timers in list */
        !           280: #define PANIC26 126     /* xl_tmcan: no such timer to cancel */
        !           281: #define PANIC27 127     /* xl_tmexp: unknown timer\n */
        !           282: #define PANIC28 128     /* xl_tmset: no such timer to set */
        !           283: #define PANIC29 129     /* xl_tmset: time left with no timers */
        !           284: 
        !           285: /* soft error status values loaded into mblock.serr */
        !           286: #define NOSERR 0        /* no error */
        !           287: #define DMAPERR 1       /* dma parity error */
        !           288: #define ECCERR 2        /* local memory ecc error */
        !           289: 
        !           290: struct ccinit {
        !           291:         char status;
        !           292:         char unused;
        !           293:         short magic;
        !           294:         struct mblok *mb;
        !           295: } ;
        !           296: 
        !           297: struct vbmem {
        !           298:         char dlstring[12];
        !           299:         struct ccinit vbinit;
        !           300:         struct mblok *mbloks[MAXMPCC];  /* 2 mbloks per 32 port board */
        !           301: };
        !           302: 

unix.superglobalmegacorp.com

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