1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for scheduler 1
29 **********************************************************************/
31 /** @file rg_sch_sc1.c
32 @brief The scheduling functionality is implemented in this file.
35 static const char* RLOG_MODULE_NAME="MAC";
36 static int RLOG_MODULE_ID=4096;
37 static int RLOG_FILE_ID=173;
39 /* header include files -- defines (.h) */
40 #include "envopt.h" /* environment options */
41 #include "envdep.h" /* environment dependent */
42 #include "envind.h" /* environment independent */
43 #include "gen.h" /* general layer */
44 #include "ssi.h" /* system service interface */
45 #include "cm5.h" /* common timers */
46 #include "cm_hash.h" /* common hash list */
47 #include "cm_llist.h" /* common linked list library */
48 #include "cm_err.h" /* common error */
49 #include "cm_lte.h" /* common LTE */
55 #include "rg_sch_inf.h"
56 #include "rg_sch_err.h"
58 #include "rg_sch_cmn.h"
59 #include "rg_sch_sc1.h"
60 #include "rl_interface.h"
61 #include "rl_common.h"
63 /* header/extern include files (.x) */
64 #include "gen.x" /* general layer typedefs */
65 #include "ssi.x" /* system services typedefs */
66 #include "cm5.x" /* common timers */
67 #include "cm_hash.x" /* common hash list */
68 #include "cm_lib.x" /* common library */
69 #include "cm_llist.x" /* common linked list */
70 #include "cm_mblk.x" /* memory management */
71 #include "cm_tkns.x" /* common tokens */
72 #include "cm_lte.x" /* common tokens */
73 #include "tfu.x" /* RGU types */
74 #include "lrg.x" /* layer management typedefs for MAC */
75 #include "rgr.x" /* layer management typedefs for MAC */
76 #include "rgm.x" /* layer management typedefs for MAC */
77 #include "rg_sch_inf.x" /* typedefs for Scheduler */
78 #include "rg_sch.x" /* typedefs for Scheduler */
79 #include "rg_sch_cmn.x"
80 #include "rg_sch_sc1.x" /* typedefs for SC1 Scheduler */
87 #endif /* __cplusplus */
89 /* Functions called from outside */
90 PRIVATE S16 rgSCHSc1RgrDlCellRecfg ARGS((
96 /*--------------------------*
97 * DL SCHED STATIC declarations START
98 *---------------------------*/
99 PRIVATE Void rgSCHSc1DlSvcAddToSchd ARGS((
103 PRIVATE Void rgSCHSc1DlAdd2UeSchdSvcs ARGS((
108 PRIVATE Void rgSCHSc1DlRmvUeFrmPrioQs ARGS((
112 PRIVATE Void rgSCHSc1DlSuspendUe ARGS((
116 PRIVATE Void rgSCHSc1DlInactvtUe ARGS((
120 PRIVATE Void rgSCHSc1DlProcRmvFrmCellRetx ARGS((
124 PRIVATE Void rgSCHSc1DlProcRmvFrmUeRetx ARGS((
129 PRIVATE Void rgSCHSc1DlMngPrio0SvcPosn ARGS((
134 PRIVATE Void rgSCHSc1DlMngGbrSvcPosn ARGS((
139 PRIVATE Void rgSCHSc1DlMngAmbrSvcPosn ARGS((
144 PRIVATE Void rgSCHSc1DlMngSvcPosn ARGS((
149 PRIVATE Void rgSCHSc1DlUeAddToSchd ARGS((
153 PRIVATE Void rgSCHSc1DlTaCmd ARGS((
155 RgSchCmnDlRbAllocInfo *allocInfo
157 PRIVATE Void rgSCHSc1DlInitQueues ARGS((
158 RgSchSc1DlCell *cellDl
160 PRIVATE Void rgSCHSc1DlDeinitQueues ARGS((
161 RgSchSc1DlCell *cellDl
163 PRIVATE Void rgSCHSc1DlAdd2UeLcsWithData ARGS((
168 PRIVATE Void rgSCHSc1DlRmFrmUeLcsWithData ARGS((
173 /*--------------------------*
174 * UL SCHED STATIC declarations START
175 *---------------------------*/
176 PRIVATE Void rgSCHSc1UlPosnUeInQ ARGS((
180 PRIVATE Void rgSCHSc1UlSchdUeTxLst ARGS((
183 RgSchCmnUlRbAllocInfo *allocInfo,
186 PRIVATE Void rgSCHSc1DlProcRmvFrmRetx ARGS((
191 PUBLIC Void rgSCHSc1DlScanUpdPdbPrio ARGS((
194 PUBLIC S16 rgSCHSc1DlFillFlowCntrlInfo ARGS((
196 RgInfSfAlloc *sfAlloc
199 PRIVATE Void rgSCHSc1DlPreSchd ARGS ((
202 PRIVATE Void rgSCHSc1DlPstSchd ARGS ((
207 #endif /* __cplusplus */
212 /***************** SC1 DL SCHEDULER FUNCTION DEFNs START HERE ********/
214 /***********************************************************
216 * Func : rgSCHSc1DlUeReset
218 * Desc : Out of Meas Gap. Reposition the UEs Retx Hq Procs,
219 * and Svc in respective Prio Qs.
228 **********************************************************/
230 PUBLIC Void rgSCHSc1DlUeReset
236 PUBLIC Void rgSCHSc1DlUeReset(cell, ue)
241 TRC2(rgSCHSc1DlUeReset);
243 rgSCHSc1DlSuspendUe(cell, ue);
249 /***********************************************************
251 * Func : rgSCHSc1DlActvtUe
253 * Desc : Out of Meas Gap. Reposition the UEs Retx Hq Procs,
254 * and Svc in respective Prio Qs.
263 **********************************************************/
265 PUBLIC Void rgSCHSc1DlActvtUe
271 PUBLIC Void rgSCHSc1DlActvtUe(cell, ue)
276 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
279 RgSchDlHqProcCb *hqP;
282 TRC2(rgSCHSc1DlActvtUe);
284 /* Add UE's HqProcs From UERetxLst to CellRetxLst */
285 lst = &ueDl->retxHqProcs;
289 hqP = (RgSchDlHqProcCb *)node->node;
291 rgSCHSc1DlProcRmvFrmUeRetx(cell, ue, hqP);
292 rgSCHSc1DlProcAddToCellRetx(cell, hqP);
295 /* Iterate over all the Services if bo != 0 then add */
296 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; ++idx)
298 svc = ue->dl.lcCb[idx];
303 rgSCHSc1DlMngSvcPosn(cell, ue, svc);
306 /* Add UE to AMBR Prio Q */
309 rgSCHSc1DlUeAddToSchd(cell, ue);
316 /***********************************************************
318 * Func : rgSCHSc1DlUeRefresh
320 * Desc : Handle 'refresh' for Downlink
321 * (ie UE's downlink AMBR and downlink GBR LCGs are
322 * refreshed at this point)
330 **********************************************************/
332 PUBLIC Void rgSCHSc1DlUeRefresh
338 PUBLIC Void rgSCHSc1DlUeRefresh(cell, ue)
343 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
344 /*cell added as part of CA dev*/
345 RgSchCmnDlSvc *svcCmn;
346 RgSchSc1DlSvc *svcSc1;
350 TRC2(rgSCHSc1DlUeRefresh);
354 ueDl->ambr = ue->dl.ambrCfgd;
358 ueDl->ambr = RG_SC1_MAX_DL_AMBR;
361 if (ueDl->ambrSvc != NULLP)
363 ueDl->effAmbr = RGSCH_MIN(ueDl->ambr, ueDl->ambrSvc->bo);
364 /* Update UEs position in the Queue */
365 rgSCHSc1DlUeAddToSchd(cell, ue);
368 lst = &ueDl->gbrSvcs;
370 while (node != NULLP)
372 svc = (RgSchDlLcCb *)node->node;
373 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
374 svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
376 svcSc1->gbr = svcCmn->gbr;
377 svcSc1->mbr = svcCmn->mbr;
378 /* Update the SVC's positioning in the Queue */
379 rgSCHSc1DlMngGbrSvcPosn(cell, ue, svc);
386 * @brief This function removes a HARQ process from the retx
390 * Function: rgSCHSc1DlProcRmvFrmCellRetx
391 * Purpose: This function removes a HARQ process from retransmission
392 * queue. This may be performed when a HARQ ack is successful
393 * for a retransmission or when the scheduling determines
394 * to throw out the process due to poor conditions
396 * Invoked by: LIM and Scheduler
398 * @param[in] RgSchSc1Cb* cell
399 * @param[in] RgDlHqProc* hqP
404 PRIVATE Void rgSCHSc1DlProcRmvFrmCellRetx
410 PRIVATE Void rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP)
412 RgSchDlHqProcCb *hqP;
415 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
416 RgSchCmnDlHqProc *hqProcDl = RG_SCH_CMN_GET_DL_HQP(hqP);
418 TRC2(rgSCHSc1DlProcRmvFrmCellRetx);
420 if (hqProcDl->retxLnk.node != NULLP)
422 cmLListDelFrm(&cellDl->retxLst[((RgSchSc1DlHqProc *)\
423 (hqProcDl->schSpfc))->prio], &(hqProcDl->retxLnk));
424 hqProcDl->retxLnk.node = NULLP;
431 * @brief This function removes a HARQ process from the UE retx
435 * Function: rgSCHSc1DlProcRmvFrmUeRetx
436 * Purpose: This function removes a HARQ process from UE retransmission
439 * Invoked by: LIM and Scheduler
441 * @param[in] RgSchUeCb* ue
442 * @param[in] RgDlHqProc* hqP
447 PRIVATE Void rgSCHSc1DlProcRmvFrmUeRetx
454 PRIVATE Void rgSCHSc1DlProcRmvFrmUeRetx(cell, ue, hqP)
457 RgSchDlHqProcCb *hqP;
460 RgSchSc1DlUe *sc1Ue = RG_GET_SC1_UE_DL(ue, cell);
461 RgSchSc1DlHqProc *hqProcDl = RG_GET_SC1_HQP_DL(hqP);
463 TRC2(rgSCHSc1DlProcRmvFrmUeRetx);
465 if (hqProcDl->retxLnkUe.node != NULLP)
467 cmLListDelFrm(&sc1Ue->retxHqProcs,
468 &(hqProcDl->retxLnkUe));
469 hqProcDl->retxLnkUe.node = NULLP;
476 * @brief This function adds a HARQ process for UEs retxLst
480 * Function: rgSCHSc1DlProcAddToUeRetx
481 * Purpose: This function adds a HARQ process to UE retransmission
482 * queue. This is performed when UE is suspended due
483 * to measurement gap.
485 * Invoked by: HARQ feedback processing
487 * @param[in] RgSchUeCb* ue
488 * @param[in] RgSchDlHqProc* hqP
493 PRIVATE Void rgSCHSc1DlProcAddToUeRetx
500 PRIVATE Void rgSCHSc1DlProcAddToUeRetx(cell, ue, hqP)
503 RgSchDlHqProcCb *hqP;
506 RgSchSc1DlUe *sc1Ue = RG_GET_SC1_UE_DL(ue, cell);
507 RgSchSc1DlHqProc *cmnHqDl = RG_GET_SC1_HQP_DL(hqP);
509 TRC2(rgSCHSc1DlProcAddToUeRetx);
511 cmLListAdd2Tail(&sc1Ue->retxHqProcs,
512 &(cmnHqDl->retxLnkUe));
513 cmnHqDl->retxLnkUe.node = (PTR)hqP;
519 * @brief This function adds a HARQ process for retx
523 * Function: rgSCHSc1DlProcAddToCellRetx
524 * Purpose: This function adds a HARQ process to retransmission
525 * queue. This may be performed when a HARQ ack is
528 * Invoked by: HARQ feedback processing
530 * @param[in] RgSchCellCb* cell
531 * @param[in] RgSchDlHqProc* hqP
536 PUBLIC Void rgSCHSc1DlProcAddToCellRetx
542 PUBLIC Void rgSCHSc1DlProcAddToCellRetx(cell, hqP)
544 RgSchDlHqProcCb *hqP;
547 RgSchSc1DlCell *sc1CellDl = RG_GET_SC1_CELL_DL(cell);
548 RgSchCmnDlHqProc *cmnHqDl = RG_SCH_CMN_GET_DL_HQP(hqP);
550 TRC2(rgSCHSc1DlProcAddToCellRetx);
552 if (!RG_SCH_CMN_DL_IS_UE_ACTIVE(hqP->hqE->ue))
554 rgSCHSc1DlProcAddToUeRetx(cell, hqP->hqE->ue, hqP);
557 cmLListAdd2Tail(&sc1CellDl->retxLst[((RgSchSc1DlHqProc *)\
558 (cmnHqDl->schSpfc))->prio], &(cmnHqDl->retxLnk));
559 cmnHqDl->retxLnk.node = (PTR)hqP;
565 * @brief This function implements DL RETRANSMISSION allocation
569 * Function: rgSCHSc1DlRetxAlloc
570 * Purpose: This function implements downlink scheduler's
571 * retransmission allocation.
573 * Invoked by: Scheduler
575 * @param[in] RgSchCellCb *cell
576 * @param[in] RgSchDlSf *subFrm
577 * @param[out] RgSchCmnDlRbAllocInfo *allocInfo
582 PRIVATE Void rgSCHSc1DlRetxAlloc
586 RgSchCmnDlRbAllocInfo *allocInfo
589 PRIVATE Void rgSCHSc1DlRetxAlloc(cell, subFrm, allocInfo)
592 RgSchCmnDlRbAllocInfo *allocInfo;
598 RgSchDlHqProcCb *hqP;
599 RgSchSc1DlCell *sc1CellDl;
600 RgSchSc1DlUe *sc1DlUe;
601 RgSchCmnDlUe *cmnUeDl;
602 #if (defined(LTEMAC_SPS) || (!defined(LTE_TDD)))
603 CmLteTimingInfo schdTime;
606 RgSchUeCb *ue = NULLP;
608 Bool dlAllowed = FALSE;
610 RgSchDlRbAlloc *dlAllocCb;
611 TRC2(rgSCHSc1DlRetxAlloc);
613 sc1CellDl = RG_GET_SC1_CELL_DL(cell);
614 #if (defined(LTEMAC_SPS) || (!defined(LTE_TDD)))
615 schdTime = cell->crntTime;
617 /* Increment by DL DELTA to determine the time for which scheduling
619 RGSCH_INCR_SUB_FRAME(schdTime, RG_SCH_CMN_DL_DELTA);
621 for (i = 0; i < RG_SCH_SC1_DL_PRIOS; i++)
623 retxLst = &sc1CellDl->retxLst[i];
624 /* allocate bw for the retransmission..should be same are previous */
625 /* If CQI gets worse, as we cannot find same TB size for another */
626 /* MCS, we just remove this from the retransmission queue */
627 node = retxLst->first;
628 while (node != NULLP)
630 hqP = (RgSchDlHqProcCb *)node->node;
635 if((0 == schdTime.subframe) || (5 == schdTime.subframe))
638 rgSCHCmnChkRetxAllowDtx(cell, ue, hqP, &reTxAllw);
639 if(FALSE == reTxAllw)
648 rgSCHCmnHdFddChkDlAllow ( cell, ue, &dlAllowed);
649 if (dlAllowed == FALSE)
655 /* This UE is already scheduled for transmission */
656 cmnUeDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
657 /*cell added as part of CA dev*/
659 if (RG_SCH_CMN_IS_UE_SPS_SCHDLD(ue, cell, schdTime))
664 if (RG_SCH_CMN_IS_UE_SCHDLD(ue, cell))
669 /* Extra check: indicate if there is furtherScope for NewTx
670 * addition for a HqProc. This information will
671 * be utilized by common scheduler, in case of SM
672 * UEs with only one of the TBs retransmitting and the
673 * other TB can be used for clubbing new TX. */
674 sc1DlUe = RG_GET_SC1_UE_DL(ue, cell);
675 dlAllocCb = RG_SCH_CMN_GET_ALLOCCB_FRM_UE(ue, cell);
676 if (sc1DlUe->lcsWithData.first != NULLP)
678 dlAllocCb->mimoAllocInfo.hasNewTxData = TRUE;
680 /* 3.1 MIMO : last parameter changed */
681 if (rgSCHCmnDlAllocRetxRb(cell, subFrm, ue, 0, &effBo, hqP, allocInfo) !=\
684 /* SF/RETX Bandwidth expired */
692 if ((hqP->tbInfo[0].state == HQ_TB_ACKED)
693 && (hqP->tbInfo[1].state == HQ_TB_ACKED))
695 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
700 /* 3.1 MIMO moving this call in cmn scheduler */
701 /*rgSCHCmnDlRbInfoAddUeRetx(allocInfo, ue);*/
707 /***********************************************************
709 * Func : rgSCHSc1RlsHqProc
711 * Desc : Toggles the NDI and releases the harq proc.
719 **********************************************************/
721 PRIVATE Void rgSCHSc1RlsHqProc
723 RgSchDlHqProcCb *hqProc
726 PRIVATE Void rgSCHSc1RlsHqProc(hqProc)
727 RgSchDlHqProcCb *hqProc;
730 TRC2(rgSCHSc1RlsHqProc)
731 rgSCHDhmRlsHqProc(hqProc);
736 * @brief This function implements dedicated logical channel data scheduling
740 * Function: rgSCHSc1DlDedSvcAlloc
741 * Purpose: This function implements dedicated logical
742 * channel data scheduling
744 * Invoked by: Scheduler
746 * @param[in] RgSchCellCb *cell
747 * @param[in] RgSchDlSf *subFrm
748 * @param[in] RgSchDlLcCb *svc
750 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
755 PRIVATE S16 rgSCHSc1DlDedSvcAlloc
761 RgSchCmnDlRbAllocInfo *allocInfo
764 PRIVATE S16 rgSCHSc1DlDedSvcAlloc(cell, subFrm, svc, bo, allocInfo)
769 RgSchCmnDlRbAllocInfo *allocInfo;
773 RgSchDlHqProcCb *proc;
776 RgSchCmnDlCell *cmnCellDl = RG_SCH_CMN_GET_DL_CELL(cell);
777 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
778 RgSchSc1DlSvc *svcSc1;
780 RgSchSc1DlHqProc *sc1HqDl;
781 RgSchCmnDlHqProc *cmnHqDl;
783 CmLteTimingInfo schdTime;
786 Bool dlAllowed = FALSE;
790 TRC2(rgSCHSc1DlDedSvcAlloc);
792 /* Get the UE to which this service belongs to */
797 rgSCHCmnHdFddChkDlAllow ( cell, ue, &dlAllowed);
798 if (dlAllowed == FALSE)
804 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
805 /*cell added as part of CA dev*/
807 schdTime = cell->crntTime;
809 /* Increment by DL DELTA to determine the time for which scheduling
811 RGSCH_INCR_SUB_FRAME(schdTime, RG_SCH_CMN_DL_DELTA);
812 if (RG_SCH_CMN_IS_UE_SPS_SCHDLD(ue, cell, schdTime))
817 if (RG_SCH_CMN_IS_UE_SCHDLD(ue, cell))
819 proc = (RgSchDlHqProcCb *)(ueDl->proc);
820 /* This UE is selected for retransmission. Hence no further */
821 /* scheduling may be done for this UE */
822 if (RG_SCH_CMN_PROC_SLCTD_FOR_RETX(proc))
824 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d rgSCHSc1DlDedSvcAlloc():"
825 "Ue retransmitting",ue->ueId);
828 /* UE is scheduled for either other services or TA */
829 sc1HqDl = RG_GET_SC1_HQP_DL(proc);
830 cmnHqDl = RG_SCH_CMN_GET_DL_HQP(proc);
831 if (sc1HqDl->prio > svcCmn->prio)
833 sc1HqDl->prio = svcCmn->prio;
836 else /* First consideration of this UE for scheduling */
838 if (rgSCHDhmGetAvlHqProc(cell, ue, cmnCellDl->time, &proc) != ROK)
840 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "CRNTI:%d rgSCHSc1DlDedSvcAlloc():"
841 " No HARQ Proc available", ue->ueId);
844 sc1HqDl = RG_GET_SC1_HQP_DL(proc);
845 cmnHqDl = RG_SCH_CMN_GET_DL_HQP(proc);
846 cmnHqDl->totBytes = 0;
847 /* Initialize some of the parameters of the HQ proc */
848 sc1HqDl->prio = svcCmn->prio;
851 /* Including each SDU's header size */
852 RG_SCH_CMN_DL_GET_HDR_EST(svc, rlcHdrEstmt);
855 ret = rgSCHCmnDlAllocTxRb(cell, subFrm, ue, bo, &effBo, proc, allocInfo);
856 if ((ret != ROK) || (effBo == 0))
858 /* If no allocations so far, meaning proc obtained now */
859 if (cmnHqDl->totBytes == 0)
861 rgSCHSc1RlsHqProc(proc);
862 /* Added the handling for removing
863 * UE from txHqPLst and resetting outStndAlloc.*/
864 if(proc->reqLnk.node != (PTR)NULLP)
866 cmLListDelFrm(&allocInfo->dedAlloc.txHqPLst, &proc->reqLnk);
867 proc->reqLnk.node = (PTR)NULLP;
869 /*Re-set the outstanding alloc information.*/
870 ueDl->outStndAlloc = 0;
872 /* ccpu00126519: proc should be set to NULLP in UE's DL scratch pad info as well. */
877 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
878 svcSc1->hdrEstimate = rlcHdrEstmt;
879 svcSc1->reqBytes = bo;
881 cmnHqDl->totBytes += effBo;
883 rgSCHSc1DlAdd2UeSchdSvcs(cell, ue, svc);
884 /* 3.1 MIMO moving this call to cmn scheduler */
885 /*rgSCHCmnDlRbInfoAddUeTx(allocInfo, ue); */
890 * @brief This function adds a SVC to UE's schdSvcsLst.
894 * Function: rgSCHSc1DlAdd2UeSchdSvcs
895 * Purpose: This function adds a SVC to UE's schdSvcsLst.
897 * Invoked by: Specific Scheduler
899 * @param[out] RgSchUeCb *ue
900 * @param[in] RgSchDlLcCb *svc
905 PRIVATE Void rgSCHSc1DlAdd2UeSchdSvcs
912 PRIVATE Void rgSCHSc1DlAdd2UeSchdSvcs(cell, ue, svc)
918 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
919 RgSchSc1DlUe *ueSc1 = RG_GET_SC1_UE_DL(ue, cell);
920 TRC2(rgSCHSc1DlAdd2UeSchdSvcs);
922 /* checking SVC's presence in this lst is unnecessary */
923 cmLListAdd2Tail(&ueSc1->schdSvcs, &svcSc1->schdSvcLnk);
924 svcSc1->schdSvcLnk.node = (PTR)svc;
930 * @brief This function performs new allocations for UEs
934 * Function: rgSCHSc1DlDedTx
935 * Purpose: This function implements scheduler for DL allocation for
936 * new transmissions of UEs.
937 * 1. It performs across 9 priorities that it supports -
938 * This is from 3GPP specifications
939 * 2. There are known number of GBR/MBR queues
940 * 3. The first queue is highest priority queue and is
941 * satisfied completely prior to any other queues. This
942 * queue is for RRC signalling.
943 * 4. Futher GBR/MBR queues are satisfied for GBR and then MBR
944 * 5. Subsequently all other queues are looked at for AMBR
946 * Invoked by: Scheduler
948 * @param[in] RgSchCellCb* cell
949 * @param[in] RgSchDlSf *subFrm
950 * @param[out] RgSchCmnDlRbAllocInfo *allocInfo
955 PRIVATE Void rgSCHSc1DlDedTx
959 RgSchCmnDlRbAllocInfo *allocInfo
962 PRIVATE Void rgSCHSc1DlDedTx(cell, subFrm, allocInfo)
965 RgSchCmnDlRbAllocInfo *allocInfo;
970 RgSchUeCb *ue = NULLP;
973 RgSchSc1DlSvc *svcSc1;
975 RgSchSc1DlCell *sc1CellDl = RG_GET_SC1_CELL_DL(cell);
977 TRC2(rgSCHSc1DlDedTx);
979 /* Process the first queue that is for RRC signalling and is of */
980 /* highest priority. */
981 lst = &sc1CellDl->prioLst[0];
985 /* Getting service instead of UE */
986 svc = (RgSchDlLcCb *)node->node;
988 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
990 if (rgSCHSc1DlDedSvcAlloc(cell, subFrm, svc, svcSc1->bo, allocInfo) != ROK)
997 /* Perform allocation for the GBR transmissions */
998 for(i = RG_SCH_SC1_DL_GBR_PRIO_START; i <= RG_SCH_SC1_DL_GBR_PRIO_END; i++)
1000 lst = &sc1CellDl->prioLst[i];
1002 while(node != NULLP)
1004 /* Getting service instead of UE */
1005 svc = (RgSchDlLcCb *)node->node;
1007 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1009 if (rgSCHSc1DlDedSvcAlloc(cell, subFrm, svc, svcSc1->effMbr, allocInfo) != ROK)
1017 /* To implement AMBR svc scheduling */
1018 for(i = RG_SCH_SC1_DL_GBR_PRIO_END + 1; i < RG_SCH_SC1_DL_PRIOS; i++)
1020 lst = &sc1CellDl->prioLst[i];
1022 while(node != NULLP)
1024 ue = (RgSchUeCb *)node->node;
1025 ueDl = RG_GET_SC1_UE_DL(ue, cell);
1027 /* Get the Curr ambr svc for which allocation is to be made */
1028 svc = ueDl->ambrSvc;
1029 if (rgSCHSc1DlDedSvcAlloc(cell, subFrm, svc, ueDl->effAmbr, allocInfo) != ROK)
1040 * @brief scheduling for a cell
1044 * Function : rgSCHSc1DlPreSchd
1047 * - Nothing to be done in case of RR
1049 * @param[in] Inst schInst
1053 PRIVATE Void rgSCHSc1DlPreSchd
1058 PUBLIC Void rgSCHSc1DlPreSchd(cell)
1062 TRC2(rgSCHSc1DlPreSchd);
1067 * @brief scheduling for a cell
1071 * Function : rgSCHSc1DlPstSchd
1074 * - Nothing to be done in case of RR
1076 * @param[in] Inst schInst
1080 PRIVATE Void rgSCHSc1DlPstSchd
1085 PUBLIC Void rgSCHSc1DlPstSchd(schInst)
1089 TRC2(rgSCHSc1DlPstSchd);
1096 * @brief This function implements scheduler DL allocation
1100 * Function: rgSCHSc1DlDedNewTx
1101 * Purpose: This function implements scheduler for DL allocation for
1104 * Invoked by: Scheduler
1106 * @param[in] RgSchCellCb *cell
1107 * @param[out] RgSchCmnDlRbAllocInfo *allocInfo
1112 PRIVATE Void rgSCHSc1DlDedNewTx
1115 RgSchCmnDlRbAllocInfo *allocInfo
1118 PRIVATE Void rgSCHSc1DlDedNewTx(cell, allocInfo)
1120 RgSchCmnDlRbAllocInfo *allocInfo;
1123 RgSchDlSf *subFrm = allocInfo->dedAlloc.dedDlSf;
1125 Inst inst = cell->instIdx;
1127 TRC2(rgSCHSc1DlDedNewTx);
1128 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "rgSCHSc1DlDedNewTx\n"));
1130 /* Now perform the new UE selections */
1131 rgSCHSc1DlDedTx(cell, subFrm, allocInfo);
1133 /* Stack Crash problem for TRACE5 changes. Added the return below */
1138 * @brief This function implements scheduler DL allocation
1142 * Function: rgSCHSc1DlDedRetx
1143 * Purpose: This function implements scheduler for DL allocation for
1146 * Invoked by: Scheduler
1148 * @param[in] RgSchCellCb *cell
1149 * @param[out] RgSchCmnDlRbAllocInfo *allocInfo
1154 PRIVATE Void rgSCHSc1DlDedRetx
1157 RgSchCmnDlRbAllocInfo *allocInfo
1160 PRIVATE Void rgSCHSc1DlDedRetx(cell, allocInfo)
1162 RgSchCmnDlRbAllocInfo *allocInfo;
1165 RgSchDlSf *subFrm = allocInfo->dedAlloc.dedDlSf;
1167 Inst inst = cell->instIdx;
1169 TRC2(rgSCHSc1DlDedRetx);
1170 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "rgSCHSc1DlDedRetx\n"));
1172 rgSCHSc1DlRetxAlloc(cell, subFrm, allocInfo);
1181 * @brief This function adds a service to scheduler
1185 * Function: rgSCHSc1DlSvcAddToSchd
1186 * Purpose: This function adds a service to the list of services
1187 * based on the priority of the services.
1189 * Invoked by: BO and Scheduler
1191 * @param[in] RgSchCellCb* cell
1192 * @param[in] RgSchUeCb* ue
1197 PRIVATE Void rgSCHSc1DlSvcAddToSchd
1203 PRIVATE Void rgSCHSc1DlSvcAddToSchd(cell, svc)
1211 RgSchSc1DlSvc *svcSc1;
1212 RgSchSc1DlSvc *lSvcSc1;
1213 RgSchSc1DlCell *sc1CellDl = RG_GET_SC1_CELL_DL(cell);
1214 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1216 TRC2(rgSCHSc1DlSvcAddToSchd);
1218 svcSc1 = RG_GET_SC1_SVC_DL(svc->ue,svc,cell);
1219 /* The service is already in the scheduler */
1220 if (svcSc1->prioLnk.node != NULLP)
1225 /* If the priority = 0, it is the highest priority with infinite */
1226 /* allowance and the priority is time bound and hence just place */
1227 /* it at the end of the queue */
1228 if (svcCmn->prio == 0)
1230 lst = &(sc1CellDl->prioLst[0]);
1231 cmLListAdd2Tail(lst, &svcSc1->prioLnk);
1232 svcSc1->prioLnk.node = (PTR)svc;
1233 /* If a svc is put in to cell wide priority Qs
1234 * then add the same to UE's lcsWithData List */
1235 rgSCHSc1DlAdd2UeLcsWithData(cell, svc->ue, svc);
1239 /* Handle GBR services. We have them of next importance */
1240 /* check changed from .._START to .._END */
1241 if (svcCmn->prio <= RG_SCH_SC1_DL_GBR_PRIO_END)
1243 if (!RG_SC1_SVC_HAS_DATA(svc,cell))
1245 lst = &(sc1CellDl->prioLst[svcCmn->prio]);
1249 lSvc = (RgSchDlLcCb *)(node->node);
1250 lSvcSc1 = RG_GET_SC1_SVC_DL(lSvc->ue,lSvc,cell);
1251 if (((svcSc1->effGbr > 0) &&
1252 (lSvcSc1->effGbr <= svcSc1->effGbr)) ||
1253 ((lSvcSc1->effGbr == 0) && (svcSc1->effMbr > 0) &&
1254 (lSvcSc1->effMbr <= svcSc1->effMbr)))
1262 /* We have come to the end of the queue. Let's place it */
1263 /* here irresepctive of effGbr or effMBr */
1264 cmLListAdd2Tail(lst, &svcSc1->prioLnk);
1265 svcSc1->prioLnk.node = (PTR)svc;
1270 cmLListInsCrnt(lst, &svcSc1->prioLnk);
1271 svcSc1->prioLnk.node = (PTR)svc;
1273 /* If a svc is put in to cell wide priority Qs
1274 * then add the same to UE's lcsWithData List */
1275 rgSCHSc1DlAdd2UeLcsWithData(cell, svc->ue, svc);
1283 * @brief This function removes a UE from scheduler Queue
1287 * Function: rgSCHSc1DlUeRmvFrmSchd
1288 * Purpose: This function removes a UE from the list of UEs
1289 * based on the priority of the UEs Current AMBR SVC.
1291 * Invoked by: BO and Scheduler
1293 * @param[in] RgSchCellCb* cell
1294 * @param[in] RgSchUeCb* ue
1299 PRIVATE Void rgSCHSc1DlUeRmvFrmSchd
1305 PRIVATE Void rgSCHSc1DlUeRmvFrmSchd(cell, ue)
1310 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
1311 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1314 TRC2(rgSCHSc1DlUeRmvFrmSchd);
1316 lst = &cellDl->prioLst[ueDl->prio];
1317 if (ueDl->prioLnk.node != NULLP)
1319 cmLListDelFrm(lst, &ueDl->prioLnk);
1320 ueDl->prioLnk.node = (PTR)NULLP;
1321 /* If a svc is removed from cell wide priority Qs
1322 * then remove the same from UE's lcsWithData List */
1323 rgSCHSc1DlRmFrmUeLcsWithData(cell, ue, ueDl->ambrSvc);
1330 * @brief This function removes a SVC from UEs AMBR LIST
1334 * Function: rgSCHSc1DlSvcRmvFrmUeAmbrLst
1335 * Purpose: This function removes a SVC from UEs AMBR List.
1337 * Invoked by: BO and Scheduler
1339 * @param[in] RgSchUeCb* ue
1340 * @param[in] RgSchDlLcCb* svc
1345 PRIVATE Void rgSCHSc1DlSvcRmvFrmUeAmbrLst
1352 PRIVATE Void rgSCHSc1DlSvcRmvFrmUeAmbrLst(cell, ue, svc)
1358 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1359 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1362 TRC2(rgSCHSc1DlSvcRmvFrmUeAmbrLst);
1364 lst = &ueDl->ambrLst;
1365 if (svcSc1->prioLnk.node != NULLP)
1367 cmLListDelFrm(lst, &svcSc1->prioLnk);
1368 svcSc1->prioLnk.node = (PTR)NULLP;
1375 * @brief This function adds a SVC to UEs AMBR LIST
1379 * Function: rgSCHSc1DlSvcAddToUeAmbrLst
1380 * Purpose: This function adds a SVC to UEs AMBR List.
1382 * Invoked by: BO and Scheduler
1384 * @param[in] RgSchUeCb* ue
1385 * @param[in] RgSchDlLcCb* svc
1390 PRIVATE Void rgSCHSc1DlSvcAddToUeAmbrLst
1397 PRIVATE Void rgSCHSc1DlSvcAddToUeAmbrLst(cell, ue, svc)
1403 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1406 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1407 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1409 TRC2(rgSCHSc1DlSvcAddToUeAmbrLst);
1411 /* If svc already present in AMBR List return */
1412 if (svcSc1->prioLnk.node != NULLP)
1415 node = ueDl->ambrLst.first;
1418 lsvc = (RgSchDlLcCb *)(node->node);
1419 if (((RgSchCmnDlSvc*)(lsvc->sch))->prio > svcCmn->prio)
1427 cmLListAdd2Tail(&ueDl->ambrLst, &svcSc1->prioLnk);
1428 svcSc1->prioLnk.node = (PTR)svc;
1432 ueDl->ambrLst.crnt = node;
1433 cmLListInsCrnt(&ueDl->ambrLst, &svcSc1->prioLnk);
1434 svcSc1->prioLnk.node = (PTR)svc;
1442 * @brief This function removes a service from scheduler
1446 * Function: rgSCHSc1DlSvcRmvFrmSchd
1447 * Purpose: This function removes the SVC from the scheduler Qs.
1449 * Invoked by: BO and Scheduler
1451 * @param[in] RgSchCellCb* cell
1452 * @param[in] RgSchUeCb* ue
1457 PRIVATE Void rgSCHSc1DlSvcRmvFrmSchd
1463 PRIVATE Void rgSCHSc1DlSvcRmvFrmSchd(cell, svc)
1468 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
1469 RgSchSc1DlSvc *svcDl = RG_GET_SC1_SVC_DL(svc->ue,svc,cell);
1470 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1473 TRC2(rgSCHSc1DlSvcRmvFrmSchd);
1475 lst = &(cellDl->prioLst[svcCmn->prio]);
1476 if (svcDl->prioLnk.node != NULLP)
1478 cmLListDelFrm(lst, &svcDl->prioLnk);
1479 svcDl->prioLnk.node = NULLP;
1480 /* If a svc is removed from cell wide priority Qs
1481 * then remove the same from UE's lcsWithData List */
1482 rgSCHSc1DlRmFrmUeLcsWithData(cell, svc->ue, svc);
1489 * @brief This function adds a service to scheduler for a UE
1493 * Function: rgSCHSc1DlSvcAdd
1494 * Purpose: This function is made available through a FP for
1495 * making scheduler aware of a service added to UE
1497 * Invoked by: BO and Scheduler
1499 * @param[in] RgSchUeCb* ue
1500 * @param[in] RgSchDlLcCb* svc
1501 * @param[in] CrgDlLchCfg* qos
1506 PRIVATE Void rgSCHSc1DlSvcAdd
1514 PRIVATE Void rgSCHSc1DlSvcAdd(cell, ue, svc, cfg)
1521 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1522 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1523 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1524 TRC2(rgSCHSc1DlSvcAdd);
1528 if (RG_SCH_CMN_SVC_IS_GBR(svc))
1530 svcSc1->gbr = svcCmn->gbr;
1531 svcSc1->mbr = svcCmn->mbr;
1532 cmLListAdd2Tail(&ueDl->gbrSvcs, &svcSc1->gbrLnk);
1533 svcSc1->gbrLnk.node = (PTR)svc;
1540 * @brief This function deletes a service from scheduler
1544 * Function: rgSCHSc1DlLcRmv
1545 * Purpose: This function is made available through a FP for
1546 * making scheduler aware of a service being deleted from UE
1548 * Invoked by: BO and Scheduler
1550 * @param[in] RgSchCellCb* cell
1551 * @param[in] RgSchUeCb* ue
1552 * @param[in] RgSchDlLcCb* svc
1557 PUBLIC Void rgSCHSc1DlLcRmv
1564 PUBLIC Void rgSCHSc1DlLcRmv(cell, ue, svc)
1571 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1572 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1574 TRC2(rgSCHSc1DlLcRmv);
1576 if (svcSc1 == NULLP)
1580 ueDl = RG_GET_SC1_UE_DL(ue, cell);
1582 if (svcCmn->prio == 0)
1584 rgSCHSc1DlSvcRmvFrmSchd(cell, svc);
1586 else if (RG_SCH_CMN_SVC_IS_GBR(svc))
1588 if (svcSc1->gbrLnk.node != NULLP)
1590 cmLListDelFrm(&ueDl->gbrSvcs, &svcSc1->gbrLnk);
1591 svcSc1->gbrLnk.node = NULLP;
1593 rgSCHSc1DlSvcRmvFrmSchd(cell, svc);
1595 else /* if AMBR service */
1597 if (ueDl->ambrSvc == svc)
1599 rgSCHSc1DlUeRmvFrmSchd(cell, ue);
1600 rgSCHSc1DlSvcRmvFrmUeAmbrLst(cell, ue, svc);
1601 ueDl->ambrSvc = NULLP;
1602 if (ueDl->ambrLst.first != NULLP)
1604 ueDl->ambrSvc = (RgSchDlLcCb *)(ueDl->ambrLst.first->node);
1605 ueDl->effAmbr = RGSCH_MIN(ueDl->ambr, svc->bo);
1608 rgSCHSc1DlUeAddToSchd(cell, ue);
1614 rgSCHSc1DlSvcRmvFrmUeAmbrLst(cell, ue, svc);
1617 /* ccpu00117052 - MOD - Passing double pointer
1618 for proper NULLP assignment*/
1619 rgSCHUtlFreeSBuf(cell->instIdx,
1620 (Data**)(&(RG_SCH_CMN_GET_LC_SCH_SPFC(ue,svc,cell))), (sizeof(RgSchSc1DlSvc)));
1625 * @brief This function is invoked as part of SVC reconfig
1629 * Function: rgSCHSc1DlSvcMod
1630 * Purpose: This function is made available through a FP for
1631 * making scheduler aware of a service reconfiguration.
1633 * Invoked by: Scheduler
1635 * @param[in] RgSchDlLcCb* svc
1636 * @param[in] CrgLchRecfg* recfg
1641 PRIVATE Void rgSCHSc1DlSvcMod
1649 PRIVATE Void rgSCHSc1DlSvcMod(cell,ue,svc, recfg)
1656 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1657 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
1658 TRC2(rgSCHSc1DlSvcMod);
1660 if (RG_SCH_CMN_SVC_IS_GBR(svc))
1662 /* Convert the QOS to handle the refresh duration */
1663 svcSc1->gbr = svcCmn->gbr;
1664 svcSc1->mbr = svcCmn->mbr;
1670 * @brief This function adds UE to scheduler for an AMBR service
1674 * Function: rgSCHSc1DlUeAddToSchd
1675 * Purpose: This function adds a UE to scheduler for the AMBR
1676 * service of highest priority.
1678 * Invoked by: BO and Scheduler
1680 * @param[in] RgSchCellCb* cell
1681 * @param[in] RgSchUeCb* ue
1686 PRIVATE Void rgSCHSc1DlUeAddToSchd
1692 PRIVATE Void rgSCHSc1DlUeAddToSchd(cell, ue)
1697 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
1698 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1699 RgSchSc1DlUe *lueDl;
1702 RgSchUeCb *nodeUe = NULLP;
1703 TRC2(rgSCHSc1DlUeAddToSchd);
1705 ueDl->prio = ((RgSchCmnDlSvc *)(ueDl->ambrSvc->sch))->prio;
1706 lst = &cellDl->prioLst[ueDl->prio];
1707 /* if UE already in list, remove and
1709 if (ueDl->prioLnk.node != NULLP)
1711 cmLListDelFrm(lst, &ueDl->prioLnk);
1712 ueDl->prioLnk.node = NULLP;
1713 /* If a svc is removed from cell wide priority Qs
1714 * then remove the same from UE's lcsWithData List */
1715 rgSCHSc1DlRmFrmUeLcsWithData(cell, ue, ueDl->ambrSvc);
1720 nodeUe = (RgSchUeCb *)(node->node);
1721 lueDl = RG_GET_SC1_UE_DL(nodeUe, cell);
1722 if (lueDl->effAmbr < ueDl->effAmbr)
1728 cmLListAdd2Tail(lst, &ueDl->prioLnk);
1729 ueDl->prioLnk.node = (PTR)ue;
1734 cmLListInsCrnt(lst, &ueDl->prioLnk);
1735 ueDl->prioLnk.node = (PTR)ue;
1737 /* If a svc is put in to cell wide priority Qs
1738 * then add the same to UE's lcsWithData List */
1739 rgSCHSc1DlAdd2UeLcsWithData(cell, ue, ueDl->ambrSvc);
1745 * @brief This function implements managing BO for an ABMR service
1749 * Function: rgSCHSc1DlMngAmbrSvcPosn
1750 * Purpose: This function should be called whenever there is a
1751 * change BO for a AMBR service.
1753 * Invoked by: BO and Scheduler
1755 * @param[in] RgSchCellCb* cell
1756 * @param[in] RgSchUeCb* ue
1757 * @param[in] RgSchDlLcCb* svc
1762 PRIVATE Void rgSCHSc1DlMngAmbrSvcPosn
1769 PRIVATE Void rgSCHSc1DlMngAmbrSvcPosn(cell, ue, svc)
1775 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
1776 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1778 TRC2(rgSCHSc1DlMngAmbrSvcPosn);
1780 if (svcSc1->bo == 0)
1782 if (ueDl->ambrSvc == svc)
1784 rgSCHSc1DlUeRmvFrmSchd(cell, ue);
1785 rgSCHSc1DlSvcRmvFrmUeAmbrLst(cell, ue, svc);
1786 ueDl->ambrSvc = NULLP;
1787 if (ueDl->ambrLst.first != NULLP)
1789 ueDl->ambrSvc = (RgSchDlLcCb *)(ueDl->ambrLst.first->node);
1790 ueDl->effAmbr = RGSCH_MIN(ueDl->ambr, svcSc1->bo);
1793 rgSCHSc1DlUeAddToSchd(cell, ue);
1799 rgSCHSc1DlSvcRmvFrmUeAmbrLst(cell, ue, svc);
1802 else /* svcSc1->bo != 0 */
1804 if (svcSc1->prioLnk.node != NULLP)
1806 if (svc == ueDl->ambrSvc)
1808 ueDl->effAmbr = RGSCH_MIN(svcSc1->bo, ueDl->ambr);
1809 /* Update UE's position in the scheduler */
1812 rgSCHSc1DlUeAddToSchd(cell, ue);
1816 rgSCHSc1DlUeRmvFrmSchd(cell, ue);
1821 rgSCHSc1DlSvcAddToUeAmbrLst(cell, ue, svc);
1822 /* Current ambr svc is always the first node of ambrLst.*/
1823 if (ueDl->ambrLst.first->node == (PTR)svc)
1825 if(ueDl->ambrSvc != svc)
1829 rgSCHSc1DlUeRmvFrmSchd(cell, ue);
1831 ueDl->ambrSvc = svc;
1832 ueDl->effAmbr = RGSCH_MIN(ueDl->ambr, svcSc1->bo);
1835 rgSCHSc1DlUeAddToSchd(cell, ue);
1845 * @brief This function updates the scheduler with service for a UE
1849 * Function: rgSCHSc1DlLcBoUpd
1850 * Purpose: This function should be called whenever there is a
1851 * change BO for a service.
1853 * Invoked by: BO and Scheduler
1855 * @param[in] RgSchCellCb* cell
1856 * @param[in] RgSchUeCb* ue
1857 * @param[in] RgSchDlLcCb* svc
1862 PUBLIC Void rgSCHSc1DlLcBoUpd
1869 PUBLIC Void rgSCHSc1DlLcBoUpd(cell, ue, svc)
1875 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1876 TRC2(rgSCHSc1DlLcBoUpd);
1878 if (svcSc1->bo == svc->bo)
1882 svcSc1->bo = svc->bo;
1883 if (!RG_SCH_CMN_DL_IS_UE_ACTIVE(ue))
1887 rgSCHSc1DlMngSvcPosn(cell, ue, svc);
1889 /* Stack Crash problem for TRACE5 changes. Added the return below */
1896 * @brief This function updates the scheduler with Prio0 service for a UE
1900 * Function: rgSCHSc1DlMngPrio0SvcPosn
1901 * Purpose: This func shall be triggered whenever there is a
1902 * change in the "Bo yet to be satisfied" field of the service.
1903 * Appropriately positions the svc in its prio Q.
1904 * Removes the SVC from the Q if BO is completely satisfied.
1906 * Invoked by: BO and Scheduler
1908 * @param[in] RgSchCellCb* cell
1909 * @param[in] RgSchUeCb* ue
1910 * @param[in] RgSchDlLcCb* svc
1915 PRIVATE Void rgSCHSc1DlMngPrio0SvcPosn
1922 PRIVATE Void rgSCHSc1DlMngPrio0SvcPosn(cell, ue, svc)
1928 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1929 TRC2(rgSCHSc1DlMngPrio0SvcPosn);
1931 /* In this priority, we just add or remove to the queue */
1934 rgSCHSc1DlSvcAddToSchd(cell, svc);
1938 rgSCHSc1DlSvcRmvFrmSchd(cell, svc);
1945 * @brief This function updates the scheduler with GBR service for a UE
1949 * Function: rgSCHSc1DlMngGbrSvcPosn
1950 * Purpose: This func shall be triggered whenever there is a
1951 * change in the "Bo yet to be satisfied" field of the service.
1952 * Appropriately positions the svc in its prio Q.
1953 * Removes the SVC from the Q if BO is completely satisfied.
1955 * Invoked by: BO and Scheduler
1957 * @param[in] RgSchCellCb* cell
1958 * @param[in] RgSchUeCb* ue
1959 * @param[in] RgSchDlLcCb* svc
1964 PRIVATE Void rgSCHSc1DlMngGbrSvcPosn
1971 PRIVATE Void rgSCHSc1DlMngGbrSvcPosn(cell, ue, svc)
1977 RgSchSc1DlSvc *svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
1978 TRC2(rgSCHSc1DlMngGbrSvcPosn);
1980 /* Handle a GBR service. */
1981 svcSc1->effGbr = RGSCH_MIN(svcSc1->bo, svcSc1->gbr);
1982 svcSc1->effMbr = RGSCH_MIN(svcSc1->bo, svcSc1->mbr);
1983 /* Adjust the SVC priority within the queue */
1984 rgSCHSc1DlSvcRmvFrmSchd(cell, svc);
1985 rgSCHSc1DlSvcAddToSchd(cell, svc);
1991 * @brief This function updates the scheduler with service for a UE
1995 * Function: rgSCHSc1DlMngSvcPosn
1996 * Purpose: This func shall be triggered whenever there is a
1997 * change in the "Bo yet to be satisfied" field of the service.
1998 * Appropriately positions the svc in its prio Q.
1999 * Removes the SVC from the Q if BO is completely satisfied.
2001 * Invoked by: BO and Scheduler
2003 * @param[in] RgSchCellCb* cell
2004 * @param[in] RgSchUeCb* ue
2005 * @param[in] RgSchDlLcCb* svc
2010 PRIVATE Void rgSCHSc1DlMngSvcPosn
2017 PRIVATE Void rgSCHSc1DlMngSvcPosn(cell, ue, svc)
2023 RgSchCmnDlSvc *svcCmn = RG_SCH_CMN_GET_DL_SVC(svc);
2024 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
2025 TRC2(rgSCHSc1DlMngSvcPosn);
2027 (cellDl->svcMngFunc[svcCmn->prio])(cell, ue, svc);
2031 /*--------------------------*
2032 * DL specific functions END
2033 *---------------------------*/
2038 * @brief Scheduler processing on cell configuration
2042 * Function : rgSCHSc1RgrDlCellCfg
2044 * This function does requisite initialisation
2045 * and setup for scheduler1 when a cell is
2048 * @param[in] RgSchCellCb *cell
2049 * @param[in] RgrCellCfg *cellCfg
2050 * @param[out] RgSchErrInfo *err
2056 PUBLIC S16 rgSCHSc1RgrDlCellCfg
2059 RgrCellCfg *cellCfg,
2063 PUBLIC S16 rgSCHSc1RgrDlCellCfg(cell, cellCfg, err)
2065 RgrCellCfg *cellCfg;
2070 RgSchSc1DlCell *cellDl;
2072 TRC2(rgSCHSc1RgrDlCellCfg);
2074 if((ret = rgSCHUtlAllocSBuf(cell->instIdx,
2075 (Data**)&(((RgSchCmnCell*)((cell)->sc.sch))->dl.schSpfc), \
2076 (sizeof(RgSchSc1DlCell)))) != ROK)
2078 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
2079 "Memory allocation FAILED");
2080 err->errCause = RGSCHERR_SCH_SC1_DL_CFG;
2084 cellDl = RG_GET_SC1_CELL_DL(cell);
2085 /* Now perform downlink Queues related initializations */
2086 rgSCHSc1DlInitQueues(cellDl);
2088 } /* rgSCHSc1RgrDlCellCfg */
2090 /***********************************************************
2092 * Func : rgSCHSc1DlDeinitQueues
2094 * Desc : De-initialise downlink scheduler queues
2102 **********************************************************/
2104 PRIVATE Void rgSCHSc1DlDeinitQueues
2106 RgSchSc1DlCell *cellDl
2109 PRIVATE Void rgSCHSc1DlDeinitQueues(cellDl)
2110 RgSchSc1DlCell *cellDl;
2114 TRC2(rgSCHSc1DlDeinitQueues);
2116 for (i = 0; i < RG_SC1_DL_NUM_Q; ++i)
2118 cmLListInit(&cellDl->prioLst[i]);
2119 cmLListInit(&cellDl->retxLst[i]);
2126 * @brief Scheduler processing for cell delete
2130 * Function : rgSCHSc1DlCellDel
2132 * This functions de-initialises and frees memory
2133 * taken up by scheduler1 for the entire cell.
2135 * @param[in] RgSchCellCb *cell
2139 PUBLIC Void rgSCHSc1DlCellDel
2144 PUBLIC Void rgSCHSc1DlCellDel(cell)
2148 TRC2(rgSCHSc1DlCellDel);
2150 if (((RgSchSc1DlCell *)((RgSchCmnCell*)((cell)->sc.sch))->dl.schSpfc) \
2156 /* Perform the deinit for the DL scheduler */
2157 rgSCHSc1DlDeinitQueues(RG_GET_SC1_CELL_DL(cell));
2158 /* ccpu00117052 - MOD - Passing double pointer
2159 for proper NULLP assignment*/
2160 rgSCHUtlFreeSBuf(cell->instIdx,
2161 (Data**)(&(((RgSchCmnCell*)((cell)->sc.sch))->dl.schSpfc)),
2162 (sizeof(RgSchSc1DlCell)));
2164 } /* rgSCHSc1DlCellDel */
2167 * @brief UE initialisation for scheduler
2171 * Function : rgSCHSc1RgrDlUeCfg
2173 * This functions intialises UE specific scheduler
2176 * @param[in] RgSchCellCb *cell
2177 * @param[in] RgSchUeCb *ue
2178 * @param[int] RgrUeCfg *ueCfg
2179 * @param[out] RgSchErrInfo *err
2185 PUBLIC S16 rgSCHSc1RgrDlUeCfg
2193 PUBLIC S16 rgSCHSc1RgrDlUeCfg(cell, ue, ueCfg, err)
2200 RgSchCmnUe *ueSchCmn = RG_SCH_CMN_GET_UE(ue, cell);
2201 Inst inst = cell->instIdx;
2204 TRC2(rgSCHSc1RgrDlUeCfg);
2206 if((rgSCHUtlAllocSBuf(inst,
2207 (Data**)&(ueSchCmn->dl.schSpfc), (sizeof(RgSchSc1DlUe))) != ROK))
2209 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "Memory allocation FAILED"
2210 "CRNTI:%d",ue->ueId);
2211 err->errCause = RGSCHERR_SCH_SC1_DL_CFG;
2214 ueDl = (RgSchSc1DlUe *)ueSchCmn->dl.schSpfc;
2215 if (ue->dl.ambrCfgd)
2217 ueDl->ambr = ue->dl.ambrCfgd;
2221 ueDl->ambr = RG_SC1_MAX_DL_AMBR;
2223 cmLListInit(&ueDl->lcsWithData);
2224 cmLListInit(&ueDl->gbrSvcs);
2225 cmLListInit(&ueDl->ambrLst);
2226 cmLListInit(&ueDl->schdSvcs);
2227 cmLListInit(&ueDl->retxHqProcs);
2229 } /* rgSCHSc1RgrDlUeCfg */
2233 * @brief Dl Harq Entity initialization for SC1
2237 * Function : rgSCHSc1DlUeHqEntInit
2240 * - Create SC1 related information per Harq Entity
2242 * @param[in] RgrSchCellCb *cell
2243 * @param[in] RgSchUeCb *ue
2249 PUBLIC S16 rgSCHSc1DlUeHqEntInit
2255 PUBLIC S16 rgSCHSc1DlUeHqEntInit(cell, hqEnt)
2260 RgSchSc1DlHqProc *hqSpcSch;
2261 RgSchDlHqProcCb *hqP;
2263 TRC2(rgSCHSc1DlUeHqEntInit);
2264 /* making use of hqE->sch for one shot allocation
2265 * of RgSchSc1DlHqProc structures */
2266 if (rgSCHUtlAllocSBuf(cell->instIdx,
2267 (Data**)&(hqEnt->sch),
2268 (hqEnt->numHqPrcs * sizeof(RgSchSc1DlHqProc))) != ROK)
2270 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
2271 "Memory allocation FAILED CRNTI:%d",hqEnt->ue->ueId);
2274 hqSpcSch = (RgSchSc1DlHqProc *)(hqEnt->sch);
2275 for(cnt = 0; cnt < hqEnt->numHqPrcs; cnt++)
2277 hqP = &hqEnt->procs[cnt];
2278 ((RgSchCmnDlHqProc *)((hqP)->sch))->schSpfc = \
2285 * @brief Dl Harq Entity deletion for Sc1
2289 * Function : rgSCHSc1DlUeHqEntDeInit
2292 * - Free SC1 related information per Harq Entity
2294 * @param[in] RgrSchCellCb *cell
2295 * @param[in] RgSchDlHqEnt *hqE
2299 PUBLIC S16 rgSCHSc1DlUeHqEntDeInit
2305 PUBLIC S16 rgSCHSc1DlUeHqEntDeInit(cell, hqE)
2310 TRC2(rgSCHSc1DlUeHqEntDeInit);
2314 rgSCHUtlFreeSBuf(cell->instIdx,
2315 (Data**)(&(hqE->sch)),
2316 (hqE->numHqPrcs * sizeof(RgSchSc1DlHqProc)));
2325 * @brief UE reconfiguration for scheduler
2329 * Function : rgSCHSc1RgrDlUeRecfg
2331 * This functions updates UE specific scheduler
2332 * information upon UE reconfiguration
2334 * @param[in] RgSchCellCb *cell
2335 * @param[in] RgSchUeCb *ue
2336 * @param[int] RgrUeRecfg *ueRecfg
2337 * @param[out] RgSchErrInfo *err
2343 PUBLIC S16 rgSCHSc1RgrDlUeRecfg
2347 RgrUeRecfg *ueRecfg,
2351 PUBLIC S16 rgSCHSc1RgrDlUeRecfg(cell, ue, ueRecfg, err)
2354 RgrUeRecfg *ueRecfg;
2358 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
2359 RgSchCmnDlUe *ueCmnDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
2360 /*cell added as part of CA dev*/
2361 RgSchDlHqEnt *hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
2362 TRC2(rgSCHSc1RgrDlUeRecfg);
2364 if (ue->dl.ambrCfgd)
2366 ueDl->ambr = ue->dl.ambrCfgd;
2370 ueDl->ambr = RG_SC1_MAX_DL_AMBR;
2373 /* Discarding TB2's context from scheduling Queues.
2374 * Since TB2 transmission needs signalling using
2375 * TM specific formats. And since during this transient
2376 * period of UE TM Recfg, SCH always uses Format 1A,
2377 * the TB2s are discarded. */
2378 if (ueCmnDl->mimoInfo.forceTD & RG_SCH_CMN_TD_TXMODE_RECFG)
2380 /* If HqP is in retx queue only for TB2 retx scheduling
2381 * then remove the harp proc from retx Queue */
2383 /* If Hqp is in retx queue for retx allocation of
2384 * both TB1 and TB2, then reset TB2's state as ACKED */
2385 RgSchDlHqProcCb *hqP;
2387 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
2390 /* Prepare TB2 release information to be sent to MAC */
2391 rlsHqBufs->numUes = 0;
2392 for(i = 0; i < hqEnt->numHqPrcs; i++)
2394 hqP = &hqEnt->procs[i];
2395 rlsHqBufs->ueHqInfo[rlsHqBufs->numUes].rnti = ue->ueId;
2396 rlsHqBufs->ueHqInfo[rlsHqBufs->numUes].hqProcId = hqP->procId;
2397 if (hqP->tbInfo[1].state == HQ_TB_NACKED)
2399 if (hqP->tbInfo[0].state != HQ_TB_NACKED)
2401 /* Remove the HqP from retx Queue.
2403 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
2404 rgSCHSc1DlProcRmvFrmUeRetx(cell, ue, hqP);
2406 rgSCHDhmRlsHqpTb(hqP, 1, TRUE);
2407 rlsHqBufs->ueHqInfo[rlsHqBufs->numUes].tbId[0] = 2;
2408 rlsHqBufs->ueHqInfo[rlsHqBufs->numUes].numOfTBs = 1;
2410 rlsHqBufs->numUes++;
2412 /* Send the hqProc list for MAC to clear TB1 contents */
2413 if (rlsHqBufs->numUes)
2415 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], cell->macInst);
2416 RgSchMacRlsHq (&pst, rlsHqBufs);
2420 } /* rgSCHSc1RgrDlUeRecfg */
2423 * @brief Removes UEs context from Priority Qs.
2427 * Function : rgSCHSc1DlRmvUeFrmPrioQs
2430 * @param[in] RgSchCellCb *cell
2431 * @param[in] RgSchUeCb *ue
2435 PRIVATE Void rgSCHSc1DlRmvUeFrmPrioQs
2441 PRIVATE Void rgSCHSc1DlRmvUeFrmPrioQs(cell, ue)
2446 RgSchSc1DlUe *sc1Ue;
2450 TRC2(rgSCHSc1DlRmvUeFrmPrioQs);
2452 sc1Ue = RG_GET_SC1_UE_DL(ue, cell);
2454 /* Remove UE From DL priority queues */
2455 if (sc1Ue->ambrSvc != NULLP)
2457 rgSCHSc1DlUeRmvFrmSchd(cell, ue);
2460 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; ++idx)
2462 svc = ue->dl.lcCb[idx];
2467 rgSCHSc1DlSvcRmvFrmSchd(cell, svc);
2471 } /* rgSCHSc1DlRmvUeFrmPrioQs */
2474 * @brief Inactivate UE reason : measgap, acknaprept, poInactv.
2478 * Function : rgSCHSc1DlInactvtUe
2481 * @param[in] RgSchCellCb *cell
2482 * @param[in] RgSchUeCb *ue
2486 PRIVATE Void rgSCHSc1DlInactvtUe
2492 PRIVATE Void rgSCHSc1DlInactvtUe(cell, ue)
2497 RgSchSc1DlCell *cellDl = RG_GET_SC1_CELL_DL(cell);
2498 RgSchDlHqProcCb *hqP;
2499 RgSchCmnDlHqProc *hqProcDl;
2501 RgSchDlHqEnt *hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
2503 TRC2(rgSCHSc1DlInactvtUe);
2505 /* ccpu00130170: UE related HARQ Procs are cleared only
2506 if UE's Re-establishment procedure is not in progress*/
2507 if(!(ue->dl.dlInactvMask & RG_HQENT_INACTIVE))
2509 /* remove all in use HARQ processes from the subframes.
2510 * Store them in UEs hqProc Lst. Add back to cell's
2511 * retx lst when UE is activated again. */
2512 for(i = 0; i < hqEnt->numHqPrcs; i++)
2514 hqP = &hqEnt->procs[i];
2515 hqProcDl = RG_SCH_CMN_GET_DL_HQP(hqP);
2516 /* Remove retx procs from cell's list and
2517 * add them to UE's List */
2520 !(RG_SCH_CMN_SPS_DL_IS_SPS_HQP(hqP)) &&
2522 hqProcDl->retxLnk.node != NULLP)
2524 cmLListDelFrm(&cellDl->retxLst[((RgSchSc1DlHqProc *)\
2525 (hqProcDl->schSpfc))->prio], &(hqProcDl->retxLnk));
2526 hqProcDl->retxLnk.node = NULLP;
2527 rgSCHSc1DlProcAddToUeRetx(cell, ue, hqP);
2532 rgSCHSc1DlRmvUeFrmPrioQs(cell, ue);
2535 } /* rgSCHSc1DlInactvtUe */
2539 * @brief UE suspension.
2543 * Function : rgSCHSc1DlSuspendUe
2545 * Removes UE, its SVCs and its HqPs from CELL WIDE
2546 * PrioQs and Retx Qs Respectively.
2548 * @param[in] RgSchCellCb *cell
2549 * @param[in] RgSchUeCb *ue
2553 PRIVATE Void rgSCHSc1DlSuspendUe
2559 PRIVATE Void rgSCHSc1DlSuspendUe(cell, ue)
2564 RgSchDlHqProcCb *hqP;
2567 RgSchDlHqEnt *hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
2569 TRC2(rgSCHSc1DlSuspendUe);
2571 /* remove all in use HARQ processes from the subframes.
2572 * Store them in UEs hqProc Lst. Add back to cell's
2573 * retx lst when UE is activated again. */
2574 for(i = 0; i < hqEnt->numHqPrcs; i++)
2576 hqP = &hqEnt->procs[i];
2577 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
2578 rgSCHSc1DlProcRmvFrmUeRetx(cell, ue, hqP);
2579 /* Removing the Harq Proc from subframes list */
2580 if (hqP->hqPSfLnk.node != NULLP)
2584 cmLListDelFrm(&hqP->subFrm->pdcchInfo.pdcchs,
2586 cmLListAdd2Tail(&cell->pdcchLst, &hqP->pdcch->lnk);
2590 rgSCHUtlDlHqPTbRmvFrmTx(hqP->subFrm,hqP,0,FALSE);
2592 for (j = 0; j < 2; j++)
2594 if (hqP->tbInfo[j].state == HQ_TB_WAITING)
2596 rgSCHDhmRlsHqpTb(hqP, j, TRUE);
2601 rgSCHSc1DlRmvUeFrmPrioQs(cell, ue);
2604 } /* rgSCHSc1DlSuspendUe */
2606 /***********************************************************
2608 * Func : rgSCHSc1DlScanUpdPdbPrio
2610 * Desc : Increment the pivot and reposition the LCs under the pivot to
2611 * new location according to thieir PDB and elapsed time.
2619 **********************************************************/
2621 PUBLIC Void rgSCHSc1DlScanUpdPdbPrio
2626 PUBLIC Void rgSCHSc1DlScanUpdPdbPrio (cell)
2630 TRC2(rgSCHSc1DlScanUpdPdbPrio);
2636 * @brief Function to update Flow control information
2637 * to be sent to MAC.
2641 * Function: rgSCHSc1DlFillFlowCntrlInfo
2643 * update Flow control information
2650 * @param[in] RgSchCellCb *cell
2651 RgInfSfAlloc *sfAlloc;
2656 PUBLIC S16 rgSCHSc1DlFillFlowCntrlInfo
2659 RgInfSfAlloc *sfAlloc
2662 PUBLIC S16 rgSCHSc1DlFillFlowCntrlInfo(cell,sfAlloc)
2664 RgInfSfAlloc *sfAlloc;
2667 TRC2(rgSCHSc1DlFillFlowCntrlInfo);
2671 * @brief UE deletion for scheduler
2675 * Function : rgSCHSc1DlUeDel
2677 * This functions deletes all scheduler information
2678 * pertaining to a UE
2680 * @param[in] RgSchCellCb *cell
2681 * @param[in] RgSchUeCb *ue
2685 PUBLIC Void rgSCHSc1DlUeDel
2691 PUBLIC Void rgSCHSc1DlUeDel(cell, ue)
2696 RgSchDlHqEnt *hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
2697 RgSchSc1DlUe *sc1DlUe = RG_GET_SC1_UE_DL(ue, cell);
2699 TRC2(rgSCHSc1DlUeDel);
2701 if (sc1DlUe == NULLP)
2707 /* Remove UEs scheduler context */
2708 rgSCHSc1DlSuspendUe(cell, ue);
2710 /* Free all SC1 specific control blocks */
2711 if (hqEnt->sch != NULLP)
2713 /* ccpu00117052 - MOD - Passing double pointer
2714 for proper NULLP assignment*/
2715 rgSCHUtlFreeSBuf(cell->instIdx,
2716 (Data**)(&(hqEnt->sch)),
2717 (hqEnt->numHqPrcs * sizeof(RgSchSc1DlHqProc)));
2721 /* ccpu00117052 - MOD - Passing double pointer
2722 for proper NULLP assignment*/
2723 rgSCHUtlFreeSBuf(cell->instIdx, (Data**)(&sc1DlUe), (sizeof(RgSchSc1DlUe)));
2726 } /* rgSCHSc1DlUeDel */
2729 * @brief Scheduler invocation on Downlink logical channel addition
2733 * Function : rgSCHSc1RgrLcCfg
2735 * This functions does required processing when a new
2736 * (dedicated) logical channel is added.
2738 * @param[in] RgSchCellCb *cell
2739 * @param[in] RgSchUeCb *ue
2740 * @param[in] RgSchDlLcCb *dlLc
2741 * @param[int] RgrLchCfg *lcCfg
2742 * @param[out] RgSchErrInfo *err
2748 PUBLIC S16 rgSCHSc1RgrLcCfg
2757 PUBLIC S16 rgSCHSc1RgrLcCfg(cell, ue, dlLc, lcCfg, err)
2766 TRC2(rgSCHSc1RgrLcCfg);
2768 ret = rgSCHUtlAllocSBuf(cell->instIdx,
2769 (Data**)&(RG_SCH_CMN_GET_LC_SCH_SPFC(ue,dlLc,cell)), \
2770 (sizeof(RgSchSc1DlSvc)));
2773 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId, "rgSCHSc1CrgLcCfg():"
2774 "SCH struct alloc failed CRNTI:%d LCID:%d",ue->ueId,lcCfg->lcId);
2775 err->errCause = RGSCHERR_SCH_SC1_DL_CFG;
2779 rgSCHSc1DlSvcAdd(cell, ue, dlLc, &lcCfg->dlInfo);
2781 } /* rgSCHSc1RgrLcCfg */
2785 * @brief Scheduler invocation on logical channel addition
2789 * Function : rgSCHSc1RgrLcRecfg
2791 * This functions does required processing when an existing
2792 * (dedicated) logical channel is reconfigured. Assumes lcg
2793 * pointer in ulLc is set to the old value.
2794 * Independent of whether new LCG is meant to be configured,
2795 * the new LCG scheduler info is accessed and possibly modified.
2797 * @param[in] RgSchCellCb *cell
2798 * @param[in] RgSchUeCb *ue
2799 * @param[in] RgSchDlLcCb *dlLc
2800 * @param[int] RgrLchRecfg *lcRecfg
2801 * @param[out] RgSchErrInfo *err
2807 PUBLIC S16 rgSCHSc1RgrLcRecfg
2812 RgrLchRecfg *lcRecfg,
2816 PUBLIC S16 rgSCHSc1RgrLcRecfg(cell, ue, dlLc, lcRecfg, err)
2820 RgrLchRecfg *lcRecfg;
2824 TRC2(rgSCHSc1RgrLcRecfg);
2828 rgSCHSc1DlSvcMod(cell,ue,dlLc, lcRecfg);
2831 } /* rgSCHSc1RgrLcRecfg */
2835 * @brief This function handles the reconfiguration of cell
2839 * Function: rgSCHSc1RgrDlCellRecfg
2840 * Purpose: Update the reconfiguration parameters.
2842 * Invoked by: Scheduler
2844 * @param[in] RgSchCellCb* cell
2849 PRIVATE S16 rgSCHSc1RgrDlCellRecfg
2852 RgrCellRecfg *recfg,
2856 PRIVATE S16 rgSCHSc1RgrDlCellRecfg(cell, recfg, err)
2858 RgrCellRecfg *recfg;
2862 TRC2(rgSCHSc1DlUeReset);
2869 * @brief This function implements scheduler DL allocation
2873 * Function: rgSCHSc1DlTaCmd
2874 * Purpose: This function implements scheduler for TA cmd alloc for
2875 * UEs. The hq proc availed as part of this alloc can be used
2876 * by the UEs Dedicated CH transmission allocation.
2878 * Invoked by: Scheduler
2880 * @param[in] RgSchCellCb* cell
2881 * @param[out] RgSchCmnDlRbAllocInfo *allocInfo
2886 PRIVATE Void rgSCHSc1DlTaCmd
2889 RgSchCmnDlRbAllocInfo *allocInfo
2892 PRIVATE Void rgSCHSc1DlTaCmd(cell, allocInfo)
2894 RgSchCmnDlRbAllocInfo *allocInfo;
2899 RgSchDlHqProcCb *proc;
2902 RgSchCmnDlCell *cellCmnDl = RG_SCH_CMN_GET_DL_CELL(cell);
2903 RgSchCmnDlUe *cmnUeDl;
2905 RgSchCmnDlHqProc *cmnHqDl;
2906 RgSchDlSf *subFrm = allocInfo->dedAlloc.dedDlSf;
2908 Bool dlAllowed = FALSE;
2910 TRC2(rgSCHSc1DlTaCmd);
2912 lst = &cellCmnDl->taLst;
2916 ue = (RgSchUeCb *)node->node;
2921 rgSCHCmnHdFddChkDlAllow ( cell, ue, &dlAllowed);
2922 if (dlAllowed == FALSE)
2928 /* If Ue is inactive in DL then ignore */
2929 if (ue->dl.dlInactvMask)
2933 cmnUeDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
2934 /*cell added as part of CA dev*/
2935 ueDl = RG_GET_SC1_UE_DL(ue, cell);
2937 if (rgSCHDhmGetAvlHqProc(cell, ue, cellCmnDl->time, &proc) != ROK)
2941 /* Initialize some of the parameters of the HQ proc */
2942 cmnHqDl = RG_SCH_CMN_GET_DL_HQP(proc);
2946 cmnHqDl->totBytes = 0;
2947 rgSCHCmnDlAllocTxRb(cell, subFrm, ue, RGSCH_TA_SIZE, &effBo, proc, allocInfo);
2950 /* If no allocations so far, meaning proc obtained now */
2951 if (cmnHqDl->totBytes == 0)
2953 rgSCHSc1RlsHqProc(proc);
2954 /* Added the handling for removing
2955 * UE from txHqPLst and resetting outStndalloc.*/
2956 if(proc->reqLnk.node != (PTR)NULLP)
2958 cmLListDelFrm(&allocInfo->dedAlloc.txHqPLst, &proc->reqLnk);
2959 proc->reqLnk.node = (PTR)NULLP;
2961 /*Re-set the outstanding alloc information.*/
2962 cmnUeDl->outStndAlloc = 0;
2964 /* Avl BW could not satisfy even TA so break */
2967 ueDl->taReqBytes = RGSCH_TA_SIZE;
2968 cmnUeDl->proc = proc;
2969 cmnHqDl->totBytes += effBo;
2970 /* 3.1 MIMO moving this call to cmn scheduler */
2971 /*rgSCHCmnDlRbInfoAddUeTx(allocInfo, ue);*/
2977 * @brief Scheduler invocation
2981 * Function: rgSCHSc1DlHndlInActUes
2982 * Purpose: The list of inactive UEs present in inactvLst should
2983 * be removed from the scheduling Qs.
2985 * Invoked by: Common Scheduler (TTI processing)
2987 * @param[in] RgSchCellCb *cell
2988 * @param[out] CmLListCp *inactvLst
2992 PUBLIC Void rgSCHSc1DlHndlInActUes
2995 CmLListCp *inactvLst
2998 PUBLIC Void rgSCHSc1DlHndlInActUes(cell, inactvLst)
3000 CmLListCp *inactvLst;
3006 TRC2(rgSCHSc1DlHndlInActUes);
3008 node = inactvLst->first;
3011 ue = (RgSchUeCb *)node->node;
3013 /* Suspend this UE from further scheduling
3014 * till it is activated again. */
3015 rgSCHSc1DlInactvtUe(cell, ue);
3021 * @brief This function initializes all the data for the scheduler
3025 * Function: rgSCHSc1DlInit
3026 * Purpose: This function initializes the following information
3027 * 1. Efficiency table
3028 * 2. CQI to table index - It is one row for upto 3 RBs
3029 * and another row for greater than 3 RBs
3031 * currently extended prefix is compiled out.
3032 * Invoked by: MAC intialization code..may be ActvInit
3038 PUBLIC Void rgSCHSc1DlInit
3040 RgDlSchdApis *rgSchDlApis
3043 PUBLIC Void rgSCHSc1DlInit(rgSchDlApis)
3044 RgDlSchdApis *rgSchDlApis;
3047 TRC2(rgSCHSc1DlInit);
3048 /* Init the function pointers */
3049 rgSchDlApis->rgSCHRgrDlUeCfg = rgSCHSc1RgrDlUeCfg;
3050 rgSchDlApis->rgSCHRgrDlUeRecfg = rgSCHSc1RgrDlUeRecfg;
3051 rgSchDlApis->rgSCHFreeDlUe = rgSCHSc1DlUeDel;
3052 rgSchDlApis->rgSCHRgrDlCellCfg = rgSCHSc1RgrDlCellCfg;
3053 rgSchDlApis->rgSCHRgrDlCellRecfg = rgSCHSc1RgrDlCellRecfg;
3054 rgSchDlApis->rgSCHFreeDlCell = rgSCHSc1DlCellDel;
3055 rgSchDlApis->rgSCHRgrDlLcCfg = rgSCHSc1RgrLcCfg;
3056 rgSchDlApis->rgSCHRgrDlLcRecfg = rgSCHSc1RgrLcRecfg;
3057 rgSchDlApis->rgSCHFreeDlLc = rgSCHSc1DlLcRmv;
3058 rgSchDlApis->rgSCHDlNewSched = rgSCHSc1DlDedNewTx;
3059 rgSchDlApis->rgSCHDlPreSched = rgSCHSc1DlPreSchd;
3060 rgSchDlApis->rgSCHDlPstSched = rgSCHSc1DlPstSchd;
3061 rgSchDlApis->rgSCHDlRetxSched = rgSCHSc1DlDedRetx;
3062 rgSchDlApis->rgSCHDlCeSched = rgSCHSc1DlTaCmd;
3063 rgSchDlApis->rgSCHDlDedBoUpd = rgSCHSc1DlLcBoUpd;
3064 rgSchDlApis->rgSCHDlProcAddToRetx = rgSCHSc1DlProcAddToCellRetx;
3065 rgSchDlApis->rgSCHDlAllocFnlz = rgSCHSc1DlAllocFnlz;
3066 rgSchDlApis->rgSCHDlCqiInd = rgSCHSc1DlCqiInd;
3067 rgSchDlApis->rgSCHDlUeRefresh = rgSCHSc1DlUeRefresh;
3068 rgSchDlApis->rgSCHDlUeReset = rgSCHSc1DlUeReset;
3069 rgSchDlApis->rgSCHDlActvtUe = rgSCHSc1DlActvtUe;
3070 rgSchDlApis->rgSCHDlInactvtUes = rgSCHSc1DlHndlInActUes;
3071 rgSchDlApis->rgSCHDlUeHqEntInit = rgSCHSc1DlUeHqEntInit;
3072 rgSchDlApis->rgSCHDlUeHqEntDeInit = rgSCHSc1DlUeHqEntDeInit;
3073 rgSchDlApis->rgSCHDlProcRmvFrmRetx = rgSCHSc1DlProcRmvFrmRetx;
3074 rgSchDlApis->rgSCHDlTickForPdbTrkng = rgSCHSc1DlScanUpdPdbPrio;
3075 rgSchDlApis->rgSCHDlFillFlwCtrlInfo = rgSCHSc1DlFillFlowCntrlInfo;
3083 /***********************************************************
3085 * Func : rgSCHSc1DlInitQueues
3087 * Desc : Initial downlink scheduler queues
3095 **********************************************************/
3097 PRIVATE Void rgSCHSc1DlInitQueues
3099 RgSchSc1DlCell *cellDl
3102 PRIVATE Void rgSCHSc1DlInitQueues(cellDl)
3103 RgSchSc1DlCell *cellDl;
3107 TRC2(rgSCHSc1DlInitQueues);
3109 for (i = 0; i < RG_SC1_DL_NUM_Q; ++i)
3111 cmLListInit(&cellDl->prioLst[i]);
3112 cmLListInit(&cellDl->retxLst[i]);
3114 /* Set appropriate "manage svc positioning" function based on
3115 * svc priority as array index */
3117 for (i = 0; i < RG_SCH_SC1_DL_GBR_PRIO_START; i++)
3119 cellDl->svcMngFunc[i] = rgSCHSc1DlMngPrio0SvcPosn;
3122 for (i = RG_SCH_SC1_DL_GBR_PRIO_START; i <= RG_SCH_SC1_DL_GBR_PRIO_END; i++)
3124 cellDl->svcMngFunc[i] = rgSCHSc1DlMngGbrSvcPosn;
3126 /* for Non-GBR svcs */
3127 for (i = RG_SCH_SC1_DL_GBR_PRIO_END+1; i <= RG_SCH_CMN_MAX_PRIO; i++)
3129 cellDl->svcMngFunc[i] = rgSCHSc1DlMngAmbrSvcPosn;
3138 * @brief This function Processes the Final Allocations
3139 * made by the RB Allocator against the requested
3144 * Function: rgSCHSc1DlRetxAllocFnlz
3145 * Purpose : Remove the Retx Hq Proc from the Cell's
3146 * Retx list, if allocation is successful.
3147 * Fill the HqProc and PDCCH and append it to the SubFrm.
3151 * Invoked by: Common Scheduler
3153 * @param[in] RgSchCellCb *cell
3154 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
3159 PRIVATE Void rgSCHSc1DlRetxAllocFnlz
3162 RgSchCmnDlRbAllocInfo *allocInfo
3165 PRIVATE Void rgSCHSc1DlRetxAllocFnlz(cell, allocInfo)
3167 RgSchCmnDlRbAllocInfo *allocInfo;
3172 RgSchDlHqProcCb *hqP;
3173 RgSchDlRbAlloc *dlAllocCb = NULLP;
3174 TRC2(rgSCHSc1DlRetxAllocFnlz);
3176 node = allocInfo->dedAlloc.schdRetxHqPLst.first;
3179 hqP = (RgSchDlHqProcCb *)node->node;
3182 /* Fill PDCCH and assign it to HqP */
3183 dlAllocCb = RG_SCH_CMN_GET_ALLOCCB_FRM_UE(ue, cell);
3185 rgSCHCmnFillHqPPdcch(cell, dlAllocCb, hqP);
3189 rgSCHCmnHdFddUpdDLMark(cell, ue);
3192 /* Extra Check: Retain the hqProc in the RETX Queue if one/more
3193 * TBs of the HqProc are yet to be scheduled for RETX.
3194 * Note: Here we are not tracking at TB Level, the priority Q
3195 * to which it belongs to. The retx prio of transmission is still
3196 * being maintained at hqProc level, rather than at TB level */
3197 if ((hqP->tbInfo[0].state != HQ_TB_NACKED) &&
3198 (hqP->tbInfo[1].state != HQ_TB_NACKED)) {
3199 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
3201 /* reset the UE allocation Information */
3202 rgSCHCmnDlUeResetTemp(ue, hqP);
3205 /* Traverse the nonSchdTxUeLst and reset the UE allocation Info */
3206 node = allocInfo->dedAlloc.nonSchdRetxHqPLst.first;
3209 hqP = (RgSchDlHqProcCb *)node->node;
3212 /* reset the UE allocation Information */
3213 rgSCHCmnDlUeResetTemp(ue, hqP);
3218 /* 3.1 MIMO Alloc distribution functions being performed
3222 /***********************************************************
3224 * Func : rgSCHSc1DlSprTxTbDstn
3226 * Desc : Perform Actual allocation distribution among
3227 * UEs schd svcs and TA for a given spare TB "tbInfo" allocation.
3228 * spare TB allocation is as a result of 1 RETX TB allocation, when
3229 * conditions are favourable for 2 TB spatial multiplexing.
3237 **********************************************************/
3239 PRIVATE Void rgSCHSc1DlSprTxTbDstn
3243 RgSchDlHqTbCb *tbInfo,
3248 PRIVATE Void rgSCHSc1DlSprTxTbDstn(cell, ue, tbInfo, effAlloc, node)
3251 RgSchDlHqTbCb *tbInfo;
3257 RgSchSc1DlSvc *svcSc1;
3258 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
3260 RgSchLchAllocInfo lchSchdData;
3264 TRC2(rgSCHSc1DlSprTxTbDstn);
3266 while((*node) && (*effAlloc > 0))
3268 svc = (RgSchDlLcCb *)(*node)->node;
3269 *node = (*node)->next;
3270 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
3272 RG_SCH_CMN_DL_GET_HDR_EST(svc, rlcHdrEstmt);
3273 /* Update the SVC QOS Param */
3274 if (RG_SCH_CMN_SVC_IS_GBR(svc))
3276 effBo = svcSc1->effMbr + rlcHdrEstmt;
3277 bytes = RGSCH_MIN(*effAlloc, effBo);
3278 /* Determine How much BO is satisfied */
3279 if (bytes <= rlcHdrEstmt)
3283 (svcSc1->bo <= bytes-rlcHdrEstmt)?\
3285 (svcSc1->bo -= bytes-rlcHdrEstmt);
3286 svc->bo = svcSc1->bo;
3290 /* Increment qciActiveLCs once since this LCs buffer will be present
3292 if (svc->lcType == CM_LTE_LCH_DTCH)
3294 ue->qciActiveLCs[svc->qciCb->qci]++;
3297 if ((svc->bo == 0) && (svc->lcType == CM_LTE_LCH_DTCH))
3299 if (ue->qciActiveLCs[svc->qciCb->qci])
3301 ue->qciActiveLCs[svc->qciCb->qci]--;
3303 if (!(ue->qciActiveLCs[svc->qciCb->qci]))
3305 svc->qciCb->dlUeCount--;
3309 (svcSc1->gbr <= bytes)? (svcSc1->gbr = 0):
3310 (svcSc1->gbr -= bytes);
3311 (svcSc1->mbr <= bytes)? (svcSc1->mbr = 0):
3312 (svcSc1->mbr -= bytes);
3314 else if(RG_SCH_CMN_SVC_IS_AMBR(svc))
3316 effBo = ueDl->effAmbr + rlcHdrEstmt;
3317 bytes = RGSCH_MIN(*effAlloc, effBo);
3318 /* Determine How much BO is satisfied */
3319 if (bytes <= rlcHdrEstmt)
3323 (svcSc1->bo <= bytes-rlcHdrEstmt)?\
3325 (svcSc1->bo -= bytes-rlcHdrEstmt);
3327 (ueDl->ambr <= bytes)? (ueDl->ambr = 0):
3328 (ueDl->ambr -= bytes);
3330 else /* Prio 0 SVC */
3332 effBo = svcSc1->bo + rlcHdrEstmt;
3333 bytes = RGSCH_MIN(*effAlloc, effBo);
3334 /* Determine How much BO is satisfied */
3335 if (bytes <= rlcHdrEstmt)
3339 (svcSc1->bo <= bytes-rlcHdrEstmt)?\
3341 (svcSc1->bo -= bytes-rlcHdrEstmt);
3343 /* Position the service accordingly */
3344 rgSCHSc1DlMngSvcPosn(cell, svc->ue, svc);
3345 /* Update effAlloc */
3348 /* Update DHM for this SVC */
3349 lchSchdData.lcId = svc->lcId;
3350 lchSchdData.schdData = bytes;
3351 rgSCHDhmAddLcData(cell->instIdx, &lchSchdData, tbInfo);
3357 /***********************************************************
3359 * Func : rgSCHSc1DlNewTxTbDstn
3361 * Desc : Perform Actual allocation distribution among
3362 * UEs schd svcs and TA for a given TB "tbInfo" allocation.
3363 * Assumption: TA is given higher priority in Alloc Distribution.
3371 **********************************************************/
3373 PRIVATE Void rgSCHSc1DlNewTxTbDstn
3377 RgSchDlHqTbCb *tbInfo,
3382 PRIVATE Void rgSCHSc1DlNewTxTbDstn(cell, ue, tbInfo, effAlloc, node)
3385 RgSchDlHqTbCb *tbInfo;
3391 RgSchSc1DlSvc *svcSc1 = NULLP;
3392 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
3394 RgSchLchAllocInfo lchSchdData;
3395 CmLList *prev = NULLP;
3397 TRC2(rgSCHSc1DlNewTxTbDstn);
3399 if (ueDl->taReqBytes)
3401 if (ueDl->taReqBytes < *effAlloc)
3403 /*TA satisfied, hence remove from TA Lst */
3404 rgSCHCmnRmvFrmTaLst(cell, ue);
3405 /* Indicate to DHM that TA has been scheduled */
3406 rgSCHDhmSchdTa(ue, tbInfo);
3407 *effAlloc -= ueDl->taReqBytes;
3409 /* Reset the TA Req Bytes Field */
3410 ueDl->taReqBytes = 0;
3412 while((*node) && (*effAlloc > 0))
3414 svc = (RgSchDlLcCb *)(*node)->node;
3416 *node = (*node)->next;
3417 svcSc1 = RG_GET_SC1_SVC_DL(ue,svc,cell);
3418 if (*effAlloc > svcSc1->reqBytes)
3420 bytes = svcSc1->reqBytes;
3421 if (bytes <= svcSc1->hdrEstimate)
3425 /* 3.1 MIMO updating the reqBytes field */
3426 svcSc1->reqBytes = 0;
3432 if (bytes <= svcSc1->hdrEstimate)
3436 /* 3.1 MIMO updating the reqBytes field */
3437 svcSc1->reqBytes -= bytes;
3438 (svcSc1->bo <= bytes-svcSc1->hdrEstimate)?\
3440 (svcSc1->bo -= bytes-svcSc1->hdrEstimate);
3442 svc->bo = svcSc1->bo;
3447 /* Increment qciActiveLCs once since this LCs buffer will be present
3449 if (svc->lcType == CM_LTE_LCH_DTCH)
3451 ue->qciActiveLCs[svc->qciCb->qci]++;
3454 if ((svc->bo == 0) && (svc->lcType == CM_LTE_LCH_DTCH))
3456 if (ue->qciActiveLCs[svc->qciCb->qci])
3458 ue->qciActiveLCs[svc->qciCb->qci]--;
3460 if (!(ue->qciActiveLCs[svc->qciCb->qci]))
3462 svc->qciCb->dlUeCount--;
3467 /* Update the SVC QOS Param */
3468 if (RG_SCH_CMN_SVC_IS_GBR(svc))
3470 (svcSc1->gbr <= bytes)? (svcSc1->gbr = 0):
3471 (svcSc1->gbr -= bytes);
3472 (svcSc1->mbr <= bytes)? (svcSc1->mbr = 0):
3473 (svcSc1->mbr -= bytes);
3475 else if(RG_SCH_CMN_SVC_IS_AMBR(svc))
3477 (ueDl->ambr <= bytes)? (ueDl->ambr = 0):
3478 (ueDl->ambr -= bytes);
3480 /* Position the service accordingly */
3481 rgSCHSc1DlMngSvcPosn(cell, svc->ue, svc);
3482 /* Update effAlloc */
3485 /* Update DHM for this SVC */
3486 lchSchdData.lcId = svc->lcId;
3487 lchSchdData.schdData = bytes;
3488 rgSCHDhmAddLcData(cell->instIdx, &lchSchdData, tbInfo);
3490 /* If no more scheduled LCs for TB data distribution
3491 * then distribute the spare TB data among the LCs
3492 * of the UE with non-zero BO. This is effective for
3493 * schedulers work on LC level priorities rather than
3495 if ((*node == NULLP) && (svcSc1) && (svcSc1->reqBytes == 0))
3497 rgSCHSc1DlSprTxTbDstn(cell, ue, tbInfo, effAlloc,
3498 &ueDl->lcsWithData.first);
3502 /* make sure node points to the svc not completely
3504 * make sure if not served completely then
3505 * the other TB allocation accomodates the same */
3512 /***********************************************************
3514 * Func : rgSCHSc1DlNewTxUeFnlz
3516 * Desc : Perform allocation Distribution from scheduled TB
3517 * among the list of services considered for scheduling.
3525 **********************************************************/
3527 PRIVATE Void rgSCHSc1DlNewTxUeFnlz
3530 RgSchCmnDlRbAllocInfo *allocInfo,
3534 PRIVATE Void rgSCHSc1DlNewTxUeFnlz(cell, allocInfo, ue)
3536 RgSchCmnDlRbAllocInfo *allocInfo;
3541 RgSchSc1DlUe *ueDl = RG_GET_SC1_UE_DL(ue, cell);
3542 RgSchCmnDlUe *cmnUeDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
3543 /*cell added as part of CA dev*/
3544 /* 3.1 MIMO Distribute data of each TB across services */
3545 RgSchDlRbAlloc *dlAllocCb = RG_SCH_CMN_GET_ALLOCCB_FRM_UE(ue, cell);
3546 U32 remTb1Bytes = dlAllocCb->tbInfo[0].bytesAlloc;
3547 U32 remTb2Bytes = dlAllocCb->tbInfo[1].bytesAlloc;
3549 /*ccpu00120365-ADD-added to code to check if second TB is utilized */
3552 TRC2(rgSCHSc1DlNewTxUeFnlz);
3555 /* 3.1 MIMO Consider the allocation of New TX TB for distribution */
3556 /* Handle schd services */
3557 node = ueDl->schdSvcs.first;
3559 effAlloc += remTb1Bytes;
3560 rgSCHSc1DlNewTxTbDstn(cell, ue, &cmnUeDl->proc->tbInfo[0],\
3561 &remTb1Bytes, &node);
3562 /* In the event that TB1 is not completely filled by the DL LCs
3563 * BO, consider the reducing the iMcs for increasing redundancy
3564 * and hence reception quality at UE */
3565 rgSCHCmnRdcImcsTxTb(dlAllocCb, 0,
3566 dlAllocCb->tbInfo[0].bytesAlloc - remTb1Bytes);
3569 /*ccpu00120365-ADD-assigning value of remTb2Bytes before utilization */
3570 tb2Bytes = remTb2Bytes;
3572 /* Extra check for a non SM UE allocation */
3574 effAlloc += remTb2Bytes;
3575 rgSCHSc1DlNewTxTbDstn(cell, ue, &cmnUeDl->proc->tbInfo[1],\
3576 &remTb2Bytes, &node);
3577 /* In the event that TB2 is not completely filled by the DL LCs
3578 * BO, consider the reducing the iMcs for increasing redundancy
3579 * and hence reception quality at UE */
3580 rgSCHCmnRdcImcsTxTb(dlAllocCb, 1,
3581 dlAllocCb->tbInfo[1].bytesAlloc - remTb2Bytes);
3584 /* ccpu00120365-ADD-Disable the second TB as the second TB is not
3586 if ( remTb2Bytes && ( tb2Bytes == remTb2Bytes) )
3588 dlAllocCb->mimoAllocInfo.precIdxInfo = 0;
3589 dlAllocCb->mimoAllocInfo.numTxLyrs = 1;
3590 dlAllocCb->tbInfo[1].schdlngForTb = FALSE;
3591 dlAllocCb->tbInfo[1].isDisabled = TRUE;
3594 if (effAlloc == (remTb1Bytes + remTb2Bytes))
3596 /* Allocation such that Nothing could be satisfied */
3597 /* Return the grabbed PDCCH */
3598 rgSCHUtlPdcchPut(cell, &dlAllocCb->dlSf->pdcchInfo,
3600 rgSCHSc1RlsHqProc(cmnUeDl->proc);
3604 /* Fill PDCCH and assign it to HqP */
3605 rgSCHCmnFillHqPPdcch(cell, dlAllocCb, cmnUeDl->proc);
3612 * @brief This function Processes the Final Allocations
3613 * made by the RB Allocator against the requested
3614 * New TX allocations.
3618 * Function: rgSCHSc1DlNewTxAllocFnlz
3619 * Purpose : Distribute the allocation among the Scheduled SVCs.
3620 * Fill pdcch and HqP for UEs will allocations.
3621 * Release HqP for UE with no allocation.
3623 * Invoked by: Common Scheduler
3625 * @param[in] RgSchCellCb *cell
3626 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
3631 PRIVATE Void rgSCHSc1DlNewTxAllocFnlz
3634 RgSchCmnDlRbAllocInfo *allocInfo
3637 PRIVATE Void rgSCHSc1DlNewTxAllocFnlz(cell, allocInfo)
3639 RgSchCmnDlRbAllocInfo *allocInfo;
3644 RgSchCmnDlUe *cmnUeDl;
3645 RgSchDlHqProcCb *hqP;
3646 TRC2(rgSCHSc1DlNewTxAllocFnlz);
3648 node = allocInfo->dedAlloc.schdTxHqPLst.first;
3651 hqP = (RgSchDlHqProcCb *)node->node;
3654 cmnUeDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
3655 /*cell added as part of CA dev*/
3657 rgSCHSc1DlNewTxUeFnlz(cell, allocInfo, ue);
3661 rgSCHCmnHdFddUpdDLMark(cell, ue);
3664 /* reset the UE allocation Information */
3665 cmLListInit(&((RgSchSc1DlUe *)(cmnUeDl->schSpfc))->schdSvcs);
3666 rgSCHCmnDlUeResetTemp(ue, hqP);
3669 /* Traverse the nonSchdTxUeLst and reset the UE allocation Info */
3670 node = allocInfo->dedAlloc.nonSchdTxHqPLst.first;
3673 hqP = (RgSchDlHqProcCb *)node->node;
3676 cmnUeDl = RG_SCH_CMN_GET_DL_UE(ue, cell);
3678 /* Release HqProc */
3679 rgSCHSc1RlsHqProc(hqP);
3680 /* reset the UE allocation Information */
3681 cmLListInit(&((RgSchSc1DlUe *)(cmnUeDl->schSpfc))->schdSvcs);
3682 rgSCHCmnDlUeResetTemp(ue, hqP);
3687 /* 3.1 Added new function to handle TX+RETX alloc fnlz'n */
3690 * @brief This function Processes the Final Allocations
3691 * made by the RB Allocator against the requested
3692 * RETX+New TX allocations. The NewTx TB allocation
3693 * is considered for distribution among LCs.
3697 * Function: rgSCHSc1DlRetxNewTxAllocFnlz
3698 * Purpose : 1. Reached here due to 1 RETX TB allocation for a
3699 * SM UE, which is capable to accomodate a newTX
3701 * 2. Distribute NewTX TB allocation among the
3702 * SVCs present in lcsWithData list of UE.
3705 * Invoked by: Common Scheduler
3707 * @param[in] RgSchCellCb *cell
3708 * @param[in] RgSchCmnDlRbAllocInfo *cellAllocInfo
3713 PRIVATE Void rgSCHSc1DlRetxNewTxAllocFnlz
3716 RgSchCmnDlRbAllocInfo *cellAllocInfo
3719 PRIVATE Void rgSCHSc1DlRetxNewTxAllocFnlz(cell, cellAllocInfo)
3721 RgSchCmnDlRbAllocInfo *cellAllocInfo;
3726 RgSchSc1DlUe *sc1DlUe;
3727 RgSchDlHqProcCb *hqP;
3728 RgSchDlHqTbCb *newTxTbInfo;
3731 RgSchDlRbAlloc *ueAllocInfo;
3732 RgSchDlRbAlloc *dlAllocCb;
3734 TRC2(rgSCHSc1DlRetxNewTxAllocFnlz);
3736 node = cellAllocInfo->dedAlloc.schdTxRetxHqPLst.first;
3739 hqP = (RgSchDlHqProcCb *)node->node;
3742 sc1DlUe = RG_GET_SC1_UE_DL(ue, cell);
3743 ueAllocInfo = RG_SCH_CMN_GET_ALLOCCB_FRM_UE(ue, cell);
3744 dlAllocCb = RG_SCH_CMN_GET_ALLOCCB_FRM_UE(ue, cell);
3745 /* Index 0 of ueAllocInfo->tbInfo will always hold the
3746 * RETX TB and index 1 will hold the NewTX TB in case of
3747 * RETX+TX allocation. */
3748 newTxTbInfo = ueAllocInfo->tbInfo[1].tbCb;
3749 effAlloc = remTbBytes = ueAllocInfo->tbInfo[1].bytesAlloc;
3750 rgSCHSc1DlSprTxTbDstn(cell, ue, newTxTbInfo,\
3751 &remTbBytes, &(sc1DlUe->lcsWithData.first));
3752 /* Trying to reduce mcs of TX TB to increase reception quality at UE.
3753 * In case of RETX+TX allocation, TX TB allocation was irrespective
3754 * of actual requirement by UE, hence in case if consumption is
3755 * less than allocation, consider reducing the iMcs of this TX TB. */
3756 rgSCHCmnRdcImcsTxTb(dlAllocCb, 1, effAlloc - remTbBytes);
3757 /* 3.1 MIMO Remove/Retain from/in cell RETX List */
3758 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
3759 /* Fill PDCCH and assign it to HqP */
3760 rgSCHCmnFillHqPPdcch(cell, dlAllocCb, hqP);
3764 rgSCHCmnHdFddUpdDLMark(cell, ue);
3767 /* reset the UE allocation Information */
3768 rgSCHCmnDlUeResetTemp(ue, hqP);
3771 /* Traverse the nonSchdTxRetxHqPLst and reset the UE allocation Info */
3772 node = cellAllocInfo->dedAlloc.nonSchdTxRetxHqPLst.first;
3775 hqP = (RgSchDlHqProcCb *)node->node;
3778 /* reset the UE allocation Information */
3779 rgSCHCmnDlUeResetTemp(ue, hqP);
3785 * @brief This function Processes the Final Allocations
3786 * made by the RB Allocator against the requested.
3790 * Function: rgSCHSc1DlAllocFnlz
3791 * Purpose: This function Processes the Final Allocations
3792 * made by the RB Allocator against the requested.
3793 * 1. Loop through scheduled TX and RETX lists.
3794 * Fill in the corresponding PDCCH and HqProcs.
3795 * In case of TX If actual Alloc < requested, then perform
3796 * an appropriate distribution among the schdSvcs.
3797 * If TA is satisfied, then remove UE from TA Lst.
3798 * 2. Loop through UnScheduled TX and RETX Lists.
3799 * Release grabbed HqProcs.
3800 * Put back SVCs from schdSvcsLst to their corresponding Qs.
3803 * Invoked by: Common Scheduler
3805 * @param[in] RgSchCellCb *cell
3806 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
3811 PUBLIC Void rgSCHSc1DlAllocFnlz
3814 RgSchCmnDlRbAllocInfo *allocInfo
3817 PUBLIC Void rgSCHSc1DlAllocFnlz(cell, allocInfo)
3819 RgSchCmnDlRbAllocInfo *allocInfo;
3822 TRC2(rgSCHSc1DlAllocFnlz);
3824 rgSCHSc1DlRetxAllocFnlz(cell, allocInfo);
3826 rgSCHSc1DlNewTxAllocFnlz(cell, allocInfo);
3828 /*3.1 MIMO new Function added to handle TX+RETX
3829 * harq process scheduling finalization */
3830 rgSCHSc1DlRetxNewTxAllocFnlz(cell, allocInfo);
3837 * @brief This function Updates the DL CQI for the UE.
3841 * Function: rgSCHSc1DlCqiInd
3842 * Purpose: Updates the DL CQI for the UE
3844 * Invoked by: Common Scheduler. SC1 does nothing.
3846 * @param[in] RgSchCellCb *cell
3847 * @param[in] RgSchUeCb *ue
3848 * @param[in] TfuDlCqiRpt *dlCqiRpt
3853 PUBLIC Void rgSCHSc1DlCqiInd
3861 PUBLIC Void rgSCHSc1DlCqiInd(cell, ue, isPucchInfo, dlCqi)
3868 TRC2(rgSCHSc1DlCqiInd);
3874 * @brief This function adds a service to UE's list of lcsWithData.
3878 * Function: rgSCHSc1DlAdd2UeLcsWithData
3879 * Purpose: 1. This is to maintain a snapshot view of the
3880 * DL SVCs distributions among the cellwide priority
3882 * 2. This snapshot view is maintained in the order
3883 * of priority of the SVCs with in UE.
3884 * 3. Addition of SVC to a cellwide priority Queue
3885 * triggers this function.
3887 * Invoked by: Functions of DL SC1 which add SVC or UE(for ambr svc)
3888 * to cellwide priority Queues.
3890 * @param[in] RgSchUeCb* ue
3891 * @param[in] RgSchDlLcCb* svc
3896 PRIVATE Void rgSCHSc1DlAdd2UeLcsWithData
3903 PRIVATE Void rgSCHSc1DlAdd2UeLcsWithData(cell, ue, svc)
3911 RgSchCmnDlSvc *cmnDlSvc = RG_SCH_CMN_GET_DL_SVC(svc);
3912 RgSchSc1DlSvc *sc1DlSvc = RG_GET_SC1_SVC_DL(ue,svc,cell);
3913 RgSchSc1DlUe *sc1DlUe = RG_GET_SC1_UE_DL(ue, cell);
3914 RgSchCmnDlSvc *cmnDlLstSvc;
3916 TRC2(rgSCHSc1DlAdd2UeLcsWithData);
3918 lst = &(sc1DlUe->lcsWithData);
3922 cmnDlLstSvc = RG_SCH_CMN_GET_DL_SVC(((RgSchDlLcCb *)(node->node)));
3923 if (cmnDlSvc->prio <= cmnDlLstSvc->prio)
3931 cmLListAdd2Tail(lst, &sc1DlSvc->lcWithDataLnk);
3932 sc1DlSvc->lcWithDataLnk.node = (PTR)svc;
3937 cmLListInsCrnt(lst, &sc1DlSvc->lcWithDataLnk);
3938 sc1DlSvc->lcWithDataLnk.node = (PTR)svc;
3945 * @brief This function adds a service to UE's list of lcsWithData.
3949 * Function: rgSCHSc1DlRmFrmUeLcsWithData
3950 * Purpose: 1. This is to maintain a snapshot view of the
3951 * DL SVCs distributions among the cellwide priority
3953 * 2. This snapshot view is maintained in the order
3954 * of priority of the SVCs with in UE.
3955 * 3. Addition of SVC to a cellwide priority Queue
3956 * triggers this function.
3958 * Invoked by: Functions of DL SC1 which add SVC or UE(for ambr svc)
3959 * to cellwide priority Queues.
3961 * @param[in] RgSchUeCb* ue
3962 * @param[in] RgSchDlLcCb* svc
3967 PRIVATE Void rgSCHSc1DlRmFrmUeLcsWithData
3974 PRIVATE Void rgSCHSc1DlRmFrmUeLcsWithData(cell, ue, svc)
3980 RgSchSc1DlSvc *sc1DlSvc = RG_GET_SC1_SVC_DL(ue,svc,cell);
3981 RgSchSc1DlUe *sc1DlUe = RG_GET_SC1_UE_DL(ue, cell);
3983 TRC2(rgSCHSc1DlRmFrmUeLcsWithData);
3985 cmLListDelFrm(&(sc1DlUe->lcsWithData), &sc1DlSvc->lcWithDataLnk);
3986 sc1DlSvc->lcWithDataLnk.node = NULLP;
3989 /***************** SC1 DL SCHEDULER FUNCTION DEFNs END HERE ****************/
3991 /***************************************************************************/
3993 /***************** SC1 UL SCHEDULER FUNCTION DEFNs START HERE **************/
3995 /*--------------------------*
3996 * UL specific functions START
3997 *---------------------------*/
4000 * @brief UE Lc Config for RR
4004 * Function : rgSCHSc1UlLchCfg
4006 * Processing Steps: Dummy function
4008 * @param[in] RgrSchCellCb *cell
4009 * @param[in] RgSchUeCb *ue
4010 * @param[in] RgrLchCfg *cfg
4011 * @param[in] RgSchErrInfo *err
4015 PUBLIC S16 rgSCHSc1UlLchCfg
4026 * @brief UE Lc Reconfig for RR
4030 * Function : rgSCHSc1UlLchRecfg
4032 * Processing Steps: Dummy function
4034 * @param[in] RgrSchCellCb *cell
4035 * @param[in] RgSchUeCb *ue
4036 * @param[in] RgrLchRecfg *recfg
4037 * @param[in] RgSchErrInfo *err
4041 PUBLIC S16 rgSCHSc1UlLchRecfg
4052 * @brief LC deletion for PFS
4056 * Function : rgSCHSc1UlLchDel
4058 * Processing Steps: Dummy function
4060 * @param[in] RgrSchCellCb *cell
4061 * @param[in] RgSchUeCb *ue
4062 * @param[in] CmLteLcId lcId
4067 PUBLIC S16 rgSCHSc1UlLchDel
4075 PUBLIC S16 rgSCHRrUlLchDel(cell, ue, lcId, lcgId)
4086 * @brief This function initializes all the data for the scheduler
4090 * Function: rgSCHSc1UlInit
4091 * Purpose: This function initializes the following information
4092 * 1. Efficiency table
4093 * 2. CQI to table index - It is one row for upto 3 RBs
4094 * and another row for greater than 3 RBs
4096 * currently extended prefix is compiled out.
4097 * Invoked by: MAC intialization code..may be ActvInit
4103 PUBLIC Void rgSCHSc1UlInit
4105 RgUlSchdApis *rgSchUlApis
4108 PUBLIC Void rgSCHSc1UlInit(rgSchUlApis)
4109 RgUlSchdApis *rgSchUlApis;
4112 TRC2(rgSCHSc1UlInit);
4113 /* Init the function pointers */
4114 rgSchUlApis->rgSCHRgrUlUeCfg = rgSCHSc1RgrUlUeCfg;
4115 rgSchUlApis->rgSCHRgrUlUeRecfg = rgSCHSc1RgrUlUeRecfg;
4116 rgSchUlApis->rgSCHFreeUlUe = rgSCHSc1UlUeDel;
4117 rgSchUlApis->rgSCHRgrUlCellCfg = rgSCHSc1RgrUlCellCfg;
4118 rgSchUlApis->rgSCHRgrUlCellRecfg = rgSCHSc1RgrUlCellRecfg;
4119 rgSchUlApis->rgSCHFreeUlCell = rgSCHSc1UlCellDel;
4120 rgSchUlApis->rgSCHRgrUlLcCfg = rgSCHSc1UlLchCfg;
4121 rgSchUlApis->rgSCHRgrUlLcRecfg = rgSCHSc1UlLchRecfg;
4122 rgSchUlApis->rgSCHRgrUlLcgCfg = rgSCHSc1RgrLcgCfg;
4123 rgSchUlApis->rgSCHRgrUlLcgRecfg = rgSCHSc1RgrLcgRecfg;
4124 rgSchUlApis->rgSCHFreeUlLcg = rgSCHSc1LcgDel;
4125 rgSchUlApis->rgSCHRgrUlLchDel = rgSCHSc1UlLchDel;
4126 rgSchUlApis->rgSCHUlSched = rgSCHSc1UlSched;
4127 rgSchUlApis->rgSCHUpdBsrShort = rgSCHSc1UpdBsrShort;
4128 rgSchUlApis->rgSCHUpdBsrTrunc = rgSCHSc1UpdBsrTrunc;
4129 rgSchUlApis->rgSCHUpdBsrLong = rgSCHSc1UpdBsrLong;
4130 rgSchUlApis->rgSCHContResUlGrant = rgSCHSc1ContResUlGrant;
4131 rgSchUlApis->rgSCHSrRcvd = rgSCHSc1SrRcvd;
4132 rgSchUlApis->rgSCHUlCqiInd = rgSCHSc1UlCqiInd;
4133 rgSchUlApis->rgSCHUlUeRefresh = rgSCHSc1UlUeRefresh;
4134 rgSchUlApis->rgSCHUlAllocFnlz = rgSCHSc1UlAllocFnlz;
4135 rgSchUlApis->rgSCHUlInactvtUes = rgSCHSc1UlHndlInActUes;
4136 rgSchUlApis->rgSCHUlActvtUe = rgSCHSc1UlActvtUe;
4137 rgSchUlApis->rgSCHUlUeReset = rgSCHSc1UlUeReset;
4138 rgSchUlApis->rgSCHRgrUlLcgUpd = rgSCHSc1UlLcgUpd;
4143 * @brief UE initialisation for scheduler
4147 * Function : rgSCHSc1RgrUlUeCfg
4149 * This functions intialises UE specific scheduler
4152 * @param[in] RgSchCellCb *cell
4153 * @param[in] RgSchUeCb *ue
4154 * @param[int] RgrUeCfg *ueCfg
4155 * @param[out] RgSchErrInfo *err
4161 PUBLIC S16 rgSCHSc1RgrUlUeCfg
4169 PUBLIC S16 rgSCHSc1RgrUlUeCfg(cell, ue, ueCfg, err)
4177 RgSchCmnUe *ueSchCmn = RG_SCH_CMN_GET_UE(ue, cell);
4178 TRC2(rgSCHSc1RgrUlUeCfg);
4180 if(rgSCHUtlAllocSBuf(cell->instIdx,
4181 (Data**)&(ueSchCmn->ul.schSpfc), (sizeof(RgSchSc1UlUe))) != ROK)
4183 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
4184 "Memory allocation FAILED CRNTI:%d",ue->ueId);
4185 err->errCause = RGSCHERR_SCH_SC1_UL_CFG;
4190 } /* rgSCHSc1RgrUlUeCfg */
4193 * @brief UE reconfiguration for scheduler
4197 * Function : rgSCHSc1RgrUlUeRecfg
4199 * This functions updates UE specific scheduler
4200 * information upon UE reconfiguration
4202 * @param[in] RgSchCellCb *cell
4203 * @param[in] RgSchUeCb *ue
4204 * @param[int] RgrUeRecfg *ueRecfg
4205 * @param[out] RgSchErrInfo *err
4211 PUBLIC S16 rgSCHSc1RgrUlUeRecfg
4215 RgrUeRecfg *ueRecfg,
4219 PUBLIC S16 rgSCHSc1RgrUlUeRecfg(cell, ue, ueRecfg, err)
4222 RgrUeRecfg *ueRecfg;
4226 TRC2(rgSCHSc1RgrUlUeRecfg);
4228 } /* rgSCHSc1RgrUeRecfg */
4231 * @brief UE deletion for scheduler
4235 * Function : rgSCHSc1UlUeDel
4237 * This functions deletes all scheduler information
4238 * pertaining to a UE
4240 * @param[in] RgSchCellCb *cell
4241 * @param[in] RgSchUeCb *ue
4245 PUBLIC Void rgSCHSc1UlUeDel
4251 PUBLIC Void rgSCHSc1UlUeDel(cell, ue)
4256 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
4257 RgSchSc1UlUe *ueUl = RG_GET_SC1_UE_UL(ue, cell);
4259 TRC2(rgSCHSc1UlUeDel);
4265 if(ueUl->txLnk.node)
4267 cmLListDelFrm(&(cellUl->ueTxLst[ueUl->qId]), &(ueUl->txLnk));
4268 ueUl->txLnk.node = NULLP;
4270 if(ueUl->contResLnk.node)
4272 cmLListDelFrm(&(cellUl->contResLst), &(ueUl->contResLnk));
4273 ueUl->contResLnk.node = NULLP;
4275 /* ccpu00117052 - MOD - Passing double pointer
4276 for proper NULLP assignment*/
4277 rgSCHUtlFreeSBuf(cell->instIdx,
4278 (Data**)(&(ueUl)), (sizeof(RgSchSc1UlUe)));
4281 } /* rgSCHSc1UlUeDel */
4284 * @brief UE Reset for scheduler
4288 * Function : rgSCHSc1UlUeReset
4290 * Remove this UE from all Scheduling Priority Qs
4292 * @param[in] RgSchCellCb *cell
4293 * @param[in] RgSchUeCb *ue
4297 PUBLIC Void rgSCHSc1UlUeReset
4303 PUBLIC Void rgSCHSc1UlUeReset(cell, ue)
4308 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
4309 RgSchSc1UlUe *ueUl = RG_GET_SC1_UE_UL(ue, cell);
4311 TRC2(rgSCHSc1UlUeReset);
4313 ueUl->srRcvd = FALSE;
4315 if(ueUl->txLnk.node)
4317 cmLListDelFrm(&(cellUl->ueTxLst[ueUl->qId]), &(ueUl->txLnk));
4318 ueUl->txLnk.node = NULLP;
4320 if(ueUl->contResLnk.node)
4322 cmLListDelFrm(&(cellUl->contResLst), &(ueUl->contResLnk));
4323 ueUl->contResLnk.node = NULLP;
4326 } /* rgSCHSc1UlUeReset */
4330 * @brief Scheduler processing on cell configuration
4334 * Function : rgSCHSc1RgrUlCellCfg
4336 * This function does requisite initialisation
4337 * and setup for scheduler1 when a cell is
4340 * @param[in] RgSchCellCb *cell
4341 * @param[in] RgrCellCfg *cellCfg
4342 * @param[out] RgSchErrInfo *err
4348 PUBLIC S16 rgSCHSc1RgrUlCellCfg
4351 RgrCellCfg *cellCfg,
4355 PUBLIC S16 rgSCHSc1RgrUlCellCfg(cell, cellCfg, err)
4357 RgrCellCfg *cellCfg;
4361 RgSchSc1UlCell *cellUl;
4363 TRC2(rgSCHSc1RgrUlCellCfg);
4365 if((rgSCHUtlAllocSBuf(cell->instIdx,
4366 (Data**)&(((RgSchCmnCell*)((cell)->sc.sch))->ul.schSpfc), \
4367 (sizeof(RgSchSc1UlCell))) != ROK))
4369 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
4370 "Memory allocation FAILED");
4371 err->errCause = RGSCHERR_SCH_SC1_UL_CFG;
4374 cellUl = RG_GET_SC1_CELL_UL(cell);
4375 cmLListInit(&cellUl->contResLst);
4376 cmLListInit(&cellUl->ueTxLst[0]);
4377 cmLListInit(&cellUl->ueTxLst[1]);
4380 } /* rgSCHSc1RgrUlCellCfg */
4384 * @brief This function handles the reconfiguration of cell
4388 * Function: rgSCHSc1RgrUlCellRecfg
4389 * Purpose: Update the reconfiguration parameters.
4391 * Invoked by: Scheduler
4393 * @param[in] RgSchCellCb* cell
4398 PUBLIC S16 rgSCHSc1RgrUlCellRecfg
4401 RgrCellRecfg *recfg,
4405 PUBLIC S16 rgSCHSc1RgrUlCellRecfg(cell, recfg, err)
4407 RgrCellRecfg *recfg;
4411 TRC2(rgSCHSc1RgrUlCellRecfg);
4416 * @brief Scheduler processing for cell delete
4420 * Function : rgSCHSc1UlCellDel
4422 * This functions de-initialises and frees memory
4423 * taken up by scheduler1 for the entire cell.
4425 * @param[in] RgSchCellCb *cell
4429 PUBLIC Void rgSCHSc1UlCellDel
4434 PUBLIC Void rgSCHSc1UlCellDel(cell)
4438 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
4440 TRC2(rgSCHSc1UlCellDel);
4442 if (cellUl == NULLP)
4446 /* ccpu00117052 - MOD - Passing double pointer
4447 for proper NULLP assignment*/
4448 rgSCHUtlFreeSBuf(cell->instIdx,
4449 (Data**)(&(cellUl)), (sizeof(RgSchSc1UlCell)));
4452 } /* rgSCHSc1UlCellDel */
4455 * @brief Scheduler invocation on logical channel Group addition
4459 * Function : rgSCHSc1RgrLcgCfg
4461 * This functions does required processing when a new
4462 * (dedicated) logical channel is added. Assumes lcg
4463 * pointer in ulLc is set.
4465 * @param[in] RgSchCellCb *cell
4466 * @param[in] RgSchUeCb *ue
4467 * @param[in] RgSchLcgCb *lcg
4468 * @param[int] RgrLcgCfg *lcgCfg
4469 * @param[out] RgSchErrInfo *err
4475 PUBLIC S16 rgSCHSc1RgrLcgCfg
4484 PUBLIC S16 rgSCHSc1RgrLcgCfg(cell, ue, lcg, lcgCfg, err)
4492 TRC2(rgSCHSc1RgrLcgCfg);
4494 } /* rgSCHSc1RgrLcgCfg */
4497 * @brief Scheduler invocation on logical channel addition
4501 * Function : rgSCHSc1RgrLcgRecfg
4503 * This functions does required processing when an existing
4504 * (dedicated) logical channel is reconfigured. Assumes lcg
4505 * pointer in ulLc is set to the old value.
4506 * Independent of whether new LCG is meant to be configured,
4507 * the new LCG scheduler info is accessed and possibly modified.
4509 * @param[in] RgSchCellCb *cell,
4510 * @param[in] RgSchUeCb *ue,
4511 * @param[in] RgSchLcgCb *lcg,
4512 * @param[in] RgrLcgRecfg *reCfg,
4513 * @param[out] RgSchErrInfo *err
4519 PUBLIC S16 rgSCHSc1RgrLcgRecfg
4528 PUBLIC S16 rgSCHSc1RgrLcgRecfg(cell, ue, lcg, reCfg, err)
4536 TRC2(rgSCHSc1RgrLcgRecfg);
4538 } /* rgSCHSc1RgrLcgRecfg */
4540 /***********************************************************
4542 * Func : rgSCHSc1LcgDel
4544 * Desc : Scheduler handling for a (dedicated)
4545 * uplink lcg being deleted
4553 **********************************************************/
4555 PUBLIC Void rgSCHSc1LcgDel
4562 PUBLIC Void rgSCHSc1LcgDel(cell, ue, lcg)
4568 TRC2(rgSCHSc1LcgDel);
4569 rgSCHSc1UlPosnUeInQ(cell, ue);
4574 * @brief Perform alloction for this UE
4578 * Function : rgSCHSc1UlSchdUe
4580 * Processing Steps: cater to as much as UE needs, with
4581 * a limitation on maxBits per scheduling instance(per TTI)
4582 * per UE. Return failure, if UE is not considered
4583 * for scheduling (case, where it is already selected for a
4587 * @param[in] RgSchUeCb *ue
4591 PRIVATE Void rgSCHSc1UlSchdUe
4597 PRIVATE Void rgSCHSc1UlSchdUe(ue,cell)
4602 RgSchCmnUlUe *cmnUlUe = RG_SCH_CMN_GET_UL_UE(ue, cell);
4603 /*cell added as part of CA dev*/
4604 RgSchSc1UlUe *ulUe = RG_GET_SC1_UE_UL(ue, cell);
4606 TRC2(rgSCHSc1UlSchdUe);
4608 if(ulUe->srRcvd == TRUE)
4610 cmnUlUe->alloc.reqBytes = RGSCH_MAX(RG_SCH_CMN_UL_SR_BYTES, \
4615 cmnUlUe->alloc.reqBytes = ue->ul.effBsr;
4621 * @brief Scheduler invocation
4625 * Function: rgSCHSc1UlSchdForDataTrans
4626 * Purpose: Uplink Scheduling for UE data Transmission.
4629 * Invoked by: Scheduler
4631 * @param[in] RgSchCellCb *cell
4632 * @param[out] RgSchCmnUlRbAllocInfo *allocInfo
4633 * @param[in] U8 remUe
4637 PRIVATE Void rgSCHSc1UlSchdForDataTrans
4640 RgSchCmnUlRbAllocInfo *allocInfo,
4644 PRIVATE Void rgSCHSc1UlSchdForDataTrans(cell, allocInfo, remUe)
4646 RgSchCmnUlRbAllocInfo *allocInfo;
4650 RgSchSc1UlCell *sc1UlCell = RG_GET_SC1_CELL_UL(cell);
4652 TRC2(rgSCHSc1UlSchdForDataTrans);
4658 /* Allocate UEs with LCG0 data pending */
4659 rgSCHSc1UlSchdUeTxLst(cell, &sc1UlCell->ueTxLst[0], allocInfo, &remUe);
4665 /* Allocate UEs with other LCGs data pending */
4666 rgSCHSc1UlSchdUeTxLst(cell, &sc1UlCell->ueTxLst[1], allocInfo, &remUe);
4672 * @brief Scheduler invocation
4676 * Function: rgSCHSc1UlSchdUeTxLst
4677 * Purpose: Uplink Scheduling for UE data Transmission.
4680 * Invoked by: Scheduler
4682 * @param[in] CmLListCp *ueTxLst
4683 * @param[out] RgSchCmnUlRbAllocInfo *allocInfo
4684 * @param[in] U8 *remUe
4688 PRIVATE Void rgSCHSc1UlSchdUeTxLst
4692 RgSchCmnUlRbAllocInfo *allocInfo,
4696 PRIVATE Void rgSCHSc1UlSchdUeTxLst(cell, ueTxLst, allocInfo, remUe)
4699 RgSchCmnUlRbAllocInfo *allocInfo;
4706 Bool ulAllowed = FALSE;
4709 TRC2(rgSCHSc1UlSchdUeTxLst);
4711 node = ueTxLst->first;
4712 while ((node) && (*remUe))
4714 ue = (RgSchUeCb *)node->node;
4719 rgSCHCmnHdFddChkUlAllow (cell, ue, &ulAllowed);
4720 if (ulAllowed == FALSE)
4727 if (RG_SCH_CMN_IS_UL_UE_RETX(ue, cell))
4729 /* UE already scheduled in this subframe (for retx)
4730 * OR is inactive for UL Transmission.*/
4733 /* Added support for SPS*/
4735 else if (RG_SCH_CMN_IS_SPS_SCHD(ue, cell))
4737 /*-- Already Scheduled by SPS --*/
4742 rgSCHSc1UlSchdUe(ue,cell);/*cell added as part of CA dev*/
4744 rgSCHCmnUlAdd2UeLst(cell, allocInfo, ue);
4753 * @brief Scheduler invocation
4757 * Function: rgSCHSc1UlSchdForContRes
4758 * Purpose: Uplink Scheduling for Contention Resolution.
4761 * Invoked by: Scheduler
4763 * @param[in] RgSchCellCb *cell
4764 * @param[out] RgSchCmnUlRbAllocInfo *allocInfo
4765 * @param[out] U8 *remUe
4769 PRIVATE Void rgSCHSc1UlSchdForContRes
4772 RgSchCmnUlRbAllocInfo *allocInfo,
4776 PRIVATE Void rgSCHSc1UlSchdForContRes(cell, allocInfo, remUe)
4778 RgSchCmnUlRbAllocInfo *allocInfo;
4782 RgSchSc1UlCell *sc1UlCell = RG_GET_SC1_CELL_UL(cell);
4785 RgSchCmnUlUe *cmnUlUe;
4787 Bool ulAllowed = FALSE;
4790 TRC2(rgSCHSc1UlSchdForContRes);
4792 node = sc1UlCell->contResLst.first;
4793 while ((node) && (*remUe))
4795 ue = (RgSchUeCb *)node->node;
4796 cmnUlUe = RG_SCH_CMN_GET_UL_UE(ue, cell);
4797 /*cell added as part of CA dev*/
4802 rgSCHCmnHdFddChkUlAllow (cell, ue, &ulAllowed);
4803 if (ulAllowed == FALSE)
4809 if (RG_SCH_CMN_IS_UL_UE_RETX(ue, cell))
4811 /* UE already scheduled in this subframe (for retx)
4812 * OR is inactive for UL Transmission.*/
4815 cmnUlUe->alloc.reqBytes = RG_SCH_CMN_MAX_UL_CONTRES_GRNT;
4816 rgSCHCmnUlAdd2CntResLst(allocInfo, ue);
4818 /* Node removal deferred to ULAllocFinalization */
4825 * @brief Scheduler invocation
4829 * Function: rgSCHSc1UlNewTx
4830 * Purpose: Uplink Scheduling for New Transmissions.
4833 * Invoked by: Scheduler
4835 * @param[in] RgSchCellCb *cell
4836 * @param[out] RgSchCmnUlRbAllocInfo *allocInfo
4840 PRIVATE Void rgSCHSc1UlNewTx
4843 RgSchCmnUlRbAllocInfo *allocInfo
4846 PRIVATE Void rgSCHSc1UlNewTx(cell, allocInfo)
4848 RgSchCmnUlRbAllocInfo *allocInfo;
4851 RgSchCmnUlCell *cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
4852 U8 remUe = cellUl->maxUeNewTxPerTti;
4854 TRC2(rgSCHSc1UlNewTx);
4856 rgSCHSc1UlSchdForContRes(cell, allocInfo, &remUe);
4857 rgSCHSc1UlSchdForDataTrans(cell, allocInfo, remUe);
4862 * @brief Scheduler invocation
4866 * Function: rgSCHSc1UlSched
4867 * Purpose: This function implements an UL scheduler for LTE. This is
4868 * made available as a function pointer to be called
4869 * at the time of TTI processing by the MAC.
4871 * Invoked by: Common Scheduler (TTI processing)
4873 * @param[in] RgSchCellCb *cell
4874 * @param[out] RgSchCmnUlRbAllocInfo *allocInfo
4878 PUBLIC Void rgSCHSc1UlSched
4881 RgSchCmnUlRbAllocInfo *allocInfo
4884 PUBLIC Void rgSCHSc1UlSched(cell, allocInfo)
4886 RgSchCmnUlRbAllocInfo *allocInfo;
4889 TRC2(rgSCHSc1UlSched);
4890 rgSCHSc1UlNewTx(cell, allocInfo);
4895 * @brief UEs Buffer Status Has changed so reposition it.
4899 * Function : rgSCHSc1UlInsUeInQ
4901 * In UE in the list in Descending order of effBsr.
4904 * @param[in] CmLListCp *lst
4905 * @param[in] RgSchUeCb *ue
4909 PRIVATE Void rgSCHSc1UlInsUeInQ
4916 PRIVATE Void rgSCHSc1UlInsUeInQ(lst, ue, cell)
4922 /*cell added as part of CA dev*/
4923 RgSchSc1UlUe *ueUl = RG_GET_SC1_UE_UL(ue, cell);
4927 TRC2(rgSCHSc1UlInsUeInQ);
4932 lUe = (RgSchUeCb *)(node->node);
4933 if (lUe->ul.effBsr <= ue->ul.effBsr)
4941 /* We have come to the end of the queue, so Append */
4942 cmLListAdd2Tail(lst, &ueUl->txLnk);
4943 ueUl->txLnk.node = (PTR)ue;
4948 cmLListInsCrnt(lst, &ueUl->txLnk);
4949 ueUl->txLnk.node = (PTR)ue;
4955 * @brief UEs Buffer Status Has changed so reposition it.
4959 * Function : rgSCHSc1UlPosnUeInQ
4961 * -Ues bs value for its LCG has changed, due to either
4962 * allocation or BSR report OR the effUeBR, i.e the byteRate
4963 * has changed due to some allocation, so add/reposition/remove
4964 * it from Qs based on this new bs and/or effUeBR value.
4965 * -If UE has non-zero lcg0 bs value, but the byteRate is
4966 * consumed totally, UE is still schedulable for this control data.
4967 * -If UE's LCG0 has pending bs then position this UE in
4969 * -If Ue has pending BSR to be satisfied, but lcg0's BS
4970 * is 0, then position it in ueTxLst[1].
4971 * -In any of these 2 Qs, insertion is such that UEs are
4972 * positioned in Descending order of their Pending BS.
4975 * @param[in] RgSchCellCb *cell
4976 * @param[in] RgSchUeCb *ue
4980 PRIVATE Void rgSCHSc1UlPosnUeInQ
4986 PRIVATE Void rgSCHSc1UlPosnUeInQ(cell, ue)
4991 RgSchSc1UlUe *ueUl = RG_GET_SC1_UE_UL(ue, cell);
4992 /*cell added as part of CA dev*/
4993 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
4994 RgSchCmnLcg *cmnLcg0 = RG_SCH_CMN_GET_UL_LCG(&ue->ul.lcgArr[0]);
4997 TRC2(rgSCHSc1UlPosnUeInQ);
4999 if (!RG_SCH_CMN_UL_IS_UE_ACTIVE(ue))
5004 /* Remove the UE from its existing position */
5005 if (ueUl->txLnk.node)
5007 cmLListDelFrm(&(cellUl->ueTxLst[ueUl->qId]), &(ueUl->txLnk));
5008 ueUl->txLnk.node = (PTR)NULLP;
5010 /* If UE has still bs left for scheduling
5011 * then reposition it */
5012 if ((ue->ul.effBsr > 0) || (ueUl->srRcvd == TRUE))
5014 /* Select the Queue where UE would be Placed */
5015 if (cmnLcg0->bs > 0)
5017 lst = &cellUl->ueTxLst[0];
5022 lst = &cellUl->ueTxLst[1];
5025 /* Insert the UE in the Q */
5026 rgSCHSc1UlInsUeInQ(lst, ue, cell);/*cell added as part of CA dev*/
5029 else if(ue->ul.totalBsr != 0)
5031 if (ue->bsrTmr.tmrEvnt != TMR_NONE)
5033 rgSCHTmrStopTmr(cell, ue->bsrTmr.tmrEvnt, ue);
5035 if (ue->ul.bsrTmrCfg.isPrdBsrTmrPres)
5037 rgSCHTmrStartTmr(cell, ue, RG_SCH_TMR_BSR,
5038 ue->ul.bsrTmrCfg.prdBsrTmr);
5047 * @brief Short BSR update
5051 * Function : rgSCHSc1UpdBsrShort
5053 * This functions does requisite updates to handle short BSR reporting
5055 * @param[in] RgSchCellCb *cell
5056 * @param[in] RgSchUeCb *ue
5057 * @param[in] RgSchLcgCb *lcg
5062 PUBLIC Void rgSCHSc1UpdBsrShort
5070 PUBLIC Void rgSCHSc1UpdBsrShort(cell, ue, lcg, bsr)
5077 TRC2(rgSCHSc1UpdBsrShort);
5078 rgSCHSc1UlPosnUeInQ(cell, ue);
5080 } /* rgSCHSc1UpdBsrShort */
5083 * @brief Truncated BSR update
5087 * Function : rgSCHSc1UpdBsrTrunc
5089 * This functions does required updates to handle truncated BSR report
5092 * @param[in] RgSchCellCb *cell
5093 * @param[in] RgSchUeCb *ue
5094 * @param[in] RgSchLcgCb *lcg
5099 PUBLIC Void rgSCHSc1UpdBsrTrunc
5107 PUBLIC Void rgSCHSc1UpdBsrTrunc(cell, ue, lcg, bsr)
5114 TRC2(rgSCHSc1UpdBsrTrunc);
5115 rgSCHSc1UlPosnUeInQ(cell, ue);
5117 } /* rgSCHSc1UpdBsrTrunc */
5120 * @brief Long BSR update
5124 * Function : rgSCHSc1UpdBsrLong
5126 * - Update UE's position within/across uplink scheduling queues
5129 * @param[in] RgSchCellCb *cell
5130 * @param[in] RgSchUeCb *ue
5131 * @param[in] U8 bsArr[]
5135 PUBLIC Void rgSCHSc1UpdBsrLong
5142 PUBLIC Void rgSCHSc1UpdBsrLong(cell, ue, bsArr)
5148 TRC2(rgSCHSc1UpdBsrLong);
5149 rgSCHSc1UlPosnUeInQ(cell, ue);
5151 } /* rgSCHSc1UpdBsrLong */
5154 * @brief UL grant for contention resolution
5158 * Function : rgSCHSc1ContResUlGrant
5160 * Add UE to another queue specifically for CRNTI based contention
5164 * @param[in] RgSchCellCb *cell
5165 * @param[in] RgSchUeCb *ue
5169 PUBLIC Void rgSCHSc1ContResUlGrant
5175 PUBLIC Void rgSCHSc1ContResUlGrant(cell, ue)
5180 RgSchSc1UlUe *ueUl = RG_GET_SC1_UE_UL(ue, cell);
5181 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
5183 TRC2(rgSCHSc1ContResUlGrant);
5185 if (ueUl->contResLnk.node)
5190 /* Remove the UE from other Qs */
5191 if(ueUl->txLnk.node)
5193 cmLListDelFrm(&(cellUl->ueTxLst[ueUl->qId]), &(ueUl->txLnk));
5194 ueUl->txLnk.node = NULLP;
5197 cmLListAdd2Tail(&cellUl->contResLst, &ueUl->contResLnk);
5198 ueUl->contResLnk.node = (PTR)ue;
5200 } /* rgSCHSc1ContResUlGrant */
5203 * @brief SR reception handling
5207 * Function : rgSCHSc1SrRcvd
5208 * Shift the UE with SrInd in to the lcgO queue.
5211 * @param[in] RgSchCellCb *cell
5212 * @param[in] RgSchUeCb *ue
5216 PUBLIC Void rgSCHSc1SrRcvd
5222 PUBLIC Void rgSCHSc1SrRcvd(cell, ue)
5227 RgSchSc1UlUe *ulUe = RG_GET_SC1_UE_UL(ue, cell);
5228 RgSchSc1UlCell *ulCell = RG_GET_SC1_CELL_UL(cell);
5230 TRC2(rgSCHSc1SrRcvd);
5232 ulUe->srRcvd = TRUE;
5234 if (ulUe->txLnk.node != NULLP)
5238 /* Already present in lcg0 Q */
5241 cmLListDelFrm(&(ulCell->ueTxLst[ulUe->qId]), &(ulUe->txLnk));
5243 /* Adding the UE to the LCG0 list for SR IND */
5244 cmLListAdd2Tail(&ulCell->ueTxLst[0], &ulUe->txLnk);
5245 ulUe->txLnk.node = (PTR)ue;
5249 } /* rgSCHSc1SrRcvd */
5252 * @brief Indication of UL CQI
5256 * Function : rgSCHSc1UlCqiInd
5258 * - Common Scheduler. SC1 does nothing.
5260 * @param[in] RgSchCellCb *cell
5261 * @param[in] RgSchUeCb *ue
5262 * @param[in] TfuUlCqiRpt *ulCqiInfo
5266 PUBLIC Void rgSCHSc1UlCqiInd
5270 TfuUlCqiRpt *ulCqiInfo
5273 PUBLIC Void rgSCHSc1UlCqiInd(cell, ue, ulCqiInfo)
5276 TfuUlCqiRpt *ulCqiInfo;
5279 TRC2(rgSCHSc1UlCqiInd);
5281 /* Stack Crash problem for TRACE5 changes. Added the return below */
5287 * @brief UL Lcg received data updation
5291 * Function : rgSCHSc1UlLcgUpd
5293 * Processing Steps:Sc1 Does nothing
5295 * @param[in] RgSchCellCb *cell
5296 * @param[in] RgSchUeCb *ue
5297 * @param[in] RgInfUeDatInd *datInd
5301 PUBLIC S16 rgSCHSc1UlLcgUpd
5305 RgInfUeDatInd *datInd
5308 PUBLIC S16 rgSCHSc1UlLcgUpd(cell, ue)
5311 RgInfUeDatInd *datInd;
5315 TRC2(rgSCHSc1UlLcgUpd);
5321 /***********************************************************
5323 * Func : rgSCHSc1UlUeRefresh
5325 * Desc : Handle 'refresh' for uplink part of a UE
5326 * (ie UE's uplink AMBR and uplink GBR LCGs are
5327 * refreshed at this point)
5335 **********************************************************/
5337 PUBLIC Void rgSCHSc1UlUeRefresh
5343 PUBLIC Void rgSCHSc1UlUeRefresh(cell, ue)
5348 TRC2(rgSCHSc1UlUeRefresh);
5349 rgSCHSc1UlPosnUeInQ(cell, ue);
5354 * @brief This function Processes the Final Allocations
5355 * made by the RB Allocator against the requested
5356 * UE data Trans Allocations.
5360 * Function: rgSCHSc1UlDatTransAllocFnlz
5361 * Purpose: This function Processes the Final Allocations
5362 * made by the RB Allocator against the requested
5363 * UE data Trans Allocations .
5365 * Invoked by: Scheduler
5367 * @param[in] RgSchCellCb *cell
5368 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
5373 PRIVATE Void rgSCHSc1UlDatTransAllocFnlz
5376 RgSchCmnUlRbAllocInfo *allocInfo
5379 PRIVATE Void rgSCHSc1UlDatTransAllocFnlz(cell, allocInfo)
5381 RgSchCmnUlRbAllocInfo *allocInfo;
5387 RgSchDrxUeCb *drxUe = NULLP;
5388 CmLListCp ulInactvLst; /* list of UE's becoming UL-inactive */
5389 TRC2(rgSCHSc1UlDatTransAllocFnlz);
5391 cmLListInit(&ulInactvLst);
5392 node = allocInfo->schdUeLst.first;
5395 ue = (RgSchUeCb *)node->node;
5397 ueUl = RG_GET_SC1_UE_UL(ue, cell);
5399 if (ue->isDrxEnabled)
5401 if(ueUl->srRcvd == TRUE)
5403 drxUe = RG_SCH_DRX_GET_UE(ue);
5404 drxUe->drxUlInactvMask |= RG_SCH_DRX_SR_BITMASK;
5406 if(!RG_SCH_DRX_UL_IS_UE_ACTIVE(drxUe))
5408 ue->ul.ulInactvMask |= RG_DRX_INACTIVE;
5409 /* Add to Ul inactive List */
5410 ue->ulDrxInactvLnk.node = (PTR)ue;
5411 cmLListAdd2Tail(&ulInactvLst,&(ue->ulDrxInactvLnk));
5413 drxUe->srRcvd = FALSE;
5416 /* Reset no matter */
5417 ueUl->srRcvd = FALSE;
5418 /* Reposition UE in Qs */
5419 rgSCHSc1UlPosnUeInQ(cell, ue);
5423 rgSCHCmnHdFddUpdULMark (cell,ue);
5426 /* reset the UE UL allocation Information */
5427 rgSCHCmnUlUeResetTemp(cell, ue);
5429 rgSCHSc1UlHndlInActUes(cell, &ulInactvLst);
5430 node = allocInfo->nonSchdUeLst.first;
5433 ue = (RgSchUeCb *)node->node;
5435 /* reset the UE UL allocation Information */
5436 rgSCHCmnUlUeResetTemp(cell, ue);
5443 * @brief This function Processes the Final Allocations
5444 * made by the RB Allocator against the requested
5445 * cont res Allocations.
5449 * Function: rgSCHSc1UlContResAllocFnlz
5450 * Purpose: This function Processes the Final Allocations
5451 * made by the RB Allocator against the requested
5452 * cont res Allocations .
5454 * Invoked by: Scheduler
5456 * @param[in] RgSchCellCb *cell
5457 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
5462 PRIVATE Void rgSCHSc1UlContResAllocFnlz
5465 RgSchCmnUlRbAllocInfo *allocInfo
5468 PRIVATE Void rgSCHSc1UlContResAllocFnlz(cell, allocInfo)
5470 RgSchCmnUlRbAllocInfo *allocInfo;
5473 RgSchSc1UlCell *sc1UlCell = RG_GET_SC1_CELL_UL(cell);
5477 TRC2(rgSCHSc1UlContResAllocFnlz);
5479 node = allocInfo->schdContResLst.first;
5482 ue = (RgSchUeCb *)node->node;
5487 rgSCHCmnHdFddUpdULMark (cell,ue);
5490 ueUl = RG_GET_SC1_UE_UL(ue, cell);
5492 /* Remove UE from Cont Res Q */
5493 cmLListDelFrm(&sc1UlCell->contResLst,
5495 ueUl->contResLnk.node = NULLP;
5496 /* reset the UE UL allocation Information */
5497 rgSCHCmnUlUeResetTemp(cell, ue);
5500 node = allocInfo->nonSchdContResLst.first;
5503 ue = (RgSchUeCb *)node->node;
5505 /* reset the UE UL allocation Information */
5506 rgSCHCmnUlUeResetTemp(cell, ue);
5513 * @brief This function Processes the Final Allocations
5514 * made by the RB Allocator against the requested.
5518 * Function: rgSCHSc1UlAllocFnlz
5519 * Purpose: This function Processes the Final Allocations
5520 * made by the RB Allocator against the requested.
5522 * Invoked by: Common Scheduler
5524 * @param[in] RgSchCellCb *cell
5525 * @param[in] RgSchCmnDlRbAllocInfo *allocInfo
5530 PUBLIC Void rgSCHSc1UlAllocFnlz
5533 RgSchCmnUlRbAllocInfo *allocInfo
5536 PUBLIC Void rgSCHSc1UlAllocFnlz(cell, allocInfo)
5538 RgSchCmnUlRbAllocInfo *allocInfo;
5541 TRC2(rgSCHSc1UlAllocFnlz);
5543 rgSCHSc1UlContResAllocFnlz(cell, allocInfo);
5544 rgSCHSc1UlDatTransAllocFnlz(cell, allocInfo);
5551 * @brief Scheduler invocation
5555 * Function: rgSCHSc1UlActvtUe
5556 * Purpose: Put back the UE in to appropriate Qs.
5558 * Invoked by: Common Scheduler
5560 * @param[in] RgSchCellCb *cell
5561 * @param[in] RgSchUeCb *ue
5565 PUBLIC Void rgSCHSc1UlActvtUe
5571 PUBLIC Void rgSCHSc1UlActvtUe(cell, ue)
5576 TRC2(rgSCHSc1UlActvtUe);
5578 rgSCHSc1UlPosnUeInQ(cell, ue);
5583 * @brief Scheduler invocation
5587 * Function: rgSCHSc1UlHndlInActUes
5588 * Purpose: The list of inactive UEs present in inactvLst should
5589 * be removed from the scheduling Qs.
5590 * But store the information pertaining to which Qs,
5591 * were they belonging to. This information shall be used
5592 * to put them back in appropriate Qs when their Activation
5595 * Invoked by: Common Scheduler (TTI processing)
5597 * @param[in] RgSchCellCb *cell
5598 * @param[out] CmLListCp *inactvLst
5602 PUBLIC Void rgSCHSc1UlHndlInActUes
5605 CmLListCp *inactvLst
5608 PUBLIC Void rgSCHSc1UlHndlInActUes(cell, inactvLst)
5610 CmLListCp *inactvLst;
5615 RgSchSc1UlCell *cellUl = RG_GET_SC1_CELL_UL(cell);
5616 CmLList *node = inactvLst->first;
5618 TRC2(rgSCHSc1UlHndlInActUes);
5622 ue = (RgSchUeCb *)node->node;
5624 ulUe = RG_GET_SC1_UE_UL(ue, cell);
5625 if(ulUe->txLnk.node)
5627 cmLListDelFrm(&(cellUl->ueTxLst[ulUe->qId]), &(ulUe->txLnk));
5628 /* This is required as lcg bs might change during
5629 * inactivity to activity. So we need to recompute
5631 ulUe->txLnk.node = NULLP;
5633 /* Do not remove UE from contResLst */
5638 * @brief Scheduler invocation
5642 * Function: rgSCHSc1DlProcRmvFrmRetx
5643 * Purpose: To remove the Harq process from the cell and from the UE
5644 * retransmission list
5646 * Invoked by: Common Scheduler (TTI processing)
5648 * @param[in] RgSchCellCb *cell
5649 * @param[in] RgSchUeCb *ue;
5650 * @param[in] RgSchDlHqProcCb *hqP
5655 PUBLIC Void rgSCHSc1DlProcRmvFrmRetx(
5658 RgSchDlHqProcCb *hqP
5661 PUBLIC Void rgSCHSc1DlProcRmvFrmRetx(cell, ue, hqP)
5664 RgSchDlHqProcCb *hqP;
5667 TRC2(rgSCHSc1DlProcRmvFrmRetx);
5668 /* Remove the HqP from retx Queue.
5670 rgSCHSc1DlProcRmvFrmCellRetx(cell, hqP);
5671 rgSCHSc1DlProcRmvFrmUeRetx(cell, ue, hqP);
5678 /**********************************************************************
5681 **********************************************************************/