Runs a SCSI request sense command and returns the sense data to the user.
The TMGETSENS ioctl operation runs a SCSI request sense command and returns the sense data to the user. This operation is allowed only for the initiator-mode device. It is issued by the caller in response to a write subroutine errno global variable set to a value of ENXIO. This operation must be the next command issued to the device for this initiator or the sense data is lost. The arg parameter to the ioctl operation is the address of the tm_get_sens structure defined in the /usr/include/sys/tmscsi.h file. The caller must supply the address and length of a buffer used for holding the returned device-sense data in this structure. The maximum length for request-sense data is 255 bytes. The caller should refer to the SCSI specification for the target device to determine the correct length for the device's request-sense data. The lesser of either the sense data length requested or the actual sense data length is returned in the buffer passed by the caller. For the definition of the returned data, refer to the detailed SCSI specification for the device in use.
After each TMGETSENS operation, the target-mode device driver generates the appropriate errno global variable. If an error occurs, the return value is set to a value of -1 and the errno global variable is set to the value generated by the target-mode device driver. The device driver also updates a status area that is kept for the last command to each device. For certain errors, and upon successful completion, the caller can read this status area to get more detailed error status for the command. The TMIOSTAT operation can be used for this purpose. The errno global variables covered by this status include EIO, EBUSY, ENXIO, and ETIMEDOUT.
Item | Description |
---|---|
/dev/tmscsi0, /dev/tmscsi1,..., /dev/tmscsin | Support processor-to-processor communications through the SCSI target-mode device driver. |