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