+ DU_LOG("\nERROR --> DU APP : Memory Allocation failed for medium bit map buffer in BuildSsbPosInBurst()");
+ return RFAILED;
+ }
+
+ if((fillBitString(&ssbPosInBurst->choice.mediumBitmap, 0, bitStringSizeInBytes, \
+ duCfgParam.sib1Params.srvCellCfgCommSib.ssbPosInBurst)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill medium bit map in BuildSsbPosInBurst()");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills SP cell config common in Reconfig with Sync
+ *
+ * @details
+ *
+ * Function : BuildSpCellConfigCommon
+ *
+ * Functionality: Fills SP cell config common in Reconfig with Sync
+ *
+ * @params[in] Pointer to ServingCellConfigCommon_t
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildSpCellConfigCommon(ServingCellConfigCommon_t *spCellConfigCommon)
+{
+ /* Physical Cell Identity */
+ DU_ALLOC(spCellConfigCommon->physCellId, sizeof(PhysCellId_t));
+ if(!spCellConfigCommon->physCellId)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for physical cell id in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->physCellId) = NR_PCI;
+
+ /* Downlink Config Common */
+ DU_ALLOC(spCellConfigCommon->downlinkConfigCommon, sizeof(DownlinkConfigCommon_t));
+ if(!spCellConfigCommon->downlinkConfigCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for DL Config Common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildDlConfigCommon(spCellConfigCommon->downlinkConfigCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill DL config commin in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* Uplinlink Config Common */
+ DU_ALLOC(spCellConfigCommon->uplinkConfigCommon, sizeof(UplinkConfigCommon_t));
+ if(!spCellConfigCommon->uplinkConfigCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for UL Config Common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildUlConfigCommon(spCellConfigCommon->uplinkConfigCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill UL config commin in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* Timing Advance offset */
+ DU_ALLOC(spCellConfigCommon->n_TimingAdvanceOffset, sizeof(long));
+ if(!spCellConfigCommon->n_TimingAdvanceOffset)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for Timing Advance Offset in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->n_TimingAdvanceOffset) = ServingCellConfigCommon__n_TimingAdvanceOffset_n0;
+
+ /* SSB Position In Burst */
+ DU_ALLOC(spCellConfigCommon->ssb_PositionsInBurst, sizeof(struct ServingCellConfigCommon__ssb_PositionsInBurst));
+ if(!spCellConfigCommon->ssb_PositionsInBurst)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for SSB Position In Burst in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildSsbPosInBurst(spCellConfigCommon->ssb_PositionsInBurst)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill SSB Position In Burst in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* SSB Periodicity in Serving cell */
+ DU_ALLOC(spCellConfigCommon->ssb_periodicityServingCell, sizeof(long));
+ if(!spCellConfigCommon->ssb_periodicityServingCell)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for SSB Periodicity serving cell in \
+ BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->ssb_periodicityServingCell) = \
+ convertSsbPeriodicityValueToEnum(duCfgParam.sib1Params.srvCellCfgCommSib.ssbPrdServingCell);
+
+ /* DMRS Type A position */
+ spCellConfigCommon->dmrs_TypeA_Position = convertDmrsTypeAPosValueToEnum(duCfgParam.macCellCfg.ssbCfg.dmrsTypeAPos);
+
+ /* SSB subcarrier spacing */
+ DU_ALLOC(spCellConfigCommon->ssbSubcarrierSpacing, sizeof(SubcarrierSpacing_t));
+ if(!spCellConfigCommon->ssbSubcarrierSpacing)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for sub-carrier spacing in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->ssbSubcarrierSpacing) = duCfgParam.sib1Params.srvCellCfgCommSib.scs;
+
+ /* TDD UL-DL configuration common */
+ DU_ALLOC(spCellConfigCommon->tdd_UL_DL_ConfigurationCommon, sizeof(TDD_UL_DL_ConfigCommon_t));
+ if(!spCellConfigCommon->tdd_UL_DL_ConfigurationCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for TDD UL-DL config common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildTddUlDlCfgComm(spCellConfigCommon->tdd_UL_DL_ConfigurationCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill TDD UL-DL config common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* SS PBCH Block Power */
+ spCellConfigCommon->ss_PBCH_BlockPower = duCfgParam.sib1Params.srvCellCfgCommSib.ssPbchBlockPwr;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills dedicated RACH configuration in Reconfiguration with sync
+ *
+ * @details
+ *
+ * Function : BuildRecfgWithSync
+ *
+ * Functionality:
+ * Fills dedicated RACH configuration in Reconfiguration with sync
+ *
+ * @params[in] DU UE CB
+ * Pointer to Rach config dedicated struct
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRachConfigDedicated(DuUeCb *ueCb, struct ReconfigurationWithSync__rach_ConfigDedicated *rachCfgDed)
+{
+ uint8_t elementCnt = 0, listIdx = 0;
+ CFRA_t *cfra = NULLP;
+ struct CFRA__resources__ssb *ssbResource = NULLP;
+ RachCfgCommon duRachCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.rachCfg;
+
+ rachCfgDed->present = ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
+
+ /* Uplink */
+ DU_ALLOC(rachCfgDed->choice.uplink, sizeof(RACH_ConfigDedicated_t));
+ if(!rachCfgDed->choice.uplink)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for RACH uplink configuration in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+
+ /* CFRA : Contention free Random Access */
+ DU_ALLOC(rachCfgDed->choice.uplink->cfra, sizeof(CFRA_t));
+ if(!rachCfgDed->choice.uplink->cfra)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+ cfra = rachCfgDed->choice.uplink->cfra;
+
+ /* CFRA occassions */
+ DU_ALLOC(cfra->occasions, sizeof(struct CFRA__occasions));
+ if(!cfra->occasions)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA occassion in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+
+ /* CFRA occassions : RACH generic configuration */
+ cfra->occasions->rach_ConfigGeneric.prach_ConfigurationIndex = duRachCfg.prachCfgIdx;
+ cfra->occasions->rach_ConfigGeneric.msg1_FDM = duRachCfg.msg1Fdm;
+ cfra->occasions->rach_ConfigGeneric.msg1_FrequencyStart = duRachCfg.msg1FreqStart;
+ cfra->occasions->rach_ConfigGeneric.zeroCorrelationZoneConfig = duRachCfg.zeroCorrZoneCfg;
+ cfra->occasions->rach_ConfigGeneric.preambleReceivedTargetPower = duRachCfg.preambleRcvdTgtPwr;
+ cfra->occasions->rach_ConfigGeneric.preambleTransMax = duRachCfg.preambleTransMax;
+ cfra->occasions->rach_ConfigGeneric.powerRampingStep = duRachCfg.pwrRampingStep;
+ cfra->occasions->rach_ConfigGeneric.ra_ResponseWindow = duRachCfg.raRspWindow;
+
+ /* CFRA occassions : SSB per RACH occasion */
+ DU_ALLOC(cfra->occasions->ssb_perRACH_Occasion, sizeof(long));
+ if(!cfra->occasions->ssb_perRACH_Occasion)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB per RACH occassion in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+ *(cfra->occasions->ssb_perRACH_Occasion) = convertCFRASsbPerRachOccasionValueToEnum(duCfgParam.macCellCfg.prachCfg.ssbPerRach);
+
+ /* CFRA resource */
+ cfra->resources.present = CFRA__resources_PR_ssb;
+
+ /* CFRA resource : SSB */
+ DU_ALLOC(cfra->resources.choice.ssb, sizeof(struct CFRA__resources__ssb));
+ if(!cfra->resources.choice.ssb)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA resource - SSB in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+ ssbResource = cfra->resources.choice.ssb;
+
+ /* CFRA SSB resource list */
+ elementCnt = ueCb->cfraResource.numSsb;
+ ssbResource->ssb_ResourceList.list.count = elementCnt;
+ ssbResource->ssb_ResourceList.list.size = elementCnt * sizeof(CFRA_SSB_Resource_t *);
+
+ DU_ALLOC(ssbResource->ssb_ResourceList.list.array, ssbResource->ssb_ResourceList.list.size);
+ if(!ssbResource->ssb_ResourceList.list.array)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB resource list in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+
+ for(listIdx = 0; listIdx < elementCnt; listIdx++)
+ {
+ DU_ALLOC(ssbResource->ssb_ResourceList.list.array[listIdx], sizeof(CFRA_SSB_Resource_t));
+ if(!ssbResource->ssb_ResourceList.list.array[listIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB resource list element in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+ ssbResource->ssb_ResourceList.list.array[listIdx]->ssb = ueCb->cfraResource.ssbResource[listIdx].ssbIdx;
+ ssbResource->ssb_ResourceList.list.array[listIdx]->ra_PreambleIndex = ueCb->cfraResource.ssbResource[listIdx].raPreambleIdx;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills reconfiguration with sync in SP cell config
+ *
+ * @details
+ *
+ * Function : BuildRecfgWithSync
+ *
+ * Functionality: Fills reconfiguration with sync in SP cell config
+ *
+ * @params[in] DU UE CB
+ * Pointer to ReconfigurationWithSync_t
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRecfgWithSync(DuUeCb *ueCb, ReconfigurationWithSync_t *recfgWithSync)
+{
+ /* SP Cell Config Common */
+ DU_ALLOC(recfgWithSync->spCellConfigCommon, sizeof(ServingCellConfigCommon_t));
+ if(!recfgWithSync->spCellConfigCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for spCellConfigCommon in BuildRecfgWithSync()");
+ return RFAILED;
+ }
+
+ if((BuildSpCellConfigCommon(recfgWithSync->spCellConfigCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to build SpCellConfigCommon in BuildRecfgWithSync()");
+ return RFAILED;
+ }
+
+ /* New UE Identity */
+ recfgWithSync->newUE_Identity = ueCb->crnti;
+
+ /* T304 timer */
+ recfgWithSync->t304 = ReconfigurationWithSync__t304_ms1000;
+
+ /* RACH configuration dedicated */
+ DU_ALLOC(recfgWithSync->rach_ConfigDedicated, sizeof(struct ReconfigurationWithSync__rach_ConfigDedicated));
+ if(!recfgWithSync->rach_ConfigDedicated)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for RACH config dedicated in BuildRecfgWithSync()");
+ return RFAILED;
+ }
+
+ if((BuildRachConfigDedicated(ueCb, recfgWithSync->rach_ConfigDedicated)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to build RACH config dedicated in BuildRecfgWithSync()");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds Spcell config
+ *
+ * @details
+ *
+ * Function : BuildSpCellCfg
+ *
+ * Functionality: Builds sp cell config in DuToCuRrcContainer
+ *
+ * @params[in] SpCellConfig_t spCellCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildSpCellCfg(DuUeCb *ueCb, SpCellConfig_t *spCellCfg)
+{
+ spCellCfg->servCellIndex = NULLP;
+ DU_ALLOC(spCellCfg->servCellIndex, sizeof(long));
+ if(!spCellCfg->servCellIndex)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
+ return RFAILED;
+ }
+
+ if(ueCb == NULLP)
+ *(spCellCfg->servCellIndex) = SERV_CELL_IDX;
+ else
+ *(spCellCfg->servCellIndex) = ueCb->duMacUeCfg.spCellCfg.servCellIdx;
+
+ spCellCfg->reconfigurationWithSync = NULLP;
+ if(ueCb && (ueCb->ueState == UE_HANDIN_IN_PROGRESS))
+ {
+ DU_ALLOC(spCellCfg->reconfigurationWithSync, sizeof(ReconfigurationWithSync_t));
+ if(!spCellCfg->reconfigurationWithSync)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
+ return RFAILED;
+ }
+
+ if((BuildRecfgWithSync(ueCb, spCellCfg->reconfigurationWithSync)) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Building of reconfiguration with sync failed at BuildSpCellCfg");
+ return RFAILED;
+ }
+ }
+
+ spCellCfg->rlf_TimersAndConstants = NULLP;
+ spCellCfg->rlmInSyncOutOfSyncThreshold = NULLP;
+
+ DU_ALLOC(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
+ if(!spCellCfg->rlmInSyncOutOfSyncThreshold)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
+ return RFAILED;
+ }
+ *(spCellCfg->rlmInSyncOutOfSyncThreshold) = RLM_SYNC_OUT_SYNC_THRESHOLD;
+
+ spCellCfg->spCellConfigDedicated = NULLP;
+ DU_ALLOC(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
+ if(!spCellCfg->spCellConfigDedicated)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
+ return RFAILED;
+ }
+ if(BuildSpCellCfgDed(ueCb, spCellCfg->spCellConfigDedicated) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildSpCellCfgDed failed");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds Phy cell group config
+ *
+ * @details
+ *
+ * Function : BuildPhyCellGrpCfg
+ *
+ * Functionality: Builds Phy cell group config in DuToCuRrcContainer
+ *
+ * @params[in] PhysicalCellGroupConfig_t *phyCellGrpCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPhyCellGrpCfg(DuUeCb *ueCb, PhysicalCellGroupConfig_t *phyCellGrpCfg)
+{
+ phyCellGrpCfg->harq_ACK_SpatialBundlingPUCCH = NULLP;
+ phyCellGrpCfg->harq_ACK_SpatialBundlingPUSCH = NULLP;
+
+ phyCellGrpCfg->p_NR_FR1 = NULLP;
+ DU_ALLOC(phyCellGrpCfg->p_NR_FR1, sizeof(long));
+ if(!phyCellGrpCfg->p_NR_FR1)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildPhyCellGrpCfg");
+ return RFAILED;
+ }
+
+ if(ueCb == NULLP)
+ {
+ *(phyCellGrpCfg->p_NR_FR1) = P_NR_FR1;
+ phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = PDSCH_HARQ_ACK_CODEBOOK;
+ }
+ else
+ {
+ *(phyCellGrpCfg->p_NR_FR1) = ueCb->duMacUeCfg.phyCellGrpCfg.pNrFr1;
+ phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = ueCb->duMacUeCfg.phyCellGrpCfg.pdschHarqAckCodebook;
+ }
+
+ phyCellGrpCfg->tpc_SRS_RNTI = NULLP;
+ phyCellGrpCfg->tpc_PUCCH_RNTI = NULLP;
+ phyCellGrpCfg->tpc_PUSCH_RNTI = NULLP;
+ phyCellGrpCfg->sp_CSI_RNTI = NULLP;
+ phyCellGrpCfg->cs_RNTI = NULLP;
+ phyCellGrpCfg->ext1 = NULLP;
+ phyCellGrpCfg->ext2 = NULLP;
+
+ return ROK;
+}
+#ifdef NR_DRX
+/*******************************************************************
+ *
+ * @brief fill long cycle offset value of drx
+ *
+ * @details
+ *
+ * Function : fillLongCycleOffsetValFromDuCb
+ *
+ * Functionality: fill long cycle offset value of drx
+ *
+ * @params[in] DrxLongCycleStartOffset drxLongCycleStartOffset,
+ * struct DRX_ConfigRrc__drx_LongCycleStartOffset drx_LongCycleStartOffset
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void fillLongCycleOffsetValFromDuCb(DrxLongCycleStartOffset drxLongCycleStartOffset,\
+struct DRX_ConfigRrc__drx_LongCycleStartOffset *drx_LongCycleStartOffset)
+{
+
+ drx_LongCycleStartOffset->present = convertLongDrxCycleLengthValueToEnum(drxLongCycleStartOffset.drxLongCycleStartOffsetChoice);
+ switch(drx_LongCycleStartOffset->present)
+ {
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10:
+ {
+ drx_LongCycleStartOffset->choice.ms10 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms20:
+ {
+ drx_LongCycleStartOffset->choice.ms20 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms32:
+ {
+ drx_LongCycleStartOffset->choice.ms32 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms40:
+ {
+ drx_LongCycleStartOffset->choice.ms40 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms60:
+ {
+ drx_LongCycleStartOffset->choice.ms60 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms64:
+ {
+ drx_LongCycleStartOffset->choice.ms64 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms70:
+ {
+ drx_LongCycleStartOffset->choice.ms70 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms80:
+ {
+ drx_LongCycleStartOffset->choice.ms80 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms128:
+ {
+ drx_LongCycleStartOffset->choice.ms128 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms160:
+ {
+ drx_LongCycleStartOffset->choice.ms160 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms256:
+ {
+ drx_LongCycleStartOffset->choice.ms256 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms320:
+ {
+ drx_LongCycleStartOffset->choice.ms320 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms512:
+ {
+ drx_LongCycleStartOffset->choice.ms512 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms640:
+ {
+ drx_LongCycleStartOffset->choice.ms640 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1024:
+ {
+ drx_LongCycleStartOffset->choice.ms1024 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1280:
+ {
+ drx_LongCycleStartOffset->choice.ms1280 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2048:
+ {
+ drx_LongCycleStartOffset->choice.ms2048 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2560:
+ {
+ drx_LongCycleStartOffset->choice.ms2560 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms5120:
+ {
+ drx_LongCycleStartOffset->choice.ms5120 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10240:
+ {
+ drx_LongCycleStartOffset->choice.ms10240 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ default :
+ break;
+ }
+}
+/*******************************************************************
+ *
+ * @brief Builds drx config IE
+ *
+ * @details
+ *
+ * Function : BuildDrxConfigRrc
+ *
+ * Functionality: Build drx config in MacCellGrpCfg
+ *
+ * @params[in] struct MAC_CellGroupConfig__drx_ConfigRrc
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildDrxConfigRrc(DuUeCb *ueCb, struct MAC_CellGroupConfig__drx_ConfigRrc *drxCfg)
+{
+ drxCfg->present = MAC_CellGroupConfig__drx_ConfigRrc_PR_setup;
+ DU_ALLOC(drxCfg->choice.setup, sizeof(struct DRX_ConfigRrc));
+ if(!drxCfg->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDrxConfigRrc");
+ return RFAILED;
+ }
+ 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->duMacUeCfg.\
+ macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationtimerValue.milliSeconds);
+ }
+ else
+ {
+ drxCfg->choice.setup->drx_onDurationTimer.present = DRX_ConfigRrc__drx_onDurationTimer_PR_subMilliSeconds;
+ drxCfg->choice.setup->drx_onDurationTimer.choice.subMilliSeconds = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxOnDurationTimer.onDurationtimerValue.subMilliSeconds;
+ }
+ drxCfg->choice.setup->drx_InactivityTimer = convertDrxInactivityTimerValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxInactivityTimer);
+ drxCfg->choice.setup->drx_HARQ_RTT_TimerDL = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxHarqRttTimerDl;
+ drxCfg->choice.setup->drx_HARQ_RTT_TimerUL = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxHarqRttTimerUl;
+ drxCfg->choice.setup->drx_RetransmissionTimerDL = convertDrxRetransmissionTimerDlValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxRetransmissionTimerDl);
+ drxCfg->choice.setup->drx_RetransmissionTimerUL = convertDrxRetransmissionTimerUlValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxRetransmissionTimerUl);
+ drxCfg->choice.setup->drx_SlotOffset = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxSlotOffset;
+ fillLongCycleOffsetValFromDuCb(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxLongCycleStartOffset, &drxCfg->choice.setup->drx_LongCycleStartOffset);
+
+ if(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.shortDrxPres)
+ {
+ DU_ALLOC(drxCfg->choice.setup->shortDRX, sizeof(struct DRX_ConfigRrc__shortDRX));
+ if(drxCfg->choice.setup->shortDRX)
+ {
+ drxCfg->choice.setup->shortDRX->drx_ShortCycle = convertShortDrxCycleLengthValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ shortDrx.drxShortCycle);
+ drxCfg->choice.setup->shortDRX->drx_ShortCycleTimer = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.shortDrx.drxShortCycleTimer;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDrxConfigRrc");
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
+#endif
+/*******************************************************************
+ *
+ * @brief Builds Mac cell group config
+ *
+ * @details
+ *
+ * Function : BuildMacCellGrpCfg
+ *
+ * Functionality: Builds Mac cell group config in DuToCuRrcContainer
+ *
+ * @params[in] MAC_CellGroupConfig_t *macCellGrpCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildMacCellGrpCfg(DuUeCb *ueCb, MAC_CellGroupConfig_t *macCellGrpCfg)
+{
+ macCellGrpCfg->drx_ConfigRrc = NULLP;
+#ifdef NR_DRX
+ if(ueCb)
+ {
+ DU_ALLOC(macCellGrpCfg->drx_ConfigRrc, sizeof(struct MAC_CellGroupConfig__drx_ConfigRrc));
+ if(!macCellGrpCfg->drx_ConfigRrc)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+ if(BuildDrxConfigRrc(ueCb, macCellGrpCfg->drx_ConfigRrc) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : failed to build drx config");
+ return RFAILED;
+ }
+ }
+#endif
+ macCellGrpCfg->schedulingRequestConfig = NULLP;
+ DU_ALLOC(macCellGrpCfg->schedulingRequestConfig, sizeof(struct SchedulingRequestConfig));
+ if(!macCellGrpCfg->schedulingRequestConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+
+ if(BuildSchedulingReqConfig(ueCb, macCellGrpCfg->schedulingRequestConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildSchedulingReqConfig failed");
+ return RFAILED;
+ }
+
+ macCellGrpCfg->bsr_Config = NULLP;
+ DU_ALLOC(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
+ if(!macCellGrpCfg->bsr_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+
+ if(BuildBsrConfig(ueCb, macCellGrpCfg->bsr_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildBsrConfig failed");
+ return RFAILED;
+ }
+
+ macCellGrpCfg->tag_Config = NULLP;
+ DU_ALLOC(macCellGrpCfg->tag_Config, sizeof(struct TAG_Config));
+ if(!macCellGrpCfg->tag_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+
+ if(BuildTagConfig(ueCb, macCellGrpCfg->tag_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildTagConfig failed");
+ return RFAILED;
+ }
+
+ macCellGrpCfg->phr_Config = NULLP;
+ DU_ALLOC(macCellGrpCfg->phr_Config, sizeof(struct MAC_CellGroupConfig__phr_Config));
+ if(!macCellGrpCfg->phr_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+
+ if(BuildPhrConfig(ueCb, macCellGrpCfg->phr_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildPhrConfig failed");
+ return RFAILED;
+ }
+
+ macCellGrpCfg->skipUplinkTxDynamic = false;
+ macCellGrpCfg->ext1 = NULLP;
+
+ return ROK;
+}
+/*******************************************************************
+ *
+ * @brief Frees memeory allocated for SearchSpcToAddModList
+ *
+ * @details
+ *
+ * Function : FreeSearchSpcToAddModList
+ *
+ * Functionality: Deallocating memory of SearchSpcToAddModList
+ *
+ * @params[in] struct PDCCH_Config__searchSpacesToAddModList *searchSpcList
+ *
+ * @return void
+ *
+ 4221 * ****************************************************************/
+void FreeSearchSpcToAddModList(struct PDCCH_Config__searchSpacesToAddModList *searchSpcList)
+{
+ uint8_t idx1=0;
+ uint8_t idx2=0;
+ struct SearchSpace *searchSpc=NULLP;
+
+ if(searchSpcList->list.array)
+ {
+ if(searchSpcList->list.array[idx2])
+ {
+ searchSpc = searchSpcList->list.array[idx2];
+ if(searchSpc->controlResourceSetId)