Ne2000: Difference between revisions

Jump to navigation Jump to search
m
replaced bold with <tt> in some places
[unchecked revision][unchecked revision]
(Fixed links)
m (replaced bold with <tt> in some places)
Line 8:
The Ne2000 network card uses two ''ring buffers'' for packet handling. These are circular buffers made of 256-byte ''pages'' that the chip's [[DMA]] logic will use to store received packets or to get received packets.
 
Note that a packet will '''always''' start on a page boundary, thus there may be unused
bytes at the end of a page.
 
==== Ring Buffer ====
 
Two registers <tt>PSTART</tt> and <tt>PSTOP</tt> define a set of 256-byte pages in the ''buffer memory'' that will be used for the ring buffer. As soon as the DMA attempts to read/write to <tt>PSTOP</tt>, it will be sent back to <tt>PSTART</tt>
 
PSTART PSTOP
Line 68:
The following sequence is the one observed by the ''ne2k-pci'' module in linux. Note that some odd cards needs a patch (read-before-write) that isn't covered here. The ''data configuration'' is initialized at 0x49 (word transfer, 8086 byte order, dual 16bit DMA, loopback disabled). Note that the weird driver doesn't seem to use interrupts for completion notification.
 
# '''<tt>COMMAND'''</tt> register set to ''"start''" and ''"nodma''" (0x22)
# '''<tt>RBCRx'''</tt> are loaded with the packet size
# ''"Remote DMA complete?''" bit is cleared by writing a 1 in bit 6 of '''<tt>ISR'''</tt> (that's odd, but that's the way it works)
# '''<tt>RSARx'''</tt> are loaded with 000x00 (low) and target page number (high) respectively. At this stage, the chip is ready receiving packet data and storing it in the ring buffer for emission.
# '''<tt>COMMAND'''</tt> register set to ''"start''" and ''"remote write DMA''" (0x12)
# Packets data is now written to the ''"data port''" (that is register 0x10) of the NIC in a loop (or using an ''"outsx''" if available). The NIC will then update its remote DMA logic after each written word/dword and places bytes in the transmit ring buffer.
# Poll '''<tt>ISR'''</tt> register until bit 6 (Remote DMA completed) is set.
 
== ISA configuration information ==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu