PDK API Guide for J721E
Enet lwIP application interface APIs

Introduction

Data Structures

struct  LwipifEnetAppIf_RxConfig
 
struct  LwipifEnetAppIf_TxConfig
 
struct  LwipifEnetAppIf_GetHandleInArgs
 Input arguments passed to the application via LwipifEnetAppCb_getHandle() when Enet's netif is initialized. More...
 
struct  Lwip2EnetAppIf_FreePktInfo
 Container structure of packet free callback info. More...
 
struct  LwipifEnetAppIf_RxHandleInfo
 RX-related parameters required by Enet's netif. They are populated by application. More...
 
struct  LwipifEnetAppIf_TxHandleInfo
 TX-related parameters required by Enet's netif. They are populated by application. More...
 
struct  LwipifEnetAppIf_GetHandleOutArgs
 Output arguments to be populated by application via LwipifEnetAppCb_getHandle() when Enet's netif is initialized. More...
 
struct  LwipifEnetAppIf_ReleaseHandleInfo
 Arguments passed to application by Enet's netif during deinitialization. More...
 

Functions

void LwipifEnetAppCb_getHandle (LwipifEnetAppIf_GetHandleInArgs *inArgs, LwipifEnetAppIf_GetHandleOutArgs *outArgs)
 Callback function used by Enet's netif to delegate TX/RX channel open to the application. More...
 
void LwipifEnetAppCb_releaseHandle (LwipifEnetAppIf_ReleaseHandleInfo *releaseInfo)
 Callback function used by Enet's netif to delegate TX/RX channel close to the application. More...
 

Typedefs

typedef void(* LwipifEnetAppIf_FreePktCbFxn) (void *cbArg, EnetDma_PktQ *fqPktInfoQ, EnetDma_PktQ *cqPktInfoQ)
 Callback function used to free packets. More...
 
typedef bool(* LwipifEnetAppIf_IsPhyLinkedCbFxn) (struct netif *netif, Enet_Handle hEnet)
 Callback function used to check PHY link status. More...
 
typedef bool(* LwipifEnetAppIf_HandleRxPktFxn) (struct netif *netif, struct pbuf *pbuf)
 Callback function used to pass packets to application for processing. More...
 

Macros

#define LWIP2ENET_RX_NUM   (2U)
 Number of RX channels. More...
 

Macro Definition Documentation

◆ LWIP2ENET_RX_NUM

#define LWIP2ENET_RX_NUM   (2U)

Number of RX channels.

Typedef Documentation

◆ LwipifEnetAppIf_FreePktCbFxn

typedef void(* LwipifEnetAppIf_FreePktCbFxn) (void *cbArg, EnetDma_PktQ *fqPktInfoQ, EnetDma_PktQ *cqPktInfoQ)

Callback function used to free packets.

Prototype of the callback function used by Enet's netif to free packets during deinitialization stage.

Parameters
cbArgCallback function argument.
fqPktInfoQPointer to free queue (FQ).
cqPktInfoQPointer to completion queue (CQ).

◆ LwipifEnetAppIf_IsPhyLinkedCbFxn

typedef bool(* LwipifEnetAppIf_IsPhyLinkedCbFxn) (struct netif *netif, Enet_Handle hEnet)

Callback function used to check PHY link status.

Prototype of the callback function used by Enet's netif to check the PHY link status.

Parameters
netifEnet's netif.
hEnetEnet driver handle.
Returns
true if PHY link is up, false otherwise.

◆ LwipifEnetAppIf_HandleRxPktFxn

typedef bool(* LwipifEnetAppIf_HandleRxPktFxn) (struct netif *netif, struct pbuf *pbuf)

Callback function used to pass packets to application for processing.

When application provides a valid callback function, netif will call this function for "processing":

  • Application consumes the packet and returns true. The packet is not passed to the lwIP stack.
  • Application reads the packet but doesn't consume it, and returns false. The packet is passed to lwIP stack as usual.

This mechanism requires LWIPIF_APP_RX_PKT_HANDLING build flag to be enabled.

Parameters
netifEnet's netif.
pbufEnet driver handle.
Return values
truePacket will not be passed to the stack.
falsePacket will be passed to the stack as usual.

Function Documentation

◆ LwipifEnetAppCb_getHandle()

void LwipifEnetAppCb_getHandle ( LwipifEnetAppIf_GetHandleInArgs inArgs,
LwipifEnetAppIf_GetHandleOutArgs outArgs 
)

Callback function used by Enet's netif to delegate TX/RX channel open to the application.

This callback function is called by Enet's netif during initialization stage to open TX and RX channels. This callback must be implemented by the application.

Parameters
inArgsPointer to parameters needed by application to open TX and RX channels.
outArgsParameters obtained during TX/RX channel opening which need to be returned to Enet's netif, i.e. channel handles.

◆ LwipifEnetAppCb_releaseHandle()

void LwipifEnetAppCb_releaseHandle ( LwipifEnetAppIf_ReleaseHandleInfo releaseInfo)

Callback function used by Enet's netif to delegate TX/RX channel close to the application.

This callback function is called by Enet's netif during deinitialization stage to close TX and RX channels. This callback must be implemented by the application.

Parameters
releaseInfoPointer to parameters/handles needed by application to close TX and RX channels.