|
|
Power 6/32 Unix version 1.21
#define MAXMPCC 16 /* max number of MPCCs in system */
#define MAXMPCCPRT 32 /* max number of ports on a MPCC */
#define MAXASYPRT 32 /* max number of async ports on MPCC */
#define MAXASY16PRT 16 /* max async ports on 16 port MPCC */
#define MAXSYNCPRT 16 /* max number of sync ports on MPCC */
#define MAXBSCPRT 16 /* max number of bsc ports on MPCC */
#define MAXPROTOCOL 5 /* max protocols supported by MPCC */
/* ASYNC, X25, BSC, SNA, UNUSED */
#define MP_INSET 8
#define MP_OUTSET 8
#define MPDLBASE 0xa0 /* base vector for download interupt */
#define MPHISBASE 0xb0 /* base vector for host interupt */
#define MPMAGIC 1969 /* magic number for mblok */
/* Structure for x25 protocol */
struct x25ent {
char *hsp; /* Host Structure Pointer */
short error; /* error code - if any */
short count; /* number of segments used */
char **seg; /* ptr to list of ptrs to data */
short *size; /* ptr to list of sizes of data */
};
#define A_HSTXMT 4 /* # of transmit ptrs per ASYNC MP_WRITE event */
#define A_MAJ16 27 /* major for first 16 ports */
#define A_MAJ32 28 /* major for ports 16-31 for 32 port async */
#define LP_MAJ16 37 /* major device for line printer on MPCC 16 */
#define LP_MAJ32 38 /* major device for line printer on MPCC 32 */
/* ASYNC host transmit list structure */
struct hxmtl {
unsigned char *dblock[A_HSTXMT]; /* ptrs to data blocks */
unsigned short size[A_HSTXMT]; /* size of each block */
};
typedef struct hxmtl HXMTL;
/* Structure for ASYNC Protocol */
struct asyevt {
unsigned short error; /* error status returned */
unsigned short flags; /* optional event flags field */
char *params; /* pointer to event parameters */
/* virtual address ptr outbound */
union {
HXMTL *hxl; /* pointer to host xmit list */
unsigned char *rcvblk; /* pointer to receive block */
}un;
unsigned short count; /* number of ptrs in xmit list */
/* or number of receive chars */
short unused; /* to make event a mult. of 4 */
};
/* structure for BSC protocol */
struct bscent {
short b_dev; /* device passed to level 2 */
short b_count; /* data count */
short ioctlcmd; /* ioctl command */
char errflag; /* error returned from level 2 */
char type; /* multistation of single stn */
char *b_data; /* data pointer */
char *b_mprt; /* pointer to port struct on host*/
char *b_ps; /* pointer to portstatus on board*/
};
/* defines for type */
#define MULTI 1
#define SINGLE 2
#define TRACE 3
/* defines for flags (Bisync) */
#define PAGAIN 1
#define INUSE 2
#define DSRWAIT 4
#define WAITLST 8
/*
MPCC Inbound Entry and Queue
*/
struct mpccinent {
char go_stat; /* Go Status */
char op_code; /* Optional Op-code */
short flags; /* Optional flags */
union {
struct x25ent x25;
struct asyevt async;
struct bscent bsc;
/* put other protocol structures here */
}un;
};
typedef struct mpccinent MPCCINENT;
/*
MPCC Outbound Entry and Queue:
*/
struct mpccoutent {
char go_stat; /* Go Status */
char op_code; /* Optional Op-code */
short flags; /* Optional flags */
union {
struct x25ent x25;
struct asyevt async;
struct bscent bsc;
/* put other protocol structures here */
}un;
};
typedef struct mpccoutent MPCCOUTENT;
/* Defines for go_stat */
#define MP_FREE 0
#define MP_GO 1
#define MP_BUSY 2
#define MP_DONE 4
/* Defines for op_code */
#define MP_OPEN 1
#define MP_CLOSE 2
#define MP_RESET 3
#define MP_IOCTL 4
#define MP_WRITE 5
#define MP_READ 6
#define MP_STATUS 7
#define MP_EVENT 8
/* Defines for events recieved */
#define MP_NORBUF 1 /* No recieve buffers */
#define MP_NOBUFH 2 /* No recieve buffer headers */
#define MP_LNKUP 3 /* Link up */
#define MP_LNKDWN 4 /* Link down */
#define MP_XMTTO 5 /* Transmitt timeout */
/*
The structure for the Host Interface Structure is as follows:
*/
struct his {
char semaphore;
char imok;
char brdnum; /* Virtual brd number for protocol */
char unused;
struct {
char inbdone[MAXMPCCPRT]; /* Ports with inbound completed */
char outbdone[MAXMPCCPRT]; /* Ports with outbound available */
int (*incmpl)(); /* Protocol completion routine */
int (*outcmpl)(); /* Protocol completion routine */
}proto[MAXPROTOCOL];
};
typedef struct his HIS;
#define EOL -1 /* delimeter for end of ports */
/* defines for imok field of Host Interface Structure */
#define MP_ALIVE 0x01
#define MP_DEAD 0x80
/* Defines for semaphores */
#define MP_NODATA 0
#define MP_AVAILABLE 1
#define MP_DATA 2
#define MP_WORK 4
struct mpccprt {
short protocol; /* protocol of port */
char on; /* Next available entry on Host */
char off; /* Next expected 'DONE' entry on Host */
struct mpccinent Inents[MP_INSET]; /* the Inbound Queue Entries */
struct mpccoutent Outents[MP_OUTSET]; /* the Outbound Queue Entries */
char nextrcv; /* Next expected 'DONE' entry on Host */
char flags; /* flags for port on host */
char unused[2];
char *portdata; /* pointer to data for port */
};
typedef struct mpccprt MPCCPRT;
/* Defines for protocol */
#define MP_UNUSED 0 /* port is not used */
#define MP_ASYNC 1 /* port is opened for async */
#define MP_X25 2 /* port is opened for x25 */
#define MP_BISYNC 3 /* port is opened for bisync */
#define MP_SNA 4 /* port is opened for sna */
/* Defines for flags */
#define MP_PROGRESS 1 /* Open or Close is in progress */
#define MP_PORTUP 2 /* link is up for port */
#define MP_REMBSY 4 /* remote station busy */
struct mblok {
char status; /* MPCC status */
char ivect; /* Interrupt vector to Host */
short magic;
char di_swtch[2]; /* run diagnostics/application */
char serr; /* 'soft' MPCC errors */
char herr; /* 'hard' MPCC errors */
struct dl {
kr char go_stat; /* 'data' is valid */
char op_code; /* what 'data' is */
short count; /* size of 'data' */
char *data;
} dlcnf; /* download/config interface */
char hiport; /* Highest Port number on MPCC */
char loport; /* Lowest Port number on MPCC */
char mpcc_num; /* mpcc number */
char hndshk; /* handshaking timer */
char *imokclk; /* handshaking clock */
char nointcnt; /* no interrupt from handshake */
char mpintcnt; /* count of outstanding interupts
* to the MPCC */
char unused[2];
char *mpintclk; /* MPCC interrupt clock */
struct his hostint; /* To Talk with Host */
char protoport[MAXMPCCPRT]; /* protocol for port */
char intport[MAXMPCCPRT]; /* used for host to mpcc interrupt */
struct mpccprt mpccport[MAXMPCCPRT]; /* See Port Interface */
};
typedef struct mblok MBLOK;
#define SZ_MPCC (sizeof(struct mblok))
/* status defines for mblok.status */
#define MP_DLPEND 1
#define MP_DLOPEN 2
#define MP_DLDONE 3
#define MP_OPCLOSE 4
#define MP_OPOPEN 5
#define MP_DLTIME 6
#define MP_DLERROR (-1)
/* hard error status values loaded into mblock.herr */
#define NOHERR 0 /* no error */
#define MPBUSERR 1 /* bus error */
#define ADDRERR 2 /* address error */
#define UNDECC 3 /* undefined ecc interrupt */
#define UNDINT 4 /* undefined interrupt */
#define PWRFL 5 /* power fail occurred */
#define NOXENTRY 6 /* xdone was enterred without an xmit entry on queue */
#define TWOFTMRS 7 /* trying to start two fast timers on one port */
#define INTQFULL 8 /* interupt queue full */
#define INTQERR 9 /* interupt queue ack error */
#define CBPERR 10 /* uncorrectable DMA parity error */
#define ACPDEAD 11 /* acap has died */
#define PANIC1 101 /* clk_rem: timer not in queue */
#define PANIC2 102 /* clk_res: illegal time value */
#define PANIC3 103 /* clk_set: illegal tix */
#define PANIC4 104 /* clkgetb: VRTX allocation error */
#define PANIC5 105 /* clkgetb: Too many clocks */
#define PANIC6 106 /* clkrelb: release error */
#define PANIC7 107 /* Bad queue */
#define PANIC8 108 /* mp_scan: VRTX sc_post error */
#define PANIC9 109 /* mp_ipool: Buffer pools too big\n */
#define PANIC10 110 /* xl_preprocess:VRTX sc_pend error */
#define PANIC11 111 /* xl_1tompcc: unknown entry type\n */
#define PANIC12 112 /* xl_ercv: unknown error status */
#define PANIC13 113 /* xl_rxidtst:entry not busy */
#define PANIC14 114 /* xl_3tompcc: undefined op_code */
#define PANIC15 115 /* xl_ses: no buffer headers. */
#define PANIC16 116 /* xl_ses:Unrecognized command */
#define PANIC17 117 /* xl_seu: no data buffers. */
#define PANIC18 118 /* xl_seu: no buffer headers. */
#define PANIC19 119 /* xl_seu: Unrecognized command */
#define PANIC20 120 /* xl_stch: Data error */
#define PANIC21 121 /* xl_xidtst:entry not busy */
#define PANIC22 122 /* xl_guframe: no uframes\n */
#define PANIC23 123 /* xl_ruframe: not a uframe\n */
#define PANIC24 124 /* xl_clkstr: Data error. */
#define PANIC25 125 /* xl_clkstr:no timers in list */
#define PANIC26 126 /* xl_tmcan: no such timer to cancel */
#define PANIC27 127 /* xl_tmexp: unknown timer\n */
#define PANIC28 128 /* xl_tmset: no such timer to set */
#define PANIC29 129 /* xl_tmset: time left with no timers */
/* soft error status values loaded into mblock.serr */
#define NOSERR 0 /* no error */
#define DMAPERR 1 /* dma parity error */
#define ECCERR 2 /* local memory ecc error */
struct ccinit {
char status;
char unused;
short magic;
struct mblok *mb;
} ;
struct vbmem {
char dlstring[12];
struct ccinit vbinit;
struct mblok *mbloks[MAXMPCC]; /* 2 mbloks per 32 port board */
};
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.