1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /********************************************************************20**
21 Name: PDCP - Database module file
25 Desc: Source code for Database Module functions such as,
40 *********************************************************************21*/
41 static const char* RLOG_MODULE_NAME="PDCP";
42 static int RLOG_MODULE_ID=1024;
43 static int RLOG_FILE_ID=214;
46 /* header (.h) include files */
47 #include "envopt.h" /* environment options */
48 #include "envdep.h" /* environment dependent */
49 #include "envind.h" /* environment independent */
51 #include "gen.h" /* general */
52 #include "ssi.h" /* system services interface */
53 #include "cm5.h" /* Timer Functions */
54 #include "cm_lte.h" /* common LTE header file */
55 #include "cm_hash.h" /* common hash module file */
56 #include "cm_llist.h" /* common list header file */
57 #include "cpj.h" /* RRC layer */
58 #include "pju.h" /* PDCP service user */
59 #include "lpj.h" /* RRC layer */
60 #include "pj_env.h" /* RLC environment options */
61 #include "pj.h" /* RLC layer */
64 /* extern (.x) include files */
65 #include "gen.x" /* general */
66 #include "ssi.x" /* system services interface */
67 #include "cm_lib.x" /* common library */
68 #include "cm5.x" /* Timer Functions */
69 #include "cm_hash.x" /* common hash module */
70 #include "cm_lte.x" /* common LTE file */
71 #include "cm_llist.x" /* common list header file */
72 #include "cpj.x" /* RRC layer */
73 #include "pju.x" /* PDCP service user */
74 #include "lpj.x" /* LM Interface */
75 #include "pj.x" /* RLC layer */
83 /* forward references */
85 /* public variable declarations */
87 /* This structure holds all the global structs we need. */
89 /* private variable declarations */
91 /* private function declarations */
94 @brief PDCP DBM Module
97 /*****************************************************************************
98 * HANDLER FOR THE TRANSMISSION BUFFER
99 ****************************************************************************/
103 * @brief Handler to initialize Buffer
106 * This function is invoked by config to initialize the Buffer
109 * @param[in] buf Rx/Tx Buffer Control Point
110 * @param[in] numBins number of Bins
118 PUBLIC S16 pjDbmBufInit
121 PjBuf *buf, /* !< Rx/Tx Buffer */
122 U8 numBins /* !< number of Bins */
125 PUBLIC S16 pjDbmBufInit(gCb,buf, numBins)
127 PjBuf *buf; /* !< Rx/Tx Buffer */
128 U8 numBins; /* !< number of Bins */
131 U8 hashIndex; /* HashIndex of array */
135 RLOG1(L_DEBUG, "pjDbmBufInit(buf, numBins(%d)", numBins);
137 /* Initialize CmLListCps*/
138 PJ_ALLOC(gCb,buf->datQ, (sizeof(CmLListCp) * numBins));
139 #if (ERRCLASS & ERRCLS_DEBUG)
140 if (buf->datQ == NULLP)
142 RLOG0(L_FATAL, "Memory Allocation failed.");
145 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
147 for(hashIndex = 0; hashIndex < numBins; hashIndex++)
149 cmLListInit(&buf->datQ[hashIndex]);
152 /* Initialistations of buf */
154 buf->numBins = numBins;
160 /********************************************************************30**
163 **********************************************************************/