Fix for RAR and DL dedicated PDU length [Issue-Id: ODUHIGH-348]
[o-du/l2.git] / src / 5gnrsch / sch_slot_ind.c
index b61bd29..92a17d7 100644 (file)
@@ -50,8 +50,6 @@ SchMacDlAllocFunc schMacDlAllocOpts[] =
 };
 
 SchCb schCb[SCH_MAX_INST];
-int schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t
-      offsetPointA);
 
 /*******************************************************************
  *
@@ -113,10 +111,10 @@ void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue)
     *        on PHY_DELTA + SCHED_DELTA + BO_DELTA                 *
     ****************************************************************/
 
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA + SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA + SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA_DL);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA_DL + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA_DL + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA_DL + SCHED_DELTA);
 }
 
 /*******************************************************************
@@ -243,6 +241,11 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
    dlBrdcstAlloc->sib1Trans = NO_SIB1;
 
    cell = schCb[schInst].cells[schInst];
+   if(cell == NULLP)
+   {
+      DU_LOG("\nERROR  -->  SCH : Cell Does not exist");
+      return RFAILED;
+   }
    ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
    memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
    dlBrdcstAlloc->ssbIdxSupported = 1;
@@ -323,7 +326,9 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       schFillRar(rarAlloc,
            cell->schDlSlotInfo[slot]->rarInfo->raRnti,
            cell->cellCfg.phyCellId,
-           cell->cellCfg.ssbSchCfg.ssbOffsetPointA);
+           cell->cellCfg.ssbSchCfg.ssbOffsetPointA,
+       dlBrdcstAlloc->ssbTrans,
+       dlBrdcstAlloc->sib1Trans);
 
       SCH_FREE(cell->schDlSlotInfo[slot]->rarInfo,sizeof(RarAlloc));
       cell->schDlSlotInfo[slot]->rarInfo = NULLP;
@@ -349,7 +354,7 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
            sizeof(DlMsgInfo));
 
       /* pdcch and pdsch data is filled */
-      schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot); 
+      schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot, dlBrdcstAlloc->ssbTrans, dlBrdcstAlloc->sib1Trans); 
 
       /* PUCCH resource */
       schAllocPucchResource(cell, msg4Alloc->dlMsgInfo.crnti, dlSchedInfo.schSlotValue.dlMsgTime.slot);