1 /* 2 * Copyright (c) 1982, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)ctreg.h 8.1 (Berkeley) 06/10/93 8 */ 9 10 struct ct_iocmd { 11 char unit; 12 char saddr; 13 short addr0; 14 long addr; 15 char nop2; 16 char slen; 17 long len; 18 char nop3; 19 char cmd; 20 }; 21 22 struct ct_rscmd { 23 char unit; 24 char cmd; 25 }; 26 27 struct ct_stat { 28 char c_vu; 29 char c_pend; 30 short c_ref; 31 short c_fef; 32 short c_aef; 33 short c_ief; 34 short c_blk0; 35 long c_blk; 36 char c_pad[4]; 37 }; 38 39 struct ct_ssmcmd { 40 char unit; 41 char cmd; 42 short refm; 43 short fefm; 44 short aefm; 45 short iefm; 46 }; 47 48 struct ct_srcmd { 49 char unit; 50 char nop; 51 char cmd; 52 char param; 53 }; 54 55 struct ct_soptcmd { 56 char unit; 57 char nop; 58 char cmd; 59 char opt; 60 }; 61 62 struct ct_ulcmd { 63 char unit; 64 char cmd; 65 }; 66 67 struct ct_wfmcmd { 68 char unit; 69 char cmd; 70 }; 71 72 struct ct_clearcmd { 73 char unit; 74 char cmd; 75 }; 76 77 struct ct_describe { 78 u_int d_iuw:16, /* controller: installed unit word */ 79 d_cmaxxfr:16, /* controller: max transfer rate (Kb) */ 80 d_ctype:8, /* controller: controller type */ 81 d_utype:8, /* unit: unit type */ 82 d_name:24, /* unit: name (6 BCD digits) */ 83 d_sectsize:16, /* unit: # of bytes per block (sector) */ 84 d_blkbuf:8, /* unit: # of blocks which can be buffered */ 85 d_burstsize:8, /* unit: recommended burst size */ 86 d_blocktime:16, /* unit: block time (u-sec) */ 87 d_uavexfr:16, /* unit: average transfer rate (Kb) */ 88 d_retry:16, /* unit: optimal retry time (1/100-sec) */ 89 d_access:16, /* unit: access time param (1/100-sec) */ 90 d_maxint:8, /* unit: maximum interleave */ 91 d_fvbyte:8, /* unit: fixed volume byte */ 92 d_rvbyte:8, /* unit: removeable volume byte */ 93 d_maxcyl:24, /* volume: maximum cylinder */ 94 d_maxhead:8, /* volume: maximum head */ 95 d_maxsect:16, /* volume: maximum sector on track */ 96 d_maxvsecth:16, /* volume: maximum sector on volume (MSW) */ 97 d_maxvsectl:32, /* volume: maximum sector on volume (LSWs) */ 98 d_interleave:8; /* volume: current interleave */ 99 }; 100 101 #define CT7946ID 0x220 102 #define CT9145ID 0x268 103 #define CT9144ID 0x260 104 #define CT9144 0 105 #define CT7912PID 0x209 106 #define CT7914PID 0x20B 107 #define CT88140 1 108 109 /* convert bytes to 1k tape block and back */ 110 #define CTBTOK(x) ((x) >> 10) 111 #define CTKTOB(x) ((x) << 10) 112 113 #define CTCTLR 15 114 115 #define REF_MASK 0x0 116 #define FEF_MASK 0x0 117 #define AEF_MASK 0x0 118 #define IEF_MASK 0xF970 119 120 #define FEF_PF 0x0002 121 #define FEF_REXMT 0x0001 122 #define AEF_EOF 0x0010 123 #define AEF_EOV 0x0008 124 125 #define C_READ 0x00 126 #define C_WRITE 0x02 127 #define C_CLEAR 0x08 128 #define C_STATUS 0x0d 129 #define C_SADDR 0x10 130 #define C_SLEN 0x18 131 #define C_SUNIT(x) (0x20 | (x)) 132 #define C_SVOL(x) (0x40 | (x)) 133 #define C_NOP 0x34 134 #define C_DESC 0x35 135 #define C_SOPT 0x38 136 #define C_SREL 0x3b 137 #define C_SSM 0x3e 138 #define C_WFM 0x49 139 #define C_UNLOAD 0x4a 140 #define C_REL 0x140 141 142 #define C_CMD 0x05 143 #define C_EXEC 0x0e 144 #define C_QSTAT 0x10 145 #define C_TCMD 0x12 146 147 #define C_CC 1 148 #define C_SKSPAR 2 149 #define C_OPT 4 150 #define C_SPAR 4 151 #define C_IMRPT 8 152