Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h

Source at commit 296 created 12 years 10 months ago.
By ifabio, add i386 folder
1/*
2 * Copyright (c) 1998-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_CMDS_INQUIRY_H_
25#define _IOKIT_SCSI_CMDS_INQUIRY_H_
26
27
28//-----------------------------------------------------------------------------
29//Includes
30//-----------------------------------------------------------------------------
31
32#if KERNEL
33#include <IOKit/IOTypes.h>
34#else
35#include <CoreFoundation/CoreFoundation.h>
36#endif
37
38
39/*! @header SCSI Inquiry Definitions
40@discussion
41This file contains all definitions for the data returned from
42the INQUIRY (0x12) command.
43*/
44
45
46/*!
47 * @enum Payload sizes
48 * @discussion
49 * Definitions for sizes related to the INQUIRY data.
50 * @constant kINQUIRY_StandardDataHeaderSize
51 * INQUIRY data header size.
52 * @constant kINQUIRY_MaximumDataSize
53 * Maximum size for INQUIRY data.
54*/
55enum
56{
57kINQUIRY_StandardDataHeaderSize= 5,
58kINQUIRY_MaximumDataSize= 255
59};
60
61
62/*!
63@enum INQUIRY field sizes
64@discussion
65Sizes for some of the inquiry data fields.
66@constant kINQUIRY_VENDOR_IDENTIFICATION_Length
67Size of VENDOR_IDENTIFICATION field.
68@constant kINQUIRY_PRODUCT_IDENTIFICATION_Length
69Size of PRODUCT_IDENTIFICATION field.
70@constant kINQUIRY_PRODUCT_REVISION_LEVEL_Length
71Size of PRODUCT_REVISION_LEVEL field.
72*/
73enum
74{
75kINQUIRY_VENDOR_IDENTIFICATION_Length= 8,
76kINQUIRY_PRODUCT_IDENTIFICATION_Length= 16,
77kINQUIRY_PRODUCT_REVISION_LEVEL_Length= 4
78};
79
80
81/*!
82@struct SCSICmd_INQUIRY_StandardData
83@discussion
84This structure defines the format of the required standard data that is
85returned for the INQUIRY command. This is the data that is required to
86be returned from all devices.
87*/
88typedef struct SCSICmd_INQUIRY_StandardData
89{
90UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
91UInt8RMB;// 7 = removable
92UInt8VERSION;// 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI.
93UInt8RESPONSE_DATA_FORMAT;// 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. (SPC-3 obsoletes AERC)
94// If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version.
95UInt8ADDITIONAL_LENGTH;// Number of additional bytes available in inquiry data
96UInt8SCCSReserved;// SCC-2 device flag and reserved fields (SPC-3 adds PROTECT 3PC TPGS, and ACC)
97UInt8flags1;// First byte of support flags (See SPC-3 section 6.4.2)
98UInt8flags2;// Second byte of support flags (Byte 7) (See SPC-3 section 6.4.2)
99charVENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length];
100charPRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length];
101charPRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length];
102} SCSICmd_INQUIRY_StandardData;
103typedef SCSICmd_INQUIRY_StandardData * SCSICmd_INQUIRY_StandardDataPtr;
104
105
106/*!
107@struct SCSICmd_INQUIRY_StandardDataAll
108@discussion
109This structure defines the all of the fields that can be returned in
110repsonse to the INQUIRy request for the standard data. There is no
111requirement as to how much of the additional data must be returned by a device.
112*/
113typedef struct SCSICmd_INQUIRY_StandardDataAll
114{
115UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
116UInt8RMB;// 7 = removable
117UInt8VERSION;// 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI.
118UInt8RESPONSE_DATA_FORMAT;// 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format.
119// If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version.
120UInt8ADDITIONAL_LENGTH;// Number of additional bytes available in inquiry data
121UInt8SCCSReserved;// SCC-2 device flag and reserved fields
122UInt8flags1;// First byte of support flags (Byte 6)
123UInt8flags2;// Second byte of support flags (Byte 7)
124charVENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length];
125charPRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length];
126charPRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length];
127
128// Following is the optional data that may be returned by a device.
129UInt8VendorSpecific1[20];
130UInt8flags3;// Third byte of support flags, mainly SPI-3 (Byte 56)
131UInt8Reserved1;
132UInt16VERSION_DESCRIPTOR[8];
133UInt8Reserved2[22];
134UInt8VendorSpecific2[160];
135} SCSICmd_INQUIRY_StandardDataAll;
136
137
138/*!
139@enum Peripheral Qualifier
140@discussion
141Inquiry Peripheral Qualifier definitions
142@constant kINQUIRY_PERIPHERAL_QUALIFIER_Connected
143Peripheral Device is connected.
144@constant kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected
145Peripheral Device is supported, but not connected.
146@constant kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported
147Peripheral Device is not supported.
148@constant kINQUIRY_PERIPHERAL_QUALIFIER_Mask
149Mask to use for PERIPHERAL_DEVICE_TYPE field.
150*/
151enum
152{
153kINQUIRY_PERIPHERAL_QUALIFIER_Connected= 0x00,
154kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected= 0x20,
155kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported= 0x60,
156kINQUIRY_PERIPHERAL_QUALIFIER_Mask= 0xE0
157};
158
159
160/*!
161@enum Peripheral Device types
162@discussion
163Inquiry Peripheral Device type definitions
164@constant kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice
165SBC Device.
166@constant kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice
167Sequential Access (Tape) SSC Device.
168@constant kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice
169SSC Device.
170@constant kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice
171SPC Device.
172@constant kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice
173SBC Device.
174@constant kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice
175MMC Device.
176@constant kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device
177SCSI2 Device.
178@constant kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice
179SBC Device.
180@constant kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice
181SMC Device.
182@constant kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice
183Comms SSC Device.
184@constant kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device
185SCC2 Device.
186@constant kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice
187SES Device.
188@constant kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice
189RBC Device.
190@constant kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice
191OCRW Device.
192@constant kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice
193OSD device.
194@constant kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface
195Automation Drive Interface device.
196@constant kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit
197Well known logical unit.
198@constant kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType
199Unknown or no device.
200@constant kINQUIRY_PERIPHERAL_TYPE_Mask
201Mask to use for PERIPHERAL_DEVICE_TYPE field.
202*/
203enum
204{
205kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice= 0x00,
206kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice= 0x01,
207kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice= 0x02,
208kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice= 0x03,
209kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice= 0x04,
210kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice= 0x05,
211kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device= 0x06,
212kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice= 0x07,
213kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice= 0x08,
214kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice= 0x09,
215/* 0x0A - 0x0B ASC IT8 Graphic Arts Prepress Devices */
216kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device= 0x0C,
217kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice= 0x0D,
218kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice= 0x0E,
219kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice= 0x0F,
220/* 0x10 - 0x1E Reserved Device Types */
221kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice= 0x11,
222kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface= 0x12,
223kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit= 0x1E,
224kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType= 0x1F,
225
226
227kINQUIRY_PERIPHERAL_TYPE_Mask= 0x1F
228};
229
230
231/*!
232@enum Removable Bit field definitions
233@discussion
234Inquiry Removable Bit field definitions
235@constant kINQUIRY_PERIPHERAL_RMB_MediumFixed
236Medium type is fixed disk.
237@constant kINQUIRY_PERIPHERAL_RMB_MediumRemovable
238Medium type is removable disk.
239@constant kINQUIRY_PERIPHERAL_RMB_BitMask
240Mask to use for RMB field.
241*/
242enum
243{
244kINQUIRY_PERIPHERAL_RMB_MediumFixed = 0x00,
245kINQUIRY_PERIPHERAL_RMB_MediumRemovable = 0x80,
246kINQUIRY_PERIPHERAL_RMB_BitMask = 0x80
247};
248
249
250/*!
251@enum Version field definitions
252@discussion
253Definitions for bits/masks in the INQUIRY Version field.
254@constant kINQUIRY_ISO_IEC_VERSION_Mask
255Mask for valid bits for ISO/IEC Version.
256@constant kINQUIRY_ECMA_VERSION_Mask
257Mask for valid bits for ECMA Version.
258@constant kINQUIRY_ANSI_VERSION_NoClaimedConformance
259No ANSI conformance claimed by the device server.
260@constant kINQUIRY_ANSI_VERSION_SCSI_1_Compliant
261SCSI-1 conformance claimed by the device server.
262@constant kINQUIRY_ANSI_VERSION_SCSI_2_Compliant
263SCSI-2 conformance claimed by the device server.
264@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant
265SPC conformance claimed by the device server.
266@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant
267SPC-2 conformance claimed by the device server.
268@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant
269SPC-3 conformance claimed by the device server.
270@constant kINQUIRY_ANSI_VERSION_Mask
271Mask for valid bits for ANSI Version.
272*/
273enum
274{
275kINQUIRY_ISO_IEC_VERSION_Mask= 0xC0,
276
277kINQUIRY_ECMA_VERSION_Mask= 0x38,
278
279kINQUIRY_ANSI_VERSION_NoClaimedConformance= 0x00,
280kINQUIRY_ANSI_VERSION_SCSI_1_Compliant= 0x01,
281kINQUIRY_ANSI_VERSION_SCSI_2_Compliant= 0x02,
282kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant= 0x03,
283kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant= 0x04,
284kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant= 0x05,
285kINQUIRY_ANSI_VERSION_Mask= 0x07
286};
287
288
289/*!
290@enum Response Data Format field definitions
291@discussion
292Definitions for bits/masks in the INQUIRY RESPONSE_DATA_FORMAT field.
293@constant kINQUIRY_Byte3_HISUP_Bit
294HISUP bit definition.
295@constant kINQUIRY_Byte3_NORMACA_Bit
296NORMACA bit definition.
297@constant kINQUIRY_Byte3_AERC_Bit
298AERC bit definition.
299@constant kINQUIRY_RESPONSE_DATA_FORMAT_Mask
300Mask for valid bits for RESPONSE_DATA_FORMAT.
301@constant kINQUIRY_Byte3_HISUP_Mask
302Mask to use to test the HISUP bit.
303@constant kINQUIRY_Byte3_NORMACA_Mask
304Mask to use to test the NORMACA bit.
305@constant kINQUIRY_Byte3_AERC_Mask
306Mask to use to test the AERC bit.
307*/
308enum
309{
310// Bit definitions
311// Bits 0-3: RESPONSE DATA FORMAT
312kINQUIRY_Byte3_HISUP_Bit= 4,
313kINQUIRY_Byte3_NORMACA_Bit= 5,
314// Bit 6 is Obsolete
315kINQUIRY_Byte3_AERC_Bit= 7,
316
317// Masks
318kINQUIRY_RESPONSE_DATA_FORMAT_Mask= 0x0F, // Bits 0-3
319kINQUIRY_Byte3_HISUP_Mask= (1 << kINQUIRY_Byte3_HISUP_Bit),
320kINQUIRY_Byte3_NORMACA_Mask= (1 << kINQUIRY_Byte3_NORMACA_Bit),
321// Bit 6 is Obsolete
322kINQUIRY_Byte3_AERC_Mask= (1 << kINQUIRY_Byte3_AERC_Bit)
323};
324
325
326/*!
327@enum SCCS field definitions
328@discussion
329Definitions for bits/masks in the INQUIRY SCCSReserved field.
330@constant kINQUIRY_Byte5_SCCS_Bit
331SCCS bit definition.
332@constant kINQUIRY_Byte5_ACC_Bit
333ACC bit definition.
334@constant kINQUIRY_Byte5_3PC_Bit
3353PC bit definition.
336@constant kINQUIRY_Byte5_PROTECT_Bit
337PROTECT bit definition.
338@constant kINQUIRY_Byte5_SCCS_Mask
339Mask to use to test the SCCS bit.
340@constant kINQUIRY_Byte5_ACC_Mask
341Mask to use to test the ACC bit.
342@constant kINQUIRY_Byte5_TPGS_Mask
343Mask to use for the TPGS bits.
344@constant kINQUIRY_Byte5_3PC_Mask
345Mask to use to test the 3PC bit.
346@constant kINQUIRY_Byte5_PROTECT_Mask
347Mask to use to test the PROTECT bit.
348*/
349enum
350{
351// Bit definitions
352kINQUIRY_Byte5_SCCS_Bit= 7,
353kINQUIRY_Byte5_ACC_Bit= 6,
354// Bits 4-5: TPGS
355kINQUIRY_Byte5_3PC_Bit= 3,
356// Bits 1-2: Reserved
357kINQUIRY_Byte5_PROTECT_Bit= 0,
358
359// Masks
360kINQUIRY_Byte5_SCCS_Mask= (1 << kINQUIRY_Byte5_SCCS_Bit),
361kINQUIRY_Byte5_ACC_Mask= (1 << kINQUIRY_Byte5_ACC_Bit),
362kINQUIRY_Byte5_TPGS_Mask= 0x18,
363kINQUIRY_Byte5_3PC_Mask= (1 << kINQUIRY_Byte5_3PC_Bit),
364// Bits 1-2: Reserved
365kINQUIRY_Byte5_PROTECT_Mask= (1 << kINQUIRY_Byte5_PROTECT_Bit)
366};
367
368
369/*!
370@enum flags1 field definitions
371@discussion
372Definitions for bits/masks in the INQUIRY flags1 field.
373@constant kINQUIRY_Byte6_ADDR16_Bit
374ADDR16 bit definition.
375@constant kINQUIRY_Byte6_MCHNGR_Bit
376MCHNGR bit definition.
377@constant kINQUIRY_Byte6_MULTIP_Bit
378MULTIP bit definition.
379@constant kINQUIRY_Byte6_VS_Bit
380VS bit definition.
381@constant kINQUIRY_Byte6_ENCSERV_Bit
382ENCSERV bit definition.
383@constant kINQUIRY_Byte6_BQUE_Bit
384BQUE bit definition.
385@constant kINQUIRY_Byte6_ADDR16_Mask
386Mask to use to test the ADDR16 bit.
387@constant kINQUIRY_Byte6_MCHNGR_Mask
388Mask to use to test the MCHNGR bit.
389@constant kINQUIRY_Byte6_MULTIP_Mask
390Mask to use to test the MULTIP bit.
391@constant kINQUIRY_Byte6_VS_Mask
392Mask to use to test the VS bit.
393@constant kINQUIRY_Byte6_ENCSERV_Mask
394Mask to use to test the ENCSERV bit.
395@constant kINQUIRY_Byte6_BQUE_Mask
396Mask to use to test the BQUE bit.
397*/
398enum
399{
400// Byte offset
401kINQUIRY_Byte6_Offset= 6,
402
403// Bit definitions
404kINQUIRY_Byte6_ADDR16_Bit= 0,// SPI Specific
405// Bit 1 is Obsolete
406// Bit 2 is Obsolete
407kINQUIRY_Byte6_MCHNGR_Bit= 3,
408kINQUIRY_Byte6_MULTIP_Bit= 4,
409kINQUIRY_Byte6_VS_Bit= 5,
410kINQUIRY_Byte6_ENCSERV_Bit= 6,
411kINQUIRY_Byte6_BQUE_Bit= 7,
412
413// Masks
414kINQUIRY_Byte6_ADDR16_Mask= (1 << kINQUIRY_Byte6_ADDR16_Bit),// SPI Specific
415// Bit 1 is Obsolete
416// Bit 2 is Obsolete
417kINQUIRY_Byte6_MCHNGR_Mask= (1 << kINQUIRY_Byte6_MCHNGR_Bit),
418kINQUIRY_Byte6_MULTIP_Mask= (1 << kINQUIRY_Byte6_MULTIP_Bit),
419kINQUIRY_Byte6_VS_Mask= (1 << kINQUIRY_Byte6_VS_Bit),
420kINQUIRY_Byte6_ENCSERV_Mask= (1 << kINQUIRY_Byte6_ENCSERV_Bit),
421kINQUIRY_Byte6_BQUE_Mask= (1 << kINQUIRY_Byte6_BQUE_Bit)
422};
423
424
425/*!
426@enum flags2 field definitions
427@discussion
428Definitions for bits/masks in the INQUIRY flags2 field.
429@constant kINQUIRY_Byte7_VS_Bit
430VS bit definition.
431@constant kINQUIRY_Byte7_CMDQUE_Bit
432CMDQUE bit definition.
433@constant kINQUIRY_Byte7_TRANDIS_Bit
434TRANDIS bit definition.
435@constant kINQUIRY_Byte7_LINKED_Bit
436LINKED bit definition.
437@constant kINQUIRY_Byte7_SYNC_Bit
438SYNC bit definition.
439@constant kINQUIRY_Byte7_WBUS16_Bit
440WBUS16 bit definition.
441@constant kINQUIRY_Byte7_RELADR_Bit
442RELADR bit definition.
443@constant kINQUIRY_Byte7_VS_Mask
444Mask to use to test the VS bit.
445@constant kINQUIRY_Byte7_CMDQUE_Mask
446Mask to use to test the CMDQUE bit.
447@constant kINQUIRY_Byte7_TRANDIS_Mask
448Mask to use to test the TRANDIS bit.
449@constant kINQUIRY_Byte7_LINKED_Mask
450Mask to use to test the LINKED bit.
451@constant kINQUIRY_Byte7_SYNC_Mask
452Mask to use to test the SYNC bit.
453@constant kINQUIRY_Byte7_WBUS16_Mask
454Mask to use to test the WBUS16 bit.
455@constant kINQUIRY_Byte7_RELADR_Mask
456Mask to use to test the RELADR bit.
457*/
458enum
459{
460// Byte offset
461kINQUIRY_Byte7_Offset= 7,
462
463// Bit definitions
464kINQUIRY_Byte7_VS_Bit= 0,
465kINQUIRY_Byte7_CMDQUE_Bit= 1,
466kINQUIRY_Byte7_TRANDIS_Bit= 2,// SPI Specific
467kINQUIRY_Byte7_LINKED_Bit= 3,
468kINQUIRY_Byte7_SYNC_Bit= 4,// SPI Specific
469kINQUIRY_Byte7_WBUS16_Bit= 5,// SPI Specific
470// Bit 6 is Obsolete
471kINQUIRY_Byte7_RELADR_Bit= 7,
472
473// Masks
474kINQUIRY_Byte7_VS_Mask= (1 << kINQUIRY_Byte7_VS_Bit),
475kINQUIRY_Byte7_CMDQUE_Mask= (1 << kINQUIRY_Byte7_CMDQUE_Bit),
476kINQUIRY_Byte7_TRANDIS_Mask= (1 << kINQUIRY_Byte7_TRANDIS_Bit),// SPI Specific
477kINQUIRY_Byte7_LINKED_Mask= (1 << kINQUIRY_Byte7_LINKED_Bit),
478kINQUIRY_Byte7_SYNC_Mask= (1 << kINQUIRY_Byte7_SYNC_Bit),// SPI Specific
479kINQUIRY_Byte7_WBUS16_Mask= (1 << kINQUIRY_Byte7_WBUS16_Bit),// SPI Specific
480// Bit 6 is Obsolete
481kINQUIRY_Byte7_RELADR_Mask= (1 << kINQUIRY_Byte7_RELADR_Bit)
482};
483
484
485/*!
486@enum Byte 56 features field definitions
487@discussion
488Definitions for bits/masks in the INQUIRY Byte 56 field.
489Inquiry Byte 56 features (for devices that report an ANSI VERSION of
490kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant or later).
491These are SPI-3 Specific.
492@constant kINQUIRY_Byte56_IUS_Bit
493IUS bit definition.
494@constant kINQUIRY_Byte56_QAS_Bit
495QAS bit definition.
496@constant kINQUIRY_Byte56_IUS_Mask
497Mask to use to test the IUS bit.
498@constant kINQUIRY_Byte56_QAS_Mask
499Mask to use to test the QAS bit.
500@constant kINQUIRY_Byte56_CLOCKING_Mask
501Mask to use to test CLOCKING bits.
502@constant kINQUIRY_Byte56_CLOCKING_ONLY_ST
503Single-transition clocking only.
504@constant kINQUIRY_Byte56_CLOCKING_ONLY_DT
505Double-transition clocking only.
506@constant kINQUIRY_Byte56_CLOCKING_ST_AND_DT
507Single-transition and double-transition clocking.
508*/
509enum
510{
511// Byte offset
512kINQUIRY_Byte56_Offset= 56,
513
514// Bit definitions
515kINQUIRY_Byte56_IUS_Bit= 0,
516kINQUIRY_Byte56_QAS_Bit= 1,
517// Bits 2 and 3 are the CLOCKING bits
518// All other bits are reserved
519
520kINQUIRY_Byte56_IUS_Mask= (1 << kINQUIRY_Byte56_IUS_Bit),
521kINQUIRY_Byte56_QAS_Mask= (1 << kINQUIRY_Byte56_QAS_Bit),
522kINQUIRY_Byte56_CLOCKING_Mask= 0x0C,
523
524// Definitions for the CLOCKING bits
525kINQUIRY_Byte56_CLOCKING_ONLY_ST= 0x00,
526kINQUIRY_Byte56_CLOCKING_ONLY_DT= 0x04,
527// kINQUIRY_Byte56_CLOCKING_RESERVED= 0x08,
528kINQUIRY_Byte56_CLOCKING_ST_AND_DT= 0x0C
529};
530
531
532/*!
533@define kINQUIRY_VERSION_DESCRIPTOR_MaxCount
534Maximum number of INQUIRY version descriptors supported.
535*/
536#definekINQUIRY_VERSION_DESCRIPTOR_MaxCount8
537
538
539/*!
540@enum kINQUIRY_VERSION_DESCRIPTOR_SAT
541SAT specification version descriptor.
542*/
543enum
544{
545kINQUIRY_VERSION_DESCRIPTOR_SAT= 0x1EA0
546};
547
548
549/*
550IORegistry property names for information derived from the Inquiry data.
551The Peripheral Device Type is the only property that the
552generic Logical Unit Drivers will use to match. These properties are
553listed in order of matching priority. First is the Peripheral Device Type.
554Second is the Vendor Identification. Third is the Product Identification.
555Last is the Product Revision Level. To match a particular product, you would
556specify the Peripheral Device Type, Vendor Identification, and Product
557Identification. To restrict the match to a particular firmware revision, you
558would add the Product Revision Level. To not match on a particular product,
559but on a particular vendor's products, you would only include the
560Peripheral Device Type and the Vendor Identification.
561*/
562
563/*!
564@define kIOPropertySCSIPeripheralDeviceType
565SCSI Peripheral Device Type as reported in the INQUIRY data.
566*/
567#define kIOPropertySCSIPeripheralDeviceType"Peripheral Device Type"
568
569/*!
570@define kIOPropertySCSIPeripheralDeviceTypeSize
571Size of the kIOPropertySCSIPeripheralDeviceType key.
572*/
573#define kIOPropertySCSIPeripheralDeviceTypeSize8
574
575/* These properties are listed in order of matching priority */
576
577/*!
578@define kIOPropertySCSIVendorIdentification
579Vendor ID as reported in the INQUIRY data. Additional space characters (0x20)
580are truncated.
581*/
582#define kIOPropertySCSIVendorIdentification"Vendor Identification"
583
584/*!
585@define kIOPropertySCSIProductIdentification
586Product ID as reported in the INQUIRY data. Additional space characters (0x20)
587are truncated.
588*/
589#define kIOPropertySCSIProductIdentification"Product Identification"
590
591/*!
592@define kIOPropertySCSIProductRevisionLevel
593Product Revision Level as reported in the INQUIRY data.
594*/
595#define kIOPropertySCSIProductRevisionLevel"Product Revision Level"
596
597
598/*!
599@enum INQUIRY Page Codes
600@discussion INQUIRY Page Codes to be used when EVPD is set in the
601INQUIRY command.
602@constant kINQUIRY_Page00_PageCode
603Page Code 00h.
604@constant kINQUIRY_Page80_PageCode
605Page Code 80h.
606@constant kINQUIRY_Page83_PageCode
607Page Code 83h.
608@constant kINQUIRY_Page89_PageCode
609Page Code 89h.
610*/
611enum
612{
613kINQUIRY_Page00_PageCode= 0x00,
614kINQUIRY_Page80_PageCode= 0x80,
615kINQUIRY_Page83_PageCode= 0x83,
616kINQUIRY_Page89_PageCode= 0x89
617};
618
619
620/*!
621@struct SCSICmd_INQUIRY_Page00_Header
622@discussion INQUIRY Page 00h Header.
623*/
624typedef struct SCSICmd_INQUIRY_Page00_Header
625{
626UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
627UInt8PAGE_CODE;// Must be equal to 00h
628UInt8RESERVED;// reserved field
629UInt8PAGE_LENGTH;// n-3 bytes
630} SCSICmd_INQUIRY_Page00_Header;
631
632
633/*!
634@struct SCSICmd_INQUIRY_Page80_Header
635@discussion INQUIRY Page 80h Header.
636*/
637typedef struct SCSICmd_INQUIRY_Page80_Header
638{
639UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
640UInt8PAGE_CODE;// Must be equal to 80h
641UInt8RESERVED;// reserved field
642UInt8PAGE_LENGTH;// n-3 bytes
643UInt8PRODUCT_SERIAL_NUMBER;// 4-n
644} SCSICmd_INQUIRY_Page80_Header;
645
646
647/*!
648@define kIOPropertySCSIINQUIRYUnitSerialNumber
649Key that describes the INQUIRY Unit Serial Number in the IORegistry.
650*/
651#define kIOPropertySCSIINQUIRYUnitSerialNumber"INQUIRY Unit Serial Number"
652
653
654/*!
655@struct SCSICmd_INQUIRY_Page83_Header
656@discussion INQUIRY Page 83h Header.
657*/
658typedef struct SCSICmd_INQUIRY_Page83_Header
659{
660UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
661UInt8PAGE_CODE;// Must be equal to 83h
662UInt8RESERVED;// reserved field
663UInt8PAGE_LENGTH;// n-3 bytes
664} SCSICmd_INQUIRY_Page83_Header;
665
666
667/*!
668@struct SCSICmd_INQUIRY_Page83_Header_SPC_16
669@discussion INQUIRY Page 83h Header used with the 16 byte INQUIRY command.
670*/
671typedef struct SCSICmd_INQUIRY_Page83_Header_SPC_16
672{
673UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
674UInt8PAGE_CODE;// Must be equal to 83h
675UInt16PAGE_LENGTH;// n-3 bytes
676} SCSICmd_INQUIRY_Page83_Header_SPC_16;
677
678
679/*!
680@struct SCSICmd_INQUIRY_Page83_Identification_Descriptor
681@discussion INQUIRY Page 83h Identification Descriptor.
682*/
683typedef struct SCSICmd_INQUIRY_Page83_Identification_Descriptor
684{
685UInt8CODE_SET;// 7-4 = Protocol Identifier. 3-0 = Code Set
686UInt8IDENTIFIER_TYPE;// 7 = PIV 5-4 = ASSOCIATION 3-0 = Identifier
687UInt8RESERVED;
688UInt8IDENTIFIER_LENGTH;
689UInt8IDENTIFIER;
690} SCSICmd_INQUIRY_Page83_Identification_Descriptor;
691
692
693/*!
694@enum INQUIRY Page 83h Code Set
695@discussion
696Definitions for the Code Set field.
697@constant kINQUIRY_Page83_CodeSetBinaryData
698The identifier contains binary data.
699@constant kINQUIRY_Page83_CodeSetASCIIData
700The identifier contains ASCII data.
701@constant kINQUIRY_Page83_CodeSetUTF8Data
702The identifier contains UTF-8 data.
703*/
704enum
705{
706kINQUIRY_Page83_CodeSetReserved= 0x0,
707kINQUIRY_Page83_CodeSetBinaryData= 0x1,
708kINQUIRY_Page83_CodeSetASCIIData= 0x2,
709kINQUIRY_Page83_CodeSetUTF8Data= 0x3,
710// 0x4 - 0xF reserved
711kINQUIRY_Page83_CodeSetMask= 0xF
712};
713
714
715/*!
716@enum INQUIRY Page 83h Association
717@discussion
718Definitions for the Association field.
719@constant kINQUIRY_Page83_AssociationLogicalUnit
720Association of the identifier is with the logical unit.
721@constant kINQUIRY_Page83_AssociationDevice
722Association of the identifier is with the device (same as logical unit in SPC-2).
723@constant kINQUIRY_Page83_AssociationTargetPort
724Association of the identifier is with the target port.
725@constant kINQUIRY_Page83_AssociationTargetDevice
726Association of the identifier is with the target device (i.e. all ports).
727@constant kINQUIRY_Page83_AssociationMask
728Mask to use to determine association.
729*/
730enum
731{
732// SPC-3 - Association is changed to be specific to
733// Logical Units
734kINQUIRY_Page83_AssociationLogicalUnit= 0x00,
735
736// Backwards compatibility for SPC-2
737kINQUIRY_Page83_AssociationDevice = kINQUIRY_Page83_AssociationLogicalUnit,
738
739// Association is related to a Target Port
740kINQUIRY_Page83_AssociationTargetPort= 0x10,
741
742// SPC-3 - Added as specific association to
743// a Target device.
744kINQUIRY_Page83_AssociationTargetDevice= 0x20,
745
746kINQUIRY_Page83_AssociationMask= 0x30
747};
748
749
750/*!
751@enum INQUIRY Page 83h Identifier Type
752@discussion
753Definitions for the Identifier Type field.
754@constant kINQUIRY_Page83_IdentifierTypeUndefined
755Undefined Identifier Type.
756@constant kINQUIRY_Page83_IdentifierTypeVendorID
757Vendor Specific Identifier Type.
758@constant kINQUIRY_Page83_IdentifierTypeIEEE_EUI64
759EUI-64 Identifier Type.
760@constant kINQUIRY_Page83_IdentifierTypeNAAIdentifier
761NAA Identifier Type.
762@constant kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier
763Relative Target Port Identifier Type.
764@constant kINQUIRY_Page83_IdentifierTypeTargetPortGroup
765Target Port Group Identifier Type.
766@constant kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup
767Logical Unit Group Identifier Type.
768@constant kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier
769MD5 Logical Unit Identifier Type.
770@constant kINQUIRY_Page83_IdentifierTypeSCSINameString
771SCSI Name String Identifier Type.
772@constant kINQUIRY_Page83_IdentifierTypeMask
773Mask to use to determine association.
774@constant kINQUIRY_Page83_ProtocolIdentifierValidBit
775PIV Bit definition.
776@constant kINQUIRY_Page83_ProtocolIdentifierValidMask
777Mask to use to determine if PIV is set.
778*/
779enum
780{
781kINQUIRY_Page83_IdentifierTypeUndefined= 0,
782kINQUIRY_Page83_IdentifierTypeVendorID= 1,
783kINQUIRY_Page83_IdentifierTypeIEEE_EUI64= 2,
784kINQUIRY_Page83_IdentifierTypeNAAIdentifier= 3,
785kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier= 4,
786kINQUIRY_Page83_IdentifierTypeTargetPortGroup= 5,
787kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup= 6,
788kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier = 7,
789kINQUIRY_Page83_IdentifierTypeSCSINameString= 8,
790// 0x9 - 0xF Reserved
791
792kINQUIRY_Page83_IdentifierTypeMask= 0xF,
793
794kINQUIRY_Page83_ProtocolIdentifierValidBit= 7,
795kINQUIRY_Page83_ProtocolIdentifierValidMask= (1 << kINQUIRY_Page83_ProtocolIdentifierValidBit)
796
797};
798
799// Backwards compatibility
800#define kINQUIRY_Page83_IdentifierTypeFCNameIdentifierkINQUIRY_Page83_IdentifierTypeNAAIdentifier
801
802
803/*!
804@enum Protocol Identifier values
805@discussion
806Definitions for the protocol identifier values.
807@constant kSCSIProtocolIdentifier_FibreChannel
808FibreChannel Protocol Identifier.
809@constant kSCSIProtocolIdentifier_ParallelSCSI
810Parallel SCSI Protocol Identifier.
811@constant kSCSIProtocolIdentifier_SSA
812SSA Protocol Identifier.
813@constant kSCSIProtocolIdentifier_FireWire
814FireWire (IEEE-1394) Protocol Identifier.
815@constant kSCSIProtocolIdentifier_RDMA
816RDMA Protocol Identifier.
817@constant kSCSIProtocolIdentifier_iSCSI
818iSCSI Protocol Identifier.
819@constant kSCSIProtocolIdentifier_SAS
820SAS Protocol Identifier.
821@constant kSCSIProtocolIdentifier_ADT
822ADT Protocol Identifier.
823@constant kSCSIProtocolIdentifier_ATAPI
824ATAPI Protocol Identifier.
825@constant kSCSIProtocolIdentifier_None
826No Protocol Identifier.
827*/
828enum
829{
830kSCSIProtocolIdentifier_FibreChannel= 0,
831kSCSIProtocolIdentifier_ParallelSCSI= 1,
832kSCSIProtocolIdentifier_SSA= 2,
833kSCSIProtocolIdentifier_FireWire= 3,
834kSCSIProtocolIdentifier_RDMA= 4,
835kSCSIProtocolIdentifier_iSCSI= 5,
836kSCSIProtocolIdentifier_SAS= 6,
837kSCSIProtocolIdentifier_ADT= 7,
838kSCSIProtocolIdentifier_ATAPI= 8,
839// 0x9-0xE Reserved
840kSCSIProtocolIdentifier_None= 0xF
841};
842
843
844/*!
845@define kIOPropertySCSIINQUIRYDeviceIdentification
846Device Identification key.
847*/
848#define kIOPropertySCSIINQUIRYDeviceIdentification"INQUIRY Device Identification"
849
850
851/*!
852@define kIOPropertySCSIINQUIRYDeviceIdCodeSet
853Code Set type key.
854*/
855#define kIOPropertySCSIINQUIRYDeviceIdCodeSet"Code Set"
856
857
858/*!
859@define kIOPropertySCSIINQUIRYDeviceIdType
860Identifier Type key.
861*/
862#define kIOPropertySCSIINQUIRYDeviceIdType"Identifier Type"
863
864
865/*!
866@define kIOPropertySCSIINQUIRYDeviceIdAssociation
867Association key.
868*/
869#define kIOPropertySCSIINQUIRYDeviceIdAssociation"Association"
870
871
872/*!
873@define kIOPropertySCSIINQUIRYDeviceIdentifier
874Identifier key (data or string).
875*/
876#define kIOPropertySCSIINQUIRYDeviceIdentifier"Identifier"
877
878
879/*!
880@struct SCSICmd_INQUIRY_Page89_Data
881@discussion INQUIRY Page 89h data as defined in the SAT 1.0
882specification. This section contians all structures and
883definitions used by the INQUIRY command in response to a request
884for page 89h - ATA information VPD Page.
885*/
886typedef struct SCSICmd_INQUIRY_Page89_Data
887{
888UInt8PERIPHERAL_DEVICE_TYPE;// 7-5 = Qualifier. 4-0 = Device type.
889UInt8PAGE_CODE;// Must be equal to 89h
890UInt16PAGE_LENGTH;// Must be equal to 238h
891UInt32Reserved;
892UInt8SAT_VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length];
893UInt8SAT_PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length];
894UInt8SAT_PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length];
895UInt8ATA_DEVICE_SIGNATURE[20];
896UInt8COMMAND_CODE;
897UInt8Reserved2[3];
898UInt8IDENTIFY_DATA[512];
899} SCSICmd_INQUIRY_Page89_Data;
900
901
902/*!
903@define kIOPropertySATVendorIdentification
904Vendor Identification of the SATL.
905*/
906#define kIOPropertySATVendorIdentification"SAT Vendor Identification"
907
908
909/*!
910@define kIOPropertySATProductIdentification
911Product Identification of the SATL.
912*/
913#define kIOPropertySATProductIdentification"SAT Product Identification"
914
915
916/*!
917@define kIOPropertySATProductRevisonLevel
918Product Revision Level of the SATL.
919*/
920#define kIOPropertySATProductRevisonLevel"SAT Product Revision Level"
921
922
923#endif/* _IOKIT_SCSI_CMDS_INQUIRY_H_ */
924

Archive Download this file

Revision: 296