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

s
sioc_io(7) sioc_io(7)
SCTL_SELECT_TIMEOUT
The target device does not answer to selection by the host SCSI interface
(the device does not exist or does not respond).
SCTL_INCOMPLETE
The device answered selection but the command is not completed (the
device took too long or a communication failure occurred).
S_GOOD Device successfully completed the command.
S_CHECK_CONDITION
Device indicated sense data is available.
S_CONDITION_MET
Device successfully completed the command and the requested (search or
pre-fetch) operation is satisfied.
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.
EXAMPLES
Assume that fildes is a valid file descriptor for a SCSI device. The first example attempts a SCSI
INQUIRY command:
#include <sys/scsi.h>
struct sctl_io sctl_io;
#define MAX_LEN 255
unsigned char inquiry_data[MAX_LEN];
memset(sctl_io, 0, sizeof(sctl_io)); /* clear reserved fields */
sctl_io.flags = SCTL_READ; /* input data expected */
sctl_io.cdb[0] = 0x12; /* can use scsi.h CMDinquiry */
sctl_io.cdb[1] = 0x00;
sctl_io.cdb[2] = 0x00;
sctl_io.cdb[3] = 0x00;
sctl_io.cdb[4] = MAX_LEN; /* allocation length */
sctl_io.cdb[5] = 0x00;
sctl_io.cdb_length = 6; /* 6 byte command */
sctl_io.data = &inquiry_data[0]; /* data buffer location */
sctl_io.data_length = MAX_LEN; /* maximum transfer length */
sctl_io.max_msecs = 10000; /* allow 10 seconds for cmd */
if (ioctl(fildes, SIOC_IO, &sctl_io) < 0)
{
/* request is invalid */
}
The following example attempts a SCSI
TEST UNIT READY command and checks to see if the device is
ready, not ready, or in some other state.
#include <sys/scsi.h>
struct sctl_io sctl_io;
memset(sctl_io, 0, sizeof(sctl_io)); /* clear reserved fields */
HP-UX 11i Version 2: August 2003 2 Hewlett-Packard Company Section 7147