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.
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
Indicates that a nonblocking read request would have blocked, because data is
available.
EFAULT
An error occurred while copying data to the caller buffer.
EINTR
Interrupted by a signal.
EINVAL
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.
EIO
An I/O error occurred.
298
User’s Guide and Maintenance Information
Summary of Contents for Advanced SerialRAID Adapters SA33-3285-02
Page 1: ...Advanced SerialRAID Adapters User s Guide and Maintenance Information SA33 3285 02 ...
Page 2: ......
Page 3: ...Advanced SerialRAID Adapters User s Guide and Maintenance Information SA33 3285 02 ...
Page 16: ...xiv User s Guide and Maintenance Information ...
Page 18: ...xvi User s Guide and Maintenance Information ...
Page 21: ...Part 1 User Information 1 ...
Page 22: ...2 User s Guide and Maintenance Information ...
Page 48: ...28 User s Guide and Maintenance Information ...
Page 64: ...44 User s Guide and Maintenance Information ...
Page 76: ...56 User s Guide and Maintenance Information ...
Page 212: ...192 User s Guide and Maintenance Information ...
Page 228: ...208 User s Guide and Maintenance Information ...
Page 230: ...210 User s Guide and Maintenance Information ...
Page 254: ...234 User s Guide and Maintenance Information ...
Page 274: ...254 User s Guide and Maintenance Information ...
Page 330: ...310 User s Guide and Maintenance Information ...
Page 331: ...Part 2 Maintenance Information 311 ...
Page 332: ...312 User s Guide and Maintenance Information ...
Page 338: ...318 User s Guide and Maintenance Information ...
Page 430: ...410 User s Guide and Maintenance Information ...
Page 503: ...Part 3 Appendixes 483 ...
Page 504: ...484 User s Guide and Maintenance Information ...
Page 508: ...488 User s Guide and Maintenance Information ...
Page 529: ......
Page 530: ...Part Number 27H0678 Printed in the U S A SA33 3285 02 1P P N 27H0678 ...
Page 531: ...Spine information Advanced SerialRAID Adapters User s Guide and Maintenance Information ...