scsi(7) scsi(7)
NAME
scsi - common SCSI interface
DESCRIPTION
scsi refers to a common interface used by various hardware device
drivers. Specific details of each driver are presented elsewhere in
this section; features common to them all are described here.
The drivers that use scsi facilities are:
hd Hard Disk interface
tp Streaming Tape Cartridge interface
There are 7 available SCSI targets and each target can support up to
8 SCSI logical units. The scsi driver restricts the total number of
logical units that can be handled at once to some maximum, currently
20.
The minor device is encoded as tttdddmpppp; meanings of which are as
follows:
ttt selects the SCSI target.
dddd selects the Logical Unit.
m is the magic bit.
pppp is the partition number.
The last two entries are defined by the specific device driver.
Scsi will only support access to one logical unit per SCSI target;
thus bits 5-7 of the minor device number should always be zero. This
allows the use of SCSI hardware that does not decode the logical unit
number.
The scsi driver provides a generic ioctl interface so that the user
can issue any SCSI command to a SCSI device. The user process fills
in the scsiioc structure specified below, found in
/usr/include/sys/scsi.h.
struct scsiioc {
unsigned char sjcb[10];
unsigned char sjcmdlength;
unsigned char sjdatadir;
unsigned char sjsdata[MAXSENSE];
unsigned char sjstatus;
unsigned char *sjdata;
int sjdatalength;
};
8/91 Page 1
scsi(7) scsi(7)
The fields have the following meanings:
sjcb[10]
The command to be sent to the SCSI device, i.e those bytes
transfer during the command phase.
sjcmdlength
Number of bytes in sj_cb above.
sjdatadir
Direction of data flow, 1 means the SCSI device will supply
data to the user process during the data phase, a zero
indicates that the kernel will copyout data from the user
process and supply it to the SCSI device during the data phase.
sjsdata[MAXSENSE]
If the SCSI command failed, this array will contain the sense
data returned from the SCSI device.
sjstatus
The sense byte, the data in the sj_sdata array is only valid if
this byte is set to CHECKCOND. Any non-zero value indicates
that the SCSI device rejected the command, or encounter some
error during the processing of the command.
sjdata
The address where data will be copied to/from during the data
phase.
sjdatalength
The number of data bytes to be supplied, or the size of the
sj_data array.
Currently only the hd interface supports the generic ioctl.
SEE ALSO
hd(7), tp(7).
Page 2 8/91