scsi_ctl.7 (2010 09)

s
scsi_ctl(7) scsi_ctl(7)
abort, and device and bus reset operations. A zero value in the max_msecs field indicates that the
timeout period is infinite and the system should wait indefinitely for command completion.
When the
SIO_IO_EXT or SIOC_IO ioctl call returns, all command processing has been completed.
Most SIOC_IO_EXT/SIOC_IO ioctl calls will return zero (success). The resulting detailed ioctl data
should be used to evaluate "success" or "failure" from the caller’s perspective. The cdb_status field indi-
cates the results of the
cdb command. If the cdb_status field indicates a
S_CHECK_CONDITION
status,
the sense_status field indicates the results of the SCSI
REQUEST SENSE command used to collect the
associated sense data. These status fields will contain one of the following values:
SCTL_INVALID_REQUEST
The SCSI command request is invalid and thus not attempted.
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 reserva-
tion.
S_COMMAND_TERMINATED
Device indicated the command is terminated early by the host sys-
tem.
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_TASK_MGMT ioctl causes a SCSI task management function to be performed if supported by
the SCSI transport. The following task management function values can be specified. They are defined
in <sys/scsi.h>:
SIOC_TM_LUN_RESET Lun Reset
SIOC_TM_WARM_TGT_RESET Warm Target Reset
SIOC_TM_COLD_TGT_RESET Cold Target Reset
The
SIOC_RESET_DEV ioctl causes a SCSI device to be reset (including clearing all active commands).
On parallel SCSI a PSIOC_RESET_DEV and SIOC_RESET_DEV
ioctls cause 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. 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 defined in <sys/scsi.h>. Note that if the ioctl
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010