xref: /freebsd/sys/contrib/ncsw/inc/Peripherals/bm_ext.h (revision c2c014f24c10f90d85126ac5fbd4d8524de32b1c)
10aeed3e9SJustin Hibbits /******************************************************************************
20aeed3e9SJustin Hibbits 
30aeed3e9SJustin Hibbits  � 1995-2003, 2004, 2005-2011 Freescale Semiconductor, Inc.
40aeed3e9SJustin Hibbits  All rights reserved.
50aeed3e9SJustin Hibbits 
60aeed3e9SJustin Hibbits  This is proprietary source code of Freescale Semiconductor Inc.,
70aeed3e9SJustin Hibbits  and its use is subject to the NetComm Device Drivers EULA.
80aeed3e9SJustin Hibbits  The copyright notice above does not evidence any actual or intended
90aeed3e9SJustin Hibbits  publication of such source code.
100aeed3e9SJustin Hibbits 
110aeed3e9SJustin Hibbits  ALTERNATIVELY, redistribution and use in source and binary forms, with
120aeed3e9SJustin Hibbits  or without modification, are permitted provided that the following
130aeed3e9SJustin Hibbits  conditions are met:
140aeed3e9SJustin Hibbits      * Redistributions of source code must retain the above copyright
150aeed3e9SJustin Hibbits        notice, this list of conditions and the following disclaimer.
160aeed3e9SJustin Hibbits      * Redistributions in binary form must reproduce the above copyright
170aeed3e9SJustin Hibbits        notice, this list of conditions and the following disclaimer in the
180aeed3e9SJustin Hibbits        documentation and/or other materials provided with the distribution.
190aeed3e9SJustin Hibbits      * Neither the name of Freescale Semiconductor nor the
200aeed3e9SJustin Hibbits        names of its contributors may be used to endorse or promote products
210aeed3e9SJustin Hibbits        derived from this software without specific prior written permission.
220aeed3e9SJustin Hibbits 
230aeed3e9SJustin Hibbits  THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
240aeed3e9SJustin Hibbits  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
250aeed3e9SJustin Hibbits  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
260aeed3e9SJustin Hibbits  DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
270aeed3e9SJustin Hibbits  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
280aeed3e9SJustin Hibbits  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
290aeed3e9SJustin Hibbits  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
300aeed3e9SJustin Hibbits  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
310aeed3e9SJustin Hibbits  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
320aeed3e9SJustin Hibbits  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
330aeed3e9SJustin Hibbits  *
340aeed3e9SJustin Hibbits 
350aeed3e9SJustin Hibbits  **************************************************************************/
360aeed3e9SJustin Hibbits /******************************************************************************
370aeed3e9SJustin Hibbits  @File          bm_ext.h
380aeed3e9SJustin Hibbits 
390aeed3e9SJustin Hibbits  @Description   BM API
400aeed3e9SJustin Hibbits *//***************************************************************************/
410aeed3e9SJustin Hibbits #ifndef __BM_EXT_H
420aeed3e9SJustin Hibbits #define __BM_EXT_H
430aeed3e9SJustin Hibbits 
440aeed3e9SJustin Hibbits #include "error_ext.h"
450aeed3e9SJustin Hibbits #include "std_ext.h"
460aeed3e9SJustin Hibbits 
470aeed3e9SJustin Hibbits 
480aeed3e9SJustin Hibbits /**************************************************************************//**
490aeed3e9SJustin Hibbits  @Group         BM_grp Buffer Manager API
500aeed3e9SJustin Hibbits 
510aeed3e9SJustin Hibbits  @Description   BM API functions, definitions and enums.
520aeed3e9SJustin Hibbits 
530aeed3e9SJustin Hibbits  @{
540aeed3e9SJustin Hibbits *//***************************************************************************/
550aeed3e9SJustin Hibbits 
560aeed3e9SJustin Hibbits /**************************************************************************//**
570aeed3e9SJustin Hibbits  @Description   This callback type is used when handling pool depletion entry/exit.
580aeed3e9SJustin Hibbits 
590aeed3e9SJustin Hibbits                 User provides this function. Driver invokes it.
600aeed3e9SJustin Hibbits 
610aeed3e9SJustin Hibbits  @Param[in]     h_App       - User's application descriptor.
620aeed3e9SJustin Hibbits  @Param[in]     in          - TRUE when entered depletion state
630aeed3e9SJustin Hibbits                               FALSE when exit the depletion state.
640aeed3e9SJustin Hibbits  *//***************************************************************************/
650aeed3e9SJustin Hibbits typedef void (t_BmDepletionCallback)(t_Handle h_App, bool in);
660aeed3e9SJustin Hibbits 
670aeed3e9SJustin Hibbits /**************************************************************************//**
680aeed3e9SJustin Hibbits  @Group         BM_lib_grp BM common API
690aeed3e9SJustin Hibbits 
700aeed3e9SJustin Hibbits  @Description   BM common API functions, definitions and enums.
710aeed3e9SJustin Hibbits 
720aeed3e9SJustin Hibbits  @{
730aeed3e9SJustin Hibbits *//***************************************************************************/
740aeed3e9SJustin Hibbits 
750aeed3e9SJustin Hibbits /**************************************************************************//**
760aeed3e9SJustin Hibbits  @Description   BM Exceptions
770aeed3e9SJustin Hibbits *//***************************************************************************/
780aeed3e9SJustin Hibbits typedef enum e_BmExceptions {
790aeed3e9SJustin Hibbits     e_BM_EX_INVALID_COMMAND = 0 ,   /**< Invalid Command Verb Interrupt */
800aeed3e9SJustin Hibbits     e_BM_EX_FBPR_THRESHOLD,         /**< FBPR Low Watermark Interrupt. */
810aeed3e9SJustin Hibbits     e_BM_EX_SINGLE_ECC,             /**< Single Bit ECC Error Interrupt. */
820aeed3e9SJustin Hibbits     e_BM_EX_MULTI_ECC               /**< Multi Bit ECC Error Interrupt */
830aeed3e9SJustin Hibbits } e_BmExceptions;
840aeed3e9SJustin Hibbits 
850aeed3e9SJustin Hibbits 
860aeed3e9SJustin Hibbits /**************************************************************************//**
870aeed3e9SJustin Hibbits  @Group         BM_init_grp BM (common) Initialization Unit
880aeed3e9SJustin Hibbits 
890aeed3e9SJustin Hibbits  @Description   BM (common) Initialization Unit
900aeed3e9SJustin Hibbits 
910aeed3e9SJustin Hibbits  @{
920aeed3e9SJustin Hibbits *//***************************************************************************/
930aeed3e9SJustin Hibbits 
940aeed3e9SJustin Hibbits /**************************************************************************//**
950aeed3e9SJustin Hibbits  @Function      t_BmExceptionsCallback
960aeed3e9SJustin Hibbits 
970aeed3e9SJustin Hibbits  @Description   Exceptions user callback routine, will be called upon an
980aeed3e9SJustin Hibbits                 exception passing the exception identification.
990aeed3e9SJustin Hibbits 
1000aeed3e9SJustin Hibbits  @Param[in]     h_App      - User's application descriptor.
1010aeed3e9SJustin Hibbits  @Param[in]     exception  - The exception.
1020aeed3e9SJustin Hibbits *//***************************************************************************/
1030aeed3e9SJustin Hibbits typedef void (t_BmExceptionsCallback) (t_Handle              h_App,
1040aeed3e9SJustin Hibbits                                        e_BmExceptions        exception);
1050aeed3e9SJustin Hibbits 
1060aeed3e9SJustin Hibbits /**************************************************************************//**
1070aeed3e9SJustin Hibbits  @Description   structure representing BM initialization parameters
1080aeed3e9SJustin Hibbits *//***************************************************************************/
1090aeed3e9SJustin Hibbits typedef struct {
1100aeed3e9SJustin Hibbits     uint8_t                 guestId;                /**< BM Partition Id */
1110aeed3e9SJustin Hibbits 
1120aeed3e9SJustin Hibbits     uintptr_t               baseAddress;            /**< Bm base address (virtual).
1130aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1140aeed3e9SJustin Hibbits     uint16_t                liodn;                  /**< This value is attached to every transaction initiated by
1150aeed3e9SJustin Hibbits                                                          BMan when accessing its private data structures
1160aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1170aeed3e9SJustin Hibbits     uint32_t                totalNumOfBuffers;      /**< Total number of buffers
1180aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1190aeed3e9SJustin Hibbits     uint32_t                fbprMemPartitionId;     /**< FBPR's mem partition id;
1200aeed3e9SJustin Hibbits                                                          NOTE: The memory partition must be non-cacheable and no-coherent area.
1210aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1220aeed3e9SJustin Hibbits     t_BmExceptionsCallback  *f_Exception;           /**< An application callback routine to handle exceptions.
1230aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1240aeed3e9SJustin Hibbits     t_Handle                h_App;                  /**< A handle to an application layer object; This handle will
1250aeed3e9SJustin Hibbits                                                          be passed by the driver upon calling the above callbacks.
1260aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
127f77405e3SJustin Hibbits     uintptr_t               errIrq;                 /**< BM error interrupt line; NO_IRQ if interrupts not used.
1280aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */
1290aeed3e9SJustin Hibbits 
1300aeed3e9SJustin Hibbits     uint8_t                 partBpidBase;           /**< The first buffer-pool-id dedicated to this partition.
1310aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only when working with multiple partitions. */
1320aeed3e9SJustin Hibbits     uint8_t                 partNumOfPools;         /**< Number of Pools dedicated to this partition.
1330aeed3e9SJustin Hibbits                                                          NOTE: this parameter relevant only when working with multiple partitions. */
1340aeed3e9SJustin Hibbits } t_BmParam;
1350aeed3e9SJustin Hibbits 
1360aeed3e9SJustin Hibbits 
1370aeed3e9SJustin Hibbits /**************************************************************************//**
1380aeed3e9SJustin Hibbits  @Function      BM_Config
1390aeed3e9SJustin Hibbits 
1400aeed3e9SJustin Hibbits  @Description   Creates descriptor for the BM module and initializes the BM module.
1410aeed3e9SJustin Hibbits 
1420aeed3e9SJustin Hibbits                 The routine returns a handle (descriptor) to the BM object.
1430aeed3e9SJustin Hibbits                 This descriptor must be passed as first parameter to all other
1440aeed3e9SJustin Hibbits                 BM function calls.
1450aeed3e9SJustin Hibbits 
1460aeed3e9SJustin Hibbits  @Param[in]     p_BmParam   - A pointer to data structure of parameters
1470aeed3e9SJustin Hibbits 
1480aeed3e9SJustin Hibbits  @Return        Handle to BM object, or NULL for Failure.
1490aeed3e9SJustin Hibbits *//***************************************************************************/
1500aeed3e9SJustin Hibbits t_Handle    BM_Config(t_BmParam *p_BmParam);
1510aeed3e9SJustin Hibbits 
1520aeed3e9SJustin Hibbits /**************************************************************************//**
1530aeed3e9SJustin Hibbits  @Function      BM_Init
1540aeed3e9SJustin Hibbits 
1550aeed3e9SJustin Hibbits  @Description   Initializes the BM module
1560aeed3e9SJustin Hibbits 
1570aeed3e9SJustin Hibbits  @Param[in]     h_Bm            - A handle to the BM module
1580aeed3e9SJustin Hibbits 
1590aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
1600aeed3e9SJustin Hibbits 
1610aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_Config().
1620aeed3e9SJustin Hibbits *//***************************************************************************/
1630aeed3e9SJustin Hibbits t_Error    BM_Init(t_Handle h_Bm);
1640aeed3e9SJustin Hibbits 
1650aeed3e9SJustin Hibbits /**************************************************************************//**
1660aeed3e9SJustin Hibbits  @Function      BM_Free
1670aeed3e9SJustin Hibbits 
1680aeed3e9SJustin Hibbits  @Description   Frees all resources that were assigned to BM module.
1690aeed3e9SJustin Hibbits 
1700aeed3e9SJustin Hibbits                 Calling this routine invalidates the descriptor.
1710aeed3e9SJustin Hibbits 
1720aeed3e9SJustin Hibbits  @Param[in]     h_Bm            - A handle to the BM module
1730aeed3e9SJustin Hibbits 
1740aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
1750aeed3e9SJustin Hibbits *//***************************************************************************/
1760aeed3e9SJustin Hibbits t_Error     BM_Free(t_Handle h_Bm);
1770aeed3e9SJustin Hibbits 
1780aeed3e9SJustin Hibbits /**************************************************************************//**
1790aeed3e9SJustin Hibbits  @Group         BM_advanced_init_grp    BM (common) Advanced Configuration Unit
1800aeed3e9SJustin Hibbits 
1810aeed3e9SJustin Hibbits  @Description   Configuration functions used to change default values.
1820aeed3e9SJustin Hibbits 
1830aeed3e9SJustin Hibbits  @{
1840aeed3e9SJustin Hibbits *//***************************************************************************/
1850aeed3e9SJustin Hibbits 
1860aeed3e9SJustin Hibbits /**************************************************************************//**
1870aeed3e9SJustin Hibbits  @Function      BM_ConfigFbprThreshold
1880aeed3e9SJustin Hibbits 
1890aeed3e9SJustin Hibbits  @Description   Change the fbpr threshold from its default
1900aeed3e9SJustin Hibbits                 configuration [0].
1910aeed3e9SJustin Hibbits                 An interrupt if enables is asserted when the number of FBPRs is below this threshold.
1920aeed3e9SJustin Hibbits                 NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID).
1930aeed3e9SJustin Hibbits 
1940aeed3e9SJustin Hibbits  @Param[in]     h_Bm            - A handle to the BM module
1950aeed3e9SJustin Hibbits  @Param[in]     threshold       - threshold value.
1960aeed3e9SJustin Hibbits 
1970aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
1980aeed3e9SJustin Hibbits 
1990aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_Config() and before BM_Init().
2000aeed3e9SJustin Hibbits *//***************************************************************************/
2010aeed3e9SJustin Hibbits t_Error     BM_ConfigFbprThreshold(t_Handle h_Bm, uint32_t threshold);
2020aeed3e9SJustin Hibbits 
2030aeed3e9SJustin Hibbits /** @} */ /* end of BM_advanced_init_grp group */
2040aeed3e9SJustin Hibbits /** @} */ /* end of BM_init_grp group */
2050aeed3e9SJustin Hibbits 
2060aeed3e9SJustin Hibbits /**************************************************************************//**
2070aeed3e9SJustin Hibbits  @Group         BM_runtime_control_grp BM (common) Runtime Control Unit
2080aeed3e9SJustin Hibbits 
2090aeed3e9SJustin Hibbits  @Description   BM (common) Runtime control unit API functions, definitions and enums.
2100aeed3e9SJustin Hibbits 
2110aeed3e9SJustin Hibbits  @{
2120aeed3e9SJustin Hibbits *//***************************************************************************/
2130aeed3e9SJustin Hibbits 
2140aeed3e9SJustin Hibbits /**************************************************************************//**
2150aeed3e9SJustin Hibbits  @Description   enum for defining BM counters
2160aeed3e9SJustin Hibbits *//***************************************************************************/
2170aeed3e9SJustin Hibbits typedef enum e_BmCounters {
2180aeed3e9SJustin Hibbits     e_BM_COUNTERS_FBPR = 0              /**< Total Free Buffer Proxy Record (FBPR) Free Pool Count in external memory */
2190aeed3e9SJustin Hibbits } e_BmCounters;
2200aeed3e9SJustin Hibbits 
2210aeed3e9SJustin Hibbits /**************************************************************************//**
2220aeed3e9SJustin Hibbits  @Description   structure for returning revision information
2230aeed3e9SJustin Hibbits *//***************************************************************************/
2240aeed3e9SJustin Hibbits typedef struct t_BmRevisionInfo {
2250aeed3e9SJustin Hibbits     uint8_t         majorRev;               /**< Major revision */
2260aeed3e9SJustin Hibbits     uint8_t         minorRev;               /**< Minor revision */
2270aeed3e9SJustin Hibbits } t_BmRevisionInfo;
2280aeed3e9SJustin Hibbits 
2290aeed3e9SJustin Hibbits #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
2300aeed3e9SJustin Hibbits /**************************************************************************//**
2310aeed3e9SJustin Hibbits  @Function      BM_DumpRegs
2320aeed3e9SJustin Hibbits 
2330aeed3e9SJustin Hibbits  @Description   Dumps all BM registers
2340aeed3e9SJustin Hibbits                 NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID).
2350aeed3e9SJustin Hibbits 
2360aeed3e9SJustin Hibbits  @Param[in]     h_Bm      A handle to an BM Module.
2370aeed3e9SJustin Hibbits 
2380aeed3e9SJustin Hibbits  @Return        E_OK on success;
2390aeed3e9SJustin Hibbits 
2400aeed3e9SJustin Hibbits  @Cautions      Allowed only after BM_Init().
2410aeed3e9SJustin Hibbits *//***************************************************************************/
2420aeed3e9SJustin Hibbits t_Error BM_DumpRegs(t_Handle h_Bm);
2430aeed3e9SJustin Hibbits #endif /* (defined(DEBUG_ERRORS) && ... */
2440aeed3e9SJustin Hibbits 
2450aeed3e9SJustin Hibbits /**************************************************************************//**
2460aeed3e9SJustin Hibbits  @Function      BM_SetException
2470aeed3e9SJustin Hibbits 
2480aeed3e9SJustin Hibbits  @Description   Calling this routine enables/disables the specified exception.
2490aeed3e9SJustin Hibbits                 NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID).
2500aeed3e9SJustin Hibbits 
2510aeed3e9SJustin Hibbits  @Param[in]     h_Bm        - A handle to the BM Module.
2520aeed3e9SJustin Hibbits  @Param[in]     exception   - The exception to be selected.
2530aeed3e9SJustin Hibbits  @Param[in]     enable      - TRUE to enable interrupt, FALSE to mask it.
2540aeed3e9SJustin Hibbits 
2550aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_Init().
2560aeed3e9SJustin Hibbits *//***************************************************************************/
2570aeed3e9SJustin Hibbits t_Error     BM_SetException(t_Handle h_Bm, e_BmExceptions exception, bool enable);
2580aeed3e9SJustin Hibbits 
2590aeed3e9SJustin Hibbits /**************************************************************************//**
2600aeed3e9SJustin Hibbits  @Function      BM_ErrorIsr
2610aeed3e9SJustin Hibbits 
2620aeed3e9SJustin Hibbits  @Description   BM interrupt-service-routine for errors.
2630aeed3e9SJustin Hibbits                 NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID).
2640aeed3e9SJustin Hibbits 
2650aeed3e9SJustin Hibbits  @Param[in]     h_Bm        - A handle to the BM Module.
2660aeed3e9SJustin Hibbits 
2670aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_Init().
2680aeed3e9SJustin Hibbits *//***************************************************************************/
2690aeed3e9SJustin Hibbits void        BM_ErrorIsr(t_Handle h_Bm);
2700aeed3e9SJustin Hibbits 
2710aeed3e9SJustin Hibbits /**************************************************************************//**
2720aeed3e9SJustin Hibbits  @Function      BM_GetCounter
2730aeed3e9SJustin Hibbits 
2740aeed3e9SJustin Hibbits  @Description   Reads one of the BM counters.
2750aeed3e9SJustin Hibbits 
2760aeed3e9SJustin Hibbits  @Param[in]     h_Bm        - A handle to the BM Module.
2770aeed3e9SJustin Hibbits  @Param[in]     counter     - The requested counter.
2780aeed3e9SJustin Hibbits 
2790aeed3e9SJustin Hibbits  @Return        Counter's current value.
2800aeed3e9SJustin Hibbits *//***************************************************************************/
2810aeed3e9SJustin Hibbits uint32_t    BM_GetCounter(t_Handle h_Bm, e_BmCounters counter);
2820aeed3e9SJustin Hibbits 
2830aeed3e9SJustin Hibbits /**************************************************************************//**
2840aeed3e9SJustin Hibbits  @Function      BM_GetRevision
2850aeed3e9SJustin Hibbits 
2860aeed3e9SJustin Hibbits  @Description   Returns the BM revision
2870aeed3e9SJustin Hibbits 
2880aeed3e9SJustin Hibbits  @Param[in]     h_Bm                A handle to a BM Module.
2890aeed3e9SJustin Hibbits  @Param[out]    p_BmRevisionInfo    A structure of revision information parameters.
2900aeed3e9SJustin Hibbits 
2910aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
2920aeed3e9SJustin Hibbits 
2930aeed3e9SJustin Hibbits  @Cautions      Allowed only following QM_Init().
2940aeed3e9SJustin Hibbits *//***************************************************************************/
2950aeed3e9SJustin Hibbits t_Error  BM_GetRevision(t_Handle h_Bm, t_BmRevisionInfo *p_BmRevisionInfo);
2960aeed3e9SJustin Hibbits 
2970aeed3e9SJustin Hibbits /** @} */ /* end of BM_runtime_control_grp group */
2980aeed3e9SJustin Hibbits /** @} */ /* end of BM_lib_grp group */
2990aeed3e9SJustin Hibbits 
3000aeed3e9SJustin Hibbits 
3010aeed3e9SJustin Hibbits /**************************************************************************//**
3020aeed3e9SJustin Hibbits  @Group         BM_portal_grp BM-Portal API
3030aeed3e9SJustin Hibbits 
3040aeed3e9SJustin Hibbits  @Description   BM-Portal API functions, definitions and enums.
3050aeed3e9SJustin Hibbits 
3060aeed3e9SJustin Hibbits  @{
3070aeed3e9SJustin Hibbits *//***************************************************************************/
3080aeed3e9SJustin Hibbits 
3090aeed3e9SJustin Hibbits /**************************************************************************//**
3100aeed3e9SJustin Hibbits  @Group         BM_portal_init_grp BM-Portal Initialization Unit
3110aeed3e9SJustin Hibbits 
3120aeed3e9SJustin Hibbits  @Description   BM-Portal Initialization Unit
3130aeed3e9SJustin Hibbits 
3140aeed3e9SJustin Hibbits  @{
3150aeed3e9SJustin Hibbits *//***************************************************************************/
3160aeed3e9SJustin Hibbits 
3170aeed3e9SJustin Hibbits /**************************************************************************//**
3180aeed3e9SJustin Hibbits  @Description   structure representing BM Portal initialization parameters
3190aeed3e9SJustin Hibbits *//***************************************************************************/
3200aeed3e9SJustin Hibbits typedef struct {
3210aeed3e9SJustin Hibbits     uintptr_t       ceBaseAddress;          /**< Cache-enabled base address (virtual) */
3220aeed3e9SJustin Hibbits     uintptr_t       ciBaseAddress;          /**< Cache-inhibited base address (virtual) */
3230aeed3e9SJustin Hibbits     t_Handle        h_Bm;                   /**< Bm Handle */
3240aeed3e9SJustin Hibbits     e_DpaaSwPortal  swPortalId;             /**< Portal id */
325*852ba100SJustin Hibbits     uintptr_t       irq;                    /**< portal interrupt line; NO_IRQ if interrupts not used */
3260aeed3e9SJustin Hibbits } t_BmPortalParam;
3270aeed3e9SJustin Hibbits 
3280aeed3e9SJustin Hibbits 
3290aeed3e9SJustin Hibbits /**************************************************************************//**
3300aeed3e9SJustin Hibbits  @Function      BM_PORTAL_Config
3310aeed3e9SJustin Hibbits 
3320aeed3e9SJustin Hibbits  @Description   Creates descriptor for the BM Portal;
3330aeed3e9SJustin Hibbits 
3340aeed3e9SJustin Hibbits                 The routine returns a handle (descriptor) to a BM-Portal object;
3350aeed3e9SJustin Hibbits                 This descriptor must be passed as first parameter to all other
3360aeed3e9SJustin Hibbits                 BM-Portal function calls.
3370aeed3e9SJustin Hibbits 
3380aeed3e9SJustin Hibbits                 No actual initialization or configuration of QM-Portal hardware is
3390aeed3e9SJustin Hibbits                 done by this routine.
3400aeed3e9SJustin Hibbits 
3410aeed3e9SJustin Hibbits  @Param[in]     p_BmPortalParam   - Pointer to data structure of parameters
3420aeed3e9SJustin Hibbits 
3430aeed3e9SJustin Hibbits  @Retval        Handle to a BM-Portal object, or NULL for Failure.
3440aeed3e9SJustin Hibbits *//***************************************************************************/
3450aeed3e9SJustin Hibbits t_Handle BM_PORTAL_Config(t_BmPortalParam *p_BmPortalParam);
3460aeed3e9SJustin Hibbits 
3470aeed3e9SJustin Hibbits /**************************************************************************//**
3480aeed3e9SJustin Hibbits  @Function      BM_PORTAL_Init
3490aeed3e9SJustin Hibbits 
3500aeed3e9SJustin Hibbits  @Description   Initializes a BM-Portal module
3510aeed3e9SJustin Hibbits 
3520aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal - A handle to a BM-Portal module
3530aeed3e9SJustin Hibbits 
3540aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
3550aeed3e9SJustin Hibbits *//***************************************************************************/
3560aeed3e9SJustin Hibbits t_Error  BM_PORTAL_Init(t_Handle h_BmPortal);
3570aeed3e9SJustin Hibbits 
3580aeed3e9SJustin Hibbits /**************************************************************************//**
3590aeed3e9SJustin Hibbits  @Function      BM_PortalFree
3600aeed3e9SJustin Hibbits 
3610aeed3e9SJustin Hibbits  @Description   Frees all resources that were assigned to BM Portal module.
3620aeed3e9SJustin Hibbits 
3630aeed3e9SJustin Hibbits                 Calling this routine invalidates the descriptor.
3640aeed3e9SJustin Hibbits 
3650aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal  - BM Portal module descriptor
3660aeed3e9SJustin Hibbits 
3670aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
3680aeed3e9SJustin Hibbits *//***************************************************************************/
3690aeed3e9SJustin Hibbits t_Error     BM_PORTAL_Free(t_Handle h_BmPortal);
3700aeed3e9SJustin Hibbits 
3710aeed3e9SJustin Hibbits /**************************************************************************//**
3720aeed3e9SJustin Hibbits  @Function      BM_PORTAL_ConfigMemAttr
3730aeed3e9SJustin Hibbits 
3740aeed3e9SJustin Hibbits  @Description   Change the memory attributes
3750aeed3e9SJustin Hibbits                 from its default configuration [MEMORY_ATTR_CACHEABLE].
3760aeed3e9SJustin Hibbits 
3770aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal          - A handle to a BM-Portal module
3780aeed3e9SJustin Hibbits  @Param[in]     hwExtStructsMemAttr - memory attributes (cache/non-cache, etc.)
3790aeed3e9SJustin Hibbits 
3800aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
3810aeed3e9SJustin Hibbits 
3820aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_PORTAL_Config() and before BM_PORTAL_Init().
3830aeed3e9SJustin Hibbits *//***************************************************************************/
3840aeed3e9SJustin Hibbits t_Error  BM_PORTAL_ConfigMemAttr(t_Handle h_BmPortal, uint32_t hwExtStructsMemAttr);
3850aeed3e9SJustin Hibbits 
3860aeed3e9SJustin Hibbits /** @} */ /* end of BM_portal_init_grp group */
3870aeed3e9SJustin Hibbits /** @} */ /* end of BM_portal_grp group */
3880aeed3e9SJustin Hibbits 
3890aeed3e9SJustin Hibbits 
3900aeed3e9SJustin Hibbits /**************************************************************************//**
3910aeed3e9SJustin Hibbits  @Group         BM_pool_grp BM-Pool API
3920aeed3e9SJustin Hibbits 
3930aeed3e9SJustin Hibbits  @Description   BM-Pool API functions, definitions and enums.
3940aeed3e9SJustin Hibbits 
3950aeed3e9SJustin Hibbits  @{
3960aeed3e9SJustin Hibbits *//***************************************************************************/
3970aeed3e9SJustin Hibbits 
3980aeed3e9SJustin Hibbits /**************************************************************************//**
3990aeed3e9SJustin Hibbits  @Group         BM_pool_init_grp BM-Pool Initialization Unit
4000aeed3e9SJustin Hibbits 
4010aeed3e9SJustin Hibbits  @Description   BM-Pool Initialization Unit
4020aeed3e9SJustin Hibbits 
4030aeed3e9SJustin Hibbits  @{
4040aeed3e9SJustin Hibbits *//***************************************************************************/
4050aeed3e9SJustin Hibbits 
4060aeed3e9SJustin Hibbits /**************************************************************************//**
4070aeed3e9SJustin Hibbits  @Collection    BM Pool Depletion Thresholds macros
4080aeed3e9SJustin Hibbits                 The thresholds are represent by an array of size MAX_DEPLETION_THRESHOLDS
4090aeed3e9SJustin Hibbits                 Use the following macros to access the appropriate location in the array.
4100aeed3e9SJustin Hibbits *//***************************************************************************/
4110aeed3e9SJustin Hibbits #define BM_POOL_DEP_THRESH_SW_ENTRY 0
4120aeed3e9SJustin Hibbits #define BM_POOL_DEP_THRESH_SW_EXIT  1
4130aeed3e9SJustin Hibbits #define BM_POOL_DEP_THRESH_HW_ENTRY 2
4140aeed3e9SJustin Hibbits #define BM_POOL_DEP_THRESH_HW_EXIT  3
4150aeed3e9SJustin Hibbits 
4160aeed3e9SJustin Hibbits #define MAX_DEPLETION_THRESHOLDS    4
4170aeed3e9SJustin Hibbits /* @} */
4180aeed3e9SJustin Hibbits 
4190aeed3e9SJustin Hibbits 
4200aeed3e9SJustin Hibbits /**************************************************************************//**
4210aeed3e9SJustin Hibbits  @Description   structure representing BM Pool initialization parameters
4220aeed3e9SJustin Hibbits *//***************************************************************************/
4230aeed3e9SJustin Hibbits typedef struct {
4240aeed3e9SJustin Hibbits     t_Handle                    h_Bm;               /**< A handle to a BM Module. */
4250aeed3e9SJustin Hibbits     t_Handle                    h_BmPortal;         /**< A handle to a BM Portal Module.
4260aeed3e9SJustin Hibbits                                                          will be used only for Init and Free routines.
4270aeed3e9SJustin Hibbits                                                          NOTE: if NULL, assuming affinity */
4280aeed3e9SJustin Hibbits     uint32_t                    numOfBuffers;       /**< Number of buffers use by this pool
4290aeed3e9SJustin Hibbits                                                          NOTE: If zero, empty pool buffer is created. */
4300aeed3e9SJustin Hibbits     t_BufferPoolInfo            bufferPoolInfo;     /**< Data buffers pool information */
4310aeed3e9SJustin Hibbits     t_Handle                    h_App;              /**< opaque user value passed as a parameter to callbacks */
4320aeed3e9SJustin Hibbits     bool                        shadowMode;         /**< If TRUE, numOfBuffers will be set to '0'. */
4330aeed3e9SJustin Hibbits     uint8_t                     bpid;               /**< index of the shadow buffer pool (0-BM_MAX_NUM_OF_POOLS).
4340aeed3e9SJustin Hibbits                                                          valid only if shadowMode='TRUE'. */
4350aeed3e9SJustin Hibbits } t_BmPoolParam;
4360aeed3e9SJustin Hibbits 
4370aeed3e9SJustin Hibbits 
4380aeed3e9SJustin Hibbits /**************************************************************************//**
4390aeed3e9SJustin Hibbits  @Function      BM_POOL_Config
4400aeed3e9SJustin Hibbits 
4410aeed3e9SJustin Hibbits  @Description   Creates descriptor for the BM Pool;
4420aeed3e9SJustin Hibbits 
4430aeed3e9SJustin Hibbits                 The routine returns a handle (descriptor) to the BM Pool object.
4440aeed3e9SJustin Hibbits 
4450aeed3e9SJustin Hibbits  @Param[in]     p_BmPoolParam   - A pointer to data structure of parameters
4460aeed3e9SJustin Hibbits 
4470aeed3e9SJustin Hibbits  @Return        Handle to BM Portal object, or NULL for Failure.
4480aeed3e9SJustin Hibbits *//***************************************************************************/
4490aeed3e9SJustin Hibbits t_Handle    BM_POOL_Config(t_BmPoolParam *p_BmPoolParam);
4500aeed3e9SJustin Hibbits 
4510aeed3e9SJustin Hibbits /**************************************************************************//**
4520aeed3e9SJustin Hibbits  @Function      BM_POOL_Init
4530aeed3e9SJustin Hibbits 
4540aeed3e9SJustin Hibbits  @Description   Initializes a BM-Pool module
4550aeed3e9SJustin Hibbits 
4560aeed3e9SJustin Hibbits  @Param[in]     h_BmPool - A handle to a BM-Pool module
4570aeed3e9SJustin Hibbits 
4580aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
4590aeed3e9SJustin Hibbits *//***************************************************************************/
4600aeed3e9SJustin Hibbits t_Error     BM_POOL_Init(t_Handle h_BmPool);
4610aeed3e9SJustin Hibbits 
4620aeed3e9SJustin Hibbits /**************************************************************************//**
4630aeed3e9SJustin Hibbits  @Function      BM_PoolFree
4640aeed3e9SJustin Hibbits 
4650aeed3e9SJustin Hibbits  @Description   Frees all resources that were assigned to BM Pool module.
4660aeed3e9SJustin Hibbits 
4670aeed3e9SJustin Hibbits                 Calling this routine invalidates the descriptor.
4680aeed3e9SJustin Hibbits 
4690aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - BM Pool module descriptor
4700aeed3e9SJustin Hibbits 
4710aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
4720aeed3e9SJustin Hibbits *//***************************************************************************/
4730aeed3e9SJustin Hibbits t_Error     BM_POOL_Free(t_Handle h_BmPool);
4740aeed3e9SJustin Hibbits 
4750aeed3e9SJustin Hibbits /**************************************************************************//**
4760aeed3e9SJustin Hibbits  @Function      BM_POOL_ConfigBpid
4770aeed3e9SJustin Hibbits 
4780aeed3e9SJustin Hibbits  @Description   Config a specific pool id rather than dynamic pool id.
4790aeed3e9SJustin Hibbits 
4800aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-Pool module
4810aeed3e9SJustin Hibbits  @Param[in]     bpid        - index of the buffer pool (0-BM_MAX_NUM_OF_POOLS).
4820aeed3e9SJustin Hibbits 
4830aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
4840aeed3e9SJustin Hibbits 
4850aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_POOL_Config() and before BM_POOL_Init().
4860aeed3e9SJustin Hibbits *//***************************************************************************/
4870aeed3e9SJustin Hibbits t_Error  BM_POOL_ConfigBpid(t_Handle h_BmPool, uint8_t bpid);
4880aeed3e9SJustin Hibbits 
4890aeed3e9SJustin Hibbits /**************************************************************************//**
4900aeed3e9SJustin Hibbits  @Function      BM_POOL_ConfigDepletion
4910aeed3e9SJustin Hibbits 
4920aeed3e9SJustin Hibbits  @Description   Config depletion-entry/exit thresholds and callback.
4930aeed3e9SJustin Hibbits 
4940aeed3e9SJustin Hibbits  @Param[in]     h_BmPool        - A handle to a BM-Pool module
4950aeed3e9SJustin Hibbits  @Param[in]     f_Depletion     - depletion-entry/exit callback.
4960aeed3e9SJustin Hibbits  @Param[in]     thresholds      - depletion-entry/exit thresholds.
4970aeed3e9SJustin Hibbits 
4980aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
4990aeed3e9SJustin Hibbits 
5000aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_POOL_Config() and before BM_POOL_Init();
5010aeed3e9SJustin Hibbits                 Allowed only if shadowMode='FALSE'.
5020aeed3e9SJustin Hibbits                 Allowed only if BM in master mode ('guestId'=NCSW_MASTER_ID), or
5030aeed3e9SJustin Hibbits                 the BM is in guest mode BUT than this routine will invoke IPC
5040aeed3e9SJustin Hibbits                 call to the master.
5050aeed3e9SJustin Hibbits *//***************************************************************************/
5060aeed3e9SJustin Hibbits t_Error  BM_POOL_ConfigDepletion(t_Handle               h_BmPool,
5070aeed3e9SJustin Hibbits                                  t_BmDepletionCallback  *f_Depletion,
5080aeed3e9SJustin Hibbits                                  uint32_t               thresholds[MAX_DEPLETION_THRESHOLDS]);
5090aeed3e9SJustin Hibbits 
5100aeed3e9SJustin Hibbits /**************************************************************************//**
5110aeed3e9SJustin Hibbits  @Function      BM_POOL_ConfigStockpile
5120aeed3e9SJustin Hibbits 
5130aeed3e9SJustin Hibbits  @Description   Config software stockpile.
5140aeed3e9SJustin Hibbits 
5150aeed3e9SJustin Hibbits  @Param[in]     h_BmPool     - A handle to a BM-Pool module
5160aeed3e9SJustin Hibbits  @Param[in]     maxBuffers   - the software data structure size saved for stockpile;
5170aeed3e9SJustin Hibbits                                when reached this value, release to hw command performed.
5180aeed3e9SJustin Hibbits  @Param[in]     minBuffers   - if current capacity is equal or lower then this value,
5190aeed3e9SJustin Hibbits                                acquire from hw command performed.
5200aeed3e9SJustin Hibbits 
5210aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
5220aeed3e9SJustin Hibbits 
5230aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_POOL_Config() and before BM_POOL_Init().
5240aeed3e9SJustin Hibbits *//***************************************************************************/
5250aeed3e9SJustin Hibbits t_Error  BM_POOL_ConfigStockpile(t_Handle h_BmPool, uint16_t maxBuffers, uint16_t minBuffers);
5260aeed3e9SJustin Hibbits 
5270aeed3e9SJustin Hibbits /**************************************************************************//**
5280aeed3e9SJustin Hibbits  @Function      BM_POOL_ConfigBuffContextMode
5290aeed3e9SJustin Hibbits 
5300aeed3e9SJustin Hibbits  @Description   Config the BM pool to set/unset buffer-context
5310aeed3e9SJustin Hibbits 
5320aeed3e9SJustin Hibbits  @Param[in]     h_BmPool     - A handle to a BM-Pool module
5330aeed3e9SJustin Hibbits  @Param[in]     en           - enable/disable buffer context mode
5340aeed3e9SJustin Hibbits 
5350aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
5360aeed3e9SJustin Hibbits 
5370aeed3e9SJustin Hibbits  @Cautions      Allowed only following BM_POOL_Config() and before BM_POOL_Init().
5380aeed3e9SJustin Hibbits *//***************************************************************************/
5390aeed3e9SJustin Hibbits t_Error  BM_POOL_ConfigBuffContextMode(t_Handle h_BmPool, bool en);
5400aeed3e9SJustin Hibbits 
5410aeed3e9SJustin Hibbits /** @} */ /* end of BM_pool_init_grp group */
5420aeed3e9SJustin Hibbits 
5430aeed3e9SJustin Hibbits 
5440aeed3e9SJustin Hibbits /**************************************************************************//**
5450aeed3e9SJustin Hibbits  @Group         BM_pool_runtime_control_grp BM-Pool Runtime Control Unit
5460aeed3e9SJustin Hibbits 
5470aeed3e9SJustin Hibbits  @Description   BM-Pool Runtime control unit API functions, definitions and enums.
5480aeed3e9SJustin Hibbits 
5490aeed3e9SJustin Hibbits  @{
5500aeed3e9SJustin Hibbits *//***************************************************************************/
5510aeed3e9SJustin Hibbits 
5520aeed3e9SJustin Hibbits /**************************************************************************//**
5530aeed3e9SJustin Hibbits  @Description   enum for defining BM Pool counters
5540aeed3e9SJustin Hibbits *//***************************************************************************/
5550aeed3e9SJustin Hibbits typedef enum e_BmPoolCounters {
5560aeed3e9SJustin Hibbits     e_BM_POOL_COUNTERS_CONTENT = 0,         /**< number of free buffers for a particular pool */
5570aeed3e9SJustin Hibbits     e_BM_POOL_COUNTERS_SW_DEPLETION,        /**< number of times pool entered sw depletion */
5580aeed3e9SJustin Hibbits     e_BM_POOL_COUNTERS_HW_DEPLETION         /**< number of times pool entered hw depletion */
5590aeed3e9SJustin Hibbits } e_BmPoolCounters;
5600aeed3e9SJustin Hibbits 
5610aeed3e9SJustin Hibbits /**************************************************************************//**
5620aeed3e9SJustin Hibbits  @Function      BM_POOL_GetId
5630aeed3e9SJustin Hibbits 
5640aeed3e9SJustin Hibbits  @Description   return a buffer pool id.
5650aeed3e9SJustin Hibbits 
5660aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
5670aeed3e9SJustin Hibbits 
5680aeed3e9SJustin Hibbits  @Return        Pool ID.
5690aeed3e9SJustin Hibbits *//***************************************************************************/
5700aeed3e9SJustin Hibbits uint8_t BM_POOL_GetId(t_Handle h_BmPool);
5710aeed3e9SJustin Hibbits 
5720aeed3e9SJustin Hibbits /**************************************************************************//**
5730aeed3e9SJustin Hibbits  @Function      BM_POOL_GetBufferSize
5740aeed3e9SJustin Hibbits 
5750aeed3e9SJustin Hibbits  @Description   returns the pool's buffer size.
5760aeed3e9SJustin Hibbits 
5770aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
5780aeed3e9SJustin Hibbits 
5790aeed3e9SJustin Hibbits  @Return        pool's buffer size.
5800aeed3e9SJustin Hibbits *//***************************************************************************/
5810aeed3e9SJustin Hibbits uint16_t BM_POOL_GetBufferSize(t_Handle h_BmPool);
5820aeed3e9SJustin Hibbits 
5830aeed3e9SJustin Hibbits /**************************************************************************//**
5840aeed3e9SJustin Hibbits  @Function      BM_POOL_GetBufferContext
5850aeed3e9SJustin Hibbits 
5860aeed3e9SJustin Hibbits  @Description   Returns the user's private context that
5870aeed3e9SJustin Hibbits                 should be associated with the buffer.
5880aeed3e9SJustin Hibbits 
5890aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
5900aeed3e9SJustin Hibbits  @Param[in]     p_Buff      - A Pointer to the buffer
5910aeed3e9SJustin Hibbits 
5920aeed3e9SJustin Hibbits  @Return        user's private context.
5930aeed3e9SJustin Hibbits *//***************************************************************************/
5940aeed3e9SJustin Hibbits t_Handle BM_POOL_GetBufferContext(t_Handle h_BmPool, void *p_Buff);
5950aeed3e9SJustin Hibbits 
5960aeed3e9SJustin Hibbits /**************************************************************************//**
5970aeed3e9SJustin Hibbits  @Function      BM_POOL_GetCounter
5980aeed3e9SJustin Hibbits 
5990aeed3e9SJustin Hibbits  @Description   Reads one of the BM Pool counters.
6000aeed3e9SJustin Hibbits 
6010aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
6020aeed3e9SJustin Hibbits  @Param[in]     counter     - The requested counter.
6030aeed3e9SJustin Hibbits 
6040aeed3e9SJustin Hibbits  @Return        Counter's current value.
6050aeed3e9SJustin Hibbits *//***************************************************************************/
6060aeed3e9SJustin Hibbits uint32_t BM_POOL_GetCounter(t_Handle h_BmPool, e_BmPoolCounters counter);
6070aeed3e9SJustin Hibbits 
6080aeed3e9SJustin Hibbits /** @} */ /* end of BM_pool_runtime_control_grp group */
6090aeed3e9SJustin Hibbits 
6100aeed3e9SJustin Hibbits 
6110aeed3e9SJustin Hibbits /**************************************************************************//**
6120aeed3e9SJustin Hibbits  @Group         BM_pool_runtime_data_grp BM-Pool Runtime Data Unit
6130aeed3e9SJustin Hibbits 
6140aeed3e9SJustin Hibbits  @Description   BM-Pool Runtime data unit API functions, definitions and enums.
6150aeed3e9SJustin Hibbits 
6160aeed3e9SJustin Hibbits  @{
6170aeed3e9SJustin Hibbits *//***************************************************************************/
6180aeed3e9SJustin Hibbits 
6190aeed3e9SJustin Hibbits /**************************************************************************//**
6200aeed3e9SJustin Hibbits  @Function      BM_POOL_GetBuf
6210aeed3e9SJustin Hibbits 
6220aeed3e9SJustin Hibbits  @Description   Allocate buffer from a buffer pool.
6230aeed3e9SJustin Hibbits 
6240aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
6250aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal  - A handle to a BM Portal Module;
6260aeed3e9SJustin Hibbits                               NOTE : if NULL, assuming affinity.
6270aeed3e9SJustin Hibbits 
6280aeed3e9SJustin Hibbits  @Return        A Pointer to the allocated buffer.
6290aeed3e9SJustin Hibbits *//***************************************************************************/
6300aeed3e9SJustin Hibbits void *      BM_POOL_GetBuf(t_Handle h_BmPool, t_Handle h_BmPortal);
6310aeed3e9SJustin Hibbits 
6320aeed3e9SJustin Hibbits /**************************************************************************//**
6330aeed3e9SJustin Hibbits  @Function      BM_POOL_PutBuf
6340aeed3e9SJustin Hibbits 
6350aeed3e9SJustin Hibbits  @Description   Deallocate buffer to a buffer pool.
6360aeed3e9SJustin Hibbits 
6370aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
6380aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal  - A handle to a BM Portal Module;
6390aeed3e9SJustin Hibbits                               NOTE : if NULL, assuming affinity.
6400aeed3e9SJustin Hibbits  @Param[in]     p_Buff      - A Pointer to the buffer.
6410aeed3e9SJustin Hibbits 
6420aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
6430aeed3e9SJustin Hibbits *//***************************************************************************/
6440aeed3e9SJustin Hibbits t_Error     BM_POOL_PutBuf(t_Handle h_BmPool, t_Handle h_BmPortal, void *p_Buff);
6450aeed3e9SJustin Hibbits 
6460aeed3e9SJustin Hibbits /**************************************************************************//**
6470aeed3e9SJustin Hibbits  @Function      BM_POOL_FillBufs
6480aeed3e9SJustin Hibbits 
6490aeed3e9SJustin Hibbits  @Description   Fill a BM pool with new buffers.
6500aeed3e9SJustin Hibbits 
6510aeed3e9SJustin Hibbits  @Param[in]     h_BmPool    - A handle to a BM-pool
6520aeed3e9SJustin Hibbits  @Param[in]     h_BmPortal  - A handle to a BM Portal Module;
6530aeed3e9SJustin Hibbits                               NOTE : if NULL, assuming affinity.
6540aeed3e9SJustin Hibbits  @Param[in]     numBufs     - How many buffers to fill into the pool.
6550aeed3e9SJustin Hibbits 
6560aeed3e9SJustin Hibbits  @Return        E_OK on success; Error code otherwise.
6570aeed3e9SJustin Hibbits *//***************************************************************************/
6580aeed3e9SJustin Hibbits t_Error     BM_POOL_FillBufs(t_Handle h_BmPool, t_Handle h_BmPortal, uint32_t numBufs);
6590aeed3e9SJustin Hibbits 
6600aeed3e9SJustin Hibbits /** @} */ /* end of BM_pool_runtime_data_grp group */
6610aeed3e9SJustin Hibbits /** @} */ /* end of BM_pool_grp group */
6620aeed3e9SJustin Hibbits /** @} */ /* end of BM_grp group */
6630aeed3e9SJustin Hibbits 
6640aeed3e9SJustin Hibbits #endif /* __BM_EXT_H */
665