[Epic-ID: ODUHIGH-517][Task-ID: ODUHIGH-540][SubTask-Id: ODUHIGH-549] Multi PDSCH...
[o-du/l2.git] / src / 5gnrsch / sch_rach.c
index 49c3109..c002ea7 100644 (file)
@@ -40,6 +40,7 @@
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
 #include "sch.h"
+#include "sch_tmr.h"
 #include "sch_utils.h"
 
 /**
@@ -74,7 +75,7 @@ bool schCheckPrachOcc(SchCellCb *cell, SlotTimingInfo prachOccasionTimingInfo)
 
    if((prachOccasionTimingInfo.sfn%x) == y)
    {
-      subFrame = prachOccasionTimingInfo.slot/pow(2, cell->cellCfg.numerology);
+      subFrame = prachOccasionTimingInfo.slot/pow(2, cell->numerology);
 
       /* check for subFrame number */
       if ((1 << subFrame) & prachSubframe)
@@ -181,7 +182,7 @@ void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotTimingInfo
    ulSchedInfo->prachSchInfo.prachFormat    = prachFormat;
    ulSchedInfo->prachSchInfo.numRa          = numRa;
    ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol;
-   DU_LOG("\nINFO   --> SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot);
+   DU_LOG("\nINFO   -->  SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot);
 }
 
 /**
@@ -555,15 +556,15 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
    RaRspWindowStatus    windowStatus=0;
    
 #ifdef NR_TDD
-   totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.scsCommon, cell->cellCfg.tddCfg.tddPeriod);
+   totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.ssbScs, cell->cellCfg.tddCfg.tddPeriod);
 #endif
    k0K1InfoTbl    = &cell->k0K1InfoTbl;
    if(cell->raReq[ueId-1]->isCFRA == false)
    {
       msg3K2InfoTbl  = &cell->msg3K2InfoTbl;
-      puschMu        = cell->cellCfg.numerology;
+      puschMu        = cell->numerology;
       msg3Delta      = puschDeltaTable[puschMu];
-      msg3MinSchTime = minMsg3SchTime[cell->cellCfg.numerology];
+      msg3MinSchTime = minMsg3SchTime[cell->numerology];
    }
 
    /* Calculating time frame to send DCI for RAR */
@@ -595,10 +596,6 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
             ADD_DELTA_TO_TIME(dciTime, rarTime, k0, cell->numSlots);
             rarSlot = rarTime.slot;
             
-            /* If PDSCH is already scheduled on this slot, cannot schedule PDSCH for another UE here. */
-            if(cell->schDlSlotInfo[rarSlot]->pdschUe != 0)
-               continue;
-
             /* If Contention-FREE RA is in progress, allocate resources for
              * PUCCH for next UL message */
             if(cell->raReq[ueId-1]->isCFRA)
@@ -783,7 +780,6 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
       }
 
       cell->schDlSlotInfo[dciSlot]->pdcchUe = ueId;
-      cell->schDlSlotInfo[rarSlot]->pdschUe = ueId;
       if(cell->raReq[ueId-1]->isCFRA)
          cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
       else
@@ -861,7 +857,7 @@ uint8_t SchProcRachInd(Pst *pst, RachIndInfo *rachInd)
    raReq->winStartTime.slot = rachInd->timingInfo.slot;
   
    /* Converting window size from ms to number of slots */
-   slotDuration = (1 / pow(2, cell->cellCfg.numerology));
+   slotDuration = (1 / pow(2, cell->numerology));
    winNumSlots = (float)cell->cellCfg.ulCfgCommon.schInitialUlBwp.schRachCfg.prachCfgGeneric.raRspWindow / slotDuration;
    
    /* Adding window size to window start time to get window end time */