[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-423]Cleanup of hoUeCb[] 02/8002/3
authorlal.harshita <Harshita.Lal@radisys.com>
Wed, 30 Mar 2022 12:43:40 +0000 (18:13 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Thu, 31 Mar 2022 10:10:08 +0000 (15:40 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: Id9acede67ae3b9c968c2e42e469725b54462d922
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
src/5gnrmac/mac.h
src/5gnrmac/mac_msg_hdl.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_ue_mgr.c
src/cm/du_app_mac_inf.h
src/cm/mac_sch_interface.h
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_mgr.h
src/du_app/du_ue_mgr.c

index 9ee975f..3d9ace0 100644 (file)
@@ -205,8 +205,7 @@ typedef struct ueDlCb
 /* UE Cb */
 typedef struct macUeCb
 {
-   uint16_t     ueId;     /* UE Id calculated from CRNTI */
-   uint8_t      duUeF1apId; /* UE ID assigned by DU APP */
+   uint16_t     ueId;     /* UE Id from DU APP */
    uint16_t     crnti;    /* UE CRNTI */
    MacCellCb    *cellCb;  /* Pointer to cellCb to whihc this UE belongs */
    UeState      state;    /* Is UE active ? */
@@ -227,7 +226,6 @@ struct macCellCb
    MacUlSlot   ulSlot[MAX_SLOTS];
    uint16_t    numActvUe;
    MacUeCfg    *ueCfgTmpData[MAX_NUM_UE];
-   MacUeCb     hoUeCb[MAX_NUM_UE];
    MacUeCb     ueCb[MAX_NUM_UE];
    MacCellCfg  macCellCfg;
    SlotTimingInfo currTime;
index a304533..16ade71 100644 (file)
@@ -200,7 +200,7 @@ uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
       
       if(macCb.macCell[cellIdx] && macCb.macCell[cellIdx]->ueCb[ueId -1].transmissionAction == STOP_TRANSMISSION)
       {
-         DU_LOG("\nINFO   -->  MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].duUeF1apId);
+         DU_LOG("\nINFO   -->  MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].ueId);
       }
       else
       {
index a201e52..c1289e7 100644 (file)
@@ -1616,7 +1616,7 @@ uint8_t fillSchUeCfg(Pst *pst, SchUeCfg *schUeCfg, MacUeCfg *ueCfg)
    uint8_t ret = ROK;
 
    schUeCfg->cellId = ueCfg->cellId;
-   schUeCfg->duUeF1apId = ueCfg->duUeF1apId;
+   schUeCfg->ueId = ueCfg->ueId;
    schUeCfg->crnti = ueCfg->crnti;
    schUeCfg->dataTransmissionInfo = ueCfg->transmissionAction;
    /* Copy MAC cell group config */
@@ -2214,10 +2214,7 @@ uint8_t procMacUeCfgData(Pst *pst, MacUeCfg *ueCfg)
    }
 
    /* Check if UE already configured */
-   if(ueCfg->crnti)
-      ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1];
-   else
-      ueCb = &macCb.macCell[cellIdx]->hoUeCb[ueCfg->duUeF1apId -1];
+   ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1];
 
    switch(pst->event)
    {
@@ -2273,7 +2270,7 @@ uint8_t copyToTmpData(MacUeCfg *ueCfg)
    }
    memcpy(tmpData, ueCfg, sizeof(MacUeCfg));
    GET_CELL_IDX(ueCfg->cellId, cellIdx);
-   macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->duUeF1apId-1] = tmpData;
+   macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->ueId-1] = tmpData;
    return ROK;
 }
 
@@ -2365,7 +2362,7 @@ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp)
    /* Filling UE Config response */
    memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
    cfgRsp->cellId = schCfgRsp->cellId;
-   cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId;
+   cfgRsp->ueId = schCfgRsp->ueId;
    cfgRsp->result = result;
 
    /* Fill Post structure and send UE Create response*/
@@ -2405,7 +2402,7 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeCfgRsp *schCfgRsp)
    /* Filling UE Config response */
    memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
    cfgRsp->cellId = schCfgRsp->cellId;
-   cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId;
+   cfgRsp->ueId = schCfgRsp->ueId;
    cfgRsp->result = result;
 
    /* Fill Post structure and send UE Create response*/
@@ -2432,12 +2429,12 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeCfgRsp *schCfgRsp)
  *
  * ****************************************************************/
 
-MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t duUeF1apId)
+MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t ueId)
 {
    MacUeCfg *ueCfg = NULLP;
    if(macCb.macCell[cellIdx])
    {
-      ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[duUeF1apId-1];
+      ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[ueId-1];
    }
    else
    {
@@ -2487,7 +2484,7 @@ uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *schCfgRsp)
 #endif
    
    GET_CELL_IDX(schCfgRsp->cellId, cellIdx);
-   ueCfg = getMacUeCfg(cellIdx, schCfgRsp->duUeF1apId);
+   ueCfg = getMacUeCfg(cellIdx, schCfgRsp->ueId);
    if(ueCfg == NULLP)
    {
       DU_LOG("\nERROR  -->  MAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event);
index ac474c7..992485b 100644 (file)
@@ -964,7 +964,7 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
    ueCb = &cell->ueCb[ueId-1];
    if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
    {
-      DU_LOG("INFO  --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+      DU_LOG("INFO  --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
       return ROK;
    }
    
@@ -1070,7 +1070,7 @@ uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd)
 
    if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
    {
-      DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+      DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
       return ROK;
    }
    
@@ -1126,7 +1126,7 @@ uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd)
    }
    if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
    {
-      DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+      DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
       return ROK;
    }
    if(uciInd->numSrBits)
index e1d8ad8..043ca95 100644 (file)
@@ -220,7 +220,7 @@ typedef struct schUlCb
 typedef struct schUeCfgCb
 {
    uint16_t        cellId;
-   uint8_t         duUeF1apId;
+   uint8_t         ueId;
    uint16_t        crnti;
    bool macCellGrpCfgPres;
    SchMacCellGrpCfg   macCellGrpCfg;
@@ -340,7 +340,6 @@ typedef struct schCellCb
    uint8_t       ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!<start symbol per SSB beam */
    SchRaReq      *raReq[MAX_NUM_UE];                /*!< Pending RA request */
    SchRaCb       raCb[MAX_NUM_UE];                  /*!< RA Cb */
-   SchUeCb       hoUeCb[MAX_NUM_UE];                /*!<List of UE being handed-in to this DU */
    uint16_t      numActvUe;                         /*!<Number of active UEs */
    uint32_t      actvUeBitMap;                      /*!<Bit map to find active UEs */
    uint32_t      boIndBitMap;                       /*!<Bit map to indicate UEs that have recevied BO */
index fa4ce2e..9f010d4 100644 (file)
@@ -72,7 +72,7 @@ void SchSendUeCfgRspToMac(uint16_t event, SchUeCfg *ueCfg, Inst inst,\
    Pst rspPst;
 
    cfgRsp->cellId = ueCfg->cellId;
-   cfgRsp->duUeF1apId = ueCfg->duUeF1apId;
+   cfgRsp->ueId = ueCfg->ueId;
    cfgRsp->crnti = ueCfg->crnti;
    cfgRsp->rsp = result;   
 
@@ -259,7 +259,7 @@ uint8_t fillSchUeCb(Inst inst, SchUeCb *ueCb, SchUeCfg *ueCfg)
    bool isLcIdValid = FALSE;
 
    ueCb->ueCfg.cellId = ueCfg->cellId;
-   ueCb->ueCfg.duUeF1apId = ueCfg->duUeF1apId;
+   ueCb->ueCfg.ueId = ueCfg->ueId;
    ueCb->ueCfg.crnti = ueCfg->crnti;
    ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo;
    if(ueCfg->macCellGrpCfgPres == true)
@@ -506,7 +506,7 @@ SchCellCb *getSchCellCb(uint16_t srcEvent, Inst inst, SchUeCfg *ueCfg)
  * ****************************************************************/
 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
 {
-   uint8_t ueId, lcIdx, ret = ROK;
+   uint8_t      lcIdx = 0, ret = ROK;
    SchCellCb    *cellCb = NULLP;
    SchUeCb      *ueCb = NULLP;
    SchUeCfgRsp  cfgRsp;
@@ -526,13 +526,7 @@ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
    cellCb = getSchCellCb(pst->event, inst, ueCfg);
 
    /* Search if UE already configured */
-   if(ueCfg->crnti)
-   {
-      GET_UE_ID(ueCfg->crnti, ueId);
-      ueCb = &cellCb->ueCb[ueId -1];
-   }
-   else
-      ueCb = &cellCb->hoUeCb[ueCfg->duUeF1apId - 1];
+   ueCb = &cellCb->ueCb[ueCfg->ueId - 1];
 
    if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
    {
@@ -543,7 +537,7 @@ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
 
    /* Fill received Ue Configuration in UeCb */
    memset(ueCb, 0, sizeof(SchUeCb));
-   ueCb->ueId = ueId;
+   ueCb->ueId = ueCfg->ueId;
    ueCb->crnti = ueCfg->crnti;
    if(ueCb->crnti)
       ueCb->state = SCH_UE_STATE_ACTIVE;
index d4671f4..afd6ca6 100644 (file)
@@ -1253,7 +1253,6 @@ typedef struct macUeCfg
 {
    uint16_t cellId;
    uint8_t  ueId;
-   uint8_t  duUeF1apId;
    uint16_t crnti;
    bool macCellGrpCfgPres;
    MacCellGrpCfg macCellGrpCfg;
@@ -1297,7 +1296,7 @@ typedef struct sCellFailInfo
 typedef struct ueCfgRsp
 {
    uint16_t       cellId;
-   uint16_t       duUeF1apId;
+   uint16_t       ueId;
    MacRsp         result;
    uint8_t        numSRBFailed;   /* valid values : 0 to MAX_NUM_SRB */ 
    SRBFailInfo    *failedSRBlisti;
index 0bb6dac..67d64ed 100644 (file)
@@ -1572,7 +1572,7 @@ typedef struct schModulationInfo
 typedef struct schUeCfg
 {
    uint16_t        cellId;
-   uint8_t         duUeF1apId;
+   uint8_t         ueId;
    uint16_t        crnti;
    bool macCellGrpCfgPres;
    SchMacCellGrpCfg   macCellGrpCfg;
@@ -1591,7 +1591,7 @@ typedef struct schUeCfg
 typedef struct schUeCfgRsp
 {
    uint16_t   cellId;
-   uint16_t   duUeF1apId;
+   uint16_t   ueId;
    uint16_t   crnti;
    SchMacRsp  rsp;
    SchFailureCause cause;
index fcff8e8..079b234 100644 (file)
@@ -12012,7 +12012,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
                      ret = RFAILED;
                      break;
                   }
-                  duUeCb = &duCb.actvCellLst[cellIdx]->hoUeCb[ueIdx];
+                  duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
                   duUeCb->f1UeDb = NULL;
                   duUeCb->gnbCuUeF1apId = gnbCuUeF1apId;
                   duUeCb->gnbDuUeF1apId = gnbDuUeF1apId;
index 5f02a2c..7dad91b 100644 (file)
@@ -186,9 +186,7 @@ typedef struct duCellCb
    MacCellCfg     *duMacCellCfg;
    CellStatus     cellStatus;             /* Cell status */
    uint32_t       numActvUes;             /* Total Active UEs */
-   DuUeCb         ueCb[MAX_NUM_UE];       /* UE context created after RRC setup */
-   uint32_t       numHoUes;               /* Number of UE handover in progress */
-   DuUeCb         hoUeCb[MAX_NUM_UE];     /* UE context created before RACH for UE being handover to this DU */
+   DuUeCb         ueCb[MAX_NUM_UE];       /* Stores UE context */
    SlotInfo       currSlotInfo;
 }DuCellCb;
 
index 9c660ef..f63e47d 100644 (file)
@@ -1169,13 +1169,9 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t gnbDuUef1apId, uint16_t crnti, DuU
    bool lcIdFound = false;
    MacUeCfg *duMacDb = NULLP;
 
-   macUeCfg->cellId       = cellId;
-   if(crnti)
-   {
-      GET_UE_ID(crnti, macUeCfg->ueId);
-      macUeCfg->crnti = crnti;
-   }
-   macUeCfg->duUeF1apId = gnbDuUef1apId;
+   macUeCfg->cellId = cellId;
+   macUeCfg->ueId = gnbDuUef1apId;
+   macUeCfg->crnti = crnti;
 
    if(!ueCfgDb)
    {
@@ -2340,64 +2336,43 @@ uint8_t duUpdateDuUeCbCfg(uint8_t ueId, uint8_t cellId)
  * ****************************************************************/
 uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
 {
-   uint8_t ret = ROK, ueIdx = 0, ueId = 0;
-   DuUeCb *ueCb = NULLP;
+   uint8_t ret = ROK;
+   uint16_t cellIdx;
 
    if(cfgRsp)
    {
+      GET_CELL_IDX(cfgRsp->cellId, cellIdx);
       if(cfgRsp->result == MAC_DU_APP_RSP_OK)
       {
          if(pst->event == EVENT_MAC_UE_CREATE_RSP)
          {
-            DU_LOG("\nINFO   -->  DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId);
-            
-            for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
-            {
-               if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId)
-               {
-                  ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx];
-                  ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
-                  break;
-               }
-            }
-            if(!ueCb)
+            DU_LOG("\nINFO   -->  DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId);
+
+            if(duCb.actvCellLst[cellIdx] && 
+                  (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
             {
-               if(duCb.actvCellLst[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1].gnbDuUeF1apId == cfgRsp->duUeF1apId)
-               {
-                  ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1];
-                  ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
-                  //TODO : in next gerrit
-                  //BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId);
-               }
-            }
+               duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
 
+               /* TODO : IF UE state is HANDIN_IN_PROGRESS, then send UE Context Setup Response */
+            }
          }
          else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
          {
-            DU_LOG("\nINFO   -->  DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId);
-            for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
-            {
-               if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId)
-               {
-                  ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx];    
-                  ueCb->macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
-                  break;
-               }
-            } 
-
-            if(ueCb)
+            DU_LOG("\nINFO   -->  DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId);
+            if(duCb.actvCellLst[cellIdx] && 
+                  (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
             {
-               GET_UE_ID(ueCb->crnti, ueId);
-               if((ret = duUpdateDuUeCbCfg(ueId, cfgRsp->cellId)) == ROK)
-               {
-                  BuildAndSendUeCtxtRsp(cfgRsp->cellId, ueId);
+               duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
+               if((ret = duUpdateDuUeCbCfg(cfgRsp->ueId, cfgRsp->cellId)) == ROK)
+               {  
+                  BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId);
                }
             }
          }
       }
       else
       {
-         DU_LOG("\nERROR  -->  DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->duUeF1apId);
+         DU_LOG("\nERROR  -->  DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->ueId);
          if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
          {
             //TODO: Send the failure case in Ue Context Setup Response