X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_f1ap_msg_hdl.c;h=3445666410b59b6e90338921bf0f89a5c8502fde;hb=ca0353e5cb5699aecb6840efe9572934a1150e2b;hp=4b43b076606cc8c26bdc28b43f83dc51128c5cf0;hpb=9eb621804acfc1798221e10cd96edf3fa9ea897c;p=o-du%2Fl2.git diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 4b43b0766..344566641 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -2763,7 +2763,7 @@ uint8_t BuildTagConfig(DuUeCb *ueCb, struct TAG_Config *tagConfig) if(ueCb == NULLP) elementCnt = ODU_VALUE_ONE; else - elementCnt = ueCb->macUeCfg.macCellGrpCfg.tagCfg.addModListCount; + elementCnt = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModListCount; tagList = tagConfig->tag_ToAddModList; tagList->list.count = elementCnt; @@ -2798,8 +2798,8 @@ uint8_t BuildTagConfig(DuUeCb *ueCb, struct TAG_Config *tagConfig) { for(idx=0; idxlist.count; idx++) { - tagList->list.array[idx]->tag_Id = ueCb->macUeCfg.macCellGrpCfg.tagCfg.addModList[idx].tagId; - tagList->list.array[idx]->timeAlignmentTimer = ueCb->macUeCfg.macCellGrpCfg.tagCfg.addModList[idx].timeAlignTimer; + tagList->list.array[idx]->tag_Id = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModList[idx].tagId; + tagList->list.array[idx]->timeAlignmentTimer = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModList[idx].timeAlignTimer; } } @@ -2846,13 +2846,13 @@ uint8_t BuildPhrConfig(DuUeCb *ueCb, struct MAC_CellGroupConfig__phr_Config *phr } else { - phrConfig->choice.setup->phr_PeriodicTimer = ueCb->macUeCfg.macCellGrpCfg.phrCfg.periodicTimer; - phrConfig->choice.setup->phr_ProhibitTimer = ueCb->macUeCfg.macCellGrpCfg.phrCfg.prohibitTimer; - phrConfig->choice.setup->phr_Tx_PowerFactorChange = ueCb->macUeCfg.macCellGrpCfg.phrCfg.txPowerFactor; - phrConfig->choice.setup->multiplePHR = ueCb->macUeCfg.macCellGrpCfg.phrCfg.multiplePHR; - phrConfig->choice.setup->dummy = ueCb->macUeCfg.macCellGrpCfg.phrCfg.dummy; - phrConfig->choice.setup->phr_Type2OtherCell = ueCb->macUeCfg.macCellGrpCfg.phrCfg.phrType2OtherCell; - phrConfig->choice.setup->phr_ModeOtherCG = ueCb->macUeCfg.macCellGrpCfg.phrCfg.phrOtherCG; + phrConfig->choice.setup->phr_PeriodicTimer = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.periodicTimer; + phrConfig->choice.setup->phr_ProhibitTimer = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.prohibitTimer; + phrConfig->choice.setup->phr_Tx_PowerFactorChange = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.txPowerFactor; + phrConfig->choice.setup->multiplePHR = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.multiplePHR; + phrConfig->choice.setup->dummy = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.dummy; + phrConfig->choice.setup->phr_Type2OtherCell = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.phrType2OtherCell; + phrConfig->choice.setup->phr_ModeOtherCG = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.phrOtherCG; } return ROK; @@ -2884,8 +2884,8 @@ uint8_t BuildBsrConfig(DuUeCb *ueCb, struct BSR_Config *bsrConfig) } else { - bsrConfig->periodicBSR_Timer = convertBsrPeriodicTmrValueToEnum(ueCb->macUeCfg.macCellGrpCfg.bsrTmrCfg.periodicTimer); - bsrConfig->retxBSR_Timer = convertBsrRetxTmrValueToEnum(ueCb->macUeCfg.macCellGrpCfg.bsrTmrCfg.retxTimer); + bsrConfig->periodicBSR_Timer = convertBsrPeriodicTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.periodicTimer); + bsrConfig->retxBSR_Timer = convertBsrRetxTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.retxTimer); bsrConfig->logicalChannelSR_DelayTimer = NULLP; DU_ALLOC(bsrConfig->logicalChannelSR_DelayTimer, sizeof(long)); @@ -2894,7 +2894,7 @@ uint8_t BuildBsrConfig(DuUeCb *ueCb, struct BSR_Config *bsrConfig) DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildBsrConfig"); return RFAILED; } - *(bsrConfig->logicalChannelSR_DelayTimer) = convertLcSrDelayTmrValueToEnum(ueCb->macUeCfg.macCellGrpCfg.bsrTmrCfg.srDelayTimer); + *(bsrConfig->logicalChannelSR_DelayTimer) = convertLcSrDelayTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.srDelayTimer); } return ROK; @@ -2933,7 +2933,7 @@ uint8_t BuildSchedulingReqConfig(DuUeCb *ueCb, struct SchedulingRequestConfig *s if(ueCb == NULLP) elementCnt = ODU_VALUE_ONE; else - elementCnt = ueCb->macUeCfg.macCellGrpCfg.schReqCfg.addModListCount; + elementCnt = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModListCount; schReqList = schedulingRequestConfig->schedulingRequestToAddModList; schReqList->list.count = elementCnt; @@ -2977,7 +2977,7 @@ uint8_t BuildSchedulingReqConfig(DuUeCb *ueCb, struct SchedulingRequestConfig *s { for(idx=0; idxlist.count; idx++) { - schReqList->list.array[idx]->schedulingRequestId = ueCb->macUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].schedReqId; + schReqList->list.array[idx]->schedulingRequestId = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].schedReqId; schReqList->list.array[idx]->sr_ProhibitTimer = NULLP; DU_ALLOC(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long)); @@ -2986,8 +2986,8 @@ uint8_t BuildSchedulingReqConfig(DuUeCb *ueCb, struct SchedulingRequestConfig *s DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig"); return RFAILED; } - *(schReqList->list.array[idx]->sr_ProhibitTimer) = ueCb->macUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srProhibitTmr; - schReqList->list.array[idx]->sr_TransMax = ueCb->macUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srTransMax; + *(schReqList->list.array[idx]->sr_ProhibitTimer) = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srProhibitTmr; + schReqList->list.array[idx]->sr_TransMax = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srTransMax; } } @@ -3508,11 +3508,11 @@ uint8_t BuildRlcBearerToAddModList(DuUeCb *ueCb, struct CellGroupConfigRrc__rlc_ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList"); return RFAILED; } - for(macLcIdx = 0; macLcIdx < ueCb->macUeCfg.numLcs; macLcIdx++) + for(macLcIdx = 0; macLcIdx < ueCb->duMacUeCfg.numLcs; macLcIdx++) { - if(ueCb->macUeCfg.lcCfgList[macLcIdx].lcId == ueCb->rlcUeCfg.rlcLcCfg[lcIdx].lcId) + if(ueCb->duMacUeCfg.lcCfgList[macLcIdx].lcConfig.lcId == ueCb->rlcUeCfg.rlcLcCfg[lcIdx].lcId) { - if(BuildMacLCConfig(&ueCb->macUeCfg.lcCfgList[macLcIdx], rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK) + if(BuildMacLCConfig(&ueCb->duMacUeCfg.lcCfgList[macLcIdx].lcConfig, rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK) { DU_LOG("\nERROR --> F1AP : BuildMacLCConfig failed"); return RFAILED; @@ -5856,13 +5856,13 @@ uint8_t BuildInitialUlBWP(InitialUlBwp *initUlBwp, BWP_UplinkDedicated_t *ulBwp) * RFAILED - failure * * ****************************************************************/ -uint8_t BuildUlCfg(ServCellCfgInfo *servCellCfg, UplinkConfig_t *ulCfg) +uint8_t BuildUlCfg(ServCellRecfgInfo *servCellRecfg, UplinkConfig_t *ulCfg) { InitialUlBwp *initUlBwp = NULLP; - if(servCellCfg) + if(servCellRecfg) { - initUlBwp = &servCellCfg->initUlBwp; + initUlBwp = &servCellRecfg->initUlBwp; } ulCfg->initialUplinkBWP = NULLP; @@ -5887,10 +5887,10 @@ uint8_t BuildUlCfg(ServCellCfgInfo *servCellCfg, UplinkConfig_t *ulCfg) DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg"); return RFAILED; } - if(servCellCfg == NULLP) + if(servCellRecfg == NULLP) *(ulCfg->firstActiveUplinkBWP_Id) = ACTIVE_UL_BWP_ID; else - *(ulCfg->firstActiveUplinkBWP_Id) = servCellCfg->firstActvUlBwpId; + *(ulCfg->firstActiveUplinkBWP_Id) = servCellRecfg->firstActvUlBwpId; ulCfg->pusch_ServingCellConfig = NULLP; DU_ALLOC(ulCfg->pusch_ServingCellConfig, sizeof(struct UplinkConfig__pusch_ServingCellConfig)); @@ -6044,18 +6044,18 @@ uint8_t BuildCsiMeasCfg(struct ServingCellConfig__csi_MeasConfig *csiMeasCfg) * * Functionality: Builds DL BWP to add/modify list * - * @params[in] ServCellCfgInfo *servCellCfg, + * @params[in] ServCellRecfgInfo *servCellRecfg, * struct ServingCellConfig__downlinkBWP_ToAddModList *dlBwpAddModList * * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t BuildDlBwpToAddModList(ServCellCfgInfo *servCellCfg, struct ServingCellConfig__downlinkBWP_ToAddModList *dlBwpAddModList) +uint8_t BuildDlBwpToAddModList(ServCellRecfgInfo *servCellRecfg, struct ServingCellConfig__downlinkBWP_ToAddModList *dlBwpAddModList) { uint8_t elementCnt, idx; - elementCnt = servCellCfg->numDlBwpToAdd; + elementCnt = servCellRecfg->numDlBwpToAddOrMod; dlBwpAddModList->list.count = elementCnt; dlBwpAddModList->list.size = elementCnt * sizeof(struct BWP_Downlink *); dlBwpAddModList->list.array = NULLP; @@ -6078,7 +6078,7 @@ uint8_t BuildDlBwpToAddModList(ServCellCfgInfo *servCellCfg, struct ServingCellC for(idx=0; idxlist.count; idx++) { - dlBwpAddModList->list.array[idx]->bwp_Id = servCellCfg->DlBwpToAddList[idx].bwpId; + dlBwpAddModList->list.array[idx]->bwp_Id = servCellRecfg->dlBwpToAddOrModList[idx].bwpId; dlBwpAddModList->list.array[idx]->bwp_Common = NULLP; dlBwpAddModList->list.array[idx]->bwp_Dedicated = NULLP; } @@ -6102,15 +6102,15 @@ uint8_t BuildDlBwpToAddModList(ServCellCfgInfo *servCellCfg, struct ServingCellC * ****************************************************************/ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) { - ServCellCfgInfo *servCellCfg = NULLP; + ServCellRecfgInfo *servCellRecfg = NULLP; InitialDlBwp *initDlBwp = NULLP; PdschServCellCfg *pdschServCellDb = NULLP; if(ueCb) { - servCellCfg = &ueCb->macUeCfg.spCellCfg.servCellCfg; - initDlBwp = &servCellCfg->initDlBwp; - pdschServCellDb = &servCellCfg->pdschServCellCfg; + servCellRecfg = &ueCb->duMacUeCfg.spCellCfg.servCellCfg; + initDlBwp = &servCellRecfg->initDlBwp; + pdschServCellDb = &servCellRecfg->pdschServCellCfg; } srvCellCfg->tdd_UL_DL_ConfigurationDedicated = NULLP; @@ -6132,7 +6132,7 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) srvCellCfg->downlinkBWP_ToReleaseList = NULLP; srvCellCfg->downlinkBWP_ToAddModList = NULLP; - if(ueCb && ueCb->macUeCfg.spCellCfg.servCellCfg.numDlBwpToAdd) + if(ueCb && ueCb->duMacUeCfg.spCellCfg.servCellCfg.numDlBwpToAddOrMod) { DU_ALLOC(srvCellCfg->downlinkBWP_ToAddModList, sizeof(struct ServingCellConfig__downlinkBWP_ToAddModList)); if(srvCellCfg->downlinkBWP_ToAddModList == NULLP) @@ -6141,7 +6141,7 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) return RFAILED; } - if(BuildDlBwpToAddModList(&ueCb->macUeCfg.spCellCfg.servCellCfg, srvCellCfg->downlinkBWP_ToAddModList) != ROK) + if(BuildDlBwpToAddModList(&ueCb->duMacUeCfg.spCellCfg.servCellCfg, srvCellCfg->downlinkBWP_ToAddModList) != ROK) { DU_LOG("\nERROR --> F1AP : BuildInitialDlBWP failed"); return RFAILED; @@ -6158,7 +6158,7 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) if(ueCb == NULLP) *(srvCellCfg->firstActiveDownlinkBWP_Id) = ACTIVE_DL_BWP_ID; else - *(srvCellCfg->firstActiveDownlinkBWP_Id) = ueCb->macUeCfg.spCellCfg.servCellCfg.firstActvDlBwpId; + *(srvCellCfg->firstActiveDownlinkBWP_Id) = ueCb->duMacUeCfg.spCellCfg.servCellCfg.firstActvDlBwpId; srvCellCfg->bwp_InactivityTimer = NULLP; @@ -6172,7 +6172,7 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) if(ueCb == NULLP) *(srvCellCfg->defaultDownlinkBWP_Id) = ACTIVE_DL_BWP_ID; else - *(srvCellCfg->defaultDownlinkBWP_Id) = ueCb->macUeCfg.spCellCfg.servCellCfg.defaultDlBwpId; + *(srvCellCfg->defaultDownlinkBWP_Id) = ueCb->duMacUeCfg.spCellCfg.servCellCfg.defaultDlBwpId; srvCellCfg->uplinkConfig = NULLP; DU_ALLOC(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t)); @@ -6182,7 +6182,7 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg) return RFAILED; } - if(BuildUlCfg(servCellCfg, srvCellCfg->uplinkConfig) != ROK) + if(BuildUlCfg(servCellRecfg, srvCellCfg->uplinkConfig) != ROK) { DU_LOG("\nERROR --> F1AP : BuildUlCfg failed"); return RFAILED; @@ -6940,7 +6940,7 @@ uint8_t BuildSpCellCfg(DuUeCb *ueCb, SpCellConfig_t *spCellCfg) if(ueCb == NULLP) *(spCellCfg->servCellIndex) = SERV_CELL_IDX; else - *(spCellCfg->servCellIndex) = ueCb->macUeCfg.spCellCfg.servCellIdx; + *(spCellCfg->servCellIndex) = ueCb->duMacUeCfg.spCellCfg.servCellIdx; spCellCfg->reconfigurationWithSync = NULLP; if(ueCb && (ueCb->ueState == UE_HANDIN_IN_PROGRESS)) @@ -7022,8 +7022,8 @@ uint8_t BuildPhyCellGrpCfg(DuUeCb *ueCb, PhysicalCellGroupConfig_t *phyCellGrpCf } else { - *(phyCellGrpCfg->p_NR_FR1) = ueCb->macUeCfg.phyCellGrpCfg.pNrFr1; - phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = ueCb->macUeCfg.phyCellGrpCfg.pdschHarqAckCodebook; + *(phyCellGrpCfg->p_NR_FR1) = ueCb->duMacUeCfg.phyCellGrpCfg.pNrFr1; + phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = ueCb->duMacUeCfg.phyCellGrpCfg.pdschHarqAckCodebook; } phyCellGrpCfg->tpc_SRS_RNTI = NULLP; @@ -7190,10 +7190,10 @@ uint8_t BuildDrxConfigRrc(DuUeCb *ueCb, struct MAC_CellGroupConfig__drx_ConfigRr DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDrxConfigRrc"); return RFAILED; } - if(ueCb->macUeCfg.macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationTimerValInMs) + if(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationTimerValInMs) { drxCfg->choice.setup->drx_onDurationTimer.present = DRX_ConfigRrc__drx_onDurationTimer_PR_milliSeconds; - drxCfg->choice.setup->drx_onDurationTimer.choice.milliSeconds = convertOnDurationTimerMilliSecondsValueToEnum(ueCb->macUeCfg.\ + drxCfg->choice.setup->drx_onDurationTimer.choice.milliSeconds = convertOnDurationTimerMilliSecondsValueToEnum(ueCb->duMacUeCfg.\ macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationtimerValue.milliSeconds); } else @@ -8932,32 +8932,6 @@ uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti /***** UE SETUP REQUEST *****/ -/******************************************************************* - * - * @brief Free Qos And Snssai Drb Info - * - * @details - * - * Function : freeDrbQosAndSnssaiInfo - * - * Functionality: Free Qos And Snssai Drb Info - * - * @params[in] LcCfg *lcCfg, - * @return void - * - * ****************************************************************/ -void freeDrbQosAndSnssaiInfo(LcCfg *lcCfg) -{ - if(lcCfg->snssai) - { - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai)); - } - if(lcCfg->drbQos) - { - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo)); - } -} - /****************************************************************** * * @brief Function to delete the RLC Lc cfg from UE APP DB @@ -9017,7 +8991,7 @@ void freeRlcLcCfg(RlcBearerCfg *lcCfg) * * ****************************************************************/ -void freeMacLcCfg(LcCfg *lcCfg) +void freeMacLcCfg(LcCfg *lcCfg) { /* Deleting DRBQOS */ if(lcCfg->drbQos) @@ -9768,7 +9742,7 @@ void freeDuUeCfg(UeCtxtActionType actionType, DuUeCfg *ueCfg) for(lcIdx = 0; lcIdx < ueCfg->numMacLcs; lcIdx++) { - freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]); + freeMacLcCfg(&ueCfg->macLcCfg[lcIdx].lcConfig); } for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++) @@ -10340,7 +10314,7 @@ uint8_t extractDrbQosCfg(DRB_Information_t *drbInfo, LcCfg *macLcToAdd ) * * ****************************************************************/ uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\ -DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo) +DRBs_ToBeModified_Item_t *drbModItem, DuLcCfg *lcCfgToAdd, UpTnlCfg *upTnlInfo) { DRB_Information_t *drbInfo = NULLP; @@ -10356,7 +10330,7 @@ DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo) if(drbItem->qoSInformation.choice.choice_extension->value.present == QoSInformation_ExtIEs__value_PR_DRB_Information) { drbInfo = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information; - if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK) + if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK) { DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()"); return RFAILED; @@ -10378,7 +10352,7 @@ DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo) QoSInformation_ExtIEs__value_PR_DRB_Information) { drbInfo = &drbSetupModItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information; - if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK) + if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK) { DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()"); return RFAILED; @@ -10403,7 +10377,7 @@ DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo) QoSInformation_ExtIEs__value_PR_DRB_Information) { drbInfo = &drbModItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information; - if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK) + if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK) { DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()"); return RFAILED; @@ -10432,7 +10406,7 @@ DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo) * ****************************************************************/ uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\ -DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo) +DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, DuLcCfg *lcCfg, UpTnlCfg *upTnlInfo) { if(drbCfg != NULLP) { @@ -10460,20 +10434,21 @@ DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, } else { - lcCfg->drbQos = NULLP; - lcCfg->snssai = NULLP; - if(lcCfg->lcId == SRB2_LCID) - lcCfg->dlLcCfg.lcp = LC_PRIORITY_3; + lcCfg->lcConfig.drbQos = NULLP; + lcCfg->lcConfig.snssai = NULLP; + if(lcCfg->lcConfig.lcId == SRB2_LCID) + lcCfg->lcConfig.dlLcCfg.lcp = LC_PRIORITY_3; else - lcCfg->dlLcCfg.lcp = LC_PRIORITY_1; + lcCfg->lcConfig.dlLcCfg.lcp = LC_PRIORITY_1; + } if(ulLcCfg) { - lcCfg->ulLcCfgPres = true; - extractUlLcCfg(&lcCfg->ulLcCfg, ulLcCfg); + lcCfg->lcConfig.ulLcCfgPres = true; + extractUlLcCfg(&lcCfg->lcConfig.ulLcCfg, ulLcCfg); } else - lcCfg->ulLcCfgPres = false; + lcCfg->lcConfig.ulLcCfgPres = false; return ROK; } @@ -10494,17 +10469,17 @@ DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType, DRBs_ToBeSetup_Item_t *drbItem,\ DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LogicalChannelConfig_t *ulLcCfg,\ -LcCfg *lcCfg, UpTnlCfg *upTnlInfo) +DuLcCfg *lcCfg, UpTnlCfg *upTnlInfo) { uint8_t ret = ROK; - lcCfg->lcId = lcId; + lcCfg->lcConfig.lcId = lcId; lcCfg->configType = configType; if(rbType == RB_TYPE_SRB) { ret = extractMacRbCfg(lcId, NULL, NULL, NULL, ulLcCfg, lcCfg, NULL); } - else if(rbType == RB_TYPE_DRB) + else if(rbType == RB_TYPE_DRB && upTnlInfo != NULLP) { if(drbItem != NULL) ret = extractMacRbCfg(lcId, drbItem, NULL, NULL, ulLcCfg, lcCfg, upTnlInfo); @@ -10580,7 +10555,7 @@ uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList } /* Filling RLC/MAC Config*/ - memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg)); + memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(DuLcCfg)); memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg)); procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]), NULLP); if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK) @@ -10646,7 +10621,7 @@ void freeMacPdschServCellInfo(PdschServCellCfg *pdsch) * @return void * * ****************************************************************/ -void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg) +void freeMacServingCellInfo(ServCellRecfgInfo *srvCellCfg) { uint8_t timeDomRsrcIdx; @@ -10677,16 +10652,16 @@ void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg) * * @details * - * Function : freeUeReCfgCellGrpInfo + * Function : freeUeRecfgCellGrpInfo * * Functionality: Free cell Grp Cfg Info * - * @params[in] MacUeCfg* duUeCfg + * @params[in] DuMacUeCfg* duUeCfg * @return void * * ****************************************************************/ -void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg) +void freeUeRecfgCellGrpInfo(DuMacUeCfg *macUeCfg) { freeMacServingCellInfo(&macUeCfg->spCellCfg.servCellCfg); } @@ -11884,8 +11859,8 @@ PucchCfg *storedPucchCfg) * @return ROK/RFAILD * * ****************************************************************/ -uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg,\ -ServCellCfgInfo *storedSrvCellCfg) +uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellRecfgInfo *macSrvCellCfg,\ +ServCellRecfgInfo *storedSrvCellCfg) { uint8_t ret = ROK; BWP_DownlinkDedicated_t *dlBwp = NULLP; @@ -12239,23 +12214,23 @@ void extractDrxConfiguration(struct MAC_CellGroupConfig__drx_ConfigRrc *cuMacCel * * @details * - * Function : extractUeReCfgCellInfo + * Function : extractUeRecfgCellInfo * * Functionality: Fills Reconfig Cell group Info received by CU * * @params[in] CellGroupConfigRrc_t *cellGrp = CellGroupConfigRrc_t information which * is send by CU, which we have stored in F1UeContextSetupDb - * MacUeCfg *MacUeCfg = Used to Store the information, + * DuMacUeCfg *MacUeCfg = Used to Store the information, * which needs to send in other layer, as well as this can be * the variable which stores the information in DuCb, - * MacUeCfg *storedMacUeCfg = Null in case of sending the + * DuMacUeCfg *storedMacUeCfg = Null in case of sending the * information to other layer else it will have copyOfmacUeCfg * which we have stored in F1UeContextSetupDb. * * @return ROK/RFAILED * * ****************************************************************/ -uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg) +uint8_t extractUeRecfgCellInfo(CellGroupConfigRrc_t *cellGrp, DuMacUeCfg *macUeCfg, DuMacUeCfg *storedMacUeCfg) { uint8_t ret = ROK; MAC_CellGroupConfig_t *macCellGroup = NULLP; @@ -12746,14 +12721,14 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet) * * @details * - * Function : procUeReCfgCellInfo + * Function : procUeRecfgCellInfo * * Functionality: builds Mac Cell Cfg * - * @params[in] MacUeCfg *macUeCfgToSend = Used to Store the information which + * @params[in] DuMacUeCfg *macUeCfgToSend = Used to Store the information which * needs to send in other layer, as well as this can be * the variable which stores the information in DuCb. - * MacUeCfg *storedMacUeCfg = Null in case of sending the + * DuMacUeCfg *storedMacUeCfg = Null in case of sending the * information to other layer else it will have copyOfmacUeCfg * which we have stored in F1UeContextSetupDb * void *cellInfo = CellGroupConfigRrc_t information which is send @@ -12762,7 +12737,7 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet) * @return void * * ****************************************************************/ -uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, MacUeCfg *storedMacUeCfg, void *cellInfo) +uint8_t procUeRecfgCellInfo(DuMacUeCfg *macUeCfgToSend, DuMacUeCfg *storedMacUeCfg, void *cellInfo) { uint8_t ret = ROK; CellGroupConfigRrc_t *cellGrp = NULLP; @@ -12770,13 +12745,13 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, MacUeCfg *storedMacUeCfg, if(cellInfo) { cellGrp = (CellGroupConfigRrc_t *)cellInfo; - ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg); + ret = extractUeRecfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg); if(ret == RFAILED) - DU_LOG("\nERROR --> F1AP : Failed at procUeReCfgCellInfo()"); + DU_LOG("\nERROR --> F1AP : Failed at procUeRecfgCellInfo()"); } if(ret == RFAILED) { - freeUeReCfgCellGrpInfo(macUeCfgToSend); + freeUeRecfgCellGrpInfo(macUeCfgToSend); } return ret; } @@ -12798,7 +12773,7 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, MacUeCfg *storedMacUeCfg, * RFAILED - failure * * ****************************************************************/ -void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap) +void duFillModulationDetails(DuMacUeCfg *ueCfg, DuMacUeCfg *oldUeCfg, void *ueCap) { UE_NR_Capability_t *ueNrCap=NULLP; @@ -12984,19 +12959,19 @@ uint8_t extractCuToDuRrcInfoExt(ProtocolExtensionContainer_4624P16_t *protocolIe * Functionality: Fills Srb List received by CU * * @params[in] SRBs_ToBeSetup_Item_t *cuSrbItem - * LcCfg pointer + * DuLcCfg pointer * RlcBearerCfg pointer * @return void * * ****************************************************************/ -uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd) +uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, DuLcCfg *duMacLcToAdd, RlcBearerCfg *rlcLcToAdd) { /* Filling RLC INFO */ procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd, NULL); /* Filling MAC INFO */ - if(procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, macLcToAdd, NULL) != ROK) + if(procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, duMacLcToAdd, NULL) != ROK) { DU_LOG("\nERROR --> F1AP : Failed at MAC LC Cfg in procSrbListToSetup()"); return RFAILED; @@ -13028,7 +13003,7 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb) { uint8_t ret = ROK, srbIdx = 0, rlcLcIdx = 0; SRBs_ToBeSetup_Item_t *srbItem = NULLP; - LcCfg *macLcCtxt = NULLP; + DuLcCfg *macLcCtxt = NULLP; RlcBearerCfg *rlcLcCtxt = NULLP; if(srbCfg) @@ -13063,7 +13038,7 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb) } if(!macLcCtxt) { - memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg)); + memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg)); macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs]; ueCfgDb->numMacLcs++; } @@ -13103,14 +13078,14 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb) * for both MAC and RLC * * @params[in] DRBs_ToBeSetup_Item_t , DRBs_ToBeSetupMod_Item_t, - * DRBs_ToBeModified_Item_t , lcId, LcCfg pointer, + * DRBs_ToBeModified_Item_t , lcId, DuLcCfg pointer, * RlcBearerCfg , UpTnlCfg, RlcUeCfg * @return void * * ****************************************************************/ uint8_t procDrbListToSetupMod(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\ -DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo, RlcUeCfg *storedRlcUeCfg) +DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, DuLcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo, RlcUeCfg *storedRlcUeCfg) { uint8_t cfgIdx = 0; RlcMode rlcModeInfo; @@ -13191,7 +13166,7 @@ uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMo DRBs_ToBeSetup_Item_t *drbItem = NULLP; DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP; DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP; - LcCfg *macLcCtxt = NULLP; + DuLcCfg *macLcCtxt = NULLP; RlcBearerCfg *rlcLcCtxt = NULLP; ret = ROK; @@ -13239,7 +13214,7 @@ uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMo } if(!macLcCtxt) { - memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg)); + memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg)); macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs]; ueCfgDb->numMacLcs++; } @@ -13265,6 +13240,7 @@ uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMo DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for Modified List"); break; } + ueCfgDb->numDrbModified++; } else { @@ -13314,6 +13290,120 @@ uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMo return ret; } +/******************************************************************* + * + * @brief extract Drb List received from CU + * + * @details + * + * Function : extractDrbListToRelease + * + * Functionality: extract Drb List received from CU + * for both MAC and RLC + * + * @params[in] DRBs_ToBeReleased_Item_t pointer + * DuUeCfg pointer + * @return ROK/RFAIED + * + * ****************************************************************/ + +uint8_t extractDrbListToRelease(uint8_t ueId, DRBs_ToBeReleased_List_t *drbToRel, uint8_t drbCount, DuUeCfg *ueCfgDb, RlcUeCfg *rlcUeCfg) +{ + uint8_t ret = ROK, teIdx = 0; + uint8_t drbIdx = 0, rlcLcIdx = 0; + uint8_t drbId = 0, lcId = 0; + DRBs_ToBeReleased_ItemIEs_t *drbRelItem = NULLP; + DuLcCfg *macLcCtxt = NULLP; + RlcBearerCfg *rlcLcCtxt = NULLP; + + ret = ROK; + if(drbCount > 0) + { + for(drbIdx = 0; drbIdx < drbCount; drbIdx++) + { + macLcCtxt = NULL; + rlcLcCtxt = NULL; + + if(drbToRel != NULLP) + { + drbRelItem = (DRBs_ToBeReleased_ItemIEs_t *) drbToRel->list.array[drbIdx]; + drbId = drbRelItem->value.choice.DRBs_ToBeReleased_Item.dRBID; + } + else + { + DU_LOG("ERROR --> DU APP : DrbToRelease pointer is NULL in extractDrbListToRelease"); + return RFAILED; + } + + for(rlcLcIdx = 0; rlcLcIdx < ueCfgDb->numRlcLcs; rlcLcIdx++) + { + if(ueCfgDb->rlcLcCfg[rlcLcIdx].rbId == drbId && ueCfgDb->rlcLcCfg[rlcLcIdx].rbType == RB_TYPE_DRB) + { + macLcCtxt = &ueCfgDb->macLcCfg[rlcLcIdx]; + rlcLcCtxt = &ueCfgDb->rlcLcCfg[rlcLcIdx]; + break; + } + } + + if(!macLcCtxt) + { + memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg)); + macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs]; + ueCfgDb->numMacLcs++; + } + if(!rlcLcCtxt) + { + memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg)); + rlcLcCtxt = &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]; + ueCfgDb->numRlcLcs++; + } + lcId = fetchLcId(drbId); + if(lcId < MIN_DRB_LCID) + { + DU_LOG("\nERROR --> F1AP : Failed fetching LCID %d in extractDrbListToRelease() for Modified List", lcId); + break; + } + + /* Filling RLC INFO */ + procRlcLcCfg(drbId, lcId, RB_TYPE_DRB, rlcLcCtxt->rlcMode, CONFIG_DEL, NULL, rlcLcCtxt, NULLP); + /* Filling MAC INFO */ + if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_DEL, NULL, NULL, NULL, NULL, macLcCtxt, NULLP) != ROK) + { + DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in extractDrbListToRelease()"); + return RFAILED; + } + ueCfgDb->upTnlInfo[ueCfgDb->numDrb].configType = CONFIG_DEL; + ueCfgDb->upTnlInfo[ueCfgDb->numDrb].drbId = drbId; + ueCfgDb->upTnlInfo[ueCfgDb->numDrb].ueId = ueId; + + for(teIdx = 0; teIdx < duCb.numTeId; teIdx++) + { + if((duCb.upTnlCfg[teIdx]->ueId == ueCfgDb->upTnlInfo[ueCfgDb->numDrb].ueId) && \ + (duCb.upTnlCfg[teIdx]->drbId == ueCfgDb->upTnlInfo[ueCfgDb->numDrb].drbId)) + { + DU_ALLOC(ueCfgDb->upTnlInfo[ueCfgDb->numDrb].tnlCfg1, sizeof(GtpTnlCfg)); + memcpy(ueCfgDb->upTnlInfo[ueCfgDb->numDrb].tnlCfg1, duCb.upTnlCfg[teIdx]->tnlCfg1, sizeof(GtpTnlCfg)); + break; + } + } + + ueCfgDb->numDrb++; + if(ret == RFAILED) + { + DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToRelease() for Modified List"); + break; + } + + DU_LOG("\nDEBUG --> DUAPP: extractDrbListToRelease():lcId:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\ + lcId,ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb); + } + } + else + ret = RFAILED; + + return ret; +} + /******************************************************************* * * @brief Function to extract Dl RRC Msg received from CU @@ -14343,6 +14433,7 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueId) FreeUeContextSetupRsp(f1apMsg); return ret; }/* End of BuildAndSendUeContextSetupRsp */ + /******************************************************************* * * @brief Build And Send Ue Context Rsp @@ -15657,12 +15748,6 @@ uint8_t BuildDrbSetupModList(DRBs_SetupMod_List_t *drbSet , DuUeCfg *ueCfg) drbCnt = ueCfg->numDrbSetupMod; - if(!drbCnt) - { - DU_LOG("\nINFO --> F1AP : BuildDrbToBeSetupModList(): No DRB information to avaialble to add"); - return ROK; - } - drbSet->list.count = drbCnt; drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *); DU_ALLOC(drbSet->list.array, drbSet->list.size); @@ -15724,6 +15809,107 @@ void FreeDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList) DU_FREE(drbSetupList->list.array, drbSetupList->list.size); } +/******************************************************************* +* +* @brief Builds the DRB to be Mod list +* +* @details +* +* Function : +* +* Functionality: Constructs the DRB to be Mod list +* +* @params[in] DRBs_Modified_List_t *drbModList +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t BuildDrbModList(DRBs_Modified_List_t *drbModList, DuUeCfg *ueCfg) +{ + uint8_t arrIdx =0, drbIdx = 0; + uint8_t drbCnt =0; + struct DRBs_Modified_ItemIEs *drbItemIe; + + /*VS: Below for loop is for debug purpose, to remove in final patch*/ + for(arrIdx = 0; arrIdx < ueCfg->numDrb; arrIdx++) + { + if(ueCfg->upTnlInfo[arrIdx].configType == CONFIG_MOD) + { + drbCnt++; + } + } + + drbCnt = ueCfg->numDrbModified; + + drbModList->list.count = drbCnt; + drbModList->list.size = drbCnt * sizeof(DRBs_Modified_ItemIEs_t *); + DU_ALLOC(drbModList->list.array, drbModList->list.size); + if(drbModList->list.array == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbModList()"); + return RFAILED; + } + + drbIdx = 0; + for(arrIdx = 0; arrIdx < ueCfg->numMacLcs; arrIdx++) + { + if(ueCfg->macLcCfg[arrIdx].configType == CONFIG_MOD) + { + DU_ALLOC(drbModList->list.array[drbIdx], sizeof(DRBs_Modified_ItemIEs_t)); + if(drbModList->list.array[drbIdx] == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbModList"); + return RFAILED; + } + + drbItemIe = (struct DRBs_Modified_ItemIEs *)drbModList->list.array[drbIdx]; + drbItemIe->id = ProtocolIE_ID_id_DRBs_Modified_Item; + drbItemIe->criticality = Criticality_reject; + drbItemIe->value.present = DRBs_Modified_ItemIEs__value_PR_DRBs_Modified_Item; + drbItemIe->value.choice.DRBs_Modified_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId; + if(fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_Modified_Item.dLUPTNLInformation_ToBeSetup_List,\ + &ueCfg->upTnlInfo[arrIdx])!= ROK) + { + DU_LOG("\nERROR --> F1AP : Failed to fill DlTnl SetupList in BuildDrbModList"); + return RFAILED; + } + drbIdx++; + } + } + + return ROK; +} + +/******************************************************************* +* @brief Free the memory allocated for DRB Mod List +* +* @details +* +* Function : FreeDrbModList +* +* Functionality: +* Free the memory allocated for DRB modified list +* +* @params[in] DRBs_Modified_List_t * +* @return void +* +* ****************************************************************/ +void FreeDrbModList(DRBs_Modified_List_t *drbModList) +{ + uint8_t arrIdx = 0; + DRBs_Modified_ItemIEs_t *drbItemIe = NULLP; + + for(arrIdx = 0; arrIdx < drbModList->list.count; arrIdx++) + { + drbItemIe = ((DRBs_Modified_ItemIEs_t *)drbModList->list.array[arrIdx]); + freeDlTnlInfo(&drbItemIe->value.choice.DRBs_Modified_Item.dLUPTNLInformation_ToBeSetup_List); + DU_FREE(drbModList->list.array[arrIdx], sizeof(DRBs_Modified_ItemIEs_t)); + } + DU_FREE(drbModList->list.array, drbModList->list.size); +} + /******************************************************************* * @brief Free the memory allocated for SRB setup List * @@ -15789,6 +15975,12 @@ void FreeUeContextModResp(F1AP_PDU_t *f1apMsg) value.choice.DRBs_SetupMod_List)); break; } + case ProtocolIE_ID_id_DRBs_Modified_List: + { + FreeDrbModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\ + value.choice.DRBs_Modified_List)); + break; + } case ProtocolIE_ID_id_SRBs_SetupMod_List: { FreeSrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.\ @@ -15860,13 +16052,16 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) if(ueCb->f1UeDb->actionType == UE_CTXT_MOD) { + elementCnt = 2; if(ueCb->f1UeDb->duUeCfg.numDrbSetupMod) - elementCnt =3; - else - elementCnt =2; + elementCnt++; + if(ueCb->f1UeDb->duUeCfg.numDrbModified) + elementCnt++; } if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) + { elementCnt = 5; + } if(ueCb->f1UeDb->actionType == UE_CTXT_RRC_RECFG_COMPLETE) elementCnt = 2; ueContextModifyRes->protocolIEs.list.count = elementCnt; @@ -15914,7 +16109,8 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) BuildCellGroupConfigRrc(ueCb, &ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCInformation.cellGroupConfig); } - if((ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) || ((ueCb->f1UeDb->actionType == UE_CTXT_MOD) && (ueCb->f1UeDb->duUeCfg.numDrbSetupMod))) + if((ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) || \ + ((ueCb->f1UeDb->actionType == UE_CTXT_MOD) && (ueCb->f1UeDb->duUeCfg.numDrbSetupMod))) { ieIdx++; ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List; @@ -15940,6 +16136,22 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) } } + if((ueCb->f1UeDb->actionType == UE_CTXT_MOD) && (ueCb->f1UeDb->duUeCfg.numDrbModified)) + { + ieIdx++; + ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_Modified_List; + ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject; + ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\ + UEContextModificationResponseIEs__value_PR_DRBs_Modified_List; + ret = BuildDrbModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\ + value.choice.DRBs_Modified_List) , &ueCb->f1UeDb->duUeCfg); + if(ret != ROK) + { + DU_LOG( "\nERROR --> F1AP : Failed to build DRB Modified List "); + break; + } + } + if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) { ieIdx++; @@ -15977,7 +16189,7 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) /* Encode results */ if(encRetVal.encoded == ENCODE_FAIL) { - DU_LOG( "\nERROR --> F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\ + DU_LOG( "\nERROR --> F1AP : Could not encode UE Modification Response structure (at %s)\n",\ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown"); ret = RFAILED; break; @@ -15994,9 +16206,9 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) } /* Sending msg */ - if(sendF1APMsg() != ROK) + if(sendF1APMsg() != ROK && (ret == ROK)) { - DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Res Failed"); + DU_LOG("\nERROR --> F1AP : Sending UE Modification Res Failed"); ret = RFAILED; break; } @@ -16007,6 +16219,7 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) FreeUeContextModResp(f1apMsg); return ret; } + /******************************************************************* * * @brief Deallocating the memory allocated by the aper decoder @@ -16085,6 +16298,7 @@ void freeAperDecodeUlTnlInfoforDrbSetupMod(ULUPTNLInformation_ToBeSetup_List_t * free(ulInfo->list.array); } } + /******************************************************************* * * @brief Deallocating the memory allocated by the aper decoder @@ -16208,6 +16422,169 @@ void freeAperDecodeDrbToBeSetupModList(DRBs_ToBeSetupMod_List_t *drbSet) free(drbSet->list.array); } +} + +/******************************************************************* + * + * @brief Deallocating the memory allocated by the aper decoder + * for DrbSetupModItem + * + * @details + * + * Function : freeAperDecodeDrbModifiedItem + * + * Functionality: Deallocating memory allocated for DrbModifedItem + * + * @params[in] DRBs_ToBeModified_Item_t *drbItem + * + * @return void + * + * ****************************************************************/ + +void freeAperDecodeDrbModifiedItem(DRBs_ToBeModified_Item_t *drbItem) +{ + uint8_t arrIdx =0; + SNSSAI_t *snssai =NULLP; + Flows_Mapped_To_DRB_List_t *flowMap = NULLP; + + if(drbItem->qoSInformation != NULLP) + { + drbItem->qoSInformation->present = QoSInformation_PR_choice_extension; + switch(drbItem->qoSInformation->present) + { + case QoSInformation_PR_NOTHING: + break; + case QoSInformation_PR_eUTRANQoS: + { + if(drbItem->qoSInformation->choice.eUTRANQoS) + { + free(drbItem->qoSInformation->choice.eUTRANQoS); + } + break; + } + case QoSInformation_PR_choice_extension: + { + if(drbItem->qoSInformation->choice.choice_extension) + { + freeAperDecodeQosInfo(&drbItem->qoSInformation->choice.choice_extension->value.choice.\ + DRB_Information.dRB_QoS); + snssai = &drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.sNSSAI; + if(snssai->sST.buf) + { + free(snssai->sST.buf); + } + if(snssai->sD) + { + if(snssai->sD->buf) + { + free(snssai->sD->buf); + } + free(snssai->sD); + } + + flowMap = &drbItem->qoSInformation->choice.choice_extension->value.choice.\ + DRB_Information.flows_Mapped_To_DRB_List; + if(flowMap->list.array) + { + for(arrIdx=0; arrIdxlist.count; arrIdx++) + { + if(flowMap->list.array[arrIdx] ) + { + freeAperDecodeQosInfo(&flowMap->list.array[arrIdx]->qoSFlowLevelQoSParameters); + free(flowMap->list.array[arrIdx]); + } + } + free(flowMap->list.array); + } + + free(drbItem->qoSInformation->choice.choice_extension); + } + break; + } + } + free(drbItem->qoSInformation); + } + freeAperDecodeUlTnlInfoforDrbSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List); + if(drbItem->uLConfiguration) + { + free(drbItem->uLConfiguration); + } +} + +/******************************************************************* + * + * @brief Deallocating the memory allocated by the aper decoder + * for DrbToBeSetupModList + * + * @details + * + * Function : freeAperDecodeDrbToBeModifiedList + * + * Functionality: Deallocating memory allocated for DrbToBeModifiedList + * + * @params[in] DRBs_ToBeModified_List_t *drbSet + * + * @return void + * + * ****************************************************************/ + +void freeAperDecodeDrbToBeModifiedList(DRBs_ToBeModified_List_t *drbSet) +{ + uint8_t arrIdx =0; + struct DRBs_ToBeModified_ItemIEs *drbItemIe; + + if(drbSet->list.array) + { + for(arrIdx=0; arrIdxlist.count ; arrIdx++) + { + if(drbSet->list.array[arrIdx] != NULLP) + { + if(arrIdx == 0) + { + drbItemIe = (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]; + freeAperDecodeDrbModifiedItem(&(drbItemIe->value.choice.DRBs_ToBeModified_Item)); + } + free(drbSet->list.array[arrIdx]); + } + } + free(drbSet->list.array); + } + +} + +/******************************************************************* + * + * @brief Deallocating the memory allocated by the aper decoder + * for DrbToBeSetupModList + * + * @details + * + * Function : freeAperDecodeDrbToBeReleasedList + * + * Functionality: Deallocating memory allocated for DrbToBeReleasedList + * + * @params[in] DRBs_ToBeReleased_List_t *drbSet + * + * @return void + * + * ****************************************************************/ + +void freeAperDecodeDrbToBeReleasedList(DRBs_ToBeReleased_List_t *drbSet) +{ + uint8_t arrIdx =0; + + if(drbSet->list.array) + { + for(arrIdx=0; arrIdxlist.count ; arrIdx++) + { + if(drbSet->list.array[arrIdx] != NULLP) + { + free(drbSet->list.array[arrIdx]); + } + } + free(drbSet->list.array); + } + } /******************************************************************* * @@ -16249,6 +16626,18 @@ void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *u value.choice.DRBs_ToBeSetupMod_List); break; } + case ProtocolIE_ID_id_DRBs_ToBeModified_List: + { + freeAperDecodeDrbToBeModifiedList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\ + value.choice.DRBs_ToBeModified_List); + break; + } + case ProtocolIE_ID_id_DRBs_ToBeReleased_List: + { + freeAperDecodeDrbToBeReleasedList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\ + value.choice.DRBs_ToBeReleased_List); + break; + } case ProtocolIE_ID_id_TransmissionActionIndicator: break; case ProtocolIE_ID_id_RRCContainer: @@ -16281,8 +16670,9 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg) UEContextModificationRequest_t *ueContextModifyReq = NULLP; uint8_t ret = ROK, ieIdx = 0, cellIdx=0; DuUeCb *duUeCb = NULLP; - DRBs_ToBeSetupMod_List_t *drbSetupModCfg; - DRBs_ToBeModified_List_t *drbModifiedCfg; + DRBs_ToBeSetupMod_List_t *drbSetupModCfg = NULLP; + DRBs_ToBeModified_List_t *drbModifiedCfg = NULLP; + DRBs_ToBeReleased_List_t *drbToRelease = NULLP; uint32_t gnbCuUeF1apId, gnbDuUeF1apId; ueContextModifyReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest; @@ -16348,9 +16738,11 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg) case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List: case ProtocolIE_ID_id_DRBs_ToBeModified_List: + case ProtocolIE_ID_id_DRBs_ToBeReleased_List: { if(duUeCb->f1UeDb) { + /*DRBs to be Added*/ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\ UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List) { @@ -16365,6 +16757,7 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg) } } + /*DRBs to be Modified*/ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \ UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List) @@ -16378,6 +16771,20 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg) ret = RFAILED; } } + /*DRBs to be Released*/ + if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \ + UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List) + + { + drbToRelease = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\ + choice.DRBs_ToBeReleased_List; + if(extractDrbListToRelease(gnbDuUeF1apId, drbToRelease, drbToRelease->list.count,\ + &duUeCb->f1UeDb->duUeCfg, &duUeCb->rlcUeCfg)) + { + DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList"); + ret = RFAILED; + } + } } break; }