Merge "[Epic-ID: ODUHIGH-556][Task-ID: ODUHIGH-570] UL Candidate Sel and Res Alloc...
[o-du/l2.git] / src / 5gnrsch / sch_slot_ind.c
index 8b423b2..0efd930 100644 (file)
@@ -242,8 +242,6 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
       }
    }
 
-   cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
-
    /*Re-setting the BO's of all DL LCs in this UE*/
    for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++)
    {
@@ -313,11 +311,11 @@ void schCalcSlotValues(SlotTimingInfo slotInd, SchSlotValue *schSlotValue, uint1
     *        on PHY_DELTA + SCHED_DELTA + BO_DELTA                 *
     ****************************************************************/
 
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA_DL, numOfSlots);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, gConfigInfo.gPhyDeltaDl, numOfSlots);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
 }
 
 /*******************************************************************
@@ -421,10 +419,11 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
    uint8_t numK0 = 0, k0TblIdx = 0, k0Val = 0, k0Index =0 ;
    uint8_t k1TblIdx = 0, k1Index = 0, k1Val = 0, numK1 = 0;
    uint8_t ret = RFAILED;
+   uint16_t  crnti = 0;
    SchUeCb *ueCb = NULLP;
    SchK0K1TimingInfoTbl *k0K1InfoTbl;
 
-   ADD_DELTA_TO_TIME(currTime, (*pdcchTime), PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(currTime, (*pdcchTime), gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
 #ifdef NR_TDD
    if(schGetSlotSymbFrmt(pdcchTime->slot, cell->slotFrmtBitMap) != DL_SLOT)
    {
@@ -434,6 +433,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
 #endif
 
    ueCb = &cell->ueCb[ueId-1];
+   GET_CRNTI(crnti, ueId);
    if(dedMsg == true)
    {
       k0K1InfoTbl = &ueCb->k0K1InfoTbl;
@@ -508,7 +508,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
             continue;
          }
 #endif
-         if(cell->schUlSlotInfo[pucchTime->slot]->pucchUe != 0)
+         if(cell->schUlSlotInfo[pucchTime->slot]->schPucchInfo[ueId - 1].crnti == crnti)
          {
             continue; 
          }
@@ -518,11 +518,11 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
          }
          pdcchTime->cellId = cell->cellId;
          pdschTime->cellId = cell->cellId;
-
-         cell->schUlSlotInfo[pucchTime->slot]->pucchUe = ueId;
+         
+         cell->schUlSlotInfo[pucchTime->slot]->schPucchInfo[ueId - 1].crnti = crnti;
 
          /*Availability of PUCCH for HARQ resources*/
-         ret = schAllocPucchResource(cell, *pucchTime, ueCb, hqP, pdcchAllocInfo);
+         ret = schAllocPucchResource(cell, ueId, *pucchTime, ueCb, hqP, pdcchAllocInfo);
          if(ret == RFAILED)
          {
             /*DL allocation can't go through as PUCCH is unavailable*/
@@ -577,7 +577,7 @@ uint8_t schProcDlPageAlloc(SchCellCb *cell, SlotTimingInfo currTime, Inst schIns
    {
       dlPageAlloc.cellId = currTime.cellId;
 
-      ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+      ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
       dlPageAlloc.shortMsgInd  = FALSE;
       pdschTime = dlPageAlloc.dlPageTime;