[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / 5gnrsch / sch_drx.c
index 911af3c..e46cdbe 100644 (file)
@@ -324,7 +324,7 @@ void schFillDrxUeCb(uint8_t numerology, SchDrxCfg drxCfg, SchDrxUeCb *drxUeCb)
  *      -# RFAILED
  **/
 
-uint8_t schAddDrxTimerIntoList(CmLListCp *drxTimerList,void * nodeInfo, CmLList *drxNodeInfo)
+uint8_t schAddDrxTimerIntoList(CmLListCp *drxTimerList,void * nodeInfo, CmLList **drxNodeInfo)
 {
    CmLList  *currentNodeInfo = NULLP;
 
@@ -338,7 +338,7 @@ uint8_t schAddDrxTimerIntoList(CmLListCp *drxTimerList,void * nodeInfo, CmLList
    currentNodeInfo->node = (PTR)nodeInfo;
    
    cmLListAdd2Tail(drxTimerList, currentNodeInfo);
-   drxNodeInfo = currentNodeInfo;
+   (*drxNodeInfo) = currentNodeInfo;
    DU_LOG("\nINFO --> SCH : Drx node added into the list");
    return ROK;
 }
@@ -515,17 +515,17 @@ void schDrxUeReCfgTimer(SchCellCb *cell, SchUeCb *ueCb)
    if((ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE) && (ueCb->drxUeCb.onDurationExpiryIndex != SCH_DRX_INVALID_INDEX))
    {
        currentSlotTime = cell->slotInfo.sfn * cell->numSlots + cell->slotInfo.slot;
-       currentSlotIndx = (currentSlotTime + PHY_DELTA_DL + SCHED_DELTA)%MAX_DRX_SIZE;
+       currentSlotIndx = (currentSlotTime + gConfigInfo.gPhyDeltaDl + SCHED_DELTA)%MAX_DRX_SIZE;
        if(currentSlotIndx >= ueCb->drxUeCb.onDurationExpiryIndex )
        {
          onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance +1) * MAX_DRX_SIZE) +\
-         (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA);
+         (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
        }
        else
        {
          
          onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance) * MAX_DRX_SIZE) +\
-         (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA);
+         (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
        }
        if(onDurTime <= onDurExpSlotTime)
        {
@@ -539,7 +539,7 @@ void schDrxUeReCfgTimer(SchCellCb *cell, SchUeCb *ueCb)
    }
    SCH_CALCULATE_TIMER_INDEX(onDurTime, ueCb->drxUeCb.onDurationStartIndex);
    ueCb->drxUeCb.onDurationStartDistance = SCH_CALC_SLOT_DIFF(onDurationOccurance, cell->slotInfo, cell->numSlots)/MAX_DRX_SIZE;
-   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, ueCb->drxUeCb.onDurationStartNodeInfo);
+   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, &ueCb->drxUeCb.onDurationStartNodeInfo);
 }
 
 /**
@@ -569,7 +569,7 @@ void schAddUeInOndurationList(SchCellCb *cell, SchUeCb *ueCb, uint8_t delta)
       onDurTime = onDurationOccurance.sfn*cell->numSlots+onDurationOccurance.slot;
       SCH_CALCULATE_TIMER_INDEX(onDurTime, ueCb->drxUeCb.onDurationStartIndex);
       ueCb->drxUeCb.onDurationStartDistance = SCH_CALC_SLOT_DIFF(onDurationOccurance, cell->slotInfo, cell->numSlots)/MAX_DRX_SIZE;
-      schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, ueCb->drxUeCb.onDurationStartNodeInfo);
+      schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, &ueCb->drxUeCb.onDurationStartNodeInfo);
 
    }
 }
@@ -631,7 +631,7 @@ void schHdlDrxOnDurStrtTimerForDlDirection(SchCellCb  *cell, uint16_t currListIn
             /* onDurationExpiry  = (current slot + onduration length) % MAX_DRX_SIZE*/
             onDurationExpiry = (currListIndx + ueCb->drxUeCb.onDurationLen)%MAX_DRX_SIZE;
             ueCb->drxUeCb.onDurationExpiryDistance =  (ueCb->drxUeCb.onDurationLen)/MAX_DRX_SIZE;
-            schAddDrxTimerIntoList(&cell->drxCb[onDurationExpiry].onDurationExpiryList, ueCb, ueCb->drxUeCb.onDurationExpiryNodeInfo);
+            schAddDrxTimerIntoList(&cell->drxCb[onDurationExpiry].onDurationExpiryList, ueCb, &ueCb->drxUeCb.onDurationExpiryNodeInfo);
             ueCb->drxUeCb.onDurationExpiryIndex = onDurationExpiry;
 
          }
@@ -692,7 +692,7 @@ void schHdlDrxOnDurStrtTimerForUlDirection(SchCellCb  *cell, uint16_t currListIn
          }
          SCH_CALCULATE_TIMER_INDEX(onDurTime, ueCb->drxUeCb.onDurationStartIndex);
          ueCb->drxUeCb.onDurationStartDistance = ueCb->drxUeCb.longCycleLen/MAX_DRX_SIZE;
-         schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, ueCb->drxUeCb.onDurationStartNodeInfo);
+         schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb, &ueCb->drxUeCb.onDurationStartNodeInfo);
       }
    }
 }
@@ -717,8 +717,8 @@ void schHdlDrxOnDurStrtTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx=0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
 
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
@@ -766,7 +766,7 @@ void schHdlDrxInActvStrtTmr(SchCellCb  *cell,  SchUeCb *ueCb, uint8_t delta)
    /* Adding the new entry in in-activity timer list */
    ueCb->drxUeCb.inActvExpiryIndex = (slotIndx + ueCb->drxUeCb.inActvTimerLen) % MAX_DRX_SIZE;
    ueCb->drxUeCb.inActiveTmrExpiryDistance = (ueCb->drxUeCb.inActvTimerLen) / MAX_DRX_SIZE;
-   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.inActvExpiryIndex].inActvTmrExpiryList, ueCb, ueCb->drxUeCb.inActvTimerExpiryNodeInfo);
+   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.inActvExpiryIndex].inActvTmrExpiryList, ueCb, &ueCb->drxUeCb.inActvTimerExpiryNodeInfo);
 
    /* Set the UE active for UL And Dl transfer */
    ueCb->drxUeCb.drxDlUeActiveMask |= UE_ACTIVE_FOR_INACTIVE_TIMER;
@@ -803,7 +803,7 @@ void schHdlDrxStartShortCycleTimer(SchCellCb  *cell, SchUeCb *ueCb)
    } 
 
    /* recalculate the new index of on duration start based on short cycle */
-   schAddUeInOndurationList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA);
+   schAddUeInOndurationList(cell, ueCb, gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
 
    /* if any node is present in short cycle exp list then remove the node from list  */
    if(ueCb->drxUeCb.shortCycleExpiryIndex != SCH_DRX_INVALID_INDEX && ueCb->drxUeCb.shortCycleDistance != SCH_DRX_INVALID_DISTANCE)
@@ -817,7 +817,7 @@ void schHdlDrxStartShortCycleTimer(SchCellCb  *cell, SchUeCb *ueCb)
    /* recalculate the new index for shortCycleExpiryList */
    ueCb->drxUeCb.shortCycleExpiryIndex = (ueCb->drxUeCb.onDurationStartIndex + ueCb->drxUeCb.shortCycleTmrLen) % MAX_DRX_SIZE;
    ueCb->drxUeCb.shortCycleDistance = ueCb->drxUeCb.shortCycleTmrLen / MAX_DRX_SIZE;
-   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.shortCycleExpiryIndex].shortCycleExpiryList, ueCb, ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo);
+   schAddDrxTimerIntoList(&cell->drxCb[ueCb->drxUeCb.shortCycleExpiryIndex].shortCycleExpiryList, ueCb, &ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo);
 }
 
 /**
@@ -847,7 +847,7 @@ void schHdlDlHqRetxStrtTimerForDl(SchCellCb *cell, uint16_t currIndx)
    {
       hqP  = (SchDlHqProcCb*)currNode->node;
       currNode = currNode->next;
-      addUeToBeScheduled(hqP->hqEnt->cell, hqP->hqEnt->ue->ueId);
+      cell->api->SchAddUeToSchedule(hqP->hqEnt->cell, hqP->hqEnt->ue->ueId);
       ueCb = hqP->hqEnt->ue;
       
       /* calculate the retransmission exp index */
@@ -923,8 +923,8 @@ void schHdlDrxDlHqRetxStrtTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx=0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
 
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
@@ -1010,7 +1010,7 @@ void schHdlUlHqRetxStrtTimerForDl(SchCellCb *cell, uint16_t currIndx)
    {
       hqP  = (SchUlHqProcCb*)currNode->node;
       currNode = currNode->next;
-      addUeToBeScheduled(hqP->hqEnt->cell, hqP->hqEnt->ue->ueId);
+      cell->api->SchAddUeToSchedule(hqP->hqEnt->cell, hqP->hqEnt->ue->ueId);
       ueCb = hqP->hqEnt->ue;
       
       /* calculate the retransmission exp index */
@@ -1086,8 +1086,8 @@ void schHdlDrxUlHqRetxStrtTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx=0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo,  gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo,  gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
 
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
@@ -1227,8 +1227,8 @@ void schHdlDrxOnDurExpiryTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx = 0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
 
@@ -1348,8 +1348,8 @@ void schHdlDrxInActvExpiryTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx = 0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
 
@@ -1403,7 +1403,7 @@ void schHdlDrxShortCycleExpiryTimerForDlDirection(SchCellCb  *cell, uint16_t dlI
          ueCb->drxUeCb.onDurationStartDistance = SCH_DRX_INVALID_DISTANCE; 
 
          /* Recalculate on-duration with  long cycle */
-         schAddUeInOndurationList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA);
+         schAddUeInOndurationList(cell, ueCb, gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
       }
    }
 }
@@ -1470,8 +1470,8 @@ void schHdlDrxShortCycleExpiryTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx= 0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
 
@@ -1646,8 +1646,8 @@ void schHdlDrxDlHarqExpireTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx = 0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
    
@@ -1872,8 +1872,8 @@ void schHdlDrxUlHarqExpireTimer(SchCellCb  *cell)
    uint16_t dlIndx = 0, ulIndx = 0;
    SlotTimingInfo dlSlotInfo, ulSlotInfo;
 
-   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
-   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
+   ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots);
    dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
    ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;