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
480 S16 rgSCHCfgVldtRgrSchedEnbCfg
483 RgrSchedEnbCfg *schedEnbCfg,
484 RgSchErrInfo *errInfo
487 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "VALIDATE RGR SCH ENB CONFIG: \n"));
489 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
492 if ((rgSCHCfgVldtRgrSchCfg(inst, schedEnbCfg)) != ROK)
494 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Validation for scheduler related "
499 RLOG1(L_INFO, "MIMO_DBG:: SCH:: numAntPorts=%d\n",schedEnbCfg->numTxAntPorts);
501 /* Validation for the ENB parameters */
502 if ((schedEnbCfg->numTxAntPorts == 0) || (schedEnbCfg->numTxAntPorts > 4))
504 RGSCHDBGERR(inst, (rgSchPBuf(inst),"Invalid number of transmit antenna"
505 " ports %d\n", schedEnbCfg->numTxAntPorts));
509 /* Validate csg access mode */
510 if((schedEnbCfg->accsMode < RGR_CELL_ACCS_OPEN) ||
511 (schedEnbCfg->accsMode > RGR_CELL_ACCS_HYBRID))
513 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Invalid CSG Access mode\n"));
517 errInfo->errCause = RGSCHERR_NONE;
518 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR SCHED ENB config validation done:"\n));
521 } /* rgSCHCfgVldtRgrSchedEnbCfg */
524 * @brief Validates the cell configuration request from RRM to MAC.
528 * Function : rgSCHCfgVldtRgrCellCfg
531 * - Retrieve the cell control block.
533 * - Validate the range of configured values recieved in
534 * configuration request.
535 * - If validated successfully,
536 * - Return ROK and pointer to the cell.
539 * - Else return RFAILED.
540 * @param[in] Inst inst
541 * @param[in] RgrCellCfg *cellCfg
542 * @param[out] RgSchCellCb **cell
543 * @param[out] RgSchErrInfo *errInfo
548 S16 rgSCHCfgVldtRgrCellCfg
553 RgSchErrInfo *errInfo
556 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_CFG;
558 /* check if cell exists already */
559 if ((uint8_t *)cell != NULLP)
561 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Cell Id already exists");
565 if(cellCfg->macInst >= SCH_INST_START)
567 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid MAC Instance %d ",
572 if (cellCfg->macRnti.startRnti < RGSCH_MIN_MAC_RNTI )
574 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid start RNTI %d for cell ",
575 cellCfg->macRnti.startRnti);
579 if ((rgSCHCfgVldtRgrCellSchCfg(inst, cellCfg)) != ROK)
581 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for scheduler related "
586 if ((cellCfg->dlHqCfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
587 (cellCfg->dlHqCfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX))
589 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid Downlink HARQ configuration:"
590 " maxDlHqTx %d maxMsg4HqTx %d", cellCfg->dlHqCfg.maxDlHqTx,
591 cellCfg->dlHqCfg.maxMsg4HqTx);
594 if ((cellCfg->cfiCfg.cfi < RGSCH_MIN_CFI_VAL) ||
595 (cellCfg->cfiCfg.cfi > RGSCH_MAX_CFI_VAL))
597 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid CFI configuration %d",
598 cellCfg->cfiCfg.cfi);
601 if (((cellCfg->puschSubBand.subbandStart) +
602 ((cellCfg->puschSubBand.numSubbands -1) * cellCfg->puschSubBand.size))
603 > (cellCfg->bwCfg.ulTotalBw - 1))
605 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid PUSCH subband configuration:"
606 " subBandStart %d numSubBands %d subBandSize %d ulTotBw %d",
607 cellCfg->puschSubBand.subbandStart,
608 cellCfg->puschSubBand.numSubbands, cellCfg->puschSubBand.size,
609 cellCfg->bwCfg.ulTotalBw);
613 if (((cellCfg->bwCfg.dlTotalBw < RGSCH_MIN_DL_BW) ||
614 (cellCfg->bwCfg.dlTotalBw > RGSCH_MAX_DL_BW)) ||
615 ((cellCfg->bwCfg.ulTotalBw < RGSCH_MIN_UL_BW) ||
616 (cellCfg->bwCfg.ulTotalBw > RGSCH_MAX_UL_BW)))
618 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid Bandwidth configuration:"
619 " ul %d dl %d",cellCfg->bwCfg.ulTotalBw,
620 cellCfg->bwCfg.dlTotalBw);
623 if (cellCfg->phichCfg.ngEnum > RGR_NG_TWO)
625 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid PHICH Ng configuration %d",
626 (uint8_t)cellCfg->phichCfg.ngEnum);
629 /* Validation for extended PHICH Duration */
630 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
631 (cellCfg->bwCfg.dlTotalBw <= 10) && (cellCfg->cfiCfg.cfi < 2))
633 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid cfi value for"
634 "Extended PHICH duration cfi:%d dlBw:%d",
635 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
638 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
639 (cellCfg->bwCfg.dlTotalBw > 10) && (cellCfg->cfiCfg.cfi < 3))
641 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid cfi value for"
642 "Extended PHICH duration cfi:%d dlBw:%d",
643 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
646 RLOG4(L_INFO,"CA_DBG:: PUCCH configuration:"
647 " N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
648 cellCfg->pucchCfg.resourceSize,
649 cellCfg->pucchCfg.n1PucchAn,
650 cellCfg->pucchCfg.deltaShift,
651 cellCfg->pucchCfg.cyclicShift);
653 /* ccpu00138567- Removing validation check for resourceSize as 0.
654 * From the spec, n2RB value 0 is a valid config. */
655 if ((cellCfg->pucchCfg.resourceSize >= cellCfg->bwCfg.ulTotalBw/2) ||
656 (cellCfg->pucchCfg.n1PucchAn == 0) ||
657 (cellCfg->pucchCfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
658 (cellCfg->pucchCfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS) ||
659 (cellCfg->pucchCfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
661 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid 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);
669 if (cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsBwEnum > RGR_SRS_BWCFG_7)
671 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid SRS configuration: "
672 " srsBw %d", (uint8_t)cellCfg->srsCfg.srsBwEnum);
676 if ((rgSCHCfgVldtRgrCellRACfg(inst, cellCfg)) != ROK)
678 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for Random access related"
683 if ((rgSCHCfgVldtRgrCellPwrCfg(inst, cellCfg, errInfo)) != ROK)
685 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for cell power "
690 /* Validate the common logical channel configuration */
691 if( (cellCfg->numCmnLcs < RGR_MIN_CMN_LC_PER_CELL)||
692 (cellCfg->numCmnLcs > RGR_MAX_CMN_LC_PER_CELL))
694 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid number(%d) of common logical"
695 "channels in cell config", cellCfg->numCmnLcs);
698 if ((rgSCHCfgVldtRgrCmnLcCfg(inst, cellCfg, errInfo)) != ROK)
700 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for common logical"
705 /* Added 0 as a valid value for number of TICKs RRM
706 * 0 implies no ticks i.e. shutting off the feature.*/
709 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellCfg->siCfg))) != ROK)
711 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for SI"
712 "configuration failed");
715 #endif /*RGR_SI_SCH */
717 /*ccpu00116923 - ADD - Srs Present support - Start*/
720 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 13)
722 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 14)
725 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid"
726 "Subframe configuration");
730 /*ccpu00116923 - ADD - Srs Present support - End*/
732 if ((cellCfg->bcchTxPwrOffset > 10000) ||
733 (cellCfg->pcchTxPwrOffset > 10000) ||
734 (cellCfg->rarTxPwrOffset > 10000) ||
735 (cellCfg->phichTxPwrOffset > 10000)
738 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
739 "Invalid txPower offset ");
743 /* LTE_ADV_FLAG_REMOVED_START */
744 /* Checking Whether DSFR is enabled without enabling SFR */
745 if(((cellCfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
746 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.dsfrCfg.status)) &&
747 (!((cellCfg->rgrLteAdvCfg.pres & RGR_SFR) &&
748 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.sfrCfg.status))))
750 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "DSFR is enbaled"
751 "Without enabling SFR");
755 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellCfg->rgrLteAdvCfg),
756 cellCfg->bwCfg.dlTotalBw)) != ROK)
758 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for LTE Adv"
759 "configuration failed");
763 if ((rgSCHCfgVldtRgrCellLteLAACfg(inst, cellCfg)) != ROK)
765 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Validation for LTE LAA"
766 "configuration failed");
770 /* LTE_ADV_FLAG_REMOVED_END */
771 if (cellCfg->msg4pAVal > RGRUE_DLPWRCNTRL_PA_DB3)
773 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId, "Invalid"
774 "msg4pAVal %u", cellCfg->msg4pAVal);
778 /* Validate RgrCellCsgParamCfg */
779 if(rgSchCb[inst].rgrSchedEnbCfg.accsMode == RGR_CELL_ACCS_HYBRID)
781 if((rgSCHCfgVldtRgrCellCsgParamCfg(inst,
782 &(cellCfg->csgParamCfg)) != ROK))
784 RGSCHDBGERR(inst, (rgSchPBuf(inst), "Validation failed for \n"
785 "Access CSG parameter failed\n"));
790 if (cellCfg->emtcEnable)
792 if(ROK != rgSCHCfgVldtRgrEmtcCellCfg(cellCfg))
794 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid EMTC cell Configuration %d for cell" ,cellCfg->cellId);
799 errInfo->errCause = RGSCHERR_NONE;
801 } /* rgSCHCfgVldtRgrCellCfg */
804 * @brief Validates the scheduler related configuration request from RRM to MAC.
808 * Function : rgSCHCfgVldtRgrSchCfg
811 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
812 * validate the value range for the configured values.
813 * - If validated successfully,
818 * @param[in] Inst inst
819 * @param[out] RgSchedCfg *rgSchedCfg
824 S16 rgSCHCfgVldtRgrSchCfg
827 RgrSchedEnbCfg *rgSchedCfg
830 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Validating \
831 scheduler related Configuration"));
832 if (rgSchedCfg->ulSchdType > (RGSCH_NUM_SCHEDULERS - 1))
834 RGSCHDBGERR(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Invalid \
835 UL scheduler type %d \n", rgSchedCfg->ulSchdType));
838 if (rgSchedCfg->dlSchdType > (RGSCH_NUM_SCHEDULERS - 1))
840 RGSCHDBGERR(inst, (rgSchPBuf(inst), "rgSCHCfgVldtRgrSchCfg:Invalid \
841 DL scheduler type %d \n", rgSchedCfg->dlSchdType));
847 * @brief Validates the scheduler related configuration request from RRM to MAC.
851 * Function : rgSCHCfgVldtRgrCellSchCfg
854 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
855 * validate the value range for the configured values.
856 * - If validated successfully,
857 * - Return ROK and pointer to the cell of UE.
861 * @param[in] Inst inst
862 * @param[out] RgSchCellCfg *cellCfg
867 S16 rgSCHCfgVldtRgrCellSchCfg
874 #if RGSCH_NUM_DLFS_SCHEDULERS
875 if (cellCfg->dlfsSchdType > RGSCH_NUM_DLFS_SCHEDULERS - 1)
877 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid dlfs scheduler type %d for cell",
878 cellCfg->dlfsSchdType);
885 * @brief Validates the RACH related configuration request from RRM to MAC.
889 * Function : rgSCHCfgVldtRgrCellRACfg
892 * - Validate the RA configuration request from RRC to MAC at CFG:
893 * validate the value range for the configured values.
894 * - If validated successfully,
895 * - Return ROK and pointer to the cell of UE.
899 * @param[in] Inst inst
900 * @param[out] RgSchCellCfg *cellCfg
905 S16 rgSCHCfgVldtRgrCellRACfg
913 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_TDD_RA_PREAMBLE_FMT) ||
915 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
917 (cellCfg->rachCfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
918 (cellCfg->rachCfg.raWinSize > RGSCH_MAX_RA_WINSIZE) ||
919 (cellCfg->rachCfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
920 (cellCfg->rachCfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE) ||
921 (cellCfg->rachCfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE) ||
922 (cellCfg->rachCfg.sizeRaPreambleGrpA >
923 cellCfg->rachCfg.numRaPreamble) ||
924 (cellCfg->rachCfg.prachResource >
925 (cellCfg->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB)))
927 RLOG_ARG3(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid RACH configuration:"
928 "preamble Fmt %d raWinSize %d maxMsg3Tx %d",
929 cellCfg->rachCfg.preambleFormat, cellCfg->rachCfg.raWinSize,
930 cellCfg->rachCfg.maxMsg3Tx);
931 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid numRaPreamble %d sizeRaPreambleGrpA %d",
932 cellCfg->rachCfg.numRaPreamble,
933 cellCfg->rachCfg.sizeRaPreambleGrpA);
937 /* verify that the ded Preambles cfgd for Pdcch Order
938 * do not collide with that of non-dedicated and validates against
939 * the configuration index and number of RACH
940 * ded-preambles. For non-zero ded preamble cfg,
941 * the config index is expected to be != NA.*/
942 if ((cellCfg->macPreambleSet.pres) &&
943 ((cellCfg->macPreambleSet.start < cellCfg->rachCfg.numRaPreamble) ||
944 (cellCfg->macPreambleSet.start >= RGSCH_MAX_NUM_RA_PREAMBLE) ||
945 (cellCfg->macPreambleSet.size < 1) ||
946 (cellCfg->macPreambleSet.size > RGSCH_MAX_NUM_RA_PREAMBLE-
947 cellCfg->rachCfg.numRaPreamble) ||
948 (cellCfg->rachCfg.raOccasion.sfnEnum == RGR_SFN_NA)))
950 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId,"Invalid RACH Preambleset conf:"
951 "preambleSet Start %d preambleSet Size %d",
952 cellCfg->macPreambleSet.start, cellCfg->macPreambleSet.size);
956 if(cellCfg->rachCfg.contResTmr)
960 idx = cellCfg->ulDlCfgIdx;
964 /* maxMsg4TxDelay = (HARQ_RTT * MAX_MSG4_HARQ_RETX) +
965 3 TTI (MAX L1+L2 processing delay at the UE) */
966 uint8_t maxMsg4TxDelay = (cellCfg->dlHqCfg.maxMsg4HqTx-1) *
967 rgSchCmnHarqRtt[idx] + 3;
970 if(maxMsg4TxDelay >= cellCfg->rachCfg.contResTmr)
972 RLOG_ARG2(L_WARNING,DBG_CELLID,cellCfg->cellId ,
973 "Warining !: Contention Resolution timer not greater than the "
974 "guard timer. Conte Res timer %d Guard timer %d",
975 cellCfg->rachCfg.contResTmr,
977 /* [ccpu00138532]-DEL- removed return fail here as it is ok if the
978 max Msg4 Tx delay is more than the contension Resolution timer.
979 In such case, the CRI CE will be scheduled immediately once
985 /* ccpu00128575 ADD - If contention resolution timer is configured as 0,
987 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
988 "Contention Resolution timer is configured as '0'");
997 * @brief Validates the UE configuration request from RRM to MAC.
1001 * Function : rgSCHCfgVldtRgrUeCfg
1004 * - Validate the UE configuration request from RRC to MAC at CFG:
1005 * validate the value range for the configured values.
1006 * - If validated successfully,
1007 * - Return ROK and pointer to the cell of UE.
1011 * @param[in] Inst inst
1012 * @param[in] RgrUeCfg *ueCfg
1013 * @param[out] RgSchCellCb **cell
1014 * @param[out] RgSchErrInfo *errInfo
1019 S16 rgSCHCfgVldtRgrUeCfg
1024 RgSchErrInfo *errInfo
1027 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_CFG;
1029 if (((*cell) == NULLP) ||
1030 ((*cell)->cellId != ueCfg->cellId))
1032 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Cell does not exist %d",
1037 * Check configured preamble id not colliding with non dedicated or PDCCH
1038 * order preamble sets. When valid preamble id given check that C-RNTI given
1039 * in configuration is not amongst the C-RNTI'smanaged by scheduler */
1040 if ((rgSCHRamVldtUeCfg(*cell, ueCfg)) != ROK)
1042 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Preamble Id configuration"
1043 "failed ",ueCfg->cellId);
1046 /* Check if Ue already configured */
1047 if (rgSCHDbmGetUeCb(*cell, ueCfg->crnti) != NULLP)
1049 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d UEID already exists",
1053 /* Validate Transmission UE modes */
1054 if ((ueCfg->txMode.pres == TRUE) && ((ueCfg->txMode.txModeEnum < RGR_UE_TM_1)
1055 || (ueCfg->txMode.txModeEnum > RGR_UE_TM_7)))
1057 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1058 " UE is %d", ueCfg->cellId,(uint8_t)ueCfg->txMode.txModeEnum);
1062 /* Validate UE Category */
1063 if (ueCfg->ueCatEnum > CM_LTE_UE_CAT_8)
1065 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid category for UE %d",
1066 ueCfg->cellId,(uint8_t)ueCfg->ueCatEnum);
1070 /* Validate UE Access Stratum Release */
1071 if (ueCfg->accessStratumRls > RGR_REL_10)
1073 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
1074 ueCfg->accessStratumRls));
1077 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
1078 ueCfg->accessStratumRls));
1080 if ((*cell)->numTxAntPorts == 1)
1082 if ((ueCfg->txMode.pres == TRUE) &&
1083 (ueCfg->txMode.txModeEnum > RGR_UE_TM_1))
1085 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1086 " UE (%d) for the configured Cell Antenna Ports",ueCfg->cellId,
1087 (uint8_t)ueCfg->txMode.txModeEnum);
1092 if ((rgSCHCfgVldtUeCqiModeCfg(*cell, &ueCfg->ueDlCqiCfg)) != ROK)
1094 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti, "CELLID:%d Invalid CQI Mode configuration",
1099 /* Validate Max Uplink HARQ transmission value */
1100 if (ueCfg->ueUlHqCfg.maxUlHqTx < RGSCH_MIN_HQ_TX)
1102 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Uplink HARQ config for "
1103 "UE %d",ueCfg->cellId,ueCfg->ueUlHqCfg.maxUlHqTx);
1107 if (rgSCHCfgVldtUePwrCfg(*cell, &ueCfg->ueUlPwrCfg) != ROK)
1109 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid PUSCH Group power"
1110 " configuration",ueCfg->cellId);
1114 if (rgSCHCfgVldtUeMeasGapAckNakRepCfg(*cell, ueCfg) != ROK)
1116 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid MeasGap/AckNackRep"
1117 " configuration",ueCfg->cellId);
1122 /* Validating SPS RNTI */
1123 if (((ueCfg->ueSpsCfg.spsRnti >= (*cell)->rntiDb.rntiStart) &&
1124 (ueCfg->ueSpsCfg.spsRnti<=((*cell)->rntiDb.rntiStart+(*cell)->rntiDb.maxRntis)))
1125 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_SI_RNTI)
1126 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_P_RNTI))
1128 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid SPS RNTI "
1129 " in DL SPS Config",ueCfg->cellId);
1133 if (ueCfg->ueSpsCfg.dlSpsCfg.isDlSpsEnabled)
1135 if (rgSCHCfgVldtUeDlSpsCfg(*cell, &ueCfg->ueSpsCfg.dlSpsCfg) != ROK)
1137 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DL SPS configuration"
1138 " for the UE",ueCfg->cellId);
1144 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
1145 if ( ROK != rgSCHCfgVldtCqiSrSrsUeCfg(*cell, ueCfg, errInfo))
1147 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Periodic CQI/SR/SRS"
1148 "configuration",ueCfg->cellId);
1153 /* Validate DRX specific parameters */
1154 if ( ROK != rgSCHCfgVldtDrxUeCfg(*cell, &(ueCfg->ueDrxCfg)))
1156 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DRX configuration",
1161 /* ccpu00117452 - MOD - Changed macro name from
1162 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1164 if (ueCfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
1166 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid numColltdCqiRept,"
1167 "MAX supported %d",RGR_CQIRPTS_MAXN,ueCfg->cellId);
1170 #endif /* End of RGR_CQI_REPT */
1173 /*This is to validate the EMTC related configuration if a UE is an EMTC UE*/
1174 if(TRUE == ueCfg->emtcUeCfg.pres)
1176 if ( ROK != rgSCHCfgVldtEmtcUeCfg(*cell, &(ueCfg->emtcUeCfg)))
1178 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
1179 ueCfg->cellId, ueCfg->crnti);
1184 errInfo->errCause = RGSCHERR_NONE;
1186 } /* rgSCHCfgVldtRgrUeCfg */
1190 * @brief Validates the cell reconfiguration request from RRM to MAC.
1194 * Function : rgSCHCfgVldtRgrCellRecfg
1197 * - Retrieve the cell control block.
1199 * - Validate the range of reconfigured values recieved in
1200 * re-configuration request.
1201 * - If validated successfully,
1202 * - Return ROK and pointer to the cell.
1205 * - Else return RFAILED.
1207 * @param[in] Inst inst
1208 * @param[in] RgrCellRecfg *cellRecfg
1209 * @param[out] RgSchCellCb **cell
1210 * @param[out] RgSchErrInfo *errInfo
1215 S16 rgSCHCfgVldtRgrCellRecfg
1218 RgrCellRecfg *cellRecfg,
1220 RgSchErrInfo *errInfo
1224 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_RECFG;
1226 /* Fetch cell and validate cell Id with the cell control block*/
1227 if (((*cell) == NULLP) ||
1228 ((*cell)->cellId != cellRecfg->cellId))
1230 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Cell control block does not exist");
1234 /* Validate recieved values */
1235 if ((cellRecfg->recfgTypes & RGR_CELL_DL_HARQ_RECFG) &&
1236 ((cellRecfg->dlHqRecfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
1237 (cellRecfg->dlHqRecfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX)))
1239 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Downlink HARQ configuration:"
1240 " maxDlHqTx %d maxMsg4HqTx %d", cellRecfg->dlHqRecfg.maxDlHqTx,
1241 cellRecfg->dlHqRecfg.maxMsg4HqTx);
1244 if ((cellRecfg->recfgTypes & RGR_CELL_CFI_RECFG) &&
1245 ((cellRecfg->cfiRecfg.cfi < RGSCH_MIN_CFI_VAL) ||
1246 (cellRecfg->cfiRecfg.cfi > RGSCH_MAX_CFI_VAL)))
1248 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid CFI configuration %d",
1249 cellRecfg->cfiRecfg.cfi);
1252 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
1254 /* ccpu00138567- Removing validation check for resourceSize as 0.
1255 * From the spec, n2RB value 0 is a valid config. */
1256 if ((cellRecfg->pucchRecfg.n1PucchAn == 0) ||
1257 (cellRecfg->pucchRecfg.resourceSize >= (*cell)->bwCfg.ulTotalBw/2)||
1258 ((cellRecfg->pucchRecfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
1259 (cellRecfg->pucchRecfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS)) ||
1260 (cellRecfg->pucchRecfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
1262 RLOG_ARG4(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid PUCCH configuration: "
1263 "N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
1264 cellRecfg->pucchRecfg.resourceSize,
1265 cellRecfg->pucchRecfg.n1PucchAn,
1266 cellRecfg->pucchRecfg.deltaShift,
1267 cellRecfg->pucchRecfg.cyclicShift);
1271 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
1273 if (cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsBwEnum > RGR_SRS_BWCFG_7)
1275 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid SRS configuration: "
1276 "srsBw %d", (uint8_t)cellRecfg->srsRecfg.srsBwEnum);
1280 /*ccpu00116923 - ADD - Srs Present support - Start*/
1283 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 13)
1285 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 14)
1288 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Subframe configuration ");
1292 /*ccpu00116923 - ADD - Srs Present support - End*/
1294 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
1296 if ((cellRecfg->rachRecfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
1297 ((cellRecfg->rachRecfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
1298 (cellRecfg->rachRecfg.raWinSize > RGSCH_MAX_RA_WINSIZE)) ||
1299 (cellRecfg->rachRecfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
1300 ((cellRecfg->rachRecfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE)
1301 || (cellRecfg->rachRecfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE))
1302 || (cellRecfg->rachRecfg.sizeRaPreambleGrpA >
1303 cellRecfg->rachRecfg.numRaPreamble) ||
1304 (cellRecfg->rachRecfg.prachResource >
1305 (*cell)->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB))
1307 RLOG_ARG3(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1308 " preamble Fmt %d raWinSize %d maxMsg3Tx %d",
1309 cellRecfg->rachRecfg.preambleFormat,
1310 cellRecfg->rachRecfg.raWinSize,
1311 cellRecfg->rachRecfg.maxMsg3Tx);
1312 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1313 "numRaPreamble %d sizeRaPreambleGrpA %d",
1314 cellRecfg->rachRecfg.numRaPreamble,
1315 cellRecfg->rachRecfg.sizeRaPreambleGrpA);
1321 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
1323 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellRecfg->siReCfg))) != ROK)
1325 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for SI"
1326 "Re-configuration failed");
1330 #endif /*RGR_SI_SCH */
1332 /* LTE_ADV_FLAG_REMOVED_START */
1333 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
1335 /* Checkin whether DSFR is enbaled without enabling SFR.
1336 * So we need to check if SFR is enabled along with DSFR
1337 * in the same reconfiguration or it is already enabled earlier*/
1338 if((cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
1339 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.dsfrCfg.status))
1341 if(!(((cellRecfg->rgrLteAdvCfg.pres & RGR_SFR) &&
1342 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.sfrCfg.status)) ||
1343 ((*cell)->lteAdvCb.sfrCfg.status == RGR_ENABLE)))
1345 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"DSFR is enbaled"
1346 "Without enabling SFR");
1350 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellRecfg->rgrLteAdvCfg),
1351 (*cell)->bwCfg.dlTotalBw)) != ROK)
1353 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for Lte Adv"
1354 "Re-configuration failed");
1358 /* LTE_ADV_FLAG_REMOVED_END */
1360 /* Validating minimum resource for non-CSG users */
1361 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
1363 if (cellRecfg->csgParamCfg.minDlResNonCsg > 100)
1365 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1366 "of minimum DL resources for NON-CSG");
1369 if (cellRecfg->csgParamCfg.minUlResNonCsg > 100)
1371 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1372 "of minimum UL resources for NON-CSG");
1376 errInfo->errCause = RGSCHERR_NONE;
1378 } /* rgSCHCfgVldtRgrCellRecfg */
1382 * @brief Ue SCell configuration for scheduler. It is invoked during first time
1383 * Scell configuration. It is not for reconfiguration
1387 * Function : rgSCHSCellCfgUeCfg
1389 * This functions updates UE specific scheduler
1390 * information upon UE SCell first time Scell configuration
1392 * @param[in] RgSchCellCb *cell
1393 * @param[in] RgSchUeCb *ue
1394 * @param[int] RgrUeRecfg *ueRecfg
1395 * @param[out] RgSchErrInfo *err
1400 S16 rgSCHSCellCfgUeCfg
1404 RgrUeRecfg *ueRecfg,
1409 Inst inst = cell->instIdx;
1410 RgSchCellCb *secCellCb = NULLP;
1411 uint8_t sCellidx = 0;
1412 RgSchUeCellInfo *sCellInfo = NULLP;
1413 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1415 RgrUeAprdDlCqiCfg *aCqiCfg;
1416 RgrUePrdDlCqiCfg *pCqiCfg;
1419 RLOG0(L_INFO, "SCELL recfg received from APP \n");
1421 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1422 "--------------------------------------------------------------------\n"
1423 "UE SCell ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1424 "--------------------------------------------------------------------\n",
1425 ue->ueId, cell->cellId));
1428 for(idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1430 /* Allocate the Ue control block */
1431 if (((rgSCHUtlAllocSBuf(inst, (Data **)&sCellInfo,
1432 sizeof(RgSchUeCellInfo))) != ROK))
1434 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx :Memomy allocation "
1435 "Failed while Adding SCell Information\n", idx));
1440 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1443 sCellInfo->sCellIdx = sCellInfoCfg->sCellIdx;
1444 sCellInfo->sCellId = sCellInfoCfg->sCellId;
1446 if(PRSNT_NODEF == sCellInfoCfg->sCellDeActTmr.pres)
1448 /* Configure implicit release */
1449 ue->sCellDeactTmrVal.val = sCellInfoCfg->sCellDeActTmr.val;
1450 ue->isScellExplicitDeAct = FALSE;
1451 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1453 else if (rgSchCb[cell->instIdx].genCfg.isSCellActDeactAlgoEnable == TRUE)
1455 /* Configure explicit release */
1456 ue->sCellDeactTmrVal.val = RGSCH_SCELL_DEACT_TMR_INFINITY_VAL;
1457 ue->isScellExplicitDeAct = TRUE;
1458 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1462 ue->sCellDeactTmrVal.val = 0;
1463 ue->isScellExplicitDeAct = FALSE;
1464 ue->sCellDeactTmrVal.pres = NOTPRSNT;
1467 sCellInfo->sCellState = RG_SCH_SCELL_INACTIVE;
1470 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = sCellInfo;
1471 sCellidx = ((sCellInfo->sCellId -
1472 rgSchCb[cell->instIdx].genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
1473 ue->cellIdToCellIdxMap[sCellidx] = sCellInfo->sCellIdx;
1475 /* For for time one Scell got added, setting allocCmnUlPdcch flag to TRUE, So that
1476 we will allocate PDCCH from common search space and the csiRequest field in DCI0 will
1477 be one bit (spec 36.213 sec 7.2.1)*/
1479 if ( ue->numSCells == 0)
1481 ue->allocCmnUlPdcch = TRUE;
1486 printf("\n SCell added for ue %d numScells %d\n",ue->ueId,ue->numSCells);
1488 /* retrieve teh sec cell Cb */
1489 if((secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, sCellInfo->sCellId)) == NULLP)
1491 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCell doesnt exists"));
1492 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1496 if(TRUE == sCellInfoCfg->txMode.pres)
1498 sCellInfo->txMode = sCellInfoCfg->txMode;
1502 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx Tx mode not present ",idx));
1503 sCellInfoCfg->txMode.pres = TRUE;
1504 sCellInfoCfg->txMode.txModeEnum = RGR_UE_TM_1;
1506 sCellInfo->txMode = sCellInfoCfg->txMode;
1508 cmInitTimers (&sCellInfo->actDelayTmr, 1);
1509 cmInitTimers (&sCellInfo->deactTmr, 1);
1511 ue->f1bCsAVal += rgSCHUtlGetMaxTbSupp(sCellInfo->txMode.txModeEnum);
1514 if(TRUE == sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.pres)
1516 sCellInfo->acqiCb.aCqiCfg.aprdModeEnum =
1517 sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.aprdModeEnum;
1520 if(TRUE == sCellInfoCfg->uePdschDedCfg.uepACfg.pAPrsnt)
1522 sCellInfo->pA.pres = TRUE;
1523 sCellInfo->pA.val = sCellInfoCfg->uePdschDedCfg.uepACfg.pA;
1527 sCellInfo->pA.pres = FALSE;
1530 aCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg;
1531 RGSCHDBGPRM(cell->instIdx, (rgSchPBuf(cell->instIdx),
1532 "rgSCHCfgACqiUeCfg cellId =%d,Config Presence =%d for \
1533 Sec Cell Id = %d\n",
1534 cellCb->cellId, aCqiCfg->pres,sCellInfo->sCellId));
1536 /* if aperiodic cqi is present then only call the below function as it is
1540 if( ROK != rgSCHCfgACqiUeCfg(secCellCb,ue, &sCellInfo->acqiCb,
1541 sCellInfo->txMode.txModeEnum, aCqiCfg, ue->ueCatEnum))
1543 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx ACQI Cfg"
1544 "failed..n\n", idx));
1545 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1549 /* Configuring PCQI */
1550 /* Scell needs to be added to the
1551 * pcqi list only after activation */
1552 pCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.prdCqiCfg;
1554 if(ROK != rgSCHSCellPCqiCfg(cell,secCellCb,ue,pCqiCfg,
1555 ue->ueCatEnum,sCellInfoCfg->sCellIdx))
1557 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx PCQI Cfg failed..n\n", idx));
1558 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1563 /* Configuring ACQI */
1565 /* Stroing the secCell for easy access */
1566 sCellInfo->cell = secCellCb;
1570 if (ROK != rgSCHLaaInitDlRbAllocCb(secCellCb,
1571 &sCellInfo->dlAllocCb))
1576 /* Initialize Harq entity */
1578 sCellInfo->hqEnt = rgSCHDhmHqEntInit(secCellCb);
1579 if (sCellInfo->hqEnt == NULLP)
1581 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UEID:Hq Entity Initialization "
1582 "failed in config\n", ue->ueId));
1583 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1587 rgSCHEmtcHqPAlloc(secCellCb, sCellInfo->hqEnt);
1589 rgSCHCmnDlInitHqEnt(secCellCb, sCellInfo->hqEnt);
1591 sCellInfo->hqEnt->ue = ue;
1592 /* Init SCell Specific Sched Spfc UE DL CB */
1593 if ((secCellCb->sc.apis->rgSCHRgrSCellUeCfg(secCellCb, ue, sCellInfoCfg, err)) != ROK)
1595 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Spec Sched DL UE CFG FAILED\n"));
1596 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1601 if((rgSCHUtlAllocUeANFdbkInfo(ue,sCellInfoCfg->sCellIdx)) != ROK)
1603 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UEID:Memomy allocation "
1604 "Failed while UE related Ack Nack Information\n",
1606 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1609 #endif /* LTE_TDD */
1612 sCellInfo->sCellLnk.node = (PTR)sCellInfo;
1613 cmLListAdd2Tail(&secCellCb->sCellUeLst, &sCellInfo->sCellLnk);
1616 /* Inserting UECB into SCELL DBM */
1617 rgSCHDbmInsUeCb(secCellCb, ue);
1620 #ifndef MAC_5GTF_UPDATE
1621 ue->ul.useExtBSRSizes = ueRecfg->ueSCellCfgInfo.useExtBSRSizes;
1623 ue->ul.useExtBSRSizes = TRUE;
1626 for (idx = 0; idx < RGSCH_ULCTRL_RECP_DIST; idx++)
1628 ue->ul.ctrlOnServCellIdx[idx] = 0xFF;
1630 /* Trigger SCell addition to primary MAC */
1633 } /* rgSCHSCellCfgUeCfg */
1636 * @brief UE SCell PUCCH reconfiguration for scheduler
1640 * Function : rgSCHSCellCfgUePucchReCfg
1642 * This functions updates UE specific scheduler
1643 * information upon UE SCell PUCCH reconfiguration
1645 * @param[in] RgSchCellCb *cell
1646 * @param[in] RgSchUeCb *ue
1647 * @param[int] RgrUeRecfg *ueRecfg
1648 * @param[out] RgSchErrInfo *err
1653 S16 rgSCHSCellCfgUePucchReCfg
1657 RgrUeRecfg *ueRecfg,
1661 Inst inst = cell->instIdx;
1662 RgrUeSCellAckPucchCfg *sCellPucchRecfg = NULLP;
1665 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1666 "--------------------------------------------------------------------\n"
1667 "UE SCell PUCCH ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1668 "--------------------------------------------------------------------\n",
1669 ue->ueId, cell->cellId));
1672 sCellPucchRecfg = &ueRecfg->sCellAckN1ResCfg;
1673 /* Copy the UCI format type suported/configured for UE */
1674 ue->uciFrmtTyp = sCellPucchRecfg->pucchFormatType;
1676 if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
1678 ue->n1PucchF1bResCb.cw1N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count;
1679 ue->n1PucchF1bResCb.cw2N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count;
1681 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count; idx++)
1683 ue->n1PucchF1bResCb.cw1N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1[idx];
1686 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count; idx++)
1688 ue->n1PucchF1bResCb.cw2N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2[idx];
1692 else if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT3)
1694 ue->n3PucchResCb.antP0N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0Count;
1695 ue->n3PucchResCb.antP1N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1Count;
1696 for (idx = 0;idx < ue->n3PucchResCb.antP0N3ResCount; idx++ )
1698 ue->n3PucchResCb.antP0N3Res[idx].n3PucchIdx
1699 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0[idx];
1700 ue->n3PucchResCb.antP0N3Res[idx].n3Lnk.node = NULLP;
1701 ue->n3PucchResCb.antP0N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1703 for (idx = 0;idx < ue->n3PucchResCb.antP1N3ResCount; idx++ )
1705 ue->n3PucchResCb.antP1N3Res[idx].n3PucchIdx
1706 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1[idx];
1707 ue->n3PucchResCb.antP1N3Res[idx].n3Lnk.node = NULLP;
1708 ue->n3PucchResCb.antP1N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1710 ue->simulAckNackCQIFormat3 = ueRecfg->simulAckNackCQIFormat3;
1715 RLOG1(L_ERROR,"Wrong PUCCH Format:%d configured for CA",ue->uciFrmtTyp);
1720 } /* rgSCHSCellCfgUePucchReCfg */
1722 * @brief Validates the UE SCell Reconfiguration request from APP to SCH.
1726 * Function : rgSCHCfgVldtRgrUeSCellRecfg
1729 * - Validate Number of SCells
1730 * - If validated successfully,
1731 * - Process Number of SCells
1734 * - Validate SCellIdx value,
1735 * - If validated successfully,
1736 * - Process Number of RgrUeSecCellCfg
1740 * @param[in] RgrUeRecfg *ueRecfg
1741 * @param[out] RgSchCellCb *cell
1742 * @param[out] RgSchUeCb *ue
1743 * @param[out] RgSchErrInfo *errInfo
1748 S16 rgSCHCfgVldtRgrUeSCellRecfg
1750 RgrUeRecfg *ueRecfg,
1753 RgSchErrInfo *errInfo
1756 RgrUeSecCellCfg *ueSCellDedCfg = NULLP;
1757 RgSchCellCb *sCell = NULLP;
1758 Inst inst = cell->instIdx;
1761 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "VALIDATE RGR UE SCELL RECONFIG: cellId %d "
1762 "oldUeId %d cell %p \n", ueRecfg->cellId, ueRecfg->oldCrnti));
1763 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
1765 if((ueRecfg->ueSCellCfgInfo.numSCells > RGR_MAX_SCELL_PER_UE) ||
1766 (ueRecfg->ueSCellCfgInfo.numSCells < 1))
1768 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid number of SCELL "
1769 " in SCELL Recfg\n"));
1773 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1775 ueSCellDedCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1776 if(ROK != rgSchUtlVldtCellId(inst, ueSCellDedCfg->sCellId))
1778 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCellId is out of range"));
1781 /* Validate existence of sec cell */
1782 sCell = rgSchUtlGetCellCb(inst, ueSCellDedCfg->sCellId);
1785 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCell doesnt exists"));
1789 /* validate the range of serv cell index */
1790 if((ueSCellDedCfg->sCellIdx < 1) ||
1791 (ueSCellDedCfg->sCellIdx > RGR_MAX_SCELL_PER_UE))
1793 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid Serv Cell Idx %d\n",
1794 ueSCellDedCfg->sCellIdx));
1798 /* Is this sec cell alredy confiured */
1799 if(NULLP != ue->cellInfo[ueSCellDedCfg->sCellIdx])
1801 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Secll with id %d already added\n",
1802 ueSCellDedCfg->sCellIdx));
1806 /* Validate CQI config params */
1807 if((rgSCHCfgVldtUeCqiModeCfg(sCell, &ueSCellDedCfg->ueSCellDlCqiCfg)) != ROK)
1809 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid CQI Mode "
1810 " configuration for Ue %d\n",ue->ueId));
1814 /* 1. Validate UE Aperiodic CQI related parameters */
1815 if( ROK != rgSCHCfgVldtRgrUeACqiCfg (sCell, ue->ueId,
1816 &ueSCellDedCfg->ueSCellDlCqiCfg.aprdCqiCfg, ueSCellDedCfg->txMode,
1819 RGSCHDBGERR(sCell->instIdx, (rgSchPBuf(sCell->instIdx),
1820 "rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Aperiodic CQI configuration\n"));
1825 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1826 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg, ueRecfg->isHdFddEnbld,
1827 ueSCellDedCfg->txMode, errInfo ))
1829 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1830 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg,
1831 ueSCellDedCfg->txMode,
1835 RGSCHDBGERR(sCell->instIdx, (rgSchPBuf(sCell->instIdx),
1836 "rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Periodic CQI configuration\n"));
1840 if((ueSCellDedCfg->txMode.txModeEnum < RGR_UE_TM_1) ||
1841 (ueSCellDedCfg->txMode.txModeEnum > RGR_UE_TM_9))
1843 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCELL Invalid transmission mode for"
1844 " UE %d\n", (uint8_t)ueSCellDedCfg->txMode.txModeEnum));
1850 errInfo->errCause = RGSCHERR_NONE;
1851 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR Ue SCell Reconfig validation done: "
1852 "cellId %d oldUeId %d\n", ueRecfg->cellId, ue->ueId));
1854 } /* rgSCHCfgVldtRgrUeSCellRecfg */
1857 * @brief Ue SCell configuration roll back due to failure during configuration
1862 * Function : rgSCHSCellCfgUeCfgRollBack
1864 * This functions roll backs the configuration of successfully added Scell
1866 * @param[in] RgSchCellCb *cell
1867 * @param[in] RgSchUeCb *ue
1868 * @param[int] RgrUeRecfg *ueRecfg
1869 * @param[out] RgSchErrInfo *err
1874 static S16 rgSCHSCellCfgUeCfgRollBack
1881 Inst inst = cell->instIdx;
1882 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1883 RgSchUeCellInfo *sCellInfo = NULLP;
1884 RgSchCmnCell *cellSch = NULLP;
1886 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1887 "--------------------------------------------------------------------\n"
1888 "UE SCell config roll back at SCH: rnti (%u) cell(%u)\n"
1889 "--------------------------------------------------------------------\n",
1890 ue->ueId, cell->cellId));
1892 /* Free all Added scell in this transaction */
1893 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1895 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1896 sCellInfo = ue->cellInfo[(sCellInfoCfg->sCellIdx)];
1898 /* if sCellInfo is not NULLP that means this Scell is added hence
1900 if (NULLP != sCellInfo)
1902 /* Clear Scheduler specific list for this UE from the
1903 * corresponding CELL */
1904 cellSch = RG_SCH_CMN_GET_CELL(sCellInfo->cell);
1905 cellSch->apisDl->rgSCHDlUeReset(sCellInfo->cell, sCellInfo->ue);
1907 /* Delete harq Entity of Scell*/
1908 rgSCHDhmDelHqEnt(cell, &(sCellInfo->hqEnt));
1910 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
1911 sizeof(RgSchUeCellInfo));
1913 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = NULLP;
1916 if (ue->numSCells == 0)
1918 ue->allocCmnUlPdcch = TRUE;
1919 /* As there is no SCell left so DCI 0 size at UE specific search space
1920 * will be recalculated as the CSI is reduced to 1 bit */
1921 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
1928 #endif /* LTE_ADV */
1930 * @brief Validates the UE reconfiguration request from RRC to MAC.
1934 * Function : rgSCHCfgVldtRgrUeRecfg
1937 * - Retrieve the UE control block.
1939 * - Validate the range of reconfigured values recieved in
1940 * re-configuration request.
1941 * - If validated successfully,
1942 * - Return ROK and pointer to the cell and ue.
1945 * - Else return RFAILED.
1947 * @param[in] Inst inst
1948 * @param[in] RgrUeRecfg *ueRecfg
1949 * @param[out] RgSchCellCb **cell
1950 * @param[out] RgSchUeCb **ue
1951 * @param[out] RgSchErrInfo *errInfo
1956 S16 rgSCHCfgVldtRgrUeRecfg
1959 RgrUeRecfg *ueRecfg,
1962 RgSchErrInfo *errInfo
1966 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RECFG;
1968 if (((*cell) == NULLP) ||
1969 ((*cell)->cellId != ueRecfg->cellId))
1971 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,
1972 "Cell does not exist for OLD CRNTI:%d",ueRecfg->oldCrnti);
1976 /* Fetch the Old Ue */
1977 if ((*ue = rgSCHDbmGetUeCb(*cell, ueRecfg->oldCrnti)) == NULLP)
1979 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"OLD CRNTI:%d does not exist",
1985 if(RGR_UE_SCELL_ADD_RECFG & ueRecfg->ueRecfgTypes)
1987 S16 ret = rgSCHCfgVldtRgrUeSCellRecfg(ueRecfg,*cell, *ue, errInfo);
1990 RGSCHDBGERR(inst,(rgSchPBuf(inst), "Ue SCell Recfg Validation FAILED\n"));
1993 errInfo->errCause = RGSCHERR_NONE;
1998 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
2000 if (rgSCHDbmGetUeCb(*cell, ueRecfg->newCrnti) != NULLP)
2002 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"NEW CRNTI:%d already exists",
2008 if ((ueRecfg->ueRecfgTypes & RGR_UE_CSG_PARAM_RECFG) &&\
2009 ((*ue)->csgMmbrSta == ueRecfg->csgMmbrSta))
2011 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE ID [%d] invalid CSG Membership reconfig :%d ",
2012 ueRecfg->newCrnti, (uint8_t)ueRecfg->csgMmbrSta);
2015 /* Validate values */
2016 if ((ueRecfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
2017 (ueRecfg->txMode.pres == TRUE) &&
2018 ((ueRecfg->txMode.txModeEnum < RGR_UE_TM_1) ||
2019 (ueRecfg->txMode.txModeEnum > RGR_UE_TM_7)))
2021 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid transmission mode %d"
2022 "for NEW CRNTI:%d", (uint8_t)ueRecfg->txMode.txModeEnum,ueRecfg->newCrnti);
2026 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2027 (((ueRecfg->prdDlCqiRecfg.k < 1) || (ueRecfg->prdDlCqiRecfg.k > 4)) ||
2028 ((ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx < 1) ||
2029 (ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx > 1024))))
2031 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid Periodic CQI INFO"
2032 "OLD CRNTI:%d NEW CRNTI:%d",(uint8_t)ueRecfg->oldCrnti,ueRecfg->newCrnti);
2036 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULHARQ_RECFG) &&
2037 (ueRecfg->ueUlHqRecfg.maxUlHqTx < RGSCH_MIN_HQ_TX))
2039 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid Uplink HARQ config %d"
2040 "for NEW CRNTI:%d", ueRecfg->ueUlHqRecfg.maxUlHqTx,ueRecfg->newCrnti);
2044 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2045 (ueRecfg->prdDlCqiRecfg.prdModeEnum > RGR_PRD_CQI_MOD21))
2047 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid periodic mode config for"
2048 " DL CQI %d NEW CRNTI:%d", (uint8_t)ueRecfg->prdDlCqiRecfg.prdModeEnum,ueRecfg->newCrnti);
2052 if ((ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG) &&
2053 (ueRecfg->cqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
2055 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid periodic mode config for "
2056 "DL CQI %d for NEW CRNTI:%d",(uint8_t)ueRecfg->cqiCfg.cqiSetup.prdModeEnum,ueRecfg->newCrnti);
2059 #endif /* TFU_UPGRADE */
2060 /* Validate UE Category */
2061 if (ueRecfg->ueCatEnum > CM_LTE_UE_CAT_8)
2063 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid category %d for NEW CRNTI:%d",
2064 (uint8_t)ueRecfg->ueCatEnum,ueRecfg->newCrnti);
2068 /* Validate UE Access Stratum Release */
2069 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
2070 (ueRecfg->accessStratumRls > RGR_REL_11))
2072 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
2073 ueRecfg->accessStratumRls));
2076 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
2077 ueRecfg->accessStratumRls));
2079 if ((ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG) &&
2080 ((ueRecfg->aprdDlCqiRecfg.pres == TRUE) &&
2081 ((ueRecfg->aprdDlCqiRecfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
2082 (*cell)->bwCfg.dlTotalBw <= 7)))
2084 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid aperiodic mode config for"
2085 " DL CQI %d for NEW CRNTI:%d", (uint8_t)ueRecfg->aprdDlCqiRecfg.aprdModeEnum,ueRecfg->newCrnti);
2088 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULPWR_RECFG) &&
2089 (rgSCHCfgVldtUePwrCfg(*cell, &ueRecfg->ueUlPwrRecfg) != ROK))
2091 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid PUSCH Group power"
2092 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2097 if ((ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG) &&
2098 (rgSCHCfgVldtUeMeasGapAckNakRepRecfg(*cell, ueRecfg) != ROK))
2100 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid MeasGap/AckNackRep"
2101 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2105 if(rgSCHCfgVldtSpsReCfg(*cell, *ue, ueRecfg)!= ROK)
2107 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid SPS"
2108 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2113 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
2114 if ( ROK != rgSCHCfgVldtCqiSrSrsUeReCfg(*cell, *ue, ueRecfg, errInfo))
2116 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid ACQI, PCQI/SR/SRS "
2117 "Re-configuration for NEW CRNTI:%d",ueRecfg->newCrnti);
2121 if ((ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG) &&
2122 (rgSCHCfgVldtDrxUeCfg(*cell, &(ueRecfg->ueDrxRecfg)) != ROK))
2124 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid drxParams"
2125 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2129 /* ccpu00117452 - MOD - Changed macro name from
2130 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
2132 /* Validate DL Power Control Config parameters */
2133 if(rgSCHCfgVldtCqiReptReCfg(*cell, ueRecfg)!= ROK)
2135 RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid DL Power Control"
2136 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2139 #endif /* End of RGR_CQI_REPT */
2140 errInfo->errCause = RGSCHERR_NONE;
2142 } /* rgSCHCfgVldtRgrUeRecfg */
2146 * @brief Validates the logical channel reconfiguration request from
2151 * Function : rgSCHCfgVldtRgrLchRecfg
2154 * - Retrieve the uplink and downlink logical channel control block.
2156 * - Validate the range of reconfigured values recieved in
2157 * re-configuration request.
2158 * - If validated successfully,
2159 * - Return ROK and pointer to the cell, UE and logical channel.
2162 * - Else return RFAILED.
2164 * @param[in] RgrLchRecfg *lcRecfg
2165 * @param[out] RgSchCellCb **cell
2166 * @param[out] RgSchUeCb **ue
2167 * @param[out] RgSchUlLcCb **ulLc
2168 * @param[out] RgSchDlLcCb **dlLc
2169 * @param[out] RgSchErrInfo *errInfo
2174 S16 rgSCHCfgVldtRgrLchRecfg
2177 RgrLchRecfg *lcRecfg,
2181 RgSchErrInfo *errInfo
2184 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LC_RECFG;
2186 if (((*cell) == NULLP) ||
2187 ((*cell)->cellId != lcRecfg->cellId))
2189 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Cell does not exist "
2190 "for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2194 /* Fetch the Ue for dedicated channels */
2195 if ((*ue = rgSCHDbmGetUeCb(*cell, lcRecfg->crnti)) == NULLP)
2197 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"UEID does not exist"
2198 "dedicated logical channel for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2202 if ((*dlLc = rgSCHDbmGetDlDedLcCb((*ue), lcRecfg->lcId)) == NULLP)
2204 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Dedicated DL LC does not "
2205 "exist for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2209 errInfo->errCause = RGSCHERR_NONE;
2211 } /* rgSCHCfgVldtRgrLchRecfg */
2214 * @brief Validates the UE Reset request from RRM to MAC.
2218 * Function : rgSCHCfgVldtRgrUeReset
2221 * - Retrieve the CELL control block
2222 * - If cell does not exist return RFAILED
2223 * - Retrieve UE Control block
2224 * - If UE does not exist return RFAILED
2227 * @param[in] Inst inst
2228 * @param[in] RgrRst *reset
2229 * @param[out] RgSchCellCb **cell
2230 * @param[out] RgSchUeCb **ue
2231 * @param[out] RgErrInfo *errInfo
2236 S16 rgSCHCfgVldtRgrUeReset
2242 RgSchErrInfo *errInfo
2246 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RESET;
2248 if ((cell == NULLP) || (cell->cellId != reset->cellId))
2250 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"CELL does not exist for CRNTI:%d",
2255 if ((*ue = rgSCHDbmGetUeCb(&(*cell), reset->crnti)) == NULLP)
2257 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"UE does not exist for CRNTI:%d",
2262 errInfo->errCause = RGSCHERR_NONE;
2265 } /* rgSCHCfgVldtRgrUeReset */
2269 * @brief Validates the logical channel reconfiguration request from
2274 * Function : rgSCHCfgVldtRgrLcgRecfg
2277 * - Retrieve the uplink and downlink logical channel control block.
2279 * - Validate the range of reconfigured values recieved in
2280 * re-configuration request.
2281 * - If validated successfully,
2282 * - Return ROK and pointer to the cell, UE and logical channel.
2285 * - Else return RFAILED.
2287 * @param[in] RgrLchRecfg *lcRecfg
2288 * @param[out] RgSchCellCb **cell
2289 * @param[out] RgSchUeCb **ue
2290 * @param[out] RgSchErrInfo *errInfo
2295 S16 rgSCHCfgVldtRgrLcgRecfg
2298 RgrLcgRecfg *lcgRecfg,
2301 RgSchErrInfo *errInfo
2304 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LCG_RECFG;
2306 if (((cell) == NULLP) ||
2307 ((cell)->cellId != lcgRecfg->cellId))
2309 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Cell does not exist for"
2310 "CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2314 /* Fetch the Ue for dedicated channels */
2315 if ((*ue = rgSCHDbmGetUeCb(&(*cell), lcgRecfg->crnti)) == NULLP)
2317 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"UE does not exist for "
2318 "dedicated logical channel group CRNTI:%d LCGID:%d",
2319 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2322 if (lcgRecfg->ulRecfg.lcgId > (RGSCH_MAX_LCG_PER_UE - 1))
2324 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Invalid lcgId for uplink logical"
2325 "channel CRNTI:%d LCGID:%d",
2326 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2330 if ((lcgRecfg->ulRecfg.gbr != 0) && (lcgRecfg->ulRecfg.mbr < lcgRecfg->ulRecfg.gbr))
2332 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "Dedicated Logical Group %d validation failed"
2333 " for ue %d for cell %d\n", lcgCfg->ulInfo.lcgId, lcgCfg->crnti, lcgCfg->cellId));
2336 errInfo->errCause = RGSCHERR_NONE;
2338 } /* rgSCHCfgVldtRgrLcgRecfg */
2344 * Function : rgSCHDynCfiCfg
2346 * @param[in] RgSchCellCb *cell
2347 * RgrCellCfg *cellCfg
2352 static S16 rgSCHDynCfiCfg
2360 uint8_t ulDlCfgIdx = cellCfg->ulDlCfgIdx;
2366 cell->dynCfiCb.isDynCfiEnb = cellCfg->isDynCfiEnb;
2368 /* Initializing Failure Sample Period */
2369 cell->dynCfiCb.failSamplePrd = (RGSCH_CFI_TTI_MON_INTRVL *
2370 RGSCH_CFI_STEP_UP_TTI_PRCNTG)/100;
2371 /* Initializing Number of Failure Samples */
2372 cell->dynCfiCb.numFailSamples = (RGSCH_CFI_TTI_MON_INTRVL/
2373 cell->dynCfiCb.failSamplePrd);
2374 cell->dynCfiCb.maxCfi = RGSCH_MAX_CFI_VAL;
2375 /* Allocating memory for CCE failure average array based on
2376 * monitoring interval and CCE failure sample period */
2377 if((rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&(cell->dynCfiCb.cceFailSamples),
2378 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)))) != ROK)
2380 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2384 /* Setting the Invalid value 0xFF to pdcchSfIdx, it will be assigned
2385 * a valid value during CFI swithing is done */
2386 cell->dynCfiCb.pdcchSfIdx = 0xFF;
2389 /* In case of config index 0, the mphich index can be upto 2
2390 * in other config index cases, it will always be set as 1*/
2393 maxMPhich = RG_SCH_MAX_MPHICH;
2397 maxMPhich = RG_SCH_MAX_MPHICH -1;
2399 /* Calculate the number of CCEs in the cell */
2400 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2402 for(mphIdx = 0; mphIdx < maxMPhich; mphIdx++)
2404 cell->dynCfiCb.cfi2NCceTbl[mphIdx][cfi] =
2405 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw,
2406 cell->phichCfg.ngEnum, cfi, mphIdx,
2407 cell->numTxAntPorts,
2408 cell->isCpDlExtend);
2412 /* Calculate the number of CCEs in the cell */
2413 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2415 /* CFI Index starts from 1 so that there can be a direct mapping from
2416 actual CFI value to cfi Index. mPhich index will always be set
2418 cell->dynCfiCb.cfi2NCceTbl[0][cfi] =
2419 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw, cell->phichCfg.ngEnum,
2420 cfi, cell->numTxAntPorts, cell->isCpDlExtend);
2423 /* Calculate the number of CCEs in the cell */
2424 if(cell->dynCfiCb.isDynCfiEnb == TRUE)
2426 /* In case if Dynamic CFI feature is enabled, default CFI
2427 * value 1 is used */
2428 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][1];
2432 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][cellCfg->cfiCfg.cfi];
2437 numDlSf = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][9] *
2438 (RGSCH_CFI_TTI_MON_INTRVL/10);
2439 cell->dynCfiCb.cfiStepUpTtiCnt =
2440 (RGSCH_CFI_STEP_UP_TTI_PRCNTG * numDlSf)/100;
2441 cell->dynCfiCb.cfiStepDownTtiCnt =
2442 (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG * numDlSf)/100;
2444 cell->dynCfiCb.cfiStepUpTtiCnt = (RGSCH_CFI_STEP_UP_TTI_PRCNTG *
2445 RGSCH_CFI_TTI_MON_INTRVL)/100;
2446 cell->dynCfiCb.cfiStepDownTtiCnt = (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG *
2447 RGSCH_CFI_TTI_MON_INTRVL)/100;
2454 * @brief Handler for the SCHED Enb configuration request from RRM to MAC.
2458 * Function : rgSCHCfgRgrSchedEnbCfg
2461 * - Invoke SCH with SCHEDULER control block to update
2462 * scheduler specific information.
2463 * - Update rgSch control block with the values recieved in the
2465 * - If successful, return ROK else RFAILED.
2467 * @param[in] RgSchCb *instCb
2468 * @param[in] SpId spId
2469 * @param[in] RgSchSchedEnbCfg *schedEnbCfg
2470 * @param[out] RgSchErrInfo *errInfo
2475 S16 rgSCHCfgRgrSchedEnbCfg
2479 RgrSchedEnbCfg *schedEnbCfg,
2480 RgSchErrInfo *errInfo
2484 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "APPLYING RGR SCH ENB CONFIG: \n"));
2485 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
2487 rgSchCb[inst].rgrSchedEnbCfg = *schedEnbCfg;
2488 RGSCHDBGPRM(inst, (rgSchPBuf(inst),"\ndlSchdType %d ulSchdType %d dlTptCoeffi %d"
2489 "dlFairCoeffi %d ulTptCoeffi %d ulFairCoeffi %d\n",
2490 schedEnbCfg->dlSchdType, schedEnbCfg->ulSchdType, schedEnbCfg->dlSchInfo.dlPfs.tptCoeffi,
2491 schedEnbCfg->dlSchInfo.dlPfs.fairCoeffi, schedEnbCfg->ulSchInfo.ulPfs.tptCoeffi,
2492 schedEnbCfg->ulSchInfo.ulPfs.fairCoeffi));
2495 rgSchCb[inst].rgSchDynTdd.isDynTddEnbld = schedEnbCfg->isDynTddEnbld;
2498 if(RGR_SCH_TYPE_PFS == schedEnbCfg->dlSchdType)
2500 rgSCHEnbPfsDlCfg(inst, errInfo);
2503 errInfo->errCause = RGSCHERR_NONE;
2504 RGSCHDBGINFO(inst, (rgSchPBuf(inst), "RGR SCH ENBconfig done: \n"));
2506 } /* rgSCHCfgRgrSchedEnbCfg */
2510 * @brief Handler for the cell configuration of 5gtf.
2514 * Function : rgSCH5gtfCellCfg
2516 * @param[in] RgSchCellCb *cell
2517 * @param[in] RgSchCellCfg *cellCfg
2522 S16 rgSCH5gtfCellCfg
2530 for(idx = 0; idx < MAX_5GTF_GROUP; idx++)
2532 cell->cell5gtfCb.ueGrp5gConf[idx].beamBitMask = 0;
2535 for(idx = 0 ; idx < MAX_5GTF_SUBFRAME_INFO ; ++idx)
2537 cell->cell5gtfCb.dynConfig[idx] = cellCfg->Cell5gtfCfg.dynConfig[idx];
2539 cell->cell5gtfCb.numUes = cellCfg->Cell5gtfCfg.numUes;
2540 cell->cell5gtfCb.uePerGrpPerTti = cellCfg->Cell5gtfCfg.uePerGrp;
2541 cell->cell5gtfCb.ueGrpPerTti = cellCfg->Cell5gtfCfg.ueGrpPerTti;
2542 cell->cell5gtfCb.numCCs = cellCfg->Cell5gtfCfg.numOfCC;
2543 cell->cell5gtfCb.bwPerCC = cellCfg->Cell5gtfCfg.bwPerCC;
2544 printf("\ncell cfg at schd,numUes:%u,uepergrp:%u,uegrppertti:%u,numCC:%u,bwPerc:%u cfi %u\n",
2545 cell->cell5gtfCb.numUes,cell->cell5gtfCb.uePerGrpPerTti,cell->cell5gtfCb.ueGrpPerTti,
2546 cell->cell5gtfCb.numCCs,cell->cell5gtfCb.bwPerCC, cell->cell5gtfCb.cfi);
2551 #ifdef XEON_LMT_ITBS
2552 uint16_t gWrMaxDlItbs;
2553 uint16_t gWrMaxUlItbs;
2556 * @brief Handler for the cell configuration request from RRM to MAC.
2560 * Function : rgSCHCfgRgrCellCfg
2563 * - Invoke SCH with cell control block to update
2564 * scheduler specific information.
2565 * - Update cell control block with the values recieved in the
2567 * - Add to the active list of cells if cell becomes ACTIVE.
2568 * - If successful, return ROK else RFAILED.
2570 * @param[in] RgSchCb *instCb
2571 * @param[in] SpId spId
2572 * @param[in] RgSchCellCfg *cellCfg
2573 * @param[out] RgSchErrInfo *errInfo
2578 S16 rgSCHCfgRgrCellCfg
2582 RgrCellCfg *cellCfg,
2583 RgSchErrInfo *errInfo
2589 RgInfCellReg cellRegReq;
2590 RgSchCellCb *cell = NULLP;
2591 Inst inst = instCb->rgSchInit.inst;
2592 uint32_t Idx1 = (uint8_t)((cellCfg->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
2594 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_CFG;
2596 memset(&pst, 0, sizeof(Pst));
2598 /* Allocate the scheduler's cell control block */
2599 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&cell, sizeof(RgSchCellCb)))
2602 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2606 if(cellCfg->emtcEnable)
2608 if((ret = rgSCHEmtcCellAlloc(cell))
2611 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for emtc cell");
2616 if ((uint8_t *)cell == NULLP)
2618 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
2621 /* Initialize the lists of the cell */
2622 ret = rgSCHDbmInitCell(cell);
2625 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"DBM initialization FAILED for cell");
2626 rgSCHCfgFreeCellCb(cell);
2629 /* LTE_ADV_FLAG_REMOVED_START */
2630 if(cellCfg->rgrLteAdvCfg.pres & RGR_ABS)
2632 cell->lteAdvCb.absCfg =
2633 cellCfg->rgrLteAdvCfg.absCfg;
2634 memset(cell->lteAdvCb.absLoadInfo, 0, sizeof(uint32_t)*RGR_ABS_PATTERN_LEN);
2635 cell->lteAdvCb.absLoadTtiCnt = 0;
2638 if(cellCfg->rgrLteAdvCfg.pres & RGR_SFR)
2640 cell->lteAdvCb.sfrCfg =
2641 cellCfg->rgrLteAdvCfg.sfrCfg;
2643 if(cellCfg->rgrLteAdvCfg.pres & RGR_DSFR)
2645 cell->lteAdvCb.dsfrCfg =
2646 cellCfg->rgrLteAdvCfg.dsfrCfg;
2648 /* LTE_ADV_FLAG_REMOVED_END */
2651 cell->emtcEnable = cellCfg->emtcEnable;
2653 /* Initialize the cell */
2654 cell->cellId = cellCfg->cellId;
2655 cell->instIdx = inst;
2656 cell->macInst = cellCfg->macInst;
2657 cell->isCpUlExtend = cellCfg->isCpUlExtend;
2658 cell->isCpDlExtend = cellCfg->isCpDlExtend;
2660 cell->numTxAntPorts = rgSchCb[inst].rgrSchedEnbCfg.numTxAntPorts;
2661 if(cell->numTxAntPorts == 1)
2663 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_ONE_ANT_PORT;
2665 else if(cell->numTxAntPorts == 2)
2667 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_TWO_ANT_PORT;
2671 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_FOUR_ANT_PORT;
2673 cell->bwCfg = cellCfg->bwCfg;
2674 cell->pbchRbStart = ((((cell->bwCfg.dlTotalBw * 12)/2) - 36)/12); /* Ref section 6.6 in 36.211 */
2675 cell->pbchRbEnd = cell->pbchRbStart + 5;
2676 cell->pucchCfg = cellCfg->pucchCfg;
2677 cell->rachCfg = cellCfg->rachCfg;
2678 cell->siCfg = cellCfg->siCfg;
2679 cell->t300TmrVal = cellCfg->t300TmrVal;
2681 /*Initialize the SI CB in Cell CB */
2682 memset(&cell->siCb, 0, sizeof(RgSchSiCb));
2684 /*Fix: Added Guard Pool for RNTI which will contain RNTIs
2685 *for UEs deleted from Scheduler but not yet from MAC*/
2686 cmLListInit(&cell->rntiDb.rntiGuardPool);
2688 /* Initialize the inWindow to sync with scheduler time when ticks starts */
2690 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2691 (RG_SCH_CMN_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL));
2693 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2694 (RG_SCH_CMN_DL_DELTA));
2697 if(cell->siCb.inWindow < 0)
2699 cell->siCb.inWindow = 0;
2701 cell->macPreambleSet = cellCfg->macPreambleSet;
2702 cell->phichCfg = cellCfg->phichCfg;
2704 /* Initialize UL and DL CCCH logical channels */
2705 cell->ulCcchId = RGSCH_INVALID_LC_ID;
2706 cell->dlCcchId = RGSCH_INVALID_LC_ID;
2708 /* Update SRS configuration */
2709 cell->srsCfg.isSrsCfgPres = cellCfg->srsCfg.isSrsCfgSetup;
2710 if(cellCfg->srsCfg.isSrsCfgSetup)
2712 cell->srsCfg.srsCfgPrdEnum = cellCfg->srsCfg.srsCfgPrdEnum;
2713 cell->srsCfg.srsBwEnum = cellCfg->srsCfg.srsBwEnum;
2714 cell->srsCfg.srsTxOffst =
2715 rgSrsTxOffstTbl[cellCfg->srsCfg.srsSubFrameCfg];
2716 /*ccpu00116923 - ADD - Srs Present support */
2718 cell->srsCfg.srsSubFrameCfg = cellCfg->srsCfg.srsSubFrameCfg;
2722 /* Configure all the common logical channels for the cell */
2723 for(idx = 0; idx < cellCfg->numCmnLcs; idx++)
2725 /* This never returns failure and hence not checked for */
2726 rgSCHCfgRgrCmnLcCfg(cell, &(cellCfg->cmnLcCfg[idx]), errInfo);
2729 /* Invoke the MeasGap and ACK NACK Rep handler for cell cfg */
2731 /* Dynamic CFI cell configuration */
2732 ret = rgSCHDynCfiCfg(cell, cellCfg);
2735 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr cell Config failed at "
2736 "Scheduler for cell");
2737 rgSCHCfgFreeCellCb(cell);
2740 /* Updating Auto TM Mode enable/diable flag */
2741 cell->isAutoCfgModeEnb = cellCfg->isAutoCfgModeEnb;
2743 if(cell->isAutoCfgModeEnb)
2745 RLOG0(L_INFO,"Auto Mode Cfg enabled durint cell cfg\n");
2748 /* CPU OvrLoad State Initialization */
2749 #ifdef XEON_LMT_ITBS
2750 cell->thresholds.maxDlItbs = gWrMaxDlItbs;
2751 cell->thresholds.maxUlItbs = gWrMaxUlItbs;
2752 RLOG2(L_INFO,"LIMIT DL and UL ITBS %d:%d \n",gWrMaxDlItbs,gWrMaxUlItbs);
2754 cell->thresholds.maxDlItbs = RG_SCH_DL_MAX_ITBS;
2755 cell->thresholds.maxUlItbs = RG_SCH_UL_MAX_ITBS;
2757 cell->measurements.dlTpt = 0;
2758 cell->measurements.ulTpt = 0;
2759 cell->measurements.dlBytesCnt = 0;
2760 cell->measurements.ulBytesCnt = 0;
2761 cell->cpuOvrLdCntrl.cpuOvrLdIns = 0; /* 0 - No command */
2762 cell->cpuOvrLdCntrl.dlNxtIndxDecNumUeTti = 0;
2763 cell->cpuOvrLdCntrl.ulNxtIndxDecNumUeTti = 0;
2764 for ( idx = 0; idx < 10; idx++ )
2766 cell->cpuOvrLdCntrl.maxUeNewTxPerTti[idx] = cellCfg->maxDlUeNewTxPerTti;
2767 cell->cpuOvrLdCntrl.maxUeNewRxPerTti[idx] = cellCfg->maxUlUeNewTxPerTti;
2770 /* Invoke scheduler to update scheduler specific information */
2771 ret = rgSCHUtlRgrCellCfg(cell, cellCfg, errInfo);
2774 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr cell Config failed at "
2775 "Scheduler for cell ");
2776 rgSCHCfgFreeCellCb(cell);
2780 /* Invoke DHM to update DHM specific information */
2781 rgSCHDhmRgrCellCfg(cell, cellCfg, errInfo);
2784 /* Initialize RNTI DB */
2785 ret = rgSCHDbmRntiDbInit(cell, cellCfg->macRnti.startRnti,
2786 cellCfg->macRnti.size);
2789 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr Cell Config failed at"
2790 " RNTI DB init for cell");
2791 rgSCHCfgFreeCellCb(cell);
2795 /* Update the cell with recieved configuration */
2796 cell->dlHqCfg = cellCfg->dlHqCfg;
2798 RLOG1(L_INFO,"Config DL HQTX = %d\n",cell->dlHqCfg.maxDlHqTx);
2800 cell->crntSfIdx = 0;
2801 /* Allocate the subframe allocation information */
2802 if((ret = rgSCHUtlGetSfAlloc(cell)) != ROK)
2804 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for "
2806 rgSCHCfgFreeCellCb(cell);
2809 /* Update RACH Related information
2810 * XXX: Below function yet to be written in RAM
2811 * To store the preambles given in the configuration for PDCCH order in the
2812 * scheduler cell control block. Initialize the PRACH Mask Index allocated
2813 * for these preambles to invalid values */
2815 cell->crntHqIdx = 0;
2816 /* Allocate the subframe allocation information */
2817 if((ret = rgSCHUtlGetRlsHqAlloc(cell)) != ROK)
2819 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for"
2821 rgSCHCfgFreeCellCb(cell);
2825 /* Associate a pair of upper and lower sapCbs with this cell */
2826 instCb->rgrSap[spId].cell = cell;
2827 instCb->tfuSap[spId].cell = cell;
2828 instCb->rgmSap[spId].cell = cell;
2829 cell->tfuSap = &(instCb->tfuSap[spId]);
2832 instCb->cells[Idx1] = cell;
2835 /* rg001.201: Added for sending TTI tick to RRM */
2836 #if (defined(RGR_RRM_TICK) || defined(RGR_CQI_REPT))
2837 /* Associate the RGR SAP as well utilized while sending TTI
2838 * Ticks to RGR User. */
2839 cell->rgrSap = &(instCb->rgrSap[spId]);
2841 cell->rgmSap = &(instCb->rgmSap[spId]);
2843 /* Store the periodicity configured */
2844 cell->rrmTtiIndPrd = cellCfg->rrmTtiIndPrd;
2848 cmLListInit(&cell->l2mList);
2851 if (rgSCHDrxCellCfg(cell,cellCfg) != ROK)
2853 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Drx Memory allocation FAILED for"
2855 rgSCHCfgFreeCellCb(cell);
2858 cell->overLoadBackOffEnab = FALSE;/* Disabling RachOverload by default */
2859 /* Updating CSG Parameters */
2860 cell->minDlResNonCsg = cellCfg->csgParamCfg.minDlResNonCsg;
2861 cell->minUlResNonCsg = cellCfg->csgParamCfg.minUlResNonCsg;
2863 /* Register the cell with MAC */
2864 rgSCHUtlGetPstToLyr(&pst, instCb, cell->macInst);
2865 cellRegReq.cellId = cell->cellId;
2866 cellRegReq.cellSapId = spId;
2868 cellRegReq.maxDlHqProcPerUe = rgSchTddDlNumHarqProcTbl[cellCfg->ulDlCfgIdx];
2870 cellRegReq.maxDlHqProcPerUe = RGSCH_MAX_DL_HQ_PROC;
2872 RgSchMacCellReg(&pst, &cellRegReq);
2875 cell->tenbStats = TSL2AllocCellStatsBlk(cell->cellId);
2876 cell->tenbStats->cellId = cell->cellId;
2879 rgSCHUtlCalcDciSizes(cell);
2882 /* Initilalization of the list of UE for which this cell is secondary cell*/
2883 cmLListInit(&cell->sCellUeLst);
2888 ret = rgSCHLaaSCellCbInit(cell, cellCfg);
2891 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Rgr Cell Config failed at"
2892 " Initializing the LAA Cell Control Cb");
2893 rgSCHCfgFreeCellCb(cell);
2896 cell->isPucchFormat3Sptd = cellCfg->isPucchFormat3Sptd;
2897 RLOG_ARG0(L_INFO,DBG_CELLID,cellCfg->cellId,"Format 3 is Enabled");
2898 printf ("\n Format 3 is Enabled for CELL:%d",cell->cellId);
2904 if(cell->emtcEnable)
2906 if (rgSCHCfgEmtcCellCfg(cell,&(cellCfg->emtcCellCfg)) != ROK)
2908 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"EMTC Config Failed"
2916 ret = rgSCH5gtfCellCfg(cell, cellCfg);
2919 RLOG_ARG0(L_ERROR, DBG_CELLID,cellCfg->cellId,"5GTF Rgr Cell Config failed");
2920 rgSCHCfgFreeCellCb(cell);
2924 errInfo->errCause = RGSCHERR_NONE;
2926 } /* rgSCHCfgRgrCellCfg */
2929 * @brief Handler for the UE configuration request from RRC to MAC.
2933 * Function : rgSCHCfgRgrUeCfg
2936 * - Allocate and create UE control block.
2937 * - Update UE control block with the values recieved in the
2939 * - Invoke RAM, SCH, UHM and DHM with created UE control block, to
2940 * update random access, scheduler, uplink harq and downlink harq
2941 * specific information respectively.
2942 * - If successful, add the control block to hash list of UEs for the cell
2943 * else Rollback and FAIL.
2945 * @param[in] RgSchCellCb *cell
2946 * @param[in] RgrUeCfg *ueCfg
2947 * @param[out] RgSchErrInfo *errInfo
2952 S16 rgSCHCfgRgrUeCfg
2956 RgSchErrInfo *errInfo
2960 RgSchRaCb *raCb=NULLP;
2961 RgSchUeCb *ue = NULLP;
2962 Inst inst = cell->instIdx;
2964 RgSchDlHqEnt *hqEnt = NULLP;
2966 uint8_t ulDlCfgIdx = cell->ulDlCfgIdx;
2967 uint8_t maxSubframes ;
2968 uint8_t maxDlSubframes;
2972 RgSchUePCqiCb *cqiCb = NULLP;
2976 errInfo->errCause = RGSCHERR_CFG_RGR_UE_CFG;
2977 /* RACHO : Check for raCb only if preamble Id not provded */
2978 #ifndef PRE_DEF_UE_CTX
2979 if (ueCfg->dedPreambleId.pres == NOTPRSNT)
2981 if ((raCb = rgSCHDbmGetRaCb(cell, ueCfg->crnti)) == NULLP)
2983 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"No RaCb exists for"
2984 "CRNTI:%d ",ueCfg->crnti);
2990 /* Allocate the Ue control block */
2991 if (((rgSCHUtlAllocSBuf(inst, (Data **)&ue, sizeof(RgSchUeCb))) != ROK) ||
2992 ((uint8_t *)ue == NULLP))
2994 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId, "Memory allocation"
2995 " FAILED for CRNTI:%d", ueCfg->crnti);
2999 /* Inititialize Ue control block */
3000 ue->ueId = ueCfg->crnti;
3002 /*ccpu00117778- Initialize Transmission Indices upon UE CB creation */
3004 ue->lastRprdAckNackTime.sfn = cell->crntTime.sfn;
3005 ue->lastRprdAckNackTime.subframe = cell->crntTime.slot;
3009 /* Allocate the Ue control block */
3010 if (((rgSCHUtlAllocSBuf(inst, (Data **)&(ue->cellInfo[RGSCH_PCELL_INDEX]),
3011 sizeof(RgSchUeCellInfo))) != ROK))
3014 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%lu]SCellIdx :Memomy allocation "
3015 "Failed while Adding SCell Information\n", idx));
3017 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%u]SCellIdx :Memomy allocation "
3018 "Failed while Adding SCell Information\n", idx));
3023 ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)] = RGSCH_PCELL_INDEX;
3024 ue->cellInfo[RGSCH_PCELL_INDEX]->cell = cell;
3025 ue->cellInfo[RGSCH_PCELL_INDEX]->ue = ue;
3027 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
3028 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellIdx = RGSCH_PCELL_INDEX;
3029 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellId = cell->cellId;
3031 if (ROK != rgSCHLaaInitDlRbAllocCb(cell,
3032 &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb))
3038 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ue,cell);
3039 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
3040 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
3041 ue->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
3042 ue->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
3044 /* LTE_ADV_FLAG_REMOVED_START */
3045 /* While doing UE configuration for SFR at SCH, by default
3046 * CC UE power is configured as LOW */
3047 ue->lteAdvUeCb.isCCUePHigh = FALSE;
3048 /* LTE_ADV_FLAG_REMOVED_END */
3050 /* Initialize the lists of the UE */
3051 if((rgSCHDbmInitUe(ue)) != ROK)
3053 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"DBM initialization "
3054 "failed for CRNTI:%d", ueCfg->crnti);
3060 if(TRUE == raCb->isEmtcRaCb)
3062 ue->isEmtcUe = TRUE;
3063 if (rgSCHUtlUpdUeEmtcInfo(cell, ueCfg, ue) != ROK)
3065 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"EMTC UE Cfg"
3066 "failed for CRNTI:%d", ueCfg->crnti);
3073 /* Initialize scheduler related information for UE */
3074 if(rgSCHUtlRgrUeCfg(cell, ue, ueCfg, errInfo) != ROK)
3076 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Scheduler handling "
3077 "failed in config for CRNTI:%d", ueCfg->crnti);
3081 ret = rgSCHUhmHqEntInit(cell, ue);
3084 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"UHM HARQ Ent Init "
3085 "Failed for CRNTI:%d", ueCfg->crnti);
3089 /* Initialize RAM related information for UE
3090 * RACHO: if preamble Id is present in ueCfg then raCb will be NULL
3091 * so rgSCHRamRgrUeCfg should take care of creating raCb */
3092 if ((ueCfg->dedPreambleId.pres == NOTPRSNT) && (NULLP != raCb) )
3094 if((rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo)) != ROK)
3096 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Random access "
3097 "handling config failed for CRNTI:%d", ueCfg->crnti);
3103 RG_SCH_CMN_GET_UE_HQE(ue, cell) = rgSCHDhmHqEntInit(cell);
3104 hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
3107 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Hq Entity Initialization "
3108 "failed in config for CRNTI:%d", ueCfg->crnti);
3112 rgSCHEmtcHqPAlloc(cell, hqEnt);
3115 /* Fix : syed Assign hqEnt to UE only if msg4 is done */
3117 rgSCHCmnDlInitHqEnt(cell, hqEnt);
3119 /* For Hand-In UE Request Aper CQI report
3121 if (ueCfg->ueDlCqiCfg.aprdCqiCfg.pres)
3123 /* Set APCQI for Pcell only*/
3124 ue->dl.reqForCqi = RG_SCH_APCQI_SERVING_CC;
3129 maxDlSubframes = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
3130 maxSubframes = 2 * maxDlSubframes;
3131 ue->dl.numHqDlSfInfo = maxSubframes;
3132 rgSCHUtlAllocSBuf(cell->instIdx,
3133 (Data **)&ue->dl.dlSfHqInfo, sizeof(RgSchDlHqInfo) * (ue->dl.numHqDlSfInfo));
3136 ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_slotS;
3139 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3141 cmLListInit(&ue->dl.dlSfHqInfo[idx].hqPLst);
3142 ue->dl.dlSfHqInfo[idx].dlSfUeLnk.node = NULLP;
3148 for (cellIdx = 0;cellIdx < MAX_5GTF_CELL ; cellIdx++)
3150 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3152 cmLListInit(&ue->dl.dlSfHqInfo[cellIdx][idx].hqPLst);
3153 ue->dl.dlSfHqInfo[cellIdx][idx].dlSfUeLnk.node = NULLP;
3159 rgSCHLaaInitDlHqInfo(cell, ue);
3163 /* Initialize lcgIds to Invalid */
3164 for (lcgCnt = 0; lcgCnt < RGSCH_MAX_LCG_PER_UE; lcgCnt++)
3166 ue->ul.lcgArr[lcgCnt].lcgId = RGSCH_INVALID_LCG_ID;
3170 rgSCHCfgRgrUePhrMsg3(cell,raCb,ue,errInfo);
3171 /* Moved this code out of rgSCHCfgRgrUePhrMsg3()
3172 * as it was not the appropriate place to
3174 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3176 RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
3177 "RNTI:%d RaCb deleted as Msg4 transmission is done",
3179 rgSCHRamDelRaCb(cell, raCb, FALSE);
3182 /* Initialize uplink HARQ related information for UE */
3183 rgSCHUhmRgrUeCfg(cell, ue, ueCfg);
3184 cmInitTimers(&ue->bsrTmr, 1);
3186 /* Added periodic BSR timer */
3187 cmInitTimers(&ue->bsrTmr, 1);
3189 /* Fix - Added proper configuration from U-ARM */
3190 if(ueCfg->ueBsrTmrCfg.isPrdBsrTmrPres == TRUE)
3192 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = TRUE;
3193 ue->ul.bsrTmrCfg.prdBsrTmr = ueCfg->ueBsrTmrCfg.prdBsrTmr;
3194 ue->ul.bsrTmrCfg.retxBsrTmr = ueCfg->ueBsrTmrCfg.retxBsrTmr;
3198 /* Initialize downlink HARQ related information for UE */
3199 rgSCHDhmRgrUeCfg(cell, ue, ueCfg, errInfo);
3201 /* Initialize MeasureGap and Acknack Rep Information for UE */
3202 if((rgSCHMeasGapANRepUeCfg(cell, ue, ueCfg)) != ROK)
3204 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Measurement Gap and"
3205 " AckNack Rep failed in Config for CRNTI:%d", ueCfg->crnti);
3211 if((rgSCHUtlAllocUeANFdbkInfo(ue,RGSCH_PCELL_INDEX)) != ROK)
3213 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"Memomy allocation "
3214 "Failed while UE related Ack Nack Information for CRNTI:%d",
3218 ue->dl.ackNackMode = ueCfg->ackNackModeEnum;
3219 #endif /* LTE_TDD */
3222 rgSCHDbmInsUeCb(cell, ue);
3225 /* Int ialize APeriodic CQI/PMI/RI Information for UE */
3227 RGSCHDBGPRM(cell->instIdx,(rgSchPBuf(cell->instIdx),
3228 "\n rgSCHCfgRgrUeCfg : CellID=%d UeId =%d AcqiCfg Pres =%d",
3229 cell->cellId, ue->ueId, ueCfg->ueDlCqiCfg.aprdCqiCfg.pres));
3231 /*Store Trigger Set Bit String to UE */
3233 ret = rgSCHCfgACqiUeCfg(cell,ue, (RG_SCH_CMN_GET_ACQICB(ue,cell)),ue->mimoInfo.txMode,
3234 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ue->ueCatEnum);
3236 ue->cqiRiWritIdx = 0;
3237 ue->cqiRiReadIdx = 0;
3238 /* Initialize Periodic CQI/PMI, RI Information for UE */
3239 ret = rgSCHCfgPCqiUeCfg(cell, ue, &ueCfg->ueDlCqiCfg.prdCqiCfg,
3242 /* Initialize UL SRS Information for UE */
3243 ret = rgSCHCfgSrsUeCfg(cell, ue, &ueCfg->srsCfg);
3245 /* Initialize SR Information for UE */
3246 ret = rgSCHCfgSrUeCfg(cell, ue, &ueCfg->srCfg);
3250 if (rgSCHHdFddUeCfg(cell, ue, ueCfg->isHdFddEnbld) != ROK)
3252 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,
3253 "Could not do HD-FDD config for CRNTI:%d",ueCfg->crnti);
3257 #endif /* LTEMAC_HDFDD */
3258 /* ccpu00117452 - MOD - Changed macro name from
3259 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
3261 ue->cqiReptCfgInfo.numColltdCqiRept =
3262 ueCfg->ueCqiReptCfg.numColltdCqiRept;
3263 #endif /* End of RGR_CQI_REPT */
3265 RG_SCH_CMN_GET_PA(ue,cell).pres = FALSE;
3266 if (RG_SCH_UE_CFG_ISPAPRSNT(ueCfg->uePdschDedCfg.uepACfg))
3268 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
3269 RG_SCH_CMN_GET_PA(ue,cell).val = ueCfg->uePdschDedCfg.uepACfg.pA;
3272 ue->isDrxEnabled = ueCfg->ueDrxCfg.isDrxEnabled;
3274 if ( ue->isDrxEnabled )
3276 if((rgSCHDrxUeCfg(cell,ue,ueCfg)) != ROK )
3278 RLOG_ARG1(L_ERROR,DBG_CELLID,ueCfg->cellId,"DRX configuration failed",
3284 /* LTE_ADV_FLAG_REMOVED_START */
3285 if ((cell->lteAdvCb.sfrCfg.status == RGR_ENABLE) || \
3286 (cell->lteAdvCb.absCfg.status == RGR_ENABLE))
3288 ue->lteAdvUeCb.rgrLteAdvUeCfg = ueCfg->ueLteAdvCfg;
3290 /* LTE_ADV_FLAG_REMOVED_END */
3293 ue->tenbStats = TSL2AllocUeStatsBlk(ue->ueId);
3294 ue->tenbStats->stats.rnti = ue->ueId;
3297 /*Update A Value for PCell TBs*/
3298 ue->f1bCsAVal = rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode);
3299 RLOG_ARG1(L_ERROR,DBG_CELLID, ueCfg->cellId,
3300 "\n UeCfg A value is %d\n",ue->f1bCsAVal);
3302 errInfo->errCause = RGSCHERR_NONE;
3304 ue->accessStratumRls = ueCfg->accessStratumRls;
3305 if (ue->numSCells > 0)
3308 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3312 /* 1 bit CSI Access Stratum Release Change */
3313 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3321 rgSCHCfgFreeUeCb(cell, ue);
3324 } /* rgSCHCfgRgrUeCfg */
3327 * @brief Handler for PHR for MSG3.
3331 * Function : rgSCHCfgRgrUePhrMsg3
3334 * Handle PHR related config for MSG3
3336 * @param[in] RgSchCellCb *cell
3337 * @param[in] RgrUeCb *ueCb
3338 * @param[in] RgSchRaCb *raCb
3339 * @param[out] RgSchErrInfo *errInfo
3341 static Void rgSCHCfgRgrUePhrMsg3
3346 RgSchErrInfo *errInfo
3350 /* Record msg3 allocation in the UE */
3351 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3353 /* If raCb received PHR, update scheduler */
3354 if(raCb->phr.pres == TRUE)
3356 ue->macCeRptTime = raCb->msg3AllocTime;
3357 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3367 * Function : rgSCHDynCfiReCfg
3369 * @param[in] RgSchCellCb *cell
3375 Void rgSCHDynCfiReCfg
3382 RgSchCmnDlCell *cellSchDl = RG_SCH_CMN_GET_DL_CELL(cell);
3386 cell->dynCfiCb.ttiCnt = 0;
3387 cellSchDl->newCfi = cellSchDl->currCfi;
3391 /* Resetting the parameters*/
3392 cell->dynCfiCb.cceFailCnt = 0;
3393 cell->dynCfiCb.cceFailSum = 0;
3394 cell->dynCfiCb.prevCceFailIdx = 0;
3396 for(idx = 0; idx < cell->dynCfiCb.numFailSamples; idx++)
3398 cell->dynCfiCb.cceFailSamples[idx] = 0;
3401 cell->dynCfiCb.cceUsed = 0;
3402 cell->dynCfiCb.lowCceCnt = 0;
3403 cell->dynCfiCb.ttiCnt = 0;
3407 * @brief Handler for the cell reconfiguration request from RRM to MAC.
3411 * Function : rgSCHCfgRgrCellRecfg
3414 * - Invoke SCH with cell control block to update
3415 * scheduler specific information.
3416 * - Update cell control block with the values recieved in the
3418 * - If successful, return ROK else RFAILED.
3420 * @param[in] RgSchCellCb *cell
3421 * @param[in] RgrCellRecfg *cellRecfg
3422 * @param[out] RgSchErrInfo *errInfo
3427 S16 rgSCHCfgRgrCellRecfg
3430 RgrCellRecfg *cellRecfg,
3431 RgSchErrInfo *errInfo
3435 Inst inst = cell->instIdx;
3436 /* LTE_ADV_FLAG_REMOVED_START */
3438 uint16_t len; /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3439 /* LTE_ADV_FLAG_REMOVED_END */
3441 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_RECFG;
3443 /* Invoke scheduler to update scheduler specific information */
3444 ret = rgSCHUtlRgrCellRecfg(cell, cellRecfg, errInfo);
3447 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId, "RGR Cell re-configuration failed "
3452 /* Invoke DHM to update DHM specific information */
3453 rgSCHDhmRgrCellRecfg(cell, cellRecfg, errInfo);
3455 /* PUCCH Reconfiguration */
3456 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
3458 cell->pucchCfg = cellRecfg->pucchRecfg;
3461 /* SRS Reconfiguration */
3462 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
3464 cell->srsCfg.isSrsCfgPres = cellRecfg->srsRecfg.isSrsCfgSetup;
3465 if(cellRecfg->srsRecfg.isSrsCfgSetup)
3467 cell->srsCfg.srsCfgPrdEnum = cellRecfg->srsRecfg.srsCfgPrdEnum;
3468 cell->srsCfg.srsBwEnum = cellRecfg->srsRecfg.srsBwEnum;
3469 cell->srsCfg.srsTxOffst =
3470 rgSrsTxOffstTbl[cellRecfg->srsRecfg.srsSubFrameCfg];
3471 /*ccpu00116923 - ADD - Srs Present support */
3473 cell->srsCfg.srsSubFrameCfg = cellRecfg->srsRecfg.srsSubFrameCfg;
3478 /* RACH Reconfiguration */
3479 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
3481 cell->rachCfg = cellRecfg->rachRecfg;
3484 /* ccpu00132256:MOD: Moved this assignment from Validation to here.*/
3485 if (cellRecfg->recfgTypes & RGR_CELL_TMRS_RECFG)
3487 cell->t300TmrVal = cellRecfg->t300TmrVal;
3490 /* SI Reconfiguration */
3491 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
3493 /*Set the specified SI configuration. */
3494 cell->siCb.newSiCfg = cellRecfg->siReCfg;
3495 /* Set the Bit mask for SI re-configuration */
3496 cell->siCb.siBitMask |= RGSCH_SI_SICFG_UPD;
3498 if(cell->emtcEnable)
3500 rgSchEmtcUpdSiCfg(cell, cellRecfg);
3504 #endif /*RGR_SI_SCH */
3506 /* Overload RACH Control changes */
3507 if (cellRecfg->recfgTypes & RGR_CELL_CNTRL_CMD_RECFG)
3509 if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_RACH_OVRLD)
3511 cell->overLoadBackOffEnab = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffEnb;
3512 cell->overLoadBackOffval = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffVal;
3514 else if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_CPU_OVRLD)
3516 if( ROK != rgSCHUtlResetCpuOvrLdState(cell, cellRecfg->cntrlCmdCfg.cmdDesc.\
3517 cpuOvrLd.instruction))
3519 RLOG_ARG1(L_ERROR,DBG_CELLID, cellRecfg->cellId,
3520 "Invalid CPU OvrLd Ins %d for cell",
3521 cellRecfg->cntrlCmdCfg.cmdDesc.cpuOvrLd.instruction);
3527 /* LTE_ADV_FLAG_REMOVED_START */
3528 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
3530 if(cellRecfg->rgrLteAdvCfg.pres & RGR_ABS)
3532 cell->lteAdvCb.absCfg =
3533 cellRecfg->rgrLteAdvCfg.absCfg;
3535 if(cellRecfg->rgrLteAdvCfg.pres & RGR_SFR)
3537 memcpy(&cell->lteAdvCb.sfrCfg, &cellRecfg->rgrLteAdvCfg.sfrCfg,
3538 sizeof(RgrSfrConfig));
3539 /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3540 if (cellRecfg->rgrLteAdvCfg.sfrCfg.status == RGR_ENABLE)
3542 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3544 /*initialise the pools of CC and CE*/
3545 if(rgSchSFRTotalPoolInit(cell, cell->subFrms[i]))
3553 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3555 /*initialise the pools of CC and CE*/
3556 rgSchSFRTotalPoolFree(&cell->subFrms[i]->sfrTotalPoolInfo, cell);
3559 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3561 /* releasing rntp info val from each subframe */
3562 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3564 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3567 /* releasing RNTP Aggregation Info from CellCb*/
3568 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3570 cell->lteAdvCb.dsfrCfg.status = RGR_DISABLE;
3574 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** Start */
3575 if(cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR)
3577 cell->lteAdvCb.dsfrCfg =
3578 cellRecfg->rgrLteAdvCfg.dsfrCfg;
3579 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3581 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3583 /*initialise the pools of CC and CE*/
3584 if(rgSchDSFRRntpInfoInit(&cell->subFrms[i]->rntpInfo,cell,cell->bwCfg.dlTotalBw))
3589 /*Calculating the length of RNTP array based on Dl Bandwidth */
3590 len = (uint16_t)((cell->bwCfg.dlTotalBw % 8 == 0) ? (cell->bwCfg.dlTotalBw/8) : (cell->bwCfg.dlTotalBw/8 + 1)); /* KW fix for LTE_ADV */
3591 if(cell->rntpAggrInfo.pres == NOTPRSNT)
3593 if((rgSCHUtlAllocSBuf(inst, (Data**)&(cell->rntpAggrInfo.val),
3594 (len * sizeof(uint8_t)))) != ROK)
3596 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,
3597 "Memory allocation FAILED for RNTP Alloc");
3600 cell->rntpAggrInfo.pres = PRSNT_NODEF;
3601 cell->rntpAggrInfo.len = len;
3604 /* in case if DSFR is disabled, need to free RNTP pattern val*/
3607 /* releasing rntp info val from each subframe */
3608 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3610 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3613 /* releasing RNTP Aggregation Info from CellCb*/
3614 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3617 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** End */
3619 /* LTE_ADV_FLAG_REMOVED_END */
3621 /* Dynamic CFI cell Reconfiguration */
3622 if(cellRecfg->recfgTypes & RGR_CELL_DYN_CFI_RECFG)
3624 if(cell->dynCfiCb.isDynCfiEnb != cellRecfg->isDynCfiEnb)
3626 if(cell->dynCfiCb.switchOvrInProgress)
3628 cell->dynCfiCb.dynCfiRecfgPend = TRUE;
3632 cell->dynCfiCb.isDynCfiEnb = cellRecfg->isDynCfiEnb;
3633 rgSCHDynCfiReCfg(cell, cellRecfg->isDynCfiEnb);
3638 /* To hanlde the case where reconfiguration comes for disabling
3639 * and then enabling before switchover period expires */
3640 cell->dynCfiCb.dynCfiRecfgPend = FALSE;
3643 /* Dynamic config of AUTO chnage flag */
3644 if(cellRecfg->recfgTypes & RGR_CELL_AUTO_CFG_MODE_RECFG)
3646 if(cell->isAutoCfgModeEnb != cellRecfg->isAutoCfgModeEnb)
3648 cell->isAutoCfgModeEnb = cellRecfg->isAutoCfgModeEnb;
3652 if(cell->isAutoCfgModeEnb)
3654 RLOG0(L_INFO,"Auto Mode Cfg enabled durint cell recfg\n");
3658 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
3660 cell->minDlResNonCsg = cellRecfg->csgParamCfg.minDlResNonCsg;
3661 cell->minUlResNonCsg = cellRecfg->csgParamCfg.minUlResNonCsg;
3664 errInfo->errCause = RGSCHERR_NONE;
3666 } /* rgSCHCfgRgrCellRecfg */
3669 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3673 * Function : rgSCHCfgRgrUeRecfgRntiChg
3676 * - If rnti changes,
3677 * - Invoke RAM for UE reconfiguration.
3678 * - Delete old UE from the list.
3679 * - Update the new rnti and re-insert the UE in the list.
3680 * - If successful, return ROK else RFAILED.
3682 * @param[in] RgSchCellCb *cell
3683 * @param[in] RgSchUeCb *ue
3684 * @param[in] RgrUeRecfg *ueRecfg
3685 * @param[out] RgSchErrInfo *errInfo
3690 static S16 rgSCHCfgRgrUeRecfgRntiChg
3694 RgrUeRecfg *ueRecfg,
3695 RgSchErrInfo *errInfo
3704 RgSchDlHqEnt **hqEnt = &(RG_SCH_CMN_GET_UE_HQE(ue, cell));
3707 /* Handle CRNTI change in reconfiguration */
3708 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
3710 RgSchRntiLnk *oldRntiLnk=NULLP;
3711 CmLteRnti oldRnti = 0;
3712 if ((raCb = rgSCHDbmGetRaCb(cell, ueRecfg->newCrnti)) == NULLP)
3714 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UEID:No RaCb exists while"
3715 "Reconfig for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3719 /* rntiLnk does not exist for a HandIn UE. Hence this check. */
3722 oldRntiLnk = ue->rntiLnk;
3726 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3730 RLOG2(L_INFO,"UE ID CHNG OLD %d new %d",ueRecfg->oldCrnti, ueRecfg->newCrnti);
3732 /* Fix : syed Deleting Old DL HqEnt. It would be assigned after
3733 * reest RACH(msg4) is completed. */
3734 rgSCHDhmDelHqEnt(cell, hqEnt);
3736 /* Initialize RAM related information for UE */
3737 ret = rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo);
3740 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"RAM Handling for UE Reconfig failed"
3741 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3744 /* Delete Ue from the ue list */
3745 rgSCHDbmDelUeCb(cell, ue);
3750 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3752 if(ue->cellInfo[sCellIdx] != NULLP)
3754 rgSCHDbmDelUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3760 /* Inititialize Ue control block */
3761 ue->ueId = ueRecfg->newCrnti;
3762 RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
3763 "Changing RNTI from %d to %d",
3769 rgSCHUtlUpdEmtcY(ue);
3773 /* Fix ccpu00122631: PCell_Reest: Updating new Rnti in all the cells
3776 for(idx = 0; idx < CM_LTE_MAX_CELLS; idx++)
3778 if(ue->cellInfo[idx])
3780 ue->cellInfo[idx]->dlAllocCb.rnti = ueRecfg->newCrnti;
3784 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3786 /* If raCb received PHR, update scheduler */
3787 if(raCb->phr.pres == TRUE)
3789 ue->macCeRptTime = raCb->msg3AllocTime;
3790 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3793 #ifdef RGR_V2 /* Acc Fix */
3794 if(TRUE == ue->isDrxEnabled)
3796 ueRecfg->ueDrxRecfg.isDrxEnabled = TRUE;
3797 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
3801 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE DRX re-est failed"
3802 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3806 #endif /* Acc Fix */
3808 /* Re-insert updated Ue */
3809 rgSCHDbmInsUeCb(cell, ue);
3814 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3816 if(ue->cellInfo[sCellIdx] != NULLP)
3818 rgSCHDbmInsUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3826 ue->tenbStats->stats.rnti = ue->ueId;
3829 /* Fix : syed If MSG4 is done, since corresponding ueCb
3830 * is ready, the raCb should be cleared immediately.
3831 * Otherwise it would remain in the cell until timed out
3832 * and till then the hq Feedbacks will be assumed to be
3834 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3836 RLOG_ARG1(L_DEBUG,DBG_CELLID,ueRecfg->cellId,
3837 "RNTI:%d with RaCb deleted as Msg4 transmission is done",
3839 rgSCHRamDelRaCb(cell, raCb, FALSE);
3841 /* Fix : syed moving the UL CQI initialization to UERESET */
3843 /* Release Older rnti */
3846 /* This is the rare case in which back to back reestablishment is
3847 * happening and previous re-est was not done completely (MSG4 was
3848 * not done) for an UE, and again re-est is triggered for the same
3849 * UE. We are deleting the old RA CB for the previous re-est which
3850 * still exist due to MSG4 not transmitted successfully */
3851 if ((oldRaCb = rgSCHDbmGetRaCb(cell, oldRntiLnk->rnti)) != NULLP)
3853 rgSCHRamDelRaCb(cell, oldRaCb, FALSE);
3856 rgSCHUtlRlsRnti(cell, oldRntiLnk, TRUE, ueRecfg->newCrnti);
3860 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3861 /* Just indicate to MAC, no need to release at SCH */
3862 RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
3863 "HO OldRnti:%d RLS and NewRnti:%d CHNG IND TO MAC",
3864 oldRnti, ueRecfg->newCrnti);
3865 rgSCHUtlIndRntiRls2Mac(cell, oldRnti, TRUE, ueRecfg->newCrnti);
3871 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3875 * Function : rgSCHCfgRgrUeRecfg
3878 * - If rnti changes,
3879 * - Invoke RAM for UE reconfiguration.
3880 * - Delete old UE from the list.
3881 * - Update the new rnti and re-insert the UE in the list.
3882 * - Update the UE control block with the reconfigured values.
3883 * - Invoke SCH, UHM and DHM with updated UE control block to
3884 * update scheduler, uplink HARQ and downlink HARQ specific
3886 * - If successful, return ROK else RFAILED.
3888 * @param[in] RgSchCellCb *cell
3889 * @param[in] RgSchUeCb *ue
3890 * @param[in] RgrUeRecfg *ueRecfg
3891 * @param[out] RgSchErrInfo *errInfo
3896 S16 rgSCHCfgRgrUeRecfg
3900 RgrUeRecfg *ueRecfg,
3901 RgSchErrInfo *errInfo
3906 Bool dciChange = TRUE;
3909 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RECFG;
3912 if (ue->numSCells > 0)
3916 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3917 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3919 ue->accessStratumRls = ueRecfg->accessStratumRls;
3923 /* if SCELL_RECFG is present , no other
3924 * type will be present. Process Scell addition
3927 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_ADD_RECFG)
3929 ret = rgSCHSCellCfgUeCfg(cell, ue, ueRecfg, errInfo);
3932 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
3933 /*FH: SCell config failed for a scell index hence revert all successful
3934 * Scell config and send negative confirmation to APP*/
3935 rgSCHSCellCfgUeCfgRollBack(cell, ue, ueRecfg);
3939 if (dciChange == TRUE)
3941 if (ue->numSCells > 0)
3944 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3948 /* 1 bit CSI Access Stratum Release Change */
3949 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3952 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_PUCCH_RECFG)
3954 ret = rgSCHSCellCfgUePucchReCfg(cell, ue, ueRecfg, errInfo);
3957 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_PUCCH_RECFG;
3962 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3963 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3965 ue->accessStratumRls = ueRecfg->accessStratumRls;
3966 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3968 #endif /* LTE_ADV */
3970 if (ueRecfg->ueRecfgTypes)
3972 /* Update scheduler related information for UE */
3973 ret = rgSCHUtlRgrUeRecfg(cell, ue, ueRecfg, errInfo);
3976 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
3977 "Scheduler handling while reconfig failed"
3978 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3982 /* Update uplink HARQ related information for UE */
3983 rgSCHUhmRgrUeRecfg(cell, ue, ueRecfg);
3985 /* Update TA related information for UE */
3986 if (ueRecfg->ueRecfgTypes & RGR_UE_TATMR_RECFG)
3988 rgSCHCfgUeTaRecfg(cell, ue, ueRecfg, errInfo);
3991 /*Update Measurement Gap and AckNack Details */
3992 /* After merging from 2.2 */
3993 if (ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG)
3995 ret = rgSCHMeasGapANRepUeRecfg(cell, ue, ueRecfg);
3998 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Measurement Gap and"
3999 "AckNack Rep Recfg failed for OLD CRNTI:%d NEW CRNTI:%d",
4000 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4004 if (ueRecfg->ueRecfgTypes & RGR_UE_BSRTMR_RECFG)
4006 cmInitTimers(&ue->bsrTmr, 1);
4007 ue->ul.bsrTmrCfg = ueRecfg->ueBsrTmrRecfg;
4008 if ((ue->ul.bsrTmrCfg.isPrdBsrTmrPres) &&
4009 (ue->ul.bsrTmrCfg.prdBsrTmr == 0xFFFF))
4011 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = FALSE;
4016 if (RFAILED == rgSCHCfgRgrUeRecfgRntiChg (cell, ue, ueRecfg, errInfo))
4018 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"RNTI change "
4019 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4020 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4025 /* Re-Initialize Aperiodic CQI Information for UE*/
4026 if ( ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
4028 ret = rgSCHCfgAcqiUeReCfg(cell, ue, &ueRecfg->aprdDlCqiRecfg,
4031 /* Re-Initialize Periodic CQI/PMI, RI Information for UE */
4032 if ( ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG)
4034 ret = rgSCHCfgPCqiUeReCfg(cell, ue, &ueRecfg->cqiCfg,
4037 /* Re-Initialize UL SRS Information for UE */
4038 if ( ueRecfg->ueRecfgTypes & RGR_UE_SRS_RECFG)
4040 ret = rgSCHCfgSrsUeReCfg(cell, ue, &ueRecfg->srsCfg);
4042 /* Re-Initialize SR Information for UE */
4043 if ( ueRecfg->ueRecfgTypes & RGR_UE_SR_RECFG)
4045 ret = rgSCHCfgSrUeReCfg(cell, ue, &ueRecfg->srCfg);
4050 if(ueRecfg->isHdFddEnbld)
4052 ret = rgSCHHdFddUeCfg(cell, ue, ueRecfg->isHdFddEnbld);
4055 errInfo->errCause = RGSCHERR_HDFDD_SPSCFGRD;
4059 #endif /* LTEMAC_HDFDD */
4061 if ( ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
4063 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
4067 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"UE DRX reconfig failed"
4068 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4069 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4074 /* ccpu00117452 - MOD - Changed macro name from
4075 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
4077 /* CQI Reporting (N) Re-configuration */
4078 if(ueRecfg->ueRecfgTypes & RGR_UE_CQIREPT_RECFG)
4080 ret = rgSCHCfgUeCqiReptReCfg(cell, ue, ueRecfg);
4083 errInfo->errCause = RGSCHERR_CQIREPT;
4087 #endif /* End of RGR_CQI_REPT */
4089 /* pA Re-configuration */
4090 if((ueRecfg->ueRecfgTypes & RGR_UE_PA_RECFG) &&
4091 RG_SCH_UE_CFG_ISPAPRSNT(ueRecfg->uePdschDedCfg.uepACfg))
4093 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
4094 RG_SCH_CMN_GET_PA(ue,cell).val = ueRecfg->uePdschDedCfg.uepACfg.pA;
4098 /* LTE_ADV_FLAG_REMOVED_START */
4099 if(ueRecfg->ueRecfgTypes & RGR_UE_LTEA_RECFG)
4101 if(ueRecfg->ueLteAdvCfg.pres & RGR_ABS)
4103 ue->lteAdvUeCb.rgrLteAdvUeCfg.isAbsUe = ueRecfg->ueLteAdvCfg.isAbsUe;
4106 if(ueRecfg->ueLteAdvCfg.pres & RGR_SFR)
4108 ue->lteAdvUeCb.rgrLteAdvUeCfg.isUeCellEdge = ueRecfg->ueLteAdvCfg.isUeCellEdge;
4111 /* LTE_ADV_FLAG_REMOVED_END */
4113 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_DPLXMODE_RECFG)
4115 rgSCHEmtcHdFddUeCfg (cell, ue,
4116 ueRecfg->emtcUeRecfg.isHdFddEnbld);
4118 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_PO_TRIGGER)
4120 rgSCHEmtcPOTrigger(cell, ue);
4123 errInfo->errCause = RGSCHERR_NONE;
4126 } /* rgSCHCfgRgrUeRecfg */
4130 * @brief Handler for the logical channel reconfiguration request from
4135 * Function : rgSCHCfgRgrLchRecfg
4138 * - Invoke scheduler to update scheduler specific information.
4139 * - Update the dedicated logical channel Cb with the reconfigured
4141 * - If successful, return ROK else RFAILED.
4143 * @param[in] RgUlCellCb *cell
4144 * @param[in] RgUlUeCb *ue
4145 * @param[in] RgSchUlLcCb *ulLc
4146 * @param[in] RgSchDlLcCb *dlLc
4147 * @param[in] RgrLchRecfg *lcRecfg
4148 * @param[out] RgSchErrInfo *errInfo
4153 S16 rgSCHCfgRgrLchRecfg
4158 RgrLchRecfg *lcRecfg,
4159 RgSchErrInfo *errInfo
4164 errInfo->errCause = RGSCHERR_CFG_RGR_LC_RECFG;
4165 /* Invoke Scheduler to update the new configuration */
4166 ret = rgSCHUtlRgrLcRecfg(cell, ue, dlLc, lcRecfg, errInfo);
4169 RLOG_ARG2(L_ERROR,DBG_CELLID,lcRecfg->cellId,"Scheduler handling for LC Recfg"
4170 " failed for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
4174 errInfo->errCause = RGSCHERR_NONE;
4176 } /* rgSCHCfgRgrLchRecfg */
4178 * @brief Handler for the logical channel reconfiguration request from
4183 * Function : rgSCHCfgRgrLcgRecfg
4186 * - Invoke scheduler to update scheduler specific information.
4187 * - Update the dedicated logical channel Cb with the re-configured
4189 * - If successful, return ROK else RFAILED.
4191 * @param[in] RgUlCellCb *cell
4192 * @param[in] RgUlUeCb *ue
4193 * @param[in] RgrLcgRecfg *lcgRecfg
4194 * @param[out] RgSchErrInfo *errInfo
4199 S16 rgSCHCfgRgrLcgRecfg
4203 RgrLcgRecfg *lcgRecfg,
4204 RgSchErrInfo *errInfo
4209 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_RECFG;
4211 /*Added for handling LCG ReConfig if the LCG was deleted */
4212 ue->ul.lcgArr[lcgRecfg->ulRecfg.lcgId].lcgId = lcgRecfg->ulRecfg.lcgId;
4214 /* Invoke Scheduler to update the new configuration */
4215 ret = rgSCHUtlRgrLcgRecfg(cell, ue, lcgRecfg, errInfo);
4218 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgRecfg->cellId,"Scheduler handling for LCG Recfg"
4219 " failed for CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
4223 errInfo->errCause = RGSCHERR_NONE;
4225 } /* rgSCHCfgRgrLcgRecfg */
4228 * @brief Handler for the UE Reset request from RRM to MAC.
4232 * Function : rgSCHCfgRgrUeReset
4235 * - Call Measument Gap Module and Ack/Nack Module for resetting UE.
4236 * - Call Common Schduler UE rest API which inturn will call scheduler
4237 * specific UE Reset APis to reset UE.
4239 * @param[in] RgSchCellCb *cell
4240 * @param[in] RgSchUeCb *ue
4241 * @param[in] RgrRst *reset
4242 * @param[out] RgSchErrInfo *errInfo
4247 S16 rgSCHCfgRgrUeReset
4252 RgSchErrInfo *errInfo
4258 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RESET;
4260 /* Setting BO of Each Logical Channel of the UE to 0 */
4261 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; idx++)
4263 if(ue->dl.lcCb[idx] != NULLP)
4264 ue->dl.lcCb[idx]->bo = 0;
4267 /* Reset the totalBo */
4269 /* Call DRX module to stop all DRX timers */
4271 if(ue->drxCb != NULLP)
4273 (Void)rgSCHDrxUeDel(cell,ue);
4276 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4277 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4279 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4280 ue->txModeTransCmplt =TRUE;
4283 /* ccpu00133470- Meas Gap should be released during RRC re-establishment */
4284 rgSCHMeasGapANRepUeDel(cell, ue, FALSE);
4286 /* Call Common scheduler which in turn will call specific scheduler for UE
4288 rgSCHUtlUeReset(cell, ue);
4290 /*PCell which is at idx 0 is always active. Adding a line after the loop
4291 *setting RGSCH_PCELL_INDEX to SCELL ACTIVE*/
4292 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
4295 /* In case of back to back reestablishments, when this UE's
4296 * previous ReEst is still in progress and has got RESET
4297 * as part of new ReEst */
4298 if((raCb = rgSCHDbmGetRaCb(cell, ue->ueId)) != NULLP)
4300 rgSCHRamDelRaCb(cell, raCb, FALSE);
4302 /* Fix : syed set UE inactive in DL until UE is reinitialization completed */
4303 ue->dl.dlInactvMask |= RG_HQENT_INACTIVE;
4304 ue->ul.ulInactvMask |= RG_HQENT_INACTIVE;
4305 /* [ccpu00127141] Resetting TA related parameters */
4306 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
4307 ue->dl.taCb.state = RGSCH_TA_IDLE;
4309 /*[ccpu00121813]-ADD-Initializing outstanding TA value */
4310 ue->dl.taCb.outStndngTa = FALSE;
4311 ue->dl.taCb.outStndngTaval = RGSCH_NO_TA_RQD;
4313 if (ue->dl.taCb.cfgTaTmr)
4315 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
4319 /* Resetting the Tx mode change factor on UE reset */
4320 ue->mimoInfo.txModUpChgFactor = 0;
4321 ue->mimoInfo.txModDownChgFactor = 0;
4324 errInfo->errCause = RGSCHERR_NONE;
4326 } /* rgSCHCfgRgrUeReset */
4329 * @brief Handler for the cell delete request from RRM to MAC.
4333 * Function : rgSCHCfgRgrCellDel
4336 * - Fetch the cell control block.
4337 * - Remove the cell control block from the hash list of cells.
4338 * - Free the cell control block.
4339 * - If successful, return ROK else return RFAILED.
4341 * @param[in] RgSchCellCb *cell
4342 * @param[in] RgrDel *cellDelInfo
4343 * @param[out] RgSchErrInfo *errInfo
4348 S16 rgSCHCfgRgrCellDel
4351 RgrDel *cellDelInfo,
4352 RgSchErrInfo *errInfo
4356 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_DEL;
4358 if (cell->cellId != cellDelInfo->u.cellDel.cellId)
4360 RLOG_ARG0(L_ERROR,DBG_CELLID,cellDelInfo->u.cellDel.cellId,
4361 "Cell does not exist");
4365 /* Free the active cell */
4366 rgSCHCfgFreeCellCb(cell);
4368 errInfo->errCause = RGSCHERR_NONE;
4370 } /* rgSCHCfgRgrCellDel */
4374 * @brief Handler for the UE delete request from RRM to MAC.
4378 * Function : rgSCHCfgRgrUeDel
4381 * - Fetch the UE control block.
4382 * - Remove the UE control block from the hash list of UEs for the cell.
4383 * - Free the UE control block.
4384 * - If successful, return ROK else return RFAILED.
4386 * @param[in] RgSchCellCb *cell
4387 * @param[in] RgrDel *ueDelInfo
4388 * @param[out] RgSchErrInfo *errInfo
4393 S16 rgSCHCfgRgrUeDel
4397 RgSchErrInfo *errInfo
4403 Inst inst = cell->instIdx;
4404 RgSchCellCb *secCellCb = NULLP;
4407 errInfo->errCause = RGSCHERR_CFG_RGR_UE_DEL;
4409 if (cell->cellId != ueDelInfo->u.ueDel.cellId)
4411 RLOG_ARG1(L_ERROR,DBG_CELLID,ueDelInfo->u.ueDel.cellId,
4412 "Cell does not exist CRNTI:%d",
4413 ueDelInfo->u.ueDel.crnti);
4416 if ((ue = rgSCHDbmGetUeCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4418 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4420 RLOG_ARG1(L_ERROR,DBG_CELLID,ueDelInfo->u.ueDel.cellId,
4421 "RaCb does not exist for CRNTI:%d",ueDelInfo->u.ueDel.crnti);
4426 /* This happens in case of Msg4 rejection */
4434 if(ueDelInfo->u.ueScellRel.ueDelTypes & RGR_UE_SCELL_DEL_RECFG)
4436 for(uint8_t idx = 0; idx < ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.numSCells; idx++)
4438 if(NULLP != (secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, \
4439 ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellId)))
4441 rgSCHUtlSndUeSCellDel2Mac(secCellCb, ue->ueId);
4442 rgSCHSCellDelUeSCell(cell,ue,ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellIdx);
4444 if ( ue->numSCells == 0)
4446 ue->allocCmnUlPdcch = TRUE;
4450 if (ue->numSCells == 0)
4452 /* As there is no SCell left so DCI 0 size at UE specific search space
4453 * will be recalculated as the CSI is reduced to 1 bit */
4454 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4460 /* Delete Ue from the UE list of CELL*/
4461 rgSCHDbmDelUeCb(cell, ue);
4464 rgSCHDbmDelL2MUe(cell, ue);
4467 /* Call MeasGap and AckNakRep processing module */
4468 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
4470 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4471 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4473 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4476 /* Call DRX module to remove UEs from various
4480 if(ue->drxCb != NULLP)
4482 (Void)rgSCHDrxUeDel(cell,ue);
4485 /*Fix: If RA CB exists, delete it*/
4486 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) != NULLP)
4488 /* Fix : syed RNTI was getting released twice, once by racb del
4489 * and subsequently by ueDel. Let it get released by ueDel alone */
4490 rgSCHRamDelRaCb(cell, raCb, FALSE);
4495 rgSCHEmtcUeDel(cell, ue);
4499 rgSCHCfgFreeUeCb(cell, ue);
4501 errInfo->errCause = RGSCHERR_NONE;
4506 } /* rgSCHCfgRgrUeDel */
4510 * @brief Handler for the logical channel delete request from
4515 * Function : rgSCHCfgRgrLcDel
4518 * - Fetch the logical channel control block.
4519 * - Free the logical channel control block.
4520 * - If successful, return ROK else return RFAILED.
4522 * @param[in] RgrDel *lcDelInfo
4523 * @param[out] RgSchErrInfo *errInfo
4528 S16 rgSCHCfgRgrLcDel
4532 RgSchErrInfo *errInfo
4543 errInfo->errCause = RGSCHERR_CFG_RGR_LC_DEL;
4545 /* Fetch the Active cell */
4546 if (cell->cellId != lcDelInfo->u.lchDel.cellId)
4548 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "Cell does not exist %d",
4549 lcDelInfo->u.lchDel.cellId);
4554 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lchDel.crnti)) == NULLP)
4556 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4557 "UE does not exist for CRNTI:%d LCID:%d",
4558 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4561 if (lcDelInfo->u.lchDel.lcgId > 3)
4563 RLOG_ARG3(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4564 "[%d]UEID:For LC %d, LCGid %d is invalid",
4565 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId,
4566 lcDelInfo->u.lchDel.lcgId);
4569 if ((dlLc = rgSCHDbmGetDlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
4572 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4573 "LC does not exist for CRNTI:%d LCID:%d",
4574 lcDelInfo->u.lchDel.crnti, lcDelInfo->u.lchDel.lcId);
4577 rgSCHUtlRgrLcDel(cell, ue, lcDelInfo->u.lchDel.lcId,lcDelInfo->u.lchDel.lcgId);
4579 /* Reduce any pending bo from this LC(if any)
4580 * from the UE's total BO */
4583 if(ue->totalBo >= dlLc->bo)
4585 ue->totalBo -= dlLc->bo;
4589 ue->totalBo = 0; /* this scenario should not occur */
4592 rgSCHDbmDelDlDedLcCb(ue, dlLc);
4593 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
4596 lcId = lcDelInfo->u.lchDel.lcId;
4597 if (TRUE == ue->ul.lcCb[lcId -1].isValid)
4599 ulLc = &(ue->ul.lcCb[lcId -1]);
4600 ue->ul.lcCb[lcId -1].isValid = FALSE;
4602 if((ulLc->qciCb->ulUeCount) &&
4603 (ue->ulActiveLCs & (1 << (ulLc->qciCb->qci -1))))
4605 ulLc->qciCb->ulUeCount--;
4606 ue->ulActiveLCs &= ~(1 << (ulLc->qciCb->qci -1));
4608 /* Shifting LCs in LCG Array because of LC deletion */
4609 for (idx = ulLc->lcgArrIdx +1; idx < ulLc->lcg->numLch;
4612 ulLc->lcg->lcArray[idx -1] =
4613 ulLc->lcg->lcArray[idx];
4614 ulLc->lcg->lcArray[idx -1]->lcgArrIdx = idx -1;
4616 ulLc->lcg->numLch--;
4617 ulLc->lcg->lcArray[idx -1] = NULLP;
4619 #endif /* LTE_L2_MEAS */
4622 errInfo->errCause = RGSCHERR_NONE;
4624 } /* rgSCHCfgRgrLcDel */
4629 * @brief Handler for the logical channel delete request from
4634 * Function : rgSCHCfgRgrLcgDel
4637 * - Fetch the logical channel control block.
4638 * - Free the logical channel control block.
4639 * - If successful, return ROK else return RFAILED.
4641 * @param[in] RgrDel *lcDelInfo
4642 * @param[out] RgSchErrInfo *errInfo
4647 S16 rgSCHCfgRgrLcgDel
4651 RgSchErrInfo *errInfo
4654 RgSchUeCb *ue = NULLP;
4656 uint8_t lcCount = 0;
4660 lcgId = lcDelInfo->u.lcgDel.lcgId;
4662 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_DEL;
4664 /* Fetch the Active cell */
4665 if (cell->cellId != lcDelInfo->u.lcgDel.cellId)
4667 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4668 "CELL does not exist for CRNTI:%d LCGID:%d",
4669 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4674 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lcgDel.crnti)) == NULLP)
4676 RLOG_ARG2(L_ERROR,DBG_CELLID,lcDelInfo->u.lchDel.cellId,
4677 "UE does not exist for CRNTI:%d LCGID:%d",
4678 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4682 /* set lcgId in UEs lcg cntrl blk to invalid */
4683 rgSCHUtlRgrLcgDel(cell, ue, lcgId);
4684 ue->ul.lcgArr[lcgId].lcgId = RGSCH_INVALID_LCG_ID;
4687 /* Since LCs are being deleted, if any of them are contributing
4688 to Active UE count for a QCI, decrease the count */
4689 for (lcCount =0; (lcCount < RGSCH_MAX_LC_PER_UE) &&
4690 (lcCount < ue->ul.lcgArr[lcgId].numLch) ; lcCount++)
4692 if (ue->ul.lcgArr[lcgId].lcArray[lcCount])
4694 if((ue->ul.lcgArr[lcgId].
4695 lcArray[lcCount]->qciCb->ulUeCount) &&
4697 (1 << ((ue->ul.lcgArr[lcgId].
4698 lcArray[lcCount])->qciCb->qci -1))))
4701 ue->ul.lcgArr[lcgId].
4702 lcArray[lcCount]->qciCb->ulUeCount--;
4703 ue->ulActiveLCs &= ~(1 <<
4704 (ue->ul.lcgArr[lcgId].
4705 lcArray[lcCount]->qciCb->qci -1));
4711 errInfo->errCause = RGSCHERR_NONE;
4713 } /* rgSCHCfgRgrLcgDel */
4717 /***********************************************************
4719 * Func : rgSCHCfgVldtRgrLcCfg
4722 * Desc : Validates dedicated logical channel configuration recieved from RRM.
4732 **********************************************************/
4733 S16 rgSCHCfgVldtRgrLcCfg
4739 RgSchErrInfo *errInfo
4743 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LC_CFG;
4745 if (((*cell) == NULLP) ||
4746 ((*cell)->cellId != lcCfg->cellId))
4748 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Cell does not existi for "
4749 "CRNTI:%d LCID:%d",lcCfg->crnti, lcCfg->lcId);
4754 if ((*ue = rgSCHDbmGetUeCb(*cell, lcCfg->crnti)) == NULLP)
4756 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"UE does not exist for dedicated"
4757 " logical channel CRNTI:%d LCID:%d", lcCfg->crnti, lcCfg->lcId);
4761 /* Validate logical channel Id */
4762 if ((lcCfg->lcId < RGSCH_DEDLC_MIN_LCID)
4763 ||(lcCfg->lcId > RGSCH_DEDLC_MAX_LCID))
4765 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid logical channel Id:%d"
4766 "for CRNTI:%d",lcCfg->lcId,lcCfg->crnti);
4770 if (lcCfg->lcType != CM_LTE_LCH_DTCH && lcCfg->lcType != CM_LTE_LCH_DCCH)
4772 RLOG_ARG3(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid logical channel Type %d"
4773 "CRNTI:%d LCID:%d",lcCfg->lcType,lcCfg->crnti, lcCfg->lcId);
4778 } /* rgSCHCfgVldtRgrLcCfg */
4780 /***********************************************************
4782 * Func : rgSCHCfgVldtRgrLcgCfg
4785 * Desc : Validates dedicated logical channel group configuration recieved from RRM.
4795 **********************************************************/
4796 S16 rgSCHCfgVldtRgrLcgCfg
4802 RgSchErrInfo *errInfo
4806 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LCG_CFG;
4808 if (((*cell) == NULLP) ||
4809 ((*cell)->cellId != lcgCfg->cellId))
4811 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgCfg->cellId,"Cell does not exist for"
4812 "CRNTI:%d LCGID:%d",lcgCfg->crnti,lcgCfg->ulInfo.lcgId);
4817 if ((*ue = rgSCHDbmGetUeCb(*cell, lcgCfg->crnti)) == NULLP)
4819 RLOG_ARG2(L_ERROR,DBG_CELLID,lcgCfg->cellId,"UE does not exist for "
4820 "dedicated logical channel CRNTI:%d LCGID:%d", lcgCfg->crnti, lcgCfg->ulInfo.lcgId);
4824 if ((lcgCfg->ulInfo.gbr != 0) && (lcgCfg->ulInfo.mbr < lcgCfg->ulInfo.gbr))
4830 } /* rgSCHCfgVldtRgrLcgCfg */
4833 /***********************************************************
4835 * Func : rgSCHCfgVldtRgrCellPwrCfg
4837 * Desc : Validates cell power configuration.
4847 **********************************************************/
4848 static S16 rgSCHCfgVldtRgrCellPwrCfg
4851 RgrCellCfg *cellCfg,
4852 RgSchErrInfo *errInfo
4859 /* This function does nothing now, placeholder for
4860 * subsequent power config validations that may be needed */
4864 } /* rgSCHCfgVldtRgrCellPwrCfg */
4867 /***********************************************************
4869 * Func : rgSCHCfgVldtRgrCmnLcCfg
4872 * Desc : Validates common logical channel configuration recieved from RRM.
4874 * @param[in] Inst inst
4875 * @param[in] RgrCellCfg *cellCfg
4876 * @param[out] RgSchErrInfo *errInfo
4885 **********************************************************/
4886 static S16 rgSCHCfgVldtRgrCmnLcCfg
4889 RgrCellCfg *cellCfg,
4890 RgSchErrInfo *errInfo
4894 RgrCmnLchCfg *lcCfg;
4895 uint8_t dirVld = FALSE;
4896 uint8_t bitMask = 0x00;
4899 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CMN_LC_CFG;
4901 for (idx = 0; idx < cellCfg->numCmnLcs; idx++)
4903 lcCfg = &(cellCfg->cmnLcCfg[idx]);
4904 /* Validate downlink info */
4905 if (lcCfg->dir & RGR_DIR_TX)
4907 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
4909 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
4913 bitMask |= RGSCH_BCCH_DLSCH_CFG1;
4920 (cellCfg->siCfg.siWinSize == 1) ||
4921 (cellCfg->siCfg.siWinSize == 2) ||
4922 (cellCfg->siCfg.siWinSize == 5) ||
4923 (cellCfg->siCfg.siWinSize == 10) ||
4924 (cellCfg->siCfg.siWinSize == 15) ||
4925 (cellCfg->siCfg.siWinSize == 20) ||
4926 (cellCfg->siCfg.siWinSize == 40)) &&
4927 (cellCfg->siCfg.retxCnt>0)
4930 bitMask |= RGSCH_BCCH_DLSCH_CFG2;
4934 RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,
4935 "Invalid si config for cell");
4940 else if (lcCfg->dlTrchType == CM_LTE_TRCH_BCH)
4942 bitMask |= RGSCH_BCCH_BCH_CFG;
4946 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,
4947 "Invalid transport channel %d for cell", lcCfg->dlTrchType);
4951 else if (lcCfg->lcType == CM_LTE_LCH_PCCH)
4953 bitMask |= RGSCH_PCCH_CFG;
4955 else if (lcCfg->lcType == CM_LTE_LCH_CCCH)
4957 bitMask |= RGSCH_DL_CCCH_CFG;
4962 /* Validate uplink info */
4963 if (lcCfg->dir & RGR_DIR_RX)
4966 if (lcCfg->lcType != CM_LTE_LCH_CCCH)
4968 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,"Invalid UL common lcType %d "
4969 "for cell", lcCfg->lcType);
4974 bitMask |= RGSCH_UL_CCCH_CFG;
4979 /* Invalid direction */
4982 RLOG_ARG1(L_ERROR,DBG_CELLID, cellCfg->cellId,"Invalid Direction %d",
4987 if (bitMask != RGSCH_CELL_ACTIVE_CFG)
4989 RLOG_ARG0(L_ERROR,DBG_CELLID, cellCfg->cellId,
4990 "Invalid Common channel config for cell");
4995 } /* rgSCHCfgVldtRgrCmnLcCfg */
4998 /***********************************************************
5000 * Func : rgSCHCfgVldtUeCqiModeCfg
5003 * Desc : Validates UE CQI modes Configuration recieved from RRC.
5013 **********************************************************/
5014 static S16 rgSCHCfgVldtUeCqiModeCfg
5017 RgrUeDlCqiCfg *ueDlCqiCfg
5022 if((ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx < 1) ||
5023 (ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx > 1024))
5025 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
5026 "Invalid Periodic CQI Info");
5030 /* Validate UE Aperiodic CQI mode */
5031 if ((ueDlCqiCfg->aprdCqiCfg.pres == TRUE) &&
5032 ((ueDlCqiCfg->aprdCqiCfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
5033 (cell->bwCfg.dlTotalBw <= 7)))
5035 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5036 "Invalid Aperiodic mode config for DL CQI",
5037 ueDlCqiCfg->aprdCqiCfg.aprdModeEnum);
5041 /* Validate UE Periodic CQI mode */
5042 if (ueDlCqiCfg->prdCqiCfg.prdModeEnum > RGR_PRD_CQI_MOD21)
5044 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5045 "Invalid periodic mode config for DL CQI",
5046 ueDlCqiCfg->prdCqiCfg.prdModeEnum);
5049 /* Validate K value in periodic CQI Config */
5050 if(((ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD20) ||
5051 (ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD21)) &&
5052 ((ueDlCqiCfg->prdCqiCfg.k < 1)||
5053 (ueDlCqiCfg->prdCqiCfg.k > 4)))
5055 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
5056 "Invalid K for Subband CQI reporting");
5060 if ((ueDlCqiCfg->prdCqiCfg.type == 1) &&
5061 (ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
5063 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
5064 "Invalid periodic mode config for DL CQI",
5065 ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum);
5074 /***********************************************************
5076 * Func : rgSCHCfgVldtUeMeasGapAckNakRepCfg
5079 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5089 **********************************************************/
5090 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg
5098 if ((ueCfg->ackNackModeEnum == RGR_TDD_ACKNACK_MODE_MULT) &&
5099 (ueCfg->ueAckNackCfg.isAckNackEnabled == TRUE))
5101 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"TDD ACK NACK Multiplexing Mode"
5102 "is not allowed when Ack/Nack is Enabled: %d CRNTI:%d",
5103 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5106 #endif /* LTE_TDD */
5107 /* Validate AckNackRep Factor */
5108 if((ueCfg->ueAckNackCfg.isAckNackEnabled == FALSE) &&
5109 (!ueCfg->ueMesGapCfg.isMesGapEnabled))
5114 if(ueCfg->ueAckNackCfg.isAckNackEnabled)
5116 if ( (ueCfg->ueAckNackCfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5117 || (ueCfg->ueAckNackCfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5119 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId, "Invalid ACK NACK REP Factor:%d CRNTI:%d",
5120 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5124 if(ueCfg->ueMesGapCfg.isMesGapEnabled)
5126 switch(ueCfg->ueMesGapCfg.gapPrd)
5128 case RG_MEAS_GAPPRD_40:
5129 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_40)
5131 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Offset:%d CRNTI:%d",
5132 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5136 case RG_MEAS_GAPPRD_80:
5137 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_80)
5139 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Offset:%d CRNTI:%d",
5140 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5146 RLOG_ARG2(L_ERROR,DBG_CELLID,ueCfg->cellId,"Invalid GAP Periodicity Settings:%d"
5147 "CRNTI:%d", ueCfg->ueMesGapCfg.gapPrd,ueCfg->crnti);
5154 } /* rgSCHCfgVldtUeMeasGapAckNakRepCfg*/
5157 /***********************************************************
5159 * Func : rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5162 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5172 **********************************************************/
5173 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5180 if((ueRecfg->ueAckNackRecfg.isAckNackEnabled == FALSE) &&
5181 (!ueRecfg->ueMeasGapRecfg.isMesGapEnabled))
5186 if(ueRecfg->ueAckNackRecfg.isAckNackEnabled )
5188 /* Validate AckNackRep Factor */
5189 if ( (ueRecfg->ueAckNackRecfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5190 || (ueRecfg->ueAckNackRecfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5192 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid ACK NACK REP Factor:%d"
5193 "NEW CRNTI:%d",ueRecfg->ueAckNackRecfg.ackNackRepFactor,ueRecfg->newCrnti);
5197 if(ueRecfg->ueMeasGapRecfg.isMesGapEnabled)
5199 switch(ueRecfg->ueMeasGapRecfg.gapPrd)
5201 case RG_MEAS_GAPPRD_40:
5202 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_40)
5204 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Offset:%d"
5205 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5209 case RG_MEAS_GAPPRD_80:
5210 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_80)
5212 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Offset:%d"
5213 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5219 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid GAP Periodicity Settings:%d"
5220 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapPrd,ueRecfg->newCrnti);
5227 } /* rgSCHCfgVldtUeMeasGapAckNakRepRecfg*/
5230 /***********************************************************
5232 * Func : rgSCHCfgVldtUeDlSpsCfg
5235 * Desc : Validates UE's DL SPS configuration recieved from RRC.
5245 **********************************************************/
5246 static S16 rgSCHCfgVldtUeDlSpsCfg
5249 RgrUeSpsDlCfg *dlSpsCfg
5255 /* peridicity validation done in SPS module */
5256 if ((dlSpsCfg->numPucchVal > RG_SCH_MAX_NUM_N1PUCCH_PER_UE) ||
5257 (dlSpsCfg->numPucchVal == 0))
5259 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid number of n1Pucch values"
5260 " in DL SPS Config");
5264 for (idx = 0; idx < dlSpsCfg->numPucchVal; ++idx)
5266 if (dlSpsCfg->n1PucchVal[idx] > RG_SCH_MAX_N1PUCCH_VAL)
5269 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid N1Pucch value"
5270 " in DL SPS Config %u", dlSpsCfg->n1PucchVal[idx]);
5272 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid N1Pucch value"
5273 " in DL SPS Config %lu", dlSpsCfg->n1PucchVal[idx]);
5278 /* SPS_TODO: check will change for TDD */
5279 if ((dlSpsCfg->numSpsHqProc == 0) ||
5280 (dlSpsCfg->numSpsHqProc > RGSCH_MAX_DL_HQ_PROC))
5282 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid number of SPS HARQ procs"
5283 " in DL SPS Config");
5288 } /* rgSCHCfgVldtDlSpsCfg */
5289 #endif /* LTEMAC_SPS */
5291 /***********************************************************
5293 * Func : rgSCHCfgVldtUePwrCfg
5296 * Desc : Validates UE Group power configuration recieved from RRC.
5306 **********************************************************/
5307 static S16 rgSCHCfgVldtUePwrCfg
5310 RgrUeUlPwrCfg *pwrCfg
5314 /* Group power control works only in accumulated mode */
5315 if (!pwrCfg->isAccumulated)
5318 if (pwrCfg->uePuschPwr.pres)
5320 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Accumulation configutation"
5321 " not in sync with group power configuration");
5326 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePuschPwr) != ROK)
5328 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid PUSCH Group power"
5332 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePucchPwr) != ROK)
5334 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid PUSCH Group power"
5340 } /* rgSCHCfgVldtUePwrCfg */
5342 /***********************************************************
5344 * Func : rgSCHCfgVldtUeGrpPwrCfg
5347 * Desc : Validates UE Group power configuration recieved from RRC.
5357 **********************************************************/
5358 static S16 rgSCHCfgVldtUeGrpPwrCfg
5361 RgrUeGrpPwrCfg *grpPwrCfg
5365 if ((grpPwrCfg->pres) &&
5366 (((grpPwrCfg->tpcRnti > cell->rntiDb.rntiStart) &&
5367 ((grpPwrCfg->tpcRnti <
5368 (cell->rntiDb.rntiStart + cell->rntiDb.maxRntis))))))
5370 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Uplink Group power "
5376 } /* rgSCHCfgVldtUeGrpPwrCfg */
5379 /***********************************************************
5381 * Func : rgSCHCfgVldtSpsReCfg
5384 * Desc : Validates UE SPS and other SPS dependent
5385 * configuration recieved from RRC.
5395 **********************************************************/
5396 static S16 rgSCHCfgVldtSpsReCfg
5404 if ((ueRecfg->ueRecfgTypes & RGR_UE_DLSPS_RECFG) &&
5405 (ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled))
5407 /* Validating SPS RNTI */
5408 if (((ueRecfg->ueSpsRecfg.spsRnti >= cell->rntiDb.rntiStart) &&
5409 (ueRecfg->ueSpsRecfg.spsRnti<=
5410 (cell->rntiDb.rntiStart+cell->rntiDb.maxRntis)))||
5411 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_SI_RNTI) ||
5412 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_P_RNTI))
5414 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid SPS RNTI "
5415 " in DL SPS Recfg OLD CRNTI:%d NEW CCRNTI:%d",
5416 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5419 if (rgSCHCfgVldtUeDlSpsCfg(cell, &ueRecfg->ueSpsRecfg.dlSpsCfg) != ROK)
5421 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid DL SPS configuration"
5422 " for the OLD CRNTI:%d NEW CRNTI:%d",
5423 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5429 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5431 if (ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
5433 /* ccpu00117035 - MOD - changed instIdx to inst */
5434 /* ccpu00117035 - MOD - changed ueID to oldCrnti*/
5435 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5436 " DRX reconfig not supported DL SPS enabled for OLD CRNTI:%d NEW CRNTI:%d",
5437 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5442 /* ccpu00117627 - ADD - SPS recfg validation against HDFDD */
5444 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5446 if(ue->hdFddEnbld == TRUE)
5448 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5449 "DL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5450 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5454 if(ueRecfg->ueSpsRecfg.ulSpsCfg.isUlSpsEnabled)
5456 if(ue->hdFddEnbld == TRUE)
5458 RLOG_ARG2(L_ERROR,DBG_CELLID,ueRecfg->cellId,
5459 "UL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5460 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5467 } /*rgSCHCfgVldtSpsReCfg*/
5470 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
5471 /***********************************************************
5473 * Func : rgSCHCfgVldtCqiReptReCfg
5476 * Desc : Validates UE CQI report for DL Power control
5477 * configuration recieved from RRC.
5487 **********************************************************/
5488 static S16 rgSCHCfgVldtCqiReptReCfg
5495 /* Validate DL Power Control Config parameters */
5496 if (ueRecfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
5498 RLOG_ARG3(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalide numColltdCqiRept,"
5499 "MAX supported %d for OLD CRNTI:%d NEW CRNTI:%d",RGR_CQIRPTS_MAXN,
5500 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5505 } /*rgSCHCfgVldtCqiReptReCfg*/
5508 /***********************************************************
5510 * Func : rgSCHCfgRgrLcChfg
5513 * Desc : Handles dedicated logical channel configuration
5514 * recieved from RRC.
5524 **********************************************************/
5525 S16 rgSCHCfgRgrLchCfg
5530 RgSchErrInfo *errInfo
5534 RgSchDlLcCb *dlLc = NULLP;
5535 Inst inst = cell->instIdx;
5540 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LC_CFG;
5542 /* Allocate the downlink logical channel control block */
5543 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&dlLc,
5544 sizeof(RgSchDlLcCb))) != ROK)
5546 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Memory allocation FAILED for "
5547 "Downlink LCId:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5550 if ((uint8_t *)dlLc == NULLP)
5552 RLOG_ARG2(L_ERROR,DBG_CELLID,lcCfg->cellId,"Memory allocation FAILED for "
5553 "Downlink LCID:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5556 dlLc->lcId = lcCfg->lcId;
5558 rgSCHLaaLcCfg(cell, dlLc, lcCfg);
5561 rgSCHDbmInsDlDedLcCb(ue, dlLc);
5563 ret = rgSCHUtlRgrLcCfg(cell, ue, dlLc, lcCfg, errInfo);
5570 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5571 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5574 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
5575 "configuration failed at SCH:UEID:%d LCID:%d CRNTI:%d",
5576 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5580 RGSCH_ARRAY_BOUND_CHECK(inst, ue->ul.lcCb, (lcCfg->lcId -1));
5581 if ( !lcCfg->lcId ||
5582 (TRUE == ue->ul.lcCb[lcCfg->lcId -1].isValid))
5587 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5588 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5591 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
5592 "configuration failed at SCH: UL LC CB already existing"
5593 " UEID:%d LCID:%d CRNTI:%d",
5594 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5598 /* Create UL LC context to maintain LCG to LC mapping and
5599 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5601 ue->ul.lcCb[lcCfg->lcId -1].isValid = TRUE;
5602 ulLc = &(ue->ul.lcCb[lcCfg->lcId -1]);
5604 ulLc->lcId = lcCfg->lcId;
5605 ulLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5606 ulLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5607 ue->ul.lcgArr[lcCfg->lcgId].lcArray[ue->ul.lcgArr[lcCfg->lcgId].numLch] = ulLc;
5608 ulLc->lcg = &ue->ul.lcgArr[lcCfg->lcgId];
5609 ulLc->lcgArrIdx = ue->ul.lcgArr[lcCfg->lcgId].numLch;
5610 ue->ul.lcgArr[lcCfg->lcgId].numLch++;
5612 dlLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5613 dlLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5614 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
5616 rgSchAddToL2Meas(cell,dlLc); /*LTE_L2_MEAS_PHASE2*/
5618 #endif /* LTE_L2_MEAS */
5621 } /* rgSCHCfgRgrLchCfg */
5623 /***********************************************************
5625 * Func : rgSCHCfgRgrLcgCfg
5628 * Desc : Handles dedicated logical channel group configuration
5629 * recieved from RRM.
5639 **********************************************************/
5640 S16 rgSCHCfgRgrLcgCfg
5645 RgSchErrInfo *errInfo
5651 //#ifdef LTE_L2_MEAS
5656 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LCG_CFG;
5658 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = lcgCfg->ulInfo.lcgId;
5660 ret = rgSCHUtlRgrLcgCfg(cell, ue, lcgCfg, errInfo);
5663 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Dedicated logical channel "
5664 "configuration failed at SCH: UEID:%d LCGID:%d CRNTI:%d",
5665 ue->ueId, lcgCfg->ulInfo.lcgId,lcgCfg->crnti);
5666 /* Roll back lcgCfg */
5667 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = RGSCH_INVALID_LCG_ID;
5668 rgSCHUtlRgrLcgDel(cell, ue, lcgCfg->ulInfo.lcgId);
5672 //#ifdef LTE_L2_MEAS
5673 /* Copy all info of UL LCH in cfg to ulLcgCb */
5674 for (idx = 0; idx < lcgCfg->ulInfo.numLch; idx++)
5676 /* Allocate the uplink logical channel control block */
5677 if((ret = rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&ulLc,
5678 sizeof(RgSchUlLcCb))) != ROK)
5680 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Memory allocation FAILED for ");
5683 if ((uint8_t *)ulLc == NULLP)
5685 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Memory allocation FAILED for ");
5688 /* Create UL LC context to maintain LCG to LC mapping and
5689 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5691 ulLc->lcId = lcgCfg->ulInfo.lchUlCfg[idx].lcId;
5692 ulLc->qciCb = &(cell->qciArray[lcgCfg->ulInfo.lchUlCfg[idx].qci]);
5693 ulLc->qciCb->qci = lcgCfg->ulInfo.lchUlCfg[idx].qci;
5694 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcArray[idx] = ulLc;
5696 ue->ul.lcCb[ulLc->lcId -1] = ulLc;
5697 ulLc->lcg = &ue->ul.lcgArr[lcgCfg->ulInfo.lcgId];
5698 ulLc->lcgArrIdx = idx;
5700 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].numLch = lcgCfg->ulInfo.numLch;
5701 #endif /* LTE_L2_MEAS */
5704 } /* rgSCHCfgRgrLcgCfg */
5708 /***********************************************************
5710 * Func : rgSCHCfgRgrCmnLcCfg
5713 * Desc : Handles dedicated logical channel configuration
5714 * recieved from RRC.
5724 **********************************************************/
5725 static S16 rgSCHCfgRgrCmnLcCfg
5728 RgrCmnLchCfg *lcCfg,
5729 RgSchErrInfo *errInfo
5732 RgSchClcDlLcCb cmnLcCb;
5734 errInfo->errCause = RGSCHERR_CFG_RGR_CMN_LC_CFG;
5736 memset(&cmnLcCb, 0, sizeof(cmnLcCb));
5738 /* Handle configuration for CCCH/BCCH/PCCH */
5739 if (lcCfg->lcType == CM_LTE_LCH_CCCH)
5741 /* UL and DL CCCH configuration */
5742 if (lcCfg->dir & RGR_DIR_TX)
5744 cell->dlCcchId = lcCfg->lcId;
5747 if (lcCfg->dir & RGR_DIR_RX)
5749 cell->ulCcchId = lcCfg->lcId;
5754 cmnLcCb.lcId = lcCfg->lcId;
5755 rgSCHDbmInitCmnLcBoLst(&cmnLcCb);
5756 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
5758 /* BCCH on BCH and DLSCH configuration */
5759 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
5761 rgSCHDbmInsBcchOnDlsch(cell, &cmnLcCb);
5765 rgSCHDbmInsBcchOnBch(cell, &cmnLcCb);
5768 else /* PCCH configuration */
5770 rgSCHDbmInsPcch(cell, &cmnLcCb);
5775 } /* rgSCHCfgRgrCmnLcCfg */
5779 /***********************************************************
5781 * Func : rgSCHCfgFreeDlDedLcCb
5785 * - Processing Steps:
5786 * - Frees downlink dedicated logical channel control block.
5794 **********************************************************/
5795 static Void rgSCHCfgFreeDlDedLcCb
5802 Inst inst = cell->instIdx;
5804 rgSCHUtlFreeDlLc(cell, ue, dlLc);
5806 /* De-allocate the Cb */
5807 /* ccpu00117052 - MOD - Passing double pointer
5808 for proper NULLP assignment*/
5809 rgSCHUtlFreeSBuf(inst, (Data **)&dlLc, sizeof(*dlLc));
5812 /* Stack Crash problem for TRACE5 changes. Added the return below */
5815 } /* rgSCHCfgFreeDlDedLcCb */
5818 /***********************************************************
5820 * Func : rgSCHCfgFreeDlCmnLcCb
5824 * - Processing Steps:
5825 * - Frees downlink common logical channel control block.
5833 **********************************************************/
5834 static Void rgSCHCfgFreeDlCmnLcCb(RgSchClcDlLcCb *cmnDlLc)
5837 memset(cmnDlLc, 0, sizeof(*cmnDlLc));
5838 cmnDlLc->lcId = RGSCH_INVALID_LC_ID;
5840 } /* rgSCHCfgFreeDlCmnLcCb */
5843 /***********************************************************
5845 * Func : rgSCHCfgFreeCellCb
5849 * - Processing Steps:
5850 * - Frees scheduler cell control block.
5858 **********************************************************/
5859 Void rgSCHCfgFreeCellCb(RgSchCellCb *cell)
5861 Inst inst = cell->instIdx;
5864 RgSchWarningSiInfo *warningSi;
5865 RgSchWarningSiPdu *warningSiPdu;
5868 /* ccpu00132385- SI Warning PDUs which are not processed need to be deleted */
5869 /* Search for used index in WarningSi */
5870 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
5872 if(cell->siCb.warningSi[idx].siId == 0)
5874 cell->siCb.siCtx.siId = cell->siCb.warningSi[idx].siId;
5875 warningSi = (RgSchWarningSiInfo *) cell->siCb.
5876 siArray[cell->siCb.siCtx.siId-1].si;
5877 if(warningSi != NULLP)
5879 /* ccpu00136659: CMAS ETWS design change */
5880 while (CM_LLIST_FIRST_NODE(&warningSi->warningSiMsg.segLstCp, node))
5882 warningSiPdu = (RgSchWarningSiPdu *)node->node;
5883 pdu = warningSiPdu->pdu;
5884 /* ccpu00136659: CMAS ETWS design change */
5885 cmLListDelFrm(&warningSi->warningSiMsg.segLstCp, node);
5886 RGSCH_FREE_MSG(pdu);
5888 cell->siCb.siArray[cell->siCb.siCtx.siId-1].si = NULLP;
5891 /* Free lists of the cell */
5892 rgSCHCfgFreeUeLst(cell);
5894 rgSCHCfgFreeSpsUeLst(cell);
5895 #endif /* LTEMAC_SPS */
5897 if ( TRUE == cell->emtcEnable )
5899 rgSCHEmtcCellDel(cell);
5902 rgSCHRamFreeCell(cell);
5904 rgSCHDbmRntiDbDeInit(cell);
5905 /* Deallocate the subframe allocation information */
5906 rgSCHUtlPutSfAlloc(cell);
5907 rgSCHUtlFreeCell(cell);
5909 rgSCHCfgFreeRgrCfgLst(cell);
5910 rgSCHCfgFreeCmnLcLst(cell);
5912 rgSCHUtlPutRlsHqAlloc(cell);
5915 rgSCHDbmDeInitUeTfuPendLst(cell);
5916 #endif /* LTE_TDD */
5919 rgSCHUtlPutSiInfo(cell);
5920 #endif/*RGR_SI_SCH*/
5922 (Void)rgSCHDrxCellDel(cell);
5924 rgSCHUtlFreeSBuf(inst, (Data**)&(cell->dynCfiCb.cceFailSamples),
5925 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)));
5928 TSL2DeallocCellStatsBlk(cell->cellId);
5932 /* LAA_SCELL: Trigger the De-Init function for the LAA Module */
5933 rgSCHLaaSCellCbDeInit(cell);
5937 if(cell->emtcEnable)
5939 rgSCHEmtcCellFree(cell);
5942 /* De-allocate the Cell */
5943 /* ccpu00117052 - MOD - Passing double pointer
5944 for proper NULLP assignment*/
5945 rgSCHUtlFreeSBuf(inst, (Data **)&cell, sizeof(*cell));
5949 /* Stack Crash problem for TRACE5 changes. Added the return below */
5952 } /* rgSCHCfgFreeCellCb */
5955 /***********************************************************
5957 * Func : rgSCHCfgFreeUeCb
5961 * - Processing Steps:
5962 * - Frees UE control block.
5970 **********************************************************/
5971 static Void rgSCHCfgFreeUeCb
5977 RgSchCmnUlUe *ueUl = RG_SCH_CMN_GET_UL_UE(ue, cell);
5978 RgUeUlHqCb *ulHqEnt;
5980 Inst inst = cell->instIdx;
5984 /* Free all logical channel info per UE */
5985 while((dlLc = rgSCHDbmGetNextDlDedLcCb(ue, NULLP)) != NULLP)
5987 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5988 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5990 for (lcCnt =0; lcCnt<RGSCH_MAX_LC_PER_UE; lcCnt++)
5992 if(ue->ul.lcCb[lcCnt].isValid == TRUE)
5994 lcgId = ue->ul.lcCb[lcCnt].lcg->lcgId;
5997 rgSCHUtlRgrLcDel(cell, ue, ue->ul.lcCb[lcCnt].lcId,lcgId);
5998 ue->ul.lcCb[lcCnt].isValid = FALSE;
6003 ulHqEnt = &(ueUl->hqEnt);
6004 /* Free Scheduler specific information per UE */
6005 rgSCHUtlFreeUe(cell, ue);
6007 /* Free Uplink HARQ specific information per UE */
6008 rgSCHUhmFreeUe(cell, ulHqEnt);
6010 if ( ue->drxCb != NULLP)
6013 /* ccpu00117052 - MOD - Passing double pointer
6014 for proper NULLP assignment*/
6015 rgSCHUtlFreeSBuf(cell->instIdx,
6016 (Data**)(&(ue->drxCb)),
6017 sizeof(RgSchDrxUeCb));
6020 ue->drxCb = (RgSchDrxUeCb *)NULLP;
6021 /* Free Downlink HARQ specific information per UE */
6023 /* Release the RNTI */
6026 rgSCHUtlRlsRnti(cell, ue->rntiLnk, FALSE, 0);
6030 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
6031 /* Just indicate to MAC, no need to release at SCH */
6032 rgSCHUtlIndRntiRls2Mac(cell, ue->ueId, FALSE, 0);
6034 /* rg009.201. Added changes of TFU_UPGRADE */
6036 rgSCHCfgPCqiSrsSrUeDel(cell,ue);
6039 rgSCHHdFddUeDel(cell, ue);
6044 TSL2DeallocUeStatsBlk(ue->ueId, ue->tenbStats);
6048 /* CA TODO Some handling needed while SCell Delete*/
6050 /* Delete the UE from the PCell secCellActCeLst*/
6051 rgSCHSCellRmvFrmActLst(cell, ue);
6052 rgSCHSCellDelUe(cell,ue);
6056 rgSCHLaaDeInitDlRbAllocCb(cell, &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb);
6059 rgSCHUtlFreeSBuf(inst, (Data **)&ue->cellInfo[0], sizeof(RgSchUeCellInfo));
6060 /* De-allocate the Ue */
6061 /* ccpu00117052 - MOD - Passing double pointer
6062 for proper NULLP assignment*/
6066 rgSCHEmtcUeInfoFree(cell, ue);
6069 rgSCHUtlFreeSBuf(inst, (Data **)&ue, sizeof(*ue));
6071 /* Stack Crash problem for TRACE5 changes. Added the return below */
6074 } /* rgSCHCfgFreeUeCb */
6076 /***********************************************************
6078 * Func : rgSCHCfgFreeRgrCfgLst
6082 * - Processing Steps:
6083 * - Frees configuration lists in cell control block.
6091 **********************************************************/
6092 static Void rgSCHCfgFreeRgrCfgLst
6097 RgSchCfgElem *rgCfgElem;
6098 Inst inst = cell->instIdx;
6100 /* Free CURRENT RGR cfg list */
6101 while ((rgCfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
6103 rgSCHDbmDelCrntRgrCfgElem(cell, rgCfgElem);
6104 /* ccpu00117052 - MOD - Passing double pointer
6105 for proper NULLP assignment*/
6106 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6109 /* Free PENDING RGR cfg list */
6110 while ((rgCfgElem = rgSCHDbmGetNextPndngRgrCfgElem(cell, NULLP)) != NULLP)
6112 rgSCHDbmDelPndngRgrCfgElem(cell, rgCfgElem);
6113 /* ccpu00117052 - MOD - Passing double pointer
6114 for proper NULLP assignment*/
6115 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6119 /* Stack Crash problem for TRACE5 changes. Added the return below */
6122 } /* rgSCHCfgFreeRgrCfgLst */
6125 /***********************************************************
6127 * Func : rgSCHCfgFreeCmnLcLst
6131 * - Processing Steps:
6132 * - Frees common logical channels in cell control block.
6140 **********************************************************/
6141 static Void rgSCHCfgFreeCmnLcLst
6146 RgSchClcDlLcCb *dlCmnLc;
6149 if ((dlCmnLc = rgSCHDbmGetBcchOnBch(cell)) != NULLP)
6151 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6153 if ((dlCmnLc = rgSCHDbmGetFirstBcchOnDlsch(cell)) != NULLP)
6155 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6157 if ((dlCmnLc = rgSCHDbmGetSecondBcchOnDlsch(cell)) != NULLP)
6159 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6161 if ((dlCmnLc = rgSCHDbmGetPcch(cell)) != NULLP)
6163 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6167 /* Stack Crash problem for TRACE5 changes. Added the return below */
6170 } /* rgSCHCfgFreeCmnLcLst */
6173 /***********************************************************
6175 * Func : rgSCHCfgFreeUeLst
6179 * - Processing Steps:
6180 * - Frees UE list in cell control block.
6188 **********************************************************/
6189 static Void rgSCHCfgFreeUeLst
6196 RgSchUeCellInfo *sCellInfo;
6200 /* Free Ues in the list */
6201 while ((ue = rgSCHDbmGetNextUeCb(cell, NULLP)) != NULLP)
6203 rgSCHDbmDelUeCb(cell, ue);
6206 if(ue->cell != cell)
6212 /* Call MeasGap and AckNakRep processing module */
6213 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
6215 rgSCHCfgFreeUeCb(cell, ue);
6218 /* De-initialize the Ue list */
6219 rgSCHDbmDeInitUeCbLst(cell);
6223 node = cell->sCellUeLst.first;
6226 sCellInfo = (RgSchUeCellInfo *)node->node;
6228 rgSCHSCellDelUeSCell(sCellInfo->ue->cell, sCellInfo->ue, sCellInfo->sCellIdx);
6232 /* Stack Crash problem for TRACE5 changes. Added the return below */
6235 } /* rgSCHCfgFreeUeLst */
6238 /***********************************************************
6240 * Func : rgSCHCfgFreeSpsUeLst
6244 * - Processing Steps:
6245 * - Frees Sps UE list in cell control block.
6253 **********************************************************/
6254 static Void rgSCHCfgFreeSpsUeLst(RgSchCellCb *cell)
6258 /* Free Ues in the list */
6259 while ((ue = rgSCHDbmGetNextSpsUeCb(cell, NULLP)))
6261 rgSCHDbmDelSpsUeCb(cell, ue);
6264 /* De-initialize the Ue list */
6265 rgSCHDbmDeInitSpsUeCbLst(cell);
6267 } /* rgSCHCfgFreeSpsUeLst */
6269 #endif /* LTEMAC_SPS */
6272 /***********************************************************
6274 * Func : rgSCHCfgVldtRgrCellSiCfg
6276 * Desc : Validates SI Configuration for SI
6286 **********************************************************/
6287 static S16 rgSCHCfgVldtRgrCellSiCfg
6293 uint8_t idx; /* idx for iteration */
6298 /* Check that retxCnt value should be <= value of siWinSize.
6299 This validation is only applicable for FDD mode. */
6300 if(siCfg->retxCnt > siCfg->siWinSize)
6302 RLOG0(L_ERROR,"retxCnt is greater than siWinSize, validation failed");
6307 /* Validate that a valid value for numSi has been specified */
6308 if(siCfg->numSi > RGR_MAX_NUM_SI)
6310 RLOG0(L_ERROR,"Validation for numSi in SI CFG failed");
6314 /* MinPeriodicity will have the least configured periodicity
6315 * Hence initializing with Max periodicity */
6316 siCfg->minPeriodicity = RGR_SI_PERD_512;
6318 /*Validate the value of periodicity specified for SIs */
6319 for(idx = 0;idx < siCfg->numSi;idx++)
6321 siCfg->minPeriodicity = RGSCH_MIN(siCfg->minPeriodicity,
6322 siCfg->siPeriodicity[idx]);
6323 /* Set the siPeriodicity as a multiple of 80 subframes */
6324 switch(siCfg->siPeriodicity[idx])
6327 case RGR_SI_PERD_16:
6328 case RGR_SI_PERD_32:
6329 case RGR_SI_PERD_64:
6330 case RGR_SI_PERD_128:
6331 case RGR_SI_PERD_256:
6332 case RGR_SI_PERD_512:
6336 RLOG0(L_ERROR,"Validation for SI Periodicity in SI-CFG failed");
6342 } /* rgSCHCfgVldtRgrCellSiCfg */
6344 /* LTE_ADV_FLAG_REMOVED_START */
6345 /***********************************************************
6347 * Func : rgSCHCfgVldtRgrCellLtrAdvCfg
6349 * Desc : Validates Lte Adv Configuration
6359 **********************************************************/
6360 static S16 rgSCHCfgVldtRgrCellLteAdvCfg
6363 RgrLteAdvancedCellConfig *lteAdvCfg,
6367 uint8_t temp[RGR_ABS_PATTERN_LEN];
6371 if((lteAdvCfg->pres & RGR_SFR) && (RGR_ENABLE == lteAdvCfg->sfrCfg.status))
6373 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.startRb > lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb)
6375 RLOG0(L_ERROR,"Invalid configuration of cell edge bandwidth for SFR feature");
6379 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb >= dlTotalBw)
6381 RLOG0(L_ERROR,"Invalid configuration of cell edge end RB for SFR feature");
6386 if(lteAdvCfg->sfrCfg.pwrThreshold.pLow >= lteAdvCfg->sfrCfg.pwrThreshold.pHigh)
6388 RLOG0(L_ERROR,"Invalid configuration of power threshold for SFR feature");
6394 if((lteAdvCfg->pres & RGR_ABS) && (RGR_ENABLE == lteAdvCfg->absCfg.status))
6396 if((RGR_ABS_MUTE != lteAdvCfg->absCfg.absPatternType) &&
6397 (RGR_ABS_TRANSMIT != lteAdvCfg->absCfg.absPatternType))
6399 RLOG0(L_ERROR,"Invalid configuration of ABS pattern type");
6403 memcpy(temp, lteAdvCfg->absCfg.absPattern,RGR_ABS_PATTERN_LEN);
6405 /* Added validation for ABS pattern len */
6406 for(idx = 0; idx < RGR_ABS_PATTERN_LEN; idx++)
6408 if((temp[idx] != 1) && (temp[idx] != 0))
6410 RLOG0(L_ERROR,"Invalid configuration of ABS pattern type");
6418 /* LTE_ADV_FLAG_REMOVED_END */
6421 /***********************************************************
6423 * Func : rgSCHCfgVldtRgrCellCsgParamCfg
6425 * Desc : Validates CSG Parameter Configuration
6435 **********************************************************/
6436 static S16 rgSCHCfgVldtRgrCellCsgParamCfg
6439 RgrCellCsgParamCfg *csgParam
6443 RGSCHDBGPRM(inst, (rgSchPBuf(inst), "Validating CSG Parameters \n"));
6445 if(csgParam->minDlResNonCsg > 100)
6447 RLOG0(L_ERROR,"Invalid Configuration of minimum DL resources "
6451 if(csgParam->minUlResNonCsg > 100)
6453 RLOG0(L_ERROR,"Invalid Configuration of minimum UL resources "
6461 * @brief Validates the SI configuration request from RRM to MAC.
6465 * Function : rgSCHCfgVldtRgrSiCfg
6468 * - Validate the range of configured values recieved in
6469 * configuration request.
6470 * - If validated successfully,
6474 * - Else return RFAILED.
6475 * @param[in] Inst inst
6476 * @param[in] RgrCellCfg *siCfg
6477 * @param[out] RgSchCellCb *cell
6478 * @param[out] RgSchErrInfo *errInfo
6483 S16 rgSCHCfgVldtRgrSiCfg
6486 RgrSiCfgReqInfo *siCfg,
6488 RgSchErrInfo *errInfo
6494 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_SI_CFG;
6496 /*Validate the cfgType parameter */
6497 switch(siCfg->cfgType)
6501 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6502 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6503 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6504 (siCfg->siId > numSi))
6506 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid SI Id value"
6510 errInfo->errCause = RGSCHERR_NONE;
6513 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
6514 case RGR_SI_CFG_TYPE_SIB1: /* SI CFG TYPE SIB1 */
6515 case RGR_SI_CFG_TYPE_SIB1_PWS: /* SI CFG TYPE SIB1_PWS */
6516 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
6518 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR:
6519 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR_PER:
6523 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
6524 /*Check that value of SI should be less than equal
6525 to configured numSi parameter value */
6526 /* Added siId validation for lower limit */
6527 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6528 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6529 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6530 (siCfg->siId > numSi))
6532 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid SI Id value"
6537 if(siCfg->siId > ((cell->siCfg.minPeriodicity * 10)/cell->siCfg.siWinSize))
6539 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "SiId can not be scheduled ");
6545 case RGR_SI_CFG_EMTC_TYPE_SI:
6546 case RGR_SI_CFG_EMTC_TYPE_SI_PER:
6547 if(ROK != rgEmtcvalidateSiCfg(siCfg,cell))
6554 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid cfgType "
6559 /*Validate the specified pdu */
6560 if(NULLP == siCfg->pdu)
6562 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid NULLP pdu "
6567 /*Check if PDU is of 0 length*/
6568 SFndLenMsg(siCfg->pdu, &msgLen);
6571 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid pdu "
6576 errInfo->errCause = RGSCHERR_NONE;
6580 } /* rgSCHCfgVldtRgrSiCfg */
6581 #endif /*RGR_SI_SCH*/
6583 /* LTE_ADV_FLAG_REMOVED_START */
6585 * @brief Validates the RNTP INF request from RRM to MAC.
6589 * Function : rgSCHCfgVldtRgrLoadInf
6592 * - Validate the range of configured values recieved in
6594 * - If validated successfully,
6598 * - Else return RFAILED.
6599 * @param[in] Inst inst
6600 * @param[in] RgrLoadInfReqInfo *loadInfReq
6601 * @param[out] RgSchCellCb *cell
6602 * @param[out] RgSchErrInfo *errInfo
6607 S16 rgSCHCfgVldtRgrLoadInf
6610 RgrLoadInfReqInfo *loadInfReq,
6612 RgSchErrInfo *errInfo
6616 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LOAD_INF;
6618 /* Validate if the CC startRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6619 if((loadInfReq->rgrCcPHighStartRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6620 (loadInfReq->rgrCcPHighStartRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6622 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid rgrCcPHighStartRb received specified");
6626 /* Validate if the CC endRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6627 if((loadInfReq->rgrCcPHighEndRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6628 (loadInfReq->rgrCcPHighEndRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6630 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "Invalid rgrCcPHighEndRb received specified");
6634 errInfo->errCause = RGSCHERR_NONE;
6638 } /* rgSCHCfgVldtRgrLoadInf */
6639 /* LTE_ADV_FLAG_REMOVED_END */
6643 /********************************************************************
6644 * UE ACQI, PCQI, RI, SRS and SR Re/Configuration Validation Functions *
6646 *********************************************************************/
6649 * @brief Validates the Tx Mode and PUSCH Mode configuration.
6653 * Function : rgSCHCfgVldtRgrTxmodePuschMode
6656 * - Validate whether the configured PUSCH Mode and the
6657 * Configured Tx Mode are in the right combination
6658 * - If validated successfully,
6663 * @param[in] RgSchCellCb *cellCb
6664 * @param[in] RgrTxMode txMde
6665 * @param[in] RgrAprdCqiMode puschMode
6666 * @param[out] RgSchErrInfo *errInfo
6671 S16 rgSCHCfgVldtRgrTxmodePuschMode
6673 RgSchCellCb *cellCb,
6675 RgrAprdCqiMode puschMode,
6676 RgSchErrInfo *errInfo
6680 if (txMde == RGR_UE_TM_1 || txMde == RGR_UE_TM_2 ||
6681 txMde == RGR_UE_TM_3 || txMde == RGR_UE_TM_7)
6683 if (puschMode == RGR_APRD_CQI_MOD12 ||
6684 puschMode == RGR_APRD_CQI_MOD22 ||
6685 puschMode == RGR_APRD_CQI_MOD31)
6691 if (txMde == RGR_UE_TM_4 || txMde == RGR_UE_TM_6)
6693 if (puschMode == RGR_APRD_CQI_MOD20 ||
6694 puschMode == RGR_APRD_CQI_MOD30)
6700 if (txMde == RGR_UE_TM_5 )
6702 if (puschMode != RGR_APRD_CQI_MOD31)
6708 /* TOODO:: Tm8 and TM9 validation has to
6709 * be changed as mentioned inthe commented
6711 /* TM8 and TM9 supports all modes
6712 * Mode 1-2, 2-2, 3-1 if pmi/ri reporting enabled
6713 * 2-0,3-0 of pmi/ri reporitng isdisabled *
6714 * if pmi/ri is enabled
6715 * Mode 1-2, 2-2, 3-1 if with pmi/ri and csi-rs ports > 1
6716 * 2-0,3-0 of pmi/ri reporitng isdisabled and csi-rs ports == 1*/
6720 }/*rgSCHCfgVldtRgrTxmodePuschMode ends*/
6723 * @brief Validates the UE ACQI configuration request from RRM to MAC.
6727 * Function : rgSCHCfgVldtRgrUeACqiCfg
6730 * - Validate the UE configuration request from RRC to MAC at CFG:
6731 * validate the ACQI Configuration
6732 * - If validated successfully,
6737 * @param[in] RgSchCellCb *cellCb,
6738 * @param[in] CmLteRnti crnti,
6739 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg,
6740 * @param[in] RgrUeTxModeCfg txMode,
6741 * @param[out] RgSchErrInfo *errInfo
6747 S16 rgSCHCfgVldtRgrUeACqiCfg
6749 RgSchCellCb *cellCb,
6751 RgrUeAprdDlCqiCfg *acqiCfg,
6752 RgrUeTxModeCfg txMode,
6753 RgSchErrInfo *errInfo
6757 RgrAprdCqiMode puschMode;
6761 if(txMode.pres == TRUE)
6763 txMde = txMode.txModeEnum;
6764 puschMode = acqiCfg->aprdModeEnum;
6765 if ( ROK != rgSCHCfgVldtRgrTxmodePuschMode(cellCb, txMde,
6766 puschMode, errInfo))
6768 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
6769 "Invalid Aperiodic CQI configuration CRNTI:%d",crnti);
6778 * @brief Validates the Tx Mode and PUCCH Mode configuration.
6782 * Function : rgSCHCfgVldtRgrTxmodePucchMode
6785 * - Validate whether the configured PUCCH Mode and the
6786 * Configured Tx Mode are in the right combination
6787 * - If validated successfully,
6792 * @param[in] RgSchCellCb *cellCb
6793 * @param[in] RgrTxMode txMde
6794 * @param[in] RgrPrdCqiMode pucchMode
6795 * @param[out] RgSchErrInfo *errInfo
6800 S16 rgSCHCfgVldtRgrTxmodePucchMode
6802 RgSchCellCb *cellCb,
6804 RgrPrdCqiMode pucchMode,
6805 RgSchErrInfo *errInfo
6809 if (pucchMode == RGR_PRD_CQI_MOD10 || pucchMode == RGR_PRD_CQI_MOD20 )
6811 if (txMde ==RGR_UE_TM_4 || txMde ==RGR_UE_TM_5 || txMde ==RGR_UE_TM_6)
6816 else if (pucchMode == RGR_PRD_CQI_MOD11 || pucchMode == RGR_PRD_CQI_MOD21)
6818 if (txMde ==RGR_UE_TM_1 || txMde ==RGR_UE_TM_2 || txMde ==RGR_UE_TM_3 \
6819 || txMde ==RGR_UE_TM_7)
6824 /* TODO:: Tm8 and TM9 validation needs to be added */
6829 * @brief Validates the UE Periodic CQI, PMI, RI, re/configuration request from RRM to MAC.
6833 * Function : rgSCHCfgVldtRgrUePCqiCfg
6836 * - Validate the UE configuration request from RRC to MAC at CFG:
6837 * validate the value range for Periodic CQI, PMI, RI values.
6838 * - If validated successfully,
6843 * @param[in] RgSchCellCb *cellCb,
6844 * @param[in] CmLteRnti crnti,
6845 * @param[in] RgrUePrdDlCqiCfg *cqiCfg,
6846 * @param[in] RgrUeTxModeCfg txMode,
6847 * @param[out] RgSchErrInfo *errInfo
6853 S16 rgSCHCfgVldtRgrUePCqiCfg
6855 RgSchCellCb *cellCb,
6857 RgrUePrdDlCqiCfg *cqiCfg,
6859 RgrUeTxModeCfg txMode,
6860 RgSchErrInfo *errInfo
6863 S16 rgSCHCfgVldtRgrUePCqiCfg
6865 RgSchCellCb *cellCb,
6867 RgrUePrdDlCqiCfg *cqiCfg,
6868 RgrUeTxModeCfg txMode,
6869 RgSchErrInfo *errInfo
6874 RgrPrdCqiMode pucchMode;
6876 txMde = RGR_UE_TM_1;
6877 pucchMode = RGR_PRD_CQI_MOD20;
6878 if ( RGR_SCH_PCQI_SETUP == cqiCfg->type )
6880 /*1. Validate for Tx Mode and PUCCH Mode combination*/
6881 if(txMode.pres == TRUE)
6883 txMde = txMode.txModeEnum;
6884 pucchMode = cqiCfg->cqiSetup.prdModeEnum;
6885 if ( ROK != rgSCHCfgVldtRgrTxmodePucchMode(cellCb, txMde,
6886 pucchMode, errInfo))
6888 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
6889 "Invalid Tx Mode-PUCCH Mode combination CRNTI:%d",crnti);
6894 /*2. Validate for PCQI Reporting Type and PUCCH Mode combination*/
6895 if((cqiCfg->cqiSetup.cqiRepType==1) &&
6896 ((pucchMode == RGR_PRD_CQI_MOD20) ||
6897 (pucchMode == RGR_PRD_CQI_MOD21)))
6899 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
6900 "Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6904 if((cqiCfg->cqiSetup.cqiRepType==2) &&
6905 ((pucchMode == RGR_PRD_CQI_MOD10) ||
6906 (pucchMode == RGR_PRD_CQI_MOD11)))
6908 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
6909 "Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6913 /*3. Validate CQI/PMI and RI Configuration related parameter values */
6914 /*TODO- To be compared with configured n2Pucch Index*/
6915 if (cqiCfg->cqiSetup.cqiPResIdx > RG_SCH_PUCCH_RES_MAX_SUPP )
6917 RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,
6918 "Not Supported or Invalid CQI-PUCCH resourceIndex=%d Cfg Val=%d CRNTI:%d",
6919 RG_SCH_PUCCH_RES_MAX_SUPP, cqiCfg->type,crnti);
6926 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6927 (cqiCfg->cqiSetup.cqiPCfgIdx < 7) ||
6928 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6930 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
6931 "Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6932 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6933 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6939 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6940 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6942 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
6943 "Not Supported or Invalid Cfg CQI Min Index Sup =%d "
6944 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6945 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6950 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6951 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6953 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
6954 "Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6955 "Max Index Sup=%d Cfg Val=%d CRNTI;%d", RG_SCH_ICQI_MIN_SUPP,
6956 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6961 if((cqiCfg->cqiSetup.cqiRepType < RGR_UE_PCQI_WB_REP) ||
6962 (cqiCfg->cqiSetup.cqiRepType > RGR_UE_PCQI_SB_REP))
6964 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
6965 "Invalid Cfg CQI Report"
6966 "ModeCfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6970 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6971 ((cqiCfg->cqiSetup.k < RG_SCH_CQI_K_MIN) ||
6972 (cqiCfg->cqiSetup.k > RG_SCH_CQI_K_MAX)))
6974 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
6975 "Invalid CQI Cfg K Cfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6979 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6980 (cellCb->bwCfg.dlTotalBw <= 7))
6982 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
6983 "Invalid Periodic CQI mode Cfg for dlTotalBw (%d) for CRNTI:%d",
6984 cellCb->bwCfg.dlTotalBw, crnti);
6989 if (cqiCfg->cqiSetup.cqiPCfgIdx == RG_SCH_ICQI_RESV_FDD )
6991 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
6992 "Reserved value Cfg =%d CRNTI:%d",
6993 cqiCfg->cqiSetup.cqiPResIdx,crnti);
6998 /* 4. Check RI Configuration values */
6999 if(cqiCfg->cqiSetup.riEna == TRUE)
7001 if(txMode.pres == TRUE)
7003 if((txMde != RGR_UE_TM_3)
7004 && (txMde != RGR_UE_TM_4)
7005 && (txMde != RGR_UE_TM_8)
7007 && (txMde != RGR_UE_TM_9)
7011 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7012 "Invalid Transmission Mode =%d CRNTI:%d",
7018 if(cqiCfg->cqiSetup.riCfgIdx > RG_SCH_IRI_MAX_SUPP)
7020 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7021 "Invalid Index RI value Cfg =%d CRNTI:%d",
7022 cqiCfg->cqiSetup.riCfgIdx,crnti);
7033 * @brief Validates the UE SRS Re/Configuation request from RRM to MAC.
7037 * Function : rgSCHCfgVldtRgrUeUlSrsCfg
7040 * - Validate the UE configuration request from RRC to MAC at CFG:
7041 * validate the value range for SRS values.
7042 * - If validated successfully,
7047 * @param[in] RgSchCellCb *cellCb,
7048 * @param[in] CmLteRnti crnti,
7049 * @param[in] RgrUeUlSrsCfg *srsCfg,
7050 * @param[out] RgSchErrInfo *errInfo
7056 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7058 RgSchCellCb *cellCb,
7060 RgrUeUlSrsCfg *srsCfg,
7062 RgSchErrInfo *errInfo
7065 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7067 RgSchCellCb *cellCb,
7069 RgrUeUlSrsCfg *srsCfg,
7070 RgSchErrInfo *errInfo
7075 uint16_t srsOffset=0;
7076 uint8_t srsSubframe=0;
7078 if ( RGR_SCH_SRS_SETUP == srsCfg->type )
7081 /*ccpu00130768 - ADD - if cell specific SRS is not configured*/
7082 if(cellCb->srsCfg.isSrsCfgPres == FALSE)
7084 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7085 "Cell specific SRS is not configured CRNTI:%d",crnti);
7089 /* 1. Validate SRS Configuration related parameter values */
7090 /* 1.1 iSRS should be 0-636; Ref: 36.213. Table 8.2-1 */
7094 if ( (srsCfg->srsSetup.srsCfgIdx < 7) ||
7095 (srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP) )
7097 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7098 "Not Supported or Invalid Cfg "
7099 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7100 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7101 srsCfg->srsSetup.srsCfgIdx,crnti);
7107 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7109 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7110 "Not Supported or Invalid Cfg"
7111 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7112 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7113 srsCfg->srsSetup.srsCfgIdx,crnti);
7119 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7121 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7122 "Not Supported or Invalid Cfg"
7123 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7124 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7125 srsCfg->srsSetup.srsCfgIdx,crnti);
7130 /* Compute SRS Offset and Periodicity */
7131 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7132 srsCfg->srsSetup.srsCfgIdx,
7133 &srsPeri, &srsOffset);
7135 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7136 srsCfg->srsSetup.srsCfgIdx,
7137 &srsPeri, &srsOffset);
7139 srsSubframe = srsOffset%RGSCH_NUM_SUB_FRAMES;
7141 if(rgSchTddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7143 if(rgSchFddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7145 RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,
7146 "UE specific SRS is not occuring in Cell specific SRS subframe"
7147 "srs Cfg Idx =%d CRNTI:%d",
7148 srsCfg->srsSetup.srsCfgIdx,crnti);
7153 if ( srsCfg->srsSetup.fDomPosi > RG_SCH_SRS_FREQDOM_POS_MAX )
7155 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7156 "Not Supported or Invalid Cfg"
7157 "SRS Min Freq Domain Position =%d"
7158 "Max Freq Domain Position =%d Cfg Val=%d CRNTI:%d",
7159 RG_SCH_SRS_FREQDOM_POS_MIN, RG_SCH_SRS_FREQDOM_POS_MAX,
7160 srsCfg->srsSetup.srsCfgIdx,crnti);
7164 if ( srsCfg->srsSetup.txComb > RG_SCH_SRS_TXCOMB_MAX )
7166 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7167 "Not Supported or Invalid Cfg"
7168 "SRS Min TX Comb =%d Max TX Comb =%d Cfg Val=%d CRNTI:%d",
7169 RG_SCH_SRS_TXCOMB_MIN, RG_SCH_SRS_TXCOMB_MAX,
7170 srsCfg->srsSetup.srsCfgIdx,crnti);
7178 * @brief Validates the UE SR Re/configuration request from RRM to MAC.
7182 * Function : rgSCHCfgVldtRgrUeSrCfg
7185 * - Validate the UE re/configuration request from RRC to MAC at CFG:
7186 * validate the value range for SR values.
7187 * - If validated successfully,
7192 * @param[in] RgSchCellCb *cellCb,
7193 * @param[in] CmLteRnti crnti,
7194 * @param[in] RgrUeSrCfg *srCfg,
7195 * @param[out] RgSchErrInfo *errInfo
7201 S16 rgSCHCfgVldtRgrUeSrCfg
7203 RgSchCellCb *cellCb,
7207 RgSchErrInfo *errInfo
7210 S16 rgSCHCfgVldtRgrUeSrCfg
7212 RgSchCellCb *cellCb,
7215 RgSchErrInfo *errInfo
7220 if ( RGR_SCH_SR_SETUP == srCfg->type )
7222 /* 1. Validate SR Configuration related parameter values */
7226 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7227 ( srCfg->srSetup.srCfgIdx < 5 ) ||
7228 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7230 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7231 "Invalid SR Index Cfg =%d"
7232 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7233 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7240 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7241 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7243 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7244 "Invalid SR Index Cfg =%d"
7245 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7246 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7252 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7253 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7255 RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
7256 "Invalid SR Index Cfg =%d"
7257 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7258 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7269 * @brief Validates the UE Aperiodic & Periodic CQI, PMI, RI, SRS and SR Configuration
7270 * request from RRM to MAC.
7274 * Function :rgSCHCfgVldtCqiSrSrsUeCfg
7277 * - Validate the UE configuration request from RRC to MAC at CFG:
7278 * validate the value range for Aperiodic & Periodic CQI, PMI, RI , SRS and SR values.
7279 * - If validated successfully,
7284 * @param[in] RgSchCellCb *cellCb
7285 * @param[in] RgrUeCfg *ueCfg
7286 * @param[out] RgSchErrInfo *errInfo
7291 static S16 rgSCHCfgVldtCqiSrSrsUeCfg
7293 RgSchCellCb *cellCb,
7295 RgSchErrInfo *errInfo
7299 /* 1. Validate UE Aperiodic CQI related parameters */
7300 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueCfg->crnti,
7301 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ueCfg->txMode, errInfo ))
7303 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7304 "Invalid Aperiodic CQI configuration CRNTI:%d",ueCfg->crnti);
7308 /* 1. Validate UE Periodic CQI/PMI, SRS and SR related parameters */
7310 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7311 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->isHdFddEnbld,
7312 ueCfg->txMode, errInfo ))
7314 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7315 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->txMode, errInfo ))
7318 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7319 "Invalid Periodic CQI configuration CRNTI:%d",ueCfg->crnti);
7323 /* 2. Validate SRS Configuration related parameter values */
7325 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti, &ueCfg->srsCfg,
7326 ueCfg->isHdFddEnbld, errInfo ))
7328 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti,
7329 &ueCfg->srsCfg, errInfo ))
7332 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7333 "Invalid SRS configuration CRNTI:%d",ueCfg->crnti);
7337 /* 3. Validate SR Configuration related parameter values */
7339 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti, &ueCfg->srCfg,
7340 ueCfg->isHdFddEnbld, errInfo))
7342 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti,
7343 &ueCfg->srCfg, errInfo))
7346 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7347 "Invalid SR configuration CRNTI:%d",ueCfg->crnti);
7357 /*****************************************************************
7358 * UE PCQI, RI, SRS and SR Re Configuration Validation Functions *
7360 ******************************************************************/
7362 * @brief Validates the UE Periodic CQI, PMI, RI, SRS and SR
7363 * Re-configuration request from RRM to MAC.
7367 * Function : rgSCHCfgVldtCqiSrSrsUeReCfg
7370 * - Validate the UE Re configuration request from RRC to MAC at CFG:
7371 * validate the value range for Periodic CQI, PMI, RI, SRS and SR values.
7372 * - If validated successfully,
7377 * @param[in] RgSchCellCb *cellCb
7378 * @param[in] RgSchUeCb *ueCb
7379 * @param[in] RgrUeCfg *ueCfg
7380 * @param[out] RgSchErrInfo *errInfo
7385 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg
7387 RgSchCellCb *cellCb,
7389 RgrUeRecfg *ueReCfg,
7390 RgSchErrInfo *errInfo
7393 RgrUeTxModeCfg txMode;
7396 txMode.tmTrnstnState = RGR_TXMODE_RECFG_CMPLT;
7397 if ((ueReCfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
7398 (ueReCfg->txMode.pres == TRUE))
7400 txMode.txModeEnum = ueReCfg->txMode.txModeEnum;
7404 txMode.txModeEnum = ueCb->mimoInfo.txMode;
7407 /* 1. Validate UE CQI/PMI, SRS and SR related parameters */
7409 if ( ueReCfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
7411 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueReCfg->oldCrnti,
7412 &ueReCfg->aprdDlCqiRecfg, txMode, errInfo ))
7414 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7415 "Invalid Aperiodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7421 /* 2. Validate UE CQI/PMI, SRS and SR related parameters */
7423 if ( ueReCfg->ueRecfgTypes & RGR_UE_PCQI_RECFG )
7426 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7427 &ueReCfg->cqiCfg, ueReCfg->isHdFddEnbld, txMode, errInfo ))
7429 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7430 &ueReCfg->cqiCfg, txMode, errInfo ))
7434 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7435 "Invalid Periodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7440 if(ueReCfg->ueRecfgTypes & RGR_UE_SRS_RECFG )
7443 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7444 &ueReCfg->srsCfg, ueReCfg->isHdFddEnbld, errInfo ))
7446 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7447 &ueReCfg->srsCfg, errInfo ))
7450 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7451 "Invalid SRS configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7457 if ( ueReCfg->ueRecfgTypes & RGR_UE_SR_RECFG )
7460 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7461 &ueReCfg->srCfg, ueReCfg->isHdFddEnbld, errInfo))
7463 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7464 &ueReCfg->srCfg, errInfo))
7467 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
7468 "Invalid SR configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7477 /*****************************************************************
7478 * UE ACQI, PCQI, RI, SRS SR Configuration Functions *
7480 ******************************************************************/
7482 * @brief Handles Aperiodic CQI , PMI, RI configuration for a UE.
7486 * Function : rgSCHCfgACqiUeCfg
7488 * Invoking Module Processing:
7489 * - This shall be invoked by SCH_GOM at UE configuration. It
7490 * shall do the validations for the spec-defined values.
7496 * @param[in] RgSchCellCb *cell
7497 * @param[in] RgrTxMode txMode
7498 * @param[in] RgrUeAprdDlCqiCfg *aCqiCfg
7499 * @param[in] CmLteUeCategory ueCat
7504 S16 rgSCHCfgACqiUeCfg
7506 RgSchCellCb *cellCb,
7508 RgSchUeACqiCb *acqiCb,
7510 RgrUeAprdDlCqiCfg *aCqiCfg,
7511 CmLteUeCategory ueCat
7514 uint8_t M; /*Num of Subbands -- Applicable only for Mode 2-0 and 2-2*/
7515 uint8_t k; /*SubBand Size (RB) --
7516 Holds different values depending on Mode*/
7517 uint8_t cqiPmiSzR1; /*CQIPMI Size for Rank =1*/
7518 uint8_t cqiPmiSzRn1; /*CQIPMI Size for Rank > 1*/
7523 acqiCb->aCqiCfg.pres = aCqiCfg->pres;
7524 acqiCb->aCqiCfg.aprdModeEnum = aCqiCfg->aprdModeEnum;
7529 /*Store Trigger Set Bit String to UE */
7530 RgSchUeCellInfo *pCellInfo = RG_SCH_CMN_GET_PCELL_INFO(ue);
7531 pCellInfo->acqiCb.aCqiCfg.triggerSet1 = aCqiCfg->triggerSet1;
7532 pCellInfo->acqiCb.aCqiCfg.triggerSet2 = aCqiCfg->triggerSet2;
7536 switch(aCqiCfg->aprdModeEnum)
7538 case RGR_APRD_CQI_MOD12:
7539 case RGR_APRD_CQI_MOD30:
7540 case RGR_APRD_CQI_MOD31:
7541 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7542 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7546 case RGR_APRD_CQI_MOD20:
7547 case RGR_APRD_CQI_MOD22:
7548 RG_SCH_GET_SBCQI_M_K_VAL(cellCb->bwCfg.dlTotalBw, M, k);
7549 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7552 acqiCb->L = RgSCHUeAcqi2022LBitWidth[M-1][acqiCb->N-1];
7558 if((ueTxMode == RGR_UE_TM_3) ||
7559 (ueTxMode == RGR_UE_TM_4))
7561 if(cellCb->numTxAntPorts ==2)
7563 acqiCb->riNumBits = 1;
7565 else if(cellCb->numTxAntPorts ==4)
7567 if(ueCat == CM_LTE_UE_CAT_8)
7569 acqiCb->riNumBits = 3;
7571 else if(ueCat >= CM_LTE_UE_CAT_5)
7573 acqiCb->riNumBits = 2;
7577 acqiCb->riNumBits = 1;
7581 rgSCHCfgUtlFetchAcqiBitSz(acqiCb, cellCb->numTxAntPorts,
7582 &cqiPmiSzR1, &cqiPmiSzRn1);
7583 acqiCb->cqiPmiSzR1 = cqiPmiSzR1;
7584 acqiCb->cqiPmiSzRn1 = cqiPmiSzRn1;
7586 acqiCb->cqiReqField = TRUE;
7588 rgSchCmnSetCqiReqField(RG_SCH_CMN_GET_SCELL_INFO(ue, cellCb),ue,&acqiCb->cqiReqField);
7595 * @brief Handles Periodic CQI , PMI, RI configuration for a UE.
7599 * Function : rgSCHCfgPCqiUeCfg
7601 * Invoking Module Processing:
7602 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7603 * validations for the spec-defined values.
7606 * - For UE-specific Periodic CQI related configuration,
7607 * - If Periodic CQI/PMI is configured,
7608 * - Update UE with the configured values.
7609 - Compute and Update next occurance of CQI/PMI or RI Tranmission instance.
7610 - Update the CQI offset and CQI perodicity information
7611 - Add Ue to cell's list
7614 * - For UE-specific Periodic RI related configuration,
7615 * - If Periodic RI is configured,
7616 * - Update UE with the configured values.
7617 - Compute and Update next occurance of RI Tranmission instance.
7618 - Update the RI offset and RI perodicity information
7623 * @param[in] RgSchCellCb *cell
7624 * @param[in] RgSchUeCb *ue
7625 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7626 * @param[in] CmLteUeCategory ueCat
7631 S16 rgSCHCfgPCqiUeCfg
7633 RgSchCellCb *cellCb,
7635 RgrUePrdDlCqiCfg *cqiCfg,
7636 CmLteUeCategory ueCat
7639 CmLteTimingInfo timingInfo;
7641 uint16_t cqiTrInstTime;
7642 uint8_t j; /*Bandwidth Parts*/
7645 RgSchUePCqiCb *cqiCb = NULLP;
7647 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
7648 (cellCb->crntTime.slot);
7649 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7650 cqiCb->servCellInfo = ueCb->cellInfo[0];
7651 /* Periodic CQI is setup */
7652 if (cqiCfg->type == RGR_SCH_PCQI_SETUP)
7654 for(loop = 0; loop < MAX_CQI_RI_RPT_BUFF;loop++)
7656 ueCb->rawCqiBitW[loop].type = TFU_RECP_REQ_INVLD; /* setting invalid type*/
7658 /* 1. Copy the Received CQI Cfg parameters to ueCb */
7659 memcpy(&cqiCb->cqiCfg, cqiCfg,
7660 sizeof(RgrUePrdDlCqiCfg));
7662 /* 2. Compute Periodic CQI Periodicity and subframe offset */
7664 rgSCHUtlGetCfgPerOff(RG_SCH_FDD_PCQI_TBL, cqiCfg->cqiSetup.cqiPCfgIdx,
7665 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7667 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_PCQI_TBL,
7668 cqiCfg->cqiSetup.cqiPCfgIdx,
7669 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7671 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
7672 "rgSCHCfgPCqiUeCfg(): UEID:%d CQI Peri=%d, CQI Offset=%d",
7678 cqiTrInstTime = ((cqiCb->cqiPeri+crntTime) - cqiCb->cqiOffset)
7680 cqiCb->nCqiTrIdx = (crntTime +
7681 (cqiCb->cqiPeri - cqiTrInstTime));
7682 /* Introduced timing delta for reception req
7684 if(cqiCb->nCqiTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7686 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx + cqiCb->cqiPeri;
7689 /* To handle the SFN wrap around case */
7690 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx % (RGSCH_MAX_SFN * RGSCH_NUM_SUB_FRAMES_5G);
7692 timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
7693 timingInfo.slot = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
7695 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
7696 %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7699 /*CQI Repetition configuration*/
7702 rgSchfillPucchCqiRepNumCountemtc(cqiCb, ueCb);
7706 if(RGR_UE_PCQI_SB_REP == cqiCfg->cqiSetup.cqiRepType)
7708 uint8_t k; /*SubBand Size (RB) */
7709 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7710 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7711 cqiCb->J = j; /*Number of Bandwidth Parts*/
7712 /*h: reporting instances required for a complete CQI/PMI report */
7713 /*j:Number of bandwidth parts; k: Subband Size*/
7714 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7715 /* ccpu00140905- L-size is coming as 3 for 100Rbs where it should be 2*/
7716 temp = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, (j*k));
7717 cqiCb->label = (temp & (temp-1)) ?
7718 (1+ rgSCHUtlLog32bitNbase2(temp)) : rgSCHUtlLog32bitNbase2(temp);
7720 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ueCb, cqiCb);
7725 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
7729 /* Place the UE in cellCb->tIUeLstCp */
7730 cqiCb->cqiLstEnt.node=(PTR) cqiCb;
7732 cqiCb->isCqiIgnoByCollsn = FALSE;
7733 cqiCb->isRiIgnoByCollsn = FALSE;
7737 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
7741 /* 4. Rank Indicator Cfg handler */
7742 rgSCHCfgRiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
7746 cqiCb->cqiCfg.type = RGR_SCH_PCQI_REL;
7747 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
7749 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,\
7752 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
7754 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst, \
7756 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
7757 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7759 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
7760 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7761 cqiCb->riDist = RG_SCH_INVALID_IDX;
7763 ueCb->nPCqiCb = cqiCb;
7764 ueCb->nPRiCb = cqiCb;
7769 * @brief Handles Periodic RI configuration for a UE.
7773 * Function : rgSCHCfgRiUeCfg
7775 * Invoking Module Processing:
7776 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7777 * validations for the spec-defined values.
7780 * - For UE-specific Periodic RI related configuration,
7781 * - If Periodic RI is configured,
7782 * - Update UE with the configured values.
7783 - Compute and Update next occurance of RI Tranmission instance.
7784 - Update the RI offset and RI perodicity information
7788 * @param[in] RgSchCellCb *cell
7789 * @param[in] RgSchUeCb *ue
7790 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7791 * @param[in] CmLteUeCategory ueCat
7798 RgSchCellCb *cellCb,
7800 RgrUePrdDlCqiCfg *cqiCfg,
7801 CmLteUeCategory ueCat
7805 uint16_t riTrInsTime;
7806 uint8_t j; /*Bandwidth parts. Valid for Modes 2-0, 2-1*/
7807 uint16_t periodicity;
7809 RgSchUePCqiCb *cqiCb = NULLP;
7811 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7812 +(cellCb->crntTime.slot);
7813 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7814 /* 1. Rank Indicator is enabled */
7815 if(cqiCfg->cqiSetup.riEna)
7818 rgSCHUtlGetCfgPerOff(RG_SCH_RI_TBL,
7819 cqiCfg->cqiSetup.riCfgIdx,
7820 &cqiCb->riPeri, &cqiCb->riOffset);
7822 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
7823 "rgSCHCfgRiUeCfg(): RI Peri=%d, RI Offset=%d UEID:%d",
7824 cqiCb->riPeri, cqiCb->riOffset,ueCb->ueId);
7826 cqiCb->perRiVal = 1;
7827 cqiCb->invalidateCqi = FALSE;
7829 if(RGR_UE_PCQI_WB_REP == cqiCfg->cqiSetup.cqiRepType)
7832 1. wideband RI reporting is configured
7834 (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )Mod(NCqiperiod
7837 periodicity = cqiCb->cqiPeri * cqiCb->riPeri;
7842 * Where Widesband and Subband RI reporting is configured
7843 * (Mode 2-0 or 2-1 )
7844 * (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )
7845 * Mod(H. NCqiperiod *MriPeriod )=0
7846 * where H= J * K +1; J=Number of bandwidth parts(BW/subsize).
7847 * K is RGR interf input
7850 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7851 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7852 periodicity = cqiCb->h * cqiCb->cqiPeri *
7856 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
7857 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
7858 * accordingly. WBCQI handling is naturally accomplished */
7859 if (periodicity >= RGSCH_MAX_SUBFRM_5G)
7861 periodicity = cqiCb->cqiOffset - cqiCb->riOffset +
7862 RGSCH_MAX_SUBFRM_5G - (crntTime);
7863 tempIdx = crntTime + periodicity;
7864 printf("CHECK_SID - periodicity %d tempIdx %d\n", periodicity, tempIdx);
7868 if ((crntTime + TFU_RECPREQ_DLDELTA + periodicity) >
7869 (RGSCH_MAX_SUBFRM_5G - 1))
7871 riTrInsTime = (periodicity - cqiCb->cqiOffset + cqiCb->riOffset) % periodicity;
7872 tempIdx = RGSCH_MAX_SUBFRM_5G + (periodicity - riTrInsTime);
7876 riTrInsTime = ((periodicity +crntTime )- \
7877 cqiCb->cqiOffset + cqiCb->riOffset)\
7879 tempIdx = (crntTime + (periodicity -riTrInsTime));
7882 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7884 tempIdx = tempIdx + periodicity;
7886 cqiCb->nRiTrIdx = tempIdx
7887 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7888 if(periodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
7890 cqiCb->riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
7891 (uint16_t) tempIdx);
7897 if(ueCb->mimoInfo.txMode == RGR_UE_TM_3
7898 || ueCb->mimoInfo.txMode == RGR_UE_TM_4)
7900 if (cellCb->numTxAntPorts ==2)
7902 cqiCb->riNumBits = 1;
7904 else if(cellCb->numTxAntPorts ==4)
7906 if(ueCat == CM_LTE_UE_CAT_8)
7908 cqiCb->riNumBits = 3;
7910 else if(ueCat >= CM_LTE_UE_CAT_5)
7912 cqiCb->riNumBits = 2;
7916 cqiCb->riNumBits = 1;
7920 /* Place the UE in cellCb->tIUeLstCp */
7921 cqiCb->riLstEnt.node=(PTR) cqiCb;
7923 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
7925 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_ADD,
7926 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7932 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7933 cqiCb->riDist = RG_SCH_INVALID_IDX;
7940 /* @brief Handles SRS configuration for a UE.
7944 * Function : rgSCHCfgSrsUeCfg
7946 * Invoking Module Processing:
7947 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7948 * validations for the spec-defined values.
7951 * - For UE-specific SRS related configuration,
7952 * - If SRS is configured,
7953 * - Update UE with the configured values.
7954 - Compute and Update next occurance of SRS Tranmission instance.
7955 - Update the SRS offset and SRS perodicity information
7956 - Add Ue to cell's srs list
7958 * - next occurance transmission instance of SRS = RG_SCH_INVALID_IDX
7962 * @param[in] RgSchCellCb *cell
7963 * @param[in] RgSchUeCb *ue
7964 * @param[in] RgrUeUlSrsCfg *srsCfg
7970 S16 rgSCHCfgSrsUeCfg
7972 RgSchCellCb *cellCb,
7974 RgrUeUlSrsCfg *srsCfg
7977 uint16_t srsTrInsTime;
7981 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7982 +(cellCb->crntTime.slot);
7984 if(RGR_SCH_SRS_SETUP == srsCfg->type)
7986 /* 1. Copy the Received Cfg parameters to local cb */
7987 memcpy(&ueCb->srsCb.srsCfg, srsCfg, sizeof(RgrUeUlSrsCfg));
7990 /* 2. Compute SRS Offset and Periodicity */
7991 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7992 srsCfg->srsSetup.srsCfgIdx,
7993 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
7995 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7996 srsCfg->srsSetup.srsCfgIdx,
7997 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
8000 RLOG_ARG3(L_DEBUG,DBG_CELLID,cellCb->cellId,
8001 "rgSCHCfgSrsUeCfg(): SRS Peri=%d, SRS Offset=%d UEID:%d",
8002 ueCb->srsCb.peri,ueCb->srsCb.offset,ueCb->ueId);
8004 /* 3. Compute next Tranmission index for SRS */
8005 /* Referenence: 36.213 Section:8.2
8006 i. SRS transmission instances for TDD with period > 2 and for FDD are
8007 ((10*sfn +Ksrs-suframeoffset))/mod(periodicity))
8009 TDD: Ksrs Table 8.2-3:
8010 ii.The SRS transmission instances for TDD (periodicity == 2)
8011 (Ksrs-Toffset)mod(5)==0. Note: This is not supported now
8014 srsTrInsTime = ((ueCb->srsCb.peri+crntTime) - ueCb->srsCb.offset)
8016 tempIdx = (crntTime + (ueCb->srsCb.peri - srsTrInsTime));
8018 if (tempIdx <= (crntTime + TFU_DELTA))
8020 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8023 tempIdx = tempIdx + ueCb->srsCb.peri;
8025 ueCb->srsCb.nSrsTrIdx =(uint16_t) (tempIdx
8026 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE);
8027 if(ueCb->srsCb.peri >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
8030 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime+TFU_DELTA),
8033 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime + TFU_RECPREQ_DLDELTA),
8039 ueCb->srsCb.srsDist = 0;
8042 /*UE Tx Antenna Selection - START*/
8043 if(ueCb->ul.ulTxAntSel.pres == TRUE )
8045 /*for both partial and full sounding bandwidth,
8046 and when frequency hopping is disabled */
8047 ueCb->srsCb.selectedAnt = (crntTime/ueCb->srsCb.peri)%2;
8051 /* TS 36.213 specifies that if Tx Antenna Selection is
8052 disabled/not supported then its Port 0*/
8053 ueCb->srsCb.selectedAnt=0;
8055 ueCb->validTxAnt = ueCb->srsCb.selectedAnt;
8056 /*UE Tx Antenna Selection - ENDS*/
8058 ueCb->srsCb.srsLstEnt.node=(PTR)ueCb;
8059 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8060 &ueCb->srsCb.srsLstEnt);
8066 /* SRS Release / Not configured */
8067 ueCb->srsCb.srsCfg.type = RGR_SCH_SRS_REL;
8068 if(ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8070 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8071 &ueCb->srsCb.srsLstEnt);
8073 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8074 ueCb->srsCb.srsLstEnt.node =(PTR) NULLP;
8081 /* * @brief Handles SR configuration for a UE.
8085 * Function : rgSCHCfgSrUeCfg
8087 * Invoking Module Processing:
8088 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8089 * validations for the spec-defined values.
8091 * - If SR is configured,
8092 * - Update UE with the configured values.
8093 - Compute and Update next occurance of SR Tranmission instance.
8094 - Update the SR offset and SR perodicity information
8095 - Add Ue to cell->tIUeLstCp[n]
8097 * - next occurance transmission instance of SR = RG_INVALID_SR_ID
8102 * @param[in] RgSchCellCb *cell
8103 * @param[in] RgSchUeCb *ue
8104 * @param[in] RgrUeSrCfg *srCfg
8112 RgSchCellCb *cellCb,
8117 uint16_t srTrInsTime;
8121 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8122 +(cellCb->crntTime.slot);
8123 if(srCfg->type == RGR_SCH_SR_SETUP)
8125 /* 1. Copy the Received Cfg parameters to local cb */
8126 memcpy(&ueCb->srCb.srCfg, srCfg, sizeof(RgrUeSrCfg));
8129 /* 2. Compute SR periodicity and offset */
8130 rgSCHUtlGetCfgPerOff( RG_SCH_SR_TBL,
8131 srCfg->srSetup.srCfgIdx,
8132 &ueCb->srCb.peri, &ueCb->srCb.offset);
8134 RLOG_ARG4(L_DEBUG,DBG_CELLID,cellCb->cellId ,
8135 "SR Config: idx(%u), period (%u) offset (%u) UEID:%d",
8136 srCfg->srSetup.srCfgIdx,
8143 rgSchfillPucchSrRepNumCountemtc(ueCb);
8146 /* 3. Compute Next Transmission Instance */
8148 srTrInsTime = ((ueCb->srCb.peri+crntTime) - ueCb->srCb.offset)
8150 ueCb->srCb.nSrTrIdx = (crntTime + (ueCb->srCb.peri- srTrInsTime));
8152 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_DELTA))
8154 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8157 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx + ueCb->srCb.peri;
8159 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx
8160 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8161 ueCb->srCb.srLstEnt.node= (PTR) ueCb;
8163 /* 4. Place UE in Cell SR Tranmisison Instance List */
8164 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8165 &ueCb->srCb.srLstEnt);
8169 ueCb->srCb.srCfg.type = RGR_SCH_SR_REL;
8171 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8173 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8174 &ueCb->srCb.srLstEnt);
8176 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8177 ueCb->srCb.srLstEnt.node = (PTR)NULLP;
8184 /*****************************************************************
8185 * UE PCQI, RI, SRS and SR Re Configuration Functions *
8187 ******************************************************************/
8190 /* * @brief Handles Periodic CQI, PMI, RI Re-configuration for a UE.
8194 * Function : rgSCHCfgPCqiUeReCfg
8196 * Invoking Module Processing:
8197 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8198 * validations for the spec-defined values.
8201 * - For UE-specific Periodic CQI related configuration,
8202 * - If Periodic CQI/PMI is re configured(first time enabled),
8203 * - Update UE with the configured values.
8204 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8206 * - Update the CQI offset and CQI perodicity information
8207 * - Add Ue to cell's list
8208 * - If Periodic CQI/PMI is re configured(modify),
8209 * - Update UE with the configured values.
8210 * - Del Ue from cell->tIUeLstCp list
8211 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8213 * - Update the CQI offset and CQI perodicity information
8214 * - Add Ue to cell's list
8215 * - If Periodic CQI/PMI is re configured(disabled),
8216 * - Update UE with the configured values.
8217 * - Del Ue from cell's list
8218 * - Update next occurance of CQI/PMI or RI Tranmission instance.
8219 * - next occurance of CQI/PMI = RG_INVALID_CQIPMI_ID
8221 * - For UE-specific Periodic RI related configuration,
8222 * - If Periodic RI is configured(first time enabled),
8223 * - Update UE with the configured values.
8224 * - Compute and Update next occurance of RI Tranmission instance.
8225 * - Update the RI offset and RI perodicity information
8226 * - If Periodic RI is configured(modify),
8227 * - Update UE with the configured values.
8228 * - Compute and Update next occurance of RI Tranmission instance.
8229 * - Update the RI offset and RI perodicity information
8231 * - next occurance of RI = RG_INVALID_CQIPMI_ID
8235 * @param[in] RgSchCellCb *cell
8236 * @param[in] RgSchUeCb *ue
8237 * @param[in] RgrUeCfg *ueCfg
8243 S16 rgSCHCfgPCqiUeReCfg
8245 RgSchCellCb *cellCb,
8247 RgrUePrdDlCqiCfg *cqiCfg,
8248 CmLteUeCategory ueCat
8252 RgSchUePCqiCb *cqiCb = NULLP;
8254 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8255 /* Fix: ccpu00124008 Fix for incorrect check causing missed CQI reception instance */
8256 if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8257 (cqiCb->cqiCfg.type != RGR_SCH_PCQI_SETUP))
8259 /* 1. cqi is in Release (Disable) state, Recfg is allowing Setup (Enable)
8261 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8264 else if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8265 (cqiCb->cqiCfg.type == RGR_SCH_PCQI_SETUP ))
8269 2. Present is SETUP(Enable) state, Recfg is modifying SETUP(Enable)
8271 2.1 Delete UE from the cqiList
8272 2.2 Set next occurance Transmission instace to "INVALID"
8273 2.3 Compute Next occurance Transmission instace
8274 2.4 Placed ue in Transmission instance list.
8276 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX )
8277 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
8280 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX )
8282 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
8284 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
8285 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8289 cqiCb->cqiLstEnt.next = NULLP;
8290 cqiCb->cqiLstEnt.prev = NULLP;
8291 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8292 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8293 cqiCb->riDist = RG_SCH_INVALID_IDX;
8295 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8299 /* Present is SETUP(Enable) state, Recfg is Release(Disable) */
8300 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8303 /* ccpu00140578:: */
8304 cqiCb->riRecpPrcsd = FALSE;
8309 /* * @brief Handles SRS Re-configuration for a UE.
8313 * Function : rgSCHCfgSrsUeReCfg
8315 * Invoking Module Processing:
8316 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8317 * validations for the spec-defined values.
8320 * - For UE-specific SRS related re configuration,
8321 * - If SRS is configured modified(First time Enabled),
8322 * - Update UE with the configured values.
8323 * - Compute and Update next occurance of SRS Tranmission instance.
8324 * - Update the SRS offset and SRS perodicity information
8325 * - Add Ue to cell's list
8326 * - If SRS is configured modified(Changed offset or index ),
8327 * - Delete UE from cell->tIUeLstCp[n] if present
8328 * - Update UE with the configured values.
8329 * - Compute and Update next occurance of SRS Tranmission instance.
8330 * - Update the SRS offset and SRS perodicity information
8331 * - Add Ue to cell's list
8332 * - If SRS is configured modified(disabled),
8333 * - Delete UE from cell->tIUeLstCp[n] if present
8334 * - Update next occurance of SRS Tranmission instance to "INVALID".
8335 * - Update the SRS offset and SRS perodicity information "INVALID"
8341 * @param[in] RgSchCellCb *cell
8342 * @param[in] RgSchUeCb *ue
8343 * @param[in] RgrUeUlSrsCfg *srsCfg
8349 S16 rgSCHCfgSrsUeReCfg
8351 RgSchCellCb *cellCb,
8353 RgrUeUlSrsCfg *srsCfg
8358 if(( RGR_SCH_SRS_SETUP == srsCfg->type) ||
8359 ( RGR_SCH_SRS_SETUP != ueCb->srsCb.srsCfg.type ))
8361 /* 1. Present is Release(Disable) state, Recfg is allowing
8363 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8365 else if (( RGR_SCH_SRS_SETUP == srsCfg->type ) &&
8366 ( RGR_SCH_SRS_SETUP == ueCb->srsCb.srsCfg.type))
8369 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8371 2.1 Delete UE from the cqiList
8372 2.2 Set next occurance Transmission instance to "INVALID"
8373 2.3 Compute Next occurance Transmission instance
8374 2.4 Placed ue in Transmission instance list.
8376 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8378 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8379 &ueCb->srsCb.srsLstEnt);
8380 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8383 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8387 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable)*/
8388 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8390 /* ccpu00140578:: */
8391 ueCb->srsCb.srsRecpPrcsd = FALSE;
8396 /* @brief Handles SR Re-configuration for a UE.
8400 * Function : rgSCHCfgSrUeReCfg
8402 * Invoking Module Processing:
8403 * - This shall be invoked by SCH_GOM at UE Re configuration.
8404 * It shall do the validations for the spec-defined values.
8407 * - For UE-specific SR related re configuration,
8408 * - If SR is configured modified(First time Enabled),
8409 * - Update UE with the configured values.
8410 * - Compute and Update next occurance of SR Tranmission instance.
8411 * - Update the SR offset and SR perodicity information
8412 * - Add Ue to cell->tIUeLstCp[n]
8413 * - If SR is configured modified(Changed offset or index ),
8414 * - Delete UE from cell->tIUeLstCp[n] if present
8415 * - Update UE with the configured values.
8416 * - Compute and Update next occurance of SR Tranmission instance.
8417 * - Update the SR offset and SR perodicity information
8418 * - Add Ue to cell->tIUeLstCp[n]
8419 * - If SR is configured modified(disabled),
8420 * - Delete UE from cell->tIUeLstCp[n] if present
8421 * - Update next occurance of SR Tranmission instance to "INVALID".
8422 * - Update the SR offset and SR perodicity information "INVALID"
8430 * @param[in] RgSchCellCb *cell
8431 * @param[in] RgSchUeCb *ue
8432 * @param[in] RgrUeCfg *ueCfg
8438 S16 rgSCHCfgSrUeReCfg
8440 RgSchCellCb *cellCb,
8446 /* Fix : syed Incorrect check for SR RECFG */
8447 if((srCfg->type == RGR_SCH_SR_SETUP) &&
8448 (ueCb->srCb.srCfg.type != RGR_SCH_SR_SETUP))
8451 1. Present is Release(Disable) state, Recfg is allowing SETUP(Enable)
8453 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8455 else if((srCfg->type == RGR_SCH_SR_SETUP) &&
8456 (ueCb->srCb.srCfg.type == RGR_SCH_SR_SETUP))
8459 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8461 2.1 Delete UE from the cqiList
8462 2.2 Compute Next occurance Transmission instace
8464 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX )
8466 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8467 &ueCb->srCb.srLstEnt);
8468 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8470 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8475 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable) */
8476 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8482 /* @brief Handles ACQI Re-configuration for a UE.
8486 * Function : rgSCHCfgAcqiUeReCfg
8488 * Invoking Module Processing:
8489 * - This shall be invoked by SCH_GOM at UE Re configuration.
8490 * It shall do the validations for the spec-defined values.
8493 * - For UE-specific ACQI related re configuration,
8494 * - Check if the ACQI Mode has been changed from the
8495 * existing Configuration.
8496 * - If the configuration has been changed,
8497 * - Call Aperiodic Config function to change the config
8504 * @param[in] RgSchCellCb *cell
8505 * @param[in] RgSchUeCb *ue
8506 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg
8512 S16 rgSCHCfgAcqiUeReCfg
8514 RgSchCellCb *cellCb,
8516 RgrUeAprdDlCqiCfg *acqiCfg,
8517 CmLteUeCategory ueCat
8521 return (rgSCHCfgACqiUeCfg(cellCb,ueCb,(RG_SCH_CMN_GET_ACQICB(ueCb,cellCb))
8522 ,ueCb->mimoInfo.txMode, acqiCfg, ueCat));
8526 /*****************************************************************
8527 * UE PCQI, RI, SRS and SR Configuration Delete *
8529 *****************************************************************/
8531 /* @brief Free Periodic CQI/PMI/RI, SRS and SR transmission instance
8532 * related data structures of this UE from CellCb
8536 * Function : rgSCHCfgPCqiSrsSrUeDel
8538 * Invoking Module Processing:
8539 * - This shall be invoked by SCH_GOM at Ue deletion.
8542 * - For SRS Transmission Instance
8543 * - if (srsTxInst!= RG_INVALID)
8544 * - Remove from the cellCb->tIUeLstCp[srsTxInst*3+2]
8547 * - For SR Transmission Instance
8548 * - if (srTxInst!= RG_INVALID)
8549 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+1]
8552 * - For Periodic CQI/PMI RI Transmission Instance
8553 * - if (pCqiTxInst!= RG_INVALID)
8554 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+0]
8558 * @param[in] RgSchCellCb *cell
8559 * @param[in] RgSchUeCb *ue
8564 S16 rgSCHCfgPCqiSrsSrUeDel
8566 RgSchCellCb *cellCb,
8572 uint32_t sCellCnt = 0;
8574 RgSchUePCqiCb *cqiRiCb = NULLP;
8576 cqiRiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8580 /* Delete SRS Transmission Instance */
8581 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8583 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8584 &ueCb->srsCb.srsLstEnt);
8585 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8588 /* Delete SR Transmission Instance */
8589 if (ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8591 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8592 &ueCb->srCb.srLstEnt);
8593 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8596 /* Delete Periodic CQI/PMI Transmission Instance */
8597 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8599 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8600 &cqiRiCb->cqiLstEnt);
8601 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8603 /* Delete Periodic RI Transmission Instance */
8605 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8607 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8608 &cqiRiCb->riLstEnt);
8609 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8610 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8611 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8616 for (cellIdx =1; cellIdx <= RG_SCH_MAX_SCELL; cellIdx++)
8618 /* If a serving cell is configured */
8619 if(ueCb->cellInfo[cellIdx] != NULLP)
8621 /* If the serving cell is in ACTIVE state and
8622 If it is not the same serving cell as cqiRiCb for which
8623 collision is being checked */
8624 cqiRiCb = &ueCb->cellInfo[cellIdx]->cqiCb;
8625 /* Delete Periodic CQI/PMI Transmission Instance */
8626 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8628 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8629 &cqiRiCb->cqiLstEnt);
8630 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8632 /* Delete Periodic RI Transmission Instance */
8634 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8636 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8637 &cqiRiCb->riLstEnt);
8638 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8639 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8640 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8644 /* If all of the num of configured scells are checked then break */
8645 if (sCellCnt == ueCb->numSCells)
8657 /* @brief Search the cfgIdx in given table and retrive periodicity & offset
8660 * Function : rgSCHUtlGetCfgPerOff
8662 * Invoking Module Processing:
8663 * - This shall be invoked by Cfg Module
8666 * binary search for given entry in table
8667 * find the periodicty, offset for a given config index from the table
8669 * @param[in] RgSchPerTbl tbl
8670 * @param[in] uint16_t cfgIdx
8671 * @param[out] uint16_t *peri
8672 * @param[out] uint16_t *offset
8678 S16 rgSCHUtlGetCfgPerOff
8689 const RgSchUePCqiSrsSrCfgIdxTbl* table;
8691 /* Added the function instead of the MACRO to get the
8692 * periodicity table */
8693 table = rgSCHCfgUtlGetPcqiSrsSrRiTbl ( tbl,&min,&max );
8696 if (( cfgIdx >= table[mid].min) &&
8697 ( cfgIdx <= table[mid].max))
8699 *peri = table[mid].peri;
8700 *offset = cfgIdx - table[mid].offset;
8704 if ( cfgIdx > table[mid].min)
8713 }while( min <= max );
8719 /***********************************************************
8721 * Func : rgSCHCfgUtlFetchAcqiBitSz
8724 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
8734 **********************************************************/
8735 static Void rgSCHCfgUtlFetchAcqiBitSz
8737 RgSchUeACqiCb *acqiCb,
8739 uint8_t* cqiPmiSzR1,
8740 uint8_t* cqiPmiSzRn1
8744 uint32_t confRepMode;
8746 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
8749 case RGR_APRD_CQI_MOD12:
8753 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8754 *cqiPmiSzRn1 = 8+ acqiCb->N;
8756 else if(numTxAnt == 4)
8758 *cqiPmiSzR1 = 4 + 4*acqiCb->N;
8759 *cqiPmiSzRn1 = 8 + 4*acqiCb->N;
8764 case RGR_APRD_CQI_MOD20:
8766 *cqiPmiSzR1 = 6 + acqiCb->L;
8767 *cqiPmiSzRn1 = 6 + acqiCb->L;
8771 case RGR_APRD_CQI_MOD22:
8775 *cqiPmiSzR1 = 10 + acqiCb->L;
8776 *cqiPmiSzRn1 = 14 + acqiCb->L;
8778 else if(numTxAnt == 4)
8780 *cqiPmiSzR1 = 14 + acqiCb->L;
8781 *cqiPmiSzRn1 = 20 + acqiCb->L;
8786 case RGR_APRD_CQI_MOD30:
8788 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8789 *cqiPmiSzRn1 = 4 + 2*acqiCb->N;
8793 case RGR_APRD_CQI_MOD31:
8797 *cqiPmiSzR1 = 6 + 2*acqiCb->N;
8798 *cqiPmiSzRn1 = 9 + 4*acqiCb->N;
8800 else if(numTxAnt == 4)
8802 *cqiPmiSzR1 = 8 + 2*acqiCb->N;
8803 *cqiPmiSzRn1 = 12 + 4*acqiCb->N;
8812 /* Added the function rgSCHCfgUtlGetPcqiCrsSrRiTbl to be used
8813 * instead of the MACRO RG_SCH_GET_PERIODICITY_TBL */
8814 /***********************************************************
8816 * Func : rgSCHCfgUtlGetPcqiCrsSrRiTbl
8819 * Desc : Get the Srs Cqi Crs Ri Table
8828 **********************************************************/
8830 static const RgSchUePCqiSrsSrCfgIdxTbl * rgSCHCfgUtlGetPcqiSrsSrRiTbl
8832 RgSchPerTbl tblType,
8837 const RgSchUePCqiSrsSrCfgIdxTbl * table;
8842 case RG_SCH_FDD_PCQI_TBL:
8844 table = rgSchUePCqiCfgIdxFddTbl;
8846 * max=RG_SCH_CQIPMI_CFGIDX_MAX_FDD;
8849 case RG_SCH_TDD_PCQI_TBL:
8851 table = rgSchUeCqiPmiCfgIdxTddTbl;
8853 * max=RG_SCH_CQIPMI_CFGIDX_MAX_TDD;
8858 table = rgSchUeRiCfgIdxTbl;
8860 * max=RG_SCH_RI_CFGIDX_MAX;
8863 case RG_SCH_FDD_SRS_TBL:
8865 table = rgSchUeSrsCfgIdxFddTbl;
8867 * max=RG_SCH_SRS_ISRS_INDX_MAX_FDD;
8870 case RG_SCH_TDD_SRS_TBL:
8872 table = rgSchUeSrsCfgIdxTddTbl;
8874 * max=RG_SCH_SRS_ISRS_INDX_MAX_TDD;
8879 table = rgSchUeSrCfgIdxTbl;
8881 * max=RG_SCH_ISR_INDX_MAX;
8886 table = (const RgSchUePCqiSrsSrCfgIdxTbl *) 0;
8896 #endif /* TFU_UPGRADE */
8898 /***********************************************************
8900 * Func : rgSCHCfgVldtDrxUeCfg
8903 * Desc : Validates UE DRX Timers Configuration recieved from RRC.
8913 **********************************************************/
8914 static S16 rgSCHCfgVldtDrxUeCfg
8917 RgrUeDrxCfg *ueDrxCfg
8921 if (ueDrxCfg->isDrxEnabled == FALSE)
8927 if ( ueDrxCfg->cqiMask.pres )
8929 if ( ueDrxCfg->cqiMask.val != RGR_DRX_SETUP )
8932 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid cqiMask configuration (%d)",
8933 ueDrxCfg->cqiMask.val);
8935 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid cqiMask configuration(%ld)",
8936 ueDrxCfg->cqiMask.val);
8941 #endif /*LTEMAC_R9*/
8943 if(ueDrxCfg->isEmtcUe)
8945 if(ueDrxCfg->drxOnDurTmrR13Pres)
8947 if ( rgSCHEmtcCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8949 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d)",
8950 ueDrxCfg->drxOnDurTmr);
8956 if (rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8958 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d) for EMTC",
8959 ueDrxCfg->drxOnDurTmr);
8968 if ( rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8970 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid onDurTimer configuration(%d) for EMTC",
8971 ueDrxCfg->drxOnDurTmr);
8976 if ( rgSCHCfgVldtDrxInActvCfg(ueDrxCfg->drxInactvTmr) != ROK )
8978 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Inactivity configuration(%d)",
8979 ueDrxCfg->drxInactvTmr);
8983 if(ueDrxCfg->isEmtcUe)
8985 if(ueDrxCfg->drxRetxTmrR13Pres)
8987 if ( rgSCHEmtcCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8989 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d) for EMTC",
8990 ueDrxCfg->drxRetxTmr);
8996 if (rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8998 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d)",
8999 ueDrxCfg->drxRetxTmr);
9008 if ( rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
9010 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d)",
9011 ueDrxCfg->drxRetxTmr);
9016 if(ueDrxCfg->isEmtcUe)
9018 if ( rgSCHEmtcCfgVldtDrxUlReTxCfg(ueDrxCfg->emtcDrxUlRetxTmr) != ROK )
9020 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid DrxReTX configuration(%d) for EMTC",
9021 ueDrxCfg->drxRetxTmr);
9028 if ( rgSCHCfgVldtDrxLngCycCfg(ueDrxCfg->drxLongCycleOffst) != ROK )
9030 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid LongCycle configuration");
9034 if ( ueDrxCfg->drxLongCycleOffst.longDrxCycle < ueDrxCfg->drxOnDurTmr )
9036 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9037 " and onDuration timer values");
9042 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxLongCycleOffst.longDrxCycle,
9043 ueDrxCfg->drxOnDurTmr, ueDrxCfg->drxLongCycleOffst.drxStartOffst) != ROK)
9045 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9046 " and onDuration timer values");
9051 if( TRUE == ueDrxCfg->drxShortDrx.pres )
9053 if ( ueDrxCfg->drxShortDrx.shortDrxCycle < ueDrxCfg->drxOnDurTmr )
9055 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of short DRX "
9056 "Cycle and onDuration timer values");
9060 if ( (ueDrxCfg->drxLongCycleOffst.longDrxCycle %
9061 ueDrxCfg->drxShortDrx.shortDrxCycle) != 0)
9063 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId," Long DRX cycle is not multiple of "
9068 if ( rgSCHCfgVldtDrxShrtCycCfg(ueDrxCfg->drxShortDrx) != ROK )
9070 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid Short Cycle configuration");
9075 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxShortDrx.shortDrxCycle,
9076 ueDrxCfg->drxOnDurTmr,
9077 ueDrxCfg->drxLongCycleOffst.drxStartOffst %
9078 ueDrxCfg->drxShortDrx.shortDrxCycle) != ROK)
9080 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Invalid combination of Long DRX Cycle "
9081 " and onDuration timer values");
9088 }/*rgSCHCfgVldtDrxUeCfg*/
9090 /***********************************************************
9092 * Func : rgSCHCfgVldtDrxOnDurCfg
9095 * Desc : Validates UE DRX On Duration configuration
9096 * recieved from RRC.
9106 **********************************************************/
9107 static S16 rgSCHCfgVldtDrxOnDurCfg
9115 case RGR_DRX_PRD_1PSF:
9116 case RGR_DRX_PRD_2PSF:
9117 case RGR_DRX_PRD_3PSF:
9118 case RGR_DRX_PRD_4PSF:
9119 case RGR_DRX_PRD_5PSF:
9120 case RGR_DRX_PRD_6PSF:
9121 case RGR_DRX_PRD_8PSF:
9122 case RGR_DRX_PRD_10PSF:
9123 case RGR_DRX_PRD_20PSF:
9124 case RGR_DRX_PRD_30PSF:
9125 case RGR_DRX_PRD_40PSF:
9126 case RGR_DRX_PRD_50PSF:
9127 case RGR_DRX_PRD_60PSF:
9128 case RGR_DRX_PRD_80PSF:
9129 case RGR_DRX_PRD_100PSF:
9130 case RGR_DRX_PRD_200PSF:
9137 }/*switch(onDurTmr)*/
9140 }/*rgSCHCfgVldtOnDurCfg*/
9142 /***********************************************************
9144 * Func : rgSCHCfgVldtDrxInActvCfg
9147 * Desc : Validates UE DRX InActivity configuration
9148 * recieved from RRC.
9158 **********************************************************/
9159 static S16 rgSCHCfgVldtDrxInActvCfg(uint16_t inActvTmr)
9161 switch ( inActvTmr )
9163 case RGR_DRX_PRD_1PSF:
9164 case RGR_DRX_PRD_2PSF:
9165 case RGR_DRX_PRD_3PSF:
9166 case RGR_DRX_PRD_4PSF:
9167 case RGR_DRX_PRD_5PSF:
9168 case RGR_DRX_PRD_6PSF:
9169 case RGR_DRX_PRD_8PSF:
9170 case RGR_DRX_PRD_10PSF:
9171 case RGR_DRX_PRD_20PSF:
9172 case RGR_DRX_PRD_30PSF:
9173 case RGR_DRX_PRD_40PSF:
9174 case RGR_DRX_PRD_50PSF:
9175 case RGR_DRX_PRD_60PSF:
9176 case RGR_DRX_PRD_80PSF:
9177 case RGR_DRX_PRD_100PSF:
9178 case RGR_DRX_PRD_200PSF:
9179 case RGR_DRX_PRD_300PSF:
9180 case RGR_DRX_PRD_500PSF:
9181 case RGR_DRX_PRD_750PSF:
9182 case RGR_DRX_PRD_1280PSF:
9183 case RGR_DRX_PRD_1920PSF:
9184 case RGR_DRX_PRD_2560PSF:
9191 }/*switch(InactvTmr)*/
9194 }/*rgSCHCfgVldtDrxInActvCfg*/
9196 /***********************************************************
9198 * Func : rgSCHCfgVldtDrxReTxCfg
9201 * Desc : Validates DRX ReTx timer configuration
9202 * recieved from RRC.
9212 **********************************************************/
9213 static S16 rgSCHCfgVldtDrxReTxCfg(uint8_t reTxTmr)
9217 case RGR_DRX_PRD_1PSF:
9218 case RGR_DRX_PRD_2PSF:
9219 case RGR_DRX_PRD_4PSF:
9220 case RGR_DRX_PRD_6PSF:
9221 case RGR_DRX_PRD_8PSF:
9222 case RGR_DRX_PRD_16PSF:
9223 case RGR_DRX_PRD_24PSF:
9224 case RGR_DRX_PRD_33PSF:
9231 }/*switch(drxRetxTmr)*/
9234 }/*rgSCHCfgVldtDrxReTxCfg*/
9236 /***********************************************************
9238 * Func : rgSCHCfgVldtDrxShrtCycCfg
9241 * Desc : Validates DRX Short Cycle timer configuration
9242 * recieved from RRC.
9253 **********************************************************/
9254 static S16 rgSCHCfgVldtDrxLngCycCfg(RgrDrxLongCycleOffst lngCycleOffst)
9256 if ( rgSCHCfgVldtDrxLngCyclTmrs(lngCycleOffst.longDrxCycle) != ROK )
9261 if ( lngCycleOffst.drxStartOffst >= lngCycleOffst.longDrxCycle )
9267 }/*rgSCHCfgVldtDrxLngCycCfg*/
9269 /***********************************************************
9271 * Func : rgSCHCfgVldtDrxLngCyclTmrs
9274 * Desc : Validates DRX Long Cycle timer values
9275 * recieved from RRC.
9286 **********************************************************/
9287 static S16 rgSCHCfgVldtDrxLngCyclTmrs(uint16_t val)
9292 case RGR_DRX_PRD_10SF:
9293 case RGR_DRX_PRD_20SF:
9294 case RGR_DRX_PRD_32SF:
9295 case RGR_DRX_PRD_40SF:
9296 case RGR_DRX_PRD_64SF:
9297 case RGR_DRX_PRD_80SF:
9298 case RGR_DRX_PRD_128SF:
9299 case RGR_DRX_PRD_160SF:
9300 case RGR_DRX_PRD_256SF:
9301 case RGR_DRX_PRD_320SF:
9302 case RGR_DRX_PRD_512SF:
9303 case RGR_DRX_PRD_640SF:
9304 case RGR_DRX_PRD_1024SF:
9305 case RGR_DRX_PRD_1280SF:
9306 case RGR_DRX_PRD_2048SF:
9307 case RGR_DRX_PRD_2560SF:
9314 }/*switch(longDrxCycle)*/
9317 }/*rgSCHCfgVldtDrxLngCyclTmrs*/
9319 /***********************************************************
9321 * Func : rgSCHCfgVldtDrxShrtCycCfg
9324 * Desc : Validates DRX Short Cycle timer configuration
9325 * recieved from RRC.
9336 **********************************************************/
9337 static S16 rgSCHCfgVldtDrxShrtCycCfg(RgrDrxShortDrx shrtCycCfg )
9339 switch(shrtCycCfg.shortDrxCycle)
9341 case RGR_DRX_PRD_2SF:
9342 case RGR_DRX_PRD_5SF:
9343 case RGR_DRX_PRD_8SF:
9344 case RGR_DRX_PRD_10SF:
9345 case RGR_DRX_PRD_16SF:
9346 case RGR_DRX_PRD_20SF:
9347 case RGR_DRX_PRD_32SF:
9348 case RGR_DRX_PRD_40SF:
9349 case RGR_DRX_PRD_64SF:
9350 case RGR_DRX_PRD_80SF:
9351 case RGR_DRX_PRD_128SF:
9352 case RGR_DRX_PRD_160SF:
9353 case RGR_DRX_PRD_256SF:
9354 case RGR_DRX_PRD_320SF:
9355 case RGR_DRX_PRD_640SF:
9363 }/*switch(shortDrxCycle)*/
9365 if ( (shrtCycCfg.drxShortCycleTmr < RGR_DRX_SHRTCYCLE_MIN) ||
9366 (shrtCycCfg.drxShortCycleTmr > RGR_DRX_SHRTCYCLE_MAX)
9376 * @brief Handler for TA related UE Reconfiguration.
9380 * Function : rgSCHCfgUeTaRecfg
9382 * This function shall fetch the TA timer related information into the
9383 * respective ueCb from the UE configuration as provided by the
9386 * @param[in] RgSchCellCb *cell
9387 * @param[in] RgSchUeCb *ueCb
9388 * @param[in] RgrUeCfg *ueCfg
9389 * @param[out] RgSchErrInfo *errInfo
9394 static Void rgSCHCfgUeTaRecfg
9404 /* Update the TA related information */
9406 if (ueCfg->ueTaTmrRecfg.pres)
9408 /* Configuring taTmr with 30 deficit, to enable eNodeB sending
9409 * TA command before the expiry of TA at UE. Also considering for
9410 * possible retx for this TA command */
9411 /* [ccpu00121813]-ADD-Added chk if tatmr val > 30 */
9412 if(ueCfg->ueTaTmrRecfg.taTmr > 30)
9414 ueCb->dl.taCb.cfgTaTmr = ueCfg->ueTaTmrRecfg.taTmr - 30;
9416 /* If TA Timer is running. Stop it and then start it*/
9417 if (ueCb->taTmr.tmrEvnt != TMR_NONE)
9419 rgSCHTmrStopTmr(cell, ueCb->taTmr.tmrEvnt, ueCb);
9420 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9424 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9428 } /* rgSCHCfgUeTaRecfg */
9430 /* ccpu00117452 - MOD - Changed macro name from
9431 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
9432 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
9433 /***********************************************************
9435 * Func : rgSCHCfgUeCqiReptReCfg
9438 * Desc : Reconfiguration of PUSH N CQI Reporting
9440 * Ret : RFAILED in case of failure
9447 **********************************************************/
9448 static S16 rgSCHCfgUeCqiReptReCfg
9457 /* Check has it been disabled */
9458 if(ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9460 /* Check if we need to send CQI reports collagted so far and send if so */
9461 if(ue->schCqiInfo.cqiCount >=
9462 ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9464 RgrStaIndInfo *staInfo;
9465 /* if yes, Send StaInd to RRM */
9466 retVal = rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&staInfo,
9467 sizeof(RgrStaIndInfo));
9470 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
9471 "Could not allocate memory for sending StaInd OLD CRNTI:%d",ueRecfg->oldCrnti);
9475 /* Fill StaInd for sending collated N CQI rpeort */
9476 rgSCHUtlFillSndStaInd(cell, ue, staInfo,
9477 ueRecfg->ueCqiReptCfg.numColltdCqiRept);
9482 ue->schCqiInfo.cqiCount = 0;
9485 ue->cqiReptCfgInfo.numColltdCqiRept =
9486 ueRecfg->ueCqiReptCfg.numColltdCqiRept;
9488 } /* End of rgSCHCfgUeCqiReptReCfg */
9489 #endif /* End of RGR_CQI_REPT */
9490 /*This function Added Ue in ongoing L2 Meas*/
9491 /*LTE_L2_MEAS_PHASE2*/
9493 static S16 rgSchAddToL2Meas(RgSchCellCb *cellCb,RgSchDlLcCb *dlLc)
9497 RgSchL2MeasCb *measCb = NULLP;
9498 lnk = cellCb->l2mList.first;
9502 /* Get the MeasCb : RgSchL2MeasCb */
9503 measCb = (RgSchL2MeasCb *)lnk->node;
9504 if (measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
9506 for(idx = 0;idx < measCb->measReq.avgPrbQciDl.numQci;idx++)
9508 if(measCb->measReq.avgPrbQciDl.qci[idx] == dlLc->qciCb->qci)
9510 break; /*exit from for loop*/
9513 if(idx == measCb->measReq.avgPrbQciDl.numQci)
9515 measCb->measReq.avgPrbQciDl.qci[measCb->measReq.avgPrbQciDl.numQci++] = dlLc->qciCb->qci;
9519 }/*End of while loop*/
9526 * @brief UE SCell Buffer Free
9530 * Function : rgSCHSCellFreeBuf
9532 * This functions will free allocated memory
9533 * for UE secondart cellCB
9536 * @param[in] Inst inst
9537 * @param[in] RgSchUeCb *ue
9538 * @param[int] RgrUeRecfg *ueRecfg
9539 * @param[out] uint8_t idx
9542 Void rgSCHSCellFreeBuf
9546 RgrUeRecfg *ueRecfg,
9550 RgSchUeCellInfo *sCellInfo = NULLP;
9551 RgrUeSecCellCfg *sCellInfoRecfg = NULLP;
9554 for(uint8_t i = 0; i <= idx; i++)
9556 sCellInfoRecfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[i];
9557 sCellInfo = ue->cellInfo[(sCellInfoRecfg->sCellIdx)];
9559 if (NULLP != sCellInfo)
9561 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
9562 sizeof(RgSchUeCellInfo));
9563 ue->cellInfo[(sCellInfoRecfg->sCellIdx)] = NULLP;
9570 /**********************************************************************
9573 **********************************************************************/