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 #include "common_def.h"
20 #include "du_app_rlc_inf.h"
22 /*******************************************************************
24 * @brief Packs and Sends UE create Request from DUAPP to RLC
28 * Function : packDuRlcUlUeCreateReq
31 * Packs and Sends UE Create Request from DUAPP to RLC
34 * @params[in] Post structure pointer
36 * @return ROK - success
39 * ****************************************************************/
40 uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
44 if(pst->selector == ODU_SELECTOR_LWLC)
46 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
48 DU_LOG("\nRLC : Memory allocation failed at packDuRlcUeCreateReq");
51 /* pack the address of the structure */
52 CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf);
56 DU_LOG("\nRLC: Only LWLC supported for packDuRlcUeCreateReq");
60 return SPstTsk(pst,mBuf);
63 /*******************************************************************
65 * @brief Unpacks UE Create Request received from DU APP
69 * Function : unpackRlcUlUeCreateReq
72 * Unpacks UE Create Request received from DU APP
74 * @params[in] Pointer to Handler
75 * Post structure pointer
77 * @return ROK - success
80 * ****************************************************************/
81 uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf)
83 if(pst->selector == ODU_SELECTOR_LWLC)
86 /* unpack the address of the structure */
87 CMCHKUNPK(cmUnpkPtr, (PTR *)&ueCfg, mBuf);
89 return (*func)(pst, ueCfg);
93 /* Nothing to do for other selectors */
94 DU_LOG("\nRLC: Only LWLC supported for UE Create Request ");
101 /*******************************************************************
103 * @brief Packs and Sends UE create Response from RLC to DUAPP
107 * Function : packRlcUlDuUeCreateRsp
110 * Packs and Sends UE Create Rrsponse from RLC to DUAPP
113 * @params[in] Post structure pointer
115 * @return ROK - success
118 * ****************************************************************/
119 uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfg)
121 Buffer *mBuf = NULLP;
123 if(pst->selector == ODU_SELECTOR_LWLC)
125 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
127 DU_LOG("\nRLC : Memory allocation failed at packRlcUlDuUeCreateRsp");
130 /* pack the address of the structure */
131 CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf);
135 DU_LOG("\nRLC: Only LWLC supported for packRlcUlDuUeCreateRsp");
139 return SPstTsk(pst,mBuf);
142 /*******************************************************************
144 * @brief Unpacks UE Create Response received from DU APP
148 * Function : unpackRlcUlUeCreateRsp
151 * Unpacks UE Create Response received from DU APP
153 * @params[in] Pointer to Handler
154 * Post structure pointer
156 * @return ROK - success
159 * ****************************************************************/
160 uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf)
162 if(pst->selector == ODU_SELECTOR_LWLC)
165 /* unpack the address of the structure */
166 CMCHKUNPK(cmUnpkPtr, (PTR *)&cfgRsp, mBuf);
168 return (*func)(pst, cfgRsp);
172 /* Nothing to do for other selectors */
173 DU_LOG("\nRLC: Only LWLC supported for UE Create Response ");
180 /*******************************************************************
182 * @brief Pack and send UL RRC message transfer from RLC to DU APP
186 * Function : packRlcUlRrcMsgToDu
189 * Pack and send UL RRC message transfer from RLC to DU APP
191 * @params[in] Post structure
192 * UL RRC Msg transfer info
193 * @return ROK - success
196 * ****************************************************************/
197 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
199 Buffer *mBuf = NULLP;
201 if(pst->selector == ODU_SELECTOR_LWLC)
203 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
205 DU_LOG("\nRLC : Memory allocation failed at packRlcUlRrcMsgToDu");
208 /* pack the address of the structure */
209 CMCHKPK(cmPkPtr,(PTR)ulRrcMsgInfo, mBuf);
210 return SPstTsk(pst,mBuf);
214 DU_LOG("\nRLC: Only LWLC supported for packRlcUlRrcMsgToDu");
219 /*******************************************************************
221 * @brief Unpack UL RRC Msg Transfer received at DU APP from RLC
225 * Function : unpackRlcUlRrcMsgToDu
228 * Unpack UL RRC Msg Transfer received at DU APP from RLC
231 * @return ROK - success
234 * ****************************************************************/
235 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf)
237 if(pst->selector == ODU_SELECTOR_LWLC)
239 RlcUlRrcMsgInfo *ulRrcMsgInfo;
240 /* unpack the address of the structure */
241 CMCHKUNPK(cmUnpkPtr, (PTR *)&ulRrcMsgInfo, mBuf);
243 return (*func)(pst, ulRrcMsgInfo);
247 /* Nothing to do for other selectors */
248 DU_LOG("\nRLC: Only LWLC supported for UL RRC Message transfer ");
256 /**********************************************************************
258 ***********************************************************************/