[Epic-ID: ODUHIGH-510][Task-ID: ODUHIGH-512] Implementation of E2 setup failure
[o-du/l2.git] / src / du_app / du_cfg.c
index 335415c..4c7a1c5 100644 (file)
@@ -18,6 +18,7 @@
 
 /* This file contains all utility functions */
 #include "common_def.h"
+#include "du_tmr.h"
 #include "legtp.h"
 #include "lrg.h"
 #include "lkw.x"
@@ -601,8 +602,8 @@ uint8_t readCfg()
    Sib1Params sib1;
    F1TaiSliceSuppLst *taiSliceSuppLst;
 
-   duCb.e2apDb.transIdCounter = 0;
-   memset(duCb.e2apDb.onGoingTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
+   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*/
@@ -1087,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");