axiethernet
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Overview

Data Structures

struct  XAxiEthernet_Config
 Holds configuration information for an AXI Ethernet device. More...
 
struct  XAxiEthernet
 struct XAxiEthernet is the type for Axi Ethernet driver instance data. More...
 

Macros

#define XAE_MDIO_DIV_DFT   29
 Default MDIO clock divisor. More...
 
#define XAE_TPID_MAX_ENTRIES   4
 Number of storable TPIDs in the VLAN table. More...
 
#define XAE_RX   1
 Receive direction. More...
 
#define XAE_TX   2
 Transmit direction. More...
 
#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID
 The following constants map to the XPAR parameters created in the. More...
 
#define AVB_PTP_RX_INTERRUPT_ID   XPAR_INTC_0_AXIETHERNET_0_AV_INTERRUPT_PTP_RX_VEC_ID
 AVB PTP receive interrupt ID. More...
 
#define AVB_PTP_INTERRUPT_ID   XPAR_INTC_0_AXIETHERNET_0_AV_INTERRUPT_10MS_VEC_ID
 AVB PTP timer interrupt ID. More...
 
#define PHY_DETECT_REG   1
 PHY DETECT REG. More...
 
#define PHY_DETECT_MASK   0x1808
 PHY detect register mask. More...
 
#define PHY_R0_RESET   0x8000
 PHY control register reset bit. More...
 
#define PHY_R0_LOOPBACK   0x4000
 PHY control register loopback bit. More...
 
#define PHY_R0_DFT_SPD_1000   0x0040
 PHY default speed bit for 1000 Mbps. More...
 
#define ETH_SYSTEM_ADDRESS_EUI48_HIGH   0x000A35
 Upper bytes of the Ethernet EUI-48 address. More...
 
#define ETH_SYSTEM_ADDRESS_EUI48_LOW   0x010203
 Lower bytes of the Ethernet EUI-48 address. More...
 
#define XAXIETHERNET_EXAMPLE_H
 XAXIETHERNET EXAMPLE H. More...
 
#define AXIETHERNET_LOOPBACK_SPEED   100
 100Mb/s for Mii. More...
 
#define AXIETHERNET_LOOPBACK_SPEED_1G   1000
 1000Mb/s for GMii. More...
 
#define AXIETHERNET_LOOPBACK_SPEED_2p5G   2500
 2p5G for 2.5G MAC. More...
 
#define AXIETHERNET_PHY_DELAY_SEC   4
 Amount of time to delay waiting on PHY to reset. More...
 
#define MAX_MULTICAST_ADDR   (1<<23)
 Maximum number of multicast Ethernet MAC addresses. More...
 
#define NUM_PACKETS   50
 Number of packets to send in the example. More...
 
#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID
 AXI Ethernet device ID. More...
 
#define AXIDMA_DEVICE_ID   XPAR_AXIDMA_0_DEVICE_ID
 AXI DMA device ID. More...
 
#define RXBD_CNT   128
 Number of RxBDs to use. More...
 
#define TXBD_CNT   128
 Number of TxBDs to use. More...
 
#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT
 Byte alignment of BDs. More...
 
#define PAYLOAD_SIZE   1000
 Payload size used in examples. More...
 
#define BD_RX_STATUS_OFFSET   2
 BD RX STATUS OFFSET. More...
 
#define RXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT)
 RXBD SPACE BYTES. More...
 
#define TXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT)
 TXBD SPACE BYTES. More...
 
#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define RXBD_CNT   128
 Number of RxBDs to use. More...
 
#define TXBD_CNT   128
 Number of TxBDs to use. More...
 
#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT
 Byte alignment of BDs. More...
 
#define PAYLOAD_SIZE   1000
 Payload size used in examples. More...
 
#define BD_VLAN_TPID_OFFSET   3
 AXI4-Stream status Word offset from the start of app user words in BD. More...
 
#define BD_VLAN_VID_OFFSET   4
 AXI4-Stream status word offset from the start of app user words in BD. More...
 
#define TPID_MASK   0xFFFF0000
 Mask to extract TPID from the AXI4 STream status word. More...
 
#define RXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT)
 RXBD SPACE BYTES. More...
 
#define TXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT)
 TXBD SPACE BYTES. More...
 
#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define PAYLOAD_SIZE   100
 Payload size used in examples. More...
 
#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...
 
#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define RXBD_CNT   128
 Number of RxBDs to use. More...
 
#define TXBD_CNT   128
 Number of TxBDs to use. More...
 
#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT*2
 Byte alignment required for buffer descriptors. 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   (XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT))
 RXBD SPACE BYTES. More...
 
#define TXBD_SPACE_BYTES   (XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT))
 TXBD SPACE BYTES. More...
 
#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...
 
#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID
 Device ID for AXI Ethernet. More...
 
#define FIFO_DEVICE_ID   XPAR_AXI_FIFO_0_DEVICE_ID
 Device ID for AXI FIFO. More...
 
#define PHY_DETECT_REG   1
 MII status register used to detect the PHY. More...
 
#define PHY_DETECT_MASK   0x1808
 PHY detect register feature mask. More...
 
#define PHY_R0_DFT_SPD_2500   0x0040
 Default PHY speed bits for 2500 Mbps. More...
 
#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR
 AXI Ethernet base address. More...
 
#define NUM_OF_PING_REQ_PKTS   10
 Number of ping req it generates. 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 ECHO_REPLY   0x00
 Echo reply. More...
 
#define HW_TYPE   0x01
 Hardware type (10/100 Mbps). More...
 
#define ARP_REQUEST   0x01
 ARP Request bits in Rx packet. More...
 
#define ARP_REPLY   0x02
 ARP status bits indicating reply. More...
 
#define IDEN_NUM   0x02
 ICMP identifier number. More...
 
#define IP_VERSION   0x0604
 IP version ipv4/ipv6. More...
 
#define BROADCAST_ADDR   0xFFFF
 Broadcast Address. More...
 
#define CORRECT_CHECKSUM_VALUE   0xFFFF
 Correct checksum value. More...
 
#define ARP_REQ_PKT_SIZE   0x2A
 ARP request packet size. More...
 
#define ICMP_PKT_SIZE   0x4A
 ICMP packet length 74 Bytes including Src and dest MAC Add. More...
 
#define IP_ADDR_SIZE   4
 IP Address size in Bytes. More...
 
#define NUM_RX_PACK_CHECK_REQ   10
 Max num of Rx pack to be checked before sending another request. More...
 
#define NUM_PACK_CHECK_RX_PACK   8000000
 Max number of pack to be checked before to identify a Rx packet. More...
 
#define DELAY   1000000
 Used to introduce delay. More...
 
#define SRC_MAC_ADDR_LOC   3
 Src MAC address location. More...
 
#define MAC_ADDR_LEN   3
 MAC address length. More...
 
#define ETHER_PROTO_TYPE_LOC   6
 Ethernet Proto type loc. More...
 
#define IP_ADDR_LEN   2
 Size of IP address. More...
 
#define IP_START_LOC   7
 IP header start location. More...
 
#define IP_HEADER_INFO_LEN   7
 IP header information length. More...
 
#define IP_HEADER_LEN   10
 IP header length. More...
 
#define IP_CHECKSUM_LOC   12
 IP header checksum location. More...
 
#define IP_REQ_SRC_IP_LOC   13
 Src IP add loc of ICMP req. More...
 
#define IP_REQ_DEST_IP_LOC   15
 Dest IP add loc of ICMP req. More...
 
#define ICMP_KNOWN_DATA_LEN   16
 ICMP known data length. More...
 
#define ICMP_ECHO_FIELD_LOC   17
 Echo field loc. More...
 
#define ICMP_DATA_START_LOC   17
 Data field start location. More...
 
#define ICMP_DATA_LEN   18
 ICMP data length. More...
 
#define ICMP_DATA_CHECKSUM_LOC   18
 ICMP data checksum location. More...
 
#define ICMP_IDEN_FIELD_LOC   19
 Identifier field loc. More...
 
#define ICMP_DATA_LOC   19
 ICMP data loc including identifier number and sequence number. More...
 
#define ICMP_SEQ_NO_LOC   20
 sequence number location. More...
 
#define ICMP_DATA_FIELD_LEN   20
 Data field length. More...
 
#define ICMP_KNOWN_DATA_LOC   21
 ICMP known data start loc. More...
 
#define ARP_REQ_STATUS_LOC   10
 ARP request loc. More...
 
#define ARP_REQ_SRC_IP_LOC   14
 Src IP add loc of ARP req Packet. 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 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...
 
#define PHY_R0_CTRL_REG   0
 PHY R0 CTRL REG. More...
 
#define PHY_R3_PHY_IDENT_REG   3
 PHY identifier register address. More...
 
#define PHY_R0_RESET   0x8000
 PHY control register reset bit. More...
 
#define PHY_R0_LOOPBACK   0x4000
 PHY control register loopback bit. More...
 
#define PHY_R0_ANEG_ENABLE   0x1000
 PHY auto-negotiation enable bit. More...
 
#define PHY_R0_DFT_SPD_MASK   0x2040
 PHY default speed field mask. More...
 
#define PHY_R0_DFT_SPD_10   0x0000
 PHY default speed bit for 10 Mbps. More...
 
#define PHY_R0_DFT_SPD_100   0x2000
 PHY default speed bit for 100 Mbps. More...
 
#define PHY_R0_DFT_SPD_1000   0x0040
 PHY default speed bit for 1000 Mbps. More...
 
#define PHY_R0_ISOLATE   0x0400
 PHY R0 ISOLATE. More...
 
#define PHY_R20_EXTND_CTRL_REG   20
 PHY R20 EXTND CTRL REG. More...
 
#define PHY_R27_EXTND_STS_REG   27
 PHY R27 EXTND STS REG. More...
 
#define PHY_R20_DFT_SPD_10   0x20
 PHY R20 DFT SPD 10. More...
 
#define PHY_R20_DFT_SPD_100   0x50
 PHY R20 DFT SPD 100. More...
 
#define PHY_R20_DFT_SPD_1000   0x60
 PHY R20 DFT SPD 1000. More...
 
#define PHY_R20_RX_DLY   0x80
 PHY R20 RX DLY. More...
 
#define PHY_R27_MAC_CONFIG_GMII   0x000F
 PHY R27 MAC CONFIG GMII. More...
 
#define PHY_R27_MAC_CONFIG_MII   0x000F
 PHY R27 MAC CONFIG MII. More...
 
#define PHY_R27_MAC_CONFIG_RGMII   0x000B
 PHY R27 MAC CONFIG RGMII. More...
 
#define PHY_R27_MAC_CONFIG_SGMII   0x0004
 PHY R27 MAC CONFIG SGMII. More...
 
#define PHY_R22_PAGE_ADDR_REG   22
 PHY R22 PAGE ADDR REG. More...
 
#define PHY_PG2_R21_CTRL_REG   21
 PHY PG2 R21 CTRL REG. More...
 
#define PHY_REG21_10   0x0030
 PHY REG21 10. More...
 
#define PHY_REG21_100   0x2030
 PHY REG21 100. More...
 
#define PHY_REG21_1000   0x0070
 PHY REG21 1000. More...
 
#define MARVEL_PHY_88E1111_MODEL   0xC0
 MARVEL PHY 88E1111 MODEL. More...
 
#define MARVEL_PHY_88E1116R_MODEL   0x240
 MARVEL PHY 88E1116R MODEL. More...
 
#define PHY_MODEL_NUM_MASK   0x3F0
 PHY MODEL NUM MASK. More...
 
#define TI_PHY_IDENTIFIER   0x2000
 TI PHY IDENTIFIER. More...
 
#define TI_PHY_MODEL   0x230
 TI PHY MODEL. More...
 
#define TI_PHY_CR   0xD
 TI PHY CR. More...
 
#define TI_PHY_PHYCTRL   0x10
 TI PHY PHYCTRL. More...
 
#define TI_PHY_CR_SGMII_EN   0x0800
 TI PHY CR SGMII EN. More...
 
#define TI_PHY_ADDDR   0xE
 TI PHY ADDDR. More...
 
#define TI_PHY_CFGR2   0x14
 TI PHY CFGR2. More...
 
#define TI_PHY_SGMIITYPE   0xD3
 TI PHY SGMIITYPE. More...
 
#define TI_PHY_CFGR2_SGMII_AUTONEG_EN   0x0080
 TI PHY CFGR2 SGMII AUTONEG EN. More...
 
#define TI_PHY_SGMIICLK_EN   0x4000
 TI PHY SGMIICLK EN. More...
 
#define TI_PHY_CR_DEVAD_EN   0x001F
 TI PHY CR DEVAD EN. More...
 
#define TI_PHY_CR_DEVAD_DATAEN   0x4000
 TI PHY CR DEVAD DATAEN. More...
 

Typedefs

typedef struct XAxiEthernet_Config XAxiEthernet_Config
 Holds configuration information for an AXI Ethernet device. More...
 
typedef struct XAxiEthernet XAxiEthernet
 struct XAxiEthernet is the type for Axi Ethernet driver instance data. More...
 

Functions

int XAxiEthernet_CfgInitialize (XAxiEthernet *InstancePtr, XAxiEthernet_Config *CfgPtr, UINTPTR EffectiveAddress)
 XAxiEthernet_CfgInitialize initializes an AXI Ethernet device along with the. More...
 
int XAxiEthernet_Initialize (XAxiEthernet *InstancePtr, XAxiEthernet_Config *CfgPtr, UINTPTR EffectiveAddress)
 XAxiEthernet_Initialize initializes an AXI Ethernet device along with the. More...
 
void XAxiEthernet_Start (XAxiEthernet *InstancePtr)
 XAxiEthernet_Start starts the Axi Ethernet device as follows:. More...
 
void XAxiEthernet_Stop (XAxiEthernet *InstancePtr)
 XAxiEthernet_Stop gracefully stops the Axi Ethernet device as follows:. More...
 
void XAxiEthernet_Reset (XAxiEthernet *InstancePtr)
 XAxiEthernet_Reset does not perform a soft reset of the AxiEthernet core. More...
 
int XAxiEthernet_SetMacAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
 Sets the MAC address for the AXI Ethernet device. More...
 
void XAxiEthernet_GetMacAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
 Reads the MAC address for the AXI Ethernet device. More...
 
int XAxiEthernet_SetOptions (XAxiEthernet *InstancePtr, u32 Options)
 XAxiEthernet_SetOptions enables the options, Options for the. More...
 
int XAxiEthernet_ClearOptions (XAxiEthernet *InstancePtr, u32 Options)
 XAxiEthernet_ClearOptions clears the options, Options for the. More...
 
u32 XAxiEthernet_GetOptions (XAxiEthernet *InstancePtr)
 XAxiEthernet_GetOptions returns the current option settings. More...
 
u16 XAxiEthernet_GetOperatingSpeed (XAxiEthernet *InstancePtr)
 Reads the current operating link speed. More...
 
int XAxiEthernet_SetOperatingSpeed (XAxiEthernet *InstancePtr, u16 Speed)
 Sets the current operating link speed. More...
 
void XAxiEthernet_SetBadFrmRcvOption (XAxiEthernet *InstancePtr)
 Enables the bad frame receive option. More...
 
void XAxiEthernet_ClearBadFrmRcvOption (XAxiEthernet *InstancePtr)
 Disables the bad frame receive option. More...
 
void XAxiEthernet_DisableControlFrameLenCheck (XAxiEthernet *InstancePtr)
 Disables the length check for control frames. More...
 
void XAxiEthernet_EnableControlFrameLenCheck (XAxiEthernet *InstancePtr)
 Enables the length check for control frames. More...
 
void XAxiEthernet_PhySetMdioDivisor (XAxiEthernet *InstancePtr, u8 Divisor)
 XAxiEthernet_PhySetMdioDivisor sets the MDIO clock divisor in the. More...
 
void XAxiEthernet_PhyRead (XAxiEthernet *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 *PhyDataPtr)
 XAxiEthernet_PhyRead reads the specified PHY register, RegiseterNum. More...
 
void XAxiEthernet_PhyWrite (XAxiEthernet *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 PhyData)
 XAxiEthernet_PhyWrite writes PhyData to the specified PHY register, RegiseterNum on the PHY specified by PhyAddress. More...
 
XAxiEthernet_Config * XAxiEthernet_LookupConfig (UINTPTR BaseAddress)
 Looks up device configuration by base address. More...
 
int XAxiEthernet_SetMacPauseAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
 XAxiEthernet_SetMacPauseAddress sets the MAC address used for pause frames. More...
 
void XAxiEthernet_GetMacPauseAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
 XAxiEthernet_GetMacPauseAddress gets the MAC address used for pause frames. More...
 
int XAxiEthernet_SendPausePacket (XAxiEthernet *InstancePtr, u16 PauseValue)
 XAxiEthernet_SendPausePacket sends a pause packet with the value of. More...
 
int XAxiEthernet_GetSgmiiStatus (XAxiEthernet *InstancePtr, u16 *SpeedPtr)
 XAxiEthernet_GetSgmiiStatus get the state of the link when using the SGMII. More...
 
int XAxiEthernet_GetRgmiiStatus (XAxiEthernet *InstancePtr, u16 *SpeedPtr, int *IsFullDuplexPtr, int *IsLinkUpPtr)
 XAxiEthernet_GetRgmiiStatus get the state of the link when using the RGMII. More...
 
int XAxiEthernet_MulticastAdd (XAxiEthernet *InstancePtr, void *AddressPtr, int Entry)
 XAxiEthernet_MulticastAdd adds the Ethernet address, AddressPtr to the. More...
 
void XAxiEthernet_MulticastGet (XAxiEthernet *InstancePtr, void *AddressPtr, int Entry)
 XAxiEthernet_MulticastGet gets the Ethernet address stored at. More...
 
int XAxiEthernet_MulticastClear (XAxiEthernet *InstancePtr, int Entry)
 XAxiEthernet_MulticastClear clears the Ethernet address stored at index. More...
 
int XAxiEthernet_SetTpid (XAxiEthernet *InstancePtr, u16 Tpid, u8 Entry)
 XAxiEthernet_SetTpid sets the VLAN Tag Protocol Identifier(TPID). More...
 
int XAxiEthernet_ClearTpid (XAxiEthernet *InstancePtr, u8 Entry)
 XAxiEthernet_ClearTpid clears the VLAN Tag Protocol Identifier(TPID). More...
 
void XAxiEthernet_GetTpid (XAxiEthernet *InstancePtr, u16 *TpidPtr, u8 Entry)
 XAxiEthernet_GetTpid gets the VLAN Tag Protocol Identifier value (TPID). More...
 
int XAxiEthernet_SetVTagMode (XAxiEthernet *InstancePtr, u32 Mode, int Dir)
 XAxiEthernet_SetVTagMode configures the VLAN tagging mode. More...
 
void XAxiEthernet_GetVTagMode (XAxiEthernet *InstancePtr, u8 *ModePtr, int Dir)
 XAxiEthernet_GetVTagMode gets VLAN tagging mode. More...
 
int XAxiEthernet_SetVStripMode (XAxiEthernet *InstancePtr, u32 Mode, int Dir)
 XAxiEthernet_SetVStripMode configures the VLAN strip mode. More...
 
void XAxiEthernet_GetVStripMode (XAxiEthernet *InstancePtr, u8 *ModePtr, int Dir)
 XAxiEthernet_GetVStripMode gets the VLAN stripping mode. More...
 
int XAxiEthernet_SetVTagValue (XAxiEthernet *InstancePtr, u32 VTagValue, int Dir)
 XAxiEthernet_SetVTagValue configures the VLAN tagging value. More...
 
void XAxiEthernet_GetVTagValue (XAxiEthernet *InstancePtr, u32 *VTagValuePtr, int Dir)
 XAxiEthernet_GetVTagValue gets the configured VLAN tagging value. More...
 
int XAxiEthernet_SetVidTable (XAxiEthernet *InstancePtr, u32 Entry, u32 Vid, u8 Strip, u8 Tag, int Dir)
 XAxiEthernet_SetVidTable sets VID table includes new VLAN ID, strip. More...
 
void XAxiEthernet_GetVidTable (XAxiEthernet *InstancePtr, u32 Entry, u32 *VidPtr, u8 *StripPtr, u8 *TagPtr, int Dir)
 XAxiEthernet_GetVidTable gets VID table content includes new VLAN ID, strip. More...
 
int XAxiEthernet_AddExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
 XAxiEthernet_AddExtMulticastGroup adds an entry to the multicast Ethernet. More...
 
int XAxiEthernet_ClearExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
 XAxiEthernet_ClearExtMulticastGroup clears input multicast Ethernet address. More...
 
int XAxiEthernet_GetExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
 XAxiEthernet_GetExtMulticastGroup returns whether the given Ethernet address. More...
 
void XAxiEthernet_DumpExtMulticastGroup (XAxiEthernet *InstancePtr)
 XAxiEthernet_DumpExtMulticastGroup dumps ALL provisioned acceptable multicast. More...
 
XStatus XAvb_CfgInitialize (XAvb *InstancePtr, XAvb_Config *ConfigPtr, u32 EffectiveAddress)
 A function to initialise variables in the data structure records. More...
 
void XAvb_Reset (XAvb *InstancePtr)
 Resets all of the AVB device driver functions to the start-up. More...
 
void XAvb_Start (XAvb *InstancePtr)
 start the PTP drivers running. More...
 
void XAvb_Stop (XAvb *InstancePtr)
 stop the PTP drivers from running. More...
 
void XAvb_PtpTimerInterruptHandler (XAvb *InstancePtr)
 The Interrupt subroutine for the "interruptPtpTimer" signal. More...
 
void XAvb_PtpRxInterruptHandler (XAvb *InstancePtr)
 The Interrupt subroutine for the "interrupt_ptp_rx" signal. More...
 
void XAvb_SetupRxFilterControlPcp (XAvb *InstancePtr, u32 VlanPriority, u8 SrClass)
 A function to set the VLAN PCP field for either SR A or B traffic in the. More...
 
void XAvb_SetupRxFilterControlVid (XAvb *InstancePtr, u32 VlanVid, u8 SrClass)
 A function to set the VLAN VID field for either SR A or B traffic in the. More...
 
void XAvb_SetupRxFilterControlMatchMode (XAvb *InstancePtr, u32 VlanMatchMode)
 A function to set the VLAN Match Mode field for the RX Filtering Control. More...
 
void AvbGMDiscontinuityHandler (void *CallBackRef, u32 TimestampsUncertain)
 is the handler which will be called if the PTP drivers. More...
 
int main ()
 Main entry point for the AVB example. More...
 
void XAvbMac_ReadStats (u32 BaseAddress, u32 CounterId, XAvb_Uint64 *Value)
 Reads the given Ethernet Statistic Register. More...
 
void XAvb_ReadRtc (u32 BaseAddress, XAvb_RtcFormat *RtcValue)
 Reads the current Real Time Counter (RTC) value. More...
 
void XAvb_WriteRtcOffset (u32 BaseAddress, XAvb_RtcFormat *RtcValue)
 Writes to the Real Time Counter (RTC) Offset Registers. More...
 
void XAvb_DecodeTxAnnounceFrame (XAvb *InstancePtr)
 A New Announce Packet has been written to this device to transmit. More...
 
void XAvb_DecodeRxAnnounceFrame (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A New Announce Packet has been received. More...
 
void XAvb_ReadAnnounceFrame (u32 BaseAddress, u32 PtpFrameBaseAddr, XAvb_BmcData *AnnounceFrame)
 Analyzes a new Announce packet. More...
 
void XAvb_ReadAnnounceReceiptTimeout (u32 BaseAddress, u32 PtpFrameBaseAddr, XAvb_BmcData *AnnounceFrame)
 Reads the logMessageinteval from an RX PTP Buffer and updates. More...
 
u32 XAvb_BestMasterClockAlgorithm (XAvb_BmcData *AnnounceFrame, XAvb_BmcData *CurrentBmc)
 accept the data pointer to the current BMCA records, accept. More...
 
void XAvb_UpdateBmcRecords (XAvb_BmcData *NewMaster, XAvb_BmcData *CurrentBmc)
 accept the data pointer to the current BMCA records, accept. More...
 
void XAvb_BecomeRtcMaster (XAvb *InstancePtr, u8 txAnnounceHasWon)
 make any adjustments needed when the node becomes the Grand. More...
 
void XAvb_BecomeRtcSlave (XAvb *InstancePtr)
 make any adjustments needed when the node becomes a PTP slave. More...
 
void XAvb_ChangePTPLockStatus (XAvb *InstancePtr, u8 locked)
 Operations needed when PTP locks or unlocks. More...
 
void XAvb_ChangePeerASCapability (XAvb *InstancePtr, u8 capable)
 Operations needed when the peer's AS capability changes. More...
 
void XAvb_SetGMDiscontinuityHandler (XAvb *InstancePtr, XAvb_Handler FuncPtr, void *CallBackRef)
 Sets the handler that will be called when a GM discontinuity. More...
 
u32 XAvb_CompareClockIdentity (u32 BaseAddress, XAvb_ClockIdentity Identity1, XAvb_ClockIdentity Identity2)
 A function to compare two ClockIdentity values. More...
 
u32 XAvb_ComparePortIdentity (u32 BaseAddress, XAvb_PortIdentity Identity1, XAvb_PortIdentity Identity2)
 A function to compare two PortIdentity values. More...
 
void XAvb_GetPortIdentity (u32 BaseAddress, u32 PtpFrameBaseAddr, u32 PortIdOffset, XAvb_PortIdentity *portID)
 A function to extract portIdentity information from a received PTP frame. More...
 
void XAvb_WriteToMultipleTxPtpFrames (u32 BaseAddress, u32 PtpFieldAddress, u32 Data, u32 DataBitEnable, u8 BufferEnable)
 A function to write common data (eg the Source Address) to all PTP frames. More...
 
u32 XAvb_ReorderWord (u32 Data)
 Switches the bytes in a 4-byte word, swapping the MSB for the. More...
 
u32 XAvb_IncSequenceId (u32 BaseAddress, u32 PtpFrameBaseAddress)
 A function to increment the sequenceId in a PTP frame template. More...
 
void XAvb_WaitOnTxPtpQueue (XAvb *InstancePtr)
 The software drivers are kept simple by only requesting a single PTP frame to. More...
 
void XAvb_MasterSendAnnounce (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP Announce Packet. More...
 
void XAvb_MasterSendSync (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP Sync Packet. More...
 
void XAvb_MasterSendFollowUp (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP Follow-Up Packet. More...
 
void XAvb_SendPDelayReq (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP PDelay Request. More...
 
void XAvb_SendPDelayResp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to format then request the transmission of a PTP PDelay Response. More...
 
void XAvb_SendPDelayRespFollowUp (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP PDelay Response. More...
 
u32 XAvb_IsRxFramePTP (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to check that various fields in the received frame contain the. More...
 
void XAvb_DecodeRxSync (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PTP Sync Packet. More...
 
void XAvb_DecodeRxFollowUp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PTP Follow-up Packet. More...
 
void XAvb_DecodeRxPDelayResp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PDelayResp Packet. More...
 
void XAvb_DecodeRxPDelayRespFollowUp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PDelayRespFollowUp Packet. More...
 
void XAvb_DecodeRxSignaling (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received Signalling Packet and modify the TX PTP. More...
 
u16 XAvb_UpdateIntervalDuration (u16 currentIntervalDuration, char logMeanVal)
 A function to update a PTP message Interval Duration (defined as a. More...
 
u16 XAvb_ConvertLogMeanToDuration (char logMeanVal)
 A function to convert a logMean (power of 2) value into a fraction of 128. More...
 
char XAvb_ConvertDurationToLogMean (u16 fractionalVal)
 A function to convert a fraction of 128 value that is compatible with. More...
 
void XAvb_UpdateLogMeanMessageInterval (u32 BaseAddress, u32 PtpFrameBaseAddr, u16 intervalDuration)
 A function to update the logMeanMessageInterval field in a PTP packet. More...
 
void XAvb_SetupSourcePortIdentity (XAvb *InstancePtr, XAvb_PortIdentity systemIdentity)
 Updates the portIdLocal local copy of the sourcePortIdentity. More...
 
u32 XAvb_CaptureNanoSec (u32 BaseAddress, u32 PtpFrameBaseAddr)
 Captures the nanosecond timestamp field from a received PTP frame. More...
 
void XAvb_CalcDelay (XAvb *InstancePtr)
 Measures the link delay of the local full-duplex Ethernet link. More...
 
void XAvb_CalcRtcOffset (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 Calculates the slave RTC offset from the grandmaster time. More...
 
void XAvb_Adjust8kClock (u32 BaseAddress, u32 NewOffset)
 Adjusts the phase offset of the 8 kHz clock. More...
 
void XAvb_UpdateRtcIncrement (XAvb *InstancePtr)
 Calculates the RTC increment value based on the slave error. More...
 
void AxiEthernetUtilSetupUart (void)
 Configures the UART used by the example. More...
 
void AxiEthernetUtilFrameHdrFormatMAC (EthernetFrame *FramePtr, char *DestAddr)
 Formats an Ethernet frame header with the destination MAC address. More...
 
void AxiEthernetUtilFrameHdrFormatType (EthernetFrame *FramePtr, u16 FrameType)
 Formats an Ethernet frame header with the EtherType value. More...
 
void AxiEthernetUtilFrameSetPayloadData (EthernetFrame *FramePtr, int PayloadSize)
 Fills an Ethernet frame payload with test data. More...
 
void AxiEthernetUtilFrameHdrVlanFormatVid (EthernetFrame *FramePtr, u32 VlanNumber, u32 Vid)
 Formats a VLAN Ethernet frame header with the VLAN ID. More...
 
void AxiEthernetUtilFrameHdrVlanFormatType (EthernetFrame *FramePtr, u16 FrameType, u32 VlanNumber)
 Formats a VLAN Ethernet frame header with the EtherType value. More...
 
void AxiEthernetUtilFrameSetVlanPayloadData (EthernetFrame *FramePtr, int PayloadSize, u32 VlanNumber)
 Fills a VLAN Ethernet frame payload with test data. More...
 
int AxiEthernetUtilFrameVerify (EthernetFrame *CheckFrame, EthernetFrame *ActualFrame)
 Verifies that two Ethernet frames contain the same data. More...
 
void AxiEthernetUtilFrameMemClear (EthernetFrame *FramePtr)
 Clears an Ethernet frame buffer. More...
 
int AxiEthernetUtilEnterLoopback (XAxiEthernet *AxiEthernetInstancePtr, int Speed)
 Sets the PHY to loopback mode. More...
 
void AxiEthernetUtilErrorTrap (char *Message)
 Called by example code when an error is detected. More...
 
void AxiEthernetUtilPhyDelay (unsigned int Seconds)
 Delays for the specified number of seconds while PHY hardware recovers. More...
 
int AxiEthernetUtilConfigureInternalPhy (XAxiEthernet *AxiEthernetInstancePtr, int Speed)
 Configures the internal phy for SGMII and 1000baseX modes. More...
 
int AxiEtherentConfigureTIPhy (XAxiEthernet *AxiEthernetInstancePtr, u32 PhyAddr)
 Configures a TI PHY for SGMII operation. More...
 
int AxiEthernetMcastExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates the usage of the Axi Ethernet extended. More...
 
int AxiEthernetSgDmaIntrExtMulticastExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends and receives a single packet in loopback mode with. More...
 
int AxiEthernetExtVlanExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates the usage of the Axi Ethernet by sending. More...
 
int AxiEthernetSgDmaIntrExtVlanExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends and receives a single packet in loopback mode with. More...
 
int AxiEthernetFifoIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XLlFifo *FifoInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates AXI Ethernet usage by sending and receiving frames in. More...
 
int AxiEthernetSingleFrameIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XLlFifo *FifoInstancePtr)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSingleFrameNonContIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XLlFifo *FifoInstancePtr)
 This example sends a packet from non-contiguous memory locations. More...
 
int AxiEthernetMultipleFramesIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XLlFifo *FifoInstancePtr)
 This example sends and receives a batch of frames. More...
 
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...
 
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...
 
int AxiEthernetSgDmaIntrExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates the usage of the Axi Ethernet by sending. More...
 
int AxiEthernetSgDmaIntrSingleFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSgDmaIntrCoalescingExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends frames with the interrupt coalescing settings altered. More...
 
int AxiEthernetSgDmaPartialChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends and receives a single packet in loopback mode with. More...
 
int AxiEthernetSgDmaFullChecksumOffloadExample (XAxiEthernet *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)
 This example sends and receives a single packet in loopback mode with. More...
 
int AxiEthernetSgDmaPollExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 Demonstrates the usage of the Axi Ethernet by sending. More...
 
int AxiEthernetSgDmaSingleFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSgDmaMultiFrameExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int CheckTxDmaResult (XMcdma *InstancePtr)
 Checks the transmit DMA completion result. More...
 
int CheckDmaResult (XMcdma *InstancePtr)
 Checks the receive DMA completion result. More...
 
int AxiEthernetPolledExample (u16 AxiEthernetDeviceId, u16 FifoDeviceId)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetSingleFramePolledExample (void)
 Demonstrates the usage of the Axi Ethernet by sending and. More...
 
int AxiEthernetMultipleFramesPolledExample (void)
 This example uses polled mode to queue up multiple frames in the packet. More...
 
int AxiEthernetPollForTxStatus (void)
 Polls the Tx status and waits for an indication that a frame has been transmitted successfully or a transmit related error has occurred. More...
 
int AxiEthernetPollForRxStatus (void)
 Polls the Rx status and waits for an indication that a frame has arrived or a receive related error has occurred. More...
 
int AxiEthernetResetDevice (void)
 Resets the device but preserves the options set by the user. More...
 
u32 AxiEthernetDetectPHY (XAxiEthernet *AxiEthernetInstancePtr)
 Detects the PHY address from MII status register contents. More...
 
int AxiEthernetPingReqExample (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR AxiEthernetBaseAddress)
 The entry point for the AxiEthernet driver to ping request example in polled. More...
 
void SendArpReqFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 send a ARP request packet. More...
 
void SendEchoReqFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 send a Echo request packet. More...
 
int ProcessRecvFrame (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 process the received packet. More...
 
int XAxienet_Send (XAxiEthernet *AxiEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId, UINTPTR TxBufPtr, u32 len)
 Sends a frame through AXI Ethernet and MCDMA. More...
 
int XAxiEnet_Recv (XMcdma *InstancePtr)
 Receives a frame through AXI Ethernet and MCDMA. More...
 
int PhySetup (XAxiEthernet *AxiEthernetInstancePtr)
 Sets up the PHY for the ping example. More...
 
int RxSetup (XMcdma *McDmaInstPtr, XAxiEthernet *AxiEthernetInstancePtr, u8 ChanId, u32 NumPkts)
 Sets up receive path resources for the example. More...
 
int GetBufAddr ()
 Returns a transmit buffer address for the channel. More...
 
int GetRxBufAddr ()
 Returns a receive buffer address for the channel. More...
 

Configuration options

Device configuration options used with XAxiEthernet_SetOptions(), XAxiEthernet_ClearOptions(), and XAxiEthernet_GetOptions().

The default state of each option is noted below. XAE_DEFAULT_OPTIONS is the bitmask applied by XAxiEthernet_Reset() and XAxiEthernet_CfgInitialize().

#define XAE_PROMISC_OPTION   0x00000001
 Accepts all incoming packets. More...
 
#define XAE_JUMBO_OPTION   0x00000002
 Accepts jumbo frames for TX and RX. More...
 
#define XAE_VLAN_OPTION   0x00000004
 Enables VLAN support for TX and RX. More...
 
#define XAE_FLOW_CONTROL_OPTION   0x00000008
 Recognizes received flow control frames. More...
 
#define XAE_FCS_STRIP_OPTION   0x00000010
 Strips FCS and PAD from RX frames. More...
 
#define XAE_FCS_INSERT_OPTION   0x00000020
 Inserts FCS and PAD on TX frames. More...
 
#define XAE_LENTYPE_ERR_OPTION   0x00000040
 Enables Length/Type error checking on RX. More...
 
#define XAE_TRANSMITTER_ENABLE_OPTION   0x00000080
 Enables the transmitter. More...
 
#define XAE_RECEIVER_ENABLE_OPTION   0x00000100
 Enables the receiver. More...
 
#define XAE_BROADCAST_OPTION   0x00000200
 Receives broadcast frames. More...
 
#define XAE_MULTICAST_OPTION   0x00000400
 Receives programmed multicast frames. More...
 
#define XAE_EXT_MULTICAST_OPTION   0x00000800
 Enables the extended multicast address table. More...
 
#define XAE_EXT_TXVLAN_TRAN_OPTION   0x00001000
 Enables TX VLAN translation. More...
 
#define XAE_EXT_RXVLAN_TRAN_OPTION   0x00002000
 Enables RX VLAN translation. More...
 
#define XAE_EXT_TXVLAN_TAG_OPTION   0x00004000
 Enables TX VLAN tagging. More...
 
#define XAE_EXT_RXVLAN_TAG_OPTION   0x00008000
 Enables RX VLAN tagging. More...
 
#define XAE_EXT_TXVLAN_STRP_OPTION   0x00010000
 Enables TX VLAN stripping. More...
 
#define XAE_EXT_RXVLAN_STRP_OPTION   0x00020000
 Enables RX VLAN stripping. More...
 
#define XAE_DEFAULT_OPTIONS   (XAE_FLOW_CONTROL_OPTION | XAE_BROADCAST_OPTION | XAE_FCS_INSERT_OPTION | XAE_FCS_STRIP_OPTION | XAE_LENTYPE_ERR_OPTION | XAE_TRANSMITTER_ENABLE_OPTION | XAE_RECEIVER_ENABLE_OPTION)
 Default options applied by XAxiEthernet_Reset() and XAxiEthernet_CfgInitialize(). More...
 

Ethernet buffer size constants

Constants that help upper layers size memory pools for Ethernet buffers and descriptor lists.

#define XAE_MAC_ADDR_SIZE   6
 Size of a MAC address in bytes. More...
 
#define XAE_MTU   1500
 Maximum MTU size of an Ethernet frame. More...
 
#define XAE_JUMBO_MTU   8982
 Maximum MTU size of a jumbo Ethernet frame. More...
 
#define XAE_HDR_SIZE   14
 Size of an Ethernet header in bytes. More...
 
#define XAE_HDR_VLAN_SIZE   18
 Size of an Ethernet header with VLAN in bytes. More...
 
#define XAE_TRL_SIZE   4
 Size of an Ethernet trailer (FCS) in bytes. More...
 
#define XAE_MAX_FRAME_SIZE   (XAE_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
 Maximum Ethernet frame size including header and trailer. More...
 
#define XAE_MAX_VLAN_FRAME_SIZE   (XAE_MTU + XAE_HDR_VLAN_SIZE + XAE_TRL_SIZE)
 Maximum VLAN Ethernet frame size including header and trailer. More...
 
#define XAE_MAX_JUMBO_FRAME_SIZE   (XAE_JUMBO_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
 Maximum jumbo Ethernet frame size including header and trailer. More...
 

PHY interface type constants

Values returned by XAxiEthernet_GetPhysicalInterface().

These match design parameters from the AXI Ethernet specification.

#define XAE_PHY_TYPE_RGMII   9
 RGMII PHY interface type. More...
 
#define XAE_PHY_TYPE_RGMII_ID   10
 RGMII with internal delay PHY interface type. More...
 
#define XAE_PHY_TYPE_RGMII_RXID   11
 RGMII with RX internal delay PHY interface type. More...
 
#define XAE_PHY_TYPE_RGMII_TXID   12
 RGMII with TX internal delay PHY interface type. More...
 
#define XAE_PHY_INTERFACE_MODE_NA   0
 PHY interface mode is not applicable. More...
 
#define XAE_PHY_TYPE_MII   2
 MII PHY interface type. More...
 
#define XAE_PHY_TYPE_GMII   3
 GMII PHY interface type. More...
 
#define XAE_PHY_TYPE_SGMII   4
 SGMII PHY interface type. More...
 
#define XAE_PHY_TYPE_RGMII_1_3   XAE_PHY_TYPE_RGMII
 RGMII 1.3 PHY interface type. More...
 
#define XAE_PHY_TYPE_RGMII_2_0   XAE_PHY_TYPE_RGMII_RXID
 RGMII 2.0 PHY interface type. More...
 
#define XAE_PHY_TYPE_1000BASE_X   21
 1000BASE-X PHY interface type. More...
 

VLAN tag and strip mode constants

Values passed into XAxiEthernet_SetVTagMode() and XAxiEthernet_SetVStripMode() and returned by XAxiEthernet_GetVTagMode() and XAxiEthernet_GetVStripMode().

#define XAE_VTAG_NONE   0
 No VLAN tagging. More...
 
#define XAE_VTAG_ALL   1
 Tag all frames. More...
 
#define XAE_VTAG_EXISTED   2
 Tag already tagged frames. More...
 
#define XAE_VTAG_SELECT   3
 Tag selected already tagged frames. More...
 
#define XAE_DEFAULT_TXVTAG_MODE   XAE_VTAG_ALL
 Default TX VLAN tag mode. More...
 
#define XAE_DEFAULT_RXVTAG_MODE   XAE_VTAG_ALL
 Default RX VLAN tag mode. More...
 
#define XAE_VSTRP_NONE   0
 No VLAN stripping. More...
 
#define XAE_VSTRP_ALL   1
 Strip one tag from all frames. More...
 
#define XAE_VSTRP_SELECT   3
 Strip one tag from selected frames. More...
 
#define XAE_DEFAULT_TXVSTRP_MODE   XAE_VSTRP_ALL
 Default TX VLAN strip mode. More...
 
#define XAE_DEFAULT_RXVSTRP_MODE   XAE_VSTRP_ALL
 Default RX VLAN strip mode. More...
 

TEMAC type constants

#define XAE_SOFT_TEMAC_10_100_MBPS   0
 Soft TEMAC at 10/100 Mbps. More...
 
#define XAE_SOFT_TEMAC_10_100_1000_MBPS   1
 Soft TEMAC at 10/100/1000 Mbps. More...
 
#define XAE_HARD_TEMC   2
 Hard TEMAC type. More...
 

AXI Ethernet DMA device type constants

#define XPAR_AXI_FIFO   1U
 AXI FIFO device type. More...
 
#define XPAR_AXI_DMA   2U
 AXI DMA device type. More...
 
#define XPAR_AXI_MCDMA   3U
 AXI MCDMA device type. More...
 

AXI Ethernet device type masks

#define XAE_AXIDEVTYPE_MASK   0xF
 Mask for the AXI device type field. More...
 
#define XAE_AXIBASEADDR_MASK   0xFFFFFFFFFFFFFFF0
 Mask for the AXI device base address field. More...
 

Macro Definition Documentation

#define ARP_REPLY   0x02

ARP status bits indicating reply.

Referenced by ProcessRecvFrame().

#define ARP_REQ_PKT_SIZE   0x2A

ARP request packet size.

Referenced by SendArpReqFrame().

#define ARP_REQ_SRC_IP_LOC   14

Src IP add loc of ARP req Packet.

Referenced by ProcessRecvFrame().

#define ARP_REQ_STATUS_LOC   10

ARP request loc.

Referenced by ProcessRecvFrame().

#define ARP_REQUEST   0x01

ARP Request bits in Rx packet.

Referenced by SendArpReqFrame().

#define AVB_PTP_INTERRUPT_ID   XPAR_INTC_0_AXIETHERNET_0_AV_INTERRUPT_10MS_VEC_ID

AVB PTP timer interrupt ID.

#define AVB_PTP_RX_INTERRUPT_ID   XPAR_INTC_0_AXIETHERNET_0_AV_INTERRUPT_PTP_RX_VEC_ID

AVB PTP receive interrupt ID.

#define AXIDMA_DEVICE_ID   XPAR_AXIDMA_0_DEVICE_ID

AXI DMA device ID.

#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID

Device ID for AXI Ethernet.

#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID

The following constants map to the XPAR parameters created in the.

xparameters.h file. They are defined here such that a user can easily change all the needed parameters in one place.AXI Ethernet device ID.

Referenced by main().

#define AXIETHERNET_DEVICE_ID   XPAR_AXIETHERNET_0_DEVICE_ID

AXI Ethernet device ID.

#define AXIETHERNET_LOOPBACK_SPEED_2p5G   2500

2p5G for 2.5G MAC.

Referenced by AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().

#define AXIETHERNET_PHY_DELAY_SEC   4

Amount of time to delay waiting on PHY to reset.

Referenced by AxiEthernetUtilEnterLoopback().

#define BD_ALIGNMENT   64

Byte alignment of BDs.

#define BD_ALIGNMENT   64

Byte alignment of BDs.

#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT

Byte alignment of BDs.

Referenced by AxiEthernetExtVlanExample().

#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT

Byte alignment of BDs.

Referenced by AxiEthernetMcastExample().

#define BD_ALIGNMENT   64

Byte alignment of BDs.

#define BD_ALIGNMENT   XAXIDMA_BD_MINIMUM_ALIGNMENT*2

Byte alignment required for buffer descriptors.

Referenced by AxiEthernetSgDmaIntrExample().

#define BD_RX_STATUS_OFFSET   2

BD RX STATUS OFFSET.

#define BD_USR0_OFFSET   0

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 0 means, Control Word 0, used for enabling checksum offloading.

#define BD_USR0_OFFSET   0

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 0 means, Control Word 0, used for enabling checksum offloading.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample(), and AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_USR0_OFFSET   0

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 0 means, Control Word 0, used for enabling checksum offloading.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample(), and AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_USR1_OFFSET   1

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 1 means, Control Word 1, used for mentioning checksum begin and checksum insert points.

#define BD_USR1_OFFSET   1

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 1 means, Control Word 1, used for mentioning checksum begin and checksum insert points.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_USR1_OFFSET   1

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 1 means, Control Word 1, used for mentioning checksum begin and checksum insert points.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_USR2_OFFSET   2

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 2 means, Control Word 2, used for mentioning checksum seed.

#define BD_USR2_OFFSET   2

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 2 means, Control Word 2, used for mentioning checksum seed.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_USR2_OFFSET   2

AXI4-Stream Control Word offset from the start of app user words in BD.

Offset 2 means, Control Word 2, used for mentioning checksum seed.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define BD_VLAN_TPID_OFFSET   3

AXI4-Stream status Word offset from the start of app user words in BD.

TPID is at status word 3, bits 31-16.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define BD_VLAN_VID_OFFSET   4

AXI4-Stream status word offset from the start of app user words in BD.

VID is at status word 4, bits 31-16.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define BLOCK_SIZE_2MB   0x200000U

BLOCK SIZE 2MB.

Referenced by AxiEthernetSgDmaPollExample().

#define BLOCK_SIZE_2MB   0x200000U

BLOCK SIZE 2MB.

Referenced by AxiEthernetSgDmaIntrExample().

#define BROADCAST_ADDR   0xFFFF

Broadcast Address.

Referenced by SendArpReqFrame().

#define CORRECT_CHECKSUM_VALUE   0xFFFF

Correct checksum value.

Referenced by ProcessRecvFrame().

#define DELAY   1000000

Used to introduce delay.

Referenced by AxiEthernetPingReqExample().

#define DUMMY_TCP_PORT_1   0x1111

DUMMY TCP PORT 1.

#define DUMMY_TCP_PORT_1   0x1111

DUMMY TCP PORT 1.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define DUMMY_TCP_PORT_1   0x1111

DUMMY TCP PORT 1.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define DUMMY_TCP_PORT_2   0x1112

DUMMY TCP PORT 2.

#define DUMMY_TCP_PORT_2   0x1112

DUMMY TCP PORT 2.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define DUMMY_TCP_PORT_2   0x1112

DUMMY TCP PORT 2.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define ECHO_REPLY   0x00

Echo reply.

Referenced by ProcessRecvFrame().

#define ETH_SYSTEM_ADDRESS_EUI48_HIGH   0x000A35

Upper bytes of the Ethernet EUI-48 address.

Referenced by main().

#define ETH_SYSTEM_ADDRESS_EUI48_LOW   0x010203

Lower bytes of the Ethernet EUI-48 address.

Referenced by main().

#define ETHER_PROTO_TYPE_LOC   6

Ethernet Proto type loc.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define FIFO_DEVICE_ID   XPAR_AXI_FIFO_0_DEVICE_ID

Device ID for AXI FIFO.

#define FULL_CSUM_ENABLE   0x00000002

Option for full csum enable.

#define FULL_CSUM_ENABLE   0x00000002

Option for full csum enable.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define FULL_CSUM_ENABLE   0x00000002

Option for full csum enable.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define FULL_CSUM_STATUS_MASK   0x00000038

Mask to extract full checksum status field from AXI4 Stream Status Word 2.

#define FULL_CSUM_STATUS_MASK   0x00000038

Mask to extract full checksum status field from AXI4 Stream Status Word 2.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define FULL_CSUM_STATUS_MASK   0x00000038

Mask to extract full checksum status field from AXI4 Stream Status Word 2.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#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.

#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.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#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.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define HW_TYPE   0x01

Hardware type (10/100 Mbps).

Referenced by SendArpReqFrame().

#define ICMP_DATA_CHECKSUM_LOC   18

ICMP data checksum location.

Referenced by SendEchoReqFrame().

#define ICMP_DATA_FIELD_LEN   20

Data field length.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_DATA_LEN   18

ICMP data length.

Referenced by SendEchoReqFrame().

#define ICMP_DATA_LOC   19

ICMP data loc including identifier number and sequence number.

#define ICMP_DATA_START_LOC   17

Data field start location.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_ECHO_FIELD_LOC   17

Echo field loc.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_IDEN_FIELD_LOC   19

Identifier field loc.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_KNOWN_DATA_LEN   16

ICMP known data length.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_KNOWN_DATA_LOC   21

ICMP known data start loc.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define ICMP_PKT_SIZE   0x4A

ICMP packet length 74 Bytes including Src and dest MAC Add.

Referenced by GetBufAddr(), and SendEchoReqFrame().

#define ICMP_SEQ_NO_LOC   20

sequence number location.

Referenced by ProcessRecvFrame().

#define IDEN_NUM   0x02

ICMP identifier number.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define IP_ADDR_LEN   2

Size of IP address.

Referenced by ProcessRecvFrame(), SendArpReqFrame(), and SendEchoReqFrame().

#define IP_ADDR_SIZE   4

IP Address size in Bytes.

#define IP_CHECKSUM_LOC   12

IP header checksum location.

Referenced by SendEchoReqFrame().

#define IP_CSUM_OK_TCP_NOT_CHECKED   0x00000001

IP CSUM OK TCP NOT CHECKED.

#define IP_CSUM_OK_TCP_NOT_CHECKED   0x00000001

IP CSUM OK TCP NOT CHECKED.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_CSUM_OK_TCP_NOT_CHECKED   0x00000001

IP CSUM OK TCP NOT CHECKED.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_CSUM_OK_TCP_NOT_OK   0x00000006

IP CSUM OK TCP NOT OK.

#define IP_CSUM_OK_TCP_NOT_OK   0x00000006

IP CSUM OK TCP NOT OK.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_CSUM_OK_TCP_NOT_OK   0x00000006

IP CSUM OK TCP NOT OK.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_INFO_LEN   7

IP header information length.

#define IP_HEADER_LEN   10

IP header length.

Referenced by SendEchoReqFrame().

#define IP_HEADER_LEN_IN_WORDS   0x05

For our case, the header length is always 20 bytes (5 words.

#define IP_HEADER_LEN_IN_WORDS   0x05

For our case, the header length is always 20 bytes (5 words.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_LEN_IN_WORDS   0x05

For our case, the header length is always 20 bytes (5 words.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

#define IP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_PROTOCOL_TCP   0x6

IP header protocol entry.

For TCP packets, it is 6.

#define IP_HEADER_PROTOCOL_TCP   0x6

IP header protocol entry.

For TCP packets, it is 6.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_PROTOCOL_TCP   0x6

IP header protocol entry.

For TCP packets, it is 6.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_PROTOCOL_UDP   0x17

IP header protocol entry.

For UDP packets, it is 17.

#define IP_HEADER_PROTOCOL_UDP   0x17

IP header protocol entry.

For UDP packets, it is 17.

#define IP_HEADER_PROTOCOL_UDP   0x17

IP header protocol entry.

For UDP packets, it is 17.

#define IP_HEADER_VERSION   0x04

For IPv4, the version entry in IP header is always 4.

#define IP_HEADER_VERSION   0x04

For IPv4, the version entry in IP header is always 4.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_HEADER_VERSION   0x04

For IPv4, the version entry in IP header is always 4.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_REQ_DEST_IP_LOC   15

Dest IP add loc of ICMP req.

Referenced by SendEchoReqFrame().

#define IP_REQ_SRC_IP_LOC   13

Src IP add loc of ICMP req.

Referenced by SendEchoReqFrame().

#define IP_START_LOC   7

IP header start location.

Referenced by SendEchoReqFrame().

#define IP_TCP_CSUMS_NOT_CHECKED   0x00000000

IP TCP CSUMS NOT CHECKED.

#define IP_TCP_CSUMS_NOT_CHECKED   0x00000000

IP TCP CSUMS NOT CHECKED.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_TCP_CSUMS_NOT_CHECKED   0x00000000

IP TCP CSUMS NOT CHECKED.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_VERSION   0x0604

IP version ipv4/ipv6.

Referenced by SendArpReqFrame().

#define IP_VERSION_4   0x800

For IPV4, the Ethernet frame type/length field will have a value of 0x800.

#define IP_VERSION_4   0x800

For IPV4, the Ethernet frame type/length field will have a value of 0x800.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define IP_VERSION_4   0x800

For IPV4, the Ethernet frame type/length field will have a value of 0x800.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define MAC_ADDR_LEN   3

MAC address length.

Referenced by ProcessRecvFrame(), SendArpReqFrame(), and SendEchoReqFrame().

#define MARVEL_PHY_88E1111_MODEL   0xC0

MARVEL PHY 88E1111 MODEL.

Referenced by AxiEthernetUtilEnterLoopback().

#define MARVEL_PHY_88E1116R_MODEL   0x240

MARVEL PHY 88E1116R MODEL.

Referenced by AxiEthernetUtilEnterLoopback().

#define MAX_MULTICAST_ADDR   (1<<23)

Maximum number of multicast Ethernet MAC addresses.

#define NUM_OF_PING_REQ_PKTS   10

Number of ping req it generates.

Referenced by AxiEthernetPingReqExample(), and ProcessRecvFrame().

#define NUM_PACK_CHECK_RX_PACK   8000000

Max number of pack to be checked before to identify a Rx packet.

Referenced by AxiEthernetPingReqExample().

#define NUM_PACKETS   50

Number of packets to send in the example.

Referenced by AxiEthernetSgDmaIntrMultiFrameExample(), and AxiEthernetSgDmaMultiFrameExample().

#define NUM_RX_PACK_CHECK_REQ   10

Max num of Rx pack to be checked before sending another request.

Referenced by AxiEthernetPingReqExample().

#define PARTIAL_CSUM_ENABLE   0x00000001

Option for partial csum enable.

#define PARTIAL_CSUM_ENABLE   0x00000001

Option for partial csum enable.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define PARTIAL_CSUM_ENABLE   0x00000001

Option for partial csum enable.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define PAYLOAD_SIZE   1000

Payload size used in examples.

Referenced by AxiEthernetSgDmaMultiFrameExample(), and AxiEthernetSgDmaSingleFrameExample().

#define PAYLOAD_SIZE   1000

Payload size used in examples.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define PAYLOAD_SIZE   1000

Payload size used in examples.

Referenced by AxiEthernetSgDmaIntrExtMulticastExample().

#define PAYLOAD_SIZE   100

Payload size used in examples.

Referenced by AxiEthernetSingleFrameIntrExample().

#define PAYLOAD_SIZE   1000
#define PAYLOAD_SIZE   1000
#define PHY_DETECT_MASK   0x1808

PHY detect register mask.

#define PHY_DETECT_MASK   0x1808

PHY detect register feature mask.

Referenced by AxiEthernetDetectPHY().

#define PHY_DETECT_REG   1

PHY DETECT REG.

#define PHY_DETECT_REG   1

MII status register used to detect the PHY.

Referenced by AxiEthernetDetectPHY().

#define PHY_MODEL_NUM_MASK   0x3F0

PHY MODEL NUM MASK.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_PG2_R21_CTRL_REG   21

PHY PG2 R21 CTRL REG.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R0_ANEG_ENABLE   0x1000

PHY auto-negotiation enable bit.

Referenced by AxiEthernetUtilConfigureInternalPhy(), AxiEthernetUtilEnterLoopback(), and PhySetup().

#define PHY_R0_CTRL_REG   0
#define PHY_R0_DFT_SPD_10   0x0000

PHY default speed bit for 10 Mbps.

Referenced by AxiEthernetUtilConfigureInternalPhy(), and AxiEthernetUtilEnterLoopback().

#define PHY_R0_DFT_SPD_100   0x2000

PHY default speed bit for 100 Mbps.

Referenced by AxiEthernetUtilConfigureInternalPhy(), and AxiEthernetUtilEnterLoopback().

#define PHY_R0_DFT_SPD_1000   0x0040

PHY default speed bit for 1000 Mbps.

Referenced by AxiEthernetUtilConfigureInternalPhy(), and AxiEthernetUtilEnterLoopback().

#define PHY_R0_DFT_SPD_1000   0x0040

PHY default speed bit for 1000 Mbps.

Referenced by PhySetup().

#define PHY_R0_DFT_SPD_2500   0x0040

Default PHY speed bits for 2500 Mbps.

Referenced by AxiEthernetUtilConfigureInternalPhy(), and AxiEthernetUtilEnterLoopback().

#define PHY_R0_DFT_SPD_MASK   0x2040

PHY default speed field mask.

#define PHY_R0_ISOLATE   0x0400

PHY R0 ISOLATE.

Referenced by AxiEthernetUtilConfigureInternalPhy(), and PhySetup().

#define PHY_R0_LOOPBACK   0x4000

PHY control register loopback bit.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R0_LOOPBACK   0x4000

PHY control register loopback bit.

#define PHY_R0_RESET   0x8000

PHY control register reset bit.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R0_RESET   0x8000

PHY control register reset bit.

#define PHY_R20_DFT_SPD_10   0x20

PHY R20 DFT SPD 10.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R20_DFT_SPD_100   0x50

PHY R20 DFT SPD 100.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R20_DFT_SPD_1000   0x60

PHY R20 DFT SPD 1000.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R20_EXTND_CTRL_REG   20

PHY R20 EXTND CTRL REG.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R20_RX_DLY   0x80

PHY R20 RX DLY.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R22_PAGE_ADDR_REG   22

PHY R22 PAGE ADDR REG.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R27_EXTND_STS_REG   27

PHY R27 EXTND STS REG.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R27_MAC_CONFIG_GMII   0x000F

PHY R27 MAC CONFIG GMII.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R27_MAC_CONFIG_MII   0x000F

PHY R27 MAC CONFIG MII.

#define PHY_R27_MAC_CONFIG_RGMII   0x000B

PHY R27 MAC CONFIG RGMII.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R27_MAC_CONFIG_SGMII   0x0004

PHY R27 MAC CONFIG SGMII.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_R3_PHY_IDENT_REG   3

PHY identifier register address.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_REG21_10   0x0030

PHY REG21 10.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_REG21_100   0x2030

PHY REG21 100.

Referenced by AxiEthernetUtilEnterLoopback().

#define PHY_REG21_1000   0x0070

PHY REG21 1000.

Referenced by AxiEthernetUtilEnterLoopback().

#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.

#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.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#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.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define RXBD_CNT   1024

Number of RxBDs to use.

Referenced by AxiEthernetSgDmaPollExample().

#define RXBD_CNT   1024

Number of RxBDs to use.

#define RXBD_CNT   128

Number of RxBDs to use.

Referenced by AxiEthernetExtVlanExample().

#define RXBD_CNT   128

Number of RxBDs to use.

Referenced by AxiEthernetMcastExample().

#define RXBD_CNT   1024

Number of RxBDs to use.

Referenced by AxiEthernetSgDmaIntrExample().

#define RXBD_CNT   128

Number of RxBDs to use.

Referenced by AxiEthernetSgDmaIntrExample().

#define RXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT)

RXBD SPACE BYTES.

#define RXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT)

RXBD SPACE BYTES.

#define RXBD_SPACE_BYTES   RXBD_CNT * 64 * 16

RXBD SPACE BYTES.

#define RXBD_SPACE_BYTES   RXBD_CNT * 64 * 16

RXBD SPACE BYTES.

#define RXBD_SPACE_BYTES   RXBD_CNT * 64 * 16

RXBD SPACE BYTES.

#define RXBD_SPACE_BYTES   (XAxiDma_BdRingMemCalc(BD_ALIGNMENT, RXBD_CNT))

RXBD SPACE BYTES.

#define SRC_MAC_ADDR_LOC   3

Src MAC address location.

Referenced by ProcessRecvFrame(), and SendEchoReqFrame().

#define TCP_CSUM_NOT_CHECKED_IP_NOT_OK   0x00000005

TCP CSUM NOT CHECKED IP NOT OK.

#define TCP_CSUM_NOT_CHECKED_IP_NOT_OK   0x00000005

TCP CSUM NOT CHECKED IP NOT OK.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TCP_CSUM_NOT_CHECKED_IP_NOT_OK   0x00000005

TCP CSUM NOT CHECKED IP NOT OK.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TCP_HEADER_LEN_IN_WORDS   0x5

For our case, the header length is always 20 bytes (5 words).

#define TCP_HEADER_LEN_IN_WORDS   0x5

For our case, the header length is always 20 bytes (5 words).

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TCP_HEADER_LEN_IN_WORDS   0x5

For our case, the header length is always 20 bytes (5 words).

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TCP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

#define TCP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TCP_HEADER_LENGTH   20

IP header length in bytes.

Used as offset to kigure out the start of TCP header.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample().

#define TI_PHY_ADDDR   0xE

TI PHY ADDDR.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CFGR2   0x14

TI PHY CFGR2.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CFGR2_SGMII_AUTONEG_EN   0x0080

TI PHY CFGR2 SGMII AUTONEG EN.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CR   0xD

TI PHY CR.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CR_DEVAD_DATAEN   0x4000

TI PHY CR DEVAD DATAEN.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CR_DEVAD_EN   0x001F

TI PHY CR DEVAD EN.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_CR_SGMII_EN   0x0800

TI PHY CR SGMII EN.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_IDENTIFIER   0x2000

TI PHY IDENTIFIER.

#define TI_PHY_MODEL   0x230

TI PHY MODEL.

Referenced by AxiEthernetUtilEnterLoopback().

#define TI_PHY_PHYCTRL   0x10

TI PHY PHYCTRL.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_SGMIICLK_EN   0x4000

TI PHY SGMIICLK EN.

Referenced by AxiEtherentConfigureTIPhy().

#define TI_PHY_SGMIITYPE   0xD3

TI PHY SGMIITYPE.

Referenced by AxiEtherentConfigureTIPhy().

#define TPID_MASK   0xFFFF0000

Mask to extract TPID from the AXI4 STream status word.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#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.

#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.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#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.

Referenced by AxiEthernetSgDmaPartialChecksumOffloadExample().

#define TXBD_CNT   1024

Number of TxBDs to use.

Referenced by AxiEthernetSgDmaPollExample().

#define TXBD_CNT   1024

Number of TxBDs to use.

#define TXBD_CNT   128

Number of TxBDs to use.

Referenced by AxiEthernetExtVlanExample().

#define TXBD_CNT   128

Number of TxBDs to use.

Referenced by AxiEthernetMcastExample().

#define TXBD_CNT   1024

Number of TxBDs to use.

Referenced by AxiEthernetSgDmaIntrExample().

#define TXBD_CNT   128

Number of TxBDs to use.

Referenced by AxiEthernetSgDmaIntrExample().

#define TXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT)

TXBD SPACE BYTES.

#define TXBD_SPACE_BYTES   XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT)

TXBD SPACE BYTES.

#define TXBD_SPACE_BYTES   TXBD_CNT * 64 * 16

TXBD SPACE BYTES.

#define TXBD_SPACE_BYTES   TXBD_CNT * 64 * 16

TXBD SPACE BYTES.

#define TXBD_SPACE_BYTES   TXBD_CNT * 64 * 16

TXBD SPACE BYTES.

#define TXBD_SPACE_BYTES   (XAxiDma_BdRingMemCalc(BD_ALIGNMENT, TXBD_CNT))

TXBD SPACE BYTES.

#define XAE_ARP_PACKET_SIZE   28

Max ARP packet size.

#define XAE_BROADCAST_OPTION   0x00000200

Receives broadcast frames.

Default is on.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_DEFAULT_RXVSTRP_MODE   XAE_VSTRP_ALL

Default RX VLAN strip mode.

Referenced by XAxiEthernet_SetOptions().

#define XAE_DEFAULT_RXVTAG_MODE   XAE_VTAG_ALL

Default RX VLAN tag mode.

Referenced by XAxiEthernet_SetOptions().

#define XAE_DEFAULT_TXVSTRP_MODE   XAE_VSTRP_ALL

Default TX VLAN strip mode.

Referenced by XAxiEthernet_SetOptions().

#define XAE_DEFAULT_TXVTAG_MODE   XAE_VTAG_ALL

Default TX VLAN tag mode.

Referenced by XAxiEthernet_SetOptions().

#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_EXT_MULTICAST_OPTION   0x00000800

Enables the extended multicast address table.

Default depends on hardware.

Referenced by AxiEthernetSgDmaIntrExtMulticastExample().

#define XAE_EXT_RXVLAN_STRP_OPTION   0x00020000

Enables RX VLAN stripping.

Default depends on hardware.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define XAE_EXT_RXVLAN_TAG_OPTION   0x00008000

Enables RX VLAN tagging.

Default depends on hardware.

#define XAE_EXT_RXVLAN_TRAN_OPTION   0x00002000

Enables RX VLAN translation.

Default depends on hardware.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define XAE_EXT_TXVLAN_STRP_OPTION   0x00010000

Enables TX VLAN stripping.

Default depends on hardware.

#define XAE_EXT_TXVLAN_TAG_OPTION   0x00004000

Enables TX VLAN tagging.

Default depends on hardware.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define XAE_EXT_TXVLAN_TRAN_OPTION   0x00001000

Enables TX VLAN translation.

Default depends on hardware.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define XAE_FCS_INSERT_OPTION   0x00000020

Inserts FCS and PAD on TX frames.

Default is on.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_FCS_STRIP_OPTION   0x00000010

Strips FCS and PAD from RX frames.

Default is on.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_FLOW_CONTROL_OPTION   0x00000008

Recognizes received flow control frames.

Default is on.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_HARD_TEMC   2

Hard TEMAC type.

#define XAE_HDR_VLAN_SIZE   18

Size of an Ethernet header with VLAN in bytes.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

#define XAE_HEADER_IP_LENGTH_OFFSET   16

IP Length Offset.

#define XAE_JUMBO_MTU   8982

Maximum MTU size of a jumbo Ethernet frame.

Referenced by GetRxBufAddr(), and RxSetup().

#define XAE_JUMBO_OPTION   0x00000002

Accepts jumbo frames for TX and RX.

Default is off.

Referenced by AxiEthernetSgDmaIntrExtVlanExample(), XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_LENTYPE_ERR_OPTION   0x00000040

Enables Length/Type error checking on RX.

Default is on.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_MAC_ADDR_SIZE   6

Size of a MAC address in bytes.

Referenced by AxiEnthernetSetMAC(), AxiEthernetSgDmaPollExample(), and AxiEthernetUtilFrameHdrFormatMAC().

#define XAE_MAX_FRAME_SIZE   (XAE_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)

Maximum Ethernet frame size including header and trailer.

#define XAE_MAX_JUMBO_FRAME_SIZE   (XAE_JUMBO_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)

Maximum jumbo Ethernet frame size including header and trailer.

Referenced by AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrSingleFrameExample(), and AxiEthernetSgDmaPartialChecksumOffloadExample().

#define XAE_MAX_VLAN_FRAME_SIZE   (XAE_MTU + XAE_HDR_VLAN_SIZE + XAE_TRL_SIZE)

Maximum VLAN Ethernet frame size including header and trailer.

#define XAE_MDIO_DIV_DFT   29

Default MDIO clock divisor.

#define XAE_MTU   1500

Maximum MTU size of an Ethernet frame.

Referenced by AxiEthernetSingleFrameNonContIntrExample().

#define XAE_MULTICAST_OPTION   0x00000400

Receives programmed multicast frames.

Default is off.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_PHY_INTERFACE_MODE_NA   0

PHY interface mode is not applicable.

#define XAE_PHY_TYPE_1000BASE_X   21

1000BASE-X PHY interface type.

Referenced by AxiEthernetUtilEnterLoopback(), and XAxiEthernet_SetOperatingSpeed().

#define XAE_PHY_TYPE_GMII   3

GMII PHY interface type.

Referenced by AxiEthernetUtilEnterLoopback().

#define XAE_PHY_TYPE_RGMII   9

RGMII PHY interface type.

#define XAE_PHY_TYPE_RGMII_1_3   XAE_PHY_TYPE_RGMII

RGMII 1.3 PHY interface type.

Referenced by AxiEthernetUtilEnterLoopback(), and XAxiEthernet_GetRgmiiStatus().

#define XAE_PHY_TYPE_RGMII_2_0   XAE_PHY_TYPE_RGMII_RXID

RGMII 2.0 PHY interface type.

Referenced by AxiEthernetUtilEnterLoopback(), and XAxiEthernet_GetRgmiiStatus().

#define XAE_PHY_TYPE_RGMII_ID   10

RGMII with internal delay PHY interface type.

#define XAE_PHY_TYPE_RGMII_RXID   11

RGMII with RX internal delay PHY interface type.

#define XAE_PHY_TYPE_RGMII_TXID   12

RGMII with TX internal delay PHY interface type.

#define XAE_PHY_TYPE_SGMII   4

SGMII PHY interface type.

Referenced by AxiEthernetUtilEnterLoopback(), and XAxiEthernet_GetSgmiiStatus().

#define XAE_PROMISC_OPTION   0x00000001

Accepts all incoming packets.

Default is off.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_SOFT_TEMAC_10_100_1000_MBPS   1

Soft TEMAC at 10/100/1000 Mbps.

#define XAE_SOFT_TEMAC_10_100_MBPS   0

Soft TEMAC at 10/100 Mbps.

#define XAE_TPID_MAX_ENTRIES   4

Number of storable TPIDs in the VLAN table.

Referenced by XAxiEthernet_ClearTpid(), XAxiEthernet_GetTpid(), and XAxiEthernet_SetTpid().

#define XAE_TRL_SIZE   4

Size of an Ethernet trailer (FCS) in bytes.

#define XAE_VLAN_OPTION   0x00000004

Enables VLAN support for TX and RX.

Default is off.

Referenced by XAxiEthernet_ClearOptions(), and XAxiEthernet_SetOptions().

#define XAE_VLAN_TAG_SIZE   4

VLAN Tag Size.

#define XAE_VSTRP_ALL   1

Strip one tag from all frames.

Referenced by XAxiEthernet_SetVStripMode().

#define XAE_VSTRP_NONE   0

No VLAN stripping.

Referenced by XAxiEthernet_SetVStripMode().

#define XAE_VSTRP_SELECT   3

Strip one tag from selected frames.

Referenced by AxiEthernetSgDmaIntrExtVlanExample(), and XAxiEthernet_SetVStripMode().

#define XAE_VTAG_ALL   1

Tag all frames.

Referenced by XAxiEthernet_SetVTagMode().

#define XAE_VTAG_EXISTED   2

Tag already tagged frames.

Referenced by XAxiEthernet_SetVTagMode().

#define XAE_VTAG_NONE   0

No VLAN tagging.

Referenced by XAxiEthernet_SetVTagMode().

#define XAE_VTAG_SELECT   3

Tag selected already tagged frames.

Referenced by AxiEthernetSgDmaIntrExtVlanExample(), and XAxiEthernet_SetVTagMode().

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_BASEADDRESS   XPAR_XAXIETHERNET_0_BASEADDR

AXI Ethernet base address.

#define XAXIETHERNET_EXAMPLE_H

XAXIETHERNET EXAMPLE H.

#define XPAR_AXI_DMA   2U
#define XPAR_AXI_FIFO   1U

AXI FIFO device type.

Referenced by AxiEthernetFifoIntrExample(), and AxiEthernetPolledExample().

#define XPAR_AXI_MCDMA   3U

Typedef Documentation

typedef struct XAxiEthernet XAxiEthernet

struct XAxiEthernet is the type for Axi Ethernet driver instance data.

The calling code is required to use a unique instance of this structure for every Axi Ethernet device used in the system. A reference to a structure of this type is then passed to the driver API functions.

Holds configuration information for an AXI Ethernet device.

Function Documentation

void AvbGMDiscontinuityHandler ( void *  CallBackRef,
u32  TimestampsUncertain 
)

is the handler which will be called if the PTP drivers.

identify a possible discontinuity in GrandMaster time.

This handler provides an example of how to handle this situation - but this function is application specific.

Parameters
[in]CallBackRefcontains a callback reference from the driver, in. this case it is the instance pointer for the AVB driver.
[in]TimestampsUncertain- a value of 1 indicates that there is a. possible discontinuity in GrandMaster time. A value of 0 indicates that Timestamps are no longer uncertain.
Note
This Handler need to be defined otherwise the XAvb_StubHandler will generate an error

Referenced by main().

void AxiEnthernetSetMAC ( char *  MacAddr,
u8  ChanId 
)

Programs the AXI Ethernet MAC address.

Parameters
[in]MacAddrMacAddr value.
[in]ChanIdMCDMA channel identifier.

References Swap8(), and XAE_MAC_ADDR_SIZE.

Referenced by AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaPollExample(), and AxiEthernetSgDmaSingleFrameExample().

int AxiEtherentConfigureTIPhy ( XAxiEthernet *  AxiEthernetInstancePtr,
u32  PhyAddr 
)

Configures a TI PHY for SGMII operation.

Parameters
[in]AxiEthernetInstancePtris a pointer to the Axi Ethernet instance.
[in]PhyAddris the PHY address on the MDIO bus.
Returns
XST_SUCCESS on success.

References TI_PHY_ADDDR, TI_PHY_CFGR2, TI_PHY_CFGR2_SGMII_AUTONEG_EN, TI_PHY_CR, TI_PHY_CR_DEVAD_DATAEN, TI_PHY_CR_DEVAD_EN, TI_PHY_CR_SGMII_EN, TI_PHY_PHYCTRL, TI_PHY_SGMIICLK_EN, TI_PHY_SGMIITYPE, XAxiEthernet_PhyRead(), and XAxiEthernet_PhyWrite().

Referenced by AxiEthernetUtilEnterLoopback().

u32 AxiEthernetDetectPHY ( XAxiEthernet *  AxiEthernetInstancePtr)

Detects the PHY address from MII status register contents.

Looks for a PHY that supports auto-negotiation and 10 Mbps full-duplex and half-duplex. On some older boards PHY address 0 may not respond, but 0 is used as the default when no other address responds.

Parameters
[in]AxiEthernetInstancePtris a pointer to the Axi Ethernet instance.
Returns
The address of the PHY (defaults to 0 if none is detected).

References PHY_DETECT_MASK, PHY_DETECT_REG, and XAxiEthernet_PhyRead().

Referenced by AxiEthernetUtilEnterLoopback().

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

Demonstrates the usage of the Axi Ethernet by sending.

and receiving frames in interrupt driven SGDMA mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXIDMA. component.
[in]AxiEthernetBaseAddressis the base address of the AxiEthernet device.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
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.

In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XAxiEthernet_Config::AxiDevBaseAddress, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AxiEthernetSgDmaIntrExtVlanExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, BD_ALIGNMENT, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, RXBD_CNT, TXBD_CNT, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_DMA.

int AxiEthernetFifoIntrExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XLlFifo *  FifoInstancePtr,
UINTPTR  AxiEthernetBaseAddress 
)

Demonstrates AXI Ethernet usage by sending and receiving frames in.

interrupt-driven FIFO mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the AXI Ethernet instance.
[in]FifoInstancePtris a pointer to the AXI FIFO instance.
[in]AxiEthernetBaseAddressis the AXI Ethernet base address.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
Note
AxiFifo hardware must be initialized before initializing AxiEthernet. Since AxiFifo reset line is connected to the AxiEthernet reset line, a reset of AxiFifo hardware during its initialization would reset AxiEthernet.

References XAxiEthernet_Config::AxiDevBaseAddress, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AxiEthernetMultipleFramesIntrExample(), AxiEthernetResetDevice(), AxiEthernetSingleFrameIntrExample(), AxiEthernetSingleFrameNonContIntrExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_FIFO.

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

Demonstrates the usage of the Axi Ethernet extended.

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

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXIDMA. component.
[in]AxiEthernetBaseAddresscontains the base address of the AxiEthernet device.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
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, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, BD_ALIGNMENT, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, RXBD_CNT, TXBD_CNT, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_DMA.

int AxiEthernetMultipleFramesIntrExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XLlFifo *  FifoInstancePtr 
)

This example sends and receives a batch of frames.

Frame reception is handled. in this function and not in the callback function.

Use this method of reception when interrupt latency is important.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]FifoInstancePtris a pointer to the instance of the Fifo. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), AxiEthernetUtilFrameVerify(), XAE_HDR_SIZE, XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetFifoIntrExample().

int AxiEthernetMultipleFramesPolledExample ( void  )

This example uses polled mode to queue up multiple frames in the packet.

FIFOs before sending them in a single burst. Receive packets are handled in a similar way.

Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetPollForRxStatus(), AxiEthernetPollForTxStatus(), AxiEthernetResetDevice(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameSetPayloadData(), AxiEthernetUtilFrameVerify(), XAE_HDR_SIZE, XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetPolledExample().

void AxiEthernetPHYRegistersDump ( XAxiEthernet *  AxiEthernetInstancePtr)

Prints PHY register values for debugging.

Parameters
[in]AxiEthernetInstancePtrPointer to the AXI Ethernet driver instance.
int AxiEthernetPingReqExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
UINTPTR  AxiEthernetBaseAddress 
)

The entry point for the AxiEthernet driver to ping request example in polled.

mode. generate specified number of request packets as defined in "NUM_OF_PING_REQ_PKTS.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXI MCDMA. component.
[in]AxiEthernetBaseAddresscontains the base address of the AxiEthernet device.
Returns
XST_FAILURE to indicate failure, otherwise it will return XST_SUCCESS.
Note
AxiMcdma hardware must be initialized before initializing AxiEthernet. Since AxiMcdma reset line is connected to the AxiEthernet reset line, a reset of AxiMcdma hardware during its initialization would reset AxiEthernet.

References XAxiEthernet_Config::AxiDevBaseAddress, XAxiEthernet_Config::BaseAddress, DELAY, XAxiEthernet_Config::Enable_1588, NUM_OF_PING_REQ_PKTS, NUM_PACK_CHECK_RX_PACK, NUM_RX_PACK_CHECK_REQ, PhySetup(), ProcessRecvFrame(), RxSetup(), SendArpReqFrame(), SendEchoReqFrame(), XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEnet_Recv(), XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XPAR_AXI_MCDMA.

int AxiEthernetPolledExample ( u16  AxiEthernetDeviceId,
u16  FifoDeviceId 
)

Demonstrates the usage of the Axi Ethernet by sending and.

receiving frames in polled mode.

Parameters
[in]AxiEthernetDeviceIdis device ID of the AxiEthernet Device , typically XPAR_<AXIETHERNET_instance>_DEVICE_ID value from xparameters.h
[in]FifoDeviceIdis device ID of the Fifo device taken from xparameters.h
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
Note
AxiFifo hardware must be initialized before initializing AxiEthernet. Since AxiFifo reset line is connected to the AxiEthernet reset line, a reset of AxiFifo hardware during its initialization would reset AxiEthernet.

References XAxiEthernet_Config::AxiDevBaseAddress, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AxiEthernetMultipleFramesPolledExample(), AxiEthernetSingleFramePolledExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), and XPAR_AXI_FIFO.

int AxiEthernetPollForRxStatus ( void  )

Polls the Rx status and waits for an indication that a frame has arrived or a receive related error has occurred.

If an error is reported, it handles all the possible error conditions.

Returns
  • XST_SUCCESS if a frame has been received.
  • XST_NO_DATA if timeout or Rx failure.
  • XST_FIFO_ERROR if there is an error in the FIFO.
  • XST_DATA_LOST if a frame has been dropped.

References AxiEthernetResetDevice(), AxiEthernetUtilErrorTrap(), XAE_INT_RXFIFOOVR_MASK, and XAE_INT_RXRJECT_MASK.

Referenced by AxiEthernetMultipleFramesPolledExample(), and AxiEthernetSingleFramePolledExample().

int AxiEthernetPollForTxStatus ( void  )

Polls the Tx status and waits for an indication that a frame has been transmitted successfully or a transmit related error has occurred.

If an error is reported, it handles all the possible error conditions.

Returns
  • XST_SUCCESS if Tx has completed.
  • XST_NO_DATA if timeout or Tx failure.
  • XST_FIFO_ERROR if there is an error in the FIFO.

References AxiEthernetResetDevice(), and AxiEthernetUtilErrorTrap().

Referenced by AxiEthernetMultipleFramesPolledExample(), and AxiEthernetSingleFramePolledExample().

int AxiEthernetResetDevice ( void  )
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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

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.

Note
Parameters and return values match AxiEthernetSgDmaSingleFrameExample().

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameSetPayloadData(), BD_USR0_OFFSET, DUMMY_TCP_PORT_1, DUMMY_TCP_PORT_2, FULL_CSUM_ENABLE, FULL_CSUM_STATUS_MASK, FULL_CSUM_VALIDATED, IP_CSUM_OK_TCP_NOT_CHECKED, IP_CSUM_OK_TCP_NOT_OK, IP_HEADER_LEN_IN_WORDS, IP_HEADER_LENGTH, IP_HEADER_PROTOCOL_TCP, IP_HEADER_VERSION, IP_TCP_CSUMS_NOT_CHECKED, IP_VERSION_4, TCP_CSUM_NOT_CHECKED_IP_NOT_OK, TCP_HEADER_LEN_IN_WORDS, TCP_HEADER_LENGTH, XAE_HDR_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().

int AxiEthernetSgDmaFullChecksumOffloadExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameSetPayloadData(), BD_USR0_OFFSET, DUMMY_TCP_PORT_1, DUMMY_TCP_PORT_2, FULL_CSUM_ENABLE, FULL_CSUM_STATUS_MASK, FULL_CSUM_VALIDATED, IP_CSUM_OK_TCP_NOT_CHECKED, IP_CSUM_OK_TCP_NOT_OK, IP_HEADER_LEN_IN_WORDS, IP_HEADER_LENGTH, IP_HEADER_PROTOCOL_TCP, IP_HEADER_VERSION, IP_TCP_CSUMS_NOT_CHECKED, IP_VERSION_4, TCP_CSUM_NOT_CHECKED_IP_NOT_OK, TCP_HEADER_LEN_IN_WORDS, TCP_HEADER_LENGTH, XAE_HDR_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_MAX_JUMBO_FRAME_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

int AxiEthernetSgDmaIntrCoalescingExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

This example sends frames with the interrupt coalescing settings altered.

from their defaults.

The default settings will interrupt the processor after every frame has been sent. This example will increase the threshold resulting in lower CPU utilization since it spends less time servicing interrupts.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameSetPayloadData(), XAE_HDR_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_ClearOptions(), XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaIntrExample().

int AxiEthernetSgDmaIntrExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
UINTPTR  AxiEthernetBaseAddress 
)

Demonstrates the usage of the Axi Ethernet by sending.

and receiving frames in interrupt driven MCDMA mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXI MCDMA. component.
[in]AxiEthernetBaseAddresscontains the base address of the AxiEthernet device.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
Note
AxiMcdma hardware must be initialized before initializing AxiEthernet. Since AxiMcdma reset line is connected to the AxiEthernet reset line, a reset of AxiMcdma hardware during its initialization would reset AxiEthernet.
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XAxiEthernet_Config::AxiDevBaseAddress, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AXIETHERNET_LOOPBACK_SPEED_2p5G, AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, BLOCK_SIZE_2MB, XAxiEthernet::Config, XAxiEthernet_Config::Enable_1588, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, RXBD_CNT, XAxiEthernet_Config::Speed, TXBD_CNT, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_MCDMA.

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

Demonstrates the usage of the Axi Ethernet by sending.

and receiving frames in interrupt driven SGDMA mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXIDMA. component.
[in]AxiEthernetBaseAddresscontains the base address of the AxiEthernet device.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
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, AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrCoalescingExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, BD_ALIGNMENT, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, RXBD_CNT, TXBD_CNT, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_DMA.

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
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXI DMA. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

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

Referenced by AxiEthernetMcastExample().

int AxiEthernetSgDmaIntrExtVlanExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

This example sends and receives a single packet in loopback mode with.

extended VLAN support.

The transmit frame will have VLAN field populated.

On receive, HW should pass the VLAN field to receive BDs.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
Note
Summary of VLAN tags handling in this example

Frame setup with Tpid1+Cfi1+TxPid => 0x88A83111 Frame translated to TxTransVid => 0x88A83222 Frame tagged to Tpid2+Cfi2+TxTagVid => 0x9100C333 + 0x88A83222 Frame sent and loopbacked.

Frame stripped with RxStrpVid(0x333) => 0x88A83222 Frame translated (key:RxVid:0x222) RxTransVid => 0x88A83444

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrVlanFormatType(), AxiEthernetUtilFrameHdrVlanFormatVid(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetVlanPayloadData(), AxiEthernetUtilFrameVerify(), BD_VLAN_TPID_OFFSET, BD_VLAN_VID_OFFSET, PAYLOAD_SIZE, TPID_MASK, XAE_EXT_RXVLAN_STRP_OPTION, XAE_EXT_RXVLAN_TRAN_OPTION, XAE_EXT_TXVLAN_TAG_OPTION, XAE_EXT_TXVLAN_TRAN_OPTION, XAE_HDR_VLAN_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_JUMBO_OPTION, XAE_RECEIVER_ENABLE_OPTION, XAE_RX, XAE_TRANSMITTER_ENABLE_OPTION, XAE_TX, XAE_VSTRP_SELECT, XAE_VTAG_SELECT, XAxiEthernet_SetOptions(), XAxiEthernet_SetTpid(), XAxiEthernet_SetVidTable(), XAxiEthernet_SetVStripMode(), XAxiEthernet_SetVTagMode(), XAxiEthernet_SetVTagValue(), and XAxiEthernet_Start().

Referenced by AxiEthernetExtVlanExample().

int AxiEthernetSgDmaIntrMultiFrameExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEnthernetSetMAC(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), NUM_PACKETS, PAYLOAD_SIZE, XAE_HDR_SIZE, 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 
)

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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEnthernetSetMAC(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), PAYLOAD_SIZE, XAE_HDR_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaIntrExample().

int AxiEthernetSgDmaIntrSingleFrameExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), AxiEthernetUtilFrameVerify(), PAYLOAD_SIZE, XAE_HDR_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_MAX_JUMBO_FRAME_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

int AxiEthernetSgDmaMultiFrameExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

Demonstrates the usage of the Axi Ethernet by sending and.

receiving multiple frames in using MCDMA in polled mode. Each source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the MCDMA instance.
[in]ChanIdis the MCDMA Channel Id to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEnthernetSetMAC(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), CheckDmaResult(), CheckTxDmaResult(), NUM_PACKETS, PAYLOAD_SIZE, XAE_HDR_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaPollExample().

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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

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.

Note
Parameters and return values match AxiEthernetSgDmaSingleFrameExample().

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), BD_USR0_OFFSET, BD_USR1_OFFSET, BD_USR2_OFFSET, PARTIAL_CSUM_ENABLE, PAYLOAD_SIZE, RCV_FRM_NOT_CORRUPTED, TX_CS_INIT_OFFSET, XAE_HDR_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().

int AxiEthernetSgDmaPartialChecksumOffloadExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XAxiDma *  DmaInstancePtr 
)

This example sends and receives a single packet in loopback mode with.

checksum offloading support.

The transmit frame will be checksummed 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.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), BD_USR0_OFFSET, BD_USR1_OFFSET, BD_USR2_OFFSET, PARTIAL_CSUM_ENABLE, PAYLOAD_SIZE, RCV_FRM_NOT_CORRUPTED, TX_CS_INIT_OFFSET, XAE_HDR_SIZE, XAE_INT_RECV_ERROR_MASK, XAE_MAX_JUMBO_FRAME_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

int AxiEthernetSgDmaPollExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
UINTPTR  AxiEthernetBaseAddress 
)

Demonstrates the usage of the Axi Ethernet by sending.

and receiving frames in polled MCDMA mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]DmaInstancePtris a pointer to the instance of the AXI MCDMA. component.
[in]AxiEthernetBaseAddresscontains the base address of the AxiEthernet device.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.
Note
AxiMcdma hardware must be initialized before initializing AxiEthernet. Since AxiMcdma reset line is connected to the AxiEthernet reset line, a reset of AxiMcdma hardware during its initialization would reset AxiEthernet.

References XAxiEthernet_Config::AxiDevBaseAddress, AxiEnthernetSetMAC(), AXIETHERNET_LOOPBACK_SPEED, AXIETHERNET_LOOPBACK_SPEED_1G, AXIETHERNET_LOOPBACK_SPEED_2p5G, AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetSgDmaSingleFrameExample(), AxiEthernetUtilEnterLoopback(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet_Config::BaseAddress, BLOCK_SIZE_2MB, XAxiEthernet::Config, XAxiEthernet_Config::Enable_1588, RXBD_CNT, XAxiEthernet_Config::Speed, Swap8(), TXBD_CNT, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, XAE_MAC_ADDR_SIZE, XAE_PHY_TYPE_MII, XAxiEthernet_CfgInitialize(), XAxiEthernet_LookupConfig(), XAxiEthernet_SetOperatingSpeed(), XAxiEthernet_Stop(), and XPAR_AXI_MCDMA.

int AxiEthernetSgDmaSingleFrameExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

Demonstrates the usage of the Axi Ethernet by sending and.

receiving a single frame in using MCDMA in polled mode. The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the MCDMA instance.
[in]ChanIdis the MCDMA Channel Id to be operate on.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEnthernetSetMAC(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), CheckDmaResult(), CheckTxDmaResult(), PAYLOAD_SIZE, XAE_HDR_SIZE, XAE_RECEIVER_ENABLE_OPTION, XAE_TRANSMITTER_ENABLE_OPTION, XAxiEthernet_SetMacAddress(), XAxiEthernet_SetOptions(), XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetSgDmaPollExample().

int AxiEthernetSingleFrameIntrExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XLlFifo *  FifoInstancePtr 
)

Demonstrates the usage of the Axi Ethernet by sending and.

receiving a single frame in interrupt mode.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]FifoInstancePtris a pointer to the instance of the Fifo. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), AxiEthernetUtilFrameSetPayloadData(), PAYLOAD_SIZE, XAE_HDR_SIZE, XAE_INT_RXFIFOOVR_MASK, XAE_INT_RXRJECT_MASK, XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetFifoIntrExample().

int AxiEthernetSingleFrameNonContIntrExample ( XAxiEthernet *  AxiEthernetInstancePtr,
XLlFifo *  FifoInstancePtr 
)

This example sends a packet from non-contiguous memory locations.

The header. is stored in one area. The payload data is calculated and written to the packet FIFO one byte at a time.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. AxiEthernet component.
[in]FifoInstancePtris a pointer to the instance of the Fifo. component.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilFrameHdrFormatMAC(), AxiEthernetUtilFrameHdrFormatType(), AxiEthernetUtilFrameMemClear(), XAE_HDR_SIZE, XAE_MTU, XAxiEthernet_Start(), and XAxiEthernet_Stop().

Referenced by AxiEthernetFifoIntrExample().

int AxiEthernetSingleFramePolledExample ( void  )
int AxiEthernetUtilConfigureInternalPhy ( XAxiEthernet *  AxiEthernetInstancePtr,
int  Speed 
)

Configures the internal phy for SGMII and 1000baseX modes.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the AxiEthernet component.
[in]Speedis the loopback speed 10, 100, or 1000 Mbit.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet::Config, PHY_R0_ANEG_ENABLE, PHY_R0_CTRL_REG, PHY_R0_DFT_SPD_10, PHY_R0_DFT_SPD_100, PHY_R0_DFT_SPD_1000, PHY_R0_DFT_SPD_2500, PHY_R0_ISOLATE, XAxiEthernet_Config::PhyAddr, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, XAE_SPEED_2500_MBPS, XAxiEthernet_PhyRead(), and XAxiEthernet_PhyWrite().

Referenced by AxiEthernetUtilEnterLoopback().

int AxiEthernetUtilEnterLoopback ( XAxiEthernet *  AxiEthernetInstancePtr,
int  Speed 
)

Sets the PHY to loopback mode.

This works with the marvell PHY. common on ML40x evaluation boards.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the AxiEthernet component.
[in]Speedis the loopback speed 10, 100, or 1000 Mbit.
Returns
XST_SUCCESS on success, XST_FAILURE otherwise.

References AxiEtherentConfigureTIPhy(), AXIETHERNET_PHY_DELAY_SEC, AxiEthernetDetectPHY(), AxiEthernetUtilConfigureInternalPhy(), AxiEthernetUtilErrorTrap(), AxiEthernetUtilPhyDelay(), XAxiEthernet::Config, MARVEL_PHY_88E1111_MODEL, MARVEL_PHY_88E1116R_MODEL, PHY_MODEL_NUM_MASK, PHY_PG2_R21_CTRL_REG, PHY_R0_ANEG_ENABLE, PHY_R0_CTRL_REG, PHY_R0_DFT_SPD_10, PHY_R0_DFT_SPD_100, PHY_R0_DFT_SPD_1000, PHY_R0_DFT_SPD_2500, PHY_R0_LOOPBACK, PHY_R0_RESET, PHY_R20_DFT_SPD_10, PHY_R20_DFT_SPD_100, PHY_R20_DFT_SPD_1000, PHY_R20_EXTND_CTRL_REG, PHY_R20_RX_DLY, PHY_R22_PAGE_ADDR_REG, PHY_R27_EXTND_STS_REG, PHY_R27_MAC_CONFIG_GMII, PHY_R27_MAC_CONFIG_RGMII, PHY_R27_MAC_CONFIG_SGMII, PHY_R3_PHY_IDENT_REG, PHY_REG21_10, PHY_REG21_100, PHY_REG21_1000, XAxiEthernet_Config::PhyAddr, TI_PHY_MODEL, XAE_PHY_TYPE_1000BASE_X, XAE_PHY_TYPE_GMII, XAE_PHY_TYPE_MII, XAE_PHY_TYPE_RGMII_1_3, XAE_PHY_TYPE_RGMII_2_0, XAE_PHY_TYPE_SGMII, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, XAE_SPEED_2500_MBPS, XAxiEthernet_PhyRead(), and XAxiEthernet_PhyWrite().

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPolledExample(), AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().

void AxiEthernetUtilFrameHdrFormatType ( EthernetFrame *  FramePtr,
u16  FrameType 
)
void AxiEthernetUtilFrameHdrVlanFormatType ( EthernetFrame *  FramePtr,
u16  FrameType,
u32  VlanNumber 
)

Formats a VLAN Ethernet frame header with the EtherType value.

Set the frame type for the specified frame.

Parameters
[in]FramePtrPointer to the Ethernet frame buffer.
[in]FrameTypeEtherType value to write into the frame header.
[in]VlanNumberVLAN header index.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

void AxiEthernetUtilFrameHdrVlanFormatVid ( EthernetFrame *  FramePtr,
u32  VlanNumber,
u32  Vid 
)

Formats a VLAN Ethernet frame header with the VLAN ID.

Set the frame VLAN info for the specified frame.

Parameters
[in]FramePtrPointer to the Ethernet frame buffer.
[in]VlanNumberVLAN header index.
[in]VidVLAN identifier.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

void AxiEthernetUtilFrameSetPayloadData ( EthernetFrame *  FramePtr,
int  PayloadSize 
)

Fills an Ethernet frame payload with test data.

Places a pattern in the payload section of a frame.

Parameters
[in]FramePtrPointer to the Ethernet frame buffer.
[in]PayloadSizeNumber of payload bytes to write.

The pattern. is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern:

  0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...

References XAE_HDR_SIZE.

Referenced by AxiEthernetMultipleFramesIntrExample(), AxiEthernetMultipleFramesPolledExample(), AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrCoalescingExample(), AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), AxiEthernetSgDmaSingleFrameExample(), AxiEthernetSingleFrameIntrExample(), and AxiEthernetSingleFramePolledExample().

void AxiEthernetUtilFrameSetVlanPayloadData ( EthernetFrame *  FramePtr,
int  PayloadSize,
u32  VlanNumber 
)

Fills a VLAN Ethernet frame payload with test data.

Places a pattern in the payload section of a frame.

Parameters
[in]FramePtrPointer to the Ethernet frame buffer.
[in]PayloadSizeNumber of payload bytes to write.
[in]VlanNumberVLAN header index.

The pattern. is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern:

  0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...

References XAE_HDR_SIZE.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

int AxiEthernetUtilFrameVerify ( EthernetFrame *  CheckFrame,
EthernetFrame *  ActualFrame 
)

Verifies that two Ethernet frames contain the same data.

Verifies the frame data against a CheckFrame.

Parameters
[in]CheckFramePointer to the expected Ethernet frame.
[in]ActualFramePointer to the received Ethernet frame.
Returns
XST_SUCCESS if the frames match, otherwise XST_FAILURE.

Validation occurs by comparing the ActualFrame to the header of the CheckFrame. If the headers match, then the payload of ActualFrame is verified for the same pattern Util_FrameSetPayloadData() generates.

References XAE_HDR_SIZE.

Referenced by AxiEthernetMultipleFramesIntrExample(), AxiEthernetMultipleFramesPolledExample(), AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetSgDmaIntrExtVlanExample(), AxiEthernetSgDmaIntrSingleFrameExample(), and AxiEthernetSingleFramePolledExample().

void AxiEthernetUtilPhyDelay ( unsigned int  Seconds)

Delays for the specified number of seconds while PHY hardware recovers.

For MicroBlaze, uses an assembly loop. On other platforms, uses sleep().

Parameters
[in]Secondsis the number of seconds to delay.

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPolledExample(), AxiEthernetSgDmaIntrExample(), AxiEthernetSgDmaPollExample(), AxiEthernetUtilConfigureInternalPhy(), and AxiEthernetUtilEnterLoopback().

void AxiEthernetUtilSetupUart ( void  )

Configures the UART used by the example.

int CheckDmaResult ( XMcdma *  InstancePtr)

Checks the receive DMA completion result.

Parameters
[in]InstancePtrPointer to the driver instance.
Returns
XST_SUCCESS on success, otherwise an error code.

Referenced by AxiEthernetSgDmaMultiFrameExample(), and AxiEthernetSgDmaSingleFrameExample().

int CheckTxDmaResult ( XMcdma *  InstancePtr)

Checks the transmit DMA completion result.

Parameters
[in]InstancePtrPointer to the driver instance.
Returns
XST_SUCCESS on success, otherwise an error code.

Referenced by AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaSingleFrameExample(), SendArpReqFrame(), and SendEchoReqFrame().

int GetBufAddr ( )

Returns a transmit buffer address for the channel.

Returns
XST_SUCCESS on success, otherwise an error code.

References ICMP_PKT_SIZE.

Referenced by SendArpReqFrame(), and SendEchoReqFrame().

int GetRxBufAddr ( )

Returns a receive buffer address for the channel.

Returns
XST_SUCCESS on success, otherwise an error code.

References XAE_JUMBO_MTU.

Referenced by ProcessRecvFrame().

int main ( void  )

Main entry point for the AVB example.

Main entry point of the Ping Request example in polled mode.

Main entry point for the Axi Ethernet example.

Note
This example will be in a infinite loop if the HW is not working properly and if the interrupts are not received.
Returns
XST_SUCCESS on success, otherwise XST_FAILURE.

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

Returns
XST_SUCCESS on success, otherwise XST_FAILURE. Runs the example application.
XST_SUCCESS on success, otherwise XST_FAILURE.
XST_SUCCESS on success, otherwise XST_FAILURE.

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

Returns
XST_SUCCESS on success, otherwise XST_FAILURE.

References AvbGMDiscontinuityHandler(), AXIETHERNET_DEVICE_ID, XAvb_Config::BaseAddress, XAxiEthernet_Config::BaseAddress, XAvb_PortIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb::Config, XAvb_Config::DeviceId, ETH_SYSTEM_ADDRESS_EUI48_HIGH, ETH_SYSTEM_ADDRESS_EUI48_LOW, XAvb_PortIdentity::PortNumber, XAvb_CfgInitialize(), XAVB_PTP_TX_PKT_SA_LOWER_OFFSET, XAVB_PTP_TX_PKT_SA_UPPER_OFFSET, XAvb_ReorderWord(), XAvb_Reset(), XAvb_SetGMDiscontinuityHandler(), XAvb_SetupSourcePortIdentity(), XAvb_Start(), XAvb_WriteToMultipleTxPtpFrames(), XAxiEthernet_CfgInitialize(), and XAxiEthernet_LookupConfig().

int PhySetup ( XAxiEthernet *  AxiEthernetInstancePtr)

Sets up the PHY for the ping example.

Parameters
[in]AxiEthernetInstancePtrPointer to the AXI Ethernet driver instance.
Returns
XST_SUCCESS on success, otherwise an error code.

References XAxiEthernet::Config, PHY_R0_ANEG_ENABLE, PHY_R0_CTRL_REG, PHY_R0_DFT_SPD_1000, PHY_R0_ISOLATE, XAxiEthernet_Config::PhyAddr, XAxiEthernet_PhyRead(), and XAxiEthernet_PhyWrite().

Referenced by AxiEthernetPingReqExample().

int ProcessRecvFrame ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

process the received packet.

Sends. the echo request packet based on the ARP reply packet.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.
Returns
XST_SUCCESS is returned when an echo reply is received. Otherwise, XST_FAILURE is returned.
Note
This assumes MAC does not strip padding or CRC.

References ARP_REPLY, ARP_REQ_SRC_IP_LOC, ARP_REQ_STATUS_LOC, CORRECT_CHECKSUM_VALUE, ECHO_REPLY, ETHER_PROTO_TYPE_LOC, GetRxBufAddr(), ICMP_DATA_FIELD_LEN, ICMP_DATA_START_LOC, ICMP_ECHO_FIELD_LOC, ICMP_IDEN_FIELD_LOC, ICMP_KNOWN_DATA_LEN, ICMP_KNOWN_DATA_LOC, ICMP_SEQ_NO_LOC, IDEN_NUM, IP_ADDR_LEN, MAC_ADDR_LEN, NUM_OF_PING_REQ_PKTS, SendEchoReqFrame(), SRC_MAC_ADDR_LOC, XAE_ETHER_PROTO_TYPE_ARP, and XAE_ETHER_PROTO_TYPE_IP.

Referenced by AxiEthernetPingReqExample().

int RxSetup ( XMcdma *  McDmaInstPtr,
XAxiEthernet *  AxiEthernetInstancePtr,
u8  ChanId,
u32  NumPkts 
)

Sets up receive path resources for the example.

Parameters
[in]McDmaInstPtrPointer to the MCDMA driver instance.
[in]AxiEthernetInstancePtrPointer to the AXI Ethernet driver instance.
[in]ChanIdMCDMA channel identifier.
[in]NumPktsNumber of packets to process.
Returns
XST_SUCCESS on success, otherwise an error code.

References XAE_JUMBO_MTU.

Referenced by AxiEthernetPingReqExample().

void SendArpReqFrame ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

send a ARP request packet.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.

References ARP_REQ_PKT_SIZE, ARP_REQUEST, BROADCAST_ADDR, CheckTxDmaResult(), GetBufAddr(), HW_TYPE, IP_ADDR_LEN, IP_VERSION, MAC_ADDR_LEN, XAE_ETHER_PROTO_TYPE_ARP, XAE_ETHER_PROTO_TYPE_IP, and XAxienet_Send().

Referenced by AxiEthernetPingReqExample().

void SendEchoReqFrame ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

send a Echo request packet.

Parameters
[in]AxiEthernetInstancePtris a pointer to the instance of the. Axi Ethernet component.
[in]DmaInstancePtris a pointer to the instance of the Dma. component.
[in]ChanIdis the MCDMA Channel number to be operate on.

References CheckTxDmaResult(), ETHER_PROTO_TYPE_LOC, GetBufAddr(), ICMP_DATA_CHECKSUM_LOC, ICMP_DATA_FIELD_LEN, ICMP_DATA_LEN, ICMP_DATA_START_LOC, ICMP_ECHO_FIELD_LOC, ICMP_IDEN_FIELD_LOC, ICMP_KNOWN_DATA_LEN, ICMP_KNOWN_DATA_LOC, ICMP_PKT_SIZE, IDEN_NUM, IP_ADDR_LEN, IP_CHECKSUM_LOC, IP_HEADER_LEN, IP_REQ_DEST_IP_LOC, IP_REQ_SRC_IP_LOC, IP_START_LOC, MAC_ADDR_LEN, SRC_MAC_ADDR_LOC, XAE_ETHER_PROTO_TYPE_IP, and XAxienet_Send().

Referenced by AxiEthernetPingReqExample(), and ProcessRecvFrame().

u16 Swap8 ( u8  Data)

Swaps bytes within an 8-byte value.

Parameters
[in]DataData value.
Returns
XST_SUCCESS on success, otherwise an error code.

Referenced by AxiEnthernetSetMAC(), and AxiEthernetSgDmaPollExample().

void XAvb_Adjust8kClock ( u32  BaseAddress,
u32  NewOffset 
)

Adjusts the phase offset of the 8 kHz clock.

Adjusts the 8 kHz clock phase offset.

Parameters
[in]BaseAddressis the base address of the device.
[in]NewOffsetis the newly calculated RTC Offset value.

References XAVB_PERIOD_8KHZ, XAvb_ReadReg, XAVB_RTC_8K_OFFSET_OFFSET, XAVB_RTC_NANOSEC_OFFSET, and XAvb_WriteReg.

Referenced by XAvb_CalcRtcOffset().

void XAvb_BecomeRtcMaster ( XAvb *  InstancePtr,
u8  txAnnounceHasWon 
)

make any adjustments needed when the node becomes the Grand.

Implements the XAvb_BecomeRtcMaster helper.

Master, including resetting the RTC to its nominal value

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]txAnnounceHasWonindicates that this function has been called from. the function XAvb_DecodeTxAnnounceFrame(). Is this is set then this function has no need to repeat actions that have been already performed.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb::CurrentBmc, XAvb::GMDiscCallBackRef, XAvb::GMDiscHandler, XAvb_BmcData::IAmTheRtcMaster, XAVB_PTP_TX_ANNOUNCE_OFFSET, XAvb_ReadAnnounceFrame(), XAVB_RTC_INCREMENT_NOMINAL_RATE, XAVB_RTC_INCREMENT_OFFSET, XAvb_UpdateBmcRecords(), and XAvb_WriteReg.

Referenced by XAvb_DecodeTxAnnounceFrame(), XAvb_PtpTimerInterruptHandler(), and XAvb_Reset().

void XAvb_BecomeRtcSlave ( XAvb *  InstancePtr)

make any adjustments needed when the node becomes a PTP slave.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

References XAvb_Counters::CounterSyncInterval, XAvb::CurrentBmc, XAvb::GMDiscCallBackRef, XAvb::GMDiscHandler, XAvb_BmcData::IAmTheRtcMaster, and XAvb::PtpCounters.

Referenced by XAvb_DecodeRxAnnounceFrame().

u32 XAvb_BestMasterClockAlgorithm ( XAvb_BmcData *  AnnounceFrame,
XAvb_BmcData *  CurrentBmc 
)

accept the data pointer to the current BMCA records, accept.

a pointer to an equivalent data structure for the new Announce Packet. The Best Master Clock Algorithm (BMCA) is then performed on these two data structures by comparing the data fields

Parameters
[in]CurrentBmcis a pointer to a suitable data structure, designed to. record the current fields from the current Grand Master's Announce Packet.
[in]AnnounceFrameis a pointer to a suitable data structure, designed to. record the useful fields from the received Announce Packet
Returns
1 if the announce frame represents a better master clock, 0 otherwise.
Note
Provides an updated decision on whether a change of state is required of Grand Master in the network.

References XAvb_ClockQuality::clockAccuracy, XAvb_ClockQuality::clockClass, XAvb_PortIdentity::ClockIdentityLower, XAvb_ClockIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb_ClockIdentity::ClockIdentityUpper, XAvb_BmcData::ClockQuality, XAvb_BmcData::GrandmasterIdentity, XAvb_BmcData::GrandmasterPriority1, XAvb_BmcData::GrandmasterPriority2, XAvb_ClockQuality::offsetScaledLogVariance, XAvb_PortIdentity::PortNumber, XAvb_BmcData::SourcePortIdentity, and XAvb_BmcData::stepsRemoved.

Referenced by XAvb_DecodeRxAnnounceFrame(), and XAvb_DecodeTxAnnounceFrame().

void XAvb_CalcDelay ( XAvb *  InstancePtr)
void XAvb_CalcRtcOffset ( XAvb *  InstancePtr,
u32  PtpFrameBaseAddr 
)
u32 XAvb_CaptureNanoSec ( u32  BaseAddress,
u32  PtpFrameBaseAddr 
)

Captures the nanosecond timestamp field from a received PTP frame.

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer
Returns
The Nanoseconds Timestamp field, captured from an Rx PTP frame

References XAVB_PTP_RX_PKT_TIMESTAMP_LOWER_OFFSET, XAVB_PTP_RX_PKT_TIMESTAMP_MID_OFFSET, XAvb_ReadPtpBuffer, and XAvb_ReorderWord().

Referenced by XAvb_CalcRtcOffset(), XAvb_DecodeRxPDelayResp(), and XAvb_DecodeRxPDelayRespFollowUp().

XStatus XAvb_CfgInitialize ( XAvb *  InstancePtr,
XAvb_Config *  ConfigPtr,
u32  EffectiveAddress 
)

A function to initialise variables in the data structure records.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]ConfigPtris the Configuration Pointer.
[in]EffectiveAddressis the base address of the Configuration Pointer.
Returns
  • XST_SUCCESS if initialization was successful
  • XST_DEVICE_NOT_FOUND if device configuration information was not found for a device with the supplied device ID.*

References XAvb_Config::BaseAddress, XAvb::Config, XAvb::GMDiscHandler, and XAvb::IsReady.

Referenced by main().

void XAvb_ChangePeerASCapability ( XAvb *  InstancePtr,
u8  capable 
)

Operations needed when the peer's AS capability changes.

Implements the XAvb_ChangePeerASCapability helper.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]capableis 1 if the peer is ASCapable, 0 otherwise.

References XAvb::PeerASCapable.

Referenced by XAvb_CalcDelay(), XAvb_ChangePTPLockStatus(), XAvb_DecodeRxPDelayResp(), XAvb_PtpTimerInterruptHandler(), XAvb_Reset(), and XAvb_Start().

void XAvb_ChangePTPLockStatus ( XAvb *  InstancePtr,
u8  locked 
)

Operations needed when PTP locks or unlocks.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]lockedis 1 if changing to locked status, zero if unlocked.

References XAvb::GMDiscCallBackRef, XAvb::GMDiscHandler, XAvb::PTPLocked, and XAvb_ChangePeerASCapability().

Referenced by XAvb_UpdateRtcIncrement().

u32 XAvb_CompareClockIdentity ( u32  BaseAddress,
XAvb_ClockIdentity  Identity1,
XAvb_ClockIdentity  Identity2 
)

A function to compare two ClockIdentity values.

Parameters
[in]BaseAddressis the base address of the device.
[in]Identity1is the first ClockIdentity to be compared.
[in]Identity2is the second ClockIdentity to be compared.
Returns
1 if the two values are equal, 0 if not equal

References XAvb_ClockIdentity::ClockIdentityLower, and XAvb_ClockIdentity::ClockIdentityUpper.

Referenced by XAvb_DecodeRxAnnounceFrame().

u32 XAvb_ComparePortIdentity ( u32  BaseAddress,
XAvb_PortIdentity  Identity1,
XAvb_PortIdentity  Identity2 
)

A function to compare two PortIdentity values.

Implements the XAvb_ComparePortIdentity helper.

Parameters
[in]BaseAddressis the base address of the device.
[in]Identity1is the first sourcePortIdentity to be compared.
[in]Identity2is the second sourcePortIdentity to be compared.
Returns
1 if the two values are equal, 0 if not equal

References XAvb_PortIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, and XAvb_PortIdentity::PortNumber.

Referenced by XAvb_DecodeRxAnnounceFrame(), XAvb_DecodeRxFollowUp(), XAvb_DecodeRxPDelayResp(), XAvb_DecodeRxPDelayRespFollowUp(), and XAvb_DecodeRxSync().

char XAvb_ConvertDurationToLogMean ( u16  fractionalVal)

A function to convert a fraction of 128 value that is compatible with.

Signalling data into a logMean (power of 2) value;

Parameters
[in]fractionalValis the Signalling data value that is to be converted.
Returns
fractionalVal represented as logMean (power of 2) value

Referenced by XAvb_UpdateLogMeanMessageInterval().

u16 XAvb_ConvertLogMeanToDuration ( char  logMeanVal)

A function to convert a logMean (power of 2) value into a fraction of 128.

Implements the XAvb_ConvertLogMeanToDuration helper.

that is compatible with Signalling data.

Parameters
[in]logMeanValis the base2 value that is to be converted.
Returns
logMeanVal represented as a fraction of 128

Referenced by XAvb_DecodeRxAnnounceFrame(), XAvb_DecodeRxSync(), XAvb_Reset(), and XAvb_UpdateIntervalDuration().

void XAvb_DecodeRxAnnounceFrame ( XAvb *  InstancePtr,
u32  PtpFrameBaseAddr 
)
void XAvb_DecodeRxSignaling ( XAvb *  InstancePtr,
u32  PtpFrameBaseAddr 
)
void XAvb_DecodeTxAnnounceFrame ( XAvb *  InstancePtr)

A New Announce Packet has been written to this device to transmit.

Implements the XAvb_DecodeTxAnnounceFrame helper.

We need to. decode it and rerun the Best Master Clock Algorithm (BMCA)

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

an updated True/False decision as to whether this device should operate as a clock master or a slave is written into the CurrentBmc data structure.

References XAvb_Config::BaseAddress, XAvb_ClockQuality::clockClass, XAvb_ClockIdentity::ClockIdentityLower, XAvb_ClockIdentity::ClockIdentityUpper, XAvb_BmcData::ClockQuality, XAvb::Config, XAvb::CurrentBmc, XAvb_BmcData::GrandmasterIdentity, XAvb_BmcData::GrandmasterPriority1, XAvb_BmcData::GrandmasterPriority2, XAvb_BmcData::IAmTheRtcMaster, XAvb_BecomeRtcMaster(), XAvb_BestMasterClockAlgorithm(), XAVB_PTP_TX_ANNOUNCE_OFFSET, XAvb_ReadAnnounceFrame(), and XAvb_UpdateBmcRecords().

Referenced by XAvb_DecodeRxAnnounceFrame(), and XAvb_Start().

void XAvb_GetPortIdentity ( u32  BaseAddress,
u32  PtpFrameBaseAddr,
u32  PortIdOffset,
XAvb_PortIdentity *  portID 
)

A function to extract portIdentity information from a received PTP frame.

This can be any portIdentity field (header portIdentity, requestingPortIdentity, etc.)

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer
[in]PortIdOffsetis the packet offset of the first byte of the portIdentity. field to be parsed
[in]portIDis the XAvb_PortIdentity struct that the data will be written to.

portID is updated with the portIdentity information.

References XAvb_PortIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb_PortIdentity::PortNumber, XAvb_ReadPtpBuffer, and XAvb_ReorderWord().

Referenced by XAvb_DecodeRxFollowUp(), XAvb_DecodeRxPDelayResp(), XAvb_DecodeRxPDelayRespFollowUp(), XAvb_DecodeRxSync(), and XAvb_ReadAnnounceFrame().

u32 XAvb_IncSequenceId ( u32  BaseAddress,
u32  PtpFrameBaseAddress 
)

A function to increment the sequenceId in a PTP frame template.

Implements the XAvb_IncSequenceId helper.

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddressis the base address of the TX PTP Buffer whose. SequenceID is to be incremented
Returns
The updated sequence ID written to the TX PTP packet buffer.

References XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET, XAvb_ReadPtpBuffer, XAvb_ReorderWord(), and XAvb_WritePtpBuffer.

Referenced by XAvb_MasterSendAnnounce(), XAvb_MasterSendSync(), and XAvb_SendPDelayReq().

u32 XAvb_IsRxFramePTP ( XAvb *  InstancePtr,
u32  PtpFrameBaseAddr 
)

A function to check that various fields in the received frame contain the.

expected values which define it as a valid AVB PTP frame. If this check does not pass then the frame should not be decoded and used.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer
Returns
An updated True/False decision as to whether this received frame really is a valid PTP type.

References XAvb_Config::BaseAddress, XAvb::Config, XAVB_PTP_ETHERTYPE, XAVB_PTP_RX_PKT_TYPE_OFFSET, XAVB_PTP_VERSION_PTP, XAvb_ReadPtpBuffer, and XAvb_ReorderWord().

Referenced by XAvb_PtpRxInterruptHandler().

void XAvb_MasterSendAnnounce ( XAvb *  InstancePtr)

A function to format then request the transmission of a PTP Announce Packet.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_IncSequenceId(), XAVB_PTP_TX_ANNOUNCE_OFFSET, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_SEND_ANNOUNCE_FRAME_MASK, XAvb_ReadReg, XAVB_RTC_NANOSEC_VALUE_OFFSET, XAVB_RTC_SEC_LOWER_VALUE_OFFSET, XAvb_WaitOnTxPtpQueue(), and XAvb_WriteReg.

Referenced by XAvb_PtpTimerInterruptHandler().

void XAvb_MasterSendFollowUp ( XAvb *  InstancePtr)

A function to format then request the transmission of a PTP Follow-Up Packet.

Implements the XAvb_MasterSendFollowUp helper.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_PtpStruct::Nanosec, XAvb::PtpRecords, XAVB_ONE_SECOND, XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_FOLLOW_UP_OFFSET, XAVB_PTP_TX_PKT_CORRECTION_FIELD_OFFSET, XAVB_PTP_TX_SEND_FOLLOWUP_FRAME_MASK, XAVB_PTP_TX_SYNC_OFFSET, XAvb_ReadPtpBuffer, XAvb_ReadReg, XAvb_ReorderWord(), XAVB_RTC_NANOSEC_OFFSET, XAVB_TX_MAC_LATENCY_IN_NS, XAvb_WaitOnTxPtpQueue(), XAvb_WritePtpBuffer, and XAvb_WriteReg.

Referenced by XAvb_PtpTimerInterruptHandler().

void XAvb_MasterSendSync ( XAvb *  InstancePtr)

A function to format then request the transmission of a PTP Sync Packet.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_PtpStruct::Nanosec, XAvb::PtpRecords, XAvb_IncSequenceId(), XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_FOLLOW_UP_OFFSET, XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_LOWER_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_MID_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_UPPER_OFFSET, XAVB_PTP_TX_SEND_SYNC_FRAME_MASK, XAVB_PTP_TX_SYNC_OFFSET, XAvb_ReadPtpBuffer, XAvb_ReadReg, XAvb_ReorderWord(), XAVB_RTC_NANOSEC_VALUE_OFFSET, XAVB_RTC_SEC_LOWER_VALUE_OFFSET, XAVB_RTC_SEC_UPPER_VALUE_OFFSET, XAvb_WaitOnTxPtpQueue(), XAvb_WritePtpBuffer, and XAvb_WriteReg.

Referenced by XAvb_PtpTimerInterruptHandler().

void XAvb_PtpRxInterruptHandler ( XAvb *  InstancePtr)
void XAvb_ReadAnnounceFrame ( u32  BaseAddress,
u32  PtpFrameBaseAddr,
XAvb_BmcData *  AnnounceFrame 
)

Analyzes a new Announce packet.

Implements the XAvb_ReadAnnounceFrame helper.

read in the. packet, decode it, and extract the relevant information fields to the "AnnounceFrame" data pointer.

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer
[in]AnnounceFrameis a pointer to a suitable data structure, designed to. record the useful fields from the received Announce Packet
Note
The AnnounceFrame data structure is updated.

References XAvb_ClockQuality::clockAccuracy, XAvb_ClockQuality::clockClass, XAvb_PortIdentity::ClockIdentityLower, XAvb_ClockIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb_ClockIdentity::ClockIdentityUpper, XAvb_BmcData::ClockQuality, XAvb_BmcData::GrandmasterIdentity, XAvb_BmcData::GrandmasterPriority1, XAvb_BmcData::GrandmasterPriority2, XAvb_ClockQuality::offsetScaledLogVariance, XAvb_BmcData::SourcePortIdentity, XAvb_BmcData::stepsRemoved, XAvb_GetPortIdentity(), XAVB_PTP_RX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET, XAVB_PTP_RX_PKT_ANNOUNCE_GMID_MID_OFFSET, XAVB_PTP_RX_PKT_ANNOUNCE_PRI1_QUAL_HI_OFFSET, XAVB_PTP_RX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET, XAVB_PTP_RX_PKT_ANNOUNCE_STEPSREMOVED_LOW_TIMESRC_OFFSET, XAVB_PTP_RX_PKT_PORTID_UPPER_OFFSET, XAvb_ReadPtpBuffer, and XAvb_ReorderWord().

Referenced by XAvb_BecomeRtcMaster(), XAvb_DecodeRxAnnounceFrame(), and XAvb_DecodeTxAnnounceFrame().

void XAvb_ReadAnnounceReceiptTimeout ( u32  BaseAddress,
u32  PtpFrameBaseAddr,
XAvb_BmcData *  AnnounceFrame 
)

Reads the logMessageinteval from an RX PTP Buffer and updates.

Implements the XAvb_ReadAnnounceReceiptTimeout helper.

the AnnounceFrame struct with the value read.

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer
[in]AnnounceFrameis a pointer to a suitable data structure, designed to. record the useful fields from the received Announce Packet
Note
The AnnounceFrame data structure is updated.

References XAvb_BmcData::logMessageInterval, XAVB_PTP_RX_PKT_SEQUENCEID_OFFSET, XAvb_ReadPtpBuffer, and XAvb_ReorderWord().

Referenced by XAvb_DecodeRxAnnounceFrame().

void XAvb_ReadRtc ( u32  BaseAddress,
XAvb_RtcFormat *  RtcValue 
)

Reads the current Real Time Counter (RTC) value.

Parameters
[in]BaseAddressis the base address of the device.
[in]RtcValueis a pointer to a struct in which to store the value read. from the RTC (The RTC 48-bit seconds field and the 32-bit ns field of this struct are updated).
Note
This is provided as a basic function since the ns field MUST be read before the seconds/epoch registers (reading the ns samples the entire RTC in hardware).

References XAvb_RtcFormat::NanoSeconds, XAvb_RtcFormat::SecondsLower, XAvb_RtcFormat::SecondsUpper, XAVB_RTC_NANOSEC_VALUE_OFFSET, XAVB_RTC_NS_MASK, XAVB_RTC_SEC_LOWER_MASK, XAVB_RTC_SEC_LOWER_VALUE_OFFSET, XAVB_RTC_SEC_UPPER_MASK, and XAVB_RTC_SEC_UPPER_VALUE_OFFSET.

Referenced by XAvb_CalcRtcOffset(), and XAvb_SendPDelayRespFollowUp().

u32 XAvb_ReorderWord ( u32  Data)

Switches the bytes in a 4-byte word, swapping the MSB for the.

Implements the XAvb_ReorderWord helper.

LSB, and vice-versa.

Parameters
[in]Datais the 4-byte input data word.
Returns
The input data word with the bytes swapped (most significant down to least significant

Referenced by main(), XAvb_CalcRtcOffset(), XAvb_CaptureNanoSec(), XAvb_DecodeRxFollowUp(), XAvb_DecodeRxPDelayResp(), XAvb_DecodeRxPDelayRespFollowUp(), XAvb_DecodeRxSignaling(), XAvb_DecodeRxSync(), XAvb_GetPortIdentity(), XAvb_IncSequenceId(), XAvb_IsRxFramePTP(), XAvb_MasterSendFollowUp(), XAvb_MasterSendSync(), XAvb_ReadAnnounceFrame(), XAvb_ReadAnnounceReceiptTimeout(), XAvb_SendPDelayReq(), XAvb_SendPDelayResp(), XAvb_SendPDelayRespFollowUp(), and XAvb_SetupSourcePortIdentity().

void XAvb_SendPDelayReq ( XAvb *  InstancePtr)

A function to format then request the transmission of a PTP PDelay Request.

Packet

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_SequenceIdStruct::PDelayReqSequenceId, XAvb_PtpStruct::PDelayTimestampT1, XAvb::PtpRecords, XAvb::SequenceIdRecords, XAvb_IncSequenceId(), XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_PDELAYREQ_OFFSET, XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET, XAVB_PTP_TX_SEND_PDELAYREQ_FRAME_MASK, XAvb_ReadPtpBuffer, XAvb_ReorderWord(), XAVB_TX_MAC_LATENCY_IN_NS, XAvb_WaitOnTxPtpQueue(), and XAvb_WriteReg.

Referenced by XAvb_PtpTimerInterruptHandler().

void XAvb_SendPDelayResp ( XAvb *  InstancePtr,
u32  PtpFrameBaseAddr 
)

A function to format then request the transmission of a PTP PDelay Response.

Packet

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]PtpFrameBaseAddris the base address of the received Announce Packet. in the Rx PTP Packet Buffer

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_PtpStruct::NsOffsetForPDelayResp, XAvb::PtpRecords, XAVB_ONE_SECOND, XAVB_PDELAY_LOG_MEAN_MESSAGE_INT, XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET, XAVB_PTP_RX_PKT_PORTID_LOWER_OFFSET, XAVB_PTP_RX_PKT_PORTID_MID_OFFSET, XAVB_PTP_RX_PKT_PORTID_UPPER_OFFSET, XAVB_PTP_RX_PKT_SEQUENCEID_OFFSET, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_PDELAYRESP_FOLLOW_UP_OFFSET, XAVB_PTP_TX_PDELAYRESP_OFFSET, XAVB_PTP_TX_PKT_REQ_PORTID_LOWER_OFFSET, XAVB_PTP_TX_PKT_REQ_PORTID_MID_OFFSET, XAVB_PTP_TX_PKT_REQ_PORTID_UPPER_OFFSET, XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_LOWER_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_MID_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_UPPER_OFFSET, XAVB_PTP_TX_SEND_PDELAYRESP_FRAME_MASK, XAvb_ReadPtpBuffer, XAvb_ReadReg, XAvb_ReorderWord(), XAVB_RTC_NANOSEC_OFFSET, XAVB_RTC_NANOSEC_VALUE_OFFSET, XAVB_RTC_SEC_LOWER_VALUE_OFFSET, XAVB_RTC_SEC_UPPER_VALUE_OFFSET, XAVB_RX_MAC_LATENCY_IN_NS, XAvb_WaitOnTxPtpQueue(), XAvb_WritePtpBuffer, and XAvb_WriteReg.

Referenced by XAvb_PtpRxInterruptHandler().

void XAvb_SendPDelayRespFollowUp ( XAvb *  InstancePtr)

A function to format then request the transmission of a PTP PDelay Response.

Implements the XAvb_SendPDelayRespFollowUp helper.

Follow-Up Packet

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

the relevant Tx PTP Packet Buffer is written to with the updated PTP fields, and then the Tx PTP Packet Buffer Control Register is written to request the frame transmission.

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_RtcFormat::NanoSeconds, XAvb_PtpStruct::NsOffsetForPDelayResp, XAvb::PtpRecords, XAvb_RtcFormat::SecondsLower, XAvb_RtcFormat::SecondsUpper, XAVB_ONE_SECOND, XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_PDELAYRESP_FOLLOW_UP_OFFSET, XAVB_PTP_TX_PDELAYRESP_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_LOWER_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_MID_OFFSET, XAVB_PTP_TX_PKT_TIMESTAMP_UPPER_OFFSET, XAVB_PTP_TX_SEND_PDELAYRESPFOLLOWUP_FRAME_MASK, XAvb_ReadPtpBuffer, XAvb_ReadRtc(), XAvb_ReorderWord(), XAVB_TX_MAC_LATENCY_IN_NS, XAvb_WaitOnTxPtpQueue(), XAvb_WritePtpBuffer, and XAvb_WriteReg.

Referenced by XAvb_PtpRxInterruptHandler().

void XAvb_SetGMDiscontinuityHandler ( XAvb *  InstancePtr,
XAvb_Handler  FuncPtr,
void *  CallBackRef 
)

Sets the handler that will be called when a GM discontinuity.

event is identified by the driver. The purpose of the handler is to allow application specific processing to be performed.

Parameters
[in]InstancePtris a pointer to the XAvb instance.
[in]FuncPtris the pointer to the callback function.
[in]CallBackRefis the upper layer callback reference passed back. when the callback function is invoked.
Note
There is no assert on the CallBackRef since the driver doesn't know what it is (nor should it)

References XAvb::GMDiscCallBackRef, XAvb::GMDiscHandler, and XAvb::IsReady.

Referenced by main().

void XAvb_SetupRxFilterControlMatchMode ( XAvb *  InstancePtr,
u32  VlanMatchMode 
)

A function to set the VLAN Match Mode field for the RX Filtering Control.

Implements the XAvb_SetupRxFilterControlMatchMode helper.

Register - such that AV traffic is correctly filtered by the RX Splitter.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]VlanMatchModecontains the 1-bit value to be written to the register. in the correct bit position as defined in the address map

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_ReadReg, XAVB_RX_AV_VLAN_MATCH_MODE_MASK, XAVB_RX_FILTER_CONTROL, and XAvb_WriteReg.

void XAvb_SetupRxFilterControlPcp ( XAvb *  InstancePtr,
u32  VlanPriority,
u8  SrClass 
)

A function to set the VLAN PCP field for either SR A or B traffic in the.

RX Filtering Control Register - such that AV traffic is correctly filtered by the RX Splitter.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]VlanPrioritycontains the 3-bit value to be written to the register. in the correct bit positions as defined in the address map
[in]SrClassis '0' if VLAN Priority (PCP) A is to be updated and is. '1' if VLAN Priority (PCP) B is to be updated

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_ReadReg, XAVB_RX_AV_VLAN_PRIORITY_A_MASK, XAVB_RX_AV_VLAN_PRIORITY_B_MASK, XAVB_RX_FILTER_CONTROL, and XAvb_WriteReg.

void XAvb_SetupRxFilterControlVid ( XAvb *  InstancePtr,
u32  VlanVid,
u8  SrClass 
)

A function to set the VLAN VID field for either SR A or B traffic in the.

Implements the XAvb_SetupRxFilterControlVid helper.

RX Filtering Control Register - such that AV traffic is correctly filtered by the RX Splitter.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]VlanVidcontains the 12-bit value to be written to the register. in the correct bit positions as defined in the address map
[in]SrClassis '0' if VLAN VID A is to be updated and is. '1' if VLAN VID B is to be updated

References XAvb_Config::BaseAddress, XAvb::Config, XAvb_ReadReg, XAVB_RX_AV_VLAN_VID_A_MASK, XAVB_RX_AV_VLAN_VID_B_MASK, XAVB_RX_FILTER_CONTROL, and XAvb_WriteReg.

void XAvb_SetupSourcePortIdentity ( XAvb *  InstancePtr,
XAvb_PortIdentity  systemIdentity 
)

Updates the portIdLocal local copy of the sourcePortIdentity.

Implements the XAvb_SetupSourcePortIdentity helper.

and writes this value into the TX PTP frame buffer templates. The fields that are written are: o sourcePortIdentity for all default PTP frames o Announce:: grandmasterIdentity o Announce:: TLV clockIdentity

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.
[in]systemIdentityis the clockIdentity and portNumber for this endpoint.
Note
Announce::TLV. By default the tlvType and length field are set up in the BRAM, assuming that N = 1.

References XAvb_Config::BaseAddress, XAvb_PortIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb::Config, XAvb::portIdLocal, XAvb_PortIdentity::PortNumber, XAVB_PTP_TX_ANNOUNCE_OFFSET, XAVB_PTP_TX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET, XAVB_PTP_TX_PKT_ANNOUNCE_GMID_MID_OFFSET, XAVB_PTP_TX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET, XAVB_PTP_TX_PKT_ANNOUNCE_TLVLEN_PATHSEQ_START_OFFSET, XAVB_PTP_TX_PKT_PORTID_LOWER_OFFSET, XAVB_PTP_TX_PKT_PORTID_MID_OFFSET, XAVB_PTP_TX_PKT_PORTID_UPPER_OFFSET, XAvb_ReadPtpBuffer, XAvb_ReorderWord(), XAvb_WritePtpBuffer, and XAvb_WriteToMultipleTxPtpFrames().

Referenced by main().

void XAvb_Start ( XAvb *  InstancePtr)

start the PTP drivers running.

Parameters
[in]InstancePtris a pointer to the Xavb instance to be worked on.

References XAvb::IsReady, XAvb::PtpIsRunning, XAvb_ChangePeerASCapability(), and XAvb_DecodeTxAnnounceFrame().

Referenced by main().

void XAvb_Stop ( XAvb *  InstancePtr)

stop the PTP drivers from running.

Parameters
[in]InstancePtris a pointer to the Xavb instance to be worked on.

References XAvb::IsReady, and XAvb_Reset().

void XAvb_UpdateBmcRecords ( XAvb_BmcData *  NewMaster,
XAvb_BmcData *  CurrentBmc 
)

accept the data pointer to the current BMCA records, accept.

Implements the XAvb_UpdateBmcRecords helper.

an equivalent pointer to a new (winning) Grand Masters Announce Packet information. The CurrentBmc data structure is then updated with the information from the NewMaster.

Parameters
[in]NewMasteris a pointer to a suitable data structure which has recorded. the relevant Announce Packet fields of the new (winning) Grand Master.
[in]CurrentBmcis a pointer to a suitable data structure which has. recorded the current fields of the current Grand Master's Announce Packet.
Note
The CurrentBmc data structure is updated.

References XAvb_PortIdentity::ClockIdentityLower, XAvb_ClockIdentity::ClockIdentityLower, XAvb_PortIdentity::ClockIdentityUpper, XAvb_ClockIdentity::ClockIdentityUpper, XAvb_BmcData::ClockQuality, XAvb_BmcData::GrandmasterIdentity, XAvb_BmcData::GrandmasterPriority1, XAvb_BmcData::GrandmasterPriority2, XAvb_PortIdentity::PortNumber, XAvb_BmcData::SourcePortIdentity, and XAvb_BmcData::stepsRemoved.

Referenced by XAvb_BecomeRtcMaster(), XAvb_DecodeRxAnnounceFrame(), and XAvb_DecodeTxAnnounceFrame().

u16 XAvb_UpdateIntervalDuration ( u16  currentIntervalDuration,
char  logMeanVal 
)

A function to update a PTP message Interval Duration (defined as a.

fraction of 128 seconds). If the endpoint cannot support a requested logMeanVal then do not perform the conversion - return the current value.

Parameters
[in]currentIntervalDurationis the Interval Duration to be updated.
[in]logMeanValis the base2 value that is to be converted.
Returns
logMeanVal represented as a fraction of 128
Note
This endpoint only supports logMeanValues >=-7 and <=8.

References XAvb_ConvertLogMeanToDuration(), XAVB_MAX_SUPPORTED_LOG_MEAN_INTERVAL, and XAVB_MIN_SUPPORTED_LOG_MEAN_INTERVAL.

Referenced by XAvb_DecodeRxSignaling().

void XAvb_UpdateLogMeanMessageInterval ( u32  BaseAddress,
u32  PtpFrameBaseAddr,
u16  intervalDuration 
)

A function to update the logMeanMessageInterval field in a PTP packet.

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFrameBaseAddris the base address of the TX PTP Buffer to be updated.
[in]intervalDurationis the "fraction of 128" value of the data to be written.

the relevant Tx PTP Packet Buffer is written to with the updated logMeanMessageInterval

References XAvb_ConvertDurationToLogMean(), XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET, XAvb_ReadPtpBuffer, and XAvb_WritePtpBuffer.

Referenced by XAvb_DecodeRxSignaling(), and XAvb_Reset().

void XAvb_UpdateRtcIncrement ( XAvb *  InstancePtr)
void XAvb_WaitOnTxPtpQueue ( XAvb *  InstancePtr)

The software drivers are kept simple by only requesting a single PTP frame to.

Implements the XAvb_WaitOnTxPtpQueue helper.

be transmitted at a time. Checks (and if necessary waits) until the previously request PTP frame has been transmitted.

Parameters
[in]InstancePtris a pointer to the XAvb instance to be worked on.

References XAvb_Config::BaseAddress, XAvb::Config, XAVB_PTP_TX_CONTROL_OFFSET, XAVB_PTP_TX_WAIT_ALL_FRAMES_MASK, and XAvb_ReadReg.

Referenced by XAvb_MasterSendAnnounce(), XAvb_MasterSendFollowUp(), XAvb_MasterSendSync(), XAvb_SendPDelayReq(), XAvb_SendPDelayResp(), and XAvb_SendPDelayRespFollowUp().

void XAvb_WriteRtcOffset ( u32  BaseAddress,
XAvb_RtcFormat *  RtcValue 
)

Writes to the Real Time Counter (RTC) Offset Registers.

Parameters
[in]BaseAddressis the base address of the device.
[in]RtcValueis the nanoseconds and seconds offset values that should. be written to the RTC.
Note
This is provided as a basic function since the ns field MUST be written after the seconds/epoch offset registers (writing to the ns offset registers samples the entire RTC offset in hardware).

References XAvb_RtcFormat::NanoSeconds, XAvb_RtcFormat::SecondsLower, XAvb_RtcFormat::SecondsUpper, XAVB_RTC_NANOSEC_OFFSET, XAVB_RTC_NS_MASK, XAVB_RTC_SEC_LOWER_MASK, XAVB_RTC_SEC_LOWER_OFFSET, XAVB_RTC_SEC_UPPER_MASK, and XAVB_RTC_SEC_UPPER_OFFSET.

Referenced by XAvb_CalcRtcOffset().

void XAvb_WriteToMultipleTxPtpFrames ( u32  BaseAddress,
u32  PtpFieldAddress,
u32  Data,
u32  DataBitEnable,
u8  BufferEnable 
)

A function to write common data (eg the Source Address) to all PTP frames.

Implements the XAvb_WriteToMultipleTxPtpFrames helper.

stored in the Tx PTP Packet buffer

Parameters
[in]BaseAddressis the base address of the device.
[in]PtpFieldAddressis the offset address of the relevant field in PTP. frames.
[in]Datais the common data to be written to all Tx PTP frame templates.
[in]DataBitEnableallows only selected bits of the 32-bit Data word to. be modified.
[in]BufferEnableallows the selected buffer to be selected: there are 8. PTP buffers - these are encoded as one-hot. For example, 0x3F will write the selected data to the first 6 buffers only.

the Tx PTP Packet Buffer is written to as requested

References XAVB_PTP_TX_SYNC_OFFSET, XAvb_ReadPtpBuffer, and XAvb_WritePtpBuffer.

Referenced by main(), and XAvb_SetupSourcePortIdentity().

void XAvbMac_ReadStats ( u32  BaseAddress,
u32  CounterId,
XAvb_Uint64 *  Value 
)

Reads the given Ethernet Statistic Register.

Parameters
[in]BaseAddressis the base address of the device.
[in]CounterIdis the statistic counter to read.
[in]Valuea pointer to the read value of the 64-bit value of the counter. and it is updated by this function
Note
The CounterId values defined here are the same as the Statistic Counter Addresses as used with the TEMAC core. Since each counter is 8-bytes wide, we must multiply these Counter ID's by 8 (or a left shift of 3) when mapping this into the PLB memory map. The 64-bit counter value is read as two separate 32-bit accesses.

References XAvb_Uint64::Lower, and XAvb_Uint64::Upper.

int XAxiEnet_Recv ( XMcdma *  InstancePtr)

Receives a frame through AXI Ethernet and MCDMA.

Parameters
[in]InstancePtrPointer to the driver instance.
Returns
XST_SUCCESS on success, otherwise an error code.

Referenced by AxiEthernetPingReqExample().

int XAxienet_Send ( XAxiEthernet *  AxiEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId,
UINTPTR  TxBufPtr,
u32  len 
)

Sends a frame through AXI Ethernet and MCDMA.

Parameters
[in]AxiEthernetInstancePtrPointer to the AXI Ethernet driver instance.
[in]DmaInstancePtrPointer to the DMA driver instance.
[in]ChanIdMCDMA channel identifier.
[in]TxBufPtrPointer to the transmit buffer.
[in]lenLength of the frame in bytes.
Returns
XST_SUCCESS on success, otherwise an error code.

Referenced by SendArpReqFrame(), and SendEchoReqFrame().

int XAxiEthernet_AddExtMulticastGroup ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_AddExtMulticastGroup adds an entry to the multicast Ethernet.

address table. The new entry, represents a group of MAC addresses based on the contents of AddressPtr. AddressPtr is one member of the MAC address set in the newly added entry.

The device must be stopped to use this function.

Once an Ethernet address is programmed, the Axi Ethernet device will begin receiving data sent from that address. The Axi Ethernet hardware does not have a control bit to disable multicast filtering. The only way to prevent the Axi Ethernet device from receiving messages from an Ethernet address in the multicast table is to clear it with XAxiEthernet_ClearExtMulticastGroup().

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a pointer to the 6-byte Ethernet address to add.
Returns
  • XST_SUCCESS.on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_INVALID_PARAM if the input MAC address is not between 01:00:5E:00:00:00 and 01:00:5E:7F:FF:FF per RFC1112.

This routine consider all 2**23 possible multicast Ethernet addresses to be 8Mx1 bit or 1M bytes memory area. All defined multicast addresses are from 01.00.5E.00.00.00 to 01.00.5E.7F.FF.FF The most significant 25 bit out of 48 bit are static, so they will not be part of calculation.

The hardware requires to 'index' with bit 22-8, 15 bits in total. The least significant byte/8 bits are considered a group.

This API operates at a group (256 MAC addresses) for hardware to do the first layer address filtering. It is user's responsibility to provision this table appropriately.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_MCAST_TABLE_OFFSET, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtMulticastExample().

int XAxiEthernet_CfgInitialize ( XAxiEthernet *  InstancePtr,
XAxiEthernet_Config *  CfgPtr,
UINTPTR  EffectiveAddress 
)

XAxiEthernet_CfgInitialize initializes an AXI Ethernet device along with the.

InstancePtr that references it.

The PHY is setup independently from the Ethernet core. Use the MII or whatever other interface may be present for setup.

Parameters
[out]InstancePtrreferences the memory instance to be associated with the AXI Ethernet core instance upon initialization.
[in]CfgPtrreferences the structure holding the hardware configuration for the Axi Ethernet core to initialize.
[in]EffectiveAddressis the processor address used to access the base address of the AXI Ethernet instance. In systems with an MMU and virtual memory, EffectiveAddress is the virtual address mapped to the physical in ConfigPtr->Config.BaseAddress. In systems without an active MMU, EffectiveAddress should be set to the same value as ConfigPtr->Config.BaseAddress.
Returns
XST_SUCCESS.

References XAxiEthernet_Config::AxiDevBaseAddress, XAxiEthernet::AxiDevBaseAddress, XAxiEthernet::AxiDevType, XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, XAxiEthernet::IsReady, XAxiEthernet::PhyMode, XAxiEthernet_Config::PhyType, XAE_AXIBASEADDR_MASK, XAE_AXIDEVTYPE_MASK, and XAxiEthernet_Reset().

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPingReqExample(), AxiEthernetPolledExample(), AxiEthernetSgDmaIntrExample(), AxiEthernetSgDmaPollExample(), and main().

void XAxiEthernet_ClearBadFrmRcvOption ( XAxiEthernet *  InstancePtr)

Disables the bad frame receive option.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_RAF_OFFSET, XAE_RAF_RXBADFRMEN_MASK, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

int XAxiEthernet_ClearExtMulticastGroup ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_ClearExtMulticastGroup clears input multicast Ethernet address.

group from table.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a pointer to the 6-byte Ethernet address to clear.
Returns
  • XST_SUCCESS on successful completion, returns XST_SUCCESS.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped
  • XST_INVALID_PARAM if input MAC address is not between 01:00:5E:00:00:00 and 01:00:5E:7F:FF:FF per RFC1112.

Please reference XAxiEthernet_AddExtMulticastGroup for multicast address index and bit value calculation.

In table, hardware requires to 'index' with bit 22-8, 15 bits in total. The least significant byte/8 bits are considered a group.

There is a scenario that might introduce issues: When multicast tables are programmed initially to accept 01:00:5E:12:34:56 and 01:00:5E:12:34:78 but later decided to clear 01:00:5E:12:34:78. Without validating all possible combinations at the indexed entry, multicast table might be misconfigured and drop frames.

When clearing a multicast address table entry, note that a whole group of mac addresses will no longer be accepted - this because an entry in the table represents multiple(256) mac addresses.

The device must be stopped to use this function.

This API operates at a group (256 MAC addresses) level for hardware to perform the first layer address filtering. It is user's responsibility to provision this table appropriately.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_MCAST_TABLE_OFFSET, and XAxiEthernet_WriteReg.

int XAxiEthernet_ClearOptions ( XAxiEthernet *  InstancePtr,
u32  Options 
)

XAxiEthernet_ClearOptions clears the options, Options for the.

Axi Ethernet, specified by InstancePtr. Axi Ethernet should be stopped with XAxiEthernet_Stop() before changing options.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Optionsis a bitmask of OR'd XAE_*_OPTION values for options to clear. Options not specified are not affected.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the device has not been stopped.

See xaxiethernet.h for a description of the available options.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAxiEthernet::Options, XAE_BROADCAST_OPTION, XAE_FCC_FCRX_MASK, XAE_FCC_OFFSET, XAE_FCS_INSERT_OPTION, XAE_FCS_STRIP_OPTION, XAE_FLOW_CONTROL_OPTION, XAE_FMI_OFFSET, XAE_FMI_PM_MASK, XAE_JUMBO_OPTION, XAE_LENTYPE_ERR_OPTION, XAE_MULTICAST_OPTION, XAE_PROMISC_OPTION, XAE_RAF_BCSTREJ_MASK, XAE_RAF_EMULTIFLTRENBL_MASK, XAE_RAF_MCSTREJ_MASK, XAE_RAF_NEWFNCENBL_MASK, XAE_RAF_OFFSET, XAE_RAF_RXVSTRPMODE_MASK, XAE_RAF_RXVTAGMODE_MASK, XAE_RAF_TXVSTRPMODE_MASK, XAE_RAF_TXVTAGMODE_MASK, XAE_RCW1_FCS_MASK, XAE_RCW1_JUM_MASK, XAE_RCW1_LT_DIS_MASK, XAE_RCW1_OFFSET, XAE_RCW1_RX_MASK, XAE_RCW1_VLAN_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TC_FCS_MASK, XAE_TC_JUM_MASK, XAE_TC_OFFSET, XAE_TC_TX_MASK, XAE_TC_VLAN_MASK, XAE_TRANSMITTER_ENABLE_OPTION, XAE_VLAN_OPTION, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetResetDevice(), AxiEthernetSgDmaIntrCoalescingExample(), and AxiEthernetSgDmaIntrExtMulticastExample().

int XAxiEthernet_ClearTpid ( XAxiEthernet *  InstancePtr,
u8  Entry 
)

XAxiEthernet_ClearTpid clears the VLAN Tag Protocol Identifier(TPID).

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Entryis the hardware storage location to program this address and must be between 0..XAE_TPID_MAX_ENTRIES.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable or have the VLAN tag capability.
Note
The device must be stopped to use this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_TPID0_OFFSET, XAE_TPID1_OFFSET, XAE_TPID_0_MASK, XAE_TPID_1_MASK, XAE_TPID_MAX_ENTRIES, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

void XAxiEthernet_DisableControlFrameLenCheck ( XAxiEthernet *  InstancePtr)

Disables the length check for control frames.

When this API is called, control frames larger than the minimum frame length are accepted.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_RCW1_CL_DIS_MASK, XAE_RCW1_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

void XAxiEthernet_DumpExtMulticastGroup ( XAxiEthernet *  InstancePtr)

XAxiEthernet_DumpExtMulticastGroup dumps ALL provisioned acceptable multicast.

MAC in the Axi Ethernet device's multicast table.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.

Hardware requires to 'index' with bit 22-8, 15 bits in total. The least significant byte/8 bits are considered a set.

This API operates at a set (256 MAC addresses) level.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_MCAST_TABLE_OFFSET, and XAxiEthernet_ReadReg.

void XAxiEthernet_EnableControlFrameLenCheck ( XAxiEthernet *  InstancePtr)

Enables the length check for control frames.

After calling this API, all control frames received are checked for proper length (less than the minimum frame length). By default, control frame length check is enabled at start up. Call this API only if XAxiEthernet_DisableControlFrameLenCheck was used earlier to disable the check.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_RCW1_CL_DIS_MASK, XAE_RCW1_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

int XAxiEthernet_GetExtMulticastGroup ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_GetExtMulticastGroup returns whether the given Ethernet address.

group is stored in the table.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a pointer to the 6-byte Ethernet address.
Returns
  • TRUE if it is an acceptable multicast MAC address and the group is present in the table.
  • FALSE if it is not a valid multicast MAC address or the group was not found in the table.

In the table, hardware requires to 'index' with bit 22-8, 15 bits in total. The least significant byte/8 bits are considered a group. This API operates at a group (256 MAC addresses) level.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_MCAST_TABLE_OFFSET, and XAxiEthernet_ReadReg.

Referenced by AxiEthernetSgDmaIntrExtMulticastExample().

void XAxiEthernet_GetMacAddress ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

Reads the MAC address for the AXI Ethernet device.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]AddressPtrreferences the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length.
Note
This routine also supports the extended/new VLAN and multicast mode. The XAE_RAF_NEWFNCENBL_MASK bit dictates which offset is configured.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_UAW0_OFFSET, XAE_UAW1_OFFSET, XAE_UAWL_OFFSET, XAE_UAWU_OFFSET, and XAxiEthernet_ReadReg.

Referenced by AxiEthernetResetDevice().

void XAxiEthernet_GetMacPauseAddress ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_GetMacPauseAddress gets the MAC address used for pause frames.

for the Axi Ethernet device specified by InstancePtr.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtrreferences the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_RCW0_OFFSET, XAE_RCW1_OFFSET, and XAxiEthernet_ReadReg.

u16 XAxiEthernet_GetOperatingSpeed ( XAxiEthernet *  InstancePtr)

Reads the current operating link speed.

The value may come from XAxiEthernet_SetOperatingSpeed() or a hardware default.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
Returns
Link speed in megabits per second (10, 100, or 1000). Returns 0 if a valid speed is not read from EMMC.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_EMMC_LINKSPD_10, XAE_EMMC_LINKSPD_100, XAE_EMMC_LINKSPD_1000, XAE_EMMC_LINKSPEED_MASK, XAE_EMMC_OFFSET, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, and XAxiEthernet_ReadReg.

u32 XAxiEthernet_GetOptions ( XAxiEthernet *  InstancePtr)

XAxiEthernet_GetOptions returns the current option settings.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
Returns
Returns a bitmask of XAE_*_OPTION constants, each bit specifying an option that is currently active.

See xaxiethernet.h for a description of the available options.

References XAxiEthernet::IsReady, and XAxiEthernet::Options.

Referenced by AxiEthernetResetDevice().

int XAxiEthernet_GetRgmiiStatus ( XAxiEthernet *  InstancePtr,
u16 *  SpeedPtr,
int *  IsFullDuplexPtr,
int *  IsLinkUpPtr 
)

XAxiEthernet_GetRgmiiStatus get the state of the link when using the RGMII.

media interface.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]SpeedPtrreferences the location to store the result, which is the auto negotiated link speed in units of Mbits/sec, either 0, 10, 100, or 1000.
[out]IsFullDuplexPtrreferences the value that is set by this function to indicate full duplex operation. IsFullDuplexPtr is set to TRUE when the RGMII link is operating in full duplex mode, otherwise it is set to FALSE.
[out]IsLinkUpPtrreferences the value that is set by this function to indicate the link status.IsLinkUpPtr is set to TRUE when the RGMII link up, otherwise it is set to FALSE.
Returns
  • XST_SUCCESS on successful completion.
  • XST_NO_FEATURE if the Axi Ethernet device is not using an RGMII interface,

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_PHY_TYPE_RGMII_1_3, XAE_PHY_TYPE_RGMII_2_0, XAE_PHYC_OFFSET, XAE_PHYC_RGLINKSPD_10, XAE_PHYC_RGLINKSPD_100, XAE_PHYC_RGLINKSPD_1000, XAE_PHYC_RGMIIHD_MASK, XAE_PHYC_RGMIILINK_MASK, XAE_PHYC_RGMIILINKSPEED_MASK, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, and XAxiEthernet_ReadReg.

int XAxiEthernet_GetSgmiiStatus ( XAxiEthernet *  InstancePtr,
u16 *  SpeedPtr 
)

XAxiEthernet_GetSgmiiStatus get the state of the link when using the SGMII.

media interface.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]SpeedPtrreferences the location to store the result, which is the auto negotiated link speed in units of Mbits/sec, either 0, 10, 100, or 1000.
Returns
  • XST_SUCCESS on successful completion.
  • XST_NO_FEATURE if the Axi Ethernet device is not using an SGMII interface,
Note
Currently SGMII PHY does not support half duplex mode.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_PHY_TYPE_SGMII, XAE_PHYC_OFFSET, XAE_PHYC_SGLINKSPD_10, XAE_PHYC_SGLINKSPD_100, XAE_PHYC_SGLINKSPD_1000, XAE_PHYC_SGMIILINKSPEED_MASK, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, and XAxiEthernet_ReadReg.

void XAxiEthernet_GetTpid ( XAxiEthernet *  InstancePtr,
u16 *  TpidPtr,
u8  Entry 
)

XAxiEthernet_GetTpid gets the VLAN Tag Protocol Identifier value (TPID).

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]TpidPtrreferences the location to store the result.
[in]Entryis the hardware storage location to program this address and must be between 0..XAE_TPID_MAX_ENTRIES.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_TPID0_OFFSET, XAE_TPID1_OFFSET, XAE_TPID_0_MASK, XAE_TPID_MAX_ENTRIES, and XAxiEthernet_ReadReg.

void XAxiEthernet_GetVidTable ( XAxiEthernet *  InstancePtr,
u32  Entry,
u32 *  VidPtr,
u8 *  StripPtr,
u8 *  TagPtr,
int  Dir 
)

XAxiEthernet_GetVidTable gets VID table content includes new VLAN ID, strip.

and tag enable bits.

The device must be stopped to use this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Entryis the hardware storage location/index to program updated VID value, strip, or tag value. The value must be between 0..0xFFF.
[out]VidPtrreferences the location to store the result. Stores the Vid value indexed by Entry into this location.
[out]StripPtrreferences the location to store the result. Stores the strip enable bit value indexed by Entry into this location.
[out]TagPtrreferences the location to store the result. This function stores the tag enable bit value indexed by Entry into this location.
[in]Dirmust be either XAE_TX or XAE_RX.

The hardware requires the table to be 'indexed' with Entry and must be 0x000..0xFFF.

Bits layout is bbbb bbbb bbbb b b VLAN ID (12b), | | | VLAN double tag enable bit VLAN strip enable bit

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_MAX_VLAN_TABL_ENTRY, XAE_RX, XAE_RX_VLAN_DATA_OFFSET, XAE_TX, XAE_TX_VLAN_DATA_OFFSET, XAE_VLAN_TABL_STRP_ENTRY_MASK, XAE_VLAN_TABL_STRP_STRT_OFFSET, XAE_VLAN_TABL_TAG_ENTRY_MASK, XAE_VLAN_TABL_VID_START_OFFSET, and XAxiEthernet_ReadReg.

void XAxiEthernet_GetVStripMode ( XAxiEthernet *  InstancePtr,
u8 *  ModePtr,
int  Dir 
)

XAxiEthernet_GetVStripMode gets the VLAN stripping mode.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]ModePtrreferences the location to store the VLAN strip mode returned by this function. Value is b'00, b'01 or b'11. Refer XAE_VTSRAP_* in xaxiethernet.h file for the details.
[in]Dirmust be either XAE_TX or XAE_RX.

Mode value shifting is handled in this function. No shifting is required to call this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_RAF_OFFSET, XAE_RAF_RXVSTRPMODE_MASK, XAE_RAF_RXVSTRPMODE_SHIFT, XAE_RAF_TXVSTRPMODE_MASK, XAE_RAF_TXVSTRPMODE_SHIFT, XAE_RX, XAE_TX, and XAxiEthernet_ReadReg.

void XAxiEthernet_GetVTagMode ( XAxiEthernet *  InstancePtr,
u8 *  ModePtr,
int  Dir 
)

XAxiEthernet_GetVTagMode gets VLAN tagging mode.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]ModePtrreferences the location to store the VLAN tag mode. Value is between b'00-b'11.
[in]Dirmust be either XAE_TX or XAE_RX.

The device must be stopped to use this function.

Mode value shifting is handled in this function. No shifting is required to call this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_RAF_OFFSET, XAE_RAF_RXVTAGMODE_MASK, XAE_RAF_RXVTAGMODE_SHIFT, XAE_RAF_TXVTAGMODE_MASK, XAE_RAF_TXVTAGMODE_SHIFT, XAE_RX, XAE_TX, and XAxiEthernet_ReadReg.

void XAxiEthernet_GetVTagValue ( XAxiEthernet *  InstancePtr,
u32 *  VTagValuePtr,
int  Dir 
)

XAxiEthernet_GetVTagValue gets the configured VLAN tagging value.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[out]VTagValuePtrreferences the location to store the result. Format is TPID, one of the following 16 bit values, 0x8100, 0x88a8, 0x9100, 0x9200. Priority, 3 bits CFI, 1 bit VID, 12 bits
[in]Dirmust be either XAE_TX or XAE_RX.

Ethernet VLAN frames' VLAN type/length(2B) and tag control information(2B). Bit layout : bbbb bbbb bbbb bbbb bbb b bbbb bbbb bbbb \ / | | \ VID (12b) / \ / | CFI bit (1b) TPID (16b) priority bit (3b)

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_RTAG_OFFSET, XAE_RX, XAE_TTAG_OFFSET, XAE_TX, and XAxiEthernet_ReadReg.

int XAxiEthernet_Initialize ( XAxiEthernet *  InstancePtr,
XAxiEthernet_Config *  CfgPtr,
UINTPTR  EffectiveAddress 
)

XAxiEthernet_Initialize initializes an AXI Ethernet device along with the.

InstancePtr that references it.

The PHY is setup independently from the Ethernet core. Use the MII or whatever other interface may be present for setup.

Parameters
[out]InstancePtrreferences the memory instance to be associated with the AXI Ethernet core instance upon initialization.
[in]CfgPtrreferences the structure holding the hardware configuration for the Axi Ethernet core to initialize.
[in]EffectiveAddressis the processor address used to access the base address of the AXI Ethernet instance. In systems with an MMU and virtual memory, EffectiveAddress is the virtual address mapped to the physical in ConfigPtr->Config.BaseAddress. In systems without an active MMU, EffectiveAddress should be set to the same value as ConfigPtr->Config.BaseAddress.
Returns
XST_SUCCESS.
Note
When user calls this function he should ensure the hardware is in a quiescent state by resetting all the hardware Configurations.

References XAxiEthernet_Config::AxiDevBaseAddress, XAxiEthernet::AxiDevBaseAddress, XAxiEthernet::AxiDevType, XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet_Config::IntrId, XAxiEthernet_Config::IntrParent, XAxiEthernet::IsReady, XAE_AXIBASEADDR_MASK, and XAE_AXIDEVTYPE_MASK.

XAxiEthernet_Config * XAxiEthernet_LookupConfig ( UINTPTR  BaseAddress)

Looks up device configuration by base address.

Implementation of XAxiEthernet_LookupConfig().

Parameters
[in]BaseAddressis the base address of the device to look up.
Returns
The configuration structure for the device. If the device base address is not found, a NULL pointer is returned.

See xaxiethernet.h for the API description.

References XAxiEthernet_Config::Name.

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPingReqExample(), AxiEthernetPolledExample(), AxiEthernetSgDmaIntrExample(), AxiEthernetSgDmaPollExample(), and main().

int XAxiEthernet_MulticastAdd ( XAxiEthernet *  InstancePtr,
void *  AddressPtr,
int  Entry 
)

XAxiEthernet_MulticastAdd adds the Ethernet address, AddressPtr to the.

Axi Ethernet device's multicast filter list, at list index Entry. The address referenced by AddressPtr may be of any unicast, multicast, or broadcast address form. The hardware for the Axi Ethernet device can hold up to C_Number_of_Table_Entries addresses in this filter list.

The device must be stopped to use this function.

Once an Ethernet address is programmed, the Axi Ethernet device will begin receiving data sent from that address. The Axi Ethernet hardware does not have a control bit to disable multicast filtering. The only way to prevent the Axi Ethernet device from receiving messages from an Ethernet address in the Multicast Address Table (MAT) is to clear it with XAxiEthernet_MulticastClear().

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a pointer to the 6-byte Ethernet address to set. The previous address at the location Entry (if any) is overwritten with the value at AddressPtr.
[in]Entryis the hardware storage location to program this address and must be between 0 to (C_Number_of_Table_Entries - 1).
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED.if the Axi Ethernet device is not stopped.

This routine works only with normal multicast filtering feature. A maximum of 4 multicast addresses can be stored in the HW provided multicast table.

To use the extended multicast feature, extended multicast filtering must be enabled by using driver API XAxiEthernet_SetOptions with proper option fields set. Once extended multicast filtering is enabled, the APIs XAxiEthernet_[Add|Clear|Get]ExtMulticastGroup() must be used to manage multicast address groups.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_AF0_OFFSET, XAE_AF1_OFFSET, XAE_FMI_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

int XAxiEthernet_MulticastClear ( XAxiEthernet *  InstancePtr,
int  Entry 
)

XAxiEthernet_MulticastClear clears the Ethernet address stored at index.

Entry in the Axi Ethernet device's multicast filter list.

The device must be stopped to use this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Entryis the HW storage location used when this address was added. It must be between 0 to (C_Number_of_Table_Entries - 1).
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED.if the Axi Ethernet device is not stopped.

This routine works only with normal multicast filtering feature. A maximum of 4 multicast addresses can be stored in the HW provided multicast table.

To use the extended multicast feature, extended multicast filtering must be enabled by using driver API XAxiEthernet_SetOptions with proper option fields set. Once extended multicast filtering is enabled, the APIs XAxiEthernet_[Add|Clear|Get]ExtMulticastGroup() must be used to manage multicast address groups.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_AF0_OFFSET, XAE_AF1_OFFSET, XAE_FMI_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

void XAxiEthernet_MulticastGet ( XAxiEthernet *  InstancePtr,
void *  AddressPtr,
int  Entry 
)

XAxiEthernet_MulticastGet gets the Ethernet address stored at.

index Entry in the Axi Ethernet device's multicast filter list.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtrreferences the memory buffer to store the retrieved Ethernet address. This memory buffer must be at least 6 bytes in length.
[in]Entryis the hardware storage location from which to retrieve the address and must be between 0 to (C_Number_of_Table_Entries - 1)

This routine works only with normal multicast filtering feature. A maximum of 4 multicast addresses can be stored in the HW provided multicast table.

To use the extended multicast feature, extended multicast filtering must be enabled by using driver API XAxiEthernet_SetOptions with proper option fields set. Once extended multicast filtering is enabled, the APIs XAxiEthernet_[Add|Clear|Get]ExtMulticastGroup() must be used to manage multicast address groups.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_AF0_OFFSET, XAE_AF1_OFFSET, XAE_FMI_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

void XAxiEthernet_PhyRead ( XAxiEthernet *  InstancePtr,
u32  PhyAddress,
u32  RegisterNum,
u16 *  PhyDataPtr 
)

XAxiEthernet_PhyRead reads the specified PHY register, RegiseterNum.

on the PHY specified by PhyAddress into PhyDataPtr. This Ethernet driver does not require the device to be stopped before reading from the PHY. It is the responsibility of the calling code to stop the device if it is deemed necessary.

Note that the Axi Ethernet hardware provides the ability to talk to a PHY that adheres to the Media Independent Interface (MII) as defined in the IEEE 802.3 standard.

It is important that calling code set up the MDIO clock with XAxiEthernet_PhySetMdioDivisor() prior to accessing the PHY with this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]PhyAddressis the address of the PHY to be written (multiple PHYs supported).
[in]RegisterNumis the register number, 0-31, of the specific PHY register to write.
[out]PhyDataPtris a reference to the location where the 16-bit result value is stored.

There is the possibility that this function will not return if the hardware is broken (i.e., it never sets the status bit indicating that the write is done). If this is of concern, the calling code should provide a mechanism suitable for recovery.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_MDIO_MCR_INITIATE_MASK, XAE_MDIO_MCR_OFFSET, XAE_MDIO_MCR_OP_READ_MASK, XAE_MDIO_MCR_PHYAD_MASK, XAE_MDIO_MCR_PHYAD_SHIFT, XAE_MDIO_MCR_READY_MASK, XAE_MDIO_MCR_REGAD_MASK, XAE_MDIO_MCR_REGAD_SHIFT, XAE_MDIO_MRD_OFFSET, XAE_PHY_ADDR_LIMIT, XAE_PHY_REG_NUM_LIMIT, XAE_RST_DEFAULT_TIMEOUT_VAL, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEtherentConfigureTIPhy(), AxiEthernetDetectPHY(), AxiEthernetUtilConfigureInternalPhy(), AxiEthernetUtilEnterLoopback(), and PhySetup().

void XAxiEthernet_PhySetMdioDivisor ( XAxiEthernet *  InstancePtr,
u8  Divisor 
)

XAxiEthernet_PhySetMdioDivisor sets the MDIO clock divisor in the.

Axi Ethernet,specified by InstancePtr to the value, Divisor. Must be called once after each reset prior to accessing MII PHY registers.

From the Virtex-6(TM) and Spartan-6 (TM) Embedded Tri-Mode Ethernet MAC User's Guide, the following equation governs the MDIO clock to the PHY:

                        f[HOSTCLK]
      f[MDC] = -----------------------
                (1 + Divisor) * 2

where f[HOSTCLK] is the bus clock frequency in MHz, and f[MDC] is the MDIO clock frequency in MHz to the PHY. Typically, f[MDC] should not exceed 2.5 MHz. Some PHYs can tolerate faster speeds which means faster access.

Parameters
[in]InstancePtrreferences the Axi Ethernet instance on which to operate.
[in]Divisoris the divisor value to set within the range of 0 to XAE_MDIO_MC_CLK_DVD_MAX.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_MDIO_MC_CLOCK_DIVIDE_MAX, XAE_MDIO_MC_MDIOEN_MASK, XAE_MDIO_MC_OFFSET, and XAxiEthernet_WriteReg.

void XAxiEthernet_PhyWrite ( XAxiEthernet *  InstancePtr,
u32  PhyAddress,
u32  RegisterNum,
u16  PhyData 
)

XAxiEthernet_PhyWrite writes PhyData to the specified PHY register, RegiseterNum on the PHY specified by PhyAddress.

This Ethernet driver does not require the device to be stopped before writing to the PHY. It is the responsibility of the calling code to stop the device if it is deemed necessary.

Note that the Axi Ethernet hardware provides the ability to talk to a PHY that adheres to the Media Independent Interface (MII) as defined in the IEEE 802.3 standard.

It is important that calling code set up the MDIO clock with XAxiEthernet_PhySetMdioDivisor() prior to accessing the PHY with this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]PhyAddressis the address of the PHY to be written (multiple PHYs supported).
[in]RegisterNumis the register number, 0-31, of the specific PHY register to write.
[in]PhyDatais the 16-bit value that will be written to the register.

There is the possibility that this function will not return if the hardware is broken (i.e., it never sets the status bit indicating that the write is done). If this is of concern, the calling code should provide a mechanism suitable for recovery.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_MDIO_MCR_INITIATE_MASK, XAE_MDIO_MCR_OFFSET, XAE_MDIO_MCR_OP_WRITE_MASK, XAE_MDIO_MCR_PHYAD_MASK, XAE_MDIO_MCR_PHYAD_SHIFT, XAE_MDIO_MCR_READY_MASK, XAE_MDIO_MCR_REGAD_MASK, XAE_MDIO_MCR_REGAD_SHIFT, XAE_MDIO_MWD_OFFSET, XAE_PHY_ADDR_LIMIT, XAE_PHY_REG_NUM_LIMIT, XAE_RST_DEFAULT_TIMEOUT_VAL, and XAxiEthernet_WriteReg.

Referenced by AxiEtherentConfigureTIPhy(), AxiEthernetUtilConfigureInternalPhy(), AxiEthernetUtilEnterLoopback(), and PhySetup().

void XAxiEthernet_Reset ( XAxiEthernet *  InstancePtr)

XAxiEthernet_Reset does not perform a soft reset of the AxiEthernet core.

AxiEthernet hardware is reset by the device connected to the AXI4-Stream interface. Inserts some delay before proceeding to check for MgtRdy bit. The delay is necessary to be at a safe side. It takes a while for the reset process to complete and for any of the AxiEthernet registers to be accessed. It then checks for MgtRdy bit in IS register to know if AxiEthernet reset is completed or not. Subsequently it calls one more driver function to complete the AxiEthernet hardware initialization.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
Note
It is the responsibility of the user to reset the AxiEthernet hardware before using it. AxiEthernet hardware should be reset through the device connected to the AXI4-Stream interface of AxiEthernet.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::Options, XAE_DEFAULT_OPTIONS, XAE_INT_MGTRDY_MASK, XAE_IS_OFFSET, XAE_RST_DEFAULT_TIMEOUT_VAL, and XAxiEthernet_Stop().

Referenced by AxiEthernetResetDevice(), and XAxiEthernet_CfgInitialize().

int XAxiEthernet_SendPausePacket ( XAxiEthernet *  InstancePtr,
u16  PauseValue 
)

XAxiEthernet_SendPausePacket sends a pause packet with the value of.

PauseValue.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]PauseValueis the pause value in units of 512 bit times.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_TPF_OFFSET, XAE_TPF_TPFV_MASK, and XAxiEthernet_WriteReg.

void XAxiEthernet_SetBadFrmRcvOption ( XAxiEthernet *  InstancePtr)

Enables the bad frame receive option.

When enabled, bad receive frames are allowed and passed to the AXI4-Stream interface as if they are good frames.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAE_RAF_OFFSET, XAE_RAF_RXBADFRMEN_MASK, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

int XAxiEthernet_SetMacAddress ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

Sets the MAC address for the AXI Ethernet device.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a reference to the 6-byte MAC address to set.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device has not stopped.
Note
This routine also supports the extended/new VLAN and multicast mode. The XAE_RAF_NEWFNCENBL_MASK bit dictates which offset is configured.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_UAW0_OFFSET, XAE_UAW1_OFFSET, XAE_UAW1_UNICASTADDR_MASK, XAE_UAWL_OFFSET, XAE_UAWU_OFFSET, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPingReqExample(), AxiEthernetPolledExample(), AxiEthernetResetDevice(), AxiEthernetSgDmaIntrExample(), AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), and AxiEthernetSgDmaSingleFrameExample().

int XAxiEthernet_SetMacPauseAddress ( XAxiEthernet *  InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_SetMacPauseAddress sets the MAC address used for pause frames.

to AddressPtr. AddressPtr will be the address the Axi Ethernet device will recognize as being for pause frames. Pause frames transmitted with XAxiEthernet_SendPausePacket() will also use this address.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]AddressPtris a pointer to the 6-byte Ethernet address to set.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_RCW0_OFFSET, XAE_RCW1_OFFSET, XAE_RCW1_PAUSEADDR_MASK, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

int XAxiEthernet_SetOperatingSpeed ( XAxiEthernet *  InstancePtr,
u16  Speed 
)

Sets the current operating link speed.

For any traffic to pass, this speed must match the current MII/GMII/SGMII/RGMII link speed.

Parameters
[in]InstancePtrreferences the Axi Ethernet on which to operate.
[in]Speedis the speed to set in units of Mbps. Valid values are 10, 100, or 1000.
Returns
- XST_SUCCESS on successful setting of speed.
  • XST_FAILURE, if the speed cannot be set for the present hardware configuration.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAE_EMMC_LINKSPD_100, XAE_EMMC_LINKSPD_1000, XAE_EMMC_LINKSPEED_MASK, XAE_EMMC_OFFSET, XAE_PHY_TYPE_1000BASE_X, XAE_PHY_TYPE_MII, XAE_SPEED_1000_MBPS, XAE_SPEED_100_MBPS, XAE_SPEED_10_MBPS, XAE_SPEED_2500_MBPS, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetExtVlanExample(), AxiEthernetFifoIntrExample(), AxiEthernetMcastExample(), AxiEthernetPolledExample(), AxiEthernetSgDmaIntrExample(), and AxiEthernetSgDmaPollExample().

int XAxiEthernet_SetOptions ( XAxiEthernet *  InstancePtr,
u32  Options 
)

XAxiEthernet_SetOptions enables the options, Options for the.

Axi Ethernet, specified by InstancePtr. Axi Ethernet should be stopped with XAxiEthernet_Stop() before changing options.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Optionsis a bitmask of OR'd XAE_*_OPTION values for options to set. Options not specified are not affected.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the device has not been stopped.
Note
See xaxiethernet.h for a description of the available options.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAxiEthernet::Options, XAE_BROADCAST_OPTION, XAE_DEFAULT_OPTIONS, XAE_DEFAULT_RXVSTRP_MODE, XAE_DEFAULT_RXVTAG_MODE, XAE_DEFAULT_TXVSTRP_MODE, XAE_DEFAULT_TXVTAG_MODE, XAE_FCC_FCRX_MASK, XAE_FCC_OFFSET, XAE_FCS_INSERT_OPTION, XAE_FCS_STRIP_OPTION, XAE_FLOW_CONTROL_OPTION, XAE_FMI_OFFSET, XAE_FMI_PM_MASK, XAE_JUMBO_OPTION, XAE_LENTYPE_ERR_OPTION, XAE_MULTICAST_OPTION, XAE_PROMISC_OPTION, XAE_RAF_BCSTREJ_MASK, XAE_RAF_EMULTIFLTRENBL_MASK, XAE_RAF_MCSTREJ_MASK, XAE_RAF_NEWFNCENBL_MASK, XAE_RAF_OFFSET, XAE_RAF_RXVSTRPMODE_MASK, XAE_RAF_RXVSTRPMODE_SHIFT, XAE_RAF_RXVTAGMODE_MASK, XAE_RAF_RXVTAGMODE_SHIFT, XAE_RAF_TXVSTRPMODE_MASK, XAE_RAF_TXVSTRPMODE_SHIFT, XAE_RAF_TXVTAGMODE_MASK, XAE_RAF_TXVTAGMODE_SHIFT, XAE_RCW1_FCS_MASK, XAE_RCW1_JUM_MASK, XAE_RCW1_LT_DIS_MASK, XAE_RCW1_OFFSET, XAE_RCW1_RX_MASK, XAE_RCW1_VLAN_MASK, XAE_RECEIVER_ENABLE_OPTION, XAE_TC_FCS_MASK, XAE_TC_JUM_MASK, XAE_TC_OFFSET, XAE_TC_TX_MASK, XAE_TC_VLAN_MASK, XAE_TRANSMITTER_ENABLE_OPTION, XAE_VLAN_OPTION, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetPingReqExample(), AxiEthernetResetDevice(), AxiEthernetSgDmaFullChecksumOffloadExample(), AxiEthernetSgDmaIntrCoalescingExample(), AxiEthernetSgDmaIntrExtMulticastExample(), AxiEthernetSgDmaIntrExtVlanExample(), AxiEthernetSgDmaIntrMultiFrameExample(), AxiEthernetSgDmaIntrSingleFrameExample(), AxiEthernetSgDmaMultiFrameExample(), AxiEthernetSgDmaPartialChecksumOffloadExample(), and AxiEthernetSgDmaSingleFrameExample().

int XAxiEthernet_SetTpid ( XAxiEthernet *  InstancePtr,
u16  Tpid,
u8  Entry 
)

XAxiEthernet_SetTpid sets the VLAN Tag Protocol Identifier(TPID).

Four values can be configured - 0x8100, 0x9100, 0x9200, 0x88A8.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Tpidis a hex value to be added to the TPID table. The four values that can be added are 0x8100, 0x9100, 0x9200, 0x88A8.
[in]Entryis the hardware storage location to program this address and must be between 0..XAE_TPID_MAX_ENTRIES.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED, if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable or have the VLAN tag capability.
  • XST_INVALID_PARAM if Tpid is not one of supported values.
Note
The device must be stopped to use this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_TPID0_OFFSET, XAE_TPID1_OFFSET, XAE_TPID_0_MASK, XAE_TPID_1_MASK, XAE_TPID_MAX_ENTRIES, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

int XAxiEthernet_SetVidTable ( XAxiEthernet *  InstancePtr,
u32  Entry,
u32  Vid,
u8  Strip,
u8  Tag,
int  Dir 
)

XAxiEthernet_SetVidTable sets VID table includes new VLAN ID, strip.

and tag enable bits.

The device must be stopped to use this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Entryis the hardware storage location/index to program updated VID value, strip, or tag value. The value must be between 0..0xFFF.
[in]Vidis updated/translated Vid value to be programmed.
[in]Stripis strip enable indication for Vid.
[in]Tagis tag enable indication for Vid.
[in]Dirmust be either XAE_TX or XAE_RX.
Returns
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable/have extended functionalities.

The hardware requires the table to be 'indexed' with Entry and must be 0x000..0xFFF.

Bits layout is bbbb bbbb bbbb b b VLAN ID (12b), | | | VLAN double tag enable bit VLAN strip enable bit

To disable translation indexed by Entry, Set Vid = Entry.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_MAX_VLAN_TABL_ENTRY, XAE_RX, XAE_RX_VLAN_DATA_OFFSET, XAE_TX, XAE_TX_VLAN_DATA_OFFSET, XAE_VLAN_TABL_STRP_FLD_LEN, XAE_VLAN_TABL_STRP_STRT_OFFSET, XAE_VLAN_TABL_TAG_FLD_LEN, XAE_VLAN_TABL_VID_START_OFFSET, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

int XAxiEthernet_SetVStripMode ( XAxiEthernet *  InstancePtr,
u32  Mode,
int  Dir 
)

XAxiEthernet_SetVStripMode configures the VLAN strip mode.

Three modes can be configured :

  • XAE_VSTRP_NONE for no stripping.
  • XAE_VSTRP_ALL to strip one tag from all frames.
  • XAE_VSTRP_SELECT to strip one tag from already selected tagged frames based on VID value.
Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Modeis the VLAN strip mode. Value must be b'00, b'01, or b'11.
[in]Dirmust be either XAE_TX or XAE_RX.
Returns
  • XST_SUCCESS on successful completion., returns XST_SUCCESS.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable or have the TX VLAN strip capability.
  • XST_INVALID_PARAM if Mode is not one of supported modes.

The device must be stopped to use this function.

The third mode (specified by XAE_VSTRP_SELECT) requires a method for specifying which tagged frames should be stripped. The VLAN translation table 'stripped enabled' is referenced. That configuration is handled in XAxiEthernet_SetVidTable().

Mode value shifting is handled in this function. No shifting is required to call this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_RAF_OFFSET, XAE_RAF_RXVSTRPMODE_MASK, XAE_RAF_RXVSTRPMODE_SHIFT, XAE_RAF_TXVSTRPMODE_MASK, XAE_RAF_TXVSTRPMODE_SHIFT, XAE_RX, XAE_TX, XAE_VSTRP_ALL, XAE_VSTRP_NONE, XAE_VSTRP_SELECT, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

int XAxiEthernet_SetVTagMode ( XAxiEthernet *  InstancePtr,
u32  Mode,
int  Dir 
)

XAxiEthernet_SetVTagMode configures the VLAN tagging mode.

Four modes can be configured,

  • XAE_VTAG_NONE for no tagging.
  • XAE_VTAG_ALL to tag all frames.
  • XAE_VTAG_EXISTED to tag already tagged frames.
  • XAE_VTAG_SELECT to tag selected already tagged frames based on VID value.
Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]Modeis the VLAN tag mode. Value must be between b'00-b'11.
[in]Dirmust be either XAE_TX or XAE_RX.
Returns
  • XST_SUCCESS. on successful completion.
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable or have the TX VLAN tag capability.
  • XST_INVALID_PARAM if Mode is not one of supported modes.

The device must be stopped to use this function.

The fourth mode (specified by XAE_VTAG_SELECT) requires a method for specifying which tagged frames should receive an additional VLAN tag. The VLAN translation table 'tag enabled' is referenced. That configuration is handled in XAxiEthernet_SetVidTable().

Mode value shifting is handled in this function. No shifting is required to call this function.

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_RAF_OFFSET, XAE_RAF_RXVTAGMODE_MASK, XAE_RAF_RXVTAGMODE_SHIFT, XAE_RAF_TXVTAGMODE_MASK, XAE_RAF_TXVTAGMODE_SHIFT, XAE_RX, XAE_TX, XAE_VTAG_ALL, XAE_VTAG_EXISTED, XAE_VTAG_NONE, XAE_VTAG_SELECT, XAxiEthernet_ReadReg, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().

int XAxiEthernet_SetVTagValue ( XAxiEthernet *  InstancePtr,
u32  VTagValue,
int  Dir 
)

XAxiEthernet_SetVTagValue configures the VLAN tagging value.

The device must be stopped to use this function.

Parameters
[in]InstancePtris a pointer to the Axi Ethernet instance to be worked on.
[in]VTagValueis the VLAN tag value to be configured. A 32bit value. TPID, one of the following 16 bit values, 0x8100, 0x88a8, 0x9100, 0x9200. Priority, 3 bits CFI, 1 bit VID, 12 bits
[in]Dirmust be either XAE_TX or XAE_RX.
Returns
  • XST_SUCCESS on successful completion, returns .
  • XST_DEVICE_IS_STARTED if the Axi Ethernet device is not stopped.
  • XST_NO_FEATURE if the Axi Ethernet does not enable/have TX VLAN tag capability.
  • XST_INVALID_PARAM, if the TPID is not one the four supported values.

The four supported TPID values are 0x8100, 0x88a8, 0x9100, 0x9200. XAxiEthernet_SetVTagValue performs verification on TPID only.

Ethernet VLAN frames' VLAN type/length(2B) and tag control information(2B). Bit layout : bbbb bbbb bbbb bbbb bbb b bbbb bbbb bbbb \ / | | \ VID (12b) / \ / | CFI bit (1b) TPID (16b) priority bit (3b)

References XAxiEthernet_Config::BaseAddress, XAxiEthernet::Config, XAxiEthernet::IsReady, XAxiEthernet::IsStarted, XAE_RTAG_OFFSET, XAE_RX, XAE_TTAG_OFFSET, XAE_TX, and XAxiEthernet_WriteReg.

Referenced by AxiEthernetSgDmaIntrExtVlanExample().