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 functions.
29 **********************************************************************/
31 /** @file rg_sch_cfg.c
32 @brief This module handles the configuration of SCH by RRC and RRM.
35 static const char* RLOG_MODULE_NAME="MAC";
36 static int RLOG_FILE_ID=186;
37 static int RLOG_MODULE_ID=4096;
39 /* header include files -- defines (.h) */
40 #include "common_def.h"
46 #include "rg_sch_inf.h"
48 #include "rg_sch_err.h"
49 #include "rg_sch_cmn.h"
50 #include "rl_interface.h"
51 #include "rl_common.h"
53 /* header/extern include files (.x) */
54 #include "tfu.x" /* TFU types */
55 #include "lrg.x" /* layer management typedefs for MAC */
56 #include "rgr.x" /* layer management typedefs for MAC */
57 #include "rgm.x" /* layer management typedefs for MAC */
58 #include "rg_sch_inf.x" /* typedefs for MAC */
59 #include "rg_sch.x" /* typedefs for MAC */
60 /* [ccpu00124018]-MOD- Retrieving CQI value from cell config*/
61 #include "rg_sch_cmn.x"
62 #include "rg_sch_clist.x"
65 /* LTE-MAC Scheduler instance control block structures */
66 RgSchCb rgSchCb[RGSCH_MAX_INST];
68 #ifdef PHY_ERROR_LOGING
69 RgSchUlAllocCntr rgSchUlAllocCntr;
73 Void rgSCHEmtcPOTrigger ARGS ((
78 S16 rgSchEmtcUpdSiCfg ARGS ((
80 RgrCellRecfg *cellRecfg
83 S16 rgSCHEmtcCfgVldtDrxReTxCfg ARGS((
87 S16 rgSCHEmtcCfgVldtDrxUlReTxCfg ARGS((
92 S16 rgSCHEnbPfsDlCfg ARGS((
97 static S16 rgSCHCfgRgrUeRecfgRntiChg ARGS (( RgSchCellCb *cell,
98 RgSchUeCb *ue, RgrUeRecfg *ueRecfg, RgSchErrInfo *errInfo));
99 static S16 rgSCHCfgVldtUePwrCfg ARGS((RgSchCellCb *cell,
100 RgrUeUlPwrCfg *pwrCfg));
101 static S16 rgSCHCfgVldtUeGrpPwrCfg ARGS((RgSchCellCb *cell,
102 RgrUeGrpPwrCfg *grpPwrCfg));
104 static S16 rgSCHCfgVldtUeDlSpsCfg ARGS((RgSchCellCb *cell,
105 RgrUeSpsDlCfg *dlSpsCfg));
106 static S16 rgSCHCfgVldtSpsReCfg ARGS ((RgSchCellCb *cell,
107 RgSchUeCb *ue, RgrUeRecfg *ueRecfg));
108 #endif /*LTEMAC_SPS*/
109 static S16 rgSCHCfgVldtUeCqiModeCfg ARGS((RgSchCellCb *cell,RgrUeDlCqiCfg *ueDlCqiCfg));
110 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg ARGS ((RgSchCellCb *cell,
112 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg ARGS ((RgSchCellCb *cell,
113 RgrUeRecfg *ueRecfg));
114 static Void rgSCHCfgFreeDlDedLcCb ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
116 static Void rgSCHCfgFreeDlCmnLcCb ARGS((RgSchClcDlLcCb *cmnDlLc));
117 static Void rgSCHCfgFreeUeCb ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
118 static Void rgSCHCfgFreeRgrCfgLst ARGS((RgSchCellCb *cell));
119 static Void rgSCHCfgFreeCmnLcLst ARGS((RgSchCellCb *cell));
120 static Void rgSCHCfgFreeUeLst ARGS((RgSchCellCb *cell));
122 static Void rgSCHCfgFreeSpsUeLst ARGS((RgSchCellCb *cell));
124 static S16 rgSCHCfgVldtRgrCmnLcCfg ARGS((Inst inst, RgrCellCfg *cellCfg,
125 RgSchErrInfo *errInfo));
126 static S16 rgSCHCfgVldtRgrCellPwrCfg ARGS((Inst inst, RgrCellCfg *cellCfg,
127 RgSchErrInfo *errInfo));
128 static S16 rgSCHCfgVldtRgrCellSchCfg ARGS((Inst inst, RgrCellCfg *cellCfg));
129 static S16 rgSCHCfgVldtRgrSchCfg ARGS((Inst inst, RgrSchedEnbCfg *schedEnbCfg));
130 static S16 rgSCHCfgVldtRgrCellRACfg ARGS((Inst inst, RgrCellCfg *cellCfg));
131 static Void rgSCHCfgRgrUePhrMsg3 ARGS(( RgSchCellCb *cell,
132 RgSchRaCb *raCb,RgSchUeCb *ue, RgSchErrInfo *errInfo));
133 static S16 rgSCHCfgRgrCmnLcCfg ARGS((RgSchCellCb *cell, RgrCmnLchCfg *lcCfg,
134 RgSchErrInfo *errInfo));
135 Void rgSCHSCellFreeBuf ARGS((Inst inst,RgSchUeCb *ue,RgrUeRecfg *ueRecfg,uint8_t idx));
137 static S16 rgSCHCfgVldtRgrCellSiCfg ARGS(( Inst inst, RgrSiCfg *siCfg));
138 #endif/*RGR_SI_SCH */
140 /* LTE_ADV_FLAG_REMOVED_START */
141 static S16 rgSCHCfgVldtRgrCellLteAdvCfg ARGS(( Inst inst,
142 RgrLteAdvancedCellConfig *lteAdvCfg, uint8_t dlTotalBw));
143 /* LTE_ADV_FLAG_REMOVED_END */
145 static S16 rgSCHCfgVldtDrxUeCfg ARGS ((RgSchCellCb *cell,
146 RgrUeDrxCfg *ueDrxCfg));
147 static S16 rgSCHCfgVldtDrxOnDurCfg ARGS((uint8_t onDurTmr));
148 static S16 rgSCHCfgVldtDrxInActvCfg ARGS((uint16_t inActvTmr));
149 static S16 rgSCHCfgVldtDrxReTxCfg ARGS((uint8_t reTxTmr));
150 static S16 rgSCHCfgVldtDrxLngCycCfg ARGS((RgrDrxLongCycleOffst lngCycleOffst));
151 static S16 rgSCHCfgVldtDrxLngCyclTmrs ARGS((uint16_t val));
152 static S16 rgSCHCfgVldtDrxShrtCycCfg ARGS((RgrDrxShortDrx shrtCycCfg));
153 static S16 rgSCHCfgVldtRgrCellCsgParamCfg ARGS((Inst inst,
154 RgrCellCsgParamCfg *csgParam));
157 S16 rgSCHCfgACqiUeCfg ARGS(( RgSchCellCb *cellCb,RgSchUeCb *ue, RgSchUeACqiCb *aCqiCb,
158 RgrTxMode ueTxMode,RgrUeAprdDlCqiCfg *aCqiCfg, CmLteUeCategory ueCat ));
160 S16 rgSCHCfgAcqiUeReCfg ARGS(( RgSchCellCb *cellCb, RgSchUeCb *ueCb,
161 RgrUeAprdDlCqiCfg *acqiCfg, CmLteUeCategory ueCat ));
163 S16 rgSCHUtlGetCfgPerOff ARGS(( RgSchPerTbl tbl, uint16_t cfgIdx,
164 uint16_t *peri, uint16_t *offset ));
166 S16 rgSCHCfgRiUeCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
167 RgrUePrdDlCqiCfg *cqiCfg, CmLteUeCategory ueCat ));
169 S16 rgSCHCfgPCqiUeCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
170 RgrUePrdDlCqiCfg *cqiCfg,CmLteUeCategory ueCat ));
172 S16 rgSCHCfgSrsUeCfg ARGS((RgSchCellCb *cellCb,RgSchUeCb *ueCb,
173 RgrUeUlSrsCfg *srsCfg ));
175 S16 rgSCHCfgSrUeCfg ARGS((RgSchCellCb *cellCb,RgSchUeCb *ueCb,
178 S16 rgSCHCfgPCqiUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
179 RgrUePrdDlCqiCfg *cqiCfg,CmLteUeCategory ueCat));
181 S16 rgSCHCfgSrsUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
182 RgrUeUlSrsCfg *srsCfg));
184 S16 rgSCHCfgSrUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
187 S16 rgSCHCfgVldtRgrTxmodePuschMode ARGS((RgSchCellCb *cellCb,
188 RgrTxMode txMde, RgrAprdCqiMode puschMode,RgSchErrInfo *errInfo));
190 S16 rgSCHCfgVldtRgrUeACqiCfg ARGS(( RgSchCellCb *cellCb,
191 CmLteRnti crnti, RgrUeAprdDlCqiCfg *acqiCfg, RgrUeTxModeCfg txMode,
192 RgSchErrInfo *errInfo ));
194 S16 rgSCHCfgVldtRgrTxmodePucchMode ARGS((RgSchCellCb *cellCb,
195 RgrTxMode txMde, RgrPrdCqiMode pucchMode,RgSchErrInfo *errInfo));
198 S16 rgSCHCfgVldtRgrUePCqiCfg ARGS(( RgSchCellCb *cellCb,
199 CmLteRnti crnti, RgrUePrdDlCqiCfg *cqiCfg, Bool hdFdd,
200 RgrUeTxModeCfg txMode, RgSchErrInfo *errInfo));
202 S16 rgSCHCfgVldtRgrUePCqiCfg ARGS(( RgSchCellCb *cellCb,
203 CmLteRnti crnti, RgrUePrdDlCqiCfg *cqiCfg, RgrUeTxModeCfg txMode,
204 RgSchErrInfo *errInfo));
207 S16 rgSCHCfgVldtRgrUeUlSrsCfg ARGS ((RgSchCellCb *cellCb,
208 CmLteRnti crnti, RgrUeUlSrsCfg *srsCfg, Bool hdFdd,
209 RgSchErrInfo *errInfo));
211 S16 rgSCHCfgVldtRgrUeUlSrsCfg ARGS ((RgSchCellCb *cellCb,
212 CmLteRnti crnti, RgrUeUlSrsCfg *srsCfg,
213 RgSchErrInfo *errInfo));
217 S16 rgSCHCfgVldtRgrUeSrCfg ARGS((RgSchCellCb *cellCb, CmLteRnti crnti,
218 RgrUeSrCfg *srCfg, Bool hdFdd, RgSchErrInfo *errInfo));
220 S16 rgSCHCfgVldtRgrUeSrCfg ARGS((RgSchCellCb *cellCb, CmLteRnti crnti,
221 RgrUeSrCfg *srCfg, RgSchErrInfo *errInfo));
223 static S16 rgSCHCfgVldtCqiSrSrsUeCfg ARGS (( RgSchCellCb *cellCb,
225 RgSchErrInfo *errInfo));
227 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg ARGS (( RgSchCellCb *cellCb,
230 RgSchErrInfo *errInfo ));
232 S16 rgSCHCfgPCqiSrsSrUeDel ARGS ((RgSchCellCb *cellCb,
235 static Void rgSCHCfgUtlFetchAcqiBitSz ARGS (( RgSchUeACqiCb *acqiCb,uint8_t numTxAnt,
236 uint8_t* cqiPmiSzR1,uint8_t* cqiPmiSzRn1 ));
238 /* Added the function to be used instead of the
239 * MACRO RG_SCH_GET_PERIODICITY_TBL */
240 static const RgSchUePCqiSrsSrCfgIdxTbl* rgSCHCfgUtlGetPcqiSrsSrRiTbl ARGS ((
245 #endif /* TFU_UPGRADE */
246 static Void rgSCHCfgUeTaRecfg ARGS (( RgSchCellCb *cellCb,
249 RgSchErrInfo *errInfo ));
251 S16 rgSCHSCellCfgUeCfg ARGS((
258 S16 rgSCHSCellCfgUePucchReCfg ARGS((
264 S16 rgSCHCfgVldtRgrUeSCellRecfg ARGS((
268 RgSchErrInfo *errInfo
270 static S16 rgSCHSCellCfgUeCfgRollBack ARGS((
277 /* ccpu00117452 - MOD - Changed macro name from
278 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
279 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
280 static S16 rgSCHCfgUeCqiReptReCfg ARGS ((
286 static S16 rgSCHCfgVldtCqiReptReCfg ARGS ((
291 /*LTE_L2_MEAS_PHASE2*/
293 static S16 rgSchAddToL2Meas ARGS ((RgSchCellCb *cellCb,RgSchDlLcCb *dlLc));
296 S16 rgSCHEmtcCfgVldtDrxOnDurCfg
300 Void rgSCHUtlUpdEmtcY
304 Void rgSCHEmtcHqPAlloc
312 const RgSchSrsTxOffst rgSrsTxOffstTbl[RGSCH_MAX_SRS_SFCFG_IDX+1]=
313 {{1,{0,0,0,0,0,0,0,0}},
314 {1,{0,0,0,0,0,0,0,0}},
315 {1,{1,0,0,0,0,0,0,0}},
316 {1,{0,0,0,0,0,0,0,0}},
317 {1,{1,0,0,0,0,0,0,0}},
318 {1,{2,0,0,0,0,0,0,0}},
319 {1,{3,0,0,0,0,0,0,0}},
320 {2,{0,1,0,0,0,0,0,0}},
321 {2,{2,3,0,0,0,0,0,0}},
322 {1,{0,0,0,0,0,0,0,0}},
323 {1,{1,0,0,0,0,0,0,0}},
324 {1,{2,0,0,0,0,0,0,0}},
325 {1,{3,0,0,0,0,0,0,0}},
326 {7,{0,1,2,3,4,6,8,0}},
327 {8,{0,1,2,3,4,5,6,8}},
328 {0,{0,0,0,0,0,0,0,0}}};
333 /* SRSCfg Table: Ref 36.213, Table: 8.2.1 */
334 const RgSchUePCqiSrsSrCfgIdxTbl
335 rgSchUeSrsCfgIdxFddTbl[RG_SCH_SRS_ISRS_INDX_MAX_FDD]=
347 /* Reference : 36.213 Table 8.2-2 */
348 const RgSchUePCqiSrsSrCfgIdxTbl
349 rgSchUeSrsCfgIdxTddTbl[RG_SCH_SRS_ISRS_INDX_MAX_TDD]=
356 { 165,324,160, 165 },
358 /* RESERVED: Configuration Module should not allow Res values */
361 /*Reference: 36.213 Table:7.2.2-1A */
362 const RgSchUePCqiSrsSrCfgIdxTbl
363 rgSchUePCqiCfgIdxFddTbl[RG_SCH_CQIPMI_CFGIDX_MAX_FDD]=
375 /* RESERVED: Configuration should not allow Res values */
378 /* Reference: 36.213 Table:7.2.2-1C */
379 const RgSchUePCqiSrsSrCfgIdxTbl
380 rgSchUeCqiPmiCfgIdxTddTbl[RG_SCH_CQIPMI_CFGIDX_MAX_TDD]=
389 /* RESERVED: Configuration should not allow Res values */
392 /* Note: RI table is same for FDD and TDD */
393 /*Reference: 36.213 Table:7.2.2-1B */
394 const RgSchUePCqiSrsSrCfgIdxTbl
395 rgSchUeRiCfgIdxTbl[RG_SCH_RI_CFGIDX_MAX]=
403 /* RESERVED: Configuration should not allow Res values */
406 /*Reference: 36.213 Table:7.2.2-2 */
407 const RgSchUeBwSubSzBwParts
408 rgSchUeBwSubSzBwPartsTbl[RG_SCH_BW_SUBSZ_BWPARTS_MAX]=
410 {6,7, 0, 0}, /*TODO: 6,7, NA, NA */
418 /* Reference : 36.213 Table 10.1-5 */
419 /* Note: SR is same table for TDD and FDD */
420 const RgSchUePCqiSrsSrCfgIdxTbl rgSchUeSrCfgIdxTbl[RG_SCH_ISR_INDX_MAX]=
427 /* RESERVED: Configuration should not allow Res values */
430 /*Reference:36.213: Derived from Table: 7.2.1-5 for Label L.
431 The Label L is CEIL(log2(BinCoe(N and M)))*/
432 const uint8_t RgSCHUeAcqi2022LBitWidth[6][28] ={
433 {0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5},
434 {0,0,2,3,4,4,5,5,6,6,6,7,7,7,7,7,8,8,8,8,8,8,8,9,9,9,9,9},
435 {0,0,0,2,4,5,6,6,7,7,8,8,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,12},
436 {0,0,0,0,3,4,6,7,7,8,9,9,10,10,11,11,12,12,12,13,13,13,14,14,14,14,15,15},
437 {0,0,0,0,0,3,5,6,7,8,9,10,11,11,12,13,13,14,14,14,15,15,16,16,16,17,17,17},
438 {0,0,0,0,0,0,3,5,7,8,9,10,11,12,13,13,14,15,15,16,16,17,17,18,18,18,19,19}
443 extern uint8_t rgSchCmnHarqRtt[];
445 S16 rgSCHEmtcCellAlloc ARGS((RgSchCellCb *cel));
446 Void rgSCHEmtcCellFree ARGS((RgSchCellCb *cel));
447 Void rgSCHEmtcUeInfoFree ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
448 uint8_t rgSchfillPucchSrRepNumCountemtc ARGS((RgSchUeCb *ueCb));
449 uint8_t rgSchfillPucchCqiRepNumCountemtc ARGS((RgSchUePCqiCb *cqiCb, RgSchUeCb *ueCb));
450 S16 rgEmtcvalidateSiCfg ARGS((RgrSiCfgReqInfo *siCfg,RgSchCellCb *cell));
452 /* forward references */
456 * @brief Validates the SCH EndoeB configuration request from RRM to SCH.
460 * Function : rgSCHCfgVldtRgrSchedEnbCfg
463 * - Retrieve the cell control block.
465 * - Validate the range of configured values recieved in
466 * configuration request.
467 * - If validated successfully,
468 * - Return ROK and pointer to the cell.
471 * - Else return RFAILED.
472 * @param[in] Inst inst
473 * @param[in] RgrSchedEnbCfg *schedEnbCfg
474 * @param[out] RgSchCellCb **cell
475 * @param[out] RgSchErrInfo *errInfo
481 S16 rgSCHCfgVldtRgrSchedEnbCfg
484 RgrSchedEnbCfg *schedEnbCfg,
485 RgSchErrInfo *errInfo
488 S16 rgSCHCfgVldtRgrSchedEnbCfg(inst, schedEnbCfg, errInfo)
490 RgrSchedEnbCfg *schedEnbCfg;
491 RgSchErrInfo *errInfo;
494 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "VALIDATE RGR SCH ENB CONFIG: \n"));
496 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
499 if ((rgSCHCfgVldtRgrSchCfg(inst, schedEnbCfg)) != ROK)
501 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Validation for scheduler related "
506 RLOG1(L_INFO, "MIMO_DBG:: SCH:: numAntPorts=%d\n",schedEnbCfg->numTxAntPorts);
508 /* Validation for the ENB parameters */
509 if ((schedEnbCfg->numTxAntPorts == 0) || (schedEnbCfg->numTxAntPorts > 4))
511 RGSCHDBGERR(inst, (rgSchPBuf(inst),"Invalid number of transmit antenna"
512 " ports %d\n", schedEnbCfg->numTxAntPorts));
516 /* Validate csg access mode */
517 if((schedEnbCfg->accsMode < RGR_CELL_ACCS_OPEN) ||
518 (schedEnbCfg->accsMode > RGR_CELL_ACCS_HYBRID))
520 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Invalid CSG Access mode\n"));
524 errInfo->errCause = RGSCHERR_NONE;
525 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR SCHED ENB config validation done:"\n));
528 } /* rgSCHCfgVldtRgrSchedEnbCfg */
531 * @brief Validates the cell configuration request from RRM to MAC.
535 * Function : rgSCHCfgVldtRgrCellCfg
538 * - Retrieve the cell control block.
540 * - Validate the range of configured values recieved in
541 * configuration request.
542 * - If validated successfully,
543 * - Return ROK and pointer to the cell.
546 * - Else return RFAILED.
547 * @param[in] Inst inst
548 * @param[in] RgrCellCfg *cellCfg
549 * @param[out] RgSchCellCb **cell
550 * @param[out] RgSchErrInfo *errInfo
556 S16 rgSCHCfgVldtRgrCellCfg
561 RgSchErrInfo *errInfo
564 S16 rgSCHCfgVldtRgrCellCfg(inst, cellCfg, cell, errInfo)
568 RgSchErrInfo *errInfo;
571 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_CFG;
573 /* check if cell exists already */
574 if ((uint8_t *)cell != NULLP)
576 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Cell Id already exists");
580 if(cellCfg->macInst >= SCH_INST_START)
582 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid MAC Instance %d ",
587 if (cellCfg->macRnti.startRnti < RGSCH_MIN_MAC_RNTI )
589 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid start RNTI %d for cell ",
590 cellCfg->macRnti.startRnti);
594 if ((rgSCHCfgVldtRgrCellSchCfg(inst, cellCfg)) != ROK)
596 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for scheduler related "
601 if ((cellCfg->dlHqCfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
602 (cellCfg->dlHqCfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX))
604 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid Downlink HARQ configuration:"
605 " maxDlHqTx %d maxMsg4HqTx %d", cellCfg->dlHqCfg.maxDlHqTx,
606 cellCfg->dlHqCfg.maxMsg4HqTx);
609 if ((cellCfg->cfiCfg.cfi < RGSCH_MIN_CFI_VAL) ||
610 (cellCfg->cfiCfg.cfi > RGSCH_MAX_CFI_VAL))
612 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid CFI configuration %d",
613 cellCfg->cfiCfg.cfi);
616 if (((cellCfg->puschSubBand.subbandStart) +
617 ((cellCfg->puschSubBand.numSubbands -1) * cellCfg->puschSubBand.size))
618 > (cellCfg->bwCfg.ulTotalBw - 1))
620 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid PUSCH subband configuration:"
621 " subBandStart %d numSubBands %d subBandSize %d ulTotBw %d",
622 cellCfg->puschSubBand.subbandStart,
623 cellCfg->puschSubBand.numSubbands, cellCfg->puschSubBand.size,
624 cellCfg->bwCfg.ulTotalBw);
628 if (((cellCfg->bwCfg.dlTotalBw < RGSCH_MIN_DL_BW) ||
629 (cellCfg->bwCfg.dlTotalBw > RGSCH_MAX_DL_BW)) ||
630 ((cellCfg->bwCfg.ulTotalBw < RGSCH_MIN_UL_BW) ||
631 (cellCfg->bwCfg.ulTotalBw > RGSCH_MAX_UL_BW)))
633 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid Bandwidth configuration:"
634 " ul %d dl %d",cellCfg->bwCfg.ulTotalBw,
635 cellCfg->bwCfg.dlTotalBw);
638 if (cellCfg->phichCfg.ngEnum > RGR_NG_TWO)
640 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid PHICH Ng configuration %d",
641 (uint8_t)cellCfg->phichCfg.ngEnum);
644 /* Validation for extended PHICH Duration */
645 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
646 (cellCfg->bwCfg.dlTotalBw <= 10) && (cellCfg->cfiCfg.cfi < 2))
648 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid cfi value for"
649 "Extended PHICH duration cfi:%d dlBw:%d",
650 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
653 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
654 (cellCfg->bwCfg.dlTotalBw > 10) && (cellCfg->cfiCfg.cfi < 3))
656 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid cfi value for"
657 "Extended PHICH duration cfi:%d dlBw:%d",
658 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
661 RLOG4(L_INFO,"CA_DBG:: PUCCH configuration:"
662 " N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
663 cellCfg->pucchCfg.resourceSize,
664 cellCfg->pucchCfg.n1PucchAn,
665 cellCfg->pucchCfg.deltaShift,
666 cellCfg->pucchCfg.cyclicShift);
668 /* ccpu00138567- Removing validation check for resourceSize as 0.
669 * From the spec, n2RB value 0 is a valid config. */
670 if ((cellCfg->pucchCfg.resourceSize >= cellCfg->bwCfg.ulTotalBw/2) ||
671 (cellCfg->pucchCfg.n1PucchAn == 0) ||
672 (cellCfg->pucchCfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
673 (cellCfg->pucchCfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS) ||
674 (cellCfg->pucchCfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
676 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid PUCCH configuration:"
677 " N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
678 cellCfg->pucchCfg.resourceSize,
679 cellCfg->pucchCfg.n1PucchAn,
680 cellCfg->pucchCfg.deltaShift,
681 cellCfg->pucchCfg.cyclicShift);
684 if (cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsBwEnum > RGR_SRS_BWCFG_7)
686 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid SRS configuration: "
687 " srsBw %d", (uint8_t)cellCfg->srsCfg.srsBwEnum);
691 if ((rgSCHCfgVldtRgrCellRACfg(inst, cellCfg)) != ROK)
693 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for Random access related"
698 if ((rgSCHCfgVldtRgrCellPwrCfg(inst, cellCfg, errInfo)) != ROK)
700 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for cell power "
705 /* Validate the common logical channel configuration */
706 if( (cellCfg->numCmnLcs < RGR_MIN_CMN_LC_PER_CELL)||
707 (cellCfg->numCmnLcs > RGR_MAX_CMN_LC_PER_CELL))
709 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid number(%d) of common logical"
710 "channels in cell config", cellCfg->numCmnLcs);
713 if ((rgSCHCfgVldtRgrCmnLcCfg(inst, cellCfg, errInfo)) != ROK)
715 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for common logical"
720 /* Added 0 as a valid value for number of TICKs RRM
721 * 0 implies no ticks i.e. shutting off the feature.*/
724 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellCfg->siCfg))) != ROK)
726 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for SI"
727 "configuration failed");
730 #endif /*RGR_SI_SCH */
732 /*ccpu00116923 - ADD - Srs Present support - Start*/
735 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 13)
737 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 14)
740 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid"
741 "Subframe configuration");
745 /*ccpu00116923 - ADD - Srs Present support - End*/
747 if ((cellCfg->bcchTxPwrOffset > 10000) ||
748 (cellCfg->pcchTxPwrOffset > 10000) ||
749 (cellCfg->rarTxPwrOffset > 10000) ||
750 (cellCfg->phichTxPwrOffset > 10000)
753 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
754 "Invalid txPower offset ");
758 /* LTE_ADV_FLAG_REMOVED_START */
759 /* Checking Whether DSFR is enabled without enabling SFR */
760 if(((cellCfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
761 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.dsfrCfg.status)) &&
762 (!((cellCfg->rgrLteAdvCfg.pres & RGR_SFR) &&
763 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.sfrCfg.status))))
765 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "DSFR is enbaled"
766 "Without enabling SFR");
770 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellCfg->rgrLteAdvCfg),
771 cellCfg->bwCfg.dlTotalBw)) != ROK)
773 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for LTE Adv"
774 "configuration failed");
778 if ((rgSCHCfgVldtRgrCellLteLAACfg(inst, cellCfg)) != ROK)
780 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for LTE LAA"
781 "configuration failed");
785 /* LTE_ADV_FLAG_REMOVED_END */
786 if (cellCfg->msg4pAVal > RGRUE_DLPWRCNTRL_PA_DB3)
788 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid"
789 "msg4pAVal %u", cellCfg->msg4pAVal);
793 /* Validate RgrCellCsgParamCfg */
794 if(rgSchCb[inst].rgrSchedEnbCfg.accsMode == RGR_CELL_ACCS_HYBRID)
796 if((rgSCHCfgVldtRgrCellCsgParamCfg(inst,
797 &(cellCfg->csgParamCfg)) != ROK))
799 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Validation failed for \n"
800 "Access CSG parameter failed\n"));
805 if (cellCfg->emtcEnable)
807 if(ROK != rgSCHCfgVldtRgrEmtcCellCfg(cellCfg))
809 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid EMTC cell Configuration %d for cell" ,cellCfg->cellId);
814 errInfo->errCause = RGSCHERR_NONE;
816 } /* rgSCHCfgVldtRgrCellCfg */
819 * @brief Validates the scheduler related configuration request from RRM to MAC.
823 * Function : rgSCHCfgVldtRgrSchCfg
826 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
827 * validate the value range for the configured values.
828 * - If validated successfully,
833 * @param[in] Inst inst
834 * @param[out] RgSchedCfg *rgSchedCfg
840 S16 rgSCHCfgVldtRgrSchCfg
843 RgrSchedEnbCfg *rgSchedCfg
846 S16 rgSCHCfgVldtRgrSchCfg(inst, rgSchedCfg)
848 RgrSchedCfg *rgSchedCfg;
851 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Validating \
852 scheduler related Configuration"));
853 if (rgSchedCfg->ulSchdType > (RGSCH_NUM_SCHEDULERS - 1))
855 RGSCHDBGERR(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Invalid \
856 UL scheduler type %d \n", rgSchedCfg->ulSchdType));
859 if (rgSchedCfg->dlSchdType > (RGSCH_NUM_SCHEDULERS - 1))
861 RGSCHDBGERR(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Invalid \
862 DL scheduler type %d \n", rgSchedCfg->dlSchdType));
868 * @brief Validates the scheduler related configuration request from RRM to MAC.
872 * Function : rgSCHCfgVldtRgrCellSchCfg
875 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
876 * validate the value range for the configured values.
877 * - If validated successfully,
878 * - Return ROK and pointer to the cell of UE.
882 * @param[in] Inst inst
883 * @param[out] RgSchCellCfg *cellCfg
889 S16 rgSCHCfgVldtRgrCellSchCfg
895 S16 rgSCHCfgVldtRgrCellSchCfg(inst, cellCfg)
901 #if RGSCH_NUM_DLFS_SCHEDULERS
902 if (cellCfg->dlfsSchdType > RGSCH_NUM_DLFS_SCHEDULERS - 1)
904 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid dlfs scheduler type %d for cell",
905 cellCfg->dlfsSchdType);
912 * @brief Validates the RACH related configuration request from RRM to MAC.
916 * Function : rgSCHCfgVldtRgrCellRACfg
919 * - Validate the RA configuration request from RRC to MAC at CFG:
920 * validate the value range for the configured values.
921 * - If validated successfully,
922 * - Return ROK and pointer to the cell of UE.
926 * @param[in] Inst inst
927 * @param[out] RgSchCellCfg *cellCfg
933 S16 rgSCHCfgVldtRgrCellRACfg
939 S16 rgSCHCfgVldtRgrCellRACfg(inst, cellCfg)
946 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_TDD_RA_PREAMBLE_FMT) ||
948 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
950 (cellCfg->rachCfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
951 (cellCfg->rachCfg.raWinSize > RGSCH_MAX_RA_WINSIZE) ||
952 (cellCfg->rachCfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
953 (cellCfg->rachCfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE) ||
954 (cellCfg->rachCfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE) ||
955 (cellCfg->rachCfg.sizeRaPreambleGrpA >
956 cellCfg->rachCfg.numRaPreamble) ||
957 (cellCfg->rachCfg.prachResource >
958 (cellCfg->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB)))
960 RLOG_ARG3(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid RACH configuration:"
961 "preamble Fmt %d raWinSize %d maxMsg3Tx %d",
962 cellCfg->rachCfg.preambleFormat, cellCfg->rachCfg.raWinSize,
963 cellCfg->rachCfg.maxMsg3Tx);
964 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid numRaPreamble %d sizeRaPreambleGrpA %d",
965 cellCfg->rachCfg.numRaPreamble,
966 cellCfg->rachCfg.sizeRaPreambleGrpA);
970 /* verify that the ded Preambles cfgd for Pdcch Order
971 * do not collide with that of non-dedicated and validates against
972 * the configuration index and number of RACH
973 * ded-preambles. For non-zero ded preamble cfg,
974 * the config index is expected to be != NA.*/
975 if ((cellCfg->macPreambleSet.pres) &&
976 ((cellCfg->macPreambleSet.start < cellCfg->rachCfg.numRaPreamble) ||
977 (cellCfg->macPreambleSet.start >= RGSCH_MAX_NUM_RA_PREAMBLE) ||
978 (cellCfg->macPreambleSet.size < 1) ||
979 (cellCfg->macPreambleSet.size > RGSCH_MAX_NUM_RA_PREAMBLE-
980 cellCfg->rachCfg.numRaPreamble) ||
981 (cellCfg->rachCfg.raOccasion.sfnEnum == RGR_SFN_NA)))
983 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid RACH Preambleset conf:"
984 "preambleSet Start %d preambleSet Size %d",
985 cellCfg->macPreambleSet.start, cellCfg->macPreambleSet.size);
989 if(cellCfg->rachCfg.contResTmr)
993 idx = cellCfg->ulDlCfgIdx;
997 /* maxMsg4TxDelay = (HARQ_RTT * MAX_MSG4_HARQ_RETX) +
998 3 TTI (MAX L1+L2 processing delay at the UE) */
999 uint8_t maxMsg4TxDelay = (cellCfg->dlHqCfg.maxMsg4HqTx-1) *
1000 rgSchCmnHarqRtt[idx] + 3;
1003 if(maxMsg4TxDelay >= cellCfg->rachCfg.contResTmr)
1005 RLOG_ARG2(L_WARNING,DBG_CELLID,cellCfg->cellId ,
1006 "Warining !: Contention Resolution timer not greater than the "
1007 "guard timer. Conte Res timer %d Guard timer %d",
1008 cellCfg->rachCfg.contResTmr,
1010 /* [ccpu00138532]-DEL- removed return fail here as it is ok if the
1011 max Msg4 Tx delay is more than the contension Resolution timer.
1012 In such case, the CRI CE will be scheduled immediately once
1018 /* ccpu00128575 ADD - If contention resolution timer is configured as 0,
1020 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
1021 "Contention Resolution timer is configured as '0'");
1030 * @brief Validates the UE configuration request from RRM to MAC.
1034 * Function : rgSCHCfgVldtRgrUeCfg
1037 * - Validate the UE configuration request from RRC to MAC at CFG:
1038 * validate the value range for the configured values.
1039 * - If validated successfully,
1040 * - Return ROK and pointer to the cell of UE.
1044 * @param[in] Inst inst
1045 * @param[in] RgrUeCfg *ueCfg
1046 * @param[out] RgSchCellCb **cell
1047 * @param[out] RgSchErrInfo *errInfo
1053 S16 rgSCHCfgVldtRgrUeCfg
1058 RgSchErrInfo *errInfo
1061 S16 rgSCHCfgVldtRgrUeCfg(inst, ueCfg, cell, errInfo)
1065 RgSchErrInfo *errInfo;
1068 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_CFG;
1070 if (((*cell) == NULLP) ||
1071 ((*cell)->cellId != ueCfg->cellId))
1073 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Cell does not exist %d",
1078 * Check configured preamble id not colliding with non dedicated or PDCCH
1079 * order preamble sets. When valid preamble id given check that C-RNTI given
1080 * in configuration is not amongst the C-RNTI'smanaged by scheduler */
1081 if ((rgSCHRamVldtUeCfg(*cell, ueCfg)) != ROK)
1083 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Preamble Id configuration"
1084 "failed ",ueCfg->cellId);
1087 /* Check if Ue already configured */
1088 if (rgSCHDbmGetUeCb(*cell, ueCfg->crnti) != NULLP)
1090 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d UEID already exists",
1094 /* Validate Transmission UE modes */
1095 if ((ueCfg->txMode.pres == TRUE) && ((ueCfg->txMode.txModeEnum < RGR_UE_TM_1)
1096 || (ueCfg->txMode.txModeEnum > RGR_UE_TM_7)))
1098 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1099 " UE is %d", ueCfg->cellId,(uint8_t)ueCfg->txMode.txModeEnum);
1103 /* Validate UE Category */
1104 if (ueCfg->ueCatEnum > CM_LTE_UE_CAT_8)
1106 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid category for UE %d",
1107 ueCfg->cellId,(uint8_t)ueCfg->ueCatEnum);
1111 /* Validate UE Access Stratum Release */
1112 if (ueCfg->accessStratumRls > RGR_REL_10)
1114 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
1115 ueCfg->accessStratumRls));
1118 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
1119 ueCfg->accessStratumRls));
1121 if ((*cell)->numTxAntPorts == 1)
1123 if ((ueCfg->txMode.pres == TRUE) &&
1124 (ueCfg->txMode.txModeEnum > RGR_UE_TM_1))
1126 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1127 " UE (%d) for the configured Cell Antenna Ports",ueCfg->cellId,
1128 (uint8_t)ueCfg->txMode.txModeEnum);
1133 if ((rgSCHCfgVldtUeCqiModeCfg(*cell, &ueCfg->ueDlCqiCfg)) != ROK)
1135 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti, "CELLID:%d Invalid CQI Mode configuration",
1140 /* Validate Max Uplink HARQ transmission value */
1141 if (ueCfg->ueUlHqCfg.maxUlHqTx < RGSCH_MIN_HQ_TX)
1143 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Uplink HARQ config for "
1144 "UE %d",ueCfg->cellId,ueCfg->ueUlHqCfg.maxUlHqTx);
1148 if (rgSCHCfgVldtUePwrCfg(*cell, &ueCfg->ueUlPwrCfg) != ROK)
1150 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid PUSCH Group power"
1151 " configuration",ueCfg->cellId);
1155 if (rgSCHCfgVldtUeMeasGapAckNakRepCfg(*cell, ueCfg) != ROK)
1157 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid MeasGap/AckNackRep"
1158 " configuration",ueCfg->cellId);
1163 /* Validating SPS RNTI */
1164 if (((ueCfg->ueSpsCfg.spsRnti >= (*cell)->rntiDb.rntiStart) &&
1165 (ueCfg->ueSpsCfg.spsRnti<=((*cell)->rntiDb.rntiStart+(*cell)->rntiDb.maxRntis)))
1166 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_SI_RNTI)
1167 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_P_RNTI))
1169 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid SPS RNTI "
1170 " in DL SPS Config",ueCfg->cellId);
1174 if (ueCfg->ueSpsCfg.dlSpsCfg.isDlSpsEnabled)
1176 if (rgSCHCfgVldtUeDlSpsCfg(*cell, &ueCfg->ueSpsCfg.dlSpsCfg) != ROK)
1178 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DL SPS configuration"
1179 " for the UE",ueCfg->cellId);
1185 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
1186 if ( ROK != rgSCHCfgVldtCqiSrSrsUeCfg(*cell, ueCfg, errInfo))
1188 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Periodic CQI/SR/SRS"
1189 "configuration",ueCfg->cellId);
1194 /* Validate DRX specific parameters */
1195 if ( ROK != rgSCHCfgVldtDrxUeCfg(*cell, &(ueCfg->ueDrxCfg)))
1197 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DRX configuration",
1202 /* ccpu00117452 - MOD - Changed macro name from
1203 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1205 if (ueCfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
1207 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid numColltdCqiRept,"
1208 "MAX supported %d",RGR_CQIRPTS_MAXN,ueCfg->cellId);
1211 #endif /* End of RGR_CQI_REPT */
1214 /*This is to validate the EMTC related configuration if a UE is an EMTC UE*/
1215 if(TRUE == ueCfg->emtcUeCfg.pres)
1217 if ( ROK != rgSCHCfgVldtEmtcUeCfg(*cell, &(ueCfg->emtcUeCfg)))
1219 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
1220 ueCfg->cellId, ueCfg->crnti);
1225 errInfo->errCause = RGSCHERR_NONE;
1227 } /* rgSCHCfgVldtRgrUeCfg */
1231 * @brief Validates the cell reconfiguration request from RRM to MAC.
1235 * Function : rgSCHCfgVldtRgrCellRecfg
1238 * - Retrieve the cell control block.
1240 * - Validate the range of reconfigured values recieved in
1241 * re-configuration request.
1242 * - If validated successfully,
1243 * - Return ROK and pointer to the cell.
1246 * - Else return RFAILED.
1248 * @param[in] Inst inst
1249 * @param[in] RgrCellRecfg *cellRecfg
1250 * @param[out] RgSchCellCb **cell
1251 * @param[out] RgSchErrInfo *errInfo
1257 S16 rgSCHCfgVldtRgrCellRecfg
1260 RgrCellRecfg *cellRecfg,
1262 RgSchErrInfo *errInfo
1265 S16 rgSCHCfgVldtRgrCellRecfg(inst, cellRecfg, cell, errInfo)
1267 RgrCellRecfg *cellRecfg;
1269 RgSchErrInfo *errInfo;
1273 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_RECFG;
1275 /* Fetch cell and validate cell Id with the cell control block*/
1276 if (((*cell) == NULLP) ||
1277 ((*cell)->cellId != cellRecfg->cellId))
1279 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Cell control block does not exist");
1283 /* Validate recieved values */
1284 if ((cellRecfg->recfgTypes & RGR_CELL_DL_HARQ_RECFG) &&
1285 ((cellRecfg->dlHqRecfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
1286 (cellRecfg->dlHqRecfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX)))
1288 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Downlink HARQ configuration:"
1289 " maxDlHqTx %d maxMsg4HqTx %d", cellRecfg->dlHqRecfg.maxDlHqTx,
1290 cellRecfg->dlHqRecfg.maxMsg4HqTx);
1293 if ((cellRecfg->recfgTypes & RGR_CELL_CFI_RECFG) &&
1294 ((cellRecfg->cfiRecfg.cfi < RGSCH_MIN_CFI_VAL) ||
1295 (cellRecfg->cfiRecfg.cfi > RGSCH_MAX_CFI_VAL)))
1297 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid CFI configuration %d",
1298 cellRecfg->cfiRecfg.cfi);
1301 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
1303 /* ccpu00138567- Removing validation check for resourceSize as 0.
1304 * From the spec, n2RB value 0 is a valid config. */
1305 if ((cellRecfg->pucchRecfg.n1PucchAn == 0) ||
1306 (cellRecfg->pucchRecfg.resourceSize >= (*cell)->bwCfg.ulTotalBw/2)||
1307 ((cellRecfg->pucchRecfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
1308 (cellRecfg->pucchRecfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS)) ||
1309 (cellRecfg->pucchRecfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
1311 RLOG_ARG4(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid PUCCH configuration: "
1312 "N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
1313 cellRecfg->pucchRecfg.resourceSize,
1314 cellRecfg->pucchRecfg.n1PucchAn,
1315 cellRecfg->pucchRecfg.deltaShift,
1316 cellRecfg->pucchRecfg.cyclicShift);
1320 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
1322 if (cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsBwEnum > RGR_SRS_BWCFG_7)
1324 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid SRS configuration: "
1325 "srsBw %d", (uint8_t)cellRecfg->srsRecfg.srsBwEnum);
1329 /*ccpu00116923 - ADD - Srs Present support - Start*/
1332 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 13)
1334 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 14)
1337 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Subframe configuration ");
1341 /*ccpu00116923 - ADD - Srs Present support - End*/
1343 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
1345 if ((cellRecfg->rachRecfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
1346 ((cellRecfg->rachRecfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
1347 (cellRecfg->rachRecfg.raWinSize > RGSCH_MAX_RA_WINSIZE)) ||
1348 (cellRecfg->rachRecfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
1349 ((cellRecfg->rachRecfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE)
1350 || (cellRecfg->rachRecfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE))
1351 || (cellRecfg->rachRecfg.sizeRaPreambleGrpA >
1352 cellRecfg->rachRecfg.numRaPreamble) ||
1353 (cellRecfg->rachRecfg.prachResource >
1354 (*cell)->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB))
1356 RLOG_ARG3(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1357 " preamble Fmt %d raWinSize %d maxMsg3Tx %d",
1358 cellRecfg->rachRecfg.preambleFormat,
1359 cellRecfg->rachRecfg.raWinSize,
1360 cellRecfg->rachRecfg.maxMsg3Tx);
1361 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1362 "numRaPreamble %d sizeRaPreambleGrpA %d",
1363 cellRecfg->rachRecfg.numRaPreamble,
1364 cellRecfg->rachRecfg.sizeRaPreambleGrpA);
1370 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
1372 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellRecfg->siReCfg))) != ROK)
1374 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for SI"
1375 "Re-configuration failed");
1379 #endif /*RGR_SI_SCH */
1381 /* LTE_ADV_FLAG_REMOVED_START */
1382 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
1384 /* Checkin whether DSFR is enbaled without enabling SFR.
1385 * So we need to check if SFR is enabled along with DSFR
1386 * in the same reconfiguration or it is already enabled earlier*/
1387 if((cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
1388 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.dsfrCfg.status))
1390 if(!(((cellRecfg->rgrLteAdvCfg.pres & RGR_SFR) &&
1391 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.sfrCfg.status)) ||
1392 ((*cell)->lteAdvCb.sfrCfg.status == RGR_ENABLE)))
1394 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"DSFR is enbaled"
1395 "Without enabling SFR");
1399 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellRecfg->rgrLteAdvCfg),
1400 (*cell)->bwCfg.dlTotalBw)) != ROK)
1402 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for Lte Adv"
1403 "Re-configuration failed");
1407 /* LTE_ADV_FLAG_REMOVED_END */
1409 /* Validating minimum resource for non-CSG users */
1410 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
1412 if (cellRecfg->csgParamCfg.minDlResNonCsg > 100)
1414 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1415 "of minimum DL resources for NON-CSG");
1418 if (cellRecfg->csgParamCfg.minUlResNonCsg > 100)
1420 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1421 "of minimum UL resources for NON-CSG");
1425 errInfo->errCause = RGSCHERR_NONE;
1427 } /* rgSCHCfgVldtRgrCellRecfg */
1431 * @brief Ue SCell configuration for scheduler. It is invoked during first time
1432 * Scell configuration. It is not for reconfiguration
1436 * Function : rgSCHSCellCfgUeCfg
1438 * This functions updates UE specific scheduler
1439 * information upon UE SCell first time Scell configuration
1441 * @param[in] RgSchCellCb *cell
1442 * @param[in] RgSchUeCb *ue
1443 * @param[int] RgrUeRecfg *ueRecfg
1444 * @param[out] RgSchErrInfo *err
1450 S16 rgSCHSCellCfgUeCfg
1454 RgrUeRecfg *ueRecfg,
1458 S16 rgSCHSCellCfgUeCfg(cell, ue, ueRecfg, err)
1461 RgrUeRecfg *ueRecfg;
1466 Inst inst = cell->instIdx;
1467 RgSchCellCb *secCellCb = NULLP;
1468 uint8_t sCellidx = 0;
1469 RgSchUeCellInfo *sCellInfo = NULLP;
1470 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1472 RgrUeAprdDlCqiCfg *aCqiCfg;
1473 RgrUePrdDlCqiCfg *pCqiCfg;
1476 RLOG0(L_INFO, "SCELL recfg received from APP \n");
1478 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1479 "--------------------------------------------------------------------\n"
1480 "UE SCell ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1481 "--------------------------------------------------------------------\n",
1482 ue->ueId, cell->cellId));
1485 for(idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1487 /* Allocate the Ue control block */
1488 if (((rgSCHUtlAllocSBuf(inst, (Data **)&sCellInfo,
1489 sizeof(RgSchUeCellInfo))) != ROK))
1491 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx :Memomy allocation "
1492 "Failed while Adding SCell Information\n", idx));
1497 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1500 sCellInfo->sCellIdx = sCellInfoCfg->sCellIdx;
1501 sCellInfo->sCellId = sCellInfoCfg->sCellId;
1503 if(PRSNT_NODEF == sCellInfoCfg->sCellDeActTmr.pres)
1505 /* Configure implicit release */
1506 ue->sCellDeactTmrVal.val = sCellInfoCfg->sCellDeActTmr.val;
1507 ue->isScellExplicitDeAct = FALSE;
1508 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1510 else if (rgSchCb[cell->instIdx].genCfg.isSCellActDeactAlgoEnable == TRUE)
1512 /* Configure explicit release */
1513 ue->sCellDeactTmrVal.val = RGSCH_SCELL_DEACT_TMR_INFINITY_VAL;
1514 ue->isScellExplicitDeAct = TRUE;
1515 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1519 ue->sCellDeactTmrVal.val = 0;
1520 ue->isScellExplicitDeAct = FALSE;
1521 ue->sCellDeactTmrVal.pres = NOTPRSNT;
1524 sCellInfo->sCellState = RG_SCH_SCELL_INACTIVE;
1527 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = sCellInfo;
1528 sCellidx = ((sCellInfo->sCellId -
1529 rgSchCb[cell->instIdx].genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
1530 ue->cellIdToCellIdxMap[sCellidx] = sCellInfo->sCellIdx;
1532 /* For for time one Scell got added, setting allocCmnUlPdcch flag to TRUE, So that
1533 we will allocate PDCCH from common search space and the csiRequest field in DCI0 will
1534 be one bit (spec 36.213 sec 7.2.1)*/
1536 if ( ue->numSCells == 0)
1538 ue->allocCmnUlPdcch = TRUE;
1543 printf("\n SCell added for ue %d numScells %d\n",ue->ueId,ue->numSCells);
1545 /* retrieve teh sec cell Cb */
1546 if((secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, sCellInfo->sCellId)) == NULLP)
1548 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCell doesnt exists"));
1549 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1553 if(TRUE == sCellInfoCfg->txMode.pres)
1555 sCellInfo->txMode = sCellInfoCfg->txMode;
1559 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx Tx mode not present ",idx));
1560 sCellInfoCfg->txMode.pres = TRUE;
1561 sCellInfoCfg->txMode.txModeEnum = RGR_UE_TM_1;
1563 sCellInfo->txMode = sCellInfoCfg->txMode;
1565 cmInitTimers (&sCellInfo->actDelayTmr, 1);
1566 cmInitTimers (&sCellInfo->deactTmr, 1);
1568 ue->f1bCsAVal += rgSCHUtlGetMaxTbSupp(sCellInfo->txMode.txModeEnum);
1571 if(TRUE == sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.pres)
1573 sCellInfo->acqiCb.aCqiCfg.aprdModeEnum =
1574 sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.aprdModeEnum;
1577 if(TRUE == sCellInfoCfg->uePdschDedCfg.uepACfg.pAPrsnt)
1579 sCellInfo->pA.pres = TRUE;
1580 sCellInfo->pA.val = sCellInfoCfg->uePdschDedCfg.uepACfg.pA;
1584 sCellInfo->pA.pres = FALSE;
1587 aCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg;
1588 RGSCHDBGPRM(cell->instIdx, (rgSchPBuf(cell->instIdx),
1589 "rgSCHCfgACqiUeCfg cellId =%d,Config Presence =%d for \
1590 Sec Cell Id = %d\n",
1591 cellCb->cellId, aCqiCfg->pres,sCellInfo->sCellId));
1593 /* if aperiodic cqi is present then only call the below function as it is
1597 if( ROK != rgSCHCfgACqiUeCfg(secCellCb,ue, &sCellInfo->acqiCb,
1598 sCellInfo->txMode.txModeEnum, aCqiCfg, ue->ueCatEnum))
1600 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx ACQI Cfg"
1601 "failed..n\n", idx));
1602 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1606 /* Configuring PCQI */
1607 /* Scell needs to be added to the
1608 * pcqi list only after activation */
1609 pCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.prdCqiCfg;
1611 if(ROK != rgSCHSCellPCqiCfg(cell,secCellCb,ue,pCqiCfg,
1612 ue->ueCatEnum,sCellInfoCfg->sCellIdx))
1614 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx PCQI Cfg failed..n\n", idx));
1615 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1620 /* Configuring ACQI */
1622 /* Stroing the secCell for easy access */
1623 sCellInfo->cell = secCellCb;
1627 if (ROK != rgSCHLaaInitDlRbAllocCb(secCellCb,
1628 &sCellInfo->dlAllocCb))
1633 /* Initialize Harq entity */
1635 sCellInfo->hqEnt = rgSCHDhmHqEntInit(secCellCb);
1636 if (sCellInfo->hqEnt == NULLP)
1638 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UEID:Hq Entity Initialization "
1639 "failed in config\n", ue->ueId));
1640 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1644 rgSCHEmtcHqPAlloc(secCellCb, sCellInfo->hqEnt);
1646 rgSCHCmnDlInitHqEnt(secCellCb, sCellInfo->hqEnt);
1648 sCellInfo->hqEnt->ue = ue;
1649 /* Init SCell Specific Sched Spfc UE DL CB */
1650 if ((secCellCb->sc.apis->rgSCHRgrSCellUeCfg(secCellCb, ue, sCellInfoCfg, err)) != ROK)
1652 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Spec Sched DL UE CFG FAILED\n"));
1653 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1658 if((rgSCHUtlAllocUeANFdbkInfo(ue,sCellInfoCfg->sCellIdx)) != ROK)
1660 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UEID:Memomy allocation "
1661 "Failed while UE related Ack Nack Information\n",
1663 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1666 #endif /* LTE_TDD */
1669 sCellInfo->sCellLnk.node = (PTR)sCellInfo;
1670 cmLListAdd2Tail(&secCellCb->sCellUeLst, &sCellInfo->sCellLnk);
1673 /* Inserting UECB into SCELL DBM */
1674 rgSCHDbmInsUeCb(secCellCb, ue);
1677 #ifndef MAC_5GTF_UPDATE
1678 ue->ul.useExtBSRSizes = ueRecfg->ueSCellCfgInfo.useExtBSRSizes;
1680 ue->ul.useExtBSRSizes = TRUE;
1683 for (idx = 0; idx < RGSCH_ULCTRL_RECP_DIST; idx++)
1685 ue->ul.ctrlOnServCellIdx[idx] = 0xFF;
1687 /* Trigger SCell addition to primary MAC */
1690 } /* rgSCHSCellCfgUeCfg */
1693 * @brief UE SCell PUCCH reconfiguration for scheduler
1697 * Function : rgSCHSCellCfgUePucchReCfg
1699 * This functions updates UE specific scheduler
1700 * information upon UE SCell PUCCH reconfiguration
1702 * @param[in] RgSchCellCb *cell
1703 * @param[in] RgSchUeCb *ue
1704 * @param[int] RgrUeRecfg *ueRecfg
1705 * @param[out] RgSchErrInfo *err
1711 S16 rgSCHSCellCfgUePucchReCfg
1715 RgrUeRecfg *ueRecfg,
1719 S16 rgSCHSCellCfgUePucchReCfg(cell, ue, ueRecfg, err)
1722 RgrUeRecfg *ueRecfg;
1726 Inst inst = cell->instIdx;
1727 RgrUeSCellAckPucchCfg *sCellPucchRecfg = NULLP;
1730 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1731 "--------------------------------------------------------------------\n"
1732 "UE SCell PUCCH ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1733 "--------------------------------------------------------------------\n",
1734 ue->ueId, cell->cellId));
1737 sCellPucchRecfg = &ueRecfg->sCellAckN1ResCfg;
1738 /* Copy the UCI format type suported/configured for UE */
1739 ue->uciFrmtTyp = sCellPucchRecfg->pucchFormatType;
1741 if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
1743 ue->n1PucchF1bResCb.cw1N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count;
1744 ue->n1PucchF1bResCb.cw2N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count;
1746 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count; idx++)
1748 ue->n1PucchF1bResCb.cw1N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1[idx];
1751 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count; idx++)
1753 ue->n1PucchF1bResCb.cw2N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2[idx];
1757 else if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT3)
1759 ue->n3PucchResCb.antP0N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0Count;
1760 ue->n3PucchResCb.antP1N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1Count;
1761 for (idx = 0;idx < ue->n3PucchResCb.antP0N3ResCount; idx++ )
1763 ue->n3PucchResCb.antP0N3Res[idx].n3PucchIdx
1764 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0[idx];
1765 ue->n3PucchResCb.antP0N3Res[idx].n3Lnk.node = NULLP;
1766 ue->n3PucchResCb.antP0N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1768 for (idx = 0;idx < ue->n3PucchResCb.antP1N3ResCount; idx++ )
1770 ue->n3PucchResCb.antP1N3Res[idx].n3PucchIdx
1771 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1[idx];
1772 ue->n3PucchResCb.antP1N3Res[idx].n3Lnk.node = NULLP;
1773 ue->n3PucchResCb.antP1N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1775 ue->simulAckNackCQIFormat3 = ueRecfg->simulAckNackCQIFormat3;
1780 RLOG1(L_ERROR,"Wrong PUCCH Format:%d configured for CA",ue->uciFrmtTyp);
1785 } /* rgSCHSCellCfgUePucchReCfg */
1787 * @brief Validates the UE SCell Reconfiguration request from APP to SCH.
1791 * Function : rgSCHCfgVldtRgrUeSCellRecfg
1794 * - Validate Number of SCells
1795 * - If validated successfully,
1796 * - Process Number of SCells
1799 * - Validate SCellIdx value,
1800 * - If validated successfully,
1801 * - Process Number of RgrUeSecCellCfg
1805 * @param[in] RgrUeRecfg *ueRecfg
1806 * @param[out] RgSchCellCb *cell
1807 * @param[out] RgSchUeCb *ue
1808 * @param[out] RgSchErrInfo *errInfo
1814 S16 rgSCHCfgVldtRgrUeSCellRecfg
1816 RgrUeRecfg *ueRecfg,
1819 RgSchErrInfo *errInfo
1822 S16 rgSCHCfgVldtRgrUeSCellRecfg(inst, ueRecfg, cell, ue, errInfo)
1823 RgrUeRecfg *ueRecfg;
1826 RgSchErrInfo *errInfo;
1829 RgrUeSecCellCfg *ueSCellDedCfg = NULLP;
1830 RgSchCellCb *sCell = NULLP;
1831 Inst inst = cell->instIdx;
1834 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "VALIDATE RGR UE SCELL RECONFIG: cellId %d "
1835 "oldUeId %d cell %p \n", ueRecfg->cellId, ueRecfg->oldCrnti));
1836 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
1838 if((ueRecfg->ueSCellCfgInfo.numSCells > RGR_MAX_SCELL_PER_UE) ||
1839 (ueRecfg->ueSCellCfgInfo.numSCells < 1))
1841 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid number of SCELL "
1842 " in SCELL Recfg\n"));
1846 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1848 ueSCellDedCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1849 if(ROK != rgSchUtlVldtCellId(inst, ueSCellDedCfg->sCellId))
1851 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCellId is out of range"));
1854 /* Validate existence of sec cell */
1855 sCell = rgSchUtlGetCellCb(inst, ueSCellDedCfg->sCellId);
1858 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCell doesnt exists"));
1862 /* validate the range of serv cell index */
1863 if((ueSCellDedCfg->sCellIdx < 1) ||
1864 (ueSCellDedCfg->sCellIdx > RGR_MAX_SCELL_PER_UE))
1866 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid Serv Cell Idx %d\n",
1867 ueSCellDedCfg->sCellIdx));
1871 /* Is this sec cell alredy confiured */
1872 if(NULLP != ue->cellInfo[ueSCellDedCfg->sCellIdx])
1874 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Secll with id %d already added\n",
1875 ueSCellDedCfg->sCellIdx));
1879 /* Validate CQI config params */
1880 if((rgSCHCfgVldtUeCqiModeCfg(sCell, &ueSCellDedCfg->ueSCellDlCqiCfg)) != ROK)
1882 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid CQI Mode "
1883 " configuration for Ue %d\n",ue->ueId));
1887 /* 1. Validate UE Aperiodic CQI related parameters */
1888 if( ROK != rgSCHCfgVldtRgrUeACqiCfg (sCell, ue->ueId,
1889 &ueSCellDedCfg->ueSCellDlCqiCfg.aprdCqiCfg, ueSCellDedCfg->txMode,
1892 RGSCHDBGERR(sCell->instIdx, (rgSchPBuf(sCell->instIdx),
1893 "rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Aperiodic CQI configuration\n"));
1898 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1899 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg, ueRecfg->isHdFddEnbld,
1900 ueSCellDedCfg->txMode, errInfo ))
1902 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1903 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg,
1904 ueSCellDedCfg->txMode,
1908 RGSCHDBGERR(sCell->instIdx, (rgSchPBuf(sCell->instIdx),
1909 "rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Periodic CQI configuration\n"));
1913 if((ueSCellDedCfg->txMode.txModeEnum < RGR_UE_TM_1) ||
1914 (ueSCellDedCfg->txMode.txModeEnum > RGR_UE_TM_9))
1916 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCELL Invalid transmission mode for"
1917 " UE %d\n", (uint8_t)ueSCellDedCfg->txMode.txModeEnum));
1923 errInfo->errCause = RGSCHERR_NONE;
1924 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR Ue SCell Reconfig validation done: "
1925 "cellId %d oldUeId %d\n", ueRecfg->cellId, ue->ueId));
1927 } /* rgSCHCfgVldtRgrUeSCellRecfg */
1930 * @brief Ue SCell configuration roll back due to failure during configuration
1935 * Function : rgSCHSCellCfgUeCfgRollBack
1937 * This functions roll backs the configuration of successfully added Scell
1939 * @param[in] RgSchCellCb *cell
1940 * @param[in] RgSchUeCb *ue
1941 * @param[int] RgrUeRecfg *ueRecfg
1942 * @param[out] RgSchErrInfo *err
1948 static S16 rgSCHSCellCfgUeCfgRollBack
1955 static S16 rgSCHSCellCfgUeCfgRollBack(cell, ue, ueRecfg)
1958 RgrUeRecfg *ueRecfg;
1961 Inst inst = cell->instIdx;
1962 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1963 RgSchUeCellInfo *sCellInfo = NULLP;
1964 RgSchCmnCell *cellSch = NULLP;
1966 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1967 "--------------------------------------------------------------------\n"
1968 "UE SCell config roll back at SCH: rnti (%u) cell(%u)\n"
1969 "--------------------------------------------------------------------\n",
1970 ue->ueId, cell->cellId));
1972 /* Free all Added scell in this transaction */
1973 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1975 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1976 sCellInfo = ue->cellInfo[(sCellInfoCfg->sCellIdx)];
1978 /* if sCellInfo is not NULLP that means this Scell is added hence
1980 if (NULLP != sCellInfo)
1982 /* Clear Scheduler specific list for this UE from the
1983 * corresponding CELL */
1984 cellSch = RG_SCH_CMN_GET_CELL(sCellInfo->cell);
1985 cellSch->apisDl->rgSCHDlUeReset(sCellInfo->cell, sCellInfo->ue);
1987 /* Delete harq Entity of Scell*/
1988 rgSCHDhmDelHqEnt(cell, &(sCellInfo->hqEnt));
1990 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
1991 sizeof(RgSchUeCellInfo));
1993 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = NULLP;
1996 if (ue->numSCells == 0)
1998 ue->allocCmnUlPdcch = TRUE;
1999 /* As there is no SCell left so DCI 0 size at UE specific search space
2000 * will be recalculated as the CSI is reduced to 1 bit */
2001 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
2008 #endif /* LTE_ADV */
2010 * @brief Validates the UE reconfiguration request from RRC to MAC.
2014 * Function : rgSCHCfgVldtRgrUeRecfg
2017 * - Retrieve the UE control block.
2019 * - Validate the range of reconfigured values recieved in
2020 * re-configuration request.
2021 * - If validated successfully,
2022 * - Return ROK and pointer to the cell and ue.
2025 * - Else return RFAILED.
2027 * @param[in] Inst inst
2028 * @param[in] RgrUeRecfg *ueRecfg
2029 * @param[out] RgSchCellCb **cell
2030 * @param[out] RgSchUeCb **ue
2031 * @param[out] RgSchErrInfo *errInfo
2037 S16 rgSCHCfgVldtRgrUeRecfg
2040 RgrUeRecfg *ueRecfg,
2043 RgSchErrInfo *errInfo
2046 S16 rgSCHCfgVldtRgrUeRecfg(inst, ueRecfg, cell, ue, errInfo)
2048 RgrUeRecfg *ueRecfg;
2051 RgSchErrInfo *errInfo;
2055 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RECFG;
2057 if (((*cell) == NULLP) ||
2058 ((*cell)->cellId != ueRecfg->cellId))
2060 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,
2061 "Cell does not exist for OLD CRNTI:%d",ueRecfg->oldCrnti);
2065 /* Fetch the Old Ue */
2066 if ((*ue = rgSCHDbmGetUeCb(*cell, ueRecfg->oldCrnti)) == NULLP)
2068 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"OLD CRNTI:%d does not exist",
2074 if(RGR_UE_SCELL_ADD_RECFG & ueRecfg->ueRecfgTypes)
2076 S16 ret = rgSCHCfgVldtRgrUeSCellRecfg(ueRecfg,*cell, *ue, errInfo);
2079 RGSCHDBGERR(inst,(rgSchPBuf(inst), "Ue SCell Recfg Validation FAILED\n"));
2082 errInfo->errCause = RGSCHERR_NONE;
2087 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
2089 if (rgSCHDbmGetUeCb(*cell, ueRecfg->newCrnti) != NULLP)
2091 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"NEW CRNTI:%d already exists",
2097 if ((ueRecfg->ueRecfgTypes & RGR_UE_CSG_PARAM_RECFG) &&\
2098 ((*ue)->csgMmbrSta == ueRecfg->csgMmbrSta))
2100 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE ID [%d] invalid CSG Membership reconfig :%d ",
2101 ueRecfg->newCrnti, (uint8_t)ueRecfg->csgMmbrSta);
2104 /* Validate values */
2105 if ((ueRecfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
2106 (ueRecfg->txMode.pres == TRUE) &&
2107 ((ueRecfg->txMode.txModeEnum < RGR_UE_TM_1) ||
2108 (ueRecfg->txMode.txModeEnum > RGR_UE_TM_7)))
2110 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid transmission mode %d"
2111 "for NEW CRNTI:%d", (uint8_t)ueRecfg->txMode.txModeEnum,ueRecfg->newCrnti);
2115 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2116 (((ueRecfg->prdDlCqiRecfg.k < 1) || (ueRecfg->prdDlCqiRecfg.k > 4)) ||
2117 ((ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx < 1) ||
2118 (ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx > 1024))))
2120 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid Periodic CQI INFO"
2121 "OLD CRNTI:%d NEW CRNTI:%d",(uint8_t)ueRecfg->oldCrnti,ueRecfg->newCrnti);
2125 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULHARQ_RECFG) &&
2126 (ueRecfg->ueUlHqRecfg.maxUlHqTx < RGSCH_MIN_HQ_TX))
2128 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid Uplink HARQ config %d"
2129 "for NEW CRNTI:%d", ueRecfg->ueUlHqRecfg.maxUlHqTx,ueRecfg->newCrnti);
2133 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2134 (ueRecfg->prdDlCqiRecfg.prdModeEnum > RGR_PRD_CQI_MOD21))
2136 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid periodic mode config for"
2137 " DL CQI %d NEW CRNTI:%d", (uint8_t)ueRecfg->prdDlCqiRecfg.prdModeEnum,ueRecfg->newCrnti);
2141 if ((ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG) &&
2142 (ueRecfg->cqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
2144 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid periodic mode config for "
2145 "DL CQI %d for NEW CRNTI:%d",(uint8_t)ueRecfg->cqiCfg.cqiSetup.prdModeEnum,ueRecfg->newCrnti);
2148 #endif /* TFU_UPGRADE */
2149 /* Validate UE Category */
2150 if (ueRecfg->ueCatEnum > CM_LTE_UE_CAT_8)
2152 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid category %d for NEW CRNTI:%d",
2153 (uint8_t)ueRecfg->ueCatEnum,ueRecfg->newCrnti);
2157 /* Validate UE Access Stratum Release */
2158 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
2159 (ueRecfg->accessStratumRls > RGR_REL_11))
2161 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
2162 ueRecfg->accessStratumRls));
2165 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
2166 ueRecfg->accessStratumRls));
2168 if ((ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG) &&
2169 ((ueRecfg->aprdDlCqiRecfg.pres == TRUE) &&
2170 ((ueRecfg->aprdDlCqiRecfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
2171 (*cell)->bwCfg.dlTotalBw <= 7)))
2173 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid aperiodic mode config for"
2174 " DL CQI %d for NEW CRNTI:%d", (uint8_t)ueRecfg->aprdDlCqiRecfg.aprdModeEnum,ueRecfg->newCrnti);
2177 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULPWR_RECFG) &&
2178 (rgSCHCfgVldtUePwrCfg(*cell, &ueRecfg->ueUlPwrRecfg) != ROK))
2180 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid PUSCH Group power"
2181 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2186 if ((ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG) &&
2187 (rgSCHCfgVldtUeMeasGapAckNakRepRecfg(*cell, ueRecfg) != ROK))
2189 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid MeasGap/AckNackRep"
2190 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2194 if(rgSCHCfgVldtSpsReCfg(*cell, *ue, ueRecfg)!= ROK)
2196 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid SPS"
2197 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2202 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
2203 if ( ROK != rgSCHCfgVldtCqiSrSrsUeReCfg(*cell, *ue, ueRecfg, errInfo))
2205 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid ACQI, PCQI/SR/SRS "
2206 "Re-configuration for NEW CRNTI:%d",ueRecfg->newCrnti);
2210 if ((ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG) &&
2211 (rgSCHCfgVldtDrxUeCfg(*cell, &(ueRecfg->ueDrxRecfg)) != ROK))
2213 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid drxParams"
2214 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2218 /* ccpu00117452 - MOD - Changed macro name from
2219 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
2221 /* Validate DL Power Control Config parameters */
2222 if(rgSCHCfgVldtCqiReptReCfg(*cell, ueRecfg)!= ROK)
2224 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid DL Power Control"
2225 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2228 #endif /* End of RGR_CQI_REPT */
2229 errInfo->errCause = RGSCHERR_NONE;
2231 } /* rgSCHCfgVldtRgrUeRecfg */
2235 * @brief Validates the logical channel reconfiguration request from
2240 * Function : rgSCHCfgVldtRgrLchRecfg
2243 * - Retrieve the uplink and downlink logical channel control block.
2245 * - Validate the range of reconfigured values recieved in
2246 * re-configuration request.
2247 * - If validated successfully,
2248 * - Return ROK and pointer to the cell, UE and logical channel.
2251 * - Else return RFAILED.
2253 * @param[in] RgrLchRecfg *lcRecfg
2254 * @param[out] RgSchCellCb **cell
2255 * @param[out] RgSchUeCb **ue
2256 * @param[out] RgSchUlLcCb **ulLc
2257 * @param[out] RgSchDlLcCb **dlLc
2258 * @param[out] RgSchErrInfo *errInfo
2264 S16 rgSCHCfgVldtRgrLchRecfg
2267 RgrLchRecfg *lcRecfg,
2271 RgSchErrInfo *errInfo
2274 S16 rgSCHCfgVldtRgrLchRecfg(inst, lcRecfg, cell, ue, dlLc, errInfo)
2276 RgrLchRecfg *lcRecfg;
2280 RgSchErrInfo *errInfo;
2283 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LC_RECFG;
2285 if (((*cell) == NULLP) ||
2286 ((*cell)->cellId != lcRecfg->cellId))
2288 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Cell does not exist "
2289 "for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2293 /* Fetch the Ue for dedicated channels */
2294 if ((*ue = rgSCHDbmGetUeCb(*cell, lcRecfg->crnti)) == NULLP)
2296 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"UEID does not exist"
2297 "dedicated logical channel for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2301 if ((*dlLc = rgSCHDbmGetDlDedLcCb((*ue), lcRecfg->lcId)) == NULLP)
2303 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Dedicated DL LC does not "
2304 "exist for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2308 errInfo->errCause = RGSCHERR_NONE;
2310 } /* rgSCHCfgVldtRgrLchRecfg */
2313 * @brief Validates the UE Reset request from RRM to MAC.
2317 * Function : rgSCHCfgVldtRgrUeReset
2320 * - Retrieve the CELL control block
2321 * - If cell does not exist return RFAILED
2322 * - Retrieve UE Control block
2323 * - If UE does not exist return RFAILED
2326 * @param[in] Inst inst
2327 * @param[in] RgrRst *reset
2328 * @param[out] RgSchCellCb **cell
2329 * @param[out] RgSchUeCb **ue
2330 * @param[out] RgErrInfo *errInfo
2336 S16 rgSCHCfgVldtRgrUeReset
2342 RgSchErrInfo *errInfo
2345 S16 rgSCHCfgVldtRgrUeReset(inst, reset, cell, ue, errInfo)
2350 RgSchErrInfo *errInfo;
2354 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RESET;
2356 if ((cell == NULLP) || (cell->cellId != reset->cellId))
2358 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"CELL does not exist for CRNTI:%d",
2363 if ((*ue = rgSCHDbmGetUeCb(&(*cell), reset->crnti)) == NULLP)
2365 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"UE does not exist for CRNTI:%d",
2370 errInfo->errCause = RGSCHERR_NONE;
2373 } /* rgSCHCfgVldtRgrUeReset */
2377 * @brief Validates the logical channel reconfiguration request from
2382 * Function : rgSCHCfgVldtRgrLcgRecfg
2385 * - Retrieve the uplink and downlink logical channel control block.
2387 * - Validate the range of reconfigured values recieved in
2388 * re-configuration request.
2389 * - If validated successfully,
2390 * - Return ROK and pointer to the cell, UE and logical channel.
2393 * - Else return RFAILED.
2395 * @param[in] RgrLchRecfg *lcRecfg
2396 * @param[out] RgSchCellCb **cell
2397 * @param[out] RgSchUeCb **ue
2398 * @param[out] RgSchErrInfo *errInfo
2404 S16 rgSCHCfgVldtRgrLcgRecfg
2407 RgrLcgRecfg *lcgRecfg,
2410 RgSchErrInfo *errInfo
2413 S16 rgSCHCfgVldtRgrLcgRecfg(inst, lcgRecfg, cell, ue, errInfo)
2415 RgrLcgRecfg *lcgRecfg;
2418 RgSchErrInfo *errInfo;
2421 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LCG_RECFG;
2423 if (((cell) == NULLP) ||
2424 ((cell)->cellId != lcgRecfg->cellId))
2426 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Cell does not exist for"
2427 "CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2431 /* Fetch the Ue for dedicated channels */
2432 if ((*ue = rgSCHDbmGetUeCb(&(*cell), lcgRecfg->crnti)) == NULLP)
2434 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"UE does not exist for "
2435 "dedicated logical channel group CRNTI:%d LCGID:%d",
2436 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2439 if (lcgRecfg->ulRecfg.lcgId > (RGSCH_MAX_LCG_PER_UE - 1))
2441 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Invalid lcgId for uplink logical"
2442 "channel CRNTI:%d LCGID:%d",
2443 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2447 if ((lcgRecfg->ulRecfg.gbr != 0) && (lcgRecfg->ulRecfg.mbr < lcgRecfg->ulRecfg.gbr))
2449 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "Dedicated Logical Group %d validation failed"
2450 " for ue %d for cell %d\n", lcgCfg->ulInfo.lcgId, lcgCfg->crnti, lcgCfg->cellId));
2453 errInfo->errCause = RGSCHERR_NONE;
2455 } /* rgSCHCfgVldtRgrLcgRecfg */
2461 * Function : rgSCHDynCfiCfg
2463 * @param[in] RgSchCellCb *cell
2464 * RgrCellCfg *cellCfg
2470 static S16 rgSCHDynCfiCfg
2476 static S16 rgSCHDynCfiCfg(cell, cellCfg)
2478 RgrCellCfg *cellCfg;
2483 uint8_t ulDlCfgIdx = cellCfg->ulDlCfgIdx;
2489 cell->dynCfiCb.isDynCfiEnb = cellCfg->isDynCfiEnb;
2491 /* Initializing Failure Sample Period */
2492 cell->dynCfiCb.failSamplePrd = (RGSCH_CFI_TTI_MON_INTRVL *
2493 RGSCH_CFI_STEP_UP_TTI_PRCNTG)/100;
2494 /* Initializing Number of Failure Samples */
2495 cell->dynCfiCb.numFailSamples = (RGSCH_CFI_TTI_MON_INTRVL/
2496 cell->dynCfiCb.failSamplePrd);
2497 cell->dynCfiCb.maxCfi = RGSCH_MAX_CFI_VAL;
2498 /* Allocating memory for CCE failure average array based on
2499 * monitoring interval and CCE failure sample period */
2500 if((rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&(cell->dynCfiCb.cceFailSamples),
2501 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)))) != ROK)
2503 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2507 /* Setting the Invalid value 0xFF to pdcchSfIdx, it will be assigned
2508 * a valid value during CFI swithing is done */
2509 cell->dynCfiCb.pdcchSfIdx = 0xFF;
2512 /* In case of config index 0, the mphich index can be upto 2
2513 * in other config index cases, it will always be set as 1*/
2516 maxMPhich = RG_SCH_MAX_MPHICH;
2520 maxMPhich = RG_SCH_MAX_MPHICH -1;
2522 /* Calculate the number of CCEs in the cell */
2523 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2525 for(mphIdx = 0; mphIdx < maxMPhich; mphIdx++)
2527 cell->dynCfiCb.cfi2NCceTbl[mphIdx][cfi] =
2528 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw,
2529 cell->phichCfg.ngEnum, cfi, mphIdx,
2530 cell->numTxAntPorts,
2531 cell->isCpDlExtend);
2535 /* Calculate the number of CCEs in the cell */
2536 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2538 /* CFI Index starts from 1 so that there can be a direct mapping from
2539 actual CFI value to cfi Index. mPhich index will always be set
2541 cell->dynCfiCb.cfi2NCceTbl[0][cfi] =
2542 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw, cell->phichCfg.ngEnum,
2543 cfi, cell->numTxAntPorts, cell->isCpDlExtend);
2546 /* Calculate the number of CCEs in the cell */
2547 if(cell->dynCfiCb.isDynCfiEnb == TRUE)
2549 /* In case if Dynamic CFI feature is enabled, default CFI
2550 * value 1 is used */
2551 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][1];
2555 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][cellCfg->cfiCfg.cfi];
2560 numDlSf = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][9] *
2561 (RGSCH_CFI_TTI_MON_INTRVL/10);
2562 cell->dynCfiCb.cfiStepUpTtiCnt =
2563 (RGSCH_CFI_STEP_UP_TTI_PRCNTG * numDlSf)/100;
2564 cell->dynCfiCb.cfiStepDownTtiCnt =
2565 (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG * numDlSf)/100;
2567 cell->dynCfiCb.cfiStepUpTtiCnt = (RGSCH_CFI_STEP_UP_TTI_PRCNTG *
2568 RGSCH_CFI_TTI_MON_INTRVL)/100;
2569 cell->dynCfiCb.cfiStepDownTtiCnt = (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG *
2570 RGSCH_CFI_TTI_MON_INTRVL)/100;
2577 * @brief Handler for the SCHED Enb configuration request from RRM to MAC.
2581 * Function : rgSCHCfgRgrSchedEnbCfg
2584 * - Invoke SCH with SCHEDULER control block to update
2585 * scheduler specific information.
2586 * - Update rgSch control block with the values recieved in the
2588 * - If successful, return ROK else RFAILED.
2590 * @param[in] RgSchCb *instCb
2591 * @param[in] SpId spId
2592 * @param[in] RgSchSchedEnbCfg *schedEnbCfg
2593 * @param[out] RgSchErrInfo *errInfo
2599 S16 rgSCHCfgRgrSchedEnbCfg
2603 RgrSchedEnbCfg *schedEnbCfg,
2604 RgSchErrInfo *errInfo
2607 S16 rgSCHCfgRgrSchedEnbCfg(inst, spId, schedEnbCfg, errInfo)
2610 RgrSchedEnbCfg *schedEnbCfg;
2611 RgSchErrInfo *errInfo;
2615 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "APPLYING RGR SCH ENB CONFIG: \n"));
2616 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
2618 rgSchCb[inst].rgrSchedEnbCfg = *schedEnbCfg;
2619 RGSCHDBGPRM(inst, (rgSchPBuf(inst),"\ndlSchdType %d ulSchdType %d dlTptCoeffi %d"
2620 "dlFairCoeffi %d ulTptCoeffi %d ulFairCoeffi %d\n",
2621 schedEnbCfg->dlSchdType, schedEnbCfg->ulSchdType, schedEnbCfg->dlSchInfo.dlPfs.tptCoeffi,
2622 schedEnbCfg->dlSchInfo.dlPfs.fairCoeffi, schedEnbCfg->ulSchInfo.ulPfs.tptCoeffi,
2623 schedEnbCfg->ulSchInfo.ulPfs.fairCoeffi));
2626 rgSchCb[inst].rgSchDynTdd.isDynTddEnbld = schedEnbCfg->isDynTddEnbld;
2629 if(RGR_SCH_TYPE_PFS == schedEnbCfg->dlSchdType)
2631 rgSCHEnbPfsDlCfg(inst, errInfo);
2634 errInfo->errCause = RGSCHERR_NONE;
2635 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR SCH ENBconfig done: \n"));
2637 } /* rgSCHCfgRgrSchedEnbCfg */
2641 * @brief Handler for the cell configuration of 5gtf.
2645 * Function : rgSCH5gtfCellCfg
2647 * @param[in] RgSchCellCb *cell
2648 * @param[in] RgSchCellCfg *cellCfg
2654 S16 rgSCH5gtfCellCfg
2660 S16 rgSCH5gtfCellCfg(cell, cellCfg)
2662 RgrCellCfg *cellCfg;
2667 for(idx = 0; idx < MAX_5GTF_GROUP; idx++)
2669 cell->cell5gtfCb.ueGrp5gConf[idx].beamBitMask = 0;
2672 for(idx = 0 ; idx < MAX_5GTF_SUBFRAME_INFO ; ++idx)
2674 cell->cell5gtfCb.dynConfig[idx] = cellCfg->Cell5gtfCfg.dynConfig[idx];
2676 cell->cell5gtfCb.numUes = cellCfg->Cell5gtfCfg.numUes;
2677 cell->cell5gtfCb.uePerGrpPerTti = cellCfg->Cell5gtfCfg.uePerGrp;
2678 cell->cell5gtfCb.ueGrpPerTti = cellCfg->Cell5gtfCfg.ueGrpPerTti;
2679 cell->cell5gtfCb.numCCs = cellCfg->Cell5gtfCfg.numOfCC;
2680 cell->cell5gtfCb.bwPerCC = cellCfg->Cell5gtfCfg.bwPerCC;
2681 printf("\ncell cfg at schd,numUes:%u,uepergrp:%u,uegrppertti:%u,numCC:%u,bwPerc:%u cfi %u\n",
2682 cell->cell5gtfCb.numUes,cell->cell5gtfCb.uePerGrpPerTti,cell->cell5gtfCb.ueGrpPerTti,
2683 cell->cell5gtfCb.numCCs,cell->cell5gtfCb.bwPerCC, cell->cell5gtfCb.cfi);
2688 #ifdef XEON_LMT_ITBS
2689 uint16_t gWrMaxDlItbs;
2690 uint16_t gWrMaxUlItbs;
2693 * @brief Handler for the cell configuration request from RRM to MAC.
2697 * Function : rgSCHCfgRgrCellCfg
2700 * - Invoke SCH with cell control block to update
2701 * scheduler specific information.
2702 * - Update cell control block with the values recieved in the
2704 * - Add to the active list of cells if cell becomes ACTIVE.
2705 * - If successful, return ROK else RFAILED.
2707 * @param[in] RgSchCb *instCb
2708 * @param[in] SpId spId
2709 * @param[in] RgSchCellCfg *cellCfg
2710 * @param[out] RgSchErrInfo *errInfo
2716 S16 rgSCHCfgRgrCellCfg
2720 RgrCellCfg *cellCfg,
2721 RgSchErrInfo *errInfo
2724 S16 rgSCHCfgRgrCellCfg(instCb, spId, cellCfg, errInfo)
2727 RgrCellCfg *cellCfg;
2728 RgSchErrInfo *errInfo;
2734 RgInfCellReg cellRegReq;
2735 RgSchCellCb *cell = NULLP;
2736 Inst inst = instCb->rgSchInit.inst;
2737 uint32_t Idx1 = (uint8_t)((cellCfg->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
2739 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_CFG;
2741 memset(&pst, 0, sizeof(Pst));
2743 /* Allocate the scheduler's cell control block */
2744 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&cell, sizeof(RgSchCellCb)))
2747 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2751 if(cellCfg->emtcEnable)
2753 if((ret = rgSCHEmtcCellAlloc(cell))
2756 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for emtc cell");
2761 if ((uint8_t *)cell == NULLP)
2763 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2766 /* Initialize the lists of the cell */
2767 ret = rgSCHDbmInitCell(cell);
2770 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"DBM initialization FAILED for cell");
2771 rgSCHCfgFreeCellCb(cell);
2774 /* LTE_ADV_FLAG_REMOVED_START */
2775 if(cellCfg->rgrLteAdvCfg.pres & RGR_ABS)
2777 cell->lteAdvCb.absCfg =
2778 cellCfg->rgrLteAdvCfg.absCfg;
2779 memset(cell->lteAdvCb.absLoadInfo, 0, sizeof(uint32_t)*RGR_ABS_PATTERN_LEN);
2780 cell->lteAdvCb.absLoadTtiCnt = 0;
2783 if(cellCfg->rgrLteAdvCfg.pres & RGR_SFR)
2785 cell->lteAdvCb.sfrCfg =
2786 cellCfg->rgrLteAdvCfg.sfrCfg;
2788 if(cellCfg->rgrLteAdvCfg.pres & RGR_DSFR)
2790 cell->lteAdvCb.dsfrCfg =
2791 cellCfg->rgrLteAdvCfg.dsfrCfg;
2793 /* LTE_ADV_FLAG_REMOVED_END */
2796 cell->emtcEnable = cellCfg->emtcEnable;
2798 /* Initialize the cell */
2799 cell->cellId = cellCfg->cellId;
2800 cell->instIdx = inst;
2801 cell->macInst = cellCfg->macInst;
2802 cell->isCpUlExtend = cellCfg->isCpUlExtend;
2803 cell->isCpDlExtend = cellCfg->isCpDlExtend;
2805 cell->numTxAntPorts = rgSchCb[inst].rgrSchedEnbCfg.numTxAntPorts;
2806 if(cell->numTxAntPorts == 1)
2808 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_ONE_ANT_PORT;
2810 else if(cell->numTxAntPorts == 2)
2812 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_TWO_ANT_PORT;
2816 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_FOUR_ANT_PORT;
2818 cell->bwCfg = cellCfg->bwCfg;
2819 cell->pbchRbStart = ((((cell->bwCfg.dlTotalBw * 12)/2) - 36)/12); /* Ref section 6.6 in 36.211 */
2820 cell->pbchRbEnd = cell->pbchRbStart + 5;
2821 cell->pucchCfg = cellCfg->pucchCfg;
2822 cell->rachCfg = cellCfg->rachCfg;
2823 cell->siCfg = cellCfg->siCfg;
2824 cell->t300TmrVal = cellCfg->t300TmrVal;
2826 /*Initialize the SI CB in Cell CB */
2827 memset(&cell->siCb, 0, sizeof(RgSchSiCb));
2829 /*Fix: Added Guard Pool for RNTI which will contain RNTIs
2830 *for UEs deleted from Scheduler but not yet from MAC*/
2831 cmLListInit(&cell->rntiDb.rntiGuardPool);
2833 /* Initialize the inWindow to sync with scheduler time when ticks starts */
2835 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2836 (RG_SCH_CMN_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL));
2838 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2839 (RG_SCH_CMN_DL_DELTA));
2842 if(cell->siCb.inWindow < 0)
2844 cell->siCb.inWindow = 0;
2846 cell->macPreambleSet = cellCfg->macPreambleSet;
2847 cell->phichCfg = cellCfg->phichCfg;
2849 /* Initialize UL and DL CCCH logical channels */
2850 cell->ulCcchId = RGSCH_INVALID_LC_ID;
2851 cell->dlCcchId = RGSCH_INVALID_LC_ID;
2853 /* Update SRS configuration */
2854 cell->srsCfg.isSrsCfgPres = cellCfg->srsCfg.isSrsCfgSetup;
2855 if(cellCfg->srsCfg.isSrsCfgSetup)
2857 cell->srsCfg.srsCfgPrdEnum = cellCfg->srsCfg.srsCfgPrdEnum;
2858 cell->srsCfg.srsBwEnum = cellCfg->srsCfg.srsBwEnum;
2859 cell->srsCfg.srsTxOffst =
2860 rgSrsTxOffstTbl[cellCfg->srsCfg.srsSubFrameCfg];
2861 /*ccpu00116923 - ADD - Srs Present support */
2863 cell->srsCfg.srsSubFrameCfg = cellCfg->srsCfg.srsSubFrameCfg;
2867 /* Configure all the common logical channels for the cell */
2868 for(idx = 0; idx < cellCfg->numCmnLcs; idx++)
2870 /* This never returns failure and hence not checked for */
2871 rgSCHCfgRgrCmnLcCfg(cell, &(cellCfg->cmnLcCfg[idx]), errInfo);
2874 /* Invoke the MeasGap and ACK NACK Rep handler for cell cfg */
2876 /* Dynamic CFI cell configuration */
2877 ret = rgSCHDynCfiCfg(cell, cellCfg);
2880 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr cell Config failed at "
2881 "Scheduler for cell");
2882 rgSCHCfgFreeCellCb(cell);
2885 /* Updating Auto TM Mode enable/diable flag */
2886 cell->isAutoCfgModeEnb = cellCfg->isAutoCfgModeEnb;
2888 if(cell->isAutoCfgModeEnb)
2890 RLOG0(L_INFO,"Auto Mode Cfg enabled durint cell cfg\n");
2893 /* CPU OvrLoad State Initialization */
2894 #ifdef XEON_LMT_ITBS
2895 cell->thresholds.maxDlItbs = gWrMaxDlItbs;
2896 cell->thresholds.maxUlItbs = gWrMaxUlItbs;
2897 RLOG2(L_INFO,"LIMIT DL and UL ITBS %d:%d \n",gWrMaxDlItbs,gWrMaxUlItbs);
2899 cell->thresholds.maxDlItbs = RG_SCH_DL_MAX_ITBS;
2900 cell->thresholds.maxUlItbs = RG_SCH_UL_MAX_ITBS;
2902 cell->measurements.dlTpt = 0;
2903 cell->measurements.ulTpt = 0;
2904 cell->measurements.dlBytesCnt = 0;
2905 cell->measurements.ulBytesCnt = 0;
2906 cell->cpuOvrLdCntrl.cpuOvrLdIns = 0; /* 0 - No command */
2907 cell->cpuOvrLdCntrl.dlNxtIndxDecNumUeTti = 0;
2908 cell->cpuOvrLdCntrl.ulNxtIndxDecNumUeTti = 0;
2909 for ( idx = 0; idx < 10; idx++ )
2911 cell->cpuOvrLdCntrl.maxUeNewTxPerTti[idx] = cellCfg->maxDlUeNewTxPerTti;
2912 cell->cpuOvrLdCntrl.maxUeNewRxPerTti[idx] = cellCfg->maxUlUeNewTxPerTti;
2915 /* Invoke scheduler to update scheduler specific information */
2916 ret = rgSCHUtlRgrCellCfg(cell, cellCfg, errInfo);
2919 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr cell Config failed at "
2920 "Scheduler for cell ");
2921 rgSCHCfgFreeCellCb(cell);
2925 /* Invoke DHM to update DHM specific information */
2926 rgSCHDhmRgrCellCfg(cell, cellCfg, errInfo);
2929 /* Initialize RNTI DB */
2930 ret = rgSCHDbmRntiDbInit(cell, cellCfg->macRnti.startRnti,
2931 cellCfg->macRnti.size);
2934 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr Cell Config failed at"
2935 " RNTI DB init for cell");
2936 rgSCHCfgFreeCellCb(cell);
2940 /* Update the cell with recieved configuration */
2941 cell->dlHqCfg = cellCfg->dlHqCfg;
2943 RLOG1(L_INFO,"Config DL HQTX = %d\n",cell->dlHqCfg.maxDlHqTx);
2945 cell->crntSfIdx = 0;
2946 /* Allocate the subframe allocation information */
2947 if((ret = rgSCHUtlGetSfAlloc(cell)) != ROK)
2949 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for "
2951 rgSCHCfgFreeCellCb(cell);
2954 /* Update RACH Related information
2955 * XXX: Below function yet to be written in RAM
2956 * To store the preambles given in the configuration for PDCCH order in the
2957 * scheduler cell control block. Initialize the PRACH Mask Index allocated
2958 * for these preambles to invalid values */
2960 cell->crntHqIdx = 0;
2961 /* Allocate the subframe allocation information */
2962 if((ret = rgSCHUtlGetRlsHqAlloc(cell)) != ROK)
2964 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for"
2966 rgSCHCfgFreeCellCb(cell);
2970 /* Associate a pair of upper and lower sapCbs with this cell */
2971 instCb->rgrSap[spId].cell = cell;
2972 instCb->tfuSap[spId].cell = cell;
2973 instCb->rgmSap[spId].cell = cell;
2974 cell->tfuSap = &(instCb->tfuSap[spId]);
2977 instCb->cells[Idx1] = cell;
2980 /* rg001.201: Added for sending TTI tick to RRM */
2981 #if (defined(RGR_RRM_TICK) || defined(RGR_CQI_REPT))
2982 /* Associate the RGR SAP as well utilized while sending TTI
2983 * Ticks to RGR User. */
2984 cell->rgrSap = &(instCb->rgrSap[spId]);
2986 cell->rgmSap = &(instCb->rgmSap[spId]);
2988 /* Store the periodicity configured */
2989 cell->rrmTtiIndPrd = cellCfg->rrmTtiIndPrd;
2993 cmLListInit(&cell->l2mList);
2996 if (rgSCHDrxCellCfg(cell,cellCfg) != ROK)
2998 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Drx Memory allocation FAILED for"
3000 rgSCHCfgFreeCellCb(cell);
3003 cell->overLoadBackOffEnab = FALSE;/* Disabling RachOverload by default */
3004 /* Updating CSG Parameters */
3005 cell->minDlResNonCsg = cellCfg->csgParamCfg.minDlResNonCsg;
3006 cell->minUlResNonCsg = cellCfg->csgParamCfg.minUlResNonCsg;
3008 /* Register the cell with MAC */
3009 rgSCHUtlGetPstToLyr(&pst, instCb, cell->macInst);
3010 cellRegReq.cellId = cell->cellId;
3011 cellRegReq.cellSapId = spId;
3013 cellRegReq.maxDlHqProcPerUe = rgSchTddDlNumHarqProcTbl[cellCfg->ulDlCfgIdx];
3015 cellRegReq.maxDlHqProcPerUe = RGSCH_MAX_DL_HQ_PROC;
3017 RgSchMacCellReg(&pst, &cellRegReq);
3020 cell->tenbStats = TSL2AllocCellStatsBlk(cell->cellId);
3021 cell->tenbStats->cellId = cell->cellId;
3024 rgSCHUtlCalcDciSizes(cell);
3027 /* Initilalization of the list of UE for which this cell is secondary cell*/
3028 cmLListInit(&cell->sCellUeLst);
3033 ret = rgSCHLaaSCellCbInit(cell, cellCfg);
3036 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr Cell Config failed at"
3037 " Initializing the LAA Cell Control Cb");
3038 rgSCHCfgFreeCellCb(cell);
3041 cell->isPucchFormat3Sptd = cellCfg->isPucchFormat3Sptd;
3042 RLOG_ARG0(L_INFO,DBG_CELLID,cellCfg->cellId,"Format 3 is Enabled");
3043 printf ("\n Format 3 is Enabled for CELL:%d",cell->cellId);
3049 if(cell->emtcEnable)
3051 if (rgSCHCfgEmtcCellCfg(cell,&(cellCfg->emtcCellCfg)) != ROK)
3053 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"EMTC Config Failed"
3061 ret = rgSCH5gtfCellCfg(cell, cellCfg);
3064 RLOG_ARG0(L_ERROR, DBG_CELLID,cellCfg->cellId,"5GTF Rgr Cell Config failed");
3065 rgSCHCfgFreeCellCb(cell);
3069 errInfo->errCause = RGSCHERR_NONE;
3071 } /* rgSCHCfgRgrCellCfg */
3074 * @brief Handler for the UE configuration request from RRC to MAC.
3078 * Function : rgSCHCfgRgrUeCfg
3081 * - Allocate and create UE control block.
3082 * - Update UE control block with the values recieved in the
3084 * - Invoke RAM, SCH, UHM and DHM with created UE control block, to
3085 * update random access, scheduler, uplink harq and downlink harq
3086 * specific information respectively.
3087 * - If successful, add the control block to hash list of UEs for the cell
3088 * else Rollback and FAIL.
3090 * @param[in] RgSchCellCb *cell
3091 * @param[in] RgrUeCfg *ueCfg
3092 * @param[out] RgSchErrInfo *errInfo
3098 S16 rgSCHCfgRgrUeCfg
3102 RgSchErrInfo *errInfo
3105 S16 rgSCHCfgRgrUeCfg(cell, ueCfg, errInfo)
3108 RgSchErrInfo *errInfo;
3112 RgSchRaCb *raCb=NULLP;
3113 RgSchUeCb *ue = NULLP;
3114 Inst inst = cell->instIdx;
3116 RgSchDlHqEnt *hqEnt = NULLP;
3118 uint8_t ulDlCfgIdx = cell->ulDlCfgIdx;
3119 uint8_t maxSubframes ;
3120 uint8_t maxDlSubframes;
3124 RgSchUePCqiCb *cqiCb = NULLP;
3128 errInfo->errCause = RGSCHERR_CFG_RGR_UE_CFG;
3129 /* RACHO : Check for raCb only if preamble Id not provded */
3130 #ifndef PRE_DEF_UE_CTX
3131 if (ueCfg->dedPreambleId.pres == NOTPRSNT)
3133 if ((raCb = rgSCHDbmGetRaCb(cell, ueCfg->crnti)) == NULLP)
3135 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"No RaCb exists for"
3136 "CRNTI:%d ",ueCfg->crnti);
3142 /* Allocate the Ue control block */
3143 if (((rgSCHUtlAllocSBuf(inst, (Data **)&ue, sizeof(RgSchUeCb))) != ROK) ||
3144 ((uint8_t *)ue == NULLP))
3146 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId, "Memory allocation"
3147 " FAILED for CRNTI:%d", ueCfg->crnti);
3151 /* Inititialize Ue control block */
3152 ue->ueId = ueCfg->crnti;
3154 /*ccpu00117778- Initialize Transmission Indices upon UE CB creation */
3156 ue->lastRprdAckNackTime.sfn = cell->crntTime.sfn;
3157 ue->lastRprdAckNackTime.subframe = cell->crntTime.slot;
3161 /* Allocate the Ue control block */
3162 if (((rgSCHUtlAllocSBuf(inst, (Data **)&(ue->cellInfo[RGSCH_PCELL_INDEX]),
3163 sizeof(RgSchUeCellInfo))) != ROK))
3166 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%lu]SCellIdx :Memomy allocation "
3167 "Failed while Adding SCell Information\n", idx));
3169 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%u]SCellIdx :Memomy allocation "
3170 "Failed while Adding SCell Information\n", idx));
3175 ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)] = RGSCH_PCELL_INDEX;
3176 ue->cellInfo[RGSCH_PCELL_INDEX]->cell = cell;
3177 ue->cellInfo[RGSCH_PCELL_INDEX]->ue = ue;
3179 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
3180 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellIdx = RGSCH_PCELL_INDEX;
3181 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellId = cell->cellId;
3183 if (ROK != rgSCHLaaInitDlRbAllocCb(cell,
3184 &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb))
3190 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ue,cell);
3191 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
3192 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
3193 ue->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
3194 ue->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
3196 /* LTE_ADV_FLAG_REMOVED_START */
3197 /* While doing UE configuration for SFR at SCH, by default
3198 * CC UE power is configured as LOW */
3199 ue->lteAdvUeCb.isCCUePHigh = FALSE;
3200 /* LTE_ADV_FLAG_REMOVED_END */
3202 /* Initialize the lists of the UE */
3203 if((rgSCHDbmInitUe(ue)) != ROK)
3205 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"DBM initialization "
3206 "failed for CRNTI:%d", ueCfg->crnti);
3212 if(TRUE == raCb->isEmtcRaCb)
3214 ue->isEmtcUe = TRUE;
3215 if (rgSCHUtlUpdUeEmtcInfo(cell, ueCfg, ue) != ROK)
3217 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"EMTC UE Cfg"
3218 "failed for CRNTI:%d", ueCfg->crnti);
3225 /* Initialize scheduler related information for UE */
3226 if(rgSCHUtlRgrUeCfg(cell, ue, ueCfg, errInfo) != ROK)
3228 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Scheduler handling "
3229 "failed in config for CRNTI:%d", ueCfg->crnti);
3233 ret = rgSCHUhmHqEntInit(cell, ue);
3236 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"UHM HARQ Ent Init "
3237 "Failed for CRNTI:%d", ueCfg->crnti);
3241 /* Initialize RAM related information for UE
3242 * RACHO: if preamble Id is present in ueCfg then raCb will be NULL
3243 * so rgSCHRamRgrUeCfg should take care of creating raCb */
3244 if ((ueCfg->dedPreambleId.pres == NOTPRSNT) && (NULLP != raCb) )
3246 if((rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo)) != ROK)
3248 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Random access "
3249 "handling config failed for CRNTI:%d", ueCfg->crnti);
3255 RG_SCH_CMN_GET_UE_HQE(ue, cell) = rgSCHDhmHqEntInit(cell);
3256 hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
3259 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Hq Entity Initialization "
3260 "failed in config for CRNTI:%d", ueCfg->crnti);
3264 rgSCHEmtcHqPAlloc(cell, hqEnt);
3267 /* Fix : syed Assign hqEnt to UE only if msg4 is done */
3269 rgSCHCmnDlInitHqEnt(cell, hqEnt);
3271 /* For Hand-In UE Request Aper CQI report
3273 if (ueCfg->ueDlCqiCfg.aprdCqiCfg.pres)
3275 /* Set APCQI for Pcell only*/
3276 ue->dl.reqForCqi = RG_SCH_APCQI_SERVING_CC;
3281 maxDlSubframes = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
3282 maxSubframes = 2 * maxDlSubframes;
3283 ue->dl.numHqDlSfInfo = maxSubframes;
3284 rgSCHUtlAllocSBuf(cell->instIdx,
3285 (Data **)&ue->dl.dlSfHqInfo, sizeof(RgSchDlHqInfo) * (ue->dl.numHqDlSfInfo));
3288 ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_slotS;
3291 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3293 cmLListInit(&ue->dl.dlSfHqInfo[idx].hqPLst);
3294 ue->dl.dlSfHqInfo[idx].dlSfUeLnk.node = NULLP;
3300 for (cellIdx = 0;cellIdx < MAX_5GTF_CELL ; cellIdx++)
3302 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3304 cmLListInit(&ue->dl.dlSfHqInfo[cellIdx][idx].hqPLst);
3305 ue->dl.dlSfHqInfo[cellIdx][idx].dlSfUeLnk.node = NULLP;
3311 rgSCHLaaInitDlHqInfo(cell, ue);
3315 /* Initialize lcgIds to Invalid */
3316 for (lcgCnt = 0; lcgCnt < RGSCH_MAX_LCG_PER_UE; lcgCnt++)
3318 ue->ul.lcgArr[lcgCnt].lcgId = RGSCH_INVALID_LCG_ID;
3322 rgSCHCfgRgrUePhrMsg3(cell,raCb,ue,errInfo);
3323 /* Moved this code out of rgSCHCfgRgrUePhrMsg3()
3324 * as it was not the appropriate place to
3326 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3328 RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
3329 "RNTI:%d RaCb deleted as Msg4 transmission is done",
3331 rgSCHRamDelRaCb(cell, raCb, FALSE);
3334 /* Initialize uplink HARQ related information for UE */
3335 rgSCHUhmRgrUeCfg(cell, ue, ueCfg);
3336 cmInitTimers(&ue->bsrTmr, 1);
3338 /* Added periodic BSR timer */
3339 cmInitTimers(&ue->bsrTmr, 1);
3341 /* Fix - Added proper configuration from U-ARM */
3342 if(ueCfg->ueBsrTmrCfg.isPrdBsrTmrPres == TRUE)
3344 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = TRUE;
3345 ue->ul.bsrTmrCfg.prdBsrTmr = ueCfg->ueBsrTmrCfg.prdBsrTmr;
3346 ue->ul.bsrTmrCfg.retxBsrTmr = ueCfg->ueBsrTmrCfg.retxBsrTmr;
3350 /* Initialize downlink HARQ related information for UE */
3351 rgSCHDhmRgrUeCfg(cell, ue, ueCfg, errInfo);
3353 /* Initialize MeasureGap and Acknack Rep Information for UE */
3354 if((rgSCHMeasGapANRepUeCfg(cell, ue, ueCfg)) != ROK)
3356 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Measurement Gap and"
3357 " AckNack Rep failed in Config for CRNTI:%d", ueCfg->crnti);
3363 if((rgSCHUtlAllocUeANFdbkInfo(ue,RGSCH_PCELL_INDEX)) != ROK)
3365 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Memomy allocation "
3366 "Failed while UE related Ack Nack Information for CRNTI:%d",
3370 ue->dl.ackNackMode = ueCfg->ackNackModeEnum;
3371 #endif /* LTE_TDD */
3374 rgSCHDbmInsUeCb(cell, ue);
3377 /* Int ialize APeriodic CQI/PMI/RI Information for UE */
3379 RGSCHDBGPRM(cell->instIdx,(rgSchPBuf(cell->instIdx),
3380 "\n rgSCHCfgRgrUeCfg : CellID=%d UeId =%d AcqiCfg Pres =%d",
3381 cell->cellId, ue->ueId, ueCfg->ueDlCqiCfg.aprdCqiCfg.pres));
3383 /*Store Trigger Set Bit String to UE */
3385 ret = rgSCHCfgACqiUeCfg(cell,ue, (RG_SCH_CMN_GET_ACQICB(ue,cell)),ue->mimoInfo.txMode,
3386 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ue->ueCatEnum);
3388 ue->cqiRiWritIdx = 0;
3389 ue->cqiRiReadIdx = 0;
3390 /* Initialize Periodic CQI/PMI, RI Information for UE */
3391 ret = rgSCHCfgPCqiUeCfg(cell, ue, &ueCfg->ueDlCqiCfg.prdCqiCfg,
3394 /* Initialize UL SRS Information for UE */
3395 ret = rgSCHCfgSrsUeCfg(cell, ue, &ueCfg->srsCfg);
3397 /* Initialize SR Information for UE */
3398 ret = rgSCHCfgSrUeCfg(cell, ue, &ueCfg->srCfg);
3402 if (rgSCHHdFddUeCfg(cell, ue, ueCfg->isHdFddEnbld) != ROK)
3404 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,
3405 "Could not do HD-FDD config for CRNTI:%d",ueCfg->crnti);
3409 #endif /* LTEMAC_HDFDD */
3410 /* ccpu00117452 - MOD - Changed macro name from
3411 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
3413 ue->cqiReptCfgInfo.numColltdCqiRept =
3414 ueCfg->ueCqiReptCfg.numColltdCqiRept;
3415 #endif /* End of RGR_CQI_REPT */
3417 RG_SCH_CMN_GET_PA(ue,cell).pres = FALSE;
3418 if (RG_SCH_UE_CFG_ISPAPRSNT(ueCfg->uePdschDedCfg.uepACfg))
3420 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
3421 RG_SCH_CMN_GET_PA(ue,cell).val = ueCfg->uePdschDedCfg.uepACfg.pA;
3424 ue->isDrxEnabled = ueCfg->ueDrxCfg.isDrxEnabled;
3426 if ( ue->isDrxEnabled )
3428 if((rgSCHDrxUeCfg(cell,ue,ueCfg)) != ROK )
3430 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"DRX configuration failed",
3436 /* LTE_ADV_FLAG_REMOVED_START */
3437 if ((cell->lteAdvCb.sfrCfg.status == RGR_ENABLE) || \
3438 (cell->lteAdvCb.absCfg.status == RGR_ENABLE))
3440 ue->lteAdvUeCb.rgrLteAdvUeCfg = ueCfg->ueLteAdvCfg;
3442 /* LTE_ADV_FLAG_REMOVED_END */
3445 ue->tenbStats = TSL2AllocUeStatsBlk(ue->ueId);
3446 ue->tenbStats->stats.rnti = ue->ueId;
3449 /*Update A Value for PCell TBs*/
3450 ue->f1bCsAVal = rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode);
3451 RLOG_ARG1(L_ERROR,DBG_CELLID, ueCfg->cellId,
3452 "\n UeCfg A value is %d\n",ue->f1bCsAVal);
3454 errInfo->errCause = RGSCHERR_NONE;
3456 ue->accessStratumRls = ueCfg->accessStratumRls;
3457 if (ue->numSCells > 0)
3460 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3464 /* 1 bit CSI Access Stratum Release Change */
3465 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3473 rgSCHCfgFreeUeCb(cell, ue);
3476 } /* rgSCHCfgRgrUeCfg */
3479 * @brief Handler for PHR for MSG3.
3483 * Function : rgSCHCfgRgrUePhrMsg3
3486 * Handle PHR related config for MSG3
3488 * @param[in] RgSchCellCb *cell
3489 * @param[in] RgrUeCb *ueCb
3490 * @param[in] RgSchRaCb *raCb
3491 * @param[out] RgSchErrInfo *errInfo
3494 static Void rgSCHCfgRgrUePhrMsg3
3499 RgSchErrInfo *errInfo
3502 static Void rgSCHCfgRgrUePhrMsg3(cell, raCb, ue, errInfo)
3506 RgSchErrInfo *errInfo;
3510 /* Record msg3 allocation in the UE */
3511 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3513 /* If raCb received PHR, update scheduler */
3514 if(raCb->phr.pres == TRUE)
3516 ue->macCeRptTime = raCb->msg3AllocTime;
3517 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3527 * Function : rgSCHDynCfiReCfg
3529 * @param[in] RgSchCellCb *cell
3536 Void rgSCHDynCfiReCfg
3542 Void rgSCHDynCfiReCfg(cell, isDynCfiEnb)
3548 RgSchCmnDlCell *cellSchDl = RG_SCH_CMN_GET_DL_CELL(cell);
3552 cell->dynCfiCb.ttiCnt = 0;
3553 cellSchDl->newCfi = cellSchDl->currCfi;
3557 /* Resetting the parameters*/
3558 cell->dynCfiCb.cceFailCnt = 0;
3559 cell->dynCfiCb.cceFailSum = 0;
3560 cell->dynCfiCb.prevCceFailIdx = 0;
3562 for(idx = 0; idx < cell->dynCfiCb.numFailSamples; idx++)
3564 cell->dynCfiCb.cceFailSamples[idx] = 0;
3567 cell->dynCfiCb.cceUsed = 0;
3568 cell->dynCfiCb.lowCceCnt = 0;
3569 cell->dynCfiCb.ttiCnt = 0;
3573 * @brief Handler for the cell reconfiguration request from RRM to MAC.
3577 * Function : rgSCHCfgRgrCellRecfg
3580 * - Invoke SCH with cell control block to update
3581 * scheduler specific information.
3582 * - Update cell control block with the values recieved in the
3584 * - If successful, return ROK else RFAILED.
3586 * @param[in] RgSchCellCb *cell
3587 * @param[in] RgrCellRecfg *cellRecfg
3588 * @param[out] RgSchErrInfo *errInfo
3594 S16 rgSCHCfgRgrCellRecfg
3597 RgrCellRecfg *cellRecfg,
3598 RgSchErrInfo *errInfo
3601 S16 rgSCHCfgRgrCellRecfg(cell, cellRecfg, errInfo)
3603 RgrCellRecfg *cellRecfg;
3604 RgSchErrInfo *errInfo;
3608 Inst inst = cell->instIdx;
3609 /* LTE_ADV_FLAG_REMOVED_START */
3611 uint16_t len; /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3612 /* LTE_ADV_FLAG_REMOVED_END */
3614 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_RECFG;
3616 /* Invoke scheduler to update scheduler specific information */
3617 ret = rgSCHUtlRgrCellRecfg(cell, cellRecfg, errInfo);
3620 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId, "RGR Cell re-configuration failed "
3625 /* Invoke DHM to update DHM specific information */
3626 rgSCHDhmRgrCellRecfg(cell, cellRecfg, errInfo);
3628 /* PUCCH Reconfiguration */
3629 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
3631 cell->pucchCfg = cellRecfg->pucchRecfg;
3634 /* SRS Reconfiguration */
3635 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
3637 cell->srsCfg.isSrsCfgPres = cellRecfg->srsRecfg.isSrsCfgSetup;
3638 if(cellRecfg->srsRecfg.isSrsCfgSetup)
3640 cell->srsCfg.srsCfgPrdEnum = cellRecfg->srsRecfg.srsCfgPrdEnum;
3641 cell->srsCfg.srsBwEnum = cellRecfg->srsRecfg.srsBwEnum;
3642 cell->srsCfg.srsTxOffst =
3643 rgSrsTxOffstTbl[cellRecfg->srsRecfg.srsSubFrameCfg];
3644 /*ccpu00116923 - ADD - Srs Present support */
3646 cell->srsCfg.srsSubFrameCfg = cellRecfg->srsRecfg.srsSubFrameCfg;
3651 /* RACH Reconfiguration */
3652 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
3654 cell->rachCfg = cellRecfg->rachRecfg;
3657 /* ccpu00132256:MOD: Moved this assignment from Validation to here.*/
3658 if (cellRecfg->recfgTypes & RGR_CELL_TMRS_RECFG)
3660 cell->t300TmrVal = cellRecfg->t300TmrVal;
3663 /* SI Reconfiguration */
3664 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
3666 /*Set the specified SI configuration. */
3667 cell->siCb.newSiCfg = cellRecfg->siReCfg;
3668 /* Set the Bit mask for SI re-configuration */
3669 cell->siCb.siBitMask |= RGSCH_SI_SICFG_UPD;
3671 if(cell->emtcEnable)
3673 rgSchEmtcUpdSiCfg(cell, cellRecfg);
3677 #endif /*RGR_SI_SCH */
3679 /* Overload RACH Control changes */
3680 if (cellRecfg->recfgTypes & RGR_CELL_CNTRL_CMD_RECFG)
3682 if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_RACH_OVRLD)
3684 cell->overLoadBackOffEnab = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffEnb;
3685 cell->overLoadBackOffval = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffVal;
3687 else if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_CPU_OVRLD)
3689 if( ROK != rgSCHUtlResetCpuOvrLdState(cell, cellRecfg->cntrlCmdCfg.cmdDesc.\
3690 cpuOvrLd.instruction))
3692 RLOG_ARG1(L_ERROR,DBG_CELLID, cellRecfg->cellId,
3693 "Invalid CPU OvrLd Ins %d for cell",
3694 cellRecfg->cntrlCmdCfg.cmdDesc.cpuOvrLd.instruction);
3700 /* LTE_ADV_FLAG_REMOVED_START */
3701 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
3703 if(cellRecfg->rgrLteAdvCfg.pres & RGR_ABS)
3705 cell->lteAdvCb.absCfg =
3706 cellRecfg->rgrLteAdvCfg.absCfg;
3708 if(cellRecfg->rgrLteAdvCfg.pres & RGR_SFR)
3710 memcpy(&cell->lteAdvCb.sfrCfg, &cellRecfg->rgrLteAdvCfg.sfrCfg,
3711 sizeof(RgrSfrConfig));
3712 /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3713 if (cellRecfg->rgrLteAdvCfg.sfrCfg.status == RGR_ENABLE)
3715 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3717 /*initialise the pools of CC and CE*/
3718 if(rgSchSFRTotalPoolInit(cell, cell->subFrms[i]))
3726 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3728 /*initialise the pools of CC and CE*/
3729 rgSchSFRTotalPoolFree(&cell->subFrms[i]->sfrTotalPoolInfo, cell);
3732 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3734 /* releasing rntp info val from each subframe */
3735 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3737 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3740 /* releasing RNTP Aggregation Info from CellCb*/
3741 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3743 cell->lteAdvCb.dsfrCfg.status = RGR_DISABLE;
3747 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** Start */
3748 if(cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR)
3750 cell->lteAdvCb.dsfrCfg =
3751 cellRecfg->rgrLteAdvCfg.dsfrCfg;
3752 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3754 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3756 /*initialise the pools of CC and CE*/
3757 if(rgSchDSFRRntpInfoInit(&cell->subFrms[i]->rntpInfo,cell,cell->bwCfg.dlTotalBw))
3762 /*Calculating the length of RNTP array based on Dl Bandwidth */
3763 len = (uint16_t)((cell->bwCfg.dlTotalBw % 8 == 0) ? (cell->bwCfg.dlTotalBw/8) : (cell->bwCfg.dlTotalBw/8 + 1)); /* KW fix for LTE_ADV */
3764 if(cell->rntpAggrInfo.pres == NOTPRSNT)
3766 if((rgSCHUtlAllocSBuf(inst, (Data**)&(cell->rntpAggrInfo.val),
3767 (len * sizeof(uint8_t)))) != ROK)
3769 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,
3770 "Memory allocation FAILED for RNTP Alloc");
3773 cell->rntpAggrInfo.pres = PRSNT_NODEF;
3774 cell->rntpAggrInfo.len = len;
3777 /* in case if DSFR is disabled, need to free RNTP pattern val*/
3780 /* releasing rntp info val from each subframe */
3781 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3783 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3786 /* releasing RNTP Aggregation Info from CellCb*/
3787 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3790 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** End */
3792 /* LTE_ADV_FLAG_REMOVED_END */
3794 /* Dynamic CFI cell Reconfiguration */
3795 if(cellRecfg->recfgTypes & RGR_CELL_DYN_CFI_RECFG)
3797 if(cell->dynCfiCb.isDynCfiEnb != cellRecfg->isDynCfiEnb)
3799 if(cell->dynCfiCb.switchOvrInProgress)
3801 cell->dynCfiCb.dynCfiRecfgPend = TRUE;
3805 cell->dynCfiCb.isDynCfiEnb = cellRecfg->isDynCfiEnb;
3806 rgSCHDynCfiReCfg(cell, cellRecfg->isDynCfiEnb);
3811 /* To hanlde the case where reconfiguration comes for disabling
3812 * and then enabling before switchover period expires */
3813 cell->dynCfiCb.dynCfiRecfgPend = FALSE;
3816 /* Dynamic config of AUTO chnage flag */
3817 if(cellRecfg->recfgTypes & RGR_CELL_AUTO_CFG_MODE_RECFG)
3819 if(cell->isAutoCfgModeEnb != cellRecfg->isAutoCfgModeEnb)
3821 cell->isAutoCfgModeEnb = cellRecfg->isAutoCfgModeEnb;
3825 if(cell->isAutoCfgModeEnb)
3827 RLOG0(L_INFO,"Auto Mode Cfg enabled durint cell recfg\n");
3831 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
3833 cell->minDlResNonCsg = cellRecfg->csgParamCfg.minDlResNonCsg;
3834 cell->minUlResNonCsg = cellRecfg->csgParamCfg.minUlResNonCsg;
3837 errInfo->errCause = RGSCHERR_NONE;
3839 } /* rgSCHCfgRgrCellRecfg */
3842 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3846 * Function : rgSCHCfgRgrUeRecfgRntiChg
3849 * - If rnti changes,
3850 * - Invoke RAM for UE reconfiguration.
3851 * - Delete old UE from the list.
3852 * - Update the new rnti and re-insert the UE in the list.
3853 * - If successful, return ROK else RFAILED.
3855 * @param[in] RgSchCellCb *cell
3856 * @param[in] RgSchUeCb *ue
3857 * @param[in] RgrUeRecfg *ueRecfg
3858 * @param[out] RgSchErrInfo *errInfo
3864 static S16 rgSCHCfgRgrUeRecfgRntiChg
3868 RgrUeRecfg *ueRecfg,
3869 RgSchErrInfo *errInfo
3872 static S16 rgSCHCfgRgrUeRecfgRntiChg(cell, ue, ueRecfg, errInfo)
3875 RgrUeRecfg *ueRecfg;
3876 RgSchErrInfo *errInfo;
3885 RgSchDlHqEnt **hqEnt = &(RG_SCH_CMN_GET_UE_HQE(ue, cell));
3888 /* Handle CRNTI change in reconfiguration */
3889 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
3891 RgSchRntiLnk *oldRntiLnk=NULLP;
3892 CmLteRnti oldRnti = 0;
3893 if ((raCb = rgSCHDbmGetRaCb(cell, ueRecfg->newCrnti)) == NULLP)
3895 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UEID:No RaCb exists while"
3896 "Reconfig for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3900 /* rntiLnk does not exist for a HandIn UE. Hence this check. */
3903 oldRntiLnk = ue->rntiLnk;
3907 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3911 RLOG2(L_INFO,"UE ID CHNG OLD %d new %d",ueRecfg->oldCrnti, ueRecfg->newCrnti);
3913 /* Fix : syed Deleting Old DL HqEnt. It would be assigned after
3914 * reest RACH(msg4) is completed. */
3915 rgSCHDhmDelHqEnt(cell, hqEnt);
3917 /* Initialize RAM related information for UE */
3918 ret = rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo);
3921 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"RAM Handling for UE Reconfig failed"
3922 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3925 /* Delete Ue from the ue list */
3926 rgSCHDbmDelUeCb(cell, ue);
3931 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3933 if(ue->cellInfo[sCellIdx] != NULLP)
3935 rgSCHDbmDelUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3941 /* Inititialize Ue control block */
3942 ue->ueId = ueRecfg->newCrnti;
3943 RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
3944 "Changing RNTI from %d to %d",
3950 rgSCHUtlUpdEmtcY(ue);
3954 /* Fix ccpu00122631: PCell_Reest: Updating new Rnti in all the cells
3957 for(idx = 0; idx < CM_LTE_MAX_CELLS; idx++)
3959 if(ue->cellInfo[idx])
3961 ue->cellInfo[idx]->dlAllocCb.rnti = ueRecfg->newCrnti;
3965 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3967 /* If raCb received PHR, update scheduler */
3968 if(raCb->phr.pres == TRUE)
3970 ue->macCeRptTime = raCb->msg3AllocTime;
3971 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3974 #ifdef RGR_V2 /* Acc Fix */
3975 if(TRUE == ue->isDrxEnabled)
3977 ueRecfg->ueDrxRecfg.isDrxEnabled = TRUE;
3978 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
3982 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE DRX re-est failed"
3983 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3987 #endif /* Acc Fix */
3989 /* Re-insert updated Ue */
3990 rgSCHDbmInsUeCb(cell, ue);
3995 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3997 if(ue->cellInfo[sCellIdx] != NULLP)
3999 rgSCHDbmInsUeCb(ue->cellInfo[sCellIdx]->cell, ue);
4007 ue->tenbStats->stats.rnti = ue->ueId;
4010 /* Fix : syed If MSG4 is done, since corresponding ueCb
4011 * is ready, the raCb should be cleared immediately.
4012 * Otherwise it would remain in the cell until timed out
4013 * and till then the hq Feedbacks will be assumed to be
4015 if (raCb->raState == RGSCH_RA_MSG4_DONE)
4017 RLOG_ARG1(L_DEBUG,DBG_CELLID,ueRecfg->cellId,
4018 "RNTI:%d with RaCb deleted as Msg4 transmission is done",
4020 rgSCHRamDelRaCb(cell, raCb, FALSE);
4022 /* Fix : syed moving the UL CQI initialization to UERESET */
4024 /* Release Older rnti */
4027 /* This is the rare case in which back to back reestablishment is
4028 * happening and previous re-est was not done completely (MSG4 was
4029 * not done) for an UE, and again re-est is triggered for the same
4030 * UE. We are deleting the old RA CB for the previous re-est which
4031 * still exist due to MSG4 not transmitted successfully */
4032 if ((oldRaCb = rgSCHDbmGetRaCb(cell, oldRntiLnk->rnti)) != NULLP)
4034 rgSCHRamDelRaCb(cell, oldRaCb, FALSE);
4037 rgSCHUtlRlsRnti(cell, oldRntiLnk, TRUE, ueRecfg->newCrnti);
4041 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
4042 /* Just indicate to MAC, no need to release at SCH */
4043 RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
4044 "HO OldRnti:%d RLS and NewRnti:%d CHNG IND TO MAC",
4045 oldRnti, ueRecfg->newCrnti);
4046 rgSCHUtlIndRntiRls2Mac(cell, oldRnti, TRUE, ueRecfg->newCrnti);
4052 * @brief Handler for the UE reconfiguration request from RRC to MAC.
4056 * Function : rgSCHCfgRgrUeRecfg
4059 * - If rnti changes,
4060 * - Invoke RAM for UE reconfiguration.
4061 * - Delete old UE from the list.
4062 * - Update the new rnti and re-insert the UE in the list.
4063 * - Update the UE control block with the reconfigured values.
4064 * - Invoke SCH, UHM and DHM with updated UE control block to
4065 * update scheduler, uplink HARQ and downlink HARQ specific
4067 * - If successful, return ROK else RFAILED.
4069 * @param[in] RgSchCellCb *cell
4070 * @param[in] RgSchUeCb *ue
4071 * @param[in] RgrUeRecfg *ueRecfg
4072 * @param[out] RgSchErrInfo *errInfo
4078 S16 rgSCHCfgRgrUeRecfg
4082 RgrUeRecfg *ueRecfg,
4083 RgSchErrInfo *errInfo
4086 S16 rgSCHCfgRgrUeRecfg(cell, ue, ueRecfg, errInfo)
4089 RgrUeRecfg *ueRecfg;
4090 RgSchErrInfo *errInfo;
4095 Bool dciChange = TRUE;
4098 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RECFG;
4101 if (ue->numSCells > 0)
4105 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
4106 (ue->accessStratumRls != ueRecfg->accessStratumRls))
4108 ue->accessStratumRls = ueRecfg->accessStratumRls;
4112 /* if SCELL_RECFG is present , no other
4113 * type will be present. Process Scell addition
4116 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_ADD_RECFG)
4118 ret = rgSCHSCellCfgUeCfg(cell, ue, ueRecfg, errInfo);
4121 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
4122 /*FH: SCell config failed for a scell index hence revert all successful
4123 * Scell config and send negative confirmation to APP*/
4124 rgSCHSCellCfgUeCfgRollBack(cell, ue, ueRecfg);
4128 if (dciChange == TRUE)
4130 if (ue->numSCells > 0)
4133 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
4137 /* 1 bit CSI Access Stratum Release Change */
4138 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4141 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_PUCCH_RECFG)
4143 ret = rgSCHSCellCfgUePucchReCfg(cell, ue, ueRecfg, errInfo);
4146 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_PUCCH_RECFG;
4151 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
4152 (ue->accessStratumRls != ueRecfg->accessStratumRls))
4154 ue->accessStratumRls = ueRecfg->accessStratumRls;
4155 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4157 #endif /* LTE_ADV */
4159 if (ueRecfg->ueRecfgTypes)
4161 /* Update scheduler related information for UE */
4162 ret = rgSCHUtlRgrUeRecfg(cell, ue, ueRecfg, errInfo);
4165 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
4166 "Scheduler handling while reconfig failed"
4167 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
4171 /* Update uplink HARQ related information for UE */
4172 rgSCHUhmRgrUeRecfg(cell, ue, ueRecfg);
4174 /* Update TA related information for UE */
4175 if (ueRecfg->ueRecfgTypes & RGR_UE_TATMR_RECFG)
4177 rgSCHCfgUeTaRecfg(cell, ue, ueRecfg, errInfo);
4180 /*Update Measurement Gap and AckNack Details */
4181 /* After merging from 2.2 */
4182 if (ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG)
4184 ret = rgSCHMeasGapANRepUeRecfg(cell, ue, ueRecfg);
4187 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Measurement Gap and"
4188 "AckNack Rep Recfg failed for OLD CRNTI:%d NEW CRNTI:%d",
4189 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4193 if (ueRecfg->ueRecfgTypes & RGR_UE_BSRTMR_RECFG)
4195 cmInitTimers(&ue->bsrTmr, 1);
4196 ue->ul.bsrTmrCfg = ueRecfg->ueBsrTmrRecfg;
4197 if ((ue->ul.bsrTmrCfg.isPrdBsrTmrPres) &&
4198 (ue->ul.bsrTmrCfg.prdBsrTmr == 0xFFFF))
4200 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = FALSE;
4205 if (RFAILED == rgSCHCfgRgrUeRecfgRntiChg (cell, ue, ueRecfg, errInfo))
4207 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"RNTI change "
4208 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4209 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4214 /* Re-Initialize Aperiodic CQI Information for UE*/
4215 if ( ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
4217 ret = rgSCHCfgAcqiUeReCfg(cell, ue, &ueRecfg->aprdDlCqiRecfg,
4220 /* Re-Initialize Periodic CQI/PMI, RI Information for UE */
4221 if ( ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG)
4223 ret = rgSCHCfgPCqiUeReCfg(cell, ue, &ueRecfg->cqiCfg,
4226 /* Re-Initialize UL SRS Information for UE */
4227 if ( ueRecfg->ueRecfgTypes & RGR_UE_SRS_RECFG)
4229 ret = rgSCHCfgSrsUeReCfg(cell, ue, &ueRecfg->srsCfg);
4231 /* Re-Initialize SR Information for UE */
4232 if ( ueRecfg->ueRecfgTypes & RGR_UE_SR_RECFG)
4234 ret = rgSCHCfgSrUeReCfg(cell, ue, &ueRecfg->srCfg);
4239 if(ueRecfg->isHdFddEnbld)
4241 ret = rgSCHHdFddUeCfg(cell, ue, ueRecfg->isHdFddEnbld);
4244 errInfo->errCause = RGSCHERR_HDFDD_SPSCFGRD;
4248 #endif /* LTEMAC_HDFDD */
4250 if ( ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
4252 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
4256 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE DRX reconfig failed"
4257 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4258 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4263 /* ccpu00117452 - MOD - Changed macro name from
4264 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
4266 /* CQI Reporting (N) Re-configuration */
4267 if(ueRecfg->ueRecfgTypes & RGR_UE_CQIREPT_RECFG)
4269 ret = rgSCHCfgUeCqiReptReCfg(cell, ue, ueRecfg);
4272 errInfo->errCause = RGSCHERR_CQIREPT;
4276 #endif /* End of RGR_CQI_REPT */
4278 /* pA Re-configuration */
4279 if((ueRecfg->ueRecfgTypes & RGR_UE_PA_RECFG) &&
4280 RG_SCH_UE_CFG_ISPAPRSNT(ueRecfg->uePdschDedCfg.uepACfg))
4282 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
4283 RG_SCH_CMN_GET_PA(ue,cell).val = ueRecfg->uePdschDedCfg.uepACfg.pA;
4287 /* LTE_ADV_FLAG_REMOVED_START */
4288 if(ueRecfg->ueRecfgTypes & RGR_UE_LTEA_RECFG)
4290 if(ueRecfg->ueLteAdvCfg.pres & RGR_ABS)
4292 ue->lteAdvUeCb.rgrLteAdvUeCfg.isAbsUe = ueRecfg->ueLteAdvCfg.isAbsUe;
4295 if(ueRecfg->ueLteAdvCfg.pres & RGR_SFR)
4297 ue->lteAdvUeCb.rgrLteAdvUeCfg.isUeCellEdge = ueRecfg->ueLteAdvCfg.isUeCellEdge;
4300 /* LTE_ADV_FLAG_REMOVED_END */
4302 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_DPLXMODE_RECFG)
4304 rgSCHEmtcHdFddUeCfg (cell, ue,
4305 ueRecfg->emtcUeRecfg.isHdFddEnbld);
4307 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_PO_TRIGGER)
4309 rgSCHEmtcPOTrigger(cell, ue);
4312 errInfo->errCause = RGSCHERR_NONE;
4315 } /* rgSCHCfgRgrUeRecfg */
4319 * @brief Handler for the logical channel reconfiguration request from
4324 * Function : rgSCHCfgRgrLchRecfg
4327 * - Invoke scheduler to update scheduler specific information.
4328 * - Update the dedicated logical channel Cb with the reconfigured
4330 * - If successful, return ROK else RFAILED.
4332 * @param[in] RgUlCellCb *cell
4333 * @param[in] RgUlUeCb *ue
4334 * @param[in] RgSchUlLcCb *ulLc
4335 * @param[in] RgSchDlLcCb *dlLc
4336 * @param[in] RgrLchRecfg *lcRecfg
4337 * @param[out] RgSchErrInfo *errInfo
4343 S16 rgSCHCfgRgrLchRecfg
4348 RgrLchRecfg *lcRecfg,
4349 RgSchErrInfo *errInfo
4352 S16 rgSCHCfgRgrLchRecfg(cell, ue, dlLc, lcRecfg, errInfo)
4356 RgrLchRecfg *lcRecfg;
4357 RgSchErrInfo *errInfo;
4362 errInfo->errCause = RGSCHERR_CFG_RGR_LC_RECFG;
4363 /* Invoke Scheduler to update the new configuration */
4364 ret = rgSCHUtlRgrLcRecfg(cell, ue, dlLc, lcRecfg, errInfo);
4367 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Scheduler handling for LC Recfg"
4368 " failed for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
4372 errInfo->errCause = RGSCHERR_NONE;
4374 } /* rgSCHCfgRgrLchRecfg */
4376 * @brief Handler for the logical channel reconfiguration request from
4381 * Function : rgSCHCfgRgrLcgRecfg
4384 * - Invoke scheduler to update scheduler specific information.
4385 * - Update the dedicated logical channel Cb with the re-configured
4387 * - If successful, return ROK else RFAILED.
4389 * @param[in] RgUlCellCb *cell
4390 * @param[in] RgUlUeCb *ue
4391 * @param[in] RgrLcgRecfg *lcgRecfg
4392 * @param[out] RgSchErrInfo *errInfo
4398 S16 rgSCHCfgRgrLcgRecfg
4402 RgrLcgRecfg *lcgRecfg,
4403 RgSchErrInfo *errInfo
4406 S16 rgSCHCfgRgrLcgRecfg(cell, ue, lcgRecfg, errInfo)
4409 RgrLcgRecfg *lcgRecfg;
4410 RgSchErrInfo *errInfo;
4415 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_RECFG;
4417 /*Added for handling LCG ReConfig if the LCG was deleted */
4418 ue->ul.lcgArr[lcgRecfg->ulRecfg.lcgId].lcgId = lcgRecfg->ulRecfg.lcgId;
4420 /* Invoke Scheduler to update the new configuration */
4421 ret = rgSCHUtlRgrLcgRecfg(cell, ue, lcgRecfg, errInfo);
4424 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Scheduler handling for LCG Recfg"
4425 " failed for CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
4429 errInfo->errCause = RGSCHERR_NONE;
4431 } /* rgSCHCfgRgrLcgRecfg */
4434 * @brief Handler for the UE Reset request from RRM to MAC.
4438 * Function : rgSCHCfgRgrUeReset
4441 * - Call Measument Gap Module and Ack/Nack Module for resetting UE.
4442 * - Call Common Schduler UE rest API which inturn will call scheduler
4443 * specific UE Reset APis to reset UE.
4445 * @param[in] RgSchCellCb *cell
4446 * @param[in] RgSchUeCb *ue
4447 * @param[in] RgrRst *reset
4448 * @param[out] RgSchErrInfo *errInfo
4454 S16 rgSCHCfgRgrUeReset
4459 RgSchErrInfo *errInfo
4462 S16 rgSCHCfgRgrUeReset(cell, ue, reset, errInfo)
4466 RgSchErrInfo *errInfo;
4472 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RESET;
4474 /* Setting BO of Each Logical Channel of the UE to 0 */
4475 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; idx++)
4477 if(ue->dl.lcCb[idx] != NULLP)
4478 ue->dl.lcCb[idx]->bo = 0;
4481 /* Reset the totalBo */
4483 /* Call DRX module to stop all DRX timers */
4485 if(ue->drxCb != NULLP)
4487 (Void)rgSCHDrxUeDel(cell,ue);
4490 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4491 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4493 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4494 ue->txModeTransCmplt =TRUE;
4497 /* ccpu00133470- Meas Gap should be released during RRC re-establishment */
4498 rgSCHMeasGapANRepUeDel(cell, ue, FALSE);
4500 /* Call Common scheduler which in turn will call specific scheduler for UE
4502 rgSCHUtlUeReset(cell, ue);
4504 /*PCell which is at idx 0 is always active. Adding a line after the loop
4505 *setting RGSCH_PCELL_INDEX to SCELL ACTIVE*/
4506 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
4509 /* In case of back to back reestablishments, when this UE's
4510 * previous ReEst is still in progress and has got RESET
4511 * as part of new ReEst */
4512 if((raCb = rgSCHDbmGetRaCb(cell, ue->ueId)) != NULLP)
4514 rgSCHRamDelRaCb(cell, raCb, FALSE);
4516 /* Fix : syed set UE inactive in DL until UE is reinitialization completed */
4517 ue->dl.dlInactvMask |= RG_HQENT_INACTIVE;
4518 ue->ul.ulInactvMask |= RG_HQENT_INACTIVE;
4519 /* [ccpu00127141] Resetting TA related parameters */
4520 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
4521 ue->dl.taCb.state = RGSCH_TA_IDLE;
4523 /*[ccpu00121813]-ADD-Initializing outstanding TA value */
4524 ue->dl.taCb.outStndngTa = FALSE;
4525 ue->dl.taCb.outStndngTaval = RGSCH_NO_TA_RQD;
4527 if (ue->dl.taCb.cfgTaTmr)
4529 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
4533 /* Resetting the Tx mode change factor on UE reset */
4534 ue->mimoInfo.txModUpChgFactor = 0;
4535 ue->mimoInfo.txModDownChgFactor = 0;
4538 errInfo->errCause = RGSCHERR_NONE;
4540 } /* rgSCHCfgRgrUeReset */
4543 * @brief Handler for the cell delete request from RRM to MAC.
4547 * Function : rgSCHCfgRgrCellDel
4550 * - Fetch the cell control block.
4551 * - Remove the cell control block from the hash list of cells.
4552 * - Free the cell control block.
4553 * - If successful, return ROK else return RFAILED.
4555 * @param[in] RgSchCellCb *cell
4556 * @param[in] RgrDel *cellDelInfo
4557 * @param[out] RgSchErrInfo *errInfo
4563 S16 rgSCHCfgRgrCellDel
4566 RgrDel *cellDelInfo,
4567 RgSchErrInfo *errInfo
4570 S16 rgSCHCfgRgrCellDel(cell, cellDelInfo, errInfo)
4572 RgrDel *cellDelInfo;
4573 RgSchErrInfo *errInfo;
4577 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_DEL;
4579 if (cell->cellId != cellDelInfo->u.cellDel.cellId)
4581 RLOG_ARG0(L_ERROR,DBG_CELLID,cellDelInfo->u.cellDel.cellId,
4582 "Cell does not exist");
4586 /* Free the active cell */
4587 rgSCHCfgFreeCellCb(cell);
4589 errInfo->errCause = RGSCHERR_NONE;
4591 } /* rgSCHCfgRgrCellDel */
4595 * @brief Handler for the UE delete request from RRM to MAC.
4599 * Function : rgSCHCfgRgrUeDel
4602 * - Fetch the UE control block.
4603 * - Remove the UE control block from the hash list of UEs for the cell.
4604 * - Free the UE control block.
4605 * - If successful, return ROK else return RFAILED.
4607 * @param[in] RgSchCellCb *cell
4608 * @param[in] RgrDel *ueDelInfo
4609 * @param[out] RgSchErrInfo *errInfo
4615 S16 rgSCHCfgRgrUeDel
4619 RgSchErrInfo *errInfo
4622 S16 rgSCHCfgRgrUeDel(cell, ueDelInfo, errInfo)
4625 RgSchErrInfo *errInfo;
4631 Inst inst = cell->instIdx;
4632 RgSchCellCb *secCellCb = NULLP;
4635 errInfo->errCause = RGSCHERR_CFG_RGR_UE_DEL;
4637 if (cell->cellId != ueDelInfo->u.ueDel.cellId)
4639 RLOG_ARG1(L_ERROR,DBG_CELLID,ueDelInfo->u.ueDel.cellId,
4640 "Cell does not exist CRNTI:%d",
4641 ueDelInfo->u.ueDel.crnti);
4644 if ((ue = rgSCHDbmGetUeCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4646 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4648 RLOG_ARG1(L_ERROR,DBG_CELLID,ueDelInfo->u.ueDel.cellId,
4649 "RaCb does not exist for CRNTI:%d",ueDelInfo->u.ueDel.crnti);
4654 /* This happens in case of Msg4 rejection */
4662 if(ueDelInfo->u.ueScellRel.ueDelTypes & RGR_UE_SCELL_DEL_RECFG)
4664 for(uint8_t idx = 0; idx < ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.numSCells; idx++)
4666 if(NULLP != (secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, \
4667 ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellId)))
4669 rgSCHUtlSndUeSCellDel2Mac(secCellCb, ue->ueId);
4670 rgSCHSCellDelUeSCell(cell,ue,ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellIdx);
4672 if ( ue->numSCells == 0)
4674 ue->allocCmnUlPdcch = TRUE;
4678 if (ue->numSCells == 0)
4680 /* As there is no SCell left so DCI 0 size at UE specific search space
4681 * will be recalculated as the CSI is reduced to 1 bit */
4682 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4688 /* Delete Ue from the UE list of CELL*/
4689 rgSCHDbmDelUeCb(cell, ue);
4692 rgSCHDbmDelL2MUe(cell, ue);
4695 /* Call MeasGap and AckNakRep processing module */
4696 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
4698 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4699 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4701 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4704 /* Call DRX module to remove UEs from various
4708 if(ue->drxCb != NULLP)
4710 (Void)rgSCHDrxUeDel(cell,ue);
4713 /*Fix: If RA CB exists, delete it*/
4714 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) != NULLP)
4716 /* Fix : syed RNTI was getting released twice, once by racb del
4717 * and subsequently by ueDel. Let it get released by ueDel alone */
4718 rgSCHRamDelRaCb(cell, raCb, FALSE);
4723 rgSCHEmtcUeDel(cell, ue);
4727 rgSCHCfgFreeUeCb(cell, ue);
4729 errInfo->errCause = RGSCHERR_NONE;
4734 } /* rgSCHCfgRgrUeDel */
4738 * @brief Handler for the logical channel delete request from
4743 * Function : rgSCHCfgRgrLcDel
4746 * - Fetch the logical channel control block.
4747 * - Free the logical channel control block.
4748 * - If successful, return ROK else return RFAILED.
4750 * @param[in] RgrDel *lcDelInfo
4751 * @param[out] RgSchErrInfo *errInfo
4757 S16 rgSCHCfgRgrLcDel
4761 RgSchErrInfo *errInfo
4764 S16 rgSCHCfgRgrLcDel(cell, lcDelInfo, errInfo)
4767 RgSchErrInfo *errInfo;
4778 errInfo->errCause = RGSCHERR_CFG_RGR_LC_DEL;
4780 /* Fetch the Active cell */
4781 if (cell->cellId != lcDelInfo->u.lchDel.cellId)
4783 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "Cell does not exist %d",
4784 lcDelInfo->u.lchDel.cellId);
4789 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lchDel.crnti)) == NULLP)
4791 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4792 "UE does not exist for CRNTI:%d LCID:%d",
4793 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4796 if (lcDelInfo->u.lchDel.lcgId > 3)
4798 RLOG_ARG3(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4799 "[%d]UEID:For LC %d, LCGid %d is invalid",
4800 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId,
4801 lcDelInfo->u.lchDel.lcgId);
4804 if ((dlLc = rgSCHDbmGetDlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
4807 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4808 "LC does not exist for CRNTI:%d LCID:%d",
4809 lcDelInfo->u.lchDel.crnti, lcDelInfo->u.lchDel.lcId);
4812 rgSCHUtlRgrLcDel(cell, ue, lcDelInfo->u.lchDel.lcId,lcDelInfo->u.lchDel.lcgId);
4814 /* Reduce any pending bo from this LC(if any)
4815 * from the UE's total BO */
4818 if(ue->totalBo >= dlLc->bo)
4820 ue->totalBo -= dlLc->bo;
4824 ue->totalBo = 0; /* this scenario should not occur */
4827 rgSCHDbmDelDlDedLcCb(ue, dlLc);
4828 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
4831 lcId = lcDelInfo->u.lchDel.lcId;
4832 if (TRUE == ue->ul.lcCb[lcId -1].isValid)
4834 ulLc = &(ue->ul.lcCb[lcId -1]);
4835 ue->ul.lcCb[lcId -1].isValid = FALSE;
4837 if((ulLc->qciCb->ulUeCount) &&
4838 (ue->ulActiveLCs & (1 << (ulLc->qciCb->qci -1))))
4840 ulLc->qciCb->ulUeCount--;
4841 ue->ulActiveLCs &= ~(1 << (ulLc->qciCb->qci -1));
4843 /* Shifting LCs in LCG Array because of LC deletion */
4844 for (idx = ulLc->lcgArrIdx +1; idx < ulLc->lcg->numLch;
4847 ulLc->lcg->lcArray[idx -1] =
4848 ulLc->lcg->lcArray[idx];
4849 ulLc->lcg->lcArray[idx -1]->lcgArrIdx = idx -1;
4851 ulLc->lcg->numLch--;
4852 ulLc->lcg->lcArray[idx -1] = NULLP;
4854 #endif /* LTE_L2_MEAS */
4857 errInfo->errCause = RGSCHERR_NONE;
4859 } /* rgSCHCfgRgrLcDel */
4864 * @brief Handler for the logical channel delete request from
4869 * Function : rgSCHCfgRgrLcgDel
4872 * - Fetch the logical channel control block.
4873 * - Free the logical channel control block.
4874 * - If successful, return ROK else return RFAILED.
4876 * @param[in] RgrDel *lcDelInfo
4877 * @param[out] RgSchErrInfo *errInfo
4883 S16 rgSCHCfgRgrLcgDel
4887 RgSchErrInfo *errInfo
4890 S16 rgSCHCfgRgrLcgDel(cell, lcDelInfo, errInfo)
4893 RgSchErrInfo *errInfo;
4896 RgSchUeCb *ue = NULLP;
4898 uint8_t lcCount = 0;
4902 lcgId = lcDelInfo->u.lcgDel.lcgId;
4904 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_DEL;
4906 /* Fetch the Active cell */
4907 if (cell->cellId != lcDelInfo->u.lcgDel.cellId)
4909 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4910 "CELL does not exist for CRNTI:%d LCGID:%d",
4911 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4916 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lcgDel.crnti)) == NULLP)
4918 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4919 "UE does not exist for CRNTI:%d LCGID:%d",
4920 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4924 /* set lcgId in UEs lcg cntrl blk to invalid */
4925 rgSCHUtlRgrLcgDel(cell, ue, lcgId);
4926 ue->ul.lcgArr[lcgId].lcgId = RGSCH_INVALID_LCG_ID;
4929 /* Since LCs are being deleted, if any of them are contributing
4930 to Active UE count for a QCI, decrease the count */
4931 for (lcCount =0; (lcCount < RGSCH_MAX_LC_PER_UE) &&
4932 (lcCount < ue->ul.lcgArr[lcgId].numLch) ; lcCount++)
4934 if (ue->ul.lcgArr[lcgId].lcArray[lcCount])
4936 if((ue->ul.lcgArr[lcgId].
4937 lcArray[lcCount]->qciCb->ulUeCount) &&
4939 (1 << ((ue->ul.lcgArr[lcgId].
4940 lcArray[lcCount])->qciCb->qci -1))))
4943 ue->ul.lcgArr[lcgId].
4944 lcArray[lcCount]->qciCb->ulUeCount--;
4945 ue->ulActiveLCs &= ~(1 <<
4946 (ue->ul.lcgArr[lcgId].
4947 lcArray[lcCount]->qciCb->qci -1));
4953 errInfo->errCause = RGSCHERR_NONE;
4955 } /* rgSCHCfgRgrLcgDel */
4959 /***********************************************************
4961 * Func : rgSCHCfgVldtRgrLcCfg
4964 * Desc : Validates dedicated logical channel configuration recieved from RRM.
4974 **********************************************************/
4976 S16 rgSCHCfgVldtRgrLcCfg
4982 RgSchErrInfo *errInfo
4985 S16 rgSCHCfgVldtRgrLcCfg(inst, lcCfg, cell, ue, errInfo)
4990 RgSchErrInfo *errInfo;
4994 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LC_CFG;
4996 if (((*cell) == NULLP) ||
4997 ((*cell)->cellId != lcCfg->cellId))
4999 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Cell does not existi for "
5000 "CRNTI:%d LCID:%d",lcCfg->crnti, lcCfg->lcId);
5005 if ((*ue = rgSCHDbmGetUeCb(*cell, lcCfg->crnti)) == NULLP)
5007 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"UE does not exist for dedicated"
5008 " logical channel CRNTI:%d LCID:%d", lcCfg->crnti, lcCfg->lcId);
5012 /* Validate logical channel Id */
5013 if ((lcCfg->lcId < RGSCH_DEDLC_MIN_LCID)
5014 ||(lcCfg->lcId > RGSCH_DEDLC_MAX_LCID))
5016 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid logical channel Id:%d"
5017 "for CRNTI:%d",lcCfg->lcId,lcCfg->crnti);
5021 if (lcCfg->lcType != CM_LTE_LCH_DTCH && lcCfg->lcType != CM_LTE_LCH_DCCH)
5023 RLOG_ARG3(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid logical channel Type %d"
5024 "CRNTI:%d LCID:%d",lcCfg->lcType,lcCfg->crnti, lcCfg->lcId);
5029 } /* rgSCHCfgVldtRgrLcCfg */
5031 /***********************************************************
5033 * Func : rgSCHCfgVldtRgrLcgCfg
5036 * Desc : Validates dedicated logical channel group configuration recieved from RRM.
5046 **********************************************************/
5048 S16 rgSCHCfgVldtRgrLcgCfg
5054 RgSchErrInfo *errInfo
5057 S16 rgSCHCfgVldtRgrLcgCfg(inst, lcgCfg, cell, ue, errInfo)
5062 RgSchErrInfo *errInfo;
5066 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LCG_CFG;
5068 if (((*cell) == NULLP) ||
5069 ((*cell)->cellId != lcgCfg->cellId))
5071 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgCfg->cellId,"Cell does not exist for"
5072 "CRNTI:%d LCGID:%d",lcgCfg->crnti,lcgCfg->ulInfo.lcgId);
5077 if ((*ue = rgSCHDbmGetUeCb(*cell, lcgCfg->crnti)) == NULLP)
5079 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgCfg->cellId,"UE does not exist for "
5080 "dedicated logical channel CRNTI:%d LCGID:%d", lcgCfg->crnti, lcgCfg->ulInfo.lcgId);
5084 if ((lcgCfg->ulInfo.gbr != 0) && (lcgCfg->ulInfo.mbr < lcgCfg->ulInfo.gbr))
5090 } /* rgSCHCfgVldtRgrLcgCfg */
5093 /***********************************************************
5095 * Func : rgSCHCfgVldtRgrCellPwrCfg
5097 * Desc : Validates cell power configuration.
5107 **********************************************************/
5109 static S16 rgSCHCfgVldtRgrCellPwrCfg
5112 RgrCellCfg *cellCfg,
5113 RgSchErrInfo *errInfo
5116 static S16 rgSCHCfgVldtRgrCellPwrCfg(inst, cellCfg, errInfo)
5118 RgrCellCfg *cellCfg;
5119 RgSchErrInfo *errInfo;
5126 /* This function does nothing now, placeholder for
5127 * subsequent power config validations that may be needed */
5131 } /* rgSCHCfgVldtRgrCellPwrCfg */
5134 /***********************************************************
5136 * Func : rgSCHCfgVldtRgrCmnLcCfg
5139 * Desc : Validates common logical channel configuration recieved from RRM.
5141 * @param[in] Inst inst
5142 * @param[in] RgrCellCfg *cellCfg
5143 * @param[out] RgSchErrInfo *errInfo
5152 **********************************************************/
5154 static S16 rgSCHCfgVldtRgrCmnLcCfg
5157 RgrCellCfg *cellCfg,
5158 RgSchErrInfo *errInfo
5161 static S16 rgSCHCfgVldtRgrCmnLcCfg(inst, cellCfg, errInfo)
5163 RgrCellCfg *cellCfg;
5164 RgSchErrInfo *errInfo;
5168 RgrCmnLchCfg *lcCfg;
5169 uint8_t dirVld = FALSE;
5170 uint8_t bitMask = 0x00;
5173 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CMN_LC_CFG;
5175 for (idx = 0; idx < cellCfg->numCmnLcs; idx++)
5177 lcCfg = &(cellCfg->cmnLcCfg[idx]);
5178 /* Validate downlink info */
5179 if (lcCfg->dir & RGR_DIR_TX)
5181 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
5183 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
5187 bitMask |= RGSCH_BCCH_DLSCH_CFG1;
5194 (cellCfg->siCfg.siWinSize == 1) ||
5195 (cellCfg->siCfg.siWinSize == 2) ||
5196 (cellCfg->siCfg.siWinSize == 5) ||
5197 (cellCfg->siCfg.siWinSize == 10) ||
5198 (cellCfg->siCfg.siWinSize == 15) ||
5199 (cellCfg->siCfg.siWinSize == 20) ||
5200 (cellCfg->siCfg.siWinSize == 40)) &&
5201 (cellCfg->siCfg.retxCnt>0)
5204 bitMask |= RGSCH_BCCH_DLSCH_CFG2;
5208 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
5209 "Invalid si config for cell");
5214 else if (lcCfg->dlTrchType == CM_LTE_TRCH_BCH)
5216 bitMask |= RGSCH_BCCH_BCH_CFG;
5220 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,
5221 "Invalid transport channel %d for cell", lcCfg->dlTrchType);
5225 else if (lcCfg->lcType == CM_LTE_LCH_PCCH)
5227 bitMask |= RGSCH_PCCH_CFG;
5229 else if (lcCfg->lcType == CM_LTE_LCH_CCCH)
5231 bitMask |= RGSCH_DL_CCCH_CFG;
5236 /* Validate uplink info */
5237 if (lcCfg->dir & RGR_DIR_RX)
5240 if (lcCfg->lcType != CM_LTE_LCH_CCCH)
5242 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,"Invalid UL common lcType %d "
5243 "for cell", lcCfg->lcType);
5248 bitMask |= RGSCH_UL_CCCH_CFG;
5253 /* Invalid direction */
5256 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,"Invalid Direction %d",
5261 if (bitMask != RGSCH_CELL_ACTIVE_CFG)
5263 RLOG_ARG0(L_ERROR,DBG_CELLID, cellCfg->cellId,
5264 "Invalid Common channel config for cell");
5269 } /* rgSCHCfgVldtRgrCmnLcCfg */
5272 /***********************************************************
5274 * Func : rgSCHCfgVldtUeCqiModeCfg
5277 * Desc : Validates UE CQI modes Configuration recieved from RRC.
5287 **********************************************************/
5289 static S16 rgSCHCfgVldtUeCqiModeCfg
5292 RgrUeDlCqiCfg *ueDlCqiCfg
5295 static S16 rgSCHCfgVldtUeCqiModeCfg(cell, ueDlCqiCfg)
5297 RgrUeDlCqiCfg *ueDlCqiCfg;
5302 if((ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx < 1) ||
5303 (ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx > 1024))
5305 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
5306 "Invalid Periodic CQI Info");
5310 /* Validate UE Aperiodic CQI mode */
5311 if ((ueDlCqiCfg->aprdCqiCfg.pres == TRUE) &&
5312 ((ueDlCqiCfg->aprdCqiCfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
5313 (cell->bwCfg.dlTotalBw <= 7)))
5315 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5316 "Invalid Aperiodic mode config for DL CQI",
5317 ueDlCqiCfg->aprdCqiCfg.aprdModeEnum);
5321 /* Validate UE Periodic CQI mode */
5322 if (ueDlCqiCfg->prdCqiCfg.prdModeEnum > RGR_PRD_CQI_MOD21)
5324 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5325 "Invalid periodic mode config for DL CQI",
5326 ueDlCqiCfg->prdCqiCfg.prdModeEnum);
5329 /* Validate K value in periodic CQI Config */
5330 if(((ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD20) ||
5331 (ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD21)) &&
5332 ((ueDlCqiCfg->prdCqiCfg.k < 1)||
5333 (ueDlCqiCfg->prdCqiCfg.k > 4)))
5335 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
5336 "Invalid K for Subband CQI reporting");
5340 if ((ueDlCqiCfg->prdCqiCfg.type == 1) &&
5341 (ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
5343 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5344 "Invalid periodic mode config for DL CQI",
5345 ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum);
5354 /***********************************************************
5356 * Func : rgSCHCfgVldtUeMeasGapAckNakRepCfg
5359 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5369 **********************************************************/
5371 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg
5377 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg(cell, ueCfg)
5384 if ((ueCfg->ackNackModeEnum == RGR_TDD_ACKNACK_MODE_MULT) &&
5385 (ueCfg->ueAckNackCfg.isAckNackEnabled == TRUE))
5387 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"TDD ACK NACK Multiplexing Mode"
5388 "is not allowed when Ack/Nack is Enabled: %d CRNTI:%d",
5389 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5392 #endif /* LTE_TDD */
5393 /* Validate AckNackRep Factor */
5394 if((ueCfg->ueAckNackCfg.isAckNackEnabled == FALSE) &&
5395 (!ueCfg->ueMesGapCfg.isMesGapEnabled))
5400 if(ueCfg->ueAckNackCfg.isAckNackEnabled)
5402 if ( (ueCfg->ueAckNackCfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5403 || (ueCfg->ueAckNackCfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5405 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId, "Invalid ACK NACK REP Factor:%d CRNTI:%d",
5406 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5410 if(ueCfg->ueMesGapCfg.isMesGapEnabled)
5412 switch(ueCfg->ueMesGapCfg.gapPrd)
5414 case RG_MEAS_GAPPRD_40:
5415 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_40)
5417 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Offset:%d CRNTI:%d",
5418 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5422 case RG_MEAS_GAPPRD_80:
5423 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_80)
5425 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Offset:%d CRNTI:%d",
5426 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5432 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Periodicity Settings:%d"
5433 "CRNTI:%d", ueCfg->ueMesGapCfg.gapPrd,ueCfg->crnti);
5440 } /* rgSCHCfgVldtUeMeasGapAckNakRepCfg*/
5443 /***********************************************************
5445 * Func : rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5448 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5458 **********************************************************/
5460 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5466 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg(cell, ueRecfg)
5468 RgrUeRecfg *ueRecfg;
5472 if((ueRecfg->ueAckNackRecfg.isAckNackEnabled == FALSE) &&
5473 (!ueRecfg->ueMeasGapRecfg.isMesGapEnabled))
5478 if(ueRecfg->ueAckNackRecfg.isAckNackEnabled )
5480 /* Validate AckNackRep Factor */
5481 if ( (ueRecfg->ueAckNackRecfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5482 || (ueRecfg->ueAckNackRecfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5484 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid ACK NACK REP Factor:%d"
5485 "NEW CRNTI:%d",ueRecfg->ueAckNackRecfg.ackNackRepFactor,ueRecfg->newCrnti);
5489 if(ueRecfg->ueMeasGapRecfg.isMesGapEnabled)
5491 switch(ueRecfg->ueMeasGapRecfg.gapPrd)
5493 case RG_MEAS_GAPPRD_40:
5494 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_40)
5496 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Offset:%d"
5497 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5501 case RG_MEAS_GAPPRD_80:
5502 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_80)
5504 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Offset:%d"
5505 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5511 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Periodicity Settings:%d"
5512 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapPrd,ueRecfg->newCrnti);
5519 } /* rgSCHCfgVldtUeMeasGapAckNakRepRecfg*/
5522 /***********************************************************
5524 * Func : rgSCHCfgVldtUeDlSpsCfg
5527 * Desc : Validates UE's DL SPS configuration recieved from RRC.
5537 **********************************************************/
5539 static S16 rgSCHCfgVldtUeDlSpsCfg
5542 RgrUeSpsDlCfg *dlSpsCfg
5545 static S16 rgSCHCfgVldtUeDlSpsCfg(cell, dlSpsCfg)
5547 RgrUeSpsDlCfg *dlSpsCfg;
5553 /* peridicity validation done in SPS module */
5554 if ((dlSpsCfg->numPucchVal > RG_SCH_MAX_NUM_N1PUCCH_PER_UE) ||
5555 (dlSpsCfg->numPucchVal == 0))
5557 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid number of n1Pucch values"
5558 " in DL SPS Config");
5562 for (idx = 0; idx < dlSpsCfg->numPucchVal; ++idx)
5564 if (dlSpsCfg->n1PucchVal[idx] > RG_SCH_MAX_N1PUCCH_VAL)
5567 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid N1Pucch value"
5568 " in DL SPS Config %u", dlSpsCfg->n1PucchVal[idx]);
5570 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid N1Pucch value"
5571 " in DL SPS Config %lu", dlSpsCfg->n1PucchVal[idx]);
5576 /* SPS_TODO: check will change for TDD */
5577 if ((dlSpsCfg->numSpsHqProc == 0) ||
5578 (dlSpsCfg->numSpsHqProc > RGSCH_MAX_DL_HQ_PROC))
5580 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid number of SPS HARQ procs"
5581 " in DL SPS Config");
5586 } /* rgSCHCfgVldtDlSpsCfg */
5587 #endif /* LTEMAC_SPS */
5589 /***********************************************************
5591 * Func : rgSCHCfgVldtUePwrCfg
5594 * Desc : Validates UE Group power configuration recieved from RRC.
5604 **********************************************************/
5606 static S16 rgSCHCfgVldtUePwrCfg
5609 RgrUeUlPwrCfg *pwrCfg
5612 static S16 rgSCHCfgVldtUePwrCfg(cell, pwrCfg)
5614 RgrUeUlPwrCfg *pwrCfg;
5618 /* Group power control works only in accumulated mode */
5619 if (!pwrCfg->isAccumulated)
5622 if (pwrCfg->uePuschPwr.pres)
5624 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Accumulation configutation"
5625 " not in sync with group power configuration");
5630 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePuschPwr) != ROK)
5632 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid PUSCH Group power"
5636 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePucchPwr) != ROK)
5638 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid PUSCH Group power"
5644 } /* rgSCHCfgVldtUePwrCfg */
5646 /***********************************************************
5648 * Func : rgSCHCfgVldtUeGrpPwrCfg
5651 * Desc : Validates UE Group power configuration recieved from RRC.
5661 **********************************************************/
5663 static S16 rgSCHCfgVldtUeGrpPwrCfg
5666 RgrUeGrpPwrCfg *grpPwrCfg
5669 static S16 rgSCHCfgVldtUeGrpPwrCfg(cell, grpPwrCfg)
5671 RgrUeGrpPwrCfg *grpPwrCfg;
5675 if ((grpPwrCfg->pres) &&
5676 (((grpPwrCfg->tpcRnti > cell->rntiDb.rntiStart) &&
5677 ((grpPwrCfg->tpcRnti <
5678 (cell->rntiDb.rntiStart + cell->rntiDb.maxRntis))))))
5680 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Uplink Group power "
5686 } /* rgSCHCfgVldtUeGrpPwrCfg */
5689 /***********************************************************
5691 * Func : rgSCHCfgVldtSpsReCfg
5694 * Desc : Validates UE SPS and other SPS dependent
5695 * configuration recieved from RRC.
5705 **********************************************************/
5707 static S16 rgSCHCfgVldtSpsReCfg
5714 static S16 rgSCHCfgVldtSpsReCfg(cell, ue, ueRecfg)
5717 RgrUeRecfg *ueRecfg;
5721 if ((ueRecfg->ueRecfgTypes & RGR_UE_DLSPS_RECFG) &&
5722 (ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled))
5724 /* Validating SPS RNTI */
5725 if (((ueRecfg->ueSpsRecfg.spsRnti >= cell->rntiDb.rntiStart) &&
5726 (ueRecfg->ueSpsRecfg.spsRnti<=
5727 (cell->rntiDb.rntiStart+cell->rntiDb.maxRntis)))||
5728 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_SI_RNTI) ||
5729 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_P_RNTI))
5731 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid SPS RNTI "
5732 " in DL SPS Recfg OLD CRNTI:%d NEW CCRNTI:%d",
5733 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5736 if (rgSCHCfgVldtUeDlSpsCfg(cell, &ueRecfg->ueSpsRecfg.dlSpsCfg) != ROK)
5738 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid DL SPS configuration"
5739 " for the OLD CRNTI:%d NEW CRNTI:%d",
5740 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5746 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5748 if (ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
5750 /* ccpu00117035 - MOD - changed instIdx to inst */
5751 /* ccpu00117035 - MOD - changed ueID to oldCrnti*/
5752 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5753 " DRX reconfig not supported DL SPS enabled for OLD CRNTI:%d NEW CRNTI:%d",
5754 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5759 /* ccpu00117627 - ADD - SPS recfg validation against HDFDD */
5761 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5763 if(ue->hdFddEnbld == TRUE)
5765 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5766 "DL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5767 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5771 if(ueRecfg->ueSpsRecfg.ulSpsCfg.isUlSpsEnabled)
5773 if(ue->hdFddEnbld == TRUE)
5775 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5776 "UL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5777 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5784 } /*rgSCHCfgVldtSpsReCfg*/
5787 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
5788 /***********************************************************
5790 * Func : rgSCHCfgVldtCqiReptReCfg
5793 * Desc : Validates UE CQI report for DL Power control
5794 * configuration recieved from RRC.
5804 **********************************************************/
5806 static S16 rgSCHCfgVldtCqiReptReCfg
5812 static S16 rgSCHCfgVldtCqiReptReCfg(cell, ueRecfg)
5814 RgrUeRecfg *ueRecfg;
5818 /* Validate DL Power Control Config parameters */
5819 if (ueRecfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
5821 RLOG_ARG3(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalide numColltdCqiRept,"
5822 "MAX supported %d for OLD CRNTI:%d NEW CRNTI:%d",RGR_CQIRPTS_MAXN,
5823 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5828 } /*rgSCHCfgVldtCqiReptReCfg*/
5831 /***********************************************************
5833 * Func : rgSCHCfgRgrLcChfg
5836 * Desc : Handles dedicated logical channel configuration
5837 * recieved from RRC.
5847 **********************************************************/
5849 S16 rgSCHCfgRgrLchCfg
5854 RgSchErrInfo *errInfo
5857 S16 rgSCHCfgRgrLchCfg(cell, ue, lcCfg, errInfo)
5861 RgSchErrInfo *errInfo;
5865 RgSchDlLcCb *dlLc = NULLP;
5866 Inst inst = cell->instIdx;
5871 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LC_CFG;
5873 /* Allocate the downlink logical channel control block */
5874 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&dlLc,
5875 sizeof(RgSchDlLcCb))) != ROK)
5877 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Memory allocation FAILED for "
5878 "Downlink LCId:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5881 if ((uint8_t *)dlLc == NULLP)
5883 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Memory allocation FAILED for "
5884 "Downlink LCID:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5887 dlLc->lcId = lcCfg->lcId;
5889 rgSCHLaaLcCfg(cell, dlLc, lcCfg);
5892 rgSCHDbmInsDlDedLcCb(ue, dlLc);
5894 ret = rgSCHUtlRgrLcCfg(cell, ue, dlLc, lcCfg, errInfo);
5901 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5902 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5905 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
5906 "configuration failed at SCH:UEID:%d LCID:%d CRNTI:%d",
5907 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5911 RGSCH_ARRAY_BOUND_CHECK(inst, ue->ul.lcCb, (lcCfg->lcId -1));
5912 if ( !lcCfg->lcId ||
5913 (TRUE == ue->ul.lcCb[lcCfg->lcId -1].isValid))
5918 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5919 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5922 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
5923 "configuration failed at SCH: UL LC CB already existing"
5924 " UEID:%d LCID:%d CRNTI:%d",
5925 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5929 /* Create UL LC context to maintain LCG to LC mapping and
5930 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5932 ue->ul.lcCb[lcCfg->lcId -1].isValid = TRUE;
5933 ulLc = &(ue->ul.lcCb[lcCfg->lcId -1]);
5935 ulLc->lcId = lcCfg->lcId;
5936 ulLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5937 ulLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5938 ue->ul.lcgArr[lcCfg->lcgId].lcArray[ue->ul.lcgArr[lcCfg->lcgId].numLch] = ulLc;
5939 ulLc->lcg = &ue->ul.lcgArr[lcCfg->lcgId];
5940 ulLc->lcgArrIdx = ue->ul.lcgArr[lcCfg->lcgId].numLch;
5941 ue->ul.lcgArr[lcCfg->lcgId].numLch++;
5943 dlLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5944 dlLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5945 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
5947 rgSchAddToL2Meas(cell,dlLc); /*LTE_L2_MEAS_PHASE2*/
5949 #endif /* LTE_L2_MEAS */
5952 } /* rgSCHCfgRgrLchCfg */
5954 /***********************************************************
5956 * Func : rgSCHCfgRgrLcgCfg
5959 * Desc : Handles dedicated logical channel group configuration
5960 * recieved from RRM.
5970 **********************************************************/
5972 S16 rgSCHCfgRgrLcgCfg
5977 RgSchErrInfo *errInfo
5980 S16 rgSCHCfgRgrLcgCfg(cell, ue, lcgCfg, errInfo)
5984 RgSchErrInfo *errInfo;
5990 //#ifdef LTE_L2_MEAS
5995 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LCG_CFG;
5997 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = lcgCfg->ulInfo.lcgId;
5999 ret = rgSCHUtlRgrLcgCfg(cell, ue, lcgCfg, errInfo);
6002 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
6003 "configuration failed at SCH: UEID:%d LCGID:%d CRNTI:%d",
6004 ue->ueId, lcgCfg->ulInfo.lcgId,lcgCfg->crnti);
6005 /* Roll back lcgCfg */
6006 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = RGSCH_INVALID_LCG_ID;
6007 rgSCHUtlRgrLcgDel(cell, ue, lcgCfg->ulInfo.lcgId);
6011 //#ifdef LTE_L2_MEAS
6012 /* Copy all info of UL LCH in cfg to ulLcgCb */
6013 for (idx = 0; idx < lcgCfg->ulInfo.numLch; idx++)
6015 /* Allocate the uplink logical channel control block */
6016 if((ret = rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&ulLc,
6017 sizeof(RgSchUlLcCb))) != ROK)
6019 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Memory allocation FAILED for ");
6022 if ((uint8_t *)ulLc == NULLP)
6024 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Memory allocation FAILED for ");
6027 /* Create UL LC context to maintain LCG to LC mapping and
6028 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
6030 ulLc->lcId = lcgCfg->ulInfo.lchUlCfg[idx].lcId;
6031 ulLc->qciCb = &(cell->qciArray[lcgCfg->ulInfo.lchUlCfg[idx].qci]);
6032 ulLc->qciCb->qci = lcgCfg->ulInfo.lchUlCfg[idx].qci;
6033 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcArray[idx] = ulLc;
6035 ue->ul.lcCb[ulLc->lcId -1] = ulLc;
6036 ulLc->lcg = &ue->ul.lcgArr[lcgCfg->ulInfo.lcgId];
6037 ulLc->lcgArrIdx = idx;
6039 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].numLch = lcgCfg->ulInfo.numLch;
6040 #endif /* LTE_L2_MEAS */
6043 } /* rgSCHCfgRgrLcgCfg */
6047 /***********************************************************
6049 * Func : rgSCHCfgRgrCmnLcCfg
6052 * Desc : Handles dedicated logical channel configuration
6053 * recieved from RRC.
6063 **********************************************************/
6065 static S16 rgSCHCfgRgrCmnLcCfg
6068 RgrCmnLchCfg *lcCfg,
6069 RgSchErrInfo *errInfo
6072 static S16 rgSCHCfgRgrCmnLcCfg(cell, lcCfg, errInfo)
6074 RgrCmnLchCfg *lcCfg;
6075 RgSchErrInfo *errInfo;
6078 RgSchClcDlLcCb cmnLcCb;
6080 errInfo->errCause = RGSCHERR_CFG_RGR_CMN_LC_CFG;
6082 memset(&cmnLcCb, 0, sizeof(cmnLcCb));
6084 /* Handle configuration for CCCH/BCCH/PCCH */
6085 if (lcCfg->lcType == CM_LTE_LCH_CCCH)
6087 /* UL and DL CCCH configuration */
6088 if (lcCfg->dir & RGR_DIR_TX)
6090 cell->dlCcchId = lcCfg->lcId;
6093 if (lcCfg->dir & RGR_DIR_RX)
6095 cell->ulCcchId = lcCfg->lcId;
6100 cmnLcCb.lcId = lcCfg->lcId;
6101 rgSCHDbmInitCmnLcBoLst(&cmnLcCb);
6102 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
6104 /* BCCH on BCH and DLSCH configuration */
6105 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
6107 rgSCHDbmInsBcchOnDlsch(cell, &cmnLcCb);
6111 rgSCHDbmInsBcchOnBch(cell, &cmnLcCb);
6114 else /* PCCH configuration */
6116 rgSCHDbmInsPcch(cell, &cmnLcCb);
6121 } /* rgSCHCfgRgrCmnLcCfg */
6125 /***********************************************************
6127 * Func : rgSCHCfgFreeDlDedLcCb
6131 * - Processing Steps:
6132 * - Frees downlink dedicated logical channel control block.
6140 **********************************************************/
6142 static Void rgSCHCfgFreeDlDedLcCb
6149 static Void rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc)
6155 Inst inst = cell->instIdx;
6157 rgSCHUtlFreeDlLc(cell, ue, dlLc);
6159 /* De-allocate the Cb */
6160 /* ccpu00117052 - MOD - Passing double pointer
6161 for proper NULLP assignment*/
6162 rgSCHUtlFreeSBuf(inst, (Data **)&dlLc, sizeof(*dlLc));
6165 /* Stack Crash problem for TRACE5 changes. Added the return below */
6168 } /* rgSCHCfgFreeDlDedLcCb */
6171 /***********************************************************
6173 * Func : rgSCHCfgFreeDlCmnLcCb
6177 * - Processing Steps:
6178 * - Frees downlink common logical channel control block.
6186 **********************************************************/
6188 static Void rgSCHCfgFreeDlCmnLcCb
6190 RgSchClcDlLcCb *cmnDlLc
6193 static Void rgSCHCfgFreeDlCmnLcCb(cmnDlLc)
6194 RgSchClcDlLcCb *cmnDlLc;
6198 memset(cmnDlLc, 0, sizeof(*cmnDlLc));
6199 cmnDlLc->lcId = RGSCH_INVALID_LC_ID;
6201 } /* rgSCHCfgFreeDlCmnLcCb */
6204 /***********************************************************
6206 * Func : rgSCHCfgFreeCellCb
6210 * - Processing Steps:
6211 * - Frees scheduler cell control block.
6219 **********************************************************/
6221 Void rgSCHCfgFreeCellCb
6226 Void rgSCHCfgFreeCellCb(cell)
6230 Inst inst = cell->instIdx;
6233 RgSchWarningSiInfo *warningSi;
6234 RgSchWarningSiPdu *warningSiPdu;
6237 /* ccpu00132385- SI Warning PDUs which are not processed need to be deleted */
6238 /* Search for used index in WarningSi */
6239 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
6241 if(cell->siCb.warningSi[idx].siId == 0)
6243 cell->siCb.siCtx.siId = cell->siCb.warningSi[idx].siId;
6244 warningSi = (RgSchWarningSiInfo *) cell->siCb.
6245 siArray[cell->siCb.siCtx.siId-1].si;
6246 if(warningSi != NULLP)
6248 /* ccpu00136659: CMAS ETWS design change */
6249 while (CM_LLIST_FIRST_NODE(&warningSi->warningSiMsg.segLstCp, node))
6251 warningSiPdu = (RgSchWarningSiPdu *)node->node;
6252 pdu = warningSiPdu->pdu;
6253 /* ccpu00136659: CMAS ETWS design change */
6254 cmLListDelFrm(&warningSi->warningSiMsg.segLstCp, node);
6255 RGSCH_FREE_MSG(pdu);
6257 cell->siCb.siArray[cell->siCb.siCtx.siId-1].si = NULLP;
6260 /* Free lists of the cell */
6261 rgSCHCfgFreeUeLst(cell);
6263 rgSCHCfgFreeSpsUeLst(cell);
6264 #endif /* LTEMAC_SPS */
6266 if ( TRUE == cell->emtcEnable )
6268 rgSCHEmtcCellDel(cell);
6271 rgSCHRamFreeCell(cell);
6273 rgSCHDbmRntiDbDeInit(cell);
6274 /* Deallocate the subframe allocation information */
6275 rgSCHUtlPutSfAlloc(cell);
6276 rgSCHUtlFreeCell(cell);
6278 rgSCHCfgFreeRgrCfgLst(cell);
6279 rgSCHCfgFreeCmnLcLst(cell);
6281 rgSCHUtlPutRlsHqAlloc(cell);
6284 rgSCHDbmDeInitUeTfuPendLst(cell);
6285 #endif /* LTE_TDD */
6288 rgSCHUtlPutSiInfo(cell);
6289 #endif/*RGR_SI_SCH*/
6291 (Void)rgSCHDrxCellDel(cell);
6293 rgSCHUtlFreeSBuf(inst, (Data**)&(cell->dynCfiCb.cceFailSamples),
6294 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)));
6297 TSL2DeallocCellStatsBlk(cell->cellId);
6301 /* LAA_SCELL: Trigger the De-Init function for the LAA Module */
6302 rgSCHLaaSCellCbDeInit(cell);
6306 if(cell->emtcEnable)
6308 rgSCHEmtcCellFree(cell);
6311 /* De-allocate the Cell */
6312 /* ccpu00117052 - MOD - Passing double pointer
6313 for proper NULLP assignment*/
6314 rgSCHUtlFreeSBuf(inst, (Data **)&cell, sizeof(*cell));
6318 /* Stack Crash problem for TRACE5 changes. Added the return below */
6321 } /* rgSCHCfgFreeCellCb */
6324 /***********************************************************
6326 * Func : rgSCHCfgFreeUeCb
6330 * - Processing Steps:
6331 * - Frees UE control block.
6339 **********************************************************/
6341 static Void rgSCHCfgFreeUeCb
6347 static Void rgSCHCfgFreeUeCb(cell, ue)
6352 RgSchCmnUlUe *ueUl = RG_SCH_CMN_GET_UL_UE(ue, cell);
6353 RgUeUlHqCb *ulHqEnt;
6355 Inst inst = cell->instIdx;
6359 /* Free all logical channel info per UE */
6360 while((dlLc = rgSCHDbmGetNextDlDedLcCb(ue, NULLP)) != NULLP)
6362 rgSCHDbmDelDlDedLcCb(ue, dlLc);
6363 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
6365 for (lcCnt =0; lcCnt<RGSCH_MAX_LC_PER_UE; lcCnt++)
6367 if(ue->ul.lcCb[lcCnt].isValid == TRUE)
6369 lcgId = ue->ul.lcCb[lcCnt].lcg->lcgId;
6372 rgSCHUtlRgrLcDel(cell, ue, ue->ul.lcCb[lcCnt].lcId,lcgId);
6373 ue->ul.lcCb[lcCnt].isValid = FALSE;
6378 ulHqEnt = &(ueUl->hqEnt);
6379 /* Free Scheduler specific information per UE */
6380 rgSCHUtlFreeUe(cell, ue);
6382 /* Free Uplink HARQ specific information per UE */
6383 rgSCHUhmFreeUe(cell, ulHqEnt);
6385 if ( ue->drxCb != NULLP)
6388 /* ccpu00117052 - MOD - Passing double pointer
6389 for proper NULLP assignment*/
6390 rgSCHUtlFreeSBuf(cell->instIdx,
6391 (Data**)(&(ue->drxCb)),
6392 sizeof(RgSchDrxUeCb));
6395 ue->drxCb = (RgSchDrxUeCb *)NULLP;
6396 /* Free Downlink HARQ specific information per UE */
6398 /* Release the RNTI */
6401 rgSCHUtlRlsRnti(cell, ue->rntiLnk, FALSE, 0);
6405 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
6406 /* Just indicate to MAC, no need to release at SCH */
6407 rgSCHUtlIndRntiRls2Mac(cell, ue->ueId, FALSE, 0);
6409 /* rg009.201. Added changes of TFU_UPGRADE */
6411 rgSCHCfgPCqiSrsSrUeDel(cell,ue);
6414 rgSCHHdFddUeDel(cell, ue);
6419 TSL2DeallocUeStatsBlk(ue->ueId, ue->tenbStats);
6423 /* CA TODO Some handling needed while SCell Delete*/
6425 /* Delete the UE from the PCell secCellActCeLst*/
6426 rgSCHSCellRmvFrmActLst(cell, ue);
6427 rgSCHSCellDelUe(cell,ue);
6431 rgSCHLaaDeInitDlRbAllocCb(cell, &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb);
6434 rgSCHUtlFreeSBuf(inst, (Data **)&ue->cellInfo[0], sizeof(RgSchUeCellInfo));
6435 /* De-allocate the Ue */
6436 /* ccpu00117052 - MOD - Passing double pointer
6437 for proper NULLP assignment*/
6441 rgSCHEmtcUeInfoFree(cell, ue);
6444 rgSCHUtlFreeSBuf(inst, (Data **)&ue, sizeof(*ue));
6446 /* Stack Crash problem for TRACE5 changes. Added the return below */
6449 } /* rgSCHCfgFreeUeCb */
6451 /***********************************************************
6453 * Func : rgSCHCfgFreeRgrCfgLst
6457 * - Processing Steps:
6458 * - Frees configuration lists in cell control block.
6466 **********************************************************/
6468 static Void rgSCHCfgFreeRgrCfgLst
6473 static Void rgSCHCfgFreeRgrCfgLst(cell)
6477 RgSchCfgElem *rgCfgElem;
6478 Inst inst = cell->instIdx;
6480 /* Free CURRENT RGR cfg list */
6481 while ((rgCfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
6483 rgSCHDbmDelCrntRgrCfgElem(cell, rgCfgElem);
6484 /* ccpu00117052 - MOD - Passing double pointer
6485 for proper NULLP assignment*/
6486 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6489 /* Free PENDING RGR cfg list */
6490 while ((rgCfgElem = rgSCHDbmGetNextPndngRgrCfgElem(cell, NULLP)) != NULLP)
6492 rgSCHDbmDelPndngRgrCfgElem(cell, rgCfgElem);
6493 /* ccpu00117052 - MOD - Passing double pointer
6494 for proper NULLP assignment*/
6495 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6499 /* Stack Crash problem for TRACE5 changes. Added the return below */
6502 } /* rgSCHCfgFreeRgrCfgLst */
6505 /***********************************************************
6507 * Func : rgSCHCfgFreeCmnLcLst
6511 * - Processing Steps:
6512 * - Frees common logical channels in cell control block.
6520 **********************************************************/
6522 static Void rgSCHCfgFreeCmnLcLst
6527 static Void rgSCHCfgFreeCmnLcLst(cell)
6531 RgSchClcDlLcCb *dlCmnLc;
6534 if ((dlCmnLc = rgSCHDbmGetBcchOnBch(cell)) != NULLP)
6536 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6538 if ((dlCmnLc = rgSCHDbmGetFirstBcchOnDlsch(cell)) != NULLP)
6540 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6542 if ((dlCmnLc = rgSCHDbmGetSecondBcchOnDlsch(cell)) != NULLP)
6544 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6546 if ((dlCmnLc = rgSCHDbmGetPcch(cell)) != NULLP)
6548 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6552 /* Stack Crash problem for TRACE5 changes. Added the return below */
6555 } /* rgSCHCfgFreeCmnLcLst */
6558 /***********************************************************
6560 * Func : rgSCHCfgFreeUeLst
6564 * - Processing Steps:
6565 * - Frees UE list in cell control block.
6573 **********************************************************/
6575 static Void rgSCHCfgFreeUeLst
6580 static Void rgSCHCfgFreeUeLst(cell)
6586 RgSchUeCellInfo *sCellInfo;
6590 /* Free Ues in the list */
6591 while ((ue = rgSCHDbmGetNextUeCb(cell, NULLP)) != NULLP)
6593 rgSCHDbmDelUeCb(cell, ue);
6596 if(ue->cell != cell)
6602 /* Call MeasGap and AckNakRep processing module */
6603 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
6605 rgSCHCfgFreeUeCb(cell, ue);
6608 /* De-initialize the Ue list */
6609 rgSCHDbmDeInitUeCbLst(cell);
6613 node = cell->sCellUeLst.first;
6616 sCellInfo = (RgSchUeCellInfo *)node->node;
6618 rgSCHSCellDelUeSCell(sCellInfo->ue->cell, sCellInfo->ue, sCellInfo->sCellIdx);
6622 /* Stack Crash problem for TRACE5 changes. Added the return below */
6625 } /* rgSCHCfgFreeUeLst */
6628 /***********************************************************
6630 * Func : rgSCHCfgFreeSpsUeLst
6634 * - Processing Steps:
6635 * - Frees Sps UE list in cell control block.
6643 **********************************************************/
6645 static Void rgSCHCfgFreeSpsUeLst
6650 static Void rgSCHCfgFreeSpsUeLst(cell)
6656 /* Free Ues in the list */
6657 while ((ue = rgSCHDbmGetNextSpsUeCb(cell, NULLP)))
6659 rgSCHDbmDelSpsUeCb(cell, ue);
6662 /* De-initialize the Ue list */
6663 rgSCHDbmDeInitSpsUeCbLst(cell);
6665 } /* rgSCHCfgFreeSpsUeLst */
6667 #endif /* LTEMAC_SPS */
6670 /***********************************************************
6672 * Func : rgSCHCfgVldtRgrCellSiCfg
6674 * Desc : Validates SI Configuration for SI
6684 **********************************************************/
6686 static S16 rgSCHCfgVldtRgrCellSiCfg
6692 static S16 rgSCHCfgVldtRgrCellSiCfg(inst, siCfg)
6697 uint8_t idx; /* idx for iteration */
6702 /* Check that retxCnt value should be <= value of siWinSize.
6703 This validation is only applicable for FDD mode. */
6704 if(siCfg->retxCnt > siCfg->siWinSize)
6706 RLOG0(L_ERROR,"retxCnt is greater than siWinSize, validation failed");
6711 /* Validate that a valid value for numSi has been specified */
6712 if(siCfg->numSi > RGR_MAX_NUM_SI)
6714 RLOG0(L_ERROR,"Validation for numSi in SI CFG failed");
6718 /* MinPeriodicity will have the least configured periodicity
6719 * Hence initializing with Max periodicity */
6720 siCfg->minPeriodicity = RGR_SI_PERD_512;
6722 /*Validate the value of periodicity specified for SIs */
6723 for(idx = 0;idx < siCfg->numSi;idx++)
6725 siCfg->minPeriodicity = RGSCH_MIN(siCfg->minPeriodicity,
6726 siCfg->siPeriodicity[idx]);
6727 /* Set the siPeriodicity as a multiple of 80 subframes */
6728 switch(siCfg->siPeriodicity[idx])
6731 case RGR_SI_PERD_16:
6732 case RGR_SI_PERD_32:
6733 case RGR_SI_PERD_64:
6734 case RGR_SI_PERD_128:
6735 case RGR_SI_PERD_256:
6736 case RGR_SI_PERD_512:
6740 RLOG0(L_ERROR,"Validation for SI Periodicity in SI-CFG failed");
6746 } /* rgSCHCfgVldtRgrCellSiCfg */
6748 /* LTE_ADV_FLAG_REMOVED_START */
6749 /***********************************************************
6751 * Func : rgSCHCfgVldtRgrCellLtrAdvCfg
6753 * Desc : Validates Lte Adv Configuration
6763 **********************************************************/
6765 static S16 rgSCHCfgVldtRgrCellLteAdvCfg
6768 RgrLteAdvancedCellConfig *lteAdvCfg,
6772 static S16 rgSCHCfgVldtRgrCellLteAdvCfg(inst, lteAdvCfg, dlTotalBw)
6774 RgrLteAdvancedCellConfig *lteAdvCfg;
6778 uint8_t temp[RGR_ABS_PATTERN_LEN];
6782 if((lteAdvCfg->pres & RGR_SFR) && (RGR_ENABLE == lteAdvCfg->sfrCfg.status))
6784 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.startRb > lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb)
6786 RLOG0(L_ERROR,"Invalid configuration of cell edge bandwidth for SFR feature");
6790 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb >= dlTotalBw)
6792 RLOG0(L_ERROR,"Invalid configuration of cell edge end RB for SFR feature");
6797 if(lteAdvCfg->sfrCfg.pwrThreshold.pLow >= lteAdvCfg->sfrCfg.pwrThreshold.pHigh)
6799 RLOG0(L_ERROR,"Invalid configuration of power threshold for SFR feature");
6805 if((lteAdvCfg->pres & RGR_ABS) && (RGR_ENABLE == lteAdvCfg->absCfg.status))
6807 if((RGR_ABS_MUTE != lteAdvCfg->absCfg.absPatternType) &&
6808 (RGR_ABS_TRANSMIT != lteAdvCfg->absCfg.absPatternType))
6810 RLOG0(L_ERROR,"Invalid configuration of ABS pattern type");
6814 memcpy(temp, lteAdvCfg->absCfg.absPattern,RGR_ABS_PATTERN_LEN);
6816 /* Added validation for ABS pattern len */
6817 for(idx = 0; idx < RGR_ABS_PATTERN_LEN; idx++)
6819 if((temp[idx] != 1) && (temp[idx] != 0))
6821 RLOG0(L_ERROR,"Invalid configuration of ABS pattern type");
6829 /* LTE_ADV_FLAG_REMOVED_END */
6832 /***********************************************************
6834 * Func : rgSCHCfgVldtRgrCellCsgParamCfg
6836 * Desc : Validates CSG Parameter Configuration
6846 **********************************************************/
6848 static S16 rgSCHCfgVldtRgrCellCsgParamCfg
6851 RgrCellCsgParamCfg *csgParam
6854 static S16 rgSCHCfgVldtRgrCellCsgParamCfg(inst, csgParam)
6856 RgrCellCsgParamCfg *csgParam;
6860 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "Validating CSG Parameters \n"));
6862 if(csgParam->minDlResNonCsg > 100)
6864 RLOG0(L_ERROR,"Invalid Configuration of minimum DL resources "
6868 if(csgParam->minUlResNonCsg > 100)
6870 RLOG0(L_ERROR,"Invalid Configuration of minimum UL resources "
6878 * @brief Validates the SI configuration request from RRM to MAC.
6882 * Function : rgSCHCfgVldtRgrSiCfg
6885 * - Validate the range of configured values recieved in
6886 * configuration request.
6887 * - If validated successfully,
6891 * - Else return RFAILED.
6892 * @param[in] Inst inst
6893 * @param[in] RgrCellCfg *siCfg
6894 * @param[out] RgSchCellCb *cell
6895 * @param[out] RgSchErrInfo *errInfo
6901 S16 rgSCHCfgVldtRgrSiCfg
6904 RgrSiCfgReqInfo *siCfg,
6906 RgSchErrInfo *errInfo
6909 S16 rgSCHCfgVldtRgrSiCfg(inst, siCfg, cell, errInfo)
6911 RgrSiCfgReqInfo *siCfg;
6913 RgSchErrInfo *errInfo;
6919 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_SI_CFG;
6921 /*Validate the cfgType parameter */
6922 switch(siCfg->cfgType)
6926 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6927 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6928 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6929 (siCfg->siId > numSi))
6931 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid SI Id value"
6935 errInfo->errCause = RGSCHERR_NONE;
6938 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
6939 case RGR_SI_CFG_TYPE_SIB1: /* SI CFG TYPE SIB1 */
6940 case RGR_SI_CFG_TYPE_SIB1_PWS: /* SI CFG TYPE SIB1_PWS */
6941 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
6943 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR:
6944 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR_PER:
6948 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
6949 /*Check that value of SI should be less than equal
6950 to configured numSi parameter value */
6951 /* Added siId validation for lower limit */
6952 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6953 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6954 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6955 (siCfg->siId > numSi))
6957 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid SI Id value"
6962 if(siCfg->siId > ((cell->siCfg.minPeriodicity * 10)/cell->siCfg.siWinSize))
6964 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "SiId can not be scheduled ");
6970 case RGR_SI_CFG_EMTC_TYPE_SI:
6971 case RGR_SI_CFG_EMTC_TYPE_SI_PER:
6972 if(ROK != rgEmtcvalidateSiCfg(siCfg,cell))
6979 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid cfgType "
6984 /*Validate the specified pdu */
6985 if(NULLP == siCfg->pdu)
6987 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid NULLP pdu "
6992 /*Check if PDU is of 0 length*/
6993 SFndLenMsg(siCfg->pdu, &msgLen);
6996 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid pdu "
7001 errInfo->errCause = RGSCHERR_NONE;
7005 } /* rgSCHCfgVldtRgrSiCfg */
7006 #endif /*RGR_SI_SCH*/
7008 /* LTE_ADV_FLAG_REMOVED_START */
7010 * @brief Validates the RNTP INF request from RRM to MAC.
7014 * Function : rgSCHCfgVldtRgrLoadInf
7017 * - Validate the range of configured values recieved in
7019 * - If validated successfully,
7023 * - Else return RFAILED.
7024 * @param[in] Inst inst
7025 * @param[in] RgrLoadInfReqInfo *loadInfReq
7026 * @param[out] RgSchCellCb *cell
7027 * @param[out] RgSchErrInfo *errInfo
7033 S16 rgSCHCfgVldtRgrLoadInf
7036 RgrLoadInfReqInfo *loadInfReq,
7038 RgSchErrInfo *errInfo
7041 S16 rgSCHCfgVldtRgrLoadInf(inst, loadInfReq, cell, errInfo)
7043 RgrLoadInfReqInfo *loadInfReq;
7045 RgSchErrInfo *errInfo;
7049 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LOAD_INF;
7051 /* Validate if the CC startRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
7052 if((loadInfReq->rgrCcPHighStartRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
7053 (loadInfReq->rgrCcPHighStartRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
7055 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid rgrCcPHighStartRb received specified");
7059 /* Validate if the CC endRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
7060 if((loadInfReq->rgrCcPHighEndRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
7061 (loadInfReq->rgrCcPHighEndRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
7063 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid rgrCcPHighEndRb received specified");
7067 errInfo->errCause = RGSCHERR_NONE;
7071 } /* rgSCHCfgVldtRgrLoadInf */
7072 /* LTE_ADV_FLAG_REMOVED_END */
7076 /********************************************************************
7077 * UE ACQI, PCQI, RI, SRS and SR Re/Configuration Validation Functions *
7079 *********************************************************************/
7082 * @brief Validates the Tx Mode and PUSCH Mode configuration.
7086 * Function : rgSCHCfgVldtRgrTxmodePuschMode
7089 * - Validate whether the configured PUSCH Mode and the
7090 * Configured Tx Mode are in the right combination
7091 * - If validated successfully,
7096 * @param[in] RgSchCellCb *cellCb
7097 * @param[in] RgrTxMode txMde
7098 * @param[in] RgrAprdCqiMode puschMode
7099 * @param[out] RgSchErrInfo *errInfo
7105 S16 rgSCHCfgVldtRgrTxmodePuschMode
7107 RgSchCellCb *cellCb,
7109 RgrAprdCqiMode puschMode,
7110 RgSchErrInfo *errInfo
7113 S16 rgSCHCfgVldtRgrTxmodePuschMode(cellCb, txMde, puschMode,errInfo)
7114 RgSchCellCb *cellCb;
7116 RgrAprdCqiMode puschMode;
7117 RgSchErrInfo *errInfo;
7121 if (txMde == RGR_UE_TM_1 || txMde == RGR_UE_TM_2 ||
7122 txMde == RGR_UE_TM_3 || txMde == RGR_UE_TM_7)
7124 if (puschMode == RGR_APRD_CQI_MOD12 ||
7125 puschMode == RGR_APRD_CQI_MOD22 ||
7126 puschMode == RGR_APRD_CQI_MOD31)
7132 if (txMde == RGR_UE_TM_4 || txMde == RGR_UE_TM_6)
7134 if (puschMode == RGR_APRD_CQI_MOD20 ||
7135 puschMode == RGR_APRD_CQI_MOD30)
7141 if (txMde == RGR_UE_TM_5 )
7143 if (puschMode != RGR_APRD_CQI_MOD31)
7149 /* TOODO:: Tm8 and TM9 validation has to
7150 * be changed as mentioned inthe commented
7152 /* TM8 and TM9 supports all modes
7153 * Mode 1-2, 2-2, 3-1 if pmi/ri reporting enabled
7154 * 2-0,3-0 of pmi/ri reporitng isdisabled *
7155 * if pmi/ri is enabled
7156 * Mode 1-2, 2-2, 3-1 if with pmi/ri and csi-rs ports > 1
7157 * 2-0,3-0 of pmi/ri reporitng isdisabled and csi-rs ports == 1*/
7161 }/*rgSCHCfgVldtRgrTxmodePuschMode ends*/
7164 * @brief Validates the UE ACQI configuration request from RRM to MAC.
7168 * Function : rgSCHCfgVldtRgrUeACqiCfg
7171 * - Validate the UE configuration request from RRC to MAC at CFG:
7172 * validate the ACQI Configuration
7173 * - If validated successfully,
7178 * @param[in] RgSchCellCb *cellCb,
7179 * @param[in] CmLteRnti crnti,
7180 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg,
7181 * @param[in] RgrUeTxModeCfg txMode,
7182 * @param[out] RgSchErrInfo *errInfo
7189 S16 rgSCHCfgVldtRgrUeACqiCfg
7191 RgSchCellCb *cellCb,
7193 RgrUeAprdDlCqiCfg *acqiCfg,
7194 RgrUeTxModeCfg txMode,
7195 RgSchErrInfo *errInfo
7198 S16 rgSCHCfgVldtRgrUeACqiCfg(cellCb, crnti, acqiCfg,txMode, errInfo)
7199 RgSchCellCb *cellCb;
7201 RgrUeAprdDlCqiCfg *acqiCfg;
7202 RgrUeTxModeCfg txMode;
7203 RgSchErrInfo *errInfo;
7207 RgrAprdCqiMode puschMode;
7211 if(txMode.pres == TRUE)
7213 txMde = txMode.txModeEnum;
7214 puschMode = acqiCfg->aprdModeEnum;
7215 if ( ROK != rgSCHCfgVldtRgrTxmodePuschMode(cellCb, txMde,
7216 puschMode, errInfo))
7218 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7219 "Invalid Aperiodic CQI configuration CRNTI:%d",crnti);
7228 * @brief Validates the Tx Mode and PUCCH Mode configuration.
7232 * Function : rgSCHCfgVldtRgrTxmodePucchMode
7235 * - Validate whether the configured PUCCH Mode and the
7236 * Configured Tx Mode are in the right combination
7237 * - If validated successfully,
7242 * @param[in] RgSchCellCb *cellCb
7243 * @param[in] RgrTxMode txMde
7244 * @param[in] RgrPrdCqiMode pucchMode
7245 * @param[out] RgSchErrInfo *errInfo
7251 S16 rgSCHCfgVldtRgrTxmodePucchMode
7253 RgSchCellCb *cellCb,
7255 RgrPrdCqiMode pucchMode,
7256 RgSchErrInfo *errInfo
7259 S16 rgSCHCfgVldtRgrTxmodePucchMode(cellCb, txMde, pucchMode,errInfo)
7260 RgSchCellCb *cellCb;
7262 RgrPrdCqiMode pucchMode;
7263 RgSchErrInfo *errInfo;
7267 if (pucchMode == RGR_PRD_CQI_MOD10 || pucchMode == RGR_PRD_CQI_MOD20 )
7269 if (txMde ==RGR_UE_TM_4 || txMde ==RGR_UE_TM_5 || txMde ==RGR_UE_TM_6)
7274 else if (pucchMode == RGR_PRD_CQI_MOD11 || pucchMode == RGR_PRD_CQI_MOD21)
7276 if (txMde ==RGR_UE_TM_1 || txMde ==RGR_UE_TM_2 || txMde ==RGR_UE_TM_3 \
7277 || txMde ==RGR_UE_TM_7)
7282 /* TODO:: Tm8 and TM9 validation needs to be added */
7287 * @brief Validates the UE Periodic CQI, PMI, RI, re/configuration request from RRM to MAC.
7291 * Function : rgSCHCfgVldtRgrUePCqiCfg
7294 * - Validate the UE configuration request from RRC to MAC at CFG:
7295 * validate the value range for Periodic CQI, PMI, RI values.
7296 * - If validated successfully,
7301 * @param[in] RgSchCellCb *cellCb,
7302 * @param[in] CmLteRnti crnti,
7303 * @param[in] RgrUePrdDlCqiCfg *cqiCfg,
7304 * @param[in] RgrUeTxModeCfg txMode,
7305 * @param[out] RgSchErrInfo *errInfo
7312 S16 rgSCHCfgVldtRgrUePCqiCfg
7314 RgSchCellCb *cellCb,
7316 RgrUePrdDlCqiCfg *cqiCfg,
7318 RgrUeTxModeCfg txMode,
7319 RgSchErrInfo *errInfo
7322 S16 rgSCHCfgVldtRgrUePCqiCfg(cellCb, crnti, cqiCfg, hdFdd,
7324 RgSchCellCb *cellCb;
7326 RgrUePrdDlCqiCfg *cqiCfg;
7328 RgrUeTxModeCfg txMode;
7329 RgSchErrInfo *errInfo;
7333 S16 rgSCHCfgVldtRgrUePCqiCfg
7335 RgSchCellCb *cellCb,
7337 RgrUePrdDlCqiCfg *cqiCfg,
7338 RgrUeTxModeCfg txMode,
7339 RgSchErrInfo *errInfo
7342 S16 rgSCHCfgVldtRgrUePCqiCfg(cellCb, crnti, cqiCfg, txMode, errInfo)
7343 RgSchCellCb *cellCb;
7345 RgrUePrdDlCqiCfg *cqiCfg;
7346 RgrUeTxModeCfg txMode;
7347 RgSchErrInfo *errInfo;
7352 RgrPrdCqiMode pucchMode;
7354 txMde = RGR_UE_TM_1;
7355 pucchMode = RGR_PRD_CQI_MOD20;
7356 if ( RGR_SCH_PCQI_SETUP == cqiCfg->type )
7358 /*1. Validate for Tx Mode and PUCCH Mode combination*/
7359 if(txMode.pres == TRUE)
7361 txMde = txMode.txModeEnum;
7362 pucchMode = cqiCfg->cqiSetup.prdModeEnum;
7363 if ( ROK != rgSCHCfgVldtRgrTxmodePucchMode(cellCb, txMde,
7364 pucchMode, errInfo))
7366 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7367 "Invalid Tx Mode-PUCCH Mode combination CRNTI:%d",crnti);
7372 /*2. Validate for PCQI Reporting Type and PUCCH Mode combination*/
7373 if((cqiCfg->cqiSetup.cqiRepType==1) &&
7374 ((pucchMode == RGR_PRD_CQI_MOD20) ||
7375 (pucchMode == RGR_PRD_CQI_MOD21)))
7377 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7378 "Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
7382 if((cqiCfg->cqiSetup.cqiRepType==2) &&
7383 ((pucchMode == RGR_PRD_CQI_MOD10) ||
7384 (pucchMode == RGR_PRD_CQI_MOD11)))
7386 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7387 "Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
7391 /*3. Validate CQI/PMI and RI Configuration related parameter values */
7392 /*TODO- To be compared with configured n2Pucch Index*/
7393 if (cqiCfg->cqiSetup.cqiPResIdx > RG_SCH_PUCCH_RES_MAX_SUPP )
7395 RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,
7396 "Not Supported or Invalid CQI-PUCCH resourceIndex=%d Cfg Val=%d CRNTI:%d",
7397 RG_SCH_PUCCH_RES_MAX_SUPP, cqiCfg->type,crnti);
7404 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
7405 (cqiCfg->cqiSetup.cqiPCfgIdx < 7) ||
7406 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
7408 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7409 "Not Supported or Invalid Cfg CQI Min Index Sup =%d"
7410 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
7411 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
7417 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
7418 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
7420 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7421 "Not Supported or Invalid Cfg CQI Min Index Sup =%d "
7422 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
7423 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
7428 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
7429 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
7431 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7432 "Not Supported or Invalid Cfg CQI Min Index Sup =%d"
7433 "Max Index Sup=%d Cfg Val=%d CRNTI;%d", RG_SCH_ICQI_MIN_SUPP,
7434 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
7439 if((cqiCfg->cqiSetup.cqiRepType < RGR_UE_PCQI_WB_REP) ||
7440 (cqiCfg->cqiSetup.cqiRepType > RGR_UE_PCQI_SB_REP))
7442 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7443 "Invalid Cfg CQI Report"
7444 "ModeCfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
7448 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
7449 ((cqiCfg->cqiSetup.k < RG_SCH_CQI_K_MIN) ||
7450 (cqiCfg->cqiSetup.k > RG_SCH_CQI_K_MAX)))
7452 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7453 "Invalid CQI Cfg K Cfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
7457 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
7458 (cellCb->bwCfg.dlTotalBw <= 7))
7460 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7461 "Invalid Periodic CQI mode Cfg for dlTotalBw (%d) for CRNTI:%d",
7462 cellCb->bwCfg.dlTotalBw, crnti);
7467 if (cqiCfg->cqiSetup.cqiPCfgIdx == RG_SCH_ICQI_RESV_FDD )
7469 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7470 "Reserved value Cfg =%d CRNTI:%d",
7471 cqiCfg->cqiSetup.cqiPResIdx,crnti);
7476 /* 4. Check RI Configuration values */
7477 if(cqiCfg->cqiSetup.riEna == TRUE)
7479 if(txMode.pres == TRUE)
7481 if((txMde != RGR_UE_TM_3)
7482 && (txMde != RGR_UE_TM_4)
7483 && (txMde != RGR_UE_TM_8)
7485 && (txMde != RGR_UE_TM_9)
7489 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7490 "Invalid Transmission Mode =%d CRNTI:%d",
7496 if(cqiCfg->cqiSetup.riCfgIdx > RG_SCH_IRI_MAX_SUPP)
7498 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7499 "Invalid Index RI value Cfg =%d CRNTI:%d",
7500 cqiCfg->cqiSetup.riCfgIdx,crnti);
7511 * @brief Validates the UE SRS Re/Configuation request from RRM to MAC.
7515 * Function : rgSCHCfgVldtRgrUeUlSrsCfg
7518 * - Validate the UE configuration request from RRC to MAC at CFG:
7519 * validate the value range for SRS values.
7520 * - If validated successfully,
7525 * @param[in] RgSchCellCb *cellCb,
7526 * @param[in] CmLteRnti crnti,
7527 * @param[in] RgrUeUlSrsCfg *srsCfg,
7528 * @param[out] RgSchErrInfo *errInfo
7535 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7537 RgSchCellCb *cellCb,
7539 RgrUeUlSrsCfg *srsCfg,
7541 RgSchErrInfo *errInfo
7544 S16 rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, crnti, srsCfg, hdFdd, errInfo)
7545 RgSchCellCb *cellCb;
7547 RgrUeUlSrsCfg *srsCfg;
7549 RgSchErrInfo *errInfo;
7553 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7555 RgSchCellCb *cellCb,
7557 RgrUeUlSrsCfg *srsCfg,
7558 RgSchErrInfo *errInfo
7561 S16 rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, crnti, srsCfg, errInfo)
7562 RgSchCellCb *cellCb;
7564 RgrUeUlSrsCfg *srsCfg;
7565 RgSchErrInfo *errInfo;
7570 uint16_t srsOffset=0;
7571 uint8_t srsSubframe=0;
7573 if ( RGR_SCH_SRS_SETUP == srsCfg->type )
7576 /*ccpu00130768 - ADD - if cell specific SRS is not configured*/
7577 if(cellCb->srsCfg.isSrsCfgPres == FALSE)
7579 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7580 "Cell specific SRS is not configured CRNTI:%d",crnti);
7584 /* 1. Validate SRS Configuration related parameter values */
7585 /* 1.1 iSRS should be 0-636; Ref: 36.213. Table 8.2-1 */
7589 if ( (srsCfg->srsSetup.srsCfgIdx < 7) ||
7590 (srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP) )
7592 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7593 "Not Supported or Invalid Cfg "
7594 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7595 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7596 srsCfg->srsSetup.srsCfgIdx,crnti);
7602 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7604 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7605 "Not Supported or Invalid Cfg"
7606 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7607 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7608 srsCfg->srsSetup.srsCfgIdx,crnti);
7614 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7616 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7617 "Not Supported or Invalid Cfg"
7618 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7619 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7620 srsCfg->srsSetup.srsCfgIdx,crnti);
7625 /* Compute SRS Offset and Periodicity */
7626 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7627 srsCfg->srsSetup.srsCfgIdx,
7628 &srsPeri, &srsOffset);
7630 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7631 srsCfg->srsSetup.srsCfgIdx,
7632 &srsPeri, &srsOffset);
7634 srsSubframe = srsOffset%RGSCH_NUM_SUB_FRAMES;
7636 if(rgSchTddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7638 if(rgSchFddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7640 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7641 "UE specific SRS is not occuring in Cell specific SRS subframe"
7642 "srs Cfg Idx =%d CRNTI:%d",
7643 srsCfg->srsSetup.srsCfgIdx,crnti);
7648 if ( srsCfg->srsSetup.fDomPosi > RG_SCH_SRS_FREQDOM_POS_MAX )
7650 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7651 "Not Supported or Invalid Cfg"
7652 "SRS Min Freq Domain Position =%d"
7653 "Max Freq Domain Position =%d Cfg Val=%d CRNTI:%d",
7654 RG_SCH_SRS_FREQDOM_POS_MIN, RG_SCH_SRS_FREQDOM_POS_MAX,
7655 srsCfg->srsSetup.srsCfgIdx,crnti);
7659 if ( srsCfg->srsSetup.txComb > RG_SCH_SRS_TXCOMB_MAX )
7661 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7662 "Not Supported or Invalid Cfg"
7663 "SRS Min TX Comb =%d Max TX Comb =%d Cfg Val=%d CRNTI:%d",
7664 RG_SCH_SRS_TXCOMB_MIN, RG_SCH_SRS_TXCOMB_MAX,
7665 srsCfg->srsSetup.srsCfgIdx,crnti);
7673 * @brief Validates the UE SR Re/configuration request from RRM to MAC.
7677 * Function : rgSCHCfgVldtRgrUeSrCfg
7680 * - Validate the UE re/configuration request from RRC to MAC at CFG:
7681 * validate the value range for SR values.
7682 * - If validated successfully,
7687 * @param[in] RgSchCellCb *cellCb,
7688 * @param[in] CmLteRnti crnti,
7689 * @param[in] RgrUeSrCfg *srCfg,
7690 * @param[out] RgSchErrInfo *errInfo
7697 S16 rgSCHCfgVldtRgrUeSrCfg
7699 RgSchCellCb *cellCb,
7703 RgSchErrInfo *errInfo
7706 S16 rgSCHCfgVldtRgrUeSrCfg(cellCb, crnti, srCfg, hdFdd, errInfo)
7707 RgSchCellCb *cellCb;
7711 RgSchErrInfo *errInfo;
7715 S16 rgSCHCfgVldtRgrUeSrCfg
7717 RgSchCellCb *cellCb,
7720 RgSchErrInfo *errInfo
7723 S16 rgSCHCfgVldtRgrUeSrCfg(cellCb, crnti, srCfg, errInfo)
7724 RgSchCellCb *cellCb;
7727 RgSchErrInfo *errInfo;
7732 if ( RGR_SCH_SR_SETUP == srCfg->type )
7734 /* 1. Validate SR Configuration related parameter values */
7738 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7739 ( srCfg->srSetup.srCfgIdx < 5 ) ||
7740 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7742 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7743 "Invalid SR Index Cfg =%d"
7744 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7745 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7752 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7753 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7755 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7756 "Invalid SR Index Cfg =%d"
7757 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7758 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7764 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7765 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7767 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7768 "Invalid SR Index Cfg =%d"
7769 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7770 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7781 * @brief Validates the UE Aperiodic & Periodic CQI, PMI, RI, SRS and SR Configuration
7782 * request from RRM to MAC.
7786 * Function :rgSCHCfgVldtCqiSrSrsUeCfg
7789 * - Validate the UE configuration request from RRC to MAC at CFG:
7790 * validate the value range for Aperiodic & Periodic CQI, PMI, RI , SRS and SR values.
7791 * - If validated successfully,
7796 * @param[in] RgSchCellCb *cellCb
7797 * @param[in] RgrUeCfg *ueCfg
7798 * @param[out] RgSchErrInfo *errInfo
7804 static S16 rgSCHCfgVldtCqiSrSrsUeCfg
7806 RgSchCellCb *cellCb,
7808 RgSchErrInfo *errInfo
7811 static S16 rgSCHCfgVldtCqiSrSrsUeCfg(cellCb, ueCfg, errInfo)
7812 RgSchCellCb *cellCb;
7814 RgSchErrInfo *errInfo;
7818 /* 1. Validate UE Aperiodic CQI related parameters */
7819 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueCfg->crnti,
7820 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ueCfg->txMode, errInfo ))
7822 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7823 "Invalid Aperiodic CQI configuration CRNTI:%d",ueCfg->crnti);
7827 /* 1. Validate UE Periodic CQI/PMI, SRS and SR related parameters */
7829 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7830 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->isHdFddEnbld,
7831 ueCfg->txMode, errInfo ))
7833 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7834 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->txMode, errInfo ))
7837 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7838 "Invalid Periodic CQI configuration CRNTI:%d",ueCfg->crnti);
7842 /* 2. Validate SRS Configuration related parameter values */
7844 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti, &ueCfg->srsCfg,
7845 ueCfg->isHdFddEnbld, errInfo ))
7847 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti,
7848 &ueCfg->srsCfg, errInfo ))
7851 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7852 "Invalid SRS configuration CRNTI:%d",ueCfg->crnti);
7856 /* 3. Validate SR Configuration related parameter values */
7858 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti, &ueCfg->srCfg,
7859 ueCfg->isHdFddEnbld, errInfo))
7861 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti,
7862 &ueCfg->srCfg, errInfo))
7865 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7866 "Invalid SR configuration CRNTI:%d",ueCfg->crnti);
7876 /*****************************************************************
7877 * UE PCQI, RI, SRS and SR Re Configuration Validation Functions *
7879 ******************************************************************/
7881 * @brief Validates the UE Periodic CQI, PMI, RI, SRS and SR
7882 * Re-configuration request from RRM to MAC.
7886 * Function : rgSCHCfgVldtCqiSrSrsUeReCfg
7889 * - Validate the UE Re configuration request from RRC to MAC at CFG:
7890 * validate the value range for Periodic CQI, PMI, RI, SRS and SR values.
7891 * - If validated successfully,
7896 * @param[in] RgSchCellCb *cellCb
7897 * @param[in] RgSchUeCb *ueCb
7898 * @param[in] RgrUeCfg *ueCfg
7899 * @param[out] RgSchErrInfo *errInfo
7905 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg
7907 RgSchCellCb *cellCb,
7909 RgrUeRecfg *ueReCfg,
7910 RgSchErrInfo *errInfo
7913 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg(cellCb, ueCb, ueReCfg, errInfo)
7914 RgSchCellCb *cellCb;
7916 RgrUeRecfg *ueReCfg;
7917 RgSchErrInfo *errInfo;
7920 RgrUeTxModeCfg txMode;
7923 txMode.tmTrnstnState = RGR_TXMODE_RECFG_CMPLT;
7924 if ((ueReCfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
7925 (ueReCfg->txMode.pres == TRUE))
7927 txMode.txModeEnum = ueReCfg->txMode.txModeEnum;
7931 txMode.txModeEnum = ueCb->mimoInfo.txMode;
7934 /* 1. Validate UE CQI/PMI, SRS and SR related parameters */
7936 if ( ueReCfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
7938 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueReCfg->oldCrnti,
7939 &ueReCfg->aprdDlCqiRecfg, txMode, errInfo ))
7941 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7942 "Invalid Aperiodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7948 /* 2. Validate UE CQI/PMI, SRS and SR related parameters */
7950 if ( ueReCfg->ueRecfgTypes & RGR_UE_PCQI_RECFG )
7953 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7954 &ueReCfg->cqiCfg, ueReCfg->isHdFddEnbld, txMode, errInfo ))
7956 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7957 &ueReCfg->cqiCfg, txMode, errInfo ))
7961 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7962 "Invalid Periodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7967 if(ueReCfg->ueRecfgTypes & RGR_UE_SRS_RECFG )
7970 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7971 &ueReCfg->srsCfg, ueReCfg->isHdFddEnbld, errInfo ))
7973 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7974 &ueReCfg->srsCfg, errInfo ))
7977 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7978 "Invalid SRS configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7984 if ( ueReCfg->ueRecfgTypes & RGR_UE_SR_RECFG )
7987 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7988 &ueReCfg->srCfg, ueReCfg->isHdFddEnbld, errInfo))
7990 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7991 &ueReCfg->srCfg, errInfo))
7994 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7995 "Invalid SR configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
8004 /*****************************************************************
8005 * UE ACQI, PCQI, RI, SRS SR Configuration Functions *
8007 ******************************************************************/
8009 * @brief Handles Aperiodic CQI , PMI, RI configuration for a UE.
8013 * Function : rgSCHCfgACqiUeCfg
8015 * Invoking Module Processing:
8016 * - This shall be invoked by SCH_GOM at UE configuration. It
8017 * shall do the validations for the spec-defined values.
8023 * @param[in] RgSchCellCb *cell
8024 * @param[in] RgrTxMode txMode
8025 * @param[in] RgrUeAprdDlCqiCfg *aCqiCfg
8026 * @param[in] CmLteUeCategory ueCat
8032 S16 rgSCHCfgACqiUeCfg
8034 RgSchCellCb *cellCb,
8036 RgSchUeACqiCb *acqiCb,
8038 RgrUeAprdDlCqiCfg *aCqiCfg,
8039 CmLteUeCategory ueCat
8042 S16 rgSCHCfgACqiUeCfg(cellCb,ue,acqiCb ueTxMode, aCqiCfg, ueCat)
8043 RgSchCellCb *cellCb;
8045 RgSchUeACqiCb *acqiCb;
8047 RgrUeAprdDlCqiCfg *aCqiCfg;
8048 CmLteUeCategory ueCat;
8051 uint8_t M; /*Num of Subbands -- Applicable only for Mode 2-0 and 2-2*/
8052 uint8_t k; /*SubBand Size (RB) --
8053 Holds different values depending on Mode*/
8054 uint8_t cqiPmiSzR1; /*CQIPMI Size for Rank =1*/
8055 uint8_t cqiPmiSzRn1; /*CQIPMI Size for Rank > 1*/
8060 acqiCb->aCqiCfg.pres = aCqiCfg->pres;
8061 acqiCb->aCqiCfg.aprdModeEnum = aCqiCfg->aprdModeEnum;
8066 /*Store Trigger Set Bit String to UE */
8067 RgSchUeCellInfo *pCellInfo = RG_SCH_CMN_GET_PCELL_INFO(ue);
8068 pCellInfo->acqiCb.aCqiCfg.triggerSet1 = aCqiCfg->triggerSet1;
8069 pCellInfo->acqiCb.aCqiCfg.triggerSet2 = aCqiCfg->triggerSet2;
8073 switch(aCqiCfg->aprdModeEnum)
8075 case RGR_APRD_CQI_MOD12:
8076 case RGR_APRD_CQI_MOD30:
8077 case RGR_APRD_CQI_MOD31:
8078 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
8079 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
8083 case RGR_APRD_CQI_MOD20:
8084 case RGR_APRD_CQI_MOD22:
8085 RG_SCH_GET_SBCQI_M_K_VAL(cellCb->bwCfg.dlTotalBw, M, k);
8086 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
8089 acqiCb->L = RgSCHUeAcqi2022LBitWidth[M-1][acqiCb->N-1];
8095 if((ueTxMode == RGR_UE_TM_3) ||
8096 (ueTxMode == RGR_UE_TM_4))
8098 if(cellCb->numTxAntPorts ==2)
8100 acqiCb->riNumBits = 1;
8102 else if(cellCb->numTxAntPorts ==4)
8104 if(ueCat == CM_LTE_UE_CAT_8)
8106 acqiCb->riNumBits = 3;
8108 else if(ueCat >= CM_LTE_UE_CAT_5)
8110 acqiCb->riNumBits = 2;
8114 acqiCb->riNumBits = 1;
8118 rgSCHCfgUtlFetchAcqiBitSz(acqiCb, cellCb->numTxAntPorts,
8119 &cqiPmiSzR1, &cqiPmiSzRn1);
8120 acqiCb->cqiPmiSzR1 = cqiPmiSzR1;
8121 acqiCb->cqiPmiSzRn1 = cqiPmiSzRn1;
8123 acqiCb->cqiReqField = TRUE;
8125 rgSchCmnSetCqiReqField(RG_SCH_CMN_GET_SCELL_INFO(ue, cellCb),ue,&acqiCb->cqiReqField);
8132 * @brief Handles Periodic CQI , PMI, RI configuration for a UE.
8136 * Function : rgSCHCfgPCqiUeCfg
8138 * Invoking Module Processing:
8139 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8140 * validations for the spec-defined values.
8143 * - For UE-specific Periodic CQI related configuration,
8144 * - If Periodic CQI/PMI is configured,
8145 * - Update UE with the configured values.
8146 - Compute and Update next occurance of CQI/PMI or RI Tranmission instance.
8147 - Update the CQI offset and CQI perodicity information
8148 - Add Ue to cell's list
8151 * - For UE-specific Periodic RI related configuration,
8152 * - If Periodic RI is configured,
8153 * - Update UE with the configured values.
8154 - Compute and Update next occurance of RI Tranmission instance.
8155 - Update the RI offset and RI perodicity information
8160 * @param[in] RgSchCellCb *cell
8161 * @param[in] RgSchUeCb *ue
8162 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
8163 * @param[in] CmLteUeCategory ueCat
8169 S16 rgSCHCfgPCqiUeCfg
8171 RgSchCellCb *cellCb,
8173 RgrUePrdDlCqiCfg *cqiCfg,
8174 CmLteUeCategory ueCat
8177 S16 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat)
8178 RgSchCellCb *cellCb;
8180 RgrUePrdDlCqiCfg *cqiCfg;
8181 CmLteUeCategory ueCat;
8184 CmLteTimingInfo timingInfo;
8186 uint16_t cqiTrInstTime;
8187 uint8_t j; /*Bandwidth Parts*/
8190 RgSchUePCqiCb *cqiCb = NULLP;
8192 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
8193 (cellCb->crntTime.slot);
8194 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8195 cqiCb->servCellInfo = ueCb->cellInfo[0];
8196 /* Periodic CQI is setup */
8197 if (cqiCfg->type == RGR_SCH_PCQI_SETUP)
8199 for(loop = 0; loop < MAX_CQI_RI_RPT_BUFF;loop++)
8201 ueCb->rawCqiBitW[loop].type = TFU_RECP_REQ_INVLD; /* setting invalid type*/
8203 /* 1. Copy the Received CQI Cfg parameters to ueCb */
8204 memcpy(&cqiCb->cqiCfg, cqiCfg,
8205 sizeof(RgrUePrdDlCqiCfg));
8207 /* 2. Compute Periodic CQI Periodicity and subframe offset */
8209 rgSCHUtlGetCfgPerOff(RG_SCH_FDD_PCQI_TBL, cqiCfg->cqiSetup.cqiPCfgIdx,
8210 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
8212 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_PCQI_TBL,
8213 cqiCfg->cqiSetup.cqiPCfgIdx,
8214 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
8216 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
8217 "rgSCHCfgPCqiUeCfg(): UEID:%d CQI Peri=%d, CQI Offset=%d",
8223 cqiTrInstTime = ((cqiCb->cqiPeri+crntTime) - cqiCb->cqiOffset)
8225 cqiCb->nCqiTrIdx = (crntTime +
8226 (cqiCb->cqiPeri - cqiTrInstTime));
8227 /* Introduced timing delta for reception req
8229 if(cqiCb->nCqiTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8231 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx + cqiCb->cqiPeri;
8234 /* To handle the SFN wrap around case */
8235 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx % (RGSCH_MAX_SFN * RGSCH_NUM_SUB_FRAMES_5G);
8237 timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
8238 timingInfo.slot = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
8240 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
8241 %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8244 /*CQI Repetition configuration*/
8247 rgSchfillPucchCqiRepNumCountemtc(cqiCb, ueCb);
8251 if(RGR_UE_PCQI_SB_REP == cqiCfg->cqiSetup.cqiRepType)
8253 uint8_t k; /*SubBand Size (RB) */
8254 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
8255 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
8256 cqiCb->J = j; /*Number of Bandwidth Parts*/
8257 /*h: reporting instances required for a complete CQI/PMI report */
8258 /*j:Number of bandwidth parts; k: Subband Size*/
8259 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
8260 /* ccpu00140905- L-size is coming as 3 for 100Rbs where it should be 2*/
8261 temp = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, (j*k));
8262 cqiCb->label = (temp & (temp-1)) ?
8263 (1+ rgSCHUtlLog32bitNbase2(temp)) : rgSCHUtlLog32bitNbase2(temp);
8265 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ueCb, cqiCb);
8270 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
8274 /* Place the UE in cellCb->tIUeLstCp */
8275 cqiCb->cqiLstEnt.node=(PTR) cqiCb;
8277 cqiCb->isCqiIgnoByCollsn = FALSE;
8278 cqiCb->isRiIgnoByCollsn = FALSE;
8282 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
8286 /* 4. Rank Indicator Cfg handler */
8287 rgSCHCfgRiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8291 cqiCb->cqiCfg.type = RGR_SCH_PCQI_REL;
8292 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8294 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,\
8297 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8299 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst, \
8301 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
8302 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8304 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8305 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8306 cqiCb->riDist = RG_SCH_INVALID_IDX;
8308 ueCb->nPCqiCb = cqiCb;
8309 ueCb->nPRiCb = cqiCb;
8314 * @brief Handles Periodic RI configuration for a UE.
8318 * Function : rgSCHCfgRiUeCfg
8320 * Invoking Module Processing:
8321 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8322 * validations for the spec-defined values.
8325 * - For UE-specific Periodic RI related configuration,
8326 * - If Periodic RI is configured,
8327 * - Update UE with the configured values.
8328 - Compute and Update next occurance of RI Tranmission instance.
8329 - Update the RI offset and RI perodicity information
8333 * @param[in] RgSchCellCb *cell
8334 * @param[in] RgSchUeCb *ue
8335 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
8336 * @param[in] CmLteUeCategory ueCat
8344 RgSchCellCb *cellCb,
8346 RgrUePrdDlCqiCfg *cqiCfg,
8347 CmLteUeCategory ueCat
8350 S16 rgSCHCfgRiUeCfg(cellCb, ueCb, cqiCfg, ueCat)
8351 RgSchCellCb *cellCb;
8353 RgrUePrdDlCqiCfg *cqiCfg;
8354 CmLteUeCategory ueCat;
8358 uint16_t riTrInsTime;
8359 uint8_t j; /*Bandwidth parts. Valid for Modes 2-0, 2-1*/
8360 uint16_t periodicity;
8362 RgSchUePCqiCb *cqiCb = NULLP;
8364 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8365 +(cellCb->crntTime.slot);
8366 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8367 /* 1. Rank Indicator is enabled */
8368 if(cqiCfg->cqiSetup.riEna)
8371 rgSCHUtlGetCfgPerOff(RG_SCH_RI_TBL,
8372 cqiCfg->cqiSetup.riCfgIdx,
8373 &cqiCb->riPeri, &cqiCb->riOffset);
8375 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
8376 "rgSCHCfgRiUeCfg(): RI Peri=%d, RI Offset=%d UEID:%d",
8377 cqiCb->riPeri, cqiCb->riOffset,ueCb->ueId);
8379 cqiCb->perRiVal = 1;
8380 cqiCb->invalidateCqi = FALSE;
8382 if(RGR_UE_PCQI_WB_REP == cqiCfg->cqiSetup.cqiRepType)
8385 1. wideband RI reporting is configured
8387 (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )Mod(NCqiperiod
8390 periodicity = cqiCb->cqiPeri * cqiCb->riPeri;
8395 * Where Widesband and Subband RI reporting is configured
8396 * (Mode 2-0 or 2-1 )
8397 * (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )
8398 * Mod(H. NCqiperiod *MriPeriod )=0
8399 * where H= J * K +1; J=Number of bandwidth parts(BW/subsize).
8400 * K is RGR interf input
8403 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
8404 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
8405 periodicity = cqiCb->h * cqiCb->cqiPeri *
8409 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
8410 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
8411 * accordingly. WBCQI handling is naturally accomplished */
8412 if (periodicity >= RGSCH_MAX_SUBFRM_5G)
8414 periodicity = cqiCb->cqiOffset - cqiCb->riOffset +
8415 RGSCH_MAX_SUBFRM_5G - (crntTime);
8416 tempIdx = crntTime + periodicity;
8417 printf("CHECK_SID - periodicity %d tempIdx %d\n", periodicity, tempIdx);
8421 if ((crntTime + TFU_RECPREQ_DLDELTA + periodicity) >
8422 (RGSCH_MAX_SUBFRM_5G - 1))
8424 riTrInsTime = (periodicity - cqiCb->cqiOffset + cqiCb->riOffset) % periodicity;
8425 tempIdx = RGSCH_MAX_SUBFRM_5G + (periodicity - riTrInsTime);
8429 riTrInsTime = ((periodicity +crntTime )- \
8430 cqiCb->cqiOffset + cqiCb->riOffset)\
8432 tempIdx = (crntTime + (periodicity -riTrInsTime));
8435 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8437 tempIdx = tempIdx + periodicity;
8439 cqiCb->nRiTrIdx = tempIdx
8440 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8441 if(periodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
8443 cqiCb->riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
8444 (uint16_t) tempIdx);
8450 if(ueCb->mimoInfo.txMode == RGR_UE_TM_3
8451 || ueCb->mimoInfo.txMode == RGR_UE_TM_4)
8453 if (cellCb->numTxAntPorts ==2)
8455 cqiCb->riNumBits = 1;
8457 else if(cellCb->numTxAntPorts ==4)
8459 if(ueCat == CM_LTE_UE_CAT_8)
8461 cqiCb->riNumBits = 3;
8463 else if(ueCat >= CM_LTE_UE_CAT_5)
8465 cqiCb->riNumBits = 2;
8469 cqiCb->riNumBits = 1;
8473 /* Place the UE in cellCb->tIUeLstCp */
8474 cqiCb->riLstEnt.node=(PTR) cqiCb;
8476 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
8478 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_ADD,
8479 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8485 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8486 cqiCb->riDist = RG_SCH_INVALID_IDX;
8493 /* @brief Handles SRS configuration for a UE.
8497 * Function : rgSCHCfgSrsUeCfg
8499 * Invoking Module Processing:
8500 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8501 * validations for the spec-defined values.
8504 * - For UE-specific SRS related configuration,
8505 * - If SRS is configured,
8506 * - Update UE with the configured values.
8507 - Compute and Update next occurance of SRS Tranmission instance.
8508 - Update the SRS offset and SRS perodicity information
8509 - Add Ue to cell's srs list
8511 * - next occurance transmission instance of SRS = RG_SCH_INVALID_IDX
8515 * @param[in] RgSchCellCb *cell
8516 * @param[in] RgSchUeCb *ue
8517 * @param[in] RgrUeUlSrsCfg *srsCfg
8524 S16 rgSCHCfgSrsUeCfg
8526 RgSchCellCb *cellCb,
8528 RgrUeUlSrsCfg *srsCfg
8531 S16 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg)
8532 RgSchCellCb *cellCb;
8534 RgrUeUlSrsCfg *srsCfg;
8537 uint16_t srsTrInsTime;
8541 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8542 +(cellCb->crntTime.slot);
8544 if(RGR_SCH_SRS_SETUP == srsCfg->type)
8546 /* 1. Copy the Received Cfg parameters to local cb */
8547 memcpy(&ueCb->srsCb.srsCfg, srsCfg, sizeof(RgrUeUlSrsCfg));
8550 /* 2. Compute SRS Offset and Periodicity */
8551 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
8552 srsCfg->srsSetup.srsCfgIdx,
8553 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
8555 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
8556 srsCfg->srsSetup.srsCfgIdx,
8557 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
8560 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
8561 "rgSCHCfgSrsUeCfg(): SRS Peri=%d, SRS Offset=%d UEID:%d",
8562 ueCb->srsCb.peri,ueCb->srsCb.offset,ueCb->ueId);
8564 /* 3. Compute next Tranmission index for SRS */
8565 /* Referenence: 36.213 Section:8.2
8566 i. SRS transmission instances for TDD with period > 2 and for FDD are
8567 ((10*sfn +Ksrs-suframeoffset))/mod(periodicity))
8569 TDD: Ksrs Table 8.2-3:
8570 ii.The SRS transmission instances for TDD (periodicity == 2)
8571 (Ksrs-Toffset)mod(5)==0. Note: This is not supported now
8574 srsTrInsTime = ((ueCb->srsCb.peri+crntTime) - ueCb->srsCb.offset)
8576 tempIdx = (crntTime + (ueCb->srsCb.peri - srsTrInsTime));
8578 if (tempIdx <= (crntTime + TFU_DELTA))
8580 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8583 tempIdx = tempIdx + ueCb->srsCb.peri;
8585 ueCb->srsCb.nSrsTrIdx =(uint16_t) (tempIdx
8586 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE);
8587 if(ueCb->srsCb.peri >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
8590 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime+TFU_DELTA),
8593 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime + TFU_RECPREQ_DLDELTA),
8599 ueCb->srsCb.srsDist = 0;
8602 /*UE Tx Antenna Selection - START*/
8603 if(ueCb->ul.ulTxAntSel.pres == TRUE )
8605 /*for both partial and full sounding bandwidth,
8606 and when frequency hopping is disabled */
8607 ueCb->srsCb.selectedAnt = (crntTime/ueCb->srsCb.peri)%2;
8611 /* TS 36.213 specifies that if Tx Antenna Selection is
8612 disabled/not supported then its Port 0*/
8613 ueCb->srsCb.selectedAnt=0;
8615 ueCb->validTxAnt = ueCb->srsCb.selectedAnt;
8616 /*UE Tx Antenna Selection - ENDS*/
8618 ueCb->srsCb.srsLstEnt.node=(PTR)ueCb;
8619 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8620 &ueCb->srsCb.srsLstEnt);
8626 /* SRS Release / Not configured */
8627 ueCb->srsCb.srsCfg.type = RGR_SCH_SRS_REL;
8628 if(ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8630 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8631 &ueCb->srsCb.srsLstEnt);
8633 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8634 ueCb->srsCb.srsLstEnt.node =(PTR) NULLP;
8641 /* * @brief Handles SR configuration for a UE.
8645 * Function : rgSCHCfgSrUeCfg
8647 * Invoking Module Processing:
8648 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8649 * validations for the spec-defined values.
8651 * - If SR is configured,
8652 * - Update UE with the configured values.
8653 - Compute and Update next occurance of SR Tranmission instance.
8654 - Update the SR offset and SR perodicity information
8655 - Add Ue to cell->tIUeLstCp[n]
8657 * - next occurance transmission instance of SR = RG_INVALID_SR_ID
8662 * @param[in] RgSchCellCb *cell
8663 * @param[in] RgSchUeCb *ue
8664 * @param[in] RgrUeSrCfg *srCfg
8673 RgSchCellCb *cellCb,
8678 S16 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg)
8679 RgSchCellCb *cellCb;
8684 uint16_t srTrInsTime;
8688 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8689 +(cellCb->crntTime.slot);
8690 if(srCfg->type == RGR_SCH_SR_SETUP)
8692 /* 1. Copy the Received Cfg parameters to local cb */
8693 memcpy(&ueCb->srCb.srCfg, srCfg, sizeof(RgrUeSrCfg));
8696 /* 2. Compute SR periodicity and offset */
8697 rgSCHUtlGetCfgPerOff( RG_SCH_SR_TBL,
8698 srCfg->srSetup.srCfgIdx,
8699 &ueCb->srCb.peri, &ueCb->srCb.offset);
8701 RLOG_ARG4(L_DEBUG,DBG_CELLID,cellCb->cellId ,
8702 "SR Config: idx(%u), period (%u) offset (%u) UEID:%d",
8703 srCfg->srSetup.srCfgIdx,
8710 rgSchfillPucchSrRepNumCountemtc(ueCb);
8713 /* 3. Compute Next Transmission Instance */
8715 srTrInsTime = ((ueCb->srCb.peri+crntTime) - ueCb->srCb.offset)
8717 ueCb->srCb.nSrTrIdx = (crntTime + (ueCb->srCb.peri- srTrInsTime));
8719 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_DELTA))
8721 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8724 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx + ueCb->srCb.peri;
8726 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx
8727 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8728 ueCb->srCb.srLstEnt.node= (PTR) ueCb;
8730 /* 4. Place UE in Cell SR Tranmisison Instance List */
8731 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8732 &ueCb->srCb.srLstEnt);
8736 ueCb->srCb.srCfg.type = RGR_SCH_SR_REL;
8738 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8740 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8741 &ueCb->srCb.srLstEnt);
8743 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8744 ueCb->srCb.srLstEnt.node = (PTR)NULLP;
8751 /*****************************************************************
8752 * UE PCQI, RI, SRS and SR Re Configuration Functions *
8754 ******************************************************************/
8757 /* * @brief Handles Periodic CQI, PMI, RI Re-configuration for a UE.
8761 * Function : rgSCHCfgPCqiUeReCfg
8763 * Invoking Module Processing:
8764 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8765 * validations for the spec-defined values.
8768 * - For UE-specific Periodic CQI related configuration,
8769 * - If Periodic CQI/PMI is re configured(first time enabled),
8770 * - Update UE with the configured values.
8771 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8773 * - Update the CQI offset and CQI perodicity information
8774 * - Add Ue to cell's list
8775 * - If Periodic CQI/PMI is re configured(modify),
8776 * - Update UE with the configured values.
8777 * - Del Ue from cell->tIUeLstCp list
8778 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8780 * - Update the CQI offset and CQI perodicity information
8781 * - Add Ue to cell's list
8782 * - If Periodic CQI/PMI is re configured(disabled),
8783 * - Update UE with the configured values.
8784 * - Del Ue from cell's list
8785 * - Update next occurance of CQI/PMI or RI Tranmission instance.
8786 * - next occurance of CQI/PMI = RG_INVALID_CQIPMI_ID
8788 * - For UE-specific Periodic RI related configuration,
8789 * - If Periodic RI is configured(first time enabled),
8790 * - Update UE with the configured values.
8791 * - Compute and Update next occurance of RI Tranmission instance.
8792 * - Update the RI offset and RI perodicity information
8793 * - If Periodic RI is configured(modify),
8794 * - Update UE with the configured values.
8795 * - Compute and Update next occurance of RI Tranmission instance.
8796 * - Update the RI offset and RI perodicity information
8798 * - next occurance of RI = RG_INVALID_CQIPMI_ID
8802 * @param[in] RgSchCellCb *cell
8803 * @param[in] RgSchUeCb *ue
8804 * @param[in] RgrUeCfg *ueCfg
8811 S16 rgSCHCfgPCqiUeReCfg
8813 RgSchCellCb *cellCb,
8815 RgrUePrdDlCqiCfg *cqiCfg,
8816 CmLteUeCategory ueCat
8819 S16 rgSCHCfgPCqiUeReCfg(cellCb, ueCb, cqiCfg, ueCat)
8820 RgSchCellCb *cellCb;
8822 RgrUePrdDlCqiCfg *cqiCfg;
8823 CmLteUeCategory ueCat;
8827 RgSchUePCqiCb *cqiCb = NULLP;
8829 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8830 /* Fix: ccpu00124008 Fix for incorrect check causing missed CQI reception instance */
8831 if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8832 (cqiCb->cqiCfg.type != RGR_SCH_PCQI_SETUP))
8834 /* 1. cqi is in Release (Disable) state, Recfg is allowing Setup (Enable)
8836 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8839 else if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8840 (cqiCb->cqiCfg.type == RGR_SCH_PCQI_SETUP ))
8844 2. Present is SETUP(Enable) state, Recfg is modifying SETUP(Enable)
8846 2.1 Delete UE from the cqiList
8847 2.2 Set next occurance Transmission instace to "INVALID"
8848 2.3 Compute Next occurance Transmission instace
8849 2.4 Placed ue in Transmission instance list.
8851 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX )
8852 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
8855 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX )
8857 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
8859 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
8860 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8864 cqiCb->cqiLstEnt.next = NULLP;
8865 cqiCb->cqiLstEnt.prev = NULLP;
8866 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8867 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8868 cqiCb->riDist = RG_SCH_INVALID_IDX;
8870 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8874 /* Present is SETUP(Enable) state, Recfg is Release(Disable) */
8875 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8878 /* ccpu00140578:: */
8879 cqiCb->riRecpPrcsd = FALSE;
8884 /* * @brief Handles SRS Re-configuration for a UE.
8888 * Function : rgSCHCfgSrsUeReCfg
8890 * Invoking Module Processing:
8891 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8892 * validations for the spec-defined values.
8895 * - For UE-specific SRS related re configuration,
8896 * - If SRS is configured modified(First time Enabled),
8897 * - Update UE with the configured values.
8898 * - Compute and Update next occurance of SRS Tranmission instance.
8899 * - Update the SRS offset and SRS perodicity information
8900 * - Add Ue to cell's list
8901 * - If SRS is configured modified(Changed offset or index ),
8902 * - Delete UE from cell->tIUeLstCp[n] if present
8903 * - Update UE with the configured values.
8904 * - Compute and Update next occurance of SRS Tranmission instance.
8905 * - Update the SRS offset and SRS perodicity information
8906 * - Add Ue to cell's list
8907 * - If SRS is configured modified(disabled),
8908 * - Delete UE from cell->tIUeLstCp[n] if present
8909 * - Update next occurance of SRS Tranmission instance to "INVALID".
8910 * - Update the SRS offset and SRS perodicity information "INVALID"
8916 * @param[in] RgSchCellCb *cell
8917 * @param[in] RgSchUeCb *ue
8918 * @param[in] RgrUeUlSrsCfg *srsCfg
8925 S16 rgSCHCfgSrsUeReCfg
8927 RgSchCellCb *cellCb,
8929 RgrUeUlSrsCfg *srsCfg
8932 S16 rgSCHCfgSrsUeReCfg(cellCb, ueCb, srsCfg)
8933 RgSchCellCb *cellCb;
8935 RgrUeUlSrsCfg *srsCfg;
8940 if(( RGR_SCH_SRS_SETUP == srsCfg->type) ||
8941 ( RGR_SCH_SRS_SETUP != ueCb->srsCb.srsCfg.type ))
8943 /* 1. Present is Release(Disable) state, Recfg is allowing
8945 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8947 else if (( RGR_SCH_SRS_SETUP == srsCfg->type ) &&
8948 ( RGR_SCH_SRS_SETUP == ueCb->srsCb.srsCfg.type))
8951 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8953 2.1 Delete UE from the cqiList
8954 2.2 Set next occurance Transmission instance to "INVALID"
8955 2.3 Compute Next occurance Transmission instance
8956 2.4 Placed ue in Transmission instance list.
8958 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8960 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8961 &ueCb->srsCb.srsLstEnt);
8962 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8965 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8969 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable)*/
8970 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8972 /* ccpu00140578:: */
8973 ueCb->srsCb.srsRecpPrcsd = FALSE;
8978 /* @brief Handles SR Re-configuration for a UE.
8982 * Function : rgSCHCfgSrUeReCfg
8984 * Invoking Module Processing:
8985 * - This shall be invoked by SCH_GOM at UE Re configuration.
8986 * It shall do the validations for the spec-defined values.
8989 * - For UE-specific SR related re configuration,
8990 * - If SR is configured modified(First time Enabled),
8991 * - Update UE with the configured values.
8992 * - Compute and Update next occurance of SR Tranmission instance.
8993 * - Update the SR offset and SR perodicity information
8994 * - Add Ue to cell->tIUeLstCp[n]
8995 * - If SR is configured modified(Changed offset or index ),
8996 * - Delete UE from cell->tIUeLstCp[n] if present
8997 * - Update UE with the configured values.
8998 * - Compute and Update next occurance of SR Tranmission instance.
8999 * - Update the SR offset and SR perodicity information
9000 * - Add Ue to cell->tIUeLstCp[n]
9001 * - If SR is configured modified(disabled),
9002 * - Delete UE from cell->tIUeLstCp[n] if present
9003 * - Update next occurance of SR Tranmission instance to "INVALID".
9004 * - Update the SR offset and SR perodicity information "INVALID"
9012 * @param[in] RgSchCellCb *cell
9013 * @param[in] RgSchUeCb *ue
9014 * @param[in] RgrUeCfg *ueCfg
9021 S16 rgSCHCfgSrUeReCfg
9023 RgSchCellCb *cellCb,
9028 S16 rgSCHCfgSrUeReCfg(cellCb, ueCb, srCfg)
9029 RgSchCellCb *cellCb;
9035 /* Fix : syed Incorrect check for SR RECFG */
9036 if((srCfg->type == RGR_SCH_SR_SETUP) &&
9037 (ueCb->srCb.srCfg.type != RGR_SCH_SR_SETUP))
9040 1. Present is Release(Disable) state, Recfg is allowing SETUP(Enable)
9042 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
9044 else if((srCfg->type == RGR_SCH_SR_SETUP) &&
9045 (ueCb->srCb.srCfg.type == RGR_SCH_SR_SETUP))
9048 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
9050 2.1 Delete UE from the cqiList
9051 2.2 Compute Next occurance Transmission instace
9053 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX )
9055 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
9056 &ueCb->srCb.srLstEnt);
9057 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
9059 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
9064 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable) */
9065 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
9071 /* @brief Handles ACQI Re-configuration for a UE.
9075 * Function : rgSCHCfgAcqiUeReCfg
9077 * Invoking Module Processing:
9078 * - This shall be invoked by SCH_GOM at UE Re configuration.
9079 * It shall do the validations for the spec-defined values.
9082 * - For UE-specific ACQI related re configuration,
9083 * - Check if the ACQI Mode has been changed from the
9084 * existing Configuration.
9085 * - If the configuration has been changed,
9086 * - Call Aperiodic Config function to change the config
9093 * @param[in] RgSchCellCb *cell
9094 * @param[in] RgSchUeCb *ue
9095 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg
9102 S16 rgSCHCfgAcqiUeReCfg
9104 RgSchCellCb *cellCb,
9106 RgrUeAprdDlCqiCfg *acqiCfg,
9107 CmLteUeCategory ueCat
9110 S16 rgSCHCfgAcqiUeReCfg(cellCb, ueCb, acqiCfg, ueCat)
9111 RgSchCellCb *cellCb;
9113 RgrUeAprdDlCqiCfg *acqiCfg;
9114 CmLteUeCategory ueCat;
9118 return (rgSCHCfgACqiUeCfg(cellCb,ueCb,(RG_SCH_CMN_GET_ACQICB(ueCb,cellCb))
9119 ,ueCb->mimoInfo.txMode, acqiCfg, ueCat));
9123 /*****************************************************************
9124 * UE PCQI, RI, SRS and SR Configuration Delete *
9126 *****************************************************************/
9128 /* @brief Free Periodic CQI/PMI/RI, SRS and SR transmission instance
9129 * related data structures of this UE from CellCb
9133 * Function : rgSCHCfgPCqiSrsSrUeDel
9135 * Invoking Module Processing:
9136 * - This shall be invoked by SCH_GOM at Ue deletion.
9139 * - For SRS Transmission Instance
9140 * - if (srsTxInst!= RG_INVALID)
9141 * - Remove from the cellCb->tIUeLstCp[srsTxInst*3+2]
9144 * - For SR Transmission Instance
9145 * - if (srTxInst!= RG_INVALID)
9146 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+1]
9149 * - For Periodic CQI/PMI RI Transmission Instance
9150 * - if (pCqiTxInst!= RG_INVALID)
9151 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+0]
9155 * @param[in] RgSchCellCb *cell
9156 * @param[in] RgSchUeCb *ue
9162 S16 rgSCHCfgPCqiSrsSrUeDel
9164 RgSchCellCb *cellCb,
9168 S16 rgSCHCfgPCqiSrsSrUeDel(cellCb, ueCb)
9169 RgSchCellCb *cellCb;
9175 uint32_t sCellCnt = 0;
9177 RgSchUePCqiCb *cqiRiCb = NULLP;
9179 cqiRiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
9183 /* Delete SRS Transmission Instance */
9184 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
9186 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
9187 &ueCb->srsCb.srsLstEnt);
9188 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
9191 /* Delete SR Transmission Instance */
9192 if (ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
9194 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
9195 &ueCb->srCb.srLstEnt);
9196 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
9199 /* Delete Periodic CQI/PMI Transmission Instance */
9200 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
9202 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
9203 &cqiRiCb->cqiLstEnt);
9204 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
9206 /* Delete Periodic RI Transmission Instance */
9208 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
9210 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
9211 &cqiRiCb->riLstEnt);
9212 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
9213 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
9214 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
9219 for (cellIdx =1; cellIdx <= RG_SCH_MAX_SCELL; cellIdx++)
9221 /* If a serving cell is configured */
9222 if(ueCb->cellInfo[cellIdx] != NULLP)
9224 /* If the serving cell is in ACTIVE state and
9225 If it is not the same serving cell as cqiRiCb for which
9226 collision is being checked */
9227 cqiRiCb = &ueCb->cellInfo[cellIdx]->cqiCb;
9228 /* Delete Periodic CQI/PMI Transmission Instance */
9229 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
9231 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
9232 &cqiRiCb->cqiLstEnt);
9233 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
9235 /* Delete Periodic RI Transmission Instance */
9237 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
9239 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
9240 &cqiRiCb->riLstEnt);
9241 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
9242 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
9243 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
9247 /* If all of the num of configured scells are checked then break */
9248 if (sCellCnt == ueCb->numSCells)
9260 /* @brief Search the cfgIdx in given table and retrive periodicity & offset
9263 * Function : rgSCHUtlGetCfgPerOff
9265 * Invoking Module Processing:
9266 * - This shall be invoked by Cfg Module
9269 * binary search for given entry in table
9270 * find the periodicty, offset for a given config index from the table
9272 * @param[in] RgSchPerTbl tbl
9273 * @param[in] uint16_t cfgIdx
9274 * @param[out] uint16_t *peri
9275 * @param[out] uint16_t *offset
9282 S16 rgSCHUtlGetCfgPerOff
9290 S16 rgSCHUtlGetCfgPerOff ( tbl, cfgIdx, peri, offset)
9300 const RgSchUePCqiSrsSrCfgIdxTbl* table;
9302 /* Added the function instead of the MACRO to get the
9303 * periodicity table */
9304 table = rgSCHCfgUtlGetPcqiSrsSrRiTbl ( tbl,&min,&max );
9307 if (( cfgIdx >= table[mid].min) &&
9308 ( cfgIdx <= table[mid].max))
9310 *peri = table[mid].peri;
9311 *offset = cfgIdx - table[mid].offset;
9315 if ( cfgIdx > table[mid].min)
9324 }while( min <= max );
9330 /***********************************************************
9332 * Func : rgSCHCfgUtlFetchAcqiBitSz
9335 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
9345 **********************************************************/
9347 static Void rgSCHCfgUtlFetchAcqiBitSz
9349 RgSchUeACqiCb *acqiCb,
9351 uint8_t* cqiPmiSzR1,
9352 uint8_t* cqiPmiSzRn1
9355 static Void rgSCHCfgUtlFetchAcqiBitSz(acqiCb, numTxAnt, cqiPmiSzR1, cqiPmiSzRn1)
9356 RgSchUeACqiCb *acqiCb;
9358 uint8_t* cqiPmiSzR1;
9359 uint8_t* cqiPmiSzRn1;
9363 uint32_t confRepMode;
9365 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
9368 case RGR_APRD_CQI_MOD12:
9372 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
9373 *cqiPmiSzRn1 = 8+ acqiCb->N;
9375 else if(numTxAnt == 4)
9377 *cqiPmiSzR1 = 4 + 4*acqiCb->N;
9378 *cqiPmiSzRn1 = 8 + 4*acqiCb->N;
9383 case RGR_APRD_CQI_MOD20:
9385 *cqiPmiSzR1 = 6 + acqiCb->L;
9386 *cqiPmiSzRn1 = 6 + acqiCb->L;
9390 case RGR_APRD_CQI_MOD22:
9394 *cqiPmiSzR1 = 10 + acqiCb->L;
9395 *cqiPmiSzRn1 = 14 + acqiCb->L;
9397 else if(numTxAnt == 4)
9399 *cqiPmiSzR1 = 14 + acqiCb->L;
9400 *cqiPmiSzRn1 = 20 + acqiCb->L;
9405 case RGR_APRD_CQI_MOD30:
9407 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
9408 *cqiPmiSzRn1 = 4 + 2*acqiCb->N;
9412 case RGR_APRD_CQI_MOD31:
9416 *cqiPmiSzR1 = 6 + 2*acqiCb->N;
9417 *cqiPmiSzRn1 = 9 + 4*acqiCb->N;
9419 else if(numTxAnt == 4)
9421 *cqiPmiSzR1 = 8 + 2*acqiCb->N;
9422 *cqiPmiSzRn1 = 12 + 4*acqiCb->N;
9431 /* Added the function rgSCHCfgUtlGetPcqiCrsSrRiTbl to be used
9432 * instead of the MACRO RG_SCH_GET_PERIODICITY_TBL */
9433 /***********************************************************
9435 * Func : rgSCHCfgUtlGetPcqiCrsSrRiTbl
9438 * Desc : Get the Srs Cqi Crs Ri Table
9447 **********************************************************/
9450 static const RgSchUePCqiSrsSrCfgIdxTbl * rgSCHCfgUtlGetPcqiSrsSrRiTbl
9452 RgSchPerTbl tblType,
9457 static const RgSchUePCqiSrsSrCfgIdxTbl * rgSCHCfgUtlGetPcqiSrsSrRiTbl(tblType, min, max)
9458 RgSchPerTbl tblType;
9463 const RgSchUePCqiSrsSrCfgIdxTbl * table;
9468 case RG_SCH_FDD_PCQI_TBL:
9470 table = rgSchUePCqiCfgIdxFddTbl;
9472 * max=RG_SCH_CQIPMI_CFGIDX_MAX_FDD;
9475 case RG_SCH_TDD_PCQI_TBL:
9477 table = rgSchUeCqiPmiCfgIdxTddTbl;
9479 * max=RG_SCH_CQIPMI_CFGIDX_MAX_TDD;
9484 table = rgSchUeRiCfgIdxTbl;
9486 * max=RG_SCH_RI_CFGIDX_MAX;
9489 case RG_SCH_FDD_SRS_TBL:
9491 table = rgSchUeSrsCfgIdxFddTbl;
9493 * max=RG_SCH_SRS_ISRS_INDX_MAX_FDD;
9496 case RG_SCH_TDD_SRS_TBL:
9498 table = rgSchUeSrsCfgIdxTddTbl;
9500 * max=RG_SCH_SRS_ISRS_INDX_MAX_TDD;
9505 table = rgSchUeSrCfgIdxTbl;
9507 * max=RG_SCH_ISR_INDX_MAX;
9512 table = (const RgSchUePCqiSrsSrCfgIdxTbl *) 0;
9522 #endif /* TFU_UPGRADE */
9524 /***********************************************************
9526 * Func : rgSCHCfgVldtDrxUeCfg
9529 * Desc : Validates UE DRX Timers Configuration recieved from RRC.
9539 **********************************************************/
9541 static S16 rgSCHCfgVldtDrxUeCfg
9544 RgrUeDrxCfg *ueDrxCfg
9547 static S16 rgSCHCfgVldtDrxUeCfg(cell, ueDrxCfg)
9549 RgrUeDrxCfg *ueDrxCfg;
9553 if (ueDrxCfg->isDrxEnabled == FALSE)
9559 if ( ueDrxCfg->cqiMask.pres )
9561 if ( ueDrxCfg->cqiMask.val != RGR_DRX_SETUP )
9564 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid cqiMask configuration (%d)",
9565 ueDrxCfg->cqiMask.val);
9567 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid cqiMask configuration(%ld)",
9568 ueDrxCfg->cqiMask.val);
9573 #endif /*LTEMAC_R9*/
9575 if(ueDrxCfg->isEmtcUe)
9577 if(ueDrxCfg->drxOnDurTmrR13Pres)
9579 if ( rgSCHEmtcCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
9581 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d)",
9582 ueDrxCfg->drxOnDurTmr);
9588 if (rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
9590 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d) for EMTC",
9591 ueDrxCfg->drxOnDurTmr);
9600 if ( rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
9602 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d) for EMTC",
9603 ueDrxCfg->drxOnDurTmr);
9608 if ( rgSCHCfgVldtDrxInActvCfg(ueDrxCfg->drxInactvTmr) != ROK )
9610 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Inactivity configuration(%d)",
9611 ueDrxCfg->drxInactvTmr);
9615 if(ueDrxCfg->isEmtcUe)
9617 if(ueDrxCfg->drxRetxTmrR13Pres)
9619 if ( rgSCHEmtcCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
9621 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d) for EMTC",
9622 ueDrxCfg->drxRetxTmr);
9628 if (rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
9630 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d)",
9631 ueDrxCfg->drxRetxTmr);
9640 if ( rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
9642 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d)",
9643 ueDrxCfg->drxRetxTmr);
9648 if(ueDrxCfg->isEmtcUe)
9650 if ( rgSCHEmtcCfgVldtDrxUlReTxCfg(ueDrxCfg->emtcDrxUlRetxTmr) != ROK )
9652 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d) for EMTC",
9653 ueDrxCfg->drxRetxTmr);
9660 if ( rgSCHCfgVldtDrxLngCycCfg(ueDrxCfg->drxLongCycleOffst) != ROK )
9662 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid LongCycle configuration");
9666 if ( ueDrxCfg->drxLongCycleOffst.longDrxCycle < ueDrxCfg->drxOnDurTmr )
9668 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9669 " and onDuration timer values");
9674 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxLongCycleOffst.longDrxCycle,
9675 ueDrxCfg->drxOnDurTmr, ueDrxCfg->drxLongCycleOffst.drxStartOffst) != ROK)
9677 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9678 " and onDuration timer values");
9683 if( TRUE == ueDrxCfg->drxShortDrx.pres )
9685 if ( ueDrxCfg->drxShortDrx.shortDrxCycle < ueDrxCfg->drxOnDurTmr )
9687 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of short DRX "
9688 "Cycle and onDuration timer values");
9692 if ( (ueDrxCfg->drxLongCycleOffst.longDrxCycle %
9693 ueDrxCfg->drxShortDrx.shortDrxCycle) != 0)
9695 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId," Long DRX cycle is not multiple of "
9700 if ( rgSCHCfgVldtDrxShrtCycCfg(ueDrxCfg->drxShortDrx) != ROK )
9702 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Short Cycle configuration");
9707 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxShortDrx.shortDrxCycle,
9708 ueDrxCfg->drxOnDurTmr,
9709 ueDrxCfg->drxLongCycleOffst.drxStartOffst %
9710 ueDrxCfg->drxShortDrx.shortDrxCycle) != ROK)
9712 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9713 " and onDuration timer values");
9720 }/*rgSCHCfgVldtDrxUeCfg*/
9722 /***********************************************************
9724 * Func : rgSCHCfgVldtDrxOnDurCfg
9727 * Desc : Validates UE DRX On Duration configuration
9728 * recieved from RRC.
9738 **********************************************************/
9740 static S16 rgSCHCfgVldtDrxOnDurCfg
9745 static S16 rgSCHCfgVldtDrxOnDurCfg(onDurTmr)
9752 case RGR_DRX_PRD_1PSF:
9753 case RGR_DRX_PRD_2PSF:
9754 case RGR_DRX_PRD_3PSF:
9755 case RGR_DRX_PRD_4PSF:
9756 case RGR_DRX_PRD_5PSF:
9757 case RGR_DRX_PRD_6PSF:
9758 case RGR_DRX_PRD_8PSF:
9759 case RGR_DRX_PRD_10PSF:
9760 case RGR_DRX_PRD_20PSF:
9761 case RGR_DRX_PRD_30PSF:
9762 case RGR_DRX_PRD_40PSF:
9763 case RGR_DRX_PRD_50PSF:
9764 case RGR_DRX_PRD_60PSF:
9765 case RGR_DRX_PRD_80PSF:
9766 case RGR_DRX_PRD_100PSF:
9767 case RGR_DRX_PRD_200PSF:
9774 }/*switch(onDurTmr)*/
9777 }/*rgSCHCfgVldtOnDurCfg*/
9779 /***********************************************************
9781 * Func : rgSCHCfgVldtDrxInActvCfg
9784 * Desc : Validates UE DRX InActivity configuration
9785 * recieved from RRC.
9795 **********************************************************/
9797 static S16 rgSCHCfgVldtDrxInActvCfg
9802 static S16 rgSCHCfgVldtDrxInActvCfg(inActvTmr)
9806 switch ( inActvTmr )
9808 case RGR_DRX_PRD_1PSF:
9809 case RGR_DRX_PRD_2PSF:
9810 case RGR_DRX_PRD_3PSF:
9811 case RGR_DRX_PRD_4PSF:
9812 case RGR_DRX_PRD_5PSF:
9813 case RGR_DRX_PRD_6PSF:
9814 case RGR_DRX_PRD_8PSF:
9815 case RGR_DRX_PRD_10PSF:
9816 case RGR_DRX_PRD_20PSF:
9817 case RGR_DRX_PRD_30PSF:
9818 case RGR_DRX_PRD_40PSF:
9819 case RGR_DRX_PRD_50PSF:
9820 case RGR_DRX_PRD_60PSF:
9821 case RGR_DRX_PRD_80PSF:
9822 case RGR_DRX_PRD_100PSF:
9823 case RGR_DRX_PRD_200PSF:
9824 case RGR_DRX_PRD_300PSF:
9825 case RGR_DRX_PRD_500PSF:
9826 case RGR_DRX_PRD_750PSF:
9827 case RGR_DRX_PRD_1280PSF:
9828 case RGR_DRX_PRD_1920PSF:
9829 case RGR_DRX_PRD_2560PSF:
9836 }/*switch(InactvTmr)*/
9839 }/*rgSCHCfgVldtDrxInActvCfg*/
9841 /***********************************************************
9843 * Func : rgSCHCfgVldtDrxReTxCfg
9846 * Desc : Validates DRX ReTx timer configuration
9847 * recieved from RRC.
9857 **********************************************************/
9859 static S16 rgSCHCfgVldtDrxReTxCfg
9864 static S16 rgSCHCfgVldtDrxReTxCfg(reTxTmr)
9870 case RGR_DRX_PRD_1PSF:
9871 case RGR_DRX_PRD_2PSF:
9872 case RGR_DRX_PRD_4PSF:
9873 case RGR_DRX_PRD_6PSF:
9874 case RGR_DRX_PRD_8PSF:
9875 case RGR_DRX_PRD_16PSF:
9876 case RGR_DRX_PRD_24PSF:
9877 case RGR_DRX_PRD_33PSF:
9884 }/*switch(drxRetxTmr)*/
9887 }/*rgSCHCfgVldtDrxReTxCfg*/
9889 /***********************************************************
9891 * Func : rgSCHCfgVldtDrxShrtCycCfg
9894 * Desc : Validates DRX Short Cycle timer configuration
9895 * recieved from RRC.
9906 **********************************************************/
9908 static S16 rgSCHCfgVldtDrxLngCycCfg
9910 RgrDrxLongCycleOffst lngCycleOffst
9913 static S16 rgSCHCfgVldtDrxLngCycCfg(lngCycleOffst)
9914 RgrDrxLongCycleOffst lngCycleOffst;
9917 if ( rgSCHCfgVldtDrxLngCyclTmrs(lngCycleOffst.longDrxCycle) != ROK )
9922 if ( lngCycleOffst.drxStartOffst >= lngCycleOffst.longDrxCycle )
9928 }/*rgSCHCfgVldtDrxLngCycCfg*/
9930 /***********************************************************
9932 * Func : rgSCHCfgVldtDrxLngCyclTmrs
9935 * Desc : Validates DRX Long Cycle timer values
9936 * recieved from RRC.
9947 **********************************************************/
9949 static S16 rgSCHCfgVldtDrxLngCyclTmrs
9954 static S16 rgSCHCfgVldtDrxLngCyclTmrs(val)
9961 case RGR_DRX_PRD_10SF:
9962 case RGR_DRX_PRD_20SF:
9963 case RGR_DRX_PRD_32SF:
9964 case RGR_DRX_PRD_40SF:
9965 case RGR_DRX_PRD_64SF:
9966 case RGR_DRX_PRD_80SF:
9967 case RGR_DRX_PRD_128SF:
9968 case RGR_DRX_PRD_160SF:
9969 case RGR_DRX_PRD_256SF:
9970 case RGR_DRX_PRD_320SF:
9971 case RGR_DRX_PRD_512SF:
9972 case RGR_DRX_PRD_640SF:
9973 case RGR_DRX_PRD_1024SF:
9974 case RGR_DRX_PRD_1280SF:
9975 case RGR_DRX_PRD_2048SF:
9976 case RGR_DRX_PRD_2560SF:
9983 }/*switch(longDrxCycle)*/
9986 }/*rgSCHCfgVldtDrxLngCyclTmrs*/
9988 /***********************************************************
9990 * Func : rgSCHCfgVldtDrxShrtCycCfg
9993 * Desc : Validates DRX Short Cycle timer configuration
9994 * recieved from RRC.
10005 **********************************************************/
10007 static S16 rgSCHCfgVldtDrxShrtCycCfg
10009 RgrDrxShortDrx shrtCycCfg
10012 static S16 rgSCHCfgVldtDrxShrtCycCfg(shrtCycCfg)
10013 RgrDrxShortDrx shrtCycCfg;
10016 switch(shrtCycCfg.shortDrxCycle)
10018 case RGR_DRX_PRD_2SF:
10019 case RGR_DRX_PRD_5SF:
10020 case RGR_DRX_PRD_8SF:
10021 case RGR_DRX_PRD_10SF:
10022 case RGR_DRX_PRD_16SF:
10023 case RGR_DRX_PRD_20SF:
10024 case RGR_DRX_PRD_32SF:
10025 case RGR_DRX_PRD_40SF:
10026 case RGR_DRX_PRD_64SF:
10027 case RGR_DRX_PRD_80SF:
10028 case RGR_DRX_PRD_128SF:
10029 case RGR_DRX_PRD_160SF:
10030 case RGR_DRX_PRD_256SF:
10031 case RGR_DRX_PRD_320SF:
10032 case RGR_DRX_PRD_640SF:
10040 }/*switch(shortDrxCycle)*/
10042 if ( (shrtCycCfg.drxShortCycleTmr < RGR_DRX_SHRTCYCLE_MIN) ||
10043 (shrtCycCfg.drxShortCycleTmr > RGR_DRX_SHRTCYCLE_MAX)
10053 * @brief Handler for TA related UE Reconfiguration.
10057 * Function : rgSCHCfgUeTaRecfg
10059 * This function shall fetch the TA timer related information into the
10060 * respective ueCb from the UE configuration as provided by the
10063 * @param[in] RgSchCellCb *cell
10064 * @param[in] RgSchUeCb *ueCb
10065 * @param[in] RgrUeCfg *ueCfg
10066 * @param[out] RgSchErrInfo *errInfo
10072 static Void rgSCHCfgUeTaRecfg
10080 static Void rgSCHCfgUeTaRecfg(cell, ueCb, ueCfg, err)
10089 /* Update the TA related information */
10091 if (ueCfg->ueTaTmrRecfg.pres)
10093 /* Configuring taTmr with 30 deficit, to enable eNodeB sending
10094 * TA command before the expiry of TA at UE. Also considering for
10095 * possible retx for this TA command */
10096 /* [ccpu00121813]-ADD-Added chk if tatmr val > 30 */
10097 if(ueCfg->ueTaTmrRecfg.taTmr > 30)
10099 ueCb->dl.taCb.cfgTaTmr = ueCfg->ueTaTmrRecfg.taTmr - 30;
10101 /* If TA Timer is running. Stop it and then start it*/
10102 if (ueCb->taTmr.tmrEvnt != TMR_NONE)
10104 rgSCHTmrStopTmr(cell, ueCb->taTmr.tmrEvnt, ueCb);
10105 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
10109 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
10113 } /* rgSCHCfgUeTaRecfg */
10115 /* ccpu00117452 - MOD - Changed macro name from
10116 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
10117 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
10118 /***********************************************************
10120 * Func : rgSCHCfgUeCqiReptReCfg
10123 * Desc : Reconfiguration of PUSH N CQI Reporting
10125 * Ret : RFAILED in case of failure
10132 **********************************************************/
10134 static S16 rgSCHCfgUeCqiReptReCfg
10138 RgrUeRecfg *ueRecfg
10141 static S16 rgSCHCfgUeCqiReptReCfg(cell, ue, ueRecfg)
10144 RgrUeRecfg *ueRecfg;
10149 /* Check has it been disabled */
10150 if(ueRecfg->ueCqiReptCfg.numColltdCqiRept)
10152 /* Check if we need to send CQI reports collagted so far and send if so */
10153 if(ue->schCqiInfo.cqiCount >=
10154 ueRecfg->ueCqiReptCfg.numColltdCqiRept)
10156 RgrStaIndInfo *staInfo;
10157 /* if yes, Send StaInd to RRM */
10158 retVal = rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&staInfo,
10159 sizeof(RgrStaIndInfo));
10162 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
10163 "Could not allocate memory for sending StaInd OLD CRNTI:%d",ueRecfg->oldCrnti);
10167 /* Fill StaInd for sending collated N CQI rpeort */
10168 rgSCHUtlFillSndStaInd(cell, ue, staInfo,
10169 ueRecfg->ueCqiReptCfg.numColltdCqiRept);
10174 ue->schCqiInfo.cqiCount = 0;
10177 ue->cqiReptCfgInfo.numColltdCqiRept =
10178 ueRecfg->ueCqiReptCfg.numColltdCqiRept;
10180 } /* End of rgSCHCfgUeCqiReptReCfg */
10181 #endif /* End of RGR_CQI_REPT */
10182 /*This function Added Ue in ongoing L2 Meas*/
10183 /*LTE_L2_MEAS_PHASE2*/
10185 static S16 rgSchAddToL2Meas(RgSchCellCb *cellCb,RgSchDlLcCb *dlLc)
10189 RgSchL2MeasCb *measCb = NULLP;
10190 lnk = cellCb->l2mList.first;
10192 while(lnk != NULLP)
10194 /* Get the MeasCb : RgSchL2MeasCb */
10195 measCb = (RgSchL2MeasCb *)lnk->node;
10196 if (measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
10198 for(idx = 0;idx < measCb->measReq.avgPrbQciDl.numQci;idx++)
10200 if(measCb->measReq.avgPrbQciDl.qci[idx] == dlLc->qciCb->qci)
10202 break; /*exit from for loop*/
10205 if(idx == measCb->measReq.avgPrbQciDl.numQci)
10207 measCb->measReq.avgPrbQciDl.qci[measCb->measReq.avgPrbQciDl.numQci++] = dlLc->qciCb->qci;
10211 }/*End of while loop*/
10218 * @brief UE SCell Buffer Free
10222 * Function : rgSCHSCellFreeBuf
10224 * This functions will free allocated memory
10225 * for UE secondart cellCB
10228 * @param[in] Inst inst
10229 * @param[in] RgSchUeCb *ue
10230 * @param[int] RgrUeRecfg *ueRecfg
10231 * @param[out] uint8_t idx
10235 Void rgSCHSCellFreeBuf
10239 RgrUeRecfg *ueRecfg,
10243 Void rgSCHSCellFreeBuf(inst ,ue, ueRecfg, idx)
10246 RgrUeRecfg *ueRecfg;
10250 RgSchUeCellInfo *sCellInfo = NULLP;
10251 RgrUeSecCellCfg *sCellInfoRecfg = NULLP;
10254 for(uint8_t i = 0; i <= idx; i++)
10256 sCellInfoRecfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[i];
10257 sCellInfo = ue->cellInfo[(sCellInfoRecfg->sCellIdx)];
10259 if (NULLP != sCellInfo)
10261 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
10262 sizeof(RgSchUeCellInfo));
10263 ue->cellInfo[(sCellInfoRecfg->sCellIdx)] = NULLP;
10270 /**********************************************************************
10273 **********************************************************************/