public:
void abort( UInt32 sequenceNumber );
The client may invoke the abort() method to force the completion of an
executing SCSI Command. The client must pass the sequence number
provided when the execute() function was invoked.
Note: The abort function provides no status on whether or not a
command has been successfully aborted. The client should wait for the
command to actually complete to determine whether the abort completed
successfully.
Name Description sequenceNumber The client must pass the sequence number assigned to the command when the client called the execute() function.
public:
void complete();
Once the complete() function is called, the controller
subclass should make no further accesses to the IOSCSICommand
being completed.
A IOSCSIDevice client would not normally call this function.
public:
bool execute( UInt32 *sequenceNumber = 0 );
Once the execute() function is called, the client should not
invoke any further functions on the SCSI Command with the
exception of abort().
The execute() function optionally returns sets a unique sequence
number token for the command. If the client intends to use the abort()
method they must retain this sequence number token.
Name Description sequenceNumber Pointer to field (UInt32) to receive the sequence number assigned to the SCSI Command.
public:
void getCDB( SCSICDBInfo *scsiCmd );
Name Description scsiCDB Pointer to a SCSICDBInfo structure to receive the SCSI Command's cdb information.
public:
void *getClientData();
The client may allocate storage in the SCSI Command for its own use. See IOSCSIDevice::allocateCmd().
public:
UInt32 getCmdType();
This function provides information on the intent of a SCSI
Command. For example, since Aborts, Request Sense and normal Execute commands are
all sent to the executeCommand() function, invoking getCmdType()
will indicate whether a Request Sense, Abort or Normal I/O request is
being processed.
It this information is not normally meaningful to IOSCSIDevice clients.
public:
IOSCSIDevice *getDevice( IOSCSIDevice *deviceType );
In some cases a IOSCSICommand is not associated with a specific target/lun. This would be the case for a SCSI Bus Reset. In this case getDevice() returns 0.
Name Description deviceType The caller should use value kIOSCSIDeviceType.
public:
IOSCSICommand *getOriginalCmd();
In cases where a SCSI command is related to a previous command, this
function will return the original command. For example, if a
Request Sense command (CmdType = kSCSICommandReqSense)is processed,
then this function can be used to obtain the original command that
caused the check condition. If an Abort command (CmdType =
kSCSICommandAbort) then this function can be used to obtain the original
command the abort was issued against.
It this information is not normally meaningful to IOSCSIDevice clients.
public:
void getPointers( IOMemoryDescriptor **desc, UInt32 *transferCount, bool *isWrite, bool isSense = false );
The client provides a set of pointers to fields to receive the IOSCSICommand's data/request sense buffer pointers.
Name Description desc Pointer to a field (IOMemoryDescriptor *) to receive the IOSCSICommand's IOMemoryDescriptor pointer. transferCount Pointer to a field (UInt32) to receive the IOSCSICommand's maximum transfer count. isWrite Pointer to a field (bool) to receive the IOSCSICommand's transfer direction. isSense If isSense is set to true, the IOSCSICommand's data buffer information is returned. Otherwise, the IOSCSICommand's request sense buffer information is returned.
public:
void getQueueInfo( UInt32 *queueType, UInt32 *queuePosition = 0 );
Name Description queueType Pointer to a field (UInt32) to receive the queue type previously set for this SCSI Command. queuePosition Pointer to a field (UInt32) to receive the queue position previously set for this SCSI Command.
public:
IOReturn getResults( SCSIResults *results );
The getResults() function returns the value of the returnCode field of the command results. If the client is only interested in a pass/fail indication for the command, the client can pass (SCSIResult *)0 as a parameter.
Name Description results Pointer to a SCSIResults structure to receive the SCSI Commands completion information.
public:
UInt32 getSequenceNumber();
The caller should check the sequence number for 0. This indicates that the command has completed or has not been processed to the point where a sequence number has been assigned.
public:
void getTargetLun( SCSITargetLun *targetLun );
Name Description targetLun Pointer to a SCSITargetLun structure to receive the target/lun information.
public:
UInt32 getTimeout();
This function returns the command timeout previously set by setTimeout().
Name Description timeout Command timeout in milliseconds.
public:
void setCDB( SCSICDBInfo *scsiCmd );
Name Description scsiCDB Pointer to a SCSICDBInfo structure.
public:
void setCallback( void *target = 0, CallbackFn callback = 0, void *refcon = 0 );
Name Description target Pointer to the object to be passed to the callback routine. This would usually be the client's (this) pointer. callback Pointer to the client's function to process the completed command refcon Pointer to the information required by the client's callback routine to process the completed command.
public:
void setPointers( IOMemoryDescriptor *desc, UInt32 transferCount, bool isWrite, bool isSense=false );
The client provides an IOMemoryDescriptor object to corresponding to the client's data or request sense buffer, the maximum data transfer count and data transfer direction.
Name Description desc Pointer to a IOMemoryDescriptor describing the client's I/O buffer. transferCount Maximum data transfer count in bytes. isWrite Data transfer direction. (Defined with respect to the device, i.e. isWrite = true indicates the host is writing to the device. isSense If isSense is set to true, the IOSCSICommand's data buffer information is set. Otherwise, the IOSCSICommand's request sense buffer information is set
public:
void setQueueInfo( UInt32 queueType = kQTypeNormalQ, UInt32 queuePosition = kQPositionTail );
Each IOSCSIDevice has two queues, a normal Q and a bypass Q. The treatment of the
queues is esentially identical except that the bypass Q is given preference whenever
it has commands available.
Usually, the client will use the normal Q for regular I/O commands and the bypass Q
to send error recovery commands to the device.
Name Description queueType Set to kQTypeNormalQ or kQTypeBypassQ to indicate which IOSCSIDevice queue the SCSI Command should be routed to. queuePosition Set to kQPositionTail or kQPositionHead to indicate whether the SCSI Command should be added to the head to tail for the selected IOSCSIDevice queue.
public:
void setResults( SCSIResults *results );
The setResults() function is used by the IOSCSIController subclass (host adapter driver) return results for a SCSI Command about to be completed.
Name Description scsiResults Pointer to a SCSIResults structure containing completion information for the SCSI Command.
Completion information is copied into the command, so the caller may release the SCSIResults structure provided when this function returns.
public:
void setTimeout( UInt32 timeoutmS );
The IOSCSIController class will abort a command which does not complete with in the time interval specified. The client should set the timeout parameter to zero if they want to suppress timing.
Name Description timeout Command timeout in milliseconds.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)