Functions
BCP Higher Layer Functions
BCP Higher Layer Data Structures & APIs

Functions

static Bcp_TxQInfoBcp_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)

Function Documentation

============================================================================
Bcp_close

brief
This API closes the BCP driver instance opened earlier using a call to Bcp_open () API.

Parameters:
[in]hBcpBCP driver handle obtained using Bcp_open () API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Invalid input handle passed. Error.
  • BCP_RETVAL_SUCCESS - Successfully closed the BCP.
Precondition:

Bcp_open () must have been called to open the driver instance prior to calling this API. Also, all open Tx, Rx objects opened by an application must be closed by calling Bcp_txClose () and Bcp_rxClose () APIs before calling this API to ensure all associated memory is freed cleanly.
Postcondition:

Reference count decremented on the BCP instance in the driver. ============================================================================
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.

Parameters:
[in]instNumBCP peripheral instance number.
Returns:
Bcp_RetVal
  • BCP_RETVAL_SUCCESS - Successfully closed the BCP CDMA.
Precondition:

Bcp_init () must be called before calling this API.
Postcondition:

Reference count decremented on the BCP instance in the driver. When reference count reaches zero, CDMA is closed, all BCP Tx queues closed and deallocated. BCP software reset performed. ============================================================================
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.

Parameters:
[in]hBcpBCP driver handle obtained using Bcp_open () API. Specifies which BCP instance to search for a match.
[in]rxQueueNumberRx queue number for which the flow Id lookup must be performed.
Returns:
Bcp_RetVal
  • <0 - Flow Id retrieval failed. Unable to find a flow for the Rx queue number and BCP instance provided in the driver database.
  • >=0 - Success. Valid Flow Id returned.
Precondition:

A valid driver handle must be obtained using Bcp_open () API before calling this API.
Postcondition:

None. ============================================================================
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.

Parameters:
[in]instNumBCP instance number.
Returns:
Bcp_LldObj*
  • NULL - Invalid instance number passed/Corresponding BCP instance not initialized yet. Error.
  • >0 - BCP LLD object handle returned.
Precondition:

Bcp_init () must have been called to open the driver instance prior to calling this API.
Postcondition:

None ============================================================================
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 *

Parameters:
[in]instNumBCP instance number from which an empty Rx object slot must be found.
Returns:
int32_t
  • <0 - Error finding an empty slot in the Rx object global database.
  • >=0 - Valid Rx object slot id from the database returned to store the new Rx object info.
Precondition:

Bcp_open () must have been called to initialize the driver before calling this API. Also a valid instance number must be specified to this API in 'instNum' parameter.
Postcondition:

None.
        ...

        // 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.

Returns:

uint32_t - Returns the BCP driver version Id
Precondition:

None.
Postcondition:

None. ============================================================================
const char* Bcp_getVersionStr ( void  )

============================================================================
Bcp_getVersionStr

brief
This API returns the BCP driver's version information in string format.

Returns:

const char* - Returns the BCP driver build and version info in string format.
Precondition:

None.
Postcondition:

None. ============================================================================
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.

Parameters:
[in]instNumBCP peripheral instance number.
[in]modeIndicates if BCP driver needs to execute in "local" or "remote" modes.
[in]pBcpInitCfgBCP initialization configuration.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EINVALID_PARAMS - Invalid instance number provided.
  • BCP_RETVAL_EBAD_HANDLE - Invalid init configuration handle provided.
  • BCP_RETVAL_EFAILURE - Error initializing driver for the BCP instance requested.
  • BCP_RETVAL_SUCCESS - BCP instance initialized succesfully.
Precondition:

This API MUST be called only once during system startup.
Postcondition:

BCP driver initialized for the instance specified. ============================================================================
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.

Parameters:
[in]instNumBCP peripheral instance number to check the status on.
Returns:
uint8_t
  • 1 - Driver initialized for the instance number passed.
  • 0 - Instance number invalid/not initialized.
Precondition:

None.
Postcondition:

None. ============================================================================
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.

Parameters:
[in]instNumBCP Instance number that the application would like to use.
[in]pBcpDrvCfgHandle to BCP driver configuration structure.
[out]pRetValPointer to hold the return value returned by this API. Following are the possible return values for this API:
  • BCP_RETVAL_EINVALID_PARAMS - Invalid instance number/driver configuration provided.
  • BCP_RETVAL_EBAD_HANDLE - Invalid driver configuration handle provided.
  • BCP_RETVAL_ENO_MEM - Error allocating memory for driver's internal book-keeping data.
  • BCP_RETVAL_SUCCESS - Successfully opened the driver instance.
Returns:
Bcp_DrvHandle
  • NULL - Error. Appropriate error code is returned in the output parameter 'pRetVal'.
  • >0 - Success. Valid BCP driver handle is returned.
Precondition:

None
Postcondition:

None ============================================================================
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.

Parameters:
[in]hBcpRxInfoRx handle obtained using Bcp_rxOpen () API.
[out]phDrvBufferPointer to hold the output (descriptor) from BCP.
[out]ppDataBufferPointer to hold data buffer pointer obtained from BCP.
[out]pDataBufferLenPointer to hold data buffer length, i.e.,holds the number of bytes available to application in the data buffer for use.
[out]ppPSInfoPointer to PS Info pointer obtained from BCP.
[out]pPSInfoLenPointer to PS Info length, i.e.,holds the number of bytes of PS info available for application to parse.
[out]pFlowIdFlow Id read from the descriptor's Source Tag lower order 8 bits.
[out]pSrcIdSource Id read from the descriptor's Source Tag higher order 8 bits.
[out]pDestnTagInfoDestination tag info read from the descriptor.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Invalid input Rx object handle provided.
  • BCP_RETVAL_ENO_RESULT - No output available yet on the Rx queue.
  • BCP_RETVAL_SUCCESS - Successfully retrieved output and stored in output parameter handles.
Precondition:

A valid Rx object handle must be obtained using Bcp_rxOpen () API before calling this API.
Postcondition:

If BCP output available, it is validated and handed over to application for further processing, otherwise appropriate status is returned. ============================================================================

============================================================================
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.

Parameters:
[in]hBcpRxInfoBCP Rx object handle obtained using Bcp_rxOpen() API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - BCP Rx object close failed.
  • BCP_RETVAL_SUCCESS - BCP Rx object successfully closed.
Precondition:

Valid Rx object handle must be obtained using Bcp_rxOpen () API before calling this API.
Postcondition:

BCP Rx object, Rx flow successfully closed on local device. Rx endpoint close callback API invoked. ============================================================================
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.

Parameters:
[in]hBcpRxInfoRx handle obtained using Bcp_rxOpen () API.
[in]hDrvBufferBCP driver output buffer handle obtained using Bcp_recv () API.
[in]drvBufferLenSize of the CPPI descriptor (BCP output buffer) being freed.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Invalid input provided. Free failed.
  • BCP_RETVAL_SUCCESS - Free succeeded.
Precondition:

A valid driver buffer handle should have been obtained using Bcp_recv () before calling this API to free the descriptor.
Postcondition:

The result buffers passed are freed up and restored to the Rx object's free descriptors. ============================================================================

============================================================================
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.

Parameters:
[in]hBcpRxInfoBCP Rx object handle obtained using Bcp_rxOpen() API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Flow Id value retrieval failed. Invalid Rx object handle passed.
  • BCP_RETVAL_ENOT_SUPPORTED - This API not supported on BCP remote device.
  • >=0 - The Flow Id associated with the Rx object ranging between 0 and (BCP_MAX_NUM_FLOWS-1) (both inclusive).
Precondition:

Valid Rx object handle must be obtained using Bcp_rxOpen () API before calling this API.
Postcondition:

None. ============================================================================

============================================================================
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.

Parameters:
[in]hBcpRxInfoRx handle obtained using Bcp_rxOpen () API.
Returns:
int32_t
  • BCP_RETVAL_EBAD_HANDLE - Invalid input Rx handle provided.
  • BCP_RETVAL_ENOT_SUPPORTED - API not supported on remote device.
  • >=0 - Number of pending output entries for this Rx object.
Precondition:

A valid Rx object handle must be obtained using Bcp_rxOpen () API before calling this API.
Postcondition:

Returns the number of BCP output entries available for this Rx object. ============================================================================

============================================================================
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.

Parameters:
[in]hBcpRxInfoBCP Rx object handle obtained using Bcp_rxOpen() API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Rx Queue Number retrieval failed.
  • BCP_RETVAL_ENOT_SUPPORTED - This API not supported on BCP remote device.
  • >=0 - The destination queue number associated with the Rx object's flow.
Precondition:

Valid Rx object handle must be obtained using Bcp_rxOpen () API before calling this API.
Postcondition:

None. ============================================================================
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.

Parameters:
[in]hBcpBCP driver handle obtained using Bcp_open () API.
[in]pBcpRxCfgInput 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]pRxEndpointCfgTransport 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.
Returns:
Bcp_RxHandle
  • NULL - Error. Invalid Rx object configuration.
  • Valid Rx handle - Success. BCP Rx object, Rx queue successfully setup.
Precondition:

Valid BCP driver handle must be obtained by calling Bcp_open () API by the application before calling this API.
Postcondition:

A Rx queue, flow successfully setup with input configuration specified on local device. On remote device, Rx remote endpoint is opened. The Rx object can now be used to retrieve results from the BCP. ============================================================================
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.

Parameters:
[in]hBcpRxInfoRx handle obtained using Bcp_rxOpen () API.
[in]pCppiDescRx descriptor containing the output that needs to be processed by this API.
[out]phDrvBufferPointer to hold BCP driver output handle.
[out]ppDataBufferPointer to hold data buffer pointer obtained from BCP.
[out]pDataBufferLenPointer to data buffer length, i.e.,holds the number of bytes available to application in the output data buffer for parsing.
[out]ppPSInfoPointer to PS Info pointer obtained from BCP.
[out]pPSInfoLenPointer to PS Info length, i.e.,holds the number of bytes of PS info available for application to parse.
[out]pFlowIdFlow Id read from the descriptor's Source Tag lower order 8 bits.
[out]pSrcIdSource Id read from the descriptor's Source Tag higher order 8 bits.
[out]pDestnTagInfoDestination tag info read from the descriptor.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Bad input Handle provided.
  • BCP_RETVAL_SUCCESS - Success.
Precondition:

A valid CPPI descriptor handle must be sent to this API. ============================================================================
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.

Parameters:
[in]hBcpTxInfoTx handle obtained using Bcp_txOpen () API.
[in]hDrvBufferCPPI descriptor built by the application containing data to be processed by BCP.
[in]drvBufferLenSize of the CPPI descriptor being sent.
[in]pDestnAddressDestination device info. On remote device, will contain information regarding BCP device and on local device must be set to NULL.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Invalid input handles provided. BCP send failed.
  • BCP_RETVAL_SUCCESS - Successfully sent data for BCP processing.
Precondition:

A valid Tx object handle must be obtained using Bcp_txOpen (), and a valid descriptor handle, length must be passed to this API.
Postcondition:

Data pushed onto BCP Tx queue corresponding to the Tx object handle passed.

============================================================================

============================================================================
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.

Parameters:
[in]hBcpTxInfoBCP Tx handle obtained using Bcp_txOpen() API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Error. Invalid input passed.
  • BCP_RETVAL_SUCCESS - Success. BCP Tx object closed.
Precondition:

A valid Tx handle also must be obtained using Bcp_txOpen () before calling this API.
Postcondition:

BCP Tx object successfully closed. The Tx queue the object uses is closed if reference count on it reaches zero. ============================================================================
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.

Parameters:
[in]hBcpBCP driver handle obtained using Bcp_open () API.
[in]pBcpTxCfgInput 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]pTxEndpointCfgConfiguration 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.
Returns:
Bcp_TxHandle
  • NULL - Error. Invalid configuration passed.
  • Valid Tx handle - Success.
Precondition:

Valid BCP driver handle must be obtained by calling Bcp_open () API by the application before calling this API. Valid Tx configuration must be specified in 'pBcpTxCfg' structure as input to this API on local device.
Postcondition:

BCP Tx queue open and setup if this API being called for first time for a given Tx queue number. Tx object is ready for use to send data to BCP. BCP tunnel Tx endpoint is setup too using the callback registered at BCP init time. ============================================================================
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 ().

Parameters:
[in]pBcpTxQInfoHandle to the transmit queue obtained using Bcp_txQueueOpen () API.
Returns:
Bcp_RetVal
  • BCP_RETVAL_EBAD_HANDLE - Invalid transmit queue handle provided.
  • BCP_RETVAL_SUCCESS - Succesfully closed the queue.
Precondition:

Bcp_txQueueOpen () must have been called succesfully to setup the BCP transmit queue before calling this API.
Postcondition:

Reference counter on the queue handle decremented. If reference counter reaches zero, queue configuration cleaned up and all associated CPPI handles released. ============================================================================
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.

Parameters:
[in]pBcpInstInfoBCP instance information handle.
[in]bcpTxQNumBCP Transmit queue number for which the setup needs to be performed. Valid values are between 0-8.
Returns:
Bcp_TxQInfo*
  • NULL - Tx queue setup failed as per input provided.
  • Valid Handle - Success. Valid Tx queue handle returned.
Precondition:

Bcp_open () API must have been called to initialize the driver's global state before calling this API.
Postcondition:

BCP Queue 'bcpTxQNum' opened and the corresponding CPPI channels are opened too if called for the first time. Reference counter for the queue is incremented to keep track of all the application threads using this queue. ============================================================================

Copyright 2014, Texas Instruments Incorporated