
7.0 Packet Reception
(Continued)
for storing packets is controlled by Buffer Management Log-
ic in the NIC. The Buffer Management Logic provides three
basic functions: linking receive buffers for long packets, re-
covery of buffers when a packet is rejected, and recircula-
tion of buffer pages that have been read by the host.
At initialization, a portion of the 64k byte (or 32k word) ad-
dress space is reserved for the receive buffer ring. Two
eight bit registers, the Page Start Address Register
(PSTART) and the Page Stop Address Register (PSTOP)
define the physical boundaries of where the buffers reside.
The NIC treats the list of buffers as a logical ring; whenever
the DMA address reaches the Page Stop Address, the DMA
is reset to the Page Start Address.
INITIALIZATION OF THE BUFFER RING
Two static registers and two working registers control the
operation of the Buffer Ring. These are the Page Start Reg-
ister, Page Stop Register (both described previously), the
Current Page Register and the Boundary Pointer Register.
The Current Page Register points to the first buffer used to
store a packet and is used to restore the DMA for writing
status to the Buffer Ring or for restoring the DMA address in
the event of a Runt packet, a CRC, or Frame Alignment
error. The Boundary Register points to the first packet in the
Ring not yet read by the host. If the local DMA address ever
reaches the Boundary, reception is aborted. The Boundary
Pointer is also used to initialize the Remote DMA for remov-
ing a packet and is advanced when a packet is removed. A
simple analogy to remember the function of these registers
is that the Current Page Register acts as a Write Pointer and
the Boundary Pointer acts as a Read Pointer.
Note 1:
At initialization, the Page Start Register value should be loaded into
both the Current Page Register and the Boundary Pointer Register.
Note 2:
The Page Start Register must not be initialized to 00H.
Receive Buffer Ring At Initialization
TL/F/8582–30
BEGINNING OF RECEPTION
When the first packet begins arriving the NIC begins storing
the packet at the location pointed to by the Current Page
Register. An offset of 4 bytes is saved in this first buffer to
allow room for storing receive status corresponding to this
packet.
Received Packet Enters Buffer Pages
TL/F/8582–31
LINKING RECEIVE BUFFER PAGES
If the length of the packet exhausts the first 256 byte buffer,
the DMA performs a forward link to the next buffer to store
the remainder of the packet. For a maximal length packet
the buffer logic will link six buffers to store the entire packet.
Buffers cannot be skipped when linking, a packet will always
be stored in contiguous buffers. Before the next buffer can
be linked, the Buffer Management Logic performs two com-
parisons. The first comparison tests for equality between
the DMA address of the next buffer and the contents of the
Page Stop Register. If the buffer address equals the Page
Stop Register, the buffer management logic will restore the
DMA to the first buffer in the Receive Buffer Ring value
programmed in the Page Start Address Register. The sec-
ond comparison tests for equality between the DMA ad-
dress of the next buffer address and the contents of the
Boundary Pointer Register. If the two values are equal the
reception is aborted. The Boundary Pointer Register can be
used to protect against overwriting any area in the receive
buffer ring that has not yet been read. When linking buffers,
buffer management will never cross this pointer, effectively
avoiding any overwrites. If the buffer address does not
match either the Boundary Pointer or Page Stop Address,
the link to the next buffer is performed.
Linking Buffers
Before the DMA can enter the next contiguous 256 byte
buffer, the address is checked for equality to PSTOP and to
the Boundary Pointer. If neither are reached, the DMA is
allowed to use the next buffer.
Linking Receive Buffer Pages
1) Check for
e
to PSTOP
2) Check for
e
to Boundary
TL/F/8582–32
8