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 "common_def.h"
29 #include "du_app_mac_inf.h"
30 #include "du_app_rlc_inf.h"
33 #include<ProtocolIE-Field.h>
36 #include "du_f1ap_msg_hdl.h"
37 #include "du_ue_mgr.h"
43 DuMacDlCcchInd packMacDlCcchIndOpts[] =
45 packMacDlCcchInd, /* Loose coupling */
46 MacProcDlCcchInd, /* TIght coupling */
47 packMacDlCcchInd /* Light weight-loose coupling */
50 DuMacUeCreateReq packMacUeCreateReqOpts[] =
52 packDuMacUeCreateReq, /* Loose coupling */
53 MacProcUeCreateReq, /* TIght coupling */
54 packDuMacUeCreateReq /* Light weight-loose coupling */
57 DuRlcUeCreateReq packRlcUeCreateReqOpts[] =
59 packDuRlcUeCreateReq, /* Loose coupling */
60 RlcProcUeCreateReq, /* TIght coupling */
61 packDuRlcUeCreateReq /* Light weight-loose coupling */
64 DuDlRrcMsgToRlcFunc duSendDlRrcMsgToRlcOpts[] =
66 packDlRrcMsgToRlc, /* Loose coupling */
67 RlcProcDlRrcMsgTransfer, /* Tight coupling */
68 packDlRrcMsgToRlc /* Light weight-loose coupling */
71 DuRlcUeReconfigReq packRlcUeReconfigReqOpts[] =
73 packDuRlcUeReconfigReq, /* Loose coupling */
74 RlcProcUeReconfigReq, /* TIght coupling */
75 packDuRlcUeReconfigReq /* Light weight-loose coupling */
78 DuMacUeReconfigReq packMacUeReconfigReqOpts[] =
80 packDuMacUeReconfigReq, /* Loose coupling */
81 MacProcUeReconfigReq, /* TIght coupling */
82 packDuMacUeReconfigReq /* Light weight-loose coupling */
84 /*******************************************************************
86 * @brief Handles EGTP data from CU
90 * Function : duHdlEgtpData
93 * Processes EGTP header and sends data to RLC
95 * @params[in] Pointer to EGTP Message
96 * @return ROK - success
99 * ****************************************************************/
100 uint8_t duHdlEgtpDlData(EgtpMsg *egtpMsg)
103 /* TODO : Extract RbId/UeID/CellID/SduId from database
104 using tunnel id in egtp header */
106 DU_LOG("\nDU_APP : Processing DL data");
109 KwuDatReqInfo datReqInfo;
111 datReqInfo.rlcId.rbId = RB_ID;
112 datReqInfo.rlcId.rbType = CM_LTE_DRB;
113 datReqInfo.rlcId.ueId = UE_ID;
114 datReqInfo.rlcId.cellId = NR_CELL_ID;
116 datReqInfo.sduId = ++sduId;
117 datReqInfo.lcType = CM_LTE_LCH_DTCH;
119 /* Filling pst and Sending to RLC DL */
120 pst.selector = ODU_SELECTOR_LWLC;
121 pst.srcEnt = ENTDUAPP;
123 pst.dstInst = RLC_DL_INST;
124 pst.dstProcId = DU_PROC;
125 pst.srcProcId = DU_PROC;
126 pst.region = duCb.init.region;
128 cmPkKwuDatReq(&pst, &datReqInfo, egtpMsg->msg);
130 //duBuildAndSendDlRrcMsgToRlc();
135 /******************************************************************
137 * @brief Builds and Sends DL CCCH Ind to MAC
141 * Function : duBuildAndSendDlCcchInd
143 * Functionality: Builds and sends DL CCCH Ind Msg to MAC
145 * @params[in] dlCcchMsg - uint8_t*
146 * @return ROK - success
149 * ****************************************************************/
150 uint8_t duBuildAndSendDlCcchInd(uint16_t *cellId, uint16_t *crnti, \
151 DlCcchMsgType msgType, uint16_t dlCcchMsgSize, uint8_t *dlCcchMsg)
155 DlCcchIndInfo *dlCcchIndInfo = NULLP;
158 DU_LOG("\nDU APP : Building and Sending DL CCCH Ind to MAC");
160 DU_ALLOC_SHRABL_BUF(dlCcchIndInfo, sizeof(DlCcchIndInfo));
164 DU_LOG("\nDU APP : Memory alloc failed while building DL CCCH Ind");
168 dlCcchIndInfo->cellId = *cellId;
169 dlCcchIndInfo->crnti = *crnti;
170 dlCcchIndInfo->msgType = msgType;
171 dlCcchIndInfo->dlCcchMsgLen = dlCcchMsgSize;
173 DU_ALLOC_SHRABL_BUF(dlCcchIndInfo->dlCcchMsg, dlCcchIndInfo->dlCcchMsgLen);
174 if(!dlCcchIndInfo->dlCcchMsg)
176 DU_LOG("\nDU APP : Memory alloc failed while building DL CCCH Ind");
177 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlCcchIndInfo, sizeof(DlCcchIndInfo));
180 for(idx2 = 0; idx2 < dlCcchIndInfo->dlCcchMsgLen; idx2++)
182 dlCcchIndInfo->dlCcchMsg[idx2] = dlCcchMsg[idx2];
184 DU_FREE(dlCcchMsg, dlCcchMsgSize);
187 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_CCCH_IND);
188 ret = (*packMacDlCcchIndOpts[pst.selector])(&pst, dlCcchIndInfo);
191 DU_LOG("\nDU_APP : Failure in sending DL CCCH to MAC");
192 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlCcchIndInfo->dlCcchMsg,\
193 dlCcchIndInfo->dlCcchMsgLen);
194 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlCcchIndInfo, \
195 sizeof(DlCcchIndInfo));
203 /*******************************************************************
205 * @brief Build and Send DL RRC Message transfer to RLC
209 * Function : duBuildAndSendDlRrcMsgToRlc
212 * Build and Send DL RRC Message transfer to RLC
214 * @params[in] Cell ID
216 * Logical Channgel ID
219 * @return ROK - success
222 * ****************************************************************/
223 uint8_t duBuildAndSendDlRrcMsgToRlc(uint16_t cellId, RlcUeCfg ueCfg, \
224 uint8_t lcId, bool execDup, bool deliveryStaReq, uint16_t rrcMsgLen, uint8_t *rrcMsg)
229 RlcDlRrcMsgInfo *dlRrcMsgInfo;
231 DU_ALLOC_SHRABL_BUF(dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
234 DU_LOG("\nDU APP : Memory allocation failed for dlRrcMsgInfo in \
235 duBuildAndSendDlRrcMsgToRlc");
236 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rrcMsg, rrcMsgLen);
240 /* Filling up the RRC msg info */
241 dlRrcMsgInfo->cellId = cellId;
242 dlRrcMsgInfo->ueIdx = ueCfg.ueIdx;
243 for(lcIdx = 0; lcIdx <= MAX_NUM_LC; lcIdx++)
245 if(ueCfg.rlcLcCfg[lcIdx].lcId == lcId)
247 dlRrcMsgInfo->rbType = ueCfg.rlcLcCfg[lcIdx].rbType;
248 dlRrcMsgInfo->rbId = ueCfg.rlcLcCfg[lcIdx].rbId;
249 dlRrcMsgInfo->lcType = ueCfg.rlcLcCfg[lcIdx].lcType;
250 dlRrcMsgInfo->lcId = ueCfg.rlcLcCfg[lcIdx].lcId;
254 dlRrcMsgInfo->execDup = execDup;
255 dlRrcMsgInfo->deliveryStaRpt = deliveryStaReq;
256 dlRrcMsgInfo->rrcMsg = rrcMsg;
257 dlRrcMsgInfo->msgLen = rrcMsgLen;
259 /* Filling post structure and sending msg */
260 FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_RRC_MSG_TRANS_TO_RLC);
261 ret = (*duSendDlRrcMsgToRlcOpts[pst.selector])(&pst, dlRrcMsgInfo);
264 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rrcMsg, rrcMsgLen);
265 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
274 /******************************************************************
276 * @brief Processes DL RRC Message Transfer sent by CU
280 * Function : procDlRrcMsgTrans
282 * Functionality: Processes DL RRC Message Transfer sent by CU
284 * @params[in] F1AP_PDU_t ASN decoded F1AP message
285 * @return ROK - success
288 * ****************************************************************/
289 uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
291 DLRRCMessageTransfer_t *dlRrcMsg = NULLP;
292 uint8_t *rrcMsgPdu = NULLP;
293 uint8_t ieIdx, ueIdx, cellIdx;
295 uint16_t byteIdx, crnti, cellId, rrcMsgSize;
296 uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
297 bool execDup = false;
298 bool deliveryStaRpt = false;
299 bool ueFound = false;
300 bool ueCcchCtxtFound = false;
302 DU_LOG("\nDU_APP : DL RRC message transfer Recevied");
304 dlRrcMsg = &f1apMsg->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
308 for(ieIdx=0; ieIdx<dlRrcMsg->protocolIEs.list.count; ieIdx++)
310 switch(dlRrcMsg->protocolIEs.list.array[ieIdx]->id)
312 case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
314 gnbCuUeF1apId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
317 case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
319 gnbDuUeF1apId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
322 case ProtocolIE_ID_id_SRBID:
324 srbId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.SRBID;
327 case ProtocolIE_ID_id_ExecuteDuplication:
332 case ProtocolIE_ID_id_RRCContainer:
334 if(dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size > 0)
336 rrcMsgSize = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size;
337 DU_ALLOC(rrcMsgPdu, rrcMsgSize);
340 DU_LOG("\nDU_APP : Memory allocation failed in procDlRrcMsgTrans");
343 for(byteIdx = 0; byteIdx < rrcMsgSize; byteIdx++)
345 rrcMsgPdu[byteIdx] = \
346 dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf[byteIdx];
351 DU_LOG("\nDU_APP : RRC Container Size is invalid:%ld",\
352 dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
357 case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
359 deliveryStaRpt = true;
363 DU_LOG("\nDU_APP : Invalid IE received in DL RRC Msg Transfer:%ld",
364 dlRrcMsg->protocolIEs.list.array[ieIdx]->id);
368 if(srbId == SRB1_LCID) //RRC connection setup
370 for(ueIdx=0; ueIdx < duCb.numUe; ueIdx++)
372 if(gnbDuUeF1apId == duCb.ueCcchCtxt[ueIdx].gnbDuUeF1apId)
374 ueCcchCtxtFound = true;
375 crnti = duCb.ueCcchCtxt[ueIdx].crnti;
376 cellId = duCb.ueCcchCtxt[ueIdx].cellId;
383 ret = duBuildAndSendDlCcchInd(&cellId, &crnti, RRC_SETUP, rrcMsgSize, rrcMsgPdu);
386 DU_LOG("\nDU_APP: Falied to build DlCcch Ind at procDlRrcMsgTrans()");
390 if(duCb.actvCellLst[cellId-1]->numActvUes < MAX_NUM_UE)
392 ret = duCreateUeCb(&duCb.ueCcchCtxt[ueIdx], gnbCuUeF1apId);
395 DU_LOG("\nDU_APP: Failed to createUeCb for cellId [%d] at procDlRrcMsgTrans()", \
396 duCb.ueCcchCtxt[ueIdx].cellId);
402 DU_LOG("\nDU_APP: Max Active UEs has reached at procDlRrcMsgTrans()");
409 for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
411 for(ueIdx = 0 ; ueIdx < MAX_NUM_UE; ueIdx++)
413 if((gnbCuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId)
414 && (gnbDuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId))
417 ret = duBuildAndSendDlRrcMsgToRlc(duCb.actvCellLst[cellIdx]->cellId, \
418 duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg, srbId, \
419 execDup, deliveryStaRpt, rrcMsgSize, rrcMsgPdu);
432 /******************************************************************
434 * @brief Generates GNB DU Ue F1AP ID
438 * Function : genGnbDuUeF1apId
440 * Functionality: Generates GNB DU Ue F1AP ID
443 * @return gnbDuF1apId
445 * ****************************************************************/
446 uint32_t genGnbDuUeF1apId()
448 static uint32_t gnbDuUeF1apId = 0;
450 return ++gnbDuUeF1apId;
453 /******************************************************************
455 * @brief Processes UL CCCH Ind recvd from MAC
459 * Function : duProcUlCcchInd
461 * Functionality: Processes UL CCCH Ind recvd from MAC
463 * @params[in] UlCcchIndInfo *ulCcchIndInfo
464 * @return ROK - success
467 * ****************************************************************/
468 uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo)
472 uint32_t gnbDuUeF1apId = 0;
474 gnbDuUeF1apId = genGnbDuUeF1apId();
476 /* Store Ue mapping */
477 duCb.ueCcchCtxt[duCb.numUe].gnbDuUeF1apId = gnbDuUeF1apId;
478 duCb.ueCcchCtxt[duCb.numUe].crnti = ulCcchIndInfo->crnti;
479 duCb.ueCcchCtxt[duCb.numUe].cellId = ulCcchIndInfo->cellId;
483 ret = (BuildAndSendInitialRrcMsgTransfer(gnbDuUeF1apId, ulCcchIndInfo->crnti, ulCcchIndInfo->ulCcchMsgLen,
484 ulCcchIndInfo->ulCcchMsg));
487 DU_LOG("\nDU_APP : BuildAndSendInitialRrcMsgTransfer failed");
490 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, ulCcchIndInfo->ulCcchMsg, ulCcchIndInfo->ulCcchMsgLen);
491 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, ulCcchIndInfo, sizeof(UlCcchIndInfo));
497 /******************************************************************
499 * @brief Fills Default UL LC Cfg
503 * Function : fillDefaultUlLcCfg
505 * Functionality: Fills Default UL LC Cfg
508 *****************************************************************/
509 void fillDefaultUlLcCfg(UlLcCfg *ulLcCfg)
511 ulLcCfg->priority = LC_PRIORITY_1;
512 ulLcCfg->lcGroup = 0;
513 ulLcCfg->schReqId = 0;
514 ulLcCfg->pbr = PBR_KBPS_INFINITY;
515 ulLcCfg->bsd = BSD_MS_1000;
518 /******************************************************************
520 * @brief Fills Initial DL Bandwidth Part
524 * Function : fillDefaultInitDlBwp
526 * Functionality: Fills Initial DL Bandwidth Part
529 *****************************************************************/
530 void fillDefaultInitDlBwp(InitialDlBwp *initDlBwp)
533 uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
534 uint8_t coreset0EndPrb, coreset1StartPrb, coreset1NumPrb;
539 /* Filling PDCCH Config */
540 initDlBwp->pdcchPresent = TRUE;
541 if(initDlBwp->pdcchPresent)
543 initDlBwp->pdcchCfg.numCRsetToAddMod = PDCCH_CTRL_RSRC_SET_ONE_ID;
544 memset(initDlBwp->pdcchCfg.cRSetToAddModList, 0, MAX_NUM_CRSET);
545 if(initDlBwp->pdcchCfg.numCRsetToAddMod <= MAX_NUM_CRSET)
547 initDlBwp->pdcchCfg.cRSetToAddModList[idx].cRSetId = \
548 PDCCH_CTRL_RSRC_SET_ONE_ID;
549 memset(initDlBwp->pdcchCfg.cRSetToAddModList[idx].freqDomainRsrc, 0,\
551 coreset0EndPrb = CORESET0_END_PRB;
552 coreset1StartPrb = coreset0EndPrb +6;
553 coreset1NumPrb = CORESET1_NUM_PRB;
554 /* calculate the PRBs */
555 freqDomRscAllocType0(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
556 memcpy(initDlBwp->pdcchCfg.cRSetToAddModList[idx].freqDomainRsrc, freqDomainResource,
559 initDlBwp->pdcchCfg.cRSetToAddModList[idx].duration = \
560 PDCCH_CTRL_RSRC_SET_ONE_DURATION;
561 initDlBwp->pdcchCfg.cRSetToAddModList[idx].cceRegMappingType = \
562 CCE_REG_MAPPINGTYPE_PR_NONINTERLEAVED;
563 initDlBwp->pdcchCfg.cRSetToAddModList[idx].precoderGranularity = \
565 initDlBwp->pdcchCfg.cRSetToAddModList[idx].dmrsScramblingId = \
568 initDlBwp->pdcchCfg.numCRsetToRel = 0;
569 /* Filling Serach Space */
570 initDlBwp->pdcchCfg.numSearchSpcToAddMod = PDCCH_CTRL_RSRC_SET_ONE_ID;
571 memset(initDlBwp->pdcchCfg.searchSpcToAddModList, 0, MAX_NUM_CRSET);
572 if(initDlBwp->pdcchCfg.numSearchSpcToAddMod <= MAX_NUM_CRSET)
574 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].searchSpaceId =\
575 PDCCH_SRCH_SPC_TWO_ID;
576 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].cRSetId = \
577 PDCCH_CTRL_RSRC_SET_ONE_ID;
578 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].\
579 mSlotPeriodicityAndOffset = SLOTPERIODICITYANDOFFSET_PR_SL1;
580 memset(initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot, 0,\
581 MONITORING_SYMB_WITHIN_SLOT_SIZE);
582 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot[idx] =\
583 PDCCH_SYMBOL_WITHIN_SLOT;
584 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel1 =\
586 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel2 =\
588 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel4 =\
590 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel8 =\
592 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel16 =\
594 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].searchSpaceType = \
595 SEARCHSPACETYPE_PR_UE_SPECIFIC;
596 initDlBwp->pdcchCfg.searchSpcToAddModList[idx].ueSpecificDciFormat =\
597 PDCCH_SRCH_SPC_TWO_UE_SPEC_DCI_FORMAT;
599 initDlBwp->pdcchCfg.numSearchSpcToRel = 0;
603 /* Filling PDSCH Config */
604 initDlBwp->pdschPresent = TRUE;
605 if(initDlBwp->pdschPresent)
607 initDlBwp->pdschCfg.dmrsDlCfgForPdschMapTypeA.addPos = ADDITIONALPOSITION_POS0;
608 initDlBwp->pdschCfg.resourceAllocType = RESOURCEALLOCATION_TYPE1;
609 initDlBwp->pdschCfg.numTimeDomRsrcAlloc = 1;
610 initDlBwp->pdschCfg.timeDomRsrcAllociList[idx].mappingType = \
612 initDlBwp->pdschCfg.timeDomRsrcAllociList[idx].startSymbol = PDSCH_START_SYMBOL;
613 initDlBwp->pdschCfg.timeDomRsrcAllociList[idx].symbolLength = PDSCH_LENGTH_SYMBOL;
614 initDlBwp->pdschCfg.timeDomRsrcAllociList[idx].startSymbolAndLength = \
615 calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
616 initDlBwp->pdschCfg.rbgSize = RBG_SIZE_CONFIG1;
617 initDlBwp->pdschCfg.numCodeWordsSchByDci = CODEWORDS_SCHED_BY_DCI_N1;
618 initDlBwp->pdschCfg.bundlingType = TYPE_STATIC_BUNDLING;
619 initDlBwp->pdschCfg.bundlingInfo.StaticBundling.size = 0;
625 /******************************************************************
627 * @brief Fills Initial UL Bandwidth Part
631 * Function : fillDefaultInitUlBwp
633 * Functionality: Fills Initial UL Bandwidth Part
636 *****************************************************************/
637 void fillDefaultInitUlBwp(InitialUlBwp *initUlBwp)
642 initUlBwp->pucchPresent = FALSE;
644 /*Filling PUSCH Config */
645 initUlBwp->puschPresent = TRUE;
646 if(initUlBwp->puschPresent)
648 initUlBwp->puschCfg.dataScramblingId = SCRAMBLING_ID;
649 initUlBwp->puschCfg.dmrsUlCfgForPuschMapTypeA.addPos = ADDITIONALPOSITION_POS0;
650 initUlBwp->puschCfg.dmrsUlCfgForPuschMapTypeA.transPrecodDisabled. \
651 scramblingId0 = SCRAMBLING_ID;
652 initUlBwp->puschCfg.resourceAllocType = RESOURCEALLOCATION_TYPE1;
653 initUlBwp->puschCfg.numTimeDomRsrcAlloc = 1;
655 if(initUlBwp->puschCfg.numTimeDomRsrcAlloc <= MAX_NUM_UL_ALLOC)
657 initUlBwp->puschCfg.timeDomRsrcAllocList[idx].k2 = PUSCH_K2;
658 initUlBwp->puschCfg.timeDomRsrcAllocList[idx].mappingType =\
660 initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbol = PUSCH_START_SYMBOL;
661 initUlBwp->puschCfg.timeDomRsrcAllocList[idx].symbolLength = PUSCH_LENGTH_SYMBOL;
662 initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbolAndLength =\
663 calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
665 initUlBwp->puschCfg.transformPrecoder = TRANSFORM_PRECODER_DISABLED;
670 DU_LOG("\n DUAPP: Memory is NULL of InitalUlBwp");
674 /******************************************************************
676 * @brief Fills SpCell Group Info
680 * Function : fillDefaultSpCellGrpInfo
682 * Functionality: Fills Sp Cell Group Info
685 *****************************************************************/
686 void fillDefaultSpCellGrpInfo(SpCellCfg *spCell)
690 spCell->servCellIdx = SERV_CELL_IDX;
691 /* Filling Initial Dl Bwp */
692 fillDefaultInitDlBwp(&spCell->servCellCfg.initDlBwp);
694 spCell->servCellCfg.numDlBwpToAdd = 0;
695 spCell->servCellCfg.firstActvDlBwpId = ACTIVE_DL_BWP_ID;
696 spCell->servCellCfg.defaultDlBwpId = ACTIVE_DL_BWP_ID;
697 spCell->servCellCfg.bwpInactivityTmr = NULLP;
698 spCell->servCellCfg.pdschServCellCfg.maxMimoLayers = NULLP;
699 spCell->servCellCfg.pdschServCellCfg.maxCodeBlkGrpPerTb = NULLP;
700 spCell->servCellCfg.pdschServCellCfg.codeBlkGrpFlushInd = NULLP;
701 spCell->servCellCfg.pdschServCellCfg.xOverhead = NULLP;
702 spCell->servCellCfg.pdschServCellCfg.numHarqProcForPdsch =\
703 NUM_HARQ_PROC_FOR_PDSCH_N_16;
704 /* Filling Initial UL Bwp*/
705 fillDefaultInitUlBwp(&spCell->servCellCfg.initUlBwp);
706 spCell->servCellCfg.numUlBwpToAdd = 0;
707 spCell->servCellCfg.firstActvUlBwpId = ACTIVE_DL_BWP_ID;
711 DU_LOG("\n DU_APP: Memory is NULL for SpCellGrp");
715 /******************************************************************
717 * @brief Fills Physical Cell Group Info
721 * Function : fillDefaultPhyCellGrpInfo
723 * Functionality: Fills Physical Cell Group Info
726 *****************************************************************/
727 void fillDefaultPhyCellGrpInfo(PhyCellGrpCfg *cellGrp)
731 cellGrp->pdschHarqAckCodebook = PDSCH_HARQ_ACK_CODEBOOK_DYNAMIC;
732 cellGrp->pNrFr1 = P_NR_FR1;
736 DU_LOG("\nDUAPP: Memory is NULL for Physical Cell Group");
740 /******************************************************************
742 * @brief Fills Mac Cell Group Info
746 * Function : fillDefaultMacCellGrpInfo
748 * Functionality: Fills Mac Cell Group Info
751 *****************************************************************/
752 void fillDefaultMacCellGrpInfo(MacCellGrpCfg *cellGrp)
758 /* Filling Scheduling Request Config */
759 cellGrp->schReqCfg.addModListCount = 1;
760 if(cellGrp->schReqCfg.addModListCount <= MAX_NUM_SR_CFG_PER_CELL_GRP)
762 for(idx = 0; idx < cellGrp->schReqCfg.addModListCount; idx++)
764 cellGrp->schReqCfg.addModList[idx].schedReqId = SCH_REQ_ID;
765 cellGrp->schReqCfg.addModList[idx].srProhibitTmr = SR_PROHIBIT_MS_32;
766 cellGrp->schReqCfg.addModList[idx].srTransMax = SR_TRANS_MAX_N_16;
769 cellGrp->schReqCfg.relListCount = 0;
771 /* Filling Tag config */
772 cellGrp->tagCfg.addModListCount = 1;
773 if(cellGrp->tagCfg.addModListCount <= MAC_NUM_TAGS)
775 for(idx = 0; idx < cellGrp->tagCfg.addModListCount; idx++)
777 cellGrp->tagCfg.addModList[idx].tagId = TAG_ID;
778 cellGrp->tagCfg.addModList[idx].timeAlignTimer = TIME_ALIGNMENT_TIMER_INFINITY;
781 cellGrp->tagCfg.relListCount = 0;
783 /* Filling BSR config */
784 cellGrp->bsrTmrCfg.periodicTimer = BSR_PERIODIC_TIMER_SF_10;
785 cellGrp->bsrTmrCfg.retxTimer = BSR_RETX_TIMER_SF_320;
786 cellGrp->bsrTmrCfg.srDelayTimer = BSR_SR_DELAY_TMR_2560;
788 /* Filling PHR config */
789 cellGrp->phrCfgSetupPres = true;
790 cellGrp->phrCfg.periodicTimer = PHR_PERIODIC_TIMER_INFINITY;
791 cellGrp->phrCfg.prohibitTimer = PHR_PROHIBIT_TIMER_SF_0;
792 cellGrp->phrCfg.txPowerFactor = PHR_TX_PWR_FACTOR_CHANGE_INFINITY;
793 cellGrp->phrCfg.multiplePHR = false;
794 cellGrp->phrCfg.dummy = false;
795 cellGrp->phrCfg.phrType2OtherCell = false;
796 cellGrp->phrCfg.phrOtherCG = PHR_MODE_OTHER_CG_REAL;
801 DU_LOG("\nDUAPP: Memory is NULL for Master Cell Group");
807 void fillMacSrb1LcCfg(LcCfg *macLcCfg)
809 macLcCfg->lcId = SRB1_LCID;
810 macLcCfg->configType = CONFIG_ADD;
811 macLcCfg->drbQos = NULLP;
812 macLcCfg->snssai = NULLP;
813 macLcCfg->ulLcCfgPres = true;
814 fillDefaultUlLcCfg(&macLcCfg->ulLcCfg);
817 /******************************************************************
819 * @brief Function to fill the Lc cfg from ueSetupReqDb
823 * Function : fillMacLcCfgToAddMod
825 * Functionality: Function to fill the Lc cfg from ueSetupReqDb
828 *****************************************************************/
830 uint8_t fillMacLcCfgToAddMod(LcCfg *lcCfg, LcCfg *ueSetReqDb)
833 lcCfg->lcId = ueSetReqDb->lcId;
834 lcCfg->configType = ueSetReqDb->configType;
836 if(ueSetReqDb->drbQos)
840 DU_ALLOC_SHRABL_BUF(lcCfg->drbQos, sizeof(DrbQosInfo));
843 DU_LOG("\nDU APP: Memory Alloc failed at drQos at fillMacLcCfgToAddMod()");
849 memcpy(lcCfg->drbQos, ueSetReqDb->drbQos, sizeof(DrbQosInfo));
854 lcCfg->drbQos = NULLP;
858 if(ueSetReqDb->snssai && ret == ROK)
862 DU_ALLOC_SHRABL_BUF(lcCfg->snssai, sizeof(Snssai));
865 DU_LOG("\nDU APP: Memory Alloc failed at snnsai at fillMacLcCfgToAddMod()");
871 memcpy(lcCfg->snssai, ueSetReqDb->snssai, sizeof(Snssai));
876 lcCfg->snssai = NULLP;
879 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
880 lcCfg->drbQos = NULLP;
883 lcCfg->ulLcCfgPres = ueSetReqDb->ulLcCfgPres;
884 memcpy(&lcCfg->ulLcCfg, &ueSetReqDb->ulLcCfg, sizeof(UlLcCfg));
885 memcpy(&lcCfg->dlLcCfg, &ueSetReqDb->dlLcCfg, sizeof(DlLcCfg));
889 /******************************************************************
891 * @brief Function to copy the Bit rate from ueSetupReqDb
895 * Function : getMaxAggrBitRate
897 * Functionality: Function to copy bit Rate from ueSetupReqDb
900 *****************************************************************/
902 uint8_t getMaxAggrBitRate(MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate)
908 DU_ALLOC_SHRABL_BUF(macBitRate, sizeof(MaxAggrBitRate));
911 DU_LOG("\nDUAPP: Memory Alloc Failed at getMaxAggrBitRate()");
915 memcpy(macBitRate, ueDbBitRate, sizeof(MaxAggrBitRate));
924 /******************************************************************
926 * @brief Builds and Send UE ReConfig Request to MAC
930 * Function : sendUeReCfgReqToMac
932 * Functionality: Builds and Send UE ReConfig Request to MAC
934 * @Params[in] MacUeCfg *
935 * @return ROK - success
938 * ****************************************************************/
940 uint8_t sendUeReCfgReqToMac(MacUeCfg *macUeCfg)
946 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_RECONFIG_REQ);
950 /* Processing one Ue at a time to MAC */
951 DU_LOG("\nDU_APP: Sending Reconfig Request to MAC");
952 ret = (*packMacUeReconfigReqOpts[pst.selector])(&pst, macUeCfg);
955 DU_LOG("\nDU_APP: Failed to send Reconfig Request to MAC at sendUeReCfgReqToMac()");
956 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macUeCfg, sizeof(MacUeCfg));
961 DU_LOG("\n DU_APP: Received macUeCfg is NULLP at sendUeReCfgReqToMac()");
967 /******************************************************************
969 * @brief Function to return Drb LcId
973 * Function : getDrbLcId
975 * Functionality: Function to return Drb LcId
977 *Returns: lcId - SUCCESS
979 *****************************************************************/
981 uint8_t getDrbLcId(uint32_t *drbBitMap)
983 uint8_t bitMask = 1, bitPos = 0;
984 bitPos = MIN_DRB_LCID;
986 while(bitPos <= MAX_DRB_LCID)
988 if((*drbBitMap & (bitMask << bitPos)) == 0)
990 *drbBitMap = ((bitMask << bitPos)| *drbBitMap);
998 DU_LOG("\nDU_APP: Max LC Reached in getDrbLcId()");
1002 /******************************************************************
1004 * @brief Fills MacUeCfg structure
1008 * Function : fillMacUeCfg
1010 * Functionality: Fills MacUeCfg
1013 *****************************************************************/
1014 uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
1015 UeContextSetupDb *ueCfgDb, MacUeCfg *macUeCfg)
1017 uint8_t ret, dbIdx, lcIdx, cellIdx;
1018 bool lcIdFound = false;
1019 MacUeCfg *duMacDb = NULLP;
1025 macUeCfg->cellId = cellId;
1026 macUeCfg->ueIdx = ueIdx;
1027 macUeCfg->crnti = crnti;
1028 fillDefaultMacCellGrpInfo(&macUeCfg->macCellGrpCfg);
1029 fillDefaultPhyCellGrpInfo(&macUeCfg->phyCellGrpCfg);
1030 fillDefaultSpCellGrpInfo(&macUeCfg->spCellCfg);
1031 macUeCfg->maxAggrBitRate = NULLP;
1032 fillMacSrb1LcCfg(&macUeCfg->lcCfgList[0]);
1037 /* Fetching MacDb from DuUeCb */
1038 GET_CELL_IDX(cellId, cellIdx);
1039 duMacDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg;
1040 /* Fetching MaUeCfg List for ADD/MOD/DEL */
1041 macUeCfg->cellId = cellId;
1042 macUeCfg->ueIdx = ueIdx;
1043 macUeCfg->crnti = crnti;
1044 ret = procUeReCfgCellInfo(macUeCfg, ueCfgDb->cellGrpCfg);
1047 ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, ueCfgDb->duUeCfg.maxAggrBitRate);
1050 /* Filling LC Context */
1051 for(dbIdx = 0; (dbIdx < ueCfgDb->duUeCfg.numMacLcs && ret == ROK); dbIdx++)
1053 if(!ueCfgDb->duUeCfg.macLcCfg[dbIdx].ulLcCfgPres)
1055 /* Filling default UL LC config in MAC if not present */
1056 ueCfgDb->duUeCfg.macLcCfg[dbIdx].ulLcCfgPres = true;
1057 fillDefaultUlLcCfg(&ueCfgDb->duUeCfg.macLcCfg[dbIdx].ulLcCfg);
1059 for(lcIdx = 0; lcIdx < duMacDb->numLcs; lcIdx++)
1061 if(ueCfgDb->duUeCfg.macLcCfg[dbIdx].lcId == duMacDb->lcCfgList[lcIdx].lcId)
1064 if((ueCfgDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_UNKNOWN) ||
1065 (ueCfgDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_MOD))
1067 ueCfgDb->duUeCfg.macLcCfg[dbIdx].configType = CONFIG_MOD;
1068 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->duUeCfg.macLcCfg[dbIdx]);
1076 /* ADD/DEL CONFIG */
1077 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->duUeCfg.macLcCfg[dbIdx]);
1085 DU_LOG("\n DU_APP: Failed to add Lc at Idx %d in fillMacUeCfg()", dbIdx);
1088 }/*End of Outer FOR loop */
1093 /******************************************************************
1095 * @brief Fills Rlc AM Information
1099 * Function : fillDefaultAmInfo
1101 * Functionality: Fills Rlc AM Information
1104 *****************************************************************/
1105 void fillDefaultAmInfo(AmBearerCfg *amCfg)
1108 amCfg->dlAmCfg.snLenDl = AM_SIZE_12;
1109 amCfg->dlAmCfg.pollRetxTmr = POLL_RETX_TMR_45MS;
1110 amCfg->dlAmCfg.pollPdu = POLL_PDU_TMR_INFINITY;
1111 amCfg->dlAmCfg.pollByte = POLL_BYTES_INFINITY;
1112 amCfg->dlAmCfg.maxRetxTh = RETX_TH_8;
1115 amCfg->ulAmCfg.snLenUl = AM_SIZE_12;
1116 amCfg->ulAmCfg.reAssemTmr = RE_ASM_40MS;
1117 amCfg->ulAmCfg.statProhTmr = PROH_35MS;
1120 /******************************************************************
1122 * @brief Fills RLC UM Bi Directional Information
1126 * Function : fillDefaultUmBiInfo
1128 * Functionality: Fills RLC UM Bi Directional Information
1131 *****************************************************************/
1132 void fillDefaultUmBiInfo(UmBiDirBearerCfg *umBiDirCfg)
1134 /* UL UM BI DIR INFO */
1135 umBiDirCfg->ulUmCfg.snLenUlUm = UM_SIZE_12;
1136 umBiDirCfg->ulUmCfg.reAssemTmr = RE_ASM_40MS;
1138 /* DL UM BI DIR INFO */
1139 umBiDirCfg->dlUmCfg.snLenDlUm = UM_SIZE_12;
1142 /******************************************************************
1144 * @brief Fills RLC UM Uni Directional UL Information
1148 * Function : fillDefaultUmUlInfo
1150 * Functionality: Fills RLC UM Uni Directional Info
1153 *****************************************************************/
1154 void fillDefaultUmUlInfo(UmUniDirUlBearerCfg *UmUlCfg)
1156 UmUlCfg->ulUmCfg.snLenUlUm = UM_SIZE_12;
1157 UmUlCfg->ulUmCfg.reAssemTmr = RE_ASM_40MS;
1160 /******************************************************************
1162 * @brief Fills RLC UM Uni Directional DL Information
1166 * Function : fillDefaultUmDlInfo
1168 * Functionality: Fills RLC UM Uni Directional DL Info
1171 *****************************************************************/
1172 void fillDefaultUmDlInfo(UmUniDirDlBearerCfg *UmDlCfg)
1174 UmDlCfg->dlUmCfg.snLenDlUm = UM_SIZE_12;
1177 /******************************************************************
1179 * @brief Builds Rlc Mode Default Configuration
1183 * Function : fillDefaultRlcModeCfg
1185 * Functionality: Builds Rlc Mode Default Configuration
1188 *****************************************************************/
1190 uint8_t fillDefaultRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *lcCfg)
1200 DU_ALLOC_SHRABL_BUF(lcCfg->u.amCfg, sizeof(AmBearerCfg));
1202 fillDefaultAmInfo(lcCfg->u.amCfg);
1206 case RLC_UM_BI_DIRECTIONAL :
1208 if(!lcCfg->u.umBiDirCfg)
1210 DU_ALLOC_SHRABL_BUF(lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
1211 if(lcCfg->u.umBiDirCfg)
1212 fillDefaultUmBiInfo(lcCfg->u.umBiDirCfg);
1216 case RLC_UM_UNI_DIRECTIONAL_UL :
1218 if(!lcCfg->u.umUniDirUlCfg)
1220 DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
1221 if(lcCfg->u.umUniDirUlCfg)
1222 fillDefaultUmUlInfo(lcCfg->u.umUniDirUlCfg);
1226 case RLC_UM_UNI_DIRECTIONAL_DL :
1228 if(!lcCfg->u.umUniDirDlCfg)
1230 DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
1231 if(lcCfg->u.umUniDirDlCfg)
1232 fillDefaultUmDlInfo(lcCfg->u.umUniDirDlCfg);
1237 DU_LOG("\nDUAPP: Invalid rlcMode %d at extractRlcCfgToAddMod()", rlcMode);
1244 DU_LOG("\nDUAPP: Received Lc Config is NULL");
1249 void fillRlcSrb1LcCfg(RlcBearerCfg *rlcLcCfg)
1251 rlcLcCfg->rbId = SRB1_LCID;
1252 rlcLcCfg->rbType = RB_TYPE_SRB;
1253 rlcLcCfg->lcId = SRB1_LCID;
1254 rlcLcCfg->lcType = LCH_DCCH;
1255 rlcLcCfg->rlcMode = RLC_AM;
1256 rlcLcCfg->configType = CONFIG_ADD;
1257 fillDefaultRlcModeCfg(rlcLcCfg->rlcMode, rlcLcCfg);
1260 /*******************************************************************
1262 * @brief Processes UE ReConfig Req to RLC UL
1266 * Function : sendUeReCfgReqToRlc
1269 * Processes UE Reconfig Req to RLC UL
1271 * @params[in] Pointer to RlcUeCfg
1272 * @return ROK - success
1275 *****************************************************************/
1277 uint8_t sendUeReCfgReqToRlc(RlcUeCfg *rlcUeCfg)
1282 FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_RECONFIG_REQ);
1285 /* Processing one Ue at a time to RLC */
1286 DU_LOG("\nDU_APP: Sending Reconfig Request to RLC UL");
1287 ret = (*packRlcUeReconfigReqOpts[pst.selector])(&pst, rlcUeCfg);
1290 DU_LOG("\nDU_APP : Failed to send Ue Reconfig Req to RLC at sendUeReCfgReqToRlc()");
1291 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rlcUeCfg, sizeof(RlcUeCfg));
1296 DU_LOG("\n DU_APP: Received RlcUeCfg is NULL at sendUeReCfgReqToRlc()");
1302 /******************************************************************
1304 * @brief Fills RlcBearerCfg structure
1308 * Function : fillRlcUeCfg
1310 * Functionality: Fills Rlc Bearer Cfg
1313 *****************************************************************/
1314 uint8_t fillRlcUeCfg(uint16_t cellId, uint8_t ueIdx,\
1315 DuUeCfg *ueCfgDb, RlcUeCfg *rlcUeCfg)
1317 uint8_t ret, dbIdx, lcIdx, cellIdx;
1318 bool lcIdFound = false;
1319 RlcUeCfg *duRlcDb = NULLP;
1324 /* Initial RB being Added */
1325 rlcUeCfg->cellId = cellId;
1326 rlcUeCfg->ueIdx = ueIdx;
1327 fillRlcSrb1LcCfg(&rlcUeCfg->rlcLcCfg[0]);
1332 /* Fetch RlcDb from DuUeCb */
1333 GET_CELL_IDX(cellId, cellIdx);
1334 duRlcDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg;
1335 /*Filling RlcUeCfg */
1336 rlcUeCfg->cellId = cellId;
1337 rlcUeCfg->ueIdx = ueIdx;
1338 for(dbIdx = 0; dbIdx < ueCfgDb->numRlcLcs; dbIdx++)
1340 fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
1341 /* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
1342 for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
1344 if(ueCfgDb->rlcLcCfg[dbIdx].lcId == duRlcDb->rlcLcCfg[lcIdx].lcId)
1347 if((ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_UNKNOWN)||
1348 (ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_MOD))
1351 ueCfgDb->rlcLcCfg[dbIdx].configType = CONFIG_MOD; /* update Db for MOD type */
1352 memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
1360 /* ADD/ DEL Config Type */
1361 memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
1369 /******************************************************************
1371 * @brief creates UE context
1375 * Function : duCreateUeCb
1377 * Functionality: Creates UE Conetxt
1379 * @params[in] UeCcchCtxt Pointer
1382 * @return ROK - success
1384 * ****************************************************************/
1385 uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId)
1387 uint8_t cellIdx = 0;
1391 for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
1393 if(ueCcchCtxt->cellId == duCb.actvCellLst[cellIdx]->cellId)
1395 GET_UE_IDX(ueCcchCtxt->crnti, ueIdx);
1396 DU_LOG("\nDU_APP: Filling UeCb for ueIdx [%d]", ueIdx);
1398 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].crnti = ueCcchCtxt->crnti;
1399 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId = ueCcchCtxt->gnbDuUeF1apId;
1400 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId = gnbCuUeF1apId;
1401 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].drbBitMap = NULLP;
1402 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].ueState = UE_ACTIVE;
1403 duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].f1UeDb = NULLP;
1405 /* Filling Mac Ue Config */
1406 memset(&duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg, 0, sizeof(MacUeCfg));
1407 ret = duBuildAndSendUeCreateReqToMac(ueCcchCtxt->cellId, ueIdx, ueCcchCtxt->crnti,\
1408 &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg);
1410 DU_LOG("\nDU_APP: Failed to send UE create request to MAC");
1412 /* Filling Rlc Ue Config */
1413 memset(&duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg, 0, sizeof(RlcUeCfg));
1414 ret = duBuildAndSendUeCreateReqToRlc(ueCcchCtxt->cellId, ueIdx, \
1415 &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg);
1417 DU_LOG("\nDU_APP: Failed to send UE create request to RLC");
1419 duCb.actvCellLst[cellIdx]->numActvUes++;
1420 memset(ueCcchCtxt, 0, sizeof(UeCcchCtxt));
1426 /******************************************************************
1428 * @brief Builds and Send UE Create Request to MAC
1432 * Function : duBuildAndSendUeCreateReqToMac
1434 * Functionality: Builds and Send UE Create Request to MAC
1436 * @Params[in] cellId,
1438 * @return ROK - success
1441 * ****************************************************************/
1443 uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t ueIdx,\
1444 uint16_t crnti, MacUeCfg *duMacUeCfg)
1448 MacUeCfg *macUeCfg = NULLP;
1450 ret = fillMacUeCfg(cellId, ueIdx, crnti, NULL, duMacUeCfg);
1453 DU_LOG("\nDU APP: Failed to fill MacUeCfg at duBuildAndSendUeCreateReqToMac()");
1457 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_CONFIG_REQ);
1459 /* Copying ueCb to a sharable buffer */
1460 DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCfg));
1463 memset(macUeCfg, 0, sizeof(MacUeCfg));
1464 memcpy(macUeCfg, &duCb.actvCellLst[cellId - 1]->ueCb[ueIdx -1].macUeCfg, sizeof(MacUeCfg));
1465 DU_LOG("\nDU_APP: Sending UE create request to MAC");
1467 /* Processing one Ue at a time to MAC */
1468 ret = (*packMacUeCreateReqOpts[pst.selector])(&pst, macUeCfg);
1471 DU_LOG("\nDU_APP : Failure in sending Ue Create Req to MAC at duBuildAndSendUeCreateReqToMac()");
1472 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macUeCfg, sizeof(MacUeCfg));
1477 DU_LOG("\n DU_APP: Memory alloc failed at duBuildAndSendUeCreateReqToMac()");
1483 /*******************************************************************
1485 * @brief To update DuUeCb Mac Cfg
1489 * Function : duUpdateMacCfg
1490 * Functionality: update DuUeCb MAC Cfg
1492 * @params[in] DuUeCb Pointer
1493 * UeContextSetupDb pointer
1494 * @return ROK - success
1497 * ****************************************************************/
1498 uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, UeContextSetupDb *f1UeDb)
1500 uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx;
1503 /*Filling Cell Group Cfg*/
1504 ret = procUeReCfgCellInfo(macUeCfg, f1UeDb->cellGrpCfg);
1507 ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, f1UeDb->duUeCfg.maxAggrBitRate);
1509 /* Filling LC Context */
1510 for(dbIdx = 0; (dbIdx < f1UeDb->duUeCfg.numMacLcs && ret == ROK); dbIdx++)
1512 numLcs = macUeCfg->numLcs;
1513 for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
1515 if(f1UeDb->duUeCfg.macLcCfg[dbIdx].lcId == macUeCfg->lcCfgList[lcIdx].lcId)
1517 if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_MOD)
1519 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[lcIdx],&f1UeDb->duUeCfg.macLcCfg[dbIdx]);
1521 else if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_DEL)
1523 /* Free memory at matched lcIdx index */
1524 freeMacLcCfg(&macUeCfg->lcCfgList[lcIdx]);
1526 for(lcDelIdx = lcIdx; lcDelIdx < macUeCfg->numLcs; lcDelIdx++)
1528 /* moving all elements one index ahead */
1529 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[lcDelIdx], &macUeCfg->lcCfgList[lcDelIdx+1]);
1530 freeMacLcCfg(&macUeCfg->lcCfgList[lcDelIdx+1]);
1533 DU_LOG("\nDU_APP: Failed to delete LC at Idx %d in duUpdateMacCfg()", lcDelIdx);
1540 if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_ADD)
1542 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[numLcs], &f1UeDb->duUeCfg.macLcCfg[dbIdx]);
1545 DU_LOG("\nDU_APP: Failed to add LC at Idx %d in duUpdateMacCfg()", numLcs);
1555 /******************************************************************
1557 * @brief Function to fill the RLC Lc cfg from ueSetupReqDb
1561 * Function : fillRlcCfgToAddMod
1563 * Functionality: Function to fill the RLC Lc cfg from ueSetupReqDb
1566 *****************************************************************/
1568 uint8_t fillRlcCfgToAddMod(RlcBearerCfg *lcCfg, RlcBearerCfg *f1UeDbLcCfg)
1570 lcCfg->configType = f1UeDbLcCfg->configType;
1571 lcCfg->rbId = f1UeDbLcCfg->rbId;
1572 lcCfg->rbType = f1UeDbLcCfg->rbType;
1573 lcCfg->lcId = f1UeDbLcCfg->lcId;
1574 lcCfg->lcType = f1UeDbLcCfg->lcType;
1575 lcCfg->rlcMode = f1UeDbLcCfg->rlcMode;
1576 switch(lcCfg->rlcMode)
1582 DU_ALLOC_SHRABL_BUF(lcCfg->u.amCfg, sizeof(AmBearerCfg));
1587 lcCfg->u.amCfg->dlAmCfg.snLenDl = f1UeDbLcCfg->u.amCfg->dlAmCfg.snLenDl;
1588 lcCfg->u.amCfg->dlAmCfg.pollRetxTmr = f1UeDbLcCfg->u.amCfg->dlAmCfg.pollRetxTmr;
1589 lcCfg->u.amCfg->dlAmCfg.pollPdu = f1UeDbLcCfg->u.amCfg->dlAmCfg.pollPdu;
1590 lcCfg->u.amCfg->dlAmCfg.pollByte = f1UeDbLcCfg->u.amCfg->dlAmCfg.pollByte;
1591 lcCfg->u.amCfg->dlAmCfg.maxRetxTh = f1UeDbLcCfg->u.amCfg->dlAmCfg.maxRetxTh;
1594 lcCfg->u.amCfg->ulAmCfg.snLenUl = f1UeDbLcCfg->u.amCfg->ulAmCfg.snLenUl;
1595 lcCfg->u.amCfg->ulAmCfg.reAssemTmr = f1UeDbLcCfg->u.amCfg->ulAmCfg.reAssemTmr;
1596 lcCfg->u.amCfg->ulAmCfg.statProhTmr = f1UeDbLcCfg->u.amCfg->ulAmCfg.statProhTmr;
1599 case RLC_UM_BI_DIRECTIONAL :
1601 if(!lcCfg->u.umBiDirCfg)
1603 DU_ALLOC_SHRABL_BUF(lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
1604 if(!lcCfg->u.umBiDirCfg)
1607 /* UL UM BI DIR INFO */
1608 lcCfg->u.umBiDirCfg->ulUmCfg.snLenUlUm = f1UeDbLcCfg->u.umBiDirCfg->ulUmCfg.snLenUlUm;
1609 lcCfg->u.umBiDirCfg->ulUmCfg.reAssemTmr = f1UeDbLcCfg->u.umBiDirCfg->ulUmCfg.reAssemTmr;
1610 /* DL UM BI DIR INFO */
1611 lcCfg->u.umBiDirCfg->dlUmCfg.snLenDlUm = f1UeDbLcCfg->u.umBiDirCfg->dlUmCfg.snLenDlUm;
1614 case RLC_UM_UNI_DIRECTIONAL_UL :
1616 if(!lcCfg->u.umUniDirUlCfg)
1618 DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
1619 if(!lcCfg->u.umUniDirUlCfg)
1622 lcCfg->u.umUniDirUlCfg->ulUmCfg.snLenUlUm = f1UeDbLcCfg->u.umUniDirUlCfg->ulUmCfg.snLenUlUm;
1623 lcCfg->u.umUniDirUlCfg->ulUmCfg.reAssemTmr = f1UeDbLcCfg->u.umUniDirUlCfg->ulUmCfg.reAssemTmr;
1627 case RLC_UM_UNI_DIRECTIONAL_DL :
1629 if(!lcCfg->u.umUniDirDlCfg)
1631 DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
1632 if(!lcCfg->u.umUniDirDlCfg)
1635 lcCfg->u.umUniDirDlCfg->dlUmCfg.snLenDlUm = f1UeDbLcCfg->u.umUniDirDlCfg->dlUmCfg.snLenDlUm;
1639 DU_LOG("\nDU_APP: Invalid Rlc Mode %d at fillRlcCfgToAddMod()", lcCfg->rlcMode);
1645 /*******************************************************************
1647 * @brief To update DuUeCb Rlc Lc Cfg
1651 * Function : duUpdateRlcLcCfg
1652 * Functionality: update DuUeCb Rlc Lc Cfg
1654 * @params[in] DuUeCb Pointer
1655 * UeContextSetupDb pointer
1656 * @return ROK - success
1659 * ****************************************************************/
1661 uint8_t duUpdateRlcLcCfg(RlcUeCfg *rlcUeCfg, UeContextSetupDb *f1UeDb)
1663 uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx;
1666 for(dbIdx = 0; (dbIdx < f1UeDb->duUeCfg.numRlcLcs && ret ==ROK); dbIdx++)
1668 numLcs = rlcUeCfg->numLcs;
1669 for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
1671 if(f1UeDb->duUeCfg.rlcLcCfg[dbIdx].lcId == rlcUeCfg->rlcLcCfg[lcIdx].lcId)
1673 if(f1UeDb->duUeCfg.rlcLcCfg[dbIdx].configType == CONFIG_MOD)
1675 ret = fillRlcCfgToAddMod(&rlcUeCfg->rlcLcCfg[lcIdx], &f1UeDb->duUeCfg.rlcLcCfg[dbIdx]);
1677 else if(f1UeDb->duUeCfg.rlcLcCfg[dbIdx].configType == CONFIG_DEL)
1679 /* Free memory at matched lcIdx index */
1680 freeRlcLcCfg(&rlcUeCfg->rlcLcCfg[lcIdx]);
1682 for(lcDelIdx = lcIdx; lcDelIdx < rlcUeCfg->numLcs; lcDelIdx++)
1684 ret = fillRlcCfgToAddMod(&rlcUeCfg->rlcLcCfg[lcDelIdx], &rlcUeCfg->rlcLcCfg[lcDelIdx+1]);
1685 freeRlcLcCfg(&rlcUeCfg->rlcLcCfg[lcDelIdx+1]);
1688 DU_LOG("\nDU_APP: Failed to delete LC at Idx %d in duUpdateRlcCfg()", lcDelIdx);
1695 if(f1UeDb->duUeCfg.rlcLcCfg[dbIdx].configType == CONFIG_ADD)
1697 ret = fillRlcCfgToAddMod(&rlcUeCfg->rlcLcCfg[lcIdx], &f1UeDb->duUeCfg.rlcLcCfg[dbIdx]);
1706 /*******************************************************************
1708 * @brief @brief To update DuUeCb Mac and Rlc Ue Cfg
1713 * Function : duUpdateDuUeCbCfg
1715 * Functionality: update DuUeCb Mac and Rlc Ue Cfg
1717 * @params[in] ueIdx, cellIdx
1718 * @return ROK - success
1721 * ****************************************************************/
1723 uint8_t duUpdateDuUeCbCfg(uint8_t ueIdx, uint8_t cellId)
1725 uint8_t ret = ROK, cellIdx = 0, crnti=0;
1726 DuUeCb *ueCb = NULLP;
1728 GET_CELL_IDX(cellId, cellIdx);
1730 if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg. \
1731 macUeCfgState == UE_RECFG_COMPLETE) &&
1732 (duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg. \
1733 rlcUeCfgState == UE_RECFG_COMPLETE))
1735 ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
1737 /*Filling RLC Ue Cfg */
1738 ueCb->rlcUeCfg.cellId = cellId;
1739 ueCb->rlcUeCfg.ueIdx = ueIdx;
1740 ret = duUpdateRlcLcCfg(&ueCb->rlcUeCfg, ueCb->f1UeDb);
1743 /*Filling MAC Ue Cfg */
1744 GET_CRNTI(crnti, ueIdx);
1745 ueCb->macUeCfg.cellId = cellId;
1746 ueCb->macUeCfg.ueIdx = ueIdx;
1747 ueCb->macUeCfg.crnti = crnti;
1748 ret = duUpdateMacCfg(&ueCb->macUeCfg, ueCb->f1UeDb);
1750 DU_LOG("\nDU APP: Failed while updating MAC LC Config at duUpdateDuUeCbCfg()");
1753 DU_LOG("\nDU APP: Failed while updating RLC LC Config at duUpdateDuUeCbCfg()");
1760 /*******************************************************************
1762 * @brief Handle UE config response from MAC
1766 * Function : DuProcMacUeCfgRsp
1768 * Functionality: Handle UE Config response from MAC
1770 * @params[in] Pointer to MacUeCfgRsp and Pst
1771 * @return ROK - success
1774 * ****************************************************************/
1775 uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
1778 uint8_t ueIdx, cellIdx;
1782 if(cfgRsp->result == MAC_DU_APP_RSP_OK)
1784 cellIdx = (cfgRsp->cellId -1);
1785 ueIdx = (cfgRsp->ueIdx -1);
1787 if(pst->event == EVENT_MAC_UE_CONFIG_RSP)
1789 DU_LOG("\nDU APP : MAC UE Create Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
1790 duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.macUeCfgState = UE_CONFIG_COMPLETE;
1792 else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
1794 DU_LOG("\nDU APP : MAC UE Reconfig Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
1795 duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
1796 if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
1797 BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
1802 DU_LOG("\nDU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [UE IDX : %d]", pst->event, cfgRsp->ueIdx);
1803 if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
1805 //TODO: Send the failure case in Ue Context Setup Response
1812 DU_LOG("\nDU APP : Received MAC Ue Config Response is NULL at DuProcMacUeCfgRsp()");
1818 /*******************************************************************
1820 * @brief Processes UE create Req to RLC UL
1824 * Function : duBuildAndSendUeCreateReqToRlc
1827 * Processes UE create Req to RLC UL
1829 * @params[in] cellId,
1831 * Pointer to RlcUeCfg
1832 * @return ROK - success
1835 *****************************************************************/
1837 uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx,\
1838 RlcUeCfg *duRlcUeCfg)
1841 RlcUeCfg *rlcUeCfg = NULLP;
1844 fillRlcUeCfg(cellId, ueIdx, NULL, duRlcUeCfg);
1845 FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_CONFIG_REQ);
1847 /* Copying ueCfg to a sharable buffer */
1848 DU_ALLOC_SHRABL_BUF(rlcUeCfg, sizeof(RlcUeCfg));
1851 memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
1852 memcpy(rlcUeCfg, duRlcUeCfg, sizeof(RlcUeCfg));
1853 /* Processing one Ue at a time to RLC */
1854 DU_LOG("\nDU_APP: Sending UE create request to RLC UL");
1855 ret = (*packRlcUeCreateReqOpts[pst.selector])(&pst, rlcUeCfg);
1858 DU_LOG("\nDU_APP : Failure in sending Ue Create Req to RLC");
1859 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rlcUeCfg, sizeof(RlcUeCfg));
1865 DU_LOG("\n DU_APP: Memory alloc failed at duBuildAndSendUeCreateReqToRlc()");
1871 /*******************************************************************
1873 * @brief Processes UE create Rsp received from RLC UL
1878 * Function : DuProcRlcUeCfgRsp
1881 * Processes UE create Rsp received from RLC UL
1883 * @params[in] Post structure
1884 * Pointer to RlcCfgCfm
1885 * @return ROK - success
1888 *****************************************************************/
1889 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp)
1892 uint8_t ueIdx, cellIdx;
1896 if(cfgRsp->result == RLC_DU_APP_RSP_OK)
1898 cellIdx = (cfgRsp->cellId -1);
1899 ueIdx = (cfgRsp->ueIdx -1);
1901 if(pst->event == EVENT_RLC_UE_CONFIG_RSP)
1903 DU_LOG("\nDU_APP: RLC UE Create Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
1904 duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcUeCfgState = UE_CONFIG_COMPLETE;
1906 else if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
1908 DU_LOG("\nDU_APP: RLC UE Reconfig Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
1909 duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
1910 if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
1911 BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
1917 DU_LOG("\nDU_APP: RLC UE CFG Response for EVENT[%d] : FAILED [UE IDX : %d, REASON :%d]",\
1918 pst->event, cfgRsp->ueIdx, cfgRsp->reason);
1919 if((pst->event == EVENT_RLC_UE_RECONFIG_RSP))
1921 //TODO: update failure case in ue Context setup Response
1925 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
1929 DU_LOG("\nDU_APP: Received RLC Ue Config Response is NULL at DuProcRlcUeCfgRsp()");
1935 /*******************************************************************
1937 * @brief Builds and Send Ue Reconfig Req to RLC
1941 * Function : duBuildAndSendUeReCfgReqToRLC
1943 * Functionality: Builds and Send Ue Reconfig Req to RLC
1945 * @params[in] cellId, crnti
1947 * RlcUeCfg *rlcUeCfg
1948 * @return ROK - success
1951 * ****************************************************************/
1953 uint8_t duBuildAndSendUeReCfgReqToRlc(uint8_t cellId, uint8_t crnti, DuUeCfg *ueCfgDb)
1955 uint8_t ret = ROK, ueIdx = 0;
1956 RlcUeCfg *rlcUeCfg = NULLP;
1958 GET_UE_IDX(crnti, ueIdx);
1959 DU_ALLOC_SHRABL_BUF(rlcUeCfg, sizeof(RlcUeCfg));
1962 memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
1963 ret = fillRlcUeCfg(cellId, ueIdx, ueCfgDb, rlcUeCfg);
1965 DU_LOG("\nDU APP: Failed at duBuildAndSendUeReCfgReqToRlc()");
1967 ret = sendUeReCfgReqToRlc(rlcUeCfg);
1971 DU_LOG("\nDU APP: Memory Alloc failed at duBuildAndSendUeReCfgReqToRlc()");
1977 /*******************************************************************
1979 * @brief Builds and Send Ue Reconfig Req to MAC
1983 * Function : duBuildAndSendUeReCfgReqToMac
1985 * Functionality: Builds and Send Ue Reconfig Req to MAC
1987 * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
1989 * MacUeCfg *macUeCfg
1990 * @return ROK - success
1993 * ****************************************************************/
1995 uint8_t duBuildAndSendUeReCfgReqToMac(uint8_t cellId, uint8_t crnti, UeContextSetupDb *ueCfgDb)
1997 uint8_t ret, ueIdx = 0;
1998 MacUeCfg *macUeCfg = NULLP;
2001 GET_UE_IDX(crnti, ueIdx);
2003 DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCfg));
2006 memset(macUeCfg, 0, sizeof(MacUeCfg));
2007 ret = fillMacUeCfg(cellId, ueIdx, crnti, ueCfgDb, macUeCfg);
2009 ret = sendUeReCfgReqToMac(macUeCfg);
2013 DU_LOG("\nDU_APP: Memory alloc failed for macUeCfg at duBuildAndSendUeReCfgReqToMac()");
2019 /*******************************************************************
2021 * @brief Process UE context setup request from CU
2025 * Function : duProcUeContextSetupRequest
2027 * Functionality: Process UE context setup request from CU
2029 * @params[in] F1AP message
2030 * @return ROK - success
2033 * ****************************************************************/
2035 uint8_t duProcUeContextSetupRequest(DuUeCb *ueCb)
2037 uint8_t ret, cellId;
2042 cellId = duCb.actvCellLst[ueCb->f1UeDb->cellIdx]->cellId;
2044 if(ueCb->f1UeDb->rrcMsg)
2046 /* Sending DL RRC Message to RLC */
2047 ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, SRB1_LCID, false, \
2048 ueCb->f1UeDb->deliveryStaReq, ueCb->f1UeDb->rrcMsgLen, ueCb->f1UeDb->rrcMsg);
2051 DU_LOG("\nDU APP : Failed to send DL RRC msg in duProcUeContextSetupRequest()");
2052 DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->rrcMsg, ueCb->f1UeDb->rrcMsgLen);
2058 DU_LOG("\nDU_APP: Processing Ue Context Setup Request for cellId [%d]", cellId);
2059 /* Filling RLC Ue Reconfig */
2060 ret = duBuildAndSendUeReCfgReqToRlc(cellId, ueCb->crnti, &ueCb->f1UeDb->duUeCfg);
2062 DU_LOG("\nDU_APP: Failed to build ctxt setup req for RLC at duBuildAndSendUeReCfgReqToRlc()");
2064 /* Filling MAC Ue Reconfig */
2065 ret = duBuildAndSendUeReCfgReqToMac(cellId, ueCb->crnti, ueCb->f1UeDb);
2067 DU_LOG("\nDU_APP: Failed at build ctxt setup req for MAC at duBuildAndSendUeReCfgReqToMac()");
2073 //TODO: To send the failure cause in UeContextSetupRsp
2074 DU_LOG("DU_APP: Failed to process UE CNTXT SETUP REQ at duProcUeContextSetupRequest()");
2079 /**********************************************************************
2081 ***********************************************************************/