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

SCIOREAD (Read) SCSI Adapter Device Driver ioctl Operation

Purpose

Issues a single block SCSI read command to a selected SCSI device.

Description

The SCIOREAD operation allows the caller to issue a SCSI device read command to a selected adapter. System management routines use this command for configuring SCSI devices.

The arg parameter of the SCIOREAD operation is the address of an sc_readblk structure. This structure is defined in the /usr/include/sys/scsi.h header file.

This command results in the SCSI adapter device driver issuing a 6-byte format ANSI SCSI-1 read command. The command is set up to read only a single block. The caller supplies:

The maximum block length for this command is 4096 bytes. The command will be rejected if the length is found to be larger than this value.

The SC_ASYNC flag of the flag parameter must not be set on the initial call to this operation. This flag is set only if a bus fault occurs and only if this is the caller's last retry attempt after this error occurs.

Note: The SCSI adapter device driver performs normal error-recovery procedures during execution of this command.

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:

EFAULT Indicates that a bad copy between kernel and user space occurred.
EINVAL Indicates that an SCIOSTART command was not issued prior to this command. If the SCIOSTART command was issued, then this indicates the block length field value is too large.
EIO Indicates that an I/O error has occurred. If an EIO value is returned, the caller should retry the SCIOREAD operation since the first command may have cleared an error condition with the device. In the case of an adapter error, the system error log records the adapter error status information.
ENOCONNECT Indicates that a bus fault has occurred. The caller should respond by retrying with the SC_ASYNC flag set in the flag byte of the passed parameters. If more than one retry is attempted, only the last retry should be made with the SC_ASYNC flag set. Generally, the SCSI adapter device driver cannot determine which device caused the bus fault, so this error is not logged.
ENODEV Indicates that no SCSI controller responded to the requested SCSI ID. This return value implies that no logical unit numbers (LUNs) exist on the specified SCSI ID. This condition is not necessarily an error and is not logged.
ENOMEM Indicates insufficient memory is available to complete the command.
ETIMEDOUT Indicates the adapter did not respond with status before the internal time-out value expired. The caller should retry this command at least once, since the first command may have cleared an error condition with the device. The system error log records this error.

Files

/dev/scsi0, /dev/scsi1,..., /dev/scsin Provide an interface to allow SCSI device drivers to access SCSI devices/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.

Related Information

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


[ Previous | Next | Contents | Home | Search ]