Data Structures | Defines | Typedefs | Functions
pktlib.h File Reference

Header file for the Packet Library. The file exposes the data structures and exported API which are available for use by applications. More...

#include <ti/drv/qmss/qmss_drv.h>
#include <ti/drv/cppi/cppi_drv.h>
#include <ti/drv/cppi/cppi_desc.h>
#include <ti/runtime/pktlib/pktlibver.h>

Data Structures

struct  Pktlib_HeapIfTable
 The structure describes the Heap Interface Table. More...
struct  Pktlib_HeapCfg
 The structure describes the Heap Configuration. More...
struct  Pktlib_HeapStats
 The structure describes the Heap Statistics. More...

Defines

#define PKTLIB_EINVAL   -1
 The error code indicates an invalid argument was passed to the API.
#define PKLIB_EMAXHEAPLIMIT   -2
 This error code implies that there the MAX heap limit was exceeded.
#define PKLIB_ERESOURCE   -3
 This error code implies that there was a resource error.
#define PKTLIB_EPERM   -4
 This error code implies that the MPU was not configured to allow the PKTLIB to write to use the QMSS threshold functionality.
#define PKTLIB_ENOMEM   -5
 This error code implies that an OUT of memory error was detected.
#define PKTLIB_EDATABUFFER_MISMATCH   -6
 The error code implies that the number of data buffers packets in the heap is NOT the same as the number of the data buffer packets with which the heap was created. This error is returned during heap deletion.
#define PKTLIB_EZEROBUFFER_MISMATCH   -7
 The error code implies that the number of zero buffers packets in the heap is NOT the same as the number of the zero buffer packets with which the heap was created. This error is returned during heap deletion.

Typedefs

typedef void * Ti_Pkt
 The packet library exposes the Ti_Pkt as an opaque handle.
typedef void * Pktlib_HeapHandle
 Packet Library Heap Handle.
typedef struct Pktlib_HeapIfTable Pktlib_HeapIfTable
 The structure describes the Heap Interface Table.
typedef struct Pktlib_HeapCfg Pktlib_HeapCfg
 The structure describes the Heap Configuration.
typedef struct Pktlib_HeapStats Pktlib_HeapStats
 The structure describes the Heap Statistics.

Functions

static Cppi_HostDesc * Pktlib_getDescFromPacket (Ti_Pkt *ptrPkt)
static Ti_PktPktlib_getPacketFromDesc (Cppi_HostDesc *ptrHostDesc)
static uint8_t Pktlib_packetBufferCount (Ti_Pkt *ptrPkt)
static void Pktlib_getDataBuffer (Ti_Pkt *ptrPkt, uint8_t **ptrDataBuffer, uint32_t *dataLen)
static uint32_t Pktlib_getDataBufferLen (Ti_Pkt *ptrPkt)
static uint32_t Pktlib_getPacketLen (Ti_Pkt *ptrPkt)
static Ti_PktPktlib_getNextPacket (Ti_Pkt *ptrPkt)
static void Pktlib_setDataBufferLen (Ti_Pkt *ptrPkt, uint32_t dataLen)
static void Pktlib_setPacketLen (Ti_Pkt *ptrPkt, uint32_t packetLen)
static int32_t Pktlib_setDataOffset (Ti_Pkt *ptrPkt, int32_t offset)
static void Pktlib_setTags (Ti_Pkt *ptrPkt, Cppi_DescTag *tag)
Ti_PktPktlib_packetMerge (Ti_Pkt *pPkt1, Ti_Pkt *pPkt2, Ti_Pkt *pLastPkt)
int32_t Pktlib_clonePacket (Ti_Pkt *ptrPktOrig, Ti_Pkt *ptrClonePacket)
Ti_PktPktlib_allocPacket (Pktlib_HeapHandle heapHandle, uint32_t size)
void Pktlib_freePacket (Ti_Pkt *pPkt)
int32_t Pktlib_splitPacket (Ti_Pkt *pOrgPkt, Ti_Pkt *pNewPkt, uint32_t splitPacketSize, Ti_Pkt **pPkt1, Ti_Pkt **pPkt2)
int32_t Pktlib_splitPacket2 (Ti_Pkt *pOrgPkt, Ti_Pkt *pNewPkt, uint32_t splitPacketSize, Ti_Pkt **pPkt1, Ti_Pkt **pPkt2)
Pktlib_HeapHandle Pktlib_createHeap (Pktlib_HeapCfg *ptrHeapCfg, int32_t *errCode)
int32_t Pktlib_deleteHeap (Pktlib_HeapHandle heapHandle, int32_t *errCode)
Pktlib_HeapHandle Pktlib_findHeapByName (const char *heapName)
void Pktlib_getHeapStats (Pktlib_HeapHandle heapHandle, Pktlib_HeapStats *ptrHeapStats)
Pktlib_HeapHandle Pktlib_getPktHeap (Ti_Pkt *pPkt)
void Pktlib_garbageCollection (Pktlib_HeapHandle heapHandle)
int32_t Pktlib_sharedHeapInit (void)
void Pktlib_invalidatePkt (Ti_Pkt *pPkt)
void Pktlib_writebackPkt (Ti_Pkt *pPkt)
Qmss_QueueHnd Pktlib_getZeroHeapQueue (Pktlib_HeapHandle heapHandle)
Qmss_QueueHnd Pktlib_getInternalHeapQueue (Pktlib_HeapHandle heapHandle)
uint32_t Pktlib_getMaxBufferSize (Pktlib_HeapHandle heapHandle)
Pktlib_HeapHandle Pktlib_createSuperHeap (const char *heapName, Pktlib_HeapHandle memberHeap[], int32_t numMemberHeaps, int32_t *errCode)

Detailed Description

Header file for the Packet Library. The file exposes the data structures and exported API which are available for use by applications.

NOTE: (C) Copyright 2012 Texas Instruments, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Copyright 2014, Texas Instruments Incorporated