1scsi_device(9S) Data Structures for Drivers scsi_device(9S)
2
3
4
6 scsi_device - SCSI device structure
7
9 #include <sys/scsi/scsi.h>
10
11
13 Solaris DDI specific (Solaris DDI).
14
16 The scsi_device structure stores common information about each SCSI
17 logical unit, including pointers to areas that contain both generic and
18 device specific information. There is one scsi_device structure for
19 each logical unit attached to the system. The host adapter driver ini‐
20 tializes part of this structure prior to probe(9E) and destroys this
21 structure after a probe failure or successful detach(9E).
22
24 struct scsi_address sd_address; /* Routing info. */
25 dev_info_t *sd_dev; /* Cross-ref. to */
26 /* dev_info_t */
27 kmutex_t sd_mutex; /* Mutex for this dev. */
28 struct scsi_inquiry *sd_inq; /* scsi_inquiry data struc. */
29 struct scsi_extended_sense *sd_sense; /* Optional request */
30 /* sense buffer ptr */
31 caddr_t sd_private; /* Target drivers
32 private data */
33
34
35
36 sd_address contains the routing information that the target driver nor‐
37 mally copies into a scsi_pkt(9S) structure using the collection of
38 makecom(9F) functions. The SCSA library routines use this information
39 to determine which host adapter, SCSI bus, and target/logical unit num‐
40 ber (lun) a command is intended for. This structure is initialized by
41 the host adapter driver.
42
43
44 sd_dev is a pointer to the corresponding dev_info structure. This
45 pointer is initialized by the host adapter driver.
46
47
48 sd_mutex is a mutual exclusion lock for this device. It is used to
49 serialize access to a device. The host adapter driver initializes this
50 mutex. See mutex(9F).
51
52
53 sd_inq is initially NULL (zero). After executing scsi_probe(9F), this
54 field contains the inquiry data associated with the particular device.
55
56
57 sd_sense is initially NULL (zero). If the target driver wants to use
58 this field for storing REQUEST SENSE data, it should allocate an
59 scsi_extended_sense(9S) buffer and set this field to the address of
60 this buffer.
61
62
63 sd_private is reserved for the use of target drivers and should gener‐
64 ally be used to point to target specific data structures.
65
67 detach(9E), probe(9E), makecom(9F), mutex(9F), scsi_probe(9F),
68 scsi_extended_sense(9S), scsi_pkt(9S)
69
70
71 Writing Device Drivers
72
73
74
75SunOS 5.11 19 Feb 1993 scsi_device(9S)