[Epic-ID: ODUHIGH-516][Task-ID: ODUHIGH-530] RIC Subscription Modification Req
[o-du/l2.git] / src / du_app / du_cfg.c
index 44608b8..72af421 100644 (file)
@@ -106,20 +106,20 @@ uint8_t readMacCfg()
 #ifdef O1_ENABLE
    duCfgParam.macCellCfg.cellId = cellParams.cellLocalId;
    duCfgParam.macCellCfg.carrCfg.dlBw = cellParams.bSChannelBwDL;
-   duCfgParam.macCellCfg.carrCfg.dlFreq = convertArfcnToFreqKhz(cellParams.arfcnDL);
+   duCfgParam.macCellCfg.carrCfg.arfcnDL = cellParams.arfcnDL;
 #else
    duCfgParam.macCellCfg.cellId = NR_CELL_ID;
    duCfgParam.macCellCfg.carrCfg.dlBw = NR_BANDWIDTH;
-   duCfgParam.macCellCfg.carrCfg.dlFreq = convertArfcnToFreqKhz(NR_DL_ARFCN);
+   duCfgParam.macCellCfg.carrCfg.arfcnDL  = NR_DL_ARFCN;
 #endif
    duCfgParam.macCellCfg.carrCfg.numTxAnt = NUM_TX_ANT;
    /* UL Carrier configuration */
 #ifdef O1_ENABLE
    duCfgParam.macCellCfg.carrCfg.ulBw = cellParams.bSChannelBwUL;
-   duCfgParam.macCellCfg.carrCfg.ulFreq = convertArfcnToFreqKhz(cellParams.arfcnUL);
+   duCfgParam.macCellCfg.carrCfg.arfcnUL = cellParams.arfcnUL;
 #else   
    duCfgParam.macCellCfg.carrCfg.ulBw = NR_BANDWIDTH;
-   duCfgParam.macCellCfg.carrCfg.ulFreq =  convertArfcnToFreqKhz(NR_UL_ARFCN);
+   duCfgParam.macCellCfg.carrCfg.arfcnUL =  NR_UL_ARFCN;
 #endif   
    duCfgParam.macCellCfg.carrCfg.numRxAnt = NUM_RX_ANT;
 
@@ -602,7 +602,7 @@ uint8_t readCfg()
    MibParams mib;
    Sib1Params sib1;
    F1TaiSliceSuppLst *taiSliceSuppLst;
-   uint8_t MeasurementInfoIdx =0, measurementInfoLen=0;
+   uint8_t measurementInfoIdx =0, measurementInfoLen=0;
    char shortName[] = SHORT_NAME;
    char serviceModelOID[]= SERVICE_MODEL_OID;
    char  description[] = DESCRIPTION;
@@ -614,6 +614,9 @@ uint8_t readCfg()
    Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
 #endif
 
+   /* Gnb Id */
+   duCb.gnbId = GNB_ID;
+   
 #ifdef O1_ENABLE
    if( getStartupConfig(&g_cfg) != ROK )
    {
@@ -635,7 +638,7 @@ uint8_t readCfg()
 #endif
 
    fillDuPort(duCfgParam.sctpParams.duPort);
-
+   
    /* F1 DU IP Address and Port*/
    duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
 
@@ -656,7 +659,7 @@ uint8_t readCfg()
    duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
 
    duCfgParam.maxUe = 32; //TODO: Check
-
+   
    /* DU Info */
    duCfgParam.duId = DU_ID;
    DU_ALLOC(duCfgParam.duName, sizeof(DU_NAME));
@@ -706,15 +709,15 @@ uint8_t readCfg()
          duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.formatType = REPORT_ACTION_FORMAT_TYPE;
          memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.name, ric_report_style_name, sizeof(ric_report_style_name));
          
-         for(MeasurementInfoIdx =0; MeasurementInfoIdx<NUM_OF_MEASUREMENT_INFO_SUPPORTED; MeasurementInfoIdx++)
+         for(measurementInfoIdx =0; measurementInfoIdx<NUM_OF_MEASUREMENT_INFO_SUPPORTED(CONFIG_ADD); measurementInfoIdx++)
          {
-            measurementInfoLen= strlen(MEASUREMENT_TYPE_NAME[MeasurementInfoIdx]);
+            measurementInfoLen= strlen(MEASUREMENT_TYPE_NAME[measurementInfoIdx]);
             MeasurementInfoForAction *measurementInfoForAction;
             DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
             if(measurementInfoForAction)
             {
-               measurementInfoForAction->measurementTypeId = MeasurementInfoIdx+1;
-               memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[MeasurementInfoIdx], measurementInfoLen+1);
+               measurementInfoForAction->measurementTypeId = measurementInfoIdx+1;
+               memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[measurementInfoIdx], measurementInfoLen+1);
             }
             DU_ALLOC(node, sizeof(CmLList));
             if(node)
@@ -732,8 +735,11 @@ uint8_t readCfg()
       
       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT;
       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT; 
+
+      cmLListInit(&duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList);
    }
-   memset(duCb.e2apDb.e2TransInfo.onGoingTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
+   memset(duCb.e2apDb.e2TransInfo.e2InitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
+   memset(duCb.e2apDb.e2TransInfo.ricInitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
    
    /* Mib Params */
    mib.sysFrmNum = SYS_FRAME_NUM;
@@ -1162,6 +1168,8 @@ uint8_t duReadCfg()
 
    /* Initialize the timer blocks */
    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1);
+   cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1);
+   cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1);
 
    /* Initialzie the timer queue */   
    memset(&(duCb.duTimersInfo.tmrTq), 0, sizeof(CmTqType) * DU_TQ_SIZE);