axiethernet
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xaxiethernet_example_intr_mcdma.c File Reference
#include "xparameters.h"
#include "xaxiethernet_example.h"
#include "xmcdma.h"
#include "xil_cache.h"
#include "xil_exception.h"
#include "stdio.h"
#include "stdlib.h"
#include "xinterrupt_wrap.h"

Macros

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define RXBD_CNT   1024
 Number of RxBDs to use. More...
 
#define TXBD_CNT   1024
 Number of TxBDs to use. More...
 
#define BD_ALIGNMENT   64
 Byte alignment of BDs. More...
 
#define PAYLOAD_SIZE   1000
 Payload size used in examples. More...
 
#define BD_USR0_OFFSET   0
 AXI4-Stream Control Word offset from the start of app user words in BD. More...
 
#define BD_USR1_OFFSET   1
 AXI4-Stream Control Word offset from the start of app user words in BD. More...
 
#define BD_USR2_OFFSET   2
 AXI4-Stream Control Word offset from the start of app user words in BD. More...
 
#define PARTIAL_CSUM_ENABLE   0x00000001
 Option for partial csum enable. More...
 
#define FULL_CSUM_ENABLE   0x00000002
 Option for full csum enable. More...
 
#define TX_CS_INIT_OFFSET   16
 Offset in the control word where byte offset in the ethernet frame to start CSUM calculation need to be inserted. More...
 
#define RCV_FRM_NOT_CORRUPTED   0xFFFF
 If the received frame is not corrupted, for partial csum offloading case, the control word 3 would return 0xFFFF. More...
 
#define IP_VERSION_4   0x800
 For IPV4, the Ethernet frame type/length field will have a value of 0x800. More...
 
#define IP_HEADER_VERSION   0x04
 For IPv4, the version entry in IP header is always 4. More...
 
#define IP_HEADER_LEN_IN_WORDS   0x05
 For our case, the header length is always 20 bytes (5 words. More...
 
#define IP_HEADER_LENGTH   20
 IP header length in bytes. More...
 
#define IP_HEADER_PROTOCOL_TCP   0x6
 IP header protocol entry. More...
 
#define IP_HEADER_PROTOCOL_UDP   0x17
 IP header protocol entry. More...
 
#define TCP_HEADER_LEN_IN_WORDS   0x5
 For our case, the header length is always 20 bytes (5 words). More...
 
#define TCP_HEADER_LENGTH   20
 IP header length in bytes. More...
 
#define FULL_CSUM_STATUS_MASK   0x00000038
 Mask to extract full checksum status field from AXI4 Stream Status Word 2. More...
 
#define FULL_CSUM_VALIDATED   0x00000002
 If bits 3-5 in AXI4 Status word have a value of 0x010, it means both IP and TCP checksums have been found to be correct. More...
 
#define IP_TCP_CSUMS_NOT_CHECKED   0x00000000
 IP TCP CSUMS NOT CHECKED. More...
 
#define IP_CSUM_OK_TCP_NOT_CHECKED   0x00000001
 IP CSUM OK TCP NOT CHECKED. More...
 
#define TCP_CSUM_NOT_CHECKED_IP_NOT_OK   0x00000005
 TCP CSUM NOT CHECKED IP NOT OK. More...
 
#define IP_CSUM_OK_TCP_NOT_OK   0x00000006
 IP CSUM OK TCP NOT OK. More...
 
#define DUMMY_TCP_PORT_1   0x1111
 DUMMY TCP PORT 1. More...
 
#define DUMMY_TCP_PORT_2   0x1112
 DUMMY TCP PORT 2. More...
 
#define RXBD_SPACE_BYTES   RXBD_CNT * 64 * 16
 RXBD SPACE BYTES. More...
 
#define TXBD_SPACE_BYTES   TXBD_CNT * 64 * 16
 TXBD SPACE BYTES. More...
 
#define BLOCK_SIZE_2MB   0x200000U
 BLOCK SIZE 2MB. More...
 

Functions

int AxiEthernetSgDmaIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates the usage of the Axi Ethernet by sending. More...
 
int AxiEthernetSgDmaIntrSingleFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSgDmaIntrMultiFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSgDmaPartialChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 This example sends and receives a single packet in loopback mode with. More...
 
int AxiEthernetSgDmaFullChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 This example sends and receives a single packet in loopback mode with. More...
 
void AxiEthernetPHYRegistersDump (XAxiEthernet *AxiEthernetInstancePtr)
 Prints PHY register values for debugging. More...
 
int main ()
 Main entry point for the AVB example. More...
 
u16 Swap8 (u8 Data)
 Swaps bytes within an 8-byte value. More...
 
void AxiEnthernetSetMAC (char *MacAddr, u8 ChanId)
 Programs the AXI Ethernet MAC address. More...