Ethernet
[TCP/IP Base Protocols]


Detailed Description

Description

The MAC module contains the driver software for the RTL8019AS NIC chip. It provides functions for reading and writing data from and to it. The RTL8019AS is a NE2000 compatible NIC, that implements both the Ethernet physical (PHY) and MAC layers. If a different NIC is to be used, users will need to modify or create a new "mac.c" file to implement access. As long as services provided by "mac.c" are not changed, all other modules will remain unchanged.

The stack utilizes the on-chip SRAM available on the NIC as a holding buffer, until a higher level module reads it. It also performs the necessary IP checksum calculations in the NICís SRAM buffer. In addition to the receive FIFO buffer managed by the NIC itself, the MAC layer manages its own transmit queue. Using this queue, the caller can transmit a message and request the MAC to reserve it so that the same message can be retransmitted, if required. The user can specify sizes for the transmit buffer, transmit queue and receive queue using ĎCí defines - see projdefs.h for details.

RTL8019AS Receive and Transmit buffers

The NIC has 8kbytes of RAM, devided into 256byte pages. At initialization, a group of these pages will be configured to be the RX buffer. The remaining pages are used for user RAM and for the TX buffer.
Receive
During reception, the NIC will transfer the received packet via Local DMA to the RX buffer. The user has to check if the RX buffer contains any packets, and if so, remove them via Remote DMA access (MACGetRxbuf and MACGetArray functions). One of two RTL8019AS commands can be used to retrieve received packets from the RX buffer:
Transmit
Transmission is done via writing the TX packet to a location in RAM via Remote DMA, and than setting registers in the NIC to start transmission.

MAC Receive Ring Buffer

The MAC makes all received packets available to the user via the MACGetRxbuf() and MACGetArray() functions. These functions will read the given amount of bytes from the current RX Buffer. The current receive buffer is the one we are currently reading from. The MACDiscardRx() function will free the current receive buffer.

Configuration

For details on configuring this module, see Configuration section of mac.h file.


Files

file  mac.h
 MAC Module for Modtronix TCP/IP Stack.


Generated on Mon Oct 9 13:22:09 2006 for SBC65EC Web Server by  doxygen 1.4.7