ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
SCSITaskInterface |
Declared In: |
Basic interface for a SCSITask.
After rendezvous with a SCSITask Device in the I/O Registry you can create an instance of this interface using the CreateSCSITask method in the SCSITaskDeviceInterface. Once you have this interface, or one of its subclasses, you can manipulate SCSITasks to send to the device.
Method to abort the SCSITask.
Method to execute the SCSITask asynchronously.
Method to execute the SCSITask synchronously.
Method to get the auto-sense data from the SCSITask.
Method to get the task's SCSICommandDescriptorBlock.
Method to get the task's SCSICommandDescriptorBlock size.
Method to get the actual transfer count in bytes from the SCSITask.
Method to get the SCSIServiceResponse from the SCSITask.
Method to get the task's attribute.
Method to get the SCSITaskState from the SCSITask.
Method to get the SCSITaskStatus from the SCSITask.
Method to get the timeout duration for the SCSITask.
Method to find out if the task is active or not.
Method to set the auto-sense data for the SCSITask.
Method to set the task's SCSICommandDescriptorBlock.
Method to set the task's scatter-gather list entries.
Method to set the task's attribute.
Method to set the asynchronous completion routine for the SCSITask.
Method to set the timeout duration for the SCSITask.
AbortTask |
Method to abort the SCSITask.
IOReturn ( *AbortTask ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
Returns kIOReturnSuccess, kIOReturnUnsupported or kIOReturnError.
This method can be used to abort an SCSITask which is already in progress.
ExecuteTaskAsync |
Method to execute the SCSITask asynchronously.
IOReturn ( *ExecuteTaskAsync ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
Returns a valid IOReturn code such as kIOReturnSuccess, kIOReturnError, kIOReturnVMError, kIOReturnCannotWire, etc. It will return kIOReturnNotPermitted if the client has not called AddCallbackDispatcherToRunLoop on the SCSITaskDeviceInterface. NOTE: IOReturn is defined as kern_return_t and as such, you may get errors back that do not fall under the IOKit subsystem error domain (sys_iokit) defined in IOReturn.h.
This method can be used to execute the SCSITask asynchronously.
ExecuteTaskSync |
Method to execute the SCSITask synchronously.
IOReturn ( *ExecuteTaskSync ) ( void *task, SCSI_Sense_Data *senseDataBuffer, SCSITaskStatus *outStatus, UInt64 *realizedTransferCount );
task
Pointer to an instance of an SCSITaskInterface.
senseDataBuffer
Pointer to a buffer for REQUEST_SENSE data. May be NULL if caller does not wish to have sense data returned. If caller has previously called SetAutoSenseDataBuffer(), this parameter is ignored.
outStatus
Pointer to an SCSITaskStatus. May be NULL if caller does not wish to have task status returned.
realizedTransferCount
Pointer to an UInt64 which reflects how much data was actually transferred. May be NULL if caller does not wish to know how many bytes were transferred.
Returns a valid IOReturn code such as kIOReturnSuccess, kIOReturnError, kIOReturnVMError, kIOReturnCannotWire, etc. NOTE: IOReturn is defined as kern_return_t and as such, you may get errors back that do not fall under the IOKit subsystem error domain (sys_iokit) defined in IOReturn.h.
This method can be used to execute the SCSITask synchronously.
GetAutoSenseData |
Method to get the auto-sense data from the SCSITask.
IOReturn ( *GetAutoSenseData ) ( void *task, SCSI_Sense_Data *senseDataBuffer );
task
Pointer to an instance of an SCSITaskInterface.
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data structure. If caller has previously called SetAutoSenseDataBuffer(), this routine will return an error.
Returns kIOReturnSuccess if sense data is valid, otherwise kIOReturnError.
This method can be used to get the auto-sense data from the SCSITask.
GetCommandDescriptorBlock |
Method to get the task's SCSICommandDescriptorBlock.
IOReturn ( *GetCommandDescriptorBlock ) ( void *task, UInt8 *outCDB );
task
Pointer to an instance of an SCSITaskInterface.
outCDB
Pointer to an array the size of the SCSICommandDescriptorBlock in question. Clients should call GetCommandDescriptorBlockSize first to find out how large an array should be passed in.
Returns kIOReturnSucces or kIOReturnError.
This method can be used to get the SCSITasks' SCSICommandDescriptorBlock.
GetCommandDescriptorBlockSize |
Method to get the task's SCSICommandDescriptorBlock size.
UInt8 ( *GetCommandDescriptorBlockSize ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
UInt8 which is the size of the SCSICommandDescriptorBlock. Valid values are 6, 10, 12, and 16 which have enums defined in SCSITask.h
This method can be used to get the size of the SCSITask's SCSICommandDescriptorBlock.
GetRealizedDataTransferCount |
Method to get the actual transfer count in bytes from the SCSITask.
UInt64 ( *GetRealizedDataTransferCount ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
outStatus
Pointer to an SCSITaskStatus.
Returns a UInt64 value of bytes transferred.
This method can be used to get the actual transfer count in bytes from the SCSITask.
GetSCSIServiceResponse |
Method to get the SCSIServiceResponse from the SCSITask.
IOReturn ( *GetSCSIServiceResponse ) ( void *task, SCSIServiceResponse *outServiceResponse );
task
Pointer to an instance of an SCSITaskInterface.
outServiceResponse
Pointer to an SCSIServiceResponse.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to get the SCSIServiceResponse from the SCSITask.
GetTaskAttribute |
Method to get the task's attribute.
IOReturn ( *GetTaskAttribute ) ( void *task, SCSITaskAttribute *outAttribute );
task
Pointer to an instance of an SCSITaskInterface.
outAttribute
Pointer to the attribute value stored in the SCSITask.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to get the SCSITasks' SCSITaskAttribute field. Valid values are defined in SCSITask.h
GetTaskState |
Method to get the SCSITaskState from the SCSITask.
IOReturn ( *GetTaskState ) ( void *task, SCSITaskState *outState );
task
Pointer to an instance of an SCSITaskInterface.
outState
Pointer to an SCSITaskState.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to get the SCSITaskState from the SCSITask.
GetTaskStatus |
Method to get the SCSITaskStatus from the SCSITask.
IOReturn ( *GetTaskStatus ) ( void *task, SCSITaskStatus *outStatus );
task
Pointer to an instance of an SCSITaskInterface.
outStatus
Pointer to an SCSITaskStatus.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to get the SCSITaskStatus from the SCSITask.
GetTimeoutDuration |
Method to get the timeout duration for the SCSITask.
UInt32 ( *GetTimeoutDuration ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
inTimeoutDurationMS
UInt32 representing the timeout in milliseconds.
Returns a value between zero and ULONG_MAX.
This method can be used to get the timeout duration for the SCSITask. The timeout duration is counted in milliseconds.
IsTaskActive |
Method to find out if the task is active or not.
Boolean ( *IsTaskActive ) ( void *task );
task
Pointer to an instance of an SCSITaskInterface.
Returns 0 if the task is not active, non-zero if it is active.
Method to find out if the task is active or not. The task is considered "active" if the SCSITaskState is not kSCSITaskState_NEW nor kSCSITaskState_ENDED.
SetAutoSenseDataBuffer |
Method to set the auto-sense data for the SCSITask.
IOReturn ( *SetAutoSenseDataBuffer ) ( void *task, SCSI_Sense_Data *senseDataBuffer, UInt8 senseDataLength );
task
Pointer to an instance of an SCSITaskInterface.
senseDataBuffer
Pointer to a buffer. May be be NULL if the caller wants to restrict the size to be less than the normal 18 bytes of sense data.
senseDataLength
Amount of sense data to retrieve. Zero is not a valid value.
Returns kIOReturnSuccess if sense data buffer was set, otherwise kIOReturnError.
This method can be used to set the auto-sense data buffer for the SCSITask.
SetCommandDescriptorBlock |
Method to set the task's SCSICommandDescriptorBlock.
IOReturn ( *SetCommandDescriptorBlock ) ( void *task, UInt8 *inCDB, UInt8 inSize );
task
Pointer to an instance of an SCSITaskInterface.
inCDB
Pointer to an array of values to be stored in the SCSITask's SCSICommandDescriptorBlock.
inSize
The size of the array inCDB. Valid values are 6, 10, 12, and 16 which have enums defined in SCSITask.h.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to set the SCSITasks' SCSICommandDescriptorBlock.
SetScatterGatherEntries |
Method to set the task's scatter-gather list entries.
IOReturn ( *SetScatterGatherEntries ) ( void *task, SCSITaskSGElement *inScatterGatherList, UInt8 inScatterGatherEntries, UInt64 inTransferCount, UInt8 inTransferDirection );
task
Pointer to an instance of an SCSITaskInterface.
inScatterGatherList
Pointer to an array of SCSITaskSGElements.
inScatterGatherEntries
The size of the inScatterGatherList array.
inTransferCount
The TOTAL amount of data to transfer. The length of all the entries in the scatter-gather list should at least add up to the amount in inTransferCount.
inTransferDirection
The transfer direction as defined in SCSITask.h. Valid values are kSCSIDataTransfer_NoDataTransfer, kSCSIDataTransfer_FromTargetToInitiator, and kSCSIDataTransfer_FromInitiatorToTarget.
Returns kIOReturnSucces or kIOReturnError.
This method can be used to set the SCSITask's scatter-gather list entries. Scatter-gather lists are represented as an array of SCSITaskSGElements. The SCSITaskSGElement structure has two elements, the address of the buffer and the length of the buffer.
SetTaskAttribute |
Method to set the task's attribute.
IOReturn ( *SetTaskAttribute ) ( void *task, SCSITaskAttribute inAttribute );
task
Pointer to an instance of an SCSITaskInterface.
inAttribute
The new attribute value to be stored in the SCSITask.
Returns kIOReturnSuccess or kIOReturnError.
This method can be used to set the SCSITask's SCSITaskAttribute field. Valid values are defined in SCSITask.h
SetTaskCompletionCallback |
Method to set the asynchronous completion routine for the SCSITask.
IOReturn ( *SetTaskCompletionCallback ) ( void *task, SCSITaskCallbackFunction callback, void *refCon );
task
Pointer to an instance of an SCSITaskInterface.
callback
SCSITaskCallbackFunction to be called upon completion of the SCSITask.
refCon
A value to be returned to the caller upon completion of the routine. This field is not used by the SCSITaskInterface.
Returns kIOReturnSuccess, kIOReturnError, or kIOReturnNotPermitted if the client has not called AddCallbackDispatcherToRunLoop on the SCSITaskDeviceInterface.
This method can be used to set the asynchronous completion routine for the SCSITask.
SetTimeoutDuration |
Method to set the timeout duration for the SCSITask.
IOReturn ( *SetTimeoutDuration ) ( void *task, UInt32 inTimeoutDurationMS );
task
Pointer to an instance of an SCSITaskInterface.
inTimeoutDurationMS
UInt32 representing the timeout in milliseconds.
Returns kIOReturnSucces or kIOReturnError.
This method can be used to set the timeout duration for the SCSITask. The timeout duration is counted in milliseconds. A value of zero is equivalent to "Wait Forever", but on some buses, this isn't possible, so ULONG_MAX is used.
|
Last Updated: 2009-02-23