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 *******************************************************************************/
18 /* This file contains UE management handling functionality for DU APP */
19 #include "du_ue_mgr.h"
25 /******************************************************************
27 * @brief Send UE configuration to RLC
31 * Function : duSendUeCreateReqToRlc
33 * Functionality: Send UeCreateReqToRlc
35 * @return ROK - success
38 * ****************************************************************/
39 S16 duSendUeCreateReqToRlc()
45 DU_SET_ZERO(&ueCfg, sizeof(ueCfg));
46 DU_SET_ZERO(&pst, sizeof(Pst));
48 DU_ALLOC(ueCfg, sizeof(CkwCfgInfo));
53 ueCfg->cellId = NR_CELL_ID;
56 for(idx = 0; idx < ueCfg->numEnt; idx++)
59 ueCfg->entCfg[idx].rbId = RB_ID;
60 ueCfg->entCfg[idx].rbType = CM_LTE_DRB;
61 ueCfg->entCfg[idx].lCh[0].lChId = LC_ID;
62 ueCfg->entCfg[idx].lCh[0].type = CM_LTE_LCH_DTCH;
64 ueCfg->entCfg[idx].entMode = CM_LTE_MODE_UM;
65 ueCfg->entCfg[idx].dir = CKW_CFG_DIR_BOTH;
66 switch(ueCfg->entCfg[idx].entMode)
75 ueCfg->entCfg[idx].m.umInfo.dl.snLen = 1; /* For 12 bit SN */
76 ueCfg->entCfg[idx].m.umInfo.ul.snLen = 1; /* For 12 bit SN */
77 ueCfg->entCfg[idx].m.umInfo.ul.reOrdTmr = 10; /* in msec */
88 } /* End of switch(entMode) */
89 } /* End of entity configuration for loop */
92 pst.selector = DU_SELECTOR_LWLC;
93 pst.srcEnt = ENTDUAPP;
95 pst.dstInst = RLC_UL_INST;
96 pst.dstProcId = DU_PROC;
97 pst.srcProcId = DU_PROC;
98 pst.region = duCb.init.region;
101 packUeCreateReq(&pst, ueCfg);
104 } /* End of duSendUeCreateReqToRlc */
106 /*******************************************************************
108 * @brief Handles EGTP data from CU
112 * Function : duHdlEgtpData
115 * Processes EGTP header and sends data to RLC
117 * @params[in] Pointer to EGTP Message
118 * @return ROK - success
121 * ****************************************************************/
122 S16 duHdlEgtpDlData(EgtpMsg *egtpMsg)
124 /* TODO : Extract RbId/UeID/CellID/SduId from database
125 using tunnel id in egtp header */
127 DU_LOG("\nDU_APP : Processing DL data");
130 KwuDatReqInfo datReqInfo;
133 datReqInfo.rlcId.rbId = RB_ID;
134 datReqInfo.rlcId.rbType = CM_LTE_DRB;
135 datReqInfo.rlcId.ueId = UE_ID;
136 datReqInfo.rlcId.cellId = NR_CELL_ID;
138 datReqInfo.sduId = ++sduId;
139 datReqInfo.lcType = CM_LTE_LCH_DTCH;
141 /* Filling pst and Sending to RLC DL */
142 pst.selector = DU_SELECTOR_LWLC;
143 pst.srcEnt = ENTDUAPP;
145 pst.dstInst = RLC_DL_INST;
146 pst.dstProcId = DU_PROC;
147 pst.srcProcId = DU_PROC;
148 pst.region = duCb.init.region;
150 cmPkKwuDatReq(&pst, &datReqInfo, egtpMsg->msg);
154 /*******************************************************************
156 * @brief Handles UL data and send to CU
160 * Function : duHdlRlcUlData
163 * Processes UL Data from RLC and sends to CU
165 * @params[in] Pointer to EGTP Message
166 * @return ROK - success
169 *****************************************************************/
171 PUBLIC S16 duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)
173 DU_LOG("\nDU_APP : Received UL Data at DU_APP");
175 /* Send UL data to CU via EGTP */
176 duSendEgtpDatInd(mBuf);
182 /**********************************************************************
184 ***********************************************************************/