141480Smckusick /* 2*63151Sbostic * Copyright (c) 1982, 1990, 1993 3*63151Sbostic * The Regents of the University of California. All rights reserved. 441480Smckusick * 541480Smckusick * %sccs.include.redist.c% 641480Smckusick * 7*63151Sbostic * @(#)ctreg.h 8.1 (Berkeley) 06/10/93 841480Smckusick */ 941480Smckusick 1041480Smckusick struct ct_iocmd { 1141480Smckusick char unit; 1241480Smckusick char saddr; 1341480Smckusick short addr0; 1441480Smckusick long addr; 1541480Smckusick char nop2; 1641480Smckusick char slen; 1741480Smckusick long len; 1841480Smckusick char nop3; 1941480Smckusick char cmd; 2041480Smckusick }; 2141480Smckusick 2241480Smckusick struct ct_rscmd { 2341480Smckusick char unit; 2441480Smckusick char cmd; 2541480Smckusick }; 2641480Smckusick 2741480Smckusick struct ct_stat { 2841480Smckusick char c_vu; 2941480Smckusick char c_pend; 3041480Smckusick short c_ref; 3141480Smckusick short c_fef; 3241480Smckusick short c_aef; 3341480Smckusick short c_ief; 3441480Smckusick short c_blk0; 3541480Smckusick long c_blk; 3641480Smckusick char c_pad[4]; 3741480Smckusick }; 3841480Smckusick 3941480Smckusick struct ct_ssmcmd { 4041480Smckusick char unit; 4141480Smckusick char cmd; 4241480Smckusick short refm; 4341480Smckusick short fefm; 4441480Smckusick short aefm; 4541480Smckusick short iefm; 4641480Smckusick }; 4741480Smckusick 4841480Smckusick struct ct_srcmd { 4941480Smckusick char unit; 5041480Smckusick char nop; 5141480Smckusick char cmd; 5241480Smckusick char param; 5341480Smckusick }; 5441480Smckusick 5541480Smckusick struct ct_soptcmd { 5641480Smckusick char unit; 5741480Smckusick char nop; 5841480Smckusick char cmd; 5941480Smckusick char opt; 6041480Smckusick }; 6141480Smckusick 6241480Smckusick struct ct_ulcmd { 6341480Smckusick char unit; 6441480Smckusick char cmd; 6541480Smckusick }; 6641480Smckusick 6741480Smckusick struct ct_wfmcmd { 6841480Smckusick char unit; 6941480Smckusick char cmd; 7041480Smckusick }; 7141480Smckusick 7241480Smckusick struct ct_clearcmd { 7341480Smckusick char unit; 7441480Smckusick char cmd; 7541480Smckusick }; 7641480Smckusick 7741480Smckusick struct ct_describe { 7841480Smckusick u_int d_iuw:16, /* controller: installed unit word */ 7941480Smckusick d_cmaxxfr:16, /* controller: max transfer rate (Kb) */ 8041480Smckusick d_ctype:8, /* controller: controller type */ 8141480Smckusick d_utype:8, /* unit: unit type */ 8241480Smckusick d_name:24, /* unit: name (6 BCD digits) */ 8341480Smckusick d_sectsize:16, /* unit: # of bytes per block (sector) */ 8441480Smckusick d_blkbuf:8, /* unit: # of blocks which can be buffered */ 8541480Smckusick d_burstsize:8, /* unit: recommended burst size */ 8641480Smckusick d_blocktime:16, /* unit: block time (u-sec) */ 8741480Smckusick d_uavexfr:16, /* unit: average transfer rate (Kb) */ 8841480Smckusick d_retry:16, /* unit: optimal retry time (1/100-sec) */ 8941480Smckusick d_access:16, /* unit: access time param (1/100-sec) */ 9041480Smckusick d_maxint:8, /* unit: maximum interleave */ 9141480Smckusick d_fvbyte:8, /* unit: fixed volume byte */ 9241480Smckusick d_rvbyte:8, /* unit: removeable volume byte */ 9341480Smckusick d_maxcyl:24, /* volume: maximum cylinder */ 9441480Smckusick d_maxhead:8, /* volume: maximum head */ 9541480Smckusick d_maxsect:16, /* volume: maximum sector on track */ 9641480Smckusick d_maxvsecth:16, /* volume: maximum sector on volume (MSW) */ 9741480Smckusick d_maxvsectl:32, /* volume: maximum sector on volume (LSWs) */ 9841480Smckusick d_interleave:8; /* volume: current interleave */ 9941480Smckusick }; 10041480Smckusick 10141480Smckusick #define CT7946ID 0x220 10241480Smckusick #define CT9145ID 0x268 10341480Smckusick #define CT9144ID 0x260 10441480Smckusick #define CT9144 0 10541480Smckusick #define CT7912PID 0x209 10641480Smckusick #define CT7914PID 0x20B 10741480Smckusick #define CT88140 1 10841480Smckusick 10941480Smckusick /* convert bytes to 1k tape block and back */ 11041480Smckusick #define CTBTOK(x) ((x) >> 10) 11141480Smckusick #define CTKTOB(x) ((x) << 10) 11241480Smckusick 11341480Smckusick #define CTCTLR 15 11441480Smckusick 11541480Smckusick #define REF_MASK 0x0 11641480Smckusick #define FEF_MASK 0x0 11741480Smckusick #define AEF_MASK 0x0 11841480Smckusick #define IEF_MASK 0xF970 11941480Smckusick 12041480Smckusick #define FEF_PF 0x0002 12141480Smckusick #define FEF_REXMT 0x0001 12241480Smckusick #define AEF_EOF 0x0010 12341480Smckusick #define AEF_EOV 0x0008 12441480Smckusick 12541480Smckusick #define C_READ 0x00 12641480Smckusick #define C_WRITE 0x02 12741480Smckusick #define C_CLEAR 0x08 12841480Smckusick #define C_STATUS 0x0d 12941480Smckusick #define C_SADDR 0x10 13041480Smckusick #define C_SLEN 0x18 13141480Smckusick #define C_SUNIT(x) (0x20 | (x)) 13241480Smckusick #define C_SVOL(x) (0x40 | (x)) 13341480Smckusick #define C_NOP 0x34 13441480Smckusick #define C_DESC 0x35 13541480Smckusick #define C_SOPT 0x38 13641480Smckusick #define C_SREL 0x3b 13741480Smckusick #define C_SSM 0x3e 13841480Smckusick #define C_WFM 0x49 13941480Smckusick #define C_UNLOAD 0x4a 14041480Smckusick #define C_REL 0x140 14141480Smckusick 14241480Smckusick #define C_CMD 0x05 14341480Smckusick #define C_EXEC 0x0e 14441480Smckusick #define C_QSTAT 0x10 14541480Smckusick #define C_TCMD 0x12 14641480Smckusick 14741480Smckusick #define C_CC 1 14841480Smckusick #define C_SKSPAR 2 14941480Smckusick #define C_OPT 4 15041480Smckusick #define C_SPAR 4 15141480Smckusick #define C_IMRPT 8 152