Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 3 - SCSI Manager / SCSI Manager Reference
SCSI Manager Routines /


SCSIComplete

You use the SCSIComplete function to complete a SCSI transaction.

FUNCTION SCSIComplete(VAR stat: Integer; VAR message: Integer; 
                      wait: LongInt): OSErr;
stat
The low-order byte contains the status byte from the target device.
message
The low-order byte contains the message byte from the target device.
wait
The number of ticks to wait for the command to complete.
DESCRIPTION
The SCSIComplete function performs the tasks necessary to properly complete the current SCSI transaction and leave the bus in the bus free phase. This function must be called at the end of each SCSI transaction, even if the transaction does not complete successfully.

The SCSIComplete function waits for the transaction to complete, and then returns one byte of status information and one byte of message information. If the transaction fails to complete within the number of ticks specified by the wait parameter, the scCommErr result is returned.

The SCSIComplete function uses a number of strategies to correct anomalous conditions on the SCSI bus and restore the bus into a known state. These include accepting arbitrary amounts of data sent by the target (and throwing this data away), and sending arbitrary data (bytes with the value of $EE) as requested by the target. The function returns the scComplPhaseErr result if either of these steps were necessary.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for SCSIComplete are
Trap macroSelector
_SCSIDispatch$0004

RESULT CODES
noErr0No error
scCommErr2Communications error, operation timeout
scPhaseErrXPhase error on the SCSI bus
scComplPhaseErr10SCSI bus was not in status phase on entry to SCSIComplete
SEE ALSO
See "Using the SCSIComplete Function," beginning on page 3-21, for more information about this function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996