Implementation of function for filling k2 table [Issue-ID: ODUHIGH-341]
[o-du/l2.git] / src / 5gnrsch / sch_slot_ind.c
index 2b1bf57..59501bc 100644 (file)
@@ -96,7 +96,7 @@ uint8_t sendDlAllocToMac(DlSchedInfo *dlSchedInfo, Inst inst)
  *         RFAILED - failure
  *
  * ****************************************************************/
-void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue)
+void schCalcSlotValues(SlotTimingInfo slotInd, SchSlotValue *schSlotValue)
 {
    /****************************************************************
     * PHY_DELTA - the physical layer delta                         * 
@@ -180,6 +180,12 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
          }
          ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
       }
+      
+      if (!dlMsgAlloc->numLc)
+      {
+         DU_LOG("\nDEBUG  -->  SCH : No bo for any lcid\n");
+         return ROK;
+      }
 
       /* pdcch and pdsch data is filled */
       schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, &accumalatedSize, slot);
@@ -221,7 +227,7 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
+uint8_t schProcessSlotInd(SlotTimingInfo *slotInd, Inst schInst)
 {
    uint8_t  ssb_rep, ueIdx, lcgIdx, ret = ROK;
    uint16_t slot;
@@ -247,7 +253,7 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       return RFAILED;
    }
    ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
-   memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
+   memcpy(&cell->slotInfo, slotInd, sizeof(SlotTimingInfo));
    dlBrdcstAlloc->ssbIdxSupported = 1;
 
    slot = dlSchedInfo.schSlotValue.currentTime.slot;
@@ -306,6 +312,9 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       }
    }
 
+   /* Check for Pending RA Requests */
+   schProcessRaReq(*slotInd, cell);
+
    /* check for RAR */
    if(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.rarTime.slot]->rarInfo != NULLP)
    {
@@ -395,13 +404,13 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
          }
          memset(dciInfo,0,sizeof(DciInfo));
          /* update the SFN and SLOT */
-         memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo));
+         memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotTimingInfo));
          slot = dlSchedInfo.schSlotValue.ulDciTime.slot;
          /* Update PUSCH allocation */
          schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo);
          /* Fill DCI for UL grant */
          schFillUlDci(ueCb, schPuschInfo, dciInfo);
-         memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo));
+         memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotTimingInfo));
          dlSchedInfo.ulGrant = dciInfo;
       }
    }