Manual page for scsi_slave(9F)
scsi_slave - utility for SCSI target drivers to establish the presence of a target
SYNOPSIS
#include <sys/scsi/scsi.h>
int scsi_slave(struct scsi_device *devp,
int (*callback)(void));
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
ARGUMENTS
- devp
-
Pointer to a
scsi_device.9s
structure.
- callback
-
Pointer to a callback function,
NULL_FUNC
or
SLEEP_FUNC.
DESCRIPTION
scsi_slave()
checks for the presence of a SCSI device.
Target drivers may use this function in their
probe.9e
routines.
scsi_slave()
determines if the device is present by using
a Test Unit Ready command followed by an Inquiry command.
If
scsi_slave()
is successful, it will fill in the scsi_inquiry structure, which is the
sd_inq
member of the
scsi_device.9s
structure, and return
SCSI_PROBE_EXISTS.
This information can be used to determine if the target driver
has probed the correct SCSI device type.
callback
indicates what the allocator routines should do when
DMA
resources are not available:
-
- NULL_FUNC
-
Do not wait for resources.
Return a
NULL
pointer.
- SLEEP_FUNC
-
Wait indefinitely for resources.
- Other Values
-
callback
points to a function which is called when resources may have become available.
callback
must
return either
0
(indicating that it attempted to allocate resources
but again failed to do so), in which case
it is put back on a list to be called again later, or
1
indicating either success in allocating
resources or indicating that it no longer
cares for a retry.
RETURN VALUES
scsi_slave()
returns:
- SCSIPROBE_NOMEM
-
No space available for structures.
- SCSIPROBE_EXISTS
-
Device exists and inquiry data is valid.
- SCSIPROBE_NONCCS
-
Device exists but inquiry data is not valid.
- SCSIPROBE_FAILURE
-
Polled command failure.
- SCSIPROBE_NORESP
-
No response to
TEST UNIT READY.
CONTEXT
scsi_slave()
is normally called from the target driver's
probe.9e
or
attach.9e
routine.
If
callback
is
SLEEP_FUNC,
then this routine may only be called from
user-level code. Otherwise, it may be called from either user or
interrupt level.
The
callback
function may not block or call routines that block.
SEE ALSO
attach.9e
probe.9e
ddi_iopb_alloc.9f
makecom.9f
scsi_dmaget.9f
scsi_ifgetcap.9f
scsi_pktalloc.9f
scsi_poll.9f
scsi_probe.9f
scsi_device.9s
ANSI Small Computer System Interface-2 (SCSI-2)
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97