Software Drivers

xaxiethernet.h File Reference

#include "xenv.h"
#include "xstatus.h"
#include "xil_assert.h"
#include "xaxiethernet_hw.h"

Classes

struct  XAxiEthernet_Config
struct  XAxiEthernet

Configuration options

The following are device configuration options. See the XAxiEthernet_SetOptions, XAxiEthernet_ClearOptions and XAxiEthernet_GetOptions routines for information on how to use options.

The default state of the options are also noted below.

#define XAE_PROMISC_OPTION   0x00000001
#define XAE_JUMBO_OPTION   0x00000002
#define XAE_VLAN_OPTION   0x00000004
#define XAE_FLOW_CONTROL_OPTION   0x00000008
#define XAE_FCS_STRIP_OPTION   0x00000010
#define XAE_FCS_INSERT_OPTION   0x00000020
#define XAE_LENTYPE_ERR_OPTION   0x00000040
#define XAE_TRANSMITTER_ENABLE_OPTION   0x00000080
#define XAE_RECEIVER_ENABLE_OPTION   0x00000100
#define XAE_BROADCAST_OPTION   0x00000200
#define XAE_MULTICAST_OPTION   0x00000400
#define XAE_EXT_MULTICAST_OPTION   0x00000800
#define XAE_EXT_TXVLAN_TRAN_OPTION   0x00001000
#define XAE_EXT_RXVLAN_TRAN_OPTION   0x00002000
#define XAE_EXT_TXVLAN_TAG_OPTION   0x00004000
#define XAE_EXT_RXVLAN_TAG_OPTION   0x00008000
#define XAE_EXT_TXVLAN_STRP_OPTION   0x00010000
#define XAE_EXT_RXVLAN_STRP_OPTION   0x00020000
#define XAE_DEFAULT_OPTIONS

Defines

#define XAXIETHERNET_H
#define XAE_MULTI_MAT_ENTRIES   4
#define XAE_MDIO_DIV_DFT   29
#define XAE_MAC_ADDR_SIZE   6
#define XAE_MTU   1500
#define XAE_JUMBO_MTU   8982
#define XAE_HDR_SIZE   14
#define XAE_HDR_VLAN_SIZE   18
#define XAE_TRL_SIZE   4
#define XAE_MAX_FRAME_SIZE   (XAE_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
#define XAE_MAX_VLAN_FRAME_SIZE   (XAE_MTU + XAE_HDR_VLAN_SIZE + XAE_TRL_SIZE)
#define XAE_MAX_JUMBO_FRAME_SIZE   (XAE_JUMBO_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
#define XAE_PHY_TYPE_MII   0
#define XAE_PHY_TYPE_GMII   1
#define XAE_PHY_TYPE_RGMII_1_3   2
#define XAE_PHY_TYPE_RGMII_2_0   3
#define XAE_PHY_TYPE_SGMII   4
#define XAE_PHY_TYPE_1000BASE_X   5
#define XAE_TPID_MAX_ENTRIES   4
#define XAE_VTAG_NONE   0
#define XAE_VTAG_ALL   1
#define XAE_VTAG_EXISTED   2
#define XAE_VTAG_SELECT   3
#define XAE_DEFAULT_TXVTAG_MODE   XAE_VTAG_ALL
#define XAE_DEFAULT_RXVTAG_MODE   XAE_VTAG_ALL
#define XAE_VSTRP_NONE   0
#define XAE_VSTRP_ALL   1
#define XAE_VSTRP_SELECT   3
#define XAE_DEFAULT_TXVSTRP_MODE   XAE_VSTRP_ALL
#define XAE_DEFAULT_RXVSTRP_MODE   XAE_VSTRP_ALL
#define XAE_RX   1
#define XAE_TX   2
#define XAE_SOFT_TEMAC_10_100_MBPS   0
#define XAE_SOFT_TEMAC_10_100_1000_MBPS   1
#define XAE_HARD_TEMC   2
#define XAxiEthernet_IsStarted(InstancePtr)   (((InstancePtr)->IsStarted == XIL_COMPONENT_IS_STARTED) ? TRUE : FALSE)
#define XAxiEthernet_IsDma(InstancePtr)   (((InstancePtr)->Config.AxiDevType == XPAR_AXI_DMA) ? TRUE: FALSE)
#define XAxiEthernet_IsFifo(InstancePtr)   (((InstancePtr)->Config.AxiDevType == XPAR_AXI_FIFO) ? TRUE: FALSE)
#define XAxiEthernet_AxiDevBaseAddress(InstancePtr)   ((InstancePtr)->Config.AxiDevBaseAddress)
#define XAxiEthernet_IsRecvFrameDropped(InstancePtr)
#define XAxiEthernet_IsRxPartialCsum(InstancePtr)   ((((InstancePtr)->Config.RxCsum) == 0x01) ? TRUE : FALSE)
#define XAxiEthernet_IsTxPartialCsum(InstancePtr)   ((((InstancePtr)->Config.TxCsum) == 0x01) ? TRUE : FALSE)
#define XAxiEthernet_IsRxFullCsum(InstancePtr)   ((((InstancePtr)->Config.RxCsum) == 0x02) ? TRUE : FALSE)
#define XAxiEthernet_IsTxFullCsum(InstancePtr)   ((((InstancePtr)->Config.TxCsum) == 0x02) ? TRUE : FALSE)
#define XAxiEthernet_GetPhysicalInterface(InstancePtr)   ((InstancePtr)->Config.PhyType)
#define XAxiEthernet_GetIntStatus(InstancePtr)   XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XAE_IS_OFFSET)
#define XAxiEthernet_IntEnable(InstancePtr, Mask)
#define XAxiEthernet_IntDisable(InstancePtr, Mask)
#define XAxiEthernet_IntPending(InstancePtr)   XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XAE_IP_OFFSET)
#define XAxiEthernet_IntClear(InstancePtr, Mask)
#define XAxiEthernet_IsExtFuncCap(InstancePtr)
#define XAxiEthernet_IsExtMcastEnable(InstancePtr)
#define XAxiEthernet_IsExtMcast(InstancePtr)   (((InstancePtr)->Config.ExtMcast) ? TRUE : FALSE)
#define XAxiEthernet_IsTxVlanStrp(InstancePtr)   (((InstancePtr)->Config.TxVlanStrp) ? TRUE : FALSE)
#define XAxiEthernet_IsRxVlanStrp(InstancePtr)   (((InstancePtr)->Config.RxVlanStrp) ? TRUE : FALSE)
#define XAxiEthernet_IsTxVlanTran(InstancePtr)   (((InstancePtr)->Config.TxVlanTran) ? TRUE : FALSE)
#define XAxiEthernet_IsRxVlanTran(InstancePtr)   (((InstancePtr)->Config.RxVlanTran) ? TRUE : FALSE)
#define XAxiEthernet_IsTxVlanTag(InstancePtr)   (((InstancePtr)->Config.TxVlanTag) ? TRUE : FALSE)
#define XAxiEthernet_IsRxVlanTag(InstancePtr)   (((InstancePtr)->Config.RxVlanTag) ? TRUE : FALSE)
#define XAxiEthernet_GetTemacType(InstancePtr)   ((InstancePtr)->Config.TemacType)
#define XAxiEthernet_IsAvbConfigured(InstancePtr)   (((InstancePtr)->Config.Avb) ? TRUE : FALSE)
#define XAxiEthernet_IsSgmiiOverLvdsEnabled(InstancePtr)   (((InstancePtr)->Config.EnableSgmiiOverLvds) ? TRUE : FALSE)
#define XAxiEthernet_IsStatsConfigured(InstancePtr)   (((InstancePtr)->Config.Stats) ? TRUE : FALSE)

Functions

int XAxiEthernet_CfgInitialize (XAxiEthernet *InstancePtr, XAxiEthernet_Config *CfgPtr, u32 VirtualAddress)
void XAxiEthernet_Start (XAxiEthernet *InstancePtr)
void XAxiEthernet_Stop (XAxiEthernet *InstancePtr)
void XAxiEthernet_Reset (XAxiEthernet *InstancePtr)
XAxiEthernet_ConfigXAxiEthernet_LookupConfig (u16 DeviceId)
int XAxiEthernet_SetOptions (XAxiEthernet *InstancePtr, u32 Options)
int XAxiEthernet_ClearOptions (XAxiEthernet *InstancePtr, u32 Options)
u32 XAxiEthernet_GetOptions (XAxiEthernet *InstancePtr)
int XAxiEthernet_SetMacAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
void XAxiEthernet_GetMacAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
int XAxiEthernet_SetMacPauseAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
void XAxiEthernet_GetMacPauseAddress (XAxiEthernet *InstancePtr, void *AddressPtr)
int XAxiEthernet_SendPausePacket (XAxiEthernet *InstancePtr, u16 PauseValue)
int XAxiEthernet_GetSgmiiStatus (XAxiEthernet *InstancePtr, u16 *SpeedPtr)
int XAxiEthernet_GetRgmiiStatus (XAxiEthernet *InstancePtr, u16 *SpeedPtr, int *IsFullDuplexPtr, int *IsLinkUpPtr)
u16 XAxiEthernet_GetOperatingSpeed (XAxiEthernet *InstancePtr)
int XAxiEthernet_SetOperatingSpeed (XAxiEthernet *InstancePtr, u16 Speed)
void XAxiEthernet_SetBadFrmRcvOption (XAxiEthernet *InstancePtr)
void XAxiEthernet_ClearBadFrmRcvOption (XAxiEthernet *InstancePtr)
void XAxiEthernet_DisableControlFrameLenCheck (XAxiEthernet *InstancePtr)
void XAxiEthernet_EnableControlFrameLenCheck (XAxiEthernet *InstancePtr)
void XAxiEthernet_PhySetMdioDivisor (XAxiEthernet *InstancePtr, u8 Divisor)
void XAxiEthernet_PhyRead (XAxiEthernet *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 *PhyDataPtr)
void XAxiEthernet_PhyWrite (XAxiEthernet *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 PhyData)
int XAxiEthernet_MulticastAdd (XAxiEthernet *InstancePtr, void *AddressPtr, int Entry)
void XAxiEthernet_MulticastGet (XAxiEthernet *InstancePtr, void *AddressPtr, int Entry)
int XAxiEthernet_MulticastClear (XAxiEthernet *InstancePtr, int Entry)
int XAxiEthernet_SetTpid (XAxiEthernet *InstancePtr, u16 Tpid, u8 Entry)
int XAxiEthernet_ClearTpid (XAxiEthernet *InstancePtr, u8 Entry)
void XAxiEthernet_GetTpid (XAxiEthernet *InstancePtr, u16 *TpidPtr, u8 Entry)
int XAxiEthernet_SetVTagMode (XAxiEthernet *InstancePtr, u32 Mode, int Dir)
void XAxiEthernet_GetVTagMode (XAxiEthernet *InstancePtr, u8 *ModePtr, int Dir)
int XAxiEthernet_SetVStripMode (XAxiEthernet *InstancePtr, u32 Mode, int Dir)
void XAxiEthernet_GetVStripMode (XAxiEthernet *InstancePtr, u8 *ModePtr, int Dir)
int XAxiEthernet_SetVTagValue (XAxiEthernet *InstancePtr, u32 VTagValue, int Dir)
void XAxiEthernet_GetVTagValue (XAxiEthernet *InstancePtr, u32 *VTagValuePtr, int Dir)
int XAxiEthernet_SetVidTable (XAxiEthernet *InstancePtr, u32 Entry, u32 Vid, u8 Strip, u8 Tag, int Dir)
void XAxiEthernet_GetVidTable (XAxiEthernet *InstancePtr, u32 Entry, u32 *VidPtr, u8 *StripPtr, u8 *TagPtr, int Dir)
int XAxiEthernet_AddExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
int XAxiEthernet_ClearExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
int XAxiEthernet_GetExtMulticastGroup (XAxiEthernet *InstancePtr, void *AddressPtr)
void XAxiEthernet_DumpExtMulticastGroup (XAxiEthernet *InstancePtr)


Define Documentation

#define XAE_BROADCAST_OPTION   0x00000200

XAE_MULTICAST_OPTION specifies the Axi Ethernet device to receive frames sent to Ethernet addresses that are programmed into the Multicast Address Table (MAT). This driver sets this option to disabled (cleared) by default.

#define XAE_DEFAULT_OPTIONS

Value:

XAE_DEFAULT_OPTIONS specify the options set in XAxiEthernet_Reset() and XAxiEthernet_CfgInitialize()

#define XAE_DEFAULT_RXVSTRP_MODE   XAE_VSTRP_ALL

#define XAE_DEFAULT_RXVTAG_MODE   XAE_VTAG_ALL

#define XAE_DEFAULT_TXVSTRP_MODE   XAE_VSTRP_ALL

#define XAE_DEFAULT_TXVTAG_MODE   XAE_VTAG_ALL

#define XAE_EXT_MULTICAST_OPTION   0x00000800

XAE_EXT_TXVLAN_TRAN_OPTION specifies the Axi Ethernet device to enable transmit VLAN translation. This driver sets this option to be dependent on HW configuration by default.

#define XAE_EXT_RXVLAN_STRP_OPTION   0x00020000

#define XAE_EXT_RXVLAN_TAG_OPTION   0x00008000

XAE_EXT_TXVLAN_STRP_OPTION specifies the Axi Ethernet device to enable transmit VLAN stripping. This driver sets this option to be dependent during HW build time by default.

#define XAE_EXT_RXVLAN_TRAN_OPTION   0x00002000

XAE_EXT_TXVLAN_TAG_OPTION specifies the Axi Ethernet device to enable transmit VLAN tagging. This driver sets this option to be dependent during HW build time by default.

#define XAE_EXT_TXVLAN_STRP_OPTION   0x00010000

XAE_EXT_RXVLAN_STRP_OPTION specifies the Axi Ethernet device to enable receive VLAN stripping. This driver sets this option to be dependent during HW build time by default.

#define XAE_EXT_TXVLAN_TAG_OPTION   0x00004000

XAE_EXT_RXVLAN_TAG_OPTION specifies the Axi Ethernet device to enable receive VLAN tagging. This driver sets this option to be dependent during HW build time by default.

#define XAE_EXT_TXVLAN_TRAN_OPTION   0x00001000

XAE_EXT_RXVLAN_TRAN_OPTION specifies the Axi Ethernet device to enable receive VLAN translation. This driver sets this option to be dependent on HW configuration by default.

#define XAE_FCS_INSERT_OPTION   0x00000020

XAE_LENTYPE_ERR_OPTION specifies the Axi Ethernet device to enable Length/Type error checking (mismatched type/length field) for received frames. This driver sets this option to enabled (set) by default.

#define XAE_FCS_STRIP_OPTION   0x00000010

XAE_FCS_INSERT_OPTION specifies the Axi Ethernet device to generate the FCS field and add PAD automatically for outgoing frames. This driver sets this option to enabled (set) by default.

#define XAE_FLOW_CONTROL_OPTION   0x00000008

XAE_FCS_STRIP_OPTION specifies the Axi Ethernet device to strip FCS and PAD from received frames. Note that PAD from VLAN frames is not stripped. This driver sets this option to enabled (set) by default.

#define XAE_HARD_TEMC   2

#define XAE_HDR_SIZE   14

#define XAE_HDR_VLAN_SIZE   18

#define XAE_JUMBO_MTU   8982

#define XAE_JUMBO_OPTION   0x00000002

XAE_VLAN_OPTION specifies the Axi Ethernet device to enable VLAN support for transmit and receive. This driver sets this option to disabled (cleared) by default.

#define XAE_LENTYPE_ERR_OPTION   0x00000040

XAE_TRANSMITTER_ENABLE_OPTION specifies the Axi Ethernet device transmitter to be enabled. This driver sets this option to enabled (set) by default.

#define XAE_MAC_ADDR_SIZE   6

#define XAE_MAX_FRAME_SIZE   (XAE_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)

#define XAE_MAX_JUMBO_FRAME_SIZE   (XAE_JUMBO_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)

#define XAE_MAX_VLAN_FRAME_SIZE   (XAE_MTU + XAE_HDR_VLAN_SIZE + XAE_TRL_SIZE)

#define XAE_MDIO_DIV_DFT   29

Default MDIO clock divisor

#define XAE_MTU   1500

#define XAE_MULTI_MAT_ENTRIES   4

Number of storable addresses in the Multicast Address Table

#define XAE_MULTICAST_OPTION   0x00000400

XAE_EXT_MULTICAST_OPTION specifies the Axi Ethernet device to receive frames sent to Ethernet addresses that are programmed into the Multicast Address Table. This driver sets this option to be dependent on HW configuration by default.

#define XAE_PHY_TYPE_1000BASE_X   5

#define XAE_PHY_TYPE_GMII   1

#define XAE_PHY_TYPE_MII   0

#define XAE_PHY_TYPE_RGMII_1_3   2

#define XAE_PHY_TYPE_RGMII_2_0   3

#define XAE_PHY_TYPE_SGMII   4

#define XAE_PROMISC_OPTION   0x00000001

< XAE_PROMISC_OPTION specifies the Axi Ethernet device to accept all incoming packets. This driver sets this option to disabled (cleared) by default. XAE_JUMBO_OPTION specifies the Axi Ethernet device to accept jumbo frames for transmit and receive. This driver sets this option to disabled (cleared) by default.

#define XAE_RECEIVER_ENABLE_OPTION   0x00000100

XAE_BROADCAST_OPTION specifies the Axi Ethernet device to receive frames sent to the broadcast Ethernet address. This driver sets this option to enabled (set) by default.

#define XAE_RX   1

#define XAE_SOFT_TEMAC_10_100_1000_MBPS   1

#define XAE_SOFT_TEMAC_10_100_MBPS   0

#define XAE_TPID_MAX_ENTRIES   4

#define XAE_TRANSMITTER_ENABLE_OPTION   0x00000080

XAE_RECEIVER_ENABLE_OPTION specifies the Axi Ethernet device receiver to be enabled. This driver sets this option to enabled (set) by default.

#define XAE_TRL_SIZE   4

#define XAE_TX   2

#define XAE_VLAN_OPTION   0x00000004

XAE_FLOW_CONTROL_OPTION specifies the Axi Ethernet device to recognize received flow control frames. This driver sets this option to enabled (set) by default.

#define XAE_VSTRP_ALL   1

#define XAE_VSTRP_NONE   0

#define XAE_VSTRP_SELECT   3

#define XAE_VTAG_ALL   1

#define XAE_VTAG_EXISTED   2

#define XAE_VTAG_NONE   0

#define XAE_VTAG_SELECT   3

#define XAxiEthernet_AxiDevBaseAddress ( InstancePtr   )     ((InstancePtr)->Config.AxiDevBaseAddress)

XAxiEthernet_AxiDevBaseAddress reports the base address of the core connected to the Axi Ethernet's Axi4 Stream interface.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
The base address of the core connected to the Axi Ethernet's streaming interface.
Note:
C-style signature: u32 XAxiEthernet_AxiDevBaseAddress(XAxiEthernet *InstancePtr)

#define XAxiEthernet_GetIntStatus ( InstancePtr   )     XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XAE_IS_OFFSET)

XAxiEthernet_GetIntStatus returns a bit mask of the interrupt status register (ISR). XAxiEthernet_GetIntStatus can be used to query the status without having to have interrupts enabled.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
Returns a bit mask of the interrupt status conditions. The mask will be a set of bit wise or'd values from the XAE_INT_*_MASK definitions in xaxitemac_hw.h file.
Note:
C-style signature: u32 XAxiEthernet_GetIntStatus(XAxiEthernet *InstancePtr)

#define XAxiEthernet_GetPhysicalInterface ( InstancePtr   )     ((InstancePtr)->Config.PhyType)

XAxiEthernet_GetPhysicalInterface returns the type of PHY interface being used by the given instance, specified by InstancePtr.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
The Physical Interface type which is one of XAE_PHY_TYPE_x where x is MII, GMII, RGMII_1_3, RGMII_2_0, SGMII, or 1000BASE_X (defined in xaxiethernet.h).
Note:
C-style signature: int XAxiEthernet_GetPhysicalInterface(XAxiEthernet *InstancePtr)

#define XAxiEthernet_GetTemacType ( InstancePtr   )     ((InstancePtr)->Config.TemacType)

XAxiEthernet_GetTemacType returns the Axi Ethernet type of the core.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • Returns the values of TemacType, which can be XAE_SOFT_TEMAC_10_100_MBPS (0) for Soft Temac Core with speed 10/100 Mbps. XAE_SOFT_TEMAC_10_100_1000_MBPS (1) for Soft Temac core with speed 10/100/1000 Mbps XAE_HARD_TEMC (2) for Hard Temac Core for Virtex-6
Note:
C-style signature: u32 XAxiEthernet_GetTemacType(XAxiEthernet *InstancePtr)

#define XAXIETHERNET_H

#define XAxiEthernet_IntClear ( InstancePtr,
Mask   ) 

Value:

XAxiEthernet_WriteReg((InstancePtr)->Config.BaseAddress, \
                        XAE_IS_OFFSET, ((Mask) & XAE_INT_ALL_MASK))
XAxiEthernet_IntClear clears pending interrupts specified in Mask. The corresponding pending interrupt for each bit set to 1 in Mask, will be cleared. In other words, XAxiEthernet_IntClear uses the "set a bit to clear it" scheme.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Mask contains a bit mask of the pending interrupts to clear. The mask can be formed using a set of bit wise or'd values from the XAE_INT_*_MASK definitions in xaxitemac_hw.h file.
Note:
C-style signature: void XAxiEthernet_IntClear(XAxiEthernet *InstancePtr, u32 Mask)

#define XAxiEthernet_IntDisable ( InstancePtr,
Mask   ) 

Value:

XAxiEthernet_WriteReg((InstancePtr)->Config.BaseAddress,         \
                XAE_IE_OFFSET,                                           \
                XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
                                XAE_IE_OFFSET) & ~((Mask) & XAE_INT_ALL_MASK));
XAxiEthernet_IntDisable disables the interrupts specified in Mask. The corresponding interrupt for each bit set to 1 in Mask, will be disabled. In other words, XAxiEthernet_IntDisable uses the "set a bit to clear it" scheme.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Mask contains a bit mask of the interrupts to disable. The mask can be formed using a set of bit wise or'd values from the XAE_INT_*_MASK definitions in xaxitemac_hw.h file
Returns:
None.
Note:
C-style signature: void XAxiEthernet_IntDisable(XAxiEthernet *InstancePtr, u32 Mask)

#define XAxiEthernet_IntEnable ( InstancePtr,
Mask   ) 

Value:

XAxiEthernet_WriteReg((InstancePtr)->Config.BaseAddress,        \
                XAE_IE_OFFSET,                                          \
                XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
                                XAE_IE_OFFSET) | ((Mask) & XAE_INT_ALL_MASK));
XAxiEthernet_IntEnable enables the interrupts specified in Mask. The corresponding interrupt for each bit set to 1 in Mask, will be enabled.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Mask contains a bit mask of the interrupts to enable. The mask can be formed using a set of bit wise or'd values from the XAE_INT_*_MASK definitions in xaxitemac_hw.h file.
Returns:
None.
Note:
C-style signature: void XAxiEthernet_IntEnable(XAxiEthernet *InstancePtr, u32 Mask)

#define XAxiEthernet_IntPending ( InstancePtr   )     XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XAE_IP_OFFSET)

XAxiEthernet_IntPending returns a bit mask of the pending interrupts. Each bit set to 1 in the return value represents a pending interrupt.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
Returns a bit mask of the interrupts that are pending. The mask will be a set of bit wise or'd values from the XAE_INT_*_MASK definitions in xaxitemac_hw.h file.
Note:
C-style signature: u32 XAxiEthernet_IntPending(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsAvbConfigured ( InstancePtr   )     (((InstancePtr)->Config.Avb) ? TRUE : FALSE)

XAxiEthernet_IsAvbConfigured returns determines if Ethernet AVB.is configured in the harwdare or not.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with Ethernet AVB.
  • FALSE if the device is NOT configured with Ethernet AVB.
Note:
C-style signature: u32 XAxiEthernet_IsAvbConfigured(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsDma ( InstancePtr   )     (((InstancePtr)->Config.AxiDevType == XPAR_AXI_DMA) ? TRUE: FALSE)

XAxiEthernet_IsDma reports if the device is currently connected to DMA.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the Axi Ethernet device is connected DMA.
  • FALSE.if the Axi Ethernet device is NOT connected to DMA
Note:
C-style signature: u32 XAxiEthernet_IsDma(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsExtFuncCap ( InstancePtr   ) 

Value:

((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAE_RAF_OFFSET) & XAE_RAF_NEWFNCENBL_MASK) ?  \
                                TRUE : FALSE)
XAxiEthernet_IsExtFuncCap determines if the device is capable of the new/extend VLAN and multicast features.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is capable and configured with extended Multicast and VLAN Tagging/Stripping and Translation.
  • TRUE if the device is NOT capable and NOT configured with extended Multicast and VLAN Tagging/Stripping and Translation.
Note:
C-style signature: u32 XAxiEthernet_IsExtFuncCap(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsExtMcast ( InstancePtr   )     (((InstancePtr)->Config.ExtMcast) ? TRUE : FALSE)

XAxiEthernet_IsExtMcast determines if the device is built with new/extended multicast features.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is built with extended multicast features.
  • FALSE if the device is not built with the extended multicast features.
Note:
This function indicates when hardware is built with extended Multicast feature.
C-style signature: u32 XAxiEthernet_IsExtMcast(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsExtMcastEnable ( InstancePtr   ) 

Value:

((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAE_RAF_OFFSET) & XAE_RAF_EMULTIFLTRENBL_MASK) ? \
                                TRUE : FALSE)
XAxiEthernet_IsExtMcastEnable determines if the extended multicast features is enabled.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the extended multicast features are enabled.
  • FALSE if the extended multicast features are NOT enabled
Note:
: This function indicates when extended Multicast is enabled in HW, extended multicast mode in wrapper can be tested.
C-style signature: u32 XAxiEthernet_IsExtMcastEnable(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsFifo ( InstancePtr   )     (((InstancePtr)->Config.AxiDevType == XPAR_AXI_FIFO) ? TRUE: FALSE)

XAxiEthernet_IsFifo reports if the device is currently connected to a fifo core.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the Axi Ethernet device is connected to a fifo
  • FALSE if the Axi Ethernet device is NOT connected to a fifo.
Note:
C-style signature: u32 XAxiEthernet_IsFifo(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRecvFrameDropped ( InstancePtr   ) 

Value:

((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress,  \
        XAE_IS_OFFSET) & XAE_INT_RXRJECT_MASK) ? TRUE : FALSE)
XAxiEthernet_IsRecvFrameDropped determines if the device thinks it has dropped a receive frame. The device interrupt status register is read to determine this.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if a frame has been dropped
  • FALSE if a frame has NOT been dropped.
Note:
C-style signature: u32 XAxiEthernet_IsRecvFrameDropped(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRxFullCsum ( InstancePtr   )     ((((InstancePtr)->Config.RxCsum) == 0x02) ? TRUE : FALSE)

XAxiEthernet_IsRxFullCsum determines if the device is configured with full checksum offloading on the receive channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with full checksum offloading on the receive channel.
  • FALSE.if the device is not configured with full checksum offloading on the receive side.
Note:
C-style signature: u32 XAxiEthernet_IsRxFullCsum(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRxPartialCsum ( InstancePtr   )     ((((InstancePtr)->Config.RxCsum) == 0x01) ? TRUE : FALSE)

XAxiEthernet_IsRxPartialCsum determines if the device is configured with partial checksum offloading on the receive channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with partial checksum offloading on the receive channel.
  • FALSE.if the device is not configured with partial checksum offloading on the receive side.
Note:
C-style signature: u32 XAxiEthernet_IsRxPartialCsum(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRxVlanStrp ( InstancePtr   )     (((InstancePtr)->Config.RxVlanStrp) ? TRUE : FALSE)

XAxiEthernet_IsRxVlanStrp determines if the device is configured with receive VLAN stripping on the receive channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN stripping on the Receive channel.
  • FALSE if the device is NOT configured with VLAN stripping on the Receive channel.
Note:
C-style signature: u32 XAxiEthernet_IsRxVlanTran(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRxVlanTag ( InstancePtr   )     (((InstancePtr)->Config.RxVlanTag) ? TRUE : FALSE)

XAxiEthernet_IsRxVlanTag determines if the device is configured with receive VLAN tagging on the receive channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN tagging on the Receive channel.
  • FALSE if the device is NOT configured with VLAN tagging on the Receive channel.
Note:
C-style signature: u32 XAxiEthernet_IsRxVlanTag(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsRxVlanTran ( InstancePtr   )     (((InstancePtr)->Config.RxVlanTran) ? TRUE : FALSE)

XAxiEthernet_IsRxVlanTran determines if the device is configured with receive VLAN translation on the receive channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN translation on the Receive channel.
  • FALSE if the device is NOT configured with VLAN translation on the Receive channel.
Note:
C-style signature: u32 XAxiEthernet_IsRxVlanTran(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsSgmiiOverLvdsEnabled ( InstancePtr   )     (((InstancePtr)->Config.EnableSgmiiOverLvds) ? TRUE : FALSE)

XAxiEthernet_IsSgmiiOverLvdsEnabled determines if SGMII over LVDS is enabled in the harwdare or not.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with SGMII over LVDS.
  • FALSE if the device is NOT configured with SGMII over LVDS.
Note:
C-style signature: u32 XAxiEthernet_IsSgmiiOverLvdsEnabled(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsStarted ( InstancePtr   )     (((InstancePtr)->IsStarted == XIL_COMPONENT_IS_STARTED) ? TRUE : FALSE)

XAxiEthernet_IsStarted reports if the device is in the started or stopped state. To be in the started state, the calling code must have made a successful call to XAxiEthernet_Start. To be in the stopped state, XAxiEthernet_Stop or XAxiEthernet_CfgInitialize function must have been called.

Parameters:
InstancePtr is a pointer to the of Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device has been started.
  • FALSE.if the device has not been started
Note:
C-style signature: u32 XAxiEthernet_IsStarted(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsStatsConfigured ( InstancePtr   )     (((InstancePtr)->Config.Stats) ? TRUE : FALSE)

XAxiEthernet_IsStatsConfigured returns determines if Statistics gathering. is configured in the harwdare or not.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with statistics gathering.
  • FALSE if the device is NOT configured with statistics gathering.
Note:
C-style signature: u32 XAxiEthernet_IsStatsConfigured(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsTxFullCsum ( InstancePtr   )     ((((InstancePtr)->Config.TxCsum) == 0x02) ? TRUE : FALSE)

XAxiEthernet_IsTxFullCsum determines if the device is configured with full checksum offloading on the transmit channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with full checksum offloading on the transmit side.
  • FALSE.if the device is not configured with full checksum offloading on the transmit side.
Note:
C-style signature: u32 XAxiEthernet_IsTxFullCsum(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsTxPartialCsum ( InstancePtr   )     ((((InstancePtr)->Config.TxCsum) == 0x01) ? TRUE : FALSE)

XAxiEthernet_IsTxPartialCsum determines if the device is configured with partial checksum offloading on the transmit channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with partial checksum offloading on the transmit side.
  • FALSE.if the device is not configured with partial checksum offloading on the transmit side.
Note:
C-style signature: u32 XAxiEthernet_IsTxPartialCsum(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsTxVlanStrp ( InstancePtr   )     (((InstancePtr)->Config.TxVlanStrp) ? TRUE : FALSE)

XAxiEthernet_IsTxVlanStrp determines if the device is configured with transmit VLAN stripping on the transmit channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN stripping on the Transmit channel.
  • FALSE if the device is NOT configured with VLAN stripping on the Transmit channel.
Note:
C-style signature: u32 XAxiEthernet_IsTxVlanStrp(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsTxVlanTag ( InstancePtr   )     (((InstancePtr)->Config.TxVlanTag) ? TRUE : FALSE)

XAxiEthernet_IsTxVlanTag determines if the device is configured with transmit VLAN tagging on the transmit channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN tagging on the Transmit channel.
  • FALSE if the device is NOT configured with VLAN tagging on the Transmit channel.
Note:
C-style signature: u32 XAxiEthernet_IsTxVlanTag(XAxiEthernet *InstancePtr)

#define XAxiEthernet_IsTxVlanTran ( InstancePtr   )     (((InstancePtr)->Config.TxVlanTran) ? TRUE : FALSE)

XAxiEthernet_IsTxVlanTran determines if the device is configured with transmit VLAN translation on the transmit channel.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
  • TRUE if the device is configured with VLAN translation on the Transmit channel.
  • FALSE if the device is NOT configured with VLAN translation on the Transmit channel.
Note:
C-style signature: u32 XAxiEthernet_IsTxVlanTran(XAxiEthernet *InstancePtr)


Function Documentation

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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.
Note:
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.

int XAxiEthernet_CfgInitialize ( XAxiEthernet InstancePtr,
XAxiEthernet_Config CfgPtr,
u32  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:
InstancePtr references the memory instance to be associated with the AXI Ethernet core instance upon initialization.
CfgPtr references the structure holding the hardware configuration for the Axi Ethernet core to initialize.
EffectiveAddress is 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:
None.

void XAxiEthernet_ClearBadFrmRcvOption ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_ClearBadFrmRcvOption is used to disable the bad frame receive option.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
None.

int XAxiEthernet_ClearExtMulticastGroup ( XAxiEthernet InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_ClearExtMulticastGroup clears input multicast Ethernet address group from table.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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.
Note:
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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Options is 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.
Note:
See xaxiethernet.h for a description of the available options.

int XAxiEthernet_ClearTpid ( XAxiEthernet InstancePtr,
u8  Entry 
)

XAxiEthernet_ClearTpid clears the VLAN Tag Protocol Identifier(TPID).

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Entry is 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.

void XAxiEthernet_DisableControlFrameLenCheck ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_DisableControlFrameLenCheck is used to disable the length check for control frames (pause frames). This means once the API is called, control frames larger than the minimum frame length are accepted.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
None.

void XAxiEthernet_DumpExtMulticastGroup ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_DumpExtMulticastGroup dumps ALL provisioned acceptable multicast MAC in the Axi Ethernet device's multicast table.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
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.

void XAxiEthernet_EnableControlFrameLenCheck ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_EnableControlFrameLenCheck is used to enable the length check for control frames (pause frames). After calling the API, all control frames received will be checked for proper length (less than minimum frame length). By default, upon normal start up, control frame length check is enabled. Hence this API needs to be called only if previously the control frame length check has been disabled by calling the API XAxiEthernet_DisableControlFrameLenCheck.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
None.

int XAxiEthernet_GetExtMulticastGroup ( XAxiEthernet InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_GetExtMulticastGroup returns whether the given Ethernet address group is stored in the table.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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.
Note:
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.

void XAxiEthernet_GetMacAddress ( XAxiEthernet InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_GetMacAddress gets the MAC address for the Axi Ethernet, specified by InstancePtr into the memory buffer specified by AddressPtr.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr references the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length.
Returns:
None.
Note:
This routine also supports the extended/new VLAN and multicast mode. The XAE_RAF_NEWFNCENBL_MASK bit dictates which offset will be configured.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr references the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length.
Returns:
None.
Note:
None.

u16 XAxiEthernet_GetOperatingSpeed ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_GetOperatingSpeed gets the current operating link speed. This may be the value set by XAxiEthernet_SetOperatingSpeed() or a hardware default.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
Returns the link speed in units of megabits per second (10 / 100 / 1000). Can return a value of 0, in case it does not get a valid speed from EMMC.
Note:
None.

u32 XAxiEthernet_GetOptions ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_GetOptions returns the current option settings.

Parameters:
InstancePtr is 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.
Note:
See xaxiethernet.h for a description of the available options.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
SpeedPtr references the location to store the result, which is the auto negotiated link speed in units of Mbits/sec, either 0, 10, 100, or 1000.
IsFullDuplexPtr references 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.
IsLinkUpPtr references 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,
Note:
None.

int XAxiEthernet_GetSgmiiStatus ( XAxiEthernet InstancePtr,
u16 *  SpeedPtr 
)

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

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
SpeedPtr references 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.

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

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

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
TpidPtr references the location to store the result.
Entry is the hardware storage location to program this address and must be between 0..XAE_TPID_MAX_ENTRIES.
Returns:
None.
Note:
None.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Entry is the hardware storage location/index to program updated VID value, strip, or tag value. The value must be between 0..0xFFF.
VidPtr references the location to store the result. This function stores the Vid value indexed by Entry into this location.
StripPtr references the location to store the result. This function stores the strip enable bit value indexed by Entry into this location.
TagPtr references the location to store the result. This function stores the tag enable bit value indexed by Entry into this location.
Dir must be either XAE_TX or XAE_RX.
Returns:
None.
Note:
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

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

XAxiEthernet_GetVStripMode gets the VLAN stripping mode.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
ModePtr references 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.
Dir must be either XAE_TX or XAE_RX.
Returns:
None.
Note:
Mode value shifting is handled in this function. No shifting is required to call this function.

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

XAxiEthernet_GetVTagMode gets VLAN tagging mode.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
ModePtr references the location to store the VLAN tag mode. Value is between b'00-b'11.
Dir must be either XAE_TX or XAE_RX.
Returns:
None.
Note:
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.

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

XAxiEthernet_GetVTagValue gets the configured VLAN tagging value.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
VTagValuePtr references 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
Dir must be either XAE_TX or XAE_RX.
Returns:
None.
Note:
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)

XAxiEthernet_Config* XAxiEthernet_LookupConfig ( u16  DeviceId  ) 

XAxiEthernet_LookupConfig returns a reference to an XAxiEthernet_Config structure based on an unique device id, DeviceId. The return value will refer to an entry in the device configuration table defined in the xaxiethernet_g.c file.

Parameters:
DeviceId is the unique device ID of the device for the lookup operation.
Returns:
  • Returns a reference to a config record in the configuration table (in xaxiethernet_g.c) corresponding to DeviceId, or NULL
  • NULL if no match is found.

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 XAE_MULTI_MAT_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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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.
Entry is the hardware storage location to program this address and must be between 0 to (XAE_MULTI_MAT_ENTRIES - 1).
Returns:
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED.if the Axi Ethernet device is not stopped.
Note:
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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Entry is the HW storage location used when this address was added. It must be between 0 to (XAE_MULTI_MAT_ENTRIES - 1).
Returns:
  • XST_SUCCESS on successful completion.
  • XST_DEVICE_IS_STARTED.if the Axi Ethernet device is not stopped.
Note:
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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr references the memory buffer to store the retrieved Ethernet address. This memory buffer must be at least 6 bytes in length.
Entry is the hardware storage location from which to retrieve the address and must be between 0 to (XAE_MULTI_MAT_ENTRIES - 1)
Returns:
None.
Note:
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.

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

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. This function 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:
InstancePtr references the Axi Ethernet instance on which to operate.
Divisor is the divisor value to set within the range of 0 to XAE_MDIO_MC_CLK_DVD_MAX.
Note:
None.

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

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. This function 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:
InstancePtr is 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.

int XAxiEthernet_SendPausePacket ( XAxiEthernet InstancePtr,
u16  PauseValue 
)

XAxiEthernet_SendPausePacket sends a pause packet with the value of PauseValue.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
PauseValue is 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.
Note:
None.

void XAxiEthernet_SetBadFrmRcvOption ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_SetBadFrmRcvOption is used to enable the bad frame receive option. If enabled, this option ensures that bad receive frames are allowed and passed to the AXI4-Stream interface as if they are good frames.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
None

int XAxiEthernet_SetMacAddress ( XAxiEthernet InstancePtr,
void *  AddressPtr 
)

XAxiEthernet_SetMacAddress sets the MAC address for the Axi Ethernet device, specified by InstancePtr to the MAC address specified by AddressPtr. The Axi Ethernet device must be stopped before calling this function.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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 will be configured.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
AddressPtr is 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.
Note:
None.

int XAxiEthernet_SetOperatingSpeed ( XAxiEthernet InstancePtr,
u16  Speed 
)

XAxiEthernet_SetOperatingSpeed sets the current operating link speed. For any traffic to be passed, this speed must match the current MII/GMII/SGMII/RGMII link speed.

Parameters:
InstancePtr references the Axi Ethernet on which to operate.
Speed is 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 harwdare configuration.
Note:
None.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Options is 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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Tpid is a hex value to be added to the TPID table. The four values that can be added are 0x8100, 0x9100, 0x9200, 0x88A8.
Entry is 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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Entry is the hardware storage location/index to program updated VID value, strip, or tag value. The value must be between 0..0xFFF.
Vid is updated/translated Vid value to be programmed.
Strip is strip enable indication for Vid.
Tag is tag enable indication for Vid.
Dir must 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.
Note:
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.

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

XAxiEthernet_SetVStripMode configures the VLAN strip mode.

Three modes can be configured :

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Mode is the VLAN strip mode. Value must be b'00, b'01, or b'11.
Dir must 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.
Note:
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.

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

XAxiEthernet_SetVTagMode configures the VLAN tagging mode.

Four modes can be configured,

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Mode is the VLAN tag mode. Value must be between b'00-b'11.
Dir must 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.
Note:
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.

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:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
VTagValue is 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
Dir must 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.
Note:
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)

void XAxiEthernet_Start ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_Start starts the Axi Ethernet device as follows:

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None.
Note:
None.

void XAxiEthernet_Stop ( XAxiEthernet InstancePtr  ) 

XAxiEthernet_Stop gracefully stops the Axi Ethernet device as follows:

XAxiEthernet_Stop does not modify any of the current device options.

Since the transmitter is not disabled, frames currently in internal buffers or in process by a DMA engine are allowed to be transmitted.

Parameters:
InstancePtr is a pointer to the Axi Ethernet instance to be worked on.
Returns:
None
Note:
None.

Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.