[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 2

TMIOCMD (Direct) tmscsi Device Driver ioctl Operation

Purpose

Sends SCSI commands directly to the attached device.

Note: This operation is not supported by all SCSI I/O controllers.

Description

Attention: The TMIOCMD operation is a very powerful operation. Extreme care must be taken by the caller before issuing any general SCSI command, as this may adversely affect the attached device, other SCSI devices on the SCSI bus, or even general system availability. It should only be used when no other means are available to run the required function or functions on the attached device. This operation requires at least dev_config authority to run.

The TMIOCMD operation provides a means of sending SCSI commands directly to the attached device. This operation is only allowed for the initiator-mode device. It enables a caller to issue specific SCSI commands that are not directly supported by the device driver. The caller is responsible for any and all error recovery associated with the sending of the SCSI command. No error recovery is performed by the device driver when the command is issued. The device driver does not log errors that occur while running the command.

The arg parameter to this command specifies the address of the sc_iocmd structure defined in the /usr/include/sys/scsi.h file. The caller fills in the SCSI command descriptor block area, command length (SCSI command block length), the time-out value for the command, and a flags field. If a data transfer is involved, the data length and buffer pointer areas, as well as the B_READ flag in the flags field, must be filled in. The B_READ is set to a value of 1 to indicate the command's data transfer is incoming, and B_READ is set to a value of 0 to indicate the data is outgoing. If there is no data transfer, these fields and flags are set to 0 values.

The target-mode device driver builds the appropriate command block to execute this operation, including ORing in the 3-bit logical unit number (LUN) identifier in the SCSI command based on the configuration information for this device instance. The returned errno global variable is generated and the status validity , SCSI bus status , and adapter status fields are updated to reflect the completion status for the command. These status areas are defined in the /usr/include/sys/scsi.h file.

Files

/dev/tmscsi0, /dev/tmscsi1,..., /dev/tmscsin Support processor-to-processor communications through the SCSI target-mode device driver.

Related Information

The rmt SCSI device driver, scdisk SCSI device driver, SCSI Adapter device driver, tmscsi SCSI device driver.


[ Previous | Next | Contents | Home | Search ]