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"
21 #include "du_app_rlc_inf.h"
23 /*******************************************************************
25 * @brief Packs and Sends UE create Request from DUAPP to RLC
29 * Function : packDuRlcUlUeCreateReq
32 * Packs and Sends UE Create Request from DUAPP to RLC
35 * @params[in] Post structure pointer
37 * @return ROK - success
40 * ****************************************************************/
41 uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
45 if(pst->selector == ODU_SELECTOR_LWLC)
47 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
49 DU_LOG("\nRLC : Memory allocation failed at packDuRlcUeCreateReq");
52 /* pack the address of the structure */
53 CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf);
57 DU_LOG("\nRLC: Only LWLC supported for packDuRlcUeCreateReq");
61 return SPstTsk(pst,mBuf);
64 /*******************************************************************
66 * @brief Unpacks UE Create Request received from DU APP
70 * Function : unpackRlcUlUeCreateReq
73 * Unpacks UE Create Request received from DU APP
75 * @params[in] Pointer to Handler
76 * Post structure pointer
78 * @return ROK - success
81 * ****************************************************************/
82 uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf)
84 if(pst->selector == ODU_SELECTOR_LWLC)
87 /* unpack the address of the structure */
88 CMCHKUNPK(cmUnpkPtr, (PTR *)&ueCfg, mBuf);
90 return (*func)(pst, ueCfg);
94 /* Nothing to do for other selectors */
95 DU_LOG("\nRLC: Only LWLC supported for UE Create Request ");
102 /*******************************************************************
104 * @brief Packs and Sends UE create Response from RLC to DUAPP
108 * Function : packRlcUlDuUeCreateRsp
111 * Packs and Sends UE Create Rrsponse from RLC to DUAPP
114 * @params[in] Post structure pointer
116 * @return ROK - success
119 * ****************************************************************/
120 uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfg)
122 Buffer *mBuf = NULLP;
124 if(pst->selector == ODU_SELECTOR_LWLC)
126 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
128 DU_LOG("\nRLC : Memory allocation failed at packRlcUlDuUeCreateRsp");
131 /* pack the address of the structure */
132 CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf);
136 DU_LOG("\nRLC: Only LWLC supported for packRlcUlDuUeCreateRsp");
140 return SPstTsk(pst,mBuf);
143 /*******************************************************************
145 * @brief Unpacks UE Create Response received from DU APP
149 * Function : unpackRlcUlUeCreateRsp
152 * Unpacks UE Create Response received from DU APP
154 * @params[in] Pointer to Handler
155 * Post structure pointer
157 * @return ROK - success
160 * ****************************************************************/
161 uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf)
163 if(pst->selector == ODU_SELECTOR_LWLC)
166 /* unpack the address of the structure */
167 CMCHKUNPK(cmUnpkPtr, (PTR *)&cfgRsp, mBuf);
169 return (*func)(pst, cfgRsp);
173 /* Nothing to do for other selectors */
174 DU_LOG("\nRLC: Only LWLC supported for UE Create Response ");
180 /**********************************************************************
182 **********************************************************************/