+ if(!frequencyInfoDL->frequencyBandList.list.array[idx]->\
+ freqBandIndicatorNR)
+ {
+ if(!frequencyInfoDL->scs_SpecificCarrierList.list.array)
+ {
+ for(idx1 = 0;idx1<frequencyInfoDL->scs_SpecificCarrierList.list.count;idx1++)
+ {
+ if(!frequencyInfoDL->scs_SpecificCarrierList.list.array[idx1])
+ {
+ DU_FREE(frequencyInfoDL->scs_SpecificCarrierList.list.\
+ array[idx1], sizeof(SCS_SpecificCarrier_t));
+ }
+ }
+ DU_FREE(frequencyInfoDL->scs_SpecificCarrierList.list.array,
+ frequencyInfoDL->scs_SpecificCarrierList.list.size);
+ }
+ DU_FREE(frequencyInfoDL->frequencyBandList.list.\
+ array[idx]->freqBandIndicatorNR, sizeof(FreqBandIndicatorNR_t));
+ }
+ }
+ for(idx = 0; idx <frequencyInfoDL->frequencyBandList.list.count; idx++)
+ {
+ if(!frequencyInfoDL->frequencyBandList.list.array[idx])
+ {
+ DU_FREE(frequencyInfoDL->frequencyBandList.list.array[idx],\
+ sizeof(NR_MultiBandInfo_t));
+ }
+ }
+ DU_FREE(frequencyInfoDL->frequencyBandList.list.array,\
+ frequencyInfoDL->frequencyBandList.list.size);
+ }
+}
+/*******************************************************************
+ *
+ * @brief : deallocating the memory of BuildSib1Msg
+ *
+ * @details
+ *
+ * Function : FreeCommonSerachSpaceList
+ *
+ * Functionality: deallocating the memory of BuildCommonSerachSpaceList
+ *
+ * @params[in] :struct PDCCH_ConfigCommon__commonSearchSpaceList *searchSpclist
+ * @return : void
+ *
+ *******************************************************************/
+void FreeCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpaceList
+*searchSpclist)
+{
+ uint8_t idx=0;
+ SearchSpace_t *searchSpace= NULLP;
+
+ if(!searchSpclist->list.array)
+ {
+ if( searchSpclist->list.array[idx] != NULLP)
+ {
+ searchSpace= searchSpclist->list.array[idx];
+ if(!searchSpace->controlResourceSetId)
+ {
+ if(!searchSpace->monitoringSlotPeriodicityAndOffset)
+ {
+ if(!searchSpace->monitoringSymbolsWithinSlot)
+ {
+ if(!searchSpace->monitoringSymbolsWithinSlot->buf)
+ {
+ if(!searchSpace->nrofCandidates)
+ {
+ if(!searchSpace->searchSpaceType)
+ {
+ switch(searchSpace->searchSpaceType->present)
+ {
+ case SearchSpace__searchSpaceType_PR_NOTHING:
+ break;
+ case SearchSpace__searchSpaceType_PR_common:
+ {
+ if(!searchSpace->searchSpaceType->choice.common)
+ {
+ if(!searchSpace->searchSpaceType->choice.\
+ common->dci_Format0_0_AndFormat1_0)
+ {
+ DU_FREE(searchSpace->searchSpaceType->choice.\
+ common->dci_Format0_0_AndFormat1_0,sizeof(struct\
+ SearchSpace__searchSpaceType__common__dci_Format0_0_AndFormat1_0));
+ }
+ DU_FREE(searchSpace->searchSpaceType->choice.common,\
+ sizeof(struct SearchSpace__searchSpaceType__common));
+ }
+ break;
+ }
+ case SearchSpace__searchSpaceType_PR_ue_Specific:
+ break;
+ default:
+ break;
+ }
+ DU_FREE(searchSpace->searchSpaceType,\
+ sizeof( struct SearchSpace__searchSpaceType));
+ }
+ DU_FREE(searchSpace->nrofCandidates,\
+ sizeof(struct SearchSpace__nrofCandidates));
+ }
+ DU_FREE(searchSpace->monitoringSymbolsWithinSlot->buf,\
+ searchSpace->monitoringSymbolsWithinSlot->size);
+ }
+ DU_FREE(searchSpace->monitoringSymbolsWithinSlot,\
+ sizeof(BIT_STRING_t));
+ }
+ DU_FREE(searchSpace->monitoringSlotPeriodicityAndOffset,\
+ sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
+ }
+ DU_FREE(searchSpace->controlResourceSetId,sizeof(ControlResourceSetId_t));
+ }
+ }
+ for(idx = 0; idx < searchSpclist->list.count; idx++)
+ {
+ if(!searchSpclist->list.array[idx])
+ {
+ DU_FREE(searchSpclist->list.array[idx], sizeof(SearchSpace_t));
+ }
+ }
+ DU_FREE(searchSpclist->list.array, searchSpclist->list.size)
+ }
+}
+/*******************************************************************
+ *
+ * @brief : deallocating the memory of BuildSib1Msg
+ *
+ * @details
+ *
+ * Function : FreeBwpDlCommon
+ *
+ * Functionality :Deallocating memory of BuildBwpDlCommon
+ *
+ * @params[in] : BWP_DownlinkCommon_t *bwp
+ *
+ * @return : void
+ *
+ *******************************************************************/
+void FreeBwpDlCommon(BWP_DownlinkCommon_t *bwp)
+{
+ uint8_t idx =0;
+ struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdschCfg=bwp->pdsch_ConfigCommon;
+ struct BWP_DownlinkCommon__pdcch_ConfigCommon *pdcchCfg=bwp->pdcch_ConfigCommon;
+ pdcchCfg->present=duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdcchCfg.present;
+ pdschCfg->present=duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdschCfg.present;
+
+ if(!bwp->pdcch_ConfigCommon)
+ {
+ if(!bwp->pdsch_ConfigCommon)
+ {
+ switch( pdschCfg->present)
+ {
+ case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_NOTHING:
+ {
+ //TODO
+ break;
+ }
+ case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_release:
+ {
+ //TODO
+ break;
+ }
+ case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup:
+ {
+ if(!pdschCfg->choice.setup)
+ {
+ if(!pdschCfg->choice.setup->pdsch_TimeDomainAllocationList)
+ {
+ if(!pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array)
+ {
+ if(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array[idx]!= NULLP)
+ {
+ if(!pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array[idx]->k0)
+ {
+ DU_FREE(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array[idx]->k0,\
+ sizeof(long));
+ }
+ }
+ for(idx=0; idx<pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.count ; idx++)
+ {
+ if(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array[idx]!=
+ NULLP)
+ {
+ DU_FREE(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array[idx],\
+ sizeof(PDSCH_TimeDomainResourceAllocation_t));
+ }
+ }
+ DU_FREE(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.array,\
+ pdschCfg->choice.setup->pdsch_TimeDomainAllocationList->list.size);
+ }
+ DU_FREE(pdschCfg->choice.setup->pdsch_TimeDomainAllocationList,\
+ sizeof(PDSCH_TimeDomainResourceAllocationList_t));
+ }
+ DU_FREE(pdschCfg->choice.setup,
+ sizeof(PDSCH_ConfigCommon_t));
+ }
+ }
+ default:
+ break;
+ }
+ DU_FREE(bwp->pdsch_ConfigCommon,\
+ sizeof(struct BWP_DownlinkCommon__pdsch_ConfigCommon));
+ }
+
+ switch(pdcchCfg->present)
+ {
+ case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_NOTHING:
+ {
+ //TODO
+ break;
+ }
+ case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_release:
+ {
+ //TODO
+ break;
+ }
+ case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup:
+ {
+ if(!pdcchCfg->choice.setup)
+ {
+ /* Control Resource Set Zero */
+ if(! pdcchCfg->choice.setup->controlResourceSetZero)
+ {
+ /* Search space zero */
+ if(! pdcchCfg->choice.setup->searchSpaceZero)
+ {
+ /* Common Search Space List */
+ if(! pdcchCfg->choice.setup->commonSearchSpaceList)
+ {
+ if(CommonSerachSpaceListret==ROK)
+ {
+ if(!pdcchCfg->choice.setup->searchSpaceSIB1)
+ {
+ if(!pdcchCfg->choice.setup->pagingSearchSpace)
+ {
+ if(!pdcchCfg->choice.setup->ra_SearchSpace)
+ {
+ DU_FREE(pdcchCfg->choice.setup->ra_SearchSpace,
+ sizeof(SearchSpaceId_t));
+ }
+ DU_FREE( pdcchCfg->choice.setup->pagingSearchSpace,
+ sizeof(SearchSpaceId_t));
+ }
+ DU_FREE( pdcchCfg->choice.setup->searchSpaceSIB1,
+ sizeof(SearchSpaceId_t));
+ }
+ }
+
+ FreeCommonSerachSpaceList(pdcchCfg->choice.setup->commonSearchSpaceList);
+
+ DU_FREE( pdcchCfg->choice.setup->commonSearchSpaceList,\
+ sizeof(struct
+ PDCCH_ConfigCommon__commonSearchSpaceList));
+ }
+ DU_FREE( pdcchCfg->choice.setup->searchSpaceZero,
+ sizeof(SearchSpaceZero_t));
+ }
+ DU_FREE( pdcchCfg->choice.setup->controlResourceSetZero,
+ sizeof(ControlResourceSetZero_t));
+ }
+ DU_FREE(pdcchCfg->choice.setup,
+ sizeof(PDCCH_ConfigCommon_t));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ DU_FREE(bwp->pdcch_ConfigCommon,sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon));
+ }
+}
+/*******************************************************************
+ *
+ * @brief deallocating the memory of BuildSib1Msg
+ *
+ * @details
+ *
+ * Function: FreeUlCfgCommSib
+ *
+ * Functionality deallocating the memory of BuildUlCfgCommSib
+ *
+ * @params[in] : UplinkConfigCommonSIB_t *ulCfg
+ *
+ * @return : void
+ *
+ *******************************************************************/
+void FreeUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg)
+{
+ uint8_t idx=0;
+ RACH_ConfigCommon_t *setup;
+ BWP_UplinkCommon_t *bwp=&ulCfg->initialUplinkBWP;
+ struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierList;
+ struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg;
+ struct BWP_UplinkCommon__pucch_ConfigCommon *pucchCfg;
+ struct BWP_UplinkCommon__pusch_ConfigCommon *puschCfg;
+ puschCfg=ulCfg->initialUplinkBWP.pusch_ConfigCommon;
+ rachCfg =bwp->rach_ConfigCommon;
+ scsCarrierList = &ulCfg->frequencyInfoUL.scs_SpecificCarrierList;
+
+ if(!scsCarrierList->list.array)
+ {
+ if(!ulCfg->frequencyInfoUL.p_Max)
+ {
+ if(FreqInfoUlret == ROK)
+ {
+ if(!bwp->rach_ConfigCommon)
+ {
+ if(RachCfgCommonret== ROK)
+ {
+ if(!bwp->pusch_ConfigCommon)
+ {
+
+ if(PuschCfgCommonret==ROK)
+ {
+ if(!bwp->pucch_ConfigCommon)
+ {
+ pucchCfg=bwp->pucch_ConfigCommon;
+ switch(pucchCfg->present)
+ {
+ case BWP_UplinkCommon__pucch_ConfigCommon_PR_NOTHING:
+ break;
+ case BWP_UplinkCommon__pucch_ConfigCommon_PR_release:
+ break;
+ case BWP_UplinkCommon__pucch_ConfigCommon_PR_setup:
+ {
+ if(!pucchCfg->choice.setup)
+ {
+
+ if(!pucchCfg->choice.setup->pucch_ResourceCommon)
+ {
+ if(!pucchCfg->choice.setup->p0_nominal)
+ {
+ DU_FREE(pucchCfg->choice.setup->p0_nominal,
+ sizeof(long));
+ }
+ DU_FREE(pucchCfg->choice.setup->pucch_ResourceCommon,
+ sizeof(long));
+ }
+ DU_FREE(pucchCfg->choice.setup,
+ sizeof(PUCCH_ConfigCommon_t));
+ }
+ }
+ default:
+ break;
+ }
+ DU_FREE(bwp->pucch_ConfigCommon,\
+ sizeof(struct
+ BWP_UplinkCommon__pucch_ConfigCommon));
+ }
+ }
+ switch(puschCfg->present)
+ {
+ case BWP_UplinkCommon__pusch_ConfigCommon_PR_NOTHING:
+ break;
+ case BWP_UplinkCommon__pusch_ConfigCommon_PR_release:
+ break;
+ case BWP_UplinkCommon__pusch_ConfigCommon_PR_setup:
+ {
+ if(!puschCfg->choice.setup)
+ {
+
+ if(! puschCfg->choice.setup->pusch_TimeDomainAllocationList)
+ {
+ if(! puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array)
+ {
+ if(!puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[idx])
+ {
+ if(!puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[idx]->k2)
+ {
+ if(! puschCfg->choice.setup->msg3_DeltaPreamble)
+ {
+ if(!puschCfg->choice.setup->p0_NominalWithGrant)
+ {
+ DU_FREE(puschCfg->choice.setup->p0_NominalWithGrant,
+ sizeof(long));
+ }
+ DU_FREE(puschCfg->choice.setup->msg3_DeltaPreamble,
+ sizeof(long));
+ }
+ DU_FREE(puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.\
+ array[idx]->k2, sizeof(long));
+ }
+ }
+ for(idx=0;
+ idx<puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.count;
+ idx++)
+ {
+ if(!puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[idx])
+ {
+ DU_FREE(puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[idx],\
+ sizeof(PUSCH_TimeDomainResourceAllocation_t));
+ }
+ }
+ DU_FREE(puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array,\
+ puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.size);
+ }
+ DU_FREE(puschCfg->choice.setup->pusch_TimeDomainAllocationList,\
+ sizeof(PUSCH_TimeDomainResourceAllocationList_t));
+ }
+ DU_FREE(puschCfg->choice.setup,
+ sizeof(PUSCH_ConfigCommon_t));
+ }
+ }
+ default :
+ break;
+ }
+
+ DU_FREE(bwp->pusch_ConfigCommon,\
+ sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon));
+ }
+ }
+ switch(rachCfg->present)
+ {
+ case BWP_UplinkCommon__rach_ConfigCommon_PR_NOTHING:
+ break;
+ case BWP_UplinkCommon__rach_ConfigCommon_PR_release:
+ break;
+ case BWP_UplinkCommon__rach_ConfigCommon_PR_setup:
+ {
+ if(!rachCfg->choice.setup)
+ {
+ setup = rachCfg->choice.setup;
+ if(!setup->totalNumberOfRA_Preambles)
+ {
+ if(!setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB)
+ {
+ if(!setup->rsrp_ThresholdSSB)
+ {
+ if(!setup->msg1_SubcarrierSpacing)
+ {
+ DU_FREE(setup->msg1_SubcarrierSpacing,
+ sizeof(SubcarrierSpacing_t));
+ }
+ DU_FREE(setup->rsrp_ThresholdSSB,
+ sizeof(RSRP_Range_t));
+ }
+ DU_FREE(setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB,\
+ sizeof(struct
+ RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
+ }
+ DU_FREE(setup->totalNumberOfRA_Preambles,
+ sizeof(long));
+ }
+
+ DU_FREE(rachCfg->choice.setup,
+ sizeof(RACH_ConfigCommon_t));
+ }
+ }
+ default:
+ break;
+ }
+ DU_FREE(bwp->rach_ConfigCommon,\
+ sizeof(struct BWP_UplinkCommon__rach_ConfigCommon));
+ }
+ }
+ DU_FREE(ulCfg->frequencyInfoUL.p_Max, sizeof(P_Max_t));
+ }
+ for(idx = 0; idx < scsCarrierList->list.count; idx++)
+ {
+ if(!scsCarrierList->list.array[idx])
+ {
+ DU_FREE(scsCarrierList->list.array[idx],
+ sizeof(SCS_SpecificCarrier_t));
+ }