![]() |
axiethernet
Vitis Drivers API Documentation
|
This file contains a Axi Ethernet MCDMA Ping request example in polled mode.
This example will generate a ping request for the specified IP address.
The local IP address is set to 10.10.70.6. User needs to update LocalIpAddr variable with a free IP address based on the network on which this example is to be run.
The Destination IP address is set to 10.10.70.3. User needs to update DestIpAddress variable with any valid IP address based on the network on which this example is to be run.
The local MAC address is set to 0x000A35030201. User can update LocalMacAddr variable with a valid MAC address. The first three bytes contains the manufacture ID. 0x000A35 is XILINX manufacture ID.
This program will generate the specified number of ping request packets as defined in "NUM_OF_PING_REQ_PKTS".
This example got validated only for SGMII based design's.
Functional guide to example:
MODIFICATION HISTORY:
Ver Who Date Changes
5.5 adk Initial Release
Macros | |
#define | XAE_ETHER_PROTO_TYPE_IP 0x0800 |
IP Protocol. More... | |
#define | XAE_ETHER_PROTO_TYPE_ARP 0x0806 |
ARP Protocol. More... | |
#define | XAE_ETHER_PROTO_TYPE_VLAN 0x8100 |
VLAN Tagged. More... | |
#define | XAE_ARP_PACKET_SIZE 28 |
Max ARP packet size. More... | |
#define | XAE_HEADER_IP_LENGTH_OFFSET 16 |
IP Length Offset. More... | |
#define | XAE_VLAN_TAG_SIZE 4 |
VLAN Tag Size. More... | |
Functions | |
int | AxiEthernetPingReqExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u16 AxiEthernetDeviceId, u16 AxiMcDmaDeviceId) |
The entry point for the AxiEthernet driver to ping request example in polled mode. More... | |
void | SendArpReqFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function will send a ARP request packet. More... | |
void | SendEchoReqFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function will send a Echo request packet. More... | |
int | ProcessRecvFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
This function will process the received packet. More... | |
int | main () |
This function is the main function of the Ping Request example in polled mode. More... | |
#define XAE_ARP_PACKET_SIZE 28 |
Max ARP packet size.
#define XAE_ETHER_PROTO_TYPE_ARP 0x0806 |
ARP Protocol.
Referenced by ProcessRecvFrame(), and SendArpReqFrame().
#define XAE_ETHER_PROTO_TYPE_IP 0x0800 |
IP Protocol.
Referenced by ProcessRecvFrame(), SendArpReqFrame(), and SendEchoReqFrame().
#define XAE_ETHER_PROTO_TYPE_VLAN 0x8100 |
VLAN Tagged.
#define XAE_HEADER_IP_LENGTH_OFFSET 16 |
IP Length Offset.
#define XAE_VLAN_TAG_SIZE 4 |
VLAN Tag Size.
int AxiEthernetPingReqExample | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u16 | AxiEthernetDeviceId, | ||
u16 | AxiMcDmaDeviceId | ||
) |
The entry point for the AxiEthernet driver to ping request example in polled mode.
This function will generate specified number of request packets as defined in "NUM_OF_PING_REQ_PKTS.
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, XAxiEthernet_Config::AxiMcDmaChan_Cnt, XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::Enable_1588, PHY_R0_CTRL_REG, ProcessRecvFrame(), SendArpReqFrame(), SendEchoReqFrame(), XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), and XAxiEthernet_Start().
Referenced by main().
int main | ( | void | ) |
This function is the main function of the Ping Request example in polled mode.
None. |
References AXIETHERNET_DEVICE_ID, and AxiEthernetPingReqExample().
int ProcessRecvFrame | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function will process the received packet.
This function sends the echo request packet based on the ARP reply packet.
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 SendEchoReqFrame(), XAE_ETHER_PROTO_TYPE_ARP, and XAE_ETHER_PROTO_TYPE_IP.
Referenced by AxiEthernetPingReqExample().
void SendArpReqFrame | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function will send a ARP request packet.
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 XAE_ETHER_PROTO_TYPE_ARP, and XAE_ETHER_PROTO_TYPE_IP.
Referenced by AxiEthernetPingReqExample().
void SendEchoReqFrame | ( | XAxiEthernet * | AxiEthernetInstancePtr, |
XMcdma * | DmaInstancePtr, | ||
u8 | ChanId | ||
) |
This function will send a Echo request packet.
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 XAE_ETHER_PROTO_TYPE_IP.
Referenced by AxiEthernetPingReqExample(), and ProcessRecvFrame().