scsi_tape.h revision 1.3 1 1.1 cgd /*
2 1.2 cgd * SCSI tape interface description
3 1.3 mycroft */
4 1.3 mycroft
5 1.3 mycroft /*
6 1.1 cgd * Written by Julian Elischer (julian (at) tfs.com)
7 1.1 cgd * for TRW Financial Systems.
8 1.1 cgd *
9 1.1 cgd * TRW Financial Systems, in accordance with their agreement with Carnegie
10 1.1 cgd * Mellon University, makes this software available to CMU to distribute
11 1.1 cgd * or use in any manner that they see fit as long as this message is kept with
12 1.1 cgd * the software. For this reason TFS also grants any other persons or
13 1.1 cgd * organisations permission to use or modify this software.
14 1.1 cgd *
15 1.1 cgd * TFS supplies this software to be publicly redistributed
16 1.1 cgd * on the understanding that TFS is not responsible for the correct
17 1.1 cgd * functioning of this software in any circumstances.
18 1.1 cgd *
19 1.1 cgd */
20 1.1 cgd
21 1.1 cgd /*
22 1.1 cgd * Ported to run under 386BSD by Julian Elischer (julian (at) tfs.com) Sept 1992
23 1.3 mycroft *
24 1.3 mycroft * $Id: scsi_tape.h,v 1.3 1994/03/29 04:29:36 mycroft Exp $
25 1.1 cgd */
26 1.3 mycroft #ifndef SCSI_SCSI_TAPE_H
27 1.3 mycroft #define SCSI_SCSI_TAPE_H 1
28 1.3 mycroft
29 1.3 mycroft
30 1.1 cgd
31 1.1 cgd /*
32 1.3 mycroft * SCSI command formats
33 1.1 cgd */
34 1.1 cgd
35 1.1 cgd
36 1.1 cgd struct scsi_rw_tape
37 1.1 cgd {
38 1.1 cgd u_char op_code;
39 1.3 mycroft u_char byte2;
40 1.3 mycroft #define SRWT_FIXED 0x01
41 1.1 cgd u_char len[3];
42 1.3 mycroft u_char control;
43 1.1 cgd } rw_tape;
44 1.1 cgd
45 1.1 cgd struct scsi_space
46 1.1 cgd {
47 1.1 cgd u_char op_code;
48 1.3 mycroft u_char byte2;
49 1.3 mycroft #define SS_CODE 0x03
50 1.1 cgd u_char number[3];
51 1.3 mycroft u_char control;
52 1.1 cgd } space;
53 1.1 cgd #define SP_BLKS 0
54 1.1 cgd #define SP_FILEMARKS 1
55 1.1 cgd #define SP_SEQ_FILEMARKS 2
56 1.1 cgd #define SP_EOM 3
57 1.1 cgd
58 1.1 cgd struct scsi_write_filemarks
59 1.1 cgd {
60 1.1 cgd u_char op_code;
61 1.3 mycroft u_char byte2;
62 1.1 cgd u_char number[3];
63 1.3 mycroft u_char control;
64 1.1 cgd } write_filemarks;
65 1.1 cgd
66 1.1 cgd struct scsi_rewind
67 1.1 cgd {
68 1.1 cgd u_char op_code;
69 1.3 mycroft u_char byte2;
70 1.3 mycroft #define SR_IMMED 0x01
71 1.1 cgd u_char unused[3];
72 1.3 mycroft u_char control;
73 1.1 cgd } rewind;
74 1.1 cgd
75 1.1 cgd struct scsi_load
76 1.1 cgd {
77 1.1 cgd u_char op_code;
78 1.3 mycroft u_char byte2;
79 1.3 mycroft #define SL_IMMED 0x01
80 1.1 cgd u_char unused[2];
81 1.3 mycroft u_char how;
82 1.3 mycroft u_char control;
83 1.1 cgd } load;
84 1.1 cgd #define LD_UNLOAD 0
85 1.1 cgd #define LD_LOAD 1
86 1.3 mycroft #define LD_RETEN 2
87 1.3 mycroft
88 1.1 cgd
89 1.1 cgd struct scsi_blk_limits
90 1.1 cgd {
91 1.1 cgd u_char op_code;
92 1.3 mycroft u_char byte2;
93 1.1 cgd u_char unused[3];
94 1.3 mycroft u_char control;
95 1.1 cgd } blk_limits;
96 1.1 cgd
97 1.1 cgd /*
98 1.1 cgd * Opcodes
99 1.1 cgd */
100 1.1 cgd
101 1.1 cgd #define REWIND 0x01
102 1.1 cgd #define READ_BLK_LIMITS 0x05
103 1.1 cgd #define READ_COMMAND_TAPE 0x08
104 1.1 cgd #define WRITE_COMMAND_TAPE 0x0a
105 1.1 cgd #define WRITE_FILEMARKS 0x10
106 1.1 cgd #define SPACE 0x11
107 1.1 cgd #define LOAD_UNLOAD 0x1b /* same as above */
108 1.1 cgd
109 1.1 cgd
110 1.1 cgd
111 1.1 cgd struct scsi_blk_limits_data
112 1.1 cgd {
113 1.1 cgd u_char reserved;
114 1.1 cgd u_char max_length_2; /* Most significant */
115 1.1 cgd u_char max_length_1;
116 1.1 cgd u_char max_length_0; /* Least significant */
117 1.1 cgd u_char min_length_1; /* Most significant */
118 1.1 cgd u_char min_length_0; /* Least significant */
119 1.1 cgd };
120 1.1 cgd
121 1.3 mycroft /* defines for the device specific byte in the mode select/sense header */
122 1.3 mycroft #define SMH_DSP_SPEED 0x0F
123 1.3 mycroft #define SMH_DSP_BUFF_MODE 0x70
124 1.3 mycroft #define SMH_DSP_BUFF_MODE_OFF 0x00
125 1.3 mycroft #define SMH_DSP_BUFF_MODE_ON 0x10
126 1.3 mycroft #define SMH_DSP_BUFF_MODE_MLTI 0x20
127 1.3 mycroft #define SMH_DSP_WRITE_PROT 0x80
128 1.3 mycroft
129 1.3 mycroft /* A special for the CIPHER ST150S(old drive) */
130 1.3 mycroft struct blk_desc_cipher
131 1.1 cgd {
132 1.3 mycroft u_char density;
133 1.3 mycroft u_char nblocks[3];
134 1.3 mycroft u_char reserved;
135 1.3 mycroft u_char blklen[3];
136 1.3 mycroft u_char other;
137 1.3 mycroft #define ST150_SEC 0x01 /* soft error count */
138 1.3 mycroft #define SR150_AUI 0x02 /* autoload inhibit */
139 1.1 cgd };
140 1.1 cgd
141 1.1 cgd
142 1.1 cgd
143 1.3 mycroft /**********************************************************************
144 1.3 mycroft from the scsi2 spec
145 1.3 mycroft Value Tracks Density(bpi) Code Type Reference Note
146 1.3 mycroft 0x1 9 800 NRZI R X3.22-1983 2
147 1.3 mycroft 0x2 9 1600 PE R X3.39-1986 2
148 1.3 mycroft 0x3 9 6250 GCR R X3.54-1986 2
149 1.3 mycroft 0x5 4/9 8000 GCR C X3.136-1986 1
150 1.3 mycroft 0x6 9 3200 PE R X3.157-1987 2
151 1.3 mycroft 0x7 4 6400 IMFM C X3.116-1986 1
152 1.3 mycroft 0x8 4 8000 GCR CS X3.158-1986 1
153 1.3 mycroft 0x9 18 37871 GCR C X3B5/87-099 2
154 1.3 mycroft 0xA 22 6667 MFM C X3B5/86-199 1
155 1.3 mycroft 0xB 4 1600 PE C X3.56-1986 1
156 1.3 mycroft 0xC 24 12690 GCR C HI-TC1 1,5
157 1.3 mycroft 0xD 24 25380 GCR C HI-TC2 1,5
158 1.3 mycroft 0xF 15 10000 GCR C QIC-120 1,5
159 1.3 mycroft 0x10 18 10000 GCR C QIC-150 1,5
160 1.3 mycroft 0x11 26 16000 GCR C QIC-320(525?) 1,5
161 1.3 mycroft 0x12 30 51667 RLL C QIC-1350 1,5
162 1.3 mycroft 0x13 1 61000 DDS CS X3B5/88-185A 4
163 1.3 mycroft 0x14 1 43245 RLL CS X3.202-1991 4
164 1.3 mycroft 0x15 1 45434 RLL CS ECMA TC17 4
165 1.3 mycroft 0x16 48 10000 MFM C X3.193-1990 1
166 1.3 mycroft 0x17 48 42500 MFM C X3B5/91-174 1
167 1.3 mycroft
168 1.3 mycroft where Code means:
169 1.3 mycroft NRZI Non Return to Zero, change on ones
170 1.3 mycroft GCR Group Code Recording
171 1.3 mycroft PE Phase Encoded
172 1.3 mycroft IMFM Inverted Modified Frequency Modulation
173 1.3 mycroft MFM Modified Frequency Modulation
174 1.3 mycroft DDS Dat Data Storage
175 1.3 mycroft RLL Run Length Encoding
176 1.3 mycroft
177 1.3 mycroft where Type means:
178 1.3 mycroft R Real-to-Real
179 1.3 mycroft C Cartridge
180 1.3 mycroft CS cassette
181 1.3 mycroft
182 1.3 mycroft where Notes means:
183 1.3 mycroft 1 Serial Recorded
184 1.3 mycroft 2 Parallel Recorded
185 1.3 mycroft 3 Old format know as QIC-11
186 1.3 mycroft 4 Helical Scan
187 1.3 mycroft 5 Not ANSI standard, rather industry standard.
188 1.3 mycroft
189 1.3 mycroft ********************************************************************/
190 1.3 mycroft
191 1.3 mycroft #define HALFINCH_800 0x01
192 1.3 mycroft #define HALFINCH_1600 0x02
193 1.3 mycroft #define HALFINCH_6250 0x03
194 1.3 mycroft #define QIC_11 0x04 /* from Archive 150S Theory of Op. XXX */
195 1.3 mycroft #define QIC_24 0x05 /* may be bad, works for CIPHER ST150S XXX */
196 1.3 mycroft #define QIC_120 0x0f
197 1.3 mycroft #define QIC_150 0x10
198 1.3 mycroft #define QIC_320 0x11
199 1.3 mycroft #define QIC_525 0x11
200 1.3 mycroft #define QIC_1320 0x12
201 1.3 mycroft #define DDS 0x13
202 1.3 mycroft #define DAT_1 0x13
203 1.1 cgd
204 1.3 mycroft #endif /*SCSI_SCSI_TAPE_H*/
205