HP-UX Reference (11i v2 03/08) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

s
scsi_ctl(7) scsi_ctl(7)
sctl_io.sense_status == S_GOOD &&
sctl_io.sense_xfer>2&&
(sctl_io.sense[2] & 0x0F) == 2)) /* can use sense_data */
{
/* device is not ready */
}
else
{
/* unknown state */
}
WARNINGS
Incorrect use of
scsi_ctl operations (even those attempting access to non-existent devices) can cause
data loss, system panics, and device damage.
The
SIOC_EXCLUSIVE
ioctl should be used to gain exclusive access to a device prior to attempting
SIOC_IO commands. If exclusive access is not obtained,
SIOC_IO commands will be intermixed with
device-specific driver commands, which can lead to undesirable results.
Device-specific drivers can reject inappropriate or troublesome
SIOC_IO commands. However, since not
all such operations are known and detected, care should be exercised to avoid disrupting device-specific
drivers when using commands that modify internal device states.
It is very easy to cause system deadlock through incorrect use of the
SIOC_PRIORITY_MODE
ioctl. Nor-
mally it is necessary to lock the calling process into memory (see plock(2)) prior to enabling priority mode.
Most
SCSI commands have a logical unit number (LUN) field. Parallel
SCSI implementations on the HP-UX
operating system select logical units via the SCSI IDENTIFY message. The LUN portion of the cdb should
normally be set to zero, even when the LUN being accessed is not zero.
Use of linked commands is not supported.
Most
SCSI commands with a data phase expect the data length information to be included somewhere in
the command bytes. Both the data_length field and any cdb data length values must be correctly
specified to get correct command results.
Very large (or infinite) timeout values can cause a parallel
SCSI bus (potentially the entire system) to
hang.
Device and/or bus reset operations can be used to regain a device’s attention when a timeout expires.
Resetting a device can cause
I/O errors and/or loss of cached data. This can result in loss of data and/or
system panics.
Obtaining
SCSI INQUIRY data by use of the SIOC_INQUIRY ioctl instead of by use of the SIOC_IO
ioctl
is generally preferable since
SCSI implementations on the
HP-UX operating system synchronize access of
inquiry data during driver open calls.
Since communication parameters can be affected by device-specific driver capabilities, device-specific
driver use might result in communication parameter changes.
The
SIOC_CAPACITY ioctl is not supported by scsi_ctl because the meaning of capacity is device-
specific.
FILES
/usr/include/sys/scsi.h
/usr/include/sys/scsi_ctl.h
SEE ALSO
mknod(1M), ioctl(2), scsi(7).
Section 7140 Hewlett-Packard Company 7 HP-UX 11i Version 2: August 2003