Merge "[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-480] WG8 Alignment | Third Phase ...
[o-du/l2.git] / src / 5gnrrlc / rlc_mgr.c
index 14de3d8..60391ef 100644 (file)
@@ -21,8 +21,8 @@
 #include "lkw.h"           /* LKW defines */
 #include "ckw.h"           /* CKW defines */
 #include "kwu.h"           /* KWU defines */
-#include "kw_env.h"        /* RLC environment options */
-#include "kw.h"            /* RLC defines */
+#include "rlc_env.h"        /* RLC environment options */
+#include "rlc_err.h"
 
 
 /* header/extern include files (.x) */
 #include "lkw.x"           /* LKW */
 #include "ckw.x"           /* CKW */
 #include "kwu.x"           /* KWU */
-#include "kw_err.h"
-#include "kw.x"
 
+#include "rlc_utils.h"            /* RLC defines */
 #include "du_app_rlc_inf.h"
 #include "rlc_mgr.h"
 
-RlcUlDuUeCreateRsp rlcUlUeCreateRspOpts[] =
+RlcDuUeCfgRsp rlcUeCfgRspOpts[] =
 {
-   packRlcUlDuUeCreateRsp,     /* 0 - loosely coupled */
-   DuProcRlcUlUeCreateRsp,     /* 1 - tightly coupled */
-   packRlcUlDuUeCreateRsp,     /* 2 - LWLC loosely coupled */
+   packRlcDuUeCfgRsp,     /* 0 - loosely coupled */
+   DuProcRlcUeCfgRsp,     /* 1 - tightly coupled */
+   packRlcDuUeCfgRsp     /* 2 - LWLC loosely coupled */
 };
 
 
@@ -62,32 +61,42 @@ RlcUlDuUeCreateRsp rlcUlUeCreateRspOpts[] =
  *      -# RFAILED
  *
  *************************************************************/
-uint8_t SendRlcUlUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
+uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
 {
    /* jump to specific primitive depending on configured selector */
-   uint8_t ret = ROK;  
-   RlcUeCfgRsp *ueCreateRsp = NULLP;
+   uint8_t ret = ROK;
+   RlcCb   *gCb;
+   RlcUeCfgRsp *ueRsp = NULLP;
 
-   RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueCreateRsp, sizeof(RlcUeCfgRsp));
-   if(!ueCreateRsp)
+   gCb = RLC_GET_RLCCB(pst->srcInst);
+   RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
+   if(!ueRsp)
    {  
-      DU_LOG("RLC: Memory allocation failed for ueCreateRsp at SendRlcUlUeCreateRspToDu()");
+      DU_LOG("\nERROR  -->  RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()");
       ret = RFAILED;
    }
    else
    {
       /* Mapping Old api to New Api */
-      fillRlcUlUeCfgRsp(ueCreateRsp, cfgRsp);
-      ret = (*rlcUlUeCreateRspOpts[pst->selector])(pst, ueCreateRsp);
-      if(ret)
+      ret = fillRlcUeCfgRsp(ueRsp, cfgRsp);
+      if(!ret)
       {
-         DU_LOG("RLC: Failed at SendRlcUlUeCreateRspToDu()");
-         RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCreateRsp, sizeof(RlcUeCfgRsp));
-        ret = RFAILED;
+         ret = (*rlcUeCfgRspOpts[pst->selector])(pst, ueRsp);
+         if(ret)
+         {
+            DU_LOG("\nERROR  -->  RLC: Failed at SendRlcUeCfgRspToDu()");
+            RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  RLC: Failed at fillRlcUeCfgRsp() for event %d", pst->event);
+         RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
       }
    }
+   RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
    return ret;
-} /* end of SendRlcUlUeCreateRspToDu */
+} /* end of SendRlcUeCfgRspToDu */
 
 /**********************************************************************
          End of file