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