* -# ROK
* -# RFAILED
**/
+
void schInitDrxHarqCb(SchDrxHarqCb *hqDrxCb)
{
memset(hqDrxCb, 0, sizeof(SchDrxHarqCb));
* -# ROK
* -# RFAILED
**/
+
void schInitDrxUeCb(SchUeCb *ueCb)
{
memset(&ueCb->drxUeCb, 0, sizeof(SchDrxUeCb));
ueCb->drxUeCb.onDurationStartDistance = SCH_DRX_INVALID_DISTANCE;
ueCb->drxUeCb.onDurationExpiryDistance = SCH_DRX_INVALID_DISTANCE;
ueCb->drxUeCb.inActiveTmrExpiryDistance = SCH_DRX_INVALID_DISTANCE;
- ueCb->drxUeCb.drxDlUeActiveStatus = false;
- ueCb->drxUeCb.drxUlUeActiveStatus = false;
+ ueCb->drxUeCb.drxDlUeActiveStatus = 0;
+ ueCb->drxUeCb.drxUlUeActiveStatus = 0;
}
-#if 0
+
/* will uncomment this function in next gerrit */
+#if 0
/**
* @brief delete Dl harq drx timers and information
*
for(idx =0; idx<numHqPrcs; idx++)
{
procs = &dlHqEnt->procs[idx];
- tmrIdx = procs->drxHarqCb.retxStrtIndex;
+ tmrIdx = procs->dlDrxHarqCb.retxStrtIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].dlRetransTmrStartList, node);
if(node)
{
SCH_FREE(node, sizeof(CmLList));
}
- tmrIdx = procs->drxHarqCb.rttIndex;
+ tmrIdx = procs->dlDrxHarqCb.rttIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].dlHarqRttExpiryList, node);
if(node)
{
SCH_FREE(node, sizeof(CmLList));
}
- tmrIdx = procs->drxHarqCb.retxIndex;
+ tmrIdx = procs->dlDrxHarqCb.retxIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].dlRetransExpiryList, node);
if(node)
{
cmLListDelFrm(&cell->drxCb[tmrIdx].dlRetransExpiryList, node);
SCH_FREE(node, sizeof(CmLList));
}
- schInitDrxHarqCb(&procs->drxHarqCb);
+ schInitDrxHarqCb(&procs->dlDrxHarqCb);
}
}
for(idx =0; idx<numHqPrcs; idx++)
{
procs = &ulHqEnt->procs[idx];
- tmrIdx = procs->drxHarqCb.retxStrtIndex;
+ tmrIdx = procs->ulDrxHarqCb.retxStrtIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].ulRetransTmrStartList, node);
if(node)
{
SCH_FREE(node, sizeof(CmLList));
}
- tmrIdx = procs->drxHarqCb.rttIndex;
+ tmrIdx = procs->ulDrxHarqCb.rttIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].ulHarqRttExpiryList, node);
if(node)
{
SCH_FREE(node, sizeof(CmLList));
}
- tmrIdx = procs->drxHarqCb.retxIndex;
+ tmrIdx = procs->ulDrxHarqCb.retxIndex;
CM_LLIST_FIRST_NODE(&cell->drxCb[tmrIdx].ulRetransExpiryList, node);
if(node)
{
cmLListDelFrm(&cell->drxCb[tmrIdx].ulRetransExpiryList, node);
SCH_FREE(node, sizeof(CmLList));
}
- schInitDrxHarqCb(&procs->drxHarqCb);
+ schInitDrxHarqCb(&procs->ulDrxHarqCb);
}
}
#endif
+
/**
* @brief delete UE drx timers and information
*
* delete UE drx timers and information
*
* @param[in] SchCellCb *cell, SchUeCb *ueCb
- * @return
- * -# ROK
- * -# RFAILED
+ * @return void
+ *
**/
+
void schDeleteUeDrxInfo(SchCellCb *cell, SchUeCb *ueCb)
{
SchDrxUeCb *drxUeCb;
* -# ROK
* -# RFAILED
**/
+
void schFillDrxUeCb(uint8_t numerology, SchDrxCfg drxCfg, SchDrxUeCb *drxUeCb)
{
if(drxCfg.drxOnDurationTimer.onDurationTimerValInMs)
SCH_CNVRT_MS_TO_SLOT(drxUeCb->inActvTimerLen, drxCfg.drxInactivityTimer, numerology);
SCH_CNVRT_SYMBL_TO_SLOT(drxUeCb->harqRttDlTimerLen, drxCfg.drxHarqRttTimerDl);
SCH_CNVRT_SYMBL_TO_SLOT(drxUeCb->harqRttUlTimerLen, drxCfg.drxHarqRttTimerUl);
- SCH_CNVRT_MS_TO_SLOT(drxUeCb->retransDlTimerLen, drxCfg.drxRetransmissionTimerDl, numerology);
- SCH_CNVRT_MS_TO_SLOT(drxUeCb->retransUlTimerLen, drxCfg.drxRetransmissionTimerUl, numerology);
+ drxUeCb->retransDlTimerLen = drxCfg.drxRetransmissionTimerDl;
+ drxUeCb->retransUlTimerLen = drxCfg.drxRetransmissionTimerUl;
SCH_CNVRT_MS_TO_SLOT(drxUeCb->longCycleLen, drxCfg.drxLongCycleStartOffset.drxLongCycleStartOffsetChoice, numerology);
- drxUeCb->drxStartOffset = drxCfg.drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ SCH_CNVRT_MS_TO_SLOT(drxUeCb->drxStartOffset, drxCfg.drxLongCycleStartOffset.drxLongCycleStartOffsetVal, numerology);
if(drxCfg.shortDrxPres)
{
drxUeCb->shortCyclePresent = true;
SCH_CNVRT_MS_TO_SLOT(drxUeCb->shortCycleLen, drxCfg.shortDrx.drxShortCycle, numerology);
- drxUeCb->shortCycleTmrLen = drxCfg.shortDrx.drxShortCycleTimer;
+ drxUeCb->shortCycleTmrLen = drxUeCb->shortCycleLen*drxCfg.shortDrx.drxShortCycleTimer;
}
- else
- drxUeCb->longCycleToBeUsed = true;
+ drxUeCb->longCycleToBeUsed = true;
SCH_CNVRT_MS_TO_SLOT(drxUeCb->drxSlotOffset, drxCfg.drxSlotOffset, numerology);
drxUeCb->drxSlotOffset = drxUeCb->drxSlotOffset>>5;
}
* -# ROK
* -# RFAILED
**/
+
uint8_t schAddDrxTimerIntoList(CmLListCp *drxTimerList,void * nodeInfo, CmLList *drxNodeInfo)
{
CmLList *currentNodeInfo = NULLP;
cmLListAdd2Tail(drxTimerList, currentNodeInfo);
drxNodeInfo = currentNodeInfo;
+ DU_LOG("\nINFO --> SCH : Drx node added into the list");
return ROK;
}
* @return
* -# void
**/
+
void findNextOndurationOccurance(SchCellCb *cell, SchDrxUeCb *ueDrxCb, SlotTimingInfo *nxtOnDur, uint8_t delta)
{
- uint16_t resultX, reusltY, idx;
+ uint16_t tmpDistance, numOfCycles;
uint32_t curTime, cycleLen, nxtDist;
SlotTimingInfo tmpTime;
-
+
if (ueDrxCb->longCycleToBeUsed == true)
{
cycleLen = ueDrxCb->longCycleLen;
}
/* Add delta to current time */
- ADD_DELTA_TO_TIME(cell->slotInfo, tmpTime, delta);
+ ADD_DELTA_TO_TIME(cell->slotInfo, tmpTime, delta, cell->numSlots);
/* Convert tmpTime to number of slots */
- curTime = ((tmpTime.sfn * MAX_SLOTS) + tmpTime.slot);
+ curTime = ((tmpTime.sfn * cell->numSlots) + tmpTime.slot);
/* as per 38.321, if the criterion below is satisfied, then that sfn and
* slot are the correct ones for the on-duration timer.
* (drx-ShortCycle) = (drxStartOffset) modulo (drx-ShortCycle); or
* if the Long DRX Cycle is used, and [(SFN × 10) + subframe number] modulo
* (drx-LongCycle) = drxStartOffset */
- for(idx =1; idx<MAX_DRX_SIZE; idx++)
+ if ( curTime <= ueDrxCb->drxStartOffset)
{
- resultX = (tmpTime.sfn *10+tmpTime.slot) % cycleLen;
- if (TRUE != ueDrxCb->shortCyclePresent)
- reusltY = ueDrxCb->drxStartOffset;
- else
- reusltY = ueDrxCb->drxStartOffset % cycleLen;
- if(resultX == reusltY)
+ /* offset is the nextOnDur */
+ nxtDist = ((((ueDrxCb->drxStartOffset / cell->numSlots)) & (MAX_SFN - 1)) * cell->numSlots) + (ueDrxCb->drxStartOffset % cell->numSlots);
+ }
+ else
+ {
+ tmpDistance = curTime - ueDrxCb->drxStartOffset;
+ numOfCycles = tmpDistance / cycleLen;
+
+ if (0 == (tmpDistance % cycleLen))
{
- memcpy(nxtOnDur, &tmpTime, sizeof(SlotTimingInfo));
- nxtDist = ((nxtOnDur->sfn * MAX_SLOTS) + nxtOnDur->slot);
- break;
+ /* Perfect match pick up the current time */
+ nxtDist = ((((curTime / cell->numSlots)) & (MAX_SFN - 1)) * cell->numSlots) + (curTime % cell->numSlots);
}
else
{
- ADD_DELTA_TO_TIME(tmpTime, tmpTime, 1);
+ nxtDist = ueDrxCb->drxStartOffset + (numOfCycles + 1) * cycleLen;
}
}
if(ueDrxCb->drxSlotOffset)
{
nxtDist = nxtDist + ueDrxCb->drxSlotOffset;
- ADD_DELTA_TO_TIME(tmpTime, tmpTime, ueDrxCb->drxSlotOffset);
- memcpy(nxtOnDur, &tmpTime, sizeof(SlotTimingInfo));
}
/*If next On Duration is less than DL DELTA ahead, we will miss it and
* hence need to move to the On-Duration after that.*/
if((nxtDist - (curTime - delta)) <= SCH_DRX_MAX_DELTA)
{
- ADD_DELTA_TO_TIME(tmpTime, tmpTime, cycleLen);
- memcpy(nxtOnDur, &tmpTime, sizeof(SlotTimingInfo));
+ nxtDist = nxtDist + cycleLen;
}
+
+ nxtOnDur->sfn = ((nxtDist / cell->numSlots) & (MAX_SFN - 1));
+ nxtOnDur->slot = (nxtDist % cell->numSlots);
}
/**
* @param[in] SchCellCb *cell, SchUeCb *ueCb
* uint8_t delta
*
- * @return
+ * @return void
**/
+
void schDrxUeReCfgTimer(SchCellCb *cell, SchUeCb *ueCb)
{
- uint8_t onDurIndx, currentSlotIndx;
+ uint8_t currentSlotIndx;
uint32_t onDurTime, onDurExpSlotTime, currentSlotTime;
uint32_t cycleLen;
SlotTimingInfo onDurationOccurance;
-
+
if(ueCb->drxUeCb.shortCyclePresent == false)
{
/* if short cycle configuration are not recived as a part of UE Recfg then if there is any entry present in short cycle timer list
{
cmLListDelFrm(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb->drxUeCb.onDurationStartNodeInfo);
SCH_FREE(ueCb->drxUeCb.onDurationStartNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.onDurationStartIndex = SCH_DRX_INVALID_INDEX;
- ueCb->drxUeCb.onDurationStartDistance = SCH_DRX_INVALID_DISTANCE;
+ ueCb->drxUeCb.onDurationStartIndex= SCH_DRX_INVALID_INDEX;
+ ueCb->drxUeCb.onDurationStartDistance= SCH_DRX_INVALID_DISTANCE;
+
}
findNextOndurationOccurance(cell, &ueCb->drxUeCb, &onDurationOccurance, 0);
- onDurTime = onDurationOccurance.sfn*MAX_SLOTS+onDurationOccurance.slot;
- onDurIndx = onDurTime%MAX_DRX_SIZE;
+ onDurTime = onDurationOccurance.sfn*cell->numSlots+onDurationOccurance.slot;
+
/* If Onduration timer of old configuration is already running then next onduration
* starts once it expires*/
- if((ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE) && (ueCb->drxUeCb.onDurationExpiryIndex == SCH_DRX_INVALID_INDEX))
+ if((ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE) && (ueCb->drxUeCb.onDurationExpiryIndex != SCH_DRX_INVALID_INDEX))
{
- currentSlotTime = cell->slotInfo.sfn * MAX_SLOTS + cell->slotInfo.slot;
+ currentSlotTime = cell->slotInfo.sfn * cell->numSlots + cell->slotInfo.slot;
currentSlotIndx = (currentSlotTime + PHY_DELTA_DL + 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);
+ onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance +1) * MAX_DRX_SIZE) +\
+ (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA);
}
else
{
- onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance) * MAX_DRX_SIZE) + (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA);
+ onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance) * MAX_DRX_SIZE) +\
+ (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA);
}
if(onDurTime <= onDurExpSlotTime)
{
onDurTime = onDurTime + ((onDurExpSlotTime - onDurTime)/cycleLen + 1) * cycleLen;
}
}
- onDurIndx = onDurTime%MAX_DRX_SIZE;
- ueCb->drxUeCb.onDurationStartIndex = onDurIndx;
- ueCb->drxUeCb.onDurationStartDistance = SCH_CALC_SLOT_DIFF(onDurationOccurance, cell->slotInfo, MAX_SLOTS)/MAX_DRX_SIZE;
- schAddDrxTimerIntoList(&cell->drxCb[onDurIndx].onDurationStartList, ueCb, ueCb->drxUeCb.onDurationStartNodeInfo);
- if((TRUE == ueCb->drxUeCb.shortCyclePresent) &&(ueCb->drxUeCb.longCycleToBeUsed == false))
- {
- /* Starting Short Cycle Timer */
- ueCb->drxUeCb.shortCycleDistance = (ueCb->drxUeCb.shortCycleTmrLen * ueCb->drxUeCb.shortCycleLen) / MAX_DRX_SIZE;
- ueCb->drxUeCb.shortCycleExpiryIndex = (onDurTime + (ueCb->drxUeCb.shortCycleTmrLen * ueCb->drxUeCb.shortCycleLen)) % MAX_DRX_SIZE;
- schAddDrxTimerIntoList(&cell->drxCb[ ueCb->drxUeCb.shortCycleExpiryIndex].shortCycleExpiryList, ueCb, ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo);
- DU_LOG("\nPBORLA ShortCycleE Added %d",ueCb->drxUeCb.shortCycleExpiryIndex);
- }
+ 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);
}
+
/**
- * @brief Add entry into the on duration list and short cycle list
+ * @brief Add entry into the on duration list
*
* @details
*
- * Function : schAddUeInOndurationAndShortCycleList
+ * Function : schAddUeInOndurationList
*
- * This function is used to Add entry into the on duration list and short
- * cycle list
+ * This function is used to Add entry into the on duration list
*
* @param[in] SchCellCb *cell, SchDrxUeCb *ueDrxCb, SlotTimingInfo *nxtOnDur,
* uint8_t delta
* @return
* -# void
**/
-void schAddUeInOndurationAndShortCycleList(SchCellCb *cell, SchUeCb *ueCb, uint8_t delta)
+
+void schAddUeInOndurationList(SchCellCb *cell, SchUeCb *ueCb, uint8_t delta)
{
- uint8_t onDurIndx;
uint32_t onDurTime;
SlotTimingInfo onDurationOccurance;
if(ueCb->ueDrxInfoPres)
{
findNextOndurationOccurance(cell, &ueCb->drxUeCb, &onDurationOccurance, delta);
- onDurTime = onDurationOccurance.sfn*MAX_SLOTS+onDurationOccurance.slot;
- onDurIndx = onDurTime%MAX_DRX_SIZE;
- ueCb->drxUeCb.onDurationStartIndex = onDurIndx;
- ueCb->drxUeCb.onDurationStartDistance = SCH_CALC_SLOT_DIFF(onDurationOccurance, cell->slotInfo, MAX_SLOTS)/MAX_DRX_SIZE;
- schAddDrxTimerIntoList(&cell->drxCb[onDurIndx].onDurationStartList, ueCb, ueCb->drxUeCb.onDurationStartNodeInfo);
+ 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);
- if((TRUE == ueCb->drxUeCb.shortCyclePresent) &&(ueCb->drxUeCb.longCycleToBeUsed == false))
- {
- /* Starting Short Cycle Timer */
- ueCb->drxUeCb.shortCycleDistance = (ueCb->drxUeCb.shortCycleTmrLen * ueCb->drxUeCb.shortCycleLen) / MAX_DRX_SIZE;
- ueCb->drxUeCb.shortCycleExpiryIndex = (onDurTime + (ueCb->drxUeCb.shortCycleTmrLen * ueCb->drxUeCb.shortCycleLen)) % MAX_DRX_SIZE;
- schAddDrxTimerIntoList(&cell->drxCb[ ueCb->drxUeCb.shortCycleExpiryIndex].shortCycleExpiryList, ueCb, ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo);
- DU_LOG("\nPBORLA ShortCycleE Added %d",ueCb->drxUeCb.shortCycleExpiryIndex);
- }
}
}
+
/**
* @brief Handling of On duration drx start timer
*
* @details
*
- * Function : schHdlDrxOnDurStrtTimerForUlandDlDirection
+ * Function : schHdlDrxOnDurStrtTimerForDlDirection
*
* Handling of On duration drx start timer
*
* -# ROK
* -# RFAILED
**/
-void schHdlDrxOnDurStrtTimerForUlandDlDirection(SchCellCb *cell, uint16_t currListIndx, bool isDlDirection)
+
+void schHdlDrxOnDurStrtTimerForDlDirection(SchCellCb *cell, uint16_t currListIndx)
{
uint16_t onDurationExpiry=0;
CmLList *drxCurrNode = NULLP;
while(drxCurrNode)
{
ueCb = (SchUeCb*)drxCurrNode->node;
+ drxCurrNode = drxCurrNode->next;
+
ueCb->drxUeCb.onDurationStartDistance--;
+
if(ueCb->drxUeCb.onDurationStartDistance != SCH_DRX_INVALID_DISTANCE)
{
continue;
}
else
{
- if(isDlDirection == true)
- ueCb->drxUeCb.drxDlUeActiveStatus = true;
- else
- ueCb->drxUeCb.drxUlUeActiveStatus = true;
-
- DU_LOG("\nPBORLA drxUeCb.drxUlUeActiveStatus drxUeCb.drxDlUeActiveStatus [%d:%d] line %d", ueCb->drxUeCb.drxUlUeActiveStatus, ueCb->drxUeCb.drxDlUeActiveStatus,__LINE__);
-
+ ueCb->drxUeCb.drxDlUeActiveStatus |= UE_ACTIVE_FOR_ONDURATION;
+
/* If there is any entery present in onDurationExpiry list remove
* the entery from the list and recalculate the
* onDurationExpiry time and add it to list */
- if(ueCb->drxUeCb.onDurationExpiryIndex != SCH_DRX_INVALID_INDEX)
+ if(ueCb->drxUeCb.onDurationExpiryIndex != SCH_DRX_INVALID_INDEX)
{
cmLListDelFrm(&cell->drxCb[ueCb->drxUeCb.onDurationExpiryIndex].onDurationExpiryList, ueCb->drxUeCb.onDurationExpiryNodeInfo);
SCH_FREE(ueCb->drxUeCb.onDurationExpiryNodeInfo, sizeof(CmLList));
ueCb->drxUeCb.onDurationExpiryIndex = SCH_DRX_INVALID_INDEX;
+ ueCb->drxUeCb.onDurationExpiryDistance = SCH_DRX_INVALID_DISTANCE;
}
/* onDurationExpiry = (current slot + onduration length) % MAX_DRX_SIZE*/
ueCb->drxUeCb.onDurationExpiryDistance = (ueCb->drxUeCb.onDurationLen)/MAX_DRX_SIZE;
schAddDrxTimerIntoList(&cell->drxCb[onDurationExpiry].onDurationExpiryList, ueCb, ueCb->drxUeCb.onDurationExpiryNodeInfo);
ueCb->drxUeCb.onDurationExpiryIndex = onDurationExpiry;
-
- /* if there is any entry present in onduration list remove the entry from the list */
- DU_LOG("\nPBORLA ONDURATION START HIT %d %d startIndx %d [%d %d]",\
- currListIndx, ueCb->drxUeCb.onDurationStartDistance,ueCb->drxUeCb.onDurationStartIndex, cell->slotInfo.sfn,cell->slotInfo.slot);
- cmLListDelFrm(&cell->drxCb[currListIndx].onDurationStartList, ueCb->drxUeCb.onDurationStartNodeInfo);
- SCH_FREE(ueCb->drxUeCb.onDurationStartNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.onDurationStartIndex = SCH_DRX_INVALID_INDEX;
- /* if there long cycle length is used as the cycle length for onduration calculation then based on that calculating next onduration occurance
- * other wise next onduration is calcuated based on short cycle
- * timer */
- if(ueCb->drxUeCb.longCycleToBeUsed)
- {
- schAddUeInOndurationAndShortCycleList(cell, ueCb, 0);
- }
+
}
- drxCurrNode = drxCurrNode->next;
}
}
}
+
/**
* @brief Handling of On duration drx start timer
*
* @details
*
- * Function : schHdlDrxOnDurStrtTimer
+ * Function : schHdlDrxOnDurStrtTimerForUlDirection
*
* Handling of On duration drx start timer
*
* -# ROK
* -# RFAILED
**/
-void schHdlDrxOnDurStrtTimer(SchCellCb *cell)
+
+void schHdlDrxOnDurStrtTimerForUlDirection(SchCellCb *cell, uint16_t currListIndx)
{
- uint16_t dlIndx = 0, ulIndx=0;
- SlotTimingInfo dlSlotInfo, ulSlotInfo;
+ uint16_t onDurTime=0;
+ CmLList *drxCurrNode = NULLP;
+ SchUeCb *ueCb = NULLP;
- ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA);
- ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA);
-
- dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
- ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
- schHdlDrxOnDurStrtTimerForUlandDlDirection(cell, dlIndx, true);
- schHdlDrxOnDurStrtTimerForUlandDlDirection(cell, ulIndx, false);
+ drxCurrNode = cell->drxCb[currListIndx].onDurationStartList.first;
+ if(drxCurrNode)
+ {
+ /* Handling of dl On duration drx start list */
+ while(drxCurrNode)
+ {
+ ueCb = (SchUeCb*)drxCurrNode->node;
+ drxCurrNode = drxCurrNode->next;
+
+ if(ueCb->drxUeCb.onDurationStartDistance != SCH_DRX_INVALID_DISTANCE)
+ {
+ continue;
+ }
+ ueCb->drxUeCb.drxUlUeActiveStatus |= UE_ACTIVE_FOR_ONDURATION;
+
+
+ /* if there short cycle length is used as the cycle length for onduration calculation then based on the short cycle else long cycle is used for calculating next onduration */
+ cmLListDelFrm(&cell->drxCb[currListIndx].onDurationStartList, ueCb->drxUeCb.onDurationStartNodeInfo);
+ SCH_FREE(ueCb->drxUeCb.onDurationStartNodeInfo, sizeof(CmLList));
+ ueCb->drxUeCb.onDurationStartIndex= SCH_DRX_INVALID_INDEX;
+
+ if(ueCb->drxUeCb.longCycleToBeUsed)
+ {
+ onDurTime = currListIndx + ueCb->drxUeCb.longCycleLen;
+ }
+ else
+ {
+ onDurTime = currListIndx + ueCb->drxUeCb.shortCycleLen;
+ }
+ 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);
+ }
+ }
}
+
/**
- * @brief Handling of short cycle drx start timer
- *
- * @details
- *
- * Function : schHdlDrxStartShortCycleTimer
- *
- * Handling of short cycle drx start timer
- *
- * @param[in] SchCellCb *cell
- * @return
- * -# ROK
- * -# RFAILED
- **/
- void schHdlDrxStartShortCycleTimer(SchCellCb *cell, SchUeCb *ueCb)
- {
- ueCb->drxUeCb.longCycleToBeUsed = false;
- schAddUeInOndurationAndShortCycleList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
- }
-/**
- * @brief Handling of the DRX inactv timers start
+ * @brief Handling of On duration drx start timer
*
* @details
*
- * Function : schHdlDrxInActvStrtTmr
+ * Function : schHdlDrxOnDurStrtTimer
*
- * Handling of DRX in active timers start
+ * Handling of On duration drx start timer
*
* @param[in] SchCellCb *cell
* @return
* -# ROK
* -# RFAILED
**/
- void schHdlDrxInActvStrtTmr(SchCellCb *cell, SchUeCb *ueCb, uint8_t delta)
- {
- uint16_t slotIndx = 0;
- SlotTimingInfo tmpSlotInfo;
-
- if(ueCb->drxUeCb.inActvTimerLen == 0)
- {
- return;
- }
- ADD_DELTA_TO_TIME(cell->slotInfo, tmpSlotInfo, delta);
- slotIndx = (tmpSlotInfo.sfn*MAX_SLOTS+tmpSlotInfo.slot)%MAX_DRX_SIZE;
+void schHdlDrxOnDurStrtTimer(SchCellCb *cell)
+{
+ uint16_t dlIndx = 0, ulIndx=0;
+ SlotTimingInfo dlSlotInfo, ulSlotInfo;
- DU_LOG("\nPBORLA IN ACTV START HIT %d %d", cell->slotInfo.sfn, cell->slotInfo.slot);
- /* if there is nay old entry present in the list remove the entry*/
- if(ueCb->drxUeCb.inActvExpiryIndex != SCH_DRX_INVALID_INDEX)
- {
- cmLListDelFrm(&cell->drxCb[ueCb->drxUeCb.inActvExpiryIndex].inActvTmrExpiryList, ueCb->drxUeCb.inActvTimerExpiryNodeInfo);
- SCH_FREE(ueCb->drxUeCb.inActvTimerExpiryNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.inActvExpiryIndex= SCH_DRX_INVALID_INDEX;
- ueCb->drxUeCb.inActiveTmrExpiryDistance= SCH_DRX_INVALID_DISTANCE;
- }
- /* 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);
+ 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);
- /* Set the UE active for UL And Dl transfer */
- ueCb->drxUeCb.drxDlUeActiveStatus = true;
- ueCb->drxUeCb.drxUlUeActiveStatus = true;
- DU_LOG("\nPBORLA drxUeCb.drxUlUeActiveStatus drxUeCb.drxDlUeActiveStatus [%d:%d] line %d", ueCb->drxUeCb.drxUlUeActiveStatus, ueCb->drxUeCb.drxDlUeActiveStatus,__LINE__);
+ dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
+ ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
+ schHdlDrxOnDurStrtTimerForDlDirection(cell, dlIndx);
+ schHdlDrxOnDurStrtTimerForUlDirection(cell, ulIndx);
+}
- }
/**
* @brief Handling of the DRX timers start
*
**/
void schHandleStartDrxTimer(SchCellCb *cell)
{
- /* Handling the onduration start timea*/
+ /* Handling the onduration start timer */
schHdlDrxOnDurStrtTimer(cell);
}
/**
- * @brief Handling of the expiry ShortCycle DRX timers
+ * @brief Handling of the expiry onduration timer in dl direction
*
* @details
*
- * Function : schHdlDrxShortCycleExpiryTimerForUlandDlDirection
+ * Function : schHdlDrxOnDurExpiryTimerForDlDirection
*
- * Handling of expiry ShortCycle
+ * Handling of expiry onduration DRX timers in dl direction
*
* @param[in] SchCellCb *cell
* @return
* -# ROK
* -# RFAILED
**/
-void schHdlDrxShortCycleExpiryTimerForUlandDlDirection(SchCellCb *cell, uint16_t currListIndx, bool isDlDirection)
+void schHdlDrxOnDurExpiryTimerForDlDirection(SchCellCb *cell, uint16_t currListIndx)
{
- CmLList *drxCurrNode = NULLP;
+ CmLList *drxCurrNode;
SchUeCb *ueCb = NULLP;
- SchUeCb *tempUeCb = NULLP;
- drxCurrNode = cell->drxCb[currListIndx].shortCycleExpiryList.first;
+ drxCurrNode = cell->drxCb[currListIndx].onDurationExpiryList.first;
if(drxCurrNode)
{
/* Handling of dl On duration drx start list */
while(drxCurrNode)
{
ueCb = (SchUeCb*)drxCurrNode->node;
- if(ueCb->ueDrxInfoPres)
- {
- if(ueCb->drxUeCb.shortCycleDistance != SCH_DRX_INVALID_DISTANCE)
- ueCb->drxUeCb.shortCycleDistance--;
-
- if(ueCb->drxUeCb.shortCycleDistance== SCH_DRX_INVALID_DISTANCE)
- {
- DU_LOG("\nPBORLA ShortCycleE EXP HIT %d",currListIndx);
- ueCb->drxUeCb.longCycleToBeUsed = true;
- /* Remove Short Cycle timer from the list */
- cmLListDelFrm(&cell->drxCb[currListIndx].shortCycleExpiryList, ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo);
- SCH_FREE(ueCb->drxUeCb.shortCycleTmrExpiryNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.shortCycleExpiryIndex = SCH_DRX_INVALID_INDEX;
-
- /* calculating the next duration event
- If another entry is found in the On duration list, it must first be removed
- before the next On duration occurrences may be calculated */
- if(ueCb->drxUeCb.onDurationStartIndex != SCH_DRX_INVALID_INDEX)
- {
- cmLListDelFrm(&cell->drxCb[ueCb->drxUeCb.onDurationStartIndex].onDurationStartList, ueCb->drxUeCb.onDurationStartNodeInfo);
- SCH_FREE(ueCb->drxUeCb.onDurationStartNodeInfo, sizeof(CmLList));
- tempUeCb->drxUeCb.onDurationStartDistance = SCH_DRX_INVALID_DISTANCE;
- tempUeCb->drxUeCb.onDurationStartIndex = SCH_DRX_INVALID_INDEX;
- }
- if(isDlDirection == true)
- schAddUeInOndurationAndShortCycleList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
- else
- schAddUeInOndurationAndShortCycleList(cell, ueCb, PHY_DELTA_UL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
+ drxCurrNode = drxCurrNode->next;
+
+ ueCb->drxUeCb.onDurationExpiryDistance--;
- }
- else
- continue;
+ if(ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE)
+ {
+ continue;
}
- drxCurrNode = drxCurrNode->next;
+ ueCb->drxUeCb.drxDlUeActiveStatus &= ~UE_ACTIVE_FOR_ONDURATION;
}
}
}
-
/**
- * @brief Handling of the expiry ShortCycle DRX timers
+ * @brief Handling of the expiry onduration DRX timers for Ul direction
*
* @details
*
- * Function :schHdlDrxShortCycleExpiryTimer
+ * Function schHdlDrxOnDurExpiryTimerForUlDirection:
*
- * Handling of expiry ShortCycle
+ * Handling of expiry onduration DRX timers in Ul direction
*
* @param[in] SchCellCb *cell
* @return
* -# ROK
* -# RFAILED
**/
-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 + SCH_DRX_TMRS_EXP_DELTA);
- ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
- dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
- ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
-
- schHdlDrxShortCycleExpiryTimerForUlandDlDirection(cell, dlIndx, true);
- schHdlDrxShortCycleExpiryTimerForUlandDlDirection(cell, ulIndx, false);
-}
-
-/**
- * @brief Handling of the expiry onduration DRX timers for specific direction
- *
- * @details
- *
- * Function :schHdlDrxOnDurExpiryTimerForUlandDlDirection
- *
- * Handling of expiry onduration DRX timers
- *
- * @param[in] SchCellCb *cell
- * @return
- * -# ROK
- * -# RFAILED
- **/
-void schHdlDrxOnDurExpiryTimerForUlandDlDirection(SchCellCb *cell, uint16_t currListIndx, bool isDlDirection)
+void schHdlDrxOnDurExpiryTimerForUlDirection(SchCellCb *cell, uint16_t currListIndx)
{
CmLList *drxCurrNode;
SchUeCb *ueCb = NULLP;
while(drxCurrNode)
{
ueCb = (SchUeCb*)drxCurrNode->node;
- if(ueCb->ueDrxInfoPres)
- {
- ueCb->drxUeCb.onDurationExpiryDistance--;
-
- if(ueCb->drxUeCb.onDurationExpiryDistance== SCH_DRX_INVALID_DISTANCE)
- {
+ drxCurrNode = drxCurrNode->next;
- DU_LOG("\nPBORLA ONDURATION EXP HIT %d[%d:%d]",currListIndx, cell->slotInfo.sfn, cell->slotInfo.slot);
-
- /* delete on duration expiry timer from ueCb */
- if(drxCurrNode->node)
- {
- cmLListDelFrm(&cell->drxCb[currListIndx].onDurationExpiryList, ueCb->drxUeCb.onDurationExpiryNodeInfo);
- SCH_FREE(ueCb->drxUeCb.onDurationExpiryNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.onDurationExpiryIndex = SCH_DRX_INVALID_INDEX;
- }
- if(isDlDirection == true)
- ueCb->drxUeCb.drxDlUeActiveStatus = false;
- else
- ueCb->drxUeCb.drxUlUeActiveStatus = false;
- DU_LOG("\nPBORLA drxUeCb.drxUlUeActiveStatus drxUeCb.drxDlUeActiveStatus [%d:%d] line %d", ueCb->drxUeCb.drxUlUeActiveStatus, ueCb->drxUeCb.drxDlUeActiveStatus,__LINE__);
- }
- else
- continue;
+ if(ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE)
+ {
+ continue;
}
- drxCurrNode = drxCurrNode->next;
+
+ ueCb->drxUeCb.drxUlUeActiveStatus &= ~UE_ACTIVE_FOR_ONDURATION;
+ cmLListDelFrm(&cell->drxCb[ueCb->drxUeCb.onDurationExpiryIndex].onDurationExpiryList, ueCb->drxUeCb.onDurationExpiryNodeInfo);
+ SCH_FREE(ueCb->drxUeCb.onDurationExpiryNodeInfo, sizeof(CmLList));
+ ueCb->drxUeCb.onDurationExpiryIndex = SCH_DRX_INVALID_INDEX;
}
}
}
-
-
/**
* @brief Handling of the expiry onduration DRX timers
*
* @details
*
- * Function : schHdlDrxOnDurExpiryTimer
+ * Function : schHdlDrxOnDurExpiryTimer
*
* Handling of expiry onduration DRX timers
*
uint16_t dlIndx = 0, ulIndx = 0;
SlotTimingInfo dlSlotInfo, ulSlotInfo;
- ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
- ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
+ 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);
dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
-
- schHdlDrxOnDurExpiryTimerForUlandDlDirection(cell, dlIndx, true);
- schHdlDrxOnDurExpiryTimerForUlandDlDirection(cell, ulIndx, false);
-}
-/**
- * @brief Handling of the expiry in active DRX timers in Dl and Ul direction
- *
- * @details
- *
- * Function : schHdlDrxInActvExpiryTimerForUlandDlDirection
- *
- * Handling of expiry in active DRX timers in DLand Ul direction
- *
- * @param[in] SchCellCb *cell, uint16_t dlIndx
- * @return
- * -# ROK
- * -# RFAILED
- **/
-void schHdlDrxInActvExpiryTimerForUlandDlDirection(SchCellCb *cell, uint16_t listIndx, bool isDlDirection)
-{
- CmLList *drxNode;
- SchUeCb *ueCb = NULLP;
-
- drxNode = cell->drxCb[listIndx].inActvTmrExpiryList.first;
- if(drxNode)
- {
- /* Handling of dl On duration drx start list */
- while(drxNode)
- {
- ueCb = (SchUeCb*)drxNode->node;
- ueCb->drxUeCb.inActiveTmrExpiryDistance--;
-
- if(ueCb->drxUeCb.onDurationExpiryDistance== SCH_DRX_INVALID_DISTANCE)
- {
- DU_LOG("\nPBORLA IN ACTV EXP HIT %d[%d:%d]",listIndx, cell->slotInfo.sfn, cell->slotInfo.slot);
- /*Delete the current entry from list */
- if(drxNode->node)
- {
- cmLListDelFrm(&cell->drxCb[listIndx].inActvTmrExpiryList, ueCb->drxUeCb.inActvTimerExpiryNodeInfo);
- SCH_FREE(ueCb->drxUeCb.inActvTimerExpiryNodeInfo, sizeof(CmLList));
- ueCb->drxUeCb.inActvExpiryIndex = SCH_DRX_INVALID_INDEX;
- }
-
- /* If short cycle is configured then start the short cycle timer */
- if(ueCb->drxUeCb.shortCyclePresent)
- {
- schHdlDrxStartShortCycleTimer(cell, ueCb);
- }
- else
- {
- ueCb->drxUeCb.longCycleToBeUsed = true;
- }
- /* Set the drx ue status as inactive once the in active timer gets
- * expire */
- if(isDlDirection == true)
- ueCb->drxUeCb.drxDlUeActiveStatus = false;
- else
- ueCb->drxUeCb.drxUlUeActiveStatus = false;
- DU_LOG("\nPBORLA drxUeCb.drxUlUeActiveStatus drxUeCb.drxDlUeActiveStatus [%d:%d] line %d", ueCb->drxUeCb.drxUlUeActiveStatus, ueCb->drxUeCb.drxDlUeActiveStatus,__LINE__);
-
- }
- else
- continue;
- drxNode = drxNode->next;
- }
- }
+ schHdlDrxOnDurExpiryTimerForDlDirection(cell, dlIndx);
+ schHdlDrxOnDurExpiryTimerForUlDirection(cell, ulIndx);
}
-/**
- * @brief Handling of the expiry in active DRX timers
- *
- * @details
- *
- * Function :schHdlDrxInActvExpiryTimer
- *
- * Handling of expiry in active DRX timers
- *
- * @param[in] SchCellCb *cell
- * @return
- * -# ROK
- * -# RFAILED
- **/
-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 + SCH_DRX_TMRS_EXP_DELTA);
- ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA + SCH_DRX_TMRS_EXP_DELTA);
- dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE;
- ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE;
-
- schHdlDrxInActvExpiryTimerForUlandDlDirection(cell, dlIndx, true);
- schHdlDrxInActvExpiryTimerForUlandDlDirection(cell, ulIndx, false);
-}/**
+/**
* @brief Handling of the expiry DRX timers
*
* @details
void schHandleExpiryDrxTimer(SchCellCb *cell)
{
/* Handling the onduration start timer */
- schHdlDrxShortCycleExpiryTimer(cell);
schHdlDrxOnDurExpiryTimer(cell);
- schHdlDrxInActvExpiryTimer(cell);
}
-
#endif
/**********************************************************************
End of file