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 4 - SCSI Manager 4.3 / SCSI Manager 4.3 Reference
SCSI Manager 4.3 Functions / Client Functions


SCSIAction

You use the SCSIAction function to initiate a SCSI transaction or request a service from the XPT or SIM.

OSErr SCSIAction(SCSI_PB *scsiPB);
scsiPB
A pointer to a SCSI Manager parameter block.
-->scsiPBLengthUInt16The size of the parameter block.
-->scsiFunctionCodeUInt8The function selector code.
<--scsiResultOSErrThe returned result code.
-->scsiDeviceDeviceIdentA 4-byte value that uniquely identifies the target device.
-->scsiCompletionCallbackProcA pointer to a completion routine. If this field is set to nil, the function is executed synchronously.
-->scsiFlagsUInt32Flags indicating the transfer direction and any special handling required for the request. See page 4-22 for descriptions of these flags.
-->scsiDriverStorageUInt8 *Optional pointer to the device driver's private storage.

DESCRIPTION
The SCSIAction function initiates the request specified by the scsiFunctionCode field of the parameter block. Certain types of requests are handled by the XPT, but most are handled by the SIM. Table 4-2 lists the function selector codes. See the following sections for descriptions of the functions you access through SCSIAction.

When called asynchronously, SCSIAction normally returns the NoErr result code, indicating that the request was queued successfully. The result of the SCSI transaction is returned in the scsiResult field upon completion. If the SCSIAction function returns an error code, the request was not queued and the completion routine will not be called.

When the completion routine is called, it receives the A5 world that existed when the SCSIAction request was received. If A5 was invalid when the request was made, it is also invalid in the completion routine.

Your completion routine should use the following function prototype:

pascal void (*CallbackProc) (void * scsiPB);
There is no implied ordering of asynchronous requests made to different devices. An earlier request may be started later, and a later request may complete earlier. However, a series of requests to the same device is issued to that device in the order received, except when the scsiSIMQHead flag is set in the scsiFlags field of the parameter block.

When called synchronously, the SCSIAction function returns the actual result of the operation. It also places this result in the scsiResult field.
Table 4-2 SCSIAction function selector codes
CodeFunctionOperation
00SCSINopNo operation.
01SCSIExecIOExecute a SCSI I/O transaction.
02Reserved 
03SCSIBusInquiryBus inquiry.
04SCSIReleaseQRelease a frozen SIM queue.
05-0FReserved 
10SCSIAbortCommandAbort a SCSI command.
11SCSIResetBusReset the SCSI bus.
12SCSIResetDeviceReset a SCSI device.
13SCSITerminateIOTerminate I/O transaction.
14-7FReserved 
80SCSIGetVirtualIDInfoReturn DeviceIdent of a virtual SCSI ID.
81Reserved 
82SCSILoadDriverLoad a driver from a SCSI device.
83Reserved 
84SCSIOldCallSIM support function for original SCSI Manager emulation.
85SCSICreateRefNumXrefRegister a device driver.
86SCSILookupRefNumXrefFind a driver reference number.
87SCSIRemoveRefNumXrefDeregister a device driver.
88SCSIRegisterWthNewXPTXPT was replaced; SIM needs to reregister.
89-BFReserved 
C0-FFVendor uniqueRequests in this range are passed directly to the SIM without evaluation by the XPT.

RESULT CODES
noErr0Asynchronous request successfully queued, or synchronous request successfully completed
Note
Result codes for specific SCSIAction function requests are listed
in the following sections. See page 4-90 for a list of all result codes.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996