blob: 376c4980cfc155fbedd477784ed0e7d9d3e4b575 [file] [log] [blame]
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02001/**
2 * @file IxOsalBufferMgtDefault.h
3 *
4 * @brief Default buffer pool management and buffer management
5 * definitions.
6 *
7 * Design Notes:
8 *
9 * @par
10 * IXP400 SW Release version 2.0
11 *
12 * -- Copyright Notice --
13 *
14 * @par
15 * Copyright 2001-2005, Intel Corporation.
16 * All rights reserved.
17 *
18 * @par
Wolfgang Denkc57eadc2013-07-28 22:12:47 +020019 * SPDX-License-Identifier: BSD-3-Clause
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020020 * @par
21 * -- End of Copyright Notice --
22 */
23
24#ifndef IX_OSAL_BUFFER_MGT_DEFAULT_H
25#define IX_OSAL_BUFFER_MGT_DEFAULT_H
26
27/**
28 * @enum IxMbufPoolAllocationType
29 * @brief Used to indicate how the pool memory was allocated
30 */
31
32typedef enum
33{
34 IX_OSAL_MBUF_POOL_TYPE_SYS_ALLOC = 0, /**< mbuf pool allocated by the system */
35 IX_OSAL_MBUF_POOL_TYPE_USER_ALLOC /**< mbuf pool allocated by the user */
36} IxOsalMbufPoolAllocationType;
37
38
39/**
40 * @brief Implementation of buffer pool structure for use with non-VxWorks OS
41 */
42
43typedef struct
44{
45 IX_OSAL_MBUF *nextFreeBuf; /**< Pointer to the next free mbuf */
46 void *mbufMemPtr; /**< Pointer to the mbuf memory area */
47 void *dataMemPtr; /**< Pointer to the data memory area */
48 int bufDataSize; /**< The size of the data portion of each mbuf */
49 int totalBufsInPool; /**< Total number of mbufs in the pool */
50 int freeBufsInPool; /**< Number of free mbufs currently in the pool */
51 int mbufMemSize; /**< The size of the pool mbuf memory area */
52 int dataMemSize; /**< The size of the pool data memory area */
53 char name[IX_OSAL_MBUF_POOL_NAME_LEN + 1]; /**< Descriptive name for pool */
54 IxOsalMbufPoolAllocationType poolAllocType;
55 unsigned int poolIdx; /**< Pool Index */
56} IxOsalMbufPool;
57
58typedef IxOsalMbufPool IX_OSAL_MBUF_POOL;
59
60
61PUBLIC IX_STATUS ixOsalBuffPoolUninit (IX_OSAL_MBUF_POOL * pool);
62
63
64#endif /* IX_OSAL_BUFFER_MGT_DEFAULT_H */