xref: /csrg-svn/sys/vax/if/if_acpvar.h (revision 45681)
1*45681Sbostic 
2*45681Sbostic /*	if_acpvar.h	 	V1.3		05/30/86	*/
3*45681Sbostic 
4*45681Sbostic /*************************************************************************/
5*45681Sbostic /*                                                                       */
6*45681Sbostic /*                                                                       */
7*45681Sbostic /*       ________________________________________________________        */
8*45681Sbostic /*      /                                                        \       */
9*45681Sbostic /*     |          AAA          CCCCCCCCCCCCCC    CCCCCCCCCCCCCC   |      */
10*45681Sbostic /*     |         AAAAA        CCCCCCCCCCCCCCCC  CCCCCCCCCCCCCCCC  |      */
11*45681Sbostic /*     |        AAAAAAA       CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC |      */
12*45681Sbostic /*     |       AAAA AAAA      CCCC              CCCC              |      */
13*45681Sbostic /*     |      AAAA   AAAA     CCCC              CCCC              |      */
14*45681Sbostic /*     |     AAAA     AAAA    CCCC              CCCC              |      */
15*45681Sbostic /*     |    AAAA       AAAA   CCCC              CCCC              |      */
16*45681Sbostic /*     |   AAAA  AAAAAAAAAAA  CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC |      */
17*45681Sbostic /*     |  AAAA    AAAAAAAAAAA CCCCCCCCCCCCCCCC  CCCCCCCCCCCCCCCC  |      */
18*45681Sbostic /*     | AAAA      AAAAAAAAA   CCCCCCCCCCCCCC    CCCCCCCCCCCCCC   |      */
19*45681Sbostic /*      \________________________________________________________/       */
20*45681Sbostic /*                                                                       */
21*45681Sbostic /*  	Copyright (c) 1986 by Advanced Computer Communications           */
22*45681Sbostic /*  	720 Santa Barbara Street, Santa Barbara, California  93101       */
23*45681Sbostic /*  	(805) 963-9431                                                   */
24*45681Sbostic /*                                                                       */
25*45681Sbostic /*                                                                       */
26*45681Sbostic /*  File:		if_acpvar.h                                      */
27*45681Sbostic /*                                                                       */
28*45681Sbostic /*  Author:		Arthur Berggreen                                 */
29*45681Sbostic /*                                                                       */
30*45681Sbostic /*  Project:		ACP6100 (UPB with HDLC firmware)                 */
31*45681Sbostic /*          		ACP5100 (QPB with HDLC firmware)                 */
32*45681Sbostic /*                                                                       */
33*45681Sbostic /*  Revision History:                                                    */
34*45681Sbostic /*                                                                       */
35*45681Sbostic /*    21-NOV-1985  Clare Russ:  add fileheader and comments              */
36*45681Sbostic /*         Add definitions for implementatin of new Command Interface    */
37*45681Sbostic /*         (CIF) and Access Path Allocation Protocol (APAP).             */
38*45681Sbostic /*         Note that values for LINK_DISABLE etc, have been updated.     */
39*45681Sbostic /*    22-NOV-1985  Clare Russ:  Modify set system parameters values      */
40*45681Sbostic /*    17-DEC-1985  Clare Russ:  NACPCH is 2 to include all channels:     */
41*45681Sbostic /*         allocation channel, supervisor channel, and data channel.     */
42*45681Sbostic /*    30-MAY-1985  Clare Russ:  Add MPCP host request initiation         */
43*45681Sbostic /*         mailbox subfunction values (0 = data, c3 = supervisory msg)   */
44*45681Sbostic /*                                                                       */
45*45681Sbostic /*************************************************************************/
46*45681Sbostic 
47*45681Sbostic 
48*45681Sbostic #define NACPCH		2		/* one ACP data channel    */
49*45681Sbostic #define ACP_ALLOC	0		/* path allocation channel */
50*45681Sbostic #define ACP_SUPR	1		/* supervisor channel      */
51*45681Sbostic #define ACP_DATA	2		/* data channel            */
52*45681Sbostic 
53*45681Sbostic 
54*45681Sbostic #define ACPMTU		4096		/* 4096 byte frames! */
55*45681Sbostic 
56*45681Sbostic #define ACP_OQMAX	8
57*45681Sbostic 
58*45681Sbostic #define DC_OBUSY	0x01
59*45681Sbostic 
60*45681Sbostic /* Defines for the Set HDLC System Parameters Command which is used */
61*45681Sbostic /* to modify several operating parameters within the ACP5100/6100   */
62*45681Sbostic 
63*45681Sbostic #define LINK_DISABLE	0x22		/* disable the HDLC line    */
64*45681Sbostic #define LINK_ENABLE	0x01		/* enable the HDLC line     */
65*45681Sbostic 
66*45681Sbostic /* The LINK_LOOPBACK, BAUD_CNTL, IDLE_POLL, and CLOCK_CNTL parameter */
67*45681Sbostic /* modification commands are one-byte values containing a size and   */
68*45681Sbostic /* and ID followed by 0-2 bytes of parameter information.  The       */
69*45681Sbostic /* number of bytes of parameter information is specified in the most */
70*45681Sbostic /* significant 2 bits of the command, the other 6 bits are the ID.   */
71*45681Sbostic /* A 00, 01, or 10 specify respectively 0, 1, or 2 bytes of          */
72*45681Sbostic /* parameter information follow.                                     */
73*45681Sbostic 
74*45681Sbostic #define LINK_LOOPBACK	0x42		/* set loopback mode        */
75*45681Sbostic #define  LOOP_NONE	0x00		/*  none (normal operation) */
76*45681Sbostic #define  LOOP_EXTERNAL	0x01		/*  external loopback       */
77*45681Sbostic #define  LOOP_INTERNAL	0x02		/*  internal loopback       */
78*45681Sbostic #define	BAUD_CNTL	0x8c		/* baud rate divisor        */
79*45681Sbostic #define	IDLE_POLL	0x4d		/* poll inactive link       */
80*45681Sbostic #define	CLOCK_CNTL	0x4e		/* select clock source      */
81*45681Sbostic 
82*45681Sbostic #define LINE_STATUS	0x61
83*45681Sbostic #define LINK_UP		0x01
84*45681Sbostic 
85*45681Sbostic /*  Host Request Mailbox Completion Status  */
86*45681Sbostic 
87*45681Sbostic #define ACPIOCOK	0x01	/* success        */
88*45681Sbostic #define ACPIOCABT	0xff	/* aborted        */
89*45681Sbostic #define ACPIOCERR	0xfe	/* error          */
90*45681Sbostic #define ACPIOCOVR	0xfd	/* overrun        */
91*45681Sbostic #define ACPIOCUBE	0xfc	/* xfer count = 0 */
92*45681Sbostic 
93*45681Sbostic /*  Host Request Mailbox Subfunction  */
94*45681Sbostic 
95*45681Sbostic #define SBFCN_DATA	0x00	/* data           */
96*45681Sbostic #define SBFCN_SUPR	0xc3	/* supervisory    */
97*45681Sbostic 
98*45681Sbostic #define ACPF_OK		0x0001	/* ACP operation flag */
99*45681Sbostic 
100*45681Sbostic #define ACPSTAT_OK	0x00
101*45681Sbostic 
102*45681Sbostic /* offsets for CIM command/response pairs */
103*45681Sbostic 
104*45681Sbostic #define	CMD_OFFSET	3	/* CIM header, offset for command */
105*45681Sbostic #define	CID_OFFSET	7	/* Command ID field, set by the   */
106*45681Sbostic 				/* generator, is returned with no */
107*45681Sbostic 				/* change in the response         */
108*45681Sbostic #define	RSF_OFFSET	11	/* CIM header, offset for RSF     */
109*45681Sbostic #define	DPN_OFFSET	13	/* alloc cmd offset for dpn       */
110*45681Sbostic #define	TYPE_OFFSET	17	/* alloc cmd offset for path type */
111*45681Sbostic 
112*45681Sbostic #define	LOOP_OFFSET	16	/* set system parms, loopback     */
113*45681Sbostic #define	DTE_OFFSET	18	/* set system parms, dte/dce mode */
114*45681Sbostic #define	BAUD_OFFSET	20	/* set system parms, dte/dce mode */
115*45681Sbostic #define	CLOCK_OFFSET	25	/* set system parms, dte/dce mode */
116*45681Sbostic #define	DOWN_OFFSET	26	/* set system parms, line down    */
117*45681Sbostic 
118*45681Sbostic #define INIT_OK		0x10	/* send line up CIM to front end  */
119*45681Sbostic 
120*45681Sbostic /****************************************************************************/
121*45681Sbostic /* Most of the following defines were extracted from front end software     */
122*45681Sbostic /* source include files cim.h, cimdef.h, and params.h on 21-NOV-1985.  This */
123*45681Sbostic /* will ensure that the host and front end are using the same definitions.  */
124*45681Sbostic /****************************************************************************/
125*45681Sbostic 
126*45681Sbostic /* Parameter Modification Commands for Set HDLC System Paramters command */
127*45681Sbostic 
128*45681Sbostic #define	DCE_OR_DTE		0x43	/* HDLC: select DCE/DTE mode	*/
129*45681Sbostic #define	DTE_MODE		0x00	/*   specify DTE mode       	*/
130*45681Sbostic #define	DCE_MODE		0x01	/*   specify DCE mode       	*/
131*45681Sbostic 
132*45681Sbostic #define	DTE_ADDR		0x04	/* HDLC: DTE frame address	*/
133*45681Sbostic #define	DCE_ADDR		0x05	/* HDLC: DCE frame address	*/
134*45681Sbostic #define	IFRAME_T_O		0x06	/* HDLC: T1 after I-frame	*/
135*45681Sbostic #define	POLL_T_O		0x07	/* HDLC: T1 after poll cmd	*/
136*45681Sbostic #define	ADM_T_O		0x08	/* HDLC: T1 for down link	*/
137*45681Sbostic #define	RETRY_LIMIT		0x0a	/* HDLC: N2 counter		*/
138*45681Sbostic #define	WATCHDOG_T_O		0x0b	/* phys: max transmit time	*/
139*45681Sbostic #define	PKT_SIZE		0x10	/* X.25: packet size		*/
140*45681Sbostic #define	PKT_WINDOW		0x11	/* X.25: packet window		*/
141*45681Sbostic #define	PKT_TIMEOUT		0x12	/* X.25: packet timeout		*/
142*45681Sbostic #define UPPER_THRESH		0x13	/* HDLC queue limits: upper	*/
143*45681Sbostic #define LOWER_THRESH		0x14	/*		      lower	*/
144*45681Sbostic #define WHICH_PROTOCOL	0x15	/* protocol above HDLC:		*/
145*45681Sbostic #define	  PRMVAL_HDH		0x01	/* HDH				*/
146*45681Sbostic #define	  PRMVAL_HDLC		0x02	/* none (bare HDLC)		*/
147*45681Sbostic #define	  PRMVAL_X25		0x03	/* X.25 packet level		*/
148*45681Sbostic #define IMP_OR_HOST		0x16	/* HDH: select IMP/host mode	*/
149*45681Sbostic #define PKT_OR_MSG		0x17	/* HDH: select packet/msg mode	*/
150*45681Sbostic #define SEND_TIMER		0x18	/* HDH send timer		*/
151*45681Sbostic #define RESPONSE_TIMER	0x19	/* HDH response timer		*/
152*45681Sbostic #define HLD_TMR		0x1A	/* HDH				*/
153*45681Sbostic #define MISSES		0x1B	/* HDH				*/
154*45681Sbostic #define HITS			0x1C	/* HDH				*/
155*45681Sbostic #define SEND_WINDOW		0x1D	/* HDH				*/
156*45681Sbostic #define MAXIFRM_XMIT		0x1e	/* HDLC: queue to transmitter	*/
157*45681Sbostic #define FRAME_SPACE		0x1f	/* phys: interframe spacing	*/
158*45681Sbostic #define FRAME_SIZE		0x20	/* HDLC: frame size		*/
159*45681Sbostic #define FRAME_WINDOW		0x21	/* HDLC: transmit frame window	*/
160*45681Sbostic #define EXTERNAL_CLOCK		0x00	/* clock generated externally   */
161*45681Sbostic #define INTERNAL_CLOCK		0x01	/* clock generated internally 	*/
162*45681Sbostic 
163*45681Sbostic #define SUCCESS     	0
164*45681Sbostic #define FAILURE     	1
165*45681Sbostic 
166*45681Sbostic /*   Path types    */
167*45681Sbostic 
168*45681Sbostic #define TYPE_DATA       0x01       /* Path type of DATA  */
169*45681Sbostic #define TYPE_CNTL       0x02       /* Path type of CONTROL */
170*45681Sbostic 
171*45681Sbostic 
172*45681Sbostic /*   Command Codes used in CIMs                */
173*45681Sbostic 
174*45681Sbostic                              /* Allocation Facility Commands */
175*45681Sbostic #define CMD_ALLOC       0x22       /* Allocate Path */
176*45681Sbostic #define CMD_DEALLOC     0x24       /* Deallocate Path */
177*45681Sbostic 
178*45681Sbostic                              /* Allocation Facility Responses */
179*45681Sbostic                              /* Note that the response value  */
180*45681Sbostic                              /* is the command value + 1      */
181*45681Sbostic #define RSP_ALLOC       0x23       /* Allocate Path */
182*45681Sbostic #define RSP_DEALLOC     0x25       /* Deallocate Path */
183*45681Sbostic #define RSP_SSP     	0x63       /* Set Sys Params  */
184*45681Sbostic #define RSP_FLUP        0x65       /* Frame Level Up */
185*45681Sbostic #define RSP_FLDWN       0x67       /* Frame Level Down */
186*45681Sbostic 
187*45681Sbostic                              /* System Facility Commands */
188*45681Sbostic #define CMD_BFINIT      0x42       /* Buffer Initialization */
189*45681Sbostic #define CMD_BFQRY       0x44       /* Buffer Query */
190*45681Sbostic #define CMD_FACQRY      0x46       /* Facility Query */
191*45681Sbostic #define CMD_MEMRD       0x48       /* Memory Read */
192*45681Sbostic #define CMD_MEMWRT      0x4A       /* Memory Write */
193*45681Sbostic 
194*45681Sbostic                              /* HDLC Facility Commands */
195*45681Sbostic #define CMD_SSP         0x62       /* Set HDLC Parameters */
196*45681Sbostic #define CMD_FLUP        0x64       /* Frame Level Up */
197*45681Sbostic #define CMD_FLDWN       0x66       /* Frame Level Down */
198*45681Sbostic #define CMD_STAQRY      0x68       /* Statistics Query */
199*45681Sbostic #define CMD_FRMQRY      0x6A       /* Frame Level Status Query */
200*45681Sbostic 
201*45681Sbostic                              /* DCP Driver Commands */
202*45681Sbostic #define CMD_ERST        0x02       /* Reset Encryption */
203*45681Sbostic #define CMD_DRST        0x04       /* Reset Decryption */
204*45681Sbostic #define CMD_ESTA        0x06       /* Start Encryption */
205*45681Sbostic #define CMD_DSTA        0x08       /* Start Decryption */
206*45681Sbostic #define CMD_ESET        0x0A       /* Set Encryption */
207*45681Sbostic #define CMD_DSET        0x0C       /* Set Decryption */
208*45681Sbostic #define CMD_ESTOP       0x0E       /* Stop Encryption */
209*45681Sbostic #define CMD_DSTOP       0x10       /* Stop Decryption */
210*45681Sbostic #define CMD_DCPERR      0x7E       /* DCP Error Detected */
211*45681Sbostic 
212*45681Sbostic /*   Facility Codes used in CIMs  */
213*45681Sbostic 
214*45681Sbostic /*    Symbol        FAC Code     Facility       */
215*45681Sbostic 
216*45681Sbostic #define FAC_NONE     0x00       /* No Facility assigned   */
217*45681Sbostic #define FAC_ALLOC    0x01       /* Allocation facility */
218*45681Sbostic #define FAC_SYS      0x02       /* System query/response facility */
219*45681Sbostic #define FAC_HDLC     0x03       /* HDLC facility */
220*45681Sbostic #define FAC_DCP      0x04       /* Data Encryption Facility */
221*45681Sbostic #define MAX_FAC         4       /* Maximum facility number  */
222*45681Sbostic 
223*45681Sbostic              /* RSF Codes used in CIMs  */
224*45681Sbostic 
225*45681Sbostic 
226*45681Sbostic /*   RSF Symbol    RSF Code    Response Description */
227*45681Sbostic /*                 (decimal)                        */
228*45681Sbostic 
229*45681Sbostic #define RSF_SUCC       0        /* Success */
230*45681Sbostic #define RSF_LONG       1        /* Command is too long */
231*45681Sbostic #define RSF_SHORT      2        /* Command is too short */
232*45681Sbostic #define RSF_NOTSUPP    3        /* Request not supported */
233*45681Sbostic #define RSF_DATA_NA    4        /* Buffer contains data-Not allowed */
234*45681Sbostic #define RSF_NOCNTL     5        /* Control Path must be allocated 1st */
235*45681Sbostic #define RSF_NOFAC      6        /* Facility unavailable for allocation */
236*45681Sbostic #define RSF_FACPTH     7        /* Path cannot be allocated for facility */
237*45681Sbostic #define RSF_NOBUF      8        /* No buffers available    */
238*45681Sbostic #define RSF_INVDPN    10        /* Invalid Data Path Number */
239*45681Sbostic #define RSF_INVCMD    11        /* Invalid Command */
240*45681Sbostic #define RSF_INVTYP    12        /* Invalid path type */
241*45681Sbostic #define RSF_INVFAC    13        /* Invalid facility */
242*45681Sbostic #define RSF_DPNOOR    20        /* DPN out of range */
243*45681Sbostic #define RSF_PTHEXC    21        /* Maximum number of paths exceeded */
244*45681Sbostic #define RSF_NOTALLOC  23        /* Path not allocated */
245*45681Sbostic #define RSF_BFROOR    30        /* Buffer size out of range */
246*45681Sbostic #define RSF_SEGBFR    31        /* Segmented Buffers implemented */
247*45681Sbostic #define RSF_BFQEXC    32        /* Too many Buffer queues requested */
248*45681Sbostic #define RSF_INVADR    40        /* Invalid ACP 6100 Address */
249*45681Sbostic #define RSF_INVCNT    41        /* Byte count Invalid */
250*45681Sbostic #define RSF_INVPID    50        /* Parameter ID Unknown */
251*45681Sbostic #define RSF_INVVAL    51        /* Invalid Value */
252*45681Sbostic #define RSF_PTLVAL    52        /* Partial Value */
253*45681Sbostic #define RSF_BDPRTY    61        /* Bad parity for Key; one or more */
254*45681Sbostic                                 /* Key bytes had bad (even) parity */
255*45681Sbostic #define RSF_NOSET     62        /* No Set Command given */
256*45681Sbostic #define RSF_INVMOD    63        /* Invalid Mode in Set command */
257*45681Sbostic #define RSF_INACT     64        /* Inactive-Stop issued for operation */
258*45681Sbostic                                 /* that's not Started */
259*45681Sbostic #define RSF_ACTIVE    66        /* Active; operation was not Stopped */
260*45681Sbostic #define RSF_ERROR     67        /* Error condition: send Reset(s) */
261*45681Sbostic #define RSF_DCPSTER   70        /* DCP chip error, bad status after */
262*45681Sbostic                                 /* Start command */
263*45681Sbostic #define RSF_DCPMODE   71        /* DCP chip error, bad status after */
264*45681Sbostic                                 /* mode set */
265*45681Sbostic #define RSF_DCPRESET  73        /* DCP chip error, bad status */
266*45681Sbostic                                 /* after software reset */
267*45681Sbostic #define RSF_DCPTRN    74        /* DMAC chip error detected; DMAC */
268*45681Sbostic                                 /* malfunction during data transfer */
269