From: lal.harshita Date: Fri, 14 Apr 2023 10:30:12 +0000 (+0530) Subject: [Task-ID: ODUHIGH-503] Fixes in GNB DU Config Update X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fl2.git;a=commitdiff_plain;h=57b70bdb263c6f9b46a0572c3ea7ee9571eb2e48 [Task-ID: ODUHIGH-503] Fixes in GNB DU Config Update Change-Id: I8ca019f8b74cd4578a3133b586fa81a38ef3382d Signed-off-by: lal.harshita --- diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 01b67c5b1..fe4ef425b 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -43,6 +43,7 @@ #include "PagingCycle.h" #include "PCCH-Config.h" #include "TimeAlignmentTimer.h" +#include "BCCH-DL-SCH-Message.h" #include "RACH-ConfigGeneric.h" #include "PUSCH-TimeDomainResourceAllocation.h" #include "PUCCH-ConfigCommon.h" diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 22c8286e9..b9a8f3495 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -174,12 +174,15 @@ #include "CFRA-SSB-Resource.h" #include "BWP-UplinkCommon.h" #include "ReconfigurationWithSync.h" +#include "BCCH-DL-SCH-Message.h" #include "du_sys_info_hdl.h" #include "DRX-ConfigRrc.h" #include "MeasurementTimingConfigurationRrc.h" #include "MeasurementTimingConfigurationRrc-IEs.h" #include "MeasTimingList.h" #include "MeasTiming.h" +#include "Cells-Status-List.h" +#include "Cells-Status-Item.h" #ifdef O1_ENABLE #include "CmInterface.h" @@ -1046,19 +1049,19 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) for(plmnidx=0; plmnidxlist.array[plmnidx],\ - sizeof(GNB_DU_Served_Cells_ItemIEs_t)); + sizeof(GNB_DU_Served_Cells_ItemIEs_t)); if(duServedCell->list.array[plmnidx] == NULLP) { - return RFAILED; + return RFAILED; } } idx = 0; duServedCell->list.array[idx]->id = ProtocolIE_ID_id_GNB_DU_Served_Cells_Item; duServedCell->list.array[idx]->criticality = Criticality_reject; duServedCell->list.array[idx]->value.present = \ - GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item; + GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item; srvCellItem = \ - &duServedCell->list.array[idx]->value.choice.GNB_DU_Served_Cells_Item; + &duServedCell->list.array[idx]->value.choice.GNB_DU_Served_Cells_Item; /*nRCGI*/ BuildNrcgiret = BuildNrcgi(&srvCellItem->served_Cell_Information.nRCGI); if(BuildNrcgiret != ROK) @@ -1067,7 +1070,7 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) } /*nRPCI*/ srvCellItem->served_Cell_Information.nRPCI = \ - duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci; + duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci; /* fiveGS_TAC */ BuildFiveGSTacret = BuildFiveGSTac(&srvCellItem->served_Cell_Information); @@ -1096,7 +1099,7 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) /* GNB DU System Information */ DU_ALLOC(srvCellItem->gNB_DU_System_Information, - sizeof(GNB_DU_System_Information_t)); + sizeof(GNB_DU_System_Information_t)); if(!srvCellItem->gNB_DU_System_Information) { return RFAILED; @@ -1104,20 +1107,20 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) /* MIB */ srvCellItem->gNB_DU_System_Information->mIB_message.size = duCfgParam.srvdCellLst[0].duSysInfo.mibLen; DU_ALLOC(srvCellItem->gNB_DU_System_Information->mIB_message.buf, - srvCellItem->gNB_DU_System_Information->mIB_message.size); + srvCellItem->gNB_DU_System_Information->mIB_message.size); if(!srvCellItem->gNB_DU_System_Information->mIB_message.buf) { return RFAILED; } memcpy(srvCellItem->gNB_DU_System_Information->mIB_message.buf, duCfgParam.srvdCellLst[0].duSysInfo.mibMsg, \ - srvCellItem->gNB_DU_System_Information->mIB_message.size); + srvCellItem->gNB_DU_System_Information->mIB_message.size); /* SIB1 */ srvCellItem->gNB_DU_System_Information->sIB1_message.size =\ - duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; + duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; DU_ALLOC(srvCellItem->gNB_DU_System_Information->sIB1_message.buf, - srvCellItem->gNB_DU_System_Information->sIB1_message.size); + srvCellItem->gNB_DU_System_Information->sIB1_message.size); if(!srvCellItem->gNB_DU_System_Information->sIB1_message.buf) { return RFAILED; @@ -1125,7 +1128,7 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) for(int x=0; xgNB_DU_System_Information->sIB1_message.size; x++) { srvCellItem->gNB_DU_System_Information->sIB1_message.buf[x]=\ - duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg[x]; + duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg[x]; } return ROK; } @@ -1631,7 +1634,7 @@ uint8_t BuildAndSendF1SetupReq() elementCnt = 5; f1SetupReq->protocolIEs.list.count = elementCnt; - f1SetupReq->protocolIEs.list.size = elementCnt * sizeof(F1SetupRequestIEs_t ); + f1SetupReq->protocolIEs.list.size = elementCnt * sizeof(F1SetupRequestIEs_t *); /* Initialize the F1Setup members */ DU_ALLOC(f1SetupReq->protocolIEs.list.array,f1SetupReq->protocolIEs.list.size); @@ -1882,7 +1885,7 @@ void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem) } } DU_FREE(modifyItem->served_Cell_Information.measurementTimingConfiguration.buf,\ - modifyItem->served_Cell_Information.measurementTimingConfiguration.size); + modifyItem->served_Cell_Information.measurementTimingConfiguration.size); } /******************************************************************* @@ -1903,12 +1906,13 @@ void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem) * ****************************************************************/ void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg) { - uint8_t ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0; + uint8_t idx=0,ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0; GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP; Served_Cells_To_Modify_List_t *cellsToModify=NULLP; Served_Cells_To_Delete_List_t *cellsToDelete=NULLP; Served_Cells_To_Delete_Item_t *deleteItem = NULLP; Served_Cells_To_Delete_ItemIEs_t *deleteItemIe = NULLP; + Cells_Status_ItemIEs_t *cellStatusItemIE; if(f1apDuCfg != NULLP) { @@ -1976,6 +1980,18 @@ void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg) duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size); break; } + case ProtocolIE_ID_id_Cells_Status_List: + { + for(idx = 0; idx < duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.count; idx++) + { + cellStatusItemIE = (Cells_Status_ItemIEs_t *)duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array[idx]; + DU_FREE(cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.nRCellIdentity.buf, cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.nRCellIdentity.size); + DU_FREE(cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.pLMN_Identity.buf, cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.pLMN_Identity.size); + DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array[idx],sizeof(Cells_Status_ItemIEs_t)); + } + DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array,\ + duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.size); + } } DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx],\ sizeof(GNBDUConfigurationUpdateIEs_t)); @@ -2468,6 +2484,7 @@ uint8_t fillCellToDeleteItem(struct Served_Cells_To_Delete_ItemIEs *deleteItemIe fillBitString(&deleteItem->oldNRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity); return ROK; } + /******************************************************************* * * @brief Builds ServCellToDeleteList @@ -2519,6 +2536,56 @@ uint8_t buildServCellToDeleteList(Served_Cells_To_Delete_List_t *cellsToDelete) return ROK; } +/******************************************************************* + * + * @brief Builds CellsStatusList + * + * @details + * + * Function : buildCellsStatusList + * + * Functionality: Builds the Cell Status List + * + * @params[in] Pointer to Cells_Status_List_t * + * + * @return ROK - success + * RFAILED - failure + * + *****************************************************************/ +uint8_t buildCellsStatusList(Cells_Status_List_t *cellStatusList) +{ + uint8_t elementCnt = 0, idx = 0, ret = ROK; + Cells_Status_ItemIEs_t *cellStatusItemIE; + + elementCnt = 1; + cellStatusList->list.count = elementCnt; + cellStatusList->list.size = elementCnt * sizeof(Cells_Status_ItemIEs_t *); + DU_ALLOC(cellStatusList->list.array, cellStatusList->list.size); + + for(idx = 0; idx < elementCnt; idx++) + { + DU_ALLOC(cellStatusList->list.array[idx], sizeof(Cells_Status_ItemIEs_t)); + if(!cellStatusList->list.array[idx]) + { + DU_LOG("ERROR --> F1AP: buildCellsStatusList() memory allocation failure"); + return RFAILED; + } + } + idx = 0; + cellStatusItemIE = (Cells_Status_ItemIEs_t *)cellStatusList->list.array[idx]; + cellStatusItemIE->id = ProtocolIE_ID_id_Cells_Status_Item; + cellStatusItemIE->criticality = Criticality_reject; + cellStatusItemIE->value.present = Cells_Status_ItemIEs__value_PR_Cells_Status_Item; + ret = BuildNrcgi(&cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI); + if(ret == RFAILED) + { + DU_LOG("ERROR --> F1AP: buildCellsStatusList() NRCGI failed"); + return RFAILED; + } + cellStatusItemIE->value.choice.Cells_Status_Item.service_status.service_state = Service_State_in_service; + return ROK; +} + /******************************************************************* * * @brief Builds and sends the DUConfigUpdate @@ -2574,7 +2641,7 @@ uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction) InitiatingMessage__value_PR_GNBDUConfigurationUpdate; duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\ choice.GNBDUConfigurationUpdate; - elementCnt = 3; + elementCnt = 4; duCfgUpdate->protocolIEs.list.count = elementCnt; duCfgUpdate->protocolIEs.list.size = \ elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*); @@ -2641,7 +2708,21 @@ uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction) } } - // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE + // TODO :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE + + /*Cell Status List*/ + ieIdx++; + duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_Cells_Status_List; + duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject; + duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \ + GNBDUConfigurationUpdateIEs__value_PR_Cells_Status_List; + ret = buildCellsStatusList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List); + if(ret == RFAILED) + { + DU_LOG("ERROR --> DU APP : BuildAndSendDUConfigUpdate(): Cell Status List building failed"); + break; + } + /*GNB DU ID */ ieIdx++; duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID; diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index 0a830ea5e..64bde2675 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -54,11 +54,11 @@ #include "TDD-UL-DL-ConfigCommon.h" #include "ServingCellConfigCommonSIB.h" #include "MCC.h" -#include "BCCH-DL-SCH-Message.h" #include "SIB1.h" #include "odu_common_codec.h" -#include "du_sys_info_hdl.h" +#include "BCCH-DL-SCH-Message.h" #include "du_f1ap_conversions.h" +#include "du_sys_info_hdl.h" void FreeSib1Msg(SIB1_t *sib1Msg); uint8_t FreqInfoUlret = RFAILED; @@ -3278,10 +3278,18 @@ void FreeBcchDlSchMsg(BCCH_DL_SCH_Message_t bcchMsg) FreeSib1Msg(bcchMsg.message.choice.c1->choice.systemInformationBlockType1); break; } + case BCCH_DL_SCH_MessageType__c1_PR_systemInformation: + break; + case BCCH_DL_SCH_MessageType__c1_PR_NOTHING: + break; } DU_FREE(bcchMsg.message.choice.c1, sizeof(struct BCCH_DL_SCH_MessageType__c1)); break; } + case BCCH_DL_SCH_MessageType_PR_messageClassExtension: + break; + case BCCH_DL_SCH_MessageType_PR_NOTHING: + break; } } diff --git a/src/du_app/du_sys_info_hdl.h b/src/du_app/du_sys_info_hdl.h index 2aab5fc0c..b175765d5 100644 --- a/src/du_app/du_sys_info_hdl.h +++ b/src/du_app/du_sys_info_hdl.h @@ -37,6 +37,7 @@ uint8_t BuildBwpUlCommon(BWP_UplinkCommon_t *bwp); uint8_t BuildTddUlDlCfgComm(TDD_UL_DL_ConfigCommon_t *tddCfg); void FreeBwpDlCommon(BWP_DownlinkCommon_t *bwp); void FreeBwpUlCommon(BWP_UplinkCommon_t *bwp); +void FreeBcchDlSchMsg(BCCH_DL_SCH_Message_t bcchMsg); char encBuf[ENC_BUF_MAX_LEN]; DuCfgParams duCfgParam;