![]() |
![]() |
Functions | |
static Bcp_TxQInfo * | Bcp_txQueueOpen (Bcp_InstanceInfo *pBcpInstInfo, Bcp_QueueId bcpTxQNum) |
static Bcp_RetVal | Bcp_txQueueClose (Bcp_TxQInfo *pBcpTxQInfo) |
static int32_t | Bcp_getNextAvailRxObjId (uint8_t instNum) |
uint32_t | Bcp_getVersionID (void) |
const char * | Bcp_getVersionStr (void) |
Bcp_RetVal | Bcp_init (uint8_t instNum, Bcp_DrvMode mode, Bcp_InitCfg *pBcpInitCfg) |
Bcp_RetVal | Bcp_deInit (uint8_t instNum) |
uint8_t | Bcp_isInitialized (uint8_t instNum) |
Bcp_DrvHandle | Bcp_open (uint8_t instNum, Bcp_DrvCfg *pBcpDrvCfg, Bcp_RetVal *pRetVal) |
Bcp_RetVal | Bcp_close (Bcp_DrvHandle hBcp) |
Bcp_LldObj * | Bcp_getLLDHandle (uint8_t instNum) |
Bcp_TxHandle | Bcp_txOpen (Bcp_DrvHandle hBcp, Bcp_TxCfg *pBcpTxCfg, void *pTxEndpointCfg) |
Bcp_RetVal | Bcp_txClose (Bcp_TxHandle hBcpTxInfo) |
Bcp_RxHandle | Bcp_rxOpen (Bcp_DrvHandle hBcp, Bcp_RxCfg *pBcpRxCfg, void *pRxEndpointCfg) |
Bcp_RetVal | Bcp_rxClose (Bcp_RxHandle hBcpRxInfo) |
Bcp_RetVal | Bcp_findFlowIdByQueueNumber (Bcp_DrvHandle hBcp, uint32_t rxQueueNumber) |
Bcp_RetVal | Bcp_rxGetRxQueueNumber (Bcp_RxHandle hBcpRxInfo) |
Bcp_RetVal | Bcp_rxGetFlowId (Bcp_RxHandle hBcpRxInfo) |
Bcp_RetVal | Bcp_send (Bcp_TxHandle hBcpTxInfo, Bcp_DrvBufferHandle hDrvBuffer, uint32_t drvBufferLen, void *pDestnAddress) |
Bcp_RetVal | Bcp_rxGetNumOutputEntries (Bcp_RxHandle hBcpRxInfo) |
Bcp_RetVal | Bcp_recv (Bcp_RxHandle hBcpRxInfo, Bcp_DrvBufferHandle *phDrvBuffer, uint8_t **ppDataBuffer, uint32_t *pDataBufferLen, uint8_t **ppPSInfo, uint32_t *pPSInfoLen, uint8_t *pFlowId, uint8_t *pSrcId, uint16_t *pDestnTagInfo) |
Bcp_RetVal | Bcp_rxProcessDesc (Bcp_RxHandle hBcpRxInfo, Cppi_Desc *pCppiDesc, Bcp_DrvBufferHandle *phDrvBuffer, uint8_t **ppDataBuffer, uint32_t *pDataBufferLen, uint8_t **ppPSInfo, uint32_t *pPSInfoLen, uint8_t *pFlowId, uint8_t *pSrcId, uint16_t *pDestnTagInfo) |
Bcp_RetVal | Bcp_rxFreeRecvBuffer (Bcp_RxHandle hBcpRxInfo, Bcp_DrvBufferHandle hDrvBuffer, uint32_t drvBufferLen) |
Bcp_RetVal Bcp_close | ( | Bcp_DrvHandle | hBcp | ) |
============================================================================
Bcp_close
brief
This API closes the BCP driver instance opened earlier using a call to Bcp_open () API.
[in] | hBcp | BCP driver handle obtained using Bcp_open () API. |
Bcp_RetVal Bcp_deInit | ( | uint8_t | instNum | ) |
============================================================================
Bcp_deInit
brief
This API closes the BCP peripheral instance opened earlier using Bcp_init () API. When all the applications using this BCP instance have released it (reference count on the instance reaches zero), this API closes the BCP CDMA, closes the BCP LLD and finally initiates a software reset on the BCP to reset all its registers, and it's state machine. On success, it restores the BCP peripheral state to 'un-initialized' state
If an application or driver would like to use any of the driver APIs again, it can do so only after calling Bcp_init() again.
[in] | instNum | BCP peripheral instance number. |
Bcp_RetVal Bcp_findFlowIdByQueueNumber | ( | Bcp_DrvHandle | hBcp, |
uint32_t | rxQueueNumber | ||
) |
============================================================================
Bcp_findFlowIdByQueueNumber
brief
Given a Rx queue number, this API returns the corresponding flow Id associated from the driver's Rx object database.
[in] | hBcp | BCP driver handle obtained using Bcp_open () API. Specifies which BCP instance to search for a match. |
[in] | rxQueueNumber | Rx queue number for which the flow Id lookup must be performed. |
Bcp_LldObj* Bcp_getLLDHandle | ( | uint8_t | instNum | ) |
============================================================================
Bcp_getLLDHandle
brief
This API returns the BCP LLD object handle corresponding to the BCP instance number provided.
[in] | instNum | BCP instance number. |
static int32_t Bcp_getNextAvailRxObjId | ( | uint8_t | instNum | ) | [static] |
============================================================================
Bcp_getNextAvailRxObjId
brief
Given a BCP peripheral instance number, this API searches through the instance's global Rx object info database to find the next available empty slot to store a new Rx object's info. Each slot in this global Rx object info database stores Rx object information that needs to be globally accessible, i.e., accessible from all cores of the device.
* API for internal use by the driver *
[in] | instNum | BCP instance number from which an empty Rx object slot must be found. |
... // Get the next available Rx object slot from the database. if (Bcp_getNextAvailRxObjId (CSL_BCP) < 0) { // Number of Rx objects created exceeds maximum allowed. }
============================================================================
uint32_t Bcp_getVersionID | ( | void | ) |
============================================================================
Bcp_getVersionID
brief
This API returns the BCP driver's version Id.
const char* Bcp_getVersionStr | ( | void | ) |
============================================================================
Bcp_getVersionStr
brief
This API returns the BCP driver's version information in string format.
Bcp_RetVal Bcp_init | ( | uint8_t | instNum, |
Bcp_DrvMode | mode, | ||
Bcp_InitCfg * | pBcpInitCfg | ||
) |
============================================================================
Bcp_init
brief
This API initializes the BCP peripheral with the configuration provided, and opens the BCP CDMA for use.
BCP driver can be initialized in 2 modes - "local" and "remote". In "remote" mode, applications can only send/receive data to/from BCP, but cannot configure its registers or its CDMA. "Local" mode however gives access to entire BCP register and CDMA configuration space in addition to the ability to send/receive packets from it. Application must initialize BCP in appropriate mode depending on whether BCP peripheral is present on the device where driver is being executed or not.
This API MUST be called ONLY once in the system and at system startup for any given BCP peripheral instance before using any of the BCP driver APIs.
[in] | instNum | BCP peripheral instance number. |
[in] | mode | Indicates if BCP driver needs to execute in "local" or "remote" modes. |
[in] | pBcpInitCfg | BCP initialization configuration. |
uint8_t Bcp_isInitialized | ( | uint8_t | instNum | ) |
============================================================================
Bcp_isInitialized
brief
Given an BCP peripheral instance number, this API returns 1 to indicate that it is initialized and has been successfully setup, 0 otherwise.
[in] | instNum | BCP peripheral instance number to check the status on. |
Bcp_DrvHandle Bcp_open | ( | uint8_t | instNum, |
Bcp_DrvCfg * | pBcpDrvCfg, | ||
Bcp_RetVal * | pRetVal | ||
) |
============================================================================
Bcp_open
brief
This API MUST be called by all BCP driver users at least once to obtain an BCP driver handle.
[in] | instNum | BCP Instance number that the application would like to use. |
[in] | pBcpDrvCfg | Handle to BCP driver configuration structure. |
[out] | pRetVal | Pointer to hold the return value returned by this API. Following are the possible return values for this API: |
Bcp_RetVal Bcp_recv | ( | Bcp_RxHandle | hBcpRxInfo, |
Bcp_DrvBufferHandle * | phDrvBuffer, | ||
uint8_t ** | ppDataBuffer, | ||
uint32_t * | pDataBufferLen, | ||
uint8_t ** | ppPSInfo, | ||
uint32_t * | pPSInfoLen, | ||
uint8_t * | pFlowId, | ||
uint8_t * | pSrcId, | ||
uint16_t * | pDestnTagInfo | ||
) |
============================================================================
Bcp_recv
brief
Given an Rx object handle, this API checks if there is any output available on the Rx queue from the BCP for its processing. If so, it does some basic validation on it and returns the descriptor handle, corresponding data buffer, its length, and any PS info found to the calling application. If no output found, this API either returns status to indicate the same.
[in] | hBcpRxInfo | Rx handle obtained using Bcp_rxOpen () API. |
[out] | phDrvBuffer | Pointer to hold the output (descriptor) from BCP. |
[out] | ppDataBuffer | Pointer to hold data buffer pointer obtained from BCP. |
[out] | pDataBufferLen | Pointer to hold data buffer length, i.e.,holds the number of bytes available to application in the data buffer for use. |
[out] | ppPSInfo | Pointer to PS Info pointer obtained from BCP. |
[out] | pPSInfoLen | Pointer to PS Info length, i.e.,holds the number of bytes of PS info available for application to parse. |
[out] | pFlowId | Flow Id read from the descriptor's Source Tag lower order 8 bits. |
[out] | pSrcId | Source Id read from the descriptor's Source Tag higher order 8 bits. |
[out] | pDestnTagInfo | Destination tag info read from the descriptor. |
Bcp_RetVal Bcp_rxClose | ( | Bcp_RxHandle | hBcpRxInfo | ) |
============================================================================
Bcp_rxClose
brief
This API closes the Rx object, any Rx tunnel endpoints.
On local device, the API closes the Rx flow and cleans up all associated queue and channel handles.
On remote device, the API invokes the corresponding Rx tunnel endpoint close API.
[in] | hBcpRxInfo | BCP Rx object handle obtained using Bcp_rxOpen() API. |
Bcp_RetVal Bcp_rxFreeRecvBuffer | ( | Bcp_RxHandle | hBcpRxInfo, |
Bcp_DrvBufferHandle | hDrvBuffer, | ||
uint32_t | drvBufferLen | ||
) |
============================================================================
Bcp_rxFreeResult
brief
Given a Rx object handle and driver buffer handle obtained from Bcp_recv () API, this API frees the driver buffer handle and restores the associated Rx descriptor back to its Rx Free descriptor queue. This API must be called by the application once its done processing the result, otherwise the driver could run out of output buffers eventually if none restored in time.
On remote device, this API instead invokes the free receive buffer API of the BCP transport layer.
[in] | hBcpRxInfo | Rx handle obtained using Bcp_rxOpen () API. |
[in] | hDrvBuffer | BCP driver output buffer handle obtained using Bcp_recv () API. |
[in] | drvBufferLen | Size of the CPPI descriptor (BCP output buffer) being freed. |
Bcp_RetVal Bcp_rxGetFlowId | ( | Bcp_RxHandle | hBcpRxInfo | ) |
============================================================================
Bcp_rxGetFlowId
brief
This API retrieves a given Rx object's Rx flow id number.
This API is supported only on BCP local device, i.e., if BCP driver was initialized in "local" mode.
[in] | hBcpRxInfo | BCP Rx object handle obtained using Bcp_rxOpen() API. |
Bcp_RetVal Bcp_rxGetNumOutputEntries | ( | Bcp_RxHandle | hBcpRxInfo | ) |
============================================================================
Bcp_rxGetNumOutputEntries
brief
Given a Rx object handle, this API retrieves the number of BCP output entries pending to be serviced by the application for it.
[in] | hBcpRxInfo | Rx handle obtained using Bcp_rxOpen () API. |
Bcp_RetVal Bcp_rxGetRxQueueNumber | ( | Bcp_RxHandle | hBcpRxInfo | ) |
============================================================================
Bcp_rxGetRxQueueNumber
brief
This API retrieves the given Rx object's Receive queue number. This API is especially useful if the application didnt specify a Rx Queue number during Bcp_rxOpen () API and would like to retrieve the queue number at a later point.
This API is supported only on BCP local device, i.e., if BCP driver was initialized in "local" mode.
[in] | hBcpRxInfo | BCP Rx object handle obtained using Bcp_rxOpen() API. |
Bcp_RxHandle Bcp_rxOpen | ( | Bcp_DrvHandle | hBcp, |
Bcp_RxCfg * | pBcpRxCfg, | ||
void * | pRxEndpointCfg | ||
) |
============================================================================
Bcp_rxOpen
brief
This API sets up a Rx object for the calling application. A Rx object is required by driver users to receive output from the BCP.
On Local device, a valid Rx object configuration MUST be provided in the input parameter 'pBcpRxCfg'. This API creates a BCP flow using the configuration provided. It also sets up the accumulator interrupts if interrupts are requested for this object. If any configuration needs to be done to redirect output from BCP to a remote device, then a valid configuration can be passed in 'pRxEndpointCfg' parameter and the driver will invoke the BCP transport layer's Rx endpoint open function. This parameter can be set to NULL if BCP output is to be processed on the same device or if no additional transport layer configuration is required.
On Remote device, a valid Rx endpoint configuration must be passed in the 'pRxEndpointCfg' parameter. This API in turn calls the transport layer's Rx endpoint open API to do the needful configuration to receive results from BCP on that device.
On success, this API returns a valid, non-zero Rx oject handle and returns NULL otherwise to indicate an error.
[in] | hBcp | BCP driver handle obtained using Bcp_open () API. |
[in] | pBcpRxCfg | Input structure that holds configuration for the Rx object. MUST be a valid handle on local device. MUST be set to NULL on remote device. |
[in] | pRxEndpointCfg | Transport layer's Rx endpoint configuration. MUST be valid on remote device. Can be NULL or a valid handle on local device, depending on whether BCP output is going to be processed on local device or not. |
Bcp_RetVal Bcp_rxProcessDesc | ( | Bcp_RxHandle | hBcpRxInfo, |
Cppi_Desc * | pCppiDesc, | ||
Bcp_DrvBufferHandle * | phDrvBuffer, | ||
uint8_t ** | ppDataBuffer, | ||
uint32_t * | pDataBufferLen, | ||
uint8_t ** | ppPSInfo, | ||
uint32_t * | pPSInfoLen, | ||
uint8_t * | pFlowId, | ||
uint8_t * | pSrcId, | ||
uint16_t * | pDestnTagInfo | ||
) |
============================================================================
Bcp_rxProcessDesc
brief
This API can be used to retrieve the various fields from the output descriptor received from the engine.
[in] | hBcpRxInfo | Rx handle obtained using Bcp_rxOpen () API. |
[in] | pCppiDesc | Rx descriptor containing the output that needs to be processed by this API. |
[out] | phDrvBuffer | Pointer to hold BCP driver output handle. |
[out] | ppDataBuffer | Pointer to hold data buffer pointer obtained from BCP. |
[out] | pDataBufferLen | Pointer to data buffer length, i.e.,holds the number of bytes available to application in the output data buffer for parsing. |
[out] | ppPSInfo | Pointer to PS Info pointer obtained from BCP. |
[out] | pPSInfoLen | Pointer to PS Info length, i.e.,holds the number of bytes of PS info available for application to parse. |
[out] | pFlowId | Flow Id read from the descriptor's Source Tag lower order 8 bits. |
[out] | pSrcId | Source Id read from the descriptor's Source Tag higher order 8 bits. |
[out] | pDestnTagInfo | Destination tag info read from the descriptor. |
Bcp_RetVal Bcp_send | ( | Bcp_TxHandle | hBcpTxInfo, |
Bcp_DrvBufferHandle | hDrvBuffer, | ||
uint32_t | drvBufferLen, | ||
void * | pDestnAddress | ||
) |
============================================================================
Bcp_send
brief
Given a Tx object handle, descriptor containing data, and the descriptor size, this API pushes the data onto BCP Tx queue for processing.
On remote device, this API instead invokes the BCP transport layer's send API to send out the packet to BCP using appropriate transport mechanism.
[in] | hBcpTxInfo | Tx handle obtained using Bcp_txOpen () API. |
[in] | hDrvBuffer | CPPI descriptor built by the application containing data to be processed by BCP. |
[in] | drvBufferLen | Size of the CPPI descriptor being sent. |
[in] | pDestnAddress | Destination device info. On remote device, will contain information regarding BCP device and on local device must be set to NULL. |
============================================================================
Bcp_RetVal Bcp_txClose | ( | Bcp_TxHandle | hBcpTxInfo | ) |
============================================================================
Bcp_txClose
brief
This API closes the Tx object and frees memory allocated for it.
On local device, it also decrements the reference count on the Tx queue this object uses. When the reference count on the queue reaches zero, the Tx queue is closed. Additionally, if any tunnel Tx endpoint was created, its corresponding close function is closed to clean it up.
On remote device, the Tx remote endpoint is closed by calling the corresponding transport layer function.
[in] | hBcpTxInfo | BCP Tx handle obtained using Bcp_txOpen() API. |
Bcp_TxHandle Bcp_txOpen | ( | Bcp_DrvHandle | hBcp, |
Bcp_TxCfg * | pBcpTxCfg, | ||
void * | pTxEndpointCfg | ||
) |
============================================================================
Bcp_txOpen
brief
This API sets up a transmit object for the calling application. A transmit object must be setup by any application that wishes to send data for processing to BCP using the driver.
On success, this API returns a valid, non-zero Tx handle and NULL otherwise to indicate an error.
On BCP local device, a valid Tx endpoint configuration must be passed in 'pTxEndpointCfg' if the BCP Tx queue being opened needs to be made accessible from remote device too. If no remote access is required for this BCP Tx queue, then 'pTxEndpointCfg' parameter can be set to NULL.
On BCP remote device, the BCP Tx queue configuration 'pBcpTxCfg' must be set to NULL since remote device has no direct access to BCP CDMA. Configuration required to open a BCP Tx remote endpoint must be passed in 'pTxEndpointCfg' and the driver in turn passes this as-is to the registered Tx endpoint open API.
[in] | hBcp | BCP driver handle obtained using Bcp_open () API. |
[in] | pBcpTxCfg | Input structure that holds configuration for the Tx object. MUST be set to NULL on remote device and MUST contain valid configuration on local device. |
[in] | pTxEndpointCfg | Configuration for BCP tunnel Tx endpoint object. MUST be valid for remote device. Can be NULL or a valid handle on local device based on whether remote access needs to be enabled for this Tx queue or not. |
static Bcp_RetVal Bcp_txQueueClose | ( | Bcp_TxQInfo * | pBcpTxQInfo | ) | [static] |
============================================================================
Bcp_txQueueClose
brief
This API decrements the reference count on the transmit queue handle provided and when the reference count reaches zero, i.e., when no application thread is no longer using this transmit queue handle it frees up the BCP transmit queue handle and all associated configuration. If an application wishes to use the transmit queue, it would have to do so by opening the BCP transmit queue with appropriate configuration using the API Bcp_txQueueOpen ().
[in] | pBcpTxQInfo | Handle to the transmit queue obtained using Bcp_txQueueOpen () API. |
static Bcp_TxQInfo* Bcp_txQueueOpen | ( | Bcp_InstanceInfo * | pBcpInstInfo, |
Bcp_QueueId | bcpTxQNum | ||
) | [static] |
============================================================================
Bcp_txQueueOpen
brief
If not already open, this API sets up the BCP Transmit queue corresponding to the queue number specified in 'bcpTxQNum' (valid values 0-8) and the BCP instance specified by 'pBcpInstInfo' handle. If open already, the queue configuration is skipped.
As part of the queue configuration this API opens the CPPI queue, and the corresponding Tx, Rx channels.
[in] | pBcpInstInfo | BCP instance information handle. |
[in] | bcpTxQNum | BCP Transmit queue number for which the setup needs to be performed. Valid values are between 0-8. |