Important: The information in this document is obsolete and should not be used for new development.
SCSITerminateIO
You can use theSCSITerminateIO
function to cancel an I/O request.
OSErr SCSIAction(SCSITerminateIOPB *scsiPB);
- scsiPB
- A pointer to a SCSI terminate I/O parameter block, which is described on page 4-33.
--> scsiPBLength UInt16 The size of the parameter block. --> scsiFunctionCode UInt8 The SCSITerminateIO
function selector code (0x13).<-- scsiResult OSErr The returned result code. --> scsiDevice DeviceIdent The device identification record. --> scsiCompletion CallbackProc A pointer to a completion routine.
If this field is set tonil
, the function is executed synchronously.--> scsiDriverStorage UInt8 * Optional pointer to the device driver's private storage. --> scsiIOptr SCSI_IO * A pointer to the SCSI I/O parameter block to be canceled. DESCRIPTION
TheSCSITerminateIO
function cancels theSCSIExecIO
request identified by thescsiIOptr
field. If the request has not yet been delivered to the device, it is removed from the queue and its completion routine is called with a result code ofscsiTerminated
. If the request has already been started, the SIM attempts to send aTERMINATE IO PROCESS
message to the device, either by asserting the /ATN signal or by reselecting the device. The function returns thescsiUnableToTerminate
result code if the specified request has already been completed.The
SCSITerminateIO
function differs from theSCSIAbortCommand
function (described on page 4-45) only in the message it sends over the SCSI bus.TERMINATE IO PROCESS
is an optional SCSI-2 message that instructs the device to complete a request normally although prematurely, while attempting to maintain media integrity.SPECIAL CONSIDERATIONS
Because the interrupt that calls the completion routine can pre-empt theSCSITerminateIO
request, this function can produce unexpected results if the completion routine for the canceled request reuses the parameter block.RESULT CODES