ctreg.h revision 1.3 1 1.1 cgd /*
2 1.3 mycroft * Copyright (c) 1982, 1990, 1993
3 1.3 mycroft * The Regents of the University of California. All rights reserved.
4 1.1 cgd *
5 1.1 cgd * Redistribution and use in source and binary forms, with or without
6 1.1 cgd * modification, are permitted provided that the following conditions
7 1.1 cgd * are met:
8 1.1 cgd * 1. Redistributions of source code must retain the above copyright
9 1.1 cgd * notice, this list of conditions and the following disclaimer.
10 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
11 1.1 cgd * notice, this list of conditions and the following disclaimer in the
12 1.1 cgd * documentation and/or other materials provided with the distribution.
13 1.1 cgd * 3. All advertising materials mentioning features or use of this software
14 1.1 cgd * must display the following acknowledgement:
15 1.1 cgd * This product includes software developed by the University of
16 1.1 cgd * California, Berkeley and its contributors.
17 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
18 1.1 cgd * may be used to endorse or promote products derived from this software
19 1.1 cgd * without specific prior written permission.
20 1.1 cgd *
21 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1 cgd * SUCH DAMAGE.
32 1.1 cgd *
33 1.3 mycroft * from: @(#)ctreg.h 8.1 (Berkeley) 6/10/93
34 1.2 mycroft * $Id: ctreg.h,v 1.3 1994/05/23 05:58:29 mycroft Exp $
35 1.1 cgd */
36 1.1 cgd
37 1.1 cgd struct ct_iocmd {
38 1.1 cgd char unit;
39 1.1 cgd char saddr;
40 1.1 cgd short addr0;
41 1.1 cgd long addr;
42 1.1 cgd char nop2;
43 1.1 cgd char slen;
44 1.1 cgd long len;
45 1.1 cgd char nop3;
46 1.1 cgd char cmd;
47 1.1 cgd };
48 1.1 cgd
49 1.1 cgd struct ct_rscmd {
50 1.1 cgd char unit;
51 1.1 cgd char cmd;
52 1.1 cgd };
53 1.1 cgd
54 1.1 cgd struct ct_stat {
55 1.1 cgd char c_vu;
56 1.1 cgd char c_pend;
57 1.1 cgd short c_ref;
58 1.1 cgd short c_fef;
59 1.1 cgd short c_aef;
60 1.1 cgd short c_ief;
61 1.1 cgd short c_blk0;
62 1.1 cgd long c_blk;
63 1.1 cgd char c_pad[4];
64 1.1 cgd };
65 1.1 cgd
66 1.1 cgd struct ct_ssmcmd {
67 1.1 cgd char unit;
68 1.1 cgd char cmd;
69 1.1 cgd short refm;
70 1.1 cgd short fefm;
71 1.1 cgd short aefm;
72 1.1 cgd short iefm;
73 1.1 cgd };
74 1.1 cgd
75 1.1 cgd struct ct_srcmd {
76 1.1 cgd char unit;
77 1.1 cgd char nop;
78 1.1 cgd char cmd;
79 1.1 cgd char param;
80 1.1 cgd };
81 1.1 cgd
82 1.1 cgd struct ct_soptcmd {
83 1.1 cgd char unit;
84 1.1 cgd char nop;
85 1.1 cgd char cmd;
86 1.1 cgd char opt;
87 1.1 cgd };
88 1.1 cgd
89 1.1 cgd struct ct_ulcmd {
90 1.1 cgd char unit;
91 1.1 cgd char cmd;
92 1.1 cgd };
93 1.1 cgd
94 1.1 cgd struct ct_wfmcmd {
95 1.1 cgd char unit;
96 1.1 cgd char cmd;
97 1.1 cgd };
98 1.1 cgd
99 1.1 cgd struct ct_clearcmd {
100 1.1 cgd char unit;
101 1.1 cgd char cmd;
102 1.1 cgd };
103 1.1 cgd
104 1.1 cgd struct ct_describe {
105 1.1 cgd u_int d_iuw:16, /* controller: installed unit word */
106 1.1 cgd d_cmaxxfr:16, /* controller: max transfer rate (Kb) */
107 1.1 cgd d_ctype:8, /* controller: controller type */
108 1.1 cgd d_utype:8, /* unit: unit type */
109 1.1 cgd d_name:24, /* unit: name (6 BCD digits) */
110 1.1 cgd d_sectsize:16, /* unit: # of bytes per block (sector) */
111 1.1 cgd d_blkbuf:8, /* unit: # of blocks which can be buffered */
112 1.1 cgd d_burstsize:8, /* unit: recommended burst size */
113 1.1 cgd d_blocktime:16, /* unit: block time (u-sec) */
114 1.1 cgd d_uavexfr:16, /* unit: average transfer rate (Kb) */
115 1.1 cgd d_retry:16, /* unit: optimal retry time (1/100-sec) */
116 1.1 cgd d_access:16, /* unit: access time param (1/100-sec) */
117 1.1 cgd d_maxint:8, /* unit: maximum interleave */
118 1.1 cgd d_fvbyte:8, /* unit: fixed volume byte */
119 1.1 cgd d_rvbyte:8, /* unit: removeable volume byte */
120 1.1 cgd d_maxcyl:24, /* volume: maximum cylinder */
121 1.1 cgd d_maxhead:8, /* volume: maximum head */
122 1.1 cgd d_maxsect:16, /* volume: maximum sector on track */
123 1.1 cgd d_maxvsecth:16, /* volume: maximum sector on volume (MSW) */
124 1.1 cgd d_maxvsectl:32, /* volume: maximum sector on volume (LSWs) */
125 1.1 cgd d_interleave:8; /* volume: current interleave */
126 1.1 cgd };
127 1.1 cgd
128 1.1 cgd #define CT7946ID 0x220
129 1.1 cgd #define CT9145ID 0x268
130 1.1 cgd #define CT9144ID 0x260
131 1.1 cgd #define CT9144 0
132 1.1 cgd #define CT7912PID 0x209
133 1.1 cgd #define CT7914PID 0x20B
134 1.1 cgd #define CT88140 1
135 1.1 cgd
136 1.1 cgd /* convert bytes to 1k tape block and back */
137 1.1 cgd #define CTBTOK(x) ((x) >> 10)
138 1.1 cgd #define CTKTOB(x) ((x) << 10)
139 1.1 cgd
140 1.1 cgd #define CTCTLR 15
141 1.1 cgd
142 1.1 cgd #define REF_MASK 0x0
143 1.1 cgd #define FEF_MASK 0x0
144 1.1 cgd #define AEF_MASK 0x0
145 1.1 cgd #define IEF_MASK 0xF970
146 1.1 cgd
147 1.1 cgd #define FEF_PF 0x0002
148 1.1 cgd #define FEF_REXMT 0x0001
149 1.1 cgd #define AEF_EOF 0x0010
150 1.1 cgd #define AEF_EOV 0x0008
151 1.1 cgd
152 1.1 cgd #define C_READ 0x00
153 1.1 cgd #define C_WRITE 0x02
154 1.1 cgd #define C_CLEAR 0x08
155 1.1 cgd #define C_STATUS 0x0d
156 1.1 cgd #define C_SADDR 0x10
157 1.1 cgd #define C_SLEN 0x18
158 1.1 cgd #define C_SUNIT(x) (0x20 | (x))
159 1.1 cgd #define C_SVOL(x) (0x40 | (x))
160 1.1 cgd #define C_NOP 0x34
161 1.1 cgd #define C_DESC 0x35
162 1.1 cgd #define C_SOPT 0x38
163 1.1 cgd #define C_SREL 0x3b
164 1.1 cgd #define C_SSM 0x3e
165 1.1 cgd #define C_WFM 0x49
166 1.1 cgd #define C_UNLOAD 0x4a
167 1.1 cgd #define C_REL 0x140
168 1.1 cgd
169 1.1 cgd #define C_CMD 0x05
170 1.1 cgd #define C_EXEC 0x0e
171 1.1 cgd #define C_QSTAT 0x10
172 1.1 cgd #define C_TCMD 0x12
173 1.1 cgd
174 1.1 cgd #define C_CC 1
175 1.1 cgd #define C_SKSPAR 2
176 1.1 cgd #define C_OPT 4
177 1.1 cgd #define C_SPAR 4
178 1.1 cgd #define C_IMRPT 8
179