Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h

Source at commit 1129 created 12 years 11 months ago.
By meklort, Change options.o so that it reloads the system config as well. Also change it so that it uses that config for variables (NOTE: if the calue exists in chameleonConfig, it's used instead.
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
54enum
55{
56kSCSIServicesNotification_Suspend= 0x69000080,
57kSCSIServicesNotification_Resume= 0x69000090
58};
59
60
61// Timeout values
62enum
63{
64kOneSecondTimeoutInMS = 1000,
65kTenSecondTimeoutInMS = 10 * kOneSecondTimeoutInMS,
66kThirtySecondTimeoutInMS= 30 * kOneSecondTimeoutInMS,
67 kFortyFiveSecondTimeoutInMS= 45 * kOneSecondTimeoutInMS
68};
69
70// Mode page values for page control field
71enum
72{
73kModePageControlCurrentValues= 0x00,
74kModePageControlChangeableValues= 0x01,
75kModePageControlDefaultValues= 0x02,
76kModePageControlSavedValues= 0x03
77};
78
79// The command should be tried 5 times. The original attempt
80// plus 4 retries.
81#define kDefaultRetryCount4
82
83// Forward declarations for internal use only classes
84class SCSIPrimaryCommands;
85
86
87//-----------------------------------------------------------------------------
88//Class Declaration
89//-----------------------------------------------------------------------------
90
91class IOSCSIPrimaryCommandsDevice : public IOSCSIProtocolInterface
92{
93
94OSDeclareAbstractStructors ( IOSCSIPrimaryCommandsDevice )
95
96private:
97
98#ifndef __LP64__
99SCSIPrimaryCommands *fSCSIPrimaryCommandObject;
100#endif
101
102IOSCSIProtocolInterface *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.
109boolfProtocolAccessEnabled;
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.
115boolfDeviceAccessEnabled;
116boolfDeviceAccessSuspended;
117
118static boolServerKeyswitchCallback ( void *target,
119 void *refCon,
120 IOService *newService );
121
122static voidTaskCallback ( SCSITaskIdentifier completedTask );
123voidTaskCompletion ( SCSITaskIdentifier completedTask );
124
125static IOReturnsWaitForTask ( void * object, SCSITaskIdentifier request );
126IOReturnGatedWaitForTask ( SCSITaskIdentifier request );
127
128protected:
129
130// Reserve space for future expansion.
131struct IOSCSIPrimaryCommandsDeviceExpansionData
132{
133IONotifier *fKeySwitchNotifier;
134UInt8fANSIVersion;
135UInt32fReadTimeoutDuration;
136UInt32fWriteTimeoutDuration;
137boolfCMDQUE;
138SCSITaggedTaskIdentifierfTaskID;
139IOSimpleLock *fTaskIDLock;
140UInt32fRetryCount;
141};
142IOSCSIPrimaryCommandsDeviceExpansionData * fIOSCSIPrimaryCommandsDeviceReserved;
143
144#definefReadTimeoutDurationfIOSCSIPrimaryCommandsDeviceReserved->fReadTimeoutDuration
145#definefWriteTimeoutDurationfIOSCSIPrimaryCommandsDeviceReserved->fWriteTimeoutDuration
146#definefRetryCountfIOSCSIPrimaryCommandsDeviceReserved->fRetryCount
147
148
149UInt8fDefaultInquiryCount;
150OSDictionary *fDeviceCharacteristicsDictionary;
151UInt32fNumCommandsOutstanding;
152
153virtual void free ( void );
154voidSetANSIVersion ( UInt8 );
155voidSetCMDQUE ( bool value );
156IOReturnGetModeSense (
157IOMemoryDescriptor *dataBuffer,
158SCSICmdField6Bit PAGE_CODE,
159SCSICmdField2Byte ALLOCATION_LENGTH,
160bool *use10ByteModeSense );
161boolRetrieveINQUIRYData (
162UInt8EVPD,
163UInt8inquiryPage,
164UInt8 *inquiryBuffer,
165UInt16 *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)
169boolfDeviceSupportsPowerConditions;
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.
180virtual 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.
185virtual boolCreateCommandSetObjects ( 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.
190virtual voidFreeCommandSetObjects ( 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.
197virtual voidCheckPowerConditionsModePage ( void );
198
199// This will return back the Protocol driver that is used to
200// send service requests to the device.
201virtual IOSCSIProtocolInterface * GetProtocolDriver ( void );
202
203// This will get a new SCSITask for the caller
204virtual SCSITaskIdentifierGetSCSITask ( void );
205
206// This will release a SCSITask (eventually return it to a pool)
207virtual voidReleaseSCSITask ( SCSITaskIdentifier request );
208
209// This will return a unique value for the tagged task identifier
210SCSITaggedTaskIdentifierGetUniqueTagID ( void );
211
212// Call for executing the command synchronously
213SCSIServiceResponse SendCommand (
214SCSITaskIdentifier request,
215UInt32 timeoutDuration );
216
217// Call for executing the command asycnchronously
218void SendCommand (
219SCSITaskIdentifier request,
220UInt32 timeoutDuration,
221SCSITaskCompletion taskCompletion );
222
223
224virtual bool InitializeDeviceSupport ( void ) = 0;
225virtual void StartDeviceSupport ( void ) = 0;
226virtual void SuspendDeviceSupport ( void ) = 0;
227virtual void ResumeDeviceSupport ( void ) = 0;
228virtual void StopDeviceSupport ( void ) = 0;
229virtual void TerminateDeviceSupport ( void ) = 0;
230virtual UInt32GetNumberOfPowerStateTransitions ( void ) = 0;
231
232virtual IOReturnVerifyDeviceState ( void );
233// Called to clear any power-on/reset status in the drive
234virtual boolClearPowerOnReset ( void );
235virtual boolClearNotReadyStatus ( void ) = 0;
236
237boolIsProtocolAccessEnabled ( void );
238boolIsDeviceAccessEnabled ( void );
239boolIsDeviceAccessSuspended ( void );
240
241// Accessors for saving and retrieving data from an SCSITask object.
242bool ResetForNewTask(
243SCSITaskIdentifier request );
244boolSetTaskAttribute (
245SCSITaskIdentifier request,
246SCSITaskAttribute newAttribute );
247SCSITaskAttributeGetTaskAttribute (
248SCSITaskIdentifier request );
249boolSetTaggedTaskIdentifier (
250SCSITaskIdentifier request,
251SCSITaggedTaskIdentifiertaggedTaskIdentifier );
252SCSITaggedTaskIdentifierGetTaggedTaskIdentifier (
253SCSITaskIdentifier request );
254boolSetTaskState (
255SCSITaskIdentifier request,
256SCSITaskState newTaskState );
257SCSITaskStateGetTaskState (
258SCSITaskIdentifier request );
259boolSetTaskStatus (
260SCSITaskIdentifier request,
261SCSITaskStatus newStatus );
262SCSITaskStatusGetTaskStatus (
263SCSITaskIdentifier request );
264bool SetCommandDescriptorBlock (
265SCSITaskIdentifier request,
266UInt8cdbByte0,
267UInt8cdbByte1,
268UInt8cdbByte2,
269UInt8cdbByte3,
270UInt8cdbByte4,
271UInt8cdbByte5 );
272
273// Populate the 10 Byte Command Descriptor Block
274bool SetCommandDescriptorBlock (
275SCSITaskIdentifier request,
276UInt8cdbByte0,
277UInt8cdbByte1,
278UInt8cdbByte2,
279UInt8cdbByte3,
280UInt8cdbByte4,
281UInt8cdbByte5,
282UInt8cdbByte6,
283UInt8cdbByte7,
284UInt8cdbByte8,
285UInt8cdbByte9 );
286
287// Populate the 12 Byte Command Descriptor Block
288bool SetCommandDescriptorBlock (
289SCSITaskIdentifier request,
290UInt8cdbByte0,
291UInt8cdbByte1,
292UInt8cdbByte2,
293UInt8cdbByte3,
294UInt8cdbByte4,
295UInt8cdbByte5,
296UInt8cdbByte6,
297UInt8cdbByte7,
298UInt8cdbByte8,
299UInt8cdbByte9,
300UInt8cdbByte10,
301UInt8cdbByte11 );
302
303// Populate the 16 Byte Command Descriptor Block
304bool SetCommandDescriptorBlock (
305SCSITaskIdentifier request,
306UInt8cdbByte0,
307UInt8cdbByte1,
308UInt8cdbByte2,
309UInt8cdbByte3,
310UInt8cdbByte4,
311UInt8cdbByte5,
312UInt8cdbByte6,
313UInt8cdbByte7,
314UInt8cdbByte8,
315UInt8cdbByte9,
316UInt8cdbByte10,
317UInt8cdbByte11,
318UInt8cdbByte12,
319UInt8cdbByte13,
320UInt8cdbByte14,
321UInt8cdbByte15 );
322
323boolSetDataTransferDirection (
324SCSITaskIdentifier request,
325UInt8 newDirection );
326UInt8GetDataTransferDirection (
327SCSITaskIdentifier request );
328boolSetRequestedDataTransferCount (
329SCSITaskIdentifier request,
330UInt64 newRequestedCount );
331UInt64GetRequestedDataTransferCount (
332SCSITaskIdentifier request );
333boolSetRealizedDataTransferCount (
334SCSITaskIdentifier request,
335UInt64 newRealizedDataCount );
336UInt64GetRealizedDataTransferCount (
337SCSITaskIdentifier request );
338boolSetDataBuffer (
339SCSITaskIdentifier request,
340IOMemoryDescriptor * newBuffer );
341IOMemoryDescriptor *GetDataBuffer (
342SCSITaskIdentifier request );
343boolSetTimeoutDuration (
344SCSITaskIdentifier request,
345UInt32 newTimeout );
346UInt32GetTimeoutDuration (
347SCSITaskIdentifier request );
348boolSetTaskCompletionCallback (
349SCSITaskIdentifier request,
350SCSITaskCompletion newCallback );
351voidTaskCompletedNotification (
352SCSITaskIdentifier request );
353
354boolSetServiceResponse (
355SCSITaskIdentifier request,
356SCSIServiceResponse serviceResponse );
357SCSIServiceResponse GetServiceResponse (
358SCSITaskIdentifier request );
359boolSetAutosenseCommand (
360SCSITaskIdentifier request,
361UInt8cdbByte0,
362UInt8cdbByte1,
363UInt8cdbByte2,
364UInt8cdbByte3,
365UInt8cdbByte4,
366UInt8cdbByte5 );
367boolGetAutoSenseData (
368SCSITaskIdentifier request,
369SCSI_Sense_Data * senseData ); // DEPRECATED, use below function instead
370boolGetAutoSenseData (
371SCSITaskIdentifier request,
372SCSI_Sense_Data * senseData,
373UInt8senseDataSize );
374UInt8GetAutoSenseDataSize (
375SCSITaskIdentifier request );
376
377boolSetApplicationLayerReference (
378SCSITaskIdentifier request,
379void * newReferenceValue );
380void *GetApplicationLayerReference (
381SCSITaskIdentifier request );
382
383void IncrementOutstandingCommandsCount ( void );
384static voidsIncrementOutstandingCommandsCount (
385IOSCSIPrimaryCommandsDevice * self );
386virtual voidHandleIncrementOutstandingCommandsCount ( 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.
391static OSObject *sGetOwnerForTask ( SCSITaskIdentifier request );
392
393public:
394
395boolinit ( OSDictionary * propTable );
396virtual boolstart ( IOService * provider );
397virtual voidstop ( IOService * provider );
398virtual 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.
404virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes );
405
406// Methods for getting device information strings
407virtual char *GetVendorString ( void );
408virtual char *GetProductString ( void );
409virtual char *GetRevisionString ( void );
410OSDictionary *GetProtocolCharacteristicsDictionary ( void );
411OSDictionary *GetDeviceCharacteristicsDictionary ( void );
412UInt8GetANSIVersion ( void );
413boolGetCMDQUE ( void );
414 OSString * MapINQUIRYDataToIconFile ( void );
415UInt32GetRetryCount ( 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
420virtual voidExecuteCommand ( SCSITaskIdentifier request );
421
422// The Task Management function to allow the SCSI Application Layer client to request
423// that a specific task be aborted.
424SCSIServiceResponseAbortTask ( 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.
428SCSIServiceResponseAbortTaskSet ( UInt8 theLogicalUnit );
429
430SCSIServiceResponseClearACA ( UInt8 theLogicalUnit );
431
432SCSIServiceResponseClearTaskSet ( UInt8 theLogicalUnit );
433
434SCSIServiceResponseLogicalUnitReset ( UInt8 theLogicalUnit );
435
436SCSIServiceResponseTargetReset ( void );
437
438// The AbortCommand method will abort the indicated SCSI Task,
439// if it is possible and the task has not already completed.
440virtual SCSIServiceResponseAbortCommand ( 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.
445virtual boolIsProtocolServiceSupported (
446SCSIProtocolFeature feature,
447void *serviceValue );
448
449// The HandleProtocolServiceFeature will return true if the specified feature could
450// be handled properly by the protocol layer.
451virtual boolHandleProtocolServiceFeature (
452SCSIProtocolFeaturefeature,
453void *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 (
462SCSICmdField1Byte param,
463SCSICmdField1Byte mask );
464
465// Validate Parameter used for 9 bit to 2 byte paramaters
466bool IsParameterValid (
467SCSICmdField2Byte param,
468SCSICmdField2Byte mask );
469
470// Validate Parameter used for 17 bit to 4 byte paramaters
471bool IsParameterValid (
472SCSICmdField4Byte param,
473SCSICmdField4Byte mask );
474
475// Validate Parameter used for 33 bit to 8 byte paramaters
476bool IsParameterValid (
477SCSICmdField8Byte param,
478SCSICmdField8Byte mask );
479
480
481bool IsMemoryDescriptorValid (
482IOMemoryDescriptor * dataBuffer );
483
484bool IsMemoryDescriptorValid (
485IOMemoryDescriptor * dataBuffer,
486UInt64requiredSize );
487
488#ifndef __LP64__
489
490// SCSI Primary command implementations
491virtual boolCHANGE_DEFINITION (
492SCSITaskIdentifierrequest,
493IOMemoryDescriptor *dataBuffer,
494SCSICmdField1Bit SAVE,
495SCSICmdField7Bit DEFINITION_PARAMETER,
496SCSICmdField1Byte PARAMETER_DATA_LENGTH,
497 SCSICmdField1Byte CONTROL );
498
499virtual boolCOMPARE (
500SCSITaskIdentifierrequest,
501IOMemoryDescriptor *dataBuffer,
502 SCSICmdField1Bit PAD,
503SCSICmdField3Byte PARAMETER_LIST_LENGTH,
504SCSICmdField1Byte CONTROL );
505
506virtual boolCOPY (
507SCSITaskIdentifierrequest,
508 IOMemoryDescriptor *dataBuffer,
509SCSICmdField1Bit PAD,
510SCSICmdField3Byte PARAMETER_LIST_LENGTH,
511SCSICmdField1Byte CONTROL );
512
513virtual boolCOPY_AND_VERIFY (
514SCSITaskIdentifierrequest,
515IOMemoryDescriptor *dataBuffer,
516SCSICmdField1Bit BYTCHK,
517SCSICmdField1Bit PAD,
518SCSICmdField3Byte PARAMETER_LIST_LENGTH,
519SCSICmdField1Byte CONTROL );
520
521virtual boolEXTENDED_COPY (
522SCSITaskIdentifierrequest,
523IOMemoryDescriptor *dataBuffer,
524SCSICmdField4Byte PARAMETER_LIST_LENGTH,
525SCSICmdField1Byte CONTROL );
526
527#endif/* !__LP64__ */
528
529virtual boolINQUIRY (
530SCSITaskIdentifierrequest,
531IOMemoryDescriptor *dataBuffer,
532SCSICmdField1Bit CMDDT,
533SCSICmdField1Bit EVPD,
534SCSICmdField1Byte PAGE_OR_OPERATION_CODE,
535SCSICmdField1Byte ALLOCATION_LENGTH,
536SCSICmdField1Byte CONTROL );
537
538virtual boolLOG_SELECT (
539SCSITaskIdentifierrequest,
540IOMemoryDescriptor *dataBuffer,
541SCSICmdField1Bit PCR,
542SCSICmdField1Bit SP,
543SCSICmdField2Bit PC,
544SCSICmdField2Byte PARAMETER_LIST_LENGTH,
545SCSICmdField1Byte CONTROL );
546
547virtual boolLOG_SENSE (
548SCSITaskIdentifierrequest,
549IOMemoryDescriptor *dataBuffer,
550SCSICmdField1Bit PPC,
551SCSICmdField1Bit SP,
552SCSICmdField2Bit PC,
553SCSICmdField6Bit PAGE_CODE,
554SCSICmdField2Byte PARAMETER_POINTER,
555SCSICmdField2Byte ALLOCATION_LENGTH,
556SCSICmdField1Byte CONTROL );
557
558virtual boolMODE_SELECT_6 (
559SCSITaskIdentifierrequest,
560IOMemoryDescriptor *dataBuffer,
561SCSICmdField1Bit PF,
562SCSICmdField1Bit SP,
563SCSICmdField1Byte PARAMETER_LIST_LENGTH,
564SCSICmdField1Byte CONTROL );
565
566 virtual boolMODE_SELECT_10 (
567SCSITaskIdentifierrequest,
568IOMemoryDescriptor *dataBuffer,
569SCSICmdField1Bit PF,
570SCSICmdField1Bit SP,
571SCSICmdField2Byte PARAMETER_LIST_LENGTH,
572SCSICmdField1Byte CONTROL );
573
574 virtual boolMODE_SENSE_6 (
575SCSITaskIdentifierrequest,
576IOMemoryDescriptor *dataBuffer,
577SCSICmdField1Bit DBD,
578 SCSICmdField2Bit PC,
579 SCSICmdField6Bit PAGE_CODE,
580 SCSICmdField1Byte ALLOCATION_LENGTH,
581SCSICmdField1Byte CONTROL );
582
583 virtual boolMODE_SENSE_10 (
584SCSITaskIdentifierrequest,
585IOMemoryDescriptor *dataBuffer,
586SCSICmdField1Bit LLBAA,
587SCSICmdField1Bit DBD,
588 SCSICmdField2Bit PC,
589 SCSICmdField6Bit PAGE_CODE,
590 SCSICmdField2Byte ALLOCATION_LENGTH,
591SCSICmdField1Byte CONTROL );
592
593 virtual boolPERSISTENT_RESERVE_IN (
594SCSITaskIdentifierrequest,
595IOMemoryDescriptor *dataBuffer,
596 SCSICmdField5Bit SERVICE_ACTION,
597 SCSICmdField2Byte ALLOCATION_LENGTH,
598SCSICmdField1Byte CONTROL );
599
600 virtual boolPERSISTENT_RESERVE_OUT (
601SCSITaskIdentifierrequest,
602IOMemoryDescriptor *dataBuffer,
603 SCSICmdField5Bit SERVICE_ACTION,
604 SCSICmdField4Bit SCOPE,
605 SCSICmdField4Bit TYPE,
606SCSICmdField1Byte CONTROL );
607
608virtual boolPREVENT_ALLOW_MEDIUM_REMOVAL (
609SCSITaskIdentifierrequest,
610 SCSICmdField2Bit PREVENT,
611SCSICmdField1Byte CONTROL );
612
613virtual boolREAD_BUFFER (
614SCSITaskIdentifierrequest,
615IOMemoryDescriptor *dataBuffer,
616SCSICmdField4Bit MODE,
617SCSICmdField1Byte BUFFER_ID,
618SCSICmdField3Byte BUFFER_OFFSET,
619SCSICmdField3Byte ALLOCATION_LENGTH,
620SCSICmdField1Byte CONTROL );
621
622virtual boolRECEIVE (
623SCSITaskIdentifierrequest,
624IOMemoryDescriptor *dataBuffer,
625 SCSICmdField3Byte TRANSFER_LENGTH,
626SCSICmdField1Byte CONTROL );
627
628virtual boolRECEIVE_DIAGNOSTICS_RESULTS (
629SCSITaskIdentifierrequest,
630IOMemoryDescriptor *dataBuffer,
631 SCSICmdField1Bit PCV,
632 SCSICmdField1BytePAGE_CODE,
633 SCSICmdField2Byte ALLOCATION_LENGTH,
634SCSICmdField1Byte CONTROL );
635
636virtual boolRELEASE_6 (
637SCSITaskIdentifierrequest,
638SCSICmdField1Byte CONTROL );
639
640#ifndef __LP64__
641
642virtual boolRELEASE_6 (
643SCSITaskIdentifierrequest,
644IOMemoryDescriptor *dataBuffer,
645SCSICmdField1Bit EXTENT,
646SCSICmdField1Byte RESERVATION_IDENTIFICATION,
647SCSICmdField1Byte CONTROL );
648
649#endif/* !__LP64__ */
650
651virtual boolRELEASE_10 (
652SCSITaskIdentifierrequest,
653IOMemoryDescriptor *dataBuffer,
654SCSICmdField1Bit THRDPTY,
655SCSICmdField1Bit LONGID,
656SCSICmdField1Byte THIRD_PARTY_DEVICE_ID,
657SCSICmdField2Byte PARAMETER_LIST_LENGTH,
658SCSICmdField1Byte CONTROL );
659
660#ifndef __LP64__
661
662virtual boolRELEASE_10 (
663SCSITaskIdentifierrequest,
664IOMemoryDescriptor *dataBuffer,
665SCSICmdField1Bit THRDPTY,
666SCSICmdField1Bit LONGID,
667SCSICmdField1Bit EXTENT,
668SCSICmdField1Byte RESERVATION_IDENTIFICATION,
669SCSICmdField1Byte THIRD_PARTY_DEVICE_ID,
670SCSICmdField2Byte PARAMETER_LIST_LENGTH,
671SCSICmdField1Byte CONTROL );
672
673#endif/* !__LP64__ */
674
675virtual boolREPORT_DEVICE_IDENTIFIER (
676SCSITaskIdentifierrequest,
677IOMemoryDescriptor *dataBuffer,
678SCSICmdField4Byte ALLOCATION_LENGTH,
679SCSICmdField1Byte CONTROL );
680
681 virtual boolREPORT_LUNS (
682SCSITaskIdentifierrequest,
683 IOMemoryDescriptor *dataBuffer,
684 SCSICmdField4Byte ALLOCATION_LENGTH,
685 SCSICmdField1Byte CONTROL );
686
687virtual boolREQUEST_SENSE (
688SCSITaskIdentifierrequest,
689 IOMemoryDescriptor *dataBuffer,
690SCSICmdField1Byte ALLOCATION_LENGTH,
691SCSICmdField1Byte CONTROL );
692
693 virtual boolRESERVE_6 (
694SCSITaskIdentifierrequest,
695IOMemoryDescriptor *dataBuffer,
696SCSICmdField1Byte CONTROL );
697
698#ifndef __LP64__
699
700 virtual boolRESERVE_6 (
701SCSITaskIdentifierrequest,
702IOMemoryDescriptor *dataBuffer,
703SCSICmdField1Bit EXTENT,
704SCSICmdField1Byte RESERVATION_IDENTIFICATION,
705SCSICmdField2Byte PARAMETER_LIST_LENGTH,
706SCSICmdField1Byte CONTROL );
707
708#endif/* !__LP64__ */
709
710virtual boolRESERVE_10 (
711SCSITaskIdentifierrequest,
712IOMemoryDescriptor *dataBuffer,
713SCSICmdField1Bit THRDPTY,
714SCSICmdField1Bit LONGID,
715SCSICmdField1Byte THIRD_PARTY_DEVICE_ID,
716SCSICmdField2Byte PARAMETER_LIST_LENGTH,
717SCSICmdField1Byte CONTROL );
718
719#ifndef __LP64__
720
721virtual boolRESERVE_10 (
722SCSITaskIdentifierrequest,
723IOMemoryDescriptor *dataBuffer,
724SCSICmdField1Bit THRDPTY,
725SCSICmdField1Bit LONGID,
726SCSICmdField1Bit EXTENT,
727SCSICmdField1Byte RESERVATION_IDENTIFICATION,
728SCSICmdField1Byte THIRD_PARTY_DEVICE_ID,
729SCSICmdField2Byte PARAMETER_LIST_LENGTH,
730SCSICmdField1Byte CONTROL );
731
732#endif/* !__LP64__ */
733
734virtual boolSEND (
735SCSITaskIdentifierrequest,
736IOMemoryDescriptor *dataBuffer,
737SCSICmdField1BitAER,
738 SCSICmdField3Byte TRANSFER_LENGTH,
739SCSICmdField1Byte CONTROL );
740
741 virtual boolSEND_DIAGNOSTICS (
742SCSITaskIdentifierrequest,
743IOMemoryDescriptor *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
752virtual boolSET_DEVICE_IDENTIFIER (
753SCSITaskIdentifierrequest,
754IOMemoryDescriptor *dataBuffer,
755SCSICmdField5Bit SERVICE_ACTION,
756SCSICmdField4Byte PARAMETER_LIST_LENGTH,
757SCSICmdField1Byte CONTROL );
758
759virtual boolTEST_UNIT_READY (
760SCSITaskIdentifierrequest,
761SCSICmdField1Byte CONTROL );
762
763virtual boolWRITE_BUFFER (
764SCSITaskIdentifierrequest,
765IOMemoryDescriptor *dataBuffer,
766SCSICmdField4Bit MODE,
767SCSICmdField1Byte BUFFER_ID,
768SCSICmdField3Byte BUFFER_OFFSET,
769SCSICmdField3Byte PARAMETER_LIST_LENGTH,
770SCSICmdField1Byte CONTROL );
771
772// The SPC-3 INQUIRY command as defined in section 6.4.1 of SPC-3.
773boolINQUIRY (
774SCSITaskIdentifierrequest,
775 IOMemoryDescriptor *dataBuffer,
776 SCSICmdField1Bit EVPD,
777 SCSICmdField1Byte PAGE_CODE,
778 SCSICmdField2Byte ALLOCATION_LENGTH,
779 SCSICmdField1Byte CONTROL );
780
781private:
782
783// Space reserved for future expansion.
784OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 1 );
785OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 2 );
786OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 3 );
787OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 4 );
788OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 5 );
789OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 6 );
790OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 7 );
791OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 8 );
792OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 9 );
793OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 10 );
794OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 11 );
795OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 12 );
796OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 13 );
797OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 14 );
798OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 15 );
799OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 16 );
800
801};
802
803#endif/* defined(KERNEL) && defined(__cplusplus) */
804
805#endif /* _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ */
806

Archive Download this file

Revision: 1129