1scsi_slave(9F)           Kernel Functions for Drivers           scsi_slave(9F)
2
3
4

NAME

6       scsi_slave  - utility for SCSI target drivers to establish the presence
7       of a target
8

SYNOPSIS

10       #include <sys/scsi/scsi.h>
11
12
13
14       int scsi_slave(struct scsi_device *devp, int (*callback)(void));
15
16

INTERFACE LEVEL

18       The scsi_slave() function is obsolete. This function has been  replaced
19       by scsi_probe(9F).
20

PARAMETERS

22       devp         Pointer to a scsi_device(9S) structure.
23
24
25       callback     Pointer to a callback function, NULL_FUNC or SLEEP_FUNC.
26
27

DESCRIPTION

29       scsi_slave()  checks  for the presence of a SCSI device. Target drivers
30       may use this function in their probe(9E) routines. scsi_slave()  deter‐
31       mines  if the device is present by using a Test Unit Ready command fol‐
32       lowed by an Inquiry command. If scsi_slave()  is  successful,  it  will
33       fill  in  the scsi_inquiry structure, which is the sd_inq member of the
34       scsi_device(9S) structure, and return SCSI_PROBE_EXISTS. This  informa‐
35       tion  can be used to determine if the target driver has probed the cor‐
36       rect SCSI device type. callback indicates what the  allocator  routines
37       should do when DMA resources are not available:
38
39       NULL_FUNC       Do not wait for resources. Return a NULL pointer.
40
41
42       SLEEP_FUNC      Wait indefinitely for resources.
43
44
45       Other Values    callback  points  to  a  function  which is called when
46                       resources may  have  become  available.  callback  must
47                       return  either 0 (indicating that it attempted to allo‐
48                       cate resources but again failed to  do  so),  in  which
49                       case it is put back on a list to be called again later,
50                       or 1 indicating either success in allocating  resources
51                       or indicating that it no longer cares for a retry.
52
53

RETURN VALUES

55       scsi_slave() returns:
56
57       SCSIPROBE_NOMEM       No space available for structures.
58
59
60       SCSIPROBE_EXISTS      Device exists and inquiry data is valid.
61
62
63       SCSIPROBE_NONCCS      Device exists but inquiry data is not valid.
64
65
66       SCSIPROBE_FAILURE     Polled command failure.
67
68
69       SCSIPROBE_NORESP      No response to TEST UNIT READY.
70
71

CONTEXT

73       scsi_slave()  is  normally called from the target driver's probe(9E) or
74       attach(9E) routine. In any case, this routine should not be called from
75       interrupt  context, because it can sleep waiting for memory to be allo‐
76       cated.
77

ATTRIBUTES

79       See attributes(5) for a description of the following attributes:
80
81
82
83
84       ┌─────────────────────────────┬─────────────────────────────┐
85ATTRIBUTE TYPE         ATTRIBUTE VALUE        
86       ├─────────────────────────────┼─────────────────────────────┤
87       │Stability Level              │Obsolete                     │
88       └─────────────────────────────┴─────────────────────────────┘
89

SEE ALSO

91       attributes(5), attach(9E), probe(9E), ddi_iopb_alloc(9F),  makecom(9F),
92       scsi_dmaget(9F),  scsi_ifgetcap(9F),  scsi_pktalloc(9F), scsi_poll(9F),
93       scsi_probe(9F), scsi_device(9S)
94
95
96        ANSI Small Computer System Interface-2 (SCSI-2)
97
98
99       Writing Device Drivers
100

NOTES

102       The scsi_slave() function is obsolete and will  be  discontinued  in  a
103       future release. This function has been replaced by scsi_probe(9F).
104
105
106
107SunOS 5.11                        27 Sep 2002                   scsi_slave(9F)
Impressum