summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9717822)
raw | patch | inline | side by side (parent: 9717822)
author | Tinku Mannan <tmannan@ti.com> | |
Tue, 2 Oct 2012 18:34:22 +0000 (14:34 -0400) | ||
committer | Tinku Mannan <tmannan@ti.com> | |
Tue, 2 Oct 2012 18:34:22 +0000 (14:34 -0400) |
index d3701f214365d1f9246ac31c424293e4bcff3e62..4c10b679f09ffe6bedc91858cb91d4557adf391f 100755 (executable)
rm -f $(ARMV7LIBDIR)/libnetapi.a
doxygen:
rm -f $(ARMV7LIBDIR)/libnetapi.a
doxygen:
+ rm -rf $(NETAPI_DOCS_DIR)/html
+ rm -rf $(NETAPI_DOCS_DIR)/latex
doxygen netapi_doxygen.cfg
doxygen_clean:
doxygen netapi_doxygen.cfg
doxygen_clean:
diff --git a/ti/runtime/netapi/build/netapi_doxygen.cfg b/ti/runtime/netapi/build/netapi_doxygen.cfg
index c94f16569168ec612412ac7e7014a640b7985f8e..7a5de9e509e5a910c7541ff24258db0b3a07779e 100755 (executable)
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ../netapi.h ../netcp_cfg.h ../netapi_sec.h ../pktio.h ../netapi_tune.h ../netapi_sched.h
+INPUT = ../netapi.h ../netcp_cfg.h ../netapi_sec.h ../netapi_tune.h ../netapi_sched.h ../pktio.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
index 1c4d8f986e323a6e7f4bf3f78fc5abd4a64b07eb..0b6c792db14528ef428ad72de56b441295411703 100755 (executable)
* @ingroup netapi
*/
* @ingroup netapi
*/
-/** @defgroup netapi_pktio_functions NETAPI PKTIO Functions
+/** @defgroup netapi_sched_functions NETAPI Scheduler Functions
* @ingroup netapi
*/
* @ingroup netapi
*/
-/** @defgroup netapi_constants NETAPI Constants
+/** @defgroup netapi_pktio_functions NETAPI PKTIO Functions
* @ingroup netapi
*/
* @ingroup netapi
*/
-/** @defgroup netapi_cb_functions NETAPI Callback Functions
+/** @defgroup netapi_cb_functions NETAPI Callback Functions
* @ingroup netapi
*/
* @ingroup netapi
*/
/**
/**
- * @brief This is the NWAL LLD Version. Versions numbers are encoded in the following
- * format:
- * 0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
+ * @def NETAPI_VERSION_ID
+ * This is the NETAPI Version. Versions numbers are encoded in the following
+ * format:
+ * 0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
*/
#define NETAPI_VERSION_ID (0x01000004)
/**
*/
#define NETAPI_VERSION_ID (0x01000004)
/**
- * @brief This is the version string which describes the NWAL LLD along with the
- * date and build information.
+ * @def NETAPI_VERSION_STR
+ * This is the version string which describes the NETAPI along with the
+ * date and build information.q
*/
#define NETAPI_VERSION_STR "NETAPI Revision: 01.00.00.04"
*/
#define NETAPI_VERSION_STR "NETAPI Revision: 01.00.00.04"
-
/**
* @ingroup netapi_structures
* @brief One per thread, used in most NETAPI function calls.
/**
* @ingroup netapi_structures
* @brief One per thread, used in most NETAPI function calls.
/**
/**
- * @brief This defines master for system
+ * @def NETAPI_SYS_MASTER
+ * This defines master for system
*/
#define NETAPI_SYS_MASTER 2
/**
*/
#define NETAPI_SYS_MASTER 2
/**
- * @brief This defines master for core
+ * @def NETAPI_CORE_MASTER
+ * This defines master for core
*/
#define NETAPI_CORE_MASTER 1
*/
#define NETAPI_CORE_MASTER 1
+
/**
/**
- * @brief This defines no mater, data only
+ * @def NETAPI_NO_MASTER
+ * This defines no mater, data only
*/
#define NETAPI_NO_MASTER 0 //data only
*/
#define NETAPI_NO_MASTER 0 //data only
*/
typedef struct NETAPI_CFG_Tag
{
*/
typedef struct NETAPI_CFG_Tag
{
- int def_mem_size; /**< Bytes of CMA memory we have allocated */
- int def_flow_pkt_rx_offset; /**< Offset in pkt buffer for hw to start RX */
- int def_max_descriptors; /**< Number of descriptors in system (must be power of 2), 2^14 max */
- int def_tot_descriptors_for_us; /**< Number of descriptors to create in our region (must be power of 2)*/
- int def_heap_n_descriptors; /**< Number of descriptor plus buffers in default heap*/
- int def_heap_n_zdescriptors; /**< Number of zero len descriptors in defaule heap*/
- int def_heap_buf_size;/**< Size of buffers in default heap, max amount of area for packet data */
- int def_heap_tailroom_size; /**< Size of tailroom in reserve */
- int def_heap_extra_size; /**< Size of extra space at end of buffer */
+ int def_mem_size; /**< Bytes of CMA memory we have allocated */
+ int def_flow_pkt_rx_offset; /**< Offset in pkt buffer for hw to start RX */
+ int def_max_descriptors; /**< Number of descriptors in system (must be power of 2), 2^14 max */
+ int def_tot_descriptors_for_us; /**< Number of descriptors to create in our region (must be power of 2)*/
+ int def_heap_n_descriptors; /**< Number of descriptor plus buffers in default heap*/
+ int def_heap_n_zdescriptors; /**< Number of zero len descriptors in defaule heap*/
+ int def_heap_buf_size; /**< Size of buffers in default heap, max amount of area for packet data */
+ int def_heap_tailroom_size; /**< Size of tailroom in reserve */
+ int def_heap_extra_size; /**< Size of extra space at end of buffer */
} NETAPI_CFG_T;
/* @note:
} NETAPI_CFG_T;
/* @note:
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_init: API instantiates the NETAPI and allocated global resources and is pre-requisite
+ * @brief netapi_init API instantiates the NETAPI and allocated global resources.
*
* @details The API will allocate global resources valid per system level common across all ARM cores
*
* @details The API will allocate global resources valid per system level common across all ARM cores
- * or per thread based on "master" argument.
- * Intializes the following substems:
- * -pktio
- * -pktlib
- * -qmss
- * -cppi
- * -nwal
- *
- * @param[in] master can be either @ref NETAPI_SYS_MASTER or @ref NETAPI_NO_MASTER
- * @param[in] p_cfg (master mode). pointer to @refNETAPI_CFG_T or NULL to use netapi default configuration.
- * @retval @ref NETAPI_T: handle to the instance or NULL on error
+ * or per thread based on "master" argument.
+ * Intializes the following substems: pktio pklib qmss cppi nwal
+ *
+ * @param[in] master Can be either @ref NETAPI_SYS_MASTER or @ref NETAPI_NO_MASTER
+ * @param[in] p_cfg (master mode) pointer to @ref NETAPI_CFG_T or NULL to use netapi default configuration.
+ * @retval Handle to the instance or NULL on error, @ref NETAPI_T
* @pre none
*/
NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg);
/**
* @ingroup netapi_gen_functions
* @pre none
*/
NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg);
/**
* @ingroup netapi_gen_functions
- * @brief netapi_shutdown: API De-allocates all global resources allocated as part of @ref netapi_init
+ * @brief netapi_shutdown API de-allocates all global resources allocated as part of @ref netapi_init
*
* @details De-allocates global resources valid per system level common across all ARM cores
*
* @details De-allocates global resources valid per system level common across all ARM cores
- * or per thread based on "master" argument passed in at init time.
- * @param[in] @ref NETAPI_T: handle to the instance
+ * or per thread based on "master" argument passed in at init time.
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
* @retval none
* @pre @ref netapi_init
*/
* @retval none
* @pre @ref netapi_init
*/
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_getPktlibIfTable: API returns a Pktlib_HeapIfTable to use when creating pktlib heaps
- *
- * @details Application will need a heapIfTable in order to create its own heaps. This
- * function returns a table that can be passed in the call to @ref Pktlib_CreateHeap
- * The memory used for these heaps is special with the following characteristicsl:
- * - specific alignment,
- * - must be contguous,
- * - must have a physical to virtual mapping that is known by NETAPI.
- * Thus it must be completely managed by NETAPI. This interfaced table provides a
- * malloc function that the pktlib heap library uses to allocate data for the heap
- * buffers.
- * @param[in] none
- * @retval Pktlib_HeapIfTable pointer
- * @pre @ref netapi_init
+ * @brief netapi_getPktlibIfTable API returns a Pktlib_HeapIfTable to use when creating pktlib heaps
+ *
+ * @details Application will need a heapIfTable in order to create its own heaps. This
+ * function returns a table that can be passed in the call to Pktlib_CreateHeap
+ * The memory used for these heaps is special with the following characteristics:
+ * - Specific alignment.
+ * - Must be contguous.
+ * - Must have a physical to virtual mapping that is known by NETAPI.
+ * Thus it must be completely managed by NETAPI. This interfaced table provides a
+ * malloc function that the pktlib heap library uses to allocate data for the heap
+ * buffers.
+ * @retval Pktlib_HeapIfTable pointer
+ * @pre @ref netapi_init
*/
Pktlib_HeapIfTable *netapi_getPktlibIfTable(void) ;
/**
* @ingroup netapi_gen_functions
*/
Pktlib_HeapIfTable *netapi_getPktlibIfTable(void) ;
/**
* @ingroup netapi_gen_functions
- * @brief netapi_getBufMemRemainder: API is used to return the amount of free memory available for allocating buffers
- * for additonal Pktlib heaps
+ * @brief netapi_getBufMemRemainder API is used to return the amount of free memory available for allocating buffers
+ * for additonal Pktlib heaps
*
*
- * @details The application can use this API to determine how much free memory is
- * available for heap buffers if it decides to create its own.
- * @param[in] void
- * @retval int : amount of memory available for heap buffer storage (in bytes)
+ * @details The application can use this API to determine how much free memory is
+ * available for heap buffers if it decides to create its own.
+ * @retval Amount of memory available for heap buffer storage (in bytes)
* @pre @ref netapi_init
*/
int netapi_getBufMemRemainder(void);
* @pre @ref netapi_init
*/
int netapi_getBufMemRemainder(void);
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_getDescRemainder: API is used to return the amount of free memory available for allocating descriptors
- * for additonal Pktlib heaps.
+ * @brief netapi_getDescRemainder API is used to return the amount of free memory available for allocating descriptors
+ * for additonal Pktlib heaps.
*
*
- * @details The application can use this API to determine how much free memory is
- * available for heap descriptors if it decides to create its own heap.
- * @param[in] void
- * @retval int : amount of memory available for heap descriptor storage (in bytes)
+ * @details The application can use this API to determine how much free memory is
+ * available for heap descriptors if it decides to create its own heap.
+ * @retval Amount of memory available for heap descriptor storage (in bytes)
* @pre @ref netapi_init
*/
int netapi_getDescRemainder(void);
* @pre @ref netapi_init
*/
int netapi_getDescRemainder(void);
* @ingroup netapi_gen_functions
* @brief netapi_getDefaultFlow: API is used to return the default NETCP flow that is to be used for incoming packets.
*
* @ingroup netapi_gen_functions
* @brief netapi_getDefaultFlow: API is used to return the default NETCP flow that is to be used for incoming packets.
*
- * @details The application can use this API to return the default NETCP flow that is used
- * for received packets. A NETCP flow is a list of PacketLib Heaps that are to be
- * used to supply free packets to the receive DMA function.
- * @param[in] @ref NETAPI_T handle to NETAPI instance
- * @retval NETCP_CFG_FLOW_HANDLE_T : the handle to default flow
+ * @details The application can use this API to return the default NETCP flow that is used
+ * for received packets. A NETCP flow is a list of PacketLib Heaps that are to be
+ * used to supply free packets to the receive DMA function.
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @retval NETCP_CFG_FLOW_HANDLE_T The handle to default flow
* @pre @ref netapi_init
*/
* @pre @ref netapi_init
*/
-static inline NETCP_CFG_FLOW_HANDLE_T netapi_getDefaultFlow(NETAPI_T p) {
-return NETCP_DEFAULT_FLOW;
+static inline NETCP_CFG_FLOW_HANDLE_T netapi_getDefaultFlow(NETAPI_T p)
+{
+ return NETCP_DEFAULT_FLOW;
}
/**
* @ingroup netapi_gen_functions
* @brief netapi_getDefaultRoute: API is used to return the default NETCP route handle.
*
}
/**
* @ingroup netapi_gen_functions
* @brief netapi_getDefaultRoute: API is used to return the default NETCP route handle.
*
- * @details This API returns the default NETCP route created by @ref netapi_init.
- * A netcp route consists of a NETCP flow plus a destination pktio channel
- * @param[in] @ref NETAPI_T handle to NETAPI instance
- * @retval NETCP_CFG_ROUTE_HANDLE_T: The handle of the default route.
+ * @details This API returns the default NETCP route created by @ref netapi_init.
+ * A netcp route consists of a NETCP flow plus a destination pktio channel
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @retval The handle of the default route, NETCP_CFG_ROUTE_HANDLE_T
* @pre @ref netapi_init
*/
* @pre @ref netapi_init
*/
-static inline NETCP_CFG_ROUTE_HANDLE_T netapi_getDefaultRoute(NETAPI_T p) {
-return NETCP_DEFAULT_ROUTE;
+static inline NETCP_CFG_ROUTE_HANDLE_T netapi_getDefaultRoute(NETAPI_T p)
+{
+ return NETCP_DEFAULT_ROUTE;
}
/**
* @ingroup netapi_gen_functions
}
/**
* @ingroup netapi_gen_functions
- * @brief netapi_getCookie: API is used to return a piece of application-provided opaque data that has been
- * stored in the netapi instance.
+ * @brief netapi_getCookie API is used to return a piece of application-provided opaque data that has been
+ * stored in the netapi instance.
*
*
- * @details The application can save a pointer to opaque data in the @ref NETAPI_T instance.
- * This APi lets this data be returned to the application
- * @param[in] @ref NETAPI_T handle to NETAPI instance
- * @retval void * : Data provided in @ref netapi_setCookie
+ * @details The application can save a pointer to opaque data in the @ref NETAPI_T instance.
+ * This APi lets this data be returned to the application.
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @retval Data provided in @ref netapi_setCookie
* @pre @ref netapi_init, @ref netapi_setCookie
*/
static inline void * netapi_getCookie(NETAPI_T p)
{
* @pre @ref netapi_init, @ref netapi_setCookie
*/
static inline void * netapi_getCookie(NETAPI_T p)
{
-NETAPI_HANDLE_T *pp = (NETAPI_HANDLE_T *) p;
-return pp->cookie;
+ NETAPI_HANDLE_T *pp = (NETAPI_HANDLE_T *) p;
+ return pp->cookie;
}
/**
* @ingroup netapi_gen_functions
}
/**
* @ingroup netapi_gen_functions
- * @brief netapi_setCookie: API is used to set a piece of application-provided opaque data t in the netapi instance.
+ * @brief netapi_setCookie API is used to set a piece of application-provided opaque data t in the netapi instance.
*
*
- * @details The applicaiton can save a pointer to opaque data in the @ref NETAPI_T instance.
- * This API can be returned later to the application via @ref netapi_getCookie
- * @param[in] @ref NETAPI_T handle to NETAPI instance
- * @param[in] void * : opaque data to be saved
+ * @details The applicaiton can save a pointer to opaque data in the @ref NETAPI_T instance.
+ * Pointer to a opaque data can be returned later to the application via @ref netapi_getCookie
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @param[in] cookie Opaque data to be saved
* @retval none
* @pre @ref netapi_init
*/
static inline void netapi_setCookie(NETAPI_T p, void * cookie)
{
* @retval none
* @pre @ref netapi_init
*/
static inline void netapi_setCookie(NETAPI_T p, void * cookie)
{
-NETAPI_HANDLE_T *pp = (NETAPI_HANDLE_T *) p;
-pp->cookie= cookie;
+ NETAPI_HANDLE_T *pp = (NETAPI_HANDLE_T *) p;
+ pp->cookie= cookie;
}
/**
* @ingroup netapi_gen_functions
}
/**
* @ingroup netapi_gen_functions
- * @brief netapi_netcpPoll: API is used to poll for NETCP configuration response messages.
+ * @brief netapi_netcpPoll API is used to poll for NETCP configuration response messages.
*
* @details Application, if controlling the scheduler, will need to call this
*
* @details Application, if controlling the scheduler, will need to call this
- * function periodically to check for NETCP configuration responses (eg
- * statistics requests).
- * @param[in] @ref NETAPI_T handle to NETAPI instance
+ * function periodically to check for NETCP configuration responses (eg
+ * statistics requests).
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
* @retval none
* @pre @ref netapi_init
*/
* @retval none
* @pre @ref netapi_init
*/
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_registerHeap: API is used to register a heap that is created by application so that
- * it's garbage queue can be polled automatically by @ref netapi_poll_heapGarbage().
- *
- * @details This API registers an application-created heap with the netapi instance
- * so that it can add that heap's garbage queue to the garbage poll function.
- * NOTE: netapi internal heap is automatically registered
- * @param[in] @ref NETAPI_T handle to NETAPI instance
- * @param[in] @ref Pktlib_HeapHandle: handle of heap to register
- * @retval int : 1 if OK, <0 on error
- * @pre @ref netapi_init @ref Pktlib_CreateHeap
+ * @brief netapi_registerHeap API is used to register a heap that is created by application so that
+ * it's garbage queue can be polled automatically by @ref netapi_poll_heapGarbage().
+ *
+ * @details This API registers an application-created heap with the netapi instance
+ * so that it can add that heap's garbage queue to the garbage poll function.
+ * NOTE: netapi internal heap is automatically registered
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @param[in] h Handle of pklib heap to register
+ * @retval 1 if OK, <0 on error
+ * @pre @ref netapi_init
*/
static inline int netapi_registerHeap(NETAPI_T p, Pktlib_HeapHandle h)
{
*/
static inline int netapi_registerHeap(NETAPI_T p, Pktlib_HeapHandle h)
{
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_unregisterHeap: API is used to un-register a heap that was created by application and previously
-* registerd so that it's garbage queue could be polled automatically by @ref netapi_poll_heapGarbage().
- *
- * @details This API un-registers an application-created heap with the netapi instance.
- * NOTE: netapi internal heap is automatically registered
- * @param[in] p: handle to NETAPI instance
- * @param[in] h: handle to heap
+ * @brief netapi_unregisterHeap API is used to un-register a heap that was created by application
+ * and previously registerd so that it's garbage queue could be polled
+ * automatically by @ref netapi_poll_heapGarbage().
+ *
+ * @details This API un-registers an application-created heap with the netapi instance.
+ * NOTE: netapi internal heap is automatically registered
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @param[in] h The pklib handle to heap
* @retval <0 if err, 1 if OK
* @retval <0 if err, 1 if OK
- * @pre @ref netapi_init , @ref Pktlib_CreateHeap, @ref netai_registerHeap()
+ * @pre @ref netapi_init , @ref netapi_registerHeap()
*/
static inline int netapi_unregisterHeap(NETAPI_T p, Pktlib_HeapHandle h)
{
*/
static inline int netapi_unregisterHeap(NETAPI_T p, Pktlib_HeapHandle h)
{
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_closeHeap: API is used to remove a created pktlib heap
+ * @brief netapi_closeHeap API is used to remove a created pktlib heap
*
*
- * @details This API removes anapplication-created heap with the netapi instance
- * NOTE: descriptors are zapped and cannot be reused]
- * @param[in] p: handle to NETAPI instance
- * @param[in] h : handle to heap, @ref Pktlib_HeapHandle
+ * @details This API removes anapplication-created heap with the netapi instance
+ * NOTE: descriptors are zapped and cannot be reused]
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
+ * @param[in] h : handle to pklib heap
* @retval <0 if err, 1 if OK
* @retval <0 if err, 1 if OK
- * @pre @ref netapi_init , @ref Pktlib_CreateHeap, @ref netai_registerHeap
+ * @pre @ref netapi_init @ref netapi_registerHeap
*/
int netapi_closeHeap(NETAPI_T p, Pktlib_HeapHandle h);
/**
* @ingroup netapi_gen_functions
*/
int netapi_closeHeap(NETAPI_T p, Pktlib_HeapHandle h);
/**
* @ingroup netapi_gen_functions
- * @brief netapi_poll_heapGarbage: API is used to poll the garbage collection queue for
- * the internal NETAPI heaps and any application created heaps
+ * @brief netapi_poll_heapGarbage API is used to poll the garbage collection queue for
+ * the internal NETAPI heaps and any application created heaps.
*
* @details This API is used to poll the netapi internal heaps and any
*
* @details This API is used to poll the netapi internal heaps and any
- * application-created heaps that have been registered with the netapi instance. The
- * poll function checks the garbage collection queue associated with the heap and returns
- * descriptors and buffers when appropriate to the main free queue.
- * @param[in] @ref NETAPI_T handle to NETAPI instance
+ * application-created heaps that have been registered with the netapi instance. The
+ * poll function checks the garbage collection queue associated with the heap and returns
+ * descriptors and buffers when appropriate to the main free queue.
+ * @param[in] p The NETAPI handle, @ref NETAPI_T
* @retval none
* @retval none
- * @pre @ref netapi_init @ref pktlib_CreateHeap
+ * @pre @ref netapi_init
*/
void netapi_poll_heapGarbage(NETAPI_T p);
/**
* @ingroup netapi_gen_functions
*/
void netapi_poll_heapGarbage(NETAPI_T p);
/**
* @ingroup netapi_gen_functions
- * @brief netapi_get_version: API used to get version of NetAPI
+ * @brief netapi_get_version API used to get version of NETAPI
*
*
- * @details This API used to get version of netapi
+ * @details This API used to get version of netapi
* @retval int version of netapi
* @pre @ref netapi_init
*/
* @retval int version of netapi
* @pre @ref netapi_init
*/
/**
* @ingroup netapi_gen_functions
/**
* @ingroup netapi_gen_functions
- * @brief netapi_get_version_string: API used to get version string of NetAPI
+ * @brief netapi_get_version_string API used to get version string of NETAPI
*
*
- * @details This API used to get version string of netapi
+ * @details This API used to get version string of netapi
* @retval char version string of netapi
* @pre @ref netapi_init
*/
* @retval char version string of netapi
* @pre @ref netapi_init
*/
index f8375f8c22c511febcef1b9231d4b981d8206a15..52f542e4b57d32077f15b74efa76fdbc7bda2314 100755 (executable)
-/***********************************
- * File: netapi_sched.h
- * Purpose: netapi scheduler module
- **************************************************************
- * FILE: netapi_sched.h
- *
- * DESCRIPTION: netapi sample event scheduler header file for
- * user space transport library
- *
- * REVISION HISTORY: rev 0.0.1
+/******************************************************************************
+ * FILE PURPOSE: Netapi scheduler module
+ ******************************************************************************
+ * FILE NAME: netapi_sched.h
+ *
+ * DESCRIPTION: Netapi sample event scheduler header file for user space transport library
+ *
+ * REVISION HISTORY:
*
* Copyright (c) Texas Instruments Incorporated 2010-2011
*
* Copyright (c) Texas Instruments Incorporated 2010-2011
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
* are met:
*
* are met:
*
- * Redistributions of source code must retain the above copyright
+ * 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.
*
* 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
+ * 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.
*
* 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
+ * 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
* 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
+ * 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
* 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
+ * 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.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ============================================================= */
+
+/**
+ * @file netapi_sched.h
+ * @brief netapi scheduler header file for user space transport library
+ */
+
- ***********************************/
#ifndef __NETAPI_SCHED__
#define __NETAPI_SCHED__
#include "netapi.h"
#ifndef __NETAPI_SCHED__
#define __NETAPI_SCHED__
#include "netapi.h"
-/****************************
- **********CONTEXT**********
- ****************************/
+/**
+ * @brief This define the handle to the NETAPI scheduling context TBD
+ */
struct NETAPI_SCHED_HANDLE_Tag;
struct NETAPI_SCHED_HANDLE_Tag;
+
+/**
+ * @ingroup netapi_cb_functions
+ * @brief NETAPI_SCHED_CB Callback function for scheduling context hous keeping. TBD
+ *
+ * @details The application provides a callback function that NETAPI scheduling context to retrieve TBD
+ * @param[in] h The handle to the NETAPI scheduling context
+ * @retval none
+ * @pre @ref netapi_init
+ */
typedef void (*NETAPI_SCHED_CB)(struct NETAPI_SCHED_HANDLE_Tag *h);
typedef void (*NETAPI_SCHED_CB)(struct NETAPI_SCHED_HANDLE_Tag *h);
+
+
+
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI scheduler configuration structure.
+ *
+ * @details Pointer to this strucutre is passed in the call to @ref netapi_schedOpen API
+ */
typedef struct NETAPI_SCHED_CONFIG_Tag
{
typedef struct NETAPI_SCHED_CONFIG_Tag
{
-int valid_flags; //which is being configured
+
+ int valid_flags; /**< This define valid flags options of scheduler context being configured */
+
+/**
+ * @def NETAPI_SCHED_DURATION
+ * This define duration option of scheduler context being configured.
+ */
#define NETAPI_SCHED_DURATION 0x1
#define NETAPI_SCHED_DURATION 0x1
+
+/**
+ * @def NETAPI_SCHED_POWER
+ * This define the Power option of scheduler context being configured. TBD
+ */
#define NETAPI_SCHED_POWER 0x2
#define NETAPI_SCHED_POWER 0x2
-#define NETAPI_SCHED_FINE 0x4 //future
-#define NETAPI_SCHED_CBV 0x8 //callback
-/*----duration------*/
-uint64_t duration; //0=forever or #tics to run for
+/**
+ * @def NETAPI_SCHED_FINE
+ * This define the fine tune option of scheduler context being configured. TBD
+ */
+#define NETAPI_SCHED_FINE 0x4
+
+/**
+ * @def NETAPI_SCHED_CBV
+ * This define the call back option of scheduler context being configured. TBD.
+ */
+#define NETAPI_SCHED_CBV 0x8
+
+/**
+ * @def NETAPI_SCHED_FOREVER
+ * This define is used to configure scheduler to run forever.
+ */
#define NETAPI_SCHED_FOREVER 0L
#define NETAPI_SCHED_FOREVER 0L
-/*-----house callback-----*/
-NETAPI_SCHED_CB house_cb;
+ uint64_t duration; /**< Duration scheduler is configured to run, 0 == forever,
+ * non-zero value is ticks for scheduler to run
+ */
-uint32_t interval; // how many poll loop intervals after which to call the house keeping function
+ NETAPI_SCHED_CB house_cb; /**< House keeping callback */
-/*------power control-------*/
-int power_control; //0= always on, >0 = duty cycle
-#define NETAPI_SCHED_POWER_ALWAYS_OFF 0 //drop to idle
-#define NETAPI_SCHED_POWER_ALWAYS_ON 100 //always runs, no drop to idle
+ uint32_t interval; /**< How many poll loop intervals after which to call the house keeping callback */
-int idle_time; //in ticks
-/*-----fine control-----*/
-//future..
+ int power_control; /**< 0 = always on, >0 = duty cycle TBD */
+/**
+ * @def NETAPI_SCHED_POWER_ALWAYS_OFF
+ * This define is used to configure scheduler power_control option to be always off TBD
+ */
+#define NETAPI_SCHED_POWER_ALWAYS_OFF 0
+
+/**
+ * @def NETAPI_SCHED_POWER_ALWAYS_ON
+ * This define is used to configure scheduler power_control option to be always on
+ */
+#define NETAPI_SCHED_POWER_ALWAYS_ON 100
+
+ int idle_time; /**< idle time TBD */
} NETAPI_SCHED_CONFIG_T;
} NETAPI_SCHED_CONFIG_T;
-/* the schedule context */
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI scheduler context handle.
+ *
+ * @details This structure is returned from call to @ref netapi_schedOpen API
+ */
typedef struct NETAPI_SCHED_HANDLE_Tag
{
typedef struct NETAPI_SCHED_HANDLE_Tag
{
- volatile int state; //0= shutdown, 1= shutting down, 2=active
-#define NETAPI_SCHED_STATE_SHUT 0
-#define NETAPI_SCHED_STATE_SHUTTING 1
-#define NETAPI_SCHED_STATE_ACTIVE 2
- void * back; //pointer back to netapi handle
- NETAPI_SCHED_CONFIG_T config;
- uint64_t start; /* start time */
- volatile int shutdown_reason;
- volatile uint64_t shutdown_time;
+ volatile int state; /**< 0= shutdown, 1= shutting down, 2=active */
+
+/**
+ * @def NETAPI_SCHED_STATE_CLOSE
+ * This define indicates the state of the scheduler to be CLOSE (idle) state TBD
+ */
+#define NETAPI_SCHED_STATE_CLOSE 0
+
+/**
+ * @def NETAPI_SCHED_STATE_CLOSE_IN_PROGRESS
+ * This define indicates the state of the scheduler is being shutdown state TBD
+ */
+#define NETAPI_SCHED_STATE_CLOSE_IN_PROGRESS 1
+
+/**
+ * @def NETAPI_SCHED_STATE_OPEN
+ * This define indicates the state of the scheduler is OPEN (running) TBD
+ */
+#define NETAPI_SCHED_STATE_OPEN 2
+
+ void * back; /**< Pointer back to NETAPI handle */
+ NETAPI_SCHED_CONFIG_T config; /**< NETAPI scheduler configuration */
+ uint64_t start; /**< Start time of NETAPI scheduler context TBD*/
+ volatile int shutdown_reason; /**< FUTURE-not implemented TBD */
+ volatile uint64_t shutdown_time; /**< Time till scheduler context will be shutdown/closed */
} NETAPI_SCHED_HANDLE_T;
} NETAPI_SCHED_HANDLE_T;
-/* how to shut down */
+
+
+
+/// @cond FUTURE
+/* return codes for wait_for_events() TBD, currently not used*/
+#define NETAPI_SCHED_RETURN_ERR 0 //unknown, err
+#define NETAPI_SCHED_RETURN_TO 1 // returned after timeout
+#define NETAPI_SCHED_RETURN_SHUTDOWN 2 //returned after shutdown
+/// @endcond
+
+
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI scheduler shutdown structure
+ * @details This structure is passed an an argument for @ref netapi_schedShutdown
+ */
typedef struct NETAPI_SCHED_SHUTDOWN_Tag
{
typedef struct NETAPI_SCHED_SHUTDOWN_Tag
{
-int shutdown_type;
+ int shutdown_type; /**< shutdown type */
+
+/**
+ * @def NETAPI_SCHED_SHUTDOWN_NOW
+ * This define is used to shudown the scheduling context immediately
+ */
#define NETAPI_SCHED_SHUTDOWN_NOW 0
#define NETAPI_SCHED_SHUTDOWN_NOW 0
+
+/**
+ * @def NETAPI_SCHED_SHUTDOWN_TO
+ * This define is used to shudown the scheduling context TBD
+ */
#define NETAPI_SCHED_SHUTDOWN_TO 1
#define NETAPI_SCHED_SHUTDOWN_TO 1
+
+/**
+ * @def NETAPI_SCHED_SHUTDOWN_NEXT_IDLE
+ * This define is used to shudown the scheduling context during next idle period
+ */
#define NETAPI_SCHED_SHUTDOWN_NEXT_IDLE 2
#define NETAPI_SCHED_SHUTDOWN_NEXT_IDLE 2
-int timeout; //ticks from now to close
+ int timeout; /**< Ticks from now to close the scheduling context */
} NETAPI_SCHED_SHUTDOWN_T;
} NETAPI_SCHED_SHUTDOWN_T;
-/****************************
- **************API **********
- ****************************/
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_schedOpen: API to open a scheduling context
+ *
+ * @details API to open a scheduling context
+ * @param[in] n the NETAPI handle, @ref NETAPI_T
+ * @param[in] p_config :pointer to @ref NETAPI_SCHED_CONFIG_T
+ * @param[out] p_err Pointer to error code.
+ * @retval Handle associated with created scheduler context, @ref NETAPI_SCHED_HANDLE_T
+ * @pre @ref netapi_init
+ */
+NETAPI_SCHED_HANDLE_T * netapi_schedOpen(NETAPI_T n,
+ NETAPI_SCHED_CONFIG_T * p_config,
+ int *p_err);
-/* open a scheduling contex */
-NETAPI_SCHED_HANDLE_T * netapi_schedOpen(NETAPI_T n, NETAPI_SCHED_CONFIG_T * p_config, int *p_err);
-/* re-configure a scheduling context */
-int netapi_schedControl(NETAPI_SCHED_HANDLE_T *s, NETAPI_SCHED_CONFIG_T *p_config, int *p_err);
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_schedControl: API to re-configure a scheduling context, FUTURE, not implemented
+ *
+ * @details API to re-configure a scheduling context
+ * @param[in] s The NETAPI scheduling context handle, @ref NETAPI_SCHED_HANDLE_T
+ * @param[in] p_config Pointer to @ref NETAPI_SCHED_CONFIG_T
+ * @param[out] p_err Pointer to error code.
+ * @retval Handle associated with created scheduler context, @ref NETAPI_SCHED_HANDLE_T
+ * @pre @ref netapi_schedOpen
+ */
+int netapi_schedControl(NETAPI_SCHED_HANDLE_T *s,
+ NETAPI_SCHED_CONFIG_T *p_config,
+ int *p_err);
-/* return codes for wait_for_events() */
-#define NETAPI_SCHED_RETURN_ERR 0 //unknown, err
-#define NETAPI_SCHED_RETURN_TO 1 // returned after timeout
-#define NETAPI_SCHED_RETURN_SHUTDOWN 2 //returned after shutdown
-/* main entry point. caller gives up control to scheduler */
-int netapi_schedWaitForEvents(NETAPI_SCHED_HANDLE_T *s, int * p_err);
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_schedWaitForEvents: API for main entry point to scheduler.
+ *
+ * @details API for main entry point to scheduler. User application gives up control to scheduler.
+ * @param[in] s The NETAPI scheduling context handle, @ref NETAPI_SCHED_HANDLE_T
+ * @param[out] p_err: error code, zero on sucess, non-zero on failure
+ * @retval TBD
+ * @pre @ref netapi_schedOpen
+ */
+int netapi_schedWaitForEvents(NETAPI_SCHED_HANDLE_T *s,
+ int * p_err);
-/* shutdown scheduler context */
-int netapi_schedShutdown(NETAPI_SCHED_HANDLE_T * s, NETAPI_SCHED_SHUTDOWN_T * p_close, int *p_err);
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_schedShutdown: API to shutdown scheduling context
+ *
+ * @details API to shutdown scheduling context
+ * @param[in] s The NETAPI scheduling context handle, @ref NETAPI_SCHED_HANDLE_T
+ * @param[in] p_close @ref NETAPI_SCHED_SHUTDOWN_T
+ * @param[out] p_err Pointer to error code.
+ * @retval TBD
+ * @pre @ref netapi_schedOpen
+ */
+int netapi_schedShutdown(NETAPI_SCHED_HANDLE_T * s,
+ NETAPI_SCHED_SHUTDOWN_T * p_close,
+ int *p_err);
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_schedShutdown: API to get the NETAPI handle from scheduling context
+ *
+ * @details API to get the NETAPI handle from scheduling context
+ * @param[in] s The NETAPI scheduling context handle, @ref NETAPI_SCHED_HANDLE_T
+ * @retval Handle to NETAPI instance
+ */
static NETAPI_T netapi_schedGetNetapiHandle(NETAPI_SCHED_HANDLE_T *s)
{ return (NETAPI_T)s->back;}
static NETAPI_T netapi_schedGetNetapiHandle(NETAPI_SCHED_HANDLE_T *s)
{ return (NETAPI_T)s->back;}
+
+
+
+
+/**
+ * @ingroup netapi_sched_functions
+ * @brief netapi_sched_get_stats: API to tget NETAP scheduling context statistics
+ *
+ * @details API to tget NETAP scheduling context statistics
+ * @param[in] p_pkts TBD
+ * @param[in] p_cycles TBD
+ * @param[in] p_ccycles TBD
+ * @retval none
+ */
void netapi_sched_get_stats(unsigned long long * p_pkts,
unsigned long long * p_cycles,
unsigned long long * p_ccycles);
void netapi_sched_get_stats(unsigned long long * p_pkts,
unsigned long long * p_cycles,
unsigned long long * p_ccycles);
index ac824ec9d8884c4ad0dfad1901a258863c92fb1a..68b8e07a68517239e5f8265c38b1b74e540e9c2e 100755 (executable)
*
* @details Pointer to this strucutre is passed in the call to netapi_getSaStats API.
*/
*
* @details Pointer to this strucutre is passed in the call to netapi_getSaStats API.
*/
-
-
typedef struct NETAPI_SA_STATS_Tag
{
typedef struct NETAPI_SA_STATS_Tag
{
-#define NETAPI_IPSEC_STAT_VALID 0x0001
-#define NETAPI_SIDEBAND_DATA_MODE_STAT_VALID 0x0002
- uint16_t validParams; /** < Bit map indicating the IPSec SA Inflow/Side band data mode stats validity */
+#define NETAPI_IPSEC_STAT_VALID 0x0001 /**< Indicates to user application that IPSEC stats are valid for INFLOW mode */
+#define NETAPI_SIDEBAND_DATA_MODE_STAT_VALID 0x0002 /**< Indicates to user application that IPSEC stats are valid for SIDEBAND mode */
+ uint16_t validParams; /**< Bit map indicating the IPSec SA Inflow/Side band data mode stats validity */
Sa_IpsecStats_t saIpsecStats; /**< Structure containing IPSEC stats in INFLOW MODE*/
Sa_IpsecStats_t saIpsecStats; /**< Structure containing IPSEC stats in INFLOW MODE*/
- Sa_DataModeStats_t dataModeStats; /**< Structure containing IPSEC stats in SIDEBAND MODE */
+ Sa_DataModeStats_t dataModeStats; /**< Structure containing IPSEC stats in SIDEBAND MODE */
} NETAPI_SA_STATS_T;
} NETAPI_SA_STATS_T;
typedef struct NETAPI_SEC_SA_INFO_tag
{
nwal_SaDir dir; /**< Direction for the channel. Inbound or Outbound */
typedef struct NETAPI_SEC_SA_INFO_tag
{
nwal_SaDir dir; /**< Direction for the channel. Inbound or Outbound */
- uint32_t spi; /**< IPSec Security Parameter index */
- nwal_IpSecProto proto; /**< IpSec Proto (ESP/AH) */
+ uint32_t spi; /**< IPSec Security Parameter index */
+ nwal_IpSecProto proto; /**< IpSec Proto (ESP/AH) */
nwal_saMode saMode; /**< Tunnel/ Transport mode */
nwal_saMode saMode; /**< Tunnel/ Transport mode */
- nwal_IpType ipType; /**< IPV4 or V6 */
+ nwal_IpType ipType; /**< IPV4 or V6 */
nwalIpAddr_t src; /**< Source IP Address (remote) */
nwalIpAddr_t src; /**< Source IP Address (remote) */
- nwalIpAddr_t dst; /**< DST IP Address (local) */
+ nwalIpAddr_t dst; /**< DST IP Address (local) */
uint32_t replayWindow; /**< Replay Window Size */
nwal_saAALG authMode; /**< Authentication Algorithm */
uint32_t replayWindow; /**< Replay Window Size */
nwal_saAALG authMode; /**< Authentication Algorithm */
- nwal_saEALG cipherMode; /**< Encryption Algorithm */
+ nwal_saEALG cipherMode; /**< Encryption Algorithm */
uint32_t esnLo; /**< Initial Value of Extended Sequence Number LSB */
uint32_t esnHi; /**< Initial Value of Extended Sequence Number MSB */
} NETAPI_SEC_SA_INFO_T;
uint32_t esnLo; /**< Initial Value of Extended Sequence Number LSB */
uint32_t esnHi; /**< Initial Value of Extended Sequence Number MSB */
} NETAPI_SEC_SA_INFO_T;
/**
* @brief This defines the SA mode of operation to be INFLOW
*/
/**
* @brief This defines the SA mode of operation to be INFLOW
*/
-#define NETAPI_SEC_SA_INFLOW 0x2
+#define NETAPI_SEC_SA_INFLOW 0x2
/**
* @brief This defines the SA mode of operation to be SIDEBAND
*/
/**
* @brief This defines the SA mode of operation to be SIDEBAND
*/
-#define NETAPI_SEC_SA_SIDEBAND 0x1
+#define NETAPI_SEC_SA_SIDEBAND 0x1
/**
* @ingroup netapi_cfg_sec_functions
/**
* @ingroup netapi_cfg_sec_functions
- * @brief netapi_secAddSA: API to configure an IPSEC SA.
- *
- * @details API to configure an IPSec SA. SAs are IPSec security contexts and define a uni-directional
- * secure path (tunnel or transport). SAs are attached to Mac interfaces that have already
- * been created. API allows SA to be configured as either inflow or sideband mode
- * @param[in] @ref NETAPI_T: the NETAPI handle
- * @param[in] iface_no:interface to attach SA to.
- * @param[in] sa_info: @ref NETAPI_SEC_SA_INFO_T: information on the SA being added
- * @param[in] key_params: @ref nwalSecKeyParams_t: security key information for the SA.
- * @param[in] mode: SA implementation mode @ref NETAPI_SEC_SA_SIDEBAND or @ref NETAPI_SEC_SA_INFLOW
- * @param[in] route: @ref NETCP_CFG_ROUTE_HANDLE_T
- * @param[in] data_mode_handle: returned data mode handle for PKTIO
- * @param[in] inflow_mode_handle: returned inflow mode handle for PKTIO
- * @param[out] perr: error codem, zero on sucess, non-zero on failure
- * @retval Aplication id associated with created SA, @ref NETCP_CFG_SA_T
- * @pre @ref netapi_init
+ * @brief netapi_secAddSA API to configure an IPSEC SA.
+ *
+ * @details API to configure an IPSec SA. SAs are IPSec security contexts and define a uni-directional
+ * secure path (tunnel or transport). SAs are attached to MAC interfaces that have already
+ * been created. API allows SA to be configured as either inflow or sideband mode
+ * @param[in] h The NETAPI handle, @ref NETAPI_T
+ * @param[in] iface_no Interface to attach SA to.
+ * @param[in] sa_info Information on the SA being added, @ref NETAPI_SEC_SA_INFO_T
+ * @param[in] key_params Security key information for the SA.
+ * @param[in] mode SA implementation mode @ref NETAPI_SEC_SA_SIDEBAND or @ref NETAPI_SEC_SA_INFLOW
+ * @param[in] route @ref NETCP_CFG_ROUTE_HANDLE_T
+ * @param[in] data_mode_handle Returned data mode handle for PKTIO
+ * @param[in] inflow_mode_handle Returned inflow mode handle for PKTIO
+ * @param[out] perr Pointer to error code.
+ * @retval Aplication id associated with created SA @ref NETCP_CFG_SA_T
+ * @pre @ref netapi_init
*/
NETCP_CFG_SA_T netapi_secAddSA(NETAPI_T h,
int iface_no,
*/
NETCP_CFG_SA_T netapi_secAddSA(NETAPI_T h,
int iface_no,
- NETAPI_SEC_SA_INFO_T *sa_info ,
+ NETAPI_SEC_SA_INFO_T *sa_info,
nwalSecKeyParams_t *key_params,
int mode,
NETCP_CFG_ROUTE_HANDLE_T route,
nwalSecKeyParams_t *key_params,
int mode,
NETCP_CFG_ROUTE_HANDLE_T route,
/**
* @ingroup netapi_cfg_sec_functions
/**
* @ingroup netapi_cfg_sec_functions
- * @brief netapi_secDelSA: API to delete an IPSEC SA.
+ * @brief netapi_secDelSA: API to delete an IPSEC SA.
*
*
- * @details API to delete an IPSEC SA
- * @param[in] h the NETAPI handle, @ref NETAPI_T
- * @param[in] iface_no:interface to attach SA to.
- * @param[in] sa_app_id: Application id returned from call to @ref netapi_secAddSA
- * @param[out] perr: zero on sucess, non-zero on failure
+ * @details API to delete an IPSEC SA
+ * @param[in] h The NETAPI handle, @ref NETAPI_T
+ * @param[in] iface_no Interface to attach SA to.
+ * @param[in] sa_app_id Application id returned from call to @ref netapi_secAddSA
+ * @param[out] perr Pointer to error code.
* @retval none
* @pre @ref netapi_init @ref netapi_secAddSA
*/
* @retval none
* @pre @ref netapi_init @ref netapi_secAddSA
*/
@@ -154,52 +152,53 @@ void netapi_secDelSA(NETAPI_T h,int iface_no, NETCP_CFG_SA_T sa_app_id, int *p
* @ingroup netapi_cfg_sec_functions
* @brief netapi_secAddRxPolicy: API to add a recieve security policy
*
* @ingroup netapi_cfg_sec_functions
* @brief netapi_secAddRxPolicy: API to add a recieve security policy
*
- * @details API to add a recieve security policy
- * @param[in] h the NETAPI handle, @ref NETAPI_T
- * @param[in] sa: Application id returned from call to @ref netapi_secAddSA
- * @param[in] ipType, @ref nwal_IpType
- * @param[in] src_ip_addr, @ref nwalIpAddr_t
- * @param[in] dst_ip_addr, @ref nwalIpAddr_t
- * @param[in] ip_qualifiers @ref nwalIpOpt_t
- * @param[in] route: optional route, @ref NETCP_CFG_ROUTE_HANDLE_T
- * @param[out] perr: zero on sucess, non-zero on failure
- * @retval Aplication id associated with created receive security policy , @ref NETCP_CFG_IPSEC_POLICY_T
+ * @details API to add a recieve security policy
+ * @param[in] h The NETAPI handle @ref NETAPI_T
+ * @param[in] sa Application id returned from call to @ref netapi_secAddSA
+ * @param[in] ipType IPV4 or IPV6
+ * @param[in] src_ip_addr
+ * @param[in] dst_ip_addr
+ * @param[in] ip_qualifiers
+ * @param[in] route Optional route @ref NETCP_CFG_ROUTE_HANDLE_T
+ * @param[out] perr Pointer to error code.
+ * @retval Aplication id associated with created receive security policy @ref NETCP_CFG_IPSEC_POLICY_T
* @pre @ref netapi_init @ref netapi_secAddSA
*/
* @pre @ref netapi_init @ref netapi_secAddSA
*/
-NETCP_CFG_IPSEC_POLICY_T netapi_secAddRxPolicy(NETAPI_T h, //the netapi handle
- NETCP_CFG_SA_T sa, //tunnel to attach to
- nwal_IpType ipType, //V4 or V6
- nwalIpAddr_t * src_ip_addr, //src (from where)
- nwalIpAddr_t * dst_ip_addr, //dst (us)
- nwalIpOpt_t * ip_qualifiers, //other qualifiers
- NETCP_CFG_ROUTE_HANDLE_T route, //Optional route
+NETCP_CFG_IPSEC_POLICY_T netapi_secAddRxPolicy(NETAPI_T h,
+ NETCP_CFG_SA_T sa,
+ nwal_IpType ipType,
+ nwalIpAddr_t * src_ip_addr,
+ nwalIpAddr_t * dst_ip_addr,
+ nwalIpOpt_t * ip_qualifiers,
+ NETCP_CFG_ROUTE_HANDLE_T route,
int * perr);
/**
* @ingroup netapi_cfg_sec_functions
* @brief netapi_secDelRxPolicy: API to add a recieve security policy
*
int * perr);
/**
* @ingroup netapi_cfg_sec_functions
* @brief netapi_secDelRxPolicy: API to add a recieve security policy
*
- * @details API to add a recieve security policy
- * @param[in] h the NETAPI handle, @ref NETAPI_T
- * @param[in] policy_app_id: Application id returned from call to @ref netapi_secAddRxPolicy
- * @param[out] perr: zero on sucess, non-zero on failure
+ * @details API to add a recieve security policy
+ * @param[in] h The NETAPI handle, @ref NETAPI_T
+ * @param[in] policy_app_id Application id returned from call to @ref netapi_secAddRxPolicy
+ * @param[out] perr Pointer to error code.
* @retval none
* @retval none
- * @pre @ref netapi_init @ref, @ref netapi_secAddRxPolicy
+ * @pre @ref netapi_init, @ref netapi_secAddRxPolicy
*/
void netapi_secDelRxPolicy(NETAPI_T h,
*/
void netapi_secDelRxPolicy(NETAPI_T h,
- NETCP_CFG_IPSEC_POLICY_T policy_app_id,
- int *perr);
+ NETCP_CFG_IPSEC_POLICY_T policy_app_id,
+ int *perr);
/**
* @ingroup netapi_cfg_sec_functions
* @brief netapi_getSaStats: API to retrieve SA statistics via NWAL.
*
/**
* @ingroup netapi_cfg_sec_functions
* @brief netapi_getSaStats: API to retrieve SA statistics via NWAL.
*
- * @details * API to retrieve SA statistics via NWAL.
- * @param[in] h the NETAPI handle, @ref NETAPI_T
- * @param[in] pSaStats: Pointer to NETAPI_SA_STATS_T which will get populated by this API call, @ref NETAPI_SA_STATS_T
+ * @details API to retrieve SA statistics via NWAL.
+ * @param[in] h The NETAPI handle, @ref NETAPI_T
+ * @param[in] handle @ref NETCP_CFG_SA_T
+ * @param[out] pSaStats Pointer to SA stats which will get populated by this API call @ref NETAPI_SA_STATS_T
* @retval none
* @retval none
- * @pre @ref netapi_init @ref, @ref netapi_secAddSA
+ * @pre @ref netapi_init, @ref netapi_secAddSA
*/
void netapi_getSaStats (NETAPI_T h,
NETCP_CFG_SA_T handle,
*/
void netapi_getSaStats (NETAPI_T h,
NETCP_CFG_SA_T handle,
index fd8113b92739fb0bb7663334617401bb99dccb02..0ac7322aa06e596a2e9228d1d9d2a54d414ce54c 100755 (executable)
/**
* @ingroup netapi_tune_parameters
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to enable securtiy. Note: libraries being use need to be built with SA enabled also
+ * @def NETAPI_ENABLE_SECURITY
+ * Define this to enable securtiy.
+ * @note Libraries using netapi need to be built with SA enabled
*/
#define NETAPI_ENABLE_SECURITY
/**
* @ingroup netapi_tune_parameters
*/
#define NETAPI_ENABLE_SECURITY
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to enable use of cached DDR for buffers and descriptors. Do not define if USE_MSMC defined below
+ * @def NETAPI_USE_DDR
+ * Define this to enable use of cached DDR for buffers and descriptors.
+ * @note Do not define if USE_MSMC defined below
*/
#define NETAPI_USE_DDR
*/
#define NETAPI_USE_DDR
+
+
#ifdef NETAPI_USE_DDR
#ifdef NETAPI_USE_DDR
+/**
+ * @ingroup netapi_tune_parameters
+ * @def NETAPI_TUNE_USE_CACHE_OPS
+ * Define this to enable use of cached DDR for buffers and descriptors.
+ * @note Do not define if USE_MSMC defined below
+*/
#define NETAPI_TUNE_USE_CACHE_OPS //for appleton, no cache coherency with netcp & ARM
#endif
/**
* @ingroup netapi_tune_parameters
#define NETAPI_TUNE_USE_CACHE_OPS //for appleton, no cache coherency with netcp & ARM
#endif
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to enable use of un-cached MSMC for buffers and descriptors . Do not define if USE_DDR defined above
+ * @def NETAPI_USE_MSMC
+ * Define this to enable use of un-cached MSMC for buffers and descriptors
+ * @note Do not define if USE_DDR defined above
*/
//#define NETAPI_USE_MSMC
*/
//#define NETAPI_USE_MSMC
/**
* @ingroup netapi_tune_parameters
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to the number of cores (theads)
+* @def TUNE_NETAPI_NUM_CORES
+* This defines the number of cores (theads)
*/
#define TUNE_NETAPI_NUM_CORES 1
/**
* @ingroup netapi_tune_parameters
*/
#define TUNE_NETAPI_NUM_CORES 1
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to how much contiguous memory to grab. This is used for
- * descriptors and buffers in the case of uncached configuration only.
- * descriptors and buffers. Can't be bigger than msmc if
- * MSMC memory is being using uncached . This can be set at netapi_init via NETAPI_CFG_T
+ * @def TUNE_NETAPI_PERM_MEM_SZ
+ * This defines how much contiguous memory to grab. This is used for
+ * descriptors and buffers in the case of uncached configuration only.
+ * descriptors and buffers. Can't be bigger than msmc if
+ * MSMC memory is being using uncached . This can be set at netapi_init via NETAPI_CFG_T
*/
#define TUNE_NETAPI_PERM_MEM_SZ (2*1024*1024)
/**
* @ingroup netapi_tune_parameters
*/
#define TUNE_NETAPI_PERM_MEM_SZ (2*1024*1024)
/**
* @ingroup netapi_tune_parameters
- * @brief Define this to how many GLOBAL pkt io channels
+ * @def TUNE_NETAPI_MAX_PKTIO
+ * This defines the number of GLOBAL pkt io channels
*/
#define TUNE_NETAPI_MAX_PKTIO 16
/**
* @ingroup netapi_tune_parameters
*/
#define TUNE_NETAPI_MAX_PKTIO 16
/**
* @ingroup netapi_tune_parameters
- * @brief Define this to the size of netapi default pktlib heap buffers This can be set at @ref netapi_init
+ * @def TUNE_NETAPI_DEFAULT_BUFFER_SIZE
+ * This defines the size of the netapi default pktlib heap buffers This can be set at @ref netapi_init
*/
#define TUNE_NETAPI_DEFAULT_BUFFER_SIZE 1600
*/
#define TUNE_NETAPI_DEFAULT_BUFFER_SIZE 1600
-
/**
* @ingroup netapi_tune_parameters
/**
* @ingroup netapi_tune_parameters
- * @brief Define this to number of netapi default pktlib heap buffers (and assoc descriptors)
- * this can be set at @ref netapi_init
+ * @def TUNE_NETAPI_DEFAULT_NUM_BUFFERS
+ * This defines the number of netapi default pktlib heap buffers (and assoc descriptors)
+ * this can be set at @ref netapi_init
*/
#define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200
/**
* @ingroup netapi_tune_parameters
*/
#define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200
/**
* @ingroup netapi_tune_parameters
- * @brief Define this to number of netapi default pkt lib heap solo descriptors
- * this can be set at @ref netapi_init
+ * @def TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS
+ * This defines the number of netapi default pkt lib heap solo descriptors
+ * this can be set at @ref netapi_init
*/
#define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS 100
/**
* @ingroup netapi_tune_parameters
*/
#define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS 100
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to include the scheduler component
+ * @def NETAPI_INCLUDE_SCHED
+ * Define this to include the scheduler component
*/
#define NETAPI_INCLUDE_SCHED
/**
* @ingroup netapi_tune_parameters
*/
#define NETAPI_INCLUDE_SCHED
/**
* @ingroup netapi_tune_parameters
-* @brief Define this to the number of of QM descriptors (total). This can be set set in @ref netapi_init
-* @note MUST BE POWER OF 2
+ * @def TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM
+ * This defines the number of of QM descriptors (total). This can be set set in @ref netapi_init
+ * @note Must be a power or 2
*/
#define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM 2048 /* 16384 is abs max */
*/
#define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM 2048 /* 16384 is abs max */
-//(8) Region info
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_NUM_LOCAL_DESC
+ * This defines the number of of QM descriptors (total). This can be set set in @ref netapi_init
+*/
#define TUNE_NETAPI_NUM_LOCAL_DESC 64
#define TUNE_NETAPI_NUM_LOCAL_DESC 64
-/* at least as big as DEFAULT_NUM_SOLO+DEFAULT_NUM_BUFFERS but also a power of 2*/
-#define TUNE_NETAPI_NUM_GLOBAL_DESC 1024
-#define TUNE_NETAPI_DESC_SIZE 128 //don't change!!
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_NUM_GLOBAL_DESC
+ * This defines the number of global descriptors.
+ * @note Must be a power or 2
+*/
+#define TUNE_NETAPI_NUM_GLOBAL_DESC 1024
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_DESC_SIZE
+ * This defines the descriptor size
+ * @note This define should NOT be changes
+ */
+#define TUNE_NETAPI_DESC_SIZE 128
+
#ifdef NETAPI_USE_DDR
#ifdef NETAPI_USE_DDR
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_QM_START_INDEX
+ * This defines the queue manager start index
+ * @note This must reflect what the kernel is uding for their region, see device tree blob for details.
+ */
#define TUNE_NETAPI_QM_START_INDEX 0x2000 //WARNING: must reflect what kernel is using for their region, see device tree blob
#define TUNE_NETAPI_QM_START_INDEX 0x2000 //WARNING: must reflect what kernel is using for their region, see device tree blob
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_QM_GLOBAL_REGION
+ * This defines the queue manager global region
+ * @note This must reflect what the kernel is uding for their region, see device tree blob for details.
+ */
#define TUNE_NETAPI_QM_GLOBAL_REGION 18 //WARNING: must reflect what kernel is using for their region, see device tree blob
#define TUNE_NETAPI_QM_GLOBAL_REGION 18 //WARNING: must reflect what kernel is using for their region, see device tree blob
+
#else //use msmc..
#else //use msmc..
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_QM_START_INDEX
+ * This defines the queue manager start index
+ * @note This must reflect what the kernel is uding for their region, see device tree blob for details.
+ */
#define TUNE_NETAPI_QM_START_INDEX 0 //ok to use 0 since kernel is somewhere higher
#define TUNE_NETAPI_QM_START_INDEX 0 //ok to use 0 since kernel is somewhere higher
-#define TUNE_NETAPI_QM_GLOBAL_REGION 0 //ok to to use 0 since msmc addr < ddr addr
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_QM_GLOBAL_REGION
+ * This defines the queue manager global region
+ * @note This must reflect what the kernel is uding for their region, see device tree blob for details.
+ */
+#define 0 //ok to to use 0 since msmc addr < ddr addr
+
#endif
#endif
-//(9) Define to 1 for DEBUG MODE [where NETCP just loops pkts that tx back to rx]
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK
+ * Define this to 1 for debutg mode where NETCP just loops pkts that tx back to rx
+ */
#define TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK 0 /*1*/
#define TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK 0 /*1*/
+/// @cond INTERNAL
//(10) NWAL (internal) config. Should not have to change
#define TUNE_NETAPI_CONFIG_MAX_PA_TO_SA_DESC 32
#define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC 32
//(10) NWAL (internal) config. Should not have to change
#define TUNE_NETAPI_CONFIG_MAX_PA_TO_SA_DESC 32
#define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC 32
+/// @endcond
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_MAC
+ * This defines the number of logical mac addresses
+ */
+#define TUNE_NETAPI_MAX_NUM_MAC 2
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_IP
+ * This defines the number of ip addresses
+ */
+#define TUNE_NETAPI_MAX_NUM_IP 32
-#define TUNE_NETAPI_MAX_NUM_MAC 2 //2 'logical' mac addresses
-#define TUNE_NETAPI_MAX_NUM_IP 32 //2 ip addresses
-#define TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE 4 //udp/tcp ports -> for lUT2 )
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE
+ * This defines the number of ports per core
+ */
+#define TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE 4
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_PORTS
+ * This defines the number maximum number of ports
+ */
#define TUNE_NETAPI_MAX_NUM_PORTS (TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE * (TUNE_NETAPI_NUM_CORES))
#ifdef NETAPI_ENABLE_SECURITY
#define TUNE_NETAPI_MAX_NUM_PORTS (TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE * (TUNE_NETAPI_NUM_CORES))
#ifdef NETAPI_ENABLE_SECURITY
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS
+ * This defines the number maximum number of ipsec channels
+ */
#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 32
#else
#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 32
#else
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS
+ * This defines the number maximum number of ipsec channels
+ */
#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0
#endif
#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0
#endif
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_L2_L3_HDRS
+ * This defines the number maximum number of L2_L3 headers TBD
+ */
#define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 3
#define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 3
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_NUM_TRANS
+ * This defines the number maximum number of trans TBD
+ */
#define TUNE_NETAPI_MAX_NUM_TRANS (TUNE_NETAPI_MAX_NUM_MAC + TUNE_NETAPI_MAX_NUM_IP + TUNE_NETAPI_MAX_NUM_PORTS + TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS)
#define TUNE_NETAPI_MAX_NUM_TRANS (TUNE_NETAPI_MAX_NUM_MAC + TUNE_NETAPI_MAX_NUM_IP + TUNE_NETAPI_MAX_NUM_PORTS + TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS)
-//(11) PA control buffer pool (internal)
+
+/// @cond INTERNAL
+/* PA control buffer pool (internal) */
#define TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE 384
#define TUNE_NETAPI_CONFIG_NUM_CTL_RX_BUF 16
#define TUNE_NETAPI_CONFIG_NUM_CTL_TX_BUF 16
#define TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE 384
#define TUNE_NETAPI_CONFIG_NUM_CTL_RX_BUF 16
#define TUNE_NETAPI_CONFIG_NUM_CTL_TX_BUF 16
+/// @endcond
-//(12) PKTIO RECV BURST SIZE
-#define TUNE_NETAPI_MAX_BURST_RCV 32 //max #ok pkts to recv in one poll
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_BURST_RCV
+ * This defines the maximum number of packets to receive in one pktio poll.
+ */
+#define TUNE_NETAPI_MAX_BURST_RCV 32
-//(13) netcp interfaces
-#define TUNE_NETAPI_MAX_IP 4 //4 ip's can be attached to interfaces
-#define TUNE_NETAPI_MAX_INTERFACES 2 //2 interfaces
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_IP
+ * This defines the maximum number of IP's that can be attached to MAC interfaces.
+ */
+#define TUNE_NETAPI_MAX_IP 4
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_INTERFACES
+ * This defines the maximum number of MAX interfaces */
+#define TUNE_NETAPI_MAX_INTERFACES 2
-//(14) timers
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_NUM_TIMER_CELLS
+ * This defines the number of hash bins in a timer group.
+ */
#define TUNE_NETAPI_NUM_TIMER_CELLS 128 //# of hash bins in a timer group
#define TUNE_NETAPI_NUM_TIMER_CELLS 128 //# of hash bins in a timer group
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_NUM_GLOBAL_TIMERS
+ * This defines the number of global timer blocks
+ */
#define TUNE_NETAPI_NUM_GLOBAL_TIMERS 4 //# global timer blocks
#define TUNE_NETAPI_NUM_GLOBAL_TIMERS 4 //# global timer blocks
-//(15) heaps
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_HEAPS
+ * This defines the maximum number of heaps
+ */
#define TUNE_NETAPI_MAX_HEAPS 4 //max # of heaps one instance can create
#define TUNE_NETAPI_MAX_HEAPS 4 //max # of heaps one instance can create
-//(16) classifiers
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_CLASSIFIERS
+ * This defines the maximum number of classifiers
+ */
#define TUNE_NETAPI_MAX_CLASSIFIERS 16
#define TUNE_NETAPI_MAX_CLASSIFIERS 16
-//(17) FLows
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_BUF_POOLS_IN_FLOW
+ * This defines the maximum number of buffer pools in flow -TBD
+ * @note This define should NOT be changes
+ */
#define TUNE_NETAPI_MAX_BUF_POOLS_IN_FLOW 4 //!!do not change!!
#define TUNE_NETAPI_MAX_BUF_POOLS_IN_FLOW 4 //!!do not change!!
+
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_FLOWS
+ * This defines the maximum number of flows
+ */
#define TUNE_NETAPI_MAX_FLOWS 4 //app defined flows
#define TUNE_NETAPI_MAX_FLOWS 4 //app defined flows
-//(18) SAs & RX policies
+/**
+ * @ingroup netapi_tune_parameters
+* @def TUNE_NETAPI_MAX_SA
+* This defines the maximum number of security associations
+*/
#define TUNE_NETAPI_MAX_SA 8 //rx&tx combined (so MAX_SA/4 tunnels typically)
#define TUNE_NETAPI_MAX_SA 8 //rx&tx combined (so MAX_SA/4 tunnels typically)
+
+/**
+ * @ingroup netapi_tune_parameters
+ * @def TUNE_NETAPI_MAX_POLICY
+ * This defines the maximum number of security policies.
+*/
#define TUNE_NETAPI_MAX_POLICY 8 //rx policies
#endif
#define TUNE_NETAPI_MAX_POLICY 8 //rx policies
#endif
old mode 100644 (file)
new mode 100755 (executable)
new mode 100755 (executable)
index 4df07fc41dad8dc8ea84a8f0198844beae62bac6..8a61e16967db74b6b6290c1211e99b1afac73bb7 100755 (executable)
#include "ti/drv/pa/pa.h"
#include "ti/runtime/pktlib/pktlib.h"
#include "ti/drv/pa/pa.h"
#include "ti/runtime/pktlib/pktlib.h"
-//NETCP FLOW
+
/**
* @ingroup netapi_structures
* @brief CPPI flow ID for default case, use NETCP_DEFAULT_FLOW
/**
* @ingroup netapi_structures
* @brief CPPI flow ID for default case, use NETCP_DEFAULT_FLOW
/**
* @ingroup netapi_constants
/**
* @ingroup netapi_constants
- * @brief This defines the NETCP default FLOW to be NULL.
+ * @def NETCP_DEFAULT_FLOW
+ * This defines the NETCP default FLOW to be NULL.
*/
#define NETCP_DEFAULT_FLOW (NETCP_CFG_FLOW_HANDLE_T*) NULL
*/
#define NETCP_DEFAULT_FLOW (NETCP_CFG_FLOW_HANDLE_T*) NULL
typedef void * NETCP_CFG_ROUTE_HANDLE_T;
/**
typedef void * NETCP_CFG_ROUTE_HANDLE_T;
/**
- * @brief This defines the NETCP default ROUTE to be NULL.
+ * @def NETCP_DEFAULT_ROUTE
+ * This defines the NETCP default ROUTE to be NULL.
*/
#define NETCP_DEFAULT_ROUTE (NETCP_CFG_ROUTE_HANDLE_T*) NULL
*/
#define NETCP_DEFAULT_ROUTE (NETCP_CFG_ROUTE_HANDLE_T*) NULL
/**
* @ingroup netapi_constants
/**
* @ingroup netapi_constants
- * @brief This defines the NETCP action to discard packet.
+ * @def NETCP_CFG_ACTION_DISCARD
+ * This defines the NETCP action to discard packet.
*/
#define NETCP_CFG_ACTION_DISCARD 0
/**
* @ingroup netapi_constants
*/
#define NETCP_CFG_ACTION_DISCARD 0
/**
* @ingroup netapi_constants
- * @brief This defines the NETCP action to pass packet ono the next classifier
+ * @def NETCP_CFG_ACTION_CONTINUE
+ * This defines the NETCP action to pass packet ono the next classifier
*/
#define NETCP_CFG_ACTION_CONTINUE 1
/**
* @ingroup netapi_constants
*/
#define NETCP_CFG_ACTION_CONTINUE 1
/**
* @ingroup netapi_constants
- * @brief This defines the NETCP action to pass packet to User space application
+ * @def NETCP_CFG_ACTION_TO_SW
+ * This defines the NETCP action to pass packet to User space application
*/
#define NETCP_CFG_ACTION_TO_SW 2
*/
#define NETCP_CFG_ACTION_TO_SW 2
/**
* @ingroup nwal_api_constants
/**
* @ingroup nwal_api_constants
- * @brief This define is to be used in AddIp, AddClassifier to indicate any MAC address.
+ * @def NETCP_CFG_NO_INTERFACE
+ * This define is to be used in AddIp, AddClassifier to indicate any MAC address.
*/
#define NETCP_CFG_NO_INTERFACE 0xff
*/
#define NETCP_CFG_NO_INTERFACE 0xff
/**
* @ingroup netapi_constants
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that apacket matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID.
- * Packet did not match any other rule
+ * @def NETAPI_NETCP_MATCH_GENERIC_MAC
+ * This define is used to indicate that apacket matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID.
+ * Packet did not match any other rule
*/
#define NETAPI_NETCP_MATCH_GENERIC_MAC 0x10000000 //lower byte==interface
/**
* @ingroup netapi_constants
*/
#define NETAPI_NETCP_MATCH_GENERIC_MAC 0x10000000 //lower byte==interface
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
- * packet matched a generic IP rule attached to that interface. The IP rule # for the interface
- * is given in Bytes 3,2 of the APPID. Packet did not match any other rule
+ * @def NETAPI_NETCP_MATCH_GENERIC_IP
+ * This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a generic IP rule attached to that interface. The IP rule # for the interface
+ * is given in Bytes 3,2 of the APPID. Packet did not match any other rule
*/
#define NETAPI_NETCP_MATCH_GENERIC_IP 0x20000000 //lower byte==interface
/**
* @ingroup netapi_constants
*/
#define NETAPI_NETCP_MATCH_GENERIC_IP 0x20000000 //lower byte==interface
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
- * packet matched a generic IP rule attached to that interface OR a general IP rule added as part of
- * the classifier or it matched a combination of ISPEC SA rule and a policy check. Finally,
- * Packet matched a L4 port rule that was added as part of a classifer. Bytes 3-2
- * give the ID of the classifier . Packet did not match any other rule
+ * @def NETAPI_NETCP_MATCH_CLASS
+ * This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a generic IP rule attached to that interface OR a general IP rule added as part of
+ * the classifier or it matched a combination of ISPEC SA rule and a policy check. Finally,
+ * Packet matched a L4 port rule that was added as part of a classifer. Bytes 3-2
+ * give the ID of the classifier . Packet did not match any other rule
*/
#define NETAPI_NETCP_MATCH_CLASS 0x80000000 //FULL MATCH or' in classifier (16 bits), lower byte==interface
/**
* @ingroup netapi_constants
*/
#define NETAPI_NETCP_MATCH_CLASS 0x80000000 //FULL MATCH or' in classifier (16 bits), lower byte==interface
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
- * packet matched a general IP rule added as part of a classifier. But it not match a
- * L4 port or any other rule. We cannout say what classifer partially matched so Bytes 3-2 are
- * not applicable
+ * @def NETAPI_NETCP_MATCH_CLASS_L3
+ * This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a general IP rule added as part of a classifier. But it not match a
+ * L4 port or any other rule. We cannout say what classifer partially matched so Bytes 3-2 are
+ * not applicable
*/
#define NETAPI_NETCP_MATCH_CLASS_L3 0x40000000 //MATCHED L3 but not L4. lower byte==interface
/**
* @ingroup netapi_constants
*/
#define NETAPI_NETCP_MATCH_CLASS_L3 0x40000000 //MATCHED L3 but not L4. lower byte==interface
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
- * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). The SA id is in
- * bytes 3-2 of APPID. Packet did not match any other rule (so may have failed a policy check)
+ * @def NETAPI_NETCP_MATCH_IPSEC
+ * This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). The SA id is in
+ * bytes 3-2 of APPID. Packet did not match any other rule (so may have failed a policy check)
*/
#define NETAPI_NETCP_MATCH_IPSEC 0x01000000 //lower byte==interface, Or' in SA id (16 bits)
/**
* @ingroup netapi_constants
*/
#define NETAPI_NETCP_MATCH_IPSEC 0x01000000 //lower byte==interface, Or' in SA id (16 bits)
/**
* @ingroup netapi_constants
- * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
- * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). Packet matched
- * a POLICY RULE - this is a check of the inner IP. The IPSEC RX Policy ID is in
- * bytes 3-2 of APPID. Packet did not match any other rule
+ * @def NETAPI_NETCP_MATCH_IPSEC_POLICY
+ * This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). Packet matched
+ * a POLICY RULE - this is a check of the inner IP. The IPSEC RX Policy ID is in
+ * bytes 3-2 of APPID. Packet did not match any other rule
*/
#define NETAPI_NETCP_MATCH_IPSEC_POLICY 0x02000000 //lower byte==interface, Or' in SA id (16 bits)
*/
#define NETAPI_NETCP_MATCH_IPSEC_POLICY 0x02000000 //lower byte==interface, Or' in SA id (16 bits)
* @details This api is used to add a flow
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] n number of Pktlib_HeapHandle
* @details This api is used to add a flow
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] n number of Pktlib_HeapHandle
- * @param[in] handles[] handles to Pktlib_HeapHandle
- * @param[in] sizes[] must be<= heap corresponding heap size-recv_offset-any desired tail room
+ * @param[in] handles[] Handles to Pktlib_HeapHandle
+ * @param[in] sizes[] must be <= heap corresponding heap size-recv_offset-any desired tail room
* @param[in] recv_offset bytes to save in front of packet
* @param[out] err pointer to error return
* @retval NETCP flow handle, @ref NETCP_CFG_FLOW_HANDLE_T
* @param[in] recv_offset bytes to save in front of packet
* @param[out] err pointer to error return
* @retval NETCP flow handle, @ref NETCP_CFG_FLOW_HANDLE_T
* @param[in] iface_no interface number (0,1,..)
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @param[in] iface_no interface number (0,1,..)
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
- * @pre @ref netapi_init , @ref netcp_cfgAddMac
+ * @pre @ref netapi_init , @ref netcp_cfgCreateMacInterface
*/
void netcp_cfgDelMac(NETAPI_T h,int iface_no, int *err);
*/
void netcp_cfgDelMac(NETAPI_T h,int iface_no, int *err);
* Note: An IP address must be attached to enable NETCP receive Checksum offload feature
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] iface_no interface number (0,1,..)
* Note: An IP address must be attached to enable NETCP receive Checksum offload feature
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] iface_no interface number (0,1,..)
- * @param[in] ipType type of IP address (V4 for V6), @ref nwal_IpType
- * @param[in] ip_addr ip_address, @ref nwalIpAddr_t
+ * @param[in] ipType type of IP address (V4 for V6)
+ * @param[in] ip_addr ip_address
* @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
* @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
- * diffserv category for example. @ref nwalIpOpt_t
+ * diffserv category for example.
* @param[in] route [future] handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @param[in] route [future] handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
- * @pre @ref netapi_init , @ref netcp_cfgAddMac
+ * @pre @ref netapi_init
*/
NETCP_CFG_IP_T netcp_cfgAddIp(
NETAPI_T h,
*/
NETCP_CFG_IP_T netcp_cfgAddIp(
NETAPI_T h,
int * err
);
int * err
);
-#define netcp_addIp netcp_cfgAddIp //oops
-
/**
* @ingroup netapi_cfg_functions
* @brief netcp_cfgDelIp API to delete IP interface
/**
* @ingroup netapi_cfg_functions
* @brief netcp_cfgDelIp API to delete IP interface
* @details This api is used to delete an IP interface
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] iface_no interface number (0,1,..)
* @details This api is used to delete an IP interface
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] iface_no interface number (0,1,..)
- * @param[in] ipType type of IP address (V4 for V6), @ref nwal_IpType
- * @param[in] ip_addr ip_address, @ref nwalIpAddr_t
+ * @param[in] ipType type of IP address (V4 for V6)
+ * @param[in] ip_addr ip_address
* @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
* @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
- * diffserv category for example. @ref nwalIpOpt_t
+ * diffserv category for example.
* @param[in] ip_rule_id @ref NETCP_CFG_IP_T
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @param[in] ip_rule_id @ref NETCP_CFG_IP_T
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @param[in] vlan [future[ vlan configuration . Set to NULL, @ref NETCP_CFG_VLAN_T
* @param[in] state [future] interface state (0=down, 1= up)
* @param[out] err pointer to error return
* @param[in] vlan [future[ vlan configuration . Set to NULL, @ref NETCP_CFG_VLAN_T
* @param[in] state [future] interface state (0=down, 1= up)
* @param[out] err pointer to error return
- * @retval returns AppID for interface (this is returned in meta data for received packets matching this rule an no others) @ref @ref NETCP_CFG_MACIF_T
+ * @retval returns AppID for interface (this is returned in meta data for received packets matching this rule an no others, @ref NETCP_CFG_MACIF_T
* @pre @ref netapi_init
*/
NETCP_CFG_MACIF_T netcp_cfgCreateMacInterface(
* @pre @ref netapi_init
*/
NETCP_CFG_MACIF_T netcp_cfgCreateMacInterface(
- NETAPI_T h,
- uint8_t *p_mac,
- int iface_no,
- int switch_port,
- NETCP_CFG_ROUTE_HANDLE_T route,
- NETCP_CFG_VLAN_T vlan,
- int state,
- int * err
- );
+ NETAPI_T h,
+ uint8_t *p_mac,
+ int iface_no,
+ int switch_port,
+ NETCP_CFG_ROUTE_HANDLE_T route,
+ NETCP_CFG_VLAN_T vlan,
+ int state,
+ int * err
+);
/**
/**
typedef uint32_t NETCP_CFG_CLASS_T;
typedef uint32_t NETCP_CFG_CLASS_T;
-
-//classifier L4 type (L2,L3 implied by iface, ip)
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI Class L4 Configuration
+ *
+ * @details This structure contains Class L4 Configuration. L2,L3 implied by iface, ip
+ */
typedef struct NETCP_CFG_CLASS_L4_Tag
{
typedef struct NETCP_CFG_CLASS_L4_Tag
{
- //which mac interface pkt is from,
- int iface;
- NETCP_CFG_IP_T ip;
-
- //L4 (port)
- nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
- nwalAppProto_t appProto; //ports or equivalent
+ int iface; /**< Indicates which MAC interface packet is from */
+ NETCP_CFG_IP_T ip; /**< @ref NETCP_CFG_IP_T */
+ nwal_appProtoType_t proto; /**< L4 proto (-1 for don't care)*/
+ nwalAppProto_t appProto; /**< Ports or equivalent */
} NETCP_CFG_CLASS_L4_T;
} NETCP_CFG_CLASS_L4_T;
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI Classifier L4 plus IPSEC policy configuration
+ *
+ * @details This structure contains Class L4 plus IPSEC policy configuration. L2,L3 implied by iface, ip
+ */
//classifier L4 + policy (L2, L3 (outer), tunnel, L3 (inner) implied by policy
typedef struct NETCP_CFG_CLASS_L4_IPSEC_Tag
{
//classifier L4 + policy (L2, L3 (outer), tunnel, L3 (inner) implied by policy
typedef struct NETCP_CFG_CLASS_L4_IPSEC_Tag
{
- //which mac interface pkt is from,
- int iface;
- NETCP_CFG_IPSEC_POLICY_T ip_policy;
-
- //L4 (port)
- nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
- nwalAppProto_t appProto; //ports or equivalent
+ int iface; /**< Indicates which MAC interface packet is from */
+ NETCP_CFG_IPSEC_POLICY_T ip_policy; /**< IPSEC policy configuration */
+ nwal_appProtoType_t proto; /**< L4 proto (-1 for don't care)*/
+ nwalAppProto_t appProto; /**< Ports or equivalent */
} NETCP_CFG_CLASS_L4_IPSEC_T;
} NETCP_CFG_CLASS_L4_IPSEC_T;
-//classifier L3_L4 type (L2 implied by iface)
+
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI Classifier L4/L3 configuration
+ *
+ * @details This structure contains Class L4 and Class L3 configuration. L2 implied by iface
+ */
typedef struct NETCP_CFG_CLASS_L3_L4_Tag
{
typedef struct NETCP_CFG_CLASS_L3_L4_Tag
{
- //which mac interface pkt is from,
- int iface;
-
- //L3 - iP address: IP type, destination addr, qualifiers
- nwal_IpType ipType;
- nwalIpAddr_t * ip_addr;
- nwalIpOpt_t * ip_qualifiers;
- NETCP_CFG_ROUTE_HANDLE_T p_fail_route; //what to do if L3 matches but L4 fails AND L3 is a
- // new rule.(if exisitng rule, then existing fail
- //route will be used.
-
- //L4 (port)
- nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
- nwalAppProto_t appProto; //ports or equivalent
-
+ int iface; /**< Indicates which MAC interface packet is from */
+ nwal_IpType ipType; /**< IP address type, IPV4 or IPV6 */
+ nwalIpAddr_t * ip_addr; /**< IP addres */
+ nwalIpOpt_t * ip_qualifiers;/**< IP address qualifiers */
+ NETCP_CFG_ROUTE_HANDLE_T p_fail_route; /**< What to do if L3 matches but L4 fails AND L3 is a
+ * new rule.(if exisitng rule, then existing fail
+ *route will be used. */
+ nwal_appProtoType_t proto; /**< L4 proto (-1 for don't care)*/
+ nwalAppProto_t appProto; /**< Ports or equivalent */
} NETCP_CFG_CLASS_L3_L4_T;
} NETCP_CFG_CLASS_L3_L4_T;
-//classifier
+/**
+ * @ingroup netapi_structures
+ * @brief NETAPI Classifier configuration
+ *
+ * @details This structure contains the NETAPI classifer configuration
+ */
typedef struct NETCP_CFG_CLASSIFIER_Tag
{
typedef struct NETCP_CFG_CLASSIFIER_Tag
{
- int classType;
+ int classType; /**< Classifier type */
+/**
+ * @def NETCP_CFG_CLASS_TYPE_L4
+ * This defines classifier type to be Class L4
+ */
#define NETCP_CFG_CLASS_TYPE_L4 0
#define NETCP_CFG_CLASS_TYPE_L4 0
-#define NETCP_CFG_CLASS_TYPE_L3_L4 1
- union
- {
- NETCP_CFG_CLASS_L3_L4_T c_l3_l4;
- NETCP_CFG_CLASS_L4_T c_l4;
- NETCP_CFG_CLASS_L4_IPSEC_T c_l4_ipsec;
- } u;
+/**
+ * @def NETCP_CFG_CLASS_TYPE_L3_L4
+ * This defines classifier type to be Class L4 and L3
+ */
+#define NETCP_CFG_CLASS_TYPE_L3_L4 1
+ union
+ {
+ NETCP_CFG_CLASS_L3_L4_T c_l3_l4; /**< @ref NETCP_CFG_CLASS_L3_L4_T */
+ NETCP_CFG_CLASS_L4_T c_l4; /**< @ref NETCP_CFG_CLASS_L4_T */
+ NETCP_CFG_CLASS_L4_IPSEC_T c_l4_ipsec; /**< @ref NETCP_CFG_CLASS_L4_IPSEC_T */
+ } u; /**< union for classifier type configuration structure */
} NETCP_CFG_CLASSIFIER_T;
} NETCP_CFG_CLASSIFIER_T;
* pktLib heap, and/or have NetCP attach a tag (classifier id) to the incoming packet.
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] p_class
* pktLib heap, and/or have NetCP attach a tag (classifier id) to the incoming packet.
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[in] p_class
- * @param[in] p_route
+ * @param[in] p_route
+ * @param[in] action
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @pre @ref netapi_init
*/NETCP_CFG_CLASS_T netcp_cfgAddClass(NETAPI_T h,
NETCP_CFG_CLASSIFIER_T *p_class,
NETCP_CFG_ROUTE_HANDLE_T p_route,
* @param[out] err pointer to error return
* @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
* @pre @ref netapi_init
*/NETCP_CFG_CLASS_T netcp_cfgAddClass(NETAPI_T h,
NETCP_CFG_CLASSIFIER_T *p_class,
NETCP_CFG_ROUTE_HANDLE_T p_route,
- int action, int * err);
+ int action,
+ int * err);
* @pre @ref netapi_init, @ref netcp_cfgAddClass
*/
void netcp_cfgDelClass(NETAPI_T h,
* @pre @ref netapi_init, @ref netcp_cfgAddClass
*/
void netcp_cfgDelClass(NETAPI_T h,
- NETCP_CFG_CLASS_T classId,
- int *err);
-
+ NETCP_CFG_CLASS_T classId,
+ int *err);
/**
/**
* @details The application provides a callback function that NETAPI uses to report statistics.
* The request for stats is generated from the @ref netcp_cfgReqStats API.
* Note: to receive ths stats callback, the @ref netapi_netcpPoll funcition must be called
* @details The application provides a callback function that NETAPI uses to report statistics.
* The request for stats is generated from the @ref netcp_cfgReqStats API.
* Note: to receive ths stats callback, the @ref netapi_netcpPoll funcition must be called
- * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
* @param[out] pPaStats the PA (NETCP packet accelerator subsystem) statistics block
* @retval none
* @param[out] pPaStats the PA (NETCP packet accelerator subsystem) statistics block
* @retval none
- * @pre @ref netapi_init , @ref netapi_cfgReqStats, @ref netapi_netcpPoll
+ * @pre @ref netapi_init , @ref netcp_cfgReqStats, @ref netapi_netcpPoll
*/
*/
-typedef void (*NETCP_CFG_STATS_CB)( NETAPI_T h, paSysStats_t* pPaStats);
-
-
-
+typedef void (*NETCP_CFG_STATS_CB)(NETAPI_T h,
+ paSysStats_t* pPaStats);
/**
* @ingroup netapi_cfg_functions
* @brief netcp_cfgReqStats API to request statistics from NETCP
*
/**
* @ingroup netapi_cfg_functions
* @brief netcp_cfgReqStats API to request statistics from NETCP
*
-* @details This api is used to request a statistics from NETCP. This will generate a stats request
+ * @details This api is used to request a statistics from NETCP. This will generate a stats request
* command to NETCP. Sometime later, the statistics result will arrive and will be passed to
* the caller via the asynchronus callback @ref NETCP_CFG_STATS_CB that is registered in this call.
* Note: to receive the stats callback, the @ref netapi_netcpPoll funcition must be called
* @param[in] h NETAPI instance handle, @ref NETAPI_T
* command to NETCP. Sometime later, the statistics result will arrive and will be passed to
* the caller via the asynchronus callback @ref NETCP_CFG_STATS_CB that is registered in this call.
* Note: to receive the stats callback, the @ref netapi_netcpPoll funcition must be called
* @param[in] h NETAPI instance handle, @ref NETAPI_T
- * @param[in] c the callback function to invoke with the resulting statistics block, @ref NETCP_CFG_STATS_CB
+ * @param[in] cb the callback function to invoke with the resulting statistics block, @ref NETCP_CFG_STATS_CB
* @param[in] doClear clear the stats in NETCP after the report (0=no, 1=yes)
* @param[in] doClear clear the stats in NETCP after the report (0=no, 1=yes)
- * @param[out] int * err: pointer to error return
+ * @param[out] err pointer to error return
* @retval none
* @pre @ref netapi_init
*/
* @retval none
* @pre @ref netapi_init
*/
-void netcp_cfgReqStats(NETAPI_T h, //NEAPI instance
- NETCP_CFG_STATS_CB c, //stats report callback function
- int doClear, //0: don't clear, 1 clear
+void netcp_cfgReqStats(NETAPI_T h,
+ NETCP_CFG_STATS_CB cb,
+ int doClear,
int *err);
int *err);
+
+
#endif
#endif
index 7fcd8ef2005af43a986d9621e291f9ea1068191f..fc374bbb690431dff83854321640f92b0d8b151f 100755 (executable)
#include "netapi_err.h"
/*--------------------defines-----------------------*/
#include "netapi_err.h"
/*--------------------defines-----------------------*/
+
+/**
+ * @def PKTIO_NOMEM
+ * This define is used to indicate out of memory to user space application
+ */
#define PKTIO_NOMEM NETAPI_ERR_NOMEM
#define PKTIO_NOMEM NETAPI_ERR_NOMEM
-//default pktio channels
+
+/**
+ * @def NETCP_TX
+ * This defines the pktio NETCP transmit INFLOW channel name
+ */
#define NETCP_TX "NETCP_TX"
#define NETCP_TX "NETCP_TX"
+
+/**
+ * @def NETCP_RX
+ * This defines the pktio NETCP receive INFLOW channel name
+ */
#define NETCP_RX "NETCP_RX"
#define NETCP_RX "NETCP_RX"
+
+/**
+ * @def NETCP_SB_RX
+ * This defines the pktio NETCP receive SIDEBAND channel name
+ */
#define NETCP_SB_RX "NETCP_SB_RX"
#define NETCP_SB_RX "NETCP_SB_RX"
-#define NETCP_SB_TX "NETCP_SB_TX"
-#define PKTIO_MAX_NAME 19
-/*--------------------data structures----------------*/
+/**
+ * @def NETCP_SB_TX
+ * This defines the pktio NETCP transmit SIDEBAND channel name
+ */
+#define NETCP_SB_TX "NETCP_SB_TX"
+/**
+ * @def PKTIO_MAX_NAME
+ * This defines the maximum length of a pktio channel name
+ */
+#define PKTIO_MAX_NAME 19
/**
* @ingroup netapi_structures
/**
* @ingroup netapi_structures
*/
typedef struct PKTIO_METADATA_Tag
{
*/
typedef struct PKTIO_METADATA_Tag
{
- int flags1;
+ int flags1; /**< Meta Data flag configuration */
+/**
+ * @def PKTIO_META_RX
+ * This defines the pktio NETCP receive INFLOW channel
+ */
#define PKTIO_META_RX 0x01
#define PKTIO_META_RX 0x01
+
+/**
+ * @def PKTIO_META_TX
+ * This defines the pktio NETCP transmit INFLOW channel
+ */
#define PKTIO_META_TX 0x02
#define PKTIO_META_TX 0x02
+
+/**
+ * @def PKTIO_META_SB_RX
+ * This defines the pktio NETCP SIDEBAND channel channel
+ */
#define PKTIO_META_SB_RX 0x4 /**< SB crypto rx */
#define PKTIO_META_SB_RX 0x4 /**< SB crypto rx */
+
+/**
+ * @def PKTIO_META_SB_TX
+ * This defines the pktio NETCP transmit SIDEBAND channel
+ */
#define PKTIO_META_SB_TX 0x8 /** <SB crypto tx */
#define PKTIO_META_SB_TX 0x8 /** <SB crypto tx */
+
+/**
+ * @def PKTIO_META_APP_DEF
+ * TBD
+ */
#define PKTIO_META_APP_DEF 0x80000000
union
{
#define PKTIO_META_APP_DEF 0x80000000
union
{
- nwalRxPktInfo_t * rx_meta; /**< NWAL Packet meta data information for incoming packet */
- nwalTxPktInfo_t * tx_meta; /**< NWAL Packet meta data information for outgoing packet */
+ nwalRxPktInfo_t * rx_meta; /**< NWAL Packet meta data information for incoming packet */
+ nwalTxPktInfo_t * tx_meta; /**< NWAL Packet meta data information for outgoing packet */
nwalDmRxPayloadInfo_t * rx_sb_meta; /**<NWAL Data mode meta data payload information from NetCP */
nwalDmTxPayloadInfo_t * tx_sb_meta; /**< NWAL Data Mode Payload information for packet to SA */
nwalDmRxPayloadInfo_t * rx_sb_meta; /**<NWAL Data mode meta data payload information from NetCP */
nwalDmTxPayloadInfo_t * tx_sb_meta; /**< NWAL Data Mode Payload information for packet to SA */
- } u;
- void * sa_handle; /**<valid for PKTIO_META_TX with IPSEC inflow or PKTIO_PKTIO_META_SB_TX MUST BE nwal_HANDLE_INVALID otherwise */
+ } u; /**< union NWAL Packet meta data information */
+ void * sa_handle; /**<valid for PKTIO_META_TX with IPSEC inflow or PKTIO_PKTIO_META_SB_TX MUST BE nwal_HANDLE_INVALID otherwise */
} PKTIO_METADATA_T;
/* the callback function */
struct PKTIO_HANDLE_tag;
} PKTIO_METADATA_T;
/* the callback function */
struct PKTIO_HANDLE_tag;
-//polling control
+/**
+ * @ingroup netapi_structures
+ * @brief PKTIO polling control struct FUTURE
+ *
+ * @details PKTIO polling control struct FUTURE
+ */
typedef struct PKTIO_POLL_Tag
{
/* future */
} PKTIO_POLL_T;
typedef struct PKTIO_POLL_Tag
{
/* future */
} PKTIO_POLL_T;
+/**
+ * @def PKTIO_MAX_RECV
+ * This defines the maximum number of packets to receive in one pktio poll, @ref TUNE_NETAPI_MAX_BURST_RCV
+ */
#define PKTIO_MAX_RECV (TUNE_NETAPI_MAX_BURST_RCV)
#define PKTIO_MAX_RECV (TUNE_NETAPI_MAX_BURST_RCV)
-typedef void (*PKTIO_CB)(struct PKTIO_HANDLE_tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T p_meta[], int n_pkts,
- uint64_t ts );
-typedef int (*PKTIO_SEND)(struct PKTIO_HANDLE_tag * channel, Ti_Pkt* p_send,
- PKTIO_METADATA_T *p_meta, int * p_err);
-typedef int (*PKTIO_POLL)(struct PKTIO_HANDLE_tag * channel,PKTIO_POLL_T * p_poll_cfg ,
+
+/**
+ * @ingroup netapi_cb_functions
+ * @brief PKTIO_CB Callback function to be issued on packet receive
+ *
+ * @details The application provides a callback function that gets invoked on packet receive
+ * @param[in] channel The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] p_recv Pointer to the packets received.
+ * @param[in] p_meta Pointer to meta data associated with packet, @ref PKTIO_METADATA_T
+ * @param[in] n_pkts Number of packets received.
+ * @param[in] ts Timestamp associted with received packets.
+ * @retval none
+ * @pre @ref pktio_open
+ */
+typedef void (*PKTIO_CB)(struct PKTIO_HANDLE_tag * channel,
+ Ti_Pkt* p_recv[],
+ PKTIO_METADATA_T p_meta[],
+ int n_pkts,
+ uint64_t ts);
+
+/**
+ * @ingroup netapi_pktio_functions
+ * @brief PKTIO_SEND PKTIO specific send function
+ *
+ * @details The application calls this PKTIO specific send function to transmit packet
+ * @param[in] channel The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] p_send Pointer to the packet to send
+ * @param[in] p_meta Pointer to meta data associated with packet, @ref PKTIO_METADATA_T
+ * @param[out] p_err Pointer to error code.
+ * @retval none
+ * @pre @ref pktio_open
+ */
+typedef int (*PKTIO_SEND)(struct PKTIO_HANDLE_tag * channel,
+ Ti_Pkt* p_send,
+ PKTIO_METADATA_T *p_meta,
int * p_err);
int * p_err);
-/** channel configuration */
-#define PKTIO_NA 0
+/**
+ * @ingroup netapi_pktio_functions
+ * @brief PKTIO_POLL PKTIO specific poll function
+ *
+ * @details The application calls this PKTIO specific POLL function
+ * @param[in] channel The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] p_poll_cfg Pointer to pktio poll configuration. @ref PKTIO_POLL_T
+ * @param[out] p_err Pointer to error code.
+ * @retval none
+ * @pre @ref pktio_open
+ */
+typedef int (*PKTIO_POLL)(struct PKTIO_HANDLE_tag * channel,
+ PKTIO_POLL_T * p_poll_cfg,
+ int * p_err);
+
+/**
+ * @brief This defines TBD
+ */
+#define PKTIO_NA 0
/**
* @ingroup netapi_structures
/**
* @ingroup netapi_structures
- * @brief PKTIO configuration information .
+ * @brief PKTIO configuration information
*
*
- * @details PKTIO configuration information
+ * @details PKTIO :q information
*/
typedef struct PKTIO_CFG_Tag
{
*/
typedef struct PKTIO_CFG_Tag
{
+/**
+ * @def PKTIO_R
+ * This defines the pktio channel as type read TBD
+ */
#define PKTIO_R 0x1
#define PKTIO_R 0x1
+
+/**
+ * @def PKTIO_W
+ * This defines the pktio channel as type write TBD
+ */
#define PKTIO_W 0x2
#define PKTIO_W 0x2
+
+/**
+ * @def PKTIO_RW
+ * This defines the pktio channel as type read/write TBD
+ */
#define PKTIO_RW (PKTIO_R | PKTIO_W)
#define PKTIO_RW (PKTIO_R | PKTIO_W)
-int flags1;
-#define PKTIO_LOCAL 0x2
+int flags1; /**< Flags for PKTIO channel configuration */
+
+/**
+ * @def PKTIO_LOCAL
+ * This defines the pktio channel as type local TBD
+ */
+#define PKTIO_LOCAL 0x2
+
+/**
+ * @def PKTIO_GLOBAL
+ * This defines the pktio channel as type global TBD
+ */
#define PKTIO_GLOBAL 0x1
#define PKTIO_GLOBAL 0x1
-#define PKTIO_PKT 0x4 //define this if this channel is for NETCP
-#define PKTIO_SB 0x8 //define this if this channel is for sideband crypto
-int flags2;
-//for create
+/**
+ * @def PKTIO_PKT
+ * This defines the pktio channel is for NETCP
+ */
+#define PKTIO_PKT 0x4
+
+/**
+ * @def PKTIO_SB
+ * This defines the pktio channel is for sideband crypto
+ */
+#define PKTIO_SB 0x8
+
+int flags2; /**< Flags for PKTIO channel configuration */
+
+/**
+ * @def PKTIO_Q_ANY
+ * This defines TBD
+ */
#define PKTIO_Q_ANY -1
#define PKTIO_Q_ANY -1
-int qnum;
-//for poll
-int max_n;
-}PKTIO_CFG_T;
+int qnum; /**< PKTIO channel queue number */
+
+
+int max_n; /**< Maximum number of packets read in 1 poll */
+} PKTIO_CFG_T;
struct NETAPI_tag;
struct NETAPI_tag;
*/
typedef struct PKTIO_HANDLE_Tag
{
*/
typedef struct PKTIO_HANDLE_Tag
{
+/**
+ * @def PKTIO_INUSE
+ * This defines is used to TBD
+ */
#define PKTIO_INUSE 0xfeedfeed
#define PKTIO_INUSE 0xfeedfeed
- int inuse;
- int use_nwal; /**<true if this is managed by nwal */
-#define PKTIO_4_IPC 0 /**<For IPC */
-#define PKTIO_4_ADJ_NWAL 1 /**<(RX)app queues managed by NWAL */
-#define PKTIO_DEF_NWAL 2 /**<default NWAL RX/TX queues */
-#define PKTIO_4_ADJ_SB 3 /**<(RX) crypto side band app defined */
-#define PKTIO_DEF_SB 4 /**<crypto side band default */
+
+ int inuse; /**<true is pktio channel is in use TBD */
+ int use_nwal; /**<true if this is managed by nwal */
+#define PKTIO_4_IPC 0 /**<For IPC */
+#define PKTIO_4_ADJ_NWAL 1 /**<(RX)app queues managed by NWAL */
+#define PKTIO_DEF_NWAL 2 /**<default NWAL RX/TX queues */
+#define PKTIO_4_ADJ_SB 3 /**<(RX) crypto side band app defined */
+#define PKTIO_DEF_SB 4 /**<crypto side band default */
struct NETAPI_tag * back; /**< back handle */
void * nwalInstanceHandle; /**<save here for conveninece */
PKTIO_CB cb; /**< callback for channel */
struct NETAPI_tag * back; /**< back handle */
void * nwalInstanceHandle; /**<save here for conveninece */
PKTIO_CB cb; /**< callback for channel */
- PKTIO_CFG_T cfg; /**<configuration */
- Qmss_QueueHnd q; /**<the associated queue handle */
- Qmss_Queue qInfo; /**<and its qm#/q# */
+ PKTIO_CFG_T cfg; /**<configuration */
+ Qmss_QueueHnd q; /**<the associated queue handle */
+ Qmss_Queue qInfo; /**<and its qm#/q# */
int max_n; /**<max # of pkts to read in one poll */
int max_n; /**<max # of pkts to read in one poll */
- void * cookie; /**<app specific */
- PKTIO_SEND _send; /**<pktio type specific send function */
- PKTIO_POLL _poll; /**<pktio type specific POLL function */
- char name[PKTIO_MAX_NAME+1];
+ void * cookie; /**<app specific */
+ PKTIO_SEND _send; /**<pktio type specific send function */
+ PKTIO_POLL _poll; /**<pktio type specific POLL function */
+ char name[PKTIO_MAX_NAME+1]; /**< Name of pktio channel */
} PKTIO_HANDLE_T;
} PKTIO_HANDLE_T;
-
+/**
+ * @ingroup netapi_structures
+ * @brief PKTIO control TBD
+ *
+ * @details PKTIO control RBD
+ */
typedef struct PKTIO_CONTROL_Tag
{
typedef struct PKTIO_CONTROL_Tag
{
-#define PKTIO_CLEAR 0x1 //clear out the channel
-#define PKTIO_DIVERT 0x2 //divert, (to dest channel)
- int op;
- PKTIO_HANDLE_T *dest;
-} PKTIO_CONTROL_T;
+/**
+ * @def PKTIO_CLEAR
+ * This defines is used to clear out the PKTIO channel
+ */
+#define PKTIO_CLEAR 0x1
+/**
+ * @def PKTIO_DIVERT
+ * This defines is used to divert to dest channel TBD
+ */
+#define PKTIO_DIVERT 0x2
+
+ int op; /**< TBD */
+ PKTIO_HANDLE_T *dest; /**< Handle to PKTIO channel */
+} PKTIO_CONTROL_T;
-/*---------------------------------------------------*/
-/*-------------------------API-----------------------*/
-/*---------------------------------------------------*/
/**
* @ingroup netapi_pktio_functions
/**
* @ingroup netapi_pktio_functions
- * @brief API creates a NETAPI PKTIO channel
+ * @brief API creates a NETAPI PKTIO channel
*
* @details This assigns global resources to a NETAPI pktio channel.
* Once created, the channel can be used to send and/or receive
*
* @details This assigns global resources to a NETAPI pktio channel.
* Once created, the channel can be used to send and/or receive
- * a TI @ref Ti_Pkt. This can be used for communication with the
+ * a Ti_Pkt. This can be used for communication with the
* the Network co-processor (NETCP) or for internal inter-processor
* communication. The channel is saved under the assigned name
* and can be opened by other netapi threads instances.
* the Network co-processor (NETCP) or for internal inter-processor
* communication. The channel is saved under the assigned name
* and can be opened by other netapi threads instances.
- * @param[in] @ref NETAPI_T: handle to the instance
- * @param[in] char * name: a pointer to the char string name for channel
- * @param[in] @ref PKTIO_CB : callback to be issued on packet receive
- * @param[in] @ref PKTIO_CFG_T: pointer to channel configuration
- * @param[out] int * err: pointer to error return
- * @retval @ref PKTIO_HANDLE_T: handle to the pktio instance or NULL on error
+ * @param[in] netapi_handle The NETAPI handle, @ref NETAPI_T
+ * @param[in] name A pointer to the char string name for channel
+ * @param[in] cb Callback to be issued on packet receive, @ref PKTIO_CB
+ * @param[in] p_cfg Pointer to channel configuration, @ref PKTIO_CFG_T
+ * @param[out] err Pointer to error code.
+ * @retval Handle to the pktio instance or NULL on error, @ref PKTIO_HANDLE_T
* @pre @ref netapi_init
*/
* @pre @ref netapi_init
*/
-PKTIO_HANDLE_T * pktio_create(NETAPI_T netapi_handle, /* netapi instance */
- char * name, /* name of the channel */
- PKTIO_CB cb, /* receive callback */
- PKTIO_CFG_T * p_cfg, /* ptr to config*/
+PKTIO_HANDLE_T * pktio_create(NETAPI_T netapi_handle,
+ char * name,
+ PKTIO_CB cb,
+ PKTIO_CFG_T* p_cfg,
int * err);
/**
* @ingroup netapi_pktio_functions
int * err);
/**
* @ingroup netapi_pktio_functions
- * @brief API opens an existing NETAPI PKTIO channel
+ * @brief API opens an existing NETAPI PKTIO channel
*
* @details This opens an NETAPI pktio channel for use. The channel
* must have already been created via @ref pktio_create or may have
* been created internally during the netapi intialization.
* Once opened, the channel can be used to send and/or receive
*
* @details This opens an NETAPI pktio channel for use. The channel
* must have already been created via @ref pktio_create or may have
* been created internally during the netapi intialization.
* Once opened, the channel can be used to send and/or receive
- * a TI @ref Ti_Pkt. This can be used for communication with the
+ * a Ti_Pkt. This can be used for communication with the
* the Network co-processor (NETCP) or for internal inter-processor
* communication.
*
* the Network co-processor (NETCP) or for internal inter-processor
* communication.
*
- * @param[in] @ref NETAPI_T: handle to the instance
- * @param[in] char * name: a pointer to the char string name for channel
- * @param[in] @ref PKTIO_CB : callback to be issued on packet receive
- * @param[in] @ref PKTIO_CFG_T: pointer to channel configuration
- * @param[out] int * err: pointer to error return
- * @retval @ref PKTIO_HANDLE_T: handle to the pktio instance or NULL on error
- * @pre @ref netapi_init , @ref pktio_create
- */
-PKTIO_HANDLE_T * pktio_open(NETAPI_T netapi_handle, /* netapi instance */
- char *name, /* name of channel to open */
- PKTIO_CB cb, /* receive callback */
- PKTIO_CFG_T *p_cfg, /* channel configuration */
+ * @param[in] netapi_handle The NETAPI handle, @ref NETAPI_T
+ * @param[in] name A pointer to the char string name for channel to open
+ * @param[in] cb Callback to be issued on packet receive, @ref PKTIO_CB
+ * @param[in] p_cfg Pointer to channel configuration, @ref PKTIO_CFG_T
+ * @param[out] err Pointer to error code.
+ * @retval Handle to the pktio instance or NULL on error, @ref PKTIO_HANDLE_T
+ * @pre @ref netapi_init, @ref pktio_create
+ */
+PKTIO_HANDLE_T * pktio_open(NETAPI_T netapi_handle,
+ char *name,
+ PKTIO_CB cb,
+ PKTIO_CFG_T *p_cfg,
int * err);
int * err);
-/* future: control the channel */
-void pktio_control(PKTIO_HANDLE_T * channel, //handle from open or create
- PKTIO_CB cb, //change the callback
- PKTIO_CFG_T * p_cfg,//optional
- PKTIO_CONTROL_T *p_control,//optional
- int *err);
-
-/* future: close or delete a pktio channel */
-void pktio_close(PKTIO_HANDLE_T * channel, int * err);
-void pktio_delete(PKTIO_HANDLE_T * channel, int * err);
+/**
+ * @ingroup netapi_pktio_functions
+ * @brief API controls an existing NETAPI PKTIO channel
+ *
+ * @details This controls an opened pktio channel
+ *
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] cb Callback to be issued on packet receive, @ref PKTIO_CB
+ * @param[in] p_cfg Pointer to channel configuration which (optional), @ref PKTIO_CFG_T
+ * @param[in] p_control Pointer to PKTIO control information (optional), @ref PKTIO_CONTROL_T
+ * @param[out] err Pointer to error code.
+ * @retval none
+ * @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
+ */
+void pktio_control(PKTIO_HANDLE_T * handle,
+ PKTIO_CB cb,
+ PKTIO_CFG_T * p_cfg,
+ PKTIO_CONTROL_T *p_control,
+ int *err);
+
+/**
+ * @ingroup netapi_pktio_functions
+ * @brief API closes a PKTIO channel
+ *
+ * @details This closes a PKTIO channel
+ *
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[out] err Pointer to error code.
+ * @retval none
+ * @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
+ */
+void pktio_close(PKTIO_HANDLE_T * handle,
+ int * err);
+
+/**
+ * @ingroup netapi_pktio_functions
+ * @brief API deletes a PKTIO channel
+ *
+ * @details This deletes a PKTIO channel
+ *
+ * @param[in] handle The PKTIO handle, @ref PKTIO_HANDLE_T
+ * @param[out] err Pointer to error code.
+ * @retval none
+ * @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
+ */
+void pktio_delete(PKTIO_HANDLE_T * handle,
+ int * err);
/**
* @ingroup netapi_pktio_functions
* @brief API sends data to a NETAPI PKTIO channel
*
/**
* @ingroup netapi_pktio_functions
* @brief API sends data to a NETAPI PKTIO channel
*
- * @details This sends a @ref Ti_Pkt and associated meta data,
+ * @details This sends a Ti_Pkt and associated meta data,
* @ref PKTIO_METADATA_T to a channel. The channel
* must have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
* @ref PKTIO_METADATA_T to a channel. The channel
* must have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
- * @param[in] @ref PKTIO_HANDLE_T: handle to the channel
- * @param[in] @ref Ti_Pkt*: pointer to the packet to send
- * @param[in] @ref PKTIO_METADATA_T: pointer to meta data associated with packet
- * @param[out] int * err: pointer to error return
- * @retval int npkts: 1 if packet sent, 0 if error
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] pkt Pointer to the packet to send
+ * @param[in] m Pointer to meta data associated with packet, @ref PKTIO_METADATA_T
+ * @param[out] err Pointer to error code.
+ * @retval 1 if packet sent, 0 if error
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
-static inline int pktio_send(PKTIO_HANDLE_T * channel, /* the channel */
- Ti_Pkt *pkt, /* pointer to packet */
- PKTIO_METADATA_T *m, /* pointer to meta data */
- int * err)
+static inline int pktio_send(PKTIO_HANDLE_T * handle,
+ Ti_Pkt *pkt,
+ PKTIO_METADATA_T *m,
+ int * err)
{
{
- return channel->_send((struct PKTIO_HANDLE_tag *)channel, pkt, m, err);
+ return handle->_send((struct PKTIO_HANDLE_tag *)handle, pkt, m, err);
}
/**
* @ingroup netapi_pktio_functions
}
/**
* @ingroup netapi_pktio_functions
- * @brief API sends data to a NETAPI PKTIO channel
+ * @brief API sends data to a NETAPI PKTIO channel
*
*
- * @details This sends an array of @ref Ti_Pkt and associated meta data,
+ * @details This sends an array of Ti_Pkt and associated meta data,
* @ref PKTIO_METADATA_T to a channel. The channel
* must have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
* @ref PKTIO_METADATA_T to a channel. The channel
* must have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
- * @param[in] @ref PKTIO_HANDLE_T: handle to the channel
- * @param[in] @ref Ti_Pkt*: pointer to the packet to send
- * @param[in] @ref PKTIO_METADATA_T: pointer to meta data associated with packet
- * @oaran[in[ int np: the number of packets in list to send
- * @param[out] int * err: pointer to error return
- * @retval int npkts: number of packets sent, 0 if error
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] pkt Pointer to the packet to send
+ * @param[in] m Pointer to meta data associated with packet, @ref PKTIO_METADATA_T
+ * @param[in] np The number of packets in list to send
+ * @param[out] err Pointer to error code.
+ * @retval Number of packets sent, 0 if error
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
-int pktio_sendMulti(PKTIO_HANDLE_T *channel, /* the channel handle */
- Ti_Pkt * pkt[], /* array of packets to send */
- PKTIO_METADATA_T * m[], /* meta data array */
- int np, /* number of packets to send */
+int pktio_sendMulti(PKTIO_HANDLE_T *handle,
+ Ti_Pkt * pkt[],
+ PKTIO_METADATA_T * m[],
+ int np,
int * err);
int * err);
-/***********************************/
-/************* polling **************/
-/***********************************/
-
/**
* @ingroup netapi_pktio_functions
* @brief API polls a NETAPI PKTIO channel for received packets
/**
* @ingroup netapi_pktio_functions
* @brief API polls a NETAPI PKTIO channel for received packets
* have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
* have already been created via @ref pktio_create or opened
* via @ref pktio_open. It may have
* been created internally during the netapi intialization.
- * @param[in] @ref PKTIO_HANDLE_T: handle to the channel
- * @param[in] @ref PKTIO_POLL_T *: pointer to pktio poll configuration
- * @param[out] int * err: pointer to error return
- * @retval int npkts: number of packets received by poll
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] p_poll_cfg Pointer to pktio poll configuration. @ref PKTIO_POLL_T
+ * @param[out] err Pointer to error code.
+ * @retval Number of packets received by poll
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
-static inline int pktio_poll(PKTIO_HANDLE_T * handle, //handle to pktio
- PKTIO_POLL_T * p_poll_cfg, //polling configuration
- int * err)
+static inline int pktio_poll(PKTIO_HANDLE_T * handle,
+ PKTIO_POLL_T * p_poll_cfg,
+ int * err)
{
{
- return handle->_poll((struct PKTIO_HANDLE_tag *) handle, p_poll_cfg, err);
+ return handle->_poll((struct PKTIO_HANDLE_tag *) handle, p_poll_cfg, err);
}
/**
* @ingroup netapi_pktio_functions
}
/**
* @ingroup netapi_pktio_functions
- * @brief API polls all NETAPI PKTIO channels associarted with @ref NETAPI_T instance
+ * @brief API polls all NETAPI PKTIO channels associarted with @ref NETAPI_T instance
* for received packets
*
* @details This api polls all pktio channels attached to an instance.
* for received packets
*
* @details This api polls all pktio channels attached to an instance.
* have already been created via @ref pktio_create or opened
* via @ref pktio_open. They may have
* been created internally during the netapi intialization.
* have already been created via @ref pktio_create or opened
* via @ref pktio_open. They may have
* been created internally during the netapi intialization.
- * @param[in] @ref NETAPI_T: handle of the NETAPI instance
- * @param[in] @ref PKTIO_POLL_T *: pointer to pktio poll configuration
- * @param[out] int * err: pointer to error return
- * @retval int npkts: number of packets received by poll
+ * @param[in] handle The PKTIO channel handle, @ref PKTIO_HANDLE_T
+ * @param[in] p_poll_cfg Pointer to pktio poll configuration. @ref PKTIO_POLL_T
+ * @param[out] err Pointer to error code.
+ * @retval Number of packets received by poll
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
* @pre @ref netapi_init, @ref pktio_create, @ref pktio_open
*/
-int pktio_pollAll(NETAPI_T handle, PKTIO_POLL_T * p_poll_cfg, int *err);
+int pktio_pollAll(NETAPI_T handle,
+ PKTIO_POLL_T * p_poll_cfg,
+ int *err);
+
-/*----------------- utilities------------------ */
/* update max_n for poll */
/* update max_n for poll */
+
+
+/**
+ * @brief This define sets the max number of pkts to read in one poll in the @ref PKTIO_HANDLE_T
+ */
#define pktio_set_max_n(handle,max_n) (handle)->max_n=max_n;
#define pktio_set_max_n(handle,max_n) (handle)->max_n=max_n;
+
+/**
+ * @brief This define returns NETAPI handle stored in the @ref PKTIO_HANDLE_T
+ */
#define pktio_get_netapi_handle(handle) (handle)->back
#define pktio_get_netapi_handle(handle) (handle)->back
+
+/**
+ * @brief This define sets a user space application cookie in the @ref PKTIO_HANDLE_T
+ */
#define pktio_set_cookie(handle, cookie) (handle)->cookie = cookie
#define pktio_set_cookie(handle, cookie) (handle)->cookie = cookie
+
+/**
+ * @brief This define returns a previously set user space application cookie stored in the @ref PKTIO_HANDLE_T
+ */
#define pktio_get_cookie(handle) (handle)->cookie
#define pktio_get_cookie(handle) (handle)->cookie
+
+
+/**
+ * @brief This define returns a associate queue handle stored in the @ref PKTIO_HANDLE_T
+ */
+
#define pktio_get_q(handle) (handle)->q
/*-----------------Extra Fast Path pkt meta data macros--------------------*/
#define pktio_get_q(handle) (handle)->q
/*-----------------Extra Fast Path pkt meta data macros--------------------*/
*/
static inline Qmss_QueueHnd PKTIO_GET_DEFAULT_NETCP_Q(PKTIO_HANDLE_T *h)
{
*/
static inline Qmss_QueueHnd PKTIO_GET_DEFAULT_NETCP_Q(PKTIO_HANDLE_T *h)
{
-nwalGlobCxtInfo_t Info;
-nwal_getGlobCxtInfo(h->nwalInstanceHandle,&Info);
-return Info.rxDefPktQ;
+ nwalGlobCxtInfo_t Info;
+ nwal_getGlobCxtInfo(h->nwalInstanceHandle,&Info);
+ return Info.rxDefPktQ;
}
}
* @ingroup netapi_pktio_functions
* @brief API to perform descriptor push to QMSS Queue
*/
* @ingroup netapi_pktio_functions
* @brief API to perform descriptor push to QMSS Queue
*/
-static inline void PKTIO_QMSS_QUEUE_PUSH_DESC_SIZE_RAW(Qmss_QueueHnd hnd, void *descAddr, uint32_t descSize)
+static inline void PKTIO_QMSS_QUEUE_PUSH_DESC_SIZE_RAW(Qmss_QueueHnd hnd,
+ void *descAddr,
+ uint32_t descSize)
{
return(Qmss_queuePushDescSizeRaw(hnd,descAddr,descSize));
}
{
return(Qmss_queuePushDescSizeRaw(hnd,descAddr,descSize));
}
index 1b5ea732334176c8b7d11e42b3534ef8458a14fb..d9f6b1b010e02de59bff084aba915b3c27997118 100755 (executable)
}
}
else ph->shutdown_time = (uint64_t) -1;
}
}
else ph->shutdown_time = (uint64_t) -1;
- ph->state =NETAPI_SCHED_STATE_ACTIVE;
+ ph->state =NETAPI_SCHED_STATE_OPEN;
return(ph);
}
return(ph);
}
next_house = s->config.interval;
}
//see if we were closed and/or its time to close
next_house = s->config.interval;
}
//see if we were closed and/or its time to close
- if (s->state!= NETAPI_SCHED_STATE_ACTIVE)
- { s->state=NETAPI_SCHED_STATE_SHUT; break;}
+ if (s->state!= NETAPI_SCHED_STATE_OPEN)
+ { s->state=NETAPI_SCHED_STATE_CLOSE; break;}
}
return 1;
}
}
return 1;
}
int netapi_schedShutdown(NETAPI_SCHED_HANDLE_T * s, NETAPI_SCHED_SHUTDOWN_T * p_close, int * p_err)
{
*p_err=0;
int netapi_schedShutdown(NETAPI_SCHED_HANDLE_T * s, NETAPI_SCHED_SHUTDOWN_T * p_close, int * p_err)
{
*p_err=0;
- s->state=NETAPI_SCHED_STATE_SHUTTING; //say we are closing
+ s->state=NETAPI_SCHED_STATE_CLOSE_IN_PROGRESS; //say we are closing
return 1;
}
return 1;
}