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"
26 /******************************************************************
28 * @brief Send UE configuration to RLC
32 * Function : duSendUeCreateReqToRlc
34 * Functionality: Send UeCreateReqToRlc
36 * @return ROK - success
39 * ****************************************************************/
40 S16 duSendUeCreateReqToRlc()
46 DU_SET_ZERO(&ueCfg, sizeof(ueCfg));
47 DU_SET_ZERO(&pst, sizeof(Pst));
49 DU_ALLOC(ueCfg, sizeof(CkwCfgInfo));
54 ueCfg->cellId = NR_CELL_ID;
57 for(idx = 0; idx < ueCfg->numEnt; idx++)
60 ueCfg->entCfg[idx].rbId = RB_ID;
61 ueCfg->entCfg[idx].rbType = CM_LTE_DRB;
62 ueCfg->entCfg[idx].lCh[0].lChId = LC_ID;
63 ueCfg->entCfg[idx].lCh[0].type = CM_LTE_LCH_DTCH;
65 ueCfg->entCfg[idx].entMode = CM_LTE_MODE_UM;
66 ueCfg->entCfg[idx].dir = CKW_CFG_DIR_BOTH;
67 switch(ueCfg->entCfg[idx].entMode)
76 ueCfg->entCfg[idx].m.umInfo.dl.snLen = 1; /* For 12 bit SN */
77 ueCfg->entCfg[idx].m.umInfo.ul.snLen = 1; /* For 12 bit SN */
78 ueCfg->entCfg[idx].m.umInfo.ul.reOrdTmr = 10; /* in msec */
89 } /* End of switch(entMode) */
90 } /* End of entity configuration for loop */
93 pst.selector = DU_SELECTOR_LWLC;
94 pst.srcEnt = ENTDUAPP;
96 pst.dstInst = RLC_UL_INST;
97 pst.dstProcId = DU_PROC;
98 pst.srcProcId = DU_PROC;
99 pst.region = duCb.init.region;
102 packUeCreateReq(&pst, ueCfg);
105 } /* End of duSendUeCreateReqToRlc */
107 /*******************************************************************
109 * @brief Handles EGTP data from CU
113 * Function : duHdlEgtpData
116 * Processes EGTP header and sends data to RLC
118 * @params[in] Pointer to EGTP Message
119 * @return ROK - success
122 * ****************************************************************/
123 S16 duHdlEgtpDlData(EgtpMsg *egtpMsg)
125 /* TODO : Extract RbId/UeID/CellID/SduId from database
126 using tunnel id in egtp header */
128 DU_LOG("\nDU_APP : Processing DL data");
131 KwuDatReqInfo datReqInfo;
134 datReqInfo.rlcId.rbId = RB_ID;
135 datReqInfo.rlcId.rbType = CM_LTE_DRB;
136 datReqInfo.rlcId.ueId = UE_ID;
137 datReqInfo.rlcId.cellId = NR_CELL_ID;
139 datReqInfo.sduId = ++sduId;
140 datReqInfo.lcType = CM_LTE_LCH_DTCH;
142 /* Filling pst and Sending to RLC DL */
143 pst.selector = DU_SELECTOR_LWLC;
144 pst.srcEnt = ENTDUAPP;
146 pst.dstInst = RLC_DL_INST;
147 pst.dstProcId = DU_PROC;
148 pst.srcProcId = DU_PROC;
149 pst.region = duCb.init.region;
151 cmPkKwuDatReq(&pst, &datReqInfo, egtpMsg->msg);
155 /*******************************************************************
157 * @brief Handles UL data and send to CU
161 * Function : duHdlRlcUlData
164 * Processes UL Data from RLC and sends to CU
166 * @params[in] Pointer to EGTP Message
167 * @return ROK - success
170 *****************************************************************/
172 PUBLIC S16 duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)
174 DU_LOG("\nDU_APP : Received UL Data at DU_APP");
176 /* Send UL data to CU via EGTP */
177 duSendEgtpDatInd(mBuf);
183 /**********************************************************************
185 ***********************************************************************/