Specifications

ATAPI For Streaming Tape QIC-157 Rev B
5
2. ATAPI Protocol
The ATAPI Device is commanded by two methods, the original ATA Command protocol utilizing
the Task File and the new Packet Command method. For both methods, the Devices using this
interface shall be programmed by the Host to perform commands and return status to the Host at
command completion. When more than one Device is daisy chained on the interface, commands are
written in parallel to all peripherals, and for ATA commands, except the Execute Diagnostics
command, only the selected Device (DRV bit in the Drive/Head ATA Register) executes the
command. On an Execute Diagnostics command addressed to Device 0, both Devices shall execute
the command, and Device 1 shall send its status to Device 0 via PDIAG-.
The “Protocol” for ATAPI centers around the usage of a new ATA Command called “Packet
Command.” All the normal ATA rules and protocol are used to issue the Packet Command, but
once the command has been issued a new set of rules applies:
1. The interpretation of the DRQ bit in the Status Register shall be used along with the Interrupt
Reason Registers to determine the actual Interrupt Type.
2. The actual command for the Device to execute is sent as a packet via the data register, and not
the Task File.
3. Command arguments are supplied by the Command Packet as well as from the Task File.
4. A Byte Count is used to determine the amount of data the Host shall transfer at each DRQ
Interrupt.
5. The ATAPI Features Register is used to indicate when DMA will be used rather than by using
different opcodes.
6. The final status is presented to the Host as a new interrupt after the last data has been
transferred, rather than along with the last block of data.
These new rules (protocol) only apply from after the issuance of the Packet Command, until the
Completion Status has been read by the Host. After the Completion Status has been read, the Task
File Register definitions and Protocol revert to the standard ATA definition.
2.1. Initialization
The ATAPI Device shall respond just as defined in the ATA Standard. The DASP and PDIAG
signals shall be utilized following any reset condition, except the ATAPI Soft Reset command.
2.2. PACKET Command
The Packet Command is issued exactly as normal ATA commands, by initializing the Task File
Registers, setting the Device Selection Bit and writing the Command byte into the Command
Register. With normal ATA commands a DRQ (Optional Interrupt) would be generated to indicate
that the data for the command could be transferred to/from the Device. With the Packet Command,
the first DRQ indicates that the Command Packet Data shall be written to the Device. Once the
Command Packet has been sent, the command proceeds as a normal ATA command would. The
Command Packet bytes shall always be transferred via PIO and never using DMA.
ATA Packet Commands can be issued regardless of the state of the DRDY Status Bit.
If, while polling BSY, the Device remains in a state where it cannot accept a command for more
than 5 seconds, the Host shall time out and reset the Device.