Patent ID: 8032674

Claim:
A storage controller that transfers data between a storage device and a host, the storage controller comprising: a buffer memory configured to store the data being transferred between the storage device and the host; a first counter; a second counter; a first channel logic connected between the buffer memory and the storage device, the first channel logic configured to increment each of the first counter and the second counter when the data is placed in the buffer memory; a serial attached small computer interface (SAS) module interfacing with the host, wherein the SAS module includes a transport module configured to i) send the data to the host and ii) decrement the second counter when the data is successfully sent to the host; a second channel logic interfacing between the SAS module and the buffer memory, wherein the second channel logic is configured to i) read the data from the buffer memory and ii) decrement the first counter when the data is read from the buffer memory; a first compare module configured to generate a first pause signal to pause each of the second channel logic and the transport module in response to the first counter reaching a first value, wherein the first value indicates that there is no data in the buffer memory; and a second compare module configured to generate a second pause signal to pause the first channel logic in response to the second counter reaching a second value, wherein the second value indicates that there is no available space in the buffer memory.