Data Structures for Drivers scsidevice(9S)
NAME
scsidevice - SCSI device structure
SYNOPSIS
#include
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
DESCRIPTION
The scsidevice structure stores common information about
each SCSI logical unit, including pointers to areas that
contain both generic and device specific information. There
is one scsidevice structure for each logical unit attached
to the system. The host adapter driver initializes part of
this structure prior to probe(9E) and destroys this struc-
ture after a probe failure or successful detach(9E).
STRUCTURE MEMBERS
struct scsiaddress sdaddress; /* Routing info. */
devinfot *sddev; /* Cross-ref. to */
/* devinfot */
kmutext sdmutex; /* Mutex for this dev. */
struct scsiinquiry *sdinq; /* scsiinquiry data struc. */
struct scsiextendedsense *sdsense; /* Optional request */
/* sense buffer ptr */
caddrt sdprivate; /* Target drivers
private data */
sdaddress contains the routing information that the target
driver normally copies into a scsipkt(9S) structure using
the collection of makecom(9F) functions. The SCSA library
routines use this information to determine which host
adapter, SCSI bus, and target/logical unit number (lun) a
command is intended for. This structure is initialized by
the host adapter driver.
sddev is a pointer to the corresponding devinfo structure.
This pointer is initialized by the host adapter driver.
sdmutex is a mutual exclusion lock for this device. It is
used to serialize access to a device. The host adapter
driver initializes this mutex. See mutex(9F).
sdinq is initially NUL (zero). After executing
scsiprobe(9F), this field contains the inquiry data
SunOS 5.11 Last change: 19 Feb 1993 1
Data Structures for Drivers scsidevice(9S)
associated with the particular device.
sdsense is initially NUL (zero). If the target driver
wants to use this field for storing REQUEST SENSE data, it
should allocate an scsiextendedsense(9S) buffer and set
this field to the address of this buffer.
sdprivate is reserved for the use of target drivers and
should generally be used to point to target specific data
structures.
SEE ALSO
detach(9E), probe(9E), makecom(9F), mutex(9F),
scsiprobe(9F), scsiextendedsense(9S), scsipkt(9S)
Writing Device Drivers
SunOS 5.11 Last change: 19 Feb 1993 2
|