Specifications
ATAPI For Streaming Tape QIC-157 Rev B
35
which the Host specifies the size of a logical block for transfer and not the method of recording
physical blocks on the medium. However, for this specification, Devices only support either fixed-
length physical or logical blocks of 512 or 1024 bytes. The length of a logical block is always
described in bytes. The length of a physical block may or may not be recorded as an exact byte count,
depending on the format but the data shall be in blocks of 512 or 1024 bytes.
5.4. Data Buffering
An ATAPI Device contains a temporary storage area capable of holding one or more logical blocks - a
data buffer. A Streaming Tape Device data buffer may include any combination of blocks and
filemarks in the process of being written to the medium, or it may contain read-ahead data blocks
transferred from the medium. (See 2.15 ATAPI Command Protocol and DSC Handling, page15).
A Device will return “Good” status for read and write operations when all data has been successfully
transferred to/from the Host from/to the Device data buffer. The Host should only attempt to send read
or write commands when the data buffer is able to immediately transfer the data, indicated by DSC set
to 1. Otherwise, the command will wait for data to be transferred between the internal buffer and the
medium and prevent the bus from being used on a different device.
The ability of the Device to immediately transfer data is determined by the DSC bit in the Status
Register. The number of blocks that can be transferred without causing a command delay is
determined by the Capabilities and Mechanical Status Page (2Ah).
A read operation is initiated by a READ command with a zero transfer length to start filling the buffer
with read-ahead data without holding the bus. The DSC bit within the Status Register will be set when
the number of blocks, as determined by the Capabilities and Mechanical Status Page, are ready to be
transferred with a read operation.
A WRITE FILEMARK command will not set DSC until all buffered write blocks and filemarks are
transferred to the medium. Upon successful completion of this process, which is called a synchronize
operation, no blocks or filemarks remain in the data buffer. A synchronize operation has no effect on a
data buffer which contains only read-ahead data.
Should an unrecoverable write error occur, the Device generates an error condition to the current
active command. If no command is active, the error shall be reported on the next applicable operation
as a deferred error. Any data within the Device's buffer not written will be lost but this is only after a
catastrophic write failure. The Read Position command may be used to determine the number of
buffered blocks not written including the block in error before the unrecoverable error was
encountered (if buffered blocks is optionally implemented in Read Position).
A Device with read-ahead data blocks in the data buffer does not report an unrecovered read error
until the data block in error is requested by the Host.
5.5. Recorded Element Descriptors (Block Identifiers)
Some recording formats specify that recorded elements (blocks and filemarks) have identifiers
included in the recorded information to help determine write sequence and also to help detect Device
positioning errors. The identifier values are unique within a partition and may be unique within a
volume.
The use of the term block identifier may imply some arithmetic sequence applied to the assignment of
recorded elements. The block identifier assignment algorithm may be defined in an applicable format
standard.