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 Entry point fucntions
29 **********************************************************************/
31 /** @file rg_sch_tmr.c
32 @brief This module does processing related to timers for the scheduler.
34 static const char* RLOG_MODULE_NAME="MAC";
35 static int RLOG_MODULE_ID=4096;
36 static int RLOG_FILE_ID=175;
38 /* header include files -- defines (.h) */
39 #include "common_def.h"
40 #include "tfu.h" /* RGU defines */
41 #include "lrg.h" /* layer management defines for LTE-MAC */
42 #include "rgr.h" /* layer management defines for LTE-MAC */
43 #include "rg_env.h" /* defines and macros for MAC */
44 #include "rg_sch_err.h" /* defines and macros for MAC */
45 #include "rg_sch_inf.h" /* defines and macros for MAC */
46 #include "rg_sch.h" /* defines and macros for MAC */
47 #include "rl_interface.h"
48 #include "rl_common.h"
51 /* header/extern include files (.x) */
52 #include "tfu.x" /* RGU types */
53 #include "lrg.x" /* layer management typedefs for MAC */
54 #include "rgr.x" /* layer management typedefs for MAC */
55 #include "rg_sch_inf.x" /* typedefs for MAC */
56 #include "rg_sch.x" /* typedefs for MAC */
59 EXTERN Void rgSCHSCellActivation ARGS((
60 RgSchUeCellInfo *sCell
63 /** @brief This function is a utility function to start timers, it is a
68 * Function: rgSCHTmrStartTmr
71 * - Starts timer at scheduler
73 * @param[in] RgSchCellCb *cell
75 * @param[in] S16 tmrEvnt
76 * @param[in] uint32_t tmrVal
88 Void rgSCHTmrStartTmr (cell, cb, tmrEvnt, tmrVal)
98 RgSchUeCellInfo *sCellCb = NULLP;
104 if(tmrEvnt == RG_SCH_TMR_SCELL_DEACT)
106 sCellCb = (RgSchUeCellInfo *)cb;
116 case RG_SCH_TMR_ACKNACK_REP:
117 arg.timers = &(ue->ackNakRepCb.ackNakRepTmr);
118 RLOG_ARG0(L_ERROR,DBG_INSTID,cell->instIdx,
119 "Hit AckNackRep timer");
121 case RG_SCH_TMR_MEASGAP:
122 arg.timers = &(ue->measGapCb.measGapTmr);
124 case RG_SCH_TMR_UL_ACKNACK:
125 arg.timers = &(ue->ackNakRepCb.ackNakRepUlInactvTmr);
127 case RG_SCH_TMR_DL_ACKNACK:
128 arg.timers = &(ue->ackNakRepCb.ackNakRepDlInactvTmr);
130 case RG_SCH_TMR_UL_MEASGAP:
131 arg.timers = &(ue->measGapCb.measGapUlInactvTmr);
133 case RG_SCH_TMR_DL_MEASGAP:
134 arg.timers = &(ue->measGapCb.measGapDlInactvTmr);
137 arg.timers = &(ue->taTmr);
139 /*MS_WORKAROUND for CR FIXME */
143 arg.timers = &(ue->bsrTmr);
149 #ifdef NO_BSR_SR_5GTF
152 arg.timers = &(ue->bsrTmr);
156 case RG_SCH_TMR_TXMODE_TRNSTN:
158 arg.timers = &(ue->txModeTransTmr);
162 case RG_SCH_TMR_SCELL_DEACT:
164 arg.timers = &(sCellCb->deactTmr);
167 case RG_SCH_TMR_SCELL_ACT_DELAY:
169 sCellCb = (RgSchUeCellInfo *)cb;
170 arg.timers = &(sCellCb->actDelayTmr);
175 RLOG_ARG0(L_ERROR,DBG_INSTID,cell->instIdx,
176 "rgSCHTmrStartTmr() Incorrect Timer event");
180 arg.tqCp = &(cell->tqCp);
192 /** @brief This function stops the timer.
196 * Function: rgSCHTmrStopTmr
199 * - Stops timer at scheduler.
201 * @param[in] RgSchCellCb *cell
202 * @param[in] S16 tmrEvnt
214 Void rgSCHTmrStopTmr (cell, tmrEvnt, cb)
223 RgSchUeCellInfo *sCellCb = NULLP;
229 if(tmrEvnt == RG_SCH_TMR_SCELL_DEACT)
231 sCellCb = (RgSchUeCellInfo *)cb;
241 case RG_SCH_TMR_ACKNACK_REP:
242 arg.timers = &(ue->ackNakRepCb.ackNakRepTmr);
244 case RG_SCH_TMR_MEASGAP:
245 arg.timers = &(ue->measGapCb.measGapTmr);
247 case RG_SCH_TMR_UL_ACKNACK:
248 arg.timers = &(ue->ackNakRepCb.ackNakRepUlInactvTmr);
250 case RG_SCH_TMR_DL_ACKNACK:
251 arg.timers = &(ue->ackNakRepCb.ackNakRepDlInactvTmr);
253 case RG_SCH_TMR_UL_MEASGAP:
254 arg.timers = &(ue->measGapCb.measGapUlInactvTmr);
256 case RG_SCH_TMR_DL_MEASGAP:
257 arg.timers = &(ue->measGapCb.measGapDlInactvTmr);
260 arg.timers = &(ue->taTmr);
262 /*MS_WORKAROUND for CR FIXME */
267 arg.timers = &(ue->bsrTmr);
273 #ifdef NO_BSR_SR_5GTF
276 arg.timers = &(ue->bsrTmr);
281 case RG_SCH_TMR_TXMODE_TRNSTN:
283 arg.timers = &(ue->txModeTransTmr);
287 case RG_SCH_TMR_SCELL_DEACT:
289 arg.timers = &(sCellCb->deactTmr);
292 case RG_SCH_TMR_SCELL_ACT_DELAY:
294 sCellCb = (RgSchUeCellInfo *)cb;
295 arg.timers = &(sCellCb->actDelayTmr);
301 RLOG_ARG0(L_ERROR,DBG_INSTID,cell->instIdx,
302 "rgSCHTmrStopTmr() Incorrect Timer event");
306 arg.tqCp = &(cell->tqCp);
317 /** @brief This function handles timer expiry.
321 * Function: rgSCHTmrProcTmr
324 * - Handles processing on timer expiry at scheduler.
327 * @param[in] S16 tmrEvnt
337 Void rgSCHTmrProcTmr (cb, tmrEvnt)
342 RgSchUeCb *ue = NULLP;
344 RgSchUeCellInfo *sCellCb = NULLP;
350 if(tmrEvnt == RG_SCH_TMR_SCELL_DEACT)
352 sCellCb = (RgSchUeCellInfo *)cb;
363 case RG_SCH_TMR_ACKNACK_REP:
364 rgSCHAckNakRepTmrExpry (ue);
366 case RG_SCH_TMR_MEASGAP:
367 rgSCHMeasGapANRepTmrExpry (ue);
369 case RG_SCH_TMR_UL_MEASGAP:
370 case RG_SCH_TMR_UL_ACKNACK:
371 rgSCHMeasGapANRepUlInactvTmrExpry (ue, (uint8_t)tmrEvnt);
373 case RG_SCH_TMR_DL_ACKNACK:
374 case RG_SCH_TMR_DL_MEASGAP:
375 rgSCHMeasGapANRepDlInactvTmrExpry (ue, (uint8_t)tmrEvnt);
379 /*TODO Needto handle TA Timer expiry for EMTC UE*/
380 if(TRUE == ue->isEmtcUe)
382 RLOG0(L_INFO,"TA Timer Expiry is not handled for EMTC UE\n");
386 rgSCHDhmProcTAExp (ue);
388 /*MS_WORKAROUND for CR FIXME */
392 rgSCHCmnBsrTmrExpry(ue);
398 rgSCHCmnBsrTmrExpry(ue);
403 case RG_SCH_TMR_TXMODE_TRNSTN:
405 ue->txModeTransCmplt = TRUE;
409 case RG_SCH_TMR_SCELL_DEACT:
411 rgSCHSCellDeactTmrExpry(sCellCb);
414 case RG_SCH_TMR_SCELL_ACT_DELAY:
416 sCellCb = (RgSchUeCellInfo *)cb;
417 rgSCHSCellActivation(sCellCb);
424 RLOG_ARG0(L_ERROR,DBG_INSTID,ue->cell->instIdx,
425 "rgSCHTmrProcTmr() Incorrect Timer event");
433 /**********************************************************************
436 **********************************************************************/