HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
s
scsi_ctl(7) scsi_ctl(7)
S_BUSY Device indicated it is unable to accept the command because it is busy
doing other operations.
S_INTERMEDIATE
Device successfully completed this command, which is one in a series of
linked commands (not supported, see
WARNINGS
).
S_I_CONDITION_MET
Device indicated both S_INTERMEDIATE
and S_CONDITION_MET
(not
supported, see
WARNINGS
).
S_RESV_CONFLICT
Device indicated the command conflicted with an existing reservation.
S_COMMAND_TERMINATED
Device indicated the command is terminated early by the host system.
S_QUEUE_FULL Device indicated it is unable to accept the command because its com-
mand queue is currently full.
The
data_xfer field indicates the number of data bytes actually transferred during the data phase of
the cdb command. This field is valid only when the
cdb_status field contains one of the following
values:
S_GOOD or S_CHECK_CONDITION
. The sense_xfer field indicates the number of valid sense
data bytes. This field is valid only when the
cdb_status field contains the value
S_CHECK_CONDITION
and the sense_status field contains the value
S_GOOD.
The
SIOC_ABORT ioctl causes a SCSI ABORT message to be sent to the
LUN. This clears all active com-
mands to the
LUN from this initiator.
The
SIOC_RESET_DEV ioctl causes a
SCSI device to be reset (including clearing all active commands).
On parallel
SCSI a SIOC_RESET_DEV
ioctl causes a SCSI BUS DEVICE RESET message to be sent to
the associated target. On Fibre Channel a
SIOC_RESET_DEV
ioctl causes a TARGET RESET task
management function to be sent to the associated target followed by a Global Process Logout (GPRLO).
The
SIOC_RESET_BUS ioctl causes the system to generate a
SCSI bus reset condition on the associated
bus. A
SCSI bus reset condition causes all devices on the bus to be reset (including clearing all active
commands on all devices). The SIOC_RESET_BUS
ioctl does not apply to Fibre Channel.
Often it is necessary or useful to prohibit other
SCSI commands while performing device-control opera-
tions. Normally this should be done by gaining exclusive access via the SIOC_EXCLUSIVE
ioctl. The
associated argument points to an integer with one of these values:
0 release exclusive access to logical unit
1 obtain exclusive access to logical unit
2 release exclusive access to target
3 obtain exclusive access to target
4 release exclusive access to bus
5 obtain exclusive access to bus
Occasionally exclusive access not possible (for example, diagnostic operations on a device containing a
mounted file system). ‘‘Priority mode’’ causes all device-specific driver
I/O operations (e.g. file system I/O
and virtual memory page swapping) and all SCSI device driver open calls (including scsi_ctl open
calls) to the associated LUN to block. These I/O operations and open calls are blocked for the entire dura-
tion that priority mode is in effect. While priority mode is in effect only SIOC_IO operations should be
attempted (these operations will not be blocked). The SIOC_PRIORITY ioctl controls the LUN priority
mode. This ioctl is only available via the device-control driver. The value ‘‘1’’ enables priority mode. The
value zero disables priority mode.
The header file <
sys/scsi.h> has useful information for SCSI device control. The following is included
from <sys/scsi.h>:
/* SCSI device control ioctls */
#define SIOC_IO _IOWR(’S’, 22, struct sctl_io)
#define SIOC_RESET_DEV _IO(’S’, 16)
#define SIOC_RESET_BUS _IO(’S’, 9)
#define SIOC_PRIORITY_MODE _IOW(’S’, 67, int)
/* Structure for SIOC_IO ioctl */
struct sctl_io
{
unsigned flags;
unsigned char cdb_length;
unsigned char cdb[16];
void *data;
Section 7−−138 Hewlett-Packard Company − 5 − HP-UX 11i Version 2: September 2004