IBM Advanced SerialRAID Adapters SA33-3285-02 User Manual page 318

Advanced serialraid adapters
Table of Contents

Advertisement

If the calling program wants to break a blocked read subroutine, the program can
generate a signal. The target-mode device driver receives the signal and ends the
current read subroutine. If no bytes were read, the errno global variable is set to
EINTR; otherwise, the return value indicates the amount of data that was read before
the interrupt occurred. The read operation returns with whatever data has been
received, whether the write operation has completed or not. If the remaining data for the
write operation is received, it is put into a queue, where it waits for either another read
request or a close command. When the target receives the signal and the current read
is returned, another read operation can be started, or the target can be closed. If the
read request that the calling program wants to break ends before the signal is
generated, the read operation ends normally, and the signal is ignored.
The target-mode device driver attempts to queue received data in front of requests from
the application program. A read-ahead buffer area is used to store the queued data.
The length of this read-ahead buffer is determined by multiplying the value of the
RecvBufferSize attribute by the value of the RecvBuffers attribute. These values are
in the configuration database. While the application program runs read subroutines, the
queued data is copied to the application data buffer, and the read-ahead buffer space is
again made available for received data. If an error occurs while he data is being copied
to the caller data buffer, the read operation fails, and the errno global variable is set to
EFAULT. If the read subroutines are not run quickly enough to fill almost all the
read-ahead buffers for the device, data reception is delayed until the application
program runs a read subroutine again. When enough area is freed, data reception
capability is restored from the device. Data might be delayed, but it is not lost or
ignored.
The target-mode device driver controls only received data into its read entry point. The
read entry point can optionally be used with the select entry point to provide a means of
asynchronous notification of received data on one or more target devices.
Possible return values for the errno global variable include:
EAGAIN
EFAULT
EINTR Interrupted by a signal.
EINVAL
EIO
298
User's Guide and Maintenance Information
any time, the device driver does not maintain an internal timer to interrupt the
read. Therefore, if a time-out function is required, it must be started by the
calling program.
Indicates that a nonblocking read request would have blocked, because data is
available.
An error occurred while copying data to the caller buffer.
Attempted to run a read operation for a device instance that is not configured,
not open, or is not a target-mode minor device number.
An I/O error occurred.

Advertisement

Table of Contents
loading

Table of Contents