![]() |
![]() |
Description
This function closes a transmit or a receive channel. The channel reference count is decremented. The channel is freed only if the reference count is zero.
[in] | hnd | Channel handle. |
Success | - Current reference count. |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_CHANNEL_NOT_OPEN |
Failure | - CPPI_RM_ERR_FREEING_RESOURCE |
Description
This function disables a transmit or a receive channel.
[in] | hnd | Channel handle. |
Success | - CPPI_SOK |
Failure | - CPPI_INVALID_PARAM |
Description
This function enables a transmit or a receive channel.
[in] | hnd | Channel handle. |
Success | - CPPI_SOK |
Failure | - CPPI_INVALID_PARAM |
Description
This function pauses a transmit or a receive channel.
[in] | hnd | Channel handle. |
Success | - CPPI_SOK |
Failure | - CPPI_INVALID_PARAM |
Description
This function returns the enable or disable channel status.
[in] | hnd | Channel handle. |
Success | - Channel Status |
Failure | - CPPI_INVALID_PARAM |
Cppi_Result Cppi_channelTeardown | ( | Cppi_ChHnd | hnd, |
Cppi_Wait | wait | ||
) |
Description
This function tears down a transmit or a receive channel by writing to the channel teardown bit. This function can do a blocking wait for the teardown to complete OR return immediately and it is up to the callee to check for channel teardown status. The behavior is based on the "wait" input parameter
[in] | hnd | Channel handle. |
[in] | wait | Specifies Wait or No Wait for teardown complete. |
Success | - CPPI_SOK |
Failure | - CPPI_INVALID_PARAM |
Cppi_Result Cppi_close | ( | Cppi_Handle | hnd | ) |
Description
This function closes the CPPI CPDMA instance. The instance reference count is decremented. CPPI CPDMA instance is closed only if the reference count is zero. CPPI CPDMA instance is closed only if all the Rx, Tx channels and Rx flows are closed. This function should be called to close all instances before re-opening the CPPI CPDMA instance.
[in] | hnd | handle returned by Cppi_open API. |
Success | - Current reference count. |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_CPDMA_NOT_INITIALIZED |
Failure | - CPPI_TX_CHANNELS_NOT_CLOSED |
Failure | - CPPI_RX_CHANNELS_NOT_CLOSED |
Failure | - CPPI_RX_FLOWS_NOT_CLOSED |
Description
This function closes a receive flow. The flow reference count is decremented. The flow is freed only if the reference count is zero.
[in] | hnd | flow handle. |
Success | - Current reference count. |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_FLOW_NOT_OPEN |
Failure | - CPPI_RM_ERR_FREEING_RESOURCE |
Cppi_FlowHnd Cppi_configureRxFlow | ( | Cppi_Handle | hnd, |
Cppi_RxFlowCfg * | cfg, | ||
uint8_t * | isAllocated | ||
) |
Description
This function configures a receive flow. The flow can be configured in two ways: 1) If flow ID number in cfg structure is set to CPPI_PARAM_NOT_SPECIFIED, then a new available flow is allocated. 2) If flow ID number is cfg structure is a valid flow i.e., >= 0, then the flow is allocated if free else a handle to a previously opened flow is returned.
The flow is configured only if it is a new flow allocation.
[in] | hnd | handle returned by Cppi_open API. |
[in] | cfg | Rx flow configuration |
[out] | isAllocated | Indicates whether the requested flow is a new flow allocation(1). or was already allocated. If the flow was previously allocated this parameter returns the reference count. |
Success | - Flow Handle. |
Failure | - NULL |
static void Cppi_decrementRefCount | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to decrement the number of references that have been made to the attached buffer by different descriptors. Multiple buffer references are commonly used to implement broadcast and multicast packet forwarding when zero packet data copies are desired.
**No validation is done on the input parameters**. **No check is made to prevent overflow **.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
None |
Cppi_Result Cppi_exit | ( | void | ) |
Description
This function deinitializes the CPPI low level driver. The LLD is deinitialized only if all the CPDMA instances are closed. This function should be called before re-initializing the CPPI low level driver.
Success | - CPPI_SOK |
Failure | - CPPI_CPDMA_NOT_CLOSED |
uint32_t Cppi_getChannelNumber | ( | Cppi_ChHnd | hnd | ) |
Description
Given the channel handle the function returns the channel number corresponding to the handle
[in] | hnd | Channel handle |
Channel | number |
Description
This function returns the CPDMA loopback configuration
[in] | hnd | handle returned by Cppi_open API. |
Success | 0 - loopback is disabled 1 - loopback is enabled |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_CPDMA_NOT_INITIALIZED |
static void Cppi_getData | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t ** | buffAddr, | ||
uint32_t * | buffLen | ||
) | [inline, static] |
Description
This function is used to retrieve the data buffer pointer from the host descriptor and payload from monolithic descriptor. Note that if PS data is present in SOP buffer, the offset to data must calculated by the caller
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[out] | buffAddr | Memory address of data buffer. |
[out] | buffLen | Size of the data buffer. |
None. |
static uint32_t Cppi_getDataLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the data length from host or monolithic descriptor
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
In | case of host descriptor Word 3 is returned In case of monolithic descriptor Word 0 (bits 0 to 15) is returned. |
static uint32_t Cppi_getDataOffset | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the payload data offset from the monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
9 | bit data offset. Valid range is 0 to 511 bytes |
static uint32_t Cppi_getDescError | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the error flags (Word 2 bits 20:23) from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
4 | bit Error flag value from descriptor. |
static Cppi_DescType Cppi_getDescType | ( | Cppi_Desc * | descAddr | ) | [inline, static] |
Description
This function is used to get the type of descriptor. Call this function if the descriptor type is not known so it can be passed to the remaining descriptor manipulation functions.
**No validation is done on the input parameters**.
[in] | descAddr | Memory address of descriptor. |
Word | 0(bits 30 to 31) are returned |
0 - Host descriptor 2 - Monolithic descriptor
uint32_t Cppi_getFlowId | ( | Cppi_FlowHnd | hnd | ) |
Description
Given the flow handle the function returns the flow ID corresponding to the handle
[in] | hnd | Flow handle |
Flow | ID |
Cppi_Result Cppi_getHeapReq | ( | Cppi_GlobalConfigParams * | cppiGblCfgParams, |
uint32_t * | size | ||
) |
Description
This function returns the worst-case heap requirements for the CPPI LLD given a cppiGblCfgParams set of managed resources.
This can be used to optionally statically allocate all of the heap memory, which is then passed in trhough Cppi_initCfg. As long as the static heap is at least the size returned by this function then no dynamic allocations via Cppi_osalMalloc will ever be made.
Use of this API is completely optional. A static heap can be used of any size. If it is too small then dynamic allocation will occur. The system can also be used with only dynamic allocation, where no static memory is provided through Cppi_initCfg.
[in] | cppiGblCfgParams | Initialization structure that contains the CPPI device specific information. |
[out] | size | Total bytes of memory that would be used if all flows and channels specified in cppiGblCfgParams are actually used. |
Success | - CPPI_SOK Failure - CPPI_INVALID_PARAM: NULL passsed for cppiGblCfgParmas or size |
static Cppi_Desc* Cppi_getNextBD | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the next buffer descriptor pointer from a host packet. If the value is zero, then the current buffer is the last buffer in the packet.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
Word | 5 of host descriptor 32 bit word aligned memory address - if current buffer is not the last buffer in packet. 0 - if current buffer is the last buffer in packet. |
static uint8_t Cppi_getOrigBufferpooIndex | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to set the original buffer pool index from which the attached buffer was originally allocated from. This is different from the descriptor pool/queue index since a single buffer may be referenced by more than one descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
Word | 6 (bit 28 to 31) of host descriptor |
static void Cppi_getOriginalBufInfo | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t ** | buffAddr, | ||
uint32_t * | buffLen | ||
) | [inline, static] |
Description
This function is used to retrieve the original buffer information from host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[out] | buffAddr | Memory address of data buffer pointer. |
[out] | buffLen | Size of the original data buffer. |
None. |
static uint32_t Cppi_getPacketLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the packet length from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
Size | of packet in bytes |
static uint8_t Cppi_getPacketType | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the packet type from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
5 | bit packet type field. Valid range is 0 to 31. |
static Cppi_Result Cppi_getPSData | ( | Cppi_DescType | descType, |
Cppi_PSLoc | location, | ||
Cppi_Desc * | descAddr, | ||
uint8_t ** | dataAddr, | ||
uint32_t * | dataLen | ||
) | [inline, static] |
Description
This function is used to retrieve the protocol specific data from the host or monolithic descriptor. In case of host descriptor the PS data is read from descriptor or SOP buffer based on the PS location.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | location | PS region location CPPI_PS_DESC - PS words are located in the descriptor CPPI_PS_SOP - PS words are located inthe SOP buffer immediately prior to data. |
[in] | descAddr | Memory address of descriptor. |
[out] | dataAddr | Pointer to the first word of protocol specific data. |
[out] | dataLen | Size of the PS data. |
Success | - CPPI_SOK |
Failure | - CPPI_PSDATA_NOT_PRESENT if PS length is zero in the descriptor. |
static uint8_t Cppi_getPSFlags | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the protocol specific flags from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
4 | bit PS flags value from descriptor. |
static uint32_t Cppi_getPSLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the protocol specific data length from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
Size | of PS data in bytes. Valid range is 0 to 128 bytes |
static Cppi_PSLoc Cppi_getPSLocation | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the protocol specific region location from host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
CPPI_PS_DESC | - PS words are located in the descriptor |
CPPI_PS_SOP | - PS words are located inthe SOP buffer immediately prior to data. |
static uint8_t Cppi_getRefCount | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the number of references that have been made to the attached buffer by different descriptors. Multiple buffer references are commonly used to implement broadcast and multicast packet forwarding when zero packet data copies are desired.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
Word | 6 (bit 22 to 27) of host descriptor |
static Cppi_ReturnPolicy Cppi_getReturnPolicy | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the return policy for the packet from host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
RETURN_ENTIRE_PACKET | - Entire packet (linked with MOP and EOP BDs and data buffers) should be returned to the return queue specified in SOP descriptor. |
RETURN_BUFFER | - Each buffer in this packet should be returned to the queue specified in its respective SOP, MOP or EOP descriptor. |
static Qmss_Location Cppi_getReturnPushPolicy | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the return push policy for the packet from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
TAIL | - Descriptor must be returned to tail of queue. |
HEAD | - Descriptor must be returned to head of queue. |
static Qmss_Queue Cppi_getReturnQueue | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the return queue manager and queue number from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
Queue | Manager - 0 or 1. |
Queue | Number - 0 to 4094 with in queue manager 0 or 1. |
static Cppi_Result Cppi_getSoftwareInfo | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t ** | infoAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the 3 words of software info field from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[out] | infoAddr | Pointer to the first word of software information block. |
Success | - CPPI_SOK |
Failure | - CPPI_EPIB_NOT_PRESENT if EPIB bit is not set in the descriptor. |
static uint32_t Cppi_getSoftwareInfo0 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the 1st word of software info field from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
4 | bytes of software info word 1 |
static uint32_t Cppi_getSoftwareInfo1 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the 2nd word of software info field from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
4 | bytes of software info word 2 |
Failure | - CPPI_EPIB_NOT_PRESENT if EPIB bit is not set in the descriptor. |
static uint32_t Cppi_getSoftwareInfo2 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to retrieve the 3rd word of software info field from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
4 | bytes of software info word 3 |
Failure | - CPPI_EPIB_NOT_PRESENT if EPIB bit is not set in the descriptor. |
static Cppi_DescTag Cppi_getTag | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to get the source and destination tags from host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
8 | bit destination low tag value. |
8 | bit destination high tag value. |
8 | bit source low tag value. |
8 | bit source high tag value. |
static Cppi_Result Cppi_getTimeStamp | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t * | timeStamp | ||
) | [inline, static] |
Description
This function is used to retrieve the timestamp field from the host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[out] | timeStamp | Timestamp value. |
Success | - CPPI_SOK |
Failure | - CPPI_EPIB_NOT_PRESENT if EPIB bit is not set in the descriptor. |
uint32_t Cppi_getVersion | ( | void | ) |
Description
The function is used to get the version information of the CPPI LLD.
Version | Information. |
const char* Cppi_getVersionStr | ( | void | ) |
Description
The function is used to get the version string for the CPPI LLD.
Version | String. |
static void Cppi_incrementRefCount | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr | ||
) | [inline, static] |
Description
This function is used to increment the number of references that have been made to the attached buffer by different descriptors. Multiple buffer references are commonly used to implement broadcast and multicast packet forwarding when zero packet data copies are desired.
**No validation is done on the input parameters**. **No check is made to prevent overflow **.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
None |
Cppi_Result Cppi_init | ( | Cppi_GlobalConfigParams * | cppiGblCfgParams | ) |
Description
This function initializes the CPPI low level driver This function is called once in the system to setup the CPPI low level driver with information pertaining to maximum supported Rx priority, Tx priority, Rx channels, Tx channels, Rx flows and memory mapped address for each CPPI CPDMA.
This works by calling Cppi_initCfg with initCfg = NULL.
[in] | cppiGblCfgParams | Initialization structure that contains the CPPI device specific information. |
Success | - CPPI_SOK |
Cppi_Result Cppi_initCfg | ( | Cppi_GlobalConfigParams * | cppiGblCfgParams, |
Cppi_InitCfg * | initCfg | ||
) |
Description
This function initializes the CPPI low level driver This function is called once in the system to setup the CPPI low level driver with information pertaining to maximum supported Rx priority, Tx priority, Rx channels, Tx channels, Rx flows and memory mapped address for each CPPI CPDMA.
[in] | cppiGblCfgParams | Initialization structure that contains the CPPI device specific information. |
[in] | initCfg | Initialization structure that contains the heap config information which can be NULL. |
Failure | - CPPI_INVALID_PARAM Success - CPPI_SOK |
Qmss_QueueHnd Cppi_initDescriptor | ( | Cppi_DescCfg * | descCfg, |
uint32_t * | numAllocated | ||
) |
Description
This function is used to obtain previously allocated descriptors. The function opens an destination queue as specified in the input parameters and pushes the requested number of descriptors from specified memory region, if available onto it. The host and monolithic descriptors are configured with values specified in "descCfg" before pushing them to the destination queue. The configuration for host descriptors are return policy, return push policy, return queue. The configuration for monolithic descriptors is the return queue. If the return queue is set to QMSS_PARAM_NOT_SPECIFIED then the destination queue specified in input parameter is configured to as return queue.
[in] | descCfg | Specifies the number of descriptors, memory region from where it should be allocated and the destination queue to push to. |
[out] | numAllocated | Number of descriptors actually allocated. |
Success | - Destination queue handle on which the allocated descriptors are stored. The queue must be closed by the caller using Qmss_queueClose() when done. |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_QMSS_MEMREGION_NOT_INITIALIZED |
Failure | - CPPI_QUEUE_OPEN_ERROR |
static void Cppi_linkNextBD | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Cppi_Desc * | nextBD | ||
) | [inline, static] |
Description
This function is used to link a host descriptor with the next buffer descriptor.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[in] | nextBD | Memory address of buffer descriptor that should be linked. |
None. |
Cppi_Handle Cppi_open | ( | Cppi_CpDmaInitCfg * | initCfg | ) |
Description
This function opens the CPPI CPDMA instance. This function is called by the CPPI CPDMA driver, application to initialize the global configuration pertaining to CPPI CPDMA that includes rx priority, tx priority, write arbitration FIFO depth, receive starvation timeout and QM base addresses. The registers are configured only once when the function is called for the first time. Any future calls to this function returns the CPDMA object handle created during the first call.
[in] | initCfg | Initialization structure that contains the global configuration parameters pertaining to CPPI CPDMA. |
Success | - Handle to CPPI CPDMA object. Used as an input parameter to all other CPPI LLD APIs. |
Failure | - NULL |
Cppi_ChHnd Cppi_rxChannelOpen | ( | Cppi_Handle | hnd, |
Cppi_RxChInitCfg * | cfg, | ||
uint8_t * | isAllocated | ||
) |
Description
This function opens a CPPI receive channel. The channel can be opened in two ways: 1) If channel number in cfg structure is set to CPPI_PARAM_NOT_SPECIFIED, then a new available channel is allocated. 2) If channel number in cfg structure is a valid channel i.e., >= 0, then the channel is allocated if free else a handle to a previously opened channel is returned. The channel is configured only if it is a new channel allocation.
[in] | hnd | handle returned by Cppi_open API. |
[in] | cfg | Rx channel configuration specifying channel number, channel enable. |
[out] | isAllocated | Indicates whether the requested channel number is a new channel allocation(1). or was already allocated. If the channel was previously allocated this parameter returns the reference count. |
Success | - Channel Handle. Used as a input parameter in all other channel related APIs. |
Failure | - NULL |
Cppi_Result Cppi_setCpdmaLoopback | ( | Cppi_Handle | hnd, |
uint8_t | loopback | ||
) |
Description
This function enables or disables CPDMA loopback
[in] | hnd | handle returned by Cppi_open API. |
[in] | loopback | 0 - To disable loopback 1 - To enable loopback |
Success | - CPPI_SOK |
Failure | - CPPI_INVALID_PARAM |
Failure | - CPPI_CPDMA_NOT_INITIALIZED |
static void Cppi_setData | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t * | buffAddr, | ||
uint32_t | buffLen | ||
) | [inline, static] |
Description
This function copies the data buffer to the host or monolithic descriptor. It is assumed that enough words are available to store the payload in case of monolithic descriptor.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | buffAddr | Memory address of data buffer. |
[in] | buffLen | Size of the data buffer. |
In case of monolithic descriptor Word 0 (bits 0 to 15) and payload are updated.
None. |
static void Cppi_setDataLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | buffLen | ||
) | [inline, static] |
Description
This function sets the data length in host or monolithic descriptor.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | buffLen | Size of the data. |
In case of monolithic descriptor Word 0 (bits 0 to 15) is updated.
None. |
static void Cppi_setDataOffset | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | dataOffset | ||
) | [inline, static] |
Description
This function is used to set the payload data offset in the monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | dataOffset | Data offset from byte 0 of word 0 of the descriptor to the location where valid data begins. Valid range is 0 to 511 bytes. |
None |
static void Cppi_setDescType | ( | Cppi_Desc * | descAddr, |
Cppi_DescType | descType | ||
) | [inline, static] |
Description
This function is used to set the type of descriptor.
**No validation is done on the input parameters**.
[in] | descAddr | Memory address of descriptor. |
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC, Cppi_DescType_TEARDOWN |
None. |
static void Cppi_setOrigBufferpooIndex | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t | poolIndex | ||
) | [inline, static] |
Description
This function is used to set the original buffer pool index from which the attached buffer was originally allocated from. This is different from the descriptor pool/queue index since a single buffer may be referenced by more than one descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[in] | poolIndex | index of buffer pool. |
None |
static void Cppi_setOriginalBufInfo | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t * | buffAddr, | ||
uint32_t | buffLen | ||
) | [inline, static] |
Description
This function is used to set the original buffer information in the host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[in] | buffAddr | Memory address of data buffer pointer. |
[in] | buffLen | Size of the original data buffer. |
None. |
static void Cppi_setPacketLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | packetLen | ||
) | [inline, static] |
Description
This function is used to set the packet length in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | packetLen | Size of packet. |
None |
static void Cppi_setPacketType | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t | packetType | ||
) | [inline, static] |
Description
This function is used to set the packet type in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | packetType | Indicates type of packet. Valid range is 0 to 31. |
None |
static uint8_t* Cppi_setPSData | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t * | dataAddr, | ||
uint32_t | dataLen | ||
) | [inline, static] |
Description
This function is used to copy the protocol specific data to the host or monolithic descriptor. Used when PS data is located in the descriptor. This function should not be used to copy PS data to SOP buffer.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | dataAddr | Pointer to the first word of protocol specific data. |
[in] | dataLen | Size of the PS data. |
Address | of the PSData that has already been set. |
static void Cppi_setPSFlags | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t | psFlags | ||
) | [inline, static] |
Description
This function is used to set the protocol specific flags in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | psFlags | 4 bit Protocol Specific flags value. |
None |
static void Cppi_setPSLen | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | dataLen | ||
) | [inline, static] |
Description
This function is update protocol specific data length in host or monolithic descriptor.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | dataLen | Size of PS data. |
None |
static void Cppi_setPSLocation | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Cppi_PSLoc | location | ||
) | [inline, static] |
Description
This function is used to set the protocol specific region location in host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[in] | location | PS region location CPPI_PS_DESC - PS words are located in the descriptor CPPI_PS_SOP - PS words are located inthe SOP buffer immediately prior to data. |
None |
static void Cppi_setReturnPolicy | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Cppi_ReturnPolicy | returnPolicy | ||
) | [inline, static] |
Description
This function is used to set the return policy for the packet in host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST |
[in] | descAddr | Memory address of descriptor. |
[in] | returnPolicy | RETURN_ENTIRE_PACKET - Entire packet (linked with MOP and EOP BDs and data buffers) should be returned to the return queue specified in SOP descriptor. RETURN_BUFFER - Each buffer in this packet should be returned to the queue specified in its respective SOP, MOP or EOP descriptor. |
None |
static void Cppi_setReturnPushPolicy | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Qmss_Location | returnPushPolicy | ||
) | [inline, static] |
Description
This function is used to set the return push policy in host or monolithic descriptor. Return push policy is valid only if Return Policy is set to 1 in host descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | returnPushPolicy | TAIL - Descriptor must be returned to tail of queue. HEAD - Descriptor must be returned to head of queue. |
None |
static void Cppi_setReturnQueue | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Qmss_Queue | queue | ||
) | [inline, static] |
Description
This function is used to set the return queue manager and queue number in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | queue | Queue Manager - 0 or 1. Queue Number - 0 to 4094 with in queue manager 0 or 1. |
None |
static void Cppi_setSoftwareInfo | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint8_t * | infoAddr | ||
) | [inline, static] |
Description
This function is used copy the optional software info field to the host or monolithic descriptor. It is assumed that enough words are available in the descriptor to store information block. The API copies 3 words of software info into the descriptor.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | infoAddr | Pointer to the first word of software information block. |
None |
static void Cppi_setSoftwareInfo0 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | value | ||
) | [inline, static] |
Description
This function is used copy the 1st word of optional software info field to the host or monolithic descriptor. It is assumed that enough words are available in the descriptor to store information block.
**No validation is done on the input parameters**. **Does not update packet length**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | value | Value to write to word 1 of software information block. |
None |
static void Cppi_setSoftwareInfo1 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | value | ||
) | [inline, static] |
Description
This function is used copy the 2nd word of optional software info field to the host or monolithic descriptor. It is assumed that enough words are available in the descriptor to store information block.
**No validation is done on the input parameters**. **Does not update packet length**. **Does not update EPIB present bit**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | value | Value to write to word 2 of software information block. |
None |
static void Cppi_setSoftwareInfo2 | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | value | ||
) | [inline, static] |
Description
This function is used copy the 3rd word of optional software info field to the host or monolithic descriptor. It is assumed that enough words are available in the descriptor to store information block.
**No validation is done on the input parameters**. **Does not update packet length**. **Does not update EPIB present bit**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | value | Value to write to word 3 of software information block. |
None |
static void Cppi_setTag | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
Cppi_DescTag * | tag | ||
) | [inline, static] |
Description
This function is used to set source and destination tags in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | tag | Destination and source low and High tag value. |
None |
static void Cppi_setTimeStamp | ( | Cppi_DescType | descType, |
Cppi_Desc * | descAddr, | ||
uint32_t | timeStamp | ||
) | [inline, static] |
Description
This function is used to set the timestamp field in host or monolithic descriptor.
**No validation is done on the input parameters**.
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | timeStamp | Timestamp value. |
None |
void Cppi_startCfg | ( | Cppi_StartCfg * | startCfg | ) |
Description
This function initializes any CPPI start configurations such as the Resource Manager handle
Cppi_ChHnd Cppi_txChannelOpen | ( | Cppi_Handle | hnd, |
Cppi_TxChInitCfg * | cfg, | ||
uint8_t * | isAllocated | ||
) |
Description
This function opens a CPPI transmit channel. The channel can be opened in two ways: 1) If channel number in cfg structure is set to CPPI_PARAM_NOT_SPECIFIED, then a new available channel is allocated. 2) If channel number in cfg structure is a valid channel i.e., >= 0, then the channel is allocated if free else a handle to a previously opened channel is returned. The channel is configured only if it is a new channel allocation.
[in] | hnd | handle returned by Cppi_open API. |
[in] | cfg | Tx channel configuration specifying scheduler priority for the channel, channel number, channel enable, PS and EPIB filtering control, special AIF Monolithic Mode. |
[out] | isAllocated | Indicates whether the requested channel number is a new channel allocation(1). or was already allocated. If the channel was previously allocated this parameter returns the reference count. |
Success | - Channel Handle. Used as a input parameter in all other channel related APIs. |
Failure | - NULL |