Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h

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_REQUEST_SENSE_H_
25#define _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_
26
27
28#if KERNEL
29#include <IOKit/IOTypes.h>
30#else
31#include <CoreFoundation/CoreFoundation.h>
32#endif
33
34
35/*! @header SCSI Request Sense Definitions
36@discussion
37This file contains all definitions for the data returned from
38the REQUEST SENSE (0x03) command and from auto sense on protocols
39that support it.
40*/
41
42
43/*!
44@enum kSenseDefaultSize
45@discussion
46The default size for SCSI Request Sense data.
47*/
48enum
49{
50kSenseDefaultSize= 18
51};
52
53
54/*!
55@struct SCSI_Sense_Data
56@discussion
57The basic SCSI Request Sense data structure.
58*/
59typedef struct SCSI_Sense_Data
60{
61UInt8VALID_RESPONSE_CODE;// 7 = Valid. 6-0 = Response Code.
62UInt8SEGMENT_NUMBER;// Segment number
63UInt8SENSE_KEY;// 7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY.
64UInt8INFORMATION_1;// INFORMATION.
65UInt8INFORMATION_2;// INFORMATION.
66UInt8INFORMATION_3;// INFORMATION.
67UInt8INFORMATION_4;// INFORMATION.
68UInt8ADDITIONAL_SENSE_LENGTH;// Number of additional bytes available in sense data
69UInt8COMMAND_SPECIFIC_INFORMATION_1;// Command Specific Information
70UInt8COMMAND_SPECIFIC_INFORMATION_2;// Command Specific Information
71UInt8COMMAND_SPECIFIC_INFORMATION_3;// Command Specific Information
72UInt8COMMAND_SPECIFIC_INFORMATION_4;// Command Specific Information
73UInt8ADDITIONAL_SENSE_CODE;// Additional Sense Code
74UInt8ADDITIONAL_SENSE_CODE_QUALIFIER;// Additional Sense Code Qualifier
75UInt8FIELD_REPLACEABLE_UNIT_CODE;// Field Replaceable Unit Code
76UInt8SKSV_SENSE_KEY_SPECIFIC_MSB;// 7 = Sense Key Specific Valid bit, 6-0 Sense Key Specific MSB
77UInt8SENSE_KEY_SPECIFIC_MID;// Sense Key Specific Middle
78UInt8SENSE_KEY_SPECIFIC_LSB;// Sense Key Specific LSB
79} SCSI_Sense_Data;
80
81
82/*!
83@enum Sense Valid
84@discussion
85Masks to use to determine if sense data is valid or not.
86@constant kSENSE_DATA_VALID
87Sense data is valid.
88@constant kSENSE_NOT_DATA_VALID
89Sense data is not valid.
90@constant kSENSE_DATA_VALID_Mask
91Validity mask to use when checking the VALID_RESPONSE_CODE field.
92*/
93enum
94{
95kSENSE_DATA_VALID= 0x80,
96kSENSE_NOT_DATA_VALID= 0x00,
97kSENSE_DATA_VALID_Mask= 0x80
98};
99
100
101/*!
102@enum Sense Response Codes
103@discussion
104Masks and values to determine the Response Code.
105@constant kSENSE_RESPONSE_CODE_Current_Errors
106Response code indicating current errors are reported.
107@constant kSENSE_RESPONSE_CODE_Deferred_Errors
108Response code indicating deferred errors are reported.
109@constant kSENSE_RESPONSE_CODE_Mask
110Mask to use when checking the VALID_RESPONSE_CODE field.
111*/
112enum
113{
114kSENSE_RESPONSE_CODE_Current_Errors= 0x70,
115kSENSE_RESPONSE_CODE_Deferred_Errors= 0x71,
116kSENSE_RESPONSE_CODE_Mask= 0x7F
117};
118
119
120/*!
121@enum FILEMARK bit field definitions
122@discussion
123Masks and values to determine the FileMark bit field.
124@constant kSENSE_FILEMARK_Set
125Filemark bit is set.
126@constant kSENSE_FILEMARK_Not_Set
127Filemark bit is not set.
128@constant kSENSE_FILEMARK_Mask
129Mask to use when checking the SENSE_KEY field for the FILEMARK bit.
130*/
131enum
132{
133kSENSE_FILEMARK_Set= 0x80,
134kSENSE_FILEMARK_Not_Set = 0x00,
135kSENSE_FILEMARK_Mask = 0x80
136};
137
138
139/*!
140@enum EOM bit field definitions
141@discussion
142Masks and values to determine the End Of Medium bit field.
143@constant kSENSE_EOM_Set
144End Of Medium bit is set.
145@constant kSENSE_EOM_Not_Set
146End Of Medium bit is not set.
147@constant kSENSE_EOM_Mask
148Mask to use when checking the SENSE_KEY field for the EOM bit.
149*/
150enum
151{
152kSENSE_EOM_Set= 0x40,
153kSENSE_EOM_Not_Set = 0x00,
154kSENSE_EOM_Mask = 0x40
155};
156
157
158/*!
159@enum ILI bit field definitions
160@discussion
161Masks and values to determine the Incorrect Length Indicator bit field.
162@constant kSENSE_ILI_Set
163Incorrect Length Indicator bit is set.
164@constant kSENSE_ILI_Not_Set
165Incorrect Length Indicator bit is not set.
166@constant kSENSE_ILI_Mask
167Mask to use when checking the SENSE_KEY field for the ILI bit.
168*/
169enum
170{
171kSENSE_ILI_Set= 0x20,
172kSENSE_ILI_Not_Set = 0x00,
173kSENSE_ILI_Mask = 0x20
174};
175
176
177/*!
178@enum Sense Key definitions
179@discussion
180Masks and values to determine the SENSE_KEY.
181@constant kSENSE_KEY_NO_SENSE
182No sense data is present.
183@constant kSENSE_KEY_RECOVERED_ERROR
184A recovered error has occurred.
185@constant kSENSE_KEY_NOT_READY
186Device server is not ready.
187@constant kSENSE_KEY_MEDIUM_ERROR
188Device server detected a medium error.
189@constant kSENSE_KEY_HARDWARE_ERROR
190Device server detected a hardware error.
191@constant kSENSE_KEY_ILLEGAL_REQUEST
192Device server detected an illegal request.
193@constant kSENSE_KEY_UNIT_ATTENTION
194Device server indicates a unit attention condition.
195@constant kSENSE_KEY_DATA_PROTECT
196Device server indicates a data protect condition.
197@constant kSENSE_KEY_BLANK_CHECK
198Device server indicates a blank check condition.
199@constant kSENSE_KEY_VENDOR_SPECIFIC
200Device server indicates a vendor specific condition.
201@constant kSENSE_KEY_COPY_ABORTED
202Device server indicates a copy aborted condition.
203@constant kSENSE_KEY_ABORTED_COMMAND
204Device server indicates an aborted command condition.
205@constant kSENSE_KEY_VOLUME_OVERFLOW
206Device server indicates a volume overflow condition.
207@constant kSENSE_KEY_MISCOMPARE
208Device server indicates a miscompare condition.
209@constant kSENSE_KEY_Mask
210Mask to use when checking the SENSE_KEY field for the SENSE_KEY value.
211*/
212enum
213{
214kSENSE_KEY_NO_SENSE= 0x00,
215kSENSE_KEY_RECOVERED_ERROR= 0x01,
216kSENSE_KEY_NOT_READY= 0x02,
217kSENSE_KEY_MEDIUM_ERROR= 0x03,
218kSENSE_KEY_HARDWARE_ERROR= 0x04,
219kSENSE_KEY_ILLEGAL_REQUEST= 0x05,
220kSENSE_KEY_UNIT_ATTENTION= 0x06,
221kSENSE_KEY_DATA_PROTECT= 0x07,
222kSENSE_KEY_BLANK_CHECK= 0x08,
223kSENSE_KEY_VENDOR_SPECIFIC= 0x09,
224kSENSE_KEY_COPY_ABORTED= 0x0A,
225kSENSE_KEY_ABORTED_COMMAND= 0x0B,
226/* SENSE KEY 0x0C is obsoleted */
227kSENSE_KEY_VOLUME_OVERFLOW= 0x0D,
228kSENSE_KEY_MISCOMPARE= 0x0E,
229/* SENSE KEY 0x0F is reserved */
230kSENSE_KEY_Mask = 0x0F
231};
232
233
234#endif/* _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ */
235

Archive Download this file

Revision: 881