axiethernet
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xaxiethernet_example_extmulticast.c File Reference

Overview

Implements examples that utilize the AXI Ethernet's interrupt driven DMA packet transfer mode to send and receive multicast frames when XAE_EXT_MULTICAST_OPTION is enabled.

This example demonstrates:

  • How to perform option enable
  • Which interrupt BD word are verified and confirm it is a valid multicast frame.

Functional guide to example:

  • AxiEthernetSgDmaIntrExtMulticast Example demonstrates the extended multicast. The HW must be setup for extended multicast for this example to execute.
MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.00a asa 4/30/10 First release based on the ll temac driver 1.01a asa 12/10/10 Changes made to enable the AXIDMA Tx/Rx ring interrupts before allocation of Tx/Rx BDs. 3.00a asa 6/25/12 Modified XAxiDma_BdSetLength API call to support new AXI DMA driver version 7.00a. 3.00a bss 10/22/12 Added support for Fast Interrupt Handlers. 3.01a srt 02/14/13 Added support for Zynq (CR 681136) 5.4 ms 01/23/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. ms 04/05/17 Added tabspace for return statements in functions for proper documentation while generating doxygen. 5.7 rsp 19/12/17 Defined Padding and ExternalLoopback variables.

#include "xparameters.h"
#include "xaxiethernet_example.h"
#include "xaxidma.h"
#include "xil_cache.h"
#include "xil_exception.h"
#include "xinterrupt_wrap.h"

Functions

int AxiEthernetMcastExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 This function demonstrates the usage usage of the Axi Ethernet extended multicast feature. More...
 
int AxiEthernetSgDmaIntrExtMulticastExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends and receives a single packet in loopback mode with extended multicast address support. More...
 
int main (void)
 This is the main function for the Axi Ethernet example. More...
 

Function Documentation

int AxiEthernetMcastExample ( XAxiEthernet AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr,
UINTPTR  AxiEthernetBaseAddress 
)

This function demonstrates the usage usage of the Axi Ethernet extended multicast feature.

It uses AXI DMA core in interrupt mode to transfer Ethernet frames.

Parameters
AxiEthernetInstancePtris a pointer to the instance of the AxiEthernet component.
DmaInstancePtris a pointer to the instance of the AXIDMA component.
AxiEthernetBaseAddresscontains the base address of the AxiEthernet device
Returns
  • XST_SUCCESS to indicate success.
  • XST_FAILURE.to indicate failure.
Note
AxiDma hardware must be initialized before initializing AxiEthernet. Since AxiDma reset line is connected to the AxiEthernet reset line, a reset of AxiDma hardware during its initialization would reset AxiEthernet.

References XAxiEthernet_Config::AxiDevBaseAddress, AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, XAxiEthernet_CfgInitialize(), XAxiEthernet_Get_Phy_Interface(), XAxiEthernet_IsExtMcast, XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), and XAxiEthernet_Stop().

Referenced by main().

int AxiEthernetSgDmaIntrExtMulticastExample ( XAxiEthernet AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

This example sends and receives a single packet in loopback mode with extended multicast address support.

The transmit frame will be addressed one of programmed multicast addresses.

On receive, HW should pass the frame to receive interrupt handler for further address checking.

Parameters
AxiEthernetInstancePtris a pointer to the instance of the AxiEthernet component.
DmaInstancePtris a pointer to the instance of the AXI DMA component.
Returns
  • XST_SUCCESS to indicate success.
  • XST_FAILURE to indicate failure.
Note
None.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), AxiEthernetUtilFrameVerify(), XAxiEthernet::Options, XAE_DEFAULT_OPTIONS, XAE_EXT_MULTICAST_OPTION, XAE_INT_RECV_ERROR_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_AddExtMulticastGroup(), XAxiEthernet_ClearOptions(), XAxiEthernet_GetExtMulticastGroup(), XAxiEthernet_IntEnable, XAxiEthernet_IsExtMcast, XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), and XAxiEthernet_Start().

Referenced by AxiEthernetMcastExample().

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.

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

References AXIETHERNET_DEVICE_ID, AxiEthernetMcastExample(), and AxiEthernetUtilErrorTrap().