Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h

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

Archive Download this file

Revision: 2045