#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_Config * | XAxiEthernet_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 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_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)
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
XAE_INT_*_MASK
definitions in xaxitemac_hw.h file.#define XAxiEthernet_GetPhysicalInterface | ( | InstancePtr | ) | ((InstancePtr)->Config.PhyType) |
XAxiEthernet_GetPhysicalInterface returns the type of PHY interface being used by the given instance, specified by InstancePtr.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_GetTemacType | ( | InstancePtr | ) | ((InstancePtr)->Config.TemacType) |
XAxiEthernet_GetTemacType returns the Axi Ethernet type of the core.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAXIETHERNET_H |
#define XAxiEthernet_IntClear | ( | InstancePtr, | |||
Mask | ) |
Value:
XAxiEthernet_WriteReg((InstancePtr)->Config.BaseAddress, \ XAE_IS_OFFSET, ((Mask) & XAE_INT_ALL_MASK))
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. |
#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));
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 |
#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));
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. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
XAE_INT_*_MASK
definitions in xaxitemac_hw.h file.#define XAxiEthernet_IsAvbConfigured | ( | InstancePtr | ) | (((InstancePtr)->Config.Avb) ? TRUE : FALSE) |
XAxiEthernet_IsAvbConfigured returns determines if Ethernet AVB.is configured in the harwdare or not.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsDma | ( | InstancePtr | ) | (((InstancePtr)->Config.AxiDevType == XPAR_AXI_DMA) ? TRUE: FALSE) |
XAxiEthernet_IsDma reports if the device is currently connected to DMA.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsExtFuncCap | ( | InstancePtr | ) |
Value:
((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \ XAE_RAF_OFFSET) & XAE_RAF_NEWFNCENBL_MASK) ? \ TRUE : FALSE)
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsExtMcast | ( | InstancePtr | ) | (((InstancePtr)->Config.ExtMcast) ? TRUE : FALSE) |
XAxiEthernet_IsExtMcast determines if the device is built with new/extended multicast features.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsExtMcastEnable | ( | InstancePtr | ) |
Value:
((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \ XAE_RAF_OFFSET) & XAE_RAF_EMULTIFLTRENBL_MASK) ? \ TRUE : FALSE)
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsRecvFrameDropped | ( | InstancePtr | ) |
Value:
((XAxiEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \ XAE_IS_OFFSET) & XAE_INT_RXRJECT_MASK) ? TRUE : FALSE)
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsSgmiiOverLvdsEnabled | ( | InstancePtr | ) | (((InstancePtr)->Config.EnableSgmiiOverLvds) ? TRUE : FALSE) |
XAxiEthernet_IsSgmiiOverLvdsEnabled determines if SGMII over LVDS is enabled in the harwdare or not.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the of Axi Ethernet instance to be worked on. |
#define XAxiEthernet_IsStatsConfigured | ( | InstancePtr | ) | (((InstancePtr)->Config.Stats) ? TRUE : FALSE) |
XAxiEthernet_IsStatsConfigured returns determines if Statistics gathering. is configured in the harwdare or not.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
#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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
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().
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. |
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.
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 . |
void XAxiEthernet_ClearBadFrmRcvOption | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_ClearBadFrmRcvOption is used to disable the bad frame receive option.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
int XAxiEthernet_ClearExtMulticastGroup | ( | XAxiEthernet * | InstancePtr, | |
void * | AddressPtr | |||
) |
XAxiEthernet_ClearExtMulticastGroup clears input multicast Ethernet address group from table.
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. |
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.
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. |
int XAxiEthernet_ClearTpid | ( | XAxiEthernet * | InstancePtr, | |
u8 | Entry | |||
) |
XAxiEthernet_ClearTpid clears the VLAN Tag Protocol Identifier(TPID).
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. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_DumpExtMulticastGroup | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_DumpExtMulticastGroup dumps ALL provisioned acceptable multicast MAC in the Axi Ethernet device's multicast table.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
int XAxiEthernet_GetExtMulticastGroup | ( | XAxiEthernet * | InstancePtr, | |
void * | AddressPtr | |||
) |
XAxiEthernet_GetExtMulticastGroup returns whether the given Ethernet address group is stored in the table.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
AddressPtr | is a pointer to the 6-byte Ethernet address. |
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.
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. |
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.
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. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
u32 XAxiEthernet_GetOptions | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_GetOptions returns the current option settings.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
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.
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. |
int XAxiEthernet_GetSgmiiStatus | ( | XAxiEthernet * | InstancePtr, | |
u16 * | SpeedPtr | |||
) |
XAxiEthernet_GetSgmiiStatus get the state of the link when using the SGMII media interface.
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. |
void XAxiEthernet_GetTpid | ( | XAxiEthernet * | InstancePtr, | |
u16 * | TpidPtr, | |||
u8 | Entry | |||
) |
XAxiEthernet_GetTpid gets the VLAN Tag Protocol Identifier value (TPID).
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. |
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.
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. |
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.
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. |
void XAxiEthernet_GetVTagMode | ( | XAxiEthernet * | InstancePtr, | |
u8 * | ModePtr, | |||
int | Dir | |||
) |
XAxiEthernet_GetVTagMode gets VLAN tagging mode.
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. |
void XAxiEthernet_GetVTagValue | ( | XAxiEthernet * | InstancePtr, | |
u32 * | VTagValuePtr, | |||
int | Dir | |||
) |
XAxiEthernet_GetVTagValue gets the configured VLAN tagging value.
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. |
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.
DeviceId | is the unique device ID of the device for the lookup operation. |
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().
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). |
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.
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). |
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.
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) |
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.
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. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
int XAxiEthernet_SendPausePacket | ( | XAxiEthernet * | InstancePtr, | |
u16 | PauseValue | |||
) |
XAxiEthernet_SendPausePacket sends a pause packet with the value of PauseValue.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
PauseValue | is the pause value in units of 512 bit times. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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 :
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. |
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,
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. |
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.
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. |
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:
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
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.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.