VirtualBox

source: vbox/trunk/include/VBox/scsi.h@ 3633

Last change on this file since 3633 was 3633, checked in by vboxsync, 17 years ago

VBox_hdr_h -> _VBox_hdr_h

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.6 KB
Line 
1/** @file
2 * VirtualBox - SCSI declarations.
3 */
4
5/*
6 * Copyright (C) 2006-2007 innotek GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21#ifndef ___VBox_scsi_h
22#define ___VBox_scsi_h
23
24
25/**
26 * SCSI command opcode identifiers.
27 *
28 * SCSI-3, so far for CD/DVD Logical Units, from Table 49 of the MMC-3 draft standard.
29 */
30typedef enum SCSICMD
31{
32 SCSI_BLANK = 0xa1,
33 SCSI_CLOSE_TRACK_SESSION = 0x5b,
34 SCSI_ERASE_10 = 0x2c,
35 SCSI_FORMAT_UNIT = 0x04,
36 SCSI_GET_CONFIGURATION = 0x46,
37 SCSI_GET_EVENT_STATUS_NOTIFICATION = 0x4a,
38 SCSI_GET_PERFORMANCE = 0xac,
39 /** Inquiry command. */
40 SCSI_INQUIRY = 0x12,
41 SCSI_LOAD_UNLOAD_MEDIUM = 0xa6,
42 SCSI_MECHANISM_STATUS = 0xbd,
43 SCSI_MODE_SELECT_10 = 0x55,
44 SCSI_MODE_SENSE_10 = 0x5a,
45 SCSI_PAUSE_RESUME = 0x4b,
46 SCSI_PLAY_AUDIO_10 = 0x45,
47 SCSI_PLAY_AUDIO_12 = 0xa5,
48 SCSI_PLAY_AUDIO_MSF = 0x47,
49 SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1e,
50 /** Read(10) command. */
51 SCSI_READ_10 = 0x28,
52 SCSI_READ_12 = 0xa8,
53 SCSI_READ_BUFFER = 0x3c,
54 SCSI_READ_BUFFER_CAPACITY = 0x5c,
55 /** Read Capacity(6) command. */
56 SCSI_READ_CAPACITY = 0x25,
57 SCSI_READ_CD = 0xbe,
58 SCSI_READ_CD_MSF = 0xb9,
59 SCSI_READ_DISC_INFORMATION = 0x51,
60 SCSI_READ_DVD_STRUCTURE = 0xad,
61 SCSI_READ_FORMAT_CAPACITIES = 0x23,
62 SCSI_READ_SUBCHANNEL = 0x42,
63 SCSI_READ_TOC_PMA_ATIP = 0x43,
64 SCSI_READ_TRACK_INFORMATION = 0x52,
65 SCSI_REPAIR_TRACK = 0x58,
66 SCSI_REPORT_KEY = 0xa4,
67 SCSI_REQUEST_SENSE = 0x03,
68 SCSI_RESERVE_TRACK = 0x53,
69 SCSI_SCAN = 0xba,
70 SCSI_SEEK_10 = 0x2b,
71 SCSI_SEND_CUE_SHEET = 0x5d,
72 SCSI_SEND_DVD_STRUCTURE = 0xbf,
73 SCSI_SEND_EVENT = 0xa2,
74 SCSI_SEND_KEY = 0xa3,
75 SCSI_SEND_OPC_INFORMATION = 0x54,
76 SCSI_SET_CD_SPEED = 0xbb,
77 SCSI_SET_READ_AHEAD = 0xa7,
78 SCSI_SET_STREAMING = 0xb6,
79 SCSI_START_STOP_UNIT = 0x1b,
80 SCSI_STOP_PLAY_SCAN = 0x4e,
81 /** Synchronize Cache command. */
82 SCSI_SYNCHRONIZE_CACHE = 0x35,
83 SCSI_TEST_UNIT_READY = 0x00,
84 SCSI_VERIFY_10 = 0x2f,
85 /** Write(10) command. */
86 SCSI_WRITE_10 = 0x2a,
87 SCSI_WRITE_12 = 0xaa,
88 SCSI_WRITE_AND_VERIFY_10 = 0x2e,
89 SCSI_WRITE_BUFFER = 0x3b,
90
91 /** Mode Sense(6) command */
92 SCSI_MODE_SENSE_6 = 0x1a,
93 /** Report LUNs command. */
94 SCSI_REPORT_LUNS = 0xa0,
95 /** Rezero Unit command. Obsolete for ages now, but used by cdrecord. */
96 SCSI_REZERO_UNIT = 0x01
97} SCSICMD;
98
99#ifdef DEBUG
100static const char * const g_apszSCSICmdNames[256] =
101{
102 "TEST UNIT READY", /* 0x00 */
103 "REZERO UNIT", /* 0x01 */
104 "", /* 0x02 */
105 "REQUEST SENSE", /* 0x03 */
106 "FORMAT UNIT", /* 0x04 */
107 "READ BLOCK LIMITS", /* 0x05 */
108 "", /* 0x06 */
109 "REASSIGN BLOCKS", /* 0x07 */
110 "READ (6)", /* 0x08 */
111 "", /* 0x09 */
112 "WRITE (6)", /* 0x0a */
113 "SEEK (6)", /* 0x0b */
114 "", /* 0x0c */
115 "", /* 0x0d */
116 "", /* 0x0e */
117 "READ REVERSE (6)", /* 0x0f */
118 "READ FILEMARKS (6)", /* 0x10 */
119 "SPACE (6)", /* 0x11 */
120 "INQUIRY", /* 0x12 */
121 "VERIFY (6)", /* 0x13 */
122 "RECOVER BUFFERED DATA", /* 0x14 */
123 "MODE SELECT (6)", /* 0x15 */
124 "RESERVE (6)", /* 0x16 */
125 "RELEASE (6)", /* 0x17 */
126 "COPY", /* 0x18 */
127 "ERASE (6)", /* 0x19 */
128 "MODE SENSE (6)", /* 0x1a */
129 "START STOP UNIT", /* 0x1b */
130 "RECEIVE DIAGNOSTIC RESULTS", /* 0x1c */
131 "SEND DIAGNOSTIC", /* 0x1d */
132 "PREVENT ALLOW MEDIUM REMOVAL", /* 0x1e */
133 "", /* 0x1f */
134 "", /* 0x20 */
135 "", /* 0x21 */
136 "", /* 0x22 */
137 "READ FORMAT CAPACITIES", /* 0x23 */
138 "SET WINDOW", /* 0x24 */
139 "READ CAPACITY", /* 0x25 */
140 "", /* 0x26 */
141 "", /* 0x27 */
142 "READ (10)", /* 0x28 */
143 "READ GENERATION", /* 0x29 */
144 "WRITE (10)", /* 0x2a */
145 "SEEK (10)", /* 0x2b */
146 "ERASE (10)", /* 0x2c */
147 "READ UPDATED BLOCK", /* 0x2d */
148 "WRITE AND VERIFY (10)", /* 0x2e */
149 "VERIFY (10)", /* 0x2f */
150 "SEARCH DATA HIGH (10)", /* 0x30 */
151 "SEARCH DATA EQUAL (10)", /* 0x31 */
152 "SEARCH DATA LOW (10)", /* 0x32 */
153 "SET LIMITS (10)", /* 0x33 */
154 "PRE-FETCH (10)", /* 0x34 */
155 "SYNCHRONIZE CACHE (10)", /* 0x35 */
156 "LOCK UNLOCK CACHE (10)", /* 0x36 */
157 "READ DEFECT DATA (10)", /* 0x37 */
158 "MEDIUM SCAN", /* 0x38 */
159 "COMPARE", /* 0x39 */
160 "COPY AND VERIFY", /* 0x3a */
161 "WRITE BUFFER", /* 0x3b */
162 "READ BUFFER", /* 0x3c */
163 "UPDATE BLOCK", /* 0x3d */
164 "READ LONG (10)", /* 0x3e */
165 "WRITE LONG (10)", /* 0x3f */
166 "CHANGE DEFINITION", /* 0x40 */
167 "WRITE SAME (10)", /* 0x41 */
168 "READ SUBCHANNEL", /* 0x42 */
169 "READ TOC/PMA/ATIP", /* 0x43 */
170 "REPORT DENSITY SUPPORT", /* 0x44 */
171 "PLAY AUDIO (10)", /* 0x45 */
172 "GET CONFIGURATION", /* 0x46 */
173 "PLAY AUDIO MSF", /* 0x47 */
174 "", /* 0x48 */
175 "", /* 0x49 */
176 "GET EVENT STATUS NOTIFICATION", /* 0x4a */
177 "PAUSE/RESUME", /* 0x4b */
178 "LOG SELECT", /* 0x4c */
179 "LOG SENSE", /* 0x4d */
180 "STOP PLAY/SCAN", /* 0x4e */
181 "", /* 0x4f */
182 "XDWRITE (10)", /* 0x50 */
183 "READ DISC INFORMATION", /* 0x51 */
184 "READ TRACK INFORMATION", /* 0x52 */
185 "RESERVE TRACK", /* 0x53 */
186 "SEND OPC INFORMATION", /* 0x54 */
187 "MODE SELECT (10)", /* 0x55 */
188 "RESERVE (10)", /* 0x56 */
189 "RELEASE (10)", /* 0x57 */
190 "REPAIR TRACK", /* 0x58 */
191 "", /* 0x59 */
192 "MODE SENSE (10)", /* 0x5a */
193 "CLOSE TRACK/SESSION", /* 0x5b */
194 "READ BUFFER CAPACITY", /* 0x5c */
195 "SEND CUE SHEET", /* 0x5d */
196 "PERSISTENT RESERVE IN", /* 0x5e */
197 "PERSISTENT RESERVE OUT", /* 0x5f */
198 "", /* 0x60 */
199 "", /* 0x61 */
200 "", /* 0x62 */
201 "", /* 0x63 */
202 "", /* 0x64 */
203 "", /* 0x65 */
204 "", /* 0x66 */
205 "", /* 0x67 */
206 "", /* 0x68 */
207 "", /* 0x69 */
208 "", /* 0x6a */
209 "", /* 0x6b */
210 "", /* 0x6c */
211 "", /* 0x6d */
212 "", /* 0x6e */
213 "", /* 0x6f */
214 "", /* 0x70 */
215 "", /* 0x71 */
216 "", /* 0x72 */
217 "", /* 0x73 */
218 "", /* 0x74 */
219 "", /* 0x75 */
220 "", /* 0x76 */
221 "", /* 0x77 */
222 "", /* 0x78 */
223 "", /* 0x79 */
224 "", /* 0x7a */
225 "", /* 0x7b */
226 "", /* 0x7c */
227 "", /* 0x7d */
228 "", /* 0x7e */
229 "", /* 0x7f */
230 "WRITE FILEMARKS (16)", /* 0x80 */
231 "READ REVERSE (16)", /* 0x81 */
232 "REGENERATE (16)", /* 0x82 */
233 "EXTENDED COPY", /* 0x83 */
234 "RECEIVE COPY RESULTS", /* 0x84 */
235 "ATA COMMAND PASS THROUGH (16)", /* 0x85 */
236 "ACCESS CONTROL IN", /* 0x86 */
237 "ACCESS CONTROL OUT", /* 0x87 */
238 "READ (16)", /* 0x88 */
239 "", /* 0x89 */
240 "WRITE(16)", /* 0x8a */
241 "", /* 0x8b */
242 "READ ATTRIBUTE", /* 0x8c */
243 "WRITE ATTRIBUTE", /* 0x8d */
244 "WRITE AND VERIFY (16)", /* 0x8e */
245 "VERIFY (16)", /* 0x8f */
246 "PRE-FETCH (16)", /* 0x90 */
247 "SYNCHRONIZE CACHE (16)", /* 0x91 */
248 "LOCK UNLOCK CACHE (16)", /* 0x92 */
249 "WRITE SAME (16)", /* 0x93 */
250 "", /* 0x94 */
251 "", /* 0x95 */
252 "", /* 0x96 */
253 "", /* 0x97 */
254 "", /* 0x98 */
255 "", /* 0x99 */
256 "", /* 0x9a */
257 "", /* 0x9b */
258 "", /* 0x9c */
259 "", /* 0x9d */
260 "SERVICE ACTION IN (16)", /* 0x9e */
261 "SERVICE ACTION OUT (16)", /* 0x9f */
262 "REPORT LUNS", /* 0xa0 */
263 "BLANK", /* 0xa1 */
264 "SEND EVENT", /* 0xa2 */
265 "SEND KEY", /* 0xa3 */
266 "REPORT KEY", /* 0xa4 */
267 "PLAY AUDIO (12)", /* 0xa5 */
268 "LOAD/UNLOAD MEDIUM", /* 0xa6 */
269 "SET READ AHEAD", /* 0xa7 */
270 "READ (12)", /* 0xa8 */
271 "SERVICE ACTION OUT (12)", /* 0xa9 */
272 "WRITE (12)", /* 0xaa */
273 "SERVICE ACTION IN (12)", /* 0xab */
274 "GET PERFORMANCE", /* 0xac */
275 "READ DVD STRUCTURE", /* 0xad */
276 "WRITE AND VERIFY (12)", /* 0xae */
277 "VERIFY (12)", /* 0xaf */
278 "SEARCH DATA HIGH (12)", /* 0xb0 */
279 "SEARCH DATA EQUAL (12)", /* 0xb1 */
280 "SEARCH DATA LOW (12)", /* 0xb2 */
281 "SET LIMITS (12)", /* 0xb3 */
282 "READ ELEMENT STATUS ATTACHED", /* 0xb4 */
283 "REQUEST VOLUME ELEMENT ADDRESS", /* 0xb5 */
284 "SET STREAMING", /* 0xb6 */
285 "READ DEFECT DATA (12)", /* 0xb7 */
286 "READ ELEMENT STATUS", /* 0xb8 */
287 "READ CD MSF", /* 0xb9 */
288 "SCAN", /* 0xba */
289 "SET CD SPEED", /* 0xbb */
290 "SPARE (IN)", /* 0xbc */
291 "MECHANISM STATUS", /* 0xbd */
292 "READ CD", /* 0xbe */
293 "SEND DVD STRUCTURE", /* 0xbf */
294 "", /* 0xc0 */
295 "", /* 0xc1 */
296 "", /* 0xc2 */
297 "", /* 0xc3 */
298 "", /* 0xc4 */
299 "", /* 0xc5 */
300 "", /* 0xc6 */
301 "", /* 0xc7 */
302 "", /* 0xc8 */
303 "", /* 0xc9 */
304 "", /* 0xca */
305 "", /* 0xcb */
306 "", /* 0xcc */
307 "", /* 0xcd */
308 "", /* 0xce */
309 "", /* 0xcf */
310 "", /* 0xd0 */
311 "", /* 0xd1 */
312 "", /* 0xd2 */
313 "", /* 0xd3 */
314 "", /* 0xd4 */
315 "", /* 0xd5 */
316 "", /* 0xd6 */
317 "", /* 0xd7 */
318 "", /* 0xd8 */
319 "", /* 0xd9 */
320 "", /* 0xda */
321 "", /* 0xdb */
322 "", /* 0xdc */
323 "", /* 0xdd */
324 "", /* 0xde */
325 "", /* 0xdf */
326 "", /* 0xe0 */
327 "", /* 0xe1 */
328 "", /* 0xe2 */
329 "", /* 0xe3 */
330 "", /* 0xe4 */
331 "", /* 0xe5 */
332 "", /* 0xe6 */
333 "", /* 0xe7 */
334 "", /* 0xe8 */
335 "", /* 0xe9 */
336 "", /* 0xea */
337 "", /* 0xeb */
338 "", /* 0xec */
339 "", /* 0xed */
340 "", /* 0xee */
341 "", /* 0xef */
342 "", /* 0xf0 */
343 "", /* 0xf1 */
344 "", /* 0xf2 */
345 "", /* 0xf3 */
346 "", /* 0xf4 */
347 "", /* 0xf5 */
348 "", /* 0xf6 */
349 "", /* 0xf7 */
350 "", /* 0xf8 */
351 "", /* 0xf9 */
352 "", /* 0xfa */
353 "", /* 0xfb */
354 "", /* 0xfc */
355 "", /* 0xfd */
356 "", /* 0xfe */
357 "" /* 0xff */
358};
359#endif /* DEBUG */
360
361/* Mode page codes for mode sense/select commands. */
362#define SCSI_MODEPAGE_ERROR_RECOVERY 0x01
363#define SCSI_MODEPAGE_WRITE_PARAMETER 0x05
364#define SCSI_MODEPAGE_CD_STATUS 0x2a
365
366
367/* Page control codes. */
368#define SCSI_PAGECONTROL_CURRENT 0x00
369#define SCSI_PAGECONTROL_CHANGEABLE 0x01
370#define SCSI_PAGECONTROL_DEFAULT 0x02
371#define SCSI_PAGECONTROL_SAVED 0x03
372
373
374#define SCSI_SENSE_NONE 0
375#define SCSI_SENSE_NOT_READY 2
376#define SCSI_SENSE_MEDIUM_ERROR 3
377#define SCSI_SENSE_ILLEGAL_REQUEST 5
378#define SCSI_SENSE_UNIT_ATTENTION 6
379
380
381#define SCSI_ASC_NONE 0x00
382#define SCSI_ASC_READ_ERROR 0x11
383#define SCSI_ASC_ILLEGAL_OPCODE 0x20
384#define SCSI_ASC_LOGICAL_BLOCK_OOR 0x21
385#define SCSI_ASC_INV_FIELD_IN_CMD_PACKET 0x24
386#define SCSI_ASC_MEDIUM_MAY_HAVE_CHANGED 0x28
387#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3a
388#define SCSI_ASC_SAVING_PARAMETERS_NOT_SUPPORTED 0x39
389#define SCSI_ASC_MEDIA_LOAD_OR_EJECT_FAILED 0x53
390
391
392#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette