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 | ␊ |
25 | #ifndef _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_␊ |
26 | #define _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_␊ |
27 | ␊ |
28 | #if defined(KERNEL) && defined(__cplusplus)␊ |
29 | ␊ |
30 | ␊ |
31 | //-----------------------------------------------------------------------------␊ |
32 | //␉Includes␊ |
33 | //-----------------------------------------------------------------------------␊ |
34 | ␊ |
35 | // General IOKit headers␊ |
36 | #include <IOKit/IOLib.h>␊ |
37 | #include <IOKit/IOService.h>␊ |
38 | #include <IOKit/IOReturn.h>␊ |
39 | #include <IOKit/IOMemoryDescriptor.h>␊ |
40 | #include <IOKit/IOSyncer.h>␊ |
41 | ␊ |
42 | // SCSI Architecture Model Family includes␊ |
43 | #include <IOKit/scsi/SCSICommandDefinitions.h>␊ |
44 | #include <IOKit/scsi/SCSICmds_INQUIRY_Definitions.h>␊ |
45 | #include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h>␊ |
46 | #include <IOKit/scsi/IOSCSIProtocolInterface.h>␊ |
47 | ␊ |
48 | ␊ |
49 | //-----------------------------------------------------------------------------␊ |
50 | //␉Constants␊ |
51 | //-----------------------------------------------------------------------------␊ |
52 | ␊ |
53 | // Notification messages␊ |
54 | enum␊ |
55 | {␊ |
56 | ␉kSCSIServicesNotification_Suspend␉= 0x69000080,␊ |
57 | ␉kSCSIServicesNotification_Resume␉= 0x69000090␊ |
58 | };␊ |
59 | ␊ |
60 | ␊ |
61 | // Timeout values␊ |
62 | enum␊ |
63 | {␊ |
64 | ␉kOneSecondTimeoutInMS ␉␉= 1000,␊ |
65 | ␉kTenSecondTimeoutInMS ␉␉= 10 * kOneSecondTimeoutInMS,␊ |
66 | ␉kThirtySecondTimeoutInMS␉= 30 * kOneSecondTimeoutInMS,␊ |
67 | kFortyFiveSecondTimeoutInMS␉= 45 * kOneSecondTimeoutInMS␊ |
68 | };␊ |
69 | ␊ |
70 | // Mode page values for page control field␊ |
71 | enum␊ |
72 | {␊ |
73 | ␉kModePageControlCurrentValues␉␉= 0x00,␊ |
74 | ␉kModePageControlChangeableValues␉= 0x01,␊ |
75 | ␉kModePageControlDefaultValues␉␉= 0x02,␊ |
76 | ␉kModePageControlSavedValues␉␉␉= 0x03␊ |
77 | };␊ |
78 | ␊ |
79 | // The command should be tried 5 times. The original attempt ␊ |
80 | // plus 4 retries.␊ |
81 | #define kDefaultRetryCount␉␉4␊ |
82 | ␊ |
83 | // Forward declarations for internal use only classes␊ |
84 | class SCSIPrimaryCommands;␊ |
85 | ␊ |
86 | ␊ |
87 | //-----------------------------------------------------------------------------␊ |
88 | //␉Class Declaration␊ |
89 | //-----------------------------------------------------------------------------␊ |
90 | ␊ |
91 | class IOSCSIPrimaryCommandsDevice : public IOSCSIProtocolInterface␊ |
92 | {␊ |
93 | ␉␊ |
94 | ␉OSDeclareAbstractStructors ( IOSCSIPrimaryCommandsDevice )␊ |
95 | ␉␊ |
96 | private:␊ |
97 | ␉␊ |
98 | #ifndef __LP64__␊ |
99 | ␉SCSIPrimaryCommands *␉␉␉fSCSIPrimaryCommandObject;␊ |
100 | #endif␊ |
101 | ␊ |
102 | ␉IOSCSIProtocolInterface *␉␉fProtocolDriver;␊ |
103 | ␉␊ |
104 | ␉// The fProtocolAccessEnabled member variable indicates whether␊ |
105 | ␉// requests coming from the client can be sent to the device.␊ |
106 | ␉// This will be set to true after the Protocol Service driver is successfully ␊ |
107 | ␉// opened and before the call to InitializeDeviceSupport and set to false before ␊ |
108 | ␉// TerminateDeviceSupport is called.␊ |
109 | ␉bool␉␉␉␉␉␉␉fProtocolAccessEnabled;␊ |
110 | ␉␊ |
111 | ␉// The fDeviceAccessEnabled member variable indicates whether␊ |
112 | ␉// requests coming from the client can be sent to the device.␊ |
113 | ␉// This will be set to true after InitializeDeviceSupport is called and␊ |
114 | ␉// set to false before StopDeviceSupport is called.␊ |
115 | ␉bool␉␉␉␉␉␉␉fDeviceAccessEnabled;␊ |
116 | ␉bool␉␉␉␉␉␉␉fDeviceAccessSuspended;␊ |
117 | ␉␊ |
118 | ␉static bool␉␉ServerKeyswitchCallback ( void *␉␉target,␊ |
119 | ␉␉␉␉␉␉␉␉␉␉␉ void *␉␉refCon,␊ |
120 | ␉␉␉␉␉␉␉␉␉␉␉ IOService *␉newService );␊ |
121 | ␉␊ |
122 | ␉static void␉␉TaskCallback ( SCSITaskIdentifier completedTask );␊ |
123 | ␉void␉␉␉TaskCompletion ( SCSITaskIdentifier completedTask );␊ |
124 | ␉␊ |
125 | ␉static IOReturn␉sWaitForTask ( void * object, SCSITaskIdentifier request );␊ |
126 | ␉IOReturn␉␉GatedWaitForTask ( SCSITaskIdentifier request );␊ |
127 | ␉␊ |
128 | protected:␊ |
129 | ␉␊ |
130 | ␉// Reserve space for future expansion.␊ |
131 | ␉struct IOSCSIPrimaryCommandsDeviceExpansionData␊ |
132 | ␉{␊ |
133 | ␉␉IONotifier *␉␉␉␉fKeySwitchNotifier;␊ |
134 | ␉␉UInt8␉␉␉␉␉␉fANSIVersion;␊ |
135 | ␉␉UInt32␉␉␉␉␉␉fReadTimeoutDuration;␊ |
136 | ␉␉UInt32␉␉␉␉␉␉fWriteTimeoutDuration;␊ |
137 | ␉␉bool␉␉␉␉␉␉fCMDQUE;␊ |
138 | ␉␉SCSITaggedTaskIdentifier␉fTaskID;␊ |
139 | ␉␉IOSimpleLock *␉␉␉␉fTaskIDLock;␊ |
140 | ␉␉UInt32␉␉␉␉␉␉fRetryCount;␊ |
141 | ␉};␊ |
142 | ␉IOSCSIPrimaryCommandsDeviceExpansionData * fIOSCSIPrimaryCommandsDeviceReserved;␊ |
143 | ␉␊ |
144 | ␉#define␉fReadTimeoutDuration␉␉fIOSCSIPrimaryCommandsDeviceReserved->fReadTimeoutDuration␊ |
145 | ␉#define␉fWriteTimeoutDuration␉␉fIOSCSIPrimaryCommandsDeviceReserved->fWriteTimeoutDuration␊ |
146 | ␉#define␉fRetryCount␉␉␉␉␉fIOSCSIPrimaryCommandsDeviceReserved->fRetryCount␊ |
147 | ␉␊ |
148 | ␉␊ |
149 | ␉UInt8␉␉␉␉␉␉␉fDefaultInquiryCount;␊ |
150 | ␉OSDictionary *␉␉␉␉␉fDeviceCharacteristicsDictionary;␊ |
151 | ␉UInt32␉␉␉␉␉␉␉fNumCommandsOutstanding;␊ |
152 | ␉␊ |
153 | ␉virtual void ␉␉␉␉␉free ( void );␊ |
154 | ␉void␉␉␉␉␉␉␉SetANSIVersion ( UInt8 );␊ |
155 | ␉void␉␉␉␉␉␉␉SetCMDQUE ( bool value );␊ |
156 | ␉IOReturn␉␉␉␉␉␉GetModeSense ( ␊ |
157 | ␉␉␉␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
158 | ␉␉␉␉␉␉␉␉␉␉SCSICmdField6Bit ␉␉␉PAGE_CODE,␊ |
159 | ␉␉␉␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH,␊ |
160 | ␉␉␉␉␉␉␉␉␉␉bool *␉␉␉␉␉␉use10ByteModeSense );␊ |
161 | ␉bool␉␉␉␉␉␉␉RetrieveINQUIRYData (␊ |
162 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉␉EVPD,␊ |
163 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉␉inquiryPage,␊ |
164 | ␉␉␉␉␉␉␉␉␉␉UInt8 *␉␉␉␉␉␉inquiryBuffer,␊ |
165 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉␉dataSize );␊ |
166 | ␉␊ |
167 | ␉// This flag is set if the device responds to a MODE_SENSE_10 command␊ |
168 | ␉// with the page code set to 0x1A (Power Conditions Mode Page)␊ |
169 | ␉bool␉␉␉␉␉␉␉fDeviceSupportsPowerConditions;␊ |
170 | ␉␊ |
171 | ␉// This method will retreive the SCSI Primary Command Set object for␊ |
172 | ␉// the class. For subclasses, this will be overridden using a␊ |
173 | ␉// dynamic cast on the base command set object of the subclass.␊ |
174 | ␊ |
175 | #ifndef __LP64__␊ |
176 | ␉␊ |
177 | ␉// ------ DEPRECATED API ----------␊ |
178 | ␉// This should no longer be called by subclasses as the command builder␊ |
179 | ␉// objects will be removed in a later release.␊ |
180 | ␉virtual SCSIPrimaryCommands *␉GetSCSIPrimaryCommandObject ( void );␉␊ |
181 | ␉␊ |
182 | ␉// This method is called by the start method to create all the command␊ |
183 | ␉// objects needed by the class. For subclasses, this will be overridden␊ |
184 | ␉// to create its needed command set objects.␊ |
185 | ␉virtual bool␉␉␉␉␉CreateCommandSetObjects ( void );␊ |
186 | ␉␊ |
187 | ␉// This method is called by the free method to free all the command␊ |
188 | ␉// objects needed by the class. For subclasses, this will be overridden␊ |
189 | ␉// to free its needed command set objects.␊ |
190 | ␉virtual void␉␉␉␉␉FreeCommandSetObjects ( void );␊ |
191 | ␊ |
192 | #endif␊ |
193 | ␉␊ |
194 | ␉␊ |
195 | ␉// This method is called by the start method to obtain information from␊ |
196 | ␉// the device with regards to whether it supports the power conditions mode page.␊ |
197 | ␉virtual void␉␉␉␉␉CheckPowerConditionsModePage ( void );␊ |
198 | ␉␊ |
199 | ␉// This will return back the Protocol driver that is used to␊ |
200 | ␉// send service requests to the device.␊ |
201 | ␉virtual IOSCSIProtocolInterface * GetProtocolDriver ( void );␊ |
202 | ␉␊ |
203 | ␉// This will get a new SCSITask for the caller␊ |
204 | ␉virtual SCSITaskIdentifier␉␉GetSCSITask ( void );␊ |
205 | ␉␊ |
206 | ␉// This will release a SCSITask (eventually return it to a pool)␊ |
207 | ␉virtual void␉␉␉␉␉ReleaseSCSITask ( SCSITaskIdentifier request );␊ |
208 | ␉␊ |
209 | ␉// This will return a unique value for the tagged task identifier␊ |
210 | ␉SCSITaggedTaskIdentifier␉␉GetUniqueTagID ( void );␊ |
211 | ␉␊ |
212 | ␉// Call for executing the command synchronously␉␊ |
213 | ␉SCSIServiceResponse ␉␉␉SendCommand ( ␉␊ |
214 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉request,␊ |
215 | ␉␉␉␉␉␉␉␉␉␉UInt32 ␉␉␉␉timeoutDuration );␊ |
216 | ␉␉␉␉␉␉␉␉␉␉␉␉␉␉␊ |
217 | ␉// Call for executing the command asycnchronously␉␊ |
218 | ␉void ␉␉␉␉␉␉␉SendCommand ( ␊ |
219 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉request,␊ |
220 | ␉␉␉␉␉␉␉␉␉␉UInt32 ␉␉␉␉timeoutDuration,␊ |
221 | ␉␉␉␉␉␉␉␉␉␉SCSITaskCompletion ␉taskCompletion );␊ |
222 | ␉␊ |
223 | ␉␊ |
224 | ␉virtual bool ␉␉␉␉␉InitializeDeviceSupport ( void ) = 0;␊ |
225 | ␉virtual void ␉␉␉␉␉StartDeviceSupport ( void ) = 0;␊ |
226 | ␉virtual void ␉␉␉␉␉SuspendDeviceSupport ( void ) = 0;␊ |
227 | ␉virtual void ␉␉␉␉␉ResumeDeviceSupport ( void ) = 0;␊ |
228 | ␉virtual void ␉␉␉␉␉StopDeviceSupport ( void ) = 0;␊ |
229 | ␉virtual void ␉␉␉␉␉TerminateDeviceSupport ( void ) = 0;␊ |
230 | ␉virtual UInt32␉␉␉␉␉GetNumberOfPowerStateTransitions ( void ) = 0;␊ |
231 | ␉␊ |
232 | ␉virtual IOReturn␉␉␉␉VerifyDeviceState ( void );␊ |
233 | ␉// Called to clear any power-on/reset status in the drive␊ |
234 | ␉virtual bool␉␉␉␉␉ClearPowerOnReset ( void );␊ |
235 | ␉virtual bool␉␉␉␉␉ClearNotReadyStatus ( void ) = 0;␊ |
236 | ␉␊ |
237 | ␉bool␉␉␉␉␉␉␉IsProtocolAccessEnabled ( void );␊ |
238 | ␉bool␉␉␉␉␉␉␉IsDeviceAccessEnabled ( void );␊ |
239 | ␉bool␉␉␉␉␉␉␉IsDeviceAccessSuspended ( void );␊ |
240 | ␊ |
241 | ␉// Accessors for saving and retrieving data from an SCSITask object.␊ |
242 | ␉bool ␉␉␉␉␉␉␉ResetForNewTask(␉␊ |
243 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
244 | ␉bool␉␉␉␉␉␉␉SetTaskAttribute ( ␊ |
245 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
246 | ␉␉␉␉␉␉␉␉␉␉SCSITaskAttribute ␉␉newAttribute );␊ |
247 | ␉SCSITaskAttribute␉␉␉␉GetTaskAttribute ( ␊ |
248 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
249 | ␉bool␉␉␉␉␉␉␉SetTaggedTaskIdentifier ( ␊ |
250 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉␉request, ␊ |
251 | ␉␉␉␉␉␉␉␉␉␉SCSITaggedTaskIdentifier␉taggedTaskIdentifier );␊ |
252 | ␉SCSITaggedTaskIdentifier␉␉GetTaggedTaskIdentifier ( ␊ |
253 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
254 | ␉bool␉␉␉␉␉␉␉SetTaskState ( ␉␊ |
255 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
256 | ␉␉␉␉␉␉␉␉␉␉SCSITaskState ␉␉␉newTaskState );␊ |
257 | ␉SCSITaskState␉␉␉␉␉GetTaskState ( ␊ |
258 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
259 | ␉bool␉␉␉␉␉␉␉SetTaskStatus ( ␊ |
260 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
261 | ␉␉␉␉␉␉␉␉␉␉SCSITaskStatus ␉␉␉newStatus );␊ |
262 | ␉SCSITaskStatus␉␉␉␉␉GetTaskStatus ( ␊ |
263 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
264 | ␉bool ␉␉␉␉␉␉␉SetCommandDescriptorBlock ( ␊ |
265 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
266 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte0,␊ |
267 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte1,␊ |
268 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte2,␊ |
269 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte3,␊ |
270 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte4,␊ |
271 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte5 );␊ |
272 | ␉␊ |
273 | ␉// Populate the 10 Byte Command Descriptor Block␊ |
274 | ␉bool ␉␉␉␉␉␉␉SetCommandDescriptorBlock ( ␊ |
275 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
276 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte0,␊ |
277 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte1,␊ |
278 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte2,␊ |
279 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte3,␊ |
280 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte4,␊ |
281 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte5,␊ |
282 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte6,␊ |
283 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte7,␊ |
284 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte8,␊ |
285 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte9 );␊ |
286 | ␉␊ |
287 | ␉// Populate the 12 Byte Command Descriptor Block␊ |
288 | ␉bool ␉␉␉␉␉␉␉SetCommandDescriptorBlock ( ␊ |
289 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
290 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte0,␊ |
291 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte1,␊ |
292 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte2,␊ |
293 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte3,␊ |
294 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte4,␊ |
295 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte5,␊ |
296 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte6,␊ |
297 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte7,␊ |
298 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte8,␊ |
299 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte9,␊ |
300 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte10,␊ |
301 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte11 );␊ |
302 | ␉␊ |
303 | ␉// Populate the 16 Byte Command Descriptor Block␊ |
304 | ␉bool ␉␉␉␉␉␉␉SetCommandDescriptorBlock ( ␊ |
305 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
306 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte0,␊ |
307 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte1,␊ |
308 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte2,␊ |
309 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte3,␊ |
310 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte4,␊ |
311 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte5,␊ |
312 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte6,␊ |
313 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte7,␊ |
314 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte8,␊ |
315 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte9,␊ |
316 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte10,␊ |
317 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte11,␊ |
318 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte12,␊ |
319 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte13,␊ |
320 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte14,␊ |
321 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte15 );␊ |
322 | ␉␉␉␉␉␉␉␉␉␉␊ |
323 | ␉bool␉␉␉␉␉␉␉SetDataTransferDirection ( ␊ |
324 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
325 | ␉␉␉␉␉␉␉␉␉␉UInt8 ␉␉␉␉␉newDirection );␊ |
326 | ␉UInt8␉␉␉␉␉␉␉GetDataTransferDirection ( ␊ |
327 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
328 | ␉bool␉␉␉␉␉␉␉SetRequestedDataTransferCount (␊ |
329 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
330 | ␉␉␉␉␉␉␉␉␉␉UInt64 ␉␉␉␉␉newRequestedCount );␊ |
331 | ␉UInt64␉␉␉␉␉␉␉GetRequestedDataTransferCount (␊ |
332 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
333 | ␉bool␉␉␉␉␉␉␉SetRealizedDataTransferCount (␊ |
334 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
335 | ␉␉␉␉␉␉␉␉␉␉UInt64 ␉␉␉␉␉newRealizedDataCount );␊ |
336 | ␉UInt64␉␉␉␉␉␉␉GetRealizedDataTransferCount ( ␊ |
337 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
338 | ␉bool␉␉␉␉␉␉␉SetDataBuffer ( ␊ |
339 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
340 | ␉␉␉␉␉␉␉␉␉␉IOMemoryDescriptor * ␉newBuffer );␊ |
341 | ␉IOMemoryDescriptor *␉␉␉GetDataBuffer ( ␊ |
342 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
343 | ␉bool␉␉␉␉␉␉␉SetTimeoutDuration ( ␊ |
344 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request, ␊ |
345 | ␉␉␉␉␉␉␉␉␉␉UInt32 ␉␉␉␉␉newTimeout );␊ |
346 | ␉UInt32␉␉␉␉␉␉␉GetTimeoutDuration ( ␊ |
347 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
348 | ␉bool␉␉␉␉␉␉␉SetTaskCompletionCallback ( ␊ |
349 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
350 | ␉␉␉␉␉␉␉␉␉␉SCSITaskCompletion ␉␉newCallback );␊ |
351 | ␉void␉␉␉␉␉␉␉TaskCompletedNotification ( ␊ |
352 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
353 | ␉␊ |
354 | ␉bool␉␉␉␉␉␉␉SetServiceResponse (␊ |
355 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
356 | ␉␉␉␉␉␉␉␉␉␉SCSIServiceResponse ␉serviceResponse );␊ |
357 | ␉SCSIServiceResponse ␉␉␉GetServiceResponse (␊ |
358 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
359 | ␉bool␉␉␉␉␉␉␉SetAutosenseCommand (␊ |
360 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
361 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte0,␊ |
362 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte1,␊ |
363 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte2,␊ |
364 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte3,␊ |
365 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte4,␊ |
366 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉cdbByte5 );␊ |
367 | ␉bool␉␉␉␉␉␉␉GetAutoSenseData (␊ |
368 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
369 | ␉␉␉␉␉␉␉␉␉␉SCSI_Sense_Data * ␉␉senseData ); // DEPRECATED, use below function instead␊ |
370 | ␉bool␉␉␉␉␉␉␉GetAutoSenseData (␊ |
371 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
372 | ␉␉␉␉␉␉␉␉␉␉SCSI_Sense_Data * ␉␉senseData,␊ |
373 | ␉␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉senseDataSize );␊ |
374 | ␉UInt8␉␉␉␉␉␉␉GetAutoSenseDataSize (␊ |
375 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
376 | ␉␊ |
377 | ␉bool␉␉␉␉␉␉␉SetApplicationLayerReference (␊ |
378 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request,␊ |
379 | ␉␉␉␉␉␉␉␉␉␉void * ␉␉␉␉␉newReferenceValue );␊ |
380 | ␉void *␉␉␉␉␉␉␉GetApplicationLayerReference (␊ |
381 | ␉␉␉␉␉␉␉␉␉␉SCSITaskIdentifier ␉␉request );␊ |
382 | ␉␊ |
383 | ␉void ␉␉␉␉␉␉␉IncrementOutstandingCommandsCount ( void );␊ |
384 | ␉static void␉␉␉␉␉␉sIncrementOutstandingCommandsCount ( ␊ |
385 | ␉␉␉␉␉␉␉␉␉␉IOSCSIPrimaryCommandsDevice * self );␊ |
386 | ␉virtual void␉␉␉␉␉HandleIncrementOutstandingCommandsCount ( void );␉␊ |
387 | ␉␊ |
388 | ␊ |
389 | ␉// This static member routine provides a mechanism for retrieving a pointer to␊ |
390 | ␉// the object that is claimed as the owner of the specified SCSITask.␊ |
391 | ␉static OSObject *␉␉␉␉sGetOwnerForTask ( SCSITaskIdentifier request );␊ |
392 | ␉␊ |
393 | public:␊ |
394 | ␉␊ |
395 | ␉bool␉␉␉␉init ( OSDictionary * propTable );␊ |
396 | ␉virtual bool␉␉start ( IOService * provider );␊ |
397 | ␉virtual void␉␉stop ( IOService * provider );␊ |
398 | ␉virtual IOReturn ␉message ( UInt32 type, IOService * nub, void * arg );␊ |
399 | ␉␊ |
400 | ␉// The setAgressiveness method is called by the power manager␊ |
401 | ␉// to notify us of certain power management settings. We override␊ |
402 | ␉// this method in order to catch the kPMMinutesToSpinDown message␊ |
403 | ␉// in order to set our idle timer.␊ |
404 | ␉virtual IOReturn ␉setAggressiveness ( unsigned long type, unsigned long minutes );␊ |
405 | ␉␊ |
406 | ␉// Methods for getting device information strings␊ |
407 | ␉virtual char *␉␉GetVendorString ( void );␊ |
408 | ␉virtual char *␉␉GetProductString ( void );␊ |
409 | ␉virtual char *␉␉GetRevisionString ( void );␊ |
410 | ␉OSDictionary *␉␉GetProtocolCharacteristicsDictionary ( void );␊ |
411 | ␉OSDictionary *␉␉GetDeviceCharacteristicsDictionary ( void );␉␊ |
412 | ␉UInt8␉␉␉␉GetANSIVersion ( void );␊ |
413 | ␉bool␉␉␉␉GetCMDQUE ( void );␊ |
414 | OSString * MapINQUIRYDataToIconFile ( void );␊ |
415 | ␉UInt32␉␉␉␉GetRetryCount ( void );␊ |
416 | ␉␊ |
417 | ␉// -- SCSI Protocol Interface Methods␉--␊ |
418 | ␉// The ExecuteCommand method will take a SCSI Task and transport␊ |
419 | ␉// it across the physical wire(s) to the device␊ |
420 | ␉virtual void␉␉ExecuteCommand ( SCSITaskIdentifier request );␊ |
421 | ␉␊ |
422 | ␉// The Task Management function to allow the SCSI Application Layer client to request␊ |
423 | ␉// that a specific task be aborted.␊ |
424 | ␉SCSIServiceResponse␉␉AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag );␊ |
425 | ␊ |
426 | ␉// The Task Management function to allow the SCSI Application Layer client to request␊ |
427 | ␉// that a all tasks curerntly in the task set be aborted.␊ |
428 | ␉SCSIServiceResponse␉␉AbortTaskSet ( UInt8 theLogicalUnit );␊ |
429 | ␊ |
430 | ␉SCSIServiceResponse␉␉ClearACA ( UInt8 theLogicalUnit );␊ |
431 | ␊ |
432 | ␉SCSIServiceResponse␉␉ClearTaskSet ( UInt8 theLogicalUnit );␊ |
433 | ␊ |
434 | ␉SCSIServiceResponse␉␉LogicalUnitReset ( UInt8 theLogicalUnit );␊ |
435 | ␊ |
436 | ␉SCSIServiceResponse␉␉TargetReset ( void );␊ |
437 | ␊ |
438 | ␉// The AbortCommand method will abort the indicated SCSI Task,␊ |
439 | ␉// if it is possible and the task has not already completed.␊ |
440 | ␉virtual SCSIServiceResponse␉AbortCommand ( SCSITaskIdentifier request );␊ |
441 | ␉␊ |
442 | ␉// The IsProtocolServiceSupported will return true if the specified␊ |
443 | ␉// feature is supported by the protocol layer. If the service has a value that must be␊ |
444 | ␉// returned, it will be returned in the serviceValue output parameter.␊ |
445 | ␉virtual bool␉␉IsProtocolServiceSupported (␊ |
446 | ␉␉␉␉␉␉␉␉␉␉␉SCSIProtocolFeature feature,␊ |
447 | ␉␉␉␉␉␉␉␉␉␉␉void *␉␉␉␉serviceValue );␊ |
448 | ␉␊ |
449 | ␉// The HandleProtocolServiceFeature will return true if the specified feature could␊ |
450 | ␉// be handled properly by the protocol layer.␊ |
451 | ␉virtual bool␉␉HandleProtocolServiceFeature (␊ |
452 | ␉␉␉␉␉␉␉␉␉␉␉SCSIProtocolFeature␉feature,␊ |
453 | ␉␉␉␉␉␉␉␉␉␉␉void *␉␉␉␉serviceValue );␊ |
454 | ␉␊ |
455 | ␉// Utility methods for use by all peripheral device objects.␊ |
456 | ␊ |
457 | ␉// isParameterValid are used to validate that the parameter passed into␊ |
458 | ␉// the command methods are of the correct value.␊ |
459 | ␉␊ |
460 | ␉// Validate Parameter used for 1 bit to 1 byte paramaters␊ |
461 | bool ␉␉␉␉IsParameterValid ( ␊ |
462 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉param,␊ |
463 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉mask );␊ |
464 | ␉␊ |
465 | ␉// Validate Parameter used for 9 bit to 2 byte paramaters␊ |
466 | ␉bool ␉␉␉␉IsParameterValid ( ␊ |
467 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉param,␊ |
468 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉mask );␊ |
469 | ␉␊ |
470 | ␉// Validate Parameter used for 17 bit to 4 byte paramaters␊ |
471 | ␉bool ␉␉␉␉IsParameterValid ( ␊ |
472 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉param,␊ |
473 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉mask );␊ |
474 | ␉␊ |
475 | ␉// Validate Parameter used for 33 bit to 8 byte paramaters␊ |
476 | ␉bool ␉␉␉␉IsParameterValid ( ␊ |
477 | ␉␉␉␉␉␉␉SCSICmdField8Byte ␉␉␉param,␊ |
478 | ␉␉␉␉␉␉␉SCSICmdField8Byte ␉␉␉mask );␊ |
479 | ␉␊ |
480 | ␊ |
481 | ␉bool ␉␉␉␉IsMemoryDescriptorValid (␊ |
482 | ␉␉␉␉␉␉␉IOMemoryDescriptor * ␉␉dataBuffer );␊ |
483 | ␉␊ |
484 | ␉bool ␉␉␉␉IsMemoryDescriptorValid (␊ |
485 | ␉␉␉␉␉␉␉IOMemoryDescriptor * ␉␉dataBuffer,␊ |
486 | ␉␉␉␉␉␉␉UInt64␉␉␉␉␉␉requiredSize );␊ |
487 | ␊ |
488 | #ifndef __LP64__␊ |
489 | ␉␊ |
490 | ␉// SCSI Primary command implementations␊ |
491 | ␉virtual bool␉␉CHANGE_DEFINITION (␊ |
492 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
493 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
494 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SAVE,␊ |
495 | ␉␉␉␉␉␉␉SCSICmdField7Bit ␉␉␉DEFINITION_PARAMETER,␊ |
496 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉PARAMETER_DATA_LENGTH,␊ |
497 | ␉␉␉ ␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
498 | ␉ ␊ |
499 | ␉virtual bool␉␉COMPARE (␊ |
500 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
501 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
502 | ␉ ␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PAD,␊ |
503 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
504 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
505 | ␉␉␉␊ |
506 | ␉virtual bool␉␉COPY (␊ |
507 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
508 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
509 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PAD,␊ |
510 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
511 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
512 | ␉ ␊ |
513 | ␉virtual bool␉␉COPY_AND_VERIFY (␊ |
514 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
515 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
516 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉BYTCHK,␊ |
517 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PAD,␊ |
518 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
519 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
520 | ␊ |
521 | ␉virtual bool␉␉EXTENDED_COPY (␊ |
522 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
523 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
524 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
525 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
526 | ␊ |
527 | #endif␉/* !__LP64__ */␊ |
528 | ␉␊ |
529 | ␉virtual bool␉␉INQUIRY (␊ |
530 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
531 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
532 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉CMDDT,␊ |
533 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EVPD,␊ |
534 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉PAGE_OR_OPERATION_CODE,␊ |
535 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉ALLOCATION_LENGTH, ␊ |
536 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
537 | ␊ |
538 | ␉virtual bool␉␉LOG_SELECT (␊ |
539 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
540 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
541 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PCR,␊ |
542 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SP,␊ |
543 | ␉␉␉␉␉␉␉SCSICmdField2Bit ␉␉␉PC,␊ |
544 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
545 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL ); ␊ |
546 | ␊ |
547 | ␉virtual bool␉␉LOG_SENSE (␊ |
548 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
549 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
550 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PPC,␊ |
551 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SP,␊ |
552 | ␉␉␉␉␉␉␉SCSICmdField2Bit ␉␉␉PC,␊ |
553 | ␉␉␉␉␉␉␉SCSICmdField6Bit ␉␉␉PAGE_CODE,␊ |
554 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_POINTER,␊ |
555 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH, ␊ |
556 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL ); ␊ |
557 | ␉␊ |
558 | ␉virtual bool␉␉MODE_SELECT_6 (␊ |
559 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
560 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
561 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PF,␊ |
562 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SP,␊ |
563 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉PARAMETER_LIST_LENGTH, ␊ |
564 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL ); ␊ |
565 | ␊ |
566 | ␉virtual bool␉␉MODE_SELECT_10 (␊ |
567 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
568 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
569 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PF,␊ |
570 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SP,␊ |
571 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH, ␊ |
572 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL ); ␊ |
573 | ␊ |
574 | ␉virtual bool␉␉MODE_SENSE_6 (␊ |
575 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
576 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
577 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉DBD,␊ |
578 | ␉ ␉␉␉␉␉␉SCSICmdField2Bit ␉␉␉PC,␊ |
579 | ␉ ␉␉␉␉␉␉SCSICmdField6Bit ␉␉␉PAGE_CODE,␊ |
580 | ␉ ␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉ALLOCATION_LENGTH,␊ |
581 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
582 | ␊ |
583 | ␉virtual bool␉␉MODE_SENSE_10 (␊ |
584 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
585 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
586 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉LLBAA,␊ |
587 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉DBD,␊ |
588 | ␉ ␉␉␉␉␉␉SCSICmdField2Bit ␉␉␉PC,␊ |
589 | ␉ ␉␉␉␉␉␉SCSICmdField6Bit ␉␉␉PAGE_CODE,␊ |
590 | ␉ ␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH,␊ |
591 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
592 | ␊ |
593 | ␉virtual bool␉␉PERSISTENT_RESERVE_IN (␊ |
594 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
595 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
596 | ␉ ␉␉␉␉␉␉SCSICmdField5Bit ␉␉␉SERVICE_ACTION,␊ |
597 | ␉ ␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH,␊ |
598 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
599 | ␊ |
600 | ␉virtual bool␉␉PERSISTENT_RESERVE_OUT (␊ |
601 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
602 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
603 | ␉ ␉␉␉␉␉␉SCSICmdField5Bit ␉␉␉SERVICE_ACTION,␊ |
604 | ␉ ␉␉␉␉␉␉SCSICmdField4Bit ␉␉␉SCOPE,␊ |
605 | ␉ ␉␉␉␉␉␉SCSICmdField4Bit ␉␉␉TYPE,␊ |
606 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
607 | ␊ |
608 | ␉virtual bool␉␉PREVENT_ALLOW_MEDIUM_REMOVAL (␊ |
609 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
610 | ␉␉ ␉␉␉␉␉SCSICmdField2Bit ␉␉␉PREVENT, ␊ |
611 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
612 | ␊ |
613 | ␉virtual bool␉␉READ_BUFFER (␊ |
614 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
615 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
616 | ␉␉␉␉␉␉␉SCSICmdField4Bit ␉␉␉MODE,␊ |
617 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉BUFFER_ID,␊ |
618 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉BUFFER_OFFSET,␊ |
619 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉ALLOCATION_LENGTH, ␊ |
620 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
621 | ␊ |
622 | ␉virtual bool␉␉RECEIVE (␊ |
623 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
624 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
625 | ␉␉ ␉␉␉␉␉SCSICmdField3Byte ␉␉␉TRANSFER_LENGTH,␊ |
626 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
627 | ␊ |
628 | ␉virtual bool␉␉RECEIVE_DIAGNOSTICS_RESULTS (␊ |
629 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
630 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
631 | ␉␉ ␉␉␉␉␉SCSICmdField1Bit ␉␉␉PCV,␊ |
632 | ␉␉ ␉␉␉␉␉SCSICmdField1Byte␉␉␉PAGE_CODE,␊ |
633 | ␉␉ ␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH,␊ |
634 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
635 | ␊ |
636 | ␉virtual bool␉␉RELEASE_6 (␊ |
637 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
638 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
639 | ␊ |
640 | #ifndef __LP64__␊ |
641 | ␊ |
642 | ␉virtual bool␉␉RELEASE_6 (␊ |
643 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
644 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
645 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EXTENT,␊ |
646 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉RESERVATION_IDENTIFICATION,␊ |
647 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
648 | ␊ |
649 | #endif␉/* !__LP64__ */␊ |
650 | ␉␊ |
651 | ␉virtual bool␉␉RELEASE_10 (␊ |
652 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
653 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
654 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉THRDPTY,␊ |
655 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉LONGID,␊ |
656 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉THIRD_PARTY_DEVICE_ID,␊ |
657 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
658 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
659 | ␊ |
660 | #ifndef __LP64__␊ |
661 | ␊ |
662 | ␉virtual bool␉␉RELEASE_10 (␊ |
663 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
664 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
665 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉THRDPTY,␊ |
666 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉LONGID,␊ |
667 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EXTENT,␊ |
668 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉RESERVATION_IDENTIFICATION,␊ |
669 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉THIRD_PARTY_DEVICE_ID,␊ |
670 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
671 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
672 | ␊ |
673 | #endif␉/* !__LP64__ */␊ |
674 | ␉␊ |
675 | ␉virtual bool␉␉REPORT_DEVICE_IDENTIFIER ( ␊ |
676 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
677 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
678 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉ALLOCATION_LENGTH,␊ |
679 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
680 | ␊ |
681 | ␉virtual bool␉␉REPORT_LUNS ( ␊ |
682 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
683 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
684 | ␉␉␉␉ ␉␉␉SCSICmdField4Byte ␉␉␉ALLOCATION_LENGTH,␊ |
685 | ␉␉␉␉ ␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
686 | ␉␊ |
687 | ␉virtual bool␉␉REQUEST_SENSE (␊ |
688 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
689 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
690 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉ALLOCATION_LENGTH, ␊ |
691 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
692 | ␉␊ |
693 | ␉virtual bool␉␉RESERVE_6 (␊ |
694 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
695 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
696 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
697 | ␊ |
698 | #ifndef __LP64__␊ |
699 | ␊ |
700 | ␉virtual bool␉␉RESERVE_6 (␊ |
701 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
702 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
703 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EXTENT,␊ |
704 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉RESERVATION_IDENTIFICATION,␊ |
705 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
706 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
707 | ␊ |
708 | #endif␉/* !__LP64__ */␊ |
709 | ␉␊ |
710 | ␉virtual bool␉␉RESERVE_10 (␊ |
711 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
712 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
713 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉THRDPTY,␊ |
714 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉LONGID,␊ |
715 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉THIRD_PARTY_DEVICE_ID,␊ |
716 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
717 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
718 | ␊ |
719 | #ifndef __LP64__␊ |
720 | ␊ |
721 | ␉virtual bool␉␉RESERVE_10 (␊ |
722 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
723 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
724 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉THRDPTY,␊ |
725 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉LONGID,␊ |
726 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EXTENT,␊ |
727 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉RESERVATION_IDENTIFICATION,␊ |
728 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉THIRD_PARTY_DEVICE_ID,␊ |
729 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
730 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
731 | ␊ |
732 | #endif␉/* !__LP64__ */␊ |
733 | ␉␊ |
734 | ␉virtual bool␉␉SEND (␊ |
735 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
736 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
737 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉AER,␊ |
738 | ␉␉ ␉␉␉␉␉SCSICmdField3Byte ␉␉␉TRANSFER_LENGTH,␊ |
739 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
740 | ␊ |
741 | ␉virtual bool␉␉SEND_DIAGNOSTICS (␊ |
742 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
743 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
744 | ␉␉␉␉ ␉␉ ␉SCSICmdField3Bit ␉␉␉SELF_TEST_CODE,␊ |
745 | ␉␉␉␉ ␉␉ ␉SCSICmdField1Bit ␉␉␉PF,␊ |
746 | ␉␉␉␉ ␉␉ ␉SCSICmdField1Bit ␉␉␉SELF_TEST,␊ |
747 | ␉␉␉␉ ␉␉ ␉SCSICmdField1Bit ␉␉␉DEVOFFL,␊ |
748 | ␉␉␉␉ ␉␉ ␉SCSICmdField1Bit ␉␉␉UNITOFFL,␊ |
749 | ␉␉␉␉ ␉ ␉␉SCSICmdField2Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
750 | ␉␉␉␉ ␉ ␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
751 | ␉␊ |
752 | ␉virtual bool␉␉SET_DEVICE_IDENTIFIER (␊ |
753 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
754 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
755 | ␉␉␉␉␉␉␉SCSICmdField5Bit ␉␉␉SERVICE_ACTION,␊ |
756 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
757 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
758 | ␉␊ |
759 | ␉virtual bool␉␉TEST_UNIT_READY (␊ |
760 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
761 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
762 | ␉␊ |
763 | ␉virtual bool␉␉WRITE_BUFFER (␊ |
764 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
765 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
766 | ␉␉␉␉␉␉␉SCSICmdField4Bit ␉␉␉MODE,␊ |
767 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉BUFFER_ID,␊ |
768 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉BUFFER_OFFSET,␊ |
769 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉PARAMETER_LIST_LENGTH,␊ |
770 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
771 | ␉␊ |
772 | ␉// The SPC-3 INQUIRY command as defined in section 6.4.1 of SPC-3.␊ |
773 | ␉bool␉␉␉␉INQUIRY (␊ |
774 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
775 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
776 | ␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉EVPD,␊ |
777 | ␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉PAGE_CODE,␊ |
778 | ␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH,␊ |
779 | ␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉CONTROL );␊ |
780 | ␉␊ |
781 | private:␊ |
782 | ␉␊ |
783 | ␉// Space reserved for future expansion.␊ |
784 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 1 );␊ |
785 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 2 );␊ |
786 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 3 );␊ |
787 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 4 );␊ |
788 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 5 );␊ |
789 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 6 );␊ |
790 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 7 );␊ |
791 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 8 );␊ |
792 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 9 );␊ |
793 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 10 );␊ |
794 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 11 );␊ |
795 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 12 );␊ |
796 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 13 );␊ |
797 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 14 );␊ |
798 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 15 );␊ |
799 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 16 );␊ |
800 | ␉␊ |
801 | };␊ |
802 | ␊ |
803 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
804 | ␊ |
805 | #endif /* _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ */␊ |
806 | |