Functions
NWAL API's
NWAL Module API

Functions

nwal_RetValue nwal_getBufferReq (nwalSizeInfo_t *sizeCfg, int sizes[nwal_N_BUFS], int aligns[nwal_N_BUFS])
 API to retrieve memory buffer requirement by NWAL module.
nwal_RetValue nwal_create (const nwalGlobCfg_t *pCfg, nwalSizeInfo_t *pSizeInfo, int sizes[nwal_N_BUFS], void *bases[nwal_N_BUFS], nwal_Inst *pNwalInst)
 API instantiates the driver and allocated global resources and is pre-requisite.
nwal_RetValue nwal_delete (nwal_Inst nwalInst)
 API frees the NetCP resources allocated byNWAL.
nwal_RetValue nwal_getGlobCxtInfo (nwal_Inst nwalInst, nwalGlobCxtInfo_t *pInfo)
 API to retrieve global resources created by NWAL at the end of.
nwal_RetValue nwal_start (nwal_Inst nwalInst, const nwalLocCfg_t *pCfg)
 API would need to be called for all cores as a pre-requisite. API allows local per core related resource configuration to NWAL.
nwal_RetValue nwal_control (nwal_Inst nwalInst, nwalCtlInfo_t *pCtlInfo)
 Control API for additional global configuration at NetCP.
nwal_RetValue nwal_getLocCxtInfo (nwal_Inst nwalInst, nwalLocCxtInfo_t *pInfo)
 API to retrieve local per process resources created by NWAL at the end of.
nwal_RetValue nwal_getChanCxtInfo (nwal_Inst nwalInst, nwal_Handle nwalHandle, nwalChanCxtInfo_t *pInfo)
 API to retrieve internal context information from channel resources maintained by NWAL. Selective NetCP PA/SA channel handles are exposed to handle the case of multiple owner use case for PA/SA LLD.
nwal_Bool_t nwal_getMacIface (nwal_Inst nwalInst, nwalMacParam_t *pParam, nwal_Handle *pIfHandle)
 nwal_getMacIface API will check for already configuration for MAC entry
nwal_RetValue nwal_setMacIface (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_AppId appId, nwalMacParam_t *pParam, nwal_Handle *pIfHandle)
 nwal_setMacIface Configures MAC LUT entry at NetCP.
nwal_RetValue nwal_delMacIface (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_Handle ifHandle)
 nwal_delMacIface Delete MAC LUT entry at NetCP.
nwal_Bool_t nwal_getIPAddr (nwal_Inst nwalInst, nwalIpParam_t *pParam, nwal_Handle pPrevHandle, nwal_Handle *pIpHandle)
 nwal_getIPAddr API will check if there is already IP Address configured by application.If found returns the handle
nwal_RetValue nwal_setIPAddr (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_AppId appId, nwal_Handle ifHandle, nwalIpParam_t *pParam, nwal_Handle *pIpHandle)
 nwal_setIPAddr Add IP Address configuration to NETCP.
nwal_RetValue nwal_delIPAddr (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_Handle ipHandle)
 nwal_deleteIPAddr Delete IP Address configuration at NETCP.
nwal_Bool_t nwal_getSecAssoc (nwal_Inst nwalInst, nwalSaIpSecId_t *pSaId, nwal_SaDir dir, nwal_Handle *pNwalSecAssocHandle, uint32_t *pSwInfo0, uint32_t *pSwInfo1)
 Get an IPSec Security Association Channel.
nwal_RetValue nwal_setSecAssoc (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_AppId appId, nwalSaIpSecId_t *pSaId, nwalCreateSAParams_t *pCreateParam, nwal_Handle *pNwalSecAssocHandle)
 API to create outer IPSec Security Association Channel For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.
nwal_RetValue nwal_delSecAssoc (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_Handle nwalSecAssocHandle)
 API to delete an existing Policy Handle For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.
nwal_Bool_t nwal_getSecPolicy (nwal_Inst nwalInst, nwalSecPolParams_t *pPolParam, nwal_Handle *pNwalSecPolHandle)
 API to retrieve handle for existing security policy for a connection.
nwal_RetValue nwal_setSecPolicy (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_AppId appId, nwalSecPolParams_t *pPolParam, nwal_Handle *pNwalSecPolHandle)
 API to create policy for a connection.
nwal_RetValue nwal_delSecPolicy (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_Handle nwalSecPolHandle)
 API to delete an existing Policy Handle.
nwal_RetValue nwal_addConn (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_AppId appId, nwal_appProtoType_t proto, nwalRxConnCfg_t *pRxConnCfg, nwalTxConnCfg_t *pTxConnCfg, nwal_Handle *pNwalConHandle)
 API to create connection establishment.
nwal_RetValue nwal_delConn (nwal_Inst nwalInst, nwal_TransID_t transId, nwal_Handle nwalConHandle)
 API to delete an existing connection.
nwal_RetValue nwal_cfgConn (nwal_Inst nwalInst, nwal_Handle nwalConHandle, nwalTxConnCfg_t *pTxConnCfg)
 API for run time configuration connection establishment.
nwal_RetValue nwal_refreshConn (nwal_Inst nwalInst, nwal_Handle nwalHandle)
 nwal_refreshConn Refreshes a connection for the core.
nwal_RetValue nwal_getPAStats (nwal_Inst nwalInst, nwal_TransID_t transId, paSysStats_t *pPaStats, nwal_Bool_t doClear)
 nwal_getPAStats Get Statistics from PA
nwal_RetValue nwal_setDMSecAssoc (nwal_Inst nwalInst, nwal_AppId appId, nwalCreateDmSAParams_t *pCreateParam, nwal_Handle *pNwalDmSaHandle)
 nwal_setDMSecAssoc API for creating Data Mode Security Association
nwal_RetValue nwal_delDMSecAssoc (nwal_Inst nwalInst, nwal_Handle nwalDmSaHandle)
 API to delete an existing Data Mode Security Channel.
nwal_RetValue nwal_sendRaw (nwal_Inst nwalInst, nwal_Bool_t lpbackPass, uint16_t bufLen, uint8_t *pBuf)
 nwal_sendRaw Transmit raw packet to the PA
nwal_RetValue nwal_updateProtoHdr (nwal_Inst nwalInst, nwal_Handle nwalHandle, nwalTxPktInfo_t *pPktInfo)
 nwal_updateProtoHdr Update protocol header to the packet
nwal_RetValue nwal_send (nwal_Inst nwalInst, nwal_Handle nwalHandle, nwalTxPktInfo_t *pPktInfo)
 nwal_send Transmit packet out for a connection
nwal_RetValue nwal_sendDM (nwal_Inst nwalInst, nwal_Handle nwalDmSaHandle, nwalDmTxPayloadInfo_t *pDmPloadInfo)
 nwal_sendDM Transmit payload for side band Data Mode Channel
void nwal_pollCtl (nwal_Inst nwalInst, nwal_CmdCallBack *pCmdCallBack, nwal_CmdPaStatsReply *pPaStatsCallBack)
 nwal_pollCtl API for polling Control message response from NetCP: PA Subsystem.
uint16_t nwal_pollPkt (nwal_Inst nwalInst, nwal_pollPktQCtl pktQCtl, uint32_t appCookie, uint16_t maxPkts, NWAL_queueHnd appRxPktQueue, nwal_rxPktCallBack *pRxPktCallBack)
 nwal_pollPkt API for polling packets from network.
uint16_t nwal_pollDm (nwal_Inst nwalInst, nwal_pollDmQCtl dmQCtl, uint32_t appCookie, uint16_t maxPkts, NWAL_queueHnd appRxQueue, nwal_rxDmCallback *pRxDmCallBack)
 nwal_pollDm API for polling Data Mode payload from NetCP after Crypto completion
nwal_RetValue nwal_initPSCmdInfo (nwal_Inst nwalInst, nwalTxPktInfo_t *pPktInfo, nwalTxPSCmdInfo_t *pTxPSCmdInfo)
 nwal_initPsCmdInfo API for Initializing PS Command Info

Function Documentation

nwal_RetValue nwal_addConn ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_AppId  appId,
nwal_appProtoType_t  proto,
nwalRxConnCfg_t *  pRxConnCfg,
nwalTxConnCfg_t pTxConnCfg,
nwal_Handle pNwalConHandle 
)

API to create connection establishment.

This function results in configuration of L4 LUT entry for the RX side.For TX side the function will collect all details to enable header creation. Supports RX only or RX/TX channel

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound Sec Policy. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction. Set this to zero in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]appIdApplication ID to be registered. The handle will be used for all interfaces from NWAL to application: 1) Asynchronous confirmation of configuration response 2) Any packets received from NetCP related to this handle
[in]protoLayer 4 protocol type
[in]pRxConnCfgConfiguration for RX packets for the channel.
[in]pTxConnCfg[Optional] Configuration for TX packets for the channel. Will be applicable if NWAL module is used for creating TX header for the channel.If provided as NULL connection will be configured as RX only
[out]pNwalConHandleConnection handle being returned to application
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_setSecPolicy for IPSec or
nwal_setIPAddr for non IPSec
nwal_RetValue nwal_cfgConn ( nwal_Inst  nwalInst,
nwal_Handle  nwalConHandle,
nwalTxConnCfg_t pTxConnCfg 
)

API for run time configuration connection establishment.

This function results in configuration of header details for TX side

Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalConHandleConnection handle to be reconfigured
[in]pTxConnCfgConfiguration for TX packets for the channel. Will be applicable if NWAL module is used for creating TX header for the channel.
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_addConn
nwal_RetValue nwal_control ( nwal_Inst  nwalInst,
nwalCtlInfo_t *  pCtlInfo 
)

Control API for additional global configuration at NetCP.

This function results in configuration of system level rules to NetCP. API is blocking and will return only after successful configuration at NetCP.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pCtlInfoControl Parameters
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_create ( const nwalGlobCfg_t pCfg,
nwalSizeInfo_t pSizeInfo,
int  sizes[nwal_N_BUFS],
void *  bases[nwal_N_BUFS],
nwal_Inst pNwalInst 
)

API instantiates the driver and allocated global resources and is pre-requisite.

Allocates global resources valid per system level common across all DSP cores

All NetCP related initialization will be done inside the module. Module also supports a possible use case of NetCP initialization being done by application. In that case application would need to provide paHandle in the API. All QM and PktDMA initialization is required to be done outside module. Following are the resource initialization prerequisite to NWAL module initialization:

  • QMSS Initialization for the link RAM and descriptors
  • CPPI Initialization of descriptors
  • Buffer pool being made available through queues containing descriptors and linked buffers
    Parameters:
    [in]pCfgInput conguration
    [in]pSizeInfoConfiguration information for Memory sizing.
    [in]sizesMemory Size for the buffers allocated. Expected to be same as output returned by NWAL during nwal_getBufferReq() API
    [in]basesArray of the memory buffer base addresses
    [out]pNwalInstNWAL Global Instance handle.
    Return values:
    @seenwal_OK on success. Error codes
    See also:
    nwal_RetValue
    Precondition:
    See also:
    nwal_getBufferReq
nwal_RetValue nwal_delConn ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_Handle  nwalConHandle 
)

API to delete an existing connection.

This function results in deletion of existing connection

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound Sec Policy. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction. Set this to zero in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]nwalConHandleConnection handle being returned to application
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_addConn
nwal_RetValue nwal_delDMSecAssoc ( nwal_Inst  nwalInst,
nwal_Handle  nwalDmSaHandle 
)

API to delete an existing Data Mode Security Channel.

This function results in freeing up SA related resources for Data Mode channel

Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalDmSaHandleData Mode SA Handle
See also:
nwal_setDMSecAssoc
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_setDMSecAssoc

API frees the NetCP resources allocated byNWAL.

Frees global resources allocated at NetCP. To be called only one per system

Parameters:
[in]nwalInstNWAL Instance identifier
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_create
nwal_RetValue nwal_delIPAddr ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_Handle  ipHandle 
)

nwal_deleteIPAddr Delete IP Address configuration at NETCP.

API removes NetCP IP Addres classification rule for local IP Address

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdThe ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]ipHandleHandle returned to application from
See also:
nwal_setIPAddr.
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_setIPAddr
nwal_RetValue nwal_delMacIface ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_Handle  ifHandle 
)

nwal_delMacIface Delete MAC LUT entry at NetCP.

The API deletes NetCP configuration received through

See also:
nwal_setMacIface
Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdThe ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]ifHandleHandle returned to application from
See also:
nwal_setMacIface.
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_setMacIface
nwal_RetValue nwal_delSecAssoc ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_Handle  nwalSecAssocHandle 
)

API to delete an existing Policy Handle For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.

This function results in freeing up SA related resource for Security profile related resources

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound direction. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]nwalSecAssocHandleConnection handle returned from
See also:
nwal_setSecAssoc
Return values:
@seenwal_OK or
See also:
nwal_TRANS_COMPLETE on success. Error codes
nwal_RetValue
Precondition:
See also:
nwal_setSecAssoc
nwal_RetValue nwal_delSecPolicy ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_Handle  nwalSecPolHandle 
)

API to delete an existing Policy Handle.

This function results in initiation of freeing up resource for Security profile related resources. For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound Sec Policy. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction. Set this to zero in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]nwalSecPolHandleConnection handle returned from nwal_setSecPolicy.
Return values:
@seenwal_OK or
See also:
nwal_TRANS_COMPLETE on success. Error codes
nwal_RetValue
Precondition:
See also:
nwal_setSecPolicy
nwal_RetValue nwal_getBufferReq ( nwalSizeInfo_t sizeCfg,
int  sizes[nwal_N_BUFS],
int  aligns[nwal_N_BUFS] 
)

API to retrieve memory buffer requirement by NWAL module.

Input to the API is configuration for NWAL through

See also:
nwalSizeInfo_t. API returns buffer size and alignment size requirement for the module

nwalSizeInfo_t Configuration information for Memory sizing. sizes Buffer sizes aligns Alignment size

Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
None
nwal_RetValue nwal_getChanCxtInfo ( nwal_Inst  nwalInst,
nwal_Handle  nwalHandle,
nwalChanCxtInfo_t pInfo 
)

API to retrieve internal context information from channel resources maintained by NWAL. Selective NetCP PA/SA channel handles are exposed to handle the case of multiple owner use case for PA/SA LLD.

API to retrieve internal context information from channel resources maintained by NWAL. Selective NetCP PA/SA channel handles are exposed to handle the case of multiple owner use case for PA/SA LLD

Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalHandleNWAL handle returned from any config APIs
[out]pInfoNWAL Channel context information
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_create

API to retrieve global resources created by NWAL at the end of.

See also:
nwal_create() API

API to retrieve global resources created by NWAL through

See also:
nwal_create() API
Parameters:
[in]nwalInstNWAL Instance identifier
[out]pInfoNWAL global context information
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_create
nwal_Bool_t nwal_getIPAddr ( nwal_Inst  nwalInst,
nwalIpParam_t *  pParam,
nwal_Handle  pPrevHandle,
nwal_Handle pIpHandle 
)

nwal_getIPAddr API will check if there is already IP Address configured by application.If found returns the handle

The API lookups IP related configuration at NWAL.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pParamIP Configuration parameters
[in]pPrevHandleDependent MAC/IP handle
[in]pIpHandleOutput handle from NWAL if found.
See also:
nwal_Handle
Return values:
Value
See also:
nwal_TRUE if found
nwal_FALSE if not configured
Precondition:
See also:
nwal_setMacIface

API to retrieve local per process resources created by NWAL at the end of.

See also:
nwal_start() APInwal_initPSCmdInfo

API to retrieve local per process resources created by NWAL at the end of

See also:
nwal_start() API
Parameters:
[in]nwalInstNWAL Instance identifier
[out]pInfoNWAL Local context information
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_create
nwal_Bool_t nwal_getMacIface ( nwal_Inst  nwalInst,
nwalMacParam_t *  pParam,
nwal_Handle pIfHandle 
)

nwal_getMacIface API will check for already configuration for MAC entry

The API lookups L2/MAC related configuration at NWAL.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pParam
See also:
nwalMacParam_t
Parameters:
[in]pIfHandleOutput handle from NWAL if found.
See also:
nwal_Handle
Return values:
nwal_TRUEif found / nwal_FALSE if not configured
Precondition:
See also:
nwal_start
nwal_RetValue nwal_getPAStats ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
paSysStats_t *  pPaStats,
nwal_Bool_t  doClear 
)

nwal_getPAStats Get Statistics from PA

The API is to querry the stats from PA.If multiple request is initiated callback will be only called with latest transId

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound Sec Policy. The ID will be returned back by NWAL in nwal_CmdPaStatsReply() upon completion of the transaction.Set this to zero in case of blocking API call. It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]pPaStatsValid only if pStatsCallback is NULL and stats requested as blocking call
[in]doClearTrue to clear the stats. Alternatively False
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_Bool_t nwal_getSecAssoc ( nwal_Inst  nwalInst,
nwalSaIpSecId_t *  pSaId,
nwal_SaDir  dir,
nwal_Handle pNwalSecAssocHandle,
uint32_t *  pSwInfo0,
uint32_t *  pSwInfo1 
)

Get an IPSec Security Association Channel.

This function looks up for an existing outer IPSec Security Association Channel.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pSaIdSA ID uniquely identifying Tunnel
[in]dirDirection
See also:
NWAL_SA_DIR_INBOUND or
NWAL_SA_DIR_OUTBOUND
Parameters:
[out]pNwalSecAssocHandleReturns nwal_TRUE with NWAL Handle for SA channel if found, nwal_FALSE if not found return NULL as handle
[out]pSwInfo0SA Security Channel Context as identified by NetCP word 0
[out]pSwInfo1SA Security Channel Context as identified by NetCP word 1
Return values:
Value
See also:
nwal_TRUE if found
nwal_FALSE if not configured
Precondition:
See also:
nwal_setMacIface
nwal_Bool_t nwal_getSecPolicy ( nwal_Inst  nwalInst,
nwalSecPolParams_t *  pPolParam,
nwal_Handle pNwalSecPolHandle 
)

API to retrieve handle for existing security policy for a connection.

API to retrieve handle for existing security policy for a connection.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pPolParamConfiguration information for Security profile for IPSec Channel.
[out]pNwalSecPolHandleReturns nwal_TRUE with NWAL Handle for SA channel if found, nwal_FALSE if not found with NULL as handle
Return values:
Value
See also:
nwal_TRUE if found
nwal_FALSE if not configured
Precondition:
See also:
nwal_setSecAssoc
nwal_RetValue nwal_initPSCmdInfo ( nwal_Inst  nwalInst,
nwalTxPktInfo_t pPktInfo,
nwalTxPSCmdInfo_t *  pTxPSCmdInfo 
)

nwal_initPsCmdInfo API for Initializing PS Command Info

The API can be called by application to initialize NetCP protocol specific command for any hardware offload functionality. The API should be called for similar packet format with protocol headers at fixed offsets. For transmitting packets out the helper functions included in nwal_util.h can be used.

The API call is not required for the application using

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pPktInfoTransmit packet information
See also:
nwalTxPktInfo_t
Parameters:
[in]pTxPSCmdInfoProtocol Specific command info initialized with static values during init.Dynamic field update will be done during API call nwal_sendxxx
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
void nwal_pollCtl ( nwal_Inst  nwalInst,
nwal_CmdCallBack pCmdCallBack,
nwal_CmdPaStatsReply pPaStatsCallBack 
)

nwal_pollCtl API for polling Control message response from NetCP: PA Subsystem.

The API will poll for control message response from NetCP PA Subsystem

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pCmdCallBackOptional:Callback for configuration response processing at application. If passed as NULL,NWAL will use default callback passed during
See also:
nwal_start
Parameters:
[in]pPaStatsCallBackOptional:Callback for PA Stats response processing at application. If passed as NULL, NWAL will use default callback passed during
See also:
nwal_start
Precondition:
See also:
nwal_start
uint16_t nwal_pollDm ( nwal_Inst  nwalInst,
nwal_pollDmQCtl  dmQCtl,
uint32_t  appCookie,
uint16_t  maxPkts,
NWAL_queueHnd  appRxQueue,
nwal_rxDmCallback pRxDmCallBack 
)

nwal_pollDm API for polling Data Mode payload from NetCP after Crypto completion

The API will poll for payload/packet back from NetCP after Crypto completion. In case if application provides an application managed packet Queue, module will poll packet from that Queue.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]dmQCtlBitmap for polling packets from queue for poll
See also:
nwal_pollDmQCtl
Parameters:
[in]appCookieOptional Application context information if required for a poll callback. Set to NULL if not used
[in]maxPktsPoll and accumulate upto this count per Queue. Maximum value can be
See also:
NWAL_MAX_RX_PKT_THRESHOLD
Parameters:
[in]appRxQueueOptional. Application managed Queue Handle. Required only if API is called for
See also:
nwal_POLL_APP_MANAGED_PKT_Q. Set to NWAL_QUEUE_NOT_SPECIFIED if not used
Parameters:
[in]pRxDmCallBackOptional:Callback for packet processing at application. Set to NULL for NWAL to use default
Return values:
Numberof packets returned through callback callback configured during
See also:
nwal_start
Precondition:
See also:
nwal_start
uint16_t nwal_pollPkt ( nwal_Inst  nwalInst,
nwal_pollPktQCtl  pktQCtl,
uint32_t  appCookie,
uint16_t  maxPkts,
NWAL_queueHnd  appRxPktQueue,
nwal_rxPktCallBack pRxPktCallBack 
)

nwal_pollPkt API for polling packets from network.

The API will poll for packets from Network. In case if application provides an application managed packet Queue, module will poll packet from that Queue.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]pktQCtlBitmap for polling packets from queue for poll
See also:
nwal_pollPktQCtl
Parameters:
[in]appCookieOptional Application context information if required for a poll. Set to NULL if not used
[in]maxPktsPoll and accumulate upto this count per Queue. Maximum value can be
See also:
NWAL_MAX_RX_PKT_THRESHOLD
Parameters:
[in]appRxPktQueueOptional. Application managed Queue Handle. Required only if API is called for
See also:
nwal_POLL_APP_MANAGED_PKT_Q. Set to NWAL_QUEUE_NOT_SPECIFIED if not used
Parameters:
[in]pRxPktCallBackOptional:Callback for packet processing at application. Set to NULL for NWAL to use default
Return values:
Numberof packets returned through callback callback configured during
See also:
nwal_start
Precondition:
See also:
nwal_start
nwal_RetValue nwal_refreshConn ( nwal_Inst  nwalInst,
nwal_Handle  nwalHandle 
)

nwal_refreshConn Refreshes a connection for the core.

API to be used to refresh an NWAL handle created external to the core

Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalHandleHandle created external to the core. The handle could be the one returned from following APIs
See also:
nwal_setMacIface,
nwal_setIPAddr ,
nwal_setSecAssoc,
nwal_setSecPolicy
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_addConn
nwal_RetValue nwal_send ( nwal_Inst  nwalInst,
nwal_Handle  nwalHandle,
nwalTxPktInfo_t pPktInfo 
)

nwal_send Transmit packet out for a connection

The API will result in transmission of packets out after creation of necessary command labels. Application is required to handle any garbage collection for freeing the packet if return queue for the packet is not pointing to free queue.

In the case of Application requiring NWAL to update L2/L3/L4 protocol header before transmit, API

See also:
nwal_updateProtoHdr need to be invoked before calling
nwal_send.
Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalHandleCan be
  • nwalSecAssocHandle NWAL Handle for SA channel returned from
See also:
nwal_setSecAssoc API in case if application has inserted the protocol headers
  • Ignored in all other cases
Parameters:
[in]pPktInfoTransmit packet information
See also:
nwalTxPktInfo_t
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_sendDM ( nwal_Inst  nwalInst,
nwal_Handle  nwalDmSaHandle,
nwalDmTxPayloadInfo_t pDmPloadInfo 
)

nwal_sendDM Transmit payload for side band Data Mode Channel

The API will result in transmission of payload for side band crypto offload to SA for data mode channel

Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalDmSaHandleData Mode SA Handle
See also:
nwal_setDMSecAssoc
Parameters:
[in]pDmPloadInfoData Mode Payload with meta data
See also:
nwalDmTxPayloadInfo_t
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_sendRaw ( nwal_Inst  nwalInst,
nwal_Bool_t  lpbackPass,
uint16_t  bufLen,
uint8_t *  pBuf 
)

nwal_sendRaw Transmit raw packet to the PA

The API transmits the raw packet to the PA.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]lpbackPassLoopback the packet at NetCP PASS. Useful for debugging any classification action at NetCP
[in]bufLenLength of buffer being transmitted.
[in]pBufByte array with the payload
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_setDMSecAssoc ( nwal_Inst  nwalInst,
nwal_AppId  appId,
nwalCreateDmSAParams_t pCreateParam,
nwal_Handle pNwalDmSaHandle 
)

nwal_setDMSecAssoc API for creating Data Mode Security Association

API for creating Data Mode Security Association

Parameters:
[in]nwalInstNWAL Instance identifier
[in]appIdApplication ID to be registered. NWAL will pass the same ID back for the payload received back from NetCP after crypto completion
[in]pCreateParamConfiguration parameters.
[out]pNwalDmSaHandleNWAL Handle for SA Data mode channel
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_setIPAddr ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_AppId  appId,
nwal_Handle  ifHandle,
nwalIpParam_t *  pParam,
nwal_Handle pIpHandle 
)

nwal_setIPAddr Add IP Address configuration to NETCP.

API configures NetCP to add classification rule for local IP Address

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdThe ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]appIdApplication ID to be registered. The handle will be used for all interfaces from NWAL to application: 1) Asynchronous confirmation of configuration response 2) Any packets received from NetCP related to this handle
[in]ifHandleHandle returned to application from
See also:
nwal_setMacIface.
Parameters:
[in]pParamConfiguration parameters for IP classification
[out]pIpHandleHandle for IP related resource
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_setMacIface
nwal_RetValue nwal_setMacIface ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_AppId  appId,
nwalMacParam_t *  pParam,
nwal_Handle pIfHandle 
)

nwal_setMacIface Configures MAC LUT entry at NetCP.

The API configures L2/MAC related configuration to NetCP.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdThe ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction. Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]appIdApplication ID to be registered. The handle will be used for all interfaces from NWAL to application: 1) Asynchronous confirmation of configuration response 2) Any packets received from NetCP related to this handle
[in]pParamConfiguration parameters.
See also:
nwalMacParam_t
Parameters:
[in]pIfHandleOutput handle from NWAL. To be used for any next route classification based on this interface handle.
See also:
nwal_Handle
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start
nwal_RetValue nwal_setSecAssoc ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_AppId  appId,
nwalSaIpSecId_t *  pSaId,
nwalCreateSAParams_t pCreateParam,
nwal_Handle pNwalSecAssocHandle 
)

API to create outer IPSec Security Association Channel For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.

This function create outer IPSec Security Association Channel.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound direction. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]appIdApplication ID to be registered. The handle will be used for all interfaces from NWAL to application: 1) Asynchronous confirmation of configuration response 2) Any packets received from NetCP related to this handle
[in]pSaIdSA ID uniquely identifying Tunnel
[in]pCreateParamConfiguration parameters.
[out]pNwalSecAssocHandleNWAL Handle for SA channel
Return values:
@seenwal_OK or
See also:
nwal_TRANS_COMPLETE on success. Error codes
nwal_RetValue
Precondition:
See also:
nwal_setMacIface
nwal_RetValue nwal_setSecPolicy ( nwal_Inst  nwalInst,
nwal_TransID_t  transId,
nwal_AppId  appId,
nwalSecPolParams_t *  pPolParam,
nwal_Handle pNwalSecPolHandle 
)

API to create policy for a connection.

This function results in configuration of Inner IP LUT entry for the RX side. For inbound direction API will trigger allocating resources at NetCP. Application can either block by passing transaction ID as NWAL_TRANSID_SPIN_WAIT or wait for call back being called with the results For outbound, API will return nwal_TRANS_COMPLETE and no further callback will be called.Application can free transaction ID after returning from API.

Parameters:
[in]nwalInstNWAL Instance identifier
[in]transIdTransaction Id maintained by application. Applicable only in the case of inbound Sec Policy. The ID will be returned back by NWAL in nwal_CmdCallBack() upon completion of the transaction.Set this to NWAL_TRANSID_SPIN_WAIT in case of blocking API call It is recommended not to initiate a blocking API call when a callback event driven API is in progress.
[in]appIdApplication ID to be registered. The handle will be used for all interfaces from NWAL to application: 1) Asynchronous confirmation of configuration response 2) Any packets received from NetCP related to this handle
[in]pPolParamConfiguration information for Security profile for IPSec Channel.
[out]pNwalSecPolHandleNWAL Handle identifying the policy configuration
Return values:
@seenwal_OK or
See also:
nwal_TRANS_COMPLETE on success. Error codes
nwal_RetValue
Precondition:
See also:
nwal_setSecAssoc
nwal_RetValue nwal_start ( nwal_Inst  nwalInst,
const nwalLocCfg_t pCfg 
)

API would need to be called for all cores as a pre-requisite. API allows local per core related resource configuration to NWAL.

Following resource initialization is handled in API:

  • Control and packet flows for each core
    Parameters:
    [in]nwalInstNWAL Instance identifier
    [in]pCfg
    See also:
    nwalLocCfg_t
    Return values:
    @seenwal_OK on success. Error codes
    See also:
    nwal_RetValue
    Precondition:
    See also:
    nwal_create
nwal_RetValue nwal_updateProtoHdr ( nwal_Inst  nwalInst,
nwal_Handle  nwalHandle,
nwalTxPktInfo_t pPktInfo 
)

nwal_updateProtoHdr Update protocol header to the packet

The API will result in prepending the packet with:MAC/[IPSec]/IP/UDP header for the packet based on the

See also:
nwalTxConnCfg_t information for the connection. Recommended sequence with minimal cycle consumption would be 1) Call nwal_updateProtoHdr for every packet 2) Call nwal_initPSCmdInfo only once to get PS Command for NetCP offload 3) Call nwal_updateXXX macros or nwal_send() for transmission of packets
Parameters:
[in]nwalInstNWAL Instance identifier
[in]nwalHandleShould be connHandle returned from
See also:
nwal_addConn
Parameters:
[in]pPktInfoTX metadata with pkt containing payload. API will update header specific offset information to the metadata during update
See also:
nwalTxPktInfo_t
Return values:
@seenwal_OK on success. Error codes
See also:
nwal_RetValue
Precondition:
See also:
nwal_start

Copyright 2014, Texas Instruments Incorporated