Specifications
System Macros Invoked by Drivers
SPI$CONNECT
SPI$CONNECT
Creates a connection from a class driver to a SCSI device.
Format
SPI$CONNECT [select_callback [,select_context]]
Parameters
select_callback
Address of a routine in the class driver that executes in response to asynchronous
event notification from the target device. The port driver invokes the selection
callback routine at this address, holding the fork lock and no other locks at IPL 8;
it passes to the routine the address of the SPDT in R4 and any optional selection
context in R5.
If the SCSI class driver does not provide a callback address, no selections are
allowed on the connection that is established.
select_context
Longword context value to be passed to selection callback routine. When the port
driver invokes the selection callback routine, it passes this value to it in R5. For
instance, some class drivers may specify the address of the UCB in this argument
(select_context=R5) if the selection callback routine needs access to the device
unit’s UCB. The select_context value can help a class driver that supports
multiple device units to identify which unit is generating the asynchronous event.
Description
The SPI$CONNECT macro establishes a connection between the class driver and
a SCSI device. It also links a SCSI class driver to the port driver. Before a SCSI
class driver can exchange commands and data with a SCSI device, it must invoke
SPI$CONNECT.
In response to the call to SPI$CONNECT, the port driver allocates and links
an SCDT for the connection. It marks the connection state open and initializes
default connection information. If the connection already exists, it returns SS$_
DEVALLOC status to the class driver.
Inputs to the SPI$CONNECT macro include the following:
Location Contents
R1 SCSI device ID (bits <31:16>) and SCSI port ID (bits <15:0>).
Valid SCSI device IDs are integers from 0 to 7; valid SCSI port
IDs are integers 0 and 1, corresponding to controller IDs A
and B.
R2 SCSI logical unit number (bits <31:16>). Bits <15:0> are
reserved. Valid SCSI logical unit numbers are integers from 0
to 7.
R4 Address of the SPDT.
2–70