Patent ID: 7818479

Claim:
A device interface apparatus having a physical layer, a link layer, a transport layer and an application layer, for transferring commands and data in packet format by serial transmission between a device and a host, the interface apparatus comprising: a receive FIFO disposed at the transport layer and configured to store on a first-in first-out basis a command packet or a data packet received from the host via the physical layer and the link layer; a command detector configured to detect the command packet stored in the receive FIFO during data transfer and to output a command detection signal; a receive task file register disposed at the application layer and configured to load the command content of the receive FIFO; a send task file register disposed at the application layer and configured to load a command or data for packet sending; a send FIFO disposed at the transport layer and configured to store on a first-in first-out basis the content of the send task file register, the send FIFO causing a command packet or a data packet to be sent to the host via the link layer and the physical layer; an available time generator configured to generate an available time for receiving another command packet from the host during data transfer; and a mid-transfer command processor unit, when a command packet is received from the host during the available time, configured to suspend the data transfer to decode the received command packet for execution of processing and thereafter to resume the data transfer; wherein the mid-transfer command processor comprises a firmware implemented by execution of a program, and wherein the mid-transfer command processor comprises: a suspend processor, when the command detection signal is output from the command detector for the command packet received during the available time and stored in the receive FIFO, configured to suspend the currently executed data transfer and to save parameters upon the suspension into a memory; a command decoder configured to decode the command content loaded from the receive FIFO into the receive task file register; a data transfer abort module, when abortion of the data transfer is determined by the command decoder, configured to discard the currently executed command packet and the saved parameters and to terminate the data transfer; and a transfer resume module, when continuance of the data transfer is determined by the command decoder, configured to throw the command content of the receive task file register into a command queue, to store command reception response information into the send FIFO and sending a command reception response packet to the host via the link layer and the physical layer, the transfer resume module configured to thereafter release the suspend of the data transfer and to set the saved parameters to resume the data transfer.