Changes for SR, BSR and MSG5 Handling
[o-du/l2.git] / src / du_app / du_msg_hdl.c
index 6dcb15a..38c7ea4 100644 (file)
 #include "lrg.h"
 #include "legtp.h"
 #include "lkw.h"
+#include "kwu.h"
 #include "lrg.x"
 #include "lkw.x"
+#include "kwu.x"
 #include "du_app_mac_inf.h"
+#include "du_app_rlc_inf.h"
 #include "du_cfg.h"
+#include "du_app_rlc_inf.h"
 #include "du_mgr.h"
 #include "du_sctp.h"
+#include "F1AP-PDU.h"
 #include "du_f1ap_msg_hdl.h"
 #include "du_ue_mgr.h"
 #include "lsctp.h"
@@ -42,7 +47,7 @@ U8 macCfg = 0;
 U8 macCfgInst = 0;
 
 extern DuCfgParams duCfgParam;
-extern S16 cmPkLkwCfgReq(Pst *pst, KwMngmt *cfg);
+extern S16 packRlcConfigReq(Pst *pst, KwMngmt *cfg);
 extern S16 cmPkLkwCntrlReq(Pst *pst, KwMngmt *cfg);
 extern S16 cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
 extern S16 BuildAndSendE2SetupReq();
@@ -150,7 +155,7 @@ S16 duBuildRlcCfg(Inst inst)
    DU_LOG("\nDU_APP : RLC Gen Cfg Req sent for inst %d", inst);
 
    /* Send the request to RLC */
-   cmPkLkwCfgReq(&pst, &kwMngmt);
+   packRlcConfigReq(&pst, &kwMngmt);
 
    return ROK;
 }
@@ -228,7 +233,7 @@ S16 duBuildRlcLsapCfg(Ent ent, Inst inst, U8 lsapInst)
       DU_LOG("\nDU_APP : RLC DL/UL Lower Sap Cfg Req sent for inst %d", inst);
    }
 
-   cmPkLkwCfgReq(&pst, &kwMngmt);
+   packRlcConfigReq(&pst, &kwMngmt);
    return ROK;
 }
 
@@ -293,7 +298,7 @@ S16 duBuildRlcUsapCfg(U8 elemId, Ent ent, Inst inst)
    pst.region = duCb.init.region;
 
    DU_LOG("\nDU_APP : RLC Kwu Upper Sap Cfg Req sent for inst %d", inst);
-   cmPkLkwCfgReq(&pst, &kwMngmt);
+   packRlcConfigReq(&pst, &kwMngmt);
 
    return ROK;
 }
@@ -429,7 +434,7 @@ S16 duSendRlcDlCfg()
  *
  * @details
  *
- *      Function : duHdlRlcCfgComplete 
+ *      Function : DuHdlRlcCfgComplete 
  * 
  *      Functionality:
  *           Handles Gen Config Confirm from RLC
@@ -440,7 +445,7 @@ S16 duSendRlcDlCfg()
  *         RFAILED - failure
  *
  ***************************************************************************/
-S16 duHdlRlcCfgComplete(Pst *pst, KwMngmt *cfm)
+S16 DuHdlRlcCfgComplete(Pst *pst, KwMngmt *cfm)
 {
    S16 ret = ROK;
    if (pst->srcInst == RLC_UL_INST)
@@ -1818,6 +1823,34 @@ uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
    return (duProcUlCcchInd(ulCcchIndInfo));
 }
 
+/*******************************************************************
+ *
+ * @brief Process UL RRC Message from RLC
+ *
+ * @details
+ *
+ *    Function : DuProcRlcUlRrcMsgTrans
+ *
+ *    Functionality: Process UL RRC Message from RLC
+ *
+ * @params[in] Post structure
+ *             UL RRC Message Info
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
+{
+   DuUeCb   ueCb;
+   
+   ueCb = duCb.actvCellLst[ulRrcMsgInfo->cellId -1]->ueCb[ulRrcMsgInfo->ueIdx -1];
+   BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
+      ulRrcMsgInfo->rrcMsg);
+
+   DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
+   DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
+   return ROK;
+}
 
 /**********************************************************************
   End of file