emacps: xemacps.h File Reference

| emacps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions
xemacps.h File Reference

## Data Structures
struct | XEmacPs_Config
| This typedef contains configuration information for a device. More...
struct | XEmacPs_Instance
| The XEmacPs driver instance data. More...

## Macros
#define | XEMACPS_MDIO_DIV_DFT MDC_DIV_32
| Default MDIO clock divisor. More...
#define | XEmacPs_GetTxRing(InstancePtr) ((InstancePtr)->TxBdRing)
| Retrieve the Tx ring object. More...
#define | XEmacPs_GetRxRing(InstancePtr) ((InstancePtr)->RxBdRing)
| Retrieve the Rx ring object. More...
#define | XEmacPs_IntEnable(InstancePtr, Mask)
| Enable interrupts specified in Mask. More...
#define | XEmacPs_IntDisable(InstancePtr, Mask)
| Disable interrupts specified in Mask. More...
#define | XEmacPs_IntQ1Enable(InstancePtr, Mask)
| Enable interrupts specified in Mask. More...
#define | XEmacPs_IntQ1Disable(InstancePtr, Mask)
| Disable interrupts specified in Mask. More...
#define | XEmacPs_Transmit(InstancePtr)
| This macro triggers trasmit circuit to send data currently in TX buffer(s). More...
#define | XEmacPs_IsRxCsum(InstancePtr)
| This macro determines if the device is configured with checksum offloading on the receive channel. More...
#define | XEmacPs_IsTxCsum(InstancePtr)
| This macro determines if the device is configured with checksum offloading on the transmit channel. More...
#define | XEmacPs_SetRXWatermark(InstancePtr, High, Low)
| This macro sets RX watermark register. More...
#define | XEmacPs_GetRXWatermark(InstancePtr)
| This macro gets RX watermark register. More...
Configuration options
Device configuration options. See the XEmacPs_SetOptions(), XEmacPs_ClearOptions() and XEmacPs_GetOptions() for information on how to use options. The default state of the options are noted and are what the device and driver will be set to after calling XEmacPs_Reset() or XEmacPs_Initialize().
#define | XEMACPS_PROMISC_OPTION 0x00000001U
| Accept all incoming packets. More...
#define | XEMACPS_FRAME1536_OPTION 0x00000002U
| Frame larger than 1516 support for Tx & Rx. More...
#define | XEMACPS_VLAN_OPTION 0x00000004U
| VLAN Rx & Tx frame support. More...
#define | XEMACPS_FLOW_CONTROL_OPTION 0x00000010U
| Enable recognition of flow control frames on Rx This option defaults to enabled (set) More...
#define | XEMACPS_FCS_STRIP_OPTION 0x00000020U
| Strip FCS and PAD from incoming frames. More...
#define | XEMACPS_FCS_INSERT_OPTION 0x00000040U
| Generate FCS field and add PAD automatically for outgoing frames. More...
#define | XEMACPS_LENTYPE_ERR_OPTION 0x00000080U
| Enable Length/Type error checking for incoming frames. More...
#define | XEMACPS_TRANSMITTER_ENABLE_OPTION 0x00000100U
| Enable the transmitter. More...
#define | XEMACPS_RECEIVER_ENABLE_OPTION 0x00000200U
| Enable the receiver This option defaults to enabled (set) More...
#define | XEMACPS_BROADCAST_OPTION 0x00000400U
| Allow reception of the broadcast address This option defaults to enabled (set) More...
#define | XEMACPS_MULTICAST_OPTION 0x00000800U
| Allows reception of multicast addresses programmed into hash This option defaults to disabled (clear) More...
#define | XEMACPS_RX_CHKSUM_ENABLE_OPTION 0x00001000U
| Enable the RX checksum offload This option defaults to enabled (set) More...
#define | XEMACPS_TX_CHKSUM_ENABLE_OPTION 0x00002000U
| Enable the TX checksum offload This option defaults to enabled (set) More...
#define | XEMACPS_JUMBO_ENABLE_OPTION 0x00004000U
#define | XEMACPS_SGMII_ENABLE_OPTION 0x00008000U
#define | XEMACPS_DEFAULT_OPTIONS
| Default options set when device is initialized or reset. More...
Callback identifiers
These constants are used as parameters to XEmacPs_SetHandler()
#define | XEMACPS_HANDLER_DMASEND 1U
#define | XEMACPS_HANDLER_DMARECV 2U
#define | XEMACPS_HANDLER_ERROR 3U

## Typedefs
typedef struct XEmacPs_Instance | XEmacPs
| The XEmacPs driver instance data. More...
Typedefs for callback functions
These callbacks are invoked in interrupt context.
typedef void(* | XEmacPs_Handler )(void *CallBackRef)
| Callback invoked when frame(s) have been sent or received in interrupt driven DMA mode. More...
typedef void(* | XEmacPs_ErrHandler )(void *CallBackRef, u8 Direction, u32 ErrorWord)
| Callback when an asynchronous error occurs. More...

## Functions
LONG | XEmacPs_CfgInitialize (XEmacPs *InstancePtr, XEmacPs_Config *CfgPtr, UINTPTR EffectiveAddress)
| Initialize a specific XEmacPs instance/driver. More...
void | XEmacPs_Start (XEmacPs *InstancePtr)
| Start the Ethernet controller as follows: More...
void | XEmacPs_Stop (XEmacPs *InstancePtr)
| Gracefully stop the Ethernet MAC as follows: More...
void | XEmacPs_Reset (XEmacPs *InstancePtr)
| Perform a graceful reset of the Ethernet MAC. More...
void | XEmacPs_SetQueuePtr (XEmacPs *InstancePtr, UINTPTR QPtr, u8 QueueNum, u16 Direction)
| This function sets the start address of the transmit/receive buffer queue. More...
XEmacPs_Config * | XEmacPs_LookupConfig (u16 DeviceId)
| Lookup the device configuration based on the unique device ID. More...
LONG | XEmacPs_SetHandler (XEmacPs *InstancePtr, u32 HandlerType, void *FuncPointer, void *CallBackRef)
| Install an asynchronous handler function for the given HandlerType: More...
void | XEmacPs_IntrHandler (void *XEmacPsPtr)
| Master interrupt handler for EMAC driver. More...
LONG | XEmacPs_SetOptions (XEmacPs *InstancePtr, u32 Options)
| Set options for the driver/device. More...
LONG | XEmacPs_ClearOptions (XEmacPs *InstancePtr, u32 Options)
| Clear options for the driver/device. More...
u32 | XEmacPs_GetOptions (XEmacPs *InstancePtr)
| Get current option settings. More...
LONG | XEmacPs_SetMacAddress (XEmacPs *InstancePtr, void *AddressPtr, u8 Index)
| Set the MAC address for this driver/device. More...
LONG | XEmacPs_DeleteHash (XEmacPs *InstancePtr, void *AddressPtr)
| Delete 48-bit MAC addresses in hash table. More...
void | XEmacPs_GetMacAddress (XEmacPs *InstancePtr, void *AddressPtr, u8 Index)
| Get the MAC address for this driver/device. More...
LONG | XEmacPs_SetHash (XEmacPs *InstancePtr, void *AddressPtr)
| Set 48-bit MAC addresses in hash table. More...
void | XEmacPs_ClearHash (XEmacPs *InstancePtr)
| Clear the Hash registers for the mac address pointed by AddressPtr. More...
void | XEmacPs_GetHash (XEmacPs *InstancePtr, void *AddressPtr)
| Get the Hash address for this driver/device. More...
void | XEmacPs_SetMdioDivisor (XEmacPs *InstancePtr, XEmacPs_MdcDiv Divisor)
| Set the MDIO clock divisor. More...
void | XEmacPs_SetOperatingSpeed (XEmacPs *InstancePtr, u16 Speed)
| XEmacPs_SetOperatingSpeed sets the current operating link speed. More...
u16 | XEmacPs_GetOperatingSpeed (XEmacPs *InstancePtr)
| XEmacPs_GetOperatingSpeed gets the current operating link speed. More...
LONG | XEmacPs_PhyRead (XEmacPs *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 *PhyDataPtr)
| Read the current value of the PHY register indicated by the PhyAddress and the RegisterNum parameters. More...
LONG | XEmacPs_PhyWrite (XEmacPs *InstancePtr, u32 PhyAddress, u32 RegisterNum, u16 PhyData)
| Write data to the specified PHY register. More...
LONG | XEmacPs_SetTypeIdCheck (XEmacPs *InstancePtr, u32 Id_Check, u8 Index)
| Set the Type ID match for this driver/device. More...
LONG | XEmacPs_SendPausePacket (XEmacPs *InstancePtr)
| Send a pause packet. More...
void | XEmacPs_DMABLengthUpdate (XEmacPs *InstancePtr, s32 BLength)
| API to update the Burst length in the DMACR register. More...