xxvethernet
Vitis Drivers API Documentation
xxxvethernet_example_intr_mcdma.c File Reference

Overview

Implements examples that utilize the Xxv Ethernet's interrupt driven MCDMA packet transfer mode to send and receive frames.

This example demonstrates how to perform a simple send and receive.

Functional guide to example:

  • XxvEthernetSgDmaIntrSingleFrameExample demonstrates the simplest way to send and receive frames in interrupt driven mode.
MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.0 hk 06/16/17 First release 1.4 rsp 05/12/20 Fix Wint-conversion gcc warning in XxvEthernetSgDmaIntrExample().

 

Functions

int XxvEthernetSgDmaIntrExample (INTC *IntcInstancePtr, XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, u16 XxvEthernetDeviceId, u16 AxiMcDmaDeviceId)
 This function demonstrates the usage usage of the Xxv Ethernet by sending and receiving frames in interrupt driven MCDMA mode. More...
 
int XxvEthernetSgDmaIntrSingleFrameExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 This function demonstrates the usage of the Xxv Ethernet by sending and receiving a single frame in interrupt mode using MCDMA. More...
 
int main (void)
 This is the main function for the Xxv Ethernet example. More...
 

Function Documentation

int main ( void  )

This is the main function for the Xxv Ethernet example.

This function is not included if the example is generated from the TestAppGen test tool.

Parameters
None.
Returns
- XST_SUCCESS to indicate success.
  • XST_FAILURE to indicate failure
Note
None.

References XxvEthernetSgDmaIntrExample(), and XxvEthernetUtilErrorTrap().

int XxvEthernetSgDmaIntrExample ( INTC *  IntcInstancePtr,
XXxvEthernet XxvEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u16  XxvEthernetDeviceId,
u16  AxiMcDmaDeviceId 
)

This function demonstrates the usage usage of the Xxv Ethernet by sending and receiving frames in interrupt driven MCDMA mode.

Parameters
IntcInstancePtris a pointer to the instance of the Intc component.
XxvEthernetInstancePtris a pointer to the instance of the XxvEthernet component.
DmaInstancePtris a pointer to the instance of the AXI MCDMA component.
XxvEthernetDeviceIdis Device ID of the Xxv Ethernet Device , typically XPAR_<XXVETHERNET_instance>_DEVICE_ID value from xparameters.h.
AxiMcDmaDeviceIdis Device ID of the Axi MCDMA Device , typically XPAR_<AXIMCDMA_instance>_DEVICE_ID value from xparameters.h.
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
AxiMcdma hardware must be initialized before initializing XxvEthernet. Since AxiMcdma reset line is connected to the XxvEthernet reset line, a reset of AxiMcdma hardware during its initialization would reset XxvEthernet.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet_Config::XxvDevBaseAddress, XxvEthernetSgDmaIntrSingleFrameExample(), XxvEthernetUtilEnterLocalLoopback(), XxvEthernetUtilErrorTrap(), XXxvEthernet_CfgInitialize(), XXxvEthernet_LookupConfig(), and XXxvEthernet_Stop().

Referenced by main().

int XxvEthernetSgDmaIntrSingleFrameExample ( XXxvEthernet XxvEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

This function demonstrates the usage of the Xxv Ethernet by sending and receiving a single frame in interrupt mode using MCDMA.

The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.

Parameters
XxvEthernetInstancePtris a pointer to the instance of the Xxv Ethernet component.
DmaInstancePtris a pointer to the instance of the Dma component.
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
None.

References XxvEthernetUtilErrorTrap(), XxvEthernetUtilFrameHdrFormatMAC(), XxvEthernetUtilFrameHdrFormatType(), XxvEthernetUtilFrameMemClear(), XxvEthernetUtilFrameSetPayloadData(), XxvEthernetUtilFrameVerify(), XXxvEthernet_Start(), and XXxvEthernet_Stop().

Referenced by XxvEthernetSgDmaIntrExample().