[Epic-ID: ODUHIGH-510][Task-ID: ODUHIGH-512] Implementation of E2 setup failure
[o-du/l2.git] / src / du_app / du_cfg.c
index fe4ef42..4c7a1c5 100644 (file)
 
 /* 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"
@@ -600,6 +602,9 @@ uint8_t readCfg()
    Sib1Params sib1;
    F1TaiSliceSuppLst *taiSliceSuppLst;
 
+   duCb.e2apDb.e2TransInfo.transIdCounter = 0;
+   memset(duCb.e2apDb.e2TransInfo.onGoingTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
+
 #ifndef O1_ENABLE
    /* Note: Added these below variable for local testing*/
    Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
@@ -1083,7 +1088,26 @@ uint8_t duReadCfg()
    pst.selector = ODU_SELECTOR_TC;
    pst.pool= DU_POOL;
 
+   /* Initialize the timer blocks */
+   cmInitTimers(&(duCb.e2apDb.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");