replaced cmMemSet, cmMemcpy with memset and memcpy resp AND Removed TRC() traces...
[o-du/l2.git] / src / 5gnrsch / sch_ue_mgr.c
index 37e8e77..b78ea4d 100644 (file)
@@ -91,6 +91,8 @@ void SchSendUeCfgRspToMac(SchUeCfg *ueCfg, Inst inst,\
 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
 {
    uint8_t      idx;
+   uint8_t      lcId;
+   uint8_t      lcIdx;
    uint16_t     ueIdx;
    SchCellCb    *cellCb;
    SchUeCb      *ueCb;
@@ -144,12 +146,28 @@ uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
 
    /* Fill received Ue Configuration in UeCb */
    memset(ueCb, 0, sizeof(SchUeCb));
-
-   GET_UE_IDX(ueCfg->crnti, ueCb->ueIdx);
+   ueCb->ueIdx = ueIdx;
    ueCb->crnti = ueCfg->crnti;
    memcpy(&ueCb->ueCfg, ueCfg, sizeof(SchUeCfg));
    ueCb->state = SCH_UE_STATE_ACTIVE;
+
+   /* Fill SRB1 info */
+   for(lcIdx = 0; lcIdx < ueCfg->numLc; lcIdx++)
+   {
+       lcId = ueCfg->lcCfgList[lcIdx].lcId;
+       ueCb->dlLcCtxt[lcId].lcp = ueCfg->lcCfgList[lcIdx].dlLcCfg.lcp;
+       ueCb->dlLcCtxt[lcId].lcState = SCH_LC_STATE_ACTIVE;
+       ueCb->dlLcCtxt[lcId].bo = 0;
+       ueCb->numDlLc++;
+       
+       if(ueCfg->lcCfgList[lcIdx].ulLcCfg)
+       {
+          /* TODO : Fill UL LC Cfg. As of now for SRB1, it is null */
+       }
+   }
+
    cellCb->numActvUe++;
+   SET_ONE_BIT(ueCb->ueIdx, cellCb->actvUeBitMap);
 
    ueCb->cellCb = cellCb;
    ueCb->srRcvd = false;
@@ -200,6 +218,7 @@ uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, S
 
   cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb += numRb;
 
+  puschInfo->crnti             = ueCb->crnti; 
   puschInfo->harqProcId        = SCH_HARQ_PROC_ID;
   puschInfo->resAllocType      = SCH_ALLOC_TYPE_1;
   puschInfo->fdAlloc.startPrb  = startRb;