Specifications

System Macros Invoked by Drivers
SPI$SEND_COMMAND
SPI$SEND_COMMAND
Sends a command to a SCSI device.
Format
SPI$SEND_COMMAND
Description
The SPI$SEND_COMMAND macro sends a command to a SCSI device. A class
driver invokes this macro, after calling SPI$ALLOCATE_COMMAND_BUFFER
to allocate a port command buffer and formatting a SCSI command descriptor
block in it.
The port driver responds to the SPI$SEND_COMMAND macro call by arbitrating
for access to the SCSI bus, selecting the target device, sending the SCSI command
descriptor block to the target, and waiting for a response. Before returning to
the class driver, the port driver sends data to or receives data from the target
device, obtains command status, processes SCSI message bytes, and transfers the
data. When the SPI$SEND_COMMAND routine completes, the port driver then
returns port status and SCSI status to the class driver.
Table 2–10 lists the inputs to the SPI$SEND_COMMAND macro.
Table 2–10 Inputs to the SPI$SEND_COMMAND Macro
Location Contents
R3 Address of the UCB.
R4 Address of the SPDT.
R5 Address of the SCDRP. The class driver must provide values
in the following fields:
SCDRP$L_CMD_PTR Address of the port command
buffer. The first longword of the
port command buffer contains the
number of bytes in the buffer (not
including the count longword).
Subsequent bytes contain the
SCSI command descriptor block.
SCDRP$L_BCNT Size in bytes of the mapped
process buffer.
SCDRP$W_PAD_BCNT Number of bytes to make the
size of the buffer equal to the
data length value required in the
command.
(continued on next page)
2–88