blob: 53b961673f577d2796e5f4c06bf61f0afcd05e54 [file] [log] [blame]
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02001/**
2 * @file IxOsalOsBufferMgt.h
3 *
4 * @brief vxworks-specific buffer management module definitions.
5 *
6 * Design Notes:
7 *
8 * @par
9 * IXP400 SW Release version 2.0
10 *
11 * -- Copyright Notice --
12 *
13 * @par
14 * Copyright 2001-2005, Intel Corporation.
15 * All rights reserved.
16 *
17 * @par
Wolfgang Denkc57eadc2013-07-28 22:12:47 +020018 * SPDX-License-Identifier: BSD-3-Clause
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020019 * @par
20 * -- End of Copyright Notice --
21 */
22
23
24#ifndef IX_OSAL_OS_BUFFER_MGT_H
25#define IX_OSAL_OS_BUFFER_MGT_H
26
27/*
28 * use the defaul bufferMgt provided by OSAL framework.
29 */
30#define IX_OSAL_USE_DEFAULT_BUFFER_MGT
31
32#include "IxOsalBufferMgtDefault.h"
33
Wolfgang Denkc16aa052006-05-30 15:58:20 +020034#if 0 /* FIXME */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020035/* Define os-specific buffer macros for subfields */
36#define IX_OSAL_OSBUF_MDATA(osBufPtr) IX_OSAL_MBUF_MDATA(osBufPtr)
37 ( ((M_BLK *) osBufPtr)->m_data )
38
39#define IX_OSAL_OSBUF_MLEN(osBufPtr) \
40 ( ((M_BLK *) osBufPtr)->m_len )
41
42#define IX_OSAL_OSBUF_PKT_LEN(osBufPtr) \
43 ( ((M_BLK *) osBufPtr)->m_pkthdr.len )
44
45#define IX_OSAL_OS_CONVERT_OSBUF_TO_IXPBUF( osBufPtr, ixpBufPtr) \
46 { \
47 IX_OSAL_MBUF_OSBUF_PTR( (IX_OSAL_MBUF *) ixpBufPtr) = (void *) osBufPtr; \
48 IX_OSAL_MBUF_MDATA((IX_OSAL_MBUF *) ixpBufPtr) = IX_OSAL_OSBUF_MDATA(osBufPtr); \
49 IX_OSAL_MBUF_PKT_LEN((IX_OSAL_MBUF *) ixpBufPtr) = IX_OSAL_OSBUF_PKT_LEN(osBufPtr); \
50 IX_OSAL_MBUF_MLEN((IX_OSAL_MBUF *) ixpBufPtr) = IX_OSAL_OSBUF_MLEN(osBufPtr); \
51 }
52
53#define IX_OSAL_OS_CONVERT_IXPBUF_TO_OSBUF( ixpBufPtr, osBufPtr) \
54 { \
55 if (ixpBufPtr == NULL) \
56 { /* Do nothing */ } \
57 else \
58 { \
59 (M_BLK *) osBufPtr = (M_BLK *) IX_OSAL_MBUF_OSBUF_PTR((IX_OSAL_MBUF *) ixpBufPtr); \
60 if (osBufPtr == NULL) \
61 { /* Do nothing */ } \
62 else \
63 { \
64 IX_OSAL_OSBUF_MLEN(osBufPtr) =IX_OSAL_MBUF_MLEN((IX_OSAL_MBUF *) ixpBufPtr); \
65 IX_OSAL_OSBUF_PKT_LEN(osBufPtr) =IX_OSAL_MBUF_PKT_LEN((IX_OSAL_MBUF *) ixpBufPtr); \
66 } \
67 } \
68 }
69
Wolfgang Denkc16aa052006-05-30 15:58:20 +020070#endif /* FIXME */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020071
72#endif /* #define IX_OSAL_OS_BUFFER_MGT_H */