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 DU_LOG("\nDEBUG --> SCH : VALIDATE RGR SCH ENB CONFIG: \n");
489 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
492 if ((rgSCHCfgVldtRgrSchCfg(inst, schedEnbCfg)) != ROK)
494 DU_LOG("\nERROR --> SCH : Validation for scheduler related "
499 DU_LOG("\nINFO --> SCH : MIMO_DBG:: SCH:: numAntPorts=%d\n",schedEnbCfg->numTxAntPorts);
501 /* Validation for the ENB parameters */
502 if ((schedEnbCfg->numTxAntPorts == 0) || (schedEnbCfg->numTxAntPorts > 4))
504 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid CSG Access mode\n");
517 errInfo->errCause = RGSCHERR_NONE;
518 DU_LOG("\nINFO --> SCH : RGR SCHED ENB config validation done:");
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 DU_LOG("\nERROR --> SCH : Cell Id already exists");
565 if(cellCfg->macInst >= SCH_INST_START)
567 DU_LOG("\nERROR --> SCH : Invalid MAC Instance %d ",
572 if (cellCfg->macRnti.startRnti < RGSCH_MIN_MAC_RNTI )
574 DU_LOG("\nERROR --> SCH : Invalid start RNTI %d for cell ",
575 cellCfg->macRnti.startRnti);
579 if ((rgSCHCfgVldtRgrCellSchCfg(inst, cellCfg)) != ROK)
581 DU_LOG("\nERROR --> SCH : Validation for scheduler related "
586 if ((cellCfg->dlHqCfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
587 (cellCfg->dlHqCfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX))
589 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid Bandwidth configuration:"
619 " ul %d dl %d",cellCfg->bwCfg.ulTotalBw,
620 cellCfg->bwCfg.dlTotalBw);
623 if (cellCfg->phichCfg.ngEnum > RGR_NG_TWO)
625 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid cfi value for"
642 "Extended PHICH duration cfi:%d dlBw:%d",
643 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
646 DU_LOG("\nINFO --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid SRS configuration: "
672 " srsBw %d", (uint8_t)cellCfg->srsCfg.srsBwEnum);
676 if ((rgSCHCfgVldtRgrCellRACfg(inst, cellCfg)) != ROK)
678 DU_LOG("\nERROR --> SCH : Validation for Random access related"
683 if ((rgSCHCfgVldtRgrCellPwrCfg(inst, cellCfg, errInfo)) != ROK)
685 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid number(%d) of common logical"
695 "channels in cell config", cellCfg->numCmnLcs);
698 if ((rgSCHCfgVldtRgrCmnLcCfg(inst, cellCfg, errInfo)) != ROK)
700 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : DSFR is enbaled"
751 "Without enabling SFR");
755 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellCfg->rgrLteAdvCfg),
756 cellCfg->bwCfg.dlTotalBw)) != ROK)
758 DU_LOG("\nERROR --> SCH : Validation for LTE Adv"
759 "configuration failed");
763 if ((rgSCHCfgVldtRgrCellLteLAACfg(inst, cellCfg)) != ROK)
765 DU_LOG("\nERROR --> SCH : Validation for LTE LAA"
766 "configuration failed");
770 /* LTE_ADV_FLAG_REMOVED_END */
771 if (cellCfg->msg4pAVal > RGRUE_DLPWRCNTRL_PA_DB3)
773 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Validation failed for \n"
785 "Access CSG parameter failed\n");
790 if (cellCfg->emtcEnable)
792 if(ROK != rgSCHCfgVldtRgrEmtcCellCfg(cellCfg))
794 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nDEBUG --> SCH : rgSCHCfgVldtRgrSchCfg:Validating \
831 scheduler related Configuration");
832 if (rgSchedCfg->ulSchdType > (RGSCH_NUM_SCHEDULERS - 1))
834 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtRgrSchCfg:Invalid \
835 UL scheduler type %d \n", rgSchedCfg->ulSchdType);
838 if (rgSchedCfg->dlSchdType > (RGSCH_NUM_SCHEDULERS - 1))
840 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Invalid RACH configuration:"
928 "preamble Fmt %d raWinSize %d maxMsg3Tx %d",
929 cellCfg->rachCfg.preambleFormat, cellCfg->rachCfg.raWinSize,
930 cellCfg->rachCfg.maxMsg3Tx);
931 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : 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 DU_LOG("\nERROR --> SCH : Warining !: Contention Resolution timer not greater than the "
973 "guard timer. Conte Res timer %d Guard timer %d",
974 cellCfg->rachCfg.contResTmr,
976 /* [ccpu00138532]-DEL- removed return fail here as it is ok if the
977 max Msg4 Tx delay is more than the contension Resolution timer.
978 In such case, the CRI CE will be scheduled immediately once
984 /* ccpu00128575 ADD - If contention resolution timer is configured as 0,
986 DU_LOG("\nERROR --> SCH : Contention Resolution timer is configured as '0'");
995 * @brief Validates the UE configuration request from RRM to MAC.
999 * Function : rgSCHCfgVldtRgrUeCfg
1002 * - Validate the UE configuration request from RRC to MAC at CFG:
1003 * validate the value range for the configured values.
1004 * - If validated successfully,
1005 * - Return ROK and pointer to the cell of UE.
1009 * @param[in] Inst inst
1010 * @param[in] RgrUeCfg *ueCfg
1011 * @param[out] RgSchCellCb **cell
1012 * @param[out] RgSchErrInfo *errInfo
1017 S16 rgSCHCfgVldtRgrUeCfg
1022 RgSchErrInfo *errInfo
1025 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_CFG;
1027 if (((*cell) == NULLP) ||
1028 ((*cell)->cellId != ueCfg->cellId))
1030 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Cell does not exist %d",
1035 * Check configured preamble id not colliding with non dedicated or PDCCH
1036 * order preamble sets. When valid preamble id given check that C-RNTI given
1037 * in configuration is not amongst the C-RNTI'smanaged by scheduler */
1038 if ((rgSCHRamVldtUeCfg(*cell, ueCfg)) != ROK)
1040 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Preamble Id configuration"
1041 "failed ",ueCfg->cellId);
1044 /* Check if Ue already configured */
1045 if (rgSCHDbmGetUeCb(*cell, ueCfg->crnti) != NULLP)
1047 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d UEID already exists",
1051 /* Validate Transmission UE modes */
1052 if ((ueCfg->txMode.pres == TRUE) && ((ueCfg->txMode.txModeEnum < RGR_UE_TM_1)
1053 || (ueCfg->txMode.txModeEnum > RGR_UE_TM_7)))
1055 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1056 " UE is %d", ueCfg->cellId,(uint8_t)ueCfg->txMode.txModeEnum);
1060 /* Validate UE Category */
1061 if (ueCfg->ueCatEnum > CM_LTE_UE_CAT_8)
1063 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid category for UE %d",
1064 ueCfg->cellId,(uint8_t)ueCfg->ueCatEnum);
1068 /* Validate UE Access Stratum Release */
1069 if (ueCfg->accessStratumRls > RGR_REL_10)
1071 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
1072 ueCfg->accessStratumRls));
1075 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
1076 ueCfg->accessStratumRls));
1078 if ((*cell)->numTxAntPorts == 1)
1080 if ((ueCfg->txMode.pres == TRUE) &&
1081 (ueCfg->txMode.txModeEnum > RGR_UE_TM_1))
1083 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
1084 " UE (%d) for the configured Cell Antenna Ports",ueCfg->cellId,
1085 (uint8_t)ueCfg->txMode.txModeEnum);
1090 if ((rgSCHCfgVldtUeCqiModeCfg(*cell, &ueCfg->ueDlCqiCfg)) != ROK)
1092 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti, "CELLID:%d Invalid CQI Mode configuration",
1097 /* Validate Max Uplink HARQ transmission value */
1098 if (ueCfg->ueUlHqCfg.maxUlHqTx < RGSCH_MIN_HQ_TX)
1100 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Uplink HARQ config for "
1101 "UE %d",ueCfg->cellId,ueCfg->ueUlHqCfg.maxUlHqTx);
1105 if (rgSCHCfgVldtUePwrCfg(*cell, &ueCfg->ueUlPwrCfg) != ROK)
1107 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid PUSCH Group power"
1108 " configuration",ueCfg->cellId);
1112 if (rgSCHCfgVldtUeMeasGapAckNakRepCfg(*cell, ueCfg) != ROK)
1114 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid MeasGap/AckNackRep"
1115 " configuration",ueCfg->cellId);
1120 /* Validating SPS RNTI */
1121 if (((ueCfg->ueSpsCfg.spsRnti >= (*cell)->rntiDb.rntiStart) &&
1122 (ueCfg->ueSpsCfg.spsRnti<=((*cell)->rntiDb.rntiStart+(*cell)->rntiDb.maxRntis)))
1123 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_SI_RNTI)
1124 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_P_RNTI))
1126 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid SPS RNTI "
1127 " in DL SPS Config",ueCfg->cellId);
1131 if (ueCfg->ueSpsCfg.dlSpsCfg.isDlSpsEnabled)
1133 if (rgSCHCfgVldtUeDlSpsCfg(*cell, &ueCfg->ueSpsCfg.dlSpsCfg) != ROK)
1135 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DL SPS configuration"
1136 " for the UE",ueCfg->cellId);
1142 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
1143 if ( ROK != rgSCHCfgVldtCqiSrSrsUeCfg(*cell, ueCfg, errInfo))
1145 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Periodic CQI/SR/SRS"
1146 "configuration",ueCfg->cellId);
1151 /* Validate DRX specific parameters */
1152 if ( ROK != rgSCHCfgVldtDrxUeCfg(*cell, &(ueCfg->ueDrxCfg)))
1154 RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DRX configuration",
1159 /* ccpu00117452 - MOD - Changed macro name from
1160 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1162 if (ueCfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
1164 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid numColltdCqiRept,"
1165 "MAX supported %d",RGR_CQIRPTS_MAXN,ueCfg->cellId);
1168 #endif /* End of RGR_CQI_REPT */
1171 /*This is to validate the EMTC related configuration if a UE is an EMTC UE*/
1172 if(TRUE == ueCfg->emtcUeCfg.pres)
1174 if ( ROK != rgSCHCfgVldtEmtcUeCfg(*cell, &(ueCfg->emtcUeCfg)))
1176 RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
1177 ueCfg->cellId, ueCfg->crnti);
1182 errInfo->errCause = RGSCHERR_NONE;
1184 } /* rgSCHCfgVldtRgrUeCfg */
1188 * @brief Validates the cell reconfiguration request from RRM to MAC.
1192 * Function : rgSCHCfgVldtRgrCellRecfg
1195 * - Retrieve the cell control block.
1197 * - Validate the range of reconfigured values recieved in
1198 * re-configuration request.
1199 * - If validated successfully,
1200 * - Return ROK and pointer to the cell.
1203 * - Else return RFAILED.
1205 * @param[in] Inst inst
1206 * @param[in] RgrCellRecfg *cellRecfg
1207 * @param[out] RgSchCellCb **cell
1208 * @param[out] RgSchErrInfo *errInfo
1213 S16 rgSCHCfgVldtRgrCellRecfg
1216 RgrCellRecfg *cellRecfg,
1218 RgSchErrInfo *errInfo
1222 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_RECFG;
1224 /* Fetch cell and validate cell Id with the cell control block*/
1225 if (((*cell) == NULLP) ||
1226 ((*cell)->cellId != cellRecfg->cellId))
1228 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Cell control block does not exist");
1232 /* Validate recieved values */
1233 if ((cellRecfg->recfgTypes & RGR_CELL_DL_HARQ_RECFG) &&
1234 ((cellRecfg->dlHqRecfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
1235 (cellRecfg->dlHqRecfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX)))
1237 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Downlink HARQ configuration:"
1238 " maxDlHqTx %d maxMsg4HqTx %d", cellRecfg->dlHqRecfg.maxDlHqTx,
1239 cellRecfg->dlHqRecfg.maxMsg4HqTx);
1242 if ((cellRecfg->recfgTypes & RGR_CELL_CFI_RECFG) &&
1243 ((cellRecfg->cfiRecfg.cfi < RGSCH_MIN_CFI_VAL) ||
1244 (cellRecfg->cfiRecfg.cfi > RGSCH_MAX_CFI_VAL)))
1246 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid CFI configuration %d",
1247 cellRecfg->cfiRecfg.cfi);
1250 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
1252 /* ccpu00138567- Removing validation check for resourceSize as 0.
1253 * From the spec, n2RB value 0 is a valid config. */
1254 if ((cellRecfg->pucchRecfg.n1PucchAn == 0) ||
1255 (cellRecfg->pucchRecfg.resourceSize >= (*cell)->bwCfg.ulTotalBw/2)||
1256 ((cellRecfg->pucchRecfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
1257 (cellRecfg->pucchRecfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS)) ||
1258 (cellRecfg->pucchRecfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
1260 RLOG_ARG4(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid PUCCH configuration: "
1261 "N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
1262 cellRecfg->pucchRecfg.resourceSize,
1263 cellRecfg->pucchRecfg.n1PucchAn,
1264 cellRecfg->pucchRecfg.deltaShift,
1265 cellRecfg->pucchRecfg.cyclicShift);
1269 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
1271 if (cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsBwEnum > RGR_SRS_BWCFG_7)
1273 RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid SRS configuration: "
1274 "srsBw %d", (uint8_t)cellRecfg->srsRecfg.srsBwEnum);
1278 /*ccpu00116923 - ADD - Srs Present support - Start*/
1281 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 13)
1283 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 14)
1286 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Subframe configuration ");
1290 /*ccpu00116923 - ADD - Srs Present support - End*/
1292 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
1294 if ((cellRecfg->rachRecfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
1295 ((cellRecfg->rachRecfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
1296 (cellRecfg->rachRecfg.raWinSize > RGSCH_MAX_RA_WINSIZE)) ||
1297 (cellRecfg->rachRecfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
1298 ((cellRecfg->rachRecfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE)
1299 || (cellRecfg->rachRecfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE))
1300 || (cellRecfg->rachRecfg.sizeRaPreambleGrpA >
1301 cellRecfg->rachRecfg.numRaPreamble) ||
1302 (cellRecfg->rachRecfg.prachResource >
1303 (*cell)->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB))
1305 RLOG_ARG3(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1306 " preamble Fmt %d raWinSize %d maxMsg3Tx %d",
1307 cellRecfg->rachRecfg.preambleFormat,
1308 cellRecfg->rachRecfg.raWinSize,
1309 cellRecfg->rachRecfg.maxMsg3Tx);
1310 RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
1311 "numRaPreamble %d sizeRaPreambleGrpA %d",
1312 cellRecfg->rachRecfg.numRaPreamble,
1313 cellRecfg->rachRecfg.sizeRaPreambleGrpA);
1319 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
1321 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellRecfg->siReCfg))) != ROK)
1323 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for SI"
1324 "Re-configuration failed");
1328 #endif /*RGR_SI_SCH */
1330 /* LTE_ADV_FLAG_REMOVED_START */
1331 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
1333 /* Checkin whether DSFR is enbaled without enabling SFR.
1334 * So we need to check if SFR is enabled along with DSFR
1335 * in the same reconfiguration or it is already enabled earlier*/
1336 if((cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
1337 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.dsfrCfg.status))
1339 if(!(((cellRecfg->rgrLteAdvCfg.pres & RGR_SFR) &&
1340 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.sfrCfg.status)) ||
1341 ((*cell)->lteAdvCb.sfrCfg.status == RGR_ENABLE)))
1343 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"DSFR is enbaled"
1344 "Without enabling SFR");
1348 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellRecfg->rgrLteAdvCfg),
1349 (*cell)->bwCfg.dlTotalBw)) != ROK)
1351 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for Lte Adv"
1352 "Re-configuration failed");
1356 /* LTE_ADV_FLAG_REMOVED_END */
1358 /* Validating minimum resource for non-CSG users */
1359 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
1361 if (cellRecfg->csgParamCfg.minDlResNonCsg > 100)
1363 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1364 "of minimum DL resources for NON-CSG");
1367 if (cellRecfg->csgParamCfg.minUlResNonCsg > 100)
1369 RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
1370 "of minimum UL resources for NON-CSG");
1374 errInfo->errCause = RGSCHERR_NONE;
1376 } /* rgSCHCfgVldtRgrCellRecfg */
1380 * @brief Ue SCell configuration for scheduler. It is invoked during first time
1381 * Scell configuration. It is not for reconfiguration
1385 * Function : rgSCHSCellCfgUeCfg
1387 * This functions updates UE specific scheduler
1388 * information upon UE SCell first time Scell configuration
1390 * @param[in] RgSchCellCb *cell
1391 * @param[in] RgSchUeCb *ue
1392 * @param[int] RgrUeRecfg *ueRecfg
1393 * @param[out] RgSchErrInfo *err
1398 S16 rgSCHSCellCfgUeCfg
1402 RgrUeRecfg *ueRecfg,
1407 Inst inst = cell->instIdx;
1408 RgSchCellCb *secCellCb = NULLP;
1409 uint8_t sCellidx = 0;
1410 RgSchUeCellInfo *sCellInfo = NULLP;
1411 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1413 RgrUeAprdDlCqiCfg *aCqiCfg;
1414 RgrUePrdDlCqiCfg *pCqiCfg;
1417 RLOG0(L_INFO, "SCELL recfg received from APP \n");
1419 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1420 "--------------------------------------------------------------------\n"
1421 "UE SCell ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1422 "--------------------------------------------------------------------\n",
1423 ue->ueId, cell->cellId));
1426 for(idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1428 /* Allocate the Ue control block */
1429 if (((rgSCHUtlAllocSBuf(inst, (Data **)&sCellInfo,
1430 sizeof(RgSchUeCellInfo))) != ROK))
1432 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx :Memomy allocation "
1433 "Failed while Adding SCell Information\n", idx));
1438 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1441 sCellInfo->sCellIdx = sCellInfoCfg->sCellIdx;
1442 sCellInfo->sCellId = sCellInfoCfg->sCellId;
1444 if(PRSNT_NODEF == sCellInfoCfg->sCellDeActTmr.pres)
1446 /* Configure implicit release */
1447 ue->sCellDeactTmrVal.val = sCellInfoCfg->sCellDeActTmr.val;
1448 ue->isScellExplicitDeAct = FALSE;
1449 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1451 else if (rgSchCb[cell->instIdx].genCfg.isSCellActDeactAlgoEnable == TRUE)
1453 /* Configure explicit release */
1454 ue->sCellDeactTmrVal.val = RGSCH_SCELL_DEACT_TMR_INFINITY_VAL;
1455 ue->isScellExplicitDeAct = TRUE;
1456 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1460 ue->sCellDeactTmrVal.val = 0;
1461 ue->isScellExplicitDeAct = FALSE;
1462 ue->sCellDeactTmrVal.pres = NOTPRSNT;
1465 sCellInfo->sCellState = RG_SCH_SCELL_INACTIVE;
1468 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = sCellInfo;
1469 sCellidx = ((sCellInfo->sCellId -
1470 rgSchCb[cell->instIdx].genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
1471 ue->cellIdToCellIdxMap[sCellidx] = sCellInfo->sCellIdx;
1473 /* For for time one Scell got added, setting allocCmnUlPdcch flag to TRUE, So that
1474 we will allocate PDCCH from common search space and the csiRequest field in DCI0 will
1475 be one bit (spec 36.213 sec 7.2.1)*/
1477 if ( ue->numSCells == 0)
1479 ue->allocCmnUlPdcch = TRUE;
1484 DU_LOG("\nDEBUG --> SCH : SCell added for ue %d numScells %d\n",ue->ueId,ue->numSCells);
1486 /* retrieve teh sec cell Cb */
1487 if((secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, sCellInfo->sCellId)) == NULLP)
1489 DU_LOG("\nERROR --> SCH : SCell doesnt exists");
1490 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1494 if(TRUE == sCellInfoCfg->txMode.pres)
1496 sCellInfo->txMode = sCellInfoCfg->txMode;
1500 DU_LOG("\nERROR --> SCH : [%d]SCellIdx Tx mode not present ",idx);
1501 sCellInfoCfg->txMode.pres = TRUE;
1502 sCellInfoCfg->txMode.txModeEnum = RGR_UE_TM_1;
1504 sCellInfo->txMode = sCellInfoCfg->txMode;
1506 cmInitTimers (&sCellInfo->actDelayTmr, 1);
1507 cmInitTimers (&sCellInfo->deactTmr, 1);
1509 ue->f1bCsAVal += rgSCHUtlGetMaxTbSupp(sCellInfo->txMode.txModeEnum);
1512 if(TRUE == sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.pres)
1514 sCellInfo->acqiCb.aCqiCfg.aprdModeEnum =
1515 sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.aprdModeEnum;
1518 if(TRUE == sCellInfoCfg->uePdschDedCfg.uepACfg.pAPrsnt)
1520 sCellInfo->pA.pres = TRUE;
1521 sCellInfo->pA.val = sCellInfoCfg->uePdschDedCfg.uepACfg.pA;
1525 sCellInfo->pA.pres = FALSE;
1528 aCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg;
1529 DU_LOG("\nDEBUG --> SCH : rgSCHCfgACqiUeCfg cellId =%d,Config Presence =%d for \
1530 Sec Cell Id = %d\n",
1531 cellCb->cellId, aCqiCfg->pres,sCellInfo->sCellId);
1533 /* if aperiodic cqi is present then only call the below function as it is
1537 if( ROK != rgSCHCfgACqiUeCfg(secCellCb,ue, &sCellInfo->acqiCb,
1538 sCellInfo->txMode.txModeEnum, aCqiCfg, ue->ueCatEnum))
1540 DU_LOG("\nERROR --> SCH : [%d]SCellIdx ACQI Cfg"
1541 "failed..n\n", idx);
1542 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1546 /* Configuring PCQI */
1547 /* Scell needs to be added to the
1548 * pcqi list only after activation */
1549 pCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.prdCqiCfg;
1551 if(ROK != rgSCHSCellPCqiCfg(cell,secCellCb,ue,pCqiCfg,
1552 ue->ueCatEnum,sCellInfoCfg->sCellIdx))
1554 DU_LOG("\nERROR --> SCH : [%d]SCellIdx PCQI Cfg failed..n\n", idx);
1555 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1560 /* Configuring ACQI */
1562 /* Stroing the secCell for easy access */
1563 sCellInfo->cell = secCellCb;
1567 if (ROK != rgSCHLaaInitDlRbAllocCb(secCellCb,
1568 &sCellInfo->dlAllocCb))
1573 /* Initialize Harq entity */
1575 sCellInfo->hqEnt = rgSCHDhmHqEntInit(secCellCb);
1576 if (sCellInfo->hqEnt == NULLP)
1578 DU_LOG("\nERROR --> SCH : [%d]UEID:Hq Entity Initialization "
1579 "failed in config\n", ue->ueId);
1580 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1584 rgSCHEmtcHqPAlloc(secCellCb, sCellInfo->hqEnt);
1586 rgSCHCmnDlInitHqEnt(secCellCb, sCellInfo->hqEnt);
1588 sCellInfo->hqEnt->ue = ue;
1589 /* Init SCell Specific Sched Spfc UE DL CB */
1590 if ((secCellCb->sc.apis->rgSCHRgrSCellUeCfg(secCellCb, ue, sCellInfoCfg, err)) != ROK)
1592 DU_LOG("\nERROR --> SCH : Spec Sched DL UE CFG FAILED\n");
1593 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1598 if((rgSCHUtlAllocUeANFdbkInfo(ue,sCellInfoCfg->sCellIdx)) != ROK)
1600 DU_LOG("\nERROR --> SCH : [%d]UEID:Memomy allocation "
1601 "Failed while UE related Ack Nack Information\n",
1603 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1606 #endif /* LTE_TDD */
1609 sCellInfo->sCellLnk.node = (PTR)sCellInfo;
1610 cmLListAdd2Tail(&secCellCb->sCellUeLst, &sCellInfo->sCellLnk);
1613 /* Inserting UECB into SCELL DBM */
1614 rgSCHDbmInsUeCb(secCellCb, ue);
1617 #ifndef MAC_5GTF_UPDATE
1618 ue->ul.useExtBSRSizes = ueRecfg->ueSCellCfgInfo.useExtBSRSizes;
1620 ue->ul.useExtBSRSizes = TRUE;
1623 for (idx = 0; idx < RGSCH_ULCTRL_RECP_DIST; idx++)
1625 ue->ul.ctrlOnServCellIdx[idx] = 0xFF;
1627 /* Trigger SCell addition to primary MAC */
1630 } /* rgSCHSCellCfgUeCfg */
1633 * @brief UE SCell PUCCH reconfiguration for scheduler
1637 * Function : rgSCHSCellCfgUePucchReCfg
1639 * This functions updates UE specific scheduler
1640 * information upon UE SCell PUCCH reconfiguration
1642 * @param[in] RgSchCellCb *cell
1643 * @param[in] RgSchUeCb *ue
1644 * @param[int] RgrUeRecfg *ueRecfg
1645 * @param[out] RgSchErrInfo *err
1650 S16 rgSCHSCellCfgUePucchReCfg
1654 RgrUeRecfg *ueRecfg,
1658 Inst inst = cell->instIdx;
1659 RgrUeSCellAckPucchCfg *sCellPucchRecfg = NULLP;
1662 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1663 "--------------------------------------------------------------------\n"
1664 "UE SCell PUCCH ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1665 "--------------------------------------------------------------------\n",
1666 ue->ueId, cell->cellId));
1669 sCellPucchRecfg = &ueRecfg->sCellAckN1ResCfg;
1670 /* Copy the UCI format type suported/configured for UE */
1671 ue->uciFrmtTyp = sCellPucchRecfg->pucchFormatType;
1673 if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
1675 ue->n1PucchF1bResCb.cw1N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count;
1676 ue->n1PucchF1bResCb.cw2N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count;
1678 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count; idx++)
1680 ue->n1PucchF1bResCb.cw1N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1[idx];
1683 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count; idx++)
1685 ue->n1PucchF1bResCb.cw2N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2[idx];
1689 else if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT3)
1691 ue->n3PucchResCb.antP0N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0Count;
1692 ue->n3PucchResCb.antP1N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1Count;
1693 for (idx = 0;idx < ue->n3PucchResCb.antP0N3ResCount; idx++ )
1695 ue->n3PucchResCb.antP0N3Res[idx].n3PucchIdx
1696 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0[idx];
1697 ue->n3PucchResCb.antP0N3Res[idx].n3Lnk.node = NULLP;
1698 ue->n3PucchResCb.antP0N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1700 for (idx = 0;idx < ue->n3PucchResCb.antP1N3ResCount; idx++ )
1702 ue->n3PucchResCb.antP1N3Res[idx].n3PucchIdx
1703 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1[idx];
1704 ue->n3PucchResCb.antP1N3Res[idx].n3Lnk.node = NULLP;
1705 ue->n3PucchResCb.antP1N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1707 ue->simulAckNackCQIFormat3 = ueRecfg->simulAckNackCQIFormat3;
1712 DU_LOG("\nERROR --> SCH : Wrong PUCCH Format:%d configured for CA",ue->uciFrmtTyp);
1717 } /* rgSCHSCellCfgUePucchReCfg */
1719 * @brief Validates the UE SCell Reconfiguration request from APP to SCH.
1723 * Function : rgSCHCfgVldtRgrUeSCellRecfg
1726 * - Validate Number of SCells
1727 * - If validated successfully,
1728 * - Process Number of SCells
1731 * - Validate SCellIdx value,
1732 * - If validated successfully,
1733 * - Process Number of RgrUeSecCellCfg
1737 * @param[in] RgrUeRecfg *ueRecfg
1738 * @param[out] RgSchCellCb *cell
1739 * @param[out] RgSchUeCb *ue
1740 * @param[out] RgSchErrInfo *errInfo
1745 S16 rgSCHCfgVldtRgrUeSCellRecfg
1747 RgrUeRecfg *ueRecfg,
1750 RgSchErrInfo *errInfo
1753 RgrUeSecCellCfg *ueSCellDedCfg = NULLP;
1754 RgSchCellCb *sCell = NULLP;
1755 Inst inst = cell->instIdx;
1758 DU_LOG("\nDEBUG --> SCH : VALIDATE RGR UE SCELL RECONFIG: cellId %d "
1759 "oldUeId %d cell %p \n", ueRecfg->cellId, ueRecfg->oldCrnti);
1760 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
1762 if((ueRecfg->ueSCellCfgInfo.numSCells > RGR_MAX_SCELL_PER_UE) ||
1763 (ueRecfg->ueSCellCfgInfo.numSCells < 1))
1765 DU_LOG("\nERROR --> SCH : Invalid number of SCELL "
1766 " in SCELL Recfg\n");
1770 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1772 ueSCellDedCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1773 if(ROK != rgSchUtlVldtCellId(inst, ueSCellDedCfg->sCellId))
1775 DU_LOG("\nERROR --> SCH : SCellId is out of range");
1778 /* Validate existence of sec cell */
1779 sCell = rgSchUtlGetCellCb(inst, ueSCellDedCfg->sCellId);
1782 DU_LOG("\nERROR --> SCH : SCell doesnt exists");
1786 /* validate the range of serv cell index */
1787 if((ueSCellDedCfg->sCellIdx < 1) ||
1788 (ueSCellDedCfg->sCellIdx > RGR_MAX_SCELL_PER_UE))
1790 DU_LOG("\nERROR --> SCH : Invalid Serv Cell Idx %d\n",
1791 ueSCellDedCfg->sCellIdx);
1795 /* Is this sec cell alredy confiured */
1796 if(NULLP != ue->cellInfo[ueSCellDedCfg->sCellIdx])
1798 DU_LOG("\nERROR --> SCH : Secll with id %d already added\n",
1799 ueSCellDedCfg->sCellIdx);
1803 /* Validate CQI config params */
1804 if((rgSCHCfgVldtUeCqiModeCfg(sCell, &ueSCellDedCfg->ueSCellDlCqiCfg)) != ROK)
1806 DU_LOG("\nERROR --> SCH : Invalid CQI Mode "
1807 " configuration for Ue %d\n",ue->ueId);
1811 /* 1. Validate UE Aperiodic CQI related parameters */
1812 if( ROK != rgSCHCfgVldtRgrUeACqiCfg (sCell, ue->ueId,
1813 &ueSCellDedCfg->ueSCellDlCqiCfg.aprdCqiCfg, ueSCellDedCfg->txMode,
1816 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Aperiodic CQI configuration\n");
1821 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1822 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg, ueRecfg->isHdFddEnbld,
1823 ueSCellDedCfg->txMode, errInfo ))
1825 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1826 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg,
1827 ueSCellDedCfg->txMode,
1831 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Periodic CQI configuration\n");
1835 if((ueSCellDedCfg->txMode.txModeEnum < RGR_UE_TM_1) ||
1836 (ueSCellDedCfg->txMode.txModeEnum > RGR_UE_TM_9))
1838 DU_LOG("\nERROR --> SCH : SCELL Invalid transmission mode for"
1839 " UE %d\n", (uint8_t)ueSCellDedCfg->txMode.txModeEnum);
1845 errInfo->errCause = RGSCHERR_NONE;
1846 DU_LOG("\nDEBUG --> SCH : RGR Ue SCell Reconfig validation done: "
1847 "cellId %d oldUeId %d\n", ueRecfg->cellId, ue->ueId);
1849 } /* rgSCHCfgVldtRgrUeSCellRecfg */
1852 * @brief Ue SCell configuration roll back due to failure during configuration
1857 * Function : rgSCHSCellCfgUeCfgRollBack
1859 * This functions roll backs the configuration of successfully added Scell
1861 * @param[in] RgSchCellCb *cell
1862 * @param[in] RgSchUeCb *ue
1863 * @param[int] RgrUeRecfg *ueRecfg
1864 * @param[out] RgSchErrInfo *err
1869 static S16 rgSCHSCellCfgUeCfgRollBack
1876 Inst inst = cell->instIdx;
1877 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1878 RgSchUeCellInfo *sCellInfo = NULLP;
1879 RgSchCmnCell *cellSch = NULLP;
1881 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1882 "--------------------------------------------------------------------\n"
1883 "UE SCell config roll back at SCH: rnti (%u) cell(%u)\n"
1884 "--------------------------------------------------------------------\n",
1885 ue->ueId, cell->cellId));
1887 /* Free all Added scell in this transaction */
1888 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1890 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1891 sCellInfo = ue->cellInfo[(sCellInfoCfg->sCellIdx)];
1893 /* if sCellInfo is not NULLP that means this Scell is added hence
1895 if (NULLP != sCellInfo)
1897 /* Clear Scheduler specific list for this UE from the
1898 * corresponding CELL */
1899 cellSch = RG_SCH_CMN_GET_CELL(sCellInfo->cell);
1900 cellSch->apisDl->rgSCHDlUeReset(sCellInfo->cell, sCellInfo->ue);
1902 /* Delete harq Entity of Scell*/
1903 rgSCHDhmDelHqEnt(cell, &(sCellInfo->hqEnt));
1905 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
1906 sizeof(RgSchUeCellInfo));
1908 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = NULLP;
1911 if (ue->numSCells == 0)
1913 ue->allocCmnUlPdcch = TRUE;
1914 /* As there is no SCell left so DCI 0 size at UE specific search space
1915 * will be recalculated as the CSI is reduced to 1 bit */
1916 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
1923 #endif /* LTE_ADV */
1925 * @brief Validates the UE reconfiguration request from RRC to MAC.
1929 * Function : rgSCHCfgVldtRgrUeRecfg
1932 * - Retrieve the UE control block.
1934 * - Validate the range of reconfigured values recieved in
1935 * re-configuration request.
1936 * - If validated successfully,
1937 * - Return ROK and pointer to the cell and ue.
1940 * - Else return RFAILED.
1942 * @param[in] Inst inst
1943 * @param[in] RgrUeRecfg *ueRecfg
1944 * @param[out] RgSchCellCb **cell
1945 * @param[out] RgSchUeCb **ue
1946 * @param[out] RgSchErrInfo *errInfo
1951 S16 rgSCHCfgVldtRgrUeRecfg
1954 RgrUeRecfg *ueRecfg,
1957 RgSchErrInfo *errInfo
1961 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RECFG;
1963 if (((*cell) == NULLP) ||
1964 ((*cell)->cellId != ueRecfg->cellId))
1966 DU_LOG("\nERROR --> SCH : Cell does not exist for OLD CRNTI:%d",ueRecfg->oldCrnti);
1970 /* Fetch the Old Ue */
1971 if ((*ue = rgSCHDbmGetUeCb(*cell, ueRecfg->oldCrnti)) == NULLP)
1973 DU_LOG("\nERROR --> SCH : OLD CRNTI:%d does not exist",
1979 if(RGR_UE_SCELL_ADD_RECFG & ueRecfg->ueRecfgTypes)
1981 S16 ret = rgSCHCfgVldtRgrUeSCellRecfg(ueRecfg,*cell, *ue, errInfo);
1984 DU_LOG("\nERROR --> SCH : Ue SCell Recfg Validation FAILED\n");
1987 errInfo->errCause = RGSCHERR_NONE;
1992 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
1994 if (rgSCHDbmGetUeCb(*cell, ueRecfg->newCrnti) != NULLP)
1996 DU_LOG("\nERROR --> SCH : NEW CRNTI:%d already exists",
2002 if ((ueRecfg->ueRecfgTypes & RGR_UE_CSG_PARAM_RECFG) &&\
2003 ((*ue)->csgMmbrSta == ueRecfg->csgMmbrSta))
2005 DU_LOG("\nERROR --> SCH : UE ID [%d] invalid CSG Membership reconfig :%d ",
2006 ueRecfg->newCrnti, (uint8_t)ueRecfg->csgMmbrSta);
2009 /* Validate values */
2010 if ((ueRecfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
2011 (ueRecfg->txMode.pres == TRUE) &&
2012 ((ueRecfg->txMode.txModeEnum < RGR_UE_TM_1) ||
2013 (ueRecfg->txMode.txModeEnum > RGR_UE_TM_7)))
2015 DU_LOG("\nERROR --> SCH : Invalid transmission mode %d"
2016 "for NEW CRNTI:%d", (uint8_t)ueRecfg->txMode.txModeEnum,ueRecfg->newCrnti);
2020 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2021 (((ueRecfg->prdDlCqiRecfg.k < 1) || (ueRecfg->prdDlCqiRecfg.k > 4)) ||
2022 ((ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx < 1) ||
2023 (ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx > 1024))))
2025 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI INFO"
2026 "OLD CRNTI:%d NEW CRNTI:%d",(uint8_t)ueRecfg->oldCrnti,ueRecfg->newCrnti);
2030 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULHARQ_RECFG) &&
2031 (ueRecfg->ueUlHqRecfg.maxUlHqTx < RGSCH_MIN_HQ_TX))
2033 DU_LOG("\nERROR --> SCH : Invalid Uplink HARQ config %d"
2034 "for NEW CRNTI:%d", ueRecfg->ueUlHqRecfg.maxUlHqTx,ueRecfg->newCrnti);
2038 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2039 (ueRecfg->prdDlCqiRecfg.prdModeEnum > RGR_PRD_CQI_MOD21))
2041 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for"
2042 " DL CQI %d NEW CRNTI:%d", (uint8_t)ueRecfg->prdDlCqiRecfg.prdModeEnum,ueRecfg->newCrnti);
2046 if ((ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG) &&
2047 (ueRecfg->cqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
2049 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for "
2050 "DL CQI %d for NEW CRNTI:%d",(uint8_t)ueRecfg->cqiCfg.cqiSetup.prdModeEnum,ueRecfg->newCrnti);
2053 #endif /* TFU_UPGRADE */
2054 /* Validate UE Category */
2055 if (ueRecfg->ueCatEnum > CM_LTE_UE_CAT_8)
2057 DU_LOG("\nERROR --> SCH : Invalid category %d for NEW CRNTI:%d",
2058 (uint8_t)ueRecfg->ueCatEnum,ueRecfg->newCrnti);
2062 /* Validate UE Access Stratum Release */
2063 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
2064 (ueRecfg->accessStratumRls > RGR_REL_11))
2066 DU_LOG("\nERROR --> SCH : Invalid Access Stratum Release %u for UE\n",
2067 ueRecfg->accessStratumRls);
2070 DU_LOG("\nINFO --> SCH : Configured Access Stratum Release %u\n", \
2071 ueRecfg->accessStratumRls);
2073 if ((ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG) &&
2074 ((ueRecfg->aprdDlCqiRecfg.pres == TRUE) &&
2075 ((ueRecfg->aprdDlCqiRecfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
2076 (*cell)->bwCfg.dlTotalBw <= 7)))
2078 DU_LOG("\nERROR --> SCH : Invalid aperiodic mode config for"
2079 " DL CQI %d for NEW CRNTI:%d", (uint8_t)ueRecfg->aprdDlCqiRecfg.aprdModeEnum,ueRecfg->newCrnti);
2082 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULPWR_RECFG) &&
2083 (rgSCHCfgVldtUePwrCfg(*cell, &ueRecfg->ueUlPwrRecfg) != ROK))
2085 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
2086 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2091 if ((ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG) &&
2092 (rgSCHCfgVldtUeMeasGapAckNakRepRecfg(*cell, ueRecfg) != ROK))
2094 DU_LOG("\nERROR --> SCH : Invalid MeasGap/AckNackRep"
2095 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2099 if(rgSCHCfgVldtSpsReCfg(*cell, *ue, ueRecfg)!= ROK)
2101 DU_LOG("\nERROR --> SCH : Invalid SPS"
2102 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2107 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
2108 if ( ROK != rgSCHCfgVldtCqiSrSrsUeReCfg(*cell, *ue, ueRecfg, errInfo))
2110 DU_LOG("\nERROR --> SCH : Invalid ACQI, PCQI/SR/SRS "
2111 "Re-configuration for NEW CRNTI:%d",ueRecfg->newCrnti);
2115 if ((ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG) &&
2116 (rgSCHCfgVldtDrxUeCfg(*cell, &(ueRecfg->ueDrxRecfg)) != ROK))
2118 DU_LOG("\nERROR --> SCH : Invalid drxParams"
2119 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2123 /* ccpu00117452 - MOD - Changed macro name from
2124 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
2126 /* Validate DL Power Control Config parameters */
2127 if(rgSCHCfgVldtCqiReptReCfg(*cell, ueRecfg)!= ROK)
2129 DU_LOG("\nERROR --> SCH : Invalid DL Power Control"
2130 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2133 #endif /* End of RGR_CQI_REPT */
2134 errInfo->errCause = RGSCHERR_NONE;
2136 } /* rgSCHCfgVldtRgrUeRecfg */
2140 * @brief Validates the logical channel reconfiguration request from
2145 * Function : rgSCHCfgVldtRgrLchRecfg
2148 * - Retrieve the uplink and downlink logical channel control block.
2150 * - Validate the range of reconfigured values recieved in
2151 * re-configuration request.
2152 * - If validated successfully,
2153 * - Return ROK and pointer to the cell, UE and logical channel.
2156 * - Else return RFAILED.
2158 * @param[in] RgrLchRecfg *lcRecfg
2159 * @param[out] RgSchCellCb **cell
2160 * @param[out] RgSchUeCb **ue
2161 * @param[out] RgSchUlLcCb **ulLc
2162 * @param[out] RgSchDlLcCb **dlLc
2163 * @param[out] RgSchErrInfo *errInfo
2168 S16 rgSCHCfgVldtRgrLchRecfg
2171 RgrLchRecfg *lcRecfg,
2175 RgSchErrInfo *errInfo
2178 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LC_RECFG;
2180 if (((*cell) == NULLP) ||
2181 ((*cell)->cellId != lcRecfg->cellId))
2183 DU_LOG("\nERROR --> SCH : Cell does not exist "
2184 "for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2188 /* Fetch the Ue for dedicated channels */
2189 if ((*ue = rgSCHDbmGetUeCb(*cell, lcRecfg->crnti)) == NULLP)
2191 DU_LOG("\nERROR --> SCH : UEID does not exist"
2192 "dedicated logical channel for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2196 if ((*dlLc = rgSCHDbmGetDlDedLcCb((*ue), lcRecfg->lcId)) == NULLP)
2198 DU_LOG("\nERROR --> SCH : Dedicated DL LC does not "
2199 "exist for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2203 errInfo->errCause = RGSCHERR_NONE;
2205 } /* rgSCHCfgVldtRgrLchRecfg */
2208 * @brief Validates the UE Reset request from RRM to MAC.
2212 * Function : rgSCHCfgVldtRgrUeReset
2215 * - Retrieve the CELL control block
2216 * - If cell does not exist return RFAILED
2217 * - Retrieve UE Control block
2218 * - If UE does not exist return RFAILED
2221 * @param[in] Inst inst
2222 * @param[in] RgrRst *reset
2223 * @param[out] RgSchCellCb **cell
2224 * @param[out] RgSchUeCb **ue
2225 * @param[out] RgErrInfo *errInfo
2230 S16 rgSCHCfgVldtRgrUeReset
2236 RgSchErrInfo *errInfo
2240 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RESET;
2242 if ((cell == NULLP) || (cell->cellId != reset->cellId))
2244 DU_LOG("\nERROR --> SCH : CELL does not exist for CRNTI:%d",
2249 if ((*ue = rgSCHDbmGetUeCb(&(*cell), reset->crnti)) == NULLP)
2251 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d",
2256 errInfo->errCause = RGSCHERR_NONE;
2259 } /* rgSCHCfgVldtRgrUeReset */
2263 * @brief Validates the logical channel reconfiguration request from
2268 * Function : rgSCHCfgVldtRgrLcgRecfg
2271 * - Retrieve the uplink and downlink logical channel control block.
2273 * - Validate the range of reconfigured values recieved in
2274 * re-configuration request.
2275 * - If validated successfully,
2276 * - Return ROK and pointer to the cell, UE and logical channel.
2279 * - Else return RFAILED.
2281 * @param[in] RgrLchRecfg *lcRecfg
2282 * @param[out] RgSchCellCb **cell
2283 * @param[out] RgSchUeCb **ue
2284 * @param[out] RgSchErrInfo *errInfo
2289 S16 rgSCHCfgVldtRgrLcgRecfg
2292 RgrLcgRecfg *lcgRecfg,
2295 RgSchErrInfo *errInfo
2298 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LCG_RECFG;
2300 if (((cell) == NULLP) ||
2301 ((cell)->cellId != lcgRecfg->cellId))
2303 DU_LOG("\nERROR --> SCH : Cell does not exist for"
2304 "CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2308 /* Fetch the Ue for dedicated channels */
2309 if ((*ue = rgSCHDbmGetUeCb(&(*cell), lcgRecfg->crnti)) == NULLP)
2311 DU_LOG("\nERROR --> SCH : UE does not exist for "
2312 "dedicated logical channel group CRNTI:%d LCGID:%d",
2313 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2316 if (lcgRecfg->ulRecfg.lcgId > (RGSCH_MAX_LCG_PER_UE - 1))
2318 DU_LOG("\nERROR --> SCH : Invalid lcgId for uplink logical"
2319 "channel CRNTI:%d LCGID:%d",
2320 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2324 if ((lcgRecfg->ulRecfg.gbr != 0) && (lcgRecfg->ulRecfg.mbr < lcgRecfg->ulRecfg.gbr))
2326 DU_LOG("\nERROR --> SCH : Dedicated Logical Group %d validation failed"\
2327 " for ue %d for cell %d\n", lcgRecfg->ulRecfg.lcgId,(*ue)->ueId, cell->cellId);
2330 errInfo->errCause = RGSCHERR_NONE;
2332 } /* rgSCHCfgVldtRgrLcgRecfg */
2338 * Function : rgSCHDynCfiCfg
2340 * @param[in] RgSchCellCb *cell
2341 * RgrCellCfg *cellCfg
2346 static S16 rgSCHDynCfiCfg
2354 uint8_t ulDlCfgIdx = cellCfg->ulDlCfgIdx;
2360 cell->dynCfiCb.isDynCfiEnb = cellCfg->isDynCfiEnb;
2362 /* Initializing Failure Sample Period */
2363 cell->dynCfiCb.failSamplePrd = (RGSCH_CFI_TTI_MON_INTRVL *
2364 RGSCH_CFI_STEP_UP_TTI_PRCNTG)/100;
2365 /* Initializing Number of Failure Samples */
2366 cell->dynCfiCb.numFailSamples = (RGSCH_CFI_TTI_MON_INTRVL/
2367 cell->dynCfiCb.failSamplePrd);
2368 cell->dynCfiCb.maxCfi = RGSCH_MAX_CFI_VAL;
2369 /* Allocating memory for CCE failure average array based on
2370 * monitoring interval and CCE failure sample period */
2371 if((rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&(cell->dynCfiCb.cceFailSamples),
2372 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)))) != ROK)
2374 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2378 /* Setting the Invalid value 0xFF to pdcchSfIdx, it will be assigned
2379 * a valid value during CFI swithing is done */
2380 cell->dynCfiCb.pdcchSfIdx = 0xFF;
2383 /* In case of config index 0, the mphich index can be upto 2
2384 * in other config index cases, it will always be set as 1*/
2387 maxMPhich = RG_SCH_MAX_MPHICH;
2391 maxMPhich = RG_SCH_MAX_MPHICH -1;
2393 /* Calculate the number of CCEs in the cell */
2394 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2396 for(mphIdx = 0; mphIdx < maxMPhich; mphIdx++)
2398 cell->dynCfiCb.cfi2NCceTbl[mphIdx][cfi] =
2399 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw,
2400 cell->phichCfg.ngEnum, cfi, mphIdx,
2401 cell->numTxAntPorts,
2402 cell->isCpDlExtend);
2406 /* Calculate the number of CCEs in the cell */
2407 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2409 /* CFI Index starts from 1 so that there can be a direct mapping from
2410 actual CFI value to cfi Index. mPhich index will always be set
2412 cell->dynCfiCb.cfi2NCceTbl[0][cfi] =
2413 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw, cell->phichCfg.ngEnum,
2414 cfi, cell->numTxAntPorts, cell->isCpDlExtend);
2417 /* Calculate the number of CCEs in the cell */
2418 if(cell->dynCfiCb.isDynCfiEnb == TRUE)
2420 /* In case if Dynamic CFI feature is enabled, default CFI
2421 * value 1 is used */
2422 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][1];
2426 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][cellCfg->cfiCfg.cfi];
2431 numDlSf = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][9] *
2432 (RGSCH_CFI_TTI_MON_INTRVL/10);
2433 cell->dynCfiCb.cfiStepUpTtiCnt =
2434 (RGSCH_CFI_STEP_UP_TTI_PRCNTG * numDlSf)/100;
2435 cell->dynCfiCb.cfiStepDownTtiCnt =
2436 (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG * numDlSf)/100;
2438 cell->dynCfiCb.cfiStepUpTtiCnt = (RGSCH_CFI_STEP_UP_TTI_PRCNTG *
2439 RGSCH_CFI_TTI_MON_INTRVL)/100;
2440 cell->dynCfiCb.cfiStepDownTtiCnt = (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG *
2441 RGSCH_CFI_TTI_MON_INTRVL)/100;
2448 * @brief Handler for the SCHED Enb configuration request from RRM to MAC.
2452 * Function : rgSCHCfgRgrSchedEnbCfg
2455 * - Invoke SCH with SCHEDULER control block to update
2456 * scheduler specific information.
2457 * - Update rgSch control block with the values recieved in the
2459 * - If successful, return ROK else RFAILED.
2461 * @param[in] RgSchCb *instCb
2462 * @param[in] SpId spId
2463 * @param[in] RgSchSchedEnbCfg *schedEnbCfg
2464 * @param[out] RgSchErrInfo *errInfo
2469 S16 rgSCHCfgRgrSchedEnbCfg
2473 RgrSchedEnbCfg *schedEnbCfg,
2474 RgSchErrInfo *errInfo
2478 DU_LOG("\nDEBUG --> SCH : APPLYING RGR SCH ENB CONFIG: \n");
2479 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
2481 rgSchCb[inst].rgrSchedEnbCfg = *schedEnbCfg;
2482 DU_LOG("\nDEBUG --> SCH : dlSchdType %d ulSchdType %d dlTptCoeffi %d"
2483 "dlFairCoeffi %d ulTptCoeffi %d ulFairCoeffi %d\n",
2484 schedEnbCfg->dlSchdType, schedEnbCfg->ulSchdType, schedEnbCfg->dlSchInfo.dlPfs.tptCoeffi,
2485 schedEnbCfg->dlSchInfo.dlPfs.fairCoeffi, schedEnbCfg->ulSchInfo.ulPfs.tptCoeffi,
2486 schedEnbCfg->ulSchInfo.ulPfs.fairCoeffi);
2489 rgSchCb[inst].rgSchDynTdd.isDynTddEnbld = schedEnbCfg->isDynTddEnbld;
2492 if(RGR_SCH_TYPE_PFS == schedEnbCfg->dlSchdType)
2494 rgSCHEnbPfsDlCfg(inst, errInfo);
2497 errInfo->errCause = RGSCHERR_NONE;
2498 DU_LOG("\nINFO --> SCH : RGR SCH gNB done: \n");
2500 } /* rgSCHCfgRgrSchedEnbCfg */
2504 * @brief Handler for the cell configuration of 5gtf.
2508 * Function : rgSCH5gtfCellCfg
2510 * @param[in] RgSchCellCb *cell
2511 * @param[in] RgSchCellCfg *cellCfg
2516 S16 rgSCH5gtfCellCfg
2524 for(idx = 0; idx < MAX_5GTF_GROUP; idx++)
2526 cell->cell5gtfCb.ueGrp5gConf[idx].beamBitMask = 0;
2529 for(idx = 0 ; idx < MAX_5GTF_SUBFRAME_INFO ; ++idx)
2531 cell->cell5gtfCb.dynConfig[idx] = cellCfg->Cell5gtfCfg.dynConfig[idx];
2533 cell->cell5gtfCb.numUes = cellCfg->Cell5gtfCfg.numUes;
2534 cell->cell5gtfCb.uePerGrpPerTti = cellCfg->Cell5gtfCfg.uePerGrp;
2535 cell->cell5gtfCb.ueGrpPerTti = cellCfg->Cell5gtfCfg.ueGrpPerTti;
2536 cell->cell5gtfCb.numCCs = cellCfg->Cell5gtfCfg.numOfCC;
2537 cell->cell5gtfCb.bwPerCC = cellCfg->Cell5gtfCfg.bwPerCC;
2538 DU_LOG("\nINFO --> SCH : cell cfg at schd,numUes:%u,uepergrp:%u,uegrppertti:%u,numCC:%u,bwPerc:%u cfi %u\n",
2539 cell->cell5gtfCb.numUes,cell->cell5gtfCb.uePerGrpPerTti,cell->cell5gtfCb.ueGrpPerTti,
2540 cell->cell5gtfCb.numCCs,cell->cell5gtfCb.bwPerCC, cell->cell5gtfCb.cfi);
2545 #ifdef XEON_LMT_ITBS
2546 uint16_t gWrMaxDlItbs;
2547 uint16_t gWrMaxUlItbs;
2550 * @brief Handler for the cell configuration request from RRM to MAC.
2554 * Function : rgSCHCfgRgrCellCfg
2557 * - Invoke SCH with cell control block to update
2558 * scheduler specific information.
2559 * - Update cell control block with the values recieved in the
2561 * - Add to the active list of cells if cell becomes ACTIVE.
2562 * - If successful, return ROK else RFAILED.
2564 * @param[in] RgSchCb *instCb
2565 * @param[in] SpId spId
2566 * @param[in] RgSchCellCfg *cellCfg
2567 * @param[out] RgSchErrInfo *errInfo
2572 S16 rgSCHCfgRgrCellCfg
2576 RgrCellCfg *cellCfg,
2577 RgSchErrInfo *errInfo
2583 RgInfCellReg cellRegReq;
2584 RgSchCellCb *cell = NULLP;
2585 Inst inst = instCb->rgSchInit.inst;
2586 uint32_t Idx1 = (uint8_t)((cellCfg->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
2588 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_CFG;
2590 memset(&pst, 0, sizeof(Pst));
2592 /* Allocate the scheduler's cell control block */
2593 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&cell, sizeof(RgSchCellCb)))
2596 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2600 if(cellCfg->emtcEnable)
2602 if((ret = rgSCHEmtcCellAlloc(cell))
2605 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for emtc cell");
2610 if ((uint8_t *)cell == NULLP)
2612 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2615 /* Initialize the lists of the cell */
2616 ret = rgSCHDbmInitCell(cell);
2619 DU_LOG("\nERROR --> SCH : DBM initialization FAILED for cell");
2620 rgSCHCfgFreeCellCb(cell);
2623 /* LTE_ADV_FLAG_REMOVED_START */
2624 if(cellCfg->rgrLteAdvCfg.pres & RGR_ABS)
2626 cell->lteAdvCb.absCfg =
2627 cellCfg->rgrLteAdvCfg.absCfg;
2628 memset(cell->lteAdvCb.absLoadInfo, 0, sizeof(uint32_t)*RGR_ABS_PATTERN_LEN);
2629 cell->lteAdvCb.absLoadTtiCnt = 0;
2632 if(cellCfg->rgrLteAdvCfg.pres & RGR_SFR)
2634 cell->lteAdvCb.sfrCfg =
2635 cellCfg->rgrLteAdvCfg.sfrCfg;
2637 if(cellCfg->rgrLteAdvCfg.pres & RGR_DSFR)
2639 cell->lteAdvCb.dsfrCfg =
2640 cellCfg->rgrLteAdvCfg.dsfrCfg;
2642 /* LTE_ADV_FLAG_REMOVED_END */
2645 cell->emtcEnable = cellCfg->emtcEnable;
2647 /* Initialize the cell */
2648 cell->cellId = cellCfg->cellId;
2649 cell->instIdx = inst;
2650 cell->macInst = cellCfg->macInst;
2651 cell->isCpUlExtend = cellCfg->isCpUlExtend;
2652 cell->isCpDlExtend = cellCfg->isCpDlExtend;
2654 cell->numTxAntPorts = rgSchCb[inst].rgrSchedEnbCfg.numTxAntPorts;
2655 if(cell->numTxAntPorts == 1)
2657 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_ONE_ANT_PORT;
2659 else if(cell->numTxAntPorts == 2)
2661 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_TWO_ANT_PORT;
2665 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_FOUR_ANT_PORT;
2667 cell->bwCfg = cellCfg->bwCfg;
2668 cell->pbchRbStart = ((((cell->bwCfg.dlTotalBw * 12)/2) - 36)/12); /* Ref section 6.6 in 36.211 */
2669 cell->pbchRbEnd = cell->pbchRbStart + 5;
2670 cell->pucchCfg = cellCfg->pucchCfg;
2671 cell->rachCfg = cellCfg->rachCfg;
2672 cell->siCfg = cellCfg->siCfg;
2673 cell->t300TmrVal = cellCfg->t300TmrVal;
2675 /*Initialize the SI CB in Cell CB */
2676 memset(&cell->siCb, 0, sizeof(RgSchSiCb));
2678 /*Fix: Added Guard Pool for RNTI which will contain RNTIs
2679 *for UEs deleted from Scheduler but not yet from MAC*/
2680 cmLListInit(&cell->rntiDb.rntiGuardPool);
2682 /* Initialize the inWindow to sync with scheduler time when ticks starts */
2684 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2685 (RG_SCH_CMN_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL));
2687 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2688 (RG_SCH_CMN_DL_DELTA));
2691 if(cell->siCb.inWindow < 0)
2693 cell->siCb.inWindow = 0;
2695 cell->macPreambleSet = cellCfg->macPreambleSet;
2696 cell->phichCfg = cellCfg->phichCfg;
2698 /* Initialize UL and DL CCCH logical channels */
2699 cell->ulCcchId = RGSCH_INVALID_LC_ID;
2700 cell->dlCcchId = RGSCH_INVALID_LC_ID;
2702 /* Update SRS configuration */
2703 cell->srsCfg.isSrsCfgPres = cellCfg->srsCfg.isSrsCfgSetup;
2704 if(cellCfg->srsCfg.isSrsCfgSetup)
2706 cell->srsCfg.srsCfgPrdEnum = cellCfg->srsCfg.srsCfgPrdEnum;
2707 cell->srsCfg.srsBwEnum = cellCfg->srsCfg.srsBwEnum;
2708 cell->srsCfg.srsTxOffst =
2709 rgSrsTxOffstTbl[cellCfg->srsCfg.srsSubFrameCfg];
2710 /*ccpu00116923 - ADD - Srs Present support */
2712 cell->srsCfg.srsSubFrameCfg = cellCfg->srsCfg.srsSubFrameCfg;
2716 /* Configure all the common logical channels for the cell */
2717 for(idx = 0; idx < cellCfg->numCmnLcs; idx++)
2719 /* This never returns failure and hence not checked for */
2720 rgSCHCfgRgrCmnLcCfg(cell, &(cellCfg->cmnLcCfg[idx]), errInfo);
2723 /* Invoke the MeasGap and ACK NACK Rep handler for cell cfg */
2725 /* Dynamic CFI cell configuration */
2726 ret = rgSCHDynCfiCfg(cell, cellCfg);
2729 DU_LOG("\nERROR --> SCH : Rgr cell Config failed at "
2730 "Scheduler for cell");
2731 rgSCHCfgFreeCellCb(cell);
2734 /* Updating Auto TM Mode enable/diable flag */
2735 cell->isAutoCfgModeEnb = cellCfg->isAutoCfgModeEnb;
2737 if(cell->isAutoCfgModeEnb)
2739 DU_LOG("\nINFO --> SCH : Auto Mode Cfg enabled durint cell cfg\n");
2742 /* CPU OvrLoad State Initialization */
2743 #ifdef XEON_LMT_ITBS
2744 cell->thresholds.maxDlItbs = gWrMaxDlItbs;
2745 cell->thresholds.maxUlItbs = gWrMaxUlItbs;
2746 DU_LOG("\nINFO --> SCH : LIMIT DL and UL ITBS %d:%d \n",gWrMaxDlItbs,gWrMaxUlItbs);
2748 cell->thresholds.maxDlItbs = RG_SCH_DL_MAX_ITBS;
2749 cell->thresholds.maxUlItbs = RG_SCH_UL_MAX_ITBS;
2751 cell->measurements.dlTpt = 0;
2752 cell->measurements.ulTpt = 0;
2753 cell->measurements.dlBytesCnt = 0;
2754 cell->measurements.ulBytesCnt = 0;
2755 cell->cpuOvrLdCntrl.cpuOvrLdIns = 0; /* 0 - No command */
2756 cell->cpuOvrLdCntrl.dlNxtIndxDecNumUeTti = 0;
2757 cell->cpuOvrLdCntrl.ulNxtIndxDecNumUeTti = 0;
2758 for ( idx = 0; idx < 10; idx++ )
2760 cell->cpuOvrLdCntrl.maxUeNewTxPerTti[idx] = cellCfg->maxDlUeNewTxPerTti;
2761 cell->cpuOvrLdCntrl.maxUeNewRxPerTti[idx] = cellCfg->maxUlUeNewTxPerTti;
2764 /* Invoke scheduler to update scheduler specific information */
2765 ret = rgSCHUtlRgrCellCfg(cell, cellCfg, errInfo);
2768 DU_LOG("\nERROR --> SCH : Rgr cell Config failed at "
2769 "Scheduler for cell ");
2770 rgSCHCfgFreeCellCb(cell);
2774 /* Invoke DHM to update DHM specific information */
2775 rgSCHDhmRgrCellCfg(cell, cellCfg, errInfo);
2778 /* Initialize RNTI DB */
2779 ret = rgSCHDbmRntiDbInit(cell, cellCfg->macRnti.startRnti,
2780 cellCfg->macRnti.size);
2783 DU_LOG("\nERROR --> SCH : Rgr Cell Config failed at"
2784 " RNTI DB init for cell");
2785 rgSCHCfgFreeCellCb(cell);
2789 /* Update the cell with recieved configuration */
2790 cell->dlHqCfg = cellCfg->dlHqCfg;
2792 DU_LOG("\nINFO --> SCH : Config DL HQTX = %d\n",cell->dlHqCfg.maxDlHqTx);
2794 cell->crntSfIdx = 0;
2795 /* Allocate the subframe allocation information */
2796 if((ret = rgSCHUtlGetSfAlloc(cell)) != ROK)
2798 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
2800 rgSCHCfgFreeCellCb(cell);
2803 /* Update RACH Related information
2804 * XXX: Below function yet to be written in RAM
2805 * To store the preambles given in the configuration for PDCCH order in the
2806 * scheduler cell control block. Initialize the PRACH Mask Index allocated
2807 * for these preambles to invalid values */
2809 cell->crntHqIdx = 0;
2810 /* Allocate the subframe allocation information */
2811 if((ret = rgSCHUtlGetRlsHqAlloc(cell)) != ROK)
2813 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for"
2815 rgSCHCfgFreeCellCb(cell);
2819 /* Associate a pair of upper and lower sapCbs with this cell */
2820 instCb->rgrSap[spId].cell = cell;
2821 instCb->tfuSap[spId].cell = cell;
2822 instCb->rgmSap[spId].cell = cell;
2823 cell->tfuSap = &(instCb->tfuSap[spId]);
2826 instCb->cells[Idx1] = cell;
2829 /* rg001.201: Added for sending TTI tick to RRM */
2830 #if (defined(RGR_RRM_TICK) || defined(RGR_CQI_REPT))
2831 /* Associate the RGR SAP as well utilized while sending TTI
2832 * Ticks to RGR User. */
2833 cell->rgrSap = &(instCb->rgrSap[spId]);
2835 cell->rgmSap = &(instCb->rgmSap[spId]);
2837 /* Store the periodicity configured */
2838 cell->rrmTtiIndPrd = cellCfg->rrmTtiIndPrd;
2842 cmLListInit(&cell->l2mList);
2845 if (rgSCHDrxCellCfg(cell,cellCfg) != ROK)
2847 DU_LOG("\nERROR --> SCH : Drx Memory allocation FAILED for"
2849 rgSCHCfgFreeCellCb(cell);
2852 cell->overLoadBackOffEnab = FALSE;/* Disabling RachOverload by default */
2853 /* Updating CSG Parameters */
2854 cell->minDlResNonCsg = cellCfg->csgParamCfg.minDlResNonCsg;
2855 cell->minUlResNonCsg = cellCfg->csgParamCfg.minUlResNonCsg;
2857 /* Register the cell with MAC */
2858 rgSCHUtlGetPstToLyr(&pst, instCb, cell->macInst);
2859 cellRegReq.cellId = cell->cellId;
2860 cellRegReq.cellSapId = spId;
2862 cellRegReq.maxDlHqProcPerUe = rgSchTddDlNumHarqProcTbl[cellCfg->ulDlCfgIdx];
2864 cellRegReq.maxDlHqProcPerUe = RGSCH_MAX_DL_HQ_PROC;
2866 RgSchMacCellReg(&pst, &cellRegReq);
2869 cell->tenbStats = TSL2AllocCellStatsBlk(cell->cellId);
2870 cell->tenbStats->cellId = cell->cellId;
2873 rgSCHUtlCalcDciSizes(cell);
2876 /* Initilalization of the list of UE for which this cell is secondary cell*/
2877 cmLListInit(&cell->sCellUeLst);
2882 ret = rgSCHLaaSCellCbInit(cell, cellCfg);
2885 DU_LOG("\nERROR --> SCH : Rgr Cell Config failed at"
2886 " Initializing the LAA Cell Control Cb");
2887 rgSCHCfgFreeCellCb(cell);
2890 cell->isPucchFormat3Sptd = cellCfg->isPucchFormat3Sptd;
2891 DU_LOG("\nINFO --> SCH : Format 3 is Enabled");
2892 DU_LOG ("\n Format 3 is Enabled for CELL:%d",cell->cellId);
2898 if(cell->emtcEnable)
2900 if (rgSCHCfgEmtcCellCfg(cell,&(cellCfg->emtcCellCfg)) != ROK)
2902 DU_LOG("\nERROR --> SCH : EMTC Config Failed cell");
2909 ret = rgSCH5gtfCellCfg(cell, cellCfg);
2912 DU_LOG("\nERROR --> SCH : 5GTF Rgr Cell Config failed");
2913 rgSCHCfgFreeCellCb(cell);
2917 errInfo->errCause = RGSCHERR_NONE;
2919 } /* rgSCHCfgRgrCellCfg */
2922 * @brief Handler for the UE configuration request from RRC to MAC.
2926 * Function : rgSCHCfgRgrUeCfg
2929 * - Allocate and create UE control block.
2930 * - Update UE control block with the values recieved in the
2932 * - Invoke RAM, SCH, UHM and DHM with created UE control block, to
2933 * update random access, scheduler, uplink harq and downlink harq
2934 * specific information respectively.
2935 * - If successful, add the control block to hash list of UEs for the cell
2936 * else Rollback and FAIL.
2938 * @param[in] RgSchCellCb *cell
2939 * @param[in] RgrUeCfg *ueCfg
2940 * @param[out] RgSchErrInfo *errInfo
2945 S16 rgSCHCfgRgrUeCfg
2949 RgSchErrInfo *errInfo
2953 RgSchRaCb *raCb=NULLP;
2954 RgSchUeCb *ue = NULLP;
2955 Inst inst = cell->instIdx;
2957 RgSchDlHqEnt *hqEnt = NULLP;
2959 uint8_t ulDlCfgIdx = cell->ulDlCfgIdx;
2960 uint8_t maxSubframes ;
2961 uint8_t maxDlSubframes;
2965 RgSchUePCqiCb *cqiCb = NULLP;
2969 errInfo->errCause = RGSCHERR_CFG_RGR_UE_CFG;
2970 /* RACHO : Check for raCb only if preamble Id not provded */
2971 #ifndef PRE_DEF_UE_CTX
2972 if (ueCfg->dedPreambleId.pres == NOTPRSNT)
2974 if ((raCb = rgSCHDbmGetRaCb(cell, ueCfg->crnti)) == NULLP)
2976 DU_LOG("\nERROR --> SCH : No RaCb exists for"
2977 "CRNTI:%d ",ueCfg->crnti);
2983 /* Allocate the Ue control block */
2984 if (((rgSCHUtlAllocSBuf(inst, (Data **)&ue, sizeof(RgSchUeCb))) != ROK) ||
2985 ((uint8_t *)ue == NULLP))
2987 DU_LOG("\nERROR --> SCH : Memory allocation"
2988 " FAILED for CRNTI:%d", ueCfg->crnti);
2992 /* Inititialize Ue control block */
2993 ue->ueId = ueCfg->crnti;
2995 /*ccpu00117778- Initialize Transmission Indices upon UE CB creation */
2997 ue->lastRprdAckNackTime.sfn = cell->crntTime.sfn;
2998 ue->lastRprdAckNackTime.subframe = cell->crntTime.slot;
3002 /* Allocate the Ue control block */
3003 if (((rgSCHUtlAllocSBuf(inst, (Data **)&(ue->cellInfo[RGSCH_PCELL_INDEX]),
3004 sizeof(RgSchUeCellInfo))) != ROK))
3007 DU_LOG("\nERROR --> SCH : [%lu]SCellIdx :Memomy allocation "
3008 "Failed while Adding SCell Information\n", idx);
3010 DU_LOG("\nERROR --> SCH : [%u]SCellIdx :Memomy allocation "
3011 "Failed while Adding SCell Information\n", idx);
3016 ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)] = RGSCH_PCELL_INDEX;
3017 ue->cellInfo[RGSCH_PCELL_INDEX]->cell = cell;
3018 ue->cellInfo[RGSCH_PCELL_INDEX]->ue = ue;
3020 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
3021 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellIdx = RGSCH_PCELL_INDEX;
3022 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellId = cell->cellId;
3024 if (ROK != rgSCHLaaInitDlRbAllocCb(cell,
3025 &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb))
3031 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ue,cell);
3032 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
3033 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
3034 ue->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
3035 ue->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
3037 /* LTE_ADV_FLAG_REMOVED_START */
3038 /* While doing UE configuration for SFR at SCH, by default
3039 * CC UE power is configured as LOW */
3040 ue->lteAdvUeCb.isCCUePHigh = FALSE;
3041 /* LTE_ADV_FLAG_REMOVED_END */
3043 /* Initialize the lists of the UE */
3044 if((rgSCHDbmInitUe(ue)) != ROK)
3046 DU_LOG("\nERROR --> SCH : DBM initialization "
3047 "failed for CRNTI:%d", ueCfg->crnti);
3053 if(TRUE == raCb->isEmtcRaCb)
3055 ue->isEmtcUe = TRUE;
3056 if (rgSCHUtlUpdUeEmtcInfo(cell, ueCfg, ue) != ROK)
3058 DU_LOG("\nERROR --> SCH : EMTC UE Cfg"
3059 "failed for CRNTI:%d", ueCfg->crnti);
3066 /* Initialize scheduler related information for UE */
3067 if(rgSCHUtlRgrUeCfg(cell, ue, ueCfg, errInfo) != ROK)
3069 DU_LOG("\nERROR --> SCH : Scheduler handling "
3070 "failed in config for CRNTI:%d", ueCfg->crnti);
3074 ret = rgSCHUhmHqEntInit(cell, ue);
3077 DU_LOG("\nERROR --> SCH : UHM HARQ Ent Init "
3078 "Failed for CRNTI:%d", ueCfg->crnti);
3082 /* Initialize RAM related information for UE
3083 * RACHO: if preamble Id is present in ueCfg then raCb will be NULL
3084 * so rgSCHRamRgrUeCfg should take care of creating raCb */
3085 if ((ueCfg->dedPreambleId.pres == NOTPRSNT) && (NULLP != raCb) )
3087 if((rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo)) != ROK)
3089 DU_LOG("\nERROR --> SCH : Random access "
3090 "handling config failed for CRNTI:%d", ueCfg->crnti);
3096 RG_SCH_CMN_GET_UE_HQE(ue, cell) = rgSCHDhmHqEntInit(cell);
3097 hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
3100 DU_LOG("\nERROR --> SCH : Hq Entity Initialization "
3101 "failed in config for CRNTI:%d", ueCfg->crnti);
3105 rgSCHEmtcHqPAlloc(cell, hqEnt);
3108 /* Fix : syed Assign hqEnt to UE only if msg4 is done */
3110 rgSCHCmnDlInitHqEnt(cell, hqEnt);
3112 /* For Hand-In UE Request Aper CQI report
3114 if (ueCfg->ueDlCqiCfg.aprdCqiCfg.pres)
3116 /* Set APCQI for Pcell only*/
3117 ue->dl.reqForCqi = RG_SCH_APCQI_SERVING_CC;
3122 maxDlSubframes = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
3123 maxSubframes = 2 * maxDlSubframes;
3124 ue->dl.numHqDlSfInfo = maxSubframes;
3125 rgSCHUtlAllocSBuf(cell->instIdx,
3126 (Data **)&ue->dl.dlSfHqInfo, sizeof(RgSchDlHqInfo) * (ue->dl.numHqDlSfInfo));
3129 ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_slotS;
3132 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3134 cmLListInit(&ue->dl.dlSfHqInfo[idx].hqPLst);
3135 ue->dl.dlSfHqInfo[idx].dlSfUeLnk.node = NULLP;
3141 for (cellIdx = 0;cellIdx < MAX_5GTF_CELL ; cellIdx++)
3143 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3145 cmLListInit(&ue->dl.dlSfHqInfo[cellIdx][idx].hqPLst);
3146 ue->dl.dlSfHqInfo[cellIdx][idx].dlSfUeLnk.node = NULLP;
3152 rgSCHLaaInitDlHqInfo(cell, ue);
3156 /* Initialize lcgIds to Invalid */
3157 for (lcgCnt = 0; lcgCnt < RGSCH_MAX_LCG_PER_UE; lcgCnt++)
3159 ue->ul.lcgArr[lcgCnt].lcgId = RGSCH_INVALID_LCG_ID;
3163 rgSCHCfgRgrUePhrMsg3(cell,raCb,ue,errInfo);
3164 /* Moved this code out of rgSCHCfgRgrUePhrMsg3()
3165 * as it was not the appropriate place to
3167 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3169 DU_LOG("\nERROR --> SCH : RNTI:%d RaCb deleted as Msg4 transmission is done",
3171 rgSCHRamDelRaCb(cell, raCb, FALSE);
3174 /* Initialize uplink HARQ related information for UE */
3175 rgSCHUhmRgrUeCfg(cell, ue, ueCfg);
3176 cmInitTimers(&ue->bsrTmr, 1);
3178 /* Added periodic BSR timer */
3179 cmInitTimers(&ue->bsrTmr, 1);
3181 /* Fix - Added proper configuration from U-ARM */
3182 if(ueCfg->ueBsrTmrCfg.isPrdBsrTmrPres == TRUE)
3184 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = TRUE;
3185 ue->ul.bsrTmrCfg.prdBsrTmr = ueCfg->ueBsrTmrCfg.prdBsrTmr;
3186 ue->ul.bsrTmrCfg.retxBsrTmr = ueCfg->ueBsrTmrCfg.retxBsrTmr;
3190 /* Initialize downlink HARQ related information for UE */
3191 rgSCHDhmRgrUeCfg(cell, ue, ueCfg, errInfo);
3193 /* Initialize MeasureGap and Acknack Rep Information for UE */
3194 if((rgSCHMeasGapANRepUeCfg(cell, ue, ueCfg)) != ROK)
3196 DU_LOG("\nERROR --> SCH : Measurement Gap and"
3197 " AckNack Rep failed in Config for CRNTI:%d", ueCfg->crnti);
3203 if((rgSCHUtlAllocUeANFdbkInfo(ue,RGSCH_PCELL_INDEX)) != ROK)
3205 DU_LOG("\nERROR --> SCH : Memomy allocation "
3206 "Failed while UE related Ack Nack Information for CRNTI:%d",
3210 ue->dl.ackNackMode = ueCfg->ackNackModeEnum;
3211 #endif /* LTE_TDD */
3214 rgSCHDbmInsUeCb(cell, ue);
3217 /* Int ialize APeriodic CQI/PMI/RI Information for UE */
3219 DU_LOG("\nDEBUG --> SCH : rgSCHCfgRgrUeCfg CellID=%d UeId =%d AcqiCfg Pres =%d", cell->cellId, ue->ueId,\
3220 ueCfg->ueDlCqiCfg.aprdCqiCfg.pres);
3222 /*Store Trigger Set Bit String to UE */
3224 ret = rgSCHCfgACqiUeCfg(cell,ue, (RG_SCH_CMN_GET_ACQICB(ue,cell)),ue->mimoInfo.txMode,
3225 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ue->ueCatEnum);
3227 ue->cqiRiWritIdx = 0;
3228 ue->cqiRiReadIdx = 0;
3229 /* Initialize Periodic CQI/PMI, RI Information for UE */
3230 ret = rgSCHCfgPCqiUeCfg(cell, ue, &ueCfg->ueDlCqiCfg.prdCqiCfg,
3233 /* Initialize UL SRS Information for UE */
3234 ret = rgSCHCfgSrsUeCfg(cell, ue, &ueCfg->srsCfg);
3236 /* Initialize SR Information for UE */
3237 ret = rgSCHCfgSrUeCfg(cell, ue, &ueCfg->srCfg);
3241 if (rgSCHHdFddUeCfg(cell, ue, ueCfg->isHdFddEnbld) != ROK)
3243 DU_LOG("\nERROR --> SCH : Could not do HD-FDD config for CRNTI:%d",ueCfg->crnti);
3247 #endif /* LTEMAC_HDFDD */
3248 /* ccpu00117452 - MOD - Changed macro name from
3249 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
3251 ue->cqiReptCfgInfo.numColltdCqiRept =
3252 ueCfg->ueCqiReptCfg.numColltdCqiRept;
3253 #endif /* End of RGR_CQI_REPT */
3255 RG_SCH_CMN_GET_PA(ue,cell).pres = FALSE;
3256 if (RG_SCH_UE_CFG_ISPAPRSNT(ueCfg->uePdschDedCfg.uepACfg))
3258 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
3259 RG_SCH_CMN_GET_PA(ue,cell).val = ueCfg->uePdschDedCfg.uepACfg.pA;
3262 ue->isDrxEnabled = ueCfg->ueDrxCfg.isDrxEnabled;
3264 if ( ue->isDrxEnabled )
3266 if((rgSCHDrxUeCfg(cell,ue,ueCfg)) != ROK )
3268 DU_LOG("\nERROR --> SCH : DRX configuration failed");
3273 /* LTE_ADV_FLAG_REMOVED_START */
3274 if ((cell->lteAdvCb.sfrCfg.status == RGR_ENABLE) || \
3275 (cell->lteAdvCb.absCfg.status == RGR_ENABLE))
3277 ue->lteAdvUeCb.rgrLteAdvUeCfg = ueCfg->ueLteAdvCfg;
3279 /* LTE_ADV_FLAG_REMOVED_END */
3282 ue->tenbStats = TSL2AllocUeStatsBlk(ue->ueId);
3283 ue->tenbStats->stats.rnti = ue->ueId;
3286 /*Update A Value for PCell TBs*/
3287 ue->f1bCsAVal = rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode);
3288 DU_LOG("\nERROR --> SCH : UeCfg A value is %d\n",ue->f1bCsAVal);
3290 errInfo->errCause = RGSCHERR_NONE;
3292 ue->accessStratumRls = ueCfg->accessStratumRls;
3293 if (ue->numSCells > 0)
3296 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3300 /* 1 bit CSI Access Stratum Release Change */
3301 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3309 rgSCHCfgFreeUeCb(cell, ue);
3312 } /* rgSCHCfgRgrUeCfg */
3315 * @brief Handler for PHR for MSG3.
3319 * Function : rgSCHCfgRgrUePhrMsg3
3322 * Handle PHR related config for MSG3
3324 * @param[in] RgSchCellCb *cell
3325 * @param[in] RgrUeCb *ueCb
3326 * @param[in] RgSchRaCb *raCb
3327 * @param[out] RgSchErrInfo *errInfo
3329 static Void rgSCHCfgRgrUePhrMsg3
3334 RgSchErrInfo *errInfo
3338 /* Record msg3 allocation in the UE */
3339 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3341 /* If raCb received PHR, update scheduler */
3342 if(raCb->phr.pres == TRUE)
3344 ue->macCeRptTime = raCb->msg3AllocTime;
3345 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3355 * Function : rgSCHDynCfiReCfg
3357 * @param[in] RgSchCellCb *cell
3363 Void rgSCHDynCfiReCfg
3370 RgSchCmnDlCell *cellSchDl = RG_SCH_CMN_GET_DL_CELL(cell);
3374 cell->dynCfiCb.ttiCnt = 0;
3375 cellSchDl->newCfi = cellSchDl->currCfi;
3379 /* Resetting the parameters*/
3380 cell->dynCfiCb.cceFailCnt = 0;
3381 cell->dynCfiCb.cceFailSum = 0;
3382 cell->dynCfiCb.prevCceFailIdx = 0;
3384 for(idx = 0; idx < cell->dynCfiCb.numFailSamples; idx++)
3386 cell->dynCfiCb.cceFailSamples[idx] = 0;
3389 cell->dynCfiCb.cceUsed = 0;
3390 cell->dynCfiCb.lowCceCnt = 0;
3391 cell->dynCfiCb.ttiCnt = 0;
3395 * @brief Handler for the cell reconfiguration request from RRM to MAC.
3399 * Function : rgSCHCfgRgrCellRecfg
3402 * - Invoke SCH with cell control block to update
3403 * scheduler specific information.
3404 * - Update cell control block with the values recieved in the
3406 * - If successful, return ROK else RFAILED.
3408 * @param[in] RgSchCellCb *cell
3409 * @param[in] RgrCellRecfg *cellRecfg
3410 * @param[out] RgSchErrInfo *errInfo
3415 S16 rgSCHCfgRgrCellRecfg
3418 RgrCellRecfg *cellRecfg,
3419 RgSchErrInfo *errInfo
3423 Inst inst = cell->instIdx;
3424 /* LTE_ADV_FLAG_REMOVED_START */
3426 uint16_t len; /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3427 /* LTE_ADV_FLAG_REMOVED_END */
3429 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_RECFG;
3431 /* Invoke scheduler to update scheduler specific information */
3432 ret = rgSCHUtlRgrCellRecfg(cell, cellRecfg, errInfo);
3435 DU_LOG("\nERROR --> SCH : RGR Cell re-configuration failed "
3440 /* Invoke DHM to update DHM specific information */
3441 rgSCHDhmRgrCellRecfg(cell, cellRecfg, errInfo);
3443 /* PUCCH Reconfiguration */
3444 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
3446 cell->pucchCfg = cellRecfg->pucchRecfg;
3449 /* SRS Reconfiguration */
3450 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
3452 cell->srsCfg.isSrsCfgPres = cellRecfg->srsRecfg.isSrsCfgSetup;
3453 if(cellRecfg->srsRecfg.isSrsCfgSetup)
3455 cell->srsCfg.srsCfgPrdEnum = cellRecfg->srsRecfg.srsCfgPrdEnum;
3456 cell->srsCfg.srsBwEnum = cellRecfg->srsRecfg.srsBwEnum;
3457 cell->srsCfg.srsTxOffst =
3458 rgSrsTxOffstTbl[cellRecfg->srsRecfg.srsSubFrameCfg];
3459 /*ccpu00116923 - ADD - Srs Present support */
3461 cell->srsCfg.srsSubFrameCfg = cellRecfg->srsRecfg.srsSubFrameCfg;
3466 /* RACH Reconfiguration */
3467 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
3469 cell->rachCfg = cellRecfg->rachRecfg;
3472 /* ccpu00132256:MOD: Moved this assignment from Validation to here.*/
3473 if (cellRecfg->recfgTypes & RGR_CELL_TMRS_RECFG)
3475 cell->t300TmrVal = cellRecfg->t300TmrVal;
3478 /* SI Reconfiguration */
3479 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
3481 /*Set the specified SI configuration. */
3482 cell->siCb.newSiCfg = cellRecfg->siReCfg;
3483 /* Set the Bit mask for SI re-configuration */
3484 cell->siCb.siBitMask |= RGSCH_SI_SICFG_UPD;
3486 if(cell->emtcEnable)
3488 rgSchEmtcUpdSiCfg(cell, cellRecfg);
3492 #endif /*RGR_SI_SCH */
3494 /* Overload RACH Control changes */
3495 if (cellRecfg->recfgTypes & RGR_CELL_CNTRL_CMD_RECFG)
3497 if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_RACH_OVRLD)
3499 cell->overLoadBackOffEnab = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffEnb;
3500 cell->overLoadBackOffval = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffVal;
3502 else if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_CPU_OVRLD)
3504 if( ROK != rgSCHUtlResetCpuOvrLdState(cell, cellRecfg->cntrlCmdCfg.cmdDesc.\
3505 cpuOvrLd.instruction))
3507 DU_LOG("\nERROR --> SCH : Invalid CPU OvrLd Ins %d for cell",
3508 cellRecfg->cntrlCmdCfg.cmdDesc.cpuOvrLd.instruction);
3514 /* LTE_ADV_FLAG_REMOVED_START */
3515 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
3517 if(cellRecfg->rgrLteAdvCfg.pres & RGR_ABS)
3519 cell->lteAdvCb.absCfg =
3520 cellRecfg->rgrLteAdvCfg.absCfg;
3522 if(cellRecfg->rgrLteAdvCfg.pres & RGR_SFR)
3524 memcpy(&cell->lteAdvCb.sfrCfg, &cellRecfg->rgrLteAdvCfg.sfrCfg,
3525 sizeof(RgrSfrConfig));
3526 /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3527 if (cellRecfg->rgrLteAdvCfg.sfrCfg.status == RGR_ENABLE)
3529 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3531 /*initialise the pools of CC and CE*/
3532 if(rgSchSFRTotalPoolInit(cell, cell->subFrms[i]))
3540 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3542 /*initialise the pools of CC and CE*/
3543 rgSchSFRTotalPoolFree(&cell->subFrms[i]->sfrTotalPoolInfo, cell);
3546 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3548 /* releasing rntp info val from each subframe */
3549 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3551 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3554 /* releasing RNTP Aggregation Info from CellCb*/
3555 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3557 cell->lteAdvCb.dsfrCfg.status = RGR_DISABLE;
3561 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** Start */
3562 if(cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR)
3564 cell->lteAdvCb.dsfrCfg =
3565 cellRecfg->rgrLteAdvCfg.dsfrCfg;
3566 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3568 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3570 /*initialise the pools of CC and CE*/
3571 if(rgSchDSFRRntpInfoInit(&cell->subFrms[i]->rntpInfo,cell,cell->bwCfg.dlTotalBw))
3576 /*Calculating the length of RNTP array based on Dl Bandwidth */
3577 len = (uint16_t)((cell->bwCfg.dlTotalBw % 8 == 0) ? (cell->bwCfg.dlTotalBw/8) : (cell->bwCfg.dlTotalBw/8 + 1)); /* KW fix for LTE_ADV */
3578 if(cell->rntpAggrInfo.pres == NOTPRSNT)
3580 if((rgSCHUtlAllocSBuf(inst, (Data**)&(cell->rntpAggrInfo.val),
3581 (len * sizeof(uint8_t)))) != ROK)
3583 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for RNTP Alloc");
3586 cell->rntpAggrInfo.pres = PRSNT_NODEF;
3587 cell->rntpAggrInfo.len = len;
3590 /* in case if DSFR is disabled, need to free RNTP pattern val*/
3593 /* releasing rntp info val from each subframe */
3594 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3596 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3599 /* releasing RNTP Aggregation Info from CellCb*/
3600 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3603 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** End */
3605 /* LTE_ADV_FLAG_REMOVED_END */
3607 /* Dynamic CFI cell Reconfiguration */
3608 if(cellRecfg->recfgTypes & RGR_CELL_DYN_CFI_RECFG)
3610 if(cell->dynCfiCb.isDynCfiEnb != cellRecfg->isDynCfiEnb)
3612 if(cell->dynCfiCb.switchOvrInProgress)
3614 cell->dynCfiCb.dynCfiRecfgPend = TRUE;
3618 cell->dynCfiCb.isDynCfiEnb = cellRecfg->isDynCfiEnb;
3619 rgSCHDynCfiReCfg(cell, cellRecfg->isDynCfiEnb);
3624 /* To hanlde the case where reconfiguration comes for disabling
3625 * and then enabling before switchover period expires */
3626 cell->dynCfiCb.dynCfiRecfgPend = FALSE;
3629 /* Dynamic config of AUTO chnage flag */
3630 if(cellRecfg->recfgTypes & RGR_CELL_AUTO_CFG_MODE_RECFG)
3632 if(cell->isAutoCfgModeEnb != cellRecfg->isAutoCfgModeEnb)
3634 cell->isAutoCfgModeEnb = cellRecfg->isAutoCfgModeEnb;
3638 if(cell->isAutoCfgModeEnb)
3640 DU_LOG("\nINFO --> SCH : Auto Mode Cfg enabled durint cell recfg\n");
3644 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
3646 cell->minDlResNonCsg = cellRecfg->csgParamCfg.minDlResNonCsg;
3647 cell->minUlResNonCsg = cellRecfg->csgParamCfg.minUlResNonCsg;
3650 errInfo->errCause = RGSCHERR_NONE;
3652 } /* rgSCHCfgRgrCellRecfg */
3655 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3659 * Function : rgSCHCfgRgrUeRecfgRntiChg
3662 * - If rnti changes,
3663 * - Invoke RAM for UE reconfiguration.
3664 * - Delete old UE from the list.
3665 * - Update the new rnti and re-insert the UE in the list.
3666 * - If successful, return ROK else RFAILED.
3668 * @param[in] RgSchCellCb *cell
3669 * @param[in] RgSchUeCb *ue
3670 * @param[in] RgrUeRecfg *ueRecfg
3671 * @param[out] RgSchErrInfo *errInfo
3676 static S16 rgSCHCfgRgrUeRecfgRntiChg
3680 RgrUeRecfg *ueRecfg,
3681 RgSchErrInfo *errInfo
3690 RgSchDlHqEnt **hqEnt = &(RG_SCH_CMN_GET_UE_HQE(ue, cell));
3693 /* Handle CRNTI change in reconfiguration */
3694 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
3696 RgSchRntiLnk *oldRntiLnk=NULLP;
3697 CmLteRnti oldRnti = 0;
3698 if ((raCb = rgSCHDbmGetRaCb(cell, ueRecfg->newCrnti)) == NULLP)
3700 DU_LOG("\nERROR --> SCH : UEID:No RaCb exists while"
3701 "Reconfig for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3705 /* rntiLnk does not exist for a HandIn UE. Hence this check. */
3708 oldRntiLnk = ue->rntiLnk;
3712 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3716 DU_LOG("\nINFO --> SCH : UE ID CHNG OLD %d new %d",ueRecfg->oldCrnti, ueRecfg->newCrnti);
3718 /* Fix : syed Deleting Old DL HqEnt. It would be assigned after
3719 * reest RACH(msg4) is completed. */
3720 rgSCHDhmDelHqEnt(cell, hqEnt);
3722 /* Initialize RAM related information for UE */
3723 ret = rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo);
3726 DU_LOG("\nERROR --> SCH : RAM Handling for UE Reconfig failed"
3727 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3730 /* Delete Ue from the ue list */
3731 rgSCHDbmDelUeCb(cell, ue);
3736 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3738 if(ue->cellInfo[sCellIdx] != NULLP)
3740 rgSCHDbmDelUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3746 /* Inititialize Ue control block */
3747 ue->ueId = ueRecfg->newCrnti;
3748 DU_LOG("\nDEBUG --> SCH : Changing RNTI from %d to %d",
3754 rgSCHUtlUpdEmtcY(ue);
3758 /* Fix ccpu00122631: PCell_Reest: Updating new Rnti in all the cells
3761 for(idx = 0; idx < CM_LTE_MAX_CELLS; idx++)
3763 if(ue->cellInfo[idx])
3765 ue->cellInfo[idx]->dlAllocCb.rnti = ueRecfg->newCrnti;
3769 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3771 /* If raCb received PHR, update scheduler */
3772 if(raCb->phr.pres == TRUE)
3774 ue->macCeRptTime = raCb->msg3AllocTime;
3775 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3778 #ifdef RGR_V2 /* Acc Fix */
3779 if(TRUE == ue->isDrxEnabled)
3781 ueRecfg->ueDrxRecfg.isDrxEnabled = TRUE;
3782 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
3786 DU_LOG("\nERROR --> SCH : UE DRX re-est failed"
3787 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3791 #endif /* Acc Fix */
3793 /* Re-insert updated Ue */
3794 rgSCHDbmInsUeCb(cell, ue);
3799 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3801 if(ue->cellInfo[sCellIdx] != NULLP)
3803 rgSCHDbmInsUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3811 ue->tenbStats->stats.rnti = ue->ueId;
3814 /* Fix : syed If MSG4 is done, since corresponding ueCb
3815 * is ready, the raCb should be cleared immediately.
3816 * Otherwise it would remain in the cell until timed out
3817 * and till then the hq Feedbacks will be assumed to be
3819 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3821 DU_LOG("\nDEBUG --> SCH : RNTI:%d with RaCb deleted as Msg4 transmission is done",
3823 rgSCHRamDelRaCb(cell, raCb, FALSE);
3825 /* Fix : syed moving the UL CQI initialization to UERESET */
3827 /* Release Older rnti */
3830 /* This is the rare case in which back to back reestablishment is
3831 * happening and previous re-est was not done completely (MSG4 was
3832 * not done) for an UE, and again re-est is triggered for the same
3833 * UE. We are deleting the old RA CB for the previous re-est which
3834 * still exist due to MSG4 not transmitted successfully */
3835 if ((oldRaCb = rgSCHDbmGetRaCb(cell, oldRntiLnk->rnti)) != NULLP)
3837 rgSCHRamDelRaCb(cell, oldRaCb, FALSE);
3840 rgSCHUtlRlsRnti(cell, oldRntiLnk, TRUE, ueRecfg->newCrnti);
3844 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3845 /* Just indicate to MAC, no need to release at SCH */
3846 DU_LOG("\nDEBUG --> SCH : HO OldRnti:%d RLS and NewRnti:%d CHNG IND TO MAC",
3847 oldRnti, ueRecfg->newCrnti);
3848 rgSCHUtlIndRntiRls2Mac(cell, oldRnti, TRUE, ueRecfg->newCrnti);
3854 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3858 * Function : rgSCHCfgRgrUeRecfg
3861 * - If rnti changes,
3862 * - Invoke RAM for UE reconfiguration.
3863 * - Delete old UE from the list.
3864 * - Update the new rnti and re-insert the UE in the list.
3865 * - Update the UE control block with the reconfigured values.
3866 * - Invoke SCH, UHM and DHM with updated UE control block to
3867 * update scheduler, uplink HARQ and downlink HARQ specific
3869 * - If successful, return ROK else RFAILED.
3871 * @param[in] RgSchCellCb *cell
3872 * @param[in] RgSchUeCb *ue
3873 * @param[in] RgrUeRecfg *ueRecfg
3874 * @param[out] RgSchErrInfo *errInfo
3879 S16 rgSCHCfgRgrUeRecfg
3883 RgrUeRecfg *ueRecfg,
3884 RgSchErrInfo *errInfo
3889 Bool dciChange = TRUE;
3892 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RECFG;
3895 if (ue->numSCells > 0)
3899 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3900 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3902 ue->accessStratumRls = ueRecfg->accessStratumRls;
3906 /* if SCELL_RECFG is present , no other
3907 * type will be present. Process Scell addition
3910 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_ADD_RECFG)
3912 ret = rgSCHSCellCfgUeCfg(cell, ue, ueRecfg, errInfo);
3915 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
3916 /*FH: SCell config failed for a scell index hence revert all successful
3917 * Scell config and send negative confirmation to APP*/
3918 rgSCHSCellCfgUeCfgRollBack(cell, ue, ueRecfg);
3922 if (dciChange == TRUE)
3924 if (ue->numSCells > 0)
3927 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3931 /* 1 bit CSI Access Stratum Release Change */
3932 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3935 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_PUCCH_RECFG)
3937 ret = rgSCHSCellCfgUePucchReCfg(cell, ue, ueRecfg, errInfo);
3940 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_PUCCH_RECFG;
3945 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3946 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3948 ue->accessStratumRls = ueRecfg->accessStratumRls;
3949 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3951 #endif /* LTE_ADV */
3953 if (ueRecfg->ueRecfgTypes)
3955 /* Update scheduler related information for UE */
3956 ret = rgSCHUtlRgrUeRecfg(cell, ue, ueRecfg, errInfo);
3959 DU_LOG("\nERROR --> SCH : Scheduler handling while reconfig failed"
3960 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3964 /* Update uplink HARQ related information for UE */
3965 rgSCHUhmRgrUeRecfg(cell, ue, ueRecfg);
3967 /* Update TA related information for UE */
3968 if (ueRecfg->ueRecfgTypes & RGR_UE_TATMR_RECFG)
3970 rgSCHCfgUeTaRecfg(cell, ue, ueRecfg, errInfo);
3973 /*Update Measurement Gap and AckNack Details */
3974 /* After merging from 2.2 */
3975 if (ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG)
3977 ret = rgSCHMeasGapANRepUeRecfg(cell, ue, ueRecfg);
3980 DU_LOG("\nERROR --> SCH : Measurement Gap and"
3981 "AckNack Rep Recfg failed for OLD CRNTI:%d NEW CRNTI:%d",
3982 ueRecfg->oldCrnti,ueRecfg->newCrnti);
3986 if (ueRecfg->ueRecfgTypes & RGR_UE_BSRTMR_RECFG)
3988 cmInitTimers(&ue->bsrTmr, 1);
3989 ue->ul.bsrTmrCfg = ueRecfg->ueBsrTmrRecfg;
3990 if ((ue->ul.bsrTmrCfg.isPrdBsrTmrPres) &&
3991 (ue->ul.bsrTmrCfg.prdBsrTmr == 0xFFFF))
3993 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = FALSE;
3998 if (RFAILED == rgSCHCfgRgrUeRecfgRntiChg (cell, ue, ueRecfg, errInfo))
4000 DU_LOG("\nERROR --> SCH : RNTI change "
4001 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4002 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4007 /* Re-Initialize Aperiodic CQI Information for UE*/
4008 if ( ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
4010 ret = rgSCHCfgAcqiUeReCfg(cell, ue, &ueRecfg->aprdDlCqiRecfg,
4013 /* Re-Initialize Periodic CQI/PMI, RI Information for UE */
4014 if ( ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG)
4016 ret = rgSCHCfgPCqiUeReCfg(cell, ue, &ueRecfg->cqiCfg,
4019 /* Re-Initialize UL SRS Information for UE */
4020 if ( ueRecfg->ueRecfgTypes & RGR_UE_SRS_RECFG)
4022 ret = rgSCHCfgSrsUeReCfg(cell, ue, &ueRecfg->srsCfg);
4024 /* Re-Initialize SR Information for UE */
4025 if ( ueRecfg->ueRecfgTypes & RGR_UE_SR_RECFG)
4027 ret = rgSCHCfgSrUeReCfg(cell, ue, &ueRecfg->srCfg);
4032 if(ueRecfg->isHdFddEnbld)
4034 ret = rgSCHHdFddUeCfg(cell, ue, ueRecfg->isHdFddEnbld);
4037 errInfo->errCause = RGSCHERR_HDFDD_SPSCFGRD;
4041 #endif /* LTEMAC_HDFDD */
4043 if ( ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
4045 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
4049 DU_LOG("\nERROR --> SCH : UE DRX reconfig failed"
4050 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4051 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4056 /* ccpu00117452 - MOD - Changed macro name from
4057 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
4059 /* CQI Reporting (N) Re-configuration */
4060 if(ueRecfg->ueRecfgTypes & RGR_UE_CQIREPT_RECFG)
4062 ret = rgSCHCfgUeCqiReptReCfg(cell, ue, ueRecfg);
4065 errInfo->errCause = RGSCHERR_CQIREPT;
4069 #endif /* End of RGR_CQI_REPT */
4071 /* pA Re-configuration */
4072 if((ueRecfg->ueRecfgTypes & RGR_UE_PA_RECFG) &&
4073 RG_SCH_UE_CFG_ISPAPRSNT(ueRecfg->uePdschDedCfg.uepACfg))
4075 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
4076 RG_SCH_CMN_GET_PA(ue,cell).val = ueRecfg->uePdschDedCfg.uepACfg.pA;
4080 /* LTE_ADV_FLAG_REMOVED_START */
4081 if(ueRecfg->ueRecfgTypes & RGR_UE_LTEA_RECFG)
4083 if(ueRecfg->ueLteAdvCfg.pres & RGR_ABS)
4085 ue->lteAdvUeCb.rgrLteAdvUeCfg.isAbsUe = ueRecfg->ueLteAdvCfg.isAbsUe;
4088 if(ueRecfg->ueLteAdvCfg.pres & RGR_SFR)
4090 ue->lteAdvUeCb.rgrLteAdvUeCfg.isUeCellEdge = ueRecfg->ueLteAdvCfg.isUeCellEdge;
4093 /* LTE_ADV_FLAG_REMOVED_END */
4095 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_DPLXMODE_RECFG)
4097 rgSCHEmtcHdFddUeCfg (cell, ue,
4098 ueRecfg->emtcUeRecfg.isHdFddEnbld);
4100 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_PO_TRIGGER)
4102 rgSCHEmtcPOTrigger(cell, ue);
4105 errInfo->errCause = RGSCHERR_NONE;
4108 } /* rgSCHCfgRgrUeRecfg */
4112 * @brief Handler for the logical channel reconfiguration request from
4117 * Function : rgSCHCfgRgrLchRecfg
4120 * - Invoke scheduler to update scheduler specific information.
4121 * - Update the dedicated logical channel Cb with the reconfigured
4123 * - If successful, return ROK else RFAILED.
4125 * @param[in] RgUlCellCb *cell
4126 * @param[in] RgUlUeCb *ue
4127 * @param[in] RgSchUlLcCb *ulLc
4128 * @param[in] RgSchDlLcCb *dlLc
4129 * @param[in] RgrLchRecfg *lcRecfg
4130 * @param[out] RgSchErrInfo *errInfo
4135 S16 rgSCHCfgRgrLchRecfg
4140 RgrLchRecfg *lcRecfg,
4141 RgSchErrInfo *errInfo
4146 errInfo->errCause = RGSCHERR_CFG_RGR_LC_RECFG;
4147 /* Invoke Scheduler to update the new configuration */
4148 ret = rgSCHUtlRgrLcRecfg(cell, ue, dlLc, lcRecfg, errInfo);
4151 DU_LOG("\nERROR --> SCH : Scheduler handling for LC Recfg"
4152 " failed for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
4156 errInfo->errCause = RGSCHERR_NONE;
4158 } /* rgSCHCfgRgrLchRecfg */
4160 * @brief Handler for the logical channel reconfiguration request from
4165 * Function : rgSCHCfgRgrLcgRecfg
4168 * - Invoke scheduler to update scheduler specific information.
4169 * - Update the dedicated logical channel Cb with the re-configured
4171 * - If successful, return ROK else RFAILED.
4173 * @param[in] RgUlCellCb *cell
4174 * @param[in] RgUlUeCb *ue
4175 * @param[in] RgrLcgRecfg *lcgRecfg
4176 * @param[out] RgSchErrInfo *errInfo
4181 S16 rgSCHCfgRgrLcgRecfg
4185 RgrLcgRecfg *lcgRecfg,
4186 RgSchErrInfo *errInfo
4191 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_RECFG;
4193 /*Added for handling LCG ReConfig if the LCG was deleted */
4194 ue->ul.lcgArr[lcgRecfg->ulRecfg.lcgId].lcgId = lcgRecfg->ulRecfg.lcgId;
4196 /* Invoke Scheduler to update the new configuration */
4197 ret = rgSCHUtlRgrLcgRecfg(cell, ue, lcgRecfg, errInfo);
4200 DU_LOG("\nERROR --> SCH : Scheduler handling for LCG Recfg"
4201 " failed for CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
4205 errInfo->errCause = RGSCHERR_NONE;
4207 } /* rgSCHCfgRgrLcgRecfg */
4210 * @brief Handler for the UE Reset request from RRM to MAC.
4214 * Function : rgSCHCfgRgrUeReset
4217 * - Call Measument Gap Module and Ack/Nack Module for resetting UE.
4218 * - Call Common Schduler UE rest API which inturn will call scheduler
4219 * specific UE Reset APis to reset UE.
4221 * @param[in] RgSchCellCb *cell
4222 * @param[in] RgSchUeCb *ue
4223 * @param[in] RgrRst *reset
4224 * @param[out] RgSchErrInfo *errInfo
4229 S16 rgSCHCfgRgrUeReset
4234 RgSchErrInfo *errInfo
4240 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RESET;
4242 /* Setting BO of Each Logical Channel of the UE to 0 */
4243 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; idx++)
4245 if(ue->dl.lcCb[idx] != NULLP)
4246 ue->dl.lcCb[idx]->bo = 0;
4249 /* Reset the totalBo */
4251 /* Call DRX module to stop all DRX timers */
4253 if(ue->drxCb != NULLP)
4255 (Void)rgSCHDrxUeDel(cell,ue);
4258 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4259 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4261 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4262 ue->txModeTransCmplt =TRUE;
4265 /* ccpu00133470- Meas Gap should be released during RRC re-establishment */
4266 rgSCHMeasGapANRepUeDel(cell, ue, FALSE);
4268 /* Call Common scheduler which in turn will call specific scheduler for UE
4270 rgSCHUtlUeReset(cell, ue);
4272 /*PCell which is at idx 0 is always active. Adding a line after the loop
4273 *setting RGSCH_PCELL_INDEX to SCELL ACTIVE*/
4274 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
4277 /* In case of back to back reestablishments, when this UE's
4278 * previous ReEst is still in progress and has got RESET
4279 * as part of new ReEst */
4280 if((raCb = rgSCHDbmGetRaCb(cell, ue->ueId)) != NULLP)
4282 rgSCHRamDelRaCb(cell, raCb, FALSE);
4284 /* Fix : syed set UE inactive in DL until UE is reinitialization completed */
4285 ue->dl.dlInactvMask |= RG_HQENT_INACTIVE;
4286 ue->ul.ulInactvMask |= RG_HQENT_INACTIVE;
4287 /* [ccpu00127141] Resetting TA related parameters */
4288 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
4289 ue->dl.taCb.state = RGSCH_TA_IDLE;
4291 /*[ccpu00121813]-ADD-Initializing outstanding TA value */
4292 ue->dl.taCb.outStndngTa = FALSE;
4293 ue->dl.taCb.outStndngTaval = RGSCH_NO_TA_RQD;
4295 if (ue->dl.taCb.cfgTaTmr)
4297 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
4301 /* Resetting the Tx mode change factor on UE reset */
4302 ue->mimoInfo.txModUpChgFactor = 0;
4303 ue->mimoInfo.txModDownChgFactor = 0;
4306 errInfo->errCause = RGSCHERR_NONE;
4308 } /* rgSCHCfgRgrUeReset */
4311 * @brief Handler for the cell delete request from RRM to MAC.
4315 * Function : rgSCHCfgRgrCellDel
4318 * - Fetch the cell control block.
4319 * - Remove the cell control block from the hash list of cells.
4320 * - Free the cell control block.
4321 * - If successful, return ROK else return RFAILED.
4323 * @param[in] RgSchCellCb *cell
4324 * @param[in] RgrDel *cellDelInfo
4325 * @param[out] RgSchErrInfo *errInfo
4330 S16 rgSCHCfgRgrCellDel
4333 RgrDel *cellDelInfo,
4334 RgSchErrInfo *errInfo
4338 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_DEL;
4340 if (cell->cellId != cellDelInfo->u.cellDel.cellId)
4342 DU_LOG("\nERROR --> SCH : Cell does not exist");
4346 /* Free the active cell */
4347 rgSCHCfgFreeCellCb(cell);
4349 errInfo->errCause = RGSCHERR_NONE;
4351 } /* rgSCHCfgRgrCellDel */
4355 * @brief Handler for the UE delete request from RRM to MAC.
4359 * Function : rgSCHCfgRgrUeDel
4362 * - Fetch the UE control block.
4363 * - Remove the UE control block from the hash list of UEs for the cell.
4364 * - Free the UE control block.
4365 * - If successful, return ROK else return RFAILED.
4367 * @param[in] RgSchCellCb *cell
4368 * @param[in] RgrDel *ueDelInfo
4369 * @param[out] RgSchErrInfo *errInfo
4374 S16 rgSCHCfgRgrUeDel
4378 RgSchErrInfo *errInfo
4384 Inst inst = cell->instIdx;
4385 RgSchCellCb *secCellCb = NULLP;
4388 errInfo->errCause = RGSCHERR_CFG_RGR_UE_DEL;
4390 if (cell->cellId != ueDelInfo->u.ueDel.cellId)
4392 DU_LOG("\nERROR --> SCH : Cell does not exist CRNTI:%d",
4393 ueDelInfo->u.ueDel.crnti);
4396 if ((ue = rgSCHDbmGetUeCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4398 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4400 DU_LOG("\nERROR --> SCH : RaCb does not exist for CRNTI:%d",ueDelInfo->u.ueDel.crnti);
4405 /* This happens in case of Msg4 rejection */
4413 if(ueDelInfo->u.ueScellRel.ueDelTypes & RGR_UE_SCELL_DEL_RECFG)
4415 for(uint8_t idx = 0; idx < ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.numSCells; idx++)
4417 if(NULLP != (secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, \
4418 ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellId)))
4420 rgSCHUtlSndUeSCellDel2Mac(secCellCb, ue->ueId);
4421 rgSCHSCellDelUeSCell(cell,ue,ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellIdx);
4423 if ( ue->numSCells == 0)
4425 ue->allocCmnUlPdcch = TRUE;
4429 if (ue->numSCells == 0)
4431 /* As there is no SCell left so DCI 0 size at UE specific search space
4432 * will be recalculated as the CSI is reduced to 1 bit */
4433 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4439 /* Delete Ue from the UE list of CELL*/
4440 rgSCHDbmDelUeCb(cell, ue);
4443 rgSCHDbmDelL2MUe(cell, ue);
4446 /* Call MeasGap and AckNakRep processing module */
4447 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
4449 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4450 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4452 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4455 /* Call DRX module to remove UEs from various
4459 if(ue->drxCb != NULLP)
4461 (Void)rgSCHDrxUeDel(cell,ue);
4464 /*Fix: If RA CB exists, delete it*/
4465 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) != NULLP)
4467 /* Fix : syed RNTI was getting released twice, once by racb del
4468 * and subsequently by ueDel. Let it get released by ueDel alone */
4469 rgSCHRamDelRaCb(cell, raCb, FALSE);
4474 rgSCHEmtcUeDel(cell, ue);
4478 rgSCHCfgFreeUeCb(cell, ue);
4480 errInfo->errCause = RGSCHERR_NONE;
4485 } /* rgSCHCfgRgrUeDel */
4489 * @brief Handler for the logical channel delete request from
4494 * Function : rgSCHCfgRgrLcDel
4497 * - Fetch the logical channel control block.
4498 * - Free the logical channel control block.
4499 * - If successful, return ROK else return RFAILED.
4501 * @param[in] RgrDel *lcDelInfo
4502 * @param[out] RgSchErrInfo *errInfo
4507 S16 rgSCHCfgRgrLcDel
4511 RgSchErrInfo *errInfo
4522 errInfo->errCause = RGSCHERR_CFG_RGR_LC_DEL;
4524 /* Fetch the Active cell */
4525 if (cell->cellId != lcDelInfo->u.lchDel.cellId)
4527 DU_LOG("\nERROR --> SCH : Cell does not exist %d",
4528 lcDelInfo->u.lchDel.cellId);
4533 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lchDel.crnti)) == NULLP)
4535 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d LCID:%d",
4536 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4539 if (lcDelInfo->u.lchDel.lcgId > 3)
4541 DU_LOG("\nERROR --> SCH : [%d]UEID:For LC %d, LCGid %d is invalid",
4542 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId,
4543 lcDelInfo->u.lchDel.lcgId);
4546 if ((dlLc = rgSCHDbmGetDlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
4549 DU_LOG("\nERROR --> SCH : LC does not exist for CRNTI:%d LCID:%d",
4550 lcDelInfo->u.lchDel.crnti, lcDelInfo->u.lchDel.lcId);
4553 rgSCHUtlRgrLcDel(cell, ue, lcDelInfo->u.lchDel.lcId,lcDelInfo->u.lchDel.lcgId);
4555 /* Reduce any pending bo from this LC(if any)
4556 * from the UE's total BO */
4559 if(ue->totalBo >= dlLc->bo)
4561 ue->totalBo -= dlLc->bo;
4565 ue->totalBo = 0; /* this scenario should not occur */
4568 rgSCHDbmDelDlDedLcCb(ue, dlLc);
4569 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
4572 lcId = lcDelInfo->u.lchDel.lcId;
4573 if (TRUE == ue->ul.lcCb[lcId -1].isValid)
4575 ulLc = &(ue->ul.lcCb[lcId -1]);
4576 ue->ul.lcCb[lcId -1].isValid = FALSE;
4578 if((ulLc->qciCb->ulUeCount) &&
4579 (ue->ulActiveLCs & (1 << (ulLc->qciCb->qci -1))))
4581 ulLc->qciCb->ulUeCount--;
4582 ue->ulActiveLCs &= ~(1 << (ulLc->qciCb->qci -1));
4584 /* Shifting LCs in LCG Array because of LC deletion */
4585 for (idx = ulLc->lcgArrIdx +1; idx < ulLc->lcg->numLch;
4588 ulLc->lcg->lcArray[idx -1] =
4589 ulLc->lcg->lcArray[idx];
4590 ulLc->lcg->lcArray[idx -1]->lcgArrIdx = idx -1;
4592 ulLc->lcg->numLch--;
4593 ulLc->lcg->lcArray[idx -1] = NULLP;
4595 #endif /* LTE_L2_MEAS */
4598 errInfo->errCause = RGSCHERR_NONE;
4600 } /* rgSCHCfgRgrLcDel */
4605 * @brief Handler for the logical channel delete request from
4610 * Function : rgSCHCfgRgrLcgDel
4613 * - Fetch the logical channel control block.
4614 * - Free the logical channel control block.
4615 * - If successful, return ROK else return RFAILED.
4617 * @param[in] RgrDel *lcDelInfo
4618 * @param[out] RgSchErrInfo *errInfo
4623 S16 rgSCHCfgRgrLcgDel
4627 RgSchErrInfo *errInfo
4630 RgSchUeCb *ue = NULLP;
4632 uint8_t lcCount = 0;
4636 lcgId = lcDelInfo->u.lcgDel.lcgId;
4638 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_DEL;
4640 /* Fetch the Active cell */
4641 if (cell->cellId != lcDelInfo->u.lcgDel.cellId)
4643 DU_LOG("\nERROR --> SCH : CELL does not exist for CRNTI:%d LCGID:%d",
4644 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4649 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lcgDel.crnti)) == NULLP)
4651 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d LCGID:%d",
4652 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4656 /* set lcgId in UEs lcg cntrl blk to invalid */
4657 rgSCHUtlRgrLcgDel(cell, ue, lcgId);
4658 ue->ul.lcgArr[lcgId].lcgId = RGSCH_INVALID_LCG_ID;
4661 /* Since LCs are being deleted, if any of them are contributing
4662 to Active UE count for a QCI, decrease the count */
4663 for (lcCount =0; (lcCount < RGSCH_MAX_LC_PER_UE) &&
4664 (lcCount < ue->ul.lcgArr[lcgId].numLch) ; lcCount++)
4666 if (ue->ul.lcgArr[lcgId].lcArray[lcCount])
4668 if((ue->ul.lcgArr[lcgId].
4669 lcArray[lcCount]->qciCb->ulUeCount) &&
4671 (1 << ((ue->ul.lcgArr[lcgId].
4672 lcArray[lcCount])->qciCb->qci -1))))
4675 ue->ul.lcgArr[lcgId].
4676 lcArray[lcCount]->qciCb->ulUeCount--;
4677 ue->ulActiveLCs &= ~(1 <<
4678 (ue->ul.lcgArr[lcgId].
4679 lcArray[lcCount]->qciCb->qci -1));
4685 errInfo->errCause = RGSCHERR_NONE;
4687 } /* rgSCHCfgRgrLcgDel */
4691 /***********************************************************
4693 * Func : rgSCHCfgVldtRgrLcCfg
4696 * Desc : Validates dedicated logical channel configuration recieved from RRM.
4706 **********************************************************/
4707 S16 rgSCHCfgVldtRgrLcCfg
4713 RgSchErrInfo *errInfo
4717 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LC_CFG;
4719 if (((*cell) == NULLP) ||
4720 ((*cell)->cellId != lcCfg->cellId))
4722 DU_LOG("\nERROR --> SCH : Cell does not existi for "
4723 "CRNTI:%d LCID:%d",lcCfg->crnti, lcCfg->lcId);
4728 if ((*ue = rgSCHDbmGetUeCb(*cell, lcCfg->crnti)) == NULLP)
4730 DU_LOG("\nERROR --> SCH : UE does not exist for dedicated"
4731 " logical channel CRNTI:%d LCID:%d", lcCfg->crnti, lcCfg->lcId);
4735 /* Validate logical channel Id */
4736 if ((lcCfg->lcId < RGSCH_DEDLC_MIN_LCID)
4737 ||(lcCfg->lcId > RGSCH_DEDLC_MAX_LCID))
4739 DU_LOG("\nERROR --> SCH : Invalid logical channel Id:%d"
4740 "for CRNTI:%d",lcCfg->lcId,lcCfg->crnti);
4744 if (lcCfg->lcType != CM_LTE_LCH_DTCH && lcCfg->lcType != CM_LTE_LCH_DCCH)
4746 DU_LOG("\nERROR --> SCH : Invalid logical channel Type %d"
4747 "CRNTI:%d LCID:%d",lcCfg->lcType,lcCfg->crnti, lcCfg->lcId);
4752 } /* rgSCHCfgVldtRgrLcCfg */
4754 /***********************************************************
4756 * Func : rgSCHCfgVldtRgrLcgCfg
4759 * Desc : Validates dedicated logical channel group configuration recieved from RRM.
4769 **********************************************************/
4770 S16 rgSCHCfgVldtRgrLcgCfg
4776 RgSchErrInfo *errInfo
4780 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LCG_CFG;
4782 if (((*cell) == NULLP) ||
4783 ((*cell)->cellId != lcgCfg->cellId))
4785 DU_LOG("\nERROR --> SCH : Cell does not exist for"
4786 "CRNTI:%d LCGID:%d",lcgCfg->crnti,lcgCfg->ulInfo.lcgId);
4791 if ((*ue = rgSCHDbmGetUeCb(*cell, lcgCfg->crnti)) == NULLP)
4793 DU_LOG("\nERROR --> SCH : UE does not exist for "
4794 "dedicated logical channel CRNTI:%d LCGID:%d", lcgCfg->crnti, lcgCfg->ulInfo.lcgId);
4798 if ((lcgCfg->ulInfo.gbr != 0) && (lcgCfg->ulInfo.mbr < lcgCfg->ulInfo.gbr))
4804 } /* rgSCHCfgVldtRgrLcgCfg */
4807 /***********************************************************
4809 * Func : rgSCHCfgVldtRgrCellPwrCfg
4811 * Desc : Validates cell power configuration.
4821 **********************************************************/
4822 static S16 rgSCHCfgVldtRgrCellPwrCfg
4825 RgrCellCfg *cellCfg,
4826 RgSchErrInfo *errInfo
4833 /* This function does nothing now, placeholder for
4834 * subsequent power config validations that may be needed */
4838 } /* rgSCHCfgVldtRgrCellPwrCfg */
4841 /***********************************************************
4843 * Func : rgSCHCfgVldtRgrCmnLcCfg
4846 * Desc : Validates common logical channel configuration recieved from RRM.
4848 * @param[in] Inst inst
4849 * @param[in] RgrCellCfg *cellCfg
4850 * @param[out] RgSchErrInfo *errInfo
4859 **********************************************************/
4860 static S16 rgSCHCfgVldtRgrCmnLcCfg
4863 RgrCellCfg *cellCfg,
4864 RgSchErrInfo *errInfo
4868 RgrCmnLchCfg *lcCfg;
4869 uint8_t dirVld = FALSE;
4870 uint8_t bitMask = 0x00;
4873 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CMN_LC_CFG;
4875 for (idx = 0; idx < cellCfg->numCmnLcs; idx++)
4877 lcCfg = &(cellCfg->cmnLcCfg[idx]);
4878 /* Validate downlink info */
4879 if (lcCfg->dir & RGR_DIR_TX)
4881 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
4883 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
4887 bitMask |= RGSCH_BCCH_DLSCH_CFG1;
4894 (cellCfg->siCfg.siWinSize == 1) ||
4895 (cellCfg->siCfg.siWinSize == 2) ||
4896 (cellCfg->siCfg.siWinSize == 5) ||
4897 (cellCfg->siCfg.siWinSize == 10) ||
4898 (cellCfg->siCfg.siWinSize == 15) ||
4899 (cellCfg->siCfg.siWinSize == 20) ||
4900 (cellCfg->siCfg.siWinSize == 40)) &&
4901 (cellCfg->siCfg.retxCnt>0)
4904 bitMask |= RGSCH_BCCH_DLSCH_CFG2;
4908 DU_LOG("\nERROR --> SCH : Invalid si config for cell");
4913 else if (lcCfg->dlTrchType == CM_LTE_TRCH_BCH)
4915 bitMask |= RGSCH_BCCH_BCH_CFG;
4919 DU_LOG("\nERROR --> SCH : Invalid transport channel %d for cell", lcCfg->dlTrchType);
4923 else if (lcCfg->lcType == CM_LTE_LCH_PCCH)
4925 bitMask |= RGSCH_PCCH_CFG;
4927 else if (lcCfg->lcType == CM_LTE_LCH_CCCH)
4929 bitMask |= RGSCH_DL_CCCH_CFG;
4934 /* Validate uplink info */
4935 if (lcCfg->dir & RGR_DIR_RX)
4938 if (lcCfg->lcType != CM_LTE_LCH_CCCH)
4940 DU_LOG("\nERROR --> SCH : Invalid UL common lcType %d for cell", lcCfg->lcType);
4945 bitMask |= RGSCH_UL_CCCH_CFG;
4950 /* Invalid direction */
4953 DU_LOG("\nERROR --> SCH : Invalid Direction %d", lcCfg->dir);
4957 if (bitMask != RGSCH_CELL_ACTIVE_CFG)
4959 DU_LOG("\nERROR --> SCH : Invalid Common channel config for cell");
4964 } /* rgSCHCfgVldtRgrCmnLcCfg */
4967 /***********************************************************
4969 * Func : rgSCHCfgVldtUeCqiModeCfg
4972 * Desc : Validates UE CQI modes Configuration recieved from RRC.
4982 **********************************************************/
4983 static S16 rgSCHCfgVldtUeCqiModeCfg
4986 RgrUeDlCqiCfg *ueDlCqiCfg
4991 if((ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx < 1) ||
4992 (ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx > 1024))
4994 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI Info");
4998 /* Validate UE Aperiodic CQI mode */
4999 if ((ueDlCqiCfg->aprdCqiCfg.pres == TRUE) &&
5000 ((ueDlCqiCfg->aprdCqiCfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
5001 (cell->bwCfg.dlTotalBw <= 7)))
5003 DU_LOG("\nERROR --> SCH : Invalid Aperiodic mode config for DL CQI");
5007 /* Validate UE Periodic CQI mode */
5008 if (ueDlCqiCfg->prdCqiCfg.prdModeEnum > RGR_PRD_CQI_MOD21)
5010 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for DL CQI");
5013 /* Validate K value in periodic CQI Config */
5014 if(((ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD20) ||
5015 (ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD21)) &&
5016 ((ueDlCqiCfg->prdCqiCfg.k < 1)||
5017 (ueDlCqiCfg->prdCqiCfg.k > 4)))
5019 DU_LOG("\nERROR --> SCH : Invalid K for Subband CQI reporting");
5023 if ((ueDlCqiCfg->prdCqiCfg.type == 1) &&
5024 (ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
5026 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for DL CQI");
5035 /***********************************************************
5037 * Func : rgSCHCfgVldtUeMeasGapAckNakRepCfg
5040 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5050 **********************************************************/
5051 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg
5059 if ((ueCfg->ackNackModeEnum == RGR_TDD_ACKNACK_MODE_MULT) &&
5060 (ueCfg->ueAckNackCfg.isAckNackEnabled == TRUE))
5062 DU_LOG("\nERROR --> SCH : TDD ACK NACK Multiplexing Mode"
5063 "is not allowed when Ack/Nack is Enabled: %d CRNTI:%d",
5064 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5067 #endif /* LTE_TDD */
5068 /* Validate AckNackRep Factor */
5069 if((ueCfg->ueAckNackCfg.isAckNackEnabled == FALSE) &&
5070 (!ueCfg->ueMesGapCfg.isMesGapEnabled))
5075 if(ueCfg->ueAckNackCfg.isAckNackEnabled)
5077 if ( (ueCfg->ueAckNackCfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5078 || (ueCfg->ueAckNackCfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5080 DU_LOG("\nERROR --> SCH : Invalid ACK NACK REP Factor:%d CRNTI:%d",
5081 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5085 if(ueCfg->ueMesGapCfg.isMesGapEnabled)
5087 switch(ueCfg->ueMesGapCfg.gapPrd)
5089 case RG_MEAS_GAPPRD_40:
5090 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_40)
5092 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d CRNTI:%d",
5093 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5097 case RG_MEAS_GAPPRD_80:
5098 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_80)
5100 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d CRNTI:%d",
5101 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5107 DU_LOG("\nERROR --> SCH : Invalid GAP Periodicity Settings:%d"
5108 "CRNTI:%d", ueCfg->ueMesGapCfg.gapPrd,ueCfg->crnti);
5115 } /* rgSCHCfgVldtUeMeasGapAckNakRepCfg*/
5118 /***********************************************************
5120 * Func : rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5123 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5133 **********************************************************/
5134 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5141 if((ueRecfg->ueAckNackRecfg.isAckNackEnabled == FALSE) &&
5142 (!ueRecfg->ueMeasGapRecfg.isMesGapEnabled))
5147 if(ueRecfg->ueAckNackRecfg.isAckNackEnabled )
5149 /* Validate AckNackRep Factor */
5150 if ( (ueRecfg->ueAckNackRecfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5151 || (ueRecfg->ueAckNackRecfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5153 DU_LOG("\nERROR --> SCH : Invalid ACK NACK REP Factor:%d"
5154 "NEW CRNTI:%d",ueRecfg->ueAckNackRecfg.ackNackRepFactor,ueRecfg->newCrnti);
5158 if(ueRecfg->ueMeasGapRecfg.isMesGapEnabled)
5160 switch(ueRecfg->ueMeasGapRecfg.gapPrd)
5162 case RG_MEAS_GAPPRD_40:
5163 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_40)
5165 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d"
5166 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5170 case RG_MEAS_GAPPRD_80:
5171 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_80)
5173 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d"
5174 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5180 DU_LOG("\nERROR --> SCH : Invalid GAP Periodicity Settings:%d"
5181 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapPrd,ueRecfg->newCrnti);
5188 } /* rgSCHCfgVldtUeMeasGapAckNakRepRecfg*/
5191 /***********************************************************
5193 * Func : rgSCHCfgVldtUeDlSpsCfg
5196 * Desc : Validates UE's DL SPS configuration recieved from RRC.
5206 **********************************************************/
5207 static S16 rgSCHCfgVldtUeDlSpsCfg
5210 RgrUeSpsDlCfg *dlSpsCfg
5216 /* peridicity validation done in SPS module */
5217 if ((dlSpsCfg->numPucchVal > RG_SCH_MAX_NUM_N1PUCCH_PER_UE) ||
5218 (dlSpsCfg->numPucchVal == 0))
5220 DU_LOG("\nERROR --> SCH : Invalid number of n1Pucch values"
5221 " in DL SPS Config");
5225 for (idx = 0; idx < dlSpsCfg->numPucchVal; ++idx)
5227 if (dlSpsCfg->n1PucchVal[idx] > RG_SCH_MAX_N1PUCCH_VAL)
5230 DU_LOG("\nERROR --> SCH : Invalid N1Pucch value"
5231 " in DL SPS Config %u", dlSpsCfg->n1PucchVal[idx]);
5233 DU_LOG("\nERROR --> SCH : Invalid N1Pucch value"
5234 " in DL SPS Config %lu", dlSpsCfg->n1PucchVal[idx]);
5239 /* SPS_TODO: check will change for TDD */
5240 if ((dlSpsCfg->numSpsHqProc == 0) ||
5241 (dlSpsCfg->numSpsHqProc > RGSCH_MAX_DL_HQ_PROC))
5243 DU_LOG("\nERROR --> SCH : Invalid number of SPS HARQ procs"
5244 " in DL SPS Config");
5249 } /* rgSCHCfgVldtDlSpsCfg */
5250 #endif /* LTEMAC_SPS */
5252 /***********************************************************
5254 * Func : rgSCHCfgVldtUePwrCfg
5257 * Desc : Validates UE Group power configuration recieved from RRC.
5267 **********************************************************/
5268 static S16 rgSCHCfgVldtUePwrCfg
5271 RgrUeUlPwrCfg *pwrCfg
5275 /* Group power control works only in accumulated mode */
5276 if (!pwrCfg->isAccumulated)
5279 if (pwrCfg->uePuschPwr.pres)
5281 DU_LOG("\nERROR --> SCH : Accumulation configutation"
5282 " not in sync with group power configuration");
5287 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePuschPwr) != ROK)
5289 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
5293 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePucchPwr) != ROK)
5295 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
5301 } /* rgSCHCfgVldtUePwrCfg */
5303 /***********************************************************
5305 * Func : rgSCHCfgVldtUeGrpPwrCfg
5308 * Desc : Validates UE Group power configuration recieved from RRC.
5318 **********************************************************/
5319 static S16 rgSCHCfgVldtUeGrpPwrCfg
5322 RgrUeGrpPwrCfg *grpPwrCfg
5326 if ((grpPwrCfg->pres) &&
5327 (((grpPwrCfg->tpcRnti > cell->rntiDb.rntiStart) &&
5328 ((grpPwrCfg->tpcRnti <
5329 (cell->rntiDb.rntiStart + cell->rntiDb.maxRntis))))))
5331 DU_LOG("\nERROR --> SCH : Invalid Uplink Group power "
5337 } /* rgSCHCfgVldtUeGrpPwrCfg */
5340 /***********************************************************
5342 * Func : rgSCHCfgVldtSpsReCfg
5345 * Desc : Validates UE SPS and other SPS dependent
5346 * configuration recieved from RRC.
5356 **********************************************************/
5357 static S16 rgSCHCfgVldtSpsReCfg
5365 if ((ueRecfg->ueRecfgTypes & RGR_UE_DLSPS_RECFG) &&
5366 (ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled))
5368 /* Validating SPS RNTI */
5369 if (((ueRecfg->ueSpsRecfg.spsRnti >= cell->rntiDb.rntiStart) &&
5370 (ueRecfg->ueSpsRecfg.spsRnti<=
5371 (cell->rntiDb.rntiStart+cell->rntiDb.maxRntis)))||
5372 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_SI_RNTI) ||
5373 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_P_RNTI))
5375 DU_LOG("\nERROR --> SCH : Invalid SPS RNTI "
5376 " in DL SPS Recfg OLD CRNTI:%d NEW CCRNTI:%d",
5377 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5380 if (rgSCHCfgVldtUeDlSpsCfg(cell, &ueRecfg->ueSpsRecfg.dlSpsCfg) != ROK)
5382 DU_LOG("\nERROR --> SCH : Invalid DL SPS configuration"
5383 " for the OLD CRNTI:%d NEW CRNTI:%d",
5384 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5390 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5392 if (ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
5394 /* ccpu00117035 - MOD - changed instIdx to inst */
5395 /* ccpu00117035 - MOD - changed ueID to oldCrnti*/
5396 DU_LOG("\nERROR --> SCH : DRX reconfig not supported DL SPS enabled for OLD CRNTI:%d NEW CRNTI:%d",
5397 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5402 /* ccpu00117627 - ADD - SPS recfg validation against HDFDD */
5404 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5406 if(ue->hdFddEnbld == TRUE)
5408 DU_LOG("\nERROR --> SCH : DL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5409 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5413 if(ueRecfg->ueSpsRecfg.ulSpsCfg.isUlSpsEnabled)
5415 if(ue->hdFddEnbld == TRUE)
5417 DU_LOG("\nERROR --> SCH : UL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5418 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5425 } /*rgSCHCfgVldtSpsReCfg*/
5428 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
5429 /***********************************************************
5431 * Func : rgSCHCfgVldtCqiReptReCfg
5434 * Desc : Validates UE CQI report for DL Power control
5435 * configuration recieved from RRC.
5445 **********************************************************/
5446 static S16 rgSCHCfgVldtCqiReptReCfg
5453 /* Validate DL Power Control Config parameters */
5454 if (ueRecfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
5456 DU_LOG("\nERROR --> SCH : Invalide numColltdCqiRept,"
5457 "MAX supported %d for OLD CRNTI:%d NEW CRNTI:%d",RGR_CQIRPTS_MAXN,
5458 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5463 } /*rgSCHCfgVldtCqiReptReCfg*/
5466 /***********************************************************
5468 * Func : rgSCHCfgRgrLcChfg
5471 * Desc : Handles dedicated logical channel configuration
5472 * recieved from RRC.
5482 **********************************************************/
5483 S16 rgSCHCfgRgrLchCfg
5488 RgSchErrInfo *errInfo
5492 RgSchDlLcCb *dlLc = NULLP;
5493 Inst inst = cell->instIdx;
5498 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LC_CFG;
5500 /* Allocate the downlink logical channel control block */
5501 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&dlLc,
5502 sizeof(RgSchDlLcCb))) != ROK)
5504 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
5505 "Downlink LCId:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5508 if ((uint8_t *)dlLc == NULLP)
5510 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
5511 "Downlink LCID:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5514 dlLc->lcId = lcCfg->lcId;
5516 rgSCHLaaLcCfg(cell, dlLc, lcCfg);
5519 rgSCHDbmInsDlDedLcCb(ue, dlLc);
5521 ret = rgSCHUtlRgrLcCfg(cell, ue, dlLc, lcCfg, errInfo);
5528 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5529 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5532 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5533 "configuration failed at SCH:UEID:%d LCID:%d CRNTI:%d",
5534 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5538 RGSCH_ARRAY_BOUND_CHECK(inst, ue->ul.lcCb, (lcCfg->lcId -1));
5539 if ( !lcCfg->lcId ||
5540 (TRUE == ue->ul.lcCb[lcCfg->lcId -1].isValid))
5545 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5546 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5549 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5550 "configuration failed at SCH: UL LC CB already existing"
5551 " UEID:%d LCID:%d CRNTI:%d",
5552 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5556 /* Create UL LC context to maintain LCG to LC mapping and
5557 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5559 ue->ul.lcCb[lcCfg->lcId -1].isValid = TRUE;
5560 ulLc = &(ue->ul.lcCb[lcCfg->lcId -1]);
5562 ulLc->lcId = lcCfg->lcId;
5563 ulLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5564 ulLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5565 ue->ul.lcgArr[lcCfg->lcgId].lcArray[ue->ul.lcgArr[lcCfg->lcgId].numLch] = ulLc;
5566 ulLc->lcg = &ue->ul.lcgArr[lcCfg->lcgId];
5567 ulLc->lcgArrIdx = ue->ul.lcgArr[lcCfg->lcgId].numLch;
5568 ue->ul.lcgArr[lcCfg->lcgId].numLch++;
5570 dlLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5571 dlLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5572 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
5574 rgSchAddToL2Meas(cell,dlLc); /*LTE_L2_MEAS_PHASE2*/
5576 #endif /* LTE_L2_MEAS */
5579 } /* rgSCHCfgRgrLchCfg */
5581 /***********************************************************
5583 * Func : rgSCHCfgRgrLcgCfg
5586 * Desc : Handles dedicated logical channel group configuration
5587 * recieved from RRM.
5597 **********************************************************/
5598 S16 rgSCHCfgRgrLcgCfg
5603 RgSchErrInfo *errInfo
5609 //#ifdef LTE_L2_MEAS
5614 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LCG_CFG;
5616 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = lcgCfg->ulInfo.lcgId;
5618 ret = rgSCHUtlRgrLcgCfg(cell, ue, lcgCfg, errInfo);
5621 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5622 "configuration failed at SCH: UEID:%d LCGID:%d CRNTI:%d",
5623 ue->ueId, lcgCfg->ulInfo.lcgId,lcgCfg->crnti);
5624 /* Roll back lcgCfg */
5625 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = RGSCH_INVALID_LCG_ID;
5626 rgSCHUtlRgrLcgDel(cell, ue, lcgCfg->ulInfo.lcgId);
5630 //#ifdef LTE_L2_MEAS
5631 /* Copy all info of UL LCH in cfg to ulLcgCb */
5632 for (idx = 0; idx < lcgCfg->ulInfo.numLch; idx++)
5634 /* Allocate the uplink logical channel control block */
5635 if((ret = rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&ulLc,
5636 sizeof(RgSchUlLcCb))) != ROK)
5638 DU_LOG("\nERROR --> SCH : Memory allocation FAILED ");
5641 if ((uint8_t *)ulLc == NULLP)
5643 DU_LOG("\nERROR --> SCH : Memory allocation FAILED ");
5646 /* Create UL LC context to maintain LCG to LC mapping and
5647 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5649 ulLc->lcId = lcgCfg->ulInfo.lchUlCfg[idx].lcId;
5650 ulLc->qciCb = &(cell->qciArray[lcgCfg->ulInfo.lchUlCfg[idx].qci]);
5651 ulLc->qciCb->qci = lcgCfg->ulInfo.lchUlCfg[idx].qci;
5652 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcArray[idx] = ulLc;
5654 ue->ul.lcCb[ulLc->lcId -1] = ulLc;
5655 ulLc->lcg = &ue->ul.lcgArr[lcgCfg->ulInfo.lcgId];
5656 ulLc->lcgArrIdx = idx;
5658 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].numLch = lcgCfg->ulInfo.numLch;
5659 #endif /* LTE_L2_MEAS */
5662 } /* rgSCHCfgRgrLcgCfg */
5666 /***********************************************************
5668 * Func : rgSCHCfgRgrCmnLcCfg
5671 * Desc : Handles dedicated logical channel configuration
5672 * recieved from RRC.
5682 **********************************************************/
5683 static S16 rgSCHCfgRgrCmnLcCfg
5686 RgrCmnLchCfg *lcCfg,
5687 RgSchErrInfo *errInfo
5690 RgSchClcDlLcCb cmnLcCb;
5692 errInfo->errCause = RGSCHERR_CFG_RGR_CMN_LC_CFG;
5694 memset(&cmnLcCb, 0, sizeof(cmnLcCb));
5696 /* Handle configuration for CCCH/BCCH/PCCH */
5697 if (lcCfg->lcType == CM_LTE_LCH_CCCH)
5699 /* UL and DL CCCH configuration */
5700 if (lcCfg->dir & RGR_DIR_TX)
5702 cell->dlCcchId = lcCfg->lcId;
5705 if (lcCfg->dir & RGR_DIR_RX)
5707 cell->ulCcchId = lcCfg->lcId;
5712 cmnLcCb.lcId = lcCfg->lcId;
5713 rgSCHDbmInitCmnLcBoLst(&cmnLcCb);
5714 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
5716 /* BCCH on BCH and DLSCH configuration */
5717 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
5719 rgSCHDbmInsBcchOnDlsch(cell, &cmnLcCb);
5723 rgSCHDbmInsBcchOnBch(cell, &cmnLcCb);
5726 else /* PCCH configuration */
5728 rgSCHDbmInsPcch(cell, &cmnLcCb);
5733 } /* rgSCHCfgRgrCmnLcCfg */
5737 /***********************************************************
5739 * Func : rgSCHCfgFreeDlDedLcCb
5743 * - Processing Steps:
5744 * - Frees downlink dedicated logical channel control block.
5752 **********************************************************/
5753 static Void rgSCHCfgFreeDlDedLcCb
5760 Inst inst = cell->instIdx;
5762 rgSCHUtlFreeDlLc(cell, ue, dlLc);
5764 /* De-allocate the Cb */
5765 /* ccpu00117052 - MOD - Passing double pointer
5766 for proper NULLP assignment*/
5767 rgSCHUtlFreeSBuf(inst, (Data **)&dlLc, sizeof(*dlLc));
5770 /* Stack Crash problem for TRACE5 changes. Added the return below */
5773 } /* rgSCHCfgFreeDlDedLcCb */
5776 /***********************************************************
5778 * Func : rgSCHCfgFreeDlCmnLcCb
5782 * - Processing Steps:
5783 * - Frees downlink common logical channel control block.
5791 **********************************************************/
5792 static Void rgSCHCfgFreeDlCmnLcCb(RgSchClcDlLcCb *cmnDlLc)
5795 memset(cmnDlLc, 0, sizeof(*cmnDlLc));
5796 cmnDlLc->lcId = RGSCH_INVALID_LC_ID;
5798 } /* rgSCHCfgFreeDlCmnLcCb */
5801 /***********************************************************
5803 * Func : rgSCHCfgFreeCellCb
5807 * - Processing Steps:
5808 * - Frees scheduler cell control block.
5816 **********************************************************/
5817 Void rgSCHCfgFreeCellCb(RgSchCellCb *cell)
5819 Inst inst = cell->instIdx;
5822 RgSchWarningSiInfo *warningSi;
5823 RgSchWarningSiPdu *warningSiPdu;
5826 /* ccpu00132385- SI Warning PDUs which are not processed need to be deleted */
5827 /* Search for used index in WarningSi */
5828 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
5830 if(cell->siCb.warningSi[idx].siId == 0)
5832 cell->siCb.siCtx.siId = cell->siCb.warningSi[idx].siId;
5833 warningSi = (RgSchWarningSiInfo *) cell->siCb.
5834 siArray[cell->siCb.siCtx.siId-1].si;
5835 if(warningSi != NULLP)
5837 /* ccpu00136659: CMAS ETWS design change */
5838 while (CM_LLIST_FIRST_NODE(&warningSi->warningSiMsg.segLstCp, node))
5840 warningSiPdu = (RgSchWarningSiPdu *)node->node;
5841 pdu = warningSiPdu->pdu;
5842 /* ccpu00136659: CMAS ETWS design change */
5843 cmLListDelFrm(&warningSi->warningSiMsg.segLstCp, node);
5844 RGSCH_FREE_MSG(pdu);
5846 cell->siCb.siArray[cell->siCb.siCtx.siId-1].si = NULLP;
5849 /* Free lists of the cell */
5850 rgSCHCfgFreeUeLst(cell);
5852 rgSCHCfgFreeSpsUeLst(cell);
5853 #endif /* LTEMAC_SPS */
5855 if ( TRUE == cell->emtcEnable )
5857 rgSCHEmtcCellDel(cell);
5860 rgSCHRamFreeCell(cell);
5862 rgSCHDbmRntiDbDeInit(cell);
5863 /* Deallocate the subframe allocation information */
5864 rgSCHUtlPutSfAlloc(cell);
5865 rgSCHUtlFreeCell(cell);
5867 rgSCHCfgFreeRgrCfgLst(cell);
5868 rgSCHCfgFreeCmnLcLst(cell);
5870 rgSCHUtlPutRlsHqAlloc(cell);
5873 rgSCHDbmDeInitUeTfuPendLst(cell);
5874 #endif /* LTE_TDD */
5877 rgSCHUtlPutSiInfo(cell);
5878 #endif/*RGR_SI_SCH*/
5880 (Void)rgSCHDrxCellDel(cell);
5882 rgSCHUtlFreeSBuf(inst, (Data**)&(cell->dynCfiCb.cceFailSamples),
5883 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)));
5886 TSL2DeallocCellStatsBlk(cell->cellId);
5890 /* LAA_SCELL: Trigger the De-Init function for the LAA Module */
5891 rgSCHLaaSCellCbDeInit(cell);
5895 if(cell->emtcEnable)
5897 rgSCHEmtcCellFree(cell);
5900 /* De-allocate the Cell */
5901 /* ccpu00117052 - MOD - Passing double pointer
5902 for proper NULLP assignment*/
5903 rgSCHUtlFreeSBuf(inst, (Data **)&cell, sizeof(*cell));
5907 /* Stack Crash problem for TRACE5 changes. Added the return below */
5910 } /* rgSCHCfgFreeCellCb */
5913 /***********************************************************
5915 * Func : rgSCHCfgFreeUeCb
5919 * - Processing Steps:
5920 * - Frees UE control block.
5928 **********************************************************/
5929 static Void rgSCHCfgFreeUeCb
5935 RgSchCmnUlUe *ueUl = RG_SCH_CMN_GET_UL_UE(ue, cell);
5936 RgUeUlHqCb *ulHqEnt;
5938 Inst inst = cell->instIdx;
5942 /* Free all logical channel info per UE */
5943 while((dlLc = rgSCHDbmGetNextDlDedLcCb(ue, NULLP)) != NULLP)
5945 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5946 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5948 for (lcCnt =0; lcCnt<RGSCH_MAX_LC_PER_UE; lcCnt++)
5950 if(ue->ul.lcCb[lcCnt].isValid == TRUE)
5952 lcgId = ue->ul.lcCb[lcCnt].lcg->lcgId;
5955 rgSCHUtlRgrLcDel(cell, ue, ue->ul.lcCb[lcCnt].lcId,lcgId);
5956 ue->ul.lcCb[lcCnt].isValid = FALSE;
5961 ulHqEnt = &(ueUl->hqEnt);
5962 /* Free Scheduler specific information per UE */
5963 rgSCHUtlFreeUe(cell, ue);
5965 /* Free Uplink HARQ specific information per UE */
5966 rgSCHUhmFreeUe(cell, ulHqEnt);
5968 if ( ue->drxCb != NULLP)
5971 /* ccpu00117052 - MOD - Passing double pointer
5972 for proper NULLP assignment*/
5973 rgSCHUtlFreeSBuf(cell->instIdx,
5974 (Data**)(&(ue->drxCb)),
5975 sizeof(RgSchDrxUeCb));
5978 ue->drxCb = (RgSchDrxUeCb *)NULLP;
5979 /* Free Downlink HARQ specific information per UE */
5981 /* Release the RNTI */
5984 rgSCHUtlRlsRnti(cell, ue->rntiLnk, FALSE, 0);
5988 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
5989 /* Just indicate to MAC, no need to release at SCH */
5990 rgSCHUtlIndRntiRls2Mac(cell, ue->ueId, FALSE, 0);
5992 /* rg009.201. Added changes of TFU_UPGRADE */
5994 rgSCHCfgPCqiSrsSrUeDel(cell,ue);
5997 rgSCHHdFddUeDel(cell, ue);
6002 TSL2DeallocUeStatsBlk(ue->ueId, ue->tenbStats);
6006 /* CA TODO Some handling needed while SCell Delete*/
6008 /* Delete the UE from the PCell secCellActCeLst*/
6009 rgSCHSCellRmvFrmActLst(cell, ue);
6010 rgSCHSCellDelUe(cell,ue);
6014 rgSCHLaaDeInitDlRbAllocCb(cell, &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb);
6017 rgSCHUtlFreeSBuf(inst, (Data **)&ue->cellInfo[0], sizeof(RgSchUeCellInfo));
6018 /* De-allocate the Ue */
6019 /* ccpu00117052 - MOD - Passing double pointer
6020 for proper NULLP assignment*/
6024 rgSCHEmtcUeInfoFree(cell, ue);
6027 rgSCHUtlFreeSBuf(inst, (Data **)&ue, sizeof(*ue));
6029 /* Stack Crash problem for TRACE5 changes. Added the return below */
6032 } /* rgSCHCfgFreeUeCb */
6034 /***********************************************************
6036 * Func : rgSCHCfgFreeRgrCfgLst
6040 * - Processing Steps:
6041 * - Frees configuration lists in cell control block.
6049 **********************************************************/
6050 static Void rgSCHCfgFreeRgrCfgLst
6055 RgSchCfgElem *rgCfgElem;
6056 Inst inst = cell->instIdx;
6058 /* Free CURRENT RGR cfg list */
6059 while ((rgCfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
6061 rgSCHDbmDelCrntRgrCfgElem(cell, rgCfgElem);
6062 /* ccpu00117052 - MOD - Passing double pointer
6063 for proper NULLP assignment*/
6064 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6067 /* Free PENDING RGR cfg list */
6068 while ((rgCfgElem = rgSCHDbmGetNextPndngRgrCfgElem(cell, NULLP)) != NULLP)
6070 rgSCHDbmDelPndngRgrCfgElem(cell, rgCfgElem);
6071 /* ccpu00117052 - MOD - Passing double pointer
6072 for proper NULLP assignment*/
6073 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6077 /* Stack Crash problem for TRACE5 changes. Added the return below */
6080 } /* rgSCHCfgFreeRgrCfgLst */
6083 /***********************************************************
6085 * Func : rgSCHCfgFreeCmnLcLst
6089 * - Processing Steps:
6090 * - Frees common logical channels in cell control block.
6098 **********************************************************/
6099 static Void rgSCHCfgFreeCmnLcLst
6104 RgSchClcDlLcCb *dlCmnLc;
6107 if ((dlCmnLc = rgSCHDbmGetBcchOnBch(cell)) != NULLP)
6109 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6111 if ((dlCmnLc = rgSCHDbmGetFirstBcchOnDlsch(cell)) != NULLP)
6113 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6115 if ((dlCmnLc = rgSCHDbmGetSecondBcchOnDlsch(cell)) != NULLP)
6117 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6119 if ((dlCmnLc = rgSCHDbmGetPcch(cell)) != NULLP)
6121 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6125 /* Stack Crash problem for TRACE5 changes. Added the return below */
6128 } /* rgSCHCfgFreeCmnLcLst */
6131 /***********************************************************
6133 * Func : rgSCHCfgFreeUeLst
6137 * - Processing Steps:
6138 * - Frees UE list in cell control block.
6146 **********************************************************/
6147 static Void rgSCHCfgFreeUeLst
6154 RgSchUeCellInfo *sCellInfo;
6158 /* Free Ues in the list */
6159 while ((ue = rgSCHDbmGetNextUeCb(cell, NULLP)) != NULLP)
6161 rgSCHDbmDelUeCb(cell, ue);
6164 if(ue->cell != cell)
6170 /* Call MeasGap and AckNakRep processing module */
6171 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
6173 rgSCHCfgFreeUeCb(cell, ue);
6176 /* De-initialize the Ue list */
6177 rgSCHDbmDeInitUeCbLst(cell);
6181 node = cell->sCellUeLst.first;
6184 sCellInfo = (RgSchUeCellInfo *)node->node;
6186 rgSCHSCellDelUeSCell(sCellInfo->ue->cell, sCellInfo->ue, sCellInfo->sCellIdx);
6190 /* Stack Crash problem for TRACE5 changes. Added the return below */
6193 } /* rgSCHCfgFreeUeLst */
6196 /***********************************************************
6198 * Func : rgSCHCfgFreeSpsUeLst
6202 * - Processing Steps:
6203 * - Frees Sps UE list in cell control block.
6211 **********************************************************/
6212 static Void rgSCHCfgFreeSpsUeLst(RgSchCellCb *cell)
6216 /* Free Ues in the list */
6217 while ((ue = rgSCHDbmGetNextSpsUeCb(cell, NULLP)))
6219 rgSCHDbmDelSpsUeCb(cell, ue);
6222 /* De-initialize the Ue list */
6223 rgSCHDbmDeInitSpsUeCbLst(cell);
6225 } /* rgSCHCfgFreeSpsUeLst */
6227 #endif /* LTEMAC_SPS */
6230 /***********************************************************
6232 * Func : rgSCHCfgVldtRgrCellSiCfg
6234 * Desc : Validates SI Configuration for SI
6244 **********************************************************/
6245 static S16 rgSCHCfgVldtRgrCellSiCfg
6251 uint8_t idx; /* idx for iteration */
6256 /* Check that retxCnt value should be <= value of siWinSize.
6257 This validation is only applicable for FDD mode. */
6258 if(siCfg->retxCnt > siCfg->siWinSize)
6260 DU_LOG("\nERROR --> SCH : retxCnt is greater than siWinSize, validation failed");
6265 /* Validate that a valid value for numSi has been specified */
6266 if(siCfg->numSi > RGR_MAX_NUM_SI)
6268 DU_LOG("\nERROR --> SCH : Validation for numSi in SI CFG failed");
6272 /* MinPeriodicity will have the least configured periodicity
6273 * Hence initializing with Max periodicity */
6274 siCfg->minPeriodicity = RGR_SI_PERD_512;
6276 /*Validate the value of periodicity specified for SIs */
6277 for(idx = 0;idx < siCfg->numSi;idx++)
6279 siCfg->minPeriodicity = RGSCH_MIN(siCfg->minPeriodicity,
6280 siCfg->siPeriodicity[idx]);
6281 /* Set the siPeriodicity as a multiple of 80 subframes */
6282 switch(siCfg->siPeriodicity[idx])
6285 case RGR_SI_PERD_16:
6286 case RGR_SI_PERD_32:
6287 case RGR_SI_PERD_64:
6288 case RGR_SI_PERD_128:
6289 case RGR_SI_PERD_256:
6290 case RGR_SI_PERD_512:
6294 DU_LOG("\nERROR --> SCH : Validation for SI Periodicity in SI-CFG failed");
6300 } /* rgSCHCfgVldtRgrCellSiCfg */
6302 /* LTE_ADV_FLAG_REMOVED_START */
6303 /***********************************************************
6305 * Func : rgSCHCfgVldtRgrCellLtrAdvCfg
6307 * Desc : Validates Lte Adv Configuration
6317 **********************************************************/
6318 static S16 rgSCHCfgVldtRgrCellLteAdvCfg
6321 RgrLteAdvancedCellConfig *lteAdvCfg,
6325 uint8_t temp[RGR_ABS_PATTERN_LEN];
6329 if((lteAdvCfg->pres & RGR_SFR) && (RGR_ENABLE == lteAdvCfg->sfrCfg.status))
6331 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.startRb > lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb)
6333 DU_LOG("\nERROR --> SCH : Invalid configuration of cell edge bandwidth for SFR feature");
6337 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb >= dlTotalBw)
6339 DU_LOG("\nERROR --> SCH : Invalid configuration of cell edge end RB for SFR feature");
6344 if(lteAdvCfg->sfrCfg.pwrThreshold.pLow >= lteAdvCfg->sfrCfg.pwrThreshold.pHigh)
6346 DU_LOG("\nERROR --> SCH : Invalid configuration of power threshold for SFR feature");
6352 if((lteAdvCfg->pres & RGR_ABS) && (RGR_ENABLE == lteAdvCfg->absCfg.status))
6354 if((RGR_ABS_MUTE != lteAdvCfg->absCfg.absPatternType) &&
6355 (RGR_ABS_TRANSMIT != lteAdvCfg->absCfg.absPatternType))
6357 DU_LOG("\nERROR --> SCH : Invalid configuration of ABS pattern type");
6361 memcpy(temp, lteAdvCfg->absCfg.absPattern,RGR_ABS_PATTERN_LEN);
6363 /* Added validation for ABS pattern len */
6364 for(idx = 0; idx < RGR_ABS_PATTERN_LEN; idx++)
6366 if((temp[idx] != 1) && (temp[idx] != 0))
6368 DU_LOG("\nERROR --> SCH : Invalid configuration of ABS pattern type");
6376 /* LTE_ADV_FLAG_REMOVED_END */
6379 /***********************************************************
6381 * Func : rgSCHCfgVldtRgrCellCsgParamCfg
6383 * Desc : Validates CSG Parameter Configuration
6393 **********************************************************/
6394 static S16 rgSCHCfgVldtRgrCellCsgParamCfg
6397 RgrCellCsgParamCfg *csgParam
6401 DU_LOG("\nDEBUG --> SCH : Validating CSG Parameters \n");
6403 if(csgParam->minDlResNonCsg > 100)
6405 DU_LOG("\nERROR --> SCH : Invalid Configuration of minimum DL resources "
6409 if(csgParam->minUlResNonCsg > 100)
6411 DU_LOG("\nERROR --> SCH : Invalid Configuration of minimum UL resources "
6419 * @brief Validates the SI configuration request from RRM to MAC.
6423 * Function : rgSCHCfgVldtRgrSiCfg
6426 * - Validate the range of configured values recieved in
6427 * configuration request.
6428 * - If validated successfully,
6432 * - Else return RFAILED.
6433 * @param[in] Inst inst
6434 * @param[in] RgrCellCfg *siCfg
6435 * @param[out] RgSchCellCb *cell
6436 * @param[out] RgSchErrInfo *errInfo
6441 S16 rgSCHCfgVldtRgrSiCfg
6444 RgrSiCfgReqInfo *siCfg,
6446 RgSchErrInfo *errInfo
6452 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_SI_CFG;
6454 /*Validate the cfgType parameter */
6455 switch(siCfg->cfgType)
6459 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6460 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6461 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6462 (siCfg->siId > numSi))
6464 DU_LOG("\nERROR --> SCH : Invalid SI Id value"
6468 errInfo->errCause = RGSCHERR_NONE;
6471 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
6472 case RGR_SI_CFG_TYPE_SIB1: /* SI CFG TYPE SIB1 */
6473 case RGR_SI_CFG_TYPE_SIB1_PWS: /* SI CFG TYPE SIB1_PWS */
6474 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
6476 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR:
6477 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR_PER:
6481 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
6482 /*Check that value of SI should be less than equal
6483 to configured numSi parameter value */
6484 /* Added siId validation for lower limit */
6485 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6486 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6487 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6488 (siCfg->siId > numSi))
6490 DU_LOG("\nERROR --> SCH : Invalid SI Id value"
6495 if(siCfg->siId > ((cell->siCfg.minPeriodicity * 10)/cell->siCfg.siWinSize))
6497 DU_LOG("\nERROR --> SCH : SiId can not be scheduled ");
6503 case RGR_SI_CFG_EMTC_TYPE_SI:
6504 case RGR_SI_CFG_EMTC_TYPE_SI_PER:
6505 if(ROK != rgEmtcvalidateSiCfg(siCfg,cell))
6512 DU_LOG("\nERROR --> SCH : Invalid cfgType "
6517 /*Validate the specified pdu */
6518 if(NULLP == siCfg->pdu)
6520 DU_LOG("\nERROR --> SCH : Invalid NULLP pdu "
6525 /*Check if PDU is of 0 length*/
6526 SFndLenMsg(siCfg->pdu, &msgLen);
6529 DU_LOG("\nERROR --> SCH : Invalid pdu "
6534 errInfo->errCause = RGSCHERR_NONE;
6538 } /* rgSCHCfgVldtRgrSiCfg */
6539 #endif /*RGR_SI_SCH*/
6541 /* LTE_ADV_FLAG_REMOVED_START */
6543 * @brief Validates the RNTP INF request from RRM to MAC.
6547 * Function : rgSCHCfgVldtRgrLoadInf
6550 * - Validate the range of configured values recieved in
6552 * - If validated successfully,
6556 * - Else return RFAILED.
6557 * @param[in] Inst inst
6558 * @param[in] RgrLoadInfReqInfo *loadInfReq
6559 * @param[out] RgSchCellCb *cell
6560 * @param[out] RgSchErrInfo *errInfo
6565 S16 rgSCHCfgVldtRgrLoadInf
6568 RgrLoadInfReqInfo *loadInfReq,
6570 RgSchErrInfo *errInfo
6574 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LOAD_INF;
6576 /* Validate if the CC startRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6577 if((loadInfReq->rgrCcPHighStartRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6578 (loadInfReq->rgrCcPHighStartRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6580 DU_LOG("\nERROR --> SCH : Invalid rgrCcPHighStartRb received specified");
6584 /* Validate if the CC endRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6585 if((loadInfReq->rgrCcPHighEndRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6586 (loadInfReq->rgrCcPHighEndRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6588 DU_LOG("\nERROR --> SCH : Invalid rgrCcPHighEndRb received specified");
6592 errInfo->errCause = RGSCHERR_NONE;
6596 } /* rgSCHCfgVldtRgrLoadInf */
6597 /* LTE_ADV_FLAG_REMOVED_END */
6601 /********************************************************************
6602 * UE ACQI, PCQI, RI, SRS and SR Re/Configuration Validation Functions *
6604 *********************************************************************/
6607 * @brief Validates the Tx Mode and PUSCH Mode configuration.
6611 * Function : rgSCHCfgVldtRgrTxmodePuschMode
6614 * - Validate whether the configured PUSCH Mode and the
6615 * Configured Tx Mode are in the right combination
6616 * - If validated successfully,
6621 * @param[in] RgSchCellCb *cellCb
6622 * @param[in] RgrTxMode txMde
6623 * @param[in] RgrAprdCqiMode puschMode
6624 * @param[out] RgSchErrInfo *errInfo
6629 S16 rgSCHCfgVldtRgrTxmodePuschMode
6631 RgSchCellCb *cellCb,
6633 RgrAprdCqiMode puschMode,
6634 RgSchErrInfo *errInfo
6638 if (txMde == RGR_UE_TM_1 || txMde == RGR_UE_TM_2 ||
6639 txMde == RGR_UE_TM_3 || txMde == RGR_UE_TM_7)
6641 if (puschMode == RGR_APRD_CQI_MOD12 ||
6642 puschMode == RGR_APRD_CQI_MOD22 ||
6643 puschMode == RGR_APRD_CQI_MOD31)
6649 if (txMde == RGR_UE_TM_4 || txMde == RGR_UE_TM_6)
6651 if (puschMode == RGR_APRD_CQI_MOD20 ||
6652 puschMode == RGR_APRD_CQI_MOD30)
6658 if (txMde == RGR_UE_TM_5 )
6660 if (puschMode != RGR_APRD_CQI_MOD31)
6666 /* TOODO:: Tm8 and TM9 validation has to
6667 * be changed as mentioned inthe commented
6669 /* TM8 and TM9 supports all modes
6670 * Mode 1-2, 2-2, 3-1 if pmi/ri reporting enabled
6671 * 2-0,3-0 of pmi/ri reporitng isdisabled *
6672 * if pmi/ri is enabled
6673 * Mode 1-2, 2-2, 3-1 if with pmi/ri and csi-rs ports > 1
6674 * 2-0,3-0 of pmi/ri reporitng isdisabled and csi-rs ports == 1*/
6678 }/*rgSCHCfgVldtRgrTxmodePuschMode ends*/
6681 * @brief Validates the UE ACQI configuration request from RRM to MAC.
6685 * Function : rgSCHCfgVldtRgrUeACqiCfg
6688 * - Validate the UE configuration request from RRC to MAC at CFG:
6689 * validate the ACQI Configuration
6690 * - If validated successfully,
6695 * @param[in] RgSchCellCb *cellCb,
6696 * @param[in] CmLteRnti crnti,
6697 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg,
6698 * @param[in] RgrUeTxModeCfg txMode,
6699 * @param[out] RgSchErrInfo *errInfo
6705 S16 rgSCHCfgVldtRgrUeACqiCfg
6707 RgSchCellCb *cellCb,
6709 RgrUeAprdDlCqiCfg *acqiCfg,
6710 RgrUeTxModeCfg txMode,
6711 RgSchErrInfo *errInfo
6715 RgrAprdCqiMode puschMode;
6719 if(txMode.pres == TRUE)
6721 txMde = txMode.txModeEnum;
6722 puschMode = acqiCfg->aprdModeEnum;
6723 if ( ROK != rgSCHCfgVldtRgrTxmodePuschMode(cellCb, txMde,
6724 puschMode, errInfo))
6726 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration CRNTI:%d",crnti);
6735 * @brief Validates the Tx Mode and PUCCH Mode configuration.
6739 * Function : rgSCHCfgVldtRgrTxmodePucchMode
6742 * - Validate whether the configured PUCCH Mode and the
6743 * Configured Tx Mode are in the right combination
6744 * - If validated successfully,
6749 * @param[in] RgSchCellCb *cellCb
6750 * @param[in] RgrTxMode txMde
6751 * @param[in] RgrPrdCqiMode pucchMode
6752 * @param[out] RgSchErrInfo *errInfo
6757 S16 rgSCHCfgVldtRgrTxmodePucchMode
6759 RgSchCellCb *cellCb,
6761 RgrPrdCqiMode pucchMode,
6762 RgSchErrInfo *errInfo
6766 if (pucchMode == RGR_PRD_CQI_MOD10 || pucchMode == RGR_PRD_CQI_MOD20 )
6768 if (txMde ==RGR_UE_TM_4 || txMde ==RGR_UE_TM_5 || txMde ==RGR_UE_TM_6)
6773 else if (pucchMode == RGR_PRD_CQI_MOD11 || pucchMode == RGR_PRD_CQI_MOD21)
6775 if (txMde ==RGR_UE_TM_1 || txMde ==RGR_UE_TM_2 || txMde ==RGR_UE_TM_3 \
6776 || txMde ==RGR_UE_TM_7)
6781 /* TODO:: Tm8 and TM9 validation needs to be added */
6786 * @brief Validates the UE Periodic CQI, PMI, RI, re/configuration request from RRM to MAC.
6790 * Function : rgSCHCfgVldtRgrUePCqiCfg
6793 * - Validate the UE configuration request from RRC to MAC at CFG:
6794 * validate the value range for Periodic CQI, PMI, RI values.
6795 * - If validated successfully,
6800 * @param[in] RgSchCellCb *cellCb,
6801 * @param[in] CmLteRnti crnti,
6802 * @param[in] RgrUePrdDlCqiCfg *cqiCfg,
6803 * @param[in] RgrUeTxModeCfg txMode,
6804 * @param[out] RgSchErrInfo *errInfo
6810 S16 rgSCHCfgVldtRgrUePCqiCfg
6812 RgSchCellCb *cellCb,
6814 RgrUePrdDlCqiCfg *cqiCfg,
6816 RgrUeTxModeCfg txMode,
6817 RgSchErrInfo *errInfo
6820 S16 rgSCHCfgVldtRgrUePCqiCfg
6822 RgSchCellCb *cellCb,
6824 RgrUePrdDlCqiCfg *cqiCfg,
6825 RgrUeTxModeCfg txMode,
6826 RgSchErrInfo *errInfo
6831 RgrPrdCqiMode pucchMode;
6833 txMde = RGR_UE_TM_1;
6834 pucchMode = RGR_PRD_CQI_MOD20;
6835 if ( RGR_SCH_PCQI_SETUP == cqiCfg->type )
6837 /*1. Validate for Tx Mode and PUCCH Mode combination*/
6838 if(txMode.pres == TRUE)
6840 txMde = txMode.txModeEnum;
6841 pucchMode = cqiCfg->cqiSetup.prdModeEnum;
6842 if ( ROK != rgSCHCfgVldtRgrTxmodePucchMode(cellCb, txMde,
6843 pucchMode, errInfo))
6845 DU_LOG("\nERROR --> SCH : Invalid Tx Mode-PUCCH Mode combination CRNTI:%d",crnti);
6850 /*2. Validate for PCQI Reporting Type and PUCCH Mode combination*/
6851 if((cqiCfg->cqiSetup.cqiRepType==1) &&
6852 ((pucchMode == RGR_PRD_CQI_MOD20) ||
6853 (pucchMode == RGR_PRD_CQI_MOD21)))
6855 DU_LOG("\nERROR --> SCH : Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6859 if((cqiCfg->cqiSetup.cqiRepType==2) &&
6860 ((pucchMode == RGR_PRD_CQI_MOD10) ||
6861 (pucchMode == RGR_PRD_CQI_MOD11)))
6863 DU_LOG("\nERROR --> SCH : Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6867 /*3. Validate CQI/PMI and RI Configuration related parameter values */
6868 /*TODO- To be compared with configured n2Pucch Index*/
6869 if (cqiCfg->cqiSetup.cqiPResIdx > RG_SCH_PUCCH_RES_MAX_SUPP )
6871 DU_LOG("\nERROR --> SCH : Not Supported or Invalid CQI-PUCCH resourceIndex=%d Cfg Val=%d CRNTI:%d",
6872 RG_SCH_PUCCH_RES_MAX_SUPP, cqiCfg->type,crnti);
6879 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6880 (cqiCfg->cqiSetup.cqiPCfgIdx < 7) ||
6881 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6883 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6884 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6885 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6891 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6892 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6894 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d "
6895 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6896 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6901 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6902 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6904 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6905 "Max Index Sup=%d Cfg Val=%d CRNTI;%d", RG_SCH_ICQI_MIN_SUPP,
6906 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6911 if((cqiCfg->cqiSetup.cqiRepType < RGR_UE_PCQI_WB_REP) ||
6912 (cqiCfg->cqiSetup.cqiRepType > RGR_UE_PCQI_SB_REP))
6914 DU_LOG("\nERROR --> SCH : Invalid Cfg CQI Report"
6915 "ModeCfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6919 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6920 ((cqiCfg->cqiSetup.k < RG_SCH_CQI_K_MIN) ||
6921 (cqiCfg->cqiSetup.k > RG_SCH_CQI_K_MAX)))
6923 DU_LOG("\nERROR --> SCH : Invalid CQI Cfg K Cfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6927 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6928 (cellCb->bwCfg.dlTotalBw <= 7))
6930 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI mode Cfg for dlTotalBw (%d) for CRNTI:%d",
6931 cellCb->bwCfg.dlTotalBw, crnti);
6936 if (cqiCfg->cqiSetup.cqiPCfgIdx == RG_SCH_ICQI_RESV_FDD )
6938 DU_LOG("\nERROR --> SCH : Reserved value Cfg =%d CRNTI:%d",
6939 cqiCfg->cqiSetup.cqiPResIdx,crnti);
6944 /* 4. Check RI Configuration values */
6945 if(cqiCfg->cqiSetup.riEna == TRUE)
6947 if(txMode.pres == TRUE)
6949 if((txMde != RGR_UE_TM_3)
6950 && (txMde != RGR_UE_TM_4)
6951 && (txMde != RGR_UE_TM_8)
6953 && (txMde != RGR_UE_TM_9)
6957 DU_LOG("\nERROR --> SCH : Invalid Transmission Mode =%d CRNTI:%d",
6963 if(cqiCfg->cqiSetup.riCfgIdx > RG_SCH_IRI_MAX_SUPP)
6965 DU_LOG("\nERROR --> SCH : Invalid Index RI value Cfg =%d CRNTI:%d",
6966 cqiCfg->cqiSetup.riCfgIdx,crnti);
6977 * @brief Validates the UE SRS Re/Configuation request from RRM to MAC.
6981 * Function : rgSCHCfgVldtRgrUeUlSrsCfg
6984 * - Validate the UE configuration request from RRC to MAC at CFG:
6985 * validate the value range for SRS values.
6986 * - If validated successfully,
6991 * @param[in] RgSchCellCb *cellCb,
6992 * @param[in] CmLteRnti crnti,
6993 * @param[in] RgrUeUlSrsCfg *srsCfg,
6994 * @param[out] RgSchErrInfo *errInfo
7000 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7002 RgSchCellCb *cellCb,
7004 RgrUeUlSrsCfg *srsCfg,
7006 RgSchErrInfo *errInfo
7009 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7011 RgSchCellCb *cellCb,
7013 RgrUeUlSrsCfg *srsCfg,
7014 RgSchErrInfo *errInfo
7019 uint16_t srsOffset=0;
7020 uint8_t srsSubframe=0;
7022 if ( RGR_SCH_SRS_SETUP == srsCfg->type )
7025 /*ccpu00130768 - ADD - if cell specific SRS is not configured*/
7026 if(cellCb->srsCfg.isSrsCfgPres == FALSE)
7028 DU_LOG("\nERROR --> SCH : Cell specific SRS is not configured CRNTI:%d",crnti);
7032 /* 1. Validate SRS Configuration related parameter values */
7033 /* 1.1 iSRS should be 0-636; Ref: 36.213. Table 8.2-1 */
7037 if ( (srsCfg->srsSetup.srsCfgIdx < 7) ||
7038 (srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP) )
7040 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg "
7041 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7042 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7043 srsCfg->srsSetup.srsCfgIdx,crnti);
7049 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7051 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7052 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7053 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7054 srsCfg->srsSetup.srsCfgIdx,crnti);
7060 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7062 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7063 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7064 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7065 srsCfg->srsSetup.srsCfgIdx,crnti);
7070 /* Compute SRS Offset and Periodicity */
7071 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7072 srsCfg->srsSetup.srsCfgIdx,
7073 &srsPeri, &srsOffset);
7075 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7076 srsCfg->srsSetup.srsCfgIdx,
7077 &srsPeri, &srsOffset);
7079 srsSubframe = srsOffset%RGSCH_NUM_SUB_FRAMES;
7081 if(rgSchTddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7083 if(rgSchFddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7085 DU_LOG("\nERROR --> SCH : UE specific SRS is not occuring in Cell specific SRS subframe"
7086 "srs Cfg Idx =%d CRNTI:%d",
7087 srsCfg->srsSetup.srsCfgIdx,crnti);
7092 if ( srsCfg->srsSetup.fDomPosi > RG_SCH_SRS_FREQDOM_POS_MAX )
7094 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7095 "SRS Min Freq Domain Position =%d"
7096 "Max Freq Domain Position =%d Cfg Val=%d CRNTI:%d",
7097 RG_SCH_SRS_FREQDOM_POS_MIN, RG_SCH_SRS_FREQDOM_POS_MAX,
7098 srsCfg->srsSetup.srsCfgIdx,crnti);
7102 if ( srsCfg->srsSetup.txComb > RG_SCH_SRS_TXCOMB_MAX )
7104 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7105 "SRS Min TX Comb =%d Max TX Comb =%d Cfg Val=%d CRNTI:%d",
7106 RG_SCH_SRS_TXCOMB_MIN, RG_SCH_SRS_TXCOMB_MAX,
7107 srsCfg->srsSetup.srsCfgIdx,crnti);
7115 * @brief Validates the UE SR Re/configuration request from RRM to MAC.
7119 * Function : rgSCHCfgVldtRgrUeSrCfg
7122 * - Validate the UE re/configuration request from RRC to MAC at CFG:
7123 * validate the value range for SR values.
7124 * - If validated successfully,
7129 * @param[in] RgSchCellCb *cellCb,
7130 * @param[in] CmLteRnti crnti,
7131 * @param[in] RgrUeSrCfg *srCfg,
7132 * @param[out] RgSchErrInfo *errInfo
7138 S16 rgSCHCfgVldtRgrUeSrCfg
7140 RgSchCellCb *cellCb,
7144 RgSchErrInfo *errInfo
7147 S16 rgSCHCfgVldtRgrUeSrCfg
7149 RgSchCellCb *cellCb,
7152 RgSchErrInfo *errInfo
7157 if ( RGR_SCH_SR_SETUP == srCfg->type )
7159 /* 1. Validate SR Configuration related parameter values */
7163 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7164 ( srCfg->srSetup.srCfgIdx < 5 ) ||
7165 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7167 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7168 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7169 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7176 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7177 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7179 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7180 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7181 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7187 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7188 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7190 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7191 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7192 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7203 * @brief Validates the UE Aperiodic & Periodic CQI, PMI, RI, SRS and SR Configuration
7204 * request from RRM to MAC.
7208 * Function :rgSCHCfgVldtCqiSrSrsUeCfg
7211 * - Validate the UE configuration request from RRC to MAC at CFG:
7212 * validate the value range for Aperiodic & Periodic CQI, PMI, RI , SRS and SR values.
7213 * - If validated successfully,
7218 * @param[in] RgSchCellCb *cellCb
7219 * @param[in] RgrUeCfg *ueCfg
7220 * @param[out] RgSchErrInfo *errInfo
7225 static S16 rgSCHCfgVldtCqiSrSrsUeCfg
7227 RgSchCellCb *cellCb,
7229 RgSchErrInfo *errInfo
7233 /* 1. Validate UE Aperiodic CQI related parameters */
7234 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueCfg->crnti,
7235 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ueCfg->txMode, errInfo ))
7237 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration CRNTI:%d",ueCfg->crnti);
7241 /* 1. Validate UE Periodic CQI/PMI, SRS and SR related parameters */
7243 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7244 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->isHdFddEnbld,
7245 ueCfg->txMode, errInfo ))
7247 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7248 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->txMode, errInfo ))
7251 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI configuration CRNTI:%d",ueCfg->crnti);
7255 /* 2. Validate SRS Configuration related parameter values */
7257 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti, &ueCfg->srsCfg,
7258 ueCfg->isHdFddEnbld, errInfo ))
7260 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti,
7261 &ueCfg->srsCfg, errInfo ))
7264 DU_LOG("\nERROR --> SCH : Invalid SRS configuration CRNTI:%d",ueCfg->crnti);
7268 /* 3. Validate SR Configuration related parameter values */
7270 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti, &ueCfg->srCfg,
7271 ueCfg->isHdFddEnbld, errInfo))
7273 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti,
7274 &ueCfg->srCfg, errInfo))
7277 DU_LOG("\nERROR --> SCH : Invalid SR configuration CRNTI:%d",ueCfg->crnti);
7287 /*****************************************************************
7288 * UE PCQI, RI, SRS and SR Re Configuration Validation Functions *
7290 ******************************************************************/
7292 * @brief Validates the UE Periodic CQI, PMI, RI, SRS and SR
7293 * Re-configuration request from RRM to MAC.
7297 * Function : rgSCHCfgVldtCqiSrSrsUeReCfg
7300 * - Validate the UE Re configuration request from RRC to MAC at CFG:
7301 * validate the value range for Periodic CQI, PMI, RI, SRS and SR values.
7302 * - If validated successfully,
7307 * @param[in] RgSchCellCb *cellCb
7308 * @param[in] RgSchUeCb *ueCb
7309 * @param[in] RgrUeCfg *ueCfg
7310 * @param[out] RgSchErrInfo *errInfo
7315 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg
7317 RgSchCellCb *cellCb,
7319 RgrUeRecfg *ueReCfg,
7320 RgSchErrInfo *errInfo
7323 RgrUeTxModeCfg txMode;
7326 txMode.tmTrnstnState = RGR_TXMODE_RECFG_CMPLT;
7327 if ((ueReCfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
7328 (ueReCfg->txMode.pres == TRUE))
7330 txMode.txModeEnum = ueReCfg->txMode.txModeEnum;
7334 txMode.txModeEnum = ueCb->mimoInfo.txMode;
7337 /* 1. Validate UE CQI/PMI, SRS and SR related parameters */
7339 if ( ueReCfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
7341 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueReCfg->oldCrnti,
7342 &ueReCfg->aprdDlCqiRecfg, txMode, errInfo ))
7344 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7350 /* 2. Validate UE CQI/PMI, SRS and SR related parameters */
7352 if ( ueReCfg->ueRecfgTypes & RGR_UE_PCQI_RECFG )
7355 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7356 &ueReCfg->cqiCfg, ueReCfg->isHdFddEnbld, txMode, errInfo ))
7358 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7359 &ueReCfg->cqiCfg, txMode, errInfo ))
7363 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7368 if(ueReCfg->ueRecfgTypes & RGR_UE_SRS_RECFG )
7371 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7372 &ueReCfg->srsCfg, ueReCfg->isHdFddEnbld, errInfo ))
7374 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7375 &ueReCfg->srsCfg, errInfo ))
7378 DU_LOG("\nERROR --> SCH : Invalid SRS configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7384 if ( ueReCfg->ueRecfgTypes & RGR_UE_SR_RECFG )
7387 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7388 &ueReCfg->srCfg, ueReCfg->isHdFddEnbld, errInfo))
7390 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7391 &ueReCfg->srCfg, errInfo))
7394 DU_LOG("\nERROR --> SCH : Invalid SR configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7403 /*****************************************************************
7404 * UE ACQI, PCQI, RI, SRS SR Configuration Functions *
7406 ******************************************************************/
7408 * @brief Handles Aperiodic CQI , PMI, RI configuration for a UE.
7412 * Function : rgSCHCfgACqiUeCfg
7414 * Invoking Module Processing:
7415 * - This shall be invoked by SCH_GOM at UE configuration. It
7416 * shall do the validations for the spec-defined values.
7422 * @param[in] RgSchCellCb *cell
7423 * @param[in] RgrTxMode txMode
7424 * @param[in] RgrUeAprdDlCqiCfg *aCqiCfg
7425 * @param[in] CmLteUeCategory ueCat
7430 S16 rgSCHCfgACqiUeCfg
7432 RgSchCellCb *cellCb,
7434 RgSchUeACqiCb *acqiCb,
7436 RgrUeAprdDlCqiCfg *aCqiCfg,
7437 CmLteUeCategory ueCat
7440 uint8_t M; /*Num of Subbands -- Applicable only for Mode 2-0 and 2-2*/
7441 uint8_t k; /*SubBand Size (RB) --
7442 Holds different values depending on Mode*/
7443 uint8_t cqiPmiSzR1; /*CQIPMI Size for Rank =1*/
7444 uint8_t cqiPmiSzRn1; /*CQIPMI Size for Rank > 1*/
7449 acqiCb->aCqiCfg.pres = aCqiCfg->pres;
7450 acqiCb->aCqiCfg.aprdModeEnum = aCqiCfg->aprdModeEnum;
7455 /*Store Trigger Set Bit String to UE */
7456 RgSchUeCellInfo *pCellInfo = RG_SCH_CMN_GET_PCELL_INFO(ue);
7457 pCellInfo->acqiCb.aCqiCfg.triggerSet1 = aCqiCfg->triggerSet1;
7458 pCellInfo->acqiCb.aCqiCfg.triggerSet2 = aCqiCfg->triggerSet2;
7462 switch(aCqiCfg->aprdModeEnum)
7464 case RGR_APRD_CQI_MOD12:
7465 case RGR_APRD_CQI_MOD30:
7466 case RGR_APRD_CQI_MOD31:
7467 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7468 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7472 case RGR_APRD_CQI_MOD20:
7473 case RGR_APRD_CQI_MOD22:
7474 RG_SCH_GET_SBCQI_M_K_VAL(cellCb->bwCfg.dlTotalBw, M, k);
7475 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7478 acqiCb->L = RgSCHUeAcqi2022LBitWidth[M-1][acqiCb->N-1];
7484 if((ueTxMode == RGR_UE_TM_3) ||
7485 (ueTxMode == RGR_UE_TM_4))
7487 if(cellCb->numTxAntPorts ==2)
7489 acqiCb->riNumBits = 1;
7491 else if(cellCb->numTxAntPorts ==4)
7493 if(ueCat == CM_LTE_UE_CAT_8)
7495 acqiCb->riNumBits = 3;
7497 else if(ueCat >= CM_LTE_UE_CAT_5)
7499 acqiCb->riNumBits = 2;
7503 acqiCb->riNumBits = 1;
7507 rgSCHCfgUtlFetchAcqiBitSz(acqiCb, cellCb->numTxAntPorts,
7508 &cqiPmiSzR1, &cqiPmiSzRn1);
7509 acqiCb->cqiPmiSzR1 = cqiPmiSzR1;
7510 acqiCb->cqiPmiSzRn1 = cqiPmiSzRn1;
7512 acqiCb->cqiReqField = TRUE;
7514 rgSchCmnSetCqiReqField(RG_SCH_CMN_GET_SCELL_INFO(ue, cellCb),ue,&acqiCb->cqiReqField);
7521 * @brief Handles Periodic CQI , PMI, RI configuration for a UE.
7525 * Function : rgSCHCfgPCqiUeCfg
7527 * Invoking Module Processing:
7528 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7529 * validations for the spec-defined values.
7532 * - For UE-specific Periodic CQI related configuration,
7533 * - If Periodic CQI/PMI is configured,
7534 * - Update UE with the configured values.
7535 - Compute and Update next occurance of CQI/PMI or RI Tranmission instance.
7536 - Update the CQI offset and CQI perodicity information
7537 - Add Ue to cell's list
7540 * - For UE-specific Periodic RI related configuration,
7541 * - If Periodic RI is configured,
7542 * - Update UE with the configured values.
7543 - Compute and Update next occurance of RI Tranmission instance.
7544 - Update the RI offset and RI perodicity information
7549 * @param[in] RgSchCellCb *cell
7550 * @param[in] RgSchUeCb *ue
7551 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7552 * @param[in] CmLteUeCategory ueCat
7557 S16 rgSCHCfgPCqiUeCfg
7559 RgSchCellCb *cellCb,
7561 RgrUePrdDlCqiCfg *cqiCfg,
7562 CmLteUeCategory ueCat
7565 CmLteTimingInfo timingInfo;
7567 uint16_t cqiTrInstTime;
7568 uint8_t j; /*Bandwidth Parts*/
7571 RgSchUePCqiCb *cqiCb = NULLP;
7573 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
7574 (cellCb->crntTime.slot);
7575 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7576 cqiCb->servCellInfo = ueCb->cellInfo[0];
7577 /* Periodic CQI is setup */
7578 if (cqiCfg->type == RGR_SCH_PCQI_SETUP)
7580 for(loop = 0; loop < MAX_CQI_RI_RPT_BUFF;loop++)
7582 ueCb->rawCqiBitW[loop].type = TFU_RECP_REQ_INVLD; /* setting invalid type*/
7584 /* 1. Copy the Received CQI Cfg parameters to ueCb */
7585 memcpy(&cqiCb->cqiCfg, cqiCfg,
7586 sizeof(RgrUePrdDlCqiCfg));
7588 /* 2. Compute Periodic CQI Periodicity and subframe offset */
7590 rgSCHUtlGetCfgPerOff(RG_SCH_FDD_PCQI_TBL, cqiCfg->cqiSetup.cqiPCfgIdx,
7591 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7593 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_PCQI_TBL,
7594 cqiCfg->cqiSetup.cqiPCfgIdx,
7595 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7597 DU_LOG("\nDEBUG --> SCH : rgSCHCfgPCqiUeCfg(): UEID:%d CQI Peri=%d, CQI Offset=%d",
7603 cqiTrInstTime = ((cqiCb->cqiPeri+crntTime) - cqiCb->cqiOffset)
7605 cqiCb->nCqiTrIdx = (crntTime +
7606 (cqiCb->cqiPeri - cqiTrInstTime));
7607 /* Introduced timing delta for reception req
7609 if(cqiCb->nCqiTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7611 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx + cqiCb->cqiPeri;
7614 /* To handle the SFN wrap around case */
7615 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx % (RGSCH_MAX_SFN * RGSCH_NUM_SUB_FRAMES_5G);
7617 timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
7618 timingInfo.slot = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
7620 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
7621 %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7624 /*CQI Repetition configuration*/
7627 rgSchfillPucchCqiRepNumCountemtc(cqiCb, ueCb);
7631 if(RGR_UE_PCQI_SB_REP == cqiCfg->cqiSetup.cqiRepType)
7633 uint8_t k; /*SubBand Size (RB) */
7634 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7635 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7636 cqiCb->J = j; /*Number of Bandwidth Parts*/
7637 /*h: reporting instances required for a complete CQI/PMI report */
7638 /*j:Number of bandwidth parts; k: Subband Size*/
7639 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7640 /* ccpu00140905- L-size is coming as 3 for 100Rbs where it should be 2*/
7641 temp = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, (j*k));
7642 cqiCb->label = (temp & (temp-1)) ?
7643 (1+ rgSCHUtlLog32bitNbase2(temp)) : rgSCHUtlLog32bitNbase2(temp);
7645 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ueCb, cqiCb);
7650 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
7654 /* Place the UE in cellCb->tIUeLstCp */
7655 cqiCb->cqiLstEnt.node=(PTR) cqiCb;
7657 cqiCb->isCqiIgnoByCollsn = FALSE;
7658 cqiCb->isRiIgnoByCollsn = FALSE;
7662 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
7666 /* 4. Rank Indicator Cfg handler */
7667 rgSCHCfgRiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
7671 cqiCb->cqiCfg.type = RGR_SCH_PCQI_REL;
7672 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
7674 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,\
7677 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
7679 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst, \
7681 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
7682 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7684 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
7685 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7686 cqiCb->riDist = RG_SCH_INVALID_IDX;
7688 ueCb->nPCqiCb = cqiCb;
7689 ueCb->nPRiCb = cqiCb;
7694 * @brief Handles Periodic RI configuration for a UE.
7698 * Function : rgSCHCfgRiUeCfg
7700 * Invoking Module Processing:
7701 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7702 * validations for the spec-defined values.
7705 * - For UE-specific Periodic RI related configuration,
7706 * - If Periodic RI is configured,
7707 * - Update UE with the configured values.
7708 - Compute and Update next occurance of RI Tranmission instance.
7709 - Update the RI offset and RI perodicity information
7713 * @param[in] RgSchCellCb *cell
7714 * @param[in] RgSchUeCb *ue
7715 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7716 * @param[in] CmLteUeCategory ueCat
7723 RgSchCellCb *cellCb,
7725 RgrUePrdDlCqiCfg *cqiCfg,
7726 CmLteUeCategory ueCat
7730 uint16_t riTrInsTime;
7731 uint8_t j; /*Bandwidth parts. Valid for Modes 2-0, 2-1*/
7732 uint16_t periodicity;
7734 RgSchUePCqiCb *cqiCb = NULLP;
7736 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7737 +(cellCb->crntTime.slot);
7738 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7739 /* 1. Rank Indicator is enabled */
7740 if(cqiCfg->cqiSetup.riEna)
7743 rgSCHUtlGetCfgPerOff(RG_SCH_RI_TBL,
7744 cqiCfg->cqiSetup.riCfgIdx,
7745 &cqiCb->riPeri, &cqiCb->riOffset);
7747 DU_LOG("\nDEBUG --> SCH : rgSCHCfgRiUeCfg(): RI Peri=%d, RI Offset=%d UEID:%d",
7748 cqiCb->riPeri, cqiCb->riOffset,ueCb->ueId);
7750 cqiCb->perRiVal = 1;
7751 cqiCb->invalidateCqi = FALSE;
7753 if(RGR_UE_PCQI_WB_REP == cqiCfg->cqiSetup.cqiRepType)
7756 1. wideband RI reporting is configured
7758 (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )Mod(NCqiperiod
7761 periodicity = cqiCb->cqiPeri * cqiCb->riPeri;
7766 * Where Widesband and Subband RI reporting is configured
7767 * (Mode 2-0 or 2-1 )
7768 * (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )
7769 * Mod(H. NCqiperiod *MriPeriod )=0
7770 * where H= J * K +1; J=Number of bandwidth parts(BW/subsize).
7771 * K is RGR interf input
7774 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7775 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7776 periodicity = cqiCb->h * cqiCb->cqiPeri *
7780 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
7781 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
7782 * accordingly. WBCQI handling is naturally accomplished */
7783 if (periodicity >= RGSCH_MAX_SUBFRM_5G)
7785 periodicity = cqiCb->cqiOffset - cqiCb->riOffset +
7786 RGSCH_MAX_SUBFRM_5G - (crntTime);
7787 tempIdx = crntTime + periodicity;
7788 DU_LOG("\nINFO --> SCH : CHECK_SID - periodicity %d tempIdx %d\n", periodicity, tempIdx);
7792 if ((crntTime + TFU_RECPREQ_DLDELTA + periodicity) >
7793 (RGSCH_MAX_SUBFRM_5G - 1))
7795 riTrInsTime = (periodicity - cqiCb->cqiOffset + cqiCb->riOffset) % periodicity;
7796 tempIdx = RGSCH_MAX_SUBFRM_5G + (periodicity - riTrInsTime);
7800 riTrInsTime = ((periodicity +crntTime )- \
7801 cqiCb->cqiOffset + cqiCb->riOffset)\
7803 tempIdx = (crntTime + (periodicity -riTrInsTime));
7806 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7808 tempIdx = tempIdx + periodicity;
7810 cqiCb->nRiTrIdx = tempIdx
7811 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7812 if(periodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
7814 cqiCb->riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
7815 (uint16_t) tempIdx);
7821 if(ueCb->mimoInfo.txMode == RGR_UE_TM_3
7822 || ueCb->mimoInfo.txMode == RGR_UE_TM_4)
7824 if (cellCb->numTxAntPorts ==2)
7826 cqiCb->riNumBits = 1;
7828 else if(cellCb->numTxAntPorts ==4)
7830 if(ueCat == CM_LTE_UE_CAT_8)
7832 cqiCb->riNumBits = 3;
7834 else if(ueCat >= CM_LTE_UE_CAT_5)
7836 cqiCb->riNumBits = 2;
7840 cqiCb->riNumBits = 1;
7844 /* Place the UE in cellCb->tIUeLstCp */
7845 cqiCb->riLstEnt.node=(PTR) cqiCb;
7847 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
7849 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_ADD,
7850 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7856 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7857 cqiCb->riDist = RG_SCH_INVALID_IDX;
7864 /* @brief Handles SRS configuration for a UE.
7868 * Function : rgSCHCfgSrsUeCfg
7870 * Invoking Module Processing:
7871 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7872 * validations for the spec-defined values.
7875 * - For UE-specific SRS related configuration,
7876 * - If SRS is configured,
7877 * - Update UE with the configured values.
7878 - Compute and Update next occurance of SRS Tranmission instance.
7879 - Update the SRS offset and SRS perodicity information
7880 - Add Ue to cell's srs list
7882 * - next occurance transmission instance of SRS = RG_SCH_INVALID_IDX
7886 * @param[in] RgSchCellCb *cell
7887 * @param[in] RgSchUeCb *ue
7888 * @param[in] RgrUeUlSrsCfg *srsCfg
7894 S16 rgSCHCfgSrsUeCfg
7896 RgSchCellCb *cellCb,
7898 RgrUeUlSrsCfg *srsCfg
7901 uint16_t srsTrInsTime;
7905 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7906 +(cellCb->crntTime.slot);
7908 if(RGR_SCH_SRS_SETUP == srsCfg->type)
7910 /* 1. Copy the Received Cfg parameters to local cb */
7911 memcpy(&ueCb->srsCb.srsCfg, srsCfg, sizeof(RgrUeUlSrsCfg));
7914 /* 2. Compute SRS Offset and Periodicity */
7915 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7916 srsCfg->srsSetup.srsCfgIdx,
7917 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
7919 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7920 srsCfg->srsSetup.srsCfgIdx,
7921 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
7924 DU_LOG("\nDEBUG --> SCH : rgSCHCfgSrsUeCfg(): SRS Peri=%d, SRS Offset=%d UEID:%d",
7925 ueCb->srsCb.peri,ueCb->srsCb.offset,ueCb->ueId);
7927 /* 3. Compute next Tranmission index for SRS */
7928 /* Referenence: 36.213 Section:8.2
7929 i. SRS transmission instances for TDD with period > 2 and for FDD are
7930 ((10*sfn +Ksrs-suframeoffset))/mod(periodicity))
7932 TDD: Ksrs Table 8.2-3:
7933 ii.The SRS transmission instances for TDD (periodicity == 2)
7934 (Ksrs-Toffset)mod(5)==0. Note: This is not supported now
7937 srsTrInsTime = ((ueCb->srsCb.peri+crntTime) - ueCb->srsCb.offset)
7939 tempIdx = (crntTime + (ueCb->srsCb.peri - srsTrInsTime));
7941 if (tempIdx <= (crntTime + TFU_DELTA))
7943 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7946 tempIdx = tempIdx + ueCb->srsCb.peri;
7948 ueCb->srsCb.nSrsTrIdx =(uint16_t) (tempIdx
7949 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE);
7950 if(ueCb->srsCb.peri >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
7953 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime+TFU_DELTA),
7956 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime + TFU_RECPREQ_DLDELTA),
7962 ueCb->srsCb.srsDist = 0;
7965 /*UE Tx Antenna Selection - START*/
7966 if(ueCb->ul.ulTxAntSel.pres == TRUE )
7968 /*for both partial and full sounding bandwidth,
7969 and when frequency hopping is disabled */
7970 ueCb->srsCb.selectedAnt = (crntTime/ueCb->srsCb.peri)%2;
7974 /* TS 36.213 specifies that if Tx Antenna Selection is
7975 disabled/not supported then its Port 0*/
7976 ueCb->srsCb.selectedAnt=0;
7978 ueCb->validTxAnt = ueCb->srsCb.selectedAnt;
7979 /*UE Tx Antenna Selection - ENDS*/
7981 ueCb->srsCb.srsLstEnt.node=(PTR)ueCb;
7982 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
7983 &ueCb->srsCb.srsLstEnt);
7989 /* SRS Release / Not configured */
7990 ueCb->srsCb.srsCfg.type = RGR_SCH_SRS_REL;
7991 if(ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
7993 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
7994 &ueCb->srsCb.srsLstEnt);
7996 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
7997 ueCb->srsCb.srsLstEnt.node =(PTR) NULLP;
8004 /* * @brief Handles SR configuration for a UE.
8008 * Function : rgSCHCfgSrUeCfg
8010 * Invoking Module Processing:
8011 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8012 * validations for the spec-defined values.
8014 * - If SR is configured,
8015 * - Update UE with the configured values.
8016 - Compute and Update next occurance of SR Tranmission instance.
8017 - Update the SR offset and SR perodicity information
8018 - Add Ue to cell->tIUeLstCp[n]
8020 * - next occurance transmission instance of SR = RG_INVALID_SR_ID
8025 * @param[in] RgSchCellCb *cell
8026 * @param[in] RgSchUeCb *ue
8027 * @param[in] RgrUeSrCfg *srCfg
8035 RgSchCellCb *cellCb,
8040 uint16_t srTrInsTime;
8044 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8045 +(cellCb->crntTime.slot);
8046 if(srCfg->type == RGR_SCH_SR_SETUP)
8048 /* 1. Copy the Received Cfg parameters to local cb */
8049 memcpy(&ueCb->srCb.srCfg, srCfg, sizeof(RgrUeSrCfg));
8052 /* 2. Compute SR periodicity and offset */
8053 rgSCHUtlGetCfgPerOff( RG_SCH_SR_TBL,
8054 srCfg->srSetup.srCfgIdx,
8055 &ueCb->srCb.peri, &ueCb->srCb.offset);
8057 DU_LOG("\nDEBUG --> SCH : SR Config: idx(%u), period (%u) offset (%u) UEID:%d",
8058 srCfg->srSetup.srCfgIdx,
8065 rgSchfillPucchSrRepNumCountemtc(ueCb);
8068 /* 3. Compute Next Transmission Instance */
8070 srTrInsTime = ((ueCb->srCb.peri+crntTime) - ueCb->srCb.offset)
8072 ueCb->srCb.nSrTrIdx = (crntTime + (ueCb->srCb.peri- srTrInsTime));
8074 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_DELTA))
8076 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8079 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx + ueCb->srCb.peri;
8081 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx
8082 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8083 ueCb->srCb.srLstEnt.node= (PTR) ueCb;
8085 /* 4. Place UE in Cell SR Tranmisison Instance List */
8086 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8087 &ueCb->srCb.srLstEnt);
8091 ueCb->srCb.srCfg.type = RGR_SCH_SR_REL;
8093 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8095 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8096 &ueCb->srCb.srLstEnt);
8098 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8099 ueCb->srCb.srLstEnt.node = (PTR)NULLP;
8106 /*****************************************************************
8107 * UE PCQI, RI, SRS and SR Re Configuration Functions *
8109 ******************************************************************/
8112 /* * @brief Handles Periodic CQI, PMI, RI Re-configuration for a UE.
8116 * Function : rgSCHCfgPCqiUeReCfg
8118 * Invoking Module Processing:
8119 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8120 * validations for the spec-defined values.
8123 * - For UE-specific Periodic CQI related configuration,
8124 * - If Periodic CQI/PMI is re configured(first time enabled),
8125 * - Update UE with the configured values.
8126 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8128 * - Update the CQI offset and CQI perodicity information
8129 * - Add Ue to cell's list
8130 * - If Periodic CQI/PMI is re configured(modify),
8131 * - Update UE with the configured values.
8132 * - Del Ue from cell->tIUeLstCp list
8133 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8135 * - Update the CQI offset and CQI perodicity information
8136 * - Add Ue to cell's list
8137 * - If Periodic CQI/PMI is re configured(disabled),
8138 * - Update UE with the configured values.
8139 * - Del Ue from cell's list
8140 * - Update next occurance of CQI/PMI or RI Tranmission instance.
8141 * - next occurance of CQI/PMI = RG_INVALID_CQIPMI_ID
8143 * - For UE-specific Periodic RI related configuration,
8144 * - If Periodic RI is configured(first time enabled),
8145 * - Update UE with the configured values.
8146 * - Compute and Update next occurance of RI Tranmission instance.
8147 * - Update the RI offset and RI perodicity information
8148 * - If Periodic RI is configured(modify),
8149 * - Update UE with the configured values.
8150 * - Compute and Update next occurance of RI Tranmission instance.
8151 * - Update the RI offset and RI perodicity information
8153 * - next occurance of RI = RG_INVALID_CQIPMI_ID
8157 * @param[in] RgSchCellCb *cell
8158 * @param[in] RgSchUeCb *ue
8159 * @param[in] RgrUeCfg *ueCfg
8165 S16 rgSCHCfgPCqiUeReCfg
8167 RgSchCellCb *cellCb,
8169 RgrUePrdDlCqiCfg *cqiCfg,
8170 CmLteUeCategory ueCat
8174 RgSchUePCqiCb *cqiCb = NULLP;
8176 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8177 /* Fix: ccpu00124008 Fix for incorrect check causing missed CQI reception instance */
8178 if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8179 (cqiCb->cqiCfg.type != RGR_SCH_PCQI_SETUP))
8181 /* 1. cqi is in Release (Disable) state, Recfg is allowing Setup (Enable)
8183 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8186 else if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8187 (cqiCb->cqiCfg.type == RGR_SCH_PCQI_SETUP ))
8191 2. Present is SETUP(Enable) state, Recfg is modifying SETUP(Enable)
8193 2.1 Delete UE from the cqiList
8194 2.2 Set next occurance Transmission instace to "INVALID"
8195 2.3 Compute Next occurance Transmission instace
8196 2.4 Placed ue in Transmission instance list.
8198 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX )
8199 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
8202 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX )
8204 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
8206 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
8207 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8211 cqiCb->cqiLstEnt.next = NULLP;
8212 cqiCb->cqiLstEnt.prev = NULLP;
8213 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8214 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8215 cqiCb->riDist = RG_SCH_INVALID_IDX;
8217 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8221 /* Present is SETUP(Enable) state, Recfg is Release(Disable) */
8222 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8225 /* ccpu00140578:: */
8226 cqiCb->riRecpPrcsd = FALSE;
8231 /* * @brief Handles SRS Re-configuration for a UE.
8235 * Function : rgSCHCfgSrsUeReCfg
8237 * Invoking Module Processing:
8238 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8239 * validations for the spec-defined values.
8242 * - For UE-specific SRS related re configuration,
8243 * - If SRS is configured modified(First time Enabled),
8244 * - Update UE with the configured values.
8245 * - Compute and Update next occurance of SRS Tranmission instance.
8246 * - Update the SRS offset and SRS perodicity information
8247 * - Add Ue to cell's list
8248 * - If SRS is configured modified(Changed offset or index ),
8249 * - Delete UE from cell->tIUeLstCp[n] if present
8250 * - Update UE with the configured values.
8251 * - Compute and Update next occurance of SRS Tranmission instance.
8252 * - Update the SRS offset and SRS perodicity information
8253 * - Add Ue to cell's list
8254 * - If SRS is configured modified(disabled),
8255 * - Delete UE from cell->tIUeLstCp[n] if present
8256 * - Update next occurance of SRS Tranmission instance to "INVALID".
8257 * - Update the SRS offset and SRS perodicity information "INVALID"
8263 * @param[in] RgSchCellCb *cell
8264 * @param[in] RgSchUeCb *ue
8265 * @param[in] RgrUeUlSrsCfg *srsCfg
8271 S16 rgSCHCfgSrsUeReCfg
8273 RgSchCellCb *cellCb,
8275 RgrUeUlSrsCfg *srsCfg
8280 if(( RGR_SCH_SRS_SETUP == srsCfg->type) ||
8281 ( RGR_SCH_SRS_SETUP != ueCb->srsCb.srsCfg.type ))
8283 /* 1. Present is Release(Disable) state, Recfg is allowing
8285 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8287 else if (( RGR_SCH_SRS_SETUP == srsCfg->type ) &&
8288 ( RGR_SCH_SRS_SETUP == ueCb->srsCb.srsCfg.type))
8291 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8293 2.1 Delete UE from the cqiList
8294 2.2 Set next occurance Transmission instance to "INVALID"
8295 2.3 Compute Next occurance Transmission instance
8296 2.4 Placed ue in Transmission instance list.
8298 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8300 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8301 &ueCb->srsCb.srsLstEnt);
8302 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8305 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8309 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable)*/
8310 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8312 /* ccpu00140578:: */
8313 ueCb->srsCb.srsRecpPrcsd = FALSE;
8318 /* @brief Handles SR Re-configuration for a UE.
8322 * Function : rgSCHCfgSrUeReCfg
8324 * Invoking Module Processing:
8325 * - This shall be invoked by SCH_GOM at UE Re configuration.
8326 * It shall do the validations for the spec-defined values.
8329 * - For UE-specific SR related re configuration,
8330 * - If SR is configured modified(First time Enabled),
8331 * - Update UE with the configured values.
8332 * - Compute and Update next occurance of SR Tranmission instance.
8333 * - Update the SR offset and SR perodicity information
8334 * - Add Ue to cell->tIUeLstCp[n]
8335 * - If SR is configured modified(Changed offset or index ),
8336 * - Delete UE from cell->tIUeLstCp[n] if present
8337 * - Update UE with the configured values.
8338 * - Compute and Update next occurance of SR Tranmission instance.
8339 * - Update the SR offset and SR perodicity information
8340 * - Add Ue to cell->tIUeLstCp[n]
8341 * - If SR is configured modified(disabled),
8342 * - Delete UE from cell->tIUeLstCp[n] if present
8343 * - Update next occurance of SR Tranmission instance to "INVALID".
8344 * - Update the SR offset and SR perodicity information "INVALID"
8352 * @param[in] RgSchCellCb *cell
8353 * @param[in] RgSchUeCb *ue
8354 * @param[in] RgrUeCfg *ueCfg
8360 S16 rgSCHCfgSrUeReCfg
8362 RgSchCellCb *cellCb,
8368 /* Fix : syed Incorrect check for SR RECFG */
8369 if((srCfg->type == RGR_SCH_SR_SETUP) &&
8370 (ueCb->srCb.srCfg.type != RGR_SCH_SR_SETUP))
8373 1. Present is Release(Disable) state, Recfg is allowing SETUP(Enable)
8375 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8377 else if((srCfg->type == RGR_SCH_SR_SETUP) &&
8378 (ueCb->srCb.srCfg.type == RGR_SCH_SR_SETUP))
8381 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8383 2.1 Delete UE from the cqiList
8384 2.2 Compute Next occurance Transmission instace
8386 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX )
8388 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8389 &ueCb->srCb.srLstEnt);
8390 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8392 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8397 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable) */
8398 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8404 /* @brief Handles ACQI Re-configuration for a UE.
8408 * Function : rgSCHCfgAcqiUeReCfg
8410 * Invoking Module Processing:
8411 * - This shall be invoked by SCH_GOM at UE Re configuration.
8412 * It shall do the validations for the spec-defined values.
8415 * - For UE-specific ACQI related re configuration,
8416 * - Check if the ACQI Mode has been changed from the
8417 * existing Configuration.
8418 * - If the configuration has been changed,
8419 * - Call Aperiodic Config function to change the config
8426 * @param[in] RgSchCellCb *cell
8427 * @param[in] RgSchUeCb *ue
8428 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg
8434 S16 rgSCHCfgAcqiUeReCfg
8436 RgSchCellCb *cellCb,
8438 RgrUeAprdDlCqiCfg *acqiCfg,
8439 CmLteUeCategory ueCat
8443 return (rgSCHCfgACqiUeCfg(cellCb,ueCb,(RG_SCH_CMN_GET_ACQICB(ueCb,cellCb))
8444 ,ueCb->mimoInfo.txMode, acqiCfg, ueCat));
8448 /*****************************************************************
8449 * UE PCQI, RI, SRS and SR Configuration Delete *
8451 *****************************************************************/
8453 /* @brief Free Periodic CQI/PMI/RI, SRS and SR transmission instance
8454 * related data structures of this UE from CellCb
8458 * Function : rgSCHCfgPCqiSrsSrUeDel
8460 * Invoking Module Processing:
8461 * - This shall be invoked by SCH_GOM at Ue deletion.
8464 * - For SRS Transmission Instance
8465 * - if (srsTxInst!= RG_INVALID)
8466 * - Remove from the cellCb->tIUeLstCp[srsTxInst*3+2]
8469 * - For SR Transmission Instance
8470 * - if (srTxInst!= RG_INVALID)
8471 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+1]
8474 * - For Periodic CQI/PMI RI Transmission Instance
8475 * - if (pCqiTxInst!= RG_INVALID)
8476 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+0]
8480 * @param[in] RgSchCellCb *cell
8481 * @param[in] RgSchUeCb *ue
8486 S16 rgSCHCfgPCqiSrsSrUeDel
8488 RgSchCellCb *cellCb,
8494 uint32_t sCellCnt = 0;
8496 RgSchUePCqiCb *cqiRiCb = NULLP;
8498 cqiRiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8502 /* Delete SRS Transmission Instance */
8503 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8505 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8506 &ueCb->srsCb.srsLstEnt);
8507 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8510 /* Delete SR Transmission Instance */
8511 if (ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8513 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8514 &ueCb->srCb.srLstEnt);
8515 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8518 /* Delete Periodic CQI/PMI Transmission Instance */
8519 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8521 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8522 &cqiRiCb->cqiLstEnt);
8523 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8525 /* Delete Periodic RI Transmission Instance */
8527 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8529 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8530 &cqiRiCb->riLstEnt);
8531 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8532 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8533 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8538 for (cellIdx =1; cellIdx <= RG_SCH_MAX_SCELL; cellIdx++)
8540 /* If a serving cell is configured */
8541 if(ueCb->cellInfo[cellIdx] != NULLP)
8543 /* If the serving cell is in ACTIVE state and
8544 If it is not the same serving cell as cqiRiCb for which
8545 collision is being checked */
8546 cqiRiCb = &ueCb->cellInfo[cellIdx]->cqiCb;
8547 /* Delete Periodic CQI/PMI Transmission Instance */
8548 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8550 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8551 &cqiRiCb->cqiLstEnt);
8552 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8554 /* Delete Periodic RI Transmission Instance */
8556 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8558 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8559 &cqiRiCb->riLstEnt);
8560 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8561 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8562 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8566 /* If all of the num of configured scells are checked then break */
8567 if (sCellCnt == ueCb->numSCells)
8579 /* @brief Search the cfgIdx in given table and retrive periodicity & offset
8582 * Function : rgSCHUtlGetCfgPerOff
8584 * Invoking Module Processing:
8585 * - This shall be invoked by Cfg Module
8588 * binary search for given entry in table
8589 * find the periodicty, offset for a given config index from the table
8591 * @param[in] RgSchPerTbl tbl
8592 * @param[in] uint16_t cfgIdx
8593 * @param[out] uint16_t *peri
8594 * @param[out] uint16_t *offset
8600 S16 rgSCHUtlGetCfgPerOff
8611 const RgSchUePCqiSrsSrCfgIdxTbl* table;
8613 /* Added the function instead of the MACRO to get the
8614 * periodicity table */
8615 table = rgSCHCfgUtlGetPcqiSrsSrRiTbl ( tbl,&min,&max );
8618 if (( cfgIdx >= table[mid].min) &&
8619 ( cfgIdx <= table[mid].max))
8621 *peri = table[mid].peri;
8622 *offset = cfgIdx - table[mid].offset;
8626 if ( cfgIdx > table[mid].min)
8635 }while( min <= max );
8641 /***********************************************************
8643 * Func : rgSCHCfgUtlFetchAcqiBitSz
8646 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
8656 **********************************************************/
8657 static Void rgSCHCfgUtlFetchAcqiBitSz
8659 RgSchUeACqiCb *acqiCb,
8661 uint8_t* cqiPmiSzR1,
8662 uint8_t* cqiPmiSzRn1
8666 uint32_t confRepMode;
8668 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
8671 case RGR_APRD_CQI_MOD12:
8675 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8676 *cqiPmiSzRn1 = 8+ acqiCb->N;
8678 else if(numTxAnt == 4)
8680 *cqiPmiSzR1 = 4 + 4*acqiCb->N;
8681 *cqiPmiSzRn1 = 8 + 4*acqiCb->N;
8686 case RGR_APRD_CQI_MOD20:
8688 *cqiPmiSzR1 = 6 + acqiCb->L;
8689 *cqiPmiSzRn1 = 6 + acqiCb->L;
8693 case RGR_APRD_CQI_MOD22:
8697 *cqiPmiSzR1 = 10 + acqiCb->L;
8698 *cqiPmiSzRn1 = 14 + acqiCb->L;
8700 else if(numTxAnt == 4)
8702 *cqiPmiSzR1 = 14 + acqiCb->L;
8703 *cqiPmiSzRn1 = 20 + acqiCb->L;
8708 case RGR_APRD_CQI_MOD30:
8710 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8711 *cqiPmiSzRn1 = 4 + 2*acqiCb->N;
8715 case RGR_APRD_CQI_MOD31:
8719 *cqiPmiSzR1 = 6 + 2*acqiCb->N;
8720 *cqiPmiSzRn1 = 9 + 4*acqiCb->N;
8722 else if(numTxAnt == 4)
8724 *cqiPmiSzR1 = 8 + 2*acqiCb->N;
8725 *cqiPmiSzRn1 = 12 + 4*acqiCb->N;
8734 /* Added the function rgSCHCfgUtlGetPcqiCrsSrRiTbl to be used
8735 * instead of the MACRO RG_SCH_GET_PERIODICITY_TBL */
8736 /***********************************************************
8738 * Func : rgSCHCfgUtlGetPcqiCrsSrRiTbl
8741 * Desc : Get the Srs Cqi Crs Ri Table
8750 **********************************************************/
8752 static const RgSchUePCqiSrsSrCfgIdxTbl * rgSCHCfgUtlGetPcqiSrsSrRiTbl
8754 RgSchPerTbl tblType,
8759 const RgSchUePCqiSrsSrCfgIdxTbl * table;
8764 case RG_SCH_FDD_PCQI_TBL:
8766 table = rgSchUePCqiCfgIdxFddTbl;
8768 * max=RG_SCH_CQIPMI_CFGIDX_MAX_FDD;
8771 case RG_SCH_TDD_PCQI_TBL:
8773 table = rgSchUeCqiPmiCfgIdxTddTbl;
8775 * max=RG_SCH_CQIPMI_CFGIDX_MAX_TDD;
8780 table = rgSchUeRiCfgIdxTbl;
8782 * max=RG_SCH_RI_CFGIDX_MAX;
8785 case RG_SCH_FDD_SRS_TBL:
8787 table = rgSchUeSrsCfgIdxFddTbl;
8789 * max=RG_SCH_SRS_ISRS_INDX_MAX_FDD;
8792 case RG_SCH_TDD_SRS_TBL:
8794 table = rgSchUeSrsCfgIdxTddTbl;
8796 * max=RG_SCH_SRS_ISRS_INDX_MAX_TDD;
8801 table = rgSchUeSrCfgIdxTbl;
8803 * max=RG_SCH_ISR_INDX_MAX;
8808 table = (const RgSchUePCqiSrsSrCfgIdxTbl *) 0;
8818 #endif /* TFU_UPGRADE */
8820 /***********************************************************
8822 * Func : rgSCHCfgVldtDrxUeCfg
8825 * Desc : Validates UE DRX Timers Configuration recieved from RRC.
8835 **********************************************************/
8836 static S16 rgSCHCfgVldtDrxUeCfg
8839 RgrUeDrxCfg *ueDrxCfg
8843 if (ueDrxCfg->isDrxEnabled == FALSE)
8849 if ( ueDrxCfg->cqiMask.pres )
8851 if ( ueDrxCfg->cqiMask.val != RGR_DRX_SETUP )
8854 DU_LOG("\nERROR --> SCH : Invalid cqiMask configuration (%d)",
8855 ueDrxCfg->cqiMask.val);
8857 DU_LOG("\nERROR --> SCH : Invalid cqiMask configuration(%ld)",
8858 ueDrxCfg->cqiMask.val);
8863 #endif /*LTEMAC_R9*/
8865 if(ueDrxCfg->isEmtcUe)
8867 if(ueDrxCfg->drxOnDurTmrR13Pres)
8869 if ( rgSCHEmtcCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8871 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d)",
8872 ueDrxCfg->drxOnDurTmr);
8878 if (rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8880 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d) for EMTC",
8881 ueDrxCfg->drxOnDurTmr);
8890 if ( rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8892 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d) for EMTC",
8893 ueDrxCfg->drxOnDurTmr);
8898 if ( rgSCHCfgVldtDrxInActvCfg(ueDrxCfg->drxInactvTmr) != ROK )
8900 DU_LOG("\nERROR --> SCH : Invalid Inactivity configuration(%d)",
8901 ueDrxCfg->drxInactvTmr);
8905 if(ueDrxCfg->isEmtcUe)
8907 if(ueDrxCfg->drxRetxTmrR13Pres)
8909 if ( rgSCHEmtcCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8911 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d) for EMTC",
8912 ueDrxCfg->drxRetxTmr);
8918 if (rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8920 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d)",
8921 ueDrxCfg->drxRetxTmr);
8930 if ( rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8932 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d)",
8933 ueDrxCfg->drxRetxTmr);
8938 if(ueDrxCfg->isEmtcUe)
8940 if ( rgSCHEmtcCfgVldtDrxUlReTxCfg(ueDrxCfg->emtcDrxUlRetxTmr) != ROK )
8942 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d) for EMTC",
8943 ueDrxCfg->drxRetxTmr);
8950 if ( rgSCHCfgVldtDrxLngCycCfg(ueDrxCfg->drxLongCycleOffst) != ROK )
8952 DU_LOG("\nERROR --> SCH : Invalid LongCycle configuration");
8956 if ( ueDrxCfg->drxLongCycleOffst.longDrxCycle < ueDrxCfg->drxOnDurTmr )
8958 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
8959 " and onDuration timer values");
8964 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxLongCycleOffst.longDrxCycle,
8965 ueDrxCfg->drxOnDurTmr, ueDrxCfg->drxLongCycleOffst.drxStartOffst) != ROK)
8967 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
8968 " and onDuration timer values");
8973 if( TRUE == ueDrxCfg->drxShortDrx.pres )
8975 if ( ueDrxCfg->drxShortDrx.shortDrxCycle < ueDrxCfg->drxOnDurTmr )
8977 DU_LOG("\nERROR --> SCH : Invalid combination of short DRX "
8978 "Cycle and onDuration timer values");
8982 if ( (ueDrxCfg->drxLongCycleOffst.longDrxCycle %
8983 ueDrxCfg->drxShortDrx.shortDrxCycle) != 0)
8985 DU_LOG("\nERROR --> SCH : Long DRX cycle is not multiple of "
8990 if ( rgSCHCfgVldtDrxShrtCycCfg(ueDrxCfg->drxShortDrx) != ROK )
8992 DU_LOG("\nERROR --> SCH : Invalid Short Cycle configuration");
8997 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxShortDrx.shortDrxCycle,
8998 ueDrxCfg->drxOnDurTmr,
8999 ueDrxCfg->drxLongCycleOffst.drxStartOffst %
9000 ueDrxCfg->drxShortDrx.shortDrxCycle) != ROK)
9002 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
9003 " and onDuration timer values");
9010 }/*rgSCHCfgVldtDrxUeCfg*/
9012 /***********************************************************
9014 * Func : rgSCHCfgVldtDrxOnDurCfg
9017 * Desc : Validates UE DRX On Duration configuration
9018 * recieved from RRC.
9028 **********************************************************/
9029 static S16 rgSCHCfgVldtDrxOnDurCfg
9037 case RGR_DRX_PRD_1PSF:
9038 case RGR_DRX_PRD_2PSF:
9039 case RGR_DRX_PRD_3PSF:
9040 case RGR_DRX_PRD_4PSF:
9041 case RGR_DRX_PRD_5PSF:
9042 case RGR_DRX_PRD_6PSF:
9043 case RGR_DRX_PRD_8PSF:
9044 case RGR_DRX_PRD_10PSF:
9045 case RGR_DRX_PRD_20PSF:
9046 case RGR_DRX_PRD_30PSF:
9047 case RGR_DRX_PRD_40PSF:
9048 case RGR_DRX_PRD_50PSF:
9049 case RGR_DRX_PRD_60PSF:
9050 case RGR_DRX_PRD_80PSF:
9051 case RGR_DRX_PRD_100PSF:
9052 case RGR_DRX_PRD_200PSF:
9059 }/*switch(onDurTmr)*/
9062 }/*rgSCHCfgVldtOnDurCfg*/
9064 /***********************************************************
9066 * Func : rgSCHCfgVldtDrxInActvCfg
9069 * Desc : Validates UE DRX InActivity configuration
9070 * recieved from RRC.
9080 **********************************************************/
9081 static S16 rgSCHCfgVldtDrxInActvCfg(uint16_t inActvTmr)
9083 switch ( inActvTmr )
9085 case RGR_DRX_PRD_1PSF:
9086 case RGR_DRX_PRD_2PSF:
9087 case RGR_DRX_PRD_3PSF:
9088 case RGR_DRX_PRD_4PSF:
9089 case RGR_DRX_PRD_5PSF:
9090 case RGR_DRX_PRD_6PSF:
9091 case RGR_DRX_PRD_8PSF:
9092 case RGR_DRX_PRD_10PSF:
9093 case RGR_DRX_PRD_20PSF:
9094 case RGR_DRX_PRD_30PSF:
9095 case RGR_DRX_PRD_40PSF:
9096 case RGR_DRX_PRD_50PSF:
9097 case RGR_DRX_PRD_60PSF:
9098 case RGR_DRX_PRD_80PSF:
9099 case RGR_DRX_PRD_100PSF:
9100 case RGR_DRX_PRD_200PSF:
9101 case RGR_DRX_PRD_300PSF:
9102 case RGR_DRX_PRD_500PSF:
9103 case RGR_DRX_PRD_750PSF:
9104 case RGR_DRX_PRD_1280PSF:
9105 case RGR_DRX_PRD_1920PSF:
9106 case RGR_DRX_PRD_2560PSF:
9113 }/*switch(InactvTmr)*/
9116 }/*rgSCHCfgVldtDrxInActvCfg*/
9118 /***********************************************************
9120 * Func : rgSCHCfgVldtDrxReTxCfg
9123 * Desc : Validates DRX ReTx timer configuration
9124 * recieved from RRC.
9134 **********************************************************/
9135 static S16 rgSCHCfgVldtDrxReTxCfg(uint8_t reTxTmr)
9139 case RGR_DRX_PRD_1PSF:
9140 case RGR_DRX_PRD_2PSF:
9141 case RGR_DRX_PRD_4PSF:
9142 case RGR_DRX_PRD_6PSF:
9143 case RGR_DRX_PRD_8PSF:
9144 case RGR_DRX_PRD_16PSF:
9145 case RGR_DRX_PRD_24PSF:
9146 case RGR_DRX_PRD_33PSF:
9153 }/*switch(drxRetxTmr)*/
9156 }/*rgSCHCfgVldtDrxReTxCfg*/
9158 /***********************************************************
9160 * Func : rgSCHCfgVldtDrxShrtCycCfg
9163 * Desc : Validates DRX Short Cycle timer configuration
9164 * recieved from RRC.
9175 **********************************************************/
9176 static S16 rgSCHCfgVldtDrxLngCycCfg(RgrDrxLongCycleOffst lngCycleOffst)
9178 if ( rgSCHCfgVldtDrxLngCyclTmrs(lngCycleOffst.longDrxCycle) != ROK )
9183 if ( lngCycleOffst.drxStartOffst >= lngCycleOffst.longDrxCycle )
9189 }/*rgSCHCfgVldtDrxLngCycCfg*/
9191 /***********************************************************
9193 * Func : rgSCHCfgVldtDrxLngCyclTmrs
9196 * Desc : Validates DRX Long Cycle timer values
9197 * recieved from RRC.
9208 **********************************************************/
9209 static S16 rgSCHCfgVldtDrxLngCyclTmrs(uint16_t val)
9214 case RGR_DRX_PRD_10SF:
9215 case RGR_DRX_PRD_20SF:
9216 case RGR_DRX_PRD_32SF:
9217 case RGR_DRX_PRD_40SF:
9218 case RGR_DRX_PRD_64SF:
9219 case RGR_DRX_PRD_80SF:
9220 case RGR_DRX_PRD_128SF:
9221 case RGR_DRX_PRD_160SF:
9222 case RGR_DRX_PRD_256SF:
9223 case RGR_DRX_PRD_320SF:
9224 case RGR_DRX_PRD_512SF:
9225 case RGR_DRX_PRD_640SF:
9226 case RGR_DRX_PRD_1024SF:
9227 case RGR_DRX_PRD_1280SF:
9228 case RGR_DRX_PRD_2048SF:
9229 case RGR_DRX_PRD_2560SF:
9236 }/*switch(longDrxCycle)*/
9239 }/*rgSCHCfgVldtDrxLngCyclTmrs*/
9241 /***********************************************************
9243 * Func : rgSCHCfgVldtDrxShrtCycCfg
9246 * Desc : Validates DRX Short Cycle timer configuration
9247 * recieved from RRC.
9258 **********************************************************/
9259 static S16 rgSCHCfgVldtDrxShrtCycCfg(RgrDrxShortDrx shrtCycCfg )
9261 switch(shrtCycCfg.shortDrxCycle)
9263 case RGR_DRX_PRD_2SF:
9264 case RGR_DRX_PRD_5SF:
9265 case RGR_DRX_PRD_8SF:
9266 case RGR_DRX_PRD_10SF:
9267 case RGR_DRX_PRD_16SF:
9268 case RGR_DRX_PRD_20SF:
9269 case RGR_DRX_PRD_32SF:
9270 case RGR_DRX_PRD_40SF:
9271 case RGR_DRX_PRD_64SF:
9272 case RGR_DRX_PRD_80SF:
9273 case RGR_DRX_PRD_128SF:
9274 case RGR_DRX_PRD_160SF:
9275 case RGR_DRX_PRD_256SF:
9276 case RGR_DRX_PRD_320SF:
9277 case RGR_DRX_PRD_640SF:
9285 }/*switch(shortDrxCycle)*/
9287 if ( (shrtCycCfg.drxShortCycleTmr < RGR_DRX_SHRTCYCLE_MIN) ||
9288 (shrtCycCfg.drxShortCycleTmr > RGR_DRX_SHRTCYCLE_MAX)
9298 * @brief Handler for TA related UE Reconfiguration.
9302 * Function : rgSCHCfgUeTaRecfg
9304 * This function shall fetch the TA timer related information into the
9305 * respective ueCb from the UE configuration as provided by the
9308 * @param[in] RgSchCellCb *cell
9309 * @param[in] RgSchUeCb *ueCb
9310 * @param[in] RgrUeCfg *ueCfg
9311 * @param[out] RgSchErrInfo *errInfo
9316 static Void rgSCHCfgUeTaRecfg
9326 /* Update the TA related information */
9328 if (ueCfg->ueTaTmrRecfg.pres)
9330 /* Configuring taTmr with 30 deficit, to enable eNodeB sending
9331 * TA command before the expiry of TA at UE. Also considering for
9332 * possible retx for this TA command */
9333 /* [ccpu00121813]-ADD-Added chk if tatmr val > 30 */
9334 if(ueCfg->ueTaTmrRecfg.taTmr > 30)
9336 ueCb->dl.taCb.cfgTaTmr = ueCfg->ueTaTmrRecfg.taTmr - 30;
9338 /* If TA Timer is running. Stop it and then start it*/
9339 if (ueCb->taTmr.tmrEvnt != TMR_NONE)
9341 rgSCHTmrStopTmr(cell, ueCb->taTmr.tmrEvnt, ueCb);
9342 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9346 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9350 } /* rgSCHCfgUeTaRecfg */
9352 /* ccpu00117452 - MOD - Changed macro name from
9353 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
9354 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
9355 /***********************************************************
9357 * Func : rgSCHCfgUeCqiReptReCfg
9360 * Desc : Reconfiguration of PUSH N CQI Reporting
9362 * Ret : RFAILED in case of failure
9369 **********************************************************/
9370 static S16 rgSCHCfgUeCqiReptReCfg
9379 /* Check has it been disabled */
9380 if(ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9382 /* Check if we need to send CQI reports collagted so far and send if so */
9383 if(ue->schCqiInfo.cqiCount >=
9384 ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9386 RgrStaIndInfo *staInfo;
9387 /* if yes, Send StaInd to RRM */
9388 retVal = rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&staInfo,
9389 sizeof(RgrStaIndInfo));
9392 DU_LOG("\nERROR --> SCH : Could not allocate memory for sending StaInd OLD CRNTI:%d",ueRecfg->oldCrnti);
9396 /* Fill StaInd for sending collated N CQI rpeort */
9397 rgSCHUtlFillSndStaInd(cell, ue, staInfo,
9398 ueRecfg->ueCqiReptCfg.numColltdCqiRept);
9403 ue->schCqiInfo.cqiCount = 0;
9406 ue->cqiReptCfgInfo.numColltdCqiRept =
9407 ueRecfg->ueCqiReptCfg.numColltdCqiRept;
9409 } /* End of rgSCHCfgUeCqiReptReCfg */
9410 #endif /* End of RGR_CQI_REPT */
9411 /*This function Added Ue in ongoing L2 Meas*/
9412 /*LTE_L2_MEAS_PHASE2*/
9414 static S16 rgSchAddToL2Meas(RgSchCellCb *cellCb,RgSchDlLcCb *dlLc)
9418 RgSchL2MeasCb *measCb = NULLP;
9419 lnk = cellCb->l2mList.first;
9423 /* Get the MeasCb : RgSchL2MeasCb */
9424 measCb = (RgSchL2MeasCb *)lnk->node;
9425 if (measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
9427 for(idx = 0;idx < measCb->measReq.avgPrbQciDl.numQci;idx++)
9429 if(measCb->measReq.avgPrbQciDl.qci[idx] == dlLc->qciCb->qci)
9431 break; /*exit from for loop*/
9434 if(idx == measCb->measReq.avgPrbQciDl.numQci)
9436 measCb->measReq.avgPrbQciDl.qci[measCb->measReq.avgPrbQciDl.numQci++] = dlLc->qciCb->qci;
9440 }/*End of while loop*/
9447 * @brief UE SCell Buffer Free
9451 * Function : rgSCHSCellFreeBuf
9453 * This functions will free allocated memory
9454 * for UE secondart cellCB
9457 * @param[in] Inst inst
9458 * @param[in] RgSchUeCb *ue
9459 * @param[int] RgrUeRecfg *ueRecfg
9460 * @param[out] uint8_t idx
9463 Void rgSCHSCellFreeBuf
9467 RgrUeRecfg *ueRecfg,
9471 RgSchUeCellInfo *sCellInfo = NULLP;
9472 RgrUeSecCellCfg *sCellInfoRecfg = NULLP;
9475 for(uint8_t i = 0; i <= idx; i++)
9477 sCellInfoRecfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[i];
9478 sCellInfo = ue->cellInfo[(sCellInfoRecfg->sCellIdx)];
9480 if (NULLP != sCellInfo)
9482 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
9483 sizeof(RgSchUeCellInfo));
9484 ue->cellInfo[(sCellInfoRecfg->sCellIdx)] = NULLP;
9491 /**********************************************************************
9494 **********************************************************************/