SCIOSTOPTGT (Stop Target) SCSI Adapter Device Driver ioctl Operation

Purpose

Closes a logical path to a SCSI initiator device.

Description

The SCIOSTOPTGT operation closes a logical path to a SCSI initiator device, where the host SCSI adapter acts as a target. This operation causes the adapter device driver to deallocate device-dependent information areas allocated in response to the SCIOSTARTTGT operation. It also causes the adapter device driver to deallocate system buffer areas used to hold data received from the initiator. Finally, it disables the host adapter's ability to receive data from the selected initiator.

This operation may only be called from a kernel process or device driver.

Note: This operation is not supported by all SCSI I/O Controllers. If not supported, errno is set to ENXIO and a value of -1 is returned.

The arg parameter to the SCIOSTOPTGT operation should be set to the address of an sc_stop_tgt structure, which is defined in the /usr/include/sys/scsi.h file. The caller fills in the id field with the SCSI ID of the initiator and sets the logical unit number (LUN) field to 0 as the initiator LUN is ignored for received data.

Note: The calling device driver should have previously freed any received-data areas by passing their information structures to the SCSI adapter device driver's free_func routine. All buffers allocated for this device are deallocated by the SCIOSTOPTGT operation regardless of whether the calling device driver has finished processing those buffers and has called the free_func routine.

Return Values

When completed successfully, this operation returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to one of the following values:

Item Description
EINVAL An SCIOSTOPTGT command has not been previously issued to this SCSI ID.
EPERM Indicates the caller is not running in kernel mode, which is the only mode allowed to execute this operation.

Files

Item Description
/dev/scsi0, /dev/scsi1, ... Provide an interface to allow SCSI device drivers to access SCSI devices or adapters.
/dev/vscsi0, /dev/vscsi1, ...,/dev/vscsin Provide an interface to allow SCSI-2 Fast/Wide Adapter/A and SCSI-2 Differential Fast/Wide Adapter/A device drivers to access SCSI devices or adapters.