EINVAL
Attempted to run an open subroutine for a device instance, but either a wrong
open flag was used, or the device is not yet configured.
EIO
An I/O error occurred.
ENOMEM
The SSA device does not have enough memory resources.
close Subroutine
The close subroutine deallocates resources that are local to the target device driver for
the target or initiator device. No commands are sent to the device as a result of running
the close subroutine.
Possible return values for the errno global variable include:
EINVAL
Attempted to run a close subroutine for a device instance that is not
configured or not opened.
EIO
An I/O error occurred.
EBUSY
The device is busy.
read Subroutine
Support for the read subroutine is provided only for the target-mode device. Support for
data scattering is provided through the user-mode readv or readvx subroutine, or
through the kernel-mode fp_rwuio service call. If the read subroutine is not successful,
the return value is set to -1, and the errno global variable is set to the return value from
the device driver. If the return value is something other than -1, the read operation was
successful, and the return code indicates the number of bytes that were read. The
caller should verify the number of bytes that were read. File offsets are not applicable
and are ignored for target-mode read operations.
The adapter write operations provide the boundary that determines how read requests
are controlled. If more data is received than is requested in the current read operation,
the requested data is passed to the caller, and the remaining data is retained and
returned for the next read operation for this target device. If less data is received in the
send command than is requested, the received data is passed for the read request,
and the return value indicates how many bytes were read.
If a write operation has not been completely received when a read request is made, the
request blocks and waits for data. However, if the target device is opened with the
O_NDELAY flag set, the read does not block; it returns immediately. If no data is
available for the read request, the read is not successful, and the errno global variable
is set to EAGAIN. If data is available, it is returned. The return value indicates the
number of bytes that were received, whether the write operation for this data has ended
or not.
Note: If the O_NDELAY flag is not set, the read subroutine can block for an undefined
time while it waits for data. Because, in a read operation, the data can come at
Chapter 13. Using the Programming Interface
297
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 ...