[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-472] Implementation of drx timer
[o-du/l2.git] / src / 5gnrsch / sch_common.c
index a16cda5..204affa 100644 (file)
@@ -470,6 +470,7 @@ uint16_t fillPucchResourceInfo(SchPucchInfo *schPucchInfo, Inst inst, SlotTiming
 uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
 {
    int ret = ROK;
+   SchUeCb   *ueCb;
    UlSchedInfo ulSchedInfo;
    SchUlSlotInfo  *schUlSlotInfo = NULLP;
    SlotTimingInfo ulTimingInfo;
@@ -491,6 +492,15 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
    if(schUlSlotInfo->schPuschInfo)
    {
       ulSchedInfo.crnti = schUlSlotInfo->schPuschInfo->crnti;
+      /* Check the ue drx status if the UE is active for uplink scheduling or not  */
+#ifdef NR_DRX 
+      ueCb = schGetUeCb(cell, ulSchedInfo.crnti);
+      if(ueCb->ueDrxInfoPres)
+      {
+         if(ueCb->drxUeCb.drxUlUeActiveStatus)
+            return RFAILED;
+      }
+#endif
       ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
       memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
            sizeof(SchPuschInfo));
@@ -1972,7 +1982,8 @@ uint8_t schCalculateUlTbs(SchUeCb *ueCb, SlotTimingInfo puschTime, uint8_t symbL
  *******************************************************************/
 bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchUlHqProcCb **hqP)
 {
-   bool k2Found = FALSE, ret = RFAILED;
+   bool k2Found = FALSE;
+   uint8_t ret = RFAILED;
    uint8_t startSymb = 0, symbLen = 0;
    uint8_t k2TblIdx = 0, k2Index = 0, k2Val = 0;
    uint16_t startPrb = 0;
@@ -2047,7 +2058,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
          break;
       }
    }
-
+   
    if(k2Found == true)
    {
       ret = schCalculateUlTbs(ueCb, puschTime, symbLen, &startPrb, &totDataReq, isRetx, *hqP);
@@ -2097,7 +2108,12 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
          updateBsrAndLcList(&((*hqP)->ulLcPrbEst.defLcList), ueCb->bsrInfo, RFAILED);
       }
    }
-   return (ret);
+   else
+   {
+      DU_LOG("\nERROR  -->  SCH : schProcessSrOrBsrReq(): K2 value is not found");
+      return false;     
+   }
+   return true;
 }