HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man7/!!!intro.7
________________________________________________________________
___ ___
s
scsi_ctl(7) scsi_ctl(7)
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 command
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 manage-
ment 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 com-
mands 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 operations.
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 duration 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;
unsigned data_length;
unsigned max_msecs;
unsigned data_xfer;
unsigned cdb_status;
unsigned char sense[256];
HP-UX Release 11i: December 2000 − 5 − Section 7−−119
___
___