Chameleon

Chameleon Svn Source Tree

Root/branches/slice/trunkM/i386/include/IOKit/scsi/SCSICommandDefinitions.h

1/*
2 * Copyright (c) 2001-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _IOKIT_SCSI_COMMAND_DEFINITIONS_H_
25#define _IOKIT_SCSI_COMMAND_DEFINITIONS_H_
26
27
28#if KERNEL
29#include <IOKit/IOTypes.h>
30#else
31#include <CoreFoundation/CoreFoundation.h>
32#endif
33
34
35/*! @header SCSICommandDefinitions
36@discussion
37This file contains all the definitions for types and constants that are
38used by the command set classes for building CDBs. The field type
39definitions are used for the parameters passed to a method that builds and
40sends any SCSI defined command to clearly identify the type of value
41expected for a parameter.
42
43The command methods will then use the appropriate mask to verify that the
44value passed into a parameter is of the specified type.
45
46Currently only types and masks are defined for 8 bytes and smaller fields.
47If a command is defined that uses a larger field, these should be expanded
48to include those sizes.
49*/
50
51#pragma mark Field Type Definitions
52/* These are the type definitions used for the parameters of methods that
53 * build and send Command Descriptor Blocks.
54 */
55
56/* 1 Byte or smaller fields. */
57
58/*! @typedef SCSICmdField1Bit */
59typedef UInt8SCSICmdField1Bit;
60
61/*! @typedef SCSICmdField2Bit */
62typedef UInt8SCSICmdField2Bit;
63
64/*! @typedef SCSICmdField3Bit */
65typedef UInt8SCSICmdField3Bit;
66
67/*! @typedef SCSICmdField4Bit */
68typedef UInt8SCSICmdField4Bit;
69
70/*! @typedef SCSICmdField5Bit */
71typedef UInt8SCSICmdField5Bit;
72
73/*! @typedef SCSICmdField6Bit */
74typedef UInt8SCSICmdField6Bit;
75
76/*! @typedef SCSICmdField7Bit */
77typedef UInt8SCSICmdField7Bit;
78
79/*! @typedef SCSICmdField1Byte */
80typedef UInt8SCSICmdField1Byte;
81
82/* 2 Bytes or smaller fields. */
83
84/*! @typedef SCSICmdField9Bit */
85typedef UInt16SCSICmdField9Bit;
86
87/*! @typedef SCSICmdField10Bit */
88typedef UInt16SCSICmdField10Bit;
89
90/*! @typedef SCSICmdField11Bit */
91typedef UInt16SCSICmdField11Bit;
92
93/*! @typedef SCSICmdField12Bit */
94typedef UInt16SCSICmdField12Bit;
95
96/*! @typedef SCSICmdField13Bit */
97typedef UInt16SCSICmdField13Bit;
98
99/*! @typedef SCSICmdField14Bit */
100typedef UInt16SCSICmdField14Bit;
101
102/*! @typedef SCSICmdField15Bit */
103typedef UInt16SCSICmdField15Bit;
104
105/*! @typedef SCSICmdField2Byte */
106typedef UInt16SCSICmdField2Byte;
107
108/* 3 Bytes or smaller fields. */
109
110/*! @typedef SCSICmdField17Bit */
111typedef UInt32SCSICmdField17Bit;
112
113/*! @typedef SCSICmdField18Bit */
114typedef UInt32SCSICmdField18Bit;
115
116/*! @typedef SCSICmdField19Bit */
117typedef UInt32SCSICmdField19Bit;
118
119/*! @typedef SCSICmdField20Bit */
120typedef UInt32SCSICmdField20Bit;
121
122/*! @typedef SCSICmdField21Bit */
123typedef UInt32SCSICmdField21Bit;
124
125/*! @typedef SCSICmdField22Bit */
126typedef UInt32SCSICmdField22Bit;
127
128/*! @typedef SCSICmdField23Bit */
129typedef UInt32SCSICmdField23Bit;
130
131/*! @typedef SCSICmdField3Byte */
132typedef UInt32SCSICmdField3Byte;
133
134/* 4 Bytes or smaller fields. */
135
136/*! @typedef SCSICmdField25Bit */
137typedef UInt32SCSICmdField25Bit;
138
139/*! @typedef SCSICmdField26Bit */
140typedef UInt32SCSICmdField26Bit;
141
142/*! @typedef SCSICmdField27Bit */
143typedef UInt32SCSICmdField27Bit;
144
145/*! @typedef SCSICmdField28Bit */
146typedef UInt32SCSICmdField28Bit;
147
148/*! @typedef SCSICmdField29Bit */
149typedef UInt32SCSICmdField29Bit;
150
151/*! @typedef SCSICmdField30Bit */
152typedef UInt32SCSICmdField30Bit;
153
154/*! @typedef SCSICmdField31Bit */
155typedef UInt32SCSICmdField31Bit;
156
157/*! @typedef SCSICmdField4Byte */
158typedef UInt32SCSICmdField4Byte;
159
160/* 5 Bytes or smaller fields. */
161
162/*! @typedef SCSICmdField33Bit */
163typedef UInt64SCSICmdField33Bit;
164
165/*! @typedef SCSICmdField34Bit */
166typedef UInt64SCSICmdField34Bit;
167
168/*! @typedef SCSICmdField35Bit */
169typedef UInt64SCSICmdField35Bit;
170
171/*! @typedef SCSICmdField36Bit */
172typedef UInt64SCSICmdField36Bit;
173
174/*! @typedef SCSICmdField37Bit */
175typedef UInt64SCSICmdField37Bit;
176
177/*! @typedef SCSICmdField38Bit */
178typedef UInt64SCSICmdField38Bit;
179
180/*! @typedef SCSICmdField39Bit */
181typedef UInt64SCSICmdField39Bit;
182
183/*! @typedef SCSICmdField5Byte */
184typedef UInt64SCSICmdField5Byte;
185
186/* 6 Bytes or smaller fields. */
187
188/*! @typedef SCSICmdField41Bit */
189typedef UInt64SCSICmdField41Bit;
190
191/*! @typedef SCSICmdField42Bit */
192typedef UInt64SCSICmdField42Bit;
193
194/*! @typedef SCSICmdField43Bit */
195typedef UInt64SCSICmdField43Bit;
196
197/*! @typedef SCSICmdField44Bit */
198typedef UInt64SCSICmdField44Bit;
199
200/*! @typedef SCSICmdField45Bit */
201typedef UInt64SCSICmdField45Bit;
202
203/*! @typedef SCSICmdField46Bit */
204typedef UInt64SCSICmdField46Bit;
205
206/*! @typedef SCSICmdField47Bit */
207typedef UInt64SCSICmdField47Bit;
208
209/*! @typedef SCSICmdField6Byte */
210typedef UInt64SCSICmdField6Byte;
211
212/* 7 Bytes or smaller fields. */
213
214/*! @typedef SCSICmdField49Bit */
215typedef UInt64SCSICmdField49Bit;
216
217/*! @typedef SCSICmdField50Bit */
218typedef UInt64SCSICmdField50Bit;
219
220/*! @typedef SCSICmdField51Bit */
221typedef UInt64SCSICmdField51Bit;
222
223/*! @typedef SCSICmdField52Bit */
224typedef UInt64SCSICmdField52Bit;
225
226/*! @typedef SCSICmdField53Bit */
227typedef UInt64SCSICmdField53Bit;
228
229/*! @typedef SCSICmdField54Bit */
230typedef UInt64SCSICmdField54Bit;
231
232/*! @typedef SCSICmdField55Bit */
233typedef UInt64SCSICmdField55Bit;
234
235/*! @typedef SCSICmdField7Byte */
236typedef UInt64SCSICmdField7Byte;
237
238/* 8 Bytes or smaller fields. */
239
240/*! @typedef SCSICmdField57Bit */
241typedef UInt64SCSICmdField57Bit;
242
243/*! @typedef SCSICmdField58Bit */
244typedef UInt64SCSICmdField58Bit;
245
246/*! @typedef SCSICmdField59Bit */
247typedef UInt64SCSICmdField59Bit;
248
249/*! @typedef SCSICmdField60Bit */
250typedef UInt64SCSICmdField60Bit;
251
252/*! @typedef SCSICmdField61Bit */
253typedef UInt64SCSICmdField61Bit;
254
255/*! @typedef SCSICmdField62Bit */
256typedef UInt64SCSICmdField62Bit;
257
258/*! @typedef SCSICmdField63Bit */
259typedef UInt64SCSICmdField63Bit;
260
261/*! @typedef SCSICmdField8Byte */
262typedef UInt64SCSICmdField8Byte;
263
264
265#pragma mark Field Mask Definitions
266/* These are masks that are used to verify that the values passed into the
267 * parameters for the fields are not larger than the field size.
268 *
269 * NB: These have changed from enums to #define since enums greater than
270 * 32 bits in size are not well-defined in C99.
271 */
272
273/* 1 Byte or smaller fields. */
274
275/*! @constant kSCSICmdFieldMask1Bit */
276#define kSCSICmdFieldMask1Bit0x01
277
278/*! @constant kSCSICmdFieldMask2Bit */
279#define kSCSICmdFieldMask2Bit0x03
280
281/*! @constant kSCSICmdFieldMask3Bit */
282#define kSCSICmdFieldMask3Bit0x07
283
284/*! @constant kSCSICmdFieldMask4Bit */
285#define kSCSICmdFieldMask4Bit0x0F
286
287/*! @constant kSCSICmdFieldMask5Bit */
288#define kSCSICmdFieldMask5Bit0x1F
289
290/*! @constant kSCSICmdFieldMask6Bit */
291#define kSCSICmdFieldMask6Bit0x3F
292
293/*! @constant kSCSICmdFieldMask7Bit */
294#define kSCSICmdFieldMask7Bit0x7F
295
296#define kSCSICmdFieldMask1Byte0xFF
297
298/* 2 Bytes or smaller fields. */
299
300/*! @constant kSCSICmdFieldMask9Bit */
301#define kSCSICmdFieldMask9Bit0x01FF
302
303/*! @constant kSCSICmdFieldMask10Bit */
304#define kSCSICmdFieldMask10Bit0x03FF
305
306/*! @constant kSCSICmdFieldMask11Bit */
307#define kSCSICmdFieldMask11Bit0x07FF
308
309/*! @constant kSCSICmdFieldMask12Bit */
310#define kSCSICmdFieldMask12Bit0x0FFF
311
312/*! @constant kSCSICmdFieldMask13Bit */
313#define kSCSICmdFieldMask13Bit0x1FFF
314
315/*! @constant kSCSICmdFieldMask14Bit */
316#define kSCSICmdFieldMask14Bit0x3FFF
317
318/*! @constant kSCSICmdFieldMask15Bit */
319#define kSCSICmdFieldMask15Bit0x7FFF
320
321/*! @constant kSCSICmdFieldMask2Byte */
322#define kSCSICmdFieldMask2Byte0xFFFF
323
324/* 3 Bytes or smaller fields. */
325
326/*! @constant kSCSICmdFieldMask17Bit */
327#define kSCSICmdFieldMask17Bit0x01FFFF
328
329/*! @constant kSCSICmdFieldMask18Bit */
330#define kSCSICmdFieldMask18Bit0x03FFFF
331
332/*! @constant kSCSICmdFieldMask19Bit */
333#define kSCSICmdFieldMask19Bit0x07FFFF
334
335/*! @constant kSCSICmdFieldMask20Bit */
336#define kSCSICmdFieldMask20Bit0x0FFFFF
337
338/*! @constant kSCSICmdFieldMask21Bit */
339#define kSCSICmdFieldMask21Bit0x1FFFFF
340
341/*! @constant kSCSICmdFieldMask22Bit */
342#define kSCSICmdFieldMask22Bit0x3FFFFF
343
344/*! @constant kSCSICmdFieldMask23Bit */
345#define kSCSICmdFieldMask23Bit0x7FFFFF
346
347/*! @constant kSCSICmdFieldMask3Byte */
348#define kSCSICmdFieldMask3Byte0xFFFFFF
349
350/* 4 Bytes or smaller fields. */
351/*! @constant kSCSICmdFieldMask25Bit */
352#define kSCSICmdFieldMask25Bit0x01FFFFFFUL
353
354/*! @constant kSCSICmdFieldMask26Bit */
355#define kSCSICmdFieldMask26Bit0x03FFFFFFUL
356
357/*! @constant kSCSICmdFieldMask27Bit */
358#define kSCSICmdFieldMask27Bit0x07FFFFFFUL
359
360/*! @constant kSCSICmdFieldMask28Bit */
361#define kSCSICmdFieldMask28Bit0x0FFFFFFFUL
362
363/*! @constant kSCSICmdFieldMask29Bit */
364#define kSCSICmdFieldMask29Bit0x1FFFFFFFUL
365
366/*! @constant kSCSICmdFieldMask30Bit */
367#define kSCSICmdFieldMask30Bit0x3FFFFFFFUL
368
369/*! @constant kSCSICmdFieldMask31Bit */
370#define kSCSICmdFieldMask31Bit0x7FFFFFFFUL
371
372/*! @constant kSCSICmdFieldMask4Byte */
373#define kSCSICmdFieldMask4Byte0xFFFFFFFFUL
374
375/* 5 Bytes or smaller fields. */
376
377/*! @constant kSCSICmdFieldMask33Bit */
378#define kSCSICmdFieldMask33Bit0x01FFFFFFFFULL
379
380/*! @constant kSCSICmdFieldMask34Bit */
381#define kSCSICmdFieldMask34Bit0x03FFFFFFFFULL
382
383/*! @constant kSCSICmdFieldMask35Bit */
384#define kSCSICmdFieldMask35Bit0x07FFFFFFFFULL
385
386/*! @constant kSCSICmdFieldMask36Bit */
387#define kSCSICmdFieldMask36Bit0x0FFFFFFFFFULL
388
389/*! @constant kSCSICmdFieldMask37Bit */
390#define kSCSICmdFieldMask37Bit0x1FFFFFFFFFULL
391
392/*! @constant kSCSICmdFieldMask38Bit */
393#define kSCSICmdFieldMask38Bit0x3FFFFFFFFFULL
394
395/*! @constant kSCSICmdFieldMask39Bit */
396#define kSCSICmdFieldMask39Bit0x7FFFFFFFFFULL
397
398/*! @constant kSCSICmdFieldMask5Byte */
399#define kSCSICmdFieldMask5Byte0xFFFFFFFFFFULL
400
401/* 6 Bytes or smaller fields. */
402
403/*! @constant kSCSICmdFieldMask41Bit */
404#define kSCSICmdFieldMask41Bit0x01FFFFFFFFFFULL
405
406/*! @constant kSCSICmdFieldMask42Bit */
407#define kSCSICmdFieldMask42Bit0x03FFFFFFFFFFULL
408
409/*! @constant kSCSICmdFieldMask43Bit */
410#define kSCSICmdFieldMask43Bit0x07FFFFFFFFFFULL
411
412/*! @constant kSCSICmdFieldMask44Bit */
413#define kSCSICmdFieldMask44Bit0x0FFFFFFFFFFFULL
414
415/*! @constant kSCSICmdFieldMask45Bit */
416#define kSCSICmdFieldMask45Bit0x1FFFFFFFFFFFULL
417
418/*! @constant kSCSICmdFieldMask46Bit */
419#define kSCSICmdFieldMask46Bit0x3FFFFFFFFFFFULL
420
421/*! @constant kSCSICmdFieldMask47Bit */
422#define kSCSICmdFieldMask47Bit0x7FFFFFFFFFFFULL
423
424/*! @constant kSCSICmdFieldMask6Byte */
425#define kSCSICmdFieldMask6Byte0xFFFFFFFFFFFFULL
426
427/* 7 Bytes or smaller fields. */
428
429/*! @constant kSCSICmdFieldMask49Bit */
430#define kSCSICmdFieldMask49Bit0x01FFFFFFFFFFFFULL
431
432/*! @constant kSCSICmdFieldMask50Bit */
433#define kSCSICmdFieldMask50Bit0x03FFFFFFFFFFFFULL
434
435/*! @constant kSCSICmdFieldMask51Bit */
436#define kSCSICmdFieldMask51Bit0x07FFFFFFFFFFFFULL
437
438/*! @constant kSCSICmdFieldMask52Bit */
439#define kSCSICmdFieldMask52Bit0x0FFFFFFFFFFFFFULL
440
441/*! @constant kSCSICmdFieldMask53Bit */
442#define kSCSICmdFieldMask53Bit0x1FFFFFFFFFFFFFULL
443
444/*! @constant kSCSICmdFieldMask54Bit */
445#define kSCSICmdFieldMask54Bit0x3FFFFFFFFFFFFFULL
446
447/*! @constant kSCSICmdFieldMask55Bit */
448#define kSCSICmdFieldMask55Bit0x7FFFFFFFFFFFFFULL
449
450/*! @constant kSCSICmdFieldMask7Byte */
451#define kSCSICmdFieldMask7Byte0xFFFFFFFFFFFFFFULL
452
453/* 8 Bytes or smaller fields. */
454
455/*! @constant kSCSICmdFieldMask57Bit */
456#define kSCSICmdFieldMask57Bit0x01FFFFFFFFFFFFFFULL
457
458/*! @constant kSCSICmdFieldMask58Bit */
459#define kSCSICmdFieldMask58Bit0x03FFFFFFFFFFFFFFULL
460
461/*! @constant kSCSICmdFieldMask59Bit */
462#define kSCSICmdFieldMask59Bit0x07FFFFFFFFFFFFFFULL
463
464/*! @constant kSCSICmdFieldMask60Bit */
465#define kSCSICmdFieldMask60Bit0x0FFFFFFFFFFFFFFFULL
466
467/*! @constant kSCSICmdFieldMask61Bit */
468#define kSCSICmdFieldMask61Bit0x1FFFFFFFFFFFFFFFULL
469
470/*! @constant kSCSICmdFieldMask62Bit */
471#define kSCSICmdFieldMask62Bit0x3FFFFFFFFFFFFFFFULL
472
473/*! @constant kSCSICmdFieldMask63Bit */
474#define kSCSICmdFieldMask63Bit0x7FFFFFFFFFFFFFFFULL
475
476/*! @constant kSCSICmdFieldMask8Byte */
477#define kSCSICmdFieldMask8Byte0xFFFFFFFFFFFFFFFFULL
478
479#endif/* _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ */
480

Archive Download this file

Revision: 1171