An apparatus and method for maintaining a circular FIFO (first-in,
first-out) queue in an I/O (input-output) subsystem of a computer system
such as a server, workstation, or storage machine. The queue is coupled
to a bypass circuit, used to provide access to data items out of the
order in which they were stored in the queue, thus bypassing the latency
inherent in retrieving the items from the queue. Control logic maintains
write and read pointers indicating locations in the queue for writing and
reading data items. The write pointer is incremented upon every data
event to the queue, thereby maintaining a history of data that has been
written to the queue, which is useful for diagnostic purposes. A history
flag is maintained to indicate whether the write pointer has wrapped
around the addresses in the queue, indicating whether all data items in
the queue are valid for diagnostic purposes.