macCellCfg 66/2766/1
authorbalajihands <balaji.shankaran@radisys.com>
Thu, 12 Mar 2020 10:58:21 +0000 (16:28 +0530)
committerbalajihands <balaji.shankaran@radisys.com>
Thu, 12 Mar 2020 10:58:36 +0000 (16:28 +0530)
Change-Id: I970b68f7196a0618c6e3f52ae255bbfe3a4b3c10
Signed-off-by: balajihands <balaji.shankaran@radisys.com>
37 files changed:
build/common/mac.mak
src/5gnrmac/lwr_mac.h
src/5gnrmac/rg.x
src/5gnrmac/rg_cfg.c
src/5gnrmac/rg_cl.h
src/5gnrmac/rg_cl_cfg.c
src/5gnrmac/rg_cl_li.c
src/5gnrmac/rg_cl_util.c
src/5gnrmac/rg_com.c
src/5gnrmac/rg_dbm.c
src/5gnrmac/rg_dhm.c
src/5gnrmac/rg_dux.c
src/5gnrmac/rg_ex_ms.c
src/5gnrmac/rg_l2m.c
src/5gnrmac/rg_lim.c
src/5gnrmac/rg_lmm.c
src/5gnrmac/rg_mux.c
src/5gnrmac/rg_pom_scell.c
src/5gnrmac/rg_prg.c
src/5gnrmac/rg_prg_pt.c
src/5gnrmac/rg_ram.c
src/5gnrmac/rg_rom.c
src/5gnrmac/rg_tom.c
src/5gnrmac/rg_uhm.c
src/5gnrmac/rg_uim.c
src/5gnrmac/rg_utl.c
src/cm/cm_gen.c
src/cm/lrg.h
src/cm/lrg.x
src/cm/mac_interface.c [new file with mode: 0644]
src/cm/mac_interface.h [new file with mode: 0644]
src/du_app/du_cell_mgr.c
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_mgr.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c

index 76feb8a..f264419 100644 (file)
@@ -32,6 +32,7 @@ HDR_FILES+=$(wildcard $(CM_DIR)/crg.[hx])
 HDR_FILES+=$(wildcard $(CM_DIR)/lrg*.[hx])
 HDR_FILES+=$(wildcard $(CM_DIR)/rgr.[hx])
 HDR_FILES+=$(wildcard $(CM_DIR)/rgm.[hx])
+HDR_FILES+=$(wildcard $(CM_DIR)/mac*.[hx])
 
 # Add the product specific header files
 HDR_FILES+= $(wildcard $(SRC_DIR)/*.[hx])
index 2ceb987..ea9cd95 100644 (file)
@@ -31,7 +31,7 @@
 #include "ssi.x"
 #include "cm_hash.x"
 #include "cm_lib.x"
-#include "lcl.h"
+#include "mac_interface.h"
 
 typedef enum
 {
@@ -64,7 +64,7 @@ typedef struct clCb
 typedef struct cellCb
 {
    U16         cellId;
-   ClCellCfg   cellCfg;
+   MacCellCfg   cellCfg;
    PhyState    phyState;
 }ClCellCb;
 
index 73c0d90..a4a1e9a 100755 (executable)
@@ -649,6 +649,7 @@ struct _rgCb
    RgCellCb *prevCell;                     /*!< Reference of last accessed cellCb*/
    U8 bufCnt;                              /*!< Count of buffers in buffersToFree[] */
    Buffer *bufToFree[RG_MAX_DFRD_FREE_BUFS];/*!< List of Shared Buffers to be freed */
+   MacCellCfg macCellCfg;   /* MAC cell config paramters */
 };
 
 /* Declaration for RgCb */
index c0220a0..f0cea9c 100755 (executable)
@@ -73,6 +73,7 @@ static int RLOG_MODULE_ID=4096;
 #include "crg.x"           /* CRG interface includes */
 #include "rg_sch_inf.x"    /* SCH interface typedefs */
 #include "rg_prg.x"        /* PRG (MAC-MAC) Interface typedefs */
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 #ifdef LTE_ADV
 #include "rg_pom_scell.x"
index f1ec0cc..79c3491 100644 (file)
@@ -31,7 +31,7 @@
 #include "ssi.x"
 #include "cm_hash.x"
 #include "cm_lib.x"
-#include "lcl.h"
+#include "mac_interface.h"
 
 typedef enum
 {
@@ -66,7 +66,7 @@ typedef struct clCb
 typedef struct cellCb
 {
    U16         cellId;
-   ClCellCfg   cellCfg;
+   MacCellCfg   cellCfg;
    PhyState    phyState;
 }ClCellCb;
 
index 8d8f32f..e08d724 100644 (file)
@@ -28,7 +28,7 @@
 #include "cm_hash.x"
 #include "cm_lib.x"
 
-#include "lcl.h"
+#include "mac_interface.h"
 #include "lwr_mac.h"
 
 EXTERN S16 rgClBldAndSndFAPICfgReq ARGS((ClCellCb *cellCb));
@@ -51,7 +51,7 @@ EXTERN S16 rgClBldAndSndFAPICfgReq ARGS((ClCellCb *cellCb));
  * ****************************************************************/
 PRIVATE S16 rgClVldtCellCfg
 (
-ClCellCfg   *cellCfg
+MacCellCfg   *cellCfg
 )
 {
   RETVALUE(ROK);
@@ -76,7 +76,7 @@ ClCellCfg   *cellCfg
  * ****************************************************************/
 PUBLIC U16 RgClCellCfgReq
 (
-ClCellCfg   *cellCfg
+MacCellCfg   *cellCfg
 )
 {
    ClCellCb   *cellCb = NULLP;
@@ -115,7 +115,7 @@ ClCellCfg   *cellCfg
       clGlobalCp.numOfCells++;
    }
 
-   cmMemcpy((U8 *)&cellCb->cellCfg, (U8 *)cellCfg, sizeof(ClCellCfg));
+   cmMemcpy((U8 *)&cellCb->cellCfg, (U8 *)cellCfg, sizeof(MacCellCfg));
 
    /* Build and send CONFIG request to PHY */
    if(rgClBldAndSndFAPICfgReq(cellCb) != ROK )
index 673fb05..30104d5 100644 (file)
@@ -27,7 +27,7 @@
 #include "ssi.x"
 #include "cm_hash.x"
 
-#include "lcl.h"
+#include "mac_interface.h"
 #include "lwr_mac.h"
 #include "rg_cl_phy.h"
 #include "fapi.h"
@@ -138,7 +138,7 @@ ClCellCb   *cellCb
    U8             *configTlvs;
    L1L2ConfigReq  *FAPIConfigReq;
    L1L2Tlv        *nextTlv;
-   ClCellCfg      cellCfg;
+   MacCellCfg      cellCfg;
 
    FAPIConfigReqSize = sizeof(L1L2ConfigReq)
                        + (cellCb->cellCfg.numTlv * sizeof(L1L2Tlv));
@@ -186,7 +186,7 @@ ClCellCb   *cellCb
 
    /* Filling SSB configuration */
    fillConfigTLV(nextTlv, configTlvs, CFG_TAG_SS_PBCH_PWR, sizeof(U16), cellCfg.ssbCfg.ssbPbchPwr, &msgLen);
-   fillConfigTLV(nextTlv, configTlvs, CFG_TAG_BCH_PAYLOAD, sizeof(U16), cellCfg.ssbCfg.bchPayload, &msgLen);
+   fillConfigTLV(nextTlv, configTlvs, CFG_TAG_BCH_PAYLOAD, sizeof(U16), cellCfg.ssbCfg.bchPayloadOption, &msgLen);
    fillConfigTLV(nextTlv, configTlvs, CFG_TAG_SCS_COMM, sizeof(U16), cellCfg.ssbCfg.scsCmn, &msgLen);
    fillConfigTLV(nextTlv, configTlvs, CFG_TAG_SSB_OFFS_POINT_A, sizeof(U16), cellCfg.ssbCfg.ssbPrbOffset, &msgLen);
    fillConfigTLV(nextTlv, configTlvs, CFG_TAG_BETA_PSS, sizeof(U16), cellCfg.ssbCfg.betaPss, &msgLen);
index edd7497..33403ef 100644 (file)
@@ -24,7 +24,6 @@
 #include "gen.x"
 #include "cm_hash.h"
 #include "cm_hash.x"
-#include "lcl.h"
 #include "lwr_mac.h"
 
  /*******************************************************************
index 9d95fec..46b72c0 100755 (executable)
@@ -73,6 +73,7 @@ static int RLOG_MODULE_ID=4096;
 #include "tfu.x"
 #include "rg_sch_inf.x"
 #include "rg_prg.x"       /* PRG interface typedefs*/
+#include "mac_interface.h"
 #include "rg.x"
 #ifdef LTE_ADV
 #include "rg_pom_scell.x"
index 936d4d0..b250513 100755 (executable)
@@ -67,6 +67,7 @@
 #include "tfu.x"
 #include "rg_sch_inf.x"
 #include "rg_prg.x"       /* PRG interface typedefs*/
+#include "mac_interface.h"
 #include "rg.x"
 
 
index d77c3b4..493a4e5 100755 (executable)
@@ -78,6 +78,7 @@ static int RLOG_MODULE_ID=4096;
 #include "tfu.x"
 #include "rg_sch_inf.x"
 #include "rg_prg.x"        /* PRG interface typedefs */
+#include "mac_interface.h"
 #include "rg.x"
 
 #ifdef L2_OPTMZ
index 2498f81..b2b58b8 100755 (executable)
@@ -79,6 +79,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rgu.x"           /* RGU Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
index 39eda97..65f5fa2 100755 (executable)
@@ -73,6 +73,7 @@ registered with SSI during the LTE MAC Task initialization.
 #include "crg.x"           /* CRG interface typedes */
 #include "rg_sch_inf.x"    /* SCH interface typedefs */
 #include "rg_prg.x"        /*PRG interface includes*/
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 
@@ -131,6 +132,10 @@ Buffer  *mBuf;                      /* message buffer       */
          cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
          break;
 #endif /* LCRGMILRG */
+      case EVENT_MAC_CELL_CONFIG_REQ:
+         /* Process MAC cell config */
+         cmUnpackLwLcMacCellCfg(unpackMacCellCfgReq, pst, mBuf);
+         break;
       default:
          RG_FREE_MSG(mBuf);
          break;
index 2018b9b..7ecdafa 100755 (executable)
@@ -69,6 +69,7 @@
 #include "crg.x"           /* layer management typedefs for MAC */
 #include "rg_sch_inf.x"    /* typedefs for Scheduler */
 #include "rg_prg.x"        /* typedefs for PRG interface */
+#include "mac_interface.h"
 #include "rg.x"            /* MAC types */
 
 #ifdef LTE_L2_MEAS
index 2d31881..44c0451 100755 (executable)
@@ -72,6 +72,7 @@ static int RLOG_MODULE_ID=4096;
 #include "crg.x"           /* layer management typedefs for MAC */
 #include "rg_sch_inf.x"    /* SCH interface typedefs */
 #include "rg_prg.x"    /* PRG interface typedefs */
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 /* local defines */
index ced3b06..4352ce3 100755 (executable)
@@ -75,6 +75,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_prg.x"    /* PRG Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 #include "rgr.x"           /* LRG Interface includes */
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 #ifdef SS_DIAG
 #include "ss_diag.h"        /* Common log file */
@@ -129,6 +130,16 @@ RgMngmt       *cfm,
 Pst           *cfmPst
 ));
 
+extern U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
+extern U16 cmPackTcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
+extern U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
+
+packMacCellCfgCfm packMacCellCfmMt[] =
+{
+   cmPackLcMacCellCfgCfm,      /* packing for loosely coupled */
+   cmPackTcMacCellCfgCfm,      /* packing for tightly coupled */
+   cmPackLwlcMacCellCfgCfm,    /* packing for light weight loosly coupled */
+};
 \f
 /**
  * @brief Task Initiation callback function. 
@@ -298,8 +309,6 @@ RgMngmt  *cfg;    /* config structure  */
       case STTFUSAP:
          reason = rgLMMSapCfg(inst,&cfg->t.cfg, cfg->hdr.elmId.elmnt);
          break;
-      case STCLCELL:
-         reason = RgClCellCfgReq(&cfg->t.cfg.s.cellCfg);
       default:
          ret = LCM_PRIM_NOK;
          reason = LCM_REASON_INVALID_ELMNT;
@@ -2053,6 +2062,88 @@ PUBLIC S16 MacSchCfgReq(pst, transId, cfgReqInfo)
 } /* end of MacSchCfgReq*/
 
 \f
+/***********************************************************
+ *
+ *     Func : macCellCfgFillCfmPst 
+ *        
+ *
+ *     Desc : Fills the Confirmation Post Structure cfmPst 
+ *
+ *     Ret  : Void
+ *
+ *     Notes: 
+ *
+ *     File : rg_lmm.c 
+ *
+ **********************************************************/
+Void macCellCfgFillCfmPst
+(
+Pst           *reqPst,
+Pst           *cfmPst
+)
+{
+   Inst inst;
+   inst = reqPst->dstInst;
+
+   cfmPst->srcEnt    = rgCb[inst].rgInit.ent;
+   cfmPst->srcInst   = rgCb[inst].rgInit.inst;
+   cfmPst->srcProcId = rgCb[inst].rgInit.procId;
+
+   cfmPst->srcEnt    = reqPst->dstEnt;
+   cfmPst->dstEnt    = reqPst->srcEnt;
+   cfmPst->srcInst   = reqPst->dstInst;
+   cfmPst->dstInst   = reqPst->srcInst;
+   cfmPst->srcProcId = reqPst->dstProcId;
+   cfmPst->dstProcId = reqPst->srcProcId;
+
+   cfmPst->selector  = LRG_SEL_LC;
+   cfmPst->prior     = reqPst->prior;
+   cfmPst->route     = reqPst->route;
+   cfmPst->region    = reqPst->region;
+   cfmPst->pool      = reqPst->pool;
+   cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM;
+
+   RETVOID;
+}
+
+/**
+ * @brief Layer Manager Configuration request handler. 
+ *
+ * @details
+ *
+ *     Function : unpackMacCellCfgReq 
+ *     
+ *     This function handles the gNB and cell configuration
+ *     request received from DU APP.
+ *     This API unapcks and forwards the config towards SCH
+ *     
+ *  @param[in]  Pst           *pst
+ *  @param[in]  MacCellCfg    *macCellCfg 
+ *  @return  S16
+ *      -# ROK
+ **/
+S16 unpackMacCellCfgReq
+(
+ Pst           *pst,
+ MacCellCfg    *macCellCfg
+)
+{
+   U16 ret = ROK;
+   MacCellCfgCfm macCellCfgCfm;
+   Pst cnfPst;
+   Inst inst = pst->dstInst;
+
+   memcpy(&rgCb[inst].macCellCfg,macCellCfg,sizeof(MacCellCfg));
+
+   macCellCfgFillCfmPst(pst,&cnfPst);
+
+   macCellCfgCfm.transId = macCellCfg->transId;
+   //ret = cmPackLcMacCellCfgCfm(&cnfPst,&macCellCfgCfm);
+   ret = (*packMacCellCfmMt[cnfPst.selector])(&cnfPst,&macCellCfgCfm);
+   return ret;
+} /* end of unpackMacCellCfgReq */
+
+\f
 /**********************************************************************
  
          End of file
index 6849151..748ccd1 100755 (executable)
@@ -79,6 +79,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rgu.x"           /* RGU Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 #include "ss_queue.h"
 #include "ss_queue.x"
index dda848f..199cf5c 100755 (executable)
@@ -69,6 +69,7 @@
 #include "tfu.x"
 #include "rg_sch_inf.x"
 #include "rg_prg.x"       /* PRG interface typedefs*/
+#include "mac_interface.h"
 #include "rg.x"
 #ifdef LTE_ADV
 #include "rg_pom_scell.x"
index b4d3f9c..716c626 100755 (executable)
@@ -65,6 +65,7 @@
 #include "crg.x"           /* layer management typedefs for MAC */
 #include "rg_sch_inf.x"           /* layer management typedefs for MAC */
 #include "rg_prg.x"           /* Prg(MAC-MAC)interface includes */
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 #ifdef LTE_ADV
index f806054..140142f 100755 (executable)
@@ -65,6 +65,7 @@
 #include "crg.x"           /* layer management typedefs for MAC */
 #include "rg_sch_inf.x"    /* layer management typedefs for MAC */
 #include "rg_prg.x"        /* PRG interface typedefs*/
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 #ifdef LTE_ADV
index 7ed0d98..fbfd01f 100755 (executable)
@@ -78,6 +78,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_prg.x"        /* PRG Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
index 587d23e..d775b07 100755 (executable)
@@ -78,6 +78,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_prg.x"        /* PRG Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
index af55609..673cc24 100755 (executable)
@@ -75,6 +75,7 @@ invoked by PHY towards MAC
 #include "rg_prg.x"        /* PRG interface typedefs */
 #include "rgm.x"           /* layer management typedefs for MAC */
 #include "rgm.h"           /* layer management typedefs for MAC */
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 #ifdef MAC_RLC_UL_RBUF
index 1c7d977..dd2c187 100755 (executable)
@@ -74,6 +74,7 @@
 #include "rg_prg.x"        /* PRG Interface defines */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
index add49a0..0c7c5c2 100755 (executable)
@@ -78,6 +78,7 @@ static int RLOG_FILE_ID=178;
 #include "rgu.x"
 #include "rg_sch_inf.x"
 #include "rg_prg.x"        /* PRG interface typedefs*/
+#include "mac_interface.h"
 #include "rg.x"            /* typedefs for MAC */
 
 #include "ss_rbuf.h"
index 709c0d2..8171c4c 100755 (executable)
@@ -78,6 +78,7 @@ static int RLOG_FILE_ID=179;
 #include "lrg.x"           /* LRG Interface includes */
 #include "rg_prg.x"        /* PRG(MAC-MAC) Interface includes */
 
+#include "mac_interface.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
index a39e3ec..582049d 100644 (file)
@@ -73,6 +73,7 @@
 /* functions in other modules */
 
 /* public variable declarations */
+U16 gTransId = 0;
 
 /* private variable declarations */
 
@@ -3553,6 +3554,25 @@ Buffer *mBuf;           /* message buffer */
 } /* end of cmUnpkIntf */
 #endif /* TDS_ROLL_UPGRADE_SUPPORT */
 
+/*
+*
+*       Fun:   cmGetTransId
+*
+*       Desc:  This function return the transaction ID used for interface transactions 
+*
+*       Ret: gTransId
+*
+*       File:  cm_gen.c
+*
+*/
+U16 cmGetTransId()
+{
+   if(gTransId<65535)
+      gTransId++;
+   else
+      gTransId = 0;
+   return gTransId; 
+}
 /**********************************************************************
          End of file
 **********************************************************************/
index 44d512d..a6805ea 100755 (executable)
@@ -95,7 +95,6 @@
 #define STRGRSAP     STGEN + 2
 #define STTFUSAP     STGEN + 4
 #define STSCHINST    STGEN + 5 /* Scheduler Instance */
-#define STCLCELL     STGEN + 6 /* CL cell */
 
 #define LRG_USTA_DGNVAL_MEM      1
 #define LRG_USTA_DGNVAL_HARQ     2
index 6480fcd..b56bdb0 100755 (executable)
@@ -34,7 +34,6 @@
 #ifndef __LRGX__
 #define __LRGX__
 
-#include "lcl.h"
 
 /* ccpu00121930 : ADD: c++ support*/
 #ifdef __cplusplus
@@ -178,7 +177,6 @@ typedef struct rgCfg
       RgUpSapCfg  crgSap;  /*!< CRG interface SAP */
       RgLowSapCfg tfuSap;  /*!< TFU interface SAP */
       RgSchInstCfg schInstCfg;/*!< General Configuration for scheduler instances */
-      ClCellCfg  cellCfg;
    }s;
 }RgCfg;
 
diff --git a/src/cm/mac_interface.c b/src/cm/mac_interface.c
new file mode 100644 (file)
index 0000000..e4945ca
--- /dev/null
@@ -0,0 +1,246 @@
+/*******************************************************************************
+################################################################################
+#   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.                                             #
+################################################################################
+*******************************************************************************/
+
+#include "envopt.h"        /* Environment options */
+#include "envdep.h"        /* Environment dependent */
+#include "envind.h"        /* Environment independent */
+#include "gen.h"           /* General */
+#include "ssi.h"           /* System services */
+#include "ss_queue.h"
+#include "ss_task.h"
+#include "ss_msg.h"
+#include "gen.x"           /* general */
+#include "ssi.x"           /* system services */
+#include "cm_tkns.x"       /* Common Token Definitions */
+#include "cm_llist.x"      /* Common Link List Definitions */
+#include "cm_lib.x"        /* Common Library Definitions */
+#include "cm_hash.x"       /* Common Hash List Definitions */
+#include "cm_lte.x"        /* Common LTE Defines */
+
+#include "mac_interface.h"
+
+/**************************************************************************
+ * @brief Function to pack Loose Coupled 
+ *        MAC cell config parameters required by MAC
+ *
+ * @details
+ *
+ *      Function : packLcMacCellCfg
+ *
+ *      Functionality:
+ *           packs the macCellCfg parameters
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfg  *macCellCfg, mac cell config parameters.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 packLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+{
+   return ROK;
+}
+
+/**************************************************************************
+ * @brief Function to pack tightly Coupled 
+ *        MAC cell config parameters required by MAC
+ *
+ * @details
+ *
+ *      Function : packTcMacCellCfg
+ *
+ *      Functionality:
+ *           packs the macCellCfg parameters
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfg  *macCellCfg, mac cell config parameters.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 packTcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+{
+   return ROK;
+}
+
+/**************************************************************************
+ * @brief Function to pack light weight Loose Coupled 
+ *        MAC cell config parameters required by MAC
+ *
+ * @details
+ *
+ *      Function : packLwLcMacCellCfg
+ *
+ *      Functionality:
+ *           packs the macCellCfg parameters
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfg  *macCellCfg, mac cell config parameters.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+{
+   Buffer *mBuf = NULLP;
+
+   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      RETVALUE(RFAILED);
+   }
+
+   /* pack the address of the structure */
+   CMCHKPK(cmPkPtr,(PTR)macCellCfg, mBuf);
+
+   RETVALUE(SPstTsk(pst,mBuf));
+}
+
+/**************************************************************************
+ * @brief Function to pack Loose Coupled 
+ *        MAC cell config parameters required by MAC
+ *
+ * @details
+ *
+ *      Function : unpackLwLcMacCellCfg
+ *
+ *      Functionality:
+ *           packs the macCellCfg parameters
+ *
+ * @param[in] DuMacCellCfgReq func; function pointer
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] Buffer *mBuf
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+void cmUnpackLwLcMacCellCfg(
+   DuMacCellCfgReq func,
+   Pst *pst,
+   Buffer *mBuf)
+{
+   MacCellCfg *macCellCfg;
+
+   /* unpack the address of the structure */
+   CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf);
+
+   RETVALUE((*func)(pst, macCellCfg));
+}
+
+/**************************************************************************
+ * @brief Function to pack Loose Coupled 
+ *        MAC cell config confirm message
+ *
+ * @details
+ *
+ *      Function : cmPackLcMacCellCfgCfm
+ *
+ *      Functionality:
+ *           packs the transaction ID  
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfgCfm  *macCellCfgCfm, mac cell config confirm.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+{
+   Buffer *mBuf = NULLP;
+   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      RETVALUE(RFAILED);
+   }
+
+   /* pack the transaction ID in CNF structure */
+   CMCHKPK(SPkU16, macCellCfgCfm->transId, mBuf);
+
+   RETVALUE(SPstTsk(pst,mBuf));
+}
+
+/**************************************************************************
+ * @brief Function to pack tightly Coupled 
+ *        MAC cell config confirm message
+ *
+ * @details
+ *
+ *      Function : cmPackTcMacCellCfgCfm
+ *
+ *      Functionality:
+ *           packs the transaction ID  
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfgCfm  *macCellCfgCfm, mac cell config confirm.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+U16 cmPackTcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+{
+   return ROK;
+}
+
+/**************************************************************************
+ * @brief Function to pack light weight Loose Coupled 
+ *        MAC cell config confirm message
+ *
+ * @details
+ *
+ *      Function : cmPackLwlcMacCellCfgCfm
+ *
+ *      Functionality:
+ *           packs the transaction ID  
+ *
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] MacCellCfgCfm  *macCellCfgCfm, mac cell config confirm.
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+{
+   return ROK;
+}
+
+/**************************************************************************
+ * @brief Function to pack MAC cell config confirm message
+ *
+ * @details
+ *
+ *      Function : cmUnpackLcMacCellCfgCfm
+ *
+ *      Functionality:
+ *           packs the transaction ID  
+ *
+ * @param[in] DuMacCellCfgCfm func; function pointer
+ * @param[in] Pst     *pst, Post structure of the primitive.
+ * @param[in] Buffer *mBuf
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 cmUnpackLcMacCellCfgCfm(
+   DuMacCellCfgCfm func, 
+   Pst *pst,
+   Buffer *mBuf)
+{
+   MacCellCfgCfm macCellCfgCfm;
+   /* pack the transaction ID in CNF structure */
+   CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
+
+   RETVALUE((*func)(&macCellCfgCfm));
+}
diff --git a/src/cm/mac_interface.h b/src/cm/mac_interface.h
new file mode 100644 (file)
index 0000000..b7043cf
--- /dev/null
@@ -0,0 +1,232 @@
+/*******************************************************************************
+################################################################################
+#   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.                                             #
+################################################################################
+*******************************************************************************/
+
+/* Defines APIs exchanged between du_app and cl module of MAC */
+#ifndef __MACINT_H__
+#define __MACINT_H__
+
+#define NUM_NUMEROLOGY 5  /* Number of numerology */
+#define MAXIMUM_TDD_PERIODICITY 5
+#define MAX_SYMB_PER_SLOT 14 
+
+#define NUM_SSB                1       /* max value is 64 */
+#define SSB_MASK_SIZE  1       /* SSB mask size is 32bit for sub6 */
+
+
+/* Event IDs */
+#define EVENT_MAC_CELL_CONFIG_REQ    200
+#define EVENT_MAC_CELL_CONFIG_CFM    201
+
+typedef enum
+{
+   DUP_MODE_FDD,
+   DUP_MODE_TDD
+}DuplexMode;
+
+typedef enum
+{
+   MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
+   PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
+   PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
+}BchPduOpt;
+
+typedef enum
+{
+   LONG_SEQUENCE,
+   SHORT_SEQUENCE
+}PrachSeqLen;
+
+typedef enum
+{
+   UNRESTRICTED,
+   RESTRICTED_SET_TYPE_A,
+   RESTRICTED_SET_TYPE_B
+}RstSetCfg;
+
+typedef enum
+{
+   DONT_REPORT_RSSI,
+   RSSI_UNIT_DBM,
+   RSSI_UNIT_DBFS
+}RSSIMeasUnit;
+
+typedef enum
+{
+   DL_SLOT,
+   UL_SLOT,
+   GUARD_SLOT
+}SlotConfig;
+
+typedef enum
+{
+   TX_PRDCTY_MS_0P5,
+   TX_PRDCTY_MS_0P625,
+   TX_PRDCTY_MS_1,
+   TX_PRDCTY_MS_1P25,
+   TX_PRDCTY_MS_2,
+   TX_PRDCTY_MS_2P5,
+   TX_PRDCTY_MS_5,
+   TX_PRDCTY_MS_10
+}DlUlTxPeriodicity;
+
+typedef enum
+{
+   BETA_PSS_0DB,
+   BETA_PSS_1DB
+}BetaPss;
+
+typedef enum 
+{
+   SSB_PRDCTY_MS_5,
+   SSB_PRDCTY_MS_10,
+   SSB_PRDCTY_MS_20,
+   SSB_PRDCTY_MS_40,
+   SSB_PRDCTY_MS_80,
+   SSB_PRDCTY_MS_160
+}SSBPeriod;
+
+typedef struct carrierCfg
+{
+   Bool  pres;
+   U16   bw;             /* DL/UL bandwidth */
+   U32   freq;           /* Absolute frequency of DL/UL point A in KHz */
+   U16   k0[NUM_NUMEROLOGY];          /* K0 for DL/UL */
+   U16   gridSize[NUM_NUMEROLOGY];    /* DL/UL Grid size for each numerologies */
+   U16   numAnt;         /* Number of Tx/Rx antennas */
+}CarrierCfg;
+
+typedef struct ssbCfg
+{
+   U32         ssbPbchPwr;       /* SSB block power */
+   BchPduOpt   bchPayloadOption;       /* Options for generation of payload */
+   U8          scsCmn;           /* subcarrier spacing for common */
+   U16         ssbPrbOffset;     /* SSB PRB offset from point A */
+   BetaPss     betaPss;
+   SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
+   U8          ssbSubcOffset;    /* Subcarrier Offset */
+   U32         mibPdu;           /* MIB payload */
+   U32         nSSBMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
+   U8          beamId[NUM_SSB];
+   Bool        multCarrBand;     /* Multiple carriers in a band */
+   Bool        multCellCarr;     /* Multiple cells in single carrier */
+}SsbCfg;
+
+typedef struct fdmInfo
+{
+   U16   rootSeqIdx;        /* Root sequence index */
+   U8    numRootSeq;        /* Number of root sequences required for FD */
+   U16   k1;                /* Frequency Offset for each FD */
+   U8    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
+   U8    numUnusedRootSeq;  /* Number of unused root sequence */
+   U8    *unsuedRootSeq;     /* Unused root sequence per FD */
+}FdmInfo;
+
+typedef struct prachCfg
+{
+   Bool          pres;
+   PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
+   U8            prachSubcSpacing;    /* Subcarrier spacing of RACH */
+   RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
+   U8            prachFdm;            /* PRACH FDM (1,2,4,8) */
+   FdmInfo       fdm[8];
+   U8            ssbPerRach;          /* SSB per RACH occassion */
+   Bool          prachMultCarrBand;    /* Multiple carriers in Band */
+}PrachCfg;
+
+typedef struct tddCfg
+{
+   Bool               pres;
+   DlUlTxPeriodicity  tddPeriod;      /* DL UL Transmission periodicity */
+   SlotConfig         slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT]; 
+}TDDCfg;
+
+typedef struct macCellCfg
+{
+   U16            transId;
+   U8             numTlv;     /* Number of configuration TLVs */
+   U8             carrierId;  /* Carrired Index */
+   U16            cellId;     /* Cell Id */
+   U16            phyCellId;  /* Physical cell id */
+   DuplexMode     dupType;    /* Duplex type: TDD/FDD */
+   CarrierCfg     dlCarrCfg;  /* DL Carrier configuration */
+   CarrierCfg     ulCarrCfg;  /* UL Carrier configuration */
+   Bool           freqShft;   /* Indicates presence of 7.5kHz frequency shift */
+   SsbCfg         ssbCfg;     /* SSB configuration */          
+   PrachCfg       prachCfg;   /* PRACH Configuration */
+   TDDCfg         tddCfg;     /* TDD periodicity and slot configuration */
+   RSSIMeasUnit   rssiUnit;   /* RSSI measurement unit */
+}MacCellCfg;
+
+typedef struct macCellCfgCfm
+{
+   U16            transId;
+}MacCellCfgCfm;
+
+/* function pointers for packing macCellCfg Request */
+typedef S16 (*packMacCellCfgReq) ARGS((
+   Pst           *pst,
+   MacCellCfg    *macCellCfg
+));
+
+typedef S16 (*packMacCellCfgCfm) 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 */
+     ));
+
+S16 packLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
+
+S16 packTcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
+
+S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
+
+
+EXTERN S16 unpackMacCellCfgReq
+(
+ Pst           *pst,
+ MacCellCfg    *macCellCfg
+);
+
+void cmUnpackLwLcMacCellCfg(
+   DuMacCellCfgReq func,
+   Pst *pst,
+   Buffer *mBuf);
+
+S16 cmUnpackLcMacCellCfgCfm(
+   DuMacCellCfgCfm func,
+   Pst *pst,
+   Buffer *mBuf);
+
+EXTERN S16 duHandleMacCellCfgCfm
+(
+ MacCellCfgCfm    *macCellCfgCfm
+);
+
+#endif
+
+/**********************************************************************
+         End of file
+**********************************************************************/
index 4f47822..69ab4c2 100644 (file)
@@ -25,6 +25,8 @@ extern DuCfgParams duCfgParam;
 extern S16 cmPkRgrCfgReq(Pst* pst, RgrCfgTransId transId, \
       RgrCfgReqInfo *cfgReqInfo);
 
+extern S16 duBuildAndSendMacCellCfg();
+
 /*******************************************************************
  *
  * @brief Processes cells to be activated
@@ -180,8 +182,9 @@ S16 procF1SetupRsp(F1AP_PDU_t *f1apMsg)
    SPutSBuf(DU_APP_MEM_REGION, DU_POOL,(Data *)&f1apMsg,(Size)sizeof(F1AP_PDU_t));
 #endif
  
-   /* Build and send GNB-DU config update */
-   ret = BuildAndSendDUConfigUpdate();
+   /* Build and send Mac Cell Cfg Paramaters */
+   ret = duBuildAndSendMacCellCfg();
+
    return ret;
 }
 
index 4fd8612..8113cca 100644 (file)
@@ -58,16 +58,16 @@ void FillSlotConfig()
    for(slot = 0; slot <= 3; slot++)
    {
       for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
-         duCfgParam.clCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
+         duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
    }
 
-   duCfgParam.clCellCfg.tddCfg.slotCfg[3][10] = GUARD_SLOT;
-   duCfgParam.clCellCfg.tddCfg.slotCfg[3][11] = GUARD_SLOT;
-   duCfgParam.clCellCfg.tddCfg.slotCfg[3][12] = GUARD_SLOT;
-   duCfgParam.clCellCfg.tddCfg.slotCfg[3][13] = UL_SLOT;
+   duCfgParam.macCellCfg.tddCfg.slotCfg[3][10] = GUARD_SLOT;
+   duCfgParam.macCellCfg.tddCfg.slotCfg[3][11] = GUARD_SLOT;
+   duCfgParam.macCellCfg.tddCfg.slotCfg[3][12] = GUARD_SLOT;
+   duCfgParam.macCellCfg.tddCfg.slotCfg[3][13] = UL_SLOT;
 
    for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
-      duCfgParam.clCellCfg.tddCfg.slotCfg[4][symbol] = UL_SLOT;
+      duCfgParam.macCellCfg.tddCfg.slotCfg[4][symbol] = UL_SLOT;
 
 }
 
@@ -77,7 +77,7 @@ void FillSlotConfig()
  *
  * @details
  *
- *    Function : readClCfg
+ *    Function : readMacCfg
  *
  *    Functionality:
  *       - Fills up the cell configuration for CL.
@@ -91,96 +91,96 @@ void FillSlotConfig()
 
 
 /* This function is used to fill up the cell configuration for CL */
-S16 readClCfg()
+S16 readMacCfg()
 {
-   duCfgParam.clCellCfg.carrierId = CARRIER_IDX;
+   duCfgParam.macCellCfg.carrierId = CARRIER_IDX;
 
    /* Cell configuration */
-   duCfgParam.clCellCfg.cellId = NR_CELL_ID;
-   duCfgParam.clCellCfg.phyCellId = NR_PCI;
-   duCfgParam.clCellCfg.dupType = DUPLEX_MODE;
+   duCfgParam.macCellCfg.cellId = NR_CELL_ID;
+   duCfgParam.macCellCfg.phyCellId = NR_PCI;
+   duCfgParam.macCellCfg.dupType = DUPLEX_MODE;
 
    /* DL carrier configuration */
-   duCfgParam.clCellCfg.dlCarrCfg.pres = TRUE;
-   duCfgParam.clCellCfg.dlCarrCfg.bw = SUL_ARFCN;
-   duCfgParam.clCellCfg.dlCarrCfg.freq = NR_ARFCN;
-   duCfgParam.clCellCfg.dlCarrCfg.k0[0] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.k0[1] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.k0[2] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.k0[3] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.k0[4] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.gridSize[0] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.gridSize[1] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.gridSize[2] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.gridSize[3] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.gridSize[4] = 1;
-   duCfgParam.clCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
+   duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE;
+   duCfgParam.macCellCfg.dlCarrCfg.bw = SUL_ARFCN;
+   duCfgParam.macCellCfg.dlCarrCfg.freq = NR_ARFCN;
+   duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.k0[2] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.k0[3] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.k0[4] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.gridSize[1] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.gridSize[2] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.gridSize[3] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.gridSize[4] = 1;
+   duCfgParam.macCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
 
    /* UL Carrier configuration */
-   duCfgParam.clCellCfg.ulCarrCfg.pres = TRUE;
-   duCfgParam.clCellCfg.ulCarrCfg.bw = SUL_ARFCN;
-   duCfgParam.clCellCfg.ulCarrCfg.freq = NR_ARFCN;
-   duCfgParam.clCellCfg.ulCarrCfg.k0[0] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.k0[1] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.k0[2] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.k0[3] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.k0[4] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.gridSize[0] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.gridSize[1] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.gridSize[2] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.gridSize[3] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.gridSize[4] = 1;
-   duCfgParam.clCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
-
-   duCfgParam.clCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
+   duCfgParam.macCellCfg.ulCarrCfg.pres = TRUE;
+   duCfgParam.macCellCfg.ulCarrCfg.bw = SUL_ARFCN;
+   duCfgParam.macCellCfg.ulCarrCfg.freq = NR_ARFCN;
+   duCfgParam.macCellCfg.ulCarrCfg.k0[0] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.k0[1] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.k0[2] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.k0[3] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.k0[4] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.gridSize[0] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.gridSize[1] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.gridSize[2] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.gridSize[3] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.gridSize[4] = 1;
+   duCfgParam.macCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
+
+   duCfgParam.macCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
 
    /* SSB configuration */
-   duCfgParam.clCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
-   duCfgParam.clCellCfg.ssbCfg.bchPayload = BCH_PAYLOAD;
-   duCfgParam.clCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
-   duCfgParam.clCellCfg.ssbCfg.ssbPrbOffset = PRB_OFFSET;
-   duCfgParam.clCellCfg.ssbCfg.betaPss = BETA_PSS;
-   duCfgParam.clCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
-   duCfgParam.clCellCfg.ssbCfg.ssbSubcOffset = SSB_SUBCARRIER_OFFSET;
-   duCfgParam.clCellCfg.ssbCfg.mibPdu = 104;
-   duCfgParam.clCellCfg.ssbCfg.nSSBMask[0] = 2162721;
-   duCfgParam.clCellCfg.ssbCfg.nSSBMask[1] = 0;
-   duCfgParam.clCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
-   duCfgParam.clCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
+   duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
+   duCfgParam.macCellCfg.ssbCfg.bchPayloadOption = BCH_PAYLOAD;
+   duCfgParam.macCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
+   duCfgParam.macCellCfg.ssbCfg.ssbPrbOffset = PRB_OFFSET;
+   duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
+   duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
+   duCfgParam.macCellCfg.ssbCfg.ssbSubcOffset = SSB_SUBCARRIER_OFFSET;
+   duCfgParam.macCellCfg.ssbCfg.mibPdu = 104;
+   duCfgParam.macCellCfg.ssbCfg.nSSBMask[0] = 2162721;
+   duCfgParam.macCellCfg.ssbCfg.nSSBMask[1] = 0;
+   duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
+   duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
 
    /* PRACH configuration */
-   duCfgParam.clCellCfg.prachCfg.pres = TRUE;
-   duCfgParam.clCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
-   duCfgParam.clCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
-   duCfgParam.clCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
-   duCfgParam.clCellCfg.prachCfg.prachFdm = NUM_PRACH_FDM;
-   duCfgParam.clCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
-   duCfgParam.clCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
-   duCfgParam.clCellCfg.prachCfg.fdm[0].k1 = 1;
-   duCfgParam.clCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
-   duCfgParam.clCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
-   DU_ALLOC(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq, NUM_UNUSED_ROOT_SEQ * sizeof(U8));
-   if(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
+   duCfgParam.macCellCfg.prachCfg.pres = TRUE;
+   duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
+   duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
+   duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
+   duCfgParam.macCellCfg.prachCfg.prachFdm = NUM_PRACH_FDM;
+   duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
+   duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
+   duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 1;
+   duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
+   duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
+   DU_ALLOC(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq, NUM_UNUSED_ROOT_SEQ * sizeof(U8));
+   if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
    {
       DU_LOG("\nDU_APP : Memory allocation failed");
       RETVALUE(RFAILED);
    }
-   *(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
-   duCfgParam.clCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
-   duCfgParam.clCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
+   *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
+   duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
+   duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
 
    /* TDD configuration */
-   duCfgParam.clCellCfg.tddCfg.pres = TRUE;
-   duCfgParam.clCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
+   duCfgParam.macCellCfg.tddCfg.pres = TRUE;
+   duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
 
    FillSlotConfig();
 
    /* RSSI Measurement configuration */
-   duCfgParam.clCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
+   duCfgParam.macCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
 
    /* This should be calculated based on
       (number of mandatory parameters) + (number of otional parameters being filled) */
-   duCfgParam.clCellCfg.numTlv = 39;
+   duCfgParam.macCellCfg.numTlv = 39;
 
    RETVALUE(ROK);
 }
@@ -194,7 +194,7 @@ S16 readClCfg()
  *
  *    Functionality:
  *       - Initializes the DuCfg members.  
- *       - Calls readClCfg()  
+ *       - Calls readMacCfg()  
  *
  * @params[in] system task ID
  * @return ROK     - success
@@ -417,9 +417,9 @@ S16 readCfg()
 
    }
 
-   if(readClCfg() != ROK)
+   if(readMacCfg() != ROK)
    {
-      DU_LOG("\nDU_APP : Failed while reading CL config");
+      DU_LOG("\nDU_APP : Failed while reading MAC config");
       RETVALUE(RFAILED);
    }
 
index 25be771..9191273 100644 (file)
@@ -20,7 +20,7 @@
 #define __DU_CONFIG_H__
 
 #include "du_mgr.h"
-#include "lcl.h"
+#include "mac_interface.h"
 #include "du_log.h"
 #include "BIT_STRING.h"
 
@@ -904,7 +904,8 @@ typedef struct duCfgParams
    CellCfgParams      cellCfg[DU_MAX_CELLS];  /* Cell info config*/
    F1DuSrvdCellInfo   srvdCellLst[DU_MAX_CELLS];   /* Serving cell list *///TODO: this must be removed eventually
    F1RrcVersion       rrcVersion;                    /* RRC version */
-   ClCellCfg          clCellCfg;                     /* CL cell configuration */
+
+   MacCellCfg        macCellCfg;       /* MAC cell configuration */
    MibParams          mibParams;                     /* MIB Params */
        Sib1Params         sib1Params;                    /* SIB1 Params */
 }DuCfgParams;
index 10ba6af..c51cc8a 100644 (file)
@@ -37,7 +37,7 @@
 #include "lkw.h"
 #include "lrg.h"
 #include "legtp.h"
-
+#include "mac_interface.h"
 
 #include "gen.x"           /* General */
 #include "ssi.x"           /* System services */
@@ -176,6 +176,8 @@ typedef struct duCb
    Bool          f1Status; /* Status of F1 connection */
    CmHashListCp  cellLst;     /* List of cells at DU APP of type DuCellCb */
    CmHashListCp  actvCellLst; /* List of cells activated/to be activated of type DuCellCb */
+   /* pointer to store the address of macCellCfg params used to send du-app to MAC */
+   MacCellCfg     *ptrMacCellCfg;     /* pointer to store params while sending DU-APP to MAC */
 }DuCb;
 
 
index ce4895b..d2095e3 100644 (file)
@@ -22,6 +22,7 @@
 #include "du_f1ap_msg_hdl.h"
 #include "lsctp.h"
 #include "legtp.h"
+#include "mac_interface.h"
 
 extern S16 cmUnpkLkwCfgCfm(LkwCfgCfm func,Pst *pst, Buffer *mBuf);
 extern S16 cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
@@ -191,7 +192,11 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf)
                      ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
                      break;
                   }
-
+               case EVENT_MAC_CELL_CONFIG_CFM:
+                  {
+                     ret = cmUnpackLcMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
+                     break;
+                  }
                default:
                   {
                      DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTRG");
index 7a35a68..910386a 100644 (file)
@@ -37,6 +37,13 @@ extern S16 cmPkLkwCfgReq(Pst *pst, KwMngmt *cfg);
 extern S16 cmPkLkwCntrlReq(Pst *pst, KwMngmt *cfg);
 extern S16 cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
 
+packMacCellCfgReq packMacCellCfgMt[] =
+{
+   packLcMacCellCfg, /* packing for loosely coupled */
+   packTcMacCellCfg, /* packing for tightly coupled */
+   packLwLcMacCellCfg, /* packing for light weight loosly coupled */
+};
+
 /**************************************************************************
  * @brief Function to fill configs required by RLC
  *
@@ -1486,6 +1493,95 @@ S16 duSendEgtpTTIInd()
    RETVALUE(ROK);
    
 }
+
+/**************************************************************************
+ * @brief Function to fill and send MacCellconfig
+ *
+ * @details
+ *
+ *      Function : duBuildAndSendMacCellCfg 
+ * 
+ *      Functionality:
+ *           Initiates MAC Configs towards MAC
+ *     
+ * @param[in] void
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 duBuildAndSendMacCellCfg()
+{
+   Pst pst;
+   DU_SET_ZERO(&pst, sizeof(Pst));
+   MacCellCfg *pMacCellCfg = NULLP;
+
+   DU_ALLOC(pMacCellCfg, sizeof(MacCellCfg));
+   if(pMacCellCfg == NULLP)
+   {
+      return RFAILED;
+   }
+
+   /* store the address in the duCb so that we can free on confirm msg */
+   duCb.ptrMacCellCfg = pMacCellCfg;
+
+   /* copy the mac config structure from duCfgParams */
+   memcpy(pMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
+
+   pMacCellCfg->transId = cmGetTransId(); /* transaction ID */
+   
+   /* Fill Pst */
+   pst.selector  = DU_SELECTOR_LWLC;
+   pst.srcEnt    = ENTDUAPP;
+   pst.dstEnt    = ENTRG;
+   pst.dstInst   = 0;
+   pst.srcInst   = 0;
+   pst.dstProcId = DU_PROC;
+   pst.srcProcId = DU_PROC;
+   pst.region = duCb.init.region;
+   pst.event = EVENT_MAC_CELL_CONFIG_REQ;
+
+   /* Send MAC cell config to MAC */
+   return (*packMacCellCfgMt[pst.selector])(&pst, pMacCellCfg);
+}
+
+/**************************************************************************
+ * @brief Function to Handle MAC cell config confirm
+ *
+ * @details
+ *
+ *      Function : duHandleMacCellCfgCfm 
+ * 
+ *      Functionality:
+ *           Initiates general Configs towards MAC
+ *     
+ * @param[in] void
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ***************************************************************************/
+S16 duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm)
+{
+   S16 ret = ROK;
+
+   if(macCellCfgCfm->transId == duCb.ptrMacCellCfg->transId)
+   {
+      /* free the memory allocated during sending macCellCfg request */
+      DU_FREE(duCb.ptrMacCellCfg,sizeof(MacCellCfg));
+      duCb.ptrMacCellCfg = NULLP;
+
+      /* Build and send GNB-DU config update */
+      ret = BuildAndSendDUConfigUpdate();
+   }
+   else
+   {
+      /* transaction ID missmatch */
+      DU_LOG("\n transaction ID mismatch in macCellCfg");
+      ret = RFAILED;
+   }
+
+   return ret;
+}
+
 /**********************************************************************
   End of file
  **********************************************************************/