A device for controlling data communication flow to a data buffer of an
integrated circuit is disclosed. The device receives data communicated
from a transmitting device. The received data is placed in a data buffer
in memory. The data buffer is defined by a set of buffer descriptors,
whereby a number of free buffer descriptors in the set of buffer
descriptors is indicative of the amount of free space in the data buffer.
A communications controller determines whether the data buffer is subject
to overflowing by determining when the number of free buffer descriptors
moves below a threshold level (a watermark). The communications
controller sends a request to the transmitting device to stop
transmitting data in response to determining that the data buffer is
possibly subject to an overflow condition, indicating that the data
buffer is nearly full.