macCellCfg 40/2840/1
authorbalajihands <balaji.shankaran@radisys.com>
Wed, 18 Mar 2020 05:50:17 +0000 (11:20 +0530)
committerbalajihands <balaji.shankaran@radisys.com>
Wed, 18 Mar 2020 05:50:32 +0000 (11:20 +0530)
Change-Id: I9562fb3e690952355b279aeb9b2896d346b7bd43
Signed-off-by: balajihands <balaji.shankaran@radisys.com>
src/5gnrmac/rg.x
src/5gnrmac/rg_ex_ms.c
src/5gnrmac/rg_lmm.c
src/cm/cm_gen.c
src/cm/mac_interface.c
src/cm/mac_interface.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c

index a4a1e9a..268ff06 100755 (executable)
@@ -339,6 +339,8 @@ struct rgCellCb
 #ifdef EMTC_ENABLE
     U8               emtcEnable;
 #endif
+   /* 5GNR changes */
+   MacCellCfg macCellCfg;   /* MAC cell config paramters */
 };
 
 /**
@@ -649,7 +651,6 @@ 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 65f5fa2..b24e3e0 100755 (executable)
@@ -134,7 +134,7 @@ Buffer  *mBuf;                      /* message buffer       */
 #endif /* LCRGMILRG */
       case EVENT_MAC_CELL_CONFIG_REQ:
          /* Process MAC cell config */
-         cmUnpackLwLcMacCellCfg(unpackMacCellCfgReq, pst, mBuf);
+         unpackDuMacCellCfg(handleMacCellCfgReq, pst, mBuf);
          break;
       default:
          RG_FREE_MSG(mBuf);
index 4352ce3..aa68fd5 100755 (executable)
@@ -131,13 +131,12 @@ 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 */
+   duHandleMacCellCfgCfm,      /* packing for tightly coupled */
    cmPackLwlcMacCellCfgCfm,    /* packing for light weight loosly coupled */
 };
 \f
@@ -2111,7 +2110,7 @@ Pst           *cfmPst
  *
  * @details
  *
- *     Function : unpackMacCellCfgReq 
+ *     Function : handleMacCellCfgReq 
  *     
  *     This function handles the gNB and cell configuration
  *     request received from DU APP.
@@ -2122,7 +2121,7 @@ Pst           *cfmPst
  *  @return  S16
  *      -# ROK
  **/
-S16 unpackMacCellCfgReq
+S16 handleMacCellCfgReq
 (
  Pst           *pst,
  MacCellCfg    *macCellCfg
@@ -2130,10 +2129,12 @@ S16 unpackMacCellCfgReq
 {
    U16 ret = ROK;
    MacCellCfgCfm macCellCfgCfm;
+   RgCellCb      *cellCb;
    Pst cnfPst;
    Inst inst = pst->dstInst;
 
-   memcpy(&rgCb[inst].macCellCfg,macCellCfg,sizeof(MacCellCfg));
+   cellCb = rgCb[inst].cell;
+   memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg));
 
    macCellCfgFillCfmPst(pst,&cnfPst);
 
@@ -2141,7 +2142,7 @@ S16 unpackMacCellCfgReq
    //ret = cmPackLcMacCellCfgCfm(&cnfPst,&macCellCfgCfm);
    ret = (*packMacCellCfmMt[cnfPst.selector])(&cnfPst,&macCellCfgCfm);
    return ret;
-} /* end of unpackMacCellCfgReq */
+} /* end of handleMacCellCfgReq */
 
 \f
 /**********************************************************************
index 582049d..709bb30 100644 (file)
@@ -3556,7 +3556,7 @@ Buffer *mBuf;           /* message buffer */
 
 /*
 *
-*       Fun:   cmGetTransId
+*       Fun:   getTransId
 *
 *       Desc:  This function return the transaction ID used for interface transactions 
 *
@@ -3565,12 +3565,9 @@ Buffer *mBuf;           /* message buffer */
 *       File:  cm_gen.c
 *
 */
-U16 cmGetTransId()
+U16 getTransId()
 {
-   if(gTransId<65535)
-      gTransId++;
-   else
-      gTransId = 0;
+   gTransId = (gTransId%65535) + 1;
    return gTransId; 
 }
 /**********************************************************************
index e4945ca..e579c2f 100644 (file)
@@ -24,6 +24,8 @@
 #include "ss_queue.h"
 #include "ss_task.h"
 #include "ss_msg.h"
+#include "du_cfg.h"
+
 #include "gen.x"           /* general */
 #include "ssi.x"           /* system services */
 #include "cm_tkns.x"       /* Common Token Definitions */
  ***************************************************************************/
 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)
-{
+   /* we are now implemented only light wieght lossely coupled interface */
    return ROK;
 }
 
@@ -116,7 +97,7 @@ S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
  *
  * @details
  *
- *      Function : unpackLwLcMacCellCfg
+ *      Function : unpackDuMacCellCfg
  *
  *      Functionality:
  *           packs the macCellCfg parameters
@@ -128,17 +109,27 @@ S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
  *         RFAILED - failure
  *
  ***************************************************************************/
-void cmUnpackLwLcMacCellCfg(
+void unpackDuMacCellCfg(
    DuMacCellCfgReq func,
    Pst *pst,
    Buffer *mBuf)
 {
+   U16 ret = ROK;
    MacCellCfg *macCellCfg;
 
-   /* unpack the address of the structure */
-   CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf);
-
-   RETVALUE((*func)(pst, macCellCfg));
+   if(pst->selector == DU_SELECTOR_LWLC)
+   {
+      /* unpack the address of the structure */
+      CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf);
+      ret = (*func)(pst, macCellCfg);
+   }
+   else
+   {
+      /* only LWLC is implemented now */
+      ret = ROK;
+   }
+   return ret;
 }
 
 /**************************************************************************
@@ -172,28 +163,6 @@ U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
    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
@@ -221,7 +190,7 @@ U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
  *
  * @details
  *
- *      Function : cmUnpackLcMacCellCfgCfm
+ *      Function : unpackMacCellCfgCfm
  *
  *      Functionality:
  *           packs the transaction ID  
@@ -233,14 +202,22 @@ U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
  *         RFAILED - failure
  *
  ***************************************************************************/
-S16 cmUnpackLcMacCellCfgCfm(
+S16 unpackMacCellCfgCfm(
    DuMacCellCfgCfm func, 
    Pst *pst,
    Buffer *mBuf)
 {
    MacCellCfgCfm macCellCfgCfm;
-   /* pack the transaction ID in CNF structure */
-   CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
 
-   RETVALUE((*func)(&macCellCfgCfm));
+   if(pst->selector == DU_SELECTOR_LC)
+   {
+      /* unpack the transaction ID in CNF structure */
+      CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
+
+      RETVALUE((*func)(&macCellCfgCfm));
+   }
+   else
+   {
+      /* only loose coupling is suported */
+   }
 }
index b7043cf..87b1f94 100644 (file)
@@ -158,9 +158,9 @@ typedef struct tddCfg
 typedef struct macCellCfg
 {
    U16            transId;
+   U16            cellId;     /* Cell Id */
    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 */
@@ -198,13 +198,10 @@ typedef S16 (*DuMacCellCfgCfm)     ARGS((
      ));
 
 S16 packLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
-
-S16 packTcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
-
 S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
 
 
-EXTERN S16 unpackMacCellCfgReq
+EXTERN S16 handleMacCellCfgReq
 (
  Pst           *pst,
  MacCellCfg    *macCellCfg
@@ -215,7 +212,7 @@ void cmUnpackLwLcMacCellCfg(
    Pst *pst,
    Buffer *mBuf);
 
-S16 cmUnpackLcMacCellCfgCfm(
+S16 unpackMacCellCfgCfm(
    DuMacCellCfgCfm func,
    Pst *pst,
    Buffer *mBuf);
index d2095e3..a7653fc 100644 (file)
@@ -194,7 +194,7 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf)
                   }
                case EVENT_MAC_CELL_CONFIG_CFM:
                   {
-                     ret = cmUnpackLcMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
+                     ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
                      break;
                   }
                default:
index 910386a..e8f712d 100644 (file)
@@ -40,7 +40,7 @@ extern S16 cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
 packMacCellCfgReq packMacCellCfgMt[] =
 {
    packLcMacCellCfg, /* packing for loosely coupled */
-   packTcMacCellCfg, /* packing for tightly coupled */
+   handleMacCellCfgReq, /* packing for tightly coupled */
    packLwLcMacCellCfg, /* packing for light weight loosly coupled */
 };
 
@@ -1527,7 +1527,7 @@ S16 duBuildAndSendMacCellCfg()
    /* copy the mac config structure from duCfgParams */
    memcpy(pMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
 
-   pMacCellCfg->transId = cmGetTransId(); /* transaction ID */
+   pMacCellCfg->transId = getTransId(); /* transaction ID */
    
    /* Fill Pst */
    pst.selector  = DU_SELECTOR_LWLC;