#include <IOKit/scsi/SCSITask.h>

IOKit/scsi/SCSITask.h Kernel.framework

@header SCSITask SCSITask typedefs and constants used inside the kernel and user space. Note that the SCSITaskIdentifier is an opaque object and that directly casting the SCSITaskIdentifier to any other type is discouraged. The SCSITask implementation changes when necessary to accomodate architectural changes, performance improvements, and bug fixes. Device and protocol layer drivers that need to access information contained in a SCSITask should use the appropriate accessor methods in IOSCSIPrimaryCommandsDevice.h or IOSCSIProtocolServices.h
includes: TargetConditionals.h, Kernel/stdint.h, IOKit/IOTypes.h, libkern/c++/OSObject.h
14 typedefs · 8 enums

typedefSCSIDeviceIdentifier

typedef UInt64 SCSIDeviceIdentifier

typedefSCSITargetIdentifier

typedef SCSIDeviceIdentifier SCSITargetIdentifier

typedefSCSIInitiatorIdentifier

typedef SCSIDeviceIdentifier SCSIInitiatorIdentifier

typedefSCSILogicalUnitBytes

@typedef SCSILogicalUnitBytes[8] @abstract 8-Byte array to represent LUN information @discussion The SCSI Primary Commands specification treats the 64-bits of LUN information as 4 2-byte structures. Use of the 64-bit SCSILogicalUnitNumber is now deprecated. Since it was not defined on Mac OS X how the 64-bits were encoded for hierarchical units and all usage was simply as a 64-bit number, changing the encoding scheme now would result in non-binary compatible code. New APIs have been added to retrieve the LUN bytes from the SCSITask and set them in the SCSITask.
typedef UInt8 SCSILogicalUnitBytes[8]

typedefSCSILogicalUnitNumber

typedef UInt64 SCSILogicalUnitNumber
DEPRECATED

typedefSCSITaggedTaskIdentifier

typedef UInt64 SCSITaggedTaskIdentifier

enum(anonymous)

underlying type unsigned int
kSCSIUntaggedTaskIdentifier0

enumSCSITaskAttribute

underlying type unsigned int
kSCSITask_SIMPLE0
kSCSITask_ORDERED1
kSCSITask_HEAD_OF_QUEUE2
kSCSITask_ACA3

typedefSCSITaskAttribute

typedef enum SCSITaskAttribute SCSITaskAttribute;

enumSCSITaskState

underlying type unsigned int
kSCSITaskState_NEW_TASK0
kSCSITaskState_ENABLED1
kSCSITaskState_BLOCKED2
kSCSITaskState_DORMANT3
kSCSITaskState_ENDED4

typedefSCSITaskState

typedef enum SCSITaskState SCSITaskState;

enumSCSIServiceResponse

underlying type unsigned int
kSCSIServiceResponse_Request_In_Process0@constant kSCSIServiceResponse_Request_In_Process Not defined in SAM specification, but is a service response used for asynchronous commands that are not yet completed.
kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE1@constant kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE The service request failed because of a delivery or target failure.
kSCSIServiceResponse_TASK_COMPLETE2@constant kSCSIServiceResponse_TASK_COMPLETE The task completed.
3@constant kSCSIServiceResponse_LINK_COMMAND_COMPLETE The linked command completed.
kSCSIServiceResponse_FUNCTION_COMPLETE4@constant kSCSIServiceResponse_FUNCTION_COMPLETE The task management function completed.
kSCSIServiceResponse_FUNCTION_REJECTED5@constant kSCSIServiceResponse_FUNCTION_REJECTED The task management function was rejected.

typedefSCSIServiceResponse

typedef enum SCSIServiceResponse SCSIServiceResponse;

enumSCSITaskStatus

@typedef SCSITaskStatus @abstract Attributes for task status. @discussion The Task Status represents the completion status of the task which provides the SCSI Application Layer with additional information about how to procede in handling a completed task. The SCSI Architecture Model specification only defines task status values for when a task completes with a service response of either TASK_COMPLETED or LINK_COMMAND_COMPLETE. Since additional information will aid in error recovery when a task fails to be completed by a device due to a service response of kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE, additional values have been defined that can be returned by the SCSI Protocol Layer to inform the SCSI Application Layer of the cause of the delivery failure. The Task Status can only be modified by the SCSI Protocol Layer. The SCSI Application Layer can only read the status
underlying type unsigned int
kSCSITaskStatus_GOOD0
kSCSITaskStatus_CHECK_CONDITION2
kSCSITaskStatus_CONDITION_MET4
kSCSITaskStatus_BUSY8@constant kSCSITaskStatus_BUSY The task completed with a status of BUSY. The device server might need time to process a request and a delay may be required.
kSCSITaskStatus_INTERMEDIATE16@constant kSCSITaskStatus_INTERMEDIATE The task completed with a status of INTERMEDIATE.
kSCSITaskStatus_INTERMEDIATE_CONDITION_MET20@constant kSCSITaskStatus_INTERMEDIATE_CONDITION_MET The task completed with a status of INTERMEDIATE_CONDITION_MET.
kSCSITaskStatus_RESERVATION_CONFLICT24@constant kSCSITaskStatus_RESERVATION_CONFLICT The task completed with a status of RESERVATION_CONFLICT.
kSCSITaskStatus_TASK_SET_FULL40@constant kSCSITaskStatus_TASK_SET_FULL The task completed with a status of TASK_SET_FULL. The device server may need to complete a task before the initiator sends another.
kSCSITaskStatus_ACA_ACTIVE48@constant kSCSITaskStatus_ACA_ACTIVE The task completed with a status of ACA_ACTIVE. The device server may need the initiator to clear the Auto-Contingent Allegiance condition before it will respond to new commands.
kSCSITaskStatus_TaskTimeoutOccurred1
kSCSITaskStatus_ProtocolTimeoutOccurred2
kSCSITaskStatus_DeviceNotResponding3
kSCSITaskStatus_DeviceNotPresent4@constant kSCSITaskStatus_DeviceNotPresent If the task is unable to be delivered because the device has been detached, the task status shall be set to kSCSITaskStatus_DeviceNotPresent. This will allow the SCSI Application Layer to halt the sending of tasks to the device and, if supported, perform any device failover or system cleanup.
kSCSITaskStatus_DeliveryFailure5@constant kSCSITaskStatus_DeliveryFailure If the task is unable to be delivered to the device due to a failure in the SCSI Protocol Layer, such as a bus reset or communications error, but the device is is known to be functioning properly, the task status shall be set to kSCSITaskStatus_DeliveryFailure. This can also be reported if the task could not be delivered due to a protocol error that has since been corrected.
kSCSITaskStatus_No_Status255@constant kSCSITaskStatus_No_Status This status is not defined by the SCSI specifications, but is here to provide a status that can be returned in cases where there is not status available from the device or protocol, for example, when the service response is neither TASK_COMPLETED nor LINK_COMMAND_COMPLETE or when the service response is SERVICE_DELIVERY_OR_TARGET_FAILURE and the reason for failure could not be determined.

typedefSCSITaskStatus

typedef enum SCSITaskStatus SCSITaskStatus;

enum(anonymous)

@enum Command Descriptor Block Size @discussion Command Descriptor Block Size constants.
underlying type unsigned int
kSCSICDBSize_Maximum16@constant kSCSICDBSize_Maximum This is the largest size a Command Descriptor Block can be as specified in SPC-2.
kSCSICDBSize_6Byte6@constant kSCSICDBSize_6Byte Use this for a 6-byte CDB.
kSCSICDBSize_10Byte10@constant kSCSICDBSize_10Byte Use this for a 10-byte CDB.
kSCSICDBSize_12Byte12@constant kSCSICDBSize_12Byte Use this for a 12-byte CDB.
kSCSICDBSize_16Byte16@constant kSCSICDBSize_16Byte Use this for a 16-byte CDB.

typedefSCSICommandDescriptorBlock

typedef UInt8 SCSICommandDescriptorBlock[kSCSICDBSize_Maximum]

enum(anonymous)

@enum Data Transfer Direction @discussion DataTransferDirection constants.
underlying type unsigned int
kSCSIDataTransfer_NoDataTransfer0@constant kSCSIDataTransfer_NoDataTransfer Use this for tasks that transfer no data.
kSCSIDataTransfer_FromInitiatorToTarget1@constant kSCSIDataTransfer_FromInitiatorToTarget Use this for tasks that transfer data from the initiator to the target.
kSCSIDataTransfer_FromTargetToInitiator2@constant kSCSIDataTransfer_FromTargetToInitiator Use this for tasks that transfer data from the target to the initiator.

enumSCSITaskMode

@enum SCSITaskMode @discussion The SCSI Task mode is used by the SCSI Protocol Layer to indicate what mode the task is executing.
underlying type unsigned int
kSCSITaskMode_CommandExecution1
kSCSITaskMode_Autosense2

typedefSCSITaskMode

typedef enum SCSITaskMode SCSITaskMode;

typedefSCSITaskIdentifier

@typedef SCSITaskIdentifier @discussion This is an opaque object that represents a task. This is used so that drivers for both the SCSI Protocol Layer and the SCSI Application Layer cannot modify the SCSITask object directly but must instead use the inherited methods to do so. This allows the implementation of SCSITask to change without directly impacting device and protocol layer drivers. In addition, it prevents changing of properties that are not allowed to be changed by a given layer.
typedef OSObject * SCSITaskIdentifier

typedefSCSITaskCompletion

@typedef SCSITaskCompletion @discussion This is the typedef for completion routines that work with SCSITaskIdentifiers.
typedef void ( *SCSITaskCompletion )( SCSITaskIdentifier completedTask )