X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_sys_info_hdl.c;h=6644079e1b4ea8c9ea684c9c8660744039e82d27;hb=c946e9243610d6fb122e34674eeab874f7d2f7a4;hp=a4c883e661549aa848050b1075ce38801ae67db0;hpb=86ce8157d6b459515f2a3f37f5bc84daee2d27ca;p=o-du%2Fl2.git diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index a4c883e66..6644079e1 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -697,7 +697,7 @@ uint8_t BuildSiSchedInfoList(struct SI_SchedulingInfo__schedulingInfoList *si_Sc * * @details * - * Function : BuildScsSpecificCarrierListDl + * Function : BuildScsSpecificCarrierListDlSib * * Functionality: * Builds Subcarrier specific carrier list for downlink @@ -707,7 +707,7 @@ uint8_t BuildSiSchedInfoList(struct SI_SchedulingInfo__schedulingInfoList *si_Sc * RFAILED - failure * * ****************************************************************/ -uint8_t BuildScsSpecificCarrierListDl( struct FrequencyInfoDL_SIB__scs_SpecificCarrierList *scsCarrierList) +uint8_t BuildScsSpecificCarrierListDlSib( struct FrequencyInfoDL_SIB__scs_SpecificCarrierList *scsCarrierList) { uint8_t idx; ScsSpecCarrier duScsSpecCarrier; @@ -737,7 +737,7 @@ uint8_t BuildScsSpecificCarrierListDl( struct FrequencyInfoDL_SIB__scs_SpecificC scsCarrierList->list.array[idx]->carrierBandwidth = duScsSpecCarrier.scsBw; return ROK; -} /* End of BuildScsSpecificCarrierListDl */ +} /* End of BuildScsSpecificCarrierListDlSib */ /******************************************************************* * @@ -763,12 +763,12 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace duPdcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdcchCfg; - DU_ALLOC(searchSpclist->list.array, searchSpclist->list.size) - if(!searchSpclist->list.array) - { - DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); - return RFAILED; - } + DU_ALLOC(searchSpclist->list.array, searchSpclist->list.size); + if(!searchSpclist->list.array) + { + DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); + return RFAILED; + } for(idx = 0; idx < searchSpclist->list.count; idx++) { @@ -803,8 +803,8 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); return RFAILED; } - searchSpace->monitoringSlotPeriodicityAndOffset->present = \ - duPdcchCfg.monitorSlotPrdAndOffPresent; + searchSpace->monitoringSlotPeriodicityAndOffset->present = duPdcchCfg.monitorSlotPrdAndOffPresent; + switch(searchSpace->monitoringSlotPeriodicityAndOffset->present) { case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1: @@ -890,16 +890,15 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace } /* Monitoring Symbols Within Slot */ - DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot,\ - sizeof(BIT_STRING_t)); + DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot, sizeof(BIT_STRING_t)); if(!searchSpace->monitoringSymbolsWithinSlot) { DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); return RFAILED; } - searchSpace->monitoringSymbolsWithinSlot->size = 2*sizeof(uint8_t); - DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot->buf, \ - searchSpace->monitoringSymbolsWithinSlot->size ); + searchSpace->monitoringSymbolsWithinSlot->size = 2 * sizeof(uint8_t); + + DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot->buf, searchSpace->monitoringSymbolsWithinSlot->size); if(!searchSpace->monitoringSymbolsWithinSlot->buf) { DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); @@ -910,8 +909,7 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace searchSpace->monitoringSymbolsWithinSlot->bits_unused = 2; /* Number of candidates per aggregation level */ - DU_ALLOC(searchSpace->nrofCandidates,\ - sizeof(struct SearchSpace__nrofCandidates)); + DU_ALLOC(searchSpace->nrofCandidates, sizeof(struct SearchSpace__nrofCandidates)); if(!searchSpace->nrofCandidates) { DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); @@ -924,8 +922,7 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace searchSpace->nrofCandidates->aggregationLevel16 = duPdcchCfg.numCandAggLvl16; /* Search Space type and DCI Format */ - DU_ALLOC(searchSpace->searchSpaceType,\ - sizeof( struct SearchSpace__searchSpaceType)); + DU_ALLOC(searchSpace->searchSpaceType, sizeof( struct SearchSpace__searchSpaceType)); if(!searchSpace->searchSpaceType) { DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); @@ -949,9 +946,8 @@ uint8_t BuildCommonSerachSpaceList( struct PDCCH_ConfigCommon__commonSearchSpace return RFAILED; } - DU_ALLOC(searchSpace->searchSpaceType->choice.common->\ - dci_Format0_0_AndFormat1_0, sizeof(struct \ - SearchSpace__searchSpaceType__common__dci_Format0_0_AndFormat1_0)); + DU_ALLOC(searchSpace->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0, \ + sizeof(struct SearchSpace__searchSpaceType__common__dci_Format0_0_AndFormat1_0)); if(!searchSpace->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) { DU_LOG("\nERROR --> DU APP : Common search space list memory alloc failed"); @@ -1041,8 +1037,7 @@ uint8_t BuildPdcchCfgCommon(struct BWP_DownlinkCommon__pdcch_ConfigCommon *pdcch *pdcchSetup->searchSpaceZero = duPdcchCfg.searchSpcZero; /* Common Search Space List */ - DU_ALLOC(pdcchSetup->commonSearchSpaceList,\ - sizeof(struct PDCCH_ConfigCommon__commonSearchSpaceList)); + DU_ALLOC(pdcchSetup->commonSearchSpaceList, sizeof(struct PDCCH_ConfigCommon__commonSearchSpaceList)); if(!pdcchSetup->commonSearchSpaceList) { DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed"); @@ -1054,6 +1049,7 @@ uint8_t BuildPdcchCfgCommon(struct BWP_DownlinkCommon__pdcch_ConfigCommon *pdcch ret = BuildCommonSerachSpaceList(pdcchSetup->commonSearchSpaceList); if(ret != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill common search space list"); return RFAILED; } CommonSerachSpaceListret=ROK; @@ -1067,7 +1063,7 @@ uint8_t BuildPdcchCfgCommon(struct BWP_DownlinkCommon__pdcch_ConfigCommon *pdcch } *pdcchSetup->searchSpaceSIB1 = duPdcchCfg.searchSpcSib1; - /* Serach Space for Paging */ + /* Search Space for Paging */ DU_ALLOC(pdcchSetup->pagingSearchSpace, sizeof(SearchSpaceId_t)); if(!pdcchSetup->pagingSearchSpace) { @@ -1148,16 +1144,17 @@ uint8_t BuildPdschCfgCommon(struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdsch pdschSetup = pdschCfg->choice.setup; /* Time Domain Allocation List */ - DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList, \ - sizeof(PDSCH_TimeDomainResourceAllocationList_t)); + DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList, sizeof(PDSCH_TimeDomainResourceAllocationList_t)); if(!pdschSetup->pdsch_TimeDomainAllocationList) { DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed"); return RFAILED; } + elementCnt = duPdschCfg.numTimeDomRsrcAlloc; pdschSetup->pdsch_TimeDomainAllocationList->list.count = elementCnt; - pdschSetup->pdsch_TimeDomainAllocationList->list.size = elementCnt * sizeof(PDSCH_TimeDomainResourceAllocation_t *); + pdschSetup->pdsch_TimeDomainAllocationList->list.size = \ + elementCnt * sizeof(PDSCH_TimeDomainResourceAllocation_t *); DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList->list.array,\ pdschSetup->pdsch_TimeDomainAllocationList->list.size); @@ -1224,40 +1221,39 @@ uint8_t BuildPdschCfgCommon(struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdsch * ****************************************************************/ uint8_t BuildBwpDlCommon(BWP_DownlinkCommon_t *bwp) { - uint8_t ret; - DlCfgCommon duDlCfg; - - duDlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg; + DlCfgCommon duDlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg; + /* Generic Parameters */ bwp->genericParameters.locationAndBandwidth = duDlCfg.locAndBw; bwp->genericParameters.subcarrierSpacing = duDlCfg.dlScsCarrier.scs; /* PDCCH Config Common */ - DU_ALLOC(bwp->pdcch_ConfigCommon, \ - sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon)); + DU_ALLOC(bwp->pdcch_ConfigCommon, sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon)); if(!bwp->pdcch_ConfigCommon) { DU_LOG("\nERROR --> DU APP : DL BWP memory allocation failed"); return RFAILED; } - ret=BuildPdcchCfgCommon(bwp->pdcch_ConfigCommon); - if(ret != ROK) + if((BuildPdcchCfgCommon(bwp->pdcch_ConfigCommon)) != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill PDCCH config common in BuildBwpDlCommon()"); return RFAILED; } + /* PDSCH Config Common */ - DU_ALLOC(bwp->pdsch_ConfigCommon, \ - sizeof(struct BWP_DownlinkCommon__pdsch_ConfigCommon)); + DU_ALLOC(bwp->pdsch_ConfigCommon, sizeof(struct BWP_DownlinkCommon__pdsch_ConfigCommon)); if(!bwp->pdsch_ConfigCommon) { DU_LOG("\nERROR --> DU APP : DL BWP memory allocation failed"); return RFAILED; } - ret=BuildPdschCfgCommon(bwp->pdsch_ConfigCommon); - if(ret != ROK) + + if((BuildPdschCfgCommon(bwp->pdsch_ConfigCommon)) != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill PDSCH config common in BuildBwpDlCommon()"); return RFAILED; } + return ROK; } /* BuildBwpDlCommon */ @@ -1534,7 +1530,7 @@ uint8_t BuildPcchConfig(PCCH_Config_t *pcchCfg) * * @details * - * Function : BuildFreqInfoDl + * Function : BuildFreqInfoDlSib * * Functionality: * Builds Frequency Info for Downlink @@ -1545,7 +1541,7 @@ uint8_t BuildPcchConfig(PCCH_Config_t *pcchCfg) * * ****************************************************************/ -uint8_t BuildFreqInfoDl(FrequencyInfoDL_SIB_t *frequencyInfoDL) +uint8_t BuildFreqInfoDlSib(FrequencyInfoDL_SIB_t *frequencyInfoDL) { uint8_t ret; uint8_t idx; @@ -1600,7 +1596,7 @@ uint8_t BuildFreqInfoDl(FrequencyInfoDL_SIB_t *frequencyInfoDL) frequencyInfoDL->scs_SpecificCarrierList.list.count = elementCnt; frequencyInfoDL->scs_SpecificCarrierList.list.size = \ elementCnt * sizeof(SCS_SpecificCarrier_t *); - ret= BuildScsSpecificCarrierListDl(&frequencyInfoDL->scs_SpecificCarrierList); + ret= BuildScsSpecificCarrierListDlSib(&frequencyInfoDL->scs_SpecificCarrierList); if(ret != ROK) { @@ -1630,7 +1626,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) { /* DL frequency info */ uint8_t ret; - ret = BuildFreqInfoDl(&dlCfg->frequencyInfoDL); + ret = BuildFreqInfoDlSib(&dlCfg->frequencyInfoDL); if(ret != ROK) { return RFAILED; @@ -1663,7 +1659,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) * * @details * - * Function : BuildScsSpecificCarrierListUl + * Function : BuildScsSpecificCarrierListUlSib * * Functionality: * Builds SCS specific carrier list for UL @@ -1674,10 +1670,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) * * ****************************************************************/ - uint8_t BuildScsSpecificCarrierListUl -( - struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierList - ) +uint8_t BuildScsSpecificCarrierListUlSib(struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierList) { uint8_t idx; ScsSpecCarrier duScsSpecCarrier; @@ -1706,7 +1699,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) scsCarrierList->list.array[idx]->carrierBandwidth = duScsSpecCarrier.scsBw; return ROK; -} /* End of BuildScsSpecificCarrierListUl */ +} /* End of BuildScsSpecificCarrierListUlSib */ /******************************************************************* * @@ -1714,7 +1707,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) * * @details * - * Function : BuildFreqInfoUl + * Function : BuildFreqInfoUlSib * * Functionality: * Builds frequency infor for UL @@ -1725,7 +1718,7 @@ uint8_t BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg) * * ****************************************************************/ -uint8_t BuildFreqInfoUl(FrequencyInfoUL_SIB_t *frequencyInfoUL) +uint8_t BuildFreqInfoUlSib(FrequencyInfoUL_SIB_t *frequencyInfoUL) { uint8_t elementCnt; UlCfgCommon ulCfg; @@ -1737,7 +1730,7 @@ uint8_t BuildFreqInfoUl(FrequencyInfoUL_SIB_t *frequencyInfoUL) frequencyInfoUL->scs_SpecificCarrierList.list.count = elementCnt; frequencyInfoUL->scs_SpecificCarrierList.list.size = \ elementCnt * sizeof(SCS_SpecificCarrier_t *); - ret=BuildScsSpecificCarrierListUl(&frequencyInfoUL->scs_SpecificCarrierList); + ret=BuildScsSpecificCarrierListUlSib(&frequencyInfoUL->scs_SpecificCarrierList); if(ret != ROK) { return RFAILED; @@ -1752,7 +1745,7 @@ uint8_t BuildFreqInfoUl(FrequencyInfoUL_SIB_t *frequencyInfoUL) *frequencyInfoUL->p_Max = ulCfg.pMax; FreqInfoUlret=ROK; return ROK; -}/* BuildFreqInfoUl */ +}/* BuildFreqInfoUlSib */ /******************************************************************* * @@ -1773,10 +1766,8 @@ uint8_t BuildFreqInfoUl(FrequencyInfoUL_SIB_t *frequencyInfoUL) uint8_t BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) { - RachCfgCommon duRachCfg; - RACH_ConfigCommon_t *setup; - - duRachCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.rachCfg; + RachCfgCommon duRachCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.rachCfg; + RACH_ConfigCommon_t *setup = NULLP; rachCfg->present = duRachCfg.present; switch(rachCfg->present) @@ -1828,8 +1819,8 @@ uint8_t BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) DU_LOG("\nERROR --> DU APP : Rach Config memory alloc failed"); return RFAILED; } - setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = \ - duRachCfg.ssbPerRachOccPresent; + setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = duRachCfg.numSsbPerRachOcc; + switch(setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present) { case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_NOTHING: @@ -1854,8 +1845,8 @@ uint8_t BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) } case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one: { - setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one =\ - duRachCfg.numSsbPerRachOcc; + setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one = \ + convertCbPreamblePerSsbValueToEnum(duRachCfg.numCbPreamblePerSsb); } case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two: { @@ -1879,8 +1870,7 @@ uint8_t BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) } default: { - DU_LOG("\nERROR --> DU APP: Invalid value for \ - ssb_PerRach_OccassionAndCB_PreamblesPerSSB"); + DU_LOG("\nERROR --> DU APP: Invalid value for ssb_PerRach_OccassionAndCB_PreamblesPerSSB"); return RFAILED; } } @@ -1965,13 +1955,12 @@ uint8_t BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCfg) { - uint8_t idx; - uint8_t elementCnt; - PuschCfgCommon duPuschCfg; - PUSCH_ConfigCommon_t *setup; - PUSCH_TimeDomainResourceAllocation_t *timeDomRsrcAllocInfo; + uint8_t idx = 0; + uint8_t elementCnt = 0; + PuschCfgCommon duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg; + PUSCH_ConfigCommon_t *setup = NULLP; + PUSCH_TimeDomainResourceAllocation_t *timeDomRsrcAllocInfo = NULLP; - duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg; puschCfg->present = duPuschCfg.puschCfgPresent; switch(puschCfg->present) @@ -1997,8 +1986,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf setup = puschCfg->choice.setup; /* Time Domain Resource Allocation List */ - DU_ALLOC(setup->pusch_TimeDomainAllocationList,\ - sizeof(PUSCH_TimeDomainResourceAllocationList_t)); + DU_ALLOC(setup->pusch_TimeDomainAllocationList, sizeof(PUSCH_TimeDomainResourceAllocationList_t)); if(!setup->pusch_TimeDomainAllocationList) { DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed"); @@ -2006,11 +1994,9 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf } elementCnt = duPuschCfg.numTimeDomRsrcAlloc; setup->pusch_TimeDomainAllocationList->list.count = elementCnt; - setup->pusch_TimeDomainAllocationList->list.size = \ - elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *); + setup->pusch_TimeDomainAllocationList->list.size = elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *); - DU_ALLOC(setup->pusch_TimeDomainAllocationList->list.array, \ - setup->pusch_TimeDomainAllocationList->list.size); + DU_ALLOC(setup->pusch_TimeDomainAllocationList->list.array, setup->pusch_TimeDomainAllocationList->list.size); if(!setup->pusch_TimeDomainAllocationList->list.array) { DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed"); @@ -2043,6 +2029,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf timeDomRsrcAllocInfo->mappingType = duPuschCfg.timeDomAllocList[idx].mapType; timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.timeDomAllocList[idx].sliv; } + /* Msg3 Delta Preamble */ DU_ALLOC(setup->msg3_DeltaPreamble, sizeof(long)); if(!setup->msg3_DeltaPreamble) @@ -2052,7 +2039,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf } *setup->msg3_DeltaPreamble = duPuschCfg.msg3DeltaPreamble; - /* P0 Nominal with grnat */ + /* P0 Nominal with grant */ DU_ALLOC(setup->p0_NominalWithGrant, sizeof(long)); if(!setup->p0_NominalWithGrant) { @@ -2171,57 +2158,56 @@ uint8_t BuildPucchCfgCommon( struct BWP_UplinkCommon__pucch_ConfigCommon *pucchC uint8_t BuildBwpUlCommon(BWP_UplinkCommon_t *bwp) { - uint8_t ret; - UlCfgCommon duUlCfg; - - duUlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg; + UlCfgCommon duUlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg; + /* Generic Parameters */ bwp->genericParameters.locationAndBandwidth = duUlCfg.locAndBw; bwp->genericParameters.subcarrierSpacing = duUlCfg.ulScsCarrier.scs; /* RACH Config Common */ - DU_ALLOC(bwp->rach_ConfigCommon,\ - sizeof(struct BWP_UplinkCommon__rach_ConfigCommon)); + DU_ALLOC(bwp->rach_ConfigCommon, sizeof(struct BWP_UplinkCommon__rach_ConfigCommon)); if(!bwp->rach_ConfigCommon) { DU_LOG("\nERROR --> DU APP : UL BWP memory allocation failed"); return RFAILED; } - ret = BuildRachCfgCommon(bwp->rach_ConfigCommon); - if(ret != ROK) + + if((BuildRachCfgCommon(bwp->rach_ConfigCommon)) != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill RACH config common in BuildBwpUlCommon()"); return RFAILED; } RachCfgCommonret=ROK; /* PUSCH Config Common */ - DU_ALLOC(bwp->pusch_ConfigCommon,\ - sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon)); + DU_ALLOC(bwp->pusch_ConfigCommon, sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon)); if(!bwp->pusch_ConfigCommon) { DU_LOG("\nERROR --> DU APP : UL BWP memory allocation failed"); return RFAILED; - } - ret = BuildPuschCfgCommon(bwp->pusch_ConfigCommon); - if(ret != ROK) + } + + if((BuildPuschCfgCommon(bwp->pusch_ConfigCommon)) != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill PUSCH config common in BuildBwpUlCommon()"); return RFAILED; } PuschCfgCommonret = ROK; /* PUCCH Config Common */ - DU_ALLOC(bwp->pucch_ConfigCommon,\ - sizeof(struct BWP_UplinkCommon__pucch_ConfigCommon)); + DU_ALLOC(bwp->pucch_ConfigCommon, sizeof(struct BWP_UplinkCommon__pucch_ConfigCommon)); if(!bwp->pucch_ConfigCommon) { DU_LOG("\nERROR --> DU APP : UL BWP memory allocation failed"); return RFAILED; - } - ret = BuildPucchCfgCommon(bwp->pucch_ConfigCommon); - if(ret != ROK) + } + + if((BuildPucchCfgCommon(bwp->pucch_ConfigCommon)) != ROK) { + DU_LOG("\nERROR --> DU APP : Failed to fill PUCCH config common in BuildBwpUlCommon()"); return RFAILED; } + return ROK; }/* BuildBwpUlCommon */ @@ -2246,7 +2232,7 @@ uint8_t BuildUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg) { uint8_t ret; /* UL frequency info */ - ret = BuildFreqInfoUl(&ulCfg->frequencyInfoUL); + ret = BuildFreqInfoUlSib(&ulCfg->frequencyInfoUL); if(ret != ROK) { return RFAILED; @@ -2283,9 +2269,7 @@ uint8_t BuildUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg) uint8_t BuildTddUlDlCfgComm(TDD_UL_DL_ConfigCommon_t *tddCfg) { - TddUlDlCfgCommon duTddCfg; - - duTddCfg = duCfgParam.sib1Params.srvCellCfgCommSib.tddCfg; + TddUlDlCfgCommon duTddCfg = duCfgParam.sib1Params.srvCellCfgCommSib.tddCfg; /* Reference Subcarrier spacing */ tddCfg->referenceSubcarrierSpacing = duTddCfg.refScs; @@ -2336,34 +2320,7 @@ uint8_t BuildServCellCfgCommonSib(ServingCellConfigCommonSIB_t *srvCellCfg) ssbPosInBurst->buf[0] = duSrvCellCfg.ssbPosInBurst; ssbPosInBurst->bits_unused = 0; - switch(duSrvCellCfg.ssbPrdServingCell) - { - case SSB_PERIODICITY_5MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms5; - break; - case SSB_PERIODICITY_10MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms10; - break; - case SSB_PERIODICITY_20MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms20; - break; - case SSB_PERIODICITY_40MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms40; - break; - case SSB_PERIODICITY_80MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms80; - break; - case SSB_PERIODICITY_160MS: - srvCellCfg->ssb_PeriodicityServingCell = \ - ServingCellConfigCommonSIB__ssb_PeriodicityServingCell_ms160; - break; - } - + srvCellCfg->ssb_PeriodicityServingCell = convertSsbPeriodicityValueToEnumForSib(duSrvCellCfg.ssbPrdServingCell); srvCellCfg->ss_PBCH_BlockPower = duSrvCellCfg.ssPbchBlockPwr; /* Downlink config common */ @@ -2528,15 +2485,15 @@ uint8_t BuildSib1Msg() * * @details * - * Function : FreeFreqInfoDl + * Function : FreeFreqInfoDlSib * - * Functionality: Freeing memory of BuildFreqInfoDl + * Functionality: Freeing memory of BuildFreqInfoDlSib * * @params[in] : FrequencyInfoDL_SIB_t *frequencyInfoDL * @return : void * *******************************************************************/ -void FreeFreqInfoDl(FrequencyInfoDL_SIB_t *frequencyInfoDL) +void FreeFreqInfoDlSib(FrequencyInfoDL_SIB_t *frequencyInfoDL) { uint8_t idx=0; uint8_t idx1=0; @@ -2821,205 +2778,212 @@ void FreeBwpDlCommon(BWP_DownlinkCommon_t *bwp) DU_FREE(bwp->pdcch_ConfigCommon,sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon)); } } + /******************************************************************* * - * @brief deallocating the memory of BuildSib1Msg + * @brief Free PUCCH configuration common * * @details * - * Function: FreeUlCfgCommSib + * Function : FreePucchCfgCommon * - * Functionality deallocating the memory of BuildUlCfgCommSib + * Functionality: + * Free PUCCH configuration common * - * @params[in] : UplinkConfigCommonSIB_t *ulCfg + * @params[in] Pointer to struct BWP_UplinkCommon__pucch_ConfigCommon + * @return void * - * @return : void + * ****************************************************************/ +void FreePucchCfgCommon( struct BWP_UplinkCommon__pucch_ConfigCommon *pucchCfg) +{ + PUCCH_ConfigCommon_t *setup; + + if(pucchCfg->choice.setup) + { + setup = pucchCfg->choice.setup; + + /* Resource Common */ + DU_FREE(setup->pucch_ResourceCommon, sizeof(long)); + + /* P0 nominal */ + DU_FREE(setup->p0_nominal, sizeof(long)); + + DU_FREE(pucchCfg->choice.setup, sizeof(PUCCH_ConfigCommon_t)); + } +}/* FreePucchCfgCommon */ + +/******************************************************************* * - *******************************************************************/ -void FreeUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg) + * @brief Free PUSCH configuration for common + * + * @details + * + * Function : FreePuschCfgCommon + * + * Functionality: + * Free PUSCH configuration for common + * + * @params[in] Pointer to struct BWP_UplinkCommon__pusch_ConfigCommon *puschCfg + * @return void + * + * ****************************************************************/ +void FreePuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCfg) { - uint8_t idx=0,arrIdx; - 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; + uint8_t idx = 0; + PUSCH_ConfigCommon_t *setup = NULLP; + PUSCH_TimeDomainResourceAllocation_t *timeDomRsrcAllocInfo = NULLP; - if(scsCarrierList->list.array) + if(puschCfg->choice.setup) { - if(ulCfg->frequencyInfoUL.p_Max) + setup = puschCfg->choice.setup; + + /* Time Domain Resource Allocation List */ + if(setup->pusch_TimeDomainAllocationList) { - if(FreqInfoUlret == ROK) + if(setup->pusch_TimeDomainAllocationList->list.array) { - if(bwp->rach_ConfigCommon) + for(idx=0; idx < setup->pusch_TimeDomainAllocationList->list.count; idx++) { - if(RachCfgCommonret== ROK) + if(setup->pusch_TimeDomainAllocationList->list.array[idx]) { - if(bwp->pusch_ConfigCommon) - { + timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx]; - 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) - { + /* K2 */ + DU_FREE(timeDomRsrcAllocInfo->k2, sizeof(long)); + DU_FREE(setup->pusch_TimeDomainAllocationList->list.array[idx],\ + sizeof(PUSCH_TimeDomainResourceAllocation_t)); + } + } + DU_FREE(setup->pusch_TimeDomainAllocationList->list.array, setup->pusch_TimeDomainAllocationList->list.size); + } + DU_FREE(setup->pusch_TimeDomainAllocationList, sizeof(PUSCH_TimeDomainResourceAllocationList_t)); + } - 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) - { + /* Msg3 Delta Preamble */ + DU_FREE(setup->msg3_DeltaPreamble, sizeof(long)); - if( puschCfg->choice.setup->pusch_TimeDomainAllocationList) - { - if( puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array) - { - for(arrIdx = 0; arrIdxchoice.setup->pusch_TimeDomainAllocationList->list.count; arrIdx++) - { - if(puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[arrIdx]) - { - if(puschCfg->choice.setup->pusch_TimeDomainAllocationList->list.array[arrIdx]->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[arrIdx]->k2, sizeof(long)); - } - } - } - for(idx=0; - idxchoice.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; - } + /* P0 Nominal with grant */ + DU_FREE(setup->p0_NominalWithGrant, sizeof(long)); - 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_ALLOC(puschCfg->choice.setup, sizeof(PUSCH_ConfigCommon_t)); + } +}/* BuildPuschCfgCommon */ - 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)); - } +/******************************************************************* + * + * @brief Free RACH configuration common + * + * @details + * + * Function : FreeRachCfgCommon + * + * Functionality: + * Free RACH configuration common + * + * @params[in] BWP_UplinkCommon__rach_ConfigCommon pointer + * @return void + * + * ****************************************************************/ + +void FreeRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg) +{ + RACH_ConfigCommon_t *setup = NULLP; + + if(rachCfg->choice.setup) + { + setup = rachCfg->choice.setup; + + /* Total number of RA preambles */ + DU_FREE(setup->totalNumberOfRA_Preambles, sizeof(long)); + + /* SSB per RACH occassion and CB Preambles per SSB */ + DU_FREE(setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB,\ + sizeof(struct RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB)); + + /* RSRP Threshold SSB */ + DU_FREE(setup->rsrp_ThresholdSSB, sizeof(RSRP_Range_t)); + + /* Msg 1 Subcarrier spacing */ + DU_FREE(setup->msg1_SubcarrierSpacing, sizeof(SubcarrierSpacing_t)); + + DU_FREE(rachCfg->choice.setup, sizeof(RACH_ConfigCommon_t)); + } +}/* FreeRachCfgCommon */ + +/******************************************************************* + * + * @brief Free UL BWP Common + * + * @details + * + * Function : FreeBwpUlCommon + * + * Functionality: + * Free UL BWP Common + * + * @params[in] BWP_UplinkCommon_t pointer + * @return void + * + * ****************************************************************/ +void FreeBwpUlCommon(BWP_UplinkCommon_t *bwp) +{ + /* RACH Config Common */ + if(bwp->rach_ConfigCommon) + { + FreeRachCfgCommon(bwp->rach_ConfigCommon); + DU_FREE(bwp->rach_ConfigCommon, sizeof(struct BWP_UplinkCommon__rach_ConfigCommon)); + } + + /* PUSCH Config Common */ + if(bwp->pusch_ConfigCommon) + { + FreePuschCfgCommon(bwp->pusch_ConfigCommon); + DU_FREE(bwp->pusch_ConfigCommon, sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon)); + } + + /* PUCCH Config Common */ + if(bwp->pucch_ConfigCommon) + { + FreePucchCfgCommon(bwp->pucch_ConfigCommon); + DU_FREE(bwp->pucch_ConfigCommon, sizeof(struct BWP_UplinkCommon__pucch_ConfigCommon)); + } +}/* FreeBwpUlCommon */ + +/******************************************************************* + * + * @brief Free frequency infor for UL + * + * @details + * + * Function : FreeFreqInfoUlSib + * + * Functionality: + * Free frequency infor for UL + * + * @params[in] FrequencyInfoUL_SIB_t pointer + * @return void + * + * ****************************************************************/ + +void FreeFreqInfoUlSib(FrequencyInfoUL_SIB_t *frequencyInfoUL) +{ + uint8_t idx = 0; + struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierList = &frequencyInfoUL->scs_SpecificCarrierList; + + /* Subcarrier Spacing specifc carrier */ + if(scsCarrierList->list.array) + { for(idx = 0; idx < scsCarrierList->list.count; idx++) { - if(scsCarrierList->list.array[idx]) - { - DU_FREE(scsCarrierList->list.array[idx], - sizeof(SCS_SpecificCarrier_t)); - } + DU_FREE(scsCarrierList->list.array[idx], sizeof(SCS_SpecificCarrier_t)); } DU_FREE(scsCarrierList->list.array, scsCarrierList->list.size); } -} + + /* P-MAX */ + DU_FREE(frequencyInfoUL->p_Max, sizeof(P_Max_t)); +}/* FreeFreqInfoUlSib */ + /******************************************************************* * * @brief : Deallocating memory of SIB1 message @@ -3036,40 +3000,32 @@ void FreeUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg) *******************************************************************/ void FreeServCellCfgCommonSib(ServingCellConfigCommonSIB_t *srvCellCfg) { - BIT_STRING_t *ssbPosInBurst; + BIT_STRING_t *ssbPosInBurst = NULLP; + DownlinkConfigCommonSIB_t *dlCfg = NULLP; + UplinkConfigCommonSIB_t *ulCfg = NULLP; + + /* SSB Position in Burst buffer */ ssbPosInBurst = &srvCellCfg->ssb_PositionsInBurst.inOneGroup; - DownlinkConfigCommonSIB_t *dlCfg=&srvCellCfg->downlinkConfigCommon; + DU_FREE(ssbPosInBurst->buf, ssbPosInBurst->size * sizeof(uint8_t)); + + /* Free Donwlink config common SIB */ + dlCfg = &srvCellCfg->downlinkConfigCommon; + FreeFreqInfoDlSib(&dlCfg->frequencyInfoDL); + FreeBwpDlCommon(&dlCfg->initialDownlinkBWP); - if(ssbPosInBurst->buf) + /* Uplink Config Comm */ + if(srvCellCfg->uplinkConfigCommon) { - /* Free DL frequency info */ - if(FreqInfoDlret == ROK) - { - if(DlCfgCommSibret == ROK) - { - /* Uplink Config Comm */ - if(srvCellCfg->uplinkConfigCommon) - { - if(UlCfgCommSibret==ROK) - { - /* TDD UL DL Config Comm */ - if(srvCellCfg->tdd_UL_DL_ConfigurationCommon) - { - DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationCommon, - sizeof(TDD_UL_DL_ConfigCommon_t)); - } - } - FreeUlCfgCommSib(srvCellCfg->uplinkConfigCommon); - DU_FREE(srvCellCfg->uplinkConfigCommon, - sizeof(UplinkConfigCommonSIB_t)); - } - } - FreeBwpDlCommon(&dlCfg->initialDownlinkBWP); - } - FreeFreqInfoDl(&dlCfg->frequencyInfoDL); - DU_FREE(ssbPosInBurst->buf, ssbPosInBurst->size * sizeof(uint8_t)); + ulCfg = srvCellCfg->uplinkConfigCommon; + FreeFreqInfoUlSib(&ulCfg->frequencyInfoUL); + FreeBwpUlCommon(&ulCfg->initialUplinkBWP); + DU_FREE(srvCellCfg->uplinkConfigCommon, sizeof(UplinkConfigCommonSIB_t)); } + + /* TDD UL DL Config Comm */ + DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationCommon, sizeof(TDD_UL_DL_ConfigCommon_t)); } + /******************************************************************* * * @brief : Deallcating memory of the function BuildSib1Msg