Fixes for memory optimization [JIRA ID - ODUHIGH-354] 81/6581/1
authorlal.harshita <Harshita.Lal@radisys.com>
Thu, 26 Aug 2021 15:39:32 +0000 (21:09 +0530)
committerHarshita Lal <harshita.lal@radisys.com>
Mon, 6 Sep 2021 07:04:45 +0000 (07:04 +0000)
Change-Id: I5672ee85b085b693938d47240b642404b02093be
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Signed-off-by: barveankit <anbarve@radisys.com>
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
(cherry picked from commit 0f864d401fa6a384c15b983828afcff96a8b0c8a)

src/5gnrsch/sch_common.c
src/5gnrsch/sch_slot_ind.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_f1ap_msg_hdl.h
src/du_app/du_mgr.h
src/du_app/du_ue_mgr.c

index fea12b3..b36d054 100644 (file)
@@ -863,10 +863,15 @@ uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t cr
 void BuildK0K1TableForFdd(SchCellCb *cell, SchK0K1TimingInfoTbl *k0K1InfoTbl, bool pdschCfgCmnPres,SchPdschCfgCmn pdschCmnCfg,\
 SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
 {
-   uint8_t k0TmpVal = 0, k1TmpVal =0, cfgIdx=0;
+   
+   uint8_t k1TmpVal =0, cfgIdx=0;
    uint8_t slotIdx=0, k0Index=0, k1Index=0, numK0=0, numK1=0, numTimeDomAlloc=0;
-   SchPdschCfgCmnTimeDomRsrcAlloc cmnTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
-   SchPdschTimeDomRsrcAlloc dedTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
+   
+   /* TODO Commented these below lines for resolving warnings. Presently these variable are not 
+    * required but this will require for harq processing */
+   // uint8_t k0TmpVal = 0; 
+   // SchPdschCfgCmnTimeDomRsrcAlloc cmnTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
+   // SchPdschTimeDomRsrcAlloc dedTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
 
    /* Initialization the structure and storing the total slot values. */
    memset(k0K1InfoTbl, 0, sizeof(SchK0K1TimingInfoTbl));
@@ -878,7 +883,8 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
       numTimeDomAlloc = pdschCmnCfg.numTimeDomAlloc;
       for(cfgIdx = 0; cfgIdx<numTimeDomAlloc; cfgIdx++)
       {
-         cmnTimeDomRsrcAllocList[cfgIdx] = pdschCmnCfg.timeDomRsrcAllocList[cfgIdx];
+         /*TODO uncomment this line during harq processing */
+         //cmnTimeDomRsrcAllocList[cfgIdx] = pdschCmnCfg.timeDomRsrcAllocList[cfgIdx];
       }
    }
    else
@@ -886,7 +892,8 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
       numTimeDomAlloc = pdschDedCfg.numTimeDomRsrcAlloc;
       for(cfgIdx = 0; cfgIdx<numTimeDomAlloc; cfgIdx++)
       {
-         dedTimeDomRsrcAllocList[cfgIdx] = pdschDedCfg.timeDomRsrcAllociList[cfgIdx];
+         /*TODO uncomment this line during harq processing */
+         //dedTimeDomRsrcAllocList[cfgIdx] = pdschDedCfg.timeDomRsrcAllociList[cfgIdx];
       }
    }
    
@@ -899,6 +906,8 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
        * As per 38.331 PDSCH-TimeDomainResourceAllocation field descriptions. */
       for(k0Index = 0; ((k0Index < numTimeDomAlloc) && (k0Index < MAX_NUM_K0_IDX));  k0Index++)
       {
+         /* TODO These if 0 we will remove during harq processing */
+#if 0
          if(pdschCfgCmnPres == true)
          {
             k0TmpVal = cmnTimeDomRsrcAllocList[k0Index].k0;
@@ -914,7 +923,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
                k0TmpVal = DEFAULT_K0_VALUE;
             }
          }
-         
+#endif         
          /* Checking all the Ul Alloc values. If value is less than MIN_NUM_K1_IDX
           * then skip else continue storing the values. */
          numK1 = 0;
index 59501bc..ba6737b 100644 (file)
@@ -183,7 +183,10 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
       
       if (!dlMsgAlloc->numLc)
       {
-         DU_LOG("\nDEBUG  -->  SCH : No bo for any lcid\n");
+         DU_LOG("\nDEBUG  -->  SCH : No pending BO for any LC id\n");
+         /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
+         SCH_FREE(cell->schDlSlotInfo[dlSchedInfo->schSlotValue.dlMsgTime.slot]->dlMsgInfo, \
+               sizeof(DlMsgInfo));
          return ROK;
       }
 
index d72a92d..2ef7201 100644 (file)
@@ -5240,8 +5240,7 @@ void FreePdschTimeDomAllocList( struct PDSCH_Config__pdsch_TimeDomainAllocationL
  * ****************************************************************/
 void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg)
 {
-   uint8_t idx1=0;
-   uint8_t idx2=0;
+   uint8_t rsrcListIdx=0;
    struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList_t=NULLP;
 
    if(puschCfg->pusch_TimeDomainAllocationList)
@@ -5249,23 +5248,23 @@ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg)
       timeDomAllocList_t=puschCfg->pusch_TimeDomainAllocationList;
       if(timeDomAllocList_t->choice.setup)
       {
-        if(timeDomAllocList_t->choice.setup->list.array)
-        {
-           DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx2]->k2, sizeof(long));
-           for(idx1 = 0; idx1<timeDomAllocList_t->choice.setup->list.count; idx1++)
-           {
-              DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx1],\
-                    sizeof(PUSCH_TimeDomainResourceAllocation_t));
-           }
-           DU_FREE(timeDomAllocList_t->choice.setup->list.array, \
-                 timeDomAllocList_t->choice.setup->list.size);
-        }
-        DU_FREE(timeDomAllocList_t->choice.setup, \
-              sizeof(struct PUSCH_TimeDomainResourceAllocationList));
+         if(timeDomAllocList_t->choice.setup->list.array)
+         {
+            for(rsrcListIdx = 0; rsrcListIdx<timeDomAllocList_t->choice.setup->list.count; rsrcListIdx++)
+            {
+               DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx]->k2, sizeof(long));
+               DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx],\
+                     sizeof(PUSCH_TimeDomainResourceAllocation_t));
+            }
+            DU_FREE(timeDomAllocList_t->choice.setup->list.array, \
+                  timeDomAllocList_t->choice.setup->list.size);
+         }
+         DU_FREE(timeDomAllocList_t->choice.setup, \
+               sizeof(struct PUSCH_TimeDomainResourceAllocationList));
       }
       DU_FREE(puschCfg->transformPrecoder, sizeof(long));
       DU_FREE(puschCfg->pusch_TimeDomainAllocationList, \
-           sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
+            sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
    }
 
 }
@@ -8125,13 +8124,19 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
  *
  *    Functionality: Fills PdschCfg received  by CU
  *
- * @params[in] PDSCH_Config_t *cuPdschCfg,
- *             PdschConfig *macPdschCfg
+ * @params[in] PDSCH_Config_t *cuPdschCfg = Information which is send by CU,
+ *                   which we have stored in F1UeContextSetupDb,
+ *             PdschConfig *macPdschCfg = Used to Store the information which
+ *                   needs to send in other layer, as well as this can be the variable
+ *                   which stores the information in DuCb,
+ *             PdschConfig *storedPdschCfg =  Null in case of sending the
+ *                   information to other layer else it will have stored pdsch 
+ *                   configuration in copyOfmacUeCfg.
  * @return void
  *
  * ****************************************************************/
 
-void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
+void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg, PdschConfig *storedPdschCfg)
 {
    uint8_t timeDomIdx;
    struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAlloc = NULLP;
@@ -8165,7 +8170,22 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
                {
                   if(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 == NULL)
                   {
-                     DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t));
+                     if(storedPdschCfg)
+                     {
+                        if(storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0)
+                        {
+                           macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 =\
+                           storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0;
+                        }
+                        else
+                        {
+                           DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t));
+                        }
+                     }
+                     else
+                     {
+                        DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t));
+                     }
                      if(!macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0)
                      {
                         DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for k0 at extractPdschCfg()");
@@ -8173,7 +8193,7 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
                      }
                   }
                   *(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) = \
-                       *(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0);
+                  *(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0);
                }
                macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \
                   timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType;
@@ -8819,13 +8839,20 @@ void extractSchedReqCfgToAddMod(PucchSchedReqCfg *macSchedReqCfg, struct PUCCH_C
  *
  *    Functionality: Fills PucchCfg received  by CU
  *
- * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg,
- *             PucchCfg *macPucchCfg
+ * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg = Information which
+ *                is send by CU, which we have stored in F1UeContextSetupDb,
+ *             PucchCfg *macPucchCfg = Used to Store the information which
+ *                needs to send in other layer, as well as this can be the variable
+ *                which stores the information in DuCb,
+ *             PucchCfg *storedPucchCfg = Null in case of sending the
+ *                information to other layer else it will have Pucch Cfg which
+ *                we have stored in copyOfmacUeCfg.
  * @return ROK/RFAILED
  *
  * ****************************************************************/
 
-uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg)         
+uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg,\
+PucchCfg *storedPucchCfg)        
 {
    uint8_t arrIdx;
 
@@ -8951,20 +8978,34 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu
 
          /* Dl_DataToUL_ACK */ 
         if(cuPucchCfg->choice.setup->dl_DataToUL_ACK)
-        {
+    {
+       if(storedPucchCfg)
+       {
+          if(storedPucchCfg->dlDataToUlAck)
+          {
+             macPucchCfg->dlDataToUlAck = storedPucchCfg->dlDataToUlAck; 
+          }
+          else
+          {
             DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck));
-           if(macPucchCfg->dlDataToUlAck == NULLP)
-           {
-              DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()");
-              return RFAILED;
-           }
-           memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck));
-            macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count;
-           for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++)
-            {
-               macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\
-                  *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx];
-           }
+          }
+       }
+       else
+       {
+          DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck));
+       }
+       if(macPucchCfg->dlDataToUlAck == NULLP)
+       {
+          DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()");
+          return RFAILED;
+       }
+       memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck));
+       macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count;
+       for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++)
+       {
+          macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\
+          *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx];
+       }
         }
 
         /* Power Control */
@@ -8994,12 +9035,19 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu
  *
  *    Functionality: Fills ServingCellReconfig received  by CU
  *
- * @params[in] ServingCellConfig_t *cuSrvCellCfg
- *             ServCellCfgInfo *macSrvCellCfg
+ * @params[in] ServingCellConfig_t *cuSrvCellCfg = Information which is send by
+ *                  CU, which we have stored in F1UeContextSetupDb,
+ *             ServCellCfgInfo *macSrvCellCfg = Used to Store the information
+ *                  which  needs to send in other layer, as well as this can be the
+ *                  variable which stores the information in DuCb, 
+ *             ServCellCfgInfo *storedSrvCellCfg = Null in case of sending the
+ *                  information to other layer else it will have ServCellCfgInfo which
+ *                  we have stored in copyOfmacUeCfg.
  * @return ROK/RFAILD
  *
  * ****************************************************************/
-uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg)
+uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg,\
+ServCellCfgInfo *storedSrvCellCfg)
 {
    uint8_t ret = ROK;
    BWP_DownlinkDedicated_t *dlBwp = NULLP;
@@ -9011,18 +9059,34 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       if(dlBwp->pdcch_Config)
       {
          if(dlBwp->pdcch_Config->choice.setup)
-        {
-           macSrvCellCfg->initDlBwp.pdcchPresent = true;
-           extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
-        }
+         {
+            macSrvCellCfg->initDlBwp.pdcchPresent = true;
+            extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
+         }
       }
       if(dlBwp->pdsch_Config)
       {
          if(dlBwp->pdsch_Config->choice.setup)
-        {
-           macSrvCellCfg->initDlBwp.pdschPresent = true;
-           extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg);
-        }
+         {
+            macSrvCellCfg->initDlBwp.pdschPresent = true;
+            
+            if(storedSrvCellCfg)
+            {
+               if(!storedSrvCellCfg->initDlBwp.pdschPresent)
+               {
+                  extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL);
+               }
+               else
+               {
+                  extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg,\
+                        &storedSrvCellCfg->initDlBwp.pdschCfg);
+               }
+            }
+            else
+            {
+               extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL);
+            }
+         }
       }
    }
    if(cuSrvCellCfg->firstActiveDownlinkBWP_Id)
@@ -9039,15 +9103,15 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       {
          macSrvCellCfg->bwpInactivityTmr = NULLP;
          DU_ALLOC_SHRABL_BUF(macSrvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
-        if(macSrvCellCfg->bwpInactivityTmr)
-        {
+         if(macSrvCellCfg->bwpInactivityTmr)
+         {
             memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
-        }
-        else
-        {
-           DU_LOG("\nERROR  --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()");
-           return RFAILED;
-        }
+         }
+         else
+         {
+            DU_LOG("\nERROR  --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()");
+            return RFAILED;
+         }
       }
    }
    if(cuSrvCellCfg->pdsch_ServingCellConfig)
@@ -9056,31 +9120,42 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       {
          ret = extractPdschServingCellCfg(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup, &macSrvCellCfg->pdschServCellCfg);
          if(ret == RFAILED)
-        {
-           DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()");
-           return RFAILED;
-        }
+         {
+            DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()");
+            return RFAILED;
+         }
       }
    }
    if(cuSrvCellCfg->uplinkConfig)
    {
-     if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
-     {
-        ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
-       if(ulBwp->pusch_Config)
-       {
-          macSrvCellCfg->initUlBwp.puschPresent = true;
-           extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
-       }
-       if(ulBwp->pucch_Config)
-       {
-          macSrvCellCfg->initUlBwp.pucchPresent = true;
-          memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg));
-           extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg); 
-       }
-     }
-     if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
-        macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
+      if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
+      {
+         ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
+         if(ulBwp->pusch_Config)
+         {
+            macSrvCellCfg->initUlBwp.puschPresent = true;
+            extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
+         }
+         if(ulBwp->pucch_Config)
+         {
+            macSrvCellCfg->initUlBwp.pucchPresent = true;
+            memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg));
+            if(storedSrvCellCfg)
+            {
+               if(!storedSrvCellCfg->initUlBwp.pucchPresent)
+                  extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL);
+               else
+                  extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg,\
+                  &storedSrvCellCfg->initUlBwp.pucchCfg);
+            }
+            else
+            {
+               extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL);
+            }
+         }
+      }
+      if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
+         macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
    }
    return ret;
 }
@@ -9093,13 +9168,20 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
  *    Function : extractUeReCfgCellInfo
  *
  *    Functionality: Fills Reconfig Cell group Info received by CU
+ *   
+ * @params[in] CellGroupConfigRrc_t *cellGrp = CellGroupConfigRrc_t information which
+ *                       is send by CU, which we have stored in F1UeContextSetupDb
+ *             MacUeCfg *MacUeCfg = Used to Store the information,
+ *                      which needs to send in other layer, as well as this can be
+ *                      the variable which stores the information in DuCb,
+ *             MacUeCfg *storedMacUeCfg = Null in case of sending the
+ *                      information to other layer else it will have copyOfmacUeCfg
+ *                      which we have stored in F1UeContextSetupDb.
  *
- * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
- *             MacUeCfg*  macUeCfg
  * @return ROK/RFAILED
  *
  * ****************************************************************/
-uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg)
+uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg)
 {
    uint8_t ret = ROK;
    MAC_CellGroupConfig_t     *macCellGroup = NULLP;
@@ -9182,7 +9264,18 @@ uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg
          if(cellGrp->spCellConfig->spCellConfigDedicated)
          {
             servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
-            ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg);
+            if(storedMacUeCfg)
+            {
+               if(!storedMacUeCfg->spCellCfgPres)
+                  ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL);
+               else
+                  ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg,\
+                        &storedMacUeCfg->spCellCfg.servCellCfg);
+            }
+            else
+            {
+               ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL);
+            }
             if(ret == RFAILED)
             {
                DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
@@ -9561,13 +9654,19 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
  *
  *    Functionality: builds Mac Cell Cfg
  *
- * @params[in] MacUeCfg pointer
- *             void pointer
+ * @params[in] MacUeCfg *macUeCfgToSend = Used to Store the information which
+ *                       needs to send in other layer, as well as this can be
+ *                       the variable which stores the information in DuCb.
+ *             MacUeCfg *storedMacUeCfg = Null in case of sending the
+ *                       information to other layer else it will have copyOfmacUeCfg  
+ *                       which we have stored in F1UeContextSetupDb
+ *             void *cellInfo = CellGroupConfigRrc_t information which is send
+ *                        by CU, which we have stored in F1UeContextSetupDb 
  *
  * @return void 
  *
  * ****************************************************************/
-uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, void *cellInfo)
+uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend,MacUeCfg *storedMacUeCfg, void *cellInfo)
 {
    uint8_t ret = ROK;
    CellGroupConfigRrc_t *cellGrp = NULLP;
@@ -9575,7 +9674,7 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, void *cellInfo)
    if(cellInfo)
    {
       cellGrp = (CellGroupConfigRrc_t *)cellInfo;
-      ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend);
+      ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg);
       if(ret == RFAILED)
          DU_LOG("\nERROR  -->  F1AP : Failed at procUeReCfgCellInfo()");
    }
index c956fe0..4182abb 100644 (file)
@@ -34,7 +34,7 @@ uint8_t BuildAndSendDUConfigUpdate();
 uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti, uint16_t rrcContSize, 
           uint8_t *rrcContainer);
 uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId,  uint16_t msgLen, uint8_t *rrcMsg);
-uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellGrp);
+uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg, void *cellGrp);
 void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg);
 uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx);
 uint8_t getDrbLcId(uint32_t *drbBitMap);
index 0cd9f86..5cd1c60 100644 (file)
@@ -127,6 +127,7 @@ typedef struct duUeCfg
    AmbrCfg *ambrCfg;
    uint8_t numDrb;
    UpTnlCfg upTnlInfo[MAX_NUM_DRB];  /* User plane TNL Info*/
+   MacUeCfg copyOfmacUeCfg;
 }DuUeCfg;
 
 typedef struct f1UeContextSetup
index 39569c9..d4d7ca0 100644 (file)
@@ -1203,7 +1203,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
       macUeCfg->cellId       = cellId;
       macUeCfg->ueIdx        = ueIdx;
       macUeCfg->crnti        = crnti;
-      ret = procUeReCfgCellInfo(macUeCfg, ueCfgDb->cellGrpCfg);
+      ret = procUeReCfgCellInfo(macUeCfg, duMacDb, ueCfgDb->cellGrpCfg);
       if(ret == ROK)
       {
          if(macUeCfg->spCellCfgPres == true)
@@ -1262,6 +1262,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
             break;
          }
       }/*End of Outer FOR loop */
+      memcpy(&ueCfgDb->copyOfmacUeCfg, macUeCfg, sizeof(MacUeCfg));
    }
    return ret;
 }
@@ -1740,12 +1741,12 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
    uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx, cellIdx;
    MacUeCfg *oldMacUeCfg;
    ret = ROK;
-
+   
    GET_CELL_IDX(macUeCfg->cellId, cellIdx);
    oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueIdx-1].macUeCfg;
 
    /*Filling Cell Group Cfg*/
-   ret =  procUeReCfgCellInfo(macUeCfg, f1UeDb->duUeCfg.cellGrpCfg);
+   ret =  procUeReCfgCellInfo(macUeCfg, &f1UeDb->duUeCfg.copyOfmacUeCfg, f1UeDb->duUeCfg.cellGrpCfg);
    if(ret == ROK)
    {
       if(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschPresent)