SIB1 optional parameters, Cell start request, stop request and slot indication 12/3212/6
authorBalaji Shankaran <balaji.shankaran@radisys.com>
Wed, 8 Apr 2020 09:36:35 +0000 (15:06 +0530)
committerBalaji Shankaran <balaji.shankaran@radisys.com>
Tue, 14 Apr 2020 04:29:29 +0000 (04:29 +0000)
PatchSet 5:
Modified :
 1. mac_msg_hdl.c
 2. rg.h
 3. du_mgr.h
 4. du_msg_hdl.c

PatchSet 4:
deleted :
 1. mac_main.h
modified :
 1. mac_msg_hdl.c
 2. mac_upr_int_api.h
 3. rg.h
 4. du_mgr.h
 5. du_msg_hdl.c

Change-Id: I857386e4d028f1ee85711eaa650978f4e2d85a55
Signed-off-by: Balaji Shankaran <balaji.shankaran@radisys.com>
24 files changed:
src/5gnrmac/mac_msg_hdl.c [new file with mode: 0644]
src/5gnrmac/mac_upr_inf_api.c [new file with mode: 0644]
src/5gnrmac/mac_upr_inf_api.h [new file with mode: 0644]
src/5gnrmac/rg.h
src/5gnrmac/rg_ex_ms.c
src/5gnrmac/rg_lim.c
src/5gnrrlc/mac_stub.c
src/cm/du_app_mac_inf.c
src/cm/du_app_mac_inf.h
src/cm/legtp.c
src/cm/legtp.h
src/cm/lphy_stub.h
src/cm/rgu.c
src/du_app/du_cell_mgr.c
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_egtp.c
src/du_app/du_egtp.h
src/du_app/du_mgr.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c
src/du_app/du_sys_info_hdl.c
src/du_app/du_sys_info_hdl.h
src/phy_stub/l1_bdy2.c

diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c
new file mode 100644 (file)
index 0000000..9a9e3f1
--- /dev/null
@@ -0,0 +1,121 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+
+/* header include files -- defines (.h)  */
+#include "envopt.h"        /* environment options */
+#include "envdep.h"        /* environment dependent */
+#include "envind.h"        /* environment independent */
+#include "gen.h"           /* general layer */
+#include "ssi.h"           /* system services */
+#include "cm5.h"           /* common timers defines */
+#include "cm_hash.h"       /* common hash list defines */
+#include "cm_llist.h"      /* common linked list defines */
+#include "cm_mblk.h"       /* memory management */
+#include "cm_tkns.h"       /* common tokens */
+#include "cm_lte.h"        /* common tokens */
+#include "rgu.h"
+#include "tfu.h"
+#include "rg_sch_inf.h"
+#include "rg_env.h"
+#include "lrg.h"
+#include "crg.h"
+#include "rg.h"
+#include "du_log.h"
+
+/* header/extern include files (.x) */
+#include "gen.x"           /* general layer typedefs */
+#include "ssi.x"           /* system services typedefs */
+#include "cm5.x"           /* common timers */
+#include "cm_hash.x"       /* common hash list */
+#include "cm_lib.x"        /* common library */
+#include "cm_llist.x"      /* common linked list */
+#include "cm_mblk.x"       /* memory management */
+#include "cm_tkns.x"       /* common tokens */
+#include "cm_lte.x"        /* common tokens */
+#include "rgu.x"
+#include "tfu.x"
+#include "rg_sch_inf.x"
+#include "lrg.x"
+#include "crg.x"
+#include "rg_prg.x"
+#include "du_app_mac_inf.h"
+#include "rg.x"
+#include "fapi_interface.h"
+
+/* This file contains message handling functionality for MAC */
+
+/*******************************************************************
+ *
+ * @brief Handles cell start reuqest from DU APP
+ *
+ * @details
+ *
+ *    Function : MacHdlCellStartReq
+ *
+ *    Functionality:
+ *      Handles cell start reuqest from DU APP
+ *
+ * @params[in] Post structure pointer
+ *             Cell Start Request info pointer 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo  *cellStartInfo)
+{
+   DU_LOG("\nMAC : Handling cell start request");
+   //sendToLowerMac(START_REQ, 0, cellStartInfo);
+
+   MAC_FREE_MEM(pst->region, pst->pool, cellStartInfo, \
+          sizeof(MacCellStartInfo));
+
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles cell stop request from DU APP
+ *
+ * @details
+ *
+ *    Function : MacHdlCellStartReq
+ *
+ *    Functionality:
+ *        Handles cell stop request from DU APP
+ *
+ * @params[in] Post structure pointer
+ *             Mac Cell stop information
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo)
+{
+   DU_LOG("\nMAC : Handling cell start request");
+   //sendToLowerMac(STOP_REQ, 0, cellStopInfo);
+
+   MAC_FREE_MEM(pst->region, pst->pool, cellStopInfo, \
+          sizeof(MacCellStopInfo));
+   return ROK;
+}
+
+/**********************************************************************
+         End of file
+**********************************************************************/
+
diff --git a/src/5gnrmac/mac_upr_inf_api.c b/src/5gnrmac/mac_upr_inf_api.c
new file mode 100644 (file)
index 0000000..fb212da
--- /dev/null
@@ -0,0 +1,58 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+
+/* This file contains the definitions for Upper Interface APIs that are
+ * invoked from MAC */
+
+#include "mac_upr_inf_api.h"
+
+/* Funtion pointer options for slot indication */
+DuMacSlotInd packMacSlotIndOpts[] =
+{
+   packMacSlotInd,
+   duHandleSlotInd,
+   packMacSlotInd
+};
+
+/*******************************************************************
+ *
+ * @brief Send slot indication to MAC
+ *
+ * @details
+ *
+ *    Function : MacDuAppSlotInd
+ *
+ *    Functionality:
+ *       Select appropriate function using selector value and
+ *       send to MAC
+ *
+ * @params[in]  Post structure pointer
+ *              Slot info pointer 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t MacDuAppSlotInd(Pst *pst, SlotInfo *slotInfo)
+{
+   return (*packMacSlotIndOpts[pst->selector])(pst, slotInfo);
+}
+
+/**********************************************************************
+         End of file
+**********************************************************************/
+
diff --git a/src/5gnrmac/mac_upr_inf_api.h b/src/5gnrmac/mac_upr_inf_api.h
new file mode 100644 (file)
index 0000000..3730045
--- /dev/null
@@ -0,0 +1,53 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+
+/* This file contains the definitions for Upper Interface APIs that are
+ * invoked from MAC */
+
+/* header include files -- defines (.h)  */
+#include "envopt.h"        /* environment options */
+#include "envdep.h"        /* environment dependent */
+#include "envind.h"        /* environment independent */
+#include "gen.h"           /* general layer */
+#include "ssi.h"           /* system services */
+#include "cm5.h"           /* common timers defines */
+#include "cm_hash.h"       /* common hash list defines */
+#include "cm_llist.h"      /* common linked list defines */
+#include "cm_mblk.h"       /* memory management */
+#include "cm_tkns.h"       /* common tokens */
+#include "cm_lte.h"        /* common tokens */
+
+/* header/extern include files (.x) */
+#include "gen.x"           /* general layer typedefs */
+#include "ssi.x"           /* system services typedefs */
+#include "cm5.x"           /* common timers */
+#include "cm_hash.x"       /* common hash list */
+#include "cm_lib.x"        /* common library */
+#include "cm_llist.x"      /* common linked list */
+#include "cm_mblk.x"       /* memory management */
+#include "cm_tkns.x"       /* common tokens */
+#include "cm_lte.x"        /* common tokens */
+#include "du_app_mac_inf.h"
+
+
+uint16_t MacDuAppSlotInd(Pst *pst, SlotInfo *slotInfo);
+
+/**********************************************************************
+         End of file
+**********************************************************************/
+
index 571bd05..545aaf2 100755 (executable)
@@ -264,6 +264,12 @@ U32 macHeader[2];
       SPutSBuf(MAC_MEM_REGION, MAC_POOL,                     \
          (Data *)_datPtr, _size);
 
+/* Free shared memory, received through LWLC */
+#define MAC_FREE_MEM(_region, _pool, _datPtr, _size)         \
+   if(_datPtr)                                               \
+       SPutSBuf(_region, _pool,(Data *)_datPtr, _size);      \
+   _datPtr = NULL;
+
 #define RG_LCG_ISCFGD(lcg) ((lcg)->lcgId != RG_INVALID_LCG_ID)
 /* Corrected the check for dlCcchId */
 #define RG_DLCCCH_ISCFGD(cell) ((cell)->dlCcchId != RG_INVALID_LC_ID)
index 915d8bb..0e6caf2 100755 (executable)
@@ -133,6 +133,14 @@ Buffer  *mBuf;                      /* message buffer       */
          /* Process MAC cell config */
          unpackDuMacCellCfg(MacHdlCellCfgReq, pst, mBuf);
          break;
+      case EVENT_MAC_CELL_START_REQ:
+         /* Process MAC cell start request */
+         unpackMacCellStartReq(MacHdlCellStartReq, pst, mBuf);
+         break;
+      case EVENT_MAC_CELL_STOP_REQ:
+         /* Process MAC cell stop request */
+         unpackMacCellStopReq(MacHdlCellStopReq, pst, mBuf);
+         break;
       default:
          RG_FREE_MSG(mBuf);
          break;
index 4c177b1..def7ae8 100755 (executable)
@@ -76,10 +76,8 @@ static int RLOG_MODULE_ID=4096;
 #include "rg.x"            /* typedefs for MAC */
 
 #include "mac_sch_interface.h"
-/* local defines */
+#include "mac_upr_inf_api.h"
 
-/* local typedefs */
 /* local externs */
 PRIVATE S16  rgLIMValidateSap ARGS((Inst inst,SuId suId));
 PRIVATE Void rgLIMUtlFreeDatIndEvnt ARGS((TfuDatIndInfo *datInd,
@@ -633,6 +631,55 @@ int sendSlotIndMacToSch(SlotIndInfo *slotInd)
    return(*macSchSlotIndOpts[pst.selector])(&pst,slotInd);
 }
 
+
+/*******************************************************************
+ *
+ * @brief Send slot indication to DU APP
+ *
+ * @details
+ *
+ *    Function : sendSlotIndMacToDuApp
+ *
+ *    Functionality:
+ *       Send slot indication to DU APP
+ *
+ * @params[in] Slot indication info 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+int sendSlotIndMacToDuApp(SlotIndInfo *slotInd)
+{
+   Pst pst;
+   SlotInfo  *slotInfo;
+  
+   /* Send Slot Indication to DU APP */
+   MAC_ALLOC(slotInfo, sizeof(SlotInfo));
+   if(!slotInfo)
+   {
+      DU_LOG("\nMAC : Slot Indication memory allocation failed");
+      return RFAILED;
+   }
+
+   /* Fill Pst */
+   pst.selector  = DU_MAC_LWLC;
+   pst.srcEnt    = ENTRG;
+   pst.dstEnt    = ENTDUAPP;
+   pst.dstInst   = 0;
+   pst.srcInst   = 0;
+   pst.dstProcId = rgCb[pst.srcInst].rgInit.procId;
+   pst.srcProcId = rgCb[pst.srcInst].rgInit.procId;
+   pst.region = MAC_MEM_REGION;
+   pst.pool = MAC_POOL;
+   pst.event = EVENT_MAC_SLOT_IND;
+   pst.route = 0;
+   pst.prior = 0;
+   pst.intfVer = 0;
+   return MacDuAppSlotInd(&pst, slotInfo);
+  
+}
+
 /**
  * @brief Transmission time interval indication from PHY.
  *
@@ -659,6 +706,8 @@ SlotIndInfo         *slotInd
    VOLATILE U32     startTime=0;
    Inst             inst;
 
+   DU_LOG("\nMAC : Slot Indication received");
+   
    RG_IS_INST_VALID(pst->dstInst);
    inst = pst->dstInst - RG_INST_START;
    /*starting Task*/
@@ -668,7 +717,7 @@ SlotIndInfo         *slotInd
    ret = sendSlotIndMacToSch(slotInd);
    if(ret != ROK)
    {
-      DU_LOG("\nsending of slot ind msg from MAC to SCH failed");
+      DU_LOG("\nMAC : Sending of slot ind msg from MAC to SCH failed");
       RETVALUE(ret);
    }
 
@@ -676,10 +725,17 @@ SlotIndInfo         *slotInd
    ret = macProcessSlotInd(inst,*slotInd);
    if(ret != ROK)
    {
-      DU_LOG("\nmacProcessSlotInd failed");
+      DU_LOG("\nMAC : macProcessSlotInd failed");
       RETVALUE(ret);
    }
 
+   /* send slot indication to du app */
+   ret = sendSlotIndMacToDuApp(slotInd);
+   if(ret != ROK)
+   {
+      DU_LOG("\nMAC :Sending of slot ind msg from MAC to DU APP failed");
+      RETVALUE(ret);
+   }
 
    /*stoping Task*/
    SStopTask(startTime, PID_MAC_TTI_IND);
index bd0e1df..df05b99 100644 (file)
@@ -28,7 +28,7 @@ PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
   Pst rspPst;
   RlcMacSchedRep *schRep;
 
-  DU_LOG("\nMAC_STUB : Received BO status from RLC");
+  DU_LOG("\nMAC : Received BO status from RLC");
 
 //  SGetSBuf(pst->region, pst->pool, (Data **)&rspPst, sizeof(Pst));
 
@@ -51,7 +51,7 @@ PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
   schRep->lchSta[0].lchStaInd.lcId = boSta->lcId;
   schRep->lchSta[0].lchStaInd.totBufSize = boSta->bo + 5; /* Extra buffer space including RLC and MAC Header size */
 
-  DU_LOG("\nMAC_STUB : Sending scheduling report to RLC");
+  DU_LOG("\nMAC : Sending scheduling report to RLC");
   
   RlcMacProcSchedRep(&rspPst, 1, schRep);
 
index ee8bb95..1a00339 100644 (file)
@@ -53,7 +53,7 @@
  *         RFAILED - failure
  *
  ***************************************************************************/
-U16 packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+uint16_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
 {
    if(pst->selector == DU_SELECTOR_LC)
    {
@@ -135,7 +135,7 @@ void unpackDuMacCellCfg(
  *         RFAILED - failure
  *
  ***************************************************************************/
-U16 packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+uint16_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
 {
    if(pst->selector == DU_SELECTOR_LC)
    {
@@ -176,7 +176,7 @@ U16 packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
  *         RFAILED - failure
  *
  ***************************************************************************/
-U16 unpackMacCellCfgCfm(
+uint16_t unpackMacCellCfgCfm(
    DuMacCellCfgCfm func, 
    Pst *pst,
    Buffer *mBuf)
@@ -195,6 +195,244 @@ U16 unpackMacCellCfgCfm(
    {
       /* only loose coupling is suported */
    }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Send Cell Start Request to MAC
+ *
+ * @details
+ *
+ *    Function : packMacCellStartReq
+ *
+ *    Functionality:
+ *      Packs and Sends Cell Start Request to MAC
+ *
+ * @params[in] Post structure pointer
+ *             MacCellStartInfo pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo  *cellStartInfo)
+{
+   if(pst->selector == DU_SELECTOR_LC)
+   {
+      /* Loose coupling not supported */
+      return RFAILED;
+   }
+   else if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      Buffer *mBuf = NULLP;
+
+      if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
+         RETVALUE(RFAILED);
+      }
+
+      /* pack the address of the structure */
+      CMCHKPK(cmPkPtr,(PTR)cellStartInfo, mBuf);
+
+      return SPstTsk(pst,mBuf);
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks MAC Cell Start Request from DU APP
+ *
+ * @details
+ *
+ *    Function : unpackMaCellStartReq
+ *
+ *    Functionality:
+ *      Unpacks MAC Cell Start Request from DU APP
+ *
+ * @params[in] Function pointer of cell start request handler
+ *             Post structure pointer
+ *             Cell Start Request Info Pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf)
+{
+   MacCellStartInfo  *cellStartInfo;
+   if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      /* unpack the address of the structure */
+      CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStartInfo, mBuf);
+      SPutMsg(mBuf); 
+      return (*func)(pst, cellStartInfo);
+   }
+   else
+   {
+      /* Nothing to do for loose coupling */
+      SPutMsg(mBuf);
+      return ROK;
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Send cell stop request to MAC
+ *
+ * @details
+ *
+ *    Function : packMacCellStopReq
+ *
+ *    Functionality:
+ *       Packs and Send cell stop request to MAC
+ *
+ * @params[in] Post structure pointer
+ *             Cell stop info structure 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo)
+{
+   if(pst->selector == DU_SELECTOR_LC)
+   {
+      /* Loose coupling not supported */
+      return RFAILED;
+   }
+   else if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      Buffer *mBuf = NULLP;
+      if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nDU APP : Memory allocation failed for cell stop req pack");
+         RETVALUE(RFAILED);
+      }
+      /* pack the address of the structure */
+      CMCHKPK(cmPkPtr,(PTR)cellStopInfo, mBuf);
+
+      return SPstTsk(pst,mBuf);
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks cell stop request from DU APP 
+ *
+ * @details
+ *
+ *    Function : unpackMaCellStopReq 
+ *
+ *    Functionality:
+ *       Unpacks cell stop request from DU APP 
+ *
+ * @params[in] Handler function pointer
+ *             Post structure pointer
+ *             Message Buffer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf)
+{
+   MacCellStopInfo  *cellStopInfo;
+  
+   if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      /* unpack the address of the structure */
+      CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopInfo, mBuf);
+      SPutMsg(mBuf);
+      return (*func)(pst, cellStopInfo);
+   }
+   else
+   {
+      /* Nothing to do for loose coupling */
+      SPutMsg(mBuf);
+      return ROK;
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Sends slot ind from MAC to DUAPP
+ *
+ * @details
+ *
+ *    Function : packMacSlotInd
+ *
+ *    Functionality:
+ *       Packs and Sends slot ind from MAC to DUAPP
+ *
+ * @params[in] Post structure pointer
+ *             Slot Info pointer              
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo )
+{
+   if(pst->selector == DU_SELECTOR_LC || pst->selector == DU_SELECTOR_TC)
+   {
+      /* Loose coupling not supported */
+      DU_LOG("\nDU APP : Only LWLC supported");
+      return RFAILED;
+   }
+   else if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      Buffer *mBuf = NULLP;
+
+      if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
+         RETVALUE(RFAILED);
+      }
+      /* pack the address of the structure */
+      CMCHKPK(cmPkPtr,(PTR)slotInfo, mBuf);
+
+      return SPstTsk(pst,mBuf);
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks slot indication from MAC
+ *
+ * @details
+ *
+ *    Function : unpackMacSlotInd
+ *
+ *    Functionality:
+ *         Unpacks slot indication from MAC
+ *
+ * @params[in] Pointer to Handler
+ *             Post structure pointer
+ *             Message Buffer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
+{
+   SlotInfo *slotInfo;
+  
+   if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      /* unpack the address of the structure */
+      CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf);
+      SPutMsg(mBuf);
+      return (*func)(pst, slotInfo);
+   }
+   else
+   {
+      /* Nothing to do for loose coupling */
+      SPutMsg(mBuf);
+      return ROK;
+   }
    return ROK;
 }
 
index 08169a1..2f2a4e6 100644 (file)
 #define SEARCHSPACE_0_INDEX   0
 #define SIB1_MCS  4
 
+/* Macros for coupling */
+#define DU_MAC_LC  0
+#define DU_MAC_TC  1
+#define DU_MAC_LWLC  2
 
 /* Event IDs */
 #define EVENT_MAC_CELL_CONFIG_REQ    200
 #define EVENT_MAC_CELL_CONFIG_CFM    201
+#define EVENT_MAC_CELL_START_REQ     202
+#define EVENT_MAC_CELL_STOP_REQ      203
+#define EVENT_MAC_SLOT_IND           204
 
 typedef enum
 {
@@ -195,48 +202,70 @@ typedef struct macCellCfgCfm
    U16            transId;
 }MacCellCfgCfm;
 
-/* function pointers for packing macCellCfg Request */
-typedef U16 (*packMacCellCfgReq) ARGS((
+typedef struct slotInfo
+{
+   uint16_t sfn;
+   uint16_t slot;
+}SlotInfo;
+
+typedef struct macCellStartInfo
+{
+   uint16_t cellId;
+}MacCellStartInfo;
+
+typedef struct macCellStopInfo
+{
+   uint16_t cellId;
+}MacCellStopInfo;
+
+/* Functions for slot Ind from MAC to DU APP*/
+typedef uint16_t (*DuMacSlotInd) ARGS((
+   Pst       *pst,
+   SlotInfo  *slotInfo ));
+
+extern uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo );
+extern uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
+extern uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo);
+
+/* Functions for mac cell start req */
+typedef uint16_t (*DuMacCellStartReq) ARGS((
+   Pst               *pst, 
+   MacCellStartInfo  *cellStartInfo ));
+
+extern uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo  *cellStartInfo);
+extern uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf);
+extern uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo  *cellStartInfo);
+
+/* Functions for mac cell stop request */
+typedef uint16_t (*DuMacCellStopReq) ARGS((
+   Pst               *pst,
+   MacCellStopInfo  *cellStopInfo ));
+extern uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo);
+extern uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf);
+extern uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo);
+
+/* Function pointers for packing macCellCfg Request and Confirm */
+typedef uint16_t (*packMacCellCfgReq) ARGS((
    Pst           *pst,
-   MacCellCfg    *macCellCfg
-));
+   MacCellCfg    *macCellCfg ));
 
-typedef S16 (*packMacCellCfgConfirm) ARGS((
+typedef uint16_t (*packMacCellCfgConfirm) ARGS((
    Pst              *pst,
-   MacCellCfgCfm    *macCellCfgCfm
-));
-
-typedef S16 (*DuMacCellCfgReq)     ARGS((
-        Pst        *pst,               /* Post Structure */
-        MacCellCfg *macCellCfg         /* Config Structure */
-     ));
-
-typedef S16 (*DuMacCellCfgCfm)     ARGS((
-        MacCellCfgCfm *macCellCfgCfm         /* Config Structure */
-     ));
-
-U16 packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
-
-EXTERN int MacHdlCellCfgReq
-(
- Pst           *pst,
- MacCellCfg    *macCellCfg
-);
-
-void cmUnpackLwLcMacCellCfg(
-   DuMacCellCfgReq func,
-   Pst *pst,
-   Buffer *mBuf);
-
-U16 unpackMacCellCfgCfm(
-   DuMacCellCfgCfm func,
-   Pst *pst,
-   Buffer *mBuf);
-
-EXTERN S16 duHandleMacCellCfgCfm
-(
- MacCellCfgCfm    *macCellCfgCfm
-);
+   MacCellCfgCfm    *macCellCfgCfm ));
+
+typedef uint16_t (*DuMacCellCfgReq) ARGS((
+   Pst        *pst,        
+   MacCellCfg *macCellCfg));
+
+typedef uint16_t (*DuMacCellCfgCfm) ARGS((
+   MacCellCfgCfm *macCellCfgCfm ));
+
+extern uint16_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
+extern int MacHdlCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
+extern void cmUnpackLwLcMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
+extern uint16_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
+extern uint16_t duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm);
 
 #endif
 
index a1ba6b1..6d763d1 100644 (file)
@@ -27,7 +27,7 @@
  *
  * @details
  *
- *    Function : cmPkEgtpCfmStatus
+ *    Function : packEgtpCfmStatus
  *
  *    Functionality:
  *       Packs EGTP confirm status
@@ -38,7 +38,7 @@
  *         RFAILED - failure
  *
  ******************************************************************/
-S16 cmPkEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
+S16 packEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
 {
    SPkU16(cfm.status, mBuf);
    SPkU16(cfm.reason, mBuf);
@@ -52,7 +52,7 @@ S16 cmPkEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmUnpkEgtpCfmStatus
+ *    Function : unpackEgtpCfmStatus
  *
  *    Functionality:
  *       Packs EGTP confirm status
@@ -64,7 +64,7 @@ S16 cmPkEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
  *
  ******************************************************************/
 
-S16 cmUnpkEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
+S16 unpackEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
 {
    SUnpkU16(&(cfm->reason), mBuf);
    SUnpkU16(&(cfm->status), mBuf);
@@ -78,7 +78,7 @@ S16 cmUnpkEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpCfgReq 
+ *    Function : packEgtpCfgReq 
  *
  *    Functionality:
  *       Packs EGTP configuration
@@ -89,7 +89,7 @@ S16 cmUnpkEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
  *         RFAILED - failure
  *
  ******************************************************************/
-S16 cmPkEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
+S16 packEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
 {
    Buffer *mBuf;
 
@@ -126,7 +126,7 @@ S16 cmPkEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
  *
  * @details
  *
- *    Function : cmUnpkEgtpCfgReq
+ *    Function : unpackEgtpCfgReq
  *
  *    Functionality:
  *       Unpacks EGTP configuration
@@ -138,7 +138,7 @@ S16 cmPkEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
  *         RFAILED - failure
  *
  * ****************************************************************/
-S16 cmUnpkEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
+S16 unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
 {
    EgtpConfig egtpCfg;
 
@@ -173,7 +173,7 @@ S16 cmUnpkEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpCfgCfm
+ *    Function : packEgtpCfgCfm
  *
  *    Functionality:
  *       Packs EGTP configuration result
@@ -185,7 +185,7 @@ S16 cmUnpkEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
  *
  ******************************************************************/
 
-S16 cmPkEgtpCfgCfm(Pst *pst, CmStatus cfm)
+S16 packEgtpCfgCfm(Pst *pst, CmStatus cfm)
 {
    Buffer *mBuf;
   
@@ -195,7 +195,7 @@ S16 cmPkEgtpCfgCfm(Pst *pst, CmStatus cfm)
       RETVALUE(RFAILED);
    }
  
-   cmPkEgtpCfmStatus(cfm, mBuf); 
+   packEgtpCfmStatus(cfm, mBuf); 
    SPstTsk(pst, mBuf); 
    RETVALUE(ROK); 
 }
@@ -206,7 +206,7 @@ S16 cmPkEgtpCfgCfm(Pst *pst, CmStatus cfm)
  *
  * @details
  *
- *    Function : cmUnpkEgtpCfgCfm
+ *    Function : unpackEgtpCfgCfm
  *
  *    Functionality:
  *       Unpacks EGTP configuration result
@@ -218,12 +218,12 @@ S16 cmPkEgtpCfgCfm(Pst *pst, CmStatus cfm)
  *
  ******************************************************************/
  
-S16 cmUnpkEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
+S16 unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
 {
    CmStatus cfm;
    
    cmMemset((U8 *)&cfm, 0, sizeof(CmStatus));
-   cmUnpkEgtpCfmStatus(&cfm, mBuf);
+   unpackEgtpCfmStatus(&cfm, mBuf);
 
    RETVALUE((*func)(cfm));
 }
@@ -234,7 +234,7 @@ S16 cmUnpkEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpSrvOpenReq
+ *    Function : packEgtpSrvOpenReq
  *
  *    Functionality:
  *       Packs EGTP server open request
@@ -244,7 +244,7 @@ S16 cmUnpkEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
  *         RFAILED - failure
  *
   *******************************************************************/ 
-S16 cmPkEgtpSrvOpenReq(Pst *pst)
+S16 packEgtpSrvOpenReq(Pst *pst)
 {
    Buffer *mBuf;
  
@@ -264,7 +264,7 @@ S16 cmPkEgtpSrvOpenReq(Pst *pst)
  *
  * @details
  *
- *    Function : cmUnpkEgtpSrvOpenReq
+ *    Function : unpackEgtpSrvOpenReq
  *
  *    Functionality:
  *       Unpacks EGTP server open req
@@ -275,7 +275,7 @@ S16 cmPkEgtpSrvOpenReq(Pst *pst)
  *         RFAILED - failure
  *
  ******************************************************************/
-S16 cmUnpkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
+S16 unpackEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
 {
     RETVALUE((*func)(pst));
 }
@@ -287,7 +287,7 @@ S16 cmUnpkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpSrvOpenCfm
+ *    Function : packEgtpSrvOpenCfm
  *
  *    Functionality:
  *       Packs EGTP server open confirm
@@ -297,7 +297,7 @@ S16 cmUnpkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
  *         RFAILED - failure
  *
  *******************************************************************/
-S16 cmPkEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
+S16 packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
 {
    Buffer *mBuf;
  
@@ -307,7 +307,7 @@ S16 cmPkEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
       RETVALUE(RFAILED);
    }
  
-   cmPkEgtpCfmStatus(cfm, mBuf); 
+   packEgtpCfmStatus(cfm, mBuf); 
    SPstTsk(pst, mBuf);
    RETVALUE(ROK);
 
@@ -319,7 +319,7 @@ S16 cmPkEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
  *
  * @details
  *
- *    Function : cmUnpkEgtpSrvOpenCfm
+ *    Function : unpackEgtpSrvOpenCfm
  *
  *    Functionality:
  *       Unpacks EGTP server open confirm
@@ -330,12 +330,12 @@ S16 cmPkEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
  *         RFAILED - failure
  *
  *******************************************************************/
-S16 cmUnpkEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
+S16 unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
 {
    CmStatus cfm;
     
    cmMemset((U8 *)&cfm, 0, sizeof(CmStatus));
-   cmUnpkEgtpCfmStatus(&cfm, mBuf);
+   unpackEgtpCfmStatus(&cfm, mBuf);
 
    RETVALUE((*func)(cfm));
 }
@@ -346,7 +346,7 @@ S16 cmUnpkEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpTnlMgmtReq
+ *    Function : packEgtpTnlMgmtReq
  *
  *    Functionality:
  *       Packs EGTP tunnel management request
@@ -359,7 +359,7 @@ S16 cmUnpkEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
  *         RFAILED - failure
  *
  *******************************************************************/
-S16 cmPkEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
+S16 packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
 {
    Buffer *mBuf;
 
@@ -384,7 +384,7 @@ S16 cmPkEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
  *
  * @details
  *
- *    Function : cmUnpkEgtpTnlMgmtReq
+ *    Function : unpackEgtpTnlMgmtReq
  *
  *    Functionality:
  *       Unpacks EGTP tunnel management request
@@ -396,7 +396,7 @@ S16 cmPkEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
  *         RFAILED - failure
  * 
  * *******************************************************************/
-S16 cmUnpkEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
+S16 unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
 {
    EgtpTnlEvt tnlEvt;
 
@@ -416,7 +416,7 @@ S16 cmUnpkEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
  *
  * @details
  *
- *    Function : cmPkEgtpTnlMgmtCfm
+ *    Function : packEgtpTnlMgmtCfm
  *
  *    Functionality:
  *      Packs EGTP tunnel management cfm
@@ -429,7 +429,7 @@ S16 cmUnpkEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
  *
  ********************************************************************/
 
-S16 cmPkEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
+S16 packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
 {
    Buffer *mBuf;
 
@@ -443,7 +443,7 @@ S16 cmPkEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
    SPkU32(tnlEvt.lclTeid, mBuf);
    SPkU32(tnlEvt.remTeid, mBuf);
    
-   cmPkEgtpCfmStatus(tnlEvt.cfmStatus, mBuf);
+   packEgtpCfmStatus(tnlEvt.cfmStatus, mBuf);
     
    SPstTsk(pst, mBuf);
    RETVALUE(ROK);
@@ -456,7 +456,7 @@ S16 cmPkEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
  *
  * @details
  *
- *    Function : cmUnpkEgtpTnlMgmtCfm
+ *    Function : unpackEgtpTnlMgmtCfm
  *
  *    Functionality:
  *       Unpacks EGTP tunnel management confirm
@@ -468,13 +468,13 @@ S16 cmPkEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
  *         RFAILED - failure
  * 
  * *******************************************************************/
-S16 cmUnpkEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
+S16 unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
 {
    EgtpTnlEvt tnlEvt;
  
    cmMemset((U8 *)&tnlEvt, 0, sizeof(EgtpTnlEvt));
 
-   cmUnpkEgtpCfmStatus(&(tnlEvt.cfmStatus), mBuf); 
+   unpackEgtpCfmStatus(&(tnlEvt.cfmStatus), mBuf); 
    SUnpkU32(&(tnlEvt.remTeid), mBuf);
    SUnpkU32(&(tnlEvt.lclTeid), mBuf);
    SUnpkU8(&(tnlEvt.action), mBuf);
@@ -485,21 +485,21 @@ S16 cmUnpkEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
 
 /*******************************************************************
  *
- * @brief Packs TTI indication and sends to EGTP
+ * @brief Packs Slot indication and sends to EGTP
  *
  * @details
  *
- *    Function : cmPkEgtpTTIInd
+ *    Function : packEgtpSlotInd
  *
  *    Functionality:
- *       Packs TTI indication and sends tp EGTP
+ *       Packs slot indication and sends tp EGTP
  *
  * @params[in] Post structure
  * @return ROK     - success
  *         RFAILED - failure
  *
  *******************************************************************/
-S16 cmPkEgtpTTIInd(Pst *pst)
+S16 packEgtpSlotInd(Pst *pst)
 {
    Buffer *mBuf;
 
@@ -516,21 +516,21 @@ S16 cmPkEgtpTTIInd(Pst *pst)
 
 /*******************************************************************
  *
- * @brief Unpacks TTI indication
+ * @brief Unpacks slot indication
  *
  * @details
  *
- *    Function : cmUnpkEgtpTTIInd
+ *    Function : unpackEgtpSlotInd
  *
  *    Functionality:
- *       Unpacks TTI indication
+ *       Unpacks slot indication
  *
  * @params[in]
  * @return ROK     - success
  *         RFAILED - failure
  *
 ******************************************************************/
-S16 cmUnpkEgtpTTIInd(EgtpTTIInd func, Pst *pst, Buffer *mBuf)
+S16 unpackEgtpSlotInd(EgtpSlotInd func, Pst *pst, Buffer *mBuf)
 {
     RETVALUE((*func)());
 }
index f77b401..dfbf4ee 100644 (file)
@@ -94,21 +94,21 @@ typedef S16 (*EgtpSrvOpenReq) ARGS(());
 typedef S16 (*EgtpSrvOpenCfm) ARGS((CmStatus cfm));
 typedef S16 (*EgtpTnlMgmtReq) ARGS((Pst *pst, EgtpTnlEvt tnlEvt));
 typedef S16 (*EgtpTnlMgmtCfm) ARGS((EgtpTnlEvt tnlEvt));
-typedef S16 (*EgtpTTIInd) ARGS(());
+typedef S16 (*EgtpSlotInd) ARGS(());
   
-S16 cmPkEgtpCfgReq(Pst *pst, EgtpConfig  egtpCfg);
-S16 cmUnpkEgtpCfgReq(EgtpCfgReq func , Pst *pst, Buffer *mBuf);
-S16 cmPkEgtpCfgCfm(Pst *pst, CmStatus cfm);
-S16 cmUnpkEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf);
-S16 cmPkEgtpSrvOpenReq(Pst *pst);
-S16 cmUnpkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf);
-S16 cmPkEgtpSrvOpenCfm(Pst *pst, CmStatus cfm);
-S16 cmUnpkEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf);
-S16 cmPkEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt);
-S16 cmUnpkEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf);
-S16 cmPkEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt);
-S16 cmUnpkEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf);
-S16 cmPkEgtpTTIInd(Pst *pst);
-S16 cmUnpkEgtpTTIInd(EgtpTTIInd func, Pst *pst, Buffer *mBuf);
+S16 packEgtpCfgReq(Pst *pst, EgtpConfig  egtpCfg);
+S16 unpackEgtpCfgReq(EgtpCfgReq func , Pst *pst, Buffer *mBuf);
+S16 packEgtpCfgCfm(Pst *pst, CmStatus cfm);
+S16 unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf);
+S16 packEgtpSrvOpenReq(Pst *pst);
+S16 unpackkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf);
+S16 packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm);
+S16 unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf);
+S16 packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt);
+S16 unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf);
+S16 packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt);
+S16 unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf);
+S16 packEgtpSlotInd(Pst *pst);
+S16 unpackEgtpSlotInd(EgtpSlotInd func, Pst *pst, Buffer *mBuf);
 
 #endif
index 25f69f8..67a3a2f 100644 (file)
@@ -10,4 +10,4 @@
 #include "ssi.x"   /* System services */
 
 void duStartTtiThread();
-S16 duSendEgtpTTIInd();
+S16 duSendEgtpSlotInd();
index 25cd9ff..f764545 100755 (executable)
@@ -2702,7 +2702,7 @@ Buffer *mBuf;
 
    for (i=param->nmbPdu-1; i >= 0; i--)
    {
-      MsgLen msgLen = 0;
+      msgLen = 0;
       if (SFndLenMsg(param->pduInfo[i].pduBuf, &msgLen) != ROK)
          RETVALUE(RFAILED);
       if (SCatMsg(mBuf, param->pduInfo[i].pduBuf, M1M2) != ROK)
@@ -2762,7 +2762,7 @@ Buffer *mBuf;
 
       CMCHKUNPK(cmUnpkBool, &param->pduInfo[i].commCh, mBuf);
       CMCHKUNPK(cmUnpkLteLcId, &param->pduInfo[i].lcId, mBuf);
-      CMCHKUNPK(cmPkMsgLen, &param->pduInfo[i].pduLen, mBuf);
+      CMCHKUNPK(cmUnpkMsgLen, &param->pduInfo[i].pduLen, mBuf);
       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
          RETVALUE(RFAILED);
       if (SSegMsg(mBuf, totalMsgLen-param->pduInfo[i].pduLen, &param->pduInfo[i].pduBuf) != ROK)
@@ -3155,7 +3155,6 @@ RlcMacSchedRep *param;
 Buffer *mBuf;
 #endif
 {
-   S32 i;
    S32 idx;
 
    TRC3(packSchedRepInfo);
@@ -3203,7 +3202,6 @@ RlcMacSchedRep *param;
 Buffer *mBuf;
 #endif
 {
-   S32 i;
    S32 idx;
 
    TRC3(unpackSchedRepInfo);
index 1af02ed..522801e 100644 (file)
@@ -16,7 +16,7 @@
 ################################################################################
 *******************************************************************************/
 
-/* This file contains message handling functionality for DU APP */
+/* This file contains message handling functionality for DU cell management */
 #include "du_cell_mgr.h"
 
 extern DuCfgParams duCfgParam;
@@ -76,7 +76,7 @@ S16 procCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
       cellCb->cellInfo.nrPci = pci;
 
       /* Now remove this cell from configured list and move to active list */
-      duCb.cfgCellLst[nci-1] = NULLP;
+      duCb.cfgCellLst[nci-1] = NULL;
       duCb.actvCellLst[nci-1] = cellCb;
 
       /* Build and send Mac Cell Cfg for the number of active cells */
index f67ef9e..f435a1c 100644 (file)
 #include "du_mgr.h"
 #include "du_sys_info_hdl.h"
 #include "MIB.h"
+#include "SearchSpace.h"
+#include "SIB-TypeInfo.h"
+#include "SchedulingInfo.h"
+#include "SI-SchedulingInfo.h"
+#include "ConnEstFailureControl.h"
 #include "PLMN-IdentityInfo.h"
 #include "odu_common_codec.h"
+#include "PDSCH-TimeDomainResourceAllocation.h"
+#include "BCCH-Config.h"
+#include "PagingCycle.h"
+#include "PCCH-Config.h"
+#include "TimeAlignmentTimer.h"
+#include "RACH-ConfigGeneric.h"
+#include "PUSCH-TimeDomainResourceAllocation.h"
+#include "PUCCH-ConfigCommon.h"
+#include "SubcarrierSpacing.h"
+#include "TDD-UL-DL-Pattern.h"
+#include "RACH-ConfigCommon.h"
+#include "BWP-DownlinkCommon.h"
+#include "BWP-UplinkCommon.h"
 
 extern DuCfgParams duCfgParam;
 extern char encBuf[ENC_BUF_MAX_LEN];
@@ -141,7 +159,7 @@ S16 readMacCfg()
    duCfgParam.macCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
    duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A;
    duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
-   duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
+   duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITY;
    duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
    duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
    duCfgParam.macCellCfg.ssbCfg.ssbMask[1] = 0;
@@ -234,6 +252,145 @@ S16 fillDuPort(U16 *duPort)
 
 
 
+/*******************************************************************
+ *
+ * @brief Configures serving cell config common in sib1
+ *
+ * @details
+ *
+ *    Function : fillServCellCfgCommSib
+ *
+ *    Functionality:
+ *       - fills Serving cell config common for SIB1
+ *
+ * @params[in] SrvCellCfgCommSib pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ * 
+ ** ****************************************************************/
+S16 fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
+{
+   PdcchCfgCommon   pdcchCfg;
+   PdschCfgCommon   pdschCfg;
+   PcchCfg          pcchCfg;
+   RachCfgCommon    rachCfg;
+   PuschCfgCommon   puschCfg;
+   PucchCfgCommon   pucchCfg;
+   TddUlDlCfgCommon   tddCfg;
+
+   /* Configuring DL Config Common for SIB1*/
+   srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND_IND; 
+   srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A;
+   srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
+   srvCellCfgComm->dlCfg.dlScsCarrier.scs = SUBCARRIER_SPACING;
+   srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = SCS_CARRIER_BANDWIDTH;
+   srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW;
+   
+   /* Configuring PDCCH Config Common For SIB1 */
+   pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup;
+   pdcchCfg.ctrlRsrcSetZero = PDCCH_CTRL_RSRC_SET_ZERO;
+   pdcchCfg.searchSpcZero = PDCCH_SEARCH_SPACE_ZERO;
+   pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
+   pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
+   pdcchCfg.monitorSlotPrdAndOffPresent = \
+      SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
+   //pdcchCfg.monitorSlotPrdAndOff = \
+      SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
+   pdcchCfg.monitorSymbolsInSlot[0] = 128;
+   pdcchCfg.monitorSymbolsInSlot[1] = 0;
+   pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8;
+   pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4;
+   pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2;
+   pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1;
+   pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0;
+   pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common;
+   pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT;
+   pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1;
+   pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
+   pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
+   srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg;
+
+   /* Configuring PDSCH Config Common For SIB1 */
+   pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup;
+   pdschCfg.k0 = PDSCH_K0;
+   pdschCfg.mapType = \
+      PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
+   pdschCfg.startSymbAndLen = PDSCH_START_SYMB_AND_LEN;
+   srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
+
+   /* Configuring BCCH Config for SIB1 */
+   srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = \
+      BCCH_Config__modificationPeriodCoeff_n16;
+
+   /* Configuring PCCH Config for SIB1 */
+   pcchCfg.dfltPagingCycle = PagingCycle_rf64;
+   pcchCfg.nAndPagingFrmOffPresent = PCCH_Config__nAndPagingFrameOffset_PR_oneT;
+   pcchCfg.numPagingOcc = PCCH_Config__ns_four;
+   srvCellCfgComm->dlCfg.pcchCfg = pcchCfg;
+
+
+   /* Configuring UL Config Common */
+   srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
+   srvCellCfgComm->ulCfg.ulScsCarrier.scs = SUBCARRIER_SPACING;
+   srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = SCS_CARRIER_BANDWIDTH;
+   srvCellCfgComm->ulCfg.pMax = UL_P_MAX;
+   srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW;
+   srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity;
+
+   /* Configuring RACH Config Common for SIB1 */
+   rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup;
+   rachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
+   rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one;
+   rachCfg.msg1FreqStart = PRACH_FREQ_START;
+   rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
+   rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR;
+   rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200;
+   rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2;
+   rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl20;
+   rachCfg.numRaPreamble = NUM_RA_PREAMBLE;
+   rachCfg.ssbPerRachOccPresent = \
+      RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one;
+   rachCfg.numSsbPerRachOcc = SSB_PER_RACH;
+   rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64;
+   rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
+   rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
+   rachCfg.rootSeqIdx = ROOT_SEQ_IDX;
+   rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ;
+   rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG;
+   srvCellCfgComm->ulCfg.rachCfg = rachCfg;
+
+   /* Configuring PUSCH Config Common for SIB1 */
+   puschCfg.present = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
+   puschCfg.k2 = PUSCH_K0;
+   puschCfg.mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
+   puschCfg.startSymbAndLen = PUSCH_START_SYMB_AND_LEN;
+   puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
+   puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
+   srvCellCfgComm->ulCfg.puschCfg = puschCfg;
+
+   /* Configuring PUCCH Config Common for SIB1 */
+   pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup;
+   pucchCfg.rsrcComm = PUCCH_RSRC_COMMON;
+   pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither;
+   pucchCfg.p0Nominal = PUCCH_P0_NOMINAL;
+   srvCellCfgComm->ulCfg.pucchCfg = pucchCfg;
+
+   /* Configuring TDD UL DL config common */
+   tddCfg.refScs = SubcarrierSpacing_kHz30;
+   tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms2p5;
+   tddCfg.numDlSlots = NUM_DL_SLOTS;
+   tddCfg.numDlSymbols = NUM_DL_SYMBOLS;
+   tddCfg.numUlSlots = NUM_UL_SLOTS;
+   tddCfg.numUlSymbols = NUM_UL_SYMBOLS;
+   srvCellCfgComm->tddCfg = tddCfg;
+
+   srvCellCfgComm->ssbPosInBurst = 192;
+   srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY;
+   srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR;
+
+   return ROK;
+}
+
 /*******************************************************************
  *
  * @brief Configures the DU Parameters
@@ -311,8 +468,20 @@ S16 readCfg()
        sib1.tac = DU_TAC;
        sib1.ranac = DU_RANAC;
        sib1.cellIdentity = CELL_IDENTITY;
-       sib1.cellResvdForOpUse = 
+       sib1.cellResvdForOpUse =\
                PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
+   sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
+   sib1.connEstFailOffValidity =\
+      ConnEstFailureControl__connEstFailOffsetValidity_s120;
+   sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
+   sib1.siSchedInfo.broadcastSta = \
+      SchedulingInfo__si_BroadcastStatus_broadcasting;
+   sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
+   sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
+   sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
+
+   fillServCellCfgCommSib(&sib1.srvCellCfgCommSib);
+
        duCfgParam.sib1Params = sib1;
 
    for(i=0; i<DEFAULT_CELLS; i++)
index 2580cc4..9e8b124 100644 (file)
 #define NR_ARFCN  2079427
 #define SUL_ARFCN 100
 #define NR_FREQ_BAND 257
+#define NR_FREQ_BAND_IND 78
 #define SUL_BAND 2
 #define TIME_CFG 0
 #define CARRIER_IDX 1
 #define NUM_TX_ANT 2
 #define NUM_RX_ANT 2
 #define FREQ_SHIFT_7P5KHZ FALSE
-#define SSB_PBCH_PWR 0
+#define SSB_PBCH_PWR -5
 #define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
-#define SUBCARRIER_SPACING 15
-#define OFFSET_TO_POINT_A 0
-#define BETA_PSS BETA_PSS_0DB
-#define SSB_PERIODICITTY 20
-#define SSB_SUBCARRIER_OFFSET 0
+#define SUBCARRIER_SPACING 1
+#define SCS_CARRIER_BANDWIDTH 273         /* Subcarrier spacing- carrier bandwidth */
+#define OFFSET_TO_POINT_A 24                     /* PRB Offset to Point A */
+#define BETA_PSS BETA_PSS_0DB  
+#define SSB_PERIODICITY 2
+#define SSB_SUBCARRIER_OFFSET 0               
 #define SSB_MULT_CARRIER_BAND FALSE
 #define MULT_CELL_CARRIER FALSE
+#define FREQ_LOC_BW  1099              /* DL frequency location and bandwidth */
+#define UL_P_MAX  23
 #define BANDWIDTH 20
 
+/* MACRO defines for PRACH Configuration */
+#define PRACH_CONFIG_IDX   147
+#define PRACH_FREQ_START   0
 #define PRACH_SEQ_LEN SHORT_SEQUENCE
-#define PRACH_SUBCARRIER_SPACING 3
-#define PRACH_RESTRICTED_SET_CFG UNRESTRICTED
+#define PRACH_SUBCARRIER_SPACING 1
+#define PRACH_RESTRICTED_SET_CFG 0
 #define NUM_PRACH_FDM 1
 #define ROOT_SEQ_IDX 0
 #define NUM_ROOT_SEQ 1
-#define ZERO_CORRELATION_ZONE_CFG 2
+#define ZERO_CORRELATION_ZONE_CFG 6
 #define NUM_UNUSED_ROOT_SEQ 1
 #define UNUSED_ROOT_SEQ 1
-#define SSB_PER_RACH 3
+#define SSB_PER_RACH 0
 #define PRACH_MULT_CARRIER_BAND FALSE
+#define PRACH_PREAMBLE_RCVD_TGT_PWR  -74   
+#define NUM_RA_PREAMBLE  63
+#define RSRP_THRESHOLD_SSB   31
 #define TDD_PERIODICITY TX_PRDCTY_MS_2P5
 #define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
 
+
+/* MACRCO Ddefine for PDCCH Configuration */
+#define PDCCH_CTRL_RSRC_SET_ZERO   13   /* Control resouce set zero */
+#define PDCCH_SEARCH_SPACE_ZERO    0    /* Search space zero */
+#define PDCCH_SEARCH_SPACE_ID      1    /* Common search space id */
+#define PDCCH_CTRL_RSRC_SET_ID     0    /* Control resource set id */
+#define PDCCH_SEARCH_SPACE_ID_SIB1 0    /* Search space id for sib1 */
+#define PDCCH_SEARCH_SPACE_ID_PAGING 1  /* Search space id for paging */
+#define PDCCH_SEARCH_SPACE_ID_RA   1    /* Search spaced id for random access */
+#define PDCCH_SERACH_SPACE_DCI_FORMAT 0
+#define SIB1_VALUE_TAG 10
+
+/* MACRCO Ddefine for PDSCH Configuration */
+#define PDSCH_K0  0
+#define PDSCH_START_SYMB_AND_LEN 53    
+
+/* MACRO Define for PUSCH Configuration */
+#define PUSCH_K0  3
+#define PUSCH_START_SYMB_AND_LEN 55
+#define PUSCH_MSG3_DELTA_PREAMBLE 0
+#define PUSCH_P0_NOMINAL_WITH_GRANT -70
+
+/* Macro define for PUCCH Configuration */
+#define PUCCH_RSRC_COMMON  0
+#define PUCCH_P0_NOMINAL   -74
+
+/* MACRO defines for TDD DL-UL Configuration */
+#define NUM_DL_SLOTS 3
+#define NUM_DL_SYMBOLS 12
+#define NUM_UL_SLOTS 1
+#define NUM_UL_SYMBOLS 0
+
 #define DU_PROC  0
 #define DU_INST 0
 #define DU_POOL  1
@@ -885,6 +927,149 @@ typedef struct mibParams
        long    intraFreqReselection;
 }MibParams;
 
+typedef struct siSchedInfo
+{
+   long     winLen;         /* SI Window Length */
+   long     broadcastSta;   /* Broadcast status */
+   long     preiodicity;    /* si periodicity */
+   long     sibType;
+   long     sibValTag;      /* Value tag */
+}SiSchedInfo;
+
+typedef struct pdcchCfgCommon
+{
+   uint8_t  present;
+   long     ctrlRsrcSetZero;  /* Control resource set zero */
+   long     searchSpcZero;    /* Search space zero */
+   long     searchSpcId;      /* Search space id */
+   long     ctrlRsrcSetId;    /* Control resource set id */
+   uint8_t  monitorSlotPrdAndOffPresent;
+   long     monitorSlotPrdAndOff;     /* Monitoring slot periodicity and offset */
+   uint8_t  monitorSymbolsInSlot[2];  /* Monitoring symbols within slot */
+   long     numCandAggLvl1;        /* Number of candiates at aggregation level 1 */
+   long     numCandAggLvl2;        /* Number of candiates at aggregation level 2 */
+   long     numCandAggLvl4;        /* Number of candiates at aggregation level 4 */
+   long     numCandAggLvl8;        /* Number of candiates at aggregation level 8 */
+   long     numCandAggLvl16;       /* Number of candiates at aggregation level 16 */
+   uint8_t  searchSpcType;        /*  Search Space type */
+   uint8_t  commSrchSpcDciFrmt;    /* DCI format of common search space type */
+   long     searchSpcSib1;         /* Id of serch space for SIB1 */
+   long     pagingSearchSpc;       /* Id of search space for paging */
+   long     raSearchSpc;           /* Id of search space for Random Access proc */
+}PdcchCfgCommon;
+
+typedef struct pdschCfgCommon
+{
+   uint8_t  present;
+   long   k0;
+   long   mapType;              /* Mapping Type */
+   long   startSymbAndLen;      /* Start Symbol and Length */
+}PdschCfgCommon;
+
+typedef struct bcchCfg
+{
+   long   modPrdCoeff;          /* Modification period co-efficient */
+}BcchCfg;
+
+typedef struct pcchCfg
+{
+   long   dfltPagingCycle;      /* Default paging cycle */
+   long   nAndPagingFrmOffPresent;
+   long   nAndPagingFrmOff;     /* n and Paging Frame offset */
+   long   numPagingOcc;         /* Number of paging occassions in paging frame */
+}PcchCfg;
+
+typedef struct scsSpecCarrier
+{
+    long   scsOffset;    /* Offset to point A considering subcarrier spacing */
+    long   scs;          /* subcarrier spacing */
+    long   scsBw;        /* Carrier bandwidth considering subcarrier spacing */
+
+}ScsSpecCarrier;
+
+typedef struct dlCfgCommon
+{
+   long   freqBandInd;  /* Downlink frequency band indicator */
+   long   offsetToPointA;       /* DL ofset to point A */
+   long   locAndBw;     /* Frequency location and bandwidth */
+   ScsSpecCarrier   dlScsCarrier;  /* SCS Specific carrier */
+   PdcchCfgCommon   pdcchCfg;
+   PdschCfgCommon   pdschCfg;
+   BcchCfg          bcchCfg;
+   PcchCfg          pcchCfg;
+}DlCfgCommon;
+
+typedef struct rachCfgCommon
+{
+   uint8_t present;
+   long   prachCfgIdx;       /* PRACH configuration index */
+   long   msg1Fdm;           /* Num of PRACH transmission occassions */
+   long   msg1FreqStart;     /* Offset of lowest msg1 transmission occassion */
+   long   zeroCorrZoneCfg;   /* Zero correlation zone configuration */
+   long   preambleRcvdTgtPwr; /* Traget power level */
+   long   preambleTransMax;  /* Max num of preamble transmission */
+   long   pwrRampingStep;    /* Power ramping steps for PRACH */
+   long   raRspWindow;       /* RA response window */
+   long   numRaPreamble;     /* Total num of preamble used in random access */
+   uint8_t ssbPerRachOccPresent;
+   long   numSsbPerRachOcc;  /* Numer of SSBs per RACH Occassion */
+   long   contResTimer;      /* Contention resolution timer */
+   long   rsrpThreshSsb;
+   uint8_t rootSeqIdxPresent;
+   long   rootSeqIdx;        /* PRACH root sequence index */
+   long   msg1Scs;           /* Msg1 subcarrier spacing */
+   long   restrictedSetCfg;  /* Restricted set configuration */
+}RachCfgCommon;
+
+typedef struct  puschCfgCommon
+{
+   uint8_t present;
+   long   k2;
+   long   mapType;
+   long   startSymbAndLen;
+   long   msg3DeltaPreamble;
+   long   p0NominalWithGrant;
+}PuschCfgCommon;
+
+typedef struct pucchCfgCommon
+{
+   uint8_t present;
+   long   rsrcComm;
+   long   grpHop;
+   long   p0Nominal;
+}PucchCfgCommon;
+
+typedef struct ulCfgCommon
+{
+   long   pMax;         /* Max UL transmission power that UE applies */
+   long   locAndBw;     /* Frequency location and bandwidth */
+   ScsSpecCarrier   ulScsCarrier; /* SCS Specific carrier */
+   RachCfgCommon    rachCfg;
+   PuschCfgCommon   puschCfg;
+   PucchCfgCommon   pucchCfg;
+   long   timeAlignTimerComm;
+}UlCfgCommon;
+
+typedef struct tddUlDlCfgCommon
+{
+   long   refScs;     /* Reference subcarrier spacing */
+   long   txPrd;      /* Transmission periodicity */
+   long   numDlSlots;
+   long   numDlSymbols;
+   long   numUlSlots;
+   long   numUlSymbols;
+}TddUlDlCfgCommon;
+
+typedef struct srvCellCfgCommSib
+{ 
+   DlCfgCommon        dlCfg;
+   UlCfgCommon        ulCfg;
+   uint8_t            ssbPosInBurst;
+   long               ssbPrdServingCell;
+   TddUlDlCfgCommon   tddCfg;
+   long               ssPbchBlockPwr;
+}SrvCellCfgCommSib;
+
 typedef struct sib1Params
 {
        Plmn    plmn;
@@ -892,6 +1077,10 @@ typedef struct sib1Params
        long      ranac;
        uint8_t   cellIdentity;
        long      cellResvdForOpUse;
+   long      connEstFailCnt;
+   long      connEstFailOffValidity;
+   SiSchedInfo           siSchedInfo;
+   SrvCellCfgCommSib     srvCellCfgCommSib;
 }Sib1Params;
 
 typedef struct duCfgParams
index e3d8d2e..120085b 100644 (file)
@@ -52,7 +52,7 @@ S16 egtpActvInit(Ent entity, Inst inst, Region region, Reason reason)
   cmMemset ((U8 *)&egtpCb, 0, sizeof(EgtpGlobalCb));
   protType = CM_INET_PROTO_UDP;
 
-  RETVALUE(ROK);
+  return ROK;
 }
 
 
@@ -87,22 +87,22 @@ S16 egtpActvTsk(Pst *pst, Buffer *mBuf)
          {
             case EVTCFGREQ:
             {
-               ret = cmUnpkEgtpCfgReq(egtpCfgReq, pst, mBuf);
+               ret = unpackEgtpCfgReq(egtpCfgReq, pst, mBuf);
                break;
             }
             case EVTSRVOPENREQ:
             {
-               ret = cmUnpkEgtpSrvOpenReq(egtpSrvOpenReq, pst, mBuf);
+               ret = unpackEgtpSrvOpenReq(egtpSrvOpenReq, pst, mBuf);
                break;
             }
             case EVTTNLMGMTREQ:
             {
-               ret = cmUnpkEgtpTnlMgmtReq(egtpTnlMgmtReq, pst, mBuf);
+               ret = unpackEgtpTnlMgmtReq(egtpTnlMgmtReq, pst, mBuf);
                break;
             }
-            case EVTTTIIND:
+            case EVTSLOTIND:
             {
-               ret = cmUnpkEgtpTTIInd(egtpTTIInd, pst, mBuf);
+               ret = unpackEgtpSlotInd(egtpSlotInd, pst, mBuf);
                SPutMsg(mBuf);
                break;
             }
@@ -139,7 +139,7 @@ S16 egtpActvTsk(Pst *pst, Buffer *mBuf)
       }
    }
    SExitTsk();
-   RETVALUE(ret);
+   return ret;
 }
 
 /**************************************************************************
@@ -192,9 +192,9 @@ S16 egtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
    egtpFillRspPst(pst, &rspPst);
    rspPst.event = EVTCFGCFM;
 
-   cmPkEgtpCfgCfm(&rspPst, cfgCfm);
+   packEgtpCfgCfm(&rspPst, cfgCfm);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**************************************************************************
@@ -225,7 +225,7 @@ S16 egtpFillRspPst(Pst *pst, Pst *rspPst)
    rspPst->selector = DU_SELECTOR_LC;
    rspPst->pool= DU_POOL;
     
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**************************************************************************
@@ -261,14 +261,14 @@ S16 egtpSrvOpenReq(Pst *pst)
    if(ret = egtpSrvOpenPrc(sockType, &(egtpCb.recvTptSrvr)) != ROK)
    {
       DU_LOG("\nEGTP : Failed while opening receiver transport server");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* Opening and Binding sender socket */
    if(ret = egtpSrvOpenPrc(sockType, &(egtpCb.dstCb.sendTptSrvr)) != ROK)
    {
       DU_LOG("\nEGTP : Failed while opening sender transport server");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    DU_LOG("\nEGTP : Receiver socket[%d] and Sender socket[%d] open", egtpCb.recvTptSrvr.sockFd.fd, egtpCb.dstCb.sendTptSrvr.sockFd.fd);
@@ -279,9 +279,9 @@ S16 egtpSrvOpenReq(Pst *pst)
 
    egtpFillRspPst(pst, &rspPst);
    rspPst.event = EVTSRVOPENCFM;
-   cmPkEgtpSrvOpenCfm(&rspPst, cfm);
+   packEgtpSrvOpenCfm(&rspPst, cfm);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*******************************************************************
@@ -308,16 +308,16 @@ S16 egtpSrvOpenPrc(U8 sockType, EgtpTptSrvr *server)
    if(ret = (cmInetSocket(sockType, &(server->sockFd), protType)) != ROK)
    {  
       DU_LOG("\nEGTP : Failed to open UDP socket");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
       
    if(ret = cmInetBind(&(server->sockFd), &(server->addr)) != ROK)
    {  
       DU_LOG("\nEGTP : Failed to bind socket");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**************************************************************************
@@ -381,9 +381,9 @@ S16 egtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
    DU_LOG("\nEGTP : Sending Tunnel management confirmation");
    egtpFillRspPst(pst, &rspPst);
    rspPst.event = EVTTNLMGMTCFM;
-   cmPkEgtpTnlMgmtCfm(&rspPst, tnlEvt);
+   packEgtpTnlMgmtCfm(&rspPst, tnlEvt);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**************************************************************************
@@ -413,7 +413,7 @@ S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
    if(ret != ROK)
    {
       DU_LOG("\nEGTP : Memory allocation failed");
-      RETVALUE(LCM_REASON_MEM_NOAVAIL);
+      return LCM_REASON_MEM_NOAVAIL;
    }
 
    cmMemset((U8 *)teidCb, 0, sizeof(EgtpTeIdCb));
@@ -425,7 +425,7 @@ S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
    {
       DU_LOG("\nEGTP : Failed to insert in hash list");
       SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)sizeof(EgtpTeIdCb));
-      RETVALUE(LCM_REASON_HASHING_FAILED);
+      return LCM_REASON_HASHING_FAILED;
    }
    egtpCb.dstCb.numTunn++;
 
@@ -439,7 +439,7 @@ S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
   
    egtpEncodeHdr((U8 *)teidCb->preEncodedHdr.hdr, &preDefHdr, &(teidCb->preEncodedHdr.cnt));
 
-   RETVALUE(ROK);
+   return ROK;
 } /* egtpTnlAdd */
 
 /**************************************************************************
@@ -475,7 +475,7 @@ S16 egtpTnlMod(EgtpTnlEvt tnlEvt)
    teidCb->teId = tnlEvt.lclTeid;
    teidCb->remTeId = tnlEvt.remTeid;
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**************************************************************************
@@ -503,14 +503,14 @@ S16 egtpTnlDel(EgtpTnlEvt tnlEvt)
    if(teidCb == NULLP)
    {
       DU_LOG("\nEGTP : Tunnel id[%d] not configured", tnlEvt.lclTeid);
-      RETVALUE(LCM_REASON_INVALID_PAR_VAL);
+      return LCM_REASON_INVALID_PAR_VAL;
    } 
 
    cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb);
    SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)sizeof(EgtpTeIdCb));
    egtpCb.dstCb.numTunn--;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*******************************************************************
@@ -544,7 +544,7 @@ S16 egtpHdlDatInd(EgtpMsg egtpMsg)
    if(teidCb == NULLP)
    {
       DU_LOG("\nEGTP : Tunnel id[%d] not configured", egtpMsg.msgHdr.teId);
-      RETVALUE(LCM_REASON_INVALID_PAR_VAL);
+      return LCM_REASON_INVALID_PAR_VAL;
    }
    
    msgHdr = &(egtpMsg.msgHdr);
@@ -601,7 +601,7 @@ S16 egtpHdlDatInd(EgtpMsg egtpMsg)
    egtpSendMsg(egtpMsg.msg);
    SPutMsg(egtpMsg.msg);
 
-   RETVALUE(ROK);
+   return ROK;
 }/* EgtpHdlDatInd */
 
 /*******************************************************************
@@ -713,7 +713,7 @@ S16 egtpEncodeHdr(U8 *preEncodedHdr, EgtpMsgHdr *preDefHdr, U8 *hdrIdx)
    }
 
    *hdrIdx = cnt;
-   RETVALUE(ROK);
+   return ROK;
 } /* egtpEncodeHdr */
 
 /*******************************************************************
@@ -749,21 +749,21 @@ S16 egtpSendMsg(Buffer *mBuf)
    if(ret != ROK && ret != RWOULDBLOCK)
    {
       DU_LOG("\nEGTP : Failed sending the message");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    DU_LOG("\nEGTP : Message Sent");
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*******************************************************************
  *
- * @brief Handles TTI Indication from PHY
+ * @brief Handles Slot Indication from PHY
  *
  * @details
  *
- *    Function : egtpTTIInd
+ *    Function : egtpSlotInd
  *
  *    Functionality:
  *       Handles TTI Indication from PHY
@@ -773,10 +773,10 @@ S16 egtpSendMsg(Buffer *mBuf)
  *         RFAILED - failure
  *
  * ****************************************************************/
-S16 egtpTTIInd()
+S16 egtpSlotInd()
 {
    egtpRecvMsg();
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*******************************************************************
@@ -806,7 +806,7 @@ S16 egtpRecvMsg()
    CmInetMemInfo  memInfo;       /* Buffer allocation info */
 
 
-   DU_LOG("\nEGTP : Received TTI Indication");
+   DU_LOG("\nEGTP : Received Slot Indication");
 
    nMsg = 0;
    memInfo.region = DU_APP_MEM_REGION;
@@ -828,7 +828,7 @@ S16 egtpRecvMsg()
       nMsg++;
    }
    
-   RETVALUE(ROK);
+   return ROK;
 }
 
 S16 egtpHdlRecvData(Buffer *mBuf)
@@ -841,7 +841,7 @@ S16 egtpHdlRecvData(Buffer *mBuf)
    /* TODO : Send received message to RLC */
    duHdlEgtpDlData(&egtpMsg);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
@@ -1004,6 +1004,6 @@ S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
 
    /* Forward the data to duApp/RLC */
  
-   RETVALUE(ROK);
+   return ROK;
 
 }
index db20d8f..e264a44 100644 (file)
@@ -96,7 +96,7 @@ S16 egtpTnlDel(EgtpTnlEvt tnlEvt);
 S16 egtpHdlDatInd(EgtpMsg msg);
 S16 egtpEncodeHdr(U8 *preEncodedHdr, EgtpMsgHdr *preDefHdr, U8 *hdrIdx);
 S16 egtpSendMsg(Buffer *mBuf);
-S16 egtpTTIInd();
+S16 egtpSlotInd();
 S16 egtpRecvMsg();
 S16 egtpHdlRecvData(Buffer *mBuf);
 S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg);
index fc23787..f229b1b 100644 (file)
@@ -75,7 +75,7 @@
 #define EVTSRVOPENCFM  5
 #define EVTTNLMGMTREQ  6
 #define EVTTNLMGMTCFM  7
-#define EVTTTIIND    8
+#define EVTSLOTIND    8
 #define EVTSTARTPOLL  9
 #define EVENT_RIC_DATA  10
 
       SPutSBuf(DU_APP_MEM_REGION, DU_POOL,                      \
          (Data *)_datPtr, _size);
 
+/* Free shared memory, received through LWLC */
+#define DU_FREE_MEM(_region, _pool, _datPtr, _size)             \
+   if(_datPtr)                                                  \
+          SPutSBuf(_region, _pool,(Data *)_datPtr, _size);          \
+   _datPtr = NULL;
+
 typedef enum
 {
    CELL_OUT_OF_SERVICE,
@@ -245,6 +251,7 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm);
 S16 duSendEgtpTestData();
 S16 duSendEgtpDatInd(Buffer *mBuf);
 S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
+uint16_t duBuildAndSendMacCellStartReq();
 
 #endif
 
index 5d6d547..ef43ccd 100644 (file)
@@ -54,6 +54,8 @@ extern S16 cmUnpkLrgCfgCfm(LrgCfgCfm func,Pst *pst, Buffer *mBuf);
  ***************************************************************************/
 S16 duActvInit(Ent entity, Inst inst, Region region, Reason reason)
 {
+   uint8_t id;
+
    duCb.init.procId  = SFndProcId();
    duCb.init.ent     = entity;
    duCb.init.inst    = inst;
@@ -70,8 +72,11 @@ S16 duActvInit(Ent entity, Inst inst, Region region, Reason reason)
    duCb.f1Status     = FALSE;
    duCb.e2Status     = FALSE;
 
-   memset(duCb.cfgCellLst, '\0', DU_MAX_CELLS * sizeof(duCb.cfgCellLst));
-   memset(duCb.actvCellLst, '\0',DU_MAX_CELLS * sizeof(duCb.actvCellLst));
+   for(id = 0; id < DU_MAX_CELLS; id ++)
+   {
+          duCb.cfgCellLst[id] = NULL;
+      duCb.actvCellLst[id] = NULL;
+   }
 
    SSetProcId(DU_PROC);
 
@@ -188,6 +193,11 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf)
                      ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
                      break;
                   }
+               case EVENT_MAC_SLOT_IND:
+                  {
+                     ret = unpackMacSlotInd(duHandleSlotInd, pst, mBuf);
+                     break;
+                  }
                default:
                   {
                      DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTRG");
@@ -233,17 +243,17 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf)
             {
                case EVTCFGCFM:
                {
-                  cmUnpkEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
+                  unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
                   break;
                }
                case EVTSRVOPENCFM:
                {
-                  cmUnpkEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
+                  unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
                   break;
                }
                case EVTTNLMGMTCFM:
                {
-                  cmUnpkEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
+                  unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
                   break;
                }
                default:
index ed91ea4..2f77a76 100644 (file)
@@ -16,7 +16,7 @@
 ################################################################################
 *******************************************************************************/
 
-/* This file contains message handling functionality for DU cell management */
+/* This file contains message handling functionality for DU APP */
 
 #include "du_mgr.h"
 #include "du_sctp.h"
@@ -44,6 +44,20 @@ packMacCellCfgReq packMacCellCfgOpts[] =
    packMacCellCfg, /* packing for light weight loosly coupled */
 };
 
+DuMacCellStartReq packMacCellStartReqOpts[] =
+{
+   packMacCellStartReq,   /* Loose coupling */
+   MacHdlCellStartReq,    /* TIght coupling */
+   packMacCellStartReq    /* Light weight-loose coupling */
+};
+
+DuMacCellStopReq packMacCellStopReqOpts[] =
+{
+   packMacCellStopReq,   /* Loose coupling */
+   MacHdlCellStopReq,    /* TIght coupling */
+   packMacCellStopReq    /* Light weight-loose coupling */
+};
+
 /**************************************************************************
  * @brief Function to fill configs required by RLC
  *
@@ -1004,7 +1018,7 @@ S16 duBuildEgtpCfgReq()
     cmMemcpy((U8 *)&egtpCfg, (U8 *)&duCfgParam.egtpParams, (PTR)sizeof(EgtpConfig));
     
     duFillEgtpPst(&pst, EVTCFGREQ);
-    cmPkEgtpCfgReq(&pst, egtpCfg);
+    packEgtpCfgReq(&pst, egtpCfg);
  
     RETVALUE(ROK);
 }
@@ -1069,7 +1083,7 @@ S16 duSendEgtpSrvOpenReq()
    DU_LOG("\nDU_APP : Sending EGTP server open request");
 
    duFillEgtpPst(&pst, EVTSRVOPENREQ);
-   cmPkEgtpSrvOpenReq(&pst);
+   packEgtpSrvOpenReq(&pst);
 
    RETVALUE(ROK);
 }
@@ -1142,7 +1156,7 @@ S16 duSendEgtpTnlMgmtReq(U8 action, U32 lclTeid, U32 remTeid)
    DU_LOG("\nDU_APP : Sending EGTP tunnel management request");
     
    duFillEgtpPst(&pst, EVTTNLMGMTREQ);
-   cmPkEgtpTnlMgmtReq(&pst, tnlEvt);
+   packEgtpTnlMgmtReq(&pst, tnlEvt);
     
    RETVALUE(ROK);
 }
@@ -1175,9 +1189,6 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
       duSendUeCreateReqToRlc();
 
       duSendEgtpTestData();
-      
-      /* For testing purpose. TTI thread should actually be in L1 */
-      duStartTtiThread();
 #endif      
    }
    else
@@ -1481,26 +1492,26 @@ S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm)
 
 /*******************************************************************
  *
- * @brief Handles TTI indication 
+ * @brief Sends Slot indication to EGTP
  *
  * @details
  *
- *    Function : duSendEgtpTTIInd
+ *    Function : duSendEgtpSlotInd
  *
  *    Functionality:
- *     Handles TTI indication received from PHY
+ *     Sends Slot indication to EGTP
  *
  * @params[in] 
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-S16 duSendEgtpTTIInd()
+S16 duSendEgtpSlotInd()
 {
    Pst pst;
 
-   duFillEgtpPst(&pst, EVTTTIIND);
-   cmPkEgtpTTIInd(&pst);
+   duFillEgtpPst(&pst, EVTSLOTIND);
+   packEgtpSlotInd(&pst);
    
    RETVALUE(ROK);
    
@@ -1571,7 +1582,7 @@ S16 duBuildAndSendMacCellCfg()
  *         RFAILED - failure
  *
  ***************************************************************************/
-S16 duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm)
+uint16_t duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm)
 {
    S16 ret = ROK;
 
@@ -1585,6 +1596,11 @@ S16 duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm)
 
                        /* Build and send GNB-DU config update */
                        ret = BuildAndSendDUConfigUpdate();
+
+         /* TODO: Trigger cell start req once cell up slot ind is received*/
+                       /* Build and Send Cell Start Req to MAC */
+                       //ret = duBuildAndSendMacCellStartReq();
+
                }
                else
                {
@@ -1601,6 +1617,140 @@ S16 duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm)
    return ret;
 }
 
+/*******************************************************************
+ *
+ * @brief Handles slot indication from MAC
+ *
+ * @details
+ *
+ *    Function : duHandleSlotInd
+ *
+ *    Functionality:
+ *      Handles slot indication from MAC
+ *
+ * @params[in] Post structure pointer
+ *             Slot Info pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo)
+{
+   
+   DU_LOG("\nDU APP : Slot Indication received");
+
+   /* TODO : Slot Indication to be moved out of EGTP_TEST when
+    * data path is established */
+#ifdef EGTP_TEST
+   duSendEgtpSlotInd();    
+#endif
+   DU_FREE_MEM(pst->region, pst->pool, slotInfo, sizeof(SlotInfo));
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds and sends cell start request to MAC
+ *
+ * @details
+ *
+ *    Function : duBuildAndSendMacCellStartReq
+ *
+ *    Functionality:
+ *       Builds and sends cell start request to MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t duBuildAndSendMacCellStartReq()
+{
+   Pst pst;
+   MacCellStartInfo *cellStartInfo = NULL;
+
+   DU_LOG("\nDU APP : Building and Sending cell start request to MAC");
+
+   /* Send Cell Start Request to MAC */
+   DU_ALLOC(cellStartInfo, sizeof(MacCellStartInfo));
+   if(!cellStartInfo)
+   {
+      DU_LOG("\nDU APP : Memory alloc failed while building cell start request");
+      return RFAILED;
+   }
+
+   for(uint8_t id = 0; id < DU_MAX_CELLS; id++) 
+   {
+      if(duCb.actvCellLst[id])
+      {
+         cellStartInfo->cellId = duCb.actvCellLst[id]->cellInfo.nrEcgi.cellId;
+         /* Fill Pst */
+         pst.selector  = DU_MAC_LWLC;
+         pst.srcEnt    = ENTDUAPP;
+         pst.dstEnt    = ENTRG;
+         pst.dstInst   = 0;
+         pst.srcInst   = 0;
+         pst.dstProcId = DU_PROC;
+         pst.srcProcId = DU_PROC;
+         pst.region = DU_APP_MEM_REGION;
+         pst.pool = DU_POOL;
+         pst.event = EVENT_MAC_CELL_START_REQ;
+         return (*packMacCellStartReqOpts[pst.selector])(&pst, cellStartInfo);
+      }
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds and sends cell stop request to MAC
+ *
+ * @details
+ *
+ *    Function : duBuildAndSendMacCellStopReq 
+ *
+ *    Functionality:
+ *       Builds and sends cell stop request to MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 duBuildAndSendMacCellStopReq()
+{
+   Pst pst;
+   MacCellStopInfo *cellStopInfo = NULL;
+   DU_LOG("\nDU APP : Building and Sending cell stop request to MAC");
+
+   /* Send Cell Stop Request to MAC */
+   DU_ALLOC(cellStopInfo, sizeof(MacCellStopInfo));
+   if(!cellStopInfo)
+   {
+      DU_LOG("\nDU APP : Memory alloc failed while building cell stop request");
+      return RFAILED;
+   }
+   cellStopInfo->cellId = duCb.actvCellLst[0]->cellId;
+   /* Fill Pst */
+   pst.selector  = DU_MAC_LWLC;
+   pst.srcEnt    = ENTDUAPP;
+   pst.dstEnt    = ENTRG;
+   pst.dstInst   = 0;
+   pst.srcInst   = 0;
+   pst.dstProcId = DU_PROC;
+   pst.srcProcId = DU_PROC;
+   pst.region = DU_APP_MEM_REGION;
+   pst.pool = DU_POOL;
+   pst.event = EVENT_MAC_CELL_STOP_REQ;
+   return (*packMacCellStopReqOpts[pst.selector])(&pst, cellStopInfo);
+}
+
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 790a10f..c3c9795 100644 (file)
 #include "du_log.h"
 #include "BCCH-BCH-Message.h"
 #include "MIB.h"
-#include "SIB1.h"
 #include "PLMN-IdentityInfo.h"
 #include "PLMN-IdentitY.h"
+#include "SIB-TypeInfo.h"
+#include "SchedulingInfo.h"
+#include "SI-SchedulingInfo.h"
+#include "ConnEstFailureControl.h"
+#include "FrequencyInfoDL-SIB.h"
+#include "SearchSpace.h"
+#include "SCS-SpecificCarrier.h"
+#include "NR-MultiBandInfo.h"
+#include "PDCCH-ConfigCommon.h"
+#include "PDSCH-TimeDomainResourceAllocation.h"
+#include "PDSCH-TimeDomainResourceAllocationList.h"
+#include "PDSCH-ConfigCommon.h"
+#include "BWP-DownlinkCommon.h"
+#include "DownlinkConfigCommonSIB.h"
+#include "RACH-ConfigCommon.h"
+#include "PUSCH-TimeDomainResourceAllocation.h"
+#include "PUSCH-TimeDomainResourceAllocationList.h"
+#include "PUSCH-ConfigCommon.h"
+#include "PUCCH-ConfigCommon.h"
+#include "UplinkConfigCommonSIB.h"
+#include "TDD-UL-DL-ConfigCommon.h"
+#include "ServingCellConfigCommonSIB.h"
 #include "MCC.h"
+#include "SIB1.h"
 #include "du_sys_info_hdl.h"
 
 extern char encBuf[ENC_BUF_MAX_LEN];
@@ -368,6 +390,7 @@ int BuildPlmnList(CellAccessRelatedInfo_t *cellAccessInfo)
                DU_LOG("DU APP: BuildPlmnList memory allocation failure");
                return RFAILED;
        }
+
        for(idx1=0; idx1<elementCnt; idx1++)
        {
                DU_ALLOC(plmnIdInfo->list.array[idx1],
@@ -458,110 +481,1906 @@ int BuildPlmnList(CellAccessRelatedInfo_t *cellAccessInfo)
 
 /*******************************************************************
  *
- * @brief Builds SIB message in Served Cell Info
+ * @brief  Build SIB Map Info List
  *
  * @details
  *
- *    Function : BuildSib1Msg
+ *    Function : BuildSibMapInfoList
  *
- *    Functionality: Building SIB message in Served Cell Info
+ *    Functionality:
+ *       Build SIB MapInfo List
  *
+ * @params[in] SIB_Mapping_t pointer
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-int BuildSib1Msg()
+S16 BuildSibMapInfoList(SIB_Mapping_t *sibMapInfo)
 {
-       SIB1_t                   *sib1Msg;
-       CellAccessRelatedInfo_t  *cellAccessInfo;
-       U8                       elementCnt;
-       U8                       idx, idx1, idx2;
-       asn_enc_rval_t           encRetVal;
-       TrackingAreaCode_t       *tac;
-       RAN_AreaCode_t           *ranac;
-       CellIdentity_t           *cellIdentity;
-       struct PLMN_IdentityInfo__plmn_IdentityList
-               *plmnIdInfo;
+   uint8_t   itr;         /* List iterator */
+   uint8_t   elementCnt;  /* Number of elements in list */
+   SIB_TypeInfo_t *sibTypeInfo;  /* Scheduling info */
 
-       DU_ALLOC(sib1Msg, sizeof(SIB1_t));
-       if(!sib1Msg)
-       {   
-               DU_LOG("DU APP: SIB1 msg memory allocation failure");
-               return RFAILED;
-       }   
-       elementCnt = ODU_VALUE_ONE;
+   /* SI scheduling info list */
+   DU_ALLOC(sibMapInfo->list.array, sibMapInfo->list.size);
+   if(!sibMapInfo->list.array)
+   {
+      DU_LOG("DU APP: BuildSibMapInfoList memory allocation failure");
+      return RFAILED;
+   }
 
-   /* PLMN list */
-       cellAccessInfo = &sib1Msg->cellAccessRelatedInfo;
-       cellAccessInfo->plmn_IdentityList.list.count =
-               elementCnt;
-       cellAccessInfo->plmn_IdentityList.list.size
-               = elementCnt * sizeof(PLMN_IdentityInfo_t);
+   elementCnt = sibMapInfo->list.count;
+   for(itr = 0; itr < elementCnt; itr++)
+   {
+      DU_ALLOC(sibMapInfo->list.array[itr], sizeof(SIB_TypeInfo_t));
+      if(!sibMapInfo->list.array[itr])
+      {
+         DU_LOG("DU APP: BuildSibMapInfoList memory allocation failure");
+         return RFAILED;
+      }
+   }
+   itr = 0;
+   sibTypeInfo = sibMapInfo->list.array[itr];
+   sibTypeInfo->type = duCfgParam.sib1Params.siSchedInfo.sibType;
+   DU_ALLOC(sibTypeInfo->valueTag, sizeof(long));
+   if(!sibTypeInfo->valueTag)
+   {
+      DU_LOG("DU APP: BuildSibMapInfoList memory allocation failure");
+      return RFAILED;
+   }
 
-   BuildPlmnList(cellAccessInfo);
+   *sibTypeInfo->valueTag = duCfgParam.sib1Params.siSchedInfo.sibValTag;
 
-   xer_fprint(stdout, &asn_DEF_SIB1, sib1Msg);
+   return ROK;
+}
 
-       /* Encode the F1SetupRequest type as APER */
-       cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
-       encBufSize = 0;
-       encRetVal = aper_encode(&asn_DEF_SIB1, 0, sib1Msg, PrepFinalEncBuf,\
-                       encBuf);
-       printf("\nencbufSize: %d\n", encBufSize);
-       if(encRetVal.encoded == -1)
-       {
-               DU_LOG("\nDU APP : Could not encode SIB1 structure (at %s)\n",\
-                               encRetVal.failed_type ?
-                               encRetVal.failed_type->name :
-                               "unknown");
-               return RFAILED;
-       }
-       for(int i=0; i< encBufSize; i++)
-       {
-               printf("%x\t",encBuf[i]);
-       }
-       printf("\n");
+/*******************************************************************
+ *
+ * @brief Builds SI Scheduling info list within SIB1 message 
+ *
+ * @details
+ *
+ *    Function : BuildSiSchedInfoList 
+ *
+ *    Functionality: 
+ *        Building SI Scheduling info list in SIB1 message
+ *
+ * @params[in] struct SI_SchedulingInfo__schedulingInfoList *si_SchedulingInfo
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildSiSchedInfoList(struct SI_SchedulingInfo__schedulingInfoList *si_SchedulingInfoList)
+{
+   uint8_t   itr;         /* List iterator */
+   uint8_t   elementCnt;  /* Number of elements in list */
+   SchedulingInfo_t *schedInfo;  /* Scheduling info */
 
-       /* Free allocated memeory */
-       /* Free PLMN List */
+   /* SI scheduling info list */
+   DU_ALLOC(si_SchedulingInfoList->list.array, si_SchedulingInfoList->list.size);
+   if(!si_SchedulingInfoList->list.array)
+   {
+      DU_LOG("DU APP: BuildSiSchedInfoList memory allocation failure");
+      return RFAILED;
+   }
+   
+   elementCnt = si_SchedulingInfoList->list.count;
+   for(itr = 0; itr < elementCnt; itr++)
+   {
+      DU_ALLOC(si_SchedulingInfoList->list.array[itr], sizeof(struct SchedulingInfo));
+      if(!si_SchedulingInfoList->list.array[itr])
+      {
+         DU_LOG("DU APP: BuildSiSchedInfoList memory allocation failure");
+         return RFAILED;
+      }
+   }
 
-       for(idx=0; idx<cellAccessInfo->plmn_IdentityList.list.count; idx++)
-       {
-               plmnIdInfo = &cellAccessInfo->plmn_IdentityList.list.array[idx]->\
-                                                plmn_IdentityList;
-               for(idx1=0; idx1<plmnIdInfo->list.count; idx1++)
-               {
-                       for(idx2=0; idx2<plmnIdInfo->list.array[idx1]->mnc.list.count; idx2++)
-                       {
-                               DU_FREE(plmnIdInfo->list.array[idx1]->mcc->list.array[idx2],
-                                               sizeof(MCC_MNC_Digit_t));
-                               DU_FREE(plmnIdInfo->list.array[idx1]->mnc.list.array[idx2],
-                                               sizeof(MCC_MNC_Digit_t));
-                       }
-                       DU_FREE(plmnIdInfo->list.array[idx1]->mcc->list.array,
-                                       plmnIdInfo->list.array[idx1]->mcc->list.size);
-                       DU_FREE(plmnIdInfo->list.array[idx1]->mnc.list.array,
-                                       plmnIdInfo->list.array[idx1]->mnc.list.size);
-                       DU_FREE(plmnIdInfo->list.array[idx1]->mcc,
-                                       sizeof(MCC_t));
-                       DU_FREE(plmnIdInfo->list.array[idx1],
-                                       sizeof(PLMN_IdentitY_t));
-               }
-               DU_FREE(cellAccessInfo->plmn_IdentityList.list.array[idx],
-                               sizeof(PLMN_IdentityInfo_t));
-               cellIdentity =\
-                                                 &cellAccessInfo->plmn_IdentityList.list.array[idx]->cellIdentity;
-               DU_FREE(cellIdentity->buf, cellIdentity->size);
+   itr = 0;
+   schedInfo = si_SchedulingInfoList->list.array[itr];
+   schedInfo->si_BroadcastStatus = duCfgParam.sib1Params.siSchedInfo.broadcastSta;
+   schedInfo->si_Periodicity = duCfgParam.sib1Params.siSchedInfo.preiodicity;
 
-               ranac = cellAccessInfo->plmn_IdentityList.list.array[idx]->ranac;
-               DU_FREE(ranac, sizeof(RAN_AreaCode_t));
+   elementCnt = ODU_VALUE_ONE; 
+   schedInfo->sib_MappingInfo.list.count = elementCnt;
+   schedInfo->sib_MappingInfo.list.size = elementCnt * sizeof(SIB_TypeInfo_t);
+   
+   BuildSibMapInfoList(&schedInfo->sib_MappingInfo);
 
-               tac = cellAccessInfo->plmn_IdentityList.list.array[idx]->trackingAreaCode;
-               DU_FREE(tac->buf, tac->size);
-               DU_FREE(tac, sizeof(TrackingAreaCode_t));
-       }
-       DU_FREE(cellAccessInfo->plmn_IdentityList.list.array,
-                       cellAccessInfo->plmn_IdentityList.list.size);
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds SCS Specific carrier list for DL 
+ *
+ * @details
+ *
+ *    Function : BuildScsSpecificCarrierListDl
+ *
+ *    Functionality:
+ *       Builds Subcarrier specific carrier list for downlink
+ *
+ * @params[in] FrequencyInfoDL_SIB__scs_SpecificCarrierList pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildScsSpecificCarrierListDl
+(
+struct FrequencyInfoDL_SIB__scs_SpecificCarrierList *scsCarrierList
+)
+{
+   uint8_t idx;
+   ScsSpecCarrier   duScsSpecCarrier;
+
+   duScsSpecCarrier = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.dlScsCarrier;
+
+   DU_ALLOC(scsCarrierList->list.array, scsCarrierList->list.size);
+   if(!scsCarrierList->list.array)
+   {
+      DU_LOG("\nDU APP : SCS Specific Carrier list memory allocation failed"); 
+      return RFAILED;
+   }
+
+   for(idx = 0; idx < scsCarrierList->list.count; idx++)
+   {
+      DU_ALLOC(scsCarrierList->list.array[idx], sizeof(SCS_SpecificCarrier_t));
+      if(!scsCarrierList->list.array[idx])
+      {
+         DU_LOG("\nDU APP : SCS Specific Carrier list memory allocation failed");
+         return RFAILED;
+      }
+   }
+
+   idx = 0;
+   scsCarrierList->list.array[idx]->offsetToCarrier = duScsSpecCarrier.scsOffset; 
+   scsCarrierList->list.array[idx]->subcarrierSpacing = duScsSpecCarrier.scs;
+   scsCarrierList->list.array[idx]->carrierBandwidth = duScsSpecCarrier.scsBw;
+
+   return ROK;
+} /* End of BuildScsSpecificCarrierListDl */
+
+/*******************************************************************
+ *
+ * @brief Builds common search space list 
+ *
+ * @details
+ *
+ *    Function : BuildCommonSerachSpaceList
+ *
+ *    Functionality:
+ *      Builds common search space list
+ *
+ * @params[in] PDCCH_ConfigCommon__commonSearchSpaceList pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildCommonSerachSpaceList
+(
+struct PDCCH_ConfigCommon__commonSearchSpaceList *searchSpclist
+)
+{
+   uint8_t idx;
+   SearchSpace_t    *searchSpace;
+   PdcchCfgCommon   duPdcchCfg;
+
+   duPdcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdcchCfg;
+
+   DU_ALLOC(searchSpclist->list.array, searchSpclist->list.size)
+   if(!searchSpclist->list.array)
+   {
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+
+   for(idx = 0; idx < searchSpclist->list.count; idx++)
+   {
+      DU_ALLOC(searchSpclist->list.array[idx], sizeof(SearchSpace_t));
+      if(!searchSpclist->list.array[idx])
+      {
+         DU_LOG("\nDU APP : Common search space list memory alloc failed");
+         return RFAILED;
+      }
+   }
+
+   idx = 0;
+   searchSpace = searchSpclist->list.array[idx];
+
+   /* Search Space id */
+   searchSpace->searchSpaceId = duPdcchCfg.searchSpcId;
+
+   /* Control Resource Set Id */
+   DU_ALLOC(searchSpace->controlResourceSetId, sizeof(ControlResourceSetId_t));
+   if(!searchSpace->controlResourceSetId)
+   {
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+   *searchSpace->controlResourceSetId = duPdcchCfg.ctrlRsrcSetId;
+
+   /* Monitoring Slot periodicity and offset */
+   DU_ALLOC(searchSpace->monitoringSlotPeriodicityAndOffset,\
+      sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
+   if(!searchSpace->monitoringSlotPeriodicityAndOffset)
+   {
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+   searchSpace->monitoringSlotPeriodicityAndOffset->present = \
+      duPdcchCfg.monitorSlotPrdAndOffPresent;
+   switch(searchSpace->monitoringSlotPeriodicityAndOffset->present)
+   {
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1:
+      {
+         //searchSpace->monitoringSlotPeriodicityAndOffset->choice.s11 = \
+            duPdcchCfg.monitorSlotPrdAndOff;
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16:
+      {
+         //TODO;
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl40:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl80:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl160:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl320:
+      {
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl640:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1280:
+      {
+         //TODO
+         break;
+      }
+      case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2560:
+      {
+         //TODO
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP : Invalid value:Montoring slot periodicity and offset");
+         return RFAILED;
+      }
+   }
+   /* Monitoring Symbols Within Slot */
+   DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot,\
+      sizeof(BIT_STRING_t));
+   if(!searchSpace->monitoringSymbolsWithinSlot)
+   {
+       DU_LOG("\nDU APP : Common search space list memory alloc failed");
+       return RFAILED;
+   }
+   searchSpace->monitoringSymbolsWithinSlot->size = 2;
+   DU_ALLOC(searchSpace->monitoringSymbolsWithinSlot->buf, \
+      searchSpace->monitoringSymbolsWithinSlot->size * sizeof(uint8_t));
+   if(!searchSpace->monitoringSymbolsWithinSlot->buf)
+   {  
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+   searchSpace->monitoringSymbolsWithinSlot->buf[0] = duPdcchCfg.monitorSymbolsInSlot[0];
+   searchSpace->monitoringSymbolsWithinSlot->buf[1] = duPdcchCfg.monitorSymbolsInSlot[1];
+   searchSpace->monitoringSymbolsWithinSlot->bits_unused = 2;
+
+   /* Number of candidates per aggregation level */
+   DU_ALLOC(searchSpace->nrofCandidates,\
+      sizeof(struct SearchSpace__nrofCandidates));
+   if(!searchSpace->nrofCandidates)
+   {
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+   searchSpace->nrofCandidates->aggregationLevel1 = duPdcchCfg.numCandAggLvl1;
+   searchSpace->nrofCandidates->aggregationLevel2 = duPdcchCfg.numCandAggLvl2;
+   searchSpace->nrofCandidates->aggregationLevel4 = duPdcchCfg.numCandAggLvl4;
+   searchSpace->nrofCandidates->aggregationLevel8 = duPdcchCfg.numCandAggLvl8;
+   searchSpace->nrofCandidates->aggregationLevel16 = duPdcchCfg.numCandAggLvl16;
+
+   /* Search Space type and  DCI Format */
+   DU_ALLOC(searchSpace->searchSpaceType,\
+      sizeof( struct SearchSpace__searchSpaceType));
+   if(!searchSpace->searchSpaceType)
+   {
+      DU_LOG("\nDU APP : Common search space list memory alloc failed");
+      return RFAILED;
+   }
+
+   searchSpace->searchSpaceType->present = duPdcchCfg.searchSpcType; 
+   switch(searchSpace->searchSpaceType->present)
+   {
+      case SearchSpace__searchSpaceType_PR_NOTHING:
+      {
+        //TODO
+        break;
+      }
+      case SearchSpace__searchSpaceType_PR_common:
+      {
+         DU_ALLOC(searchSpace->searchSpaceType->choice.common,\
+            sizeof(struct SearchSpace__searchSpaceType__common));
+         if(!searchSpace->searchSpaceType->choice.common)
+         {
+            DU_LOG("\nDU APP : Common search space list memory alloc failed");
+            return RFAILED;
+         }
+
+         DU_ALLOC(searchSpace->searchSpaceType->choice.common->\
+            dci_Format0_0_AndFormat1_0, sizeof(struct \
+            SearchSpace__searchSpaceType__common__dci_Format0_0_AndFormat1_0));
+         if(!searchSpace->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0)
+         {
+            DU_LOG("\nDU APP : Common search space list memory alloc failed");
+            return RFAILED;
+         }
+         break;
+      }
+      case SearchSpace__searchSpaceType_PR_ue_Specific:
+      {
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU_APP: Invalid Search Space type");
+         return RFAILED;
+      }
+
+   }
+
+   return ROK;
+}/* BuildCommonSerachSpaceList */
+
+/*******************************************************************
+ *
+ * @brief Builds PDCCH configuration common 
+ *
+ * @details
+ *
+ *    Function : BuildPdcchCfgCommon
+ *
+ *    Functionality:
+ *      Builds PDCCH configuration common
+ *
+ * @params[in] BWP_DownlinkCommon__pdcch_ConfigCommon pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildPdcchCfgCommon(struct BWP_DownlinkCommon__pdcch_ConfigCommon *pdcchCfg)
+{
+   uint8_t   elementCnt;
+   PdcchCfgCommon   duPdcchCfg;
+   PDCCH_ConfigCommon_t  *pdcchSetup;
+
+   duPdcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdcchCfg;
+
+   pdcchCfg->present = duPdcchCfg.present;
+
+   switch(pdcchCfg->present)
+   {
+      case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_release:
+      {
+         //TODO
+         break;
+      }
+      case BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup:
+      {
+         DU_ALLOC(pdcchCfg->choice.setup, sizeof(PDCCH_ConfigCommon_t));
+         if(!pdcchCfg->choice.setup)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         pdcchSetup = pdcchCfg->choice.setup;
+         
+         /* Control Resource Set Zero */
+         DU_ALLOC(pdcchSetup->controlResourceSetZero, 
+            sizeof(ControlResourceSetZero_t)); 
+         if(!pdcchSetup->controlResourceSetZero)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *pdcchSetup->controlResourceSetZero = duPdcchCfg.ctrlRsrcSetZero;
+         
+         /* Search space zero */
+         DU_ALLOC(pdcchSetup->searchSpaceZero, sizeof(SearchSpaceZero_t));
+         if(!pdcchSetup->searchSpaceZero)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *pdcchSetup->searchSpaceZero = duPdcchCfg.searchSpcZero;
+        
+         /* Common Search Space List */
+         DU_ALLOC(pdcchSetup->commonSearchSpaceList,\
+            sizeof(struct PDCCH_ConfigCommon__commonSearchSpaceList));
+         if(!pdcchSetup->commonSearchSpaceList)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         elementCnt = ODU_VALUE_ONE;
+         pdcchSetup->commonSearchSpaceList->list.count = elementCnt;
+         pdcchSetup->commonSearchSpaceList->list.size = \
+            elementCnt * sizeof(SearchSpace_t);
+         BuildCommonSerachSpaceList(pdcchSetup->commonSearchSpaceList);
+
+         /* Search Space for SIB1 */
+         DU_ALLOC(pdcchSetup->searchSpaceSIB1, sizeof(SearchSpaceId_t));
+         if(!pdcchSetup->searchSpaceSIB1)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *pdcchSetup->searchSpaceSIB1 = duPdcchCfg.searchSpcSib1;
+
+         /* Serach Space for Paging */
+         DU_ALLOC(pdcchSetup->pagingSearchSpace, sizeof(SearchSpaceId_t));
+         if(!pdcchSetup->pagingSearchSpace)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }  
+         *pdcchSetup->pagingSearchSpace = duPdcchCfg.pagingSearchSpc;
+
+         /* Search space for Random Access */
+         DU_ALLOC(pdcchSetup->ra_SearchSpace, sizeof(SearchSpaceId_t));
+         if(!pdcchSetup->ra_SearchSpace)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }             
+         *pdcchSetup->ra_SearchSpace = duPdcchCfg.raSearchSpc;
+
+         break;
+      }
+      default :
+      {
+         DU_LOG("\nDU APP : Invalid PDCCH Config type");
+         return RFAILED;
+      }
+   }
+
+   return ROK;
+} /* BuildPdcchCfgCommon */
+
+/*******************************************************************
+ *
+ * @brief Builds PDSCH configuration common 
+ *
+ * @details
+ *
+ *    Function : BuildPdschCfgCommon
+ *
+ *    Functionality:
+ *       Builds PDSCH configuration common
+ *
+ * @params[in] BWP_DownlinkCommon__pdsch_ConfigCommon pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildPdschCfgCommon(struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdschCfg)
+{
+   uint8_t   idx;
+   uint8_t   elementCnt;
+   PdschCfgCommon   duPdschCfg;
+   PDSCH_ConfigCommon_t  *pdschSetup;
+   PDSCH_TimeDomainResourceAllocation_t  *timeDomRsrcAllocInfo;
+   duPdschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pdschCfg;
+  
+   pdschCfg->present = duPdschCfg.present;
+
+   switch(pdschCfg->present)
+   {
+      case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_release:
+      {
+         //TODO
+         break;
+      }
+      case BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup:
+      {
+         DU_ALLOC(pdschCfg->choice.setup, sizeof(PDSCH_ConfigCommon_t));
+         if(!pdschCfg->choice.setup)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         pdschSetup = pdschCfg->choice.setup; 
+         
+         /* Time Domain Allocation List */
+         DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList, \
+            sizeof(PDSCH_TimeDomainResourceAllocationList_t));
+         if(!pdschSetup->pdsch_TimeDomainAllocationList)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         elementCnt = ODU_VALUE_ONE;
+         pdschSetup->pdsch_TimeDomainAllocationList->list.count = elementCnt;
+         pdschSetup->pdsch_TimeDomainAllocationList->list.size = \
+            elementCnt * sizeof(PDSCH_TimeDomainResourceAllocation_t);
+
+         DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList->list.array,\
+            pdschSetup->pdsch_TimeDomainAllocationList->list.size);
+         if(!pdschSetup->pdsch_TimeDomainAllocationList->list.array)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+          
+         for(idx=0; idx<elementCnt; idx++)
+         {
+            DU_ALLOC(pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx],\
+               sizeof(PDSCH_TimeDomainResourceAllocation_t));
+            if(!pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx])
+            {
+               DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+               return RFAILED;
+            }
+         }
+
+         idx = 0;
+         timeDomRsrcAllocInfo = pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx];
+
+         /* K0 */
+         DU_ALLOC(timeDomRsrcAllocInfo->k0, sizeof(long));
+         if(!timeDomRsrcAllocInfo->k0)
+         {
+            DU_LOG("\nDU APP : PDCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *timeDomRsrcAllocInfo->k0 = duPdschCfg.k0;
+  
+         timeDomRsrcAllocInfo->mappingType = duPdschCfg.mapType;
+         timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.startSymbAndLen;
+
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP: Invalid PDSCH Configuration type");
+         return RFAILED;
+      }
+   }
+
+   return ROK;
+}/* BuildPdschCfgCommon */
+
+/*******************************************************************
+ *
+ * @brief Builds DL BWP common 
+ *
+ * @details
+ *
+ *    Function : BuildBwpDlCommon
+ *
+ *    Functionality:
+ *      Builds DL BWP common
+ *
+ * @params[in] BWP_DownlinkCommon_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildBwpDlCommon(BWP_DownlinkCommon_t *bwp)
+{
+   DlCfgCommon duDlCfg;
+   duDlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg;
+
+   bwp->genericParameters.locationAndBandwidth = duDlCfg.locAndBw;
+   bwp->genericParameters.subcarrierSpacing = duDlCfg.dlScsCarrier.scs;
+
+   /* PDCCH Config Common */
+   DU_ALLOC(bwp->pdcch_ConfigCommon, \
+      sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon));
+   if(!bwp->pdcch_ConfigCommon)
+   {
+      DU_LOG("\nDU APP : DL BWP memory allocation failed");
+      return RFAILED;
+   }
+   BuildPdcchCfgCommon(bwp->pdcch_ConfigCommon);
+
+   /* PDSCH Config Common */
+   DU_ALLOC(bwp->pdsch_ConfigCommon, \
+      sizeof(struct BWP_DownlinkCommon__pdsch_ConfigCommon));
+   if(!bwp->pdsch_ConfigCommon)
+   {
+      DU_LOG("\nDU APP : DL BWP memory allocation failed");
+      return RFAILED;
+   }
+   BuildPdschCfgCommon(bwp->pdsch_ConfigCommon);
+
+   return ROK;
+} /* BuildBwpDlCommon */
+
+/*******************************************************************
+ *
+ * @brief Build BCCH configuration 
+ *
+ * @details
+ *
+ *    Function : BuildBcchConfig
+ *
+ *    Functionality:
+ *      Build BCCH configuration
+ *
+ * @params[in] BCCH_Config_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildBcchConfig(BCCH_Config_t *bcchCfg)
+{
+   BcchCfg   duBcchCfg;
+
+   duBcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.bcchCfg;
+
+   bcchCfg->modificationPeriodCoeff = duBcchCfg.modPrdCoeff;
+   
+   return ROK;
+}/* BuildBcchConfig */
+
+/*******************************************************************
+ *
+ * @brief Builds PCCH configuration 
+ *
+ * @details
+ *
+ *    Function : BuildPcchConfig
+ *
+ *    Functionality:
+ *        Builds PCCH configuration
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildPcchConfig(PCCH_Config_t *pcchCfg)
+{
+   PcchCfg   duPcchCfg;
+  
+   duPcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg;
+   pcchCfg->defaultPagingCycle = duPcchCfg.dfltPagingCycle;
+   pcchCfg->nAndPagingFrameOffset.present =  duPcchCfg.nAndPagingFrmOffPresent;
+   switch(pcchCfg->nAndPagingFrameOffset.present)
+   {
+      case PCCH_Config__nAndPagingFrameOffset_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case PCCH_Config__nAndPagingFrameOffset_PR_oneT:
+      {
+         break;
+      }
+      case PCCH_Config__nAndPagingFrameOffset_PR_halfT:
+      {
+         //TODO
+         break;
+      }
+      case PCCH_Config__nAndPagingFrameOffset_PR_quarterT:
+      {
+         //TODO
+         break;
+      }
+      case PCCH_Config__nAndPagingFrameOffset_PR_oneEighthT:
+      {
+         //TODO
+         break;
+      }
+      case PCCH_Config__nAndPagingFrameOffset_PR_oneSixteenthT:
+      {
+         //TODO
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP : Invalid nAndPagingFrameOffset configuration");
+         return RFAILED;
+      }
+   }
+   pcchCfg->ns = duPcchCfg.numPagingOcc;
+
+   return ROK;
+}/* BuildPcchConfig */
+
+/*******************************************************************
+ *
+ * @brief Builds Frequency Info for Downlink 
+ *
+ * @details
+ *
+ *    Function : BuildFreqInfoDl
+ *
+ *    Functionality:
+ *     Builds Frequency Info for Downlink
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildFreqInfoDl(FrequencyInfoDL_SIB_t *frequencyInfoDL)
+{
+   uint8_t idx;
+   uint8_t elementCnt;
+   DlCfgCommon  dlCfg;
+   NR_MultiBandInfo_t  *multiBandInfo;
+
+   dlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg;
+
+   /* NR Multi-Band Info */
+   elementCnt = ODU_VALUE_ONE;   
+   frequencyInfoDL->frequencyBandList.list.count = elementCnt;  
+   frequencyInfoDL->frequencyBandList.list.size = \
+     elementCnt * sizeof(NR_MultiBandInfo_t);
+
+   DU_ALLOC(frequencyInfoDL->frequencyBandList.list.array, \
+      frequencyInfoDL->frequencyBandList.list.size);
+   if(!frequencyInfoDL->frequencyBandList.list.array)
+   {
+      DU_LOG("\nDU APP : SIB1 DL Configuration memory allocation failed");
+      return RFAILED;
+   }
+
+   for(idx = 0; idx < elementCnt; idx++)
+   {
+      DU_ALLOC(frequencyInfoDL->frequencyBandList.list.array[idx],\
+         sizeof(NR_MultiBandInfo_t));
+      if(!frequencyInfoDL->frequencyBandList.list.array[idx])
+      {
+         DU_LOG("\nDU APP : SIB1 DL Configuration memory allocation failed");
+         return RFAILED;
+      }
+   }
+
+   idx = 0;
+   multiBandInfo = frequencyInfoDL->frequencyBandList.list.array[idx];
+
+   /* Frequency band indicator */
+   DU_ALLOC(multiBandInfo->freqBandIndicatorNR, sizeof(FreqBandIndicatorNR_t));
+   if(!multiBandInfo->freqBandIndicatorNR)
+   {
+      DU_LOG("\nDU APP : SIB1 DL Configuration memory allocation failed");
+      return RFAILED;
+   }
+   *multiBandInfo->freqBandIndicatorNR = dlCfg.freqBandInd;
+
+   /* Offset to Point A */
+   frequencyInfoDL->offsetToPointA = dlCfg.offsetToPointA;
+
+   /* Subcarrier Spacing specifc carrier */
+   elementCnt = ODU_VALUE_ONE;
+   frequencyInfoDL->scs_SpecificCarrierList.list.count = elementCnt;
+   frequencyInfoDL->scs_SpecificCarrierList.list.size = \
+      elementCnt * sizeof(SCS_SpecificCarrier_t);
+   BuildScsSpecificCarrierListDl(&frequencyInfoDL->scs_SpecificCarrierList);
+
+   return ROK;
+}/* BuildFreqInfoDl */
+
+/*******************************************************************
+ *
+ * @brief Builds DL configuration common for SIB
+ *
+ * @details
+ *
+ *    Function : BuildDlCfgCommSib
+ *
+ *    Functionality:
+ *     Builds DL configuration common for SIB
+ *
+ * @params[in] DownlinkConfigCommonSIB_t pointer 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildDlCfgCommSib(DownlinkConfigCommonSIB_t *dlCfg)
+{
+   /* DL frequency info */
+   BuildFreqInfoDl(&dlCfg->frequencyInfoDL);
+   
+   /* BWP Downlink Common */
+   BuildBwpDlCommon(&dlCfg->initialDownlinkBWP);
+
+   /* BCCH Config */
+   BuildBcchConfig(&dlCfg->bcch_Config);
+
+   /* PCCH Config */
+   BuildPcchConfig(&dlCfg->pcch_Config);
+
+   return ROK;
+} /* BuildDlCfgCommSib */
+
+/*******************************************************************
+ *
+ * @brief Builds SCS specific carrier list for UL 
+ *
+ * @details
+ *
+ *    Function : BuildScsSpecificCarrierListUl
+ *
+ *    Functionality:
+ *       Builds SCS specific carrier list for UL
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildScsSpecificCarrierListUl
+(
+struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierList
+)
+{
+   uint8_t idx;
+   ScsSpecCarrier   duScsSpecCarrier;
+   duScsSpecCarrier = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.ulScsCarrier;
+   DU_ALLOC(scsCarrierList->list.array, scsCarrierList->list.size);
+   if(!scsCarrierList->list.array)
+   {
+       DU_LOG("\nDU APP : SCS Specific Carrier list memory allocation failed");
+       return RFAILED;
+   }
+   for(idx = 0; idx < scsCarrierList->list.count; idx++)
+   {
+      DU_ALLOC(scsCarrierList->list.array[idx], sizeof(SCS_SpecificCarrier_t));
+      if(!scsCarrierList->list.array[idx])
+      {
+         DU_LOG("\nDU APP : SCS Specific Carrier list memory allocation failed");
+         return RFAILED;
+      }
+   }
+   idx = 0;
+   scsCarrierList->list.array[idx]->offsetToCarrier = duScsSpecCarrier.scsOffset;
+   scsCarrierList->list.array[idx]->subcarrierSpacing = duScsSpecCarrier.scs;
+   scsCarrierList->list.array[idx]->carrierBandwidth = duScsSpecCarrier.scsBw;
+   return ROK;
+} /* End of BuildScsSpecificCarrierListUl */
+
+/*******************************************************************
+ *
+ * @brief Builds frequency infor for UL 
+ *
+ * @details
+ *
+ *    Function : BuildFreqInfoUl
+ *
+ *    Functionality:
+ *       Builds frequency infor for UL
+ *
+ * @params[in] FrequencyInfoUL_SIB_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildFreqInfoUl(FrequencyInfoUL_SIB_t *frequencyInfoUL)
+{
+   uint8_t elementCnt;
+   UlCfgCommon  ulCfg;
+
+   ulCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg;
+     
+   /* Subcarrier Spacing specifc carrier */
+   elementCnt = ODU_VALUE_ONE;
+   frequencyInfoUL->scs_SpecificCarrierList.list.count = elementCnt;
+   frequencyInfoUL->scs_SpecificCarrierList.list.size = \
+     elementCnt * sizeof(SCS_SpecificCarrier_t);
+   BuildScsSpecificCarrierListUl(&frequencyInfoUL->scs_SpecificCarrierList);
+
+   /* P-MAX */
+   DU_ALLOC(frequencyInfoUL->p_Max, sizeof(P_Max_t));
+   if(!frequencyInfoUL->p_Max)
+   {
+      DU_LOG("\nDU APP : UL Frequency Infoo  memory allocation failure");
+      return RFAILED;
+   }
+   *frequencyInfoUL->p_Max = ulCfg.pMax;
+
+   return ROK;
+}/* BuildFreqInfoUl */
+
+/*******************************************************************
+ *
+ * @brief Builds RACH configuration common 
+ *
+ * @details
+ *
+ *    Function : BuildRachCfgCommon
+ *
+ *    Functionality:
+ *      Builds RACH configuration common
+ *
+ * @params[in] BWP_UplinkCommon__rach_ConfigCommon pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16  BuildRachCfgCommon(struct BWP_UplinkCommon__rach_ConfigCommon *rachCfg)
+{
+   RachCfgCommon    duRachCfg;
+   RACH_ConfigCommon_t  *setup;
+
+   duRachCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.rachCfg;
+
+   rachCfg->present = duRachCfg.present;
+   switch(rachCfg->present)
+   {
+      case BWP_UplinkCommon__rach_ConfigCommon_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__rach_ConfigCommon_PR_release:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__rach_ConfigCommon_PR_setup:
+      {
+         DU_ALLOC(rachCfg->choice.setup, sizeof(RACH_ConfigCommon_t)); 
+         if(!rachCfg->choice.setup)
+         {
+            DU_LOG("\nDU APP : Rach Config memory alloc failed");
+            return RFAILED;
+         }
+         setup = rachCfg->choice.setup;
+
+         /* Generic RACH Configuration */
+         setup->rach_ConfigGeneric.prach_ConfigurationIndex = duRachCfg.prachCfgIdx;
+         setup->rach_ConfigGeneric.msg1_FDM = duRachCfg.msg1Fdm;
+         setup->rach_ConfigGeneric.msg1_FrequencyStart = duRachCfg.msg1FreqStart;
+         setup->rach_ConfigGeneric.zeroCorrelationZoneConfig = duRachCfg.zeroCorrZoneCfg;
+         setup->rach_ConfigGeneric.preambleReceivedTargetPower = duRachCfg.preambleRcvdTgtPwr; 
+         setup->rach_ConfigGeneric.preambleTransMax = duRachCfg.preambleTransMax;
+         setup->rach_ConfigGeneric.powerRampingStep = duRachCfg.pwrRampingStep;
+         setup->rach_ConfigGeneric.ra_ResponseWindow = duRachCfg.raRspWindow;
+
+         /* Total number of RA preambles */
+         DU_ALLOC(setup->totalNumberOfRA_Preambles, sizeof(long));
+         if(!setup->totalNumberOfRA_Preambles)
+         {
+            DU_LOG("\nDU APP : Rach Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->totalNumberOfRA_Preambles = duRachCfg.numRaPreamble;
+
+         /* SSB per RACH occassion and CB Preambles per SSB */
+         DU_ALLOC(setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB,\
+          sizeof(struct RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
+         if(!setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB)
+         {
+            DU_LOG("\nDU APP : Rach Config memory alloc failed");
+            return RFAILED;
+         }
+         setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = \
+            duRachCfg.ssbPerRachOccPresent;
+         switch(setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present)
+         {
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_NOTHING:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
+            {
+               setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one =\
+                  duRachCfg.numSsbPerRachOcc;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
+            {
+               //TODO
+               break;
+            }
+            default:
+            {
+               DU_LOG("\nDU APP: Invalid value for \
+                  ssb_PerRach_OccassionAndCB_PreamblesPerSSB");
+               return RFAILED;
+            }
+         }
+
+         /* RA Contention Resolution Timer */
+         setup->ra_ContentionResolutionTimer = duRachCfg.contResTimer;
+
+         /* RSRP Threshold SSB */
+         DU_ALLOC(setup->rsrp_ThresholdSSB, sizeof(RSRP_Range_t));
+         if(!setup->rsrp_ThresholdSSB)
+         {
+            DU_LOG("\nDU APP : Rach Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->rsrp_ThresholdSSB = duRachCfg.rsrpThreshSsb;
+
+         /* Root Sequence index */
+         setup->prach_RootSequenceIndex.present = duRachCfg.rootSeqIdxPresent;
+         switch(setup->prach_RootSequenceIndex.present)
+         {
+            case RACH_ConfigCommon__prach_RootSequenceIndex_PR_NOTHING:
+            {
+               //TODO
+               break;
+            }
+            case RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839:
+            {
+               //TODO
+               break;;
+            }
+            case RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139:
+            {
+               setup->prach_RootSequenceIndex.choice.l139 = duRachCfg.rootSeqIdx;
+               break;
+            }
+            default:
+            {
+               DU_LOG("\nDU APP: Inavlid PRACH root sequence index type");
+               return RFAILED;
+            }
+         }
+         
+         /* Msg 1 Subcarrier spacing */
+         DU_ALLOC(setup->msg1_SubcarrierSpacing, sizeof(SubcarrierSpacing_t));
+         if(!setup->msg1_SubcarrierSpacing)
+         {
+            DU_LOG("\nDU APP : Rach Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->msg1_SubcarrierSpacing = duRachCfg.msg1Scs;
+
+         /* Restricted Set Config */
+         setup->restrictedSetConfig = duRachCfg.restrictedSetCfg;
+
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP : Invalid RACH Config type ");
+         return RFAILED;
+      }
+   }
+   return ROK;
+}/* BuildRachCfgCommon */
+
+/*******************************************************************
+ *
+ * @brief Builds PUSCH configuration for common 
+ *
+ * @details
+ *
+ *    Function : BuildPuschCfgCommon
+ *
+ *    Functionality:
+ *      Builds PUSCH configuration for common
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCfg)
+{
+   uint8_t           idx;
+   uint8_t           elementCnt;   
+   PuschCfgCommon    duPuschCfg;
+   PUSCH_ConfigCommon_t *setup;
+   PUSCH_TimeDomainResourceAllocation_t  *timeDomRsrcAllocInfo;
+  
+   duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg;
+   puschCfg->present = duPuschCfg.present;
+   switch(puschCfg->present)
+   {
+      case BWP_UplinkCommon__pusch_ConfigCommon_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__pusch_ConfigCommon_PR_release:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__pusch_ConfigCommon_PR_setup:
+      {
+         DU_ALLOC(puschCfg->choice.setup, sizeof(PUSCH_ConfigCommon_t));
+         if(!puschCfg->choice.setup)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+         setup = puschCfg->choice.setup;
+
+         /* Time Domain Resource Allocation List */
+         DU_ALLOC(setup->pusch_TimeDomainAllocationList,\
+            sizeof(PUSCH_TimeDomainResourceAllocationList_t)); 
+         if(!setup->pusch_TimeDomainAllocationList)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+         elementCnt = ODU_VALUE_ONE;
+         setup->pusch_TimeDomainAllocationList->list.count = elementCnt;
+         setup->pusch_TimeDomainAllocationList->list.size = \
+            elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t);
+
+         DU_ALLOC(setup->pusch_TimeDomainAllocationList->list.array, \
+            setup->pusch_TimeDomainAllocationList->list.size);
+         if(!setup->pusch_TimeDomainAllocationList->list.array)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+
+         for(idx=0; idx<elementCnt; idx++)
+         {
+            DU_ALLOC(setup->pusch_TimeDomainAllocationList->list.array[idx],\
+               sizeof(PUSCH_TimeDomainResourceAllocation_t));
+            if(!setup->pusch_TimeDomainAllocationList->list.array[idx])
+            {
+               DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+               return RFAILED;
+            }
+         }
+
+         idx = 0;
+         timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx];
+
+         /* K2 */
+         DU_ALLOC(timeDomRsrcAllocInfo->k2, sizeof(long));
+         if(!timeDomRsrcAllocInfo->k2)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *timeDomRsrcAllocInfo->k2 = duPuschCfg.k2;
+
+         timeDomRsrcAllocInfo->mappingType = duPuschCfg.mapType;
+         timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.startSymbAndLen;
+         
+         /* Msg3 Delta Preamble */
+         DU_ALLOC(setup->msg3_DeltaPreamble, sizeof(long));
+         if(!setup->msg3_DeltaPreamble)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->msg3_DeltaPreamble = duPuschCfg.msg3DeltaPreamble;
+
+         /* P0 Nominal with grnat */
+         DU_ALLOC(setup->p0_NominalWithGrant, sizeof(long));
+         if(!setup->p0_NominalWithGrant)
+         {
+            DU_LOG("\nDU APP : PUSCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->p0_NominalWithGrant = duPuschCfg.p0NominalWithGrant;
+
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP : Invalid PUSCH configuration type ");
+         return RFAILED;
+      }
+   }
+
+   return ROK;
+}/* BuildPuschCfgCommon */
+
+/*******************************************************************
+ *
+ * @brief  Builds PUCCH configuration common
+ *
+ * @details
+ *
+ *    Function : BuildPucchCfgCommon
+ *
+ *    Functionality:
+ *      Builds PUCCH configuration common
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildPucchCfgCommon( struct BWP_UplinkCommon__pucch_ConfigCommon *pucchCfg)
+{
+   PucchCfgCommon    duPucchCfg;
+   PUCCH_ConfigCommon_t *setup;
+
+   duPucchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.pucchCfg;
+   pucchCfg->present = duPucchCfg.present;
+   switch(pucchCfg->present)
+   {
+      case BWP_UplinkCommon__pucch_ConfigCommon_PR_NOTHING:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__pucch_ConfigCommon_PR_release:
+      {
+         //TODO
+         break;
+      }
+      case BWP_UplinkCommon__pucch_ConfigCommon_PR_setup:
+      {
+         DU_ALLOC(pucchCfg->choice.setup, sizeof(PUCCH_ConfigCommon_t));
+         if(!pucchCfg->choice.setup)
+         {
+            DU_LOG("\nDU APP : PUCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         setup = pucchCfg->choice.setup;
+         
+         /* Resource Common */
+         DU_ALLOC(setup->pucch_ResourceCommon, sizeof(long));
+         if(!setup->pucch_ResourceCommon)
+         {
+            DU_LOG("\nDU APP : PUCCH Config memory alloc failed");
+            return RFAILED;
+         }
+         *setup->pucch_ResourceCommon = duPucchCfg.rsrcComm;
+
+         /* Group hopping */
+         setup->pucch_GroupHopping = duPucchCfg.grpHop;
+
+         /* P0 nominal */
+         DU_ALLOC(setup->p0_nominal, sizeof(long));
+         if(!setup->p0_nominal)
+         {
+           DU_LOG("\nDU APP : PUCCH Config memory alloc failed");
+           return RFAILED;
+         }
+         *setup->p0_nominal = duPucchCfg.p0Nominal;
+
+         break;
+      }
+      default:
+      {
+         DU_LOG("\nDU APP : Invalid PUCCH Config type");
+         return RFAILED;
+      }
+   }
+   return ROK;
+}/* BuildPucchCfgCommon */
+
+/*******************************************************************
+ *
+ * @brief Builds UL BWP Common 
+ *
+ * @details
+ *
+ *    Function : BuildBwpUlCommon
+ *
+ *    Functionality:
+ *      Builds UL BWP Common 
+ *
+ * @params[in] BWP_UplinkCommon_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildBwpUlCommon(BWP_UplinkCommon_t *bwp)
+{
+   UlCfgCommon duUlCfg;
+   duUlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg;
+   bwp->genericParameters.locationAndBandwidth = duUlCfg.locAndBw;
+   bwp->genericParameters.subcarrierSpacing = duUlCfg.ulScsCarrier.scs;
+   /* RACH Config Common */
+   DU_ALLOC(bwp->rach_ConfigCommon,\
+      sizeof(struct BWP_UplinkCommon__rach_ConfigCommon));
+   if(!bwp->rach_ConfigCommon)
+   {
+      DU_LOG("\nDU APP : UL BWP memory allocation failed");
+      return RFAILED;
+   }
+   BuildRachCfgCommon(bwp->rach_ConfigCommon);
+
+   /* PUSCH Config Common */
+   DU_ALLOC(bwp->pusch_ConfigCommon,\
+      sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon));
+   if(!bwp->pusch_ConfigCommon)
+   {
+      DU_LOG("\nDU APP : UL BWP memory allocation failed");
+      return RFAILED;
+   } 
+   BuildPuschCfgCommon(bwp->pusch_ConfigCommon);
+
+   /* PUCCH Config Common */
+   DU_ALLOC(bwp->pucch_ConfigCommon,\
+      sizeof(struct BWP_UplinkCommon__pucch_ConfigCommon));
+   if(!bwp->pucch_ConfigCommon)
+   {
+      DU_LOG("\nDU APP : UL BWP memory allocation failed");
+      return RFAILED;
+   } 
+   BuildPucchCfgCommon(bwp->pucch_ConfigCommon);
+
+   return ROK;
+}/* BuildBwpUlCommon */
+
+/*******************************************************************
+ *
+ * @brief Builds UL config common for SIB 
+ *
+ * @details
+ *
+ *    Function : BuildUlCfgCommSib
+ *
+ *    Functionality:
+ *      Builds UL config common for SIB
+ *
+ * @params[in] UplinkConfigCommonSIB_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildUlCfgCommSib(UplinkConfigCommonSIB_t *ulCfg)
+{
+   /* UL frequency info */
+   BuildFreqInfoUl(&ulCfg->frequencyInfoUL);
+
+   /* BWP Uplink Common */
+   BuildBwpUlCommon(&ulCfg->initialUplinkBWP);
+
+   /* Time Alignment timer */
+   ulCfg->timeAlignmentTimerCommon = \
+     duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.timeAlignTimerComm;
+
+   return ROK;
+}/* BuildUlCfgCommSib */
+
+/*******************************************************************
+ *
+ * @brief Builds TDD UL DL configuration common 
+ *
+ * @details
+ *
+ *    Function : BuildTddUlDlCfgComm
+ *
+ *    Functionality:
+ *      Builds TDD UL DL configuration common
+ *
+ * @params[in] TDD_UL_DL_ConfigCommon_t pointer 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 BuildTddUlDlCfgComm(TDD_UL_DL_ConfigCommon_t *tddCfg)
+{
+   TddUlDlCfgCommon duTddCfg;
+
+   duTddCfg = duCfgParam.sib1Params.srvCellCfgCommSib.tddCfg;
+
+   /* Reference Subcarrier spacing */
+   tddCfg->referenceSubcarrierSpacing = duTddCfg.refScs;
+
+   /* Pattern 1*/
+   tddCfg->pattern1.dl_UL_TransmissionPeriodicity = duTddCfg.txPrd;
+   tddCfg->pattern1.nrofDownlinkSlots = duTddCfg.numDlSlots;
+   tddCfg->pattern1.nrofDownlinkSymbols = duTddCfg.numDlSymbols;
+   tddCfg->pattern1.nrofUplinkSlots = duTddCfg.numUlSlots;
+   tddCfg->pattern1.nrofUplinkSymbols = duTddCfg.numUlSymbols;
+   
+   return ROK;
+
+}/* BuildTddUlDlCfgComm */
+/*******************************************************************
+ * 
+ * @brief Builds Serving cell config common in SIB1 message 
+ * 
+ * @details
+ * 
+ *     Function : BuildServCellCfgCommonSib
+ * 
+ *    Functionality: 
+ *       Building Serving cell config common in SIB1 message
+ *
+ * @params[in] ServingCellConfigCommonSIB_t pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 BuildServCellCfgCommonSib(ServingCellConfigCommonSIB_t *srvCellCfg)
+{
+   SrvCellCfgCommSib    duSrvCellCfg;
+   BIT_STRING_t         *ssbPosInBurst;
+
+   duSrvCellCfg = duCfgParam.sib1Params.srvCellCfgCommSib;
+
+   /* SSB Position in Burst */
+   ssbPosInBurst = &srvCellCfg->ssb_PositionsInBurst.inOneGroup;
+   ssbPosInBurst->size = 1;
+   DU_ALLOC(ssbPosInBurst->buf, ssbPosInBurst->size * sizeof(uint8_t));
+   if(!ssbPosInBurst->buf)
+   {
+      DU_LOG("\nDU APP : Serving cell config common  memory allocation failure");
+      return RFAILED;
+   } 
+   ssbPosInBurst->buf[0] = duSrvCellCfg.ssbPosInBurst;  
+   ssbPosInBurst->bits_unused = 0;
+
+   srvCellCfg->ssb_PeriodicityServingCell = duSrvCellCfg.ssbPrdServingCell;
+   srvCellCfg->ss_PBCH_BlockPower = duSrvCellCfg.ssPbchBlockPwr;
+
+   /* Downlink config common */
+   BuildDlCfgCommSib(&srvCellCfg->downlinkConfigCommon);
+
+   /* Uplink Config Comm */
+   DU_ALLOC(srvCellCfg->uplinkConfigCommon, sizeof(UplinkConfigCommonSIB_t));
+   if(!srvCellCfg->uplinkConfigCommon)
+   {
+      DU_LOG("\nDU APP : Serving cell config common  memory allocation failure");
+      return RFAILED;
+   }
+   BuildUlCfgCommSib(srvCellCfg->uplinkConfigCommon);
+
+   /* TDD UL DL Config Comm */
+   DU_ALLOC(srvCellCfg->tdd_UL_DL_ConfigurationCommon, sizeof(TDD_UL_DL_ConfigCommon_t));
+   if(!srvCellCfg->tdd_UL_DL_ConfigurationCommon)
+   {
+      DU_LOG("\nDU APP : Serving cell config common  memory allocation failure");
+      return RFAILED;
+   }
+   BuildTddUlDlCfgComm(srvCellCfg->tdd_UL_DL_ConfigurationCommon);
+
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds SIB message in Served Cell Info
+ *
+ * @details
+ *
+ *    Function : BuildSib1Msg
+ *
+ *    Functionality: Building SIB message in Served Cell Info
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+int BuildSib1Msg()
+{
+       SIB1_t                   *sib1Msg;
+       CellAccessRelatedInfo_t  *cellAccessInfo;
+       U8                       elementCnt;
+       U8                       idx, idx1, idx2;
+       asn_enc_rval_t           encRetVal;
+       TrackingAreaCode_t       *tac;
+       RAN_AreaCode_t           *ranac;
+       CellIdentity_t           *cellIdentity;
+   SIB_Mapping_t            *sibMapInfo;
+   ServingCellConfigCommonSIB_t     *srvCellCfg;
+   DownlinkConfigCommonSIB_t        *dlCfg;
+   UplinkConfigCommonSIB_t          *ulCfg;
+   FrequencyInfoDL_SIB_t            *frequencyInfoDL;
+   FrequencyInfoUL_SIB_t            *frequencyInfoUL;
+   BWP_DownlinkCommon_t             *bwpDl;
+   BWP_UplinkCommon_t               *bwpUl;
+   PDCCH_ConfigCommon_t             *pdcchSetup;
+   SearchSpace_t                    *pdcchSearchSpace;
+   PDSCH_ConfigCommon_t             *pdschSetup;
+   RACH_ConfigCommon_t              *rachSetup;
+   PUSCH_ConfigCommon_t             *puschSetup;
+   PUCCH_ConfigCommon_t             *pucchSetup;
+   struct PLMN_IdentityInfo__plmn_IdentityList     *plmnIdInfo;
+   struct SI_SchedulingInfo__schedulingInfoList    *si_SchedulingInfoList;
+   struct BWP_DownlinkCommon__pdcch_ConfigCommon   *pdcchCfg;
+   struct BWP_DownlinkCommon__pdsch_ConfigCommon   *pdschCfg;
+   struct BWP_UplinkCommon__rach_ConfigCommon      *rachCfg;
+   struct BWP_UplinkCommon__pusch_ConfigCommon     *puschCfg;
+   struct BWP_UplinkCommon__pucch_ConfigCommon     *pucchCfg;
+   struct FrequencyInfoDL_SIB__scs_SpecificCarrierList *scsCarrierList;
+   struct FrequencyInfoUL_SIB__scs_SpecificCarrierList *scsCarrierListUl;
+   struct PDCCH_ConfigCommon__commonSearchSpaceList *pdcchSearchSpclist;
+  
+
+       DU_ALLOC(sib1Msg, sizeof(SIB1_t));
+       if(!sib1Msg)
+       {   
+               DU_LOG("DU APP: SIB1 msg memory allocation failure");
+               return RFAILED;
+       }   
+   
+       elementCnt = ODU_VALUE_ONE;
+
+   /* PLMN list */
+       cellAccessInfo = &sib1Msg->cellAccessRelatedInfo;
+       cellAccessInfo->plmn_IdentityList.list.count =
+               elementCnt;
+       cellAccessInfo->plmn_IdentityList.list.size
+               = elementCnt * sizeof(PLMN_IdentityInfo_t);
+
+   BuildPlmnList(cellAccessInfo);
+
+   /* Connection Establish Failure Control */
+   DU_ALLOC(sib1Msg->connEstFailureControl, sizeof(ConnEstFailureControl_t));
+   if(!sib1Msg->connEstFailureControl)
+   {
+      DU_LOG("DU APP: sib1Msg->connEstFailureControl memory allocation failure");
+      return RFAILED;
+   }
+   sib1Msg->connEstFailureControl->connEstFailCount =\
+      duCfgParam.sib1Params.connEstFailCnt;
+   sib1Msg->connEstFailureControl->connEstFailOffsetValidity =\
+      duCfgParam.sib1Params.connEstFailOffValidity;
+
+   /* SI Scheduling Info */
+   DU_ALLOC(sib1Msg->si_SchedulingInfo, sizeof(SI_SchedulingInfo_t));
+   if(!sib1Msg->si_SchedulingInfo)
+   {
+      DU_LOG("DU APP: sib1Msg->si_SchedulingInfo memory allocation failure");
+      return RFAILED;
+   } 
+   elementCnt = ODU_VALUE_ONE;
+   sib1Msg->si_SchedulingInfo->schedulingInfoList.list.count = elementCnt;
+   sib1Msg->si_SchedulingInfo->schedulingInfoList.list.size = elementCnt * sizeof(struct SchedulingInfo);
+   BuildSiSchedInfoList(&sib1Msg->si_SchedulingInfo->schedulingInfoList);
+   sib1Msg->si_SchedulingInfo->si_WindowLength = duCfgParam.sib1Params.siSchedInfo.winLen;
+
+   /* Serving Cell Config Common */
+   DU_ALLOC(sib1Msg->servingCellConfigCommon, sizeof(ServingCellConfigCommonSIB_t));
+   if(!sib1Msg->servingCellConfigCommon)
+   {
+      DU_LOG("DU APP: sib1Msg->servingCellConfigCommon memory allocation failure");
+      return RFAILED;
+   }
+   BuildServCellCfgCommonSib(sib1Msg->servingCellConfigCommon);
+
+
+   xer_fprint(stdout, &asn_DEF_SIB1, sib1Msg);
+
+       /* Encode the F1SetupRequest type as APER */
+       cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
+       encBufSize = 0;
+       encRetVal = aper_encode(&asn_DEF_SIB1, 0, sib1Msg, PrepFinalEncBuf,\
+                       encBuf);
+       printf("\nencbufSize: %d\n", encBufSize);
+       if(encRetVal.encoded == -1)
+       {
+               DU_LOG("\nDU APP : Could not encode SIB1 structure (at %s)\n",\
+                               encRetVal.failed_type ?
+                               encRetVal.failed_type->name :
+                               "unknown");
+               return RFAILED;
+       }
+       for(int i=0; i< encBufSize; i++)
+       {
+               printf("%x\t",encBuf[i]);
+       }
+       printf("\n");
+
+       /* Free allocated memeory */
+
+   /* Free serving cell config common */
+   srvCellCfg = sib1Msg->servingCellConfigCommon;
+
+   /* Free downling config common */
+   dlCfg = &srvCellCfg->downlinkConfigCommon;
+
+   /* Free DL frequency info */
+   frequencyInfoDL = &dlCfg->frequencyInfoDL;
+
+   for(idx = 0; idx < frequencyInfoDL->frequencyBandList.list.count; idx++)
+   {
+      DU_FREE(frequencyInfoDL->frequencyBandList.list.array[idx]->\
+         freqBandIndicatorNR, sizeof(FreqBandIndicatorNR_t));
+      DU_FREE(frequencyInfoDL->frequencyBandList.list.array[idx],\
+            sizeof(NR_MultiBandInfo_t));
+   }
+   DU_FREE(frequencyInfoDL->frequencyBandList.list.array, \
+      frequencyInfoDL->frequencyBandList.list.size);
+
+   scsCarrierList = &frequencyInfoDL->scs_SpecificCarrierList;
+   for(idx = 0; idx < scsCarrierList->list.count; idx++)
+   {
+      DU_FREE(scsCarrierList->list.array[idx], sizeof(SCS_SpecificCarrier_t));
+   }
+   DU_FREE(scsCarrierList->list.array, scsCarrierList->list.size);
+
+   /* Free BWP DL common */
+   bwpDl = &dlCfg->initialDownlinkBWP;
+  
+   /* Free PDCCH config common */
+   pdcchCfg = bwpDl->pdcch_ConfigCommon;
+   pdcchSetup = pdcchCfg->choice.setup;
+
+   DU_FREE(pdcchSetup->controlResourceSetZero, sizeof(ControlResourceSetZero_t));
+   DU_FREE(pdcchSetup->searchSpaceZero, sizeof(SearchSpaceZero_t));
+
+   pdcchSearchSpclist = pdcchSetup->commonSearchSpaceList;
+   for(idx = 0; idx < pdcchSearchSpclist->list.count; idx++)
+   {
+      pdcchSearchSpace = pdcchSearchSpclist->list.array[idx];
+
+      DU_FREE(pdcchSearchSpace->controlResourceSetId, \
+         sizeof(ControlResourceSetId_t));
+      DU_FREE(pdcchSearchSpace->monitoringSlotPeriodicityAndOffset,\
+         sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
+      DU_FREE(pdcchSearchSpace->monitoringSymbolsWithinSlot->buf, \
+         pdcchSearchSpace->monitoringSymbolsWithinSlot->size * sizeof(uint8_t));
+      DU_FREE(pdcchSearchSpace->monitoringSymbolsWithinSlot,\
+         sizeof(BIT_STRING_t));
+      DU_FREE(pdcchSearchSpace->nrofCandidates,\
+         sizeof(struct SearchSpace__nrofCandidates));
+      DU_FREE(pdcchSearchSpace->searchSpaceType->choice.common->\
+         dci_Format0_0_AndFormat1_0, sizeof(struct \
+         SearchSpace__searchSpaceType__common__dci_Format0_0_AndFormat1_0));
+      DU_FREE(pdcchSearchSpace->searchSpaceType->choice.common,\
+         sizeof(struct SearchSpace__searchSpaceType__common));
+      DU_FREE(pdcchSearchSpace->searchSpaceType,\
+         sizeof( struct SearchSpace__searchSpaceType));
+
+      DU_FREE(pdcchSearchSpclist->list.array[idx], sizeof(SearchSpace_t));
+   }
+   DU_FREE(pdcchSearchSpclist->list.array, pdcchSearchSpclist->list.size);
+
+   DU_FREE(pdcchSetup->commonSearchSpaceList,\
+      sizeof(struct PDCCH_ConfigCommon__commonSearchSpaceList));
+   DU_FREE(pdcchSetup->searchSpaceSIB1, sizeof(SearchSpaceId_t));
+   DU_FREE(pdcchSetup->pagingSearchSpace, sizeof(SearchSpaceId_t));
+   DU_FREE(pdcchSetup->ra_SearchSpace, sizeof(SearchSpaceId_t));
+
+   DU_FREE(pdcchCfg->choice.setup, sizeof(PDCCH_ConfigCommon_t));
+   DU_FREE(bwpDl->pdcch_ConfigCommon, \
+      sizeof(struct BWP_DownlinkCommon__pdcch_ConfigCommon));
+
+   /* Free PDSCH Config Common */
+   pdschCfg = bwpDl->pdsch_ConfigCommon;
+   pdschSetup = pdschCfg->choice.setup;
+
+   for(idx=0; idx<pdschSetup->pdsch_TimeDomainAllocationList->list.count; idx++)
+   {
+      DU_FREE(pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx]->k0, \
+         sizeof(long));
+      DU_FREE(pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx],\
+         sizeof(PDSCH_TimeDomainResourceAllocation_t));
+   }
+   DU_FREE(pdschSetup->pdsch_TimeDomainAllocationList->list.array,\
+      pdschSetup->pdsch_TimeDomainAllocationList->list.size);
+   DU_FREE(pdschSetup->pdsch_TimeDomainAllocationList, \
+      sizeof(PDSCH_TimeDomainResourceAllocationList_t));
+   DU_FREE(pdschCfg->choice.setup, sizeof(PDSCH_ConfigCommon_t));
+   DU_FREE(bwpDl->pdsch_ConfigCommon, \
+      sizeof(struct BWP_DownlinkCommon__pdsch_ConfigCommon));
+
+   /* Free Uplink Config Common */
+   ulCfg = srvCellCfg->uplinkConfigCommon;
+
+   /* Free UL Frequency Info */
+   frequencyInfoUL = &ulCfg->frequencyInfoUL;
+   scsCarrierListUl = &frequencyInfoUL->scs_SpecificCarrierList;
+   for(idx = 0; idx < scsCarrierListUl->list.count; idx++)
+   {
+      DU_FREE(scsCarrierListUl->list.array[idx], sizeof(SCS_SpecificCarrier_t));
+   }
+   DU_FREE(scsCarrierListUl->list.array, scsCarrierList->list.size);
+   DU_FREE(frequencyInfoUL->p_Max, sizeof(P_Max_t));
+
+   /* Free BWP Uplink common */
+   bwpUl = &ulCfg->initialUplinkBWP;
+
+   /* Free RACH config Common */
+   rachCfg = bwpUl->rach_ConfigCommon;
+   rachSetup = rachCfg->choice.setup;
+   DU_FREE(rachSetup->totalNumberOfRA_Preambles, sizeof(long));
+   DU_FREE(rachSetup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB,\
+      sizeof(struct RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
+   DU_FREE(rachSetup->rsrp_ThresholdSSB, sizeof(RSRP_Range_t));
+   DU_FREE(rachSetup->msg1_SubcarrierSpacing, sizeof(SubcarrierSpacing_t));
+   DU_FREE(rachCfg->choice.setup, sizeof(RACH_ConfigCommon_t));
+   DU_FREE(bwpUl->rach_ConfigCommon, \
+      sizeof(struct BWP_UplinkCommon__rach_ConfigCommon));
+
+   /* Free PUSCH Config Common */
+   puschCfg = bwpUl->pusch_ConfigCommon;
+   puschSetup = puschCfg->choice.setup;
+   for(idx=0; idx<puschSetup->pusch_TimeDomainAllocationList->list.count; idx++)
+   {
+      DU_FREE(puschSetup->pusch_TimeDomainAllocationList->list.array[idx]->k2,\
+         sizeof(long));
+      DU_FREE(puschSetup->pusch_TimeDomainAllocationList->list.array[idx],\
+         sizeof(PUSCH_TimeDomainResourceAllocation_t));
+   }
+   DU_FREE(puschSetup->pusch_TimeDomainAllocationList->list.array, \
+      puschSetup->pusch_TimeDomainAllocationList->list.size);
+   DU_FREE(puschSetup->pusch_TimeDomainAllocationList,\
+      sizeof(PUSCH_TimeDomainResourceAllocationList_t));
+   DU_FREE(puschSetup->msg3_DeltaPreamble, sizeof(long));
+   DU_FREE(puschSetup->p0_NominalWithGrant, sizeof(long));
+   DU_FREE(puschCfg->choice.setup, sizeof(PUSCH_ConfigCommon_t));
+   DU_FREE(bwpUl->pusch_ConfigCommon,\
+      sizeof(struct BWP_UplinkCommon__pusch_ConfigCommon));
+
+
+   /* Free PUCCH Config Common */
+   pucchCfg = bwpUl->pucch_ConfigCommon;
+   pucchSetup = pucchCfg->choice.setup;
+   DU_FREE(pucchSetup->pucch_ResourceCommon, sizeof(long));
+   DU_FREE(pucchSetup->p0_nominal, sizeof(long));
+   DU_FREE(pucchCfg->choice.setup, sizeof(PUCCH_ConfigCommon_t));
+   DU_FREE(bwpUl->pucch_ConfigCommon,\
+      sizeof(struct BWP_UplinkCommon__pucch_ConfigCommon));
+
+   DU_FREE(srvCellCfg->uplinkConfigCommon, sizeof(UplinkConfigCommonSIB_t));
+
+   DU_FREE(srvCellCfg->ssb_PositionsInBurst.inOneGroup.buf, \
+      srvCellCfg->ssb_PositionsInBurst.inOneGroup.size * sizeof(uint8_t));
+   DU_FREE(sib1Msg->servingCellConfigCommon, sizeof(ServingCellConfigCommonSIB_t));
+
+       /* Free PLMN List */
+
+       for(idx=0; idx<cellAccessInfo->plmn_IdentityList.list.count; idx++)
+       {
+               plmnIdInfo = &cellAccessInfo->plmn_IdentityList.list.array[idx]->\
+                                                plmn_IdentityList;
+               for(idx1=0; idx1<plmnIdInfo->list.count; idx1++)
+               {
+                       for(idx2=0; idx2<plmnIdInfo->list.array[idx1]->mnc.list.count; idx2++)
+                       {
+                               DU_FREE(plmnIdInfo->list.array[idx1]->mcc->list.array[idx2],
+                                               sizeof(MCC_MNC_Digit_t));
+                               DU_FREE(plmnIdInfo->list.array[idx1]->mnc.list.array[idx2],
+                                               sizeof(MCC_MNC_Digit_t));
+                       }
+                       DU_FREE(plmnIdInfo->list.array[idx1]->mcc->list.array,
+                                       plmnIdInfo->list.array[idx1]->mcc->list.size);
+                       DU_FREE(plmnIdInfo->list.array[idx1]->mnc.list.array,
+                                       plmnIdInfo->list.array[idx1]->mnc.list.size);
+                       DU_FREE(plmnIdInfo->list.array[idx1]->mcc,
+                                       sizeof(MCC_t));
+                       DU_FREE(plmnIdInfo->list.array[idx1],
+                                       sizeof(PLMN_IdentitY_t));
+               }
+               DU_FREE(cellAccessInfo->plmn_IdentityList.list.array[idx],
+                               sizeof(PLMN_IdentityInfo_t));
+               cellIdentity =\
+                                                 &cellAccessInfo->plmn_IdentityList.list.array[idx]->cellIdentity;
+               DU_FREE(cellIdentity->buf, cellIdentity->size);
+
+               ranac = cellAccessInfo->plmn_IdentityList.list.array[idx]->ranac;
+               DU_FREE(ranac, sizeof(RAN_AreaCode_t));
+
+               tac = cellAccessInfo->plmn_IdentityList.list.array[idx]->trackingAreaCode;
+               DU_FREE(tac->buf, tac->size);
+               DU_FREE(tac, sizeof(TrackingAreaCode_t));
+       }
+       DU_FREE(cellAccessInfo->plmn_IdentityList.list.array,
+                       cellAccessInfo->plmn_IdentityList.list.size);
+
+   si_SchedulingInfoList = &sib1Msg->si_SchedulingInfo->schedulingInfoList;
+   for(idx = 0; idx < si_SchedulingInfoList->list.count; idx++)
+   {
+      sibMapInfo = &si_SchedulingInfoList->list.array[idx]->sib_MappingInfo;
+      for(idx1 = 0; idx1 < sibMapInfo->list.count; idx1++)
+      {
+         DU_FREE(sibMapInfo->list.array[idx1]->valueTag, sizeof(long));
+         DU_FREE(sibMapInfo->list.array[idx1], sizeof(SIB_TypeInfo_t));
+      }
+      DU_FREE(sibMapInfo->list.array, sibMapInfo->list.size);
+      DU_FREE(si_SchedulingInfoList->list.array[idx], sizeof(struct SchedulingInfo));
+   }
+   DU_FREE(si_SchedulingInfoList->list.array, si_SchedulingInfoList->list.size);
+   DU_FREE(sib1Msg->si_SchedulingInfo, sizeof(SI_SchedulingInfo_t));
+   DU_FREE(sib1Msg->connEstFailureControl, sizeof(ConnEstFailureControl_t));
 
        DU_FREE(sib1Msg, sizeof(SIB1_t));
    return ROK;
index 98dd354..33fede1 100644 (file)
 #define ODU_VALUE_FOUR 4
 #define ODU_VALUE_FIVE 5
 #define ODU_VALUE_SEVEN 7
+#define ODU_VALUE_EIGHT 8
+#define ODU_VALUE_NINE  9 
+#define ODU_VALUE_TEN  10
+
 
 /* Function declarations */
 int BuildMibPdu();
index 7a800af..61b1f30 100644 (file)
@@ -9,18 +9,19 @@ void *GenerateTicks(void *arg)
    while(1)
    {
       sleep(1);
-      printf("\nTTI indication");
-      /* Send TTI indication to CL */
-      duSendEgtpTTIInd();
+      printf("\nPHY STUB : Slot indication");
+
+      /* Send Slot indication indication to lower mac */
+      //buildAndSendSlotIndication();
    }
 }
 
-void duStartTtiThread()
+void duStartSlotIndicaion()
 {
-   pthread_t ttiThread;
+   pthread_t thread;
    int ret;
 
-   ret = pthread_create(&ttiThread, NULL, GenerateTicks, NULL);
+   ret = pthread_create(&thread, NULL, GenerateTicks, NULL);
    if(ret)
    {
       printf("\nUnable to create thread");