AM243x MCU+ SDK  10.00.00
Enet packet utils API and data structures.

Introduction

Functions

static void EnetDma_checkPktState (uint32_t *pStateVar, EnetDma_PktStateModuleType module, uint32_t expectedState, uint32_t newState)
 Packet state check & set API for app, memory manager and dma driver. More...
 
static void EnetDma_checkDescState (uint32_t *pStateVar, EnetDma_DescStateMemMgr expectedState, EnetDma_DescStateMemMgr newState)
 Descriptor state check & set API for descriptor memory manager. More...
 

Enumerations

enum  EnetDma_DescStateMemMgr { ENET_DESCSTATE_MEMMGR_FREE = 0U, ENET_DESCSTATE_MEMMGR_ALLOC }
 Enet DMA Descriptor state. More...
 
enum  EnetDma_PktStateApp { ENET_PKTSTATE_APP_WITH_FREEQ = 0U, ENET_PKTSTATE_APP_WITH_READYQ, ENET_PKTSTATE_APP_WITH_DRIVER }
 App Pkt state. More...
 
enum  EnetDma_PktStateDma { ENET_PKTSTATE_DMA_WITH_HW = 0U, ENET_PKTSTATE_DMA_NOT_WITH_HW }
 DMA Pkt state. More...
 
enum  EnetDma_PktStateMemMgr { ENET_PKTSTATE_MEMMGR_FREE = 0U, ENET_PKTSTATE_MEMMGR_ALLOC }
 Enet DMA Pkt state. More...
 
enum  EnetDma_PktStateModuleType { ENET_PKTSTATE_MODULE_APP = 0U, ENET_PKTSTATE_MODULE_DRIVER, ENET_PKTSTATE_MODULE_MEMMGR }
 Enet DMA Pkt state. More...
 

Macros

#define ENET_UTILS_GET_STATE(state, mask, bitshift)   ((*(state) & (mask)) >> (bitshift))
 
#define ENET_UTILS_SET_STATE(state, mask, bitshift, value)
 
#define ENET_UTILS_DRIVER_STATE_MASK   (0x000000FFU)
 
#define ENET_UTILS_DRIVER_STATE_BIT_SHIFT   (0U)
 
#define ENET_DMA_MEMMGR_STATE_MASK   (0x0000FF00U)
 
#define ENET_DMA_MEMMGR_STATE_BIT_SHIFT   (8U)
 
#define ENET_UTILS_APP_STATE_MASK   (0x00FF0000U)
 
#define ENET_UTILS_APP_STATE_BIT_SHIFT   (16U)
 
#define ENET_UTILS_GET_PKT_DRIVER_STATE(state)
 
#define ENET_UTILS_SET_PKT_DRIVER_STATE(state, value)
 
#define ENET_UTILS_GET_PKT_MEMMGR_STATE(state)
 
#define ENET_UTILS_SET_PKT_MEMMGR_STATE(state, value)
 
#define ENET_UTILS_GET_PKT_APP_STATE(state)
 
#define ENET_UTILS_SET_PKT_APP_STATE(state, value)
 
#define ENET_DMA_MEMMGR_DESCSTATE_MASK   (0x000000FFU)
 
#define ENET_DMA_MEMMGR_DESCSTATE_SHIFT   (0U)
 
#define ENET_UTILS_GET_DESC_MEMMGR_STATE(state)
 
#define ENET_UTILS_SET_DESC_MEMMGR_STATE(state, value)
 

Macro Definition Documentation

◆ ENET_UTILS_GET_STATE

#define ENET_UTILS_GET_STATE (   state,
  mask,
  bitshift 
)    ((*(state) & (mask)) >> (bitshift))

◆ ENET_UTILS_SET_STATE

#define ENET_UTILS_SET_STATE (   state,
  mask,
  bitshift,
  value 
)
Value:
({ \
*(state) &= ~(mask); \
*(state) |= ((value) << (bitshift)); \
})

◆ ENET_UTILS_DRIVER_STATE_MASK

#define ENET_UTILS_DRIVER_STATE_MASK   (0x000000FFU)

◆ ENET_UTILS_DRIVER_STATE_BIT_SHIFT

#define ENET_UTILS_DRIVER_STATE_BIT_SHIFT   (0U)

◆ ENET_DMA_MEMMGR_STATE_MASK

#define ENET_DMA_MEMMGR_STATE_MASK   (0x0000FF00U)

◆ ENET_DMA_MEMMGR_STATE_BIT_SHIFT

#define ENET_DMA_MEMMGR_STATE_BIT_SHIFT   (8U)

◆ ENET_UTILS_APP_STATE_MASK

#define ENET_UTILS_APP_STATE_MASK   (0x00FF0000U)

◆ ENET_UTILS_APP_STATE_BIT_SHIFT

#define ENET_UTILS_APP_STATE_BIT_SHIFT   (16U)

◆ ENET_UTILS_GET_PKT_DRIVER_STATE

#define ENET_UTILS_GET_PKT_DRIVER_STATE (   state)

◆ ENET_UTILS_SET_PKT_DRIVER_STATE

#define ENET_UTILS_SET_PKT_DRIVER_STATE (   state,
  value 
)

◆ ENET_UTILS_GET_PKT_MEMMGR_STATE

#define ENET_UTILS_GET_PKT_MEMMGR_STATE (   state)

◆ ENET_UTILS_SET_PKT_MEMMGR_STATE

#define ENET_UTILS_SET_PKT_MEMMGR_STATE (   state,
  value 
)

◆ ENET_UTILS_GET_PKT_APP_STATE

#define ENET_UTILS_GET_PKT_APP_STATE (   state)

◆ ENET_UTILS_SET_PKT_APP_STATE

#define ENET_UTILS_SET_PKT_APP_STATE (   state,
  value 
)

◆ ENET_DMA_MEMMGR_DESCSTATE_MASK

#define ENET_DMA_MEMMGR_DESCSTATE_MASK   (0x000000FFU)

◆ ENET_DMA_MEMMGR_DESCSTATE_SHIFT

#define ENET_DMA_MEMMGR_DESCSTATE_SHIFT   (0U)

◆ ENET_UTILS_GET_DESC_MEMMGR_STATE

#define ENET_UTILS_GET_DESC_MEMMGR_STATE (   state)

◆ ENET_UTILS_SET_DESC_MEMMGR_STATE

#define ENET_UTILS_SET_DESC_MEMMGR_STATE (   state,
  value 
)

Enumeration Type Documentation

◆ EnetDma_DescStateMemMgr

Enet DMA Descriptor state.

DMA descriptor state used by Enet DMA driver for sanity check.

Enumerator
ENET_DESCSTATE_MEMMGR_FREE 

Desc free

ENET_DESCSTATE_MEMMGR_ALLOC 

Desc Allocated

◆ EnetDma_PktStateApp

App Pkt state.

Packet state for application

Enumerator
ENET_PKTSTATE_APP_WITH_FREEQ 

Packet with APP Free queue

ENET_PKTSTATE_APP_WITH_READYQ 

Packet with APP Ready queue

ENET_PKTSTATE_APP_WITH_DRIVER 

Packet with Driver

◆ EnetDma_PktStateDma

DMA Pkt state.

Packet state for DMA

Enumerator
ENET_PKTSTATE_DMA_WITH_HW 

Packet with HW

ENET_PKTSTATE_DMA_NOT_WITH_HW 

Packet not with HW

◆ EnetDma_PktStateMemMgr

Enet DMA Pkt state.

Packet state for memory manager

Enumerator
ENET_PKTSTATE_MEMMGR_FREE 

Packet free

ENET_PKTSTATE_MEMMGR_ALLOC 

Packet Allocated

◆ EnetDma_PktStateModuleType

Enet DMA Pkt state.

Type of Enet DMA Pkt state.

Enumerator
ENET_PKTSTATE_MODULE_APP 

Module type is app

ENET_PKTSTATE_MODULE_DRIVER 

Module type is DMA Driver

ENET_PKTSTATE_MODULE_MEMMGR 

Module type is MEM Mgr

Function Documentation

◆ EnetDma_checkPktState()

static void EnetDma_checkPktState ( uint32_t *  pStateVar,
EnetDma_PktStateModuleType  module,
uint32_t  expectedState,
uint32_t  newState 
)
inlinestatic

Packet state check & set API for app, memory manager and dma driver.

This development time API checks expected state and sets new packet state. This is used by modules handling the packet to confirm the packet is returned and allocated in correct state. Memutils checks (free, allocated), dma driver checks (with Hw, with driver) and app checks which queue it belongs

Parameters
pStateVar[IN/OUT] Pointer to packet state variable of packet structure EnetDma_Pkt
module[IN] Module id. Refer to EnetDma_PktStateModuleType
expectedState[IN] State packet is expected to be.
newState[IN] New state packet is set to.
Note
- Optional for MemMgr and app. DMA driver mandatory uses when ENET_CFG_DEV_ERROR is defined.

◆ EnetDma_checkDescState()

static void EnetDma_checkDescState ( uint32_t *  pStateVar,
EnetDma_DescStateMemMgr  expectedState,
EnetDma_DescStateMemMgr  newState 
)
inlinestatic

Descriptor state check & set API for descriptor memory manager.

This development time API checks expected state and sets new descriptor state. This is used by modules handling the Desc to confirm the Desc is returned and allocated in correct state. Only memutils modules uses it now for checking if desc is free or allocated while allocating or freeing desc respectively.

Parameters
pStateVar[IN/OUT] Pointer to Desc state variable.
expectedState[IN] State Desc is expected to be.
newState[IN] New state Desc is set to.
Note
- memory manager may not allocate the descState as this is optional check for MemMgr.
ENET_UTILS_APP_STATE_MASK
#define ENET_UTILS_APP_STATE_MASK
Definition: enet_dma_pktutils.h:77
ENET_UTILS_GET_STATE
#define ENET_UTILS_GET_STATE(state, mask, bitshift)
Definition: enet_dma_pktutils.h:64
ENET_UTILS_DRIVER_STATE_MASK
#define ENET_UTILS_DRIVER_STATE_MASK
Definition: enet_dma_pktutils.h:71
state
uint8_t state
Definition: tisci_pm_clock.h:3
ENET_DMA_MEMMGR_DESCSTATE_MASK
#define ENET_DMA_MEMMGR_DESCSTATE_MASK
Definition: enet_dma_pktutils.h:113
ENET_UTILS_SET_STATE
#define ENET_UTILS_SET_STATE(state, mask, bitshift, value)
Definition: enet_dma_pktutils.h:65
ENET_UTILS_APP_STATE_BIT_SHIFT
#define ENET_UTILS_APP_STATE_BIT_SHIFT
Definition: enet_dma_pktutils.h:78
value
uint32_t value
Definition: tisci_otp_revision.h:2
ENET_DMA_MEMMGR_STATE_BIT_SHIFT
#define ENET_DMA_MEMMGR_STATE_BIT_SHIFT
Definition: enet_dma_pktutils.h:75
ENET_DMA_MEMMGR_DESCSTATE_SHIFT
#define ENET_DMA_MEMMGR_DESCSTATE_SHIFT
Definition: enet_dma_pktutils.h:114
ENET_DMA_MEMMGR_STATE_MASK
#define ENET_DMA_MEMMGR_STATE_MASK
Definition: enet_dma_pktutils.h:74
ENET_UTILS_DRIVER_STATE_BIT_SHIFT
#define ENET_UTILS_DRIVER_STATE_BIT_SHIFT
Definition: enet_dma_pktutils.h:72