AM263Px MCU+ SDK  10.01.00

Introduction

Sub Modules

 Enet CPDMA APIs
 
 Enet packet utils API and data structures.
 
 Packet statistics
 

Functions

EnetDma_Handle EnetDma_initDmaCfg (Enet_Type enetType, uint32_t instId, const EnetDma_initCfg *pDmaCfg)
 Initialize data path. More...
 
int32_t EnetDma_deinitDmaCfg (EnetDma_Handle hEnetUdma)
 De-initialize data path. More...
 
void EnetDma_initRxChParams (void *pRxChCfg)
 Initialize RX channel open parameters. More...
 
EnetDma_RxChHandle EnetDma_openRxCh (EnetDma_Handle hDma, const void *pRxChCfg)
 Enet DMA open RX channel. More...
 
int32_t EnetDma_closeRxCh (EnetDma_RxChHandle hRxCh, EnetDma_PktQ *fq, EnetDma_PktQ *cq)
 Enet DMA close RX channel. More...
 
int32_t EnetDma_enableRxEvent (EnetDma_RxChHandle hRxCh)
 Enable RX channel packet reception event. More...
 
int32_t EnetDma_registerRxEventCb (EnetDma_RxChHandle hRxCh, EnetDma_PktNotifyCb notifyCb, void *cbArg)
 Register packet arrival event callback. More...
 
int32_t EnetDma_disableRxEvent (EnetDma_RxChHandle hRxCh)
 Disable RX channel packet reception event. More...
 
void EnetDma_initTxChParams (void *pTxChCfg)
 Initialize TX channel open parameters. More...
 
EnetDma_TxChHandle EnetDma_openTxCh (EnetDma_Handle hDma, const void *pTxChCfg)
 Enet DMA open TX channel. More...
 
int32_t EnetDma_closeTxCh (EnetDma_TxChHandle hTxCh, EnetDma_PktQ *fq, EnetDma_PktQ *cq)
 Enet DMA close TX channel. More...
 
int32_t EnetDma_enableTxEvent (EnetDma_TxChHandle hTxCh)
 Enable TX channel packet transmit completion event. More...
 
int32_t EnetDma_registerTxEventCb (EnetDma_TxChHandle hTxCh, EnetDma_PktNotifyCb notifyCb, void *cbArg)
 Register packet transmit completion event callback. More...
 
int32_t EnetDma_disableTxEvent (EnetDma_TxChHandle hTxCh)
 Disable TX channel packet transmit completion event. More...
 
int32_t EnetDma_retrieveRxPktQ (EnetDma_RxChHandle hRxCh, EnetDma_PktQ *pRetrieveQ)
 Retrieve queue of RX ready (full) packets from RX channel. More...
 
int32_t EnetDma_retrieveRxPkt (EnetDma_RxChHandle hRxCh, EnetDma_Pkt **pPkt)
 Retrieve single RX ready (full) packet (single) from RX channel. More...
 
int32_t EnetDma_submitRxPktQ (EnetDma_RxChHandle hRxCh, EnetDma_PktQ *pSubmitQ)
 Submit queue of RX free (empty) packets for reception to RX channel. More...
 
int32_t EnetDma_submitRxPkt (EnetDma_RxChHandle hRxCh, EnetDma_Pkt *pPkt)
 Submit single RX free (empty) packet for reception to RX channel. More...
 
int32_t EnetDma_retrieveTxPktQ (EnetDma_TxChHandle hTxCh, EnetDma_PktQ *pRetrieveQ)
 Retrieve queue of TX free (empty) packets from TX channel. More...
 
int32_t EnetDma_retrieveTxPkt (EnetDma_TxChHandle hTxCh, EnetDma_Pkt **pPkt)
 Retrieve single TX free (empty) packet from TX channel. More...
 
int32_t EnetDma_submitTxPktQ (EnetDma_TxChHandle hTxCh, EnetDma_PktQ *pSubmitQ)
 Submit a queue of ready (full) packets to TX channel. More...
 
int32_t EnetDma_submitTxPkt (EnetDma_TxChHandle hTxCh, EnetDma_Pkt *pPkt)
 Submit a single ready (full) packet to TX channel. More...
 
void EnetDma_initPktInfo (EnetDma_Pkt *pktInfo)
 Initialize packet information structure. More...
 
int32_t EnetDma_getRxChStats (EnetDma_RxChHandle hRxCh, EnetDma_RxChStats *pStats)
 Get RX channel statistics. More...
 
int32_t EnetDma_getTxChStats (EnetDma_TxChHandle hTxCh, EnetDma_TxChStats *pStats)
 Get TX channel statistics. More...
 
int32_t EnetDma_resetRxChStats (EnetDma_RxChHandle hRxCh)
 Reset RX channel statistics. More...
 
int32_t EnetDma_resetTxChStats (EnetDma_TxChHandle hTxCh)
 Reset TX channel statistics. More...
 

Typedefs

typedef EnetQ EnetDma_PktQ
 Packet queue. More...
 

Macros

#define ENETDMA_RXCSUMINFO_CHKSUM_ADD_SHIFT   (0U)
 THOST CSUM ENCAP Word- Checksum Add bit shift. More...
 
#define ENETDMA_RXCSUMINFO_CHKSUM_ADD_MASK   (((uint32_t) 0xFFFF) << ENETDMA_RXCSUMINFO_CHKSUM_ADD_SHIFT)
 THOST CSUM ENCAP Word - Checksum Add bit mask. More...
 
#define ENETDMA_RXCSUMINFO_CHKSUM_ERR_SHIFT   (16U)
 THOST CSUM ENCAP Word - Checksum Error bit shift. More...
 
#define ENETDMA_RXCSUMINFO_CHKSUM_ERR_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_CHKSUM_ERR_SHIFT)
 THOST CSUM ENCAP Word - Checksum Error bit mask. More...
 
#define ENETDMA_RXCSUMINFO_FRAGMENT_SHIFT   (17U)
 THOST CSUM ENCAP Word - IP Fragment bit shift. More...
 
#define ENETDMA_RXCSUMINFO_FRAGMENT_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_FRAGMENT_SHIFT)
 THOST CSUM ENCAP Word - IP Fragment bit mask. More...
 
#define ENETDMA_RXCSUMINFO_TCP_UDP_N_SHIFT   (18U)
 THOST CSUM ENCAP Word - TCP or UDP bit shift. More...
 
#define ENETDMA_RXCSUMINFO_TCP_UDP_N_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_TCP_UDP_N_SHIFT)
 THOST CSUM ENCAP Word - TCP or UDP bit mask. More...
 
#define ENETDMA_RXCSUMINFO_IPV6_VALID_SHIFT   (19U)
 THOST CSUM ENCAP Word - IPv6 Valid bit shift. More...
 
#define ENETDMA_RXCSUMINFO_IPV6_VALID_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_IPV6_VALID_SHIFT)
 THOST CSUM ENCAP Word - IPv6 Valid bit mask. More...
 
#define ENETDMA_RXCSUMINFO_IPV4_VALID_SHIFT   (20U)
 THOST CSUM ENCAP Word - IPv4 Valid bit shift. More...
 
#define ENETDMA_RXCSUMINFO_IPV4_VALID_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_IPV4_VALID_SHIFT)
 THOST CSUM ENCAP Word - IPv4 Valid bit mask. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_SHIFT   (0U)
 FHOST CSUM ENCAP Word - Checksum Byte Count bit shift. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_MASK   (((uint32_t) 0x3FFFU) << ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_SHIFT)
 FHOST CSUM ENCAP Word - Checksum Byte Count bit mask. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_INV_SHIFT   (15U)
 FHOST CSUM ENCAP Word - Inverted Checksum bit shift. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_INV_MASK   (((uint32_t) 0x1U) << ENETDMA_TXCSUMINFO_CHKSUM_INV_SHIFT)
 FHOST CSUM ENCAP Word - Inverted Checksum bit mask. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_SHIFT   (16U)
 FHOST CSUM ENCAP Word - Checksum Start Byte bit shift. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_MASK   (((uint32_t) 0xFFU) << ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_SHIFT)
 FHOST CSUM ENCAP Word - Checksum Start Byte bit mask. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_RESULT_SHIFT   (24U)
 FHOST CSUM ENCAP Word - Checksum Result bit shift. More...
 
#define ENETDMA_TXCSUMINFO_CHKSUM_RESULT_MASK   (((uint32_t) 0xFFU) << ENETDMA_TXCSUMINFO_CHKSUM_RESULT_SHIFT)
 FHOST CSUM ENCAP Word - Checksum Result bit mask. More...
 
#define ENETDMA_RXCSUMINFO_GET_IPV4_FLAG(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_IPV4_VALID)
 Get IPv4 flag from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_RXCSUMINFO_GET_IPV6_FLAG(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_IPV6_VALID)
 Get IPv6 flag from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_RXCSUMINFO_GET_TCPUDP_N_FLAG(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_TCP_UDP_N)
 Get TCP or UDP flag from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_RXCSUMINFO_GET_FRAGMENT_FLAG(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_FRAGMENT)
 Get IP Fragment flag from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_RXCSUMINFO_GET_CHKSUM_ERR_FLAG(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_CHKSUM_ERR)
 Get Checksum Error flag from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_RXCSUMINFO_GET_CHKSUM_RESULT(chkSumInfo)    ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_CHKSUM_ADD)
 Get Checksum Result from THOST Checksum Encapsulation word. More...
 
#define ENETDMA_TXCSUMINFO_SET_CHKSUM_RESBYTE(chkSumInfo, val)    ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_RESULT, val)
 Set Checksum Result Byte into FHOST Checksum Encapsulation word. More...
 
#define ENETDMA_TXCSUMINFO_SET_CHKSUM_STARTBYTE(chkSumInfo, val)    ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE, val)
 Set Checksum Start Byte into FHOST Checksum Encapsulation word. More...
 
#define ENETDMA_TXCSUMINFO_SET_CHKSUM_INV_FLAG(chkSumInfo, val)    ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_INV, val)
 Set Invert Checksum flag into FHOST Checksum Encapsulation word. More...
 
#define ENETDMA_TXCSUMINFO_SET_CHKSUM_BYTECNT(chkSumInfo, val)    ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT, val)
 Set Checksum Byte Count into FHOST Checksum Encapsulation word. More...
 
#define ENET_DMA_STATS_HISTORY_CNT   ((uint32_t)2U)
 Enet DMA statistics configuration. More...
 

Enet DMA driver callback function types.

Callback function typedefs so that the EnetDma layer can call into the app layer and let it translate between the DMA packet descriptors and packets and the stack/translation layer's buffers and packets.

typedef EnetDma_Pkt *(* EnetDma_AllocEthPktFxn) (uint32_t pktSize, uint32_t alignSize, void *appPriv)
 Function pointer type for Ethernet packet allocation function. More...
 
typedef void(* EnetDma_FreeEthPktFxn) (EnetDma_Pkt *pPktInfo)
 Function pointer type for Ethernet packet free function. More...
 

Enet DMA driver opaque handles

Opaque handle typedefs for Enet DMA driver objects.

typedef struct EnetCpdma_DrvObj_s * EnetDma_Handle
 Opaque handle for Enet CPDMA driver object. More...
 
typedef struct EnetCpdma_RxChObj_s * EnetDma_RxChHandle
 Opaque handle that holds software state for Enet RX DMA channel. More...
 
typedef struct EnetCpdma_TxChObj_s * EnetDma_TxChHandle
 Opaque handle that holds software state for Enet TX DMA channel. More...
 
typedef struct EnetCpdma_PktInfo_s EnetDma_Pkt
 Opaque handle that holds software state for Enet Packet Info. More...
 

Macro Definition Documentation

◆ ENETDMA_RXCSUMINFO_CHKSUM_ADD_SHIFT

#define ENETDMA_RXCSUMINFO_CHKSUM_ADD_SHIFT   (0U)

THOST CSUM ENCAP Word- Checksum Add bit shift.

◆ ENETDMA_RXCSUMINFO_CHKSUM_ADD_MASK

#define ENETDMA_RXCSUMINFO_CHKSUM_ADD_MASK   (((uint32_t) 0xFFFF) << ENETDMA_RXCSUMINFO_CHKSUM_ADD_SHIFT)

THOST CSUM ENCAP Word - Checksum Add bit mask.

◆ ENETDMA_RXCSUMINFO_CHKSUM_ERR_SHIFT

#define ENETDMA_RXCSUMINFO_CHKSUM_ERR_SHIFT   (16U)

THOST CSUM ENCAP Word - Checksum Error bit shift.

◆ ENETDMA_RXCSUMINFO_CHKSUM_ERR_MASK

#define ENETDMA_RXCSUMINFO_CHKSUM_ERR_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_CHKSUM_ERR_SHIFT)

THOST CSUM ENCAP Word - Checksum Error bit mask.

◆ ENETDMA_RXCSUMINFO_FRAGMENT_SHIFT

#define ENETDMA_RXCSUMINFO_FRAGMENT_SHIFT   (17U)

THOST CSUM ENCAP Word - IP Fragment bit shift.

◆ ENETDMA_RXCSUMINFO_FRAGMENT_MASK

#define ENETDMA_RXCSUMINFO_FRAGMENT_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_FRAGMENT_SHIFT)

THOST CSUM ENCAP Word - IP Fragment bit mask.

◆ ENETDMA_RXCSUMINFO_TCP_UDP_N_SHIFT

#define ENETDMA_RXCSUMINFO_TCP_UDP_N_SHIFT   (18U)

THOST CSUM ENCAP Word - TCP or UDP bit shift.

◆ ENETDMA_RXCSUMINFO_TCP_UDP_N_MASK

#define ENETDMA_RXCSUMINFO_TCP_UDP_N_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_TCP_UDP_N_SHIFT)

THOST CSUM ENCAP Word - TCP or UDP bit mask.

◆ ENETDMA_RXCSUMINFO_IPV6_VALID_SHIFT

#define ENETDMA_RXCSUMINFO_IPV6_VALID_SHIFT   (19U)

THOST CSUM ENCAP Word - IPv6 Valid bit shift.

◆ ENETDMA_RXCSUMINFO_IPV6_VALID_MASK

#define ENETDMA_RXCSUMINFO_IPV6_VALID_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_IPV6_VALID_SHIFT)

THOST CSUM ENCAP Word - IPv6 Valid bit mask.

◆ ENETDMA_RXCSUMINFO_IPV4_VALID_SHIFT

#define ENETDMA_RXCSUMINFO_IPV4_VALID_SHIFT   (20U)

THOST CSUM ENCAP Word - IPv4 Valid bit shift.

◆ ENETDMA_RXCSUMINFO_IPV4_VALID_MASK

#define ENETDMA_RXCSUMINFO_IPV4_VALID_MASK   (((uint32_t) 0x1U) << ENETDMA_RXCSUMINFO_IPV4_VALID_SHIFT)

THOST CSUM ENCAP Word - IPv4 Valid bit mask.

◆ ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_SHIFT

#define ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_SHIFT   (0U)

FHOST CSUM ENCAP Word - Checksum Byte Count bit shift.

◆ ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_MASK

#define ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_MASK   (((uint32_t) 0x3FFFU) << ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT_SHIFT)

FHOST CSUM ENCAP Word - Checksum Byte Count bit mask.

◆ ENETDMA_TXCSUMINFO_CHKSUM_INV_SHIFT

#define ENETDMA_TXCSUMINFO_CHKSUM_INV_SHIFT   (15U)

FHOST CSUM ENCAP Word - Inverted Checksum bit shift.

◆ ENETDMA_TXCSUMINFO_CHKSUM_INV_MASK

#define ENETDMA_TXCSUMINFO_CHKSUM_INV_MASK   (((uint32_t) 0x1U) << ENETDMA_TXCSUMINFO_CHKSUM_INV_SHIFT)

FHOST CSUM ENCAP Word - Inverted Checksum bit mask.

◆ ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_SHIFT

#define ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_SHIFT   (16U)

FHOST CSUM ENCAP Word - Checksum Start Byte bit shift.

◆ ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_MASK

#define ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_MASK   (((uint32_t) 0xFFU) << ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE_SHIFT)

FHOST CSUM ENCAP Word - Checksum Start Byte bit mask.

◆ ENETDMA_TXCSUMINFO_CHKSUM_RESULT_SHIFT

#define ENETDMA_TXCSUMINFO_CHKSUM_RESULT_SHIFT   (24U)

FHOST CSUM ENCAP Word - Checksum Result bit shift.

◆ ENETDMA_TXCSUMINFO_CHKSUM_RESULT_MASK

#define ENETDMA_TXCSUMINFO_CHKSUM_RESULT_MASK   (((uint32_t) 0xFFU) << ENETDMA_TXCSUMINFO_CHKSUM_RESULT_SHIFT)

FHOST CSUM ENCAP Word - Checksum Result bit mask.

◆ ENETDMA_RXCSUMINFO_GET_IPV4_FLAG

#define ENETDMA_RXCSUMINFO_GET_IPV4_FLAG (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_IPV4_VALID)

Get IPv4 flag from THOST Checksum Encapsulation word.

◆ ENETDMA_RXCSUMINFO_GET_IPV6_FLAG

#define ENETDMA_RXCSUMINFO_GET_IPV6_FLAG (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_IPV6_VALID)

Get IPv6 flag from THOST Checksum Encapsulation word.

◆ ENETDMA_RXCSUMINFO_GET_TCPUDP_N_FLAG

#define ENETDMA_RXCSUMINFO_GET_TCPUDP_N_FLAG (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_TCP_UDP_N)

Get TCP or UDP flag from THOST Checksum Encapsulation word.

◆ ENETDMA_RXCSUMINFO_GET_FRAGMENT_FLAG

#define ENETDMA_RXCSUMINFO_GET_FRAGMENT_FLAG (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_FRAGMENT)

Get IP Fragment flag from THOST Checksum Encapsulation word.

◆ ENETDMA_RXCSUMINFO_GET_CHKSUM_ERR_FLAG

#define ENETDMA_RXCSUMINFO_GET_CHKSUM_ERR_FLAG (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_CHKSUM_ERR)

Get Checksum Error flag from THOST Checksum Encapsulation word.

◆ ENETDMA_RXCSUMINFO_GET_CHKSUM_RESULT

#define ENETDMA_RXCSUMINFO_GET_CHKSUM_RESULT (   chkSumInfo)     ENET_FEXT(chkSumInfo, ENETDMA_RXCSUMINFO_CHKSUM_ADD)

Get Checksum Result from THOST Checksum Encapsulation word.

◆ ENETDMA_TXCSUMINFO_SET_CHKSUM_RESBYTE

#define ENETDMA_TXCSUMINFO_SET_CHKSUM_RESBYTE (   chkSumInfo,
  val 
)     ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_RESULT, val)

Set Checksum Result Byte into FHOST Checksum Encapsulation word.

◆ ENETDMA_TXCSUMINFO_SET_CHKSUM_STARTBYTE

#define ENETDMA_TXCSUMINFO_SET_CHKSUM_STARTBYTE (   chkSumInfo,
  val 
)     ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_STARTBYTE, val)

Set Checksum Start Byte into FHOST Checksum Encapsulation word.

◆ ENETDMA_TXCSUMINFO_SET_CHKSUM_INV_FLAG

#define ENETDMA_TXCSUMINFO_SET_CHKSUM_INV_FLAG (   chkSumInfo,
  val 
)     ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_INV, val)

Set Invert Checksum flag into FHOST Checksum Encapsulation word.

◆ ENETDMA_TXCSUMINFO_SET_CHKSUM_BYTECNT

#define ENETDMA_TXCSUMINFO_SET_CHKSUM_BYTECNT (   chkSumInfo,
  val 
)     ENET_FINS(chkSumInfo, ENETDMA_TXCSUMINFO_CHKSUM_BYTECNT, val)

Set Checksum Byte Count into FHOST Checksum Encapsulation word.

◆ ENET_DMA_STATS_HISTORY_CNT

#define ENET_DMA_STATS_HISTORY_CNT   ((uint32_t)2U)

Enet DMA statistics configuration.

Number of entries kept in the statistics for DMA module.

Typedef Documentation

◆ EnetDma_AllocEthPktFxn

typedef EnetDma_Pkt*(* EnetDma_AllocEthPktFxn) (uint32_t pktSize, uint32_t alignSize, void *appPriv)

Function pointer type for Ethernet packet allocation function.

◆ EnetDma_FreeEthPktFxn

typedef void(* EnetDma_FreeEthPktFxn) (EnetDma_Pkt *pPktInfo)

Function pointer type for Ethernet packet free function.

◆ EnetDma_PktQ

Packet queue.

A queue of packets, which are used for managing the packets given to the DMA driver by an application. It can also be used by the translation or application layer to manage free packets pools.

◆ EnetDma_Handle

typedef struct EnetCpdma_DrvObj_s* EnetDma_Handle

Opaque handle for Enet CPDMA driver object.

Opaque structure to hold software state for the Enet CPDMA module.

◆ EnetDma_RxChHandle

typedef struct EnetCpdma_RxChObj_s* EnetDma_RxChHandle

Opaque handle that holds software state for Enet RX DMA channel.

◆ EnetDma_TxChHandle

typedef struct EnetCpdma_TxChObj_s* EnetDma_TxChHandle

Opaque handle that holds software state for Enet TX DMA channel.

◆ EnetDma_Pkt

typedef struct EnetCpdma_PktInfo_s EnetDma_Pkt

Opaque handle that holds software state for Enet Packet Info.

Function Documentation

◆ EnetDma_initDmaCfg()

EnetDma_Handle EnetDma_initDmaCfg ( Enet_Type  enetType,
uint32_t  instId,
const EnetDma_initCfg pDmaCfg 
)

Initialize data path.

Initialize DMA data path state on remote core.

Parameters
enetType[IN] Enet Peripheral type
instId[IN] Enet Peripheral instance id
pDmaCfg[OUT] Data Path Init params
Returns
Enet DMA opaque handle

◆ EnetDma_deinitDmaCfg()

int32_t EnetDma_deinitDmaCfg ( EnetDma_Handle  hEnetUdma)

De-initialize data path.

De-initialize DMA data path state on remote core.

Parameters
hEnetUdma[IN] Cpsw DMA Handle
Returns
Enet_ErrorCodes

◆ EnetDma_initRxChParams()

void EnetDma_initRxChParams ( void *  pRxChCfg)

Initialize RX channel open parameters.

Initializes RX channel parameters with default values. Refer to SOC DMA specific RX channel config structure for specific config details.

Parameters
pRxChCfgRX channel configuration parameters.

◆ EnetDma_openRxCh()

EnetDma_RxChHandle EnetDma_openRxCh ( EnetDma_Handle  hDma,
const void *  pRxChCfg 
)

Enet DMA open RX channel.

Opens the Enet DMA RX channel based on the channel parameters. This function configures the DMA channel. This also configures event if notifyCb is not null. Refer to SOC DMA specific RX channel config structure for specific config details.

Enet DMA is peripheral-aware as peripherals in a given SoC may need different handling, i.e. DMA descriptor's extra fields having different meaning for two peripherals using same DMA engine. This peripheral-awareness is given to the RX channel/flow via EnetDma_Handle passed at open time.

Parameters
hDmaEnet DMA handle
pRxChCfgRX channel configuration parameters. This parameter can't be NULL.
Returns
RX channel opaque handle if opened. Otherwise, NULL.

◆ EnetDma_closeRxCh()

int32_t EnetDma_closeRxCh ( EnetDma_RxChHandle  hRxCh,
EnetDma_PktQ fq,
EnetDma_PktQ cq 
)

Enet DMA close RX channel.

Closes the Enet DMA RX channel and frees all associated resources. During close operation, we flush FQ taking all DMA descriptors with packet submitted in advance for reception and return to app. Also we retrieve all packets from the CQ (packets received between last EnetDma_retrieveRxPktQ() function call) and return those to app. App doesn't need to call function EnetDma_retrieveRxPktQ() explicitly to retrieve these packets.

Parameters
hRxCh[IN] Enet DMA channel handle. This parameter can't be NULL.
fq[OUT] Pointer to EnetDma_PktQ structure where packets from FQ (submitted for reception) are retrieved and returned to application. This parameter can't be NULL.
cq[OUT] Pointer to EnetDma_PktQ structure where packets from CQ (received packets) are retrieved and returned to application. This parameter can't be NULL.
Returns
Enet_ErrorCodes

◆ EnetDma_enableRxEvent()

int32_t EnetDma_enableRxEvent ( EnetDma_RxChHandle  hRxCh)

Enable RX channel packet reception event.

Enables the packet arrival event for RX channel. This allows application to control notify events runtime and retrieve packet only once to do burst packet processing.

Parameters
hRxCh[IN] Handle to Enet DMA RX channel
Returns
Enet_ErrorCodes

◆ EnetDma_registerRxEventCb()

int32_t EnetDma_registerRxEventCb ( EnetDma_RxChHandle  hRxCh,
EnetDma_PktNotifyCb  notifyCb,
void *  cbArg 
)

Register packet arrival event callback.

Enables the packet arrival event for RX channel. This allows application to control notify events runtime and retrieve packet only once to do burst packet processing.

Parameters
hRxCh[IN] Handle to Enet DMA RX channel
notifyCb[IN] Packet rx event notify function callback
cbArg[IN] Argument to be passed to notify function callback
Returns
Enet_ErrorCodes

◆ EnetDma_disableRxEvent()

int32_t EnetDma_disableRxEvent ( EnetDma_RxChHandle  hRxCh)

Disable RX channel packet reception event.

Disable the packet arrival event for RX channel.

Parameters
hRxCh[IN] Handle to Enet DMA RX channel
Returns
Enet_ErrorCodes

◆ EnetDma_initTxChParams()

void EnetDma_initTxChParams ( void *  pTxChCfg)

Initialize TX channel open parameters.

Initializes TX channel open parameters with default values. Refer to SOC DMA specific RX channel config structure for specific config details.

Parameters
pTxChCfgTX channel configuration parameters.

◆ EnetDma_openTxCh()

EnetDma_TxChHandle EnetDma_openTxCh ( EnetDma_Handle  hDma,
const void *  pTxChCfg 
)

Enet DMA open TX channel.

Opens the DMA TX DMA channel based on the channel parameters. This function open TX channel using chNum provided in EnetDma_OpenTxChPrms() and configures TX channel. This also configures event if notifyCb is not null. Refer to SOC DMA specific RX channel config structure for specific config details.

Enet DMA is peripheral-aware as peripherals in a given SoC may need different handling, i.e. DMA descriptor's extra fields having different meaning for two peripherals using same DMA engine. This peripheral-awareness is given to the TX channel via EnetDma_Handle passed at open time.

Parameters
hDmaEnet DMA handle
pTxChCfgTX channel configuration parameters. This parameter can't be NULL.
Returns
TX channel opaque handle if opened. Otherwise, NULL.

◆ EnetDma_closeTxCh()

int32_t EnetDma_closeTxCh ( EnetDma_TxChHandle  hTxCh,
EnetDma_PktQ fq,
EnetDma_PktQ cq 
)

Enet DMA close TX channel.

Closes the Enet DMA TX channel and frees all associated resources. During close operation, we flush FQ taking all DMA descriptors with packet submitted but not yet transmitted and return to app. Also we retrieve all packets from the CQ (transmission completed packets) and return those to app. App doesn't need to call EnetDma_retrieveTxPktQ() explicitly to retrieve these packets.

Parameters
hTxCh[IN] Enet DMA TX Channel handle. This parameter can't be NULL.
fq[OUT] Pointer to EnetDma_PktQ structure where packets from FQ (TX ready - submitted for transmission) are retrieved and returned to application. This parameter can't be NULL.
cq[OUT] Pointer to EnetDma_PktQ structure where packets from CQ (TX free - transmitted packets) are retrieved and returned to application. This parameter can't be NULL.
Returns
Enet_ErrorCodes

◆ EnetDma_enableTxEvent()

int32_t EnetDma_enableTxEvent ( EnetDma_TxChHandle  hTxCh)

Enable TX channel packet transmit completion event.

Enables the packet transmit event for TX channel. This allows application to control notify events runtime and retrieve empty packets only once to do burst packet processing.

Parameters
hTxCh[IN] Handle to Enet DMA TX channel
Returns
Enet_ErrorCodes

◆ EnetDma_registerTxEventCb()

int32_t EnetDma_registerTxEventCb ( EnetDma_TxChHandle  hTxCh,
EnetDma_PktNotifyCb  notifyCb,
void *  cbArg 
)

Register packet transmit completion event callback.

Parameters
hTxCh[IN] Handle to Enet DMA TX channel
notifyCb[IN] Packet tx event notify function callback
cbArg[IN] Argument to be passed to notify function callback
Returns
Enet_ErrorCodes

◆ EnetDma_disableTxEvent()

int32_t EnetDma_disableTxEvent ( EnetDma_TxChHandle  hTxCh)

Disable TX channel packet transmit completion event.

Disable the packet transmit event for TX channel.

Parameters
hTxCh[IN] Handle to Enet DMA TX channel
Returns
Enet_ErrorCodes

◆ EnetDma_retrieveRxPktQ()

int32_t EnetDma_retrieveRxPktQ ( EnetDma_RxChHandle  hRxCh,
EnetDma_PktQ pRetrieveQ 
)

Retrieve queue of RX ready (full) packets from RX channel.

Parameters
hRxCh[IN] Enet DMA RX channel handle for the RX channel we wish to retrieve packets from
pRetrieveQ[OUT] Pointer to EnetDma_PktQ structure where packets from hardware are retrieved and returned to application
Returns
Enet_ErrorCodes

◆ EnetDma_retrieveRxPkt()

int32_t EnetDma_retrieveRxPkt ( EnetDma_RxChHandle  hRxCh,
EnetDma_Pkt **  pPkt 
)

Retrieve single RX ready (full) packet (single) from RX channel.

Parameters
hRxCh[IN] Enet DMA RX channel handle for the RX channel we wish to retrieve packet from
pPkt[OUT] Pointer to EnetDma_Pkt structure where packet from hardware is retrieved and returned to application
Returns
Enet_ErrorCodes

◆ EnetDma_submitRxPktQ()

int32_t EnetDma_submitRxPktQ ( EnetDma_RxChHandle  hRxCh,
EnetDma_PktQ pSubmitQ 
)

Submit queue of RX free (empty) packets for reception to RX channel.

Parameters
hRxCh[IN] Enet DMA RX channel handle for the RX channel we wish to submit packets to
pSubmitQ[IN] Pointer to EnetDma_PktQ structure containing packets to be submitted to channel [OUT] Returned packets for which driver couldn't allocate the DMA descriptors.
Returns
Enet_ErrorCodes

◆ EnetDma_submitRxPkt()

int32_t EnetDma_submitRxPkt ( EnetDma_RxChHandle  hRxCh,
EnetDma_Pkt pPkt 
)

Submit single RX free (empty) packet for reception to RX channel.

Parameters
hRxCh[IN] Enet DMA RX channel handle for the RX channel we wish to submit packet to
pPkt[IN] Pointer to EnetDma_Pkt structure containing packet to be submitted to channel
Returns
Enet_ErrorCodes

◆ EnetDma_retrieveTxPktQ()

int32_t EnetDma_retrieveTxPktQ ( EnetDma_TxChHandle  hTxCh,
EnetDma_PktQ pRetrieveQ 
)

Retrieve queue of TX free (empty) packets from TX channel.

Parameters
hTxCh[IN] Enet DMA TX channel handle for the TX channel we wish to retrieve packet from
pRetrieveQ[OUT] Pointer to EnetDma_PktQ structure where packets from hardware are retrieved and returned to application
Returns
Enet_ErrorCodes

◆ EnetDma_retrieveTxPkt()

int32_t EnetDma_retrieveTxPkt ( EnetDma_TxChHandle  hTxCh,
EnetDma_Pkt **  pPkt 
)

Retrieve single TX free (empty) packet from TX channel.

Parameters
hTxCh[IN] Enet DMA TX channel handle for the TX channel we wish to retrieve packet from
pPkt[OUT] Pointer to EnetDma_Pkt structure where packet from hardware is retrieved and returned to application
Returns
Enet_ErrorCodes

◆ EnetDma_submitTxPktQ()

int32_t EnetDma_submitTxPktQ ( EnetDma_TxChHandle  hTxCh,
EnetDma_PktQ pSubmitQ 
)

Submit a queue of ready (full) packets to TX channel.

Parameters
hTxCh[IN] TX Channel handle for the TX channel we wish to submit packets to
pSubmitQ[IN] Pointer to EnetDma_Pkt structure containing packets to be submitted.
Returns
Enet_ErrorCodes

◆ EnetDma_submitTxPkt()

int32_t EnetDma_submitTxPkt ( EnetDma_TxChHandle  hTxCh,
EnetDma_Pkt pPkt 
)

Submit a single ready (full) packet to TX channel.

Parameters
hTxCh[IN] TX Channel handle for the TX channel we wish to submit packets to
pPkt[IN] Pointer to EnetDma_Pkt structure containing packet to be submitted.
Returns
Enet_ErrorCodes

◆ EnetDma_initPktInfo()

void EnetDma_initPktInfo ( EnetDma_Pkt pktInfo)

Initialize packet information structure.

Initialize packet information structure with null/zero values.

Parameters
pktInfo[IN] Pointer to EnetDma_Pkt structure

◆ EnetDma_getRxChStats()

int32_t EnetDma_getRxChStats ( EnetDma_RxChHandle  hRxCh,
EnetDma_RxChStats pStats 
)

Get RX channel statistics.

Parameters
hRxCh[IN] RX channel handle
pStats[INOUT] Pointer to RX channel stats object where stats would be returned
Return values
ENET_SOKRetrieved stats successfully
ENET_ENOTSUPPORTEDStats is not supported (enabled) or error retrieving

◆ EnetDma_getTxChStats()

int32_t EnetDma_getTxChStats ( EnetDma_TxChHandle  hTxCh,
EnetDma_TxChStats pStats 
)

Get TX channel statistics.

Parameters
hTxCh[IN] TX channel handle
pStats[INOUT] Pointer to TX Channel stats object where stats would be returned
Return values
ENET_SOKRetrieved stats successfully
ENET_ENOTSUPPORTEDStats is not supported (enabled) or error retrieving

◆ EnetDma_resetRxChStats()

int32_t EnetDma_resetRxChStats ( EnetDma_RxChHandle  hRxCh)

Reset RX channel statistics.

Parameters
hRxCh[IN] RX channel handle
Return values
ENET_SOKReseted stats successfully
ENET_ENOTSUPPORTEDStats is not supported (enabled) or error resetting

◆ EnetDma_resetTxChStats()

int32_t EnetDma_resetTxChStats ( EnetDma_TxChHandle  hTxCh)

Reset TX channel statistics.

Parameters
hTxCh[IN] TX Channel handle
Return values
ENET_SOKReseted stats successfully
ENET_ENOTSUPPORTEDStats is not supported (enabled) or error resetting