SCIOLTUR
This operation issues a Test Unit Ready command to an adapter and aids in device configuration.
rc = ioctl(adapter, SCIOLTUR, &ready_struct);
where adapter is a file descriptor and ready_struct is a scsi_ready structure as defined in the /usr/include/sys/scsi_buf.h header file. The FCP SCSI ID or iSCSI device's SCSI ID alias, and LUN should be placed in the scsi_ready parameter block. The status of the device can be determined by evaluating the two output fields: status_validity and scsi_status. Possible errno values are:
Item | Description |
---|---|
EIO | A system error has occurred. Consider retrying the operation
several (around three) times, because another attempt might be successful.
If an EIO error occurs and the status_validity field is set
to SC_FCP_ERROR, then the scsi_status field has a
valid value and should be inspected. If the status_validity field is zero and remains so on successive retries, then an unrecoverable error has occurred with the device. If the status_validity field is SC_FCP_ERROR and the scsi_status field contains a Check Condition status, then the SCIOLTUR operation should be retried after several seconds. If after successive retries, the Check Condition status remains, the device should be considered inoperable. |
EFAULT | A user process copy has failed. |
EINVAL | The device is not opened. |
EACCES | The adapter is in diagnostics mode. |
ENOMEM | A memory request has failed. |
ETIMEDOUT | The command has timed out. Consider retrying the operation several times, because another attempt might be successful. |
ENODEV | The device is not responding and possibly no LUNs exist on the present target. |
ENOCONNECT | A transport fault occurred. |
SCSI_VERSION_1
,
which is defined in the /usr/include/sys/scsi_buf.h file. In
addition, the following fields can be set: - world_wide_name - The caller can set the world_wide_name field to the World Wide Name of the attached target device. If Dynamic Tracking of FC devices is enabled, the world_wide_name field must be set to ensure communication with the device because the scsi_id field of a device can change after dynamic tracking events.
- node_name - The caller can set the node_name field
to the Node Name of the attached target device. If the world_wide_name field
and the version field are set to
SCSI_VERSION_1
but the node_name field is not set, the scsi_id field is used for device lookup instead of the world_wide_name. If Dynamic Tracking of FC devices is enabled, the node_name field must be set to ensure communication with the device because the scsi_id field of a device can change after dynamic tracking events.
For Virtual SCSI adapters, the version field of the scsi_sciolst structure must be set to the value of SCSI_VERSION_1 (defined in the /usr/include/sys/scsi_buf.h file). In addition, Virtual SCSI adapters require the caller to set the lun_id field to the Logical Unit Id (LUN) of the device being reset. Target Reset is not supported on vscsi devices, so the driver sends a Lun Reset regardless of the value of the SCIOLRESET_LUN_RESET flag.
This operation requires SCIOLSTART to be run first.
If the FCP SCIOLTUR ioctl operation completes successfully, then the adap_set_flags field might have the SC_RET_ID flag set. This field is set only if the world_wide_name and node_ name fields were provided in the ioctl call and the FC adapter driver detects that the scsi_id field of this device has changed. The scsi_id field contains the new scsi_id value.