Moved macCellCfg to duCellCb 73/4873/5
authorlal.harshita <harshita.lal@radisys.com>
Wed, 21 Oct 2020 12:26:29 +0000 (17:56 +0530)
committerlal.harshita <harshita.lal@radisys.com>
Wed, 4 Nov 2020 12:20:42 +0000 (17:50 +0530)
Change-Id: I06718c0e5c18897ce03ecfa80d5da38d648cc08d
Signed-off-by: lal.harshita <harshita.lal@radisys.com>
docs/README
src/du_app/du_cell_mgr.c
src/du_app/du_mgr.h
src/du_app/du_msg_hdl.c

index d14d729..9201a8e 100644 (file)
@@ -56,8 +56,8 @@ How to Clean and Build:
    c. Cleaning RIC Stub binary
          make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
 
-4. Cleaning ODU and CU Stub
-      make clean_all MACHINE=BIT64 MODE=FDD
+4. Cleaning ODU, CU Stub and RIC Stub:
+      make clean_all
 
 How to execute:
 ---------------
index 0a49c0d..655801f 100644 (file)
@@ -37,7 +37,7 @@
 #include "du_f1ap_msg_hdl.h"
 
 extern DuCfgParams duCfgParam;
-extern uint8_t duBuildAndSendMacCellCfg();
+uint8_t duBuildAndSendMacCellCfg(uint16_t cellId);
 
 /*******************************************************************
  *
@@ -96,10 +96,14 @@ uint8_t procCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
       duCb.actvCellLst[nci-1] = cellCb;
       duCb.numActvCells++;
       /* Build and send Mac Cell Cfg for the number of active cells */
-      ret = duBuildAndSendMacCellCfg();
+      ret = duBuildAndSendMacCellCfg(cellCb->cellId);
       if(ret != ROK)
       {
          DU_LOG("\nDU APP : macCellCfg build and send failed");
+        /* Move cellCb back to cfgCellList */
+        duCb.cfgCellLst[nci-1] = duCb.actvCellLst[nci-1];
+        duCb.actvCellLst[nci-1] = NULLP;
+        duCb.numActvCells--;
          return RFAILED;
       }
    }
index d3b5ea2..c9b1bc9 100644 (file)
@@ -93,6 +93,8 @@ typedef struct duCellCb
 {
    uint16_t       cellId;           /* Internal cell Id */
    CellCfgParams  cellInfo;         /* Cell info */
+   /* pointer to store the address of macCellCfg params used to send du-app to MAC */
+   MacCellCfg    *duMacCellCfg;
    bool           firstSlotIndRcvd;
    CellStatus     cellStatus;       /* Cell status */
    uint32_t       numActvUes;       /* Total Active UEs */
@@ -132,8 +134,6 @@ typedef struct duCb
    DuCellCb*     cfgCellLst[MAX_NUM_CELL];     /* List of cells at DU APP of type DuCellCb */
    uint8_t       numActvCells;
    DuCellCb*     actvCellLst[MAX_NUM_CELL];    /* 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    *duMacCellCfg;         /* pointer to store params while sending DU-APP to MAC */
    uint32_t       numUe;            /* current number of UEs */
    UeCcchCtxt     ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
 }DuCb;
index d7744cb..8d20c99 100644 (file)
@@ -1539,15 +1539,14 @@ uint8_t duSendEgtpSlotInd()
  *      Functionality:
  *           Initiates MAC Configs towards MAC
  *     
- * @param[in] void
+ * @param[in]cell id
  * @return ROK     - success
  *         RFAILED - failure
  *
  ***************************************************************************/
-uint8_t duBuildAndSendMacCellCfg()
+uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
 {
    Pst pst;
-   DU_SET_ZERO(&pst, sizeof(Pst));
    MacCellCfg *duMacCellCfg = NULLP;
 
    DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
@@ -1556,8 +1555,8 @@ uint8_t duBuildAndSendMacCellCfg()
       return RFAILED;
    }
 
-   /* store the address in the duCb so that we can free on confirm msg */
-   duCb.duMacCellCfg = duMacCellCfg;
+   /* store the address in the duCellCb so that we can free on confirm msg */
+   duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
 
    /* copy the mac config structure from duCfgParams */
    memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
@@ -1589,29 +1588,30 @@ uint8_t  duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
    uint8_t actvCellIdx  = 0;
    uint8_t ret          = ROK;
 
-   if(macCellCfgCfm->rsp == ROK)  
+   for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
    {
-       for(actvCellIdx = 0 ; actvCellIdx <duCb.numActvCells ; actvCellIdx++)
-       {
-           if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
-           {
-               duCb.duMacCellCfg = NULLP;
-               /* 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
-    {
-       DU_LOG("\nMac cell cfg failed");
-       ret = RFAILED;
-    }
-    return ret;
+      if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
+      {
+        duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
+      }
+   }
+   if(macCellCfgCfm->rsp == ROK)
+   {
+      /* Build and send GNB-DU config update */
+      ret = BuildAndSendDUConfigUpdate();
+
+      /* Build and Send Cell Start Req to MAC */
+      ret = duBuildAndSendMacCellStartReq();
+   }
+   else
+   {
+      /* TODO : Action to be taken if cell configuration fails. 
+       * Should CU be informed? */
+
+      DU_LOG("\nMac cell cfg failed");
+      ret = RFAILED;
+   }
+   return ret;
 }
 
 /*******************************************************************