• No results found

READ BUFFER command

In document SCSI Commands Reference Manual (Page 142-146)

REGISTER AND MOVE

3.24 READ BUFFER command

3.24.1 READ BUFFER command introduction

The READ BUFFER command (see table 91) is used in conjunction with the WRITE BUFFER command as a diagnostic function for testing memory in the SCSI device and the integrity of the service delivery subsystem.

This command shall not alter the medium.

MODE field

The function of this command and the meaning of fields within the CDB depend on the contents of the MODE field. The

MODE field is defined in table 92.

If the mode is not set to one, the ALLOCATION LENGTH field is defined in 2.1.4.5.

Note. a Combined header and data mode (00h) In this mode, a four-byte header followed by data bytes is returned to the application client in the Data-In Buffer. The allocation length should be set to four or greater. The BUFFER ID and the BUFFER OFFSET fields are reserved.

Table 91 — READ BUFFER command Bit

Byte

7 6 5 4 3 2 1 0

0 OPERATION CODE (3Ch)

1 Reserved MODE

2 BUFFER ID

3 (MSB) BUFFER OFFSET

4 (LSB)

5 (MSB) ALLOCATION LENGTH

6 (LSB)

7 CONTROL

Table 92 — READ BUFFER MODE field MODE Description

00h Combined header and data a 01h Vendor specific a

02h Data

03h Descriptor

0Ah Echo buffer

0Bh Echo buffer descriptor

1Ah Enable expander communications protocol and Echo buffer 04h - 09h Reserved

0Ch - 19h Reserved 1Bh - 1Fh Reserved

a Modes 00h and 01h are not recommended.

The four-byte READ BUFFER header (see table 93) is followed by data bytes from the buffer.

BUFFER CAPACITY field

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. The relationship between the BUFFER CAPACITY field and the CDB ALLOCATION LENGTH field is defined in 2.1.4.5. Following the READ BUFFER header, the device server shall transfer data from the buffer.

3.24.1.1 Vendor specific mode (01h)

In this mode, the meanings of the BUFFER ID, BUFFER OFFSET, and ALLOCATION LENGTH fields are not specified by the standard.

3.24.1.2 Data mode (02h)

In this mode, the Data-In Buffer is filled only with logical unit buffer data. The BUFFER ID field specifies a buffer within the logical unit from which data shall be transferred. Seagate assigns buffer ID codes to buffers within the logical unit. Buffer ID zero shall be supported. If more than one buffer is supported, then additional buffer ID codes shall be assigned contiguously, beginning with one. Buffer ID code assignments for the READ BUFFER command shall be the same as for the WRITE BUFFER command. If an unsupported buffer ID code is selected, then the command shall be terminated with CHECK CONDITION status, with the sense key set to ILLEGAL REQUEST, and the additional sense code set to INVALID FIELD IN CDB.

The BUFFER OFFSET field contains the byte offset within the specified buffer from which data shall be trans-ferred. The application client should conform to the offset boundary requirements returned in the READ BUFFER descriptor (see 3.24.1.3). If the device server is unable to accept the specified buffer offset, the com-mand shall be terminated with CHECK CONDITION status, with the sense key set to ILLEGAL REQUEST, and the additional sense code set to INVALID FIELD IN CDB.

3.24.1.3 Descriptor mode (03h)

In this mode, a maximum of four bytes of READ BUFFER descriptor information is returned. The device server shall return the descriptor information for the buffer specified by the BUFFER ID field (see the description of the buffer ID in 3.24.1.2). If there is no buffer associated with the specified buffer ID, the device server shall return all zeros in the READ BUFFER descriptor. The BUFFER OFFSET field is reserved in this mode. The allocation length should be set to four or greater. The READ BUFFER descriptor is defined as shown in table 94.

OFFSET BOUNDARY field

The OFFSET BOUNDARY field returns the boundary alignment within the selected buffer for subsequent WRITE BUFFER and READ BUFFER commands. The value contained in the OFFSETBOUNDARY field shall be interpreted as a power of two.

Table 93 — READ BUFFER header Bit

BUFFER OFFSET field

The value contained in the BUFFER OFFSET field of subsequent WRITE BUFFER and READ BUFFER com-mands should be a multiple of 2offset boundary as shown in table 95.

BUFFER CAPACITY field

The BUFFER CAPACITY field shall return the size of the selected buffer in bytes.

Note. In a system employing multiple application clients, a buffer may be altered between the WRITE BUFFER and READ BUFFER commands by another application client. Buffer testing applications should ensure that only a single application client is active. Use of reservations to all logical units on the device or linked commands may be helpful in avoiding buffer alteration between these two commands.

3.24.1.4 Echo buffer mode (0Ah)

In this mode the device server transfers data to the application client from the echo buffer that was written by the most recent WRITE BUFFER command with the mode field set to echo buffer received on the same I_T nexus. The READ BUFFER command shall return the same number of bytes of data as received in the prior WRITE BUFFER command with the mode field set to echo buffer, limited by the allocation length. The BUFFER ID and BUFFER OFFSET fields are ignored in this mode.

If no WRITE BUFFER command with the mode set to echo buffer received on this I_T nexus has completed without an error, then the READ BUFFER command shall terminate with CHECK CONDITION status, with the sense key set to ILLEGAL REQUEST, and the additional sense code set to COMMAND SEQUENCE ERROR.

If the data in the echo buffer has been overwritten by another I_T nexus, the READ BUFFER command shall be terminated with CHECK CONDITION status, with the sense key set to ABORTED COMMAND, and the additional sense code set to ECHO BUFFER OVERWRITTEN.

After a WRITE BUFFER command with the mode set to echo buffer has completed without an error, the appli-cation client may send multiple READ BUFFER commands with the mode set to echo buffer in order to read the echo buffer data multiple times.

Table 94 — READ BUFFER descriptor Bit

Table 95 — Buffer offset boundary

Offset boundary 2Offset boundary Buffer offsets

0h 20 = 1 Byte boundaries

1h 21 = 2 Even-byte boundaries

2h 22 = 4 Four-byte boundaries

3h 23 = 8 Eight-byte boundaries

4h 24 = 16 16-byte boundaries

. . .

FFh Not applicable 0 is the only supported buffer offset

3.24.1.5 Echo buffer descriptor mode (0Bh)

In this mode, a maximum of four bytes of READ BUFFER descriptor information is returned. The device server shall return the descriptor information for the echo buffer. If there is no echo buffer implemented, the device server shall return all zeros in the READ BUFFER descriptor. The BUFFER ID field and BUFFEROFFSET field are reserved in this mode. The allocation length should be set to four or greater. The READ BUFFER descrip-tor is defined as shown in table 96.

BUFFER CAPACITY field

The BUFFER CAPACITY field shall return the size of the echo buffer in bytes aligned to a four-byte boundary. The maxi-mum echo buffer size is 4 096 bytes.

If the echo buffer is implemented, the echo buffer descriptor shall be implemented.

EBOS bit

1 An echo buffer overwritten supported (EBOS) bit set to one indicates either:

a) The device server returns the ECHO BUFFER OVERWRITTEN additional sense code if the data being read from the echo buffer is not the data previously written by the same I_T nexus, or

b) The device server ensures echo buffer data returned to each I_T nexus is the same as that previously written by that I_T nexus.

0 An EBOS bit set to zero specifies that the echo buffer may be overwritten by any intervening command received on any I_T nexus.

A READ BUFFER command with the mode set to echo buffer descriptor may be used to determine the echo buffer capacity and supported features before a WRITE BUFFER command with the mode set to echo buffer is sent.

3.24.1.6 Enable expander communications protocol and Echo buffer (1Ah)

Receipt of a READ BUFFER command with this mode (1Ah) causes a communicative expander (see SPI-5) to enter the expanded communications protocol mode. Device servers in SCSI target devices that receive a READ BUFFER command with this mode shall process it as if it were a READ BUFFER command with mode 0Ah (see 3.24.1.4).

Table 96 — Echo buffer descriptor Bit

Byte

7 6 5 4 3 2 1 0

0 Reserved EBOS

1 Reserved

2 Reserved (MSB)

3 BUFFER CAPACITY (LSB)

In document SCSI Commands Reference Manual (Page 142-146)