Root/
Source at commit 1164 created 13 years 12 days ago. By azimutz, Add some pauses to nvidia.c and ati.c to help user feedback collection. | |
---|---|
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_REDUCED_BLOCK_COMMANDS_DEVICE_H_␊ |
26 | #define _IOKIT_IO_SCSI_REDUCED_BLOCK_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/IOMemoryDescriptor.h>␊ |
38 | ␊ |
39 | // Generic IOKit storage related headers␊ |
40 | #include <IOKit/storage/IOStorage.h>␊ |
41 | ␊ |
42 | // SCSI Architecture Model Family includes␊ |
43 | #include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h>␊ |
44 | ␊ |
45 | ␊ |
46 | //-----------------------------------------------------------------------------␊ |
47 | //␉Constants␊ |
48 | //-----------------------------------------------------------------------------␊ |
49 | ␊ |
50 | ␊ |
51 | // RBC power states as defined in T10:1240D SCSI Reduced Block Commands (RBC)␊ |
52 | // Revision 10a, August 18, 1999, page 13.␊ |
53 | enum␊ |
54 | {␊ |
55 | ␉kRBCPowerStateSystemSleep␉= 0,␊ |
56 | ␉kRBCPowerStateSleep ␉␉= 1,␊ |
57 | ␉kRBCPowerStateStandby ␉␉= 2,␊ |
58 | ␉kRBCPowerStateIdle␉␉␉= 3,␊ |
59 | ␉kRBCPowerStateActive␉␉= 4,␊ |
60 | ␉kRBCNumPowerStates␉␉␉= 5␊ |
61 | };␊ |
62 | ␊ |
63 | enum␊ |
64 | {␊ |
65 | ␉kMediaStateUnlocked␉= 0,␊ |
66 | ␉kMediaStateLocked ␉= 1␊ |
67 | };␊ |
68 | ␊ |
69 | #define kCapacityDataBufferSize␉␉␉␉8␊ |
70 | ␊ |
71 | // Forward declaration for the SCSIReducedBlockCommands that is used internally by the␊ |
72 | // IOSCSIReducedBlockCommandsDevice class.␊ |
73 | class SCSIReducedBlockCommands;␊ |
74 | ␊ |
75 | //-----------------------------------------------------------------------------␊ |
76 | //␉Class Declaration␊ |
77 | //-----------------------------------------------------------------------------␊ |
78 | ␊ |
79 | class IOSCSIReducedBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice␊ |
80 | {␊ |
81 | ␉␊ |
82 | ␉OSDeclareAbstractStructors ( IOSCSIReducedBlockCommandsDevice );␊ |
83 | ␉␊ |
84 | private:␊ |
85 | ␉␊ |
86 | #ifndef __LP64__␊ |
87 | ␉␊ |
88 | SCSIReducedBlockCommands *␉␉fSCSIReducedBlockCommandObject;␊ |
89 | SCSIReducedBlockCommands *␉␉GetSCSIReducedBlockCommandObject ( void );␊ |
90 | ␉␊ |
91 | #endif␉/* !__LP64__ */␊ |
92 | ␉␊ |
93 | ␉static void␉␉␉AsyncReadWriteComplete ( SCSITaskIdentifier completedTask );␊ |
94 | ␉␊ |
95 | protected:␊ |
96 | ␊ |
97 | // Reserve space for future expansion.␊ |
98 | struct IOSCSIReducedBlockCommandsDeviceExpansionData␊ |
99 | ␉{␊ |
100 | ␉␉IONotifier *␉fPowerDownNotifier;␊ |
101 | bool␉␉␉fMediumRemovalPrevented;␊ |
102 | bool␉␉␉fKnownManualEject;␊ |
103 | UInt32␉␉␉fPollingMode;␊ |
104 | ␉␉bool␉␉␉fProtocolSpecificPowerControl;␊ |
105 | ␉};␊ |
106 | IOSCSIReducedBlockCommandsDeviceExpansionData * fIOSCSIReducedBlockCommandsDeviceReserved;␊ |
107 | ␉␊ |
108 | ␉#define fPowerDownNotifier␉␉␉␉fIOSCSIReducedBlockCommandsDeviceReserved->fPowerDownNotifier␊ |
109 | ␉#define fMediumRemovalPrevented␉␉␉fIOSCSIReducedBlockCommandsDeviceReserved->fMediumRemovalPrevented␊ |
110 | ␉#define fKnownManualEject␉␉␉␉fIOSCSIReducedBlockCommandsDeviceReserved->fKnownManualEject␊ |
111 | ␉#define fPollingMode␉␉␉␉␉fIOSCSIReducedBlockCommandsDeviceReserved->fPollingMode␊ |
112 | ␉#define fProtocolSpecificPowerControl␉fIOSCSIReducedBlockCommandsDeviceReserved->fProtocolSpecificPowerControl␊ |
113 | ␉␊ |
114 | ␉bool␉␉␉␉fMediaChanged;␊ |
115 | ␉bool␉␉␉␉fMediaPresent;␊ |
116 | ␉␊ |
117 | ␉// The byte count of each physical block on the media.␊ |
118 | ␉UInt32␉␉␉␉fMediaBlockSize;␊ |
119 | ␉␊ |
120 | ␉// The total number of blocks of mediaBlockSize on the media.␊ |
121 | ␉UInt32␉␉␉␉fMediaBlockCount;␊ |
122 | ␉␊ |
123 | ␉// Flags used to indicate device feature␊ |
124 | ␉bool␉␉␉␉fMediaIsRemovable;␊ |
125 | ␉bool␉␉␉␉fMediaIsWriteProtected;␊ |
126 | ␉␊ |
127 | ␉thread_call_t␉␉fPollingThread;␊ |
128 | ␉␊ |
129 | ␉enum␊ |
130 | ␉{␊ |
131 | ␉␉kPollingMode_Suspended␉␉␉= 0,␊ |
132 | ␉␉kPollingMode_NewMedia ␉␉␉= 1,␊ |
133 | ␉␉kPollingMode_MediaRemoval␉␉= 2␊ |
134 | ␉};␊ |
135 | ␉␊ |
136 | ␉virtual void ␉␉CreateStorageServiceNub ( void );␊ |
137 | ␉virtual bool␉␉DetermineDeviceCharacteristics ( void );␉␊ |
138 | ␉virtual void␉␉PollForMedia ( void );␊ |
139 | ␉virtual void␉␉EnablePolling ( void );␊ |
140 | ␉virtual void␉␉DisablePolling ( void );␊ |
141 | ␉virtual void␉␉CheckWriteProtection ( void );␊ |
142 | ␉virtual void␉␉SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount );␊ |
143 | ␉virtual void␉␉ResetMediaCharacteristics ( void );␊ |
144 | ␉virtual bool␉␉ClearNotReadyStatus ( void );␊ |
145 | ␉␊ |
146 | ␉virtual IOReturn␉IssueRead ( IOMemoryDescriptor *␉buffer,␊ |
147 | ␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉startBlock,␊ |
148 | ␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉blockCount );␊ |
149 | ␉␊ |
150 | ␉virtual IOReturn␉IssueWrite ( IOMemoryDescriptor*␉buffer,␊ |
151 | ␉␉␉␉␉␉␉␉␉ UInt64␉␉␉␉␉startBlock,␊ |
152 | ␉␉␉␉␉␉␉␉␉ UInt64␉␉␉␉␉blockCount );␊ |
153 | ␉␊ |
154 | ␉virtual IOReturn␉IssueRead ( IOMemoryDescriptor *␉buffer,␊ |
155 | ␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉startBlock,␊ |
156 | ␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉blockCount,␊ |
157 | ␉␉␉␉␉␉␉␉␉void *␉␉␉␉␉clientData );␊ |
158 | ␉␊ |
159 | ␉virtual IOReturn␉IssueWrite ( IOMemoryDescriptor *␉buffer,␊ |
160 | ␉␉␉␉␉␉␉␉␉ UInt64␉␉␉␉␉startBlock,␊ |
161 | ␉␉␉␉␉␉␉␉␉ UInt64␉␉␉␉␉blockCount,␊ |
162 | ␉␉␉␉␉␉␉␉␉ void *␉␉␉␉␉clientData );␊ |
163 | ␊ |
164 | #ifndef __LP64__␊ |
165 | ␉␊ |
166 | ␉// This method will retreive the SCSI Primary Command Set object for␊ |
167 | ␉// the class. For subclasses, this will be overridden using a␊ |
168 | ␉// dynamic cast on the subclasses base command set object.␊ |
169 | ␉virtual SCSIPrimaryCommands *␉GetSCSIPrimaryCommandObject ( void );␊ |
170 | ␊ |
171 | #endif␉/* !__LP64__ */␊ |
172 | ␉␊ |
173 | ␉// ----- Power Management Support ------␊ |
174 | ␉␉␊ |
175 | ␉// We override this method to set our power states and register ourselves␊ |
176 | ␉// as a power policy maker.␊ |
177 | ␉virtual void ␉␉InitializePowerManagement ( IOService * provider );␊ |
178 | ␉␊ |
179 | ␉// We override this method so that when we register for power management,␊ |
180 | ␉// we go to our active power state (which the drive is definitely in␊ |
181 | ␉// at startup time).␊ |
182 | ␉virtual UInt32␉␉GetInitialPowerState ( void );␊ |
183 | ␉␊ |
184 | ␉// We override this method in order to provide the number of transitions␊ |
185 | ␉// from Fully active to Sleep state so that the idle timer can be adjusted␊ |
186 | ␉// to the appropriate time period based on the disk spindown time set in␊ |
187 | ␉// the Energy Saver prefs panel.␊ |
188 | ␉virtual UInt32␉␉GetNumberOfPowerStateTransitions ( void );␊ |
189 | ␉␊ |
190 | ␉// The TicklePowerManager method is called to tell the power manager that the␊ |
191 | ␉// device needs to be in a certain power state to handle requests.␊ |
192 | ␉virtual void␉␉TicklePowerManager ( void );␊ |
193 | ␉␊ |
194 | ␉// The HandlePowerChange method is the state machine for power management.␊ |
195 | ␉// It is guaranteed to be on its own thread of execution (different from␊ |
196 | ␉// the power manager thread AND the workloop thread. This routine can␊ |
197 | ␉// send sync or async calls to the drive without worrying about threading␊ |
198 | ␉// issues.␊ |
199 | ␉virtual void␉␉HandlePowerChange ( void );␊ |
200 | ␉␊ |
201 | ␉// The HandleCheckPowerState (void) method is on the serialized side of the command␊ |
202 | ␉// gate and can change member variables safely without multi-threading issues.␊ |
203 | ␉// It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState )␊ |
204 | ␉// with the max power state the class registered with.␊ |
205 | ␉virtual void␉␉HandleCheckPowerState ( void );␊ |
206 | ␉␊ |
207 | ␉// The CheckMediaPresence method is called to see if the media which we␊ |
208 | ␉// anticipated being there is still there.␊ |
209 | ␉virtual bool␉␉CheckMediaPresence ( void );␊ |
210 | ␉␊ |
211 | ␉virtual bool␉␉InitializeDeviceSupport ( void );␊ |
212 | ␉virtual void␉␉StartDeviceSupport ( void );␊ |
213 | ␉virtual void␉␉SuspendDeviceSupport ( void );␊ |
214 | ␉virtual void␉␉ResumeDeviceSupport ( void );␊ |
215 | ␉virtual void␉␉StopDeviceSupport ( void );␊ |
216 | ␉virtual void␉␉TerminateDeviceSupport ( void );␊ |
217 | ␉␊ |
218 | ␉virtual void ␉␉free ( void );␊ |
219 | ␉␊ |
220 | #ifndef __LP64__␊ |
221 | ␉␊ |
222 | ␉virtual bool␉␉CreateCommandSetObjects ( void );␊ |
223 | ␉virtual void␉␉FreeCommandSetObjects ( void );␊ |
224 | ␊ |
225 | #endif␉/* !__LP64__ */␊ |
226 | ␉␊ |
227 | public:␊ |
228 | ␉␊ |
229 | ␉virtual IOReturn␉SyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
230 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉startBlock,␊ |
231 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉blockCount );␊ |
232 | ␉␊ |
233 | ␉virtual IOReturn␉AsyncReadWrite (␉IOMemoryDescriptor *␉buffer,␊ |
234 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉block,␊ |
235 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉nblks,␊ |
236 | ␉␉␉␉␉␉␉␉␉␉␉void *␉␉␉␉␉clientData );␊ |
237 | ␉␊ |
238 | ␉␊ |
239 | ␉virtual IOReturn␉EjectTheMedia ( void );␉␊ |
240 | ␉virtual IOReturn␉FormatMedia ( UInt64 byteCapacity );␊ |
241 | ␉virtual UInt32␉␉GetFormatCapacities ( ␉UInt64 * capacities,␊ |
242 | ␉␉␉␉␉␉␉␉␉␉␉␉UInt32 capacitiesMaxCount ) const;␊ |
243 | ␉virtual IOReturn␉LockUnlockMedia ( bool doLock );␊ |
244 | ␉virtual IOReturn␉SynchronizeCache ( void );␊ |
245 | ␉virtual IOReturn␉ReportBlockSize ( UInt64 * blockSize );␊ |
246 | ␉virtual IOReturn␉ReportEjectability ( bool * isEjectable );␊ |
247 | ␉virtual IOReturn␉ReportLockability ( bool * isLockable );␊ |
248 | ␉virtual IOReturn␉ReportPollRequirements ( bool * pollIsRequired,␊ |
249 | ␉␉␉␉␉␉␉␉␉␉␉␉ bool * pollIsExpensive );␊ |
250 | ␉virtual IOReturn␉ReportMaxReadTransfer ( UInt64 ␉blockSize,␊ |
251 | ␉␉␉␉␉␉␉␉␉␉␉␉ UInt64 * ␉max );␊ |
252 | ␉virtual IOReturn␉ReportMaxValidBlock ( UInt64 * maxBlock );␊ |
253 | ␉virtual IOReturn␉ReportMaxWriteTransfer ( UInt64␉blockSize,␊ |
254 | ␉␉␉␉␉␉␉␉␉␉␉␉UInt64 * max );␊ |
255 | ␉virtual IOReturn␉ReportMediaState ( ␉bool * mediaPresent,␊ |
256 | ␉␉␉␉␉␉␉␉␉␉␉bool * changed );␊ |
257 | ␉virtual IOReturn␉ReportRemovability ( bool * isRemovable );␊ |
258 | ␉virtual IOReturn␉ReportWriteProtection ( bool * isWriteProtected );␊ |
259 | ␉␊ |
260 | ␉static ␉void␉␉sPollForMedia ( void * pdtDriver, void * refCon );␊ |
261 | ␉␊ |
262 | ␉␊ |
263 | protected:␊ |
264 | ␉␊ |
265 | ␉␊ |
266 | ␉// The FORMAT_UNIT command as defined in section 5.1␊ |
267 | ␉virtual bool FORMAT_UNIT (␊ |
268 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
269 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉IMMED,␊ |
270 | ␉ ␉␉␉␉␉␉SCSICmdField1Bit␉␉␉PROGRESS,␊ |
271 | ␉ ␉␉␉␉␉␉SCSICmdField1Bit␉␉␉PERCENT_TIME,␊ |
272 | ␉ ␉␉␉␉␉␉SCSICmdField1Bit␉␉␉INCREMENT );␊ |
273 | ␉␊ |
274 | ␉// The INQUIRY command as defined in SPC-2 w/o CONTROL byte␊ |
275 | ␉virtual bool INQUIRY (␊ |
276 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
277 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
278 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉CMDDT,␊ |
279 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉EVPD,␊ |
280 | ␉␉␉␉␉␉␉SCSICmdField1Byte␉␉␉PAGE_OR_OPERATION_CODE,␊ |
281 | ␉␉␉␉␉␉␉SCSICmdField1Byte␉␉␉ALLOCATION_LENGTH );␊ |
282 | ␉␊ |
283 | ␉// The MODE_SELECT(6) command as defined in SPC-2 w/o CONTROL byte␊ |
284 | ␉virtual bool MODE_SELECT_6 (␊ |
285 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
286 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
287 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉PF,␊ |
288 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉SP,␊ |
289 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉PARAMETER_LIST_LENGTH );␊ |
290 | ␉␊ |
291 | ␉// The MODE_SENSE(6) command as defined in SPC-2 w/o CONTROL byte␊ |
292 | ␉virtual bool MODE_SENSE_6 (␊ |
293 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
294 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
295 | ␉␉␉␉␉␉␉SCSICmdField1Bit ␉␉␉DBD,␊ |
296 | ␉␉ ␉␉␉␉␉SCSICmdField2Bit ␉␉␉PC,␊ |
297 | ␉␉ ␉␉␉␉␉SCSICmdField6Bit ␉␉␉PAGE_CODE,␊ |
298 | ␉␉ ␉␉␉␉␉SCSICmdField1Byte ␉␉␉ALLOCATION_LENGTH );␊ |
299 | ␉␊ |
300 | ␉// The PERSISTENT_RESERVE_IN command as defined in SPC-2 w/o CONTROL byte␊ |
301 | ␉virtual bool PERSISTENT_RESERVE_IN (␊ |
302 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
303 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
304 | ␉␉ ␉␉␉␉␉SCSICmdField5Bit ␉␉␉SERVICE_ACTION,␊ |
305 | ␉␉ ␉␉␉␉␉SCSICmdField2Byte ␉␉␉ALLOCATION_LENGTH );␊ |
306 | ␉␊ |
307 | ␉// The PERSISTENT_RESERVE_OUT command as defined in SPC-2 w/o CONTROL byte␊ |
308 | ␉virtual bool PERSISTENT_RESERVE_OUT (␊ |
309 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
310 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
311 | ␉␉ ␉␉␉␉␉SCSICmdField5Bit␉␉␉SERVICE_ACTION,␊ |
312 | ␉␉ ␉␉␉␉␉SCSICmdField4Bit␉␉␉SCOPE,␊ |
313 | ␉␉ ␉␉␉␉␉SCSICmdField4Bit␉␉␉TYPE );␊ |
314 | ␉␊ |
315 | ␉// The PREVENT_ALLOW_MEDIUM_REMOVAL command as defined in SPC-2 w/o CONTROL byte␊ |
316 | ␉virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( ␊ |
317 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
318 | ␉ ␉␉␉␉␉␉SCSICmdField2Bit␉␉␉PREVENT );␊ |
319 | ␉␊ |
320 | ␉// The READ_10 command as defined in section 5.2␊ |
321 | ␉virtual bool READ_10 (␊ |
322 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
323 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
324 | ␉␉␉␉␉␉␉UInt32␉␉␉␉␉␉blockSize,␊ |
325 | ␉␉␉␉␉␉␉SCSICmdField4Byte␉␉␉LOGICAL_BLOCK_ADDRESS,␊ |
326 | ␉␉␉␉␉␉␉SCSICmdField2Byte␉␉␉TRANSFER_LENGTH );␊ |
327 | ␉␊ |
328 | ␉// The READ_CAPACITY command as defined in section 5.3␊ |
329 | ␉virtual bool READ_CAPACITY (␊ |
330 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
331 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer );␊ |
332 | ␉␊ |
333 | ␉// The RELEASE(6) command as defined in SPC-2 w/o CONTROL byte␊ |
334 | ␉virtual bool RELEASE_6 (␉␉␉␉␉␉␉␉␊ |
335 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request );␊ |
336 | ␉␊ |
337 | ␉// The REQUEST_SENSE command as defined in SPC-2 w/o CONTROL byte␊ |
338 | ␉virtual bool REQUEST_SENSE (␊ |
339 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
340 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
341 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉ALLOCATION_LENGTH );␊ |
342 | ␉␊ |
343 | ␉// The RESERVE(6) command as defined in SPC-2 w/o CONTROL byte␊ |
344 | ␉virtual bool RESERVE_6 (␉␊ |
345 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request );␊ |
346 | ␉␊ |
347 | ␉// The START_STOP_UNIT command as defined in section 5.4␊ |
348 | ␉virtual bool START_STOP_UNIT (␊ |
349 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
350 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉IMMED,␊ |
351 | ␉␉␉␉␉␉␉SCSICmdField4Bit␉␉␉POWER_CONDITIONS,␊ |
352 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉LEOJ,␊ |
353 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉START );␊ |
354 | ␉␊ |
355 | ␉// The SYNCRONIZE_CACHE command as defined in section 5.5␊ |
356 | ␉virtual bool SYNCHRONIZE_CACHE (␊ |
357 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request );␊ |
358 | ␉␊ |
359 | ␉// The TEST_UNIT_READY command as defined in SPC-2 w/o CONTROL byte␊ |
360 | ␉virtual bool TEST_UNIT_READY (␊ |
361 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request );␊ |
362 | ␉␊ |
363 | ␉// The VERIFY command as defined in section 5.7␊ |
364 | ␉virtual bool VERIFY (␊ |
365 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
366 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉LOGICAL_BLOCK_ADDRESS,␊ |
367 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉VERIFICATION_LENGTH );␊ |
368 | ␉␊ |
369 | ␉// The WRITE_10 command␉as defined in section 5.6␊ |
370 | ␉virtual bool WRITE_10 (␊ |
371 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
372 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
373 | ␉␉␉␉␉␉␉UInt32␉␉␉␉␉␉blockSize,␊ |
374 | ␉␉␉␉␉␉␉SCSICmdField1Bit␉␉␉FUA,␊ |
375 | ␉␉␉␉␉␉␉SCSICmdField4Byte ␉␉␉LOGICAL_BLOCK_ADDRESS,␊ |
376 | ␉␉␉␉␉␉␉SCSICmdField2Byte ␉␉␉TRANSFER_LENGTH );␊ |
377 | ␉␊ |
378 | ␉// The WRITE_BUFFER command as defined in SPC-2 w/o CONTROL byte␊ |
379 | ␉virtual bool WRITE_BUFFER ( ␊ |
380 | ␉␉␉␉␉␉␉SCSITaskIdentifier␉␉␉request,␊ |
381 | ␉␉␉␉␉␉␉IOMemoryDescriptor *␉␉dataBuffer,␊ |
382 | ␉␉␉␉␉␉␉SCSICmdField4Bit ␉␉␉MODE,␊ |
383 | ␉␉␉␉␉␉␉SCSICmdField1Byte ␉␉␉BUFFER_ID,␊ |
384 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉BUFFER_OFFSET,␊ |
385 | ␉␉␉␉␉␉␉SCSICmdField3Byte ␉␉␉PARAMETER_LIST_LENGTH );␊ |
386 | ␉␊ |
387 | ␉␊ |
388 | ␊ |
389 | ␉/* Added with 10.2 */␊ |
390 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 1 );␊ |
391 | ␉␊ |
392 | public:␊ |
393 | ␉␊ |
394 | ␉virtual IOReturn␉PowerDownHandler (␉void * ␉␉␉refCon,␊ |
395 | ␉␉␉␉␉␉␉␉␉␉␉UInt32 ␉␉␉messageType,␊ |
396 | ␉␉␉␉␉␉␉␉␉␉␉IOService * ␉provider,␊ |
397 | ␉␉␉␉␉␉␉␉␉␉␉void * ␉␉␉messageArgument,␊ |
398 | ␉␉␉␉␉␉␉␉␉␉␉vm_size_t ␉␉argSize );␊ |
399 | ␉␊ |
400 | ␉␊ |
401 | ␉/* Added with 10.2 */␉␊ |
402 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 2 );␊ |
403 | ␉␊ |
404 | protected:␊ |
405 | ␊ |
406 | ␉virtual␉void␉␉SetMediaIcon ( void );␊ |
407 | ␉␊ |
408 | ␊ |
409 | ␉/* Added with 10.3.3 */␉␉␊ |
410 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 3 );␊ |
411 | ␉␊ |
412 | protected:␊ |
413 | ␊ |
414 | ␉virtual␉void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask );␊ |
415 | ␉␊ |
416 | ␉␊ |
417 | private:␊ |
418 | ␉␊ |
419 | ␉// Space reserved for future expansion.␊ |
420 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 4 );␊ |
421 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 5 );␊ |
422 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 6 );␊ |
423 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 7 );␊ |
424 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 8 );␊ |
425 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 9 );␊ |
426 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 10 );␊ |
427 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 11 );␊ |
428 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 12 );␊ |
429 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 13 );␊ |
430 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 14 );␊ |
431 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 15 );␊ |
432 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 16 );␊ |
433 | ␉␊ |
434 | };␊ |
435 | ␊ |
436 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
437 | ␊ |
438 | #endif /* _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ */␊ |
439 |