Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 4 - SCSI Manager 4.3 / SCSI Manager 4.3 Reference
SCSI Manager 4.3 Functions / Client Functions


You can use the SCSITerminateIO function to cancel an I/O request.

OSErr SCSIAction(SCSITerminateIOPB *scsiPB);
A pointer to a SCSI terminate I/O parameter block, which is described on page 4-33.
-->scsiPBLengthUInt16The size of the parameter block.
-->scsiFunctionCodeUInt8The SCSITerminateIO function selector code (0x13).
<--scsiResultOSErrThe returned result code.
-->scsiDeviceDeviceIdentThe device identification record.
-->scsiCompletionCallbackProcA pointer to a completion routine.
If this field is set to nil, the function is executed synchronously.
-->scsiDriverStorageUInt8 *Optional pointer to the device driver's private storage.
-->scsiIOptrSCSI_IO *A pointer to the SCSI I/O parameter block to be canceled.

The SCSITerminateIO function cancels the SCSIExecIO request identified by the scsiIOptr 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 of scsiTerminated. If the request has already been started, the SIM attempts to send a TERMINATE IO PROCESS message to the device, either by asserting the /ATN signal or by reselecting the device. The function returns the scsiUnableToTerminate result code if the specified request has already been completed.

The SCSITerminateIO function differs from the SCSIAbortCommand 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.

Because the interrupt that calls the completion routine can pre-empt the SCSITerminateIO request, this function can produce unexpected results if the completion routine for the canceled request reuses the parameter block.

noErr0No error
scsiBusInvalid-7869The bus ID is invalid
scsiRequestInvalid-7870The parameter block request is invalid
scsiPBLengthError-7872The parameter block is too small for this SIM
scsiQLinkInvalid-7881The qLink field was not 0
scsiUnableToTerminate-7927Unable to terminate I/O parameter block request

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996