Specifications
ATAPI For Streaming Tape QIC-157 Rev B
6
Data transfers may be accomplished in more ways than are described by this specification, but the
sequences described in this specification shall be used to remain compatible with current and future
ATAPI Devices.
2.3. Status Register Utilization for Packet Commands
See 3.6 ATAPI Register Map (Packet Command) on page 19 for a description of the register
definition.
2.4. Byte Count Register (Cylinder Low/High) Usage for Packet Commands
This register is used to control the number of bytes the Host shall transfer at each DRQ. It is only
used for the command parameter data being transferred via PIO and never for DMA or Command
Packet bytes.
Since the length of data that is actually transferred to and from an ATAPI Device using PIO is
controlled by the Host, and since the ATAPI Device needs to be able to control the number of bytes
transferred, an additional capability was needed. By using the Byte Count Register, a capability to
transfer a variable number of bytes has been created. In ATAPI the Device indicates to the Host the
number of bytes that shall be transferred on each DRQ Interrupt. Before transferring data, the Host
shall read the 16-bit Byte Count Register, and comply with the length requested. Both the ATAPI
Device and the Host will have their own byte counts and will transfer until those counts go to zero.
For some commands, such as MODE SENSE, the Host does not know the amount of data that will
be transferred, and shall rely on the Byte Count supplied by the Device to transfer the correct
amount of data.
When using DMA to transfer data, the Byte Count Register is not used and will contain unspecified
data.
A further capability of the Byte Count Register is for the Host to signal to the ATAPI Device the
maximum amount of data it can take in a single PIO DRQ packet or the preferred PIO DRQ packet
size. For all commands that require data be transferred, the Host shall set the Byte Count Register to
the desired length before issuing the Packet Command. This length shall be used by the ATAPI
Device as the maximum size for each PIO data packet. The Device can choose to transfer PIO DRQ
packets smaller than those set by the Host in the Byte Count Register. The smallest maximum byte
count that the host can specify is 512, and devices that transfer 512 bytes or less per DRQ may
ignore this field.
For all commands that can transfer all the data in one DRQ Interrupt, the Byte Count shall contain
the total data length. When a Read command is being processed, the ATAPI Device may wish to
send all the data that is available in its buffers on just one DRQ Interrupt, with the limitation that
only 65535 bytes may be transferred at one time.