SCIOLRESET

If the SCIOLRESET_LUN_RESET flag is not set in the flags field of the scsi_sciolst, then this operation causes an FCP or iSCSI device, clear all current commands, and return to an initial state by issuing a Target Reset, which resets all LUNs associated with the specified FCP ID or iSCSI device's SCSI ID alias. If, for an FCP or iSCSI device the SCIOLRESET_LUN_RESET flag is set in the flags field of the scsi_sciolst, then this operation causes an FCP or iSCSI device to clear all current commands, and return to an initial state by issuing a Lun Reset, which resets just the specified LUN associated with the specified FCP ID or iSCSI device's SCSI ID alias. For the SAS transport type, the Target Reset command is not defined; and thus for SAS, this ioctl always results in Lun Reset being issued without regard to the SCIOLRESET_LUN_RESET flag setting.

Note: Both the Target and LUN reset commands that are generated by the SCIOLRESET ioctl causes a device that honors a standard SCSI reservation to release that reservation. Whether a device driver for the device reestablishes the standard SCSI reservation is based on the following conditions:
  • The configuration attributes of the device
  • The condition when the reservation is initially established
  • The mode in which the device is opened
The following is a typical call:

        rc = fp_ioctl(fp, SCIOLRESET, &sciolst);

where fp is a pointer to a file structure and sciolst is a scsi_sciolst structure (defined in /usr/include/sys/scsi_buf.h) that contains the SCSI ID or iSCSI device's SCSI ID alias, and Logical Unit Number (LUN) ID values of the device to be started.

A nonzero return value indicates an error has occurred. Possible errno values are:

Item Description
EIO An unrecoverable system error has occurred.
EINVAL The device is not opened.
EACCES The adapter is in diagnostics mode.
ETIMEDOUT The operation did not complete before the time-out value was exceeded.
For all transport types, the version field of the scsi_sciolst structure must be set to a minimum value of 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.

This operation requires SCIOLSTART to be run first.

If the FCP SCIOLRESET ioctl operation completes successfully, then the adap_set_flags field might have the SCIOL_RET_ID_ALIAS 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.