Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /* |
2 | * HISTORY | |
3 | * $Log: scsi_disk.h,v $ | |
4 | * Revision 1.2 1992/10/13 03:14:21 julian | |
5 | * added the load-eject field in 'start/stop' for removable devices. | |
6 | * | |
7 | * Revision 1.1 1992/09/26 22:11:29 julian | |
8 | * Initial revision | |
9 | * | |
10 | * | |
11 | * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE | |
12 | * -------------------- ----- ---------------------- | |
13 | * CURRENT PATCH LEVEL: 1 00098 | |
14 | * -------------------- ----- ---------------------- | |
15 | * | |
16 | * 16 Feb 93 Julian Elischer ADDED for SCSI system | |
17 | * | |
18 | */ | |
19 | ||
20 | /* | |
21 | * SCSI interface description | |
22 | */ | |
23 | ||
24 | /* | |
25 | * Some lines of this file comes from a file of the name "scsi.h" | |
26 | * distributed by OSF as part of mach2.5, | |
27 | * so the following disclaimer has been kept. | |
28 | * | |
29 | * Copyright 1990 by Open Software Foundation, | |
30 | * Grenoble, FRANCE | |
31 | * | |
32 | * All Rights Reserved | |
33 | * | |
34 | * Permission to use, copy, modify, and distribute this software and | |
35 | * its documentation for any purpose and without fee is hereby granted, | |
36 | * provided that the above copyright notice appears in all copies and | |
37 | * that both the copyright notice and this permission notice appear in | |
38 | * supporting documentation, and that the name of OSF or Open Software | |
39 | * Foundation not be used in advertising or publicity pertaining to | |
40 | * distribution of the software without specific, written prior | |
41 | * permission. | |
42 | * | |
43 | * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE | |
44 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, | |
45 | * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR | |
46 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | |
47 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, | |
48 | * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | |
49 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
50 | */ | |
51 | ||
52 | /* | |
53 | * Largely written by Julian Elischer (julian@tfs.com) | |
54 | * for TRW Financial Systems. | |
55 | * | |
56 | * TRW Financial Systems, in accordance with their agreement with Carnegie | |
57 | * Mellon University, makes this software available to CMU to distribute | |
58 | * or use in any manner that they see fit as long as this message is kept with | |
59 | * the software. For this reason TFS also grants any other persons or | |
60 | * organisations permission to use or modify this software. | |
61 | * | |
62 | * TFS supplies this software to be publicly redistributed | |
63 | * on the understanding that TFS is not responsible for the correct | |
64 | * functioning of this software in any circumstances. | |
65 | * | |
66 | */ | |
67 | ||
68 | /* | |
69 | * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 | |
70 | */ | |
71 | ||
72 | /* | |
73 | * SCSI command format | |
74 | */ | |
75 | ||
76 | ||
77 | struct scsi_reassign_blocks | |
78 | { | |
79 | u_char op_code; | |
80 | u_char :5; | |
81 | u_char lun:3; | |
82 | u_char unused[3]; | |
83 | u_char link:1; | |
84 | u_char flag:1; | |
85 | u_char :6; | |
86 | }; | |
87 | ||
88 | struct scsi_rw | |
89 | { | |
90 | u_char op_code; | |
91 | u_char addr_2:5; /* Most significant */ | |
92 | u_char lun:3; | |
93 | u_char addr_1; | |
94 | u_char addr_0; /* least significant */ | |
95 | u_char length; | |
96 | u_char link:1; | |
97 | u_char flag:1; | |
98 | u_char :6; | |
99 | }; | |
100 | ||
101 | struct scsi_rw_big | |
102 | { | |
103 | u_char op_code; | |
104 | u_char rel_addr:1; | |
105 | u_char :4; /* Most significant */ | |
106 | u_char lun:3; | |
107 | u_char addr_3; | |
108 | u_char addr_2; | |
109 | u_char addr_1; | |
110 | u_char addr_0; /* least significant */ | |
111 | u_char reserved;; | |
112 | u_char length2; | |
113 | u_char length1; | |
114 | u_char link:1; | |
115 | u_char flag:1; | |
116 | u_char :4; | |
117 | u_char vendor:2; | |
118 | }; | |
119 | ||
120 | struct scsi_read_capacity | |
121 | { | |
122 | u_char op_code; | |
123 | u_char :5; | |
124 | u_char lun:3; | |
125 | u_char addr_3; /* Most Significant */ | |
126 | u_char addr_2; | |
127 | u_char addr_1; | |
128 | u_char addr_0; /* Least Significant */ | |
129 | u_char unused[3]; | |
130 | u_char link:1; | |
131 | u_char flag:1; | |
132 | u_char :6; | |
133 | }; | |
134 | ||
135 | struct scsi_start_stop | |
136 | { | |
137 | u_char op_code; | |
138 | u_char :5; | |
139 | u_char lun:3; | |
140 | u_char unused[2]; | |
141 | u_char start:1; | |
142 | u_char loej:1; | |
143 | u_char :6; | |
144 | u_char link:1; | |
145 | u_char flag:1; | |
146 | u_char :6; | |
147 | }; | |
148 | ||
149 | ||
150 | ||
151 | /* | |
152 | * Opcodes | |
153 | */ | |
154 | ||
155 | #define REASSIGN_BLOCKS 0x07 | |
156 | #define READ_COMMAND 0x08 | |
157 | #define WRITE_COMMAND 0x0a | |
158 | #define MODE_SELECT 0x15 | |
159 | #define MODE_SENSE 0x1a | |
160 | #define START_STOP 0x1b | |
161 | #define PREVENT_ALLOW 0x1e | |
162 | #define READ_CAPACITY 0x25 | |
163 | #define READ_BIG 0x28 | |
164 | #define WRITE_BIG 0x2a | |
165 | ||
166 | ||
167 | ||
168 | struct scsi_read_cap_data | |
169 | { | |
170 | u_char addr_3; /* Most significant */ | |
171 | u_char addr_2; | |
172 | u_char addr_1; | |
173 | u_char addr_0; /* Least significant */ | |
174 | u_char length_3; /* Most significant */ | |
175 | u_char length_2; | |
176 | u_char length_1; | |
177 | u_char length_0; /* Least significant */ | |
178 | }; | |
179 | ||
180 | struct scsi_reassign_blocks_data | |
181 | { | |
182 | u_char reserved[2]; | |
183 | u_char length_msb; | |
184 | u_char length_lsb; | |
185 | struct | |
186 | { | |
187 | u_char dlbaddr_3; /* defect logical block address (MSB) */ | |
188 | u_char dlbaddr_2; | |
189 | u_char dlbaddr_1; | |
190 | u_char dlbaddr_0; /* defect logical block address (LSB) */ | |
191 | } defect_descriptor[1]; | |
192 | }; | |
193 | ||
194 | union disk_pages /* this is the structure copied from osf */ | |
195 | { | |
196 | struct page_disk_format { | |
197 | u_char pg_code:6; /* page code (should be 3) */ | |
198 | u_char :2; | |
199 | u_char pg_length; /* page length (should be 0x16) */ | |
200 | u_char trk_z_1; /* tracks per zone (MSB) */ | |
201 | u_char trk_z_0; /* tracks per zone (LSB) */ | |
202 | u_char alt_sec_1; /* alternate sectors per zone (MSB) */ | |
203 | u_char alt_sec_0; /* alternate sectors per zone (LSB) */ | |
204 | u_char alt_trk_z_1; /* alternate tracks per zone (MSB) */ | |
205 | u_char alt_trk_z_0; /* alternate tracks per zone (LSB) */ | |
206 | u_char alt_trk_v_1; /* alternate tracks per volume (MSB) */ | |
207 | u_char alt_trk_v_0; /* alternate tracks per volume (LSB) */ | |
208 | u_char ph_sec_t_1; /* physical sectors per track (MSB) */ | |
209 | u_char ph_sec_t_0; /* physical sectors per track (LSB) */ | |
210 | u_char bytes_s_1; /* bytes per sector (MSB) */ | |
211 | u_char bytes_s_0; /* bytes per sector (LSB) */ | |
212 | u_char interleave_1;/* interleave (MSB) */ | |
213 | u_char interleave_0;/* interleave (LSB) */ | |
214 | u_char trk_skew_1; /* track skew factor (MSB) */ | |
215 | u_char trk_skew_0; /* track skew factor (LSB) */ | |
216 | u_char cyl_skew_1; /* cylinder skew (MSB) */ | |
217 | u_char cyl_skew_0; /* cylinder skew (LSB) */ | |
218 | u_char reserved1:4; | |
219 | u_char surf:1; | |
220 | u_char rmb:1; | |
221 | u_char hsec:1; | |
222 | u_char ssec:1; | |
223 | u_char reserved2; | |
224 | u_char reserved3; | |
225 | } disk_format; | |
226 | struct page_rigid_geometry { | |
227 | u_char pg_code:7; /* page code (should be 4) */ | |
228 | u_char mbone:1; /* must be one */ | |
229 | u_char pg_length; /* page length (should be 0x16) */ | |
230 | u_char ncyl_2; /* number of cylinders (MSB) */ | |
231 | u_char ncyl_1; /* number of cylinders */ | |
232 | u_char ncyl_0; /* number of cylinders (LSB) */ | |
233 | u_char nheads; /* number of heads */ | |
234 | u_char st_cyl_wp_2; /* starting cyl., write precomp (MSB) */ | |
235 | u_char st_cyl_wp_1; /* starting cyl., write precomp */ | |
236 | u_char st_cyl_wp_0; /* starting cyl., write precomp (LSB) */ | |
237 | u_char st_cyl_rwc_2;/* starting cyl., red. write cur (MSB)*/ | |
238 | u_char st_cyl_rwc_1;/* starting cyl., red. write cur */ | |
239 | u_char st_cyl_rwc_0;/* starting cyl., red. write cur (LSB)*/ | |
240 | u_char driv_step_1; /* drive step rate (MSB) */ | |
241 | u_char driv_step_0; /* drive step rate (LSB) */ | |
242 | u_char land_zone_2; /* landing zone cylinder (MSB) */ | |
243 | u_char land_zone_1; /* landing zone cylinder */ | |
244 | u_char land_zone_0; /* landing zone cylinder (LSB) */ | |
245 | u_char reserved1; | |
246 | u_char reserved2; | |
247 | u_char reserved3; | |
248 | } rigid_geometry; | |
249 | } ; |