X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cfg.c;h=34308d759a755842c156f7bcf1ef00d90f8c0b51;hb=5b0a8c1ccec481f354d22c1dff57b35bf72a1622;hp=fe4ef425b0634091cdbdcf807dc6906caba006c5;hpb=f1f384a125521129ec29c1589b8499010cc4685c;p=o-du%2Fl2.git diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index fe4ef425b..34308d759 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -18,12 +18,14 @@ /* This file contains all utility functions */ #include "common_def.h" +#include "du_tmr.h" #include "legtp.h" #include "lrg.h" #include "lkw.x" #include "lrg.x" #include "du_app_mac_inf.h" #include "du_app_rlc_inf.h" +#include "du_e2ap_mgr.h" #include "du_cfg.h" #include "du_mgr.h" #include "du_utils.h" @@ -593,12 +595,19 @@ uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) uint8_t readCfg() { - uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx; + CmLList *node; + uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx, ranFuncIdx, eventTriggerStyleIdx, reportStyleIdx, tnlAssocIdx; uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx; uint32_t ipv4_du, ipv4_cu, ipv4_ric; MibParams mib; Sib1Params sib1; F1TaiSliceSuppLst *taiSliceSuppLst; + uint8_t MeasurementInfoIdx =0, measurementInfoLen=0; + char shortName[] = SHORT_NAME; + char serviceModelOID[]= SERVICE_MODEL_OID; + char description[] = DESCRIPTION; + char event_trigger_style_name[]= EVENT_TRIGGER_STYLE_NAME; + char ric_report_style_name[]= REPORT_STYLE_NAME; #ifndef O1_ENABLE /* Note: Added these below variable for local testing*/ @@ -658,6 +667,74 @@ uint8_t readCfg() } strcpy((char*)duCfgParam.duName,DU_NAME); + memset(&duCb.e2apDb, 0, sizeof(E2apDb)); + duCb.e2apDb.e2NodeId = DU_ID; + duCb.e2apDb.e2TransInfo.transIdCounter = 0; + + duCb.e2apDb.numOfTNLAssoc = 1; + for(tnlAssocIdx =0; tnlAssocIdxmeasurementTypeId = MeasurementInfoIdx+1; + memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[MeasurementInfoIdx], measurementInfoLen+1); + } + DU_ALLOC(node, sizeof(CmLList)); + if(node) + { + node->node = (PTR) measurementInfoForAction; + cmLListAdd2Tail(&duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].measurementInfoList, node); + } + else + { + + DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction)); + } + } + } + + duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT; + duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT; + } + memset(duCb.e2apDb.e2TransInfo.onGoingTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo)); + /* Mib Params */ mib.sysFrmNum = SYS_FRAME_NUM; #ifdef NR_TDD @@ -1083,7 +1160,26 @@ uint8_t duReadCfg() pst.selector = ODU_SELECTOR_TC; pst.pool= DU_POOL; + /* Initialize the timer blocks */ + cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1); + /* Initialzie the timer queue */ + memset(&(duCb.duTimersInfo.tmrTq), 0, sizeof(CmTqType) * DU_TQ_SIZE); + + /* Initialize the timer control point */ + memset(&(duCb.duTimersInfo.tmrTqCp), 0, sizeof(CmTqCp)); + duCb.duTimersInfo.tmrTqCp.tmrLen = DU_TQ_SIZE; + + /* Initialize the timer resolution */ + duCb.duTimersInfo.tmrRes = DU_TIMER_RESOLUTION; + + /* Timer Registration request to system services */ + if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK) + { + DU_LOG("\nERROR --> DU_APP : Failed to register timer"); + return RFAILED; + } + if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK) { DU_LOG("\nERROR --> DU_APP : Memory allocation failed in duReadCfg");