![]() |
axiethernet
Vitis Drivers API Documentation
|
Implements examples that utilize the Axi Ethernet's polled mode MCDMA packet transfer mode to send and receive frames.
These examples demonstrate:
Functional guide to example:
MODIFICATION HISTORY:
Ver Who Date Changes
5.5 adk Initial Release.
Functions | |
int | AxiEthernetSgDmaPollExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u16 AxiEthernetDeviceId, u16 AxiMcDmaDeviceId) |
This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in polled MCDMA mode. More... | |
int | AxiEthernetSgDmaSingleFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a single frame in using MCDMA in polled mode. More... | |
int | AxiEthernetSgDmaMultiFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving multiple frames in using MCDMA in polled mode. More... | |
int | AxiEthernetSgDmaPartialChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This example sends and receives a single packet in loopback mode with checksum offloading support. More... | |
int | AxiEthernetSgDmaFullChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This example sends and receives a single packet in loopback mode with full checksum offloading support. More... | |
int | main (void) |
This is the main function for the Axi Ethernet example. More... | |
int AxiEthernetSgDmaFullChecksumOffloadExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This example sends and receives a single packet in loopback mode with full checksum offloading support.
An Ethernet frame is formed with IP header, TCP header and payload. The hardware calculates the IP Header checksum and populates it at the appropriate location in the IP header. Similarly, the hardware calculates the TCP Pseudo header from IP header and calculates TCP checksum for TCP Pseudo header, TCP header and TCP payload. It then populates the checksum in the TCP header. The Ethernet frame is then looped back and received. The hardware validates the IP header checksum and the TCP checksum. The example retrieves the checksum validation information from the AXI4- Stream Appword2.
AxiEthernetInstancePtr | is a pointer to the instance of the AxiEthernet component. |
DmaInstancePtr | is a pointer to the instance of the Dma component. |
int AxiEthernetSgDmaMultiFrameExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving multiple frames in using MCDMA in polled mode.
Each source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.
AxiEthernetInstancePtr | is a pointer to the instance of the Axi Ethernet component. |
DmaInstancePtr | is a pointer to the instance of the Dma component. |
ChanId | is the MCDMA Channel Id to be operate on. |
References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().
Referenced by AxiEthernetSgDmaPollExample().
int AxiEthernetSgDmaPartialChecksumOffloadExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This example sends and receives a single packet in loopback mode with checksum offloading support.
The transmit frame will be che cksummed over the entire Ethernet payload and inserted into the last 2 bytes of the frame.
On receive, HW should calculate the Ethernet payload checksum and return a value of 0xFFFF which means the payload data was likely not corrupted.
AxiEthernetInstancePtr | is a pointer to the instance of the AxiEthernet component. |
DmaInstancePtr | is a pointer to the instance of the Dma component. |
int AxiEthernetSgDmaPollExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u16 | AxiEthernetDeviceId, | ||
u16 | AxiMcDmaDeviceId | ||
) |
This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in polled MCDMA mode.
AxiEthernetInstancePtr | is a pointer to the instance of the AxiEthernet component. |
DmaInstancePtr | is a pointer to the instance of the AXI MCDMA component. |
AxiEthernetDeviceId | is Device ID of the Axi Ethernet Device , typically XPAR_<AXIETHERNET_instance>_DEVICE_ID value from xparameters.h. |
AxiMcDmaDeviceId | is Device ID of the Axi DMAA Device , typically XPAR_<AXIMCDMA_instance>_DEVICE_ID value from xparameters.h. |
References XAxiEthernet_Config::AxiDevBaseAddress, XAxiEthernet_Config::AxiDevType, AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetSgDmaSingleFrameExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameVerify(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::AxiMcDmaChan_Cnt, XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::Enable_1588, XAxiEthernet_Config::Speed, XAxiEthernet_CfgInitialize(), XAxiEthernet_GetPhysicalInterface, XAxiEthernet_IsRxFullCsum, XAxiEthernet_IsRxPartialCsum, XAxiEthernet_IsRxVlanStrp, XAxiEthernet_IsRxVlanTag, XAxiEthernet_IsRxVlanTran, XAxiEthernet_IsTxFullCsum, XAxiEthernet_IsTxPartialCsum, XAxiEthernet_IsTxVlanStrp, XAxiEthernet_IsTxVlanTag, XAxiEthernet_IsTxVlanTran, XAxiEthernet_LookupConfig(), XAxiEthernet_SetOperatingSpeed(), and XAxiEthernet_Stop().
Referenced by main().
int AxiEthernetSgDmaSingleFrameExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a single frame in using MCDMA in polled mode.
The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.
AxiEthernetInstancePtr | is a pointer to the instance of the Axi Ethernet component. |
DmaInstancePtr | is a pointer to the instance of the Dma component. |
ChanId | is the MCDMA Channel Id to be operate on. |
References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().
Referenced by AxiEthernetSgDmaPollExample().
int main | ( | void | ) |
This is the main function for the Axi Ethernet example.
None. |
References AXIETHERNET_DEVICE_ID, AxiEthernetSgDmaPollExample(), and AxiEthernetUtilErrorTrap().