The host bus adapter driver allocates and initializes a scsi_device(9S) structure for the target driver before either the probe(9E) or attach(9E) routine is called. This structure stores information about each SCSI logical unit, including pointers to information areas that contain both generic and device-specific information. There is one scsi_device(9S) structure for each logical unit attached to the system. The target driver can retrieve a pointer to this structure by calling ddi_get_driver_private(9F).
Because the host bus adapter driver uses the private field in the target device's dev_info structure, target drivers must not use ddi_set_driver_private(9F).
The scsi_device(9S) structure contains the following fields:
struct scsi_device { struct scsi_address sd_address; /* opaque address */ dev_info_t *sd_dev; /* device node */ kmutex_t sd_mutex; void *sd_reserved; struct scsi_inquiry *sd_inq; struct scsi_extended_sense *sd_sense; caddr_t sd_private; };
Data structure that is passed to the SCSI resource allocation routines.
Pointer to the target's dev_info structure.
Mutex for use by the target driver. This is initialized by the host bus adapter driver and can be used by the target driver as a per-device mutex. Do not hold this mutex across a call to scsi_transport(9F) or scsi_poll(9F). See Chapter 3, Multithreading for more information on mutexes.
Pointer for the target device's SCSI inquiry data. The scsi_probe(9F) routine allocates a buffer, fills it in with inquiry data, and attaches it to this field.
Pointer to a buffer to contain SCSI request sense data from the device. The target driver must allocate and manage this buffer itself; see "attach(9E)".
Pointer field for use by the target driver. It is commonly used to store a pointer to a private target driver state structure.