WEB Server

tcpip_layer1

Internet Protocol Suite

The software driver implements low-level API to handle Ethernet Frame transfer between the Link Layer and the Internet Layer.

API Specification

Ethernet Frame Transmission

  • Description
    • The function copies the number of bytes specified by flen from fbuf to Local Memory in the FPGA, and send it as an Ethernet Frame.
  • Return Value
    • None
Ethernet Frame Reception

  • Description
    • The function stores received Ethernet Frame from Local Memory in the FPGA to fbuf.
  • Return Value
    • The function returns the number of bytes of received Ethernet Frame on success.

Ethernet Frame Transmission Flow

An Ethernet Frame is transmitted in the following way.

  1. Copies Frame data from CPU main memory to FPGA Local Memory
  2. Set Mode Register TXEN bit of MAC Core to 1
  3. Set Local Memory address which the data stored in to TXPNT of Tx Buffer Descriptor register in MAC Core.
  4. Set Tx Buffer Descriptor RD bit of MAC Core to 1.
  5. Wait for transmit complete interrupt.
  6. Clear the interrupt.
ether_pic2

Ethernet Frame Transmit Flow Chart

Frame CRC will be calculated and added to the end of the Frame. After Tx Buffer Descriptor is enabled, Ethernet MAC Core reads data from Local Memory then send it to PHY as an Ethernet Frame.

Transmission API Implementation – ether_write_frame()

Ethernet Frame Reception Flow

An Ethernet Frame is received in the following way.

  1. Set Mode Register RXEN bit of MAC Core to 1
  2. Set Local Memory address, which specifies the data to be received to RXPNT of Rx Buffer Descriptor in MAC Core.
  3. Set Rx Buffer Descriptor E bit of MAC Core to 1.
  4. Wait for reception complete interrupt.
  5. Clear the interrupt.
  6. Copies Frame data from FPGA Local Memory to CPU main memory.
ether_pic3

Ethernet Frame Reception Flow Chart

The Frame data from PHY is transferred from Ethernet MAC Core to Local Memory according to the configuration of Rx Buffer Descriptor register. CRC in the Frame is removed and not stored in Local Memory.

Reception API Implementation – ether_read_frame()


スポンサーリンク







  • このエントリーをはてなブックマークに追加
スポンサーリンク