X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_f1ap_msg_hdl.c;h=37a0aef4f8a5ee54194c4511f53c7f427cc0e82a;hb=d62d6a2c96903363a6d7a2f1b23658bfef3590c9;hp=21dae0c267761d6344086d94456ed94f93958c16;hpb=7f6d859aef2f454e8521a921000b37a4571f1e02;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 21dae0c26..37a0aef4f 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -103,12 +103,55 @@ #include "GTPTunnel.h" #ifdef O1_ENABLE -#include "ConfigInterface.h" +#include "CmInterface.h" extern StartupConfig g_cfg; #endif DuCfgParams duCfgParam; +/****************************************************************** + * + * @brief Function to fetch lcId based on DRB Id + * + * @details + * + * Function : fetchLcId + * + * @params[in] drbId + * + * Functionality: Function to fetch lcId based on DRB Id + * + * Returns: lcId - SUCCESS + * RFAILED - FAILURE + *****************************************************************/ + +uint8_t fetchLcId(uint8_t drbId) +{ + uint8_t cellIdx = 0, ueIdx = 0, lcIdx = 0, numLcs = 0, lcId = 0; + + for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++) + { + for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++) + { + if(duCb.actvCellLst[cellIdx] != NULLP) + { + numLcs = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.numLcs; + for(lcIdx = 0; lcIdx < numLcs; lcIdx++) + { + if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbId == drbId && \ + duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbType == RB_TYPE_DRB) + { + lcId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].lcId; + return lcId; + } + } + } + } + } + DU_LOG("\nERROR --> DU_APP: fetchLcId() failed for drbId %d", drbId); + return RFAILED; +} + /************************************************************************ * * @brief Converts enum values into actual value of Poll retransmit timer @@ -804,7 +847,7 @@ uint8_t BuildDLNRInfo(NRFreqInfo_t *dlnrfreq) S16 BuildNrCellId(BIT_STRING_t *nrcell) { memset(nrcell->buf, 0, nrcell->size); - nrcell->buf[4] = 16; + nrcell->buf[4] = duCfgParam.sib1Params.cellIdentity; nrcell->bits_unused = 4; return ROK; } @@ -2284,7 +2327,7 @@ uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo) { srvCellInfo->nRCGI.nRCellIdentity.buf[tmp] = 0; } - srvCellInfo->nRCGI.nRCellIdentity.buf[4] = 16; + srvCellInfo->nRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity; srvCellInfo->nRCGI.nRCellIdentity.bits_unused =4; /*nRPCI*/ @@ -2382,7 +2425,7 @@ uint8_t fillServCellToModItem(Served_Cells_To_Modify_Item_t *modifyItem) { modifyItem->oldNRCGI.nRCellIdentity.buf[ieIdx] = 0; } - modifyItem->oldNRCGI.nRCellIdentity.buf[4] = 16; + modifyItem->oldNRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity; modifyItem->oldNRCGI.nRCellIdentity.bits_unused = 4; if(fillServedCellInfo(&modifyItem->served_Cell_Information)) @@ -2491,7 +2534,7 @@ uint8_t fillCellToDeleteItem(struct Served_Cells_To_Delete_ItemIEs *deleteItemIe { deleteItem->oldNRCGI.nRCellIdentity.buf[arrIdx] = 0; } - deleteItem->oldNRCGI.nRCellIdentity.buf[4] = 16; + deleteItem->oldNRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity; deleteItem->oldNRCGI.nRCellIdentity.bits_unused = 4; return ROK; } @@ -3412,7 +3455,7 @@ uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddMod coreset1StartPrb = coreset0EndPrb + 6; coreset1NumPrb = CORESET1_NUM_PRB; /* calculate the PRBs */ - freqDomRscAllocType0(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource); + fillCoresetFeqDomAllocMap(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource); memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE); controlRSet->frequencyDomainResources.bits_unused = bitsUnused; @@ -4312,7 +4355,124 @@ uint8_t BuildBWPUlDedPuschCfg(PUSCH_Config_t *puschCfg) uint8_t BuildBWPUlDedPucchCfg(PUCCH_Config_t *pucchCfg) { uint8_t arrIdx, elementCnt; + uint8_t rsrcIdx, rsrcSetIdx; + PUCCH_ResourceSet_t *rsrcSet = NULLP; + PUCCH_Resource_t *rsrc = NULLP; + + //RESOURCE SET + elementCnt = 1; + DU_ALLOC(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList)); + if(pucchCfg->resourceSetToAddModList == NULL) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + + pucchCfg->resourceSetToAddModList->list.count = elementCnt; + pucchCfg->resourceSetToAddModList->list.size = elementCnt * sizeof(PUCCH_ResourceSet_t *); + DU_ALLOC(pucchCfg->resourceSetToAddModList->list.array, pucchCfg->resourceSetToAddModList->list.size); + if(pucchCfg->resourceSetToAddModList->list.array == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + for(rsrcSetIdx=0; rsrcSetIdx < pucchCfg->resourceSetToAddModList->list.count; rsrcSetIdx++) + { + DU_ALLOC(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t)); + if(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx] == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + } + rsrcSetIdx = 0; + rsrcSet = pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx]; + rsrcSet->pucch_ResourceSetId = 1; + elementCnt = 1; + rsrcSet->resourceList.list.count = elementCnt; + rsrcSet->resourceList.list.size = elementCnt * sizeof(PUCCH_ResourceId_t *); + DU_ALLOC(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size); + if(rsrcSet->resourceList.list.array == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++) + { + DU_ALLOC(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t)); + if(rsrcSet->resourceList.list.array[rsrcIdx] == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + } + rsrcIdx = 0; + *(rsrcSet->resourceList.list.array[rsrcIdx]) = 1; + + //RESOURCE + elementCnt = 1; + DU_ALLOC(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList)); + if(pucchCfg->resourceToAddModList == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + pucchCfg->resourceToAddModList->list.count = elementCnt; + pucchCfg->resourceToAddModList->list.size = elementCnt * sizeof(PUCCH_Resource_t *); + DU_ALLOC(pucchCfg->resourceToAddModList->list.array, pucchCfg->resourceToAddModList->list.size); + if(pucchCfg->resourceToAddModList->list.array == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + for(rsrcIdx=0; rsrcIdx < pucchCfg->resourceToAddModList->list.count; rsrcIdx++) + { + DU_ALLOC(pucchCfg->resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t)); + if(pucchCfg->resourceToAddModList->list.array[rsrcIdx] == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + } + rsrcIdx = 0; + rsrc = pucchCfg->resourceToAddModList->list.array[rsrcIdx]; + rsrc->pucch_ResourceId = 1; + rsrc->startingPRB = 0; + rsrc->format.present = PUCCH_Resource__format_PR_format1; + DU_ALLOC(rsrc->format.choice.format1, sizeof(PUCCH_format1_t)); + if(rsrc->format.choice.format1 == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + rsrc->format.choice.format1->initialCyclicShift = 0; + rsrc->format.choice.format1->nrofSymbols = 4; + rsrc->format.choice.format1->startingSymbolIndex = 0; + rsrc->format.choice.format1->timeDomainOCC = 0; + + //PUCCH Format 1 + DU_ALLOC(pucchCfg->format1, sizeof(struct PUCCH_Config__format1)); + if(pucchCfg->format1 == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + pucchCfg->format1->present = PUCCH_Config__format1_PR_setup; + DU_ALLOC(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t)); + if(pucchCfg->format1->choice.setup == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + DU_ALLOC(pucchCfg->format1->choice.setup->nrofSlots, sizeof(long)); + if(pucchCfg->format1->choice.setup->nrofSlots == NULLP) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg"); + return RFAILED; + } + *(pucchCfg->format1->choice.setup->nrofSlots) = PUCCH_FormatConfig__nrofSlots_n4; + //DL DATA TO UL ACK DU_ALLOC(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK)); if(pucchCfg->dl_DataToUL_ACK == NULLP) { @@ -5314,6 +5474,105 @@ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg) } } + +/******************************************************************* + * + * @brief Frees memory allocated for Dedicated PUCCH config + * + * @details + * + * Function : FreeBWPUlDedPucchCfg + * + * Functionality: Deallocating memory of Dedicated PUCCH cfg + * + * @params[in] BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg + * + * @return void + * + * ****************************************************************/ +void FreeBWPUlDedPucchCfg(struct BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg) +{ + uint8_t k1Idx, rsrcIdx, rsrcSetIdx; + PUCCH_Config_t *pucchCfg = NULLP; + PUCCH_ResourceSet_t *rsrcSet = NULLP; + PUCCH_Resource_t *rsrc = NULLP; + + if(ulBwpPucchCfg) + { + if(ulBwpPucchCfg->choice.setup) + { + pucchCfg = ulBwpPucchCfg->choice.setup; + + //Free resource set list + if(pucchCfg->resourceSetToAddModList) + { + if(pucchCfg->resourceSetToAddModList->list.array) + { + for(rsrcSetIdx=0; rsrcSetIdx < pucchCfg->resourceSetToAddModList->list.count; rsrcSetIdx++) + { + rsrcSet = pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx]; + if(rsrcSet->resourceList.list.array) + { + for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++) + { + DU_FREE(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t)); + } + DU_FREE(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size); + } + DU_FREE(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t)); + } + DU_FREE(pucchCfg->resourceSetToAddModList->list.array, pucchCfg->resourceSetToAddModList->list.size); + } + DU_FREE(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList)); + } + + //Free resource list + if(pucchCfg->resourceToAddModList) + { + if(pucchCfg->resourceToAddModList->list.array) + { + for(rsrcIdx=0; rsrcIdx < pucchCfg->resourceToAddModList->list.count; rsrcIdx++) + { + rsrc = pucchCfg->resourceToAddModList->list.array[rsrcIdx]; + DU_FREE(rsrc->format.choice.format1, sizeof(PUCCH_format1_t)); + DU_FREE(pucchCfg->resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t)); + } + DU_FREE(pucchCfg->resourceToAddModList->list.array, pucchCfg->resourceToAddModList->list.size); + } + DU_FREE(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList)); + } + + //PUCCH Format 1 + if(pucchCfg->format1) + { + if(pucchCfg->format1->choice.setup) + { + DU_FREE(pucchCfg->format1->choice.setup->nrofSlots, sizeof(long)); + DU_FREE(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t)); + } + DU_FREE(pucchCfg->format1, sizeof(struct PUCCH_Config__format1)); + } + + //DL DATA TO UL ACK + if(pucchCfg->dl_DataToUL_ACK) + { + if(pucchCfg->dl_DataToUL_ACK->list.array) + { + for(k1Idx = 0; k1Idx < pucchCfg->dl_DataToUL_ACK->list.count; k1Idx++) + { + DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array[k1Idx], sizeof(long)); + } + DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size); + } + DU_FREE(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK)); + } + + DU_FREE(ulBwpPucchCfg->choice.setup, sizeof(PUCCH_Config_t)); + } + DU_FREE(ulBwpPucchCfg, sizeof(struct BWP_UplinkDedicated__pucch_Config)); + } +} + /******************************************************************* * * @brief Frees memory allocated for InitialUlBWP @@ -5331,36 +5590,15 @@ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg) * ****************************************************************/ void FreeInitialUlBWP(BWP_UplinkDedicated_t *ulBwp) { - uint8_t rSetIdx, rsrcIdx, k1Idx; + uint8_t rSetIdx, rsrcIdx; SRS_Config_t *srsCfg = NULLP; PUSCH_Config_t *puschCfg = NULLP; - PUCCH_Config_t *pucchCfg = NULLP; struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA *dmrsUlCfg = NULLP; struct SRS_Config__srs_ResourceSetToAddModList *rsrcSetList = NULLP; struct SRS_ResourceSet__srs_ResourceIdList *rsrcIdList = NULLP; struct SRS_Config__srs_ResourceToAddModList *resourceList = NULLP; - if(ulBwp->pucch_Config) - { - if(ulBwp->pucch_Config->choice.setup) - { - pucchCfg = ulBwp->pucch_Config->choice.setup; - if(pucchCfg->dl_DataToUL_ACK) - { - if(pucchCfg->dl_DataToUL_ACK->list.array) - { - for(k1Idx = 0; k1Idx < pucchCfg->dl_DataToUL_ACK->list.count; k1Idx++) - { - DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array[k1Idx], sizeof(long)); - } - DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size); - } - DU_FREE(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK)); - } - DU_FREE(ulBwp->pucch_Config->choice.setup, sizeof(PUCCH_Config_t)); - } - DU_FREE(ulBwp->pucch_Config, sizeof(struct BWP_UplinkDedicated__pucch_Config)); - } + FreeBWPUlDedPucchCfg(ulBwp->pucch_Config); if(ulBwp->pusch_Config) { @@ -8153,31 +8391,34 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg) if(cRsetToAddModList->list.count) { macPdcchCfg->numCRsetToAddMod = cRsetToAddModList->list.count; - for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++) - { - macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \ - cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId; - bitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\ - macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc); + for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++) + { + macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \ + cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId; + //freqDomRsrcBitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\ + macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc); + memcpy(macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc, \ + cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources.buf, + cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources.size); + macPdcchCfg->cRSetToAddModList[cRsetIdx].duration = \ - cRsetToAddModList->list.array[cRsetIdx]->duration; + cRsetToAddModList->list.array[cRsetIdx]->duration; - macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \ - cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present; + macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \ + cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present; if(macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType == CCE_REG_MAPPINGTYPE_PR_INTERLEAVED) - { - //TODO: handle the case for Interleaved + { + //TODO: handle the case for Interleaved } macPdcchCfg->cRSetToAddModList[cRsetIdx].precoderGranularity = \ - cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity; - if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID) - { - macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \ - *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID); - } + cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity; + if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID) + { + macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \ + *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID); + } } } - } /* Control Resource Set To Release List */ if(cuPdcchCfg->controlResourceSetToReleaseList) @@ -8186,10 +8427,10 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg) if(cRsetToRelList->list.count) { macPdcchCfg->numCRsetToRel = cRsetToRelList->list.count; - for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++) - { + for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++) + { macPdcchCfg->cRSetToRelList[cRsetIdx] = *(cRsetToRelList->list.array[cRsetIdx]); - } + } } } @@ -8200,49 +8441,49 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg) if(srchSpcToAddModList->list.count) { macPdcchCfg->numSearchSpcToAddMod = srchSpcToAddModList->list.count; - for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++) - { + for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++) + { macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceId =\ - srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId; + srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId; macPdcchCfg->searchSpcToAddModList[srchSpcIdx].cRSetId =\ - *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId); - if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset) - { + *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId); + if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset) + { macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset =\ - srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present; + srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present; } if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot) { - bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\ - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot); + bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\ + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot); } - if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates) + if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates) { - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \ - srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1; - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \ - srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2; - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \ - srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4; - - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \ - srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8; - - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \ - srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16; - } + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \ + srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1; + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \ + srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2; + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \ + srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4; + + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \ + srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8; + + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \ + srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16; + } if(srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType) - { - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\ - srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present; - if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC) - { - macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\ - srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats; - } - - } - } + { + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\ + srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present; + if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC) + { + macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\ + srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats; + } + + } + } } } /* Search space To Rel List */ @@ -8252,11 +8493,11 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg) if(srchSpcToRelList->list.count) { macPdcchCfg->numSearchSpcToRel = srchSpcToRelList->list.count; - for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++) - { + for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++) + { macPdcchCfg->searchSpcToRelList[srchSpcIdx] =\ - *(srchSpcToRelList->list.array[srchSpcIdx]); - } + *(srchSpcToRelList->list.array[srchSpcIdx]); + } } } } @@ -8654,8 +8895,16 @@ void extractResrcSetToAddModList(PucchResrcSetCfg *macRsrcSetList, struct PUCCH_ macRsrcSetList->resrcSetToAddModList[arrIdx].resrcList[rsrcListIdx] =\ *cuRsrcSetList->list.array[arrIdx]->resourceList.list.array[rsrcListIdx]; } - macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\ - *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1; + + if(cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1) + { + macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\ + *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1; + } + else + { + macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize = 0; + } } }/* End of extractResrcSetToAddModList */ @@ -9208,7 +9457,21 @@ ServCellCfgInfo *storedSrvCellCfg) if(dlBwp->pdcch_Config->choice.setup) { macSrvCellCfg->initDlBwp.pdcchPresent = true; - extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); + if(storedSrvCellCfg) + { + if(!storedSrvCellCfg->initDlBwp.pdcchPresent) + { + extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); + } + else + { + extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); + } + } + else + { + extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); + } } } if(dlBwp->pdsch_Config) @@ -12134,7 +12397,7 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck) uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId) { uint8_t ieIdx=0, arrIdx=0,ret=ROK; - uint8_t ueId =0 , ueIdx =0; + uint8_t ueId =0 , ueIdx =0, totalActiveUe = 0; uint16_t cellId =0, cellIdx =0, crnti=0; CmLList *f1apPduNode = NULLP; ReservedF1apPduInfo *f1apPduInfo =NULLP; @@ -12186,28 +12449,38 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId) ret = duSendCellDeletReq(cellId); if(ret == RFAILED) { - DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\ + DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\ request for cellId[%d]", cellId); } } else { - for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++) + totalActiveUe = duCb.actvCellLst[cellIdx]->numActvUes; + while(totalActiveUe) { + if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].ueState != UE_ACTIVE) + { + ueIdx++; + continue; + } + crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti; GET_UE_IDX(crnti,ueId); + /* Sending Ue Context release request only for maximum supporting UEs */ ret = BuildAndSendUeContextReleaseReq(cellId, ueId); if(ret == RFAILED) { - DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\ + DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\ request for cellId[%d]", cellId); } + ueIdx++; + totalActiveUe--; } } } else { - DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId); + DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId); ret = RFAILED; } break; @@ -13418,7 +13691,7 @@ uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1 break; }while(true); - if(ret == ROK) + if(ret == ROK && (duCb.actvCellLst[cellId-1]->numActvUes == 0)) { duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS; ret = duSendCellDeletReq(cellId); @@ -13543,7 +13816,7 @@ uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg) { for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++) { - for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++) + for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++) { if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\ (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId)) @@ -13592,7 +13865,7 @@ uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg) } if(!ueIdxFound) { - DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()"); + DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextReleaseCommand()"); ret = RFAILED; }