1*45682Sbostic /*- 2*45682Sbostic * @(#)if_acpvar.h 7.2 (Berkeley) 12/02/90 3*45682Sbostic */ 445681Sbostic 545681Sbostic /*************************************************************************/ 645681Sbostic /* */ 745681Sbostic /* */ 845681Sbostic /* ________________________________________________________ */ 945681Sbostic /* / \ */ 1045681Sbostic /* | AAA CCCCCCCCCCCCCC CCCCCCCCCCCCCC | */ 1145681Sbostic /* | AAAAA CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC | */ 1245681Sbostic /* | AAAAAAA CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC | */ 1345681Sbostic /* | AAAA AAAA CCCC CCCC | */ 1445681Sbostic /* | AAAA AAAA CCCC CCCC | */ 1545681Sbostic /* | AAAA AAAA CCCC CCCC | */ 1645681Sbostic /* | AAAA AAAA CCCC CCCC | */ 1745681Sbostic /* | AAAA AAAAAAAAAAA CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC | */ 1845681Sbostic /* | AAAA AAAAAAAAAAA CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC | */ 1945681Sbostic /* | AAAA AAAAAAAAA CCCCCCCCCCCCCC CCCCCCCCCCCCCC | */ 2045681Sbostic /* \________________________________________________________/ */ 2145681Sbostic /* */ 2245681Sbostic /* Copyright (c) 1986 by Advanced Computer Communications */ 2345681Sbostic /* 720 Santa Barbara Street, Santa Barbara, California 93101 */ 2445681Sbostic /* (805) 963-9431 */ 2545681Sbostic /* */ 2645681Sbostic /* */ 2745681Sbostic /* File: if_acpvar.h */ 2845681Sbostic /* */ 2945681Sbostic /* Author: Arthur Berggreen */ 3045681Sbostic /* */ 3145681Sbostic /* Project: ACP6100 (UPB with HDLC firmware) */ 3245681Sbostic /* ACP5100 (QPB with HDLC firmware) */ 3345681Sbostic /* */ 3445681Sbostic /* Revision History: */ 3545681Sbostic /* */ 3645681Sbostic /* 21-NOV-1985 Clare Russ: add fileheader and comments */ 3745681Sbostic /* Add definitions for implementatin of new Command Interface */ 3845681Sbostic /* (CIF) and Access Path Allocation Protocol (APAP). */ 3945681Sbostic /* Note that values for LINK_DISABLE etc, have been updated. */ 4045681Sbostic /* 22-NOV-1985 Clare Russ: Modify set system parameters values */ 4145681Sbostic /* 17-DEC-1985 Clare Russ: NACPCH is 2 to include all channels: */ 4245681Sbostic /* allocation channel, supervisor channel, and data channel. */ 4345681Sbostic /* 30-MAY-1985 Clare Russ: Add MPCP host request initiation */ 4445681Sbostic /* mailbox subfunction values (0 = data, c3 = supervisory msg) */ 4545681Sbostic /* */ 4645681Sbostic /*************************************************************************/ 4745681Sbostic 4845681Sbostic 4945681Sbostic #define NACPCH 2 /* one ACP data channel */ 5045681Sbostic #define ACP_ALLOC 0 /* path allocation channel */ 5145681Sbostic #define ACP_SUPR 1 /* supervisor channel */ 5245681Sbostic #define ACP_DATA 2 /* data channel */ 5345681Sbostic 5445681Sbostic 5545681Sbostic #define ACPMTU 4096 /* 4096 byte frames! */ 5645681Sbostic 5745681Sbostic #define ACP_OQMAX 8 5845681Sbostic 5945681Sbostic #define DC_OBUSY 0x01 6045681Sbostic 6145681Sbostic /* Defines for the Set HDLC System Parameters Command which is used */ 6245681Sbostic /* to modify several operating parameters within the ACP5100/6100 */ 6345681Sbostic 6445681Sbostic #define LINK_DISABLE 0x22 /* disable the HDLC line */ 6545681Sbostic #define LINK_ENABLE 0x01 /* enable the HDLC line */ 6645681Sbostic 6745681Sbostic /* The LINK_LOOPBACK, BAUD_CNTL, IDLE_POLL, and CLOCK_CNTL parameter */ 6845681Sbostic /* modification commands are one-byte values containing a size and */ 6945681Sbostic /* and ID followed by 0-2 bytes of parameter information. The */ 7045681Sbostic /* number of bytes of parameter information is specified in the most */ 7145681Sbostic /* significant 2 bits of the command, the other 6 bits are the ID. */ 7245681Sbostic /* A 00, 01, or 10 specify respectively 0, 1, or 2 bytes of */ 7345681Sbostic /* parameter information follow. */ 7445681Sbostic 7545681Sbostic #define LINK_LOOPBACK 0x42 /* set loopback mode */ 7645681Sbostic #define LOOP_NONE 0x00 /* none (normal operation) */ 7745681Sbostic #define LOOP_EXTERNAL 0x01 /* external loopback */ 7845681Sbostic #define LOOP_INTERNAL 0x02 /* internal loopback */ 7945681Sbostic #define BAUD_CNTL 0x8c /* baud rate divisor */ 8045681Sbostic #define IDLE_POLL 0x4d /* poll inactive link */ 8145681Sbostic #define CLOCK_CNTL 0x4e /* select clock source */ 8245681Sbostic 8345681Sbostic #define LINE_STATUS 0x61 8445681Sbostic #define LINK_UP 0x01 8545681Sbostic 8645681Sbostic /* Host Request Mailbox Completion Status */ 8745681Sbostic 8845681Sbostic #define ACPIOCOK 0x01 /* success */ 8945681Sbostic #define ACPIOCABT 0xff /* aborted */ 9045681Sbostic #define ACPIOCERR 0xfe /* error */ 9145681Sbostic #define ACPIOCOVR 0xfd /* overrun */ 9245681Sbostic #define ACPIOCUBE 0xfc /* xfer count = 0 */ 9345681Sbostic 9445681Sbostic /* Host Request Mailbox Subfunction */ 9545681Sbostic 9645681Sbostic #define SBFCN_DATA 0x00 /* data */ 9745681Sbostic #define SBFCN_SUPR 0xc3 /* supervisory */ 9845681Sbostic 9945681Sbostic #define ACPF_OK 0x0001 /* ACP operation flag */ 10045681Sbostic 10145681Sbostic #define ACPSTAT_OK 0x00 10245681Sbostic 10345681Sbostic /* offsets for CIM command/response pairs */ 10445681Sbostic 10545681Sbostic #define CMD_OFFSET 3 /* CIM header, offset for command */ 10645681Sbostic #define CID_OFFSET 7 /* Command ID field, set by the */ 10745681Sbostic /* generator, is returned with no */ 10845681Sbostic /* change in the response */ 10945681Sbostic #define RSF_OFFSET 11 /* CIM header, offset for RSF */ 11045681Sbostic #define DPN_OFFSET 13 /* alloc cmd offset for dpn */ 11145681Sbostic #define TYPE_OFFSET 17 /* alloc cmd offset for path type */ 11245681Sbostic 11345681Sbostic #define LOOP_OFFSET 16 /* set system parms, loopback */ 11445681Sbostic #define DTE_OFFSET 18 /* set system parms, dte/dce mode */ 11545681Sbostic #define BAUD_OFFSET 20 /* set system parms, dte/dce mode */ 11645681Sbostic #define CLOCK_OFFSET 25 /* set system parms, dte/dce mode */ 11745681Sbostic #define DOWN_OFFSET 26 /* set system parms, line down */ 11845681Sbostic 11945681Sbostic #define INIT_OK 0x10 /* send line up CIM to front end */ 12045681Sbostic 12145681Sbostic /****************************************************************************/ 12245681Sbostic /* Most of the following defines were extracted from front end software */ 12345681Sbostic /* source include files cim.h, cimdef.h, and params.h on 21-NOV-1985. This */ 12445681Sbostic /* will ensure that the host and front end are using the same definitions. */ 12545681Sbostic /****************************************************************************/ 12645681Sbostic 12745681Sbostic /* Parameter Modification Commands for Set HDLC System Paramters command */ 12845681Sbostic 12945681Sbostic #define DCE_OR_DTE 0x43 /* HDLC: select DCE/DTE mode */ 13045681Sbostic #define DTE_MODE 0x00 /* specify DTE mode */ 13145681Sbostic #define DCE_MODE 0x01 /* specify DCE mode */ 13245681Sbostic 13345681Sbostic #define DTE_ADDR 0x04 /* HDLC: DTE frame address */ 13445681Sbostic #define DCE_ADDR 0x05 /* HDLC: DCE frame address */ 13545681Sbostic #define IFRAME_T_O 0x06 /* HDLC: T1 after I-frame */ 13645681Sbostic #define POLL_T_O 0x07 /* HDLC: T1 after poll cmd */ 13745681Sbostic #define ADM_T_O 0x08 /* HDLC: T1 for down link */ 13845681Sbostic #define RETRY_LIMIT 0x0a /* HDLC: N2 counter */ 13945681Sbostic #define WATCHDOG_T_O 0x0b /* phys: max transmit time */ 14045681Sbostic #define PKT_SIZE 0x10 /* X.25: packet size */ 14145681Sbostic #define PKT_WINDOW 0x11 /* X.25: packet window */ 14245681Sbostic #define PKT_TIMEOUT 0x12 /* X.25: packet timeout */ 14345681Sbostic #define UPPER_THRESH 0x13 /* HDLC queue limits: upper */ 14445681Sbostic #define LOWER_THRESH 0x14 /* lower */ 14545681Sbostic #define WHICH_PROTOCOL 0x15 /* protocol above HDLC: */ 14645681Sbostic #define PRMVAL_HDH 0x01 /* HDH */ 14745681Sbostic #define PRMVAL_HDLC 0x02 /* none (bare HDLC) */ 14845681Sbostic #define PRMVAL_X25 0x03 /* X.25 packet level */ 14945681Sbostic #define IMP_OR_HOST 0x16 /* HDH: select IMP/host mode */ 15045681Sbostic #define PKT_OR_MSG 0x17 /* HDH: select packet/msg mode */ 15145681Sbostic #define SEND_TIMER 0x18 /* HDH send timer */ 15245681Sbostic #define RESPONSE_TIMER 0x19 /* HDH response timer */ 15345681Sbostic #define HLD_TMR 0x1A /* HDH */ 15445681Sbostic #define MISSES 0x1B /* HDH */ 15545681Sbostic #define HITS 0x1C /* HDH */ 15645681Sbostic #define SEND_WINDOW 0x1D /* HDH */ 15745681Sbostic #define MAXIFRM_XMIT 0x1e /* HDLC: queue to transmitter */ 15845681Sbostic #define FRAME_SPACE 0x1f /* phys: interframe spacing */ 15945681Sbostic #define FRAME_SIZE 0x20 /* HDLC: frame size */ 16045681Sbostic #define FRAME_WINDOW 0x21 /* HDLC: transmit frame window */ 16145681Sbostic #define EXTERNAL_CLOCK 0x00 /* clock generated externally */ 16245681Sbostic #define INTERNAL_CLOCK 0x01 /* clock generated internally */ 16345681Sbostic 16445681Sbostic #define SUCCESS 0 16545681Sbostic #define FAILURE 1 16645681Sbostic 16745681Sbostic /* Path types */ 16845681Sbostic 16945681Sbostic #define TYPE_DATA 0x01 /* Path type of DATA */ 17045681Sbostic #define TYPE_CNTL 0x02 /* Path type of CONTROL */ 17145681Sbostic 17245681Sbostic 17345681Sbostic /* Command Codes used in CIMs */ 17445681Sbostic 17545681Sbostic /* Allocation Facility Commands */ 17645681Sbostic #define CMD_ALLOC 0x22 /* Allocate Path */ 17745681Sbostic #define CMD_DEALLOC 0x24 /* Deallocate Path */ 17845681Sbostic 17945681Sbostic /* Allocation Facility Responses */ 18045681Sbostic /* Note that the response value */ 18145681Sbostic /* is the command value + 1 */ 18245681Sbostic #define RSP_ALLOC 0x23 /* Allocate Path */ 18345681Sbostic #define RSP_DEALLOC 0x25 /* Deallocate Path */ 18445681Sbostic #define RSP_SSP 0x63 /* Set Sys Params */ 18545681Sbostic #define RSP_FLUP 0x65 /* Frame Level Up */ 18645681Sbostic #define RSP_FLDWN 0x67 /* Frame Level Down */ 18745681Sbostic 18845681Sbostic /* System Facility Commands */ 18945681Sbostic #define CMD_BFINIT 0x42 /* Buffer Initialization */ 19045681Sbostic #define CMD_BFQRY 0x44 /* Buffer Query */ 19145681Sbostic #define CMD_FACQRY 0x46 /* Facility Query */ 19245681Sbostic #define CMD_MEMRD 0x48 /* Memory Read */ 19345681Sbostic #define CMD_MEMWRT 0x4A /* Memory Write */ 19445681Sbostic 19545681Sbostic /* HDLC Facility Commands */ 19645681Sbostic #define CMD_SSP 0x62 /* Set HDLC Parameters */ 19745681Sbostic #define CMD_FLUP 0x64 /* Frame Level Up */ 19845681Sbostic #define CMD_FLDWN 0x66 /* Frame Level Down */ 19945681Sbostic #define CMD_STAQRY 0x68 /* Statistics Query */ 20045681Sbostic #define CMD_FRMQRY 0x6A /* Frame Level Status Query */ 20145681Sbostic 20245681Sbostic /* DCP Driver Commands */ 20345681Sbostic #define CMD_ERST 0x02 /* Reset Encryption */ 20445681Sbostic #define CMD_DRST 0x04 /* Reset Decryption */ 20545681Sbostic #define CMD_ESTA 0x06 /* Start Encryption */ 20645681Sbostic #define CMD_DSTA 0x08 /* Start Decryption */ 20745681Sbostic #define CMD_ESET 0x0A /* Set Encryption */ 20845681Sbostic #define CMD_DSET 0x0C /* Set Decryption */ 20945681Sbostic #define CMD_ESTOP 0x0E /* Stop Encryption */ 21045681Sbostic #define CMD_DSTOP 0x10 /* Stop Decryption */ 21145681Sbostic #define CMD_DCPERR 0x7E /* DCP Error Detected */ 21245681Sbostic 21345681Sbostic /* Facility Codes used in CIMs */ 21445681Sbostic 21545681Sbostic /* Symbol FAC Code Facility */ 21645681Sbostic 21745681Sbostic #define FAC_NONE 0x00 /* No Facility assigned */ 21845681Sbostic #define FAC_ALLOC 0x01 /* Allocation facility */ 21945681Sbostic #define FAC_SYS 0x02 /* System query/response facility */ 22045681Sbostic #define FAC_HDLC 0x03 /* HDLC facility */ 22145681Sbostic #define FAC_DCP 0x04 /* Data Encryption Facility */ 22245681Sbostic #define MAX_FAC 4 /* Maximum facility number */ 22345681Sbostic 22445681Sbostic /* RSF Codes used in CIMs */ 22545681Sbostic 22645681Sbostic 22745681Sbostic /* RSF Symbol RSF Code Response Description */ 22845681Sbostic /* (decimal) */ 22945681Sbostic 23045681Sbostic #define RSF_SUCC 0 /* Success */ 23145681Sbostic #define RSF_LONG 1 /* Command is too long */ 23245681Sbostic #define RSF_SHORT 2 /* Command is too short */ 23345681Sbostic #define RSF_NOTSUPP 3 /* Request not supported */ 23445681Sbostic #define RSF_DATA_NA 4 /* Buffer contains data-Not allowed */ 23545681Sbostic #define RSF_NOCNTL 5 /* Control Path must be allocated 1st */ 23645681Sbostic #define RSF_NOFAC 6 /* Facility unavailable for allocation */ 23745681Sbostic #define RSF_FACPTH 7 /* Path cannot be allocated for facility */ 23845681Sbostic #define RSF_NOBUF 8 /* No buffers available */ 23945681Sbostic #define RSF_INVDPN 10 /* Invalid Data Path Number */ 24045681Sbostic #define RSF_INVCMD 11 /* Invalid Command */ 24145681Sbostic #define RSF_INVTYP 12 /* Invalid path type */ 24245681Sbostic #define RSF_INVFAC 13 /* Invalid facility */ 24345681Sbostic #define RSF_DPNOOR 20 /* DPN out of range */ 24445681Sbostic #define RSF_PTHEXC 21 /* Maximum number of paths exceeded */ 24545681Sbostic #define RSF_NOTALLOC 23 /* Path not allocated */ 24645681Sbostic #define RSF_BFROOR 30 /* Buffer size out of range */ 24745681Sbostic #define RSF_SEGBFR 31 /* Segmented Buffers implemented */ 24845681Sbostic #define RSF_BFQEXC 32 /* Too many Buffer queues requested */ 24945681Sbostic #define RSF_INVADR 40 /* Invalid ACP 6100 Address */ 25045681Sbostic #define RSF_INVCNT 41 /* Byte count Invalid */ 25145681Sbostic #define RSF_INVPID 50 /* Parameter ID Unknown */ 25245681Sbostic #define RSF_INVVAL 51 /* Invalid Value */ 25345681Sbostic #define RSF_PTLVAL 52 /* Partial Value */ 25445681Sbostic #define RSF_BDPRTY 61 /* Bad parity for Key; one or more */ 25545681Sbostic /* Key bytes had bad (even) parity */ 25645681Sbostic #define RSF_NOSET 62 /* No Set Command given */ 25745681Sbostic #define RSF_INVMOD 63 /* Invalid Mode in Set command */ 25845681Sbostic #define RSF_INACT 64 /* Inactive-Stop issued for operation */ 25945681Sbostic /* that's not Started */ 26045681Sbostic #define RSF_ACTIVE 66 /* Active; operation was not Stopped */ 26145681Sbostic #define RSF_ERROR 67 /* Error condition: send Reset(s) */ 26245681Sbostic #define RSF_DCPSTER 70 /* DCP chip error, bad status after */ 26345681Sbostic /* Start command */ 26445681Sbostic #define RSF_DCPMODE 71 /* DCP chip error, bad status after */ 26545681Sbostic /* mode set */ 26645681Sbostic #define RSF_DCPRESET 73 /* DCP chip error, bad status */ 26745681Sbostic /* after software reset */ 26845681Sbostic #define RSF_DCPTRN 74 /* DMAC chip error detected; DMAC */ 26945681Sbostic /* malfunction during data transfer */ 270