![]() |
axiethernet
Vitis Drivers API Documentation
|
Implements examples that utilize the Axi Ethernet's interrupt driven 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 | AxiEthernetSgDmaIntrExample (INTC *IntcInstancePtr, XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u16 AxiEthernetDeviceId, u16 AxiMcDmaDeviceId, u16 AxiEthernetIntrId) |
This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in interrupt driven MCDMA mode. More... | |
int | AxiEthernetSgDmaIntrSingleFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a single frame in SGDMA interrupt mode. More... | |
int | AxiEthernetSgDmaIntrMultiFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a multiple frames in MCDMA interrupt 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. |
ChanId | is the MCDMA Channel number to be operate on. |
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. |
References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameSetPayloadData(), XAE_INT_RECV_ERROR_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_IntEnable, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().
Referenced by AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().
int AxiEthernetSgDmaIntrExample | ( | INTC * | IntcInstancePtr, |
XAxiEthernet * | AxiEthernetInstancePtr, | ||
XMcdma * | DmaInstancePtr, | ||
u16 | AxiEthernetDeviceId, | ||
u16 | AxiMcDmaDeviceId, | ||
u16 | AxiEthernetIntrId | ||
) |
This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in interrupt driven MCDMA mode.
IntcInstancePtr | is a pointer to the instance of the Intc component. |
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. |
AxiEthernetIntrId | is the Interrupt ID and is typically XPAR_<INTC_instance>_<AXIETHERNET_instance>_VEC_ID value from xparameters.h. |
References XAxiEthernet_Config::AxiDevBaseAddress, XAxiEthernet_Config::AxiDevType, AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameVerify(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::AxiMcDmaChan_Cnt, XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::Enable_1588, XAxiEthernet_Config::Speed, XAE_INT_RXFIFOOVR_MASK, XAE_INT_RXRJECT_MASK, XAxiEthernet_CfgInitialize(), XAxiEthernet_GetPhysicalInterface, XAxiEthernet_IntClear, XAxiEthernet_IntPending, 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 AxiEthernetSgDmaIntrMultiFrameExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a multiple frames in MCDMA interrupt 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 number 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 AxiEthernetSgDmaIntrExample().
int AxiEthernetSgDmaIntrSingleFrameExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function demonstrates the usage of the Axi Ethernet by sending and receiving a single frame in SGDMA interrupt 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 number 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 AxiEthernetSgDmaIntrExample().
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. |
ChanId | is the MCDMA Channel number to be operate on. |
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. |
References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), XAE_INT_RECV_ERROR_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_IntEnable, XAxiEthernet_IsRxPartialCsum, XAxiEthernet_IsTxPartialCsum, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().
Referenced by AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().
int main | ( | void | ) |
This is the main function for the Axi Ethernet example.
This function is not included if the example is generated from the TestAppGen test tool.
None. |
References AXIETHERNET_DEVICE_ID, AxiEthernetSgDmaIntrExample(), and AxiEthernetUtilErrorTrap().