Closed erichelgeson closed 2 years ago
you are right, the documentation:
WRITE_BUFFER
MODE_COMBINED_HEADER_DATA (0h)
In this mode, data to be transferred is preceded by a four-byte header. The four-byte header consists of all reserved bytes.
The PARAMETER LIST LENGTH field specifies the maximum number of bytes that shall be transferred from the Data-Out Buffer. This number includes four bytes of header, so the data length to be stored in the device server’s buffer is parameter list length minus four. The application client should attempt to ensure that the parameter list length is not greater than four plus the BUFFER CAPACITY field value that is returned in the header of the READ BUFFER command (mode 0h).
READ_BUFFER MODE_COMBINED_HEADER_DATA (0h) The four-byte READ BUFFER header is followed by data bytes from the buffer. The BUFFER CAPACITY field specifies the total number of data bytes available in the buffer. The buffer capacity is not reduced to reflect the actual number of bytes written using the WRITE BUFFER command with combined header and data mode. Following the READ BUFFER header, the device server shall transfer data from the buffer
Thanks to @marcelv-3 for the code for SCSI Read & Write Buffer.
Trivial impl of ReZero Unit & Send Diagnostic