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