Important: The information in this document is obsolete and should not be used for new development.
SCSITerminateIO
You can use theSCSITerminateIOfunction 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 SCSITerminateIOfunction 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
TheSCSITerminateIOfunction cancels theSCSIExecIOrequest identified by thescsiIOptrfield. 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 PROCESSmessage to the device, either by asserting the /ATN signal or by reselecting the device. The function returns thescsiUnableToTerminateresult code if the specified request has already been completed.The
SCSITerminateIOfunction differs from theSCSIAbortCommandfunction (described on page 4-45) only in the message it sends over the SCSI bus.TERMINATE IO PROCESSis 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 theSCSITerminateIOrequest, this function can produce unexpected results if the completion routine for the canceled request reuses the parameter block.RESULT CODES
 
  
  
 