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.
36 /* header include files -- defines (.h) */
37 #include "common_def.h"
43 #include "rg_sch_inf.h"
45 #include "rg_sch_err.h"
46 #include "rg_sch_cmn.h"
48 /* header/extern include files (.x) */
49 #include "tfu.x" /* TFU types */
50 #include "lrg.x" /* layer management typedefs for MAC */
51 #include "rgr.x" /* layer management typedefs for MAC */
52 #include "rgm.x" /* layer management typedefs for MAC */
53 #include "rg_sch_inf.x" /* typedefs for MAC */
54 #include "rg_sch.x" /* typedefs for MAC */
55 /* [ccpu00124018]-MOD- Retrieving CQI value from cell config*/
56 #include "rg_sch_cmn.x"
57 #include "rg_sch_clist.x"
60 /* LTE-MAC Scheduler instance control block structures */
61 RgSchCb rgSchCb[RGSCH_MAX_INST];
63 #ifdef PHY_ERROR_LOGING
64 RgSchUlAllocCntr rgSchUlAllocCntr;
68 Void rgSCHEmtcPOTrigger ARGS ((
73 S16 rgSchEmtcUpdSiCfg ARGS ((
75 RgrCellRecfg *cellRecfg
78 S16 rgSCHEmtcCfgVldtDrxReTxCfg ARGS((
82 S16 rgSCHEmtcCfgVldtDrxUlReTxCfg ARGS((
87 S16 rgSCHEnbPfsDlCfg ARGS((
92 static S16 rgSCHCfgRgrUeRecfgRntiChg ARGS (( RgSchCellCb *cell,
93 RgSchUeCb *ue, RgrUeRecfg *ueRecfg, RgSchErrInfo *errInfo));
94 static S16 rgSCHCfgVldtUePwrCfg ARGS((RgSchCellCb *cell,
95 RgrUeUlPwrCfg *pwrCfg));
96 static S16 rgSCHCfgVldtUeGrpPwrCfg ARGS((RgSchCellCb *cell,
97 RgrUeGrpPwrCfg *grpPwrCfg));
99 static S16 rgSCHCfgVldtUeDlSpsCfg ARGS((RgSchCellCb *cell,
100 RgrUeSpsDlCfg *dlSpsCfg));
101 static S16 rgSCHCfgVldtSpsReCfg ARGS ((RgSchCellCb *cell,
102 RgSchUeCb *ue, RgrUeRecfg *ueRecfg));
103 #endif /*LTEMAC_SPS*/
104 static S16 rgSCHCfgVldtUeCqiModeCfg ARGS((RgSchCellCb *cell,RgrUeDlCqiCfg *ueDlCqiCfg));
105 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg ARGS ((RgSchCellCb *cell,
107 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg ARGS ((RgSchCellCb *cell,
108 RgrUeRecfg *ueRecfg));
109 static Void rgSCHCfgFreeDlDedLcCb ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
111 static Void rgSCHCfgFreeDlCmnLcCb ARGS((RgSchClcDlLcCb *cmnDlLc));
112 static Void rgSCHCfgFreeUeCb ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
113 static Void rgSCHCfgFreeRgrCfgLst ARGS((RgSchCellCb *cell));
114 static Void rgSCHCfgFreeCmnLcLst ARGS((RgSchCellCb *cell));
115 static Void rgSCHCfgFreeUeLst ARGS((RgSchCellCb *cell));
117 static Void rgSCHCfgFreeSpsUeLst ARGS((RgSchCellCb *cell));
119 static S16 rgSCHCfgVldtRgrCmnLcCfg ARGS((Inst inst, RgrCellCfg *cellCfg,
120 RgSchErrInfo *errInfo));
121 static S16 rgSCHCfgVldtRgrCellPwrCfg ARGS((Inst inst, RgrCellCfg *cellCfg,
122 RgSchErrInfo *errInfo));
123 static S16 rgSCHCfgVldtRgrCellSchCfg ARGS((Inst inst, RgrCellCfg *cellCfg));
124 static S16 rgSCHCfgVldtRgrSchCfg ARGS((Inst inst, RgrSchedEnbCfg *schedEnbCfg));
125 static S16 rgSCHCfgVldtRgrCellRACfg ARGS((Inst inst, RgrCellCfg *cellCfg));
126 static Void rgSCHCfgRgrUePhrMsg3 ARGS(( RgSchCellCb *cell,
127 RgSchRaCb *raCb,RgSchUeCb *ue, RgSchErrInfo *errInfo));
128 static S16 rgSCHCfgRgrCmnLcCfg ARGS((RgSchCellCb *cell, RgrCmnLchCfg *lcCfg,
129 RgSchErrInfo *errInfo));
130 Void rgSCHSCellFreeBuf ARGS((Inst inst,RgSchUeCb *ue,RgrUeRecfg *ueRecfg,uint8_t idx));
132 static S16 rgSCHCfgVldtRgrCellSiCfg ARGS(( Inst inst, RgrSiCfg *siCfg));
133 #endif/*RGR_SI_SCH */
135 /* LTE_ADV_FLAG_REMOVED_START */
136 static S16 rgSCHCfgVldtRgrCellLteAdvCfg ARGS(( Inst inst,
137 RgrLteAdvancedCellConfig *lteAdvCfg, uint8_t dlTotalBw));
138 /* LTE_ADV_FLAG_REMOVED_END */
140 static S16 rgSCHCfgVldtDrxUeCfg ARGS ((RgSchCellCb *cell,
141 RgrUeDrxCfg *ueDrxCfg));
142 static S16 rgSCHCfgVldtDrxOnDurCfg ARGS((uint8_t onDurTmr));
143 static S16 rgSCHCfgVldtDrxInActvCfg ARGS((uint16_t inActvTmr));
144 static S16 rgSCHCfgVldtDrxReTxCfg ARGS((uint8_t reTxTmr));
145 static S16 rgSCHCfgVldtDrxLngCycCfg ARGS((RgrDrxLongCycleOffst lngCycleOffst));
146 static S16 rgSCHCfgVldtDrxLngCyclTmrs ARGS((uint16_t val));
147 static S16 rgSCHCfgVldtDrxShrtCycCfg ARGS((RgrDrxShortDrx shrtCycCfg));
148 static S16 rgSCHCfgVldtRgrCellCsgParamCfg ARGS((Inst inst,
149 RgrCellCsgParamCfg *csgParam));
152 S16 rgSCHCfgACqiUeCfg ARGS(( RgSchCellCb *cellCb,RgSchUeCb *ue, RgSchUeACqiCb *aCqiCb,
153 RgrTxMode ueTxMode,RgrUeAprdDlCqiCfg *aCqiCfg, CmLteUeCategory ueCat ));
155 S16 rgSCHCfgAcqiUeReCfg ARGS(( RgSchCellCb *cellCb, RgSchUeCb *ueCb,
156 RgrUeAprdDlCqiCfg *acqiCfg, CmLteUeCategory ueCat ));
158 S16 rgSCHUtlGetCfgPerOff ARGS(( RgSchPerTbl tbl, uint16_t cfgIdx,
159 uint16_t *peri, uint16_t *offset ));
161 S16 rgSCHCfgRiUeCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
162 RgrUePrdDlCqiCfg *cqiCfg, CmLteUeCategory ueCat ));
164 S16 rgSCHCfgPCqiUeCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
165 RgrUePrdDlCqiCfg *cqiCfg,CmLteUeCategory ueCat ));
167 S16 rgSCHCfgSrsUeCfg ARGS((RgSchCellCb *cellCb,RgSchUeCb *ueCb,
168 RgrUeUlSrsCfg *srsCfg ));
170 S16 rgSCHCfgSrUeCfg ARGS((RgSchCellCb *cellCb,RgSchUeCb *ueCb,
173 S16 rgSCHCfgPCqiUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
174 RgrUePrdDlCqiCfg *cqiCfg,CmLteUeCategory ueCat));
176 S16 rgSCHCfgSrsUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
177 RgrUeUlSrsCfg *srsCfg));
179 S16 rgSCHCfgSrUeReCfg ARGS((RgSchCellCb *cellCb, RgSchUeCb *ueCb,
182 S16 rgSCHCfgVldtRgrTxmodePuschMode ARGS((RgSchCellCb *cellCb,
183 RgrTxMode txMde, RgrAprdCqiMode puschMode,RgSchErrInfo *errInfo));
185 S16 rgSCHCfgVldtRgrUeACqiCfg ARGS(( RgSchCellCb *cellCb,
186 CmLteRnti crnti, RgrUeAprdDlCqiCfg *acqiCfg, RgrUeTxModeCfg txMode,
187 RgSchErrInfo *errInfo ));
189 S16 rgSCHCfgVldtRgrTxmodePucchMode ARGS((RgSchCellCb *cellCb,
190 RgrTxMode txMde, RgrPrdCqiMode pucchMode,RgSchErrInfo *errInfo));
193 S16 rgSCHCfgVldtRgrUePCqiCfg ARGS(( RgSchCellCb *cellCb,
194 CmLteRnti crnti, RgrUePrdDlCqiCfg *cqiCfg, Bool hdFdd,
195 RgrUeTxModeCfg txMode, RgSchErrInfo *errInfo));
197 S16 rgSCHCfgVldtRgrUePCqiCfg ARGS(( RgSchCellCb *cellCb,
198 CmLteRnti crnti, RgrUePrdDlCqiCfg *cqiCfg, RgrUeTxModeCfg txMode,
199 RgSchErrInfo *errInfo));
202 S16 rgSCHCfgVldtRgrUeUlSrsCfg ARGS ((RgSchCellCb *cellCb,
203 CmLteRnti crnti, RgrUeUlSrsCfg *srsCfg, Bool hdFdd,
204 RgSchErrInfo *errInfo));
206 S16 rgSCHCfgVldtRgrUeUlSrsCfg ARGS ((RgSchCellCb *cellCb,
207 CmLteRnti crnti, RgrUeUlSrsCfg *srsCfg,
208 RgSchErrInfo *errInfo));
212 S16 rgSCHCfgVldtRgrUeSrCfg ARGS((RgSchCellCb *cellCb, CmLteRnti crnti,
213 RgrUeSrCfg *srCfg, Bool hdFdd, RgSchErrInfo *errInfo));
215 S16 rgSCHCfgVldtRgrUeSrCfg ARGS((RgSchCellCb *cellCb, CmLteRnti crnti,
216 RgrUeSrCfg *srCfg, RgSchErrInfo *errInfo));
218 static S16 rgSCHCfgVldtCqiSrSrsUeCfg ARGS (( RgSchCellCb *cellCb,
220 RgSchErrInfo *errInfo));
222 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg ARGS (( RgSchCellCb *cellCb,
225 RgSchErrInfo *errInfo ));
227 S16 rgSCHCfgPCqiSrsSrUeDel ARGS ((RgSchCellCb *cellCb,
230 static Void rgSCHCfgUtlFetchAcqiBitSz ARGS (( RgSchUeACqiCb *acqiCb,uint8_t numTxAnt,
231 uint8_t* cqiPmiSzR1,uint8_t* cqiPmiSzRn1 ));
233 /* Added the function to be used instead of the
234 * MACRO RG_SCH_GET_PERIODICITY_TBL */
235 static const RgSchUePCqiSrsSrCfgIdxTbl* rgSCHCfgUtlGetPcqiSrsSrRiTbl ARGS ((
240 #endif /* TFU_UPGRADE */
241 static Void rgSCHCfgUeTaRecfg ARGS (( RgSchCellCb *cellCb,
244 RgSchErrInfo *errInfo ));
246 S16 rgSCHSCellCfgUeCfg ARGS((
253 S16 rgSCHSCellCfgUePucchReCfg ARGS((
259 S16 rgSCHCfgVldtRgrUeSCellRecfg ARGS((
263 RgSchErrInfo *errInfo
265 static S16 rgSCHSCellCfgUeCfgRollBack ARGS((
272 /* ccpu00117452 - MOD - Changed macro name from
273 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
274 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
275 static S16 rgSCHCfgUeCqiReptReCfg ARGS ((
281 static S16 rgSCHCfgVldtCqiReptReCfg ARGS ((
286 /*LTE_L2_MEAS_PHASE2*/
288 static S16 rgSchAddToL2Meas ARGS ((RgSchCellCb *cellCb,RgSchDlLcCb *dlLc));
291 S16 rgSCHEmtcCfgVldtDrxOnDurCfg
295 Void rgSCHUtlUpdEmtcY
299 Void rgSCHEmtcHqPAlloc
307 const RgSchSrsTxOffst rgSrsTxOffstTbl[RGSCH_MAX_SRS_SFCFG_IDX+1]=
308 {{1,{0,0,0,0,0,0,0,0}},
309 {1,{0,0,0,0,0,0,0,0}},
310 {1,{1,0,0,0,0,0,0,0}},
311 {1,{0,0,0,0,0,0,0,0}},
312 {1,{1,0,0,0,0,0,0,0}},
313 {1,{2,0,0,0,0,0,0,0}},
314 {1,{3,0,0,0,0,0,0,0}},
315 {2,{0,1,0,0,0,0,0,0}},
316 {2,{2,3,0,0,0,0,0,0}},
317 {1,{0,0,0,0,0,0,0,0}},
318 {1,{1,0,0,0,0,0,0,0}},
319 {1,{2,0,0,0,0,0,0,0}},
320 {1,{3,0,0,0,0,0,0,0}},
321 {7,{0,1,2,3,4,6,8,0}},
322 {8,{0,1,2,3,4,5,6,8}},
323 {0,{0,0,0,0,0,0,0,0}}};
328 /* SRSCfg Table: Ref 36.213, Table: 8.2.1 */
329 const RgSchUePCqiSrsSrCfgIdxTbl
330 rgSchUeSrsCfgIdxFddTbl[RG_SCH_SRS_ISRS_INDX_MAX_FDD]=
342 /* Reference : 36.213 Table 8.2-2 */
343 const RgSchUePCqiSrsSrCfgIdxTbl
344 rgSchUeSrsCfgIdxTddTbl[RG_SCH_SRS_ISRS_INDX_MAX_TDD]=
351 { 165,324,160, 165 },
353 /* RESERVED: Configuration Module should not allow Res values */
356 /*Reference: 36.213 Table:7.2.2-1A */
357 const RgSchUePCqiSrsSrCfgIdxTbl
358 rgSchUePCqiCfgIdxFddTbl[RG_SCH_CQIPMI_CFGIDX_MAX_FDD]=
370 /* RESERVED: Configuration should not allow Res values */
373 /* Reference: 36.213 Table:7.2.2-1C */
374 const RgSchUePCqiSrsSrCfgIdxTbl
375 rgSchUeCqiPmiCfgIdxTddTbl[RG_SCH_CQIPMI_CFGIDX_MAX_TDD]=
384 /* RESERVED: Configuration should not allow Res values */
387 /* Note: RI table is same for FDD and TDD */
388 /*Reference: 36.213 Table:7.2.2-1B */
389 const RgSchUePCqiSrsSrCfgIdxTbl
390 rgSchUeRiCfgIdxTbl[RG_SCH_RI_CFGIDX_MAX]=
398 /* RESERVED: Configuration should not allow Res values */
401 /*Reference: 36.213 Table:7.2.2-2 */
402 const RgSchUeBwSubSzBwParts
403 rgSchUeBwSubSzBwPartsTbl[RG_SCH_BW_SUBSZ_BWPARTS_MAX]=
405 {6,7, 0, 0}, /*TODO: 6,7, NA, NA */
413 /* Reference : 36.213 Table 10.1-5 */
414 /* Note: SR is same table for TDD and FDD */
415 const RgSchUePCqiSrsSrCfgIdxTbl rgSchUeSrCfgIdxTbl[RG_SCH_ISR_INDX_MAX]=
422 /* RESERVED: Configuration should not allow Res values */
425 /*Reference:36.213: Derived from Table: 7.2.1-5 for Label L.
426 The Label L is CEIL(log2(BinCoe(N and M)))*/
427 const uint8_t RgSCHUeAcqi2022LBitWidth[6][28] ={
428 {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},
429 {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},
430 {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},
431 {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},
432 {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},
433 {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}
438 extern uint8_t rgSchCmnHarqRtt[];
440 S16 rgSCHEmtcCellAlloc ARGS((RgSchCellCb *cel));
441 Void rgSCHEmtcCellFree ARGS((RgSchCellCb *cel));
442 Void rgSCHEmtcUeInfoFree ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
443 uint8_t rgSchfillPucchSrRepNumCountemtc ARGS((RgSchUeCb *ueCb));
444 uint8_t rgSchfillPucchCqiRepNumCountemtc ARGS((RgSchUePCqiCb *cqiCb, RgSchUeCb *ueCb));
445 S16 rgEmtcvalidateSiCfg ARGS((RgrSiCfgReqInfo *siCfg,RgSchCellCb *cell));
447 /* forward references */
451 * @brief Validates the SCH EndoeB configuration request from RRM to SCH.
455 * Function : rgSCHCfgVldtRgrSchedEnbCfg
458 * - Retrieve the cell control block.
460 * - Validate the range of configured values recieved in
461 * configuration request.
462 * - If validated successfully,
463 * - Return ROK and pointer to the cell.
466 * - Else return RFAILED.
467 * @param[in] Inst inst
468 * @param[in] RgrSchedEnbCfg *schedEnbCfg
469 * @param[out] RgSchCellCb **cell
470 * @param[out] RgSchErrInfo *errInfo
475 S16 rgSCHCfgVldtRgrSchedEnbCfg
478 RgrSchedEnbCfg *schedEnbCfg,
479 RgSchErrInfo *errInfo
482 DU_LOG("\nDEBUG --> SCH : VALIDATE RGR SCH ENB CONFIG: \n");
484 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
487 if ((rgSCHCfgVldtRgrSchCfg(inst, schedEnbCfg)) != ROK)
489 DU_LOG("\nERROR --> SCH : Validation for scheduler related "
494 DU_LOG("\nINFO --> SCH : MIMO_DBG:: SCH:: numAntPorts=%d\n",schedEnbCfg->numTxAntPorts);
496 /* Validation for the ENB parameters */
497 if ((schedEnbCfg->numTxAntPorts == 0) || (schedEnbCfg->numTxAntPorts > 4))
499 DU_LOG("\nERROR --> SCH : Invalid number of transmit antenna"
500 " ports %d\n", schedEnbCfg->numTxAntPorts);
504 /* Validate csg access mode */
505 if((schedEnbCfg->accsMode < RGR_CELL_ACCS_OPEN) ||
506 (schedEnbCfg->accsMode > RGR_CELL_ACCS_HYBRID))
508 DU_LOG("\nERROR --> SCH : Invalid CSG Access mode\n");
512 errInfo->errCause = RGSCHERR_NONE;
513 DU_LOG("\nINFO --> SCH : RGR SCHED ENB config validation done:");
516 } /* rgSCHCfgVldtRgrSchedEnbCfg */
519 * @brief Validates the cell configuration request from RRM to MAC.
523 * Function : rgSCHCfgVldtRgrCellCfg
526 * - Retrieve the cell control block.
528 * - Validate the range of configured values recieved in
529 * configuration request.
530 * - If validated successfully,
531 * - Return ROK and pointer to the cell.
534 * - Else return RFAILED.
535 * @param[in] Inst inst
536 * @param[in] RgrCellCfg *cellCfg
537 * @param[out] RgSchCellCb **cell
538 * @param[out] RgSchErrInfo *errInfo
543 S16 rgSCHCfgVldtRgrCellCfg
548 RgSchErrInfo *errInfo
551 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_CFG;
553 /* check if cell exists already */
554 if ((uint8_t *)cell != NULLP)
556 DU_LOG("\nERROR --> SCH : Cell Id already exists");
560 if(cellCfg->macInst >= SCH_INST_START)
562 DU_LOG("\nERROR --> SCH : Invalid MAC Instance %d ",
567 if (cellCfg->macRnti.startRnti < RGSCH_MIN_MAC_RNTI )
569 DU_LOG("\nERROR --> SCH : Invalid start RNTI %d for cell ",
570 cellCfg->macRnti.startRnti);
574 if ((rgSCHCfgVldtRgrCellSchCfg(inst, cellCfg)) != ROK)
576 DU_LOG("\nERROR --> SCH : Validation for scheduler related "
581 if ((cellCfg->dlHqCfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
582 (cellCfg->dlHqCfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX))
584 DU_LOG("\nERROR --> SCH : Invalid Downlink HARQ configuration:"
585 " maxDlHqTx %d maxMsg4HqTx %d", cellCfg->dlHqCfg.maxDlHqTx,
586 cellCfg->dlHqCfg.maxMsg4HqTx);
589 if ((cellCfg->cfiCfg.cfi < RGSCH_MIN_CFI_VAL) ||
590 (cellCfg->cfiCfg.cfi > RGSCH_MAX_CFI_VAL))
592 DU_LOG("\nERROR --> SCH : Invalid CFI configuration %d",
593 cellCfg->cfiCfg.cfi);
596 if (((cellCfg->puschSubBand.subbandStart) +
597 ((cellCfg->puschSubBand.numSubbands -1) * cellCfg->puschSubBand.size))
598 > (cellCfg->bwCfg.ulTotalBw - 1))
600 DU_LOG("\nERROR --> SCH : Invalid PUSCH subband configuration:"
601 " subBandStart %d numSubBands %d subBandSize %d ulTotBw %d",
602 cellCfg->puschSubBand.subbandStart,
603 cellCfg->puschSubBand.numSubbands, cellCfg->puschSubBand.size,
604 cellCfg->bwCfg.ulTotalBw);
608 if (((cellCfg->bwCfg.dlTotalBw < RGSCH_MIN_DL_BW) ||
609 (cellCfg->bwCfg.dlTotalBw > RGSCH_MAX_DL_BW)) ||
610 ((cellCfg->bwCfg.ulTotalBw < RGSCH_MIN_UL_BW) ||
611 (cellCfg->bwCfg.ulTotalBw > RGSCH_MAX_UL_BW)))
613 DU_LOG("\nERROR --> SCH : Invalid Bandwidth configuration:"
614 " ul %d dl %d",cellCfg->bwCfg.ulTotalBw,
615 cellCfg->bwCfg.dlTotalBw);
618 if (cellCfg->phichCfg.ngEnum > RGR_NG_TWO)
620 DU_LOG("\nERROR --> SCH : Invalid PHICH Ng configuration %d",
621 (uint8_t)cellCfg->phichCfg.ngEnum);
624 /* Validation for extended PHICH Duration */
625 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
626 (cellCfg->bwCfg.dlTotalBw <= 10) && (cellCfg->cfiCfg.cfi < 2))
628 DU_LOG("\nERROR --> SCH : Invalid cfi value for"
629 "Extended PHICH duration cfi:%d dlBw:%d",
630 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
633 if ((cellCfg->phichCfg.isDurExtend == TRUE) &&
634 (cellCfg->bwCfg.dlTotalBw > 10) && (cellCfg->cfiCfg.cfi < 3))
636 DU_LOG("\nERROR --> SCH : Invalid cfi value for"
637 "Extended PHICH duration cfi:%d dlBw:%d",
638 (uint8_t)cellCfg->cfiCfg.cfi, cellCfg->bwCfg.dlTotalBw);
641 DU_LOG("\nINFO --> SCH : CA_DBG:: PUCCH configuration:"
642 " N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
643 cellCfg->pucchCfg.resourceSize,
644 cellCfg->pucchCfg.n1PucchAn,
645 cellCfg->pucchCfg.deltaShift,
646 cellCfg->pucchCfg.cyclicShift);
648 /* ccpu00138567- Removing validation check for resourceSize as 0.
649 * From the spec, n2RB value 0 is a valid config. */
650 if ((cellCfg->pucchCfg.resourceSize >= cellCfg->bwCfg.ulTotalBw/2) ||
651 (cellCfg->pucchCfg.n1PucchAn == 0) ||
652 (cellCfg->pucchCfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
653 (cellCfg->pucchCfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS) ||
654 (cellCfg->pucchCfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
656 DU_LOG("\nERROR --> SCH : Invalid PUCCH configuration:"
657 " N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
658 cellCfg->pucchCfg.resourceSize,
659 cellCfg->pucchCfg.n1PucchAn,
660 cellCfg->pucchCfg.deltaShift,
661 cellCfg->pucchCfg.cyclicShift);
664 if (cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsBwEnum > RGR_SRS_BWCFG_7)
666 DU_LOG("\nERROR --> SCH : Invalid SRS configuration: "
667 " srsBw %d", (uint8_t)cellCfg->srsCfg.srsBwEnum);
671 if ((rgSCHCfgVldtRgrCellRACfg(inst, cellCfg)) != ROK)
673 DU_LOG("\nERROR --> SCH : Validation for Random access related"
678 if ((rgSCHCfgVldtRgrCellPwrCfg(inst, cellCfg, errInfo)) != ROK)
680 DU_LOG("\nERROR --> SCH : Validation for cell power "
685 /* Validate the common logical channel configuration */
686 if( (cellCfg->numCmnLcs < RGR_MIN_CMN_LC_PER_CELL)||
687 (cellCfg->numCmnLcs > RGR_MAX_CMN_LC_PER_CELL))
689 DU_LOG("\nERROR --> SCH : Invalid number(%d) of common logical"
690 "channels in cell config", cellCfg->numCmnLcs);
693 if ((rgSCHCfgVldtRgrCmnLcCfg(inst, cellCfg, errInfo)) != ROK)
695 DU_LOG("\nERROR --> SCH : Validation for common logical"
700 /* Added 0 as a valid value for number of TICKs RRM
701 * 0 implies no ticks i.e. shutting off the feature.*/
704 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellCfg->siCfg))) != ROK)
706 DU_LOG("\nERROR --> SCH : Validation for SI"
707 "configuration failed");
710 #endif /*RGR_SI_SCH */
712 /*ccpu00116923 - ADD - Srs Present support - Start*/
715 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 13)
717 if(cellCfg->srsCfg.isSrsCfgSetup && cellCfg->srsCfg.srsSubFrameCfg > 14)
720 DU_LOG("\nERROR --> SCH : Invalid"
721 "Subframe configuration");
725 /*ccpu00116923 - ADD - Srs Present support - End*/
727 if ((cellCfg->bcchTxPwrOffset > 10000) ||
728 (cellCfg->pcchTxPwrOffset > 10000) ||
729 (cellCfg->rarTxPwrOffset > 10000) ||
730 (cellCfg->phichTxPwrOffset > 10000)
733 DU_LOG("\nERROR --> SCH : Invalid txPower offset ");
738 /* LTE_ADV_FLAG_REMOVED_START */
739 /* Checking Whether DSFR is enabled without enabling SFR */
740 if(((cellCfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
741 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.dsfrCfg.status)) &&
742 (!((cellCfg->rgrLteAdvCfg.pres & RGR_SFR) &&
743 (RGR_ENABLE == cellCfg->rgrLteAdvCfg.sfrCfg.status))))
745 DU_LOG("\nERROR --> SCH : DSFR is enbaled"
746 "Without enabling SFR");
750 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellCfg->rgrLteAdvCfg),
751 cellCfg->bwCfg.dlTotalBw)) != ROK)
753 DU_LOG("\nERROR --> SCH : Validation for LTE Adv"
754 "configuration failed");
758 if ((rgSCHCfgVldtRgrCellLteLAACfg(inst, cellCfg)) != ROK)
760 DU_LOG("\nERROR --> SCH : Validation for LTE LAA"
761 "configuration failed");
765 /* LTE_ADV_FLAG_REMOVED_END */
766 if (cellCfg->msg4pAVal > RGRUE_DLPWRCNTRL_PA_DB3)
768 DU_LOG("\nERROR --> SCH : Invalid"
769 "msg4pAVal %u", cellCfg->msg4pAVal);
773 /* Validate RgrCellCsgParamCfg */
774 if(rgSchCb[inst].rgrSchedEnbCfg.accsMode == RGR_CELL_ACCS_HYBRID)
776 if((rgSCHCfgVldtRgrCellCsgParamCfg(inst,
777 &(cellCfg->csgParamCfg)) != ROK))
779 DU_LOG("\nERROR --> SCH : Validation failed for \n"
780 "Access CSG parameter failed\n");
785 if (cellCfg->emtcEnable)
787 if(ROK != rgSCHCfgVldtRgrEmtcCellCfg(cellCfg))
789 DU_LOG("\nERROR --> SCH : Invalid EMTC cell Configuration %d for cell" ,cellCfg->cellId);
794 errInfo->errCause = RGSCHERR_NONE;
796 } /* rgSCHCfgVldtRgrCellCfg */
799 * @brief Validates the scheduler related configuration request from RRM to MAC.
803 * Function : rgSCHCfgVldtRgrSchCfg
806 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
807 * validate the value range for the configured values.
808 * - If validated successfully,
813 * @param[in] Inst inst
814 * @param[out] RgSchedCfg *rgSchedCfg
819 S16 rgSCHCfgVldtRgrSchCfg
822 RgrSchedEnbCfg *rgSchedCfg
825 DU_LOG("\nDEBUG --> SCH : rgSCHCfgVldtRgrSchCfg:Validating \
826 scheduler related Configuration");
827 if (rgSchedCfg->ulSchdType > (RGSCH_NUM_SCHEDULERS - 1))
829 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtRgrSchCfg:Invalid \
830 UL scheduler type %d \n", rgSchedCfg->ulSchdType);
833 if (rgSchedCfg->dlSchdType > (RGSCH_NUM_SCHEDULERS - 1))
835 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtRgrSchCfg:Invalid \
836 DL scheduler type %d \n", rgSchedCfg->dlSchdType);
842 * @brief Validates the scheduler related configuration request from RRM to MAC.
846 * Function : rgSCHCfgVldtRgrCellSchCfg
849 * - Validate the scheduler related configuration request from RRC to MAC at CFG:
850 * validate the value range for the configured values.
851 * - If validated successfully,
852 * - Return ROK and pointer to the cell of UE.
856 * @param[in] Inst inst
857 * @param[out] RgSchCellCfg *cellCfg
862 S16 rgSCHCfgVldtRgrCellSchCfg
869 #if RGSCH_NUM_DLFS_SCHEDULERS
870 if (cellCfg->dlfsSchdType > RGSCH_NUM_DLFS_SCHEDULERS - 1)
872 DU_LOG("\nERROR --> SCH : Invalid dlfs scheduler type %d for cell",
873 cellCfg->dlfsSchdType);
880 * @brief Validates the RACH related configuration request from RRM to MAC.
884 * Function : rgSCHCfgVldtRgrCellRACfg
887 * - Validate the RA configuration request from RRC to MAC at CFG:
888 * validate the value range for the configured values.
889 * - If validated successfully,
890 * - Return ROK and pointer to the cell of UE.
894 * @param[in] Inst inst
895 * @param[out] RgSchCellCfg *cellCfg
900 S16 rgSCHCfgVldtRgrCellRACfg
908 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_TDD_RA_PREAMBLE_FMT) ||
910 if ((cellCfg->rachCfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
912 (cellCfg->rachCfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
913 (cellCfg->rachCfg.raWinSize > RGSCH_MAX_RA_WINSIZE) ||
914 (cellCfg->rachCfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
915 (cellCfg->rachCfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE) ||
916 (cellCfg->rachCfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE) ||
917 (cellCfg->rachCfg.sizeRaPreambleGrpA >
918 cellCfg->rachCfg.numRaPreamble) ||
919 (cellCfg->rachCfg.prachResource >
920 (cellCfg->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB)))
922 DU_LOG("\nERROR --> SCH : Invalid RACH configuration:"
923 "preamble Fmt %d raWinSize %d maxMsg3Tx %d",
924 cellCfg->rachCfg.preambleFormat, cellCfg->rachCfg.raWinSize,
925 cellCfg->rachCfg.maxMsg3Tx);
926 DU_LOG("\nERROR --> SCH : Invalid numRaPreamble %d sizeRaPreambleGrpA %d",
927 cellCfg->rachCfg.numRaPreamble,
928 cellCfg->rachCfg.sizeRaPreambleGrpA);
932 /* verify that the ded Preambles cfgd for Pdcch Order
933 * do not collide with that of non-dedicated and validates against
934 * the configuration index and number of RACH
935 * ded-preambles. For non-zero ded preamble cfg,
936 * the config index is expected to be != NA.*/
937 if ((cellCfg->macPreambleSet.pres) &&
938 ((cellCfg->macPreambleSet.start < cellCfg->rachCfg.numRaPreamble) ||
939 (cellCfg->macPreambleSet.start >= RGSCH_MAX_NUM_RA_PREAMBLE) ||
940 (cellCfg->macPreambleSet.size < 1) ||
941 (cellCfg->macPreambleSet.size > RGSCH_MAX_NUM_RA_PREAMBLE-
942 cellCfg->rachCfg.numRaPreamble) ||
943 (cellCfg->rachCfg.raOccasion.sfnEnum == RGR_SFN_NA)))
945 DU_LOG("\nERROR --> SCH : Invalid RACH Preambleset conf:"
946 "preambleSet Start %d preambleSet Size %d",
947 cellCfg->macPreambleSet.start, cellCfg->macPreambleSet.size);
951 if(cellCfg->rachCfg.contResTmr)
955 idx = cellCfg->ulDlCfgIdx;
959 /* maxMsg4TxDelay = (HARQ_RTT * MAX_MSG4_HARQ_RETX) +
960 3 TTI (MAX L1+L2 processing delay at the UE) */
961 uint8_t maxMsg4TxDelay = (cellCfg->dlHqCfg.maxMsg4HqTx-1) *
962 rgSchCmnHarqRtt[idx] + 3;
965 if(maxMsg4TxDelay >= cellCfg->rachCfg.contResTmr)
967 DU_LOG("\nERROR --> SCH : Warining !: Contention Resolution timer not greater than the "
968 "guard timer. Conte Res timer %d Guard timer %d",
969 cellCfg->rachCfg.contResTmr,
971 /* [ccpu00138532]-DEL- removed return fail here as it is ok if the
972 max Msg4 Tx delay is more than the contension Resolution timer.
973 In such case, the CRI CE will be scheduled immediately once
979 /* ccpu00128575 ADD - If contention resolution timer is configured as 0,
981 DU_LOG("\nERROR --> SCH : Contention Resolution timer is configured as '0'");
990 * @brief Validates the UE configuration request from RRM to MAC.
994 * Function : rgSCHCfgVldtRgrUeCfg
997 * - Validate the UE configuration request from RRC to MAC at CFG:
998 * validate the value range for the configured values.
999 * - If validated successfully,
1000 * - Return ROK and pointer to the cell of UE.
1004 * @param[in] Inst inst
1005 * @param[in] RgrUeCfg *ueCfg
1006 * @param[out] RgSchCellCb **cell
1007 * @param[out] RgSchErrInfo *errInfo
1012 S16 rgSCHCfgVldtRgrUeCfg
1017 RgSchErrInfo *errInfo
1020 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_CFG;
1022 if (((*cell) == NULLP) ||
1023 ((*cell)->cellId != ueCfg->cellId))
1025 DU_LOG("\nERROR --> SCH : Cell does not exist %d",
1030 * Check configured preamble id not colliding with non dedicated or PDCCH
1031 * order preamble sets. When valid preamble id given check that C-RNTI given
1032 * in configuration is not amongst the C-RNTI'smanaged by scheduler */
1033 if ((rgSCHRamVldtUeCfg(*cell, ueCfg)) != ROK)
1035 DU_LOG("\nERROR --> SCH : CELLID:%d Preamble Id configuration"
1036 "failed ",ueCfg->cellId);
1039 /* Check if Ue already configured */
1040 if (rgSCHDbmGetUeCb(*cell, ueCfg->crnti) != NULLP)
1042 DU_LOG("\nERROR --> SCH : CELLID:%d UEID already exists",
1046 /* Validate Transmission UE modes */
1047 if ((ueCfg->txMode.pres == TRUE) && ((ueCfg->txMode.txModeEnum < RGR_UE_TM_1)
1048 || (ueCfg->txMode.txModeEnum > RGR_UE_TM_7)))
1050 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid transmission mode for"
1051 " UE is %d", ueCfg->cellId,(uint8_t)ueCfg->txMode.txModeEnum);
1055 /* Validate UE Category */
1056 if (ueCfg->ueCatEnum > CM_LTE_UE_CAT_8)
1058 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid category for UE %d",
1059 ueCfg->cellId,(uint8_t)ueCfg->ueCatEnum);
1063 /* Validate UE Access Stratum Release */
1064 if (ueCfg->accessStratumRls > RGR_REL_10)
1066 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "Invalid Access Stratum Release %u for UE\n",
1067 ueCfg->accessStratumRls));
1070 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "Configured Access Stratum Release %u\n", \
1071 ueCfg->accessStratumRls));
1073 if ((*cell)->numTxAntPorts == 1)
1075 if ((ueCfg->txMode.pres == TRUE) &&
1076 (ueCfg->txMode.txModeEnum > RGR_UE_TM_1))
1078 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid transmission mode for"
1079 " UE (%d) for the configured Cell Antenna Ports",ueCfg->cellId,
1080 (uint8_t)ueCfg->txMode.txModeEnum);
1085 if ((rgSCHCfgVldtUeCqiModeCfg(*cell, &ueCfg->ueDlCqiCfg)) != ROK)
1087 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid CQI Mode configuration",
1092 /* Validate Max Uplink HARQ transmission value */
1093 if (ueCfg->ueUlHqCfg.maxUlHqTx < RGSCH_MIN_HQ_TX)
1095 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid Uplink HARQ config for "
1096 "UE %d",ueCfg->cellId,ueCfg->ueUlHqCfg.maxUlHqTx);
1100 if (rgSCHCfgVldtUePwrCfg(*cell, &ueCfg->ueUlPwrCfg) != ROK)
1102 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid PUSCH Group power"
1103 " configuration",ueCfg->cellId);
1107 if (rgSCHCfgVldtUeMeasGapAckNakRepCfg(*cell, ueCfg) != ROK)
1109 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid MeasGap/AckNackRep"
1110 " configuration",ueCfg->cellId);
1115 /* Validating SPS RNTI */
1116 if (((ueCfg->ueSpsCfg.spsRnti >= (*cell)->rntiDb.rntiStart) &&
1117 (ueCfg->ueSpsCfg.spsRnti<=((*cell)->rntiDb.rntiStart+(*cell)->rntiDb.maxRntis)))
1118 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_SI_RNTI)
1119 ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_P_RNTI))
1121 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid SPS RNTI "
1122 " in DL SPS Config",ueCfg->cellId);
1126 if (ueCfg->ueSpsCfg.dlSpsCfg.isDlSpsEnabled)
1128 if (rgSCHCfgVldtUeDlSpsCfg(*cell, &ueCfg->ueSpsCfg.dlSpsCfg) != ROK)
1130 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid DL SPS configuration"
1131 " for the UE",ueCfg->cellId);
1137 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
1138 if ( ROK != rgSCHCfgVldtCqiSrSrsUeCfg(*cell, ueCfg, errInfo))
1140 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid Periodic CQI/SR/SRS"
1141 "configuration",ueCfg->cellId);
1146 /* Validate DRX specific parameters */
1147 if ( ROK != rgSCHCfgVldtDrxUeCfg(*cell, &(ueCfg->ueDrxCfg)))
1149 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid DRX configuration",
1154 /* ccpu00117452 - MOD - Changed macro name from
1155 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1157 if (ueCfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
1159 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid numColltdCqiRept,"
1160 "MAX supported %d",RGR_CQIRPTS_MAXN,ueCfg->cellId);
1163 #endif /* End of RGR_CQI_REPT */
1166 /*This is to validate the EMTC related configuration if a UE is an EMTC UE*/
1167 if(TRUE == ueCfg->emtcUeCfg.pres)
1169 if ( ROK != rgSCHCfgVldtEmtcUeCfg(*cell, &(ueCfg->emtcUeCfg)))
1171 DU_LOG("\nERROR --> SCH : CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
1172 ueCfg->cellId, ueCfg->crnti);
1177 errInfo->errCause = RGSCHERR_NONE;
1179 } /* rgSCHCfgVldtRgrUeCfg */
1183 * @brief Validates the cell reconfiguration request from RRM to MAC.
1187 * Function : rgSCHCfgVldtRgrCellRecfg
1190 * - Retrieve the cell control block.
1192 * - Validate the range of reconfigured values recieved in
1193 * re-configuration request.
1194 * - If validated successfully,
1195 * - Return ROK and pointer to the cell.
1198 * - Else return RFAILED.
1200 * @param[in] Inst inst
1201 * @param[in] RgrCellRecfg *cellRecfg
1202 * @param[out] RgSchCellCb **cell
1203 * @param[out] RgSchErrInfo *errInfo
1208 S16 rgSCHCfgVldtRgrCellRecfg
1211 RgrCellRecfg *cellRecfg,
1213 RgSchErrInfo *errInfo
1217 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CELL_RECFG;
1219 /* Fetch cell and validate cell Id with the cell control block*/
1220 if (((*cell) == NULLP) ||
1221 ((*cell)->cellId != cellRecfg->cellId))
1223 DU_LOG("\nERROR --> SCH : Cell control block does not exist");
1227 /* Validate recieved values */
1228 if ((cellRecfg->recfgTypes & RGR_CELL_DL_HARQ_RECFG) &&
1229 ((cellRecfg->dlHqRecfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
1230 (cellRecfg->dlHqRecfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX)))
1232 DU_LOG("\nERROR --> SCH : Invalid Downlink HARQ configuration:"
1233 " maxDlHqTx %d maxMsg4HqTx %d", cellRecfg->dlHqRecfg.maxDlHqTx,
1234 cellRecfg->dlHqRecfg.maxMsg4HqTx);
1237 if ((cellRecfg->recfgTypes & RGR_CELL_CFI_RECFG) &&
1238 ((cellRecfg->cfiRecfg.cfi < RGSCH_MIN_CFI_VAL) ||
1239 (cellRecfg->cfiRecfg.cfi > RGSCH_MAX_CFI_VAL)))
1241 DU_LOG("\nERROR --> SCH : Invalid CFI configuration %d",
1242 cellRecfg->cfiRecfg.cfi);
1245 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
1247 /* ccpu00138567- Removing validation check for resourceSize as 0.
1248 * From the spec, n2RB value 0 is a valid config. */
1249 if ((cellRecfg->pucchRecfg.n1PucchAn == 0) ||
1250 (cellRecfg->pucchRecfg.resourceSize >= (*cell)->bwCfg.ulTotalBw/2)||
1251 ((cellRecfg->pucchRecfg.deltaShift < RGSCH_PUCCH_MINVAL_DS) ||
1252 (cellRecfg->pucchRecfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS)) ||
1253 (cellRecfg->pucchRecfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
1255 DU_LOG("\nERROR --> SCH : Invalid PUCCH configuration: "
1256 "N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
1257 cellRecfg->pucchRecfg.resourceSize,
1258 cellRecfg->pucchRecfg.n1PucchAn,
1259 cellRecfg->pucchRecfg.deltaShift,
1260 cellRecfg->pucchRecfg.cyclicShift);
1264 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
1266 if (cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsBwEnum > RGR_SRS_BWCFG_7)
1268 DU_LOG("\nERROR --> SCH : Invalid SRS configuration: "
1269 "srsBw %d", (uint8_t)cellRecfg->srsRecfg.srsBwEnum);
1273 /*ccpu00116923 - ADD - Srs Present support - Start*/
1276 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 13)
1278 if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 14)
1281 DU_LOG("\nERROR --> SCH : Invalid Subframe configuration ");
1285 /*ccpu00116923 - ADD - Srs Present support - End*/
1287 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
1289 if ((cellRecfg->rachRecfg.preambleFormat > RGSCH_MAX_RA_PREAMBLE_FMT) ||
1290 ((cellRecfg->rachRecfg.raWinSize < RGSCH_MIN_RA_WINSIZE) ||
1291 (cellRecfg->rachRecfg.raWinSize > RGSCH_MAX_RA_WINSIZE)) ||
1292 (cellRecfg->rachRecfg.maxMsg3Tx < RGSCH_MIN_HQ_TX) ||
1293 ((cellRecfg->rachRecfg.numRaPreamble < RGSCH_MIN_NUM_RA_PREAMBLE)
1294 || (cellRecfg->rachRecfg.numRaPreamble > RGSCH_MAX_NUM_RA_PREAMBLE))
1295 || (cellRecfg->rachRecfg.sizeRaPreambleGrpA >
1296 cellRecfg->rachRecfg.numRaPreamble) ||
1297 (cellRecfg->rachRecfg.prachResource >
1298 (*cell)->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB))
1300 DU_LOG("\nERROR --> SCH : Invalid RACH configuration:"
1301 " preamble Fmt %d raWinSize %d maxMsg3Tx %d",
1302 cellRecfg->rachRecfg.preambleFormat,
1303 cellRecfg->rachRecfg.raWinSize,
1304 cellRecfg->rachRecfg.maxMsg3Tx);
1305 DU_LOG("\nERROR --> SCH : Invalid RACH configuration:"
1306 "numRaPreamble %d sizeRaPreambleGrpA %d",
1307 cellRecfg->rachRecfg.numRaPreamble,
1308 cellRecfg->rachRecfg.sizeRaPreambleGrpA);
1314 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
1316 if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellRecfg->siReCfg))) != ROK)
1318 DU_LOG("\nERROR --> SCH : Validation for SI"
1319 "Re-configuration failed");
1323 #endif /*RGR_SI_SCH */
1325 /* LTE_ADV_FLAG_REMOVED_START */
1326 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
1328 /* Checkin whether DSFR is enbaled without enabling SFR.
1329 * So we need to check if SFR is enabled along with DSFR
1330 * in the same reconfiguration or it is already enabled earlier*/
1331 if((cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR) &&
1332 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.dsfrCfg.status))
1334 if(!(((cellRecfg->rgrLteAdvCfg.pres & RGR_SFR) &&
1335 (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.sfrCfg.status)) ||
1336 ((*cell)->lteAdvCb.sfrCfg.status == RGR_ENABLE)))
1338 DU_LOG("\nERROR --> SCH : DSFR is enbaled"
1339 "Without enabling SFR");
1343 if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellRecfg->rgrLteAdvCfg),
1344 (*cell)->bwCfg.dlTotalBw)) != ROK)
1346 DU_LOG("\nERROR --> SCH : Validation for Lte Adv"
1347 "Re-configuration failed");
1351 /* LTE_ADV_FLAG_REMOVED_END */
1353 /* Validating minimum resource for non-CSG users */
1354 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
1356 if (cellRecfg->csgParamCfg.minDlResNonCsg > 100)
1358 DU_LOG("\nERROR --> SCH : Invalid Configuration "
1359 "of minimum DL resources for NON-CSG");
1362 if (cellRecfg->csgParamCfg.minUlResNonCsg > 100)
1364 DU_LOG("\nERROR --> SCH : Invalid Configuration "
1365 "of minimum UL resources for NON-CSG");
1369 errInfo->errCause = RGSCHERR_NONE;
1371 } /* rgSCHCfgVldtRgrCellRecfg */
1375 * @brief Ue SCell configuration for scheduler. It is invoked during first time
1376 * Scell configuration. It is not for reconfiguration
1380 * Function : rgSCHSCellCfgUeCfg
1382 * This functions updates UE specific scheduler
1383 * information upon UE SCell first time Scell configuration
1385 * @param[in] RgSchCellCb *cell
1386 * @param[in] RgSchUeCb *ue
1387 * @param[int] RgrUeRecfg *ueRecfg
1388 * @param[out] RgSchErrInfo *err
1393 S16 rgSCHSCellCfgUeCfg
1397 RgrUeRecfg *ueRecfg,
1402 Inst inst = cell->instIdx;
1403 RgSchCellCb *secCellCb = NULLP;
1404 uint8_t sCellidx = 0;
1405 RgSchUeCellInfo *sCellInfo = NULLP;
1406 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1408 RgrUeAprdDlCqiCfg *aCqiCfg;
1409 RgrUePrdDlCqiCfg *pCqiCfg;
1412 DU_LOG("\nINFO --> SCH : SCELL recfg received from APP \n");
1414 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1415 "--------------------------------------------------------------------\n"
1416 "UE SCell ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1417 "--------------------------------------------------------------------\n",
1418 ue->ueId, cell->cellId));
1421 for(idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1423 /* Allocate the Ue control block */
1424 if (((rgSCHUtlAllocSBuf(inst, (Data **)&sCellInfo,
1425 sizeof(RgSchUeCellInfo))) != ROK))
1427 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]SCellIdx :Memomy allocation "
1428 "Failed while Adding SCell Information\n", idx));
1433 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1436 sCellInfo->sCellIdx = sCellInfoCfg->sCellIdx;
1437 sCellInfo->sCellId = sCellInfoCfg->sCellId;
1439 if(PRSNT_NODEF == sCellInfoCfg->sCellDeActTmr.pres)
1441 /* Configure implicit release */
1442 ue->sCellDeactTmrVal.val = sCellInfoCfg->sCellDeActTmr.val;
1443 ue->isScellExplicitDeAct = FALSE;
1444 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1446 else if (rgSchCb[cell->instIdx].genCfg.isSCellActDeactAlgoEnable == TRUE)
1448 /* Configure explicit release */
1449 ue->sCellDeactTmrVal.val = RGSCH_SCELL_DEACT_TMR_INFINITY_VAL;
1450 ue->isScellExplicitDeAct = TRUE;
1451 ue->sCellDeactTmrVal.pres = PRSNT_NODEF;
1455 ue->sCellDeactTmrVal.val = 0;
1456 ue->isScellExplicitDeAct = FALSE;
1457 ue->sCellDeactTmrVal.pres = NOTPRSNT;
1460 sCellInfo->sCellState = RG_SCH_SCELL_INACTIVE;
1463 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = sCellInfo;
1464 sCellidx = ((sCellInfo->sCellId -
1465 rgSchCb[cell->instIdx].genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
1466 ue->cellIdToCellIdxMap[sCellidx] = sCellInfo->sCellIdx;
1468 /* For for time one Scell got added, setting allocCmnUlPdcch flag to TRUE, So that
1469 we will allocate PDCCH from common search space and the csiRequest field in DCI0 will
1470 be one bit (spec 36.213 sec 7.2.1)*/
1472 if ( ue->numSCells == 0)
1474 ue->allocCmnUlPdcch = TRUE;
1479 DU_LOG("\nDEBUG --> SCH : SCell added for ue %d numScells %d\n",ue->ueId,ue->numSCells);
1481 /* retrieve teh sec cell Cb */
1482 if((secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, sCellInfo->sCellId)) == NULLP)
1484 DU_LOG("\nERROR --> SCH : SCell doesnt exists");
1485 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1489 if(TRUE == sCellInfoCfg->txMode.pres)
1491 sCellInfo->txMode = sCellInfoCfg->txMode;
1495 DU_LOG("\nERROR --> SCH : [%d]SCellIdx Tx mode not present ",idx);
1496 sCellInfoCfg->txMode.pres = TRUE;
1497 sCellInfoCfg->txMode.txModeEnum = RGR_UE_TM_1;
1499 sCellInfo->txMode = sCellInfoCfg->txMode;
1501 cmInitTimers (&sCellInfo->actDelayTmr, 1);
1502 cmInitTimers (&sCellInfo->deactTmr, 1);
1504 ue->f1bCsAVal += rgSCHUtlGetMaxTbSupp(sCellInfo->txMode.txModeEnum);
1507 if(TRUE == sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.pres)
1509 sCellInfo->acqiCb.aCqiCfg.aprdModeEnum =
1510 sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg.aprdModeEnum;
1513 if(TRUE == sCellInfoCfg->uePdschDedCfg.uepACfg.pAPrsnt)
1515 sCellInfo->pA.pres = TRUE;
1516 sCellInfo->pA.val = sCellInfoCfg->uePdschDedCfg.uepACfg.pA;
1520 sCellInfo->pA.pres = FALSE;
1523 aCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.aprdCqiCfg;
1524 DU_LOG("\nDEBUG --> SCH : rgSCHCfgACqiUeCfg cellId =%d,Config Presence =%d for \
1525 Sec Cell Id = %d\n",
1526 cellCb->cellId, aCqiCfg->pres,sCellInfo->sCellId);
1528 /* if aperiodic cqi is present then only call the below function as it is
1532 if( ROK != rgSCHCfgACqiUeCfg(secCellCb,ue, &sCellInfo->acqiCb,
1533 sCellInfo->txMode.txModeEnum, aCqiCfg, ue->ueCatEnum))
1535 DU_LOG("\nERROR --> SCH : [%d]SCellIdx ACQI Cfg"
1536 "failed..n\n", idx);
1537 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1541 /* Configuring PCQI */
1542 /* Scell needs to be added to the
1543 * pcqi list only after activation */
1544 pCqiCfg = &sCellInfoCfg->ueSCellDlCqiCfg.prdCqiCfg;
1546 if(ROK != rgSCHSCellPCqiCfg(cell,secCellCb,ue,pCqiCfg,
1547 ue->ueCatEnum,sCellInfoCfg->sCellIdx))
1549 DU_LOG("\nERROR --> SCH : [%d]SCellIdx PCQI Cfg failed..n\n", idx);
1550 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1555 /* Configuring ACQI */
1557 /* Stroing the secCell for easy access */
1558 sCellInfo->cell = secCellCb;
1562 if (ROK != rgSCHLaaInitDlRbAllocCb(secCellCb,
1563 &sCellInfo->dlAllocCb))
1568 /* Initialize Harq entity */
1570 sCellInfo->hqEnt = rgSCHDhmHqEntInit(secCellCb);
1571 if (sCellInfo->hqEnt == NULLP)
1573 DU_LOG("\nERROR --> SCH : [%d]UEID:Hq Entity Initialization "
1574 "failed in config\n", ue->ueId);
1575 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1579 rgSCHEmtcHqPAlloc(secCellCb, sCellInfo->hqEnt);
1581 rgSCHCmnDlInitHqEnt(secCellCb, sCellInfo->hqEnt);
1583 sCellInfo->hqEnt->ue = ue;
1584 /* Init SCell Specific Sched Spfc UE DL CB */
1585 if ((secCellCb->sc.apis->rgSCHRgrSCellUeCfg(secCellCb, ue, sCellInfoCfg, err)) != ROK)
1587 DU_LOG("\nERROR --> SCH : Spec Sched DL UE CFG FAILED\n");
1588 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1593 if((rgSCHUtlAllocUeANFdbkInfo(ue,sCellInfoCfg->sCellIdx)) != ROK)
1595 DU_LOG("\nERROR --> SCH : [%d]UEID:Memomy allocation "
1596 "Failed while UE related Ack Nack Information\n",
1598 rgSCHSCellFreeBuf (inst,ue,ueRecfg,idx);
1601 #endif /* LTE_TDD */
1604 sCellInfo->sCellLnk.node = (PTR)sCellInfo;
1605 cmLListAdd2Tail(&secCellCb->sCellUeLst, &sCellInfo->sCellLnk);
1608 /* Inserting UECB into SCELL DBM */
1609 rgSCHDbmInsUeCb(secCellCb, ue);
1612 #ifndef MAC_5GTF_UPDATE
1613 ue->ul.useExtBSRSizes = ueRecfg->ueSCellCfgInfo.useExtBSRSizes;
1615 ue->ul.useExtBSRSizes = TRUE;
1618 for (idx = 0; idx < RGSCH_ULCTRL_RECP_DIST; idx++)
1620 ue->ul.ctrlOnServCellIdx[idx] = 0xFF;
1622 /* Trigger SCell addition to primary MAC */
1625 } /* rgSCHSCellCfgUeCfg */
1628 * @brief UE SCell PUCCH reconfiguration for scheduler
1632 * Function : rgSCHSCellCfgUePucchReCfg
1634 * This functions updates UE specific scheduler
1635 * information upon UE SCell PUCCH reconfiguration
1637 * @param[in] RgSchCellCb *cell
1638 * @param[in] RgSchUeCb *ue
1639 * @param[int] RgrUeRecfg *ueRecfg
1640 * @param[out] RgSchErrInfo *err
1645 S16 rgSCHSCellCfgUePucchReCfg
1649 RgrUeRecfg *ueRecfg,
1653 Inst inst = cell->instIdx;
1654 RgrUeSCellAckPucchCfg *sCellPucchRecfg = NULLP;
1657 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1658 "--------------------------------------------------------------------\n"
1659 "UE SCell PUCCH ReConfiguration at SCH: rnti (%u) cell(%u)\n"
1660 "--------------------------------------------------------------------\n",
1661 ue->ueId, cell->cellId));
1664 sCellPucchRecfg = &ueRecfg->sCellAckN1ResCfg;
1665 /* Copy the UCI format type suported/configured for UE */
1666 ue->uciFrmtTyp = sCellPucchRecfg->pucchFormatType;
1668 if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
1670 ue->n1PucchF1bResCb.cw1N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count;
1671 ue->n1PucchF1bResCb.cw2N1ResCount = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count;
1673 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1Count; idx++)
1675 ue->n1PucchF1bResCb.cw1N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb1[idx];
1678 for(idx = 0; idx < sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2Count; idx++)
1680 ue->n1PucchF1bResCb.cw2N1Res[idx].n1PucchIdx = sCellPucchRecfg->u.format1Bcs.sCellAckN1ResTb2[idx];
1684 else if (ue->uciFrmtTyp == RG_SCH_UCI_FORMAT3)
1686 ue->n3PucchResCb.antP0N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0Count;
1687 ue->n3PucchResCb.antP1N3ResCount = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1Count;
1688 for (idx = 0;idx < ue->n3PucchResCb.antP0N3ResCount; idx++ )
1690 ue->n3PucchResCb.antP0N3Res[idx].n3PucchIdx
1691 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP0[idx];
1692 ue->n3PucchResCb.antP0N3Res[idx].n3Lnk.node = NULLP;
1693 ue->n3PucchResCb.antP0N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1695 for (idx = 0;idx < ue->n3PucchResCb.antP1N3ResCount; idx++ )
1697 ue->n3PucchResCb.antP1N3Res[idx].n3PucchIdx
1698 = sCellPucchRecfg->u.format3.sCellAckN3ResAntP1[idx];
1699 ue->n3PucchResCb.antP1N3Res[idx].n3Lnk.node = NULLP;
1700 ue->n3PucchResCb.antP1N3Res[idx].sCellIdx = RGSCH_INVALID_CELL_IDX;
1702 ue->simulAckNackCQIFormat3 = ueRecfg->simulAckNackCQIFormat3;
1707 DU_LOG("\nERROR --> SCH : Wrong PUCCH Format:%d configured for CA",ue->uciFrmtTyp);
1712 } /* rgSCHSCellCfgUePucchReCfg */
1714 * @brief Validates the UE SCell Reconfiguration request from APP to SCH.
1718 * Function : rgSCHCfgVldtRgrUeSCellRecfg
1721 * - Validate Number of SCells
1722 * - If validated successfully,
1723 * - Process Number of SCells
1726 * - Validate SCellIdx value,
1727 * - If validated successfully,
1728 * - Process Number of RgrUeSecCellCfg
1732 * @param[in] RgrUeRecfg *ueRecfg
1733 * @param[out] RgSchCellCb *cell
1734 * @param[out] RgSchUeCb *ue
1735 * @param[out] RgSchErrInfo *errInfo
1740 S16 rgSCHCfgVldtRgrUeSCellRecfg
1742 RgrUeRecfg *ueRecfg,
1745 RgSchErrInfo *errInfo
1748 RgrUeSecCellCfg *ueSCellDedCfg = NULLP;
1749 RgSchCellCb *sCell = NULLP;
1750 Inst inst = cell->instIdx;
1753 DU_LOG("\nDEBUG --> SCH : VALIDATE RGR UE SCELL RECONFIG: cellId %d "
1754 "oldUeId %d cell %p \n", ueRecfg->cellId, ueRecfg->oldCrnti);
1755 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
1757 if((ueRecfg->ueSCellCfgInfo.numSCells > RGR_MAX_SCELL_PER_UE) ||
1758 (ueRecfg->ueSCellCfgInfo.numSCells < 1))
1760 DU_LOG("\nERROR --> SCH : Invalid number of SCELL "
1761 " in SCELL Recfg\n");
1765 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1767 ueSCellDedCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1768 if(ROK != rgSchUtlVldtCellId(inst, ueSCellDedCfg->sCellId))
1770 DU_LOG("\nERROR --> SCH : SCellId is out of range");
1773 /* Validate existence of sec cell */
1774 sCell = rgSchUtlGetCellCb(inst, ueSCellDedCfg->sCellId);
1777 DU_LOG("\nERROR --> SCH : SCell doesnt exists");
1781 /* validate the range of serv cell index */
1782 if((ueSCellDedCfg->sCellIdx < 1) ||
1783 (ueSCellDedCfg->sCellIdx > RGR_MAX_SCELL_PER_UE))
1785 DU_LOG("\nERROR --> SCH : Invalid Serv Cell Idx %d\n",
1786 ueSCellDedCfg->sCellIdx);
1790 /* Is this sec cell alredy confiured */
1791 if(NULLP != ue->cellInfo[ueSCellDedCfg->sCellIdx])
1793 DU_LOG("\nERROR --> SCH : Secll with id %d already added\n",
1794 ueSCellDedCfg->sCellIdx);
1798 /* Validate CQI config params */
1799 if((rgSCHCfgVldtUeCqiModeCfg(sCell, &ueSCellDedCfg->ueSCellDlCqiCfg)) != ROK)
1801 DU_LOG("\nERROR --> SCH : Invalid CQI Mode "
1802 " configuration for Ue %d\n",ue->ueId);
1806 /* 1. Validate UE Aperiodic CQI related parameters */
1807 if( ROK != rgSCHCfgVldtRgrUeACqiCfg (sCell, ue->ueId,
1808 &ueSCellDedCfg->ueSCellDlCqiCfg.aprdCqiCfg, ueSCellDedCfg->txMode,
1811 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Aperiodic CQI configuration\n");
1816 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1817 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg, ueRecfg->isHdFddEnbld,
1818 ueSCellDedCfg->txMode, errInfo ))
1820 if( ROK != rgSCHCfgVldtRgrUePCqiCfg (sCell, ue->ueId,
1821 &ueSCellDedCfg->ueSCellDlCqiCfg.prdCqiCfg,
1822 ueSCellDedCfg->txMode,
1826 DU_LOG("\nERROR --> SCH : rgSCHCfgVldtCqiSrSrsUeCfg: Invalid Periodic CQI configuration\n");
1830 if((ueSCellDedCfg->txMode.txModeEnum < RGR_UE_TM_1) ||
1831 (ueSCellDedCfg->txMode.txModeEnum > RGR_UE_TM_9))
1833 DU_LOG("\nERROR --> SCH : SCELL Invalid transmission mode for"
1834 " UE %d\n", (uint8_t)ueSCellDedCfg->txMode.txModeEnum);
1840 errInfo->errCause = RGSCHERR_NONE;
1841 DU_LOG("\nDEBUG --> SCH : RGR Ue SCell Reconfig validation done: "
1842 "cellId %d oldUeId %d\n", ueRecfg->cellId, ue->ueId);
1844 } /* rgSCHCfgVldtRgrUeSCellRecfg */
1847 * @brief Ue SCell configuration roll back due to failure during configuration
1852 * Function : rgSCHSCellCfgUeCfgRollBack
1854 * This functions roll backs the configuration of successfully added Scell
1856 * @param[in] RgSchCellCb *cell
1857 * @param[in] RgSchUeCb *ue
1858 * @param[int] RgrUeRecfg *ueRecfg
1859 * @param[out] RgSchErrInfo *err
1864 static S16 rgSCHSCellCfgUeCfgRollBack
1871 Inst inst = cell->instIdx;
1872 RgrUeSecCellCfg *sCellInfoCfg = NULLP;
1873 RgSchUeCellInfo *sCellInfo = NULLP;
1874 RgSchCmnCell *cellSch = NULLP;
1876 RGSCHDBGINFONEW(inst, (rgSchPBuf(inst),
1877 "--------------------------------------------------------------------\n"
1878 "UE SCell config roll back at SCH: rnti (%u) cell(%u)\n"
1879 "--------------------------------------------------------------------\n",
1880 ue->ueId, cell->cellId));
1882 /* Free all Added scell in this transaction */
1883 for(uint8_t idx = 0; idx < ueRecfg->ueSCellCfgInfo.numSCells; idx++)
1885 sCellInfoCfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[idx];
1886 sCellInfo = ue->cellInfo[(sCellInfoCfg->sCellIdx)];
1888 /* if sCellInfo is not NULLP that means this Scell is added hence
1890 if (NULLP != sCellInfo)
1892 /* Clear Scheduler specific list for this UE from the
1893 * corresponding CELL */
1894 cellSch = RG_SCH_CMN_GET_CELL(sCellInfo->cell);
1895 cellSch->apisDl->rgSCHDlUeReset(sCellInfo->cell, sCellInfo->ue);
1897 /* Delete harq Entity of Scell*/
1898 rgSCHDhmDelHqEnt(cell, &(sCellInfo->hqEnt));
1900 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
1901 sizeof(RgSchUeCellInfo));
1903 ue->cellInfo[(sCellInfoCfg->sCellIdx)] = NULLP;
1906 if (ue->numSCells == 0)
1908 ue->allocCmnUlPdcch = TRUE;
1909 /* As there is no SCell left so DCI 0 size at UE specific search space
1910 * will be recalculated as the CSI is reduced to 1 bit */
1911 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
1918 #endif /* LTE_ADV */
1920 * @brief Validates the UE reconfiguration request from RRC to MAC.
1924 * Function : rgSCHCfgVldtRgrUeRecfg
1927 * - Retrieve the UE control block.
1929 * - Validate the range of reconfigured values recieved in
1930 * re-configuration request.
1931 * - If validated successfully,
1932 * - Return ROK and pointer to the cell and ue.
1935 * - Else return RFAILED.
1937 * @param[in] Inst inst
1938 * @param[in] RgrUeRecfg *ueRecfg
1939 * @param[out] RgSchCellCb **cell
1940 * @param[out] RgSchUeCb **ue
1941 * @param[out] RgSchErrInfo *errInfo
1946 S16 rgSCHCfgVldtRgrUeRecfg
1949 RgrUeRecfg *ueRecfg,
1952 RgSchErrInfo *errInfo
1956 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RECFG;
1958 if (((*cell) == NULLP) ||
1959 ((*cell)->cellId != ueRecfg->cellId))
1961 DU_LOG("\nERROR --> SCH : Cell does not exist for OLD CRNTI:%d",ueRecfg->oldCrnti);
1965 /* Fetch the Old Ue */
1966 if ((*ue = rgSCHDbmGetUeCb(*cell, ueRecfg->oldCrnti)) == NULLP)
1968 DU_LOG("\nERROR --> SCH : OLD CRNTI:%d does not exist",
1974 if(RGR_UE_SCELL_ADD_RECFG & ueRecfg->ueRecfgTypes)
1976 S16 ret = rgSCHCfgVldtRgrUeSCellRecfg(ueRecfg,*cell, *ue, errInfo);
1979 DU_LOG("\nERROR --> SCH : Ue SCell Recfg Validation FAILED\n");
1982 errInfo->errCause = RGSCHERR_NONE;
1987 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
1989 if (rgSCHDbmGetUeCb(*cell, ueRecfg->newCrnti) != NULLP)
1991 DU_LOG("\nERROR --> SCH : NEW CRNTI:%d already exists",
1997 if ((ueRecfg->ueRecfgTypes & RGR_UE_CSG_PARAM_RECFG) &&\
1998 ((*ue)->csgMmbrSta == ueRecfg->csgMmbrSta))
2000 DU_LOG("\nERROR --> SCH : UE ID [%d] invalid CSG Membership reconfig :%d ",
2001 ueRecfg->newCrnti, (uint8_t)ueRecfg->csgMmbrSta);
2004 /* Validate values */
2005 if ((ueRecfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
2006 (ueRecfg->txMode.pres == TRUE) &&
2007 ((ueRecfg->txMode.txModeEnum < RGR_UE_TM_1) ||
2008 (ueRecfg->txMode.txModeEnum > RGR_UE_TM_7)))
2010 DU_LOG("\nERROR --> SCH : Invalid transmission mode %d"
2011 "for NEW CRNTI:%d", (uint8_t)ueRecfg->txMode.txModeEnum,ueRecfg->newCrnti);
2015 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2016 (((ueRecfg->prdDlCqiRecfg.k < 1) || (ueRecfg->prdDlCqiRecfg.k > 4)) ||
2017 ((ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx < 1) ||
2018 (ueRecfg->prdDlCqiRecfg.cqiPmiCfgIdx > 1024))))
2020 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI INFO"
2021 "OLD CRNTI:%d NEW CRNTI:%d",(uint8_t)ueRecfg->oldCrnti,ueRecfg->newCrnti);
2025 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULHARQ_RECFG) &&
2026 (ueRecfg->ueUlHqRecfg.maxUlHqTx < RGSCH_MIN_HQ_TX))
2028 DU_LOG("\nERROR --> SCH : Invalid Uplink HARQ config %d"
2029 "for NEW CRNTI:%d", ueRecfg->ueUlHqRecfg.maxUlHqTx,ueRecfg->newCrnti);
2033 if ((ueRecfg->ueRecfgTypes & RGR_UE_PRD_DLCQI_RECFG) &&
2034 (ueRecfg->prdDlCqiRecfg.prdModeEnum > RGR_PRD_CQI_MOD21))
2036 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for"
2037 " DL CQI %d NEW CRNTI:%d", (uint8_t)ueRecfg->prdDlCqiRecfg.prdModeEnum,ueRecfg->newCrnti);
2041 if ((ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG) &&
2042 (ueRecfg->cqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
2044 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for "
2045 "DL CQI %d for NEW CRNTI:%d",(uint8_t)ueRecfg->cqiCfg.cqiSetup.prdModeEnum,ueRecfg->newCrnti);
2048 #endif /* TFU_UPGRADE */
2049 /* Validate UE Category */
2050 if (ueRecfg->ueCatEnum > CM_LTE_UE_CAT_8)
2052 DU_LOG("\nERROR --> SCH : Invalid category %d for NEW CRNTI:%d",
2053 (uint8_t)ueRecfg->ueCatEnum,ueRecfg->newCrnti);
2057 /* Validate UE Access Stratum Release */
2058 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
2059 (ueRecfg->accessStratumRls > RGR_REL_11))
2061 DU_LOG("\nERROR --> SCH : Invalid Access Stratum Release %u for UE\n",
2062 ueRecfg->accessStratumRls);
2065 DU_LOG("\nINFO --> SCH : Configured Access Stratum Release %u\n", \
2066 ueRecfg->accessStratumRls);
2068 if ((ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG) &&
2069 ((ueRecfg->aprdDlCqiRecfg.pres == TRUE) &&
2070 ((ueRecfg->aprdDlCqiRecfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
2071 (*cell)->bwCfg.dlTotalBw <= 7)))
2073 DU_LOG("\nERROR --> SCH : Invalid aperiodic mode config for"
2074 " DL CQI %d for NEW CRNTI:%d", (uint8_t)ueRecfg->aprdDlCqiRecfg.aprdModeEnum,ueRecfg->newCrnti);
2077 if ((ueRecfg->ueRecfgTypes & RGR_UE_ULPWR_RECFG) &&
2078 (rgSCHCfgVldtUePwrCfg(*cell, &ueRecfg->ueUlPwrRecfg) != ROK))
2080 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
2081 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2086 if ((ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG) &&
2087 (rgSCHCfgVldtUeMeasGapAckNakRepRecfg(*cell, ueRecfg) != ROK))
2089 DU_LOG("\nERROR --> SCH : Invalid MeasGap/AckNackRep"
2090 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2094 if(rgSCHCfgVldtSpsReCfg(*cell, *ue, ueRecfg)!= ROK)
2096 DU_LOG("\nERROR --> SCH : Invalid SPS"
2097 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2102 /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
2103 if ( ROK != rgSCHCfgVldtCqiSrSrsUeReCfg(*cell, *ue, ueRecfg, errInfo))
2105 DU_LOG("\nERROR --> SCH : Invalid ACQI, PCQI/SR/SRS "
2106 "Re-configuration for NEW CRNTI:%d",ueRecfg->newCrnti);
2110 if ((ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG) &&
2111 (rgSCHCfgVldtDrxUeCfg(*cell, &(ueRecfg->ueDrxRecfg)) != ROK))
2113 DU_LOG("\nERROR --> SCH : Invalid drxParams"
2114 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2118 /* ccpu00117452 - MOD - Changed macro name from
2119 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
2121 /* Validate DL Power Control Config parameters */
2122 if(rgSCHCfgVldtCqiReptReCfg(*cell, ueRecfg)!= ROK)
2124 DU_LOG("\nERROR --> SCH : Invalid DL Power Control"
2125 " Reconfiguration for NEW CRNTI:%d",ueRecfg->newCrnti);
2128 #endif /* End of RGR_CQI_REPT */
2129 errInfo->errCause = RGSCHERR_NONE;
2131 } /* rgSCHCfgVldtRgrUeRecfg */
2135 * @brief Validates the logical channel reconfiguration request from
2140 * Function : rgSCHCfgVldtRgrLchRecfg
2143 * - Retrieve the uplink and downlink logical channel control block.
2145 * - Validate the range of reconfigured values recieved in
2146 * re-configuration request.
2147 * - If validated successfully,
2148 * - Return ROK and pointer to the cell, UE and logical channel.
2151 * - Else return RFAILED.
2153 * @param[in] RgrLchRecfg *lcRecfg
2154 * @param[out] RgSchCellCb **cell
2155 * @param[out] RgSchUeCb **ue
2156 * @param[out] RgSchUlLcCb **ulLc
2157 * @param[out] RgSchDlLcCb **dlLc
2158 * @param[out] RgSchErrInfo *errInfo
2163 S16 rgSCHCfgVldtRgrLchRecfg
2166 RgrLchRecfg *lcRecfg,
2170 RgSchErrInfo *errInfo
2173 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LC_RECFG;
2175 if (((*cell) == NULLP) ||
2176 ((*cell)->cellId != lcRecfg->cellId))
2178 DU_LOG("\nERROR --> SCH : Cell does not exist "
2179 "for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2183 /* Fetch the Ue for dedicated channels */
2184 if ((*ue = rgSCHDbmGetUeCb(*cell, lcRecfg->crnti)) == NULLP)
2186 DU_LOG("\nERROR --> SCH : UEID does not exist"
2187 "dedicated logical channel for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2191 if ((*dlLc = rgSCHDbmGetDlDedLcCb((*ue), lcRecfg->lcId)) == NULLP)
2193 DU_LOG("\nERROR --> SCH : Dedicated DL LC does not "
2194 "exist for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
2198 errInfo->errCause = RGSCHERR_NONE;
2200 } /* rgSCHCfgVldtRgrLchRecfg */
2203 * @brief Validates the UE Reset request from RRM to MAC.
2207 * Function : rgSCHCfgVldtRgrUeReset
2210 * - Retrieve the CELL control block
2211 * - If cell does not exist return RFAILED
2212 * - Retrieve UE Control block
2213 * - If UE does not exist return RFAILED
2216 * @param[in] Inst inst
2217 * @param[in] RgrRst *reset
2218 * @param[out] RgSchCellCb **cell
2219 * @param[out] RgSchUeCb **ue
2220 * @param[out] RgErrInfo *errInfo
2225 S16 rgSCHCfgVldtRgrUeReset
2231 RgSchErrInfo *errInfo
2235 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_RESET;
2237 if ((cell == NULLP) || (cell->cellId != reset->cellId))
2239 DU_LOG("\nERROR --> SCH : CELL does not exist for CRNTI:%d",
2244 if ((*ue = rgSCHDbmGetUeCb(&(*cell), reset->crnti)) == NULLP)
2246 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d",
2251 errInfo->errCause = RGSCHERR_NONE;
2254 } /* rgSCHCfgVldtRgrUeReset */
2258 * @brief Validates the logical channel reconfiguration request from
2263 * Function : rgSCHCfgVldtRgrLcgRecfg
2266 * - Retrieve the uplink and downlink logical channel control block.
2268 * - Validate the range of reconfigured values recieved in
2269 * re-configuration request.
2270 * - If validated successfully,
2271 * - Return ROK and pointer to the cell, UE and logical channel.
2274 * - Else return RFAILED.
2276 * @param[in] RgrLchRecfg *lcRecfg
2277 * @param[out] RgSchCellCb **cell
2278 * @param[out] RgSchUeCb **ue
2279 * @param[out] RgSchErrInfo *errInfo
2284 S16 rgSCHCfgVldtRgrLcgRecfg
2287 RgrLcgRecfg *lcgRecfg,
2290 RgSchErrInfo *errInfo
2293 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LCG_RECFG;
2295 if (((cell) == NULLP) ||
2296 ((cell)->cellId != lcgRecfg->cellId))
2298 DU_LOG("\nERROR --> SCH : Cell does not exist for"
2299 "CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2303 /* Fetch the Ue for dedicated channels */
2304 if ((*ue = rgSCHDbmGetUeCb(&(*cell), lcgRecfg->crnti)) == NULLP)
2306 DU_LOG("\nERROR --> SCH : UE does not exist for "
2307 "dedicated logical channel group CRNTI:%d LCGID:%d",
2308 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2311 if (lcgRecfg->ulRecfg.lcgId > (RGSCH_MAX_LCG_PER_UE - 1))
2313 DU_LOG("\nERROR --> SCH : Invalid lcgId for uplink logical"
2314 "channel CRNTI:%d LCGID:%d",
2315 lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
2319 if ((lcgRecfg->ulRecfg.gbr != 0) && (lcgRecfg->ulRecfg.mbr < lcgRecfg->ulRecfg.gbr))
2321 DU_LOG("\nERROR --> SCH : Dedicated Logical Group %d validation failed"\
2322 " for ue %d for cell %d\n", lcgRecfg->ulRecfg.lcgId,(*ue)->ueId, cell->cellId);
2325 errInfo->errCause = RGSCHERR_NONE;
2327 } /* rgSCHCfgVldtRgrLcgRecfg */
2333 * Function : rgSCHDynCfiCfg
2335 * @param[in] RgSchCellCb *cell
2336 * RgrCellCfg *cellCfg
2341 static S16 rgSCHDynCfiCfg
2349 uint8_t ulDlCfgIdx = cellCfg->ulDlCfgIdx;
2355 cell->dynCfiCb.isDynCfiEnb = cellCfg->isDynCfiEnb;
2357 /* Initializing Failure Sample Period */
2358 cell->dynCfiCb.failSamplePrd = (RGSCH_CFI_TTI_MON_INTRVL *
2359 RGSCH_CFI_STEP_UP_TTI_PRCNTG)/100;
2360 /* Initializing Number of Failure Samples */
2361 cell->dynCfiCb.numFailSamples = (RGSCH_CFI_TTI_MON_INTRVL/
2362 cell->dynCfiCb.failSamplePrd);
2363 cell->dynCfiCb.maxCfi = RGSCH_MAX_CFI_VAL;
2364 /* Allocating memory for CCE failure average array based on
2365 * monitoring interval and CCE failure sample period */
2366 if((rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&(cell->dynCfiCb.cceFailSamples),
2367 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)))) != ROK)
2369 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2373 /* Setting the Invalid value 0xFF to pdcchSfIdx, it will be assigned
2374 * a valid value during CFI swithing is done */
2375 cell->dynCfiCb.pdcchSfIdx = 0xFF;
2378 /* In case of config index 0, the mphich index can be upto 2
2379 * in other config index cases, it will always be set as 1*/
2382 maxMPhich = RG_SCH_MAX_MPHICH;
2386 maxMPhich = RG_SCH_MAX_MPHICH -1;
2388 /* Calculate the number of CCEs in the cell */
2389 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2391 for(mphIdx = 0; mphIdx < maxMPhich; mphIdx++)
2393 cell->dynCfiCb.cfi2NCceTbl[mphIdx][cfi] =
2394 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw,
2395 cell->phichCfg.ngEnum, cfi, mphIdx,
2396 cell->numTxAntPorts,
2397 cell->isCpDlExtend);
2401 /* Calculate the number of CCEs in the cell */
2402 for(cfi = 1; cfi < RG_SCH_CMN_MAX_CFI; cfi++)
2404 /* CFI Index starts from 1 so that there can be a direct mapping from
2405 actual CFI value to cfi Index. mPhich index will always be set
2407 cell->dynCfiCb.cfi2NCceTbl[0][cfi] =
2408 rgSCHUtlCalcNCce(cell->bwCfg.dlTotalBw, cell->phichCfg.ngEnum,
2409 cfi, cell->numTxAntPorts, cell->isCpDlExtend);
2412 /* Calculate the number of CCEs in the cell */
2413 if(cell->dynCfiCb.isDynCfiEnb == TRUE)
2415 /* In case if Dynamic CFI feature is enabled, default CFI
2416 * value 1 is used */
2417 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][1];
2421 cell->nCce = cell->dynCfiCb.cfi2NCceTbl[0][cellCfg->cfiCfg.cfi];
2426 numDlSf = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][9] *
2427 (RGSCH_CFI_TTI_MON_INTRVL/10);
2428 cell->dynCfiCb.cfiStepUpTtiCnt =
2429 (RGSCH_CFI_STEP_UP_TTI_PRCNTG * numDlSf)/100;
2430 cell->dynCfiCb.cfiStepDownTtiCnt =
2431 (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG * numDlSf)/100;
2433 cell->dynCfiCb.cfiStepUpTtiCnt = (RGSCH_CFI_STEP_UP_TTI_PRCNTG *
2434 RGSCH_CFI_TTI_MON_INTRVL)/100;
2435 cell->dynCfiCb.cfiStepDownTtiCnt = (RGSCH_CFI_STEP_DOWN_TTI_PERCNTG *
2436 RGSCH_CFI_TTI_MON_INTRVL)/100;
2443 * @brief Handler for the SCHED Enb configuration request from RRM to MAC.
2447 * Function : rgSCHCfgRgrSchedEnbCfg
2450 * - Invoke SCH with SCHEDULER control block to update
2451 * scheduler specific information.
2452 * - Update rgSch control block with the values recieved in the
2454 * - If successful, return ROK else RFAILED.
2456 * @param[in] RgSchCb *instCb
2457 * @param[in] SpId spId
2458 * @param[in] RgSchSchedEnbCfg *schedEnbCfg
2459 * @param[out] RgSchErrInfo *errInfo
2464 S16 rgSCHCfgRgrSchedEnbCfg
2468 RgrSchedEnbCfg *schedEnbCfg,
2469 RgSchErrInfo *errInfo
2473 DU_LOG("\nDEBUG --> SCH : APPLYING RGR SCH ENB CONFIG: \n");
2474 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_ENB_CFG;
2476 rgSchCb[inst].rgrSchedEnbCfg = *schedEnbCfg;
2477 DU_LOG("\nDEBUG --> SCH : dlSchdType %d ulSchdType %d dlTptCoeffi %d"
2478 "dlFairCoeffi %d ulTptCoeffi %d ulFairCoeffi %d\n",
2479 schedEnbCfg->dlSchdType, schedEnbCfg->ulSchdType, schedEnbCfg->dlSchInfo.dlPfs.tptCoeffi,
2480 schedEnbCfg->dlSchInfo.dlPfs.fairCoeffi, schedEnbCfg->ulSchInfo.ulPfs.tptCoeffi,
2481 schedEnbCfg->ulSchInfo.ulPfs.fairCoeffi);
2484 rgSchCb[inst].rgSchDynTdd.isDynTddEnbld = schedEnbCfg->isDynTddEnbld;
2487 if(RGR_SCH_TYPE_PFS == schedEnbCfg->dlSchdType)
2489 rgSCHEnbPfsDlCfg(inst, errInfo);
2492 errInfo->errCause = RGSCHERR_NONE;
2493 DU_LOG("\nINFO --> SCH : RGR SCH gNB done: \n");
2495 } /* rgSCHCfgRgrSchedEnbCfg */
2499 * @brief Handler for the cell configuration of 5gtf.
2503 * Function : rgSCH5gtfCellCfg
2505 * @param[in] RgSchCellCb *cell
2506 * @param[in] RgSchCellCfg *cellCfg
2511 S16 rgSCH5gtfCellCfg
2519 for(idx = 0; idx < MAX_5GTF_GROUP; idx++)
2521 cell->cell5gtfCb.ueGrp5gConf[idx].beamBitMask = 0;
2524 for(idx = 0 ; idx < MAX_5GTF_SUBFRAME_INFO ; ++idx)
2526 cell->cell5gtfCb.dynConfig[idx] = cellCfg->Cell5gtfCfg.dynConfig[idx];
2528 cell->cell5gtfCb.numUes = cellCfg->Cell5gtfCfg.numUes;
2529 cell->cell5gtfCb.uePerGrpPerTti = cellCfg->Cell5gtfCfg.uePerGrp;
2530 cell->cell5gtfCb.ueGrpPerTti = cellCfg->Cell5gtfCfg.ueGrpPerTti;
2531 cell->cell5gtfCb.numCCs = cellCfg->Cell5gtfCfg.numOfCC;
2532 cell->cell5gtfCb.bwPerCC = cellCfg->Cell5gtfCfg.bwPerCC;
2533 DU_LOG("\nINFO --> SCH : cell cfg at schd,numUes:%u,uepergrp:%u,uegrppertti:%u,numCC:%u,bwPerc:%u cfi %u\n",
2534 cell->cell5gtfCb.numUes,cell->cell5gtfCb.uePerGrpPerTti,cell->cell5gtfCb.ueGrpPerTti,
2535 cell->cell5gtfCb.numCCs,cell->cell5gtfCb.bwPerCC, cell->cell5gtfCb.cfi);
2540 #ifdef XEON_LMT_ITBS
2541 uint16_t gWrMaxDlItbs;
2542 uint16_t gWrMaxUlItbs;
2545 * @brief Handler for the cell configuration request from RRM to MAC.
2549 * Function : rgSCHCfgRgrCellCfg
2552 * - Invoke SCH with cell control block to update
2553 * scheduler specific information.
2554 * - Update cell control block with the values recieved in the
2556 * - Add to the active list of cells if cell becomes ACTIVE.
2557 * - If successful, return ROK else RFAILED.
2559 * @param[in] RgSchCb *instCb
2560 * @param[in] SpId spId
2561 * @param[in] RgSchCellCfg *cellCfg
2562 * @param[out] RgSchErrInfo *errInfo
2567 S16 rgSCHCfgRgrCellCfg
2571 RgrCellCfg *cellCfg,
2572 RgSchErrInfo *errInfo
2578 RgInfCellReg cellRegReq;
2579 RgSchCellCb *cell = NULLP;
2580 Inst inst = instCb->rgSchInit.inst;
2581 uint32_t Idx1 = (uint8_t)((cellCfg->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
2583 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_CFG;
2585 memset(&pst, 0, sizeof(Pst));
2587 /* Allocate the scheduler's cell control block */
2588 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&cell, sizeof(RgSchCellCb)))
2591 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2595 if(cellCfg->emtcEnable)
2597 if((ret = rgSCHEmtcCellAlloc(cell))
2600 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for emtc cell");
2605 if ((uint8_t *)cell == NULLP)
2607 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for cell");
2610 /* Initialize the lists of the cell */
2611 ret = rgSCHDbmInitCell(cell);
2614 DU_LOG("\nERROR --> SCH : DBM initialization FAILED for cell");
2615 rgSCHCfgFreeCellCb(cell);
2618 /* LTE_ADV_FLAG_REMOVED_START */
2619 if(cellCfg->rgrLteAdvCfg.pres & RGR_ABS)
2621 cell->lteAdvCb.absCfg =
2622 cellCfg->rgrLteAdvCfg.absCfg;
2623 memset(cell->lteAdvCb.absLoadInfo, 0, sizeof(uint32_t)*RGR_ABS_PATTERN_LEN);
2624 cell->lteAdvCb.absLoadTtiCnt = 0;
2627 if(cellCfg->rgrLteAdvCfg.pres & RGR_SFR)
2629 cell->lteAdvCb.sfrCfg =
2630 cellCfg->rgrLteAdvCfg.sfrCfg;
2632 if(cellCfg->rgrLteAdvCfg.pres & RGR_DSFR)
2634 cell->lteAdvCb.dsfrCfg =
2635 cellCfg->rgrLteAdvCfg.dsfrCfg;
2637 /* LTE_ADV_FLAG_REMOVED_END */
2640 cell->emtcEnable = cellCfg->emtcEnable;
2642 /* Initialize the cell */
2643 cell->cellId = cellCfg->cellId;
2644 cell->instIdx = inst;
2645 cell->macInst = cellCfg->macInst;
2646 cell->isCpUlExtend = cellCfg->isCpUlExtend;
2647 cell->isCpDlExtend = cellCfg->isCpDlExtend;
2649 cell->numTxAntPorts = rgSchCb[inst].rgrSchedEnbCfg.numTxAntPorts;
2650 if(cell->numTxAntPorts == 1)
2652 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_ONE_ANT_PORT;
2654 else if(cell->numTxAntPorts == 2)
2656 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_TWO_ANT_PORT;
2660 cell->numCellRSPerSf = RGSCH_NUM_CELL_RS_FOUR_ANT_PORT;
2662 cell->bwCfg = cellCfg->bwCfg;
2663 cell->pbchRbStart = ((((cell->bwCfg.dlTotalBw * 12)/2) - 36)/12); /* Ref section 6.6 in 36.211 */
2664 cell->pbchRbEnd = cell->pbchRbStart + 5;
2665 cell->pucchCfg = cellCfg->pucchCfg;
2666 cell->rachCfg = cellCfg->rachCfg;
2667 cell->siCfg = cellCfg->siCfg;
2668 cell->t300TmrVal = cellCfg->t300TmrVal;
2670 /*Initialize the SI CB in Cell CB */
2671 memset(&cell->siCb, 0, sizeof(RgSchSiCb));
2673 /*Fix: Added Guard Pool for RNTI which will contain RNTIs
2674 *for UEs deleted from Scheduler but not yet from MAC*/
2675 cmLListInit(&cell->rntiDb.rntiGuardPool);
2677 /* Initialize the inWindow to sync with scheduler time when ticks starts */
2679 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2680 (RG_SCH_CMN_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL));
2682 cell->siCb.inWindow = (cellCfg->siCfg.siWinSize -
2683 (RG_SCH_CMN_DL_DELTA));
2686 if(cell->siCb.inWindow < 0)
2688 cell->siCb.inWindow = 0;
2690 cell->macPreambleSet = cellCfg->macPreambleSet;
2691 cell->phichCfg = cellCfg->phichCfg;
2693 /* Initialize UL and DL CCCH logical channels */
2694 cell->ulCcchId = RGSCH_INVALID_LC_ID;
2695 cell->dlCcchId = RGSCH_INVALID_LC_ID;
2697 /* Update SRS configuration */
2698 cell->srsCfg.isSrsCfgPres = cellCfg->srsCfg.isSrsCfgSetup;
2699 if(cellCfg->srsCfg.isSrsCfgSetup)
2701 cell->srsCfg.srsCfgPrdEnum = cellCfg->srsCfg.srsCfgPrdEnum;
2702 cell->srsCfg.srsBwEnum = cellCfg->srsCfg.srsBwEnum;
2703 cell->srsCfg.srsTxOffst =
2704 rgSrsTxOffstTbl[cellCfg->srsCfg.srsSubFrameCfg];
2705 /*ccpu00116923 - ADD - Srs Present support */
2707 cell->srsCfg.srsSubFrameCfg = cellCfg->srsCfg.srsSubFrameCfg;
2711 /* Configure all the common logical channels for the cell */
2712 for(idx = 0; idx < cellCfg->numCmnLcs; idx++)
2714 /* This never returns failure and hence not checked for */
2715 rgSCHCfgRgrCmnLcCfg(cell, &(cellCfg->cmnLcCfg[idx]), errInfo);
2718 /* Invoke the MeasGap and ACK NACK Rep handler for cell cfg */
2720 /* Dynamic CFI cell configuration */
2721 ret = rgSCHDynCfiCfg(cell, cellCfg);
2724 DU_LOG("\nERROR --> SCH : Rgr cell Config failed at "
2725 "Scheduler for cell");
2726 rgSCHCfgFreeCellCb(cell);
2729 /* Updating Auto TM Mode enable/diable flag */
2730 cell->isAutoCfgModeEnb = cellCfg->isAutoCfgModeEnb;
2732 if(cell->isAutoCfgModeEnb)
2734 DU_LOG("\nINFO --> SCH : Auto Mode Cfg enabled durint cell cfg\n");
2737 /* CPU OvrLoad State Initialization */
2738 #ifdef XEON_LMT_ITBS
2739 cell->thresholds.maxDlItbs = gWrMaxDlItbs;
2740 cell->thresholds.maxUlItbs = gWrMaxUlItbs;
2741 DU_LOG("\nINFO --> SCH : LIMIT DL and UL ITBS %d:%d \n",gWrMaxDlItbs,gWrMaxUlItbs);
2743 cell->thresholds.maxDlItbs = RG_SCH_DL_MAX_ITBS;
2744 cell->thresholds.maxUlItbs = RG_SCH_UL_MAX_ITBS;
2746 cell->measurements.dlTpt = 0;
2747 cell->measurements.ulTpt = 0;
2748 cell->measurements.dlBytesCnt = 0;
2749 cell->measurements.ulBytesCnt = 0;
2750 cell->cpuOvrLdCntrl.cpuOvrLdIns = 0; /* 0 - No command */
2751 cell->cpuOvrLdCntrl.dlNxtIndxDecNumUeTti = 0;
2752 cell->cpuOvrLdCntrl.ulNxtIndxDecNumUeTti = 0;
2753 for ( idx = 0; idx < 10; idx++ )
2755 cell->cpuOvrLdCntrl.maxUeNewTxPerTti[idx] = cellCfg->maxDlUeNewTxPerTti;
2756 cell->cpuOvrLdCntrl.maxUeNewRxPerTti[idx] = cellCfg->maxUlUeNewTxPerTti;
2759 /* Invoke scheduler to update scheduler specific information */
2760 ret = rgSCHUtlRgrCellCfg(cell, cellCfg, errInfo);
2763 DU_LOG("\nERROR --> SCH : Rgr cell Config failed at "
2764 "Scheduler for cell ");
2765 rgSCHCfgFreeCellCb(cell);
2769 /* Invoke DHM to update DHM specific information */
2770 rgSCHDhmRgrCellCfg(cell, cellCfg, errInfo);
2773 /* Initialize RNTI DB */
2774 ret = rgSCHDbmRntiDbInit(cell, cellCfg->macRnti.startRnti,
2775 cellCfg->macRnti.size);
2778 DU_LOG("\nERROR --> SCH : Rgr Cell Config failed at"
2779 " RNTI DB init for cell");
2780 rgSCHCfgFreeCellCb(cell);
2784 /* Update the cell with recieved configuration */
2785 cell->dlHqCfg = cellCfg->dlHqCfg;
2787 DU_LOG("\nINFO --> SCH : Config DL HQTX = %d\n",cell->dlHqCfg.maxDlHqTx);
2789 cell->crntSfIdx = 0;
2790 /* Allocate the subframe allocation information */
2791 if((ret = rgSCHUtlGetSfAlloc(cell)) != ROK)
2793 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
2795 rgSCHCfgFreeCellCb(cell);
2798 /* Update RACH Related information
2799 * XXX: Below function yet to be written in RAM
2800 * To store the preambles given in the configuration for PDCCH order in the
2801 * scheduler cell control block. Initialize the PRACH Mask Index allocated
2802 * for these preambles to invalid values */
2804 cell->crntHqIdx = 0;
2805 /* Allocate the subframe allocation information */
2806 if((ret = rgSCHUtlGetRlsHqAlloc(cell)) != ROK)
2808 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for"
2810 rgSCHCfgFreeCellCb(cell);
2814 /* Associate a pair of upper and lower sapCbs with this cell */
2815 instCb->rgrSap[spId].cell = cell;
2816 instCb->tfuSap[spId].cell = cell;
2817 instCb->rgmSap[spId].cell = cell;
2818 cell->tfuSap = &(instCb->tfuSap[spId]);
2821 instCb->cells[Idx1] = cell;
2824 /* rg001.201: Added for sending TTI tick to RRM */
2825 #if (defined(RGR_RRM_TICK) || defined(RGR_CQI_REPT))
2826 /* Associate the RGR SAP as well utilized while sending TTI
2827 * Ticks to RGR User. */
2828 cell->rgrSap = &(instCb->rgrSap[spId]);
2830 cell->rgmSap = &(instCb->rgmSap[spId]);
2832 /* Store the periodicity configured */
2833 cell->rrmTtiIndPrd = cellCfg->rrmTtiIndPrd;
2837 cmLListInit(&cell->l2mList);
2840 if (rgSCHDrxCellCfg(cell,cellCfg) != ROK)
2842 DU_LOG("\nERROR --> SCH : Drx Memory allocation FAILED for"
2844 rgSCHCfgFreeCellCb(cell);
2847 cell->overLoadBackOffEnab = FALSE;/* Disabling RachOverload by default */
2848 /* Updating CSG Parameters */
2849 cell->minDlResNonCsg = cellCfg->csgParamCfg.minDlResNonCsg;
2850 cell->minUlResNonCsg = cellCfg->csgParamCfg.minUlResNonCsg;
2852 /* Register the cell with MAC */
2853 rgSCHUtlGetPstToLyr(&pst, instCb, cell->macInst);
2854 cellRegReq.cellId = cell->cellId;
2855 cellRegReq.cellSapId = spId;
2857 cellRegReq.maxDlHqProcPerUe = rgSchTddDlNumHarqProcTbl[cellCfg->ulDlCfgIdx];
2859 cellRegReq.maxDlHqProcPerUe = RGSCH_MAX_DL_HQ_PROC;
2861 RgSchMacCellReg(&pst, &cellRegReq);
2864 cell->tenbStats = TSL2AllocCellStatsBlk(cell->cellId);
2865 cell->tenbStats->cellId = cell->cellId;
2868 rgSCHUtlCalcDciSizes(cell);
2871 /* Initilalization of the list of UE for which this cell is secondary cell*/
2872 cmLListInit(&cell->sCellUeLst);
2877 ret = rgSCHLaaSCellCbInit(cell, cellCfg);
2880 DU_LOG("\nERROR --> SCH : Rgr Cell Config failed at"
2881 " Initializing the LAA Cell Control Cb");
2882 rgSCHCfgFreeCellCb(cell);
2885 cell->isPucchFormat3Sptd = cellCfg->isPucchFormat3Sptd;
2886 DU_LOG("\nINFO --> SCH : Format 3 is Enabled");
2887 DU_LOG ("\n Format 3 is Enabled for CELL:%d",cell->cellId);
2893 if(cell->emtcEnable)
2895 if (rgSCHCfgEmtcCellCfg(cell,&(cellCfg->emtcCellCfg)) != ROK)
2897 DU_LOG("\nERROR --> SCH : EMTC Config Failed cell");
2904 ret = rgSCH5gtfCellCfg(cell, cellCfg);
2907 DU_LOG("\nERROR --> SCH : 5GTF Rgr Cell Config failed");
2908 rgSCHCfgFreeCellCb(cell);
2912 errInfo->errCause = RGSCHERR_NONE;
2914 } /* rgSCHCfgRgrCellCfg */
2917 * @brief Handler for the UE configuration request from RRC to MAC.
2921 * Function : rgSCHCfgRgrUeCfg
2924 * - Allocate and create UE control block.
2925 * - Update UE control block with the values recieved in the
2927 * - Invoke RAM, SCH, UHM and DHM with created UE control block, to
2928 * update random access, scheduler, uplink harq and downlink harq
2929 * specific information respectively.
2930 * - If successful, add the control block to hash list of UEs for the cell
2931 * else Rollback and FAIL.
2933 * @param[in] RgSchCellCb *cell
2934 * @param[in] RgrUeCfg *ueCfg
2935 * @param[out] RgSchErrInfo *errInfo
2940 S16 rgSCHCfgRgrUeCfg
2944 RgSchErrInfo *errInfo
2948 RgSchRaCb *raCb=NULLP;
2949 RgSchUeCb *ue = NULLP;
2950 Inst inst = cell->instIdx;
2952 RgSchDlHqEnt *hqEnt = NULLP;
2954 uint8_t ulDlCfgIdx = cell->ulDlCfgIdx;
2955 uint8_t maxSubframes ;
2956 uint8_t maxDlSubframes;
2960 RgSchUePCqiCb *cqiCb = NULLP;
2964 errInfo->errCause = RGSCHERR_CFG_RGR_UE_CFG;
2965 /* RACHO : Check for raCb only if preamble Id not provded */
2966 #ifndef PRE_DEF_UE_CTX
2967 if (ueCfg->dedPreambleId.pres == NOTPRSNT)
2969 if ((raCb = rgSCHDbmGetRaCb(cell, ueCfg->crnti)) == NULLP)
2971 DU_LOG("\nERROR --> SCH : No RaCb exists for"
2972 "CRNTI:%d ",ueCfg->crnti);
2978 /* Allocate the Ue control block */
2979 if (((rgSCHUtlAllocSBuf(inst, (Data **)&ue, sizeof(RgSchUeCb))) != ROK) ||
2980 ((uint8_t *)ue == NULLP))
2982 DU_LOG("\nERROR --> SCH : Memory allocation"
2983 " FAILED for CRNTI:%d", ueCfg->crnti);
2987 /* Inititialize Ue control block */
2988 ue->ueId = ueCfg->crnti;
2990 /*ccpu00117778- Initialize Transmission Indices upon UE CB creation */
2992 ue->lastRprdAckNackTime.sfn = cell->crntTime.sfn;
2993 ue->lastRprdAckNackTime.subframe = cell->crntTime.slot;
2997 /* Allocate the Ue control block */
2998 if (((rgSCHUtlAllocSBuf(inst, (Data **)&(ue->cellInfo[RGSCH_PCELL_INDEX]),
2999 sizeof(RgSchUeCellInfo))) != ROK))
3002 DU_LOG("\nERROR --> SCH : [%lu]SCellIdx :Memomy allocation "
3003 "Failed while Adding SCell Information\n", idx);
3005 DU_LOG("\nERROR --> SCH : [%u]SCellIdx :Memomy allocation "
3006 "Failed while Adding SCell Information\n", idx);
3011 ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)] = RGSCH_PCELL_INDEX;
3012 ue->cellInfo[RGSCH_PCELL_INDEX]->cell = cell;
3013 ue->cellInfo[RGSCH_PCELL_INDEX]->ue = ue;
3015 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
3016 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellIdx = RGSCH_PCELL_INDEX;
3017 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellId = cell->cellId;
3019 if (ROK != rgSCHLaaInitDlRbAllocCb(cell,
3020 &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb))
3026 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ue,cell);
3027 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
3028 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
3029 ue->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
3030 ue->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
3032 /* LTE_ADV_FLAG_REMOVED_START */
3033 /* While doing UE configuration for SFR at SCH, by default
3034 * CC UE power is configured as LOW */
3035 ue->lteAdvUeCb.isCCUePHigh = FALSE;
3036 /* LTE_ADV_FLAG_REMOVED_END */
3038 /* Initialize the lists of the UE */
3039 if((rgSCHDbmInitUe(ue)) != ROK)
3041 DU_LOG("\nERROR --> SCH : DBM initialization "
3042 "failed for CRNTI:%d", ueCfg->crnti);
3048 if(TRUE == raCb->isEmtcRaCb)
3050 ue->isEmtcUe = TRUE;
3051 if (rgSCHUtlUpdUeEmtcInfo(cell, ueCfg, ue) != ROK)
3053 DU_LOG("\nERROR --> SCH : EMTC UE Cfg"
3054 "failed for CRNTI:%d", ueCfg->crnti);
3061 /* Initialize scheduler related information for UE */
3062 if(rgSCHUtlRgrUeCfg(cell, ue, ueCfg, errInfo) != ROK)
3064 DU_LOG("\nERROR --> SCH : Scheduler handling "
3065 "failed in config for CRNTI:%d", ueCfg->crnti);
3069 ret = rgSCHUhmHqEntInit(cell, ue);
3072 DU_LOG("\nERROR --> SCH : UHM HARQ Ent Init "
3073 "Failed for CRNTI:%d", ueCfg->crnti);
3077 /* Initialize RAM related information for UE
3078 * RACHO: if preamble Id is present in ueCfg then raCb will be NULL
3079 * so rgSCHRamRgrUeCfg should take care of creating raCb */
3080 if ((ueCfg->dedPreambleId.pres == NOTPRSNT) && (NULLP != raCb) )
3082 if((rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo)) != ROK)
3084 DU_LOG("\nERROR --> SCH : Random access "
3085 "handling config failed for CRNTI:%d", ueCfg->crnti);
3091 RG_SCH_CMN_GET_UE_HQE(ue, cell) = rgSCHDhmHqEntInit(cell);
3092 hqEnt = RG_SCH_CMN_GET_UE_HQE(ue, cell);
3095 DU_LOG("\nERROR --> SCH : Hq Entity Initialization "
3096 "failed in config for CRNTI:%d", ueCfg->crnti);
3100 rgSCHEmtcHqPAlloc(cell, hqEnt);
3103 /* Fix : syed Assign hqEnt to UE only if msg4 is done */
3105 rgSCHCmnDlInitHqEnt(cell, hqEnt);
3107 /* For Hand-In UE Request Aper CQI report
3109 if (ueCfg->ueDlCqiCfg.aprdCqiCfg.pres)
3111 /* Set APCQI for Pcell only*/
3112 ue->dl.reqForCqi = RG_SCH_APCQI_SERVING_CC;
3117 maxDlSubframes = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
3118 maxSubframes = 2 * maxDlSubframes;
3119 ue->dl.numHqDlSfInfo = maxSubframes;
3120 rgSCHUtlAllocSBuf(cell->instIdx,
3121 (Data **)&ue->dl.dlSfHqInfo, sizeof(RgSchDlHqInfo) * (ue->dl.numHqDlSfInfo));
3124 ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_slotS;
3127 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3129 cmLListInit(&ue->dl.dlSfHqInfo[idx].hqPLst);
3130 ue->dl.dlSfHqInfo[idx].dlSfUeLnk.node = NULLP;
3136 for (cellIdx = 0;cellIdx < MAX_5GTF_CELL ; cellIdx++)
3138 for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
3140 cmLListInit(&ue->dl.dlSfHqInfo[cellIdx][idx].hqPLst);
3141 ue->dl.dlSfHqInfo[cellIdx][idx].dlSfUeLnk.node = NULLP;
3147 rgSCHLaaInitDlHqInfo(cell, ue);
3151 /* Initialize lcgIds to Invalid */
3152 for (lcgCnt = 0; lcgCnt < RGSCH_MAX_LCG_PER_UE; lcgCnt++)
3154 ue->ul.lcgArr[lcgCnt].lcgId = RGSCH_INVALID_LCG_ID;
3158 rgSCHCfgRgrUePhrMsg3(cell,raCb,ue,errInfo);
3159 /* Moved this code out of rgSCHCfgRgrUePhrMsg3()
3160 * as it was not the appropriate place to
3162 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3164 DU_LOG("\nERROR --> SCH : RNTI:%d RaCb deleted as Msg4 transmission is done",
3166 rgSCHRamDelRaCb(cell, raCb, FALSE);
3169 /* Initialize uplink HARQ related information for UE */
3170 rgSCHUhmRgrUeCfg(cell, ue, ueCfg);
3171 cmInitTimers(&ue->bsrTmr, 1);
3173 /* Added periodic BSR timer */
3174 cmInitTimers(&ue->bsrTmr, 1);
3176 /* Fix - Added proper configuration from U-ARM */
3177 if(ueCfg->ueBsrTmrCfg.isPrdBsrTmrPres == TRUE)
3179 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = TRUE;
3180 ue->ul.bsrTmrCfg.prdBsrTmr = ueCfg->ueBsrTmrCfg.prdBsrTmr;
3181 ue->ul.bsrTmrCfg.retxBsrTmr = ueCfg->ueBsrTmrCfg.retxBsrTmr;
3185 /* Initialize downlink HARQ related information for UE */
3186 rgSCHDhmRgrUeCfg(cell, ue, ueCfg, errInfo);
3188 /* Initialize MeasureGap and Acknack Rep Information for UE */
3189 if((rgSCHMeasGapANRepUeCfg(cell, ue, ueCfg)) != ROK)
3191 DU_LOG("\nERROR --> SCH : Measurement Gap and"
3192 " AckNack Rep failed in Config for CRNTI:%d", ueCfg->crnti);
3198 if((rgSCHUtlAllocUeANFdbkInfo(ue,RGSCH_PCELL_INDEX)) != ROK)
3200 DU_LOG("\nERROR --> SCH : Memomy allocation "
3201 "Failed while UE related Ack Nack Information for CRNTI:%d",
3205 ue->dl.ackNackMode = ueCfg->ackNackModeEnum;
3206 #endif /* LTE_TDD */
3209 rgSCHDbmInsUeCb(cell, ue);
3212 /* Int ialize APeriodic CQI/PMI/RI Information for UE */
3214 DU_LOG("\nDEBUG --> SCH : rgSCHCfgRgrUeCfg CellID=%d UeId =%d AcqiCfg Pres =%d", cell->cellId, ue->ueId,\
3215 ueCfg->ueDlCqiCfg.aprdCqiCfg.pres);
3217 /*Store Trigger Set Bit String to UE */
3219 ret = rgSCHCfgACqiUeCfg(cell,ue, (RG_SCH_CMN_GET_ACQICB(ue,cell)),ue->mimoInfo.txMode,
3220 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ue->ueCatEnum);
3222 ue->cqiRiWritIdx = 0;
3223 ue->cqiRiReadIdx = 0;
3224 /* Initialize Periodic CQI/PMI, RI Information for UE */
3225 ret = rgSCHCfgPCqiUeCfg(cell, ue, &ueCfg->ueDlCqiCfg.prdCqiCfg,
3228 /* Initialize UL SRS Information for UE */
3229 ret = rgSCHCfgSrsUeCfg(cell, ue, &ueCfg->srsCfg);
3231 /* Initialize SR Information for UE */
3232 ret = rgSCHCfgSrUeCfg(cell, ue, &ueCfg->srCfg);
3236 if (rgSCHHdFddUeCfg(cell, ue, ueCfg->isHdFddEnbld) != ROK)
3238 DU_LOG("\nERROR --> SCH : Could not do HD-FDD config for CRNTI:%d",ueCfg->crnti);
3242 #endif /* LTEMAC_HDFDD */
3243 /* ccpu00117452 - MOD - Changed macro name from
3244 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
3246 ue->cqiReptCfgInfo.numColltdCqiRept =
3247 ueCfg->ueCqiReptCfg.numColltdCqiRept;
3248 #endif /* End of RGR_CQI_REPT */
3250 RG_SCH_CMN_GET_PA(ue,cell).pres = FALSE;
3251 if (RG_SCH_UE_CFG_ISPAPRSNT(ueCfg->uePdschDedCfg.uepACfg))
3253 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
3254 RG_SCH_CMN_GET_PA(ue,cell).val = ueCfg->uePdschDedCfg.uepACfg.pA;
3257 ue->isDrxEnabled = ueCfg->ueDrxCfg.isDrxEnabled;
3259 if ( ue->isDrxEnabled )
3261 if((rgSCHDrxUeCfg(cell,ue,ueCfg)) != ROK )
3263 DU_LOG("\nERROR --> SCH : DRX configuration failed");
3268 /* LTE_ADV_FLAG_REMOVED_START */
3269 if ((cell->lteAdvCb.sfrCfg.status == RGR_ENABLE) || \
3270 (cell->lteAdvCb.absCfg.status == RGR_ENABLE))
3272 ue->lteAdvUeCb.rgrLteAdvUeCfg = ueCfg->ueLteAdvCfg;
3274 /* LTE_ADV_FLAG_REMOVED_END */
3277 ue->tenbStats = TSL2AllocUeStatsBlk(ue->ueId);
3278 ue->tenbStats->stats.rnti = ue->ueId;
3281 /*Update A Value for PCell TBs*/
3282 ue->f1bCsAVal = rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode);
3283 DU_LOG("\nERROR --> SCH : UeCfg A value is %d\n",ue->f1bCsAVal);
3285 errInfo->errCause = RGSCHERR_NONE;
3287 ue->accessStratumRls = ueCfg->accessStratumRls;
3288 if (ue->numSCells > 0)
3291 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3295 /* 1 bit CSI Access Stratum Release Change */
3296 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3304 rgSCHCfgFreeUeCb(cell, ue);
3307 } /* rgSCHCfgRgrUeCfg */
3310 * @brief Handler for PHR for MSG3.
3314 * Function : rgSCHCfgRgrUePhrMsg3
3317 * Handle PHR related config for MSG3
3319 * @param[in] RgSchCellCb *cell
3320 * @param[in] RgrUeCb *ueCb
3321 * @param[in] RgSchRaCb *raCb
3322 * @param[out] RgSchErrInfo *errInfo
3324 static Void rgSCHCfgRgrUePhrMsg3
3329 RgSchErrInfo *errInfo
3333 /* Record msg3 allocation in the UE */
3334 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3336 /* If raCb received PHR, update scheduler */
3337 if(raCb->phr.pres == TRUE)
3339 ue->macCeRptTime = raCb->msg3AllocTime;
3340 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3350 * Function : rgSCHDynCfiReCfg
3352 * @param[in] RgSchCellCb *cell
3358 Void rgSCHDynCfiReCfg
3365 RgSchCmnDlCell *cellSchDl = RG_SCH_CMN_GET_DL_CELL(cell);
3369 cell->dynCfiCb.ttiCnt = 0;
3370 cellSchDl->newCfi = cellSchDl->currCfi;
3374 /* Resetting the parameters*/
3375 cell->dynCfiCb.cceFailCnt = 0;
3376 cell->dynCfiCb.cceFailSum = 0;
3377 cell->dynCfiCb.prevCceFailIdx = 0;
3379 for(idx = 0; idx < cell->dynCfiCb.numFailSamples; idx++)
3381 cell->dynCfiCb.cceFailSamples[idx] = 0;
3384 cell->dynCfiCb.cceUsed = 0;
3385 cell->dynCfiCb.lowCceCnt = 0;
3386 cell->dynCfiCb.ttiCnt = 0;
3390 * @brief Handler for the cell reconfiguration request from RRM to MAC.
3394 * Function : rgSCHCfgRgrCellRecfg
3397 * - Invoke SCH with cell control block to update
3398 * scheduler specific information.
3399 * - Update cell control block with the values recieved in the
3401 * - If successful, return ROK else RFAILED.
3403 * @param[in] RgSchCellCb *cell
3404 * @param[in] RgrCellRecfg *cellRecfg
3405 * @param[out] RgSchErrInfo *errInfo
3410 S16 rgSCHCfgRgrCellRecfg
3413 RgrCellRecfg *cellRecfg,
3414 RgSchErrInfo *errInfo
3418 Inst inst = cell->instIdx;
3419 /* LTE_ADV_FLAG_REMOVED_START */
3421 uint16_t len; /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3422 /* LTE_ADV_FLAG_REMOVED_END */
3424 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_RECFG;
3426 /* Invoke scheduler to update scheduler specific information */
3427 ret = rgSCHUtlRgrCellRecfg(cell, cellRecfg, errInfo);
3430 DU_LOG("\nERROR --> SCH : RGR Cell re-configuration failed "
3435 /* Invoke DHM to update DHM specific information */
3436 rgSCHDhmRgrCellRecfg(cell, cellRecfg, errInfo);
3438 /* PUCCH Reconfiguration */
3439 if (cellRecfg->recfgTypes & RGR_CELL_PUCCH_RECFG)
3441 cell->pucchCfg = cellRecfg->pucchRecfg;
3444 /* SRS Reconfiguration */
3445 if (cellRecfg->recfgTypes & RGR_CELL_SRS_RECFG)
3447 cell->srsCfg.isSrsCfgPres = cellRecfg->srsRecfg.isSrsCfgSetup;
3448 if(cellRecfg->srsRecfg.isSrsCfgSetup)
3450 cell->srsCfg.srsCfgPrdEnum = cellRecfg->srsRecfg.srsCfgPrdEnum;
3451 cell->srsCfg.srsBwEnum = cellRecfg->srsRecfg.srsBwEnum;
3452 cell->srsCfg.srsTxOffst =
3453 rgSrsTxOffstTbl[cellRecfg->srsRecfg.srsSubFrameCfg];
3454 /*ccpu00116923 - ADD - Srs Present support */
3456 cell->srsCfg.srsSubFrameCfg = cellRecfg->srsRecfg.srsSubFrameCfg;
3461 /* RACH Reconfiguration */
3462 if (cellRecfg->recfgTypes & RGR_CELL_RACH_RECFG)
3464 cell->rachCfg = cellRecfg->rachRecfg;
3467 /* ccpu00132256:MOD: Moved this assignment from Validation to here.*/
3468 if (cellRecfg->recfgTypes & RGR_CELL_TMRS_RECFG)
3470 cell->t300TmrVal = cellRecfg->t300TmrVal;
3473 /* SI Reconfiguration */
3474 if (cellRecfg->recfgTypes & RGR_CELL_SI_RECFG)
3476 /*Set the specified SI configuration. */
3477 cell->siCb.newSiCfg = cellRecfg->siReCfg;
3478 /* Set the Bit mask for SI re-configuration */
3479 cell->siCb.siBitMask |= RGSCH_SI_SICFG_UPD;
3481 if(cell->emtcEnable)
3483 rgSchEmtcUpdSiCfg(cell, cellRecfg);
3487 #endif /*RGR_SI_SCH */
3489 /* Overload RACH Control changes */
3490 if (cellRecfg->recfgTypes & RGR_CELL_CNTRL_CMD_RECFG)
3492 if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_RACH_OVRLD)
3494 cell->overLoadBackOffEnab = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffEnb;
3495 cell->overLoadBackOffval = cellRecfg->cntrlCmdCfg.cmdDesc.rachOvrLd.backOffVal;
3497 else if (cellRecfg->cntrlCmdCfg.cmdType == RGR_CNTRL_CMD_CPU_OVRLD)
3499 if( ROK != rgSCHUtlResetCpuOvrLdState(cell, cellRecfg->cntrlCmdCfg.cmdDesc.\
3500 cpuOvrLd.instruction))
3502 DU_LOG("\nERROR --> SCH : Invalid CPU OvrLd Ins %d for cell",
3503 cellRecfg->cntrlCmdCfg.cmdDesc.cpuOvrLd.instruction);
3509 /* LTE_ADV_FLAG_REMOVED_START */
3510 if (cellRecfg->recfgTypes & RGR_CELL_LTEA_FEATURE_RECFG)
3512 if(cellRecfg->rgrLteAdvCfg.pres & RGR_ABS)
3514 cell->lteAdvCb.absCfg =
3515 cellRecfg->rgrLteAdvCfg.absCfg;
3517 if(cellRecfg->rgrLteAdvCfg.pres & RGR_SFR)
3519 memcpy(&cell->lteAdvCb.sfrCfg, &cellRecfg->rgrLteAdvCfg.sfrCfg,
3520 sizeof(RgrSfrConfig));
3521 /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
3522 if (cellRecfg->rgrLteAdvCfg.sfrCfg.status == RGR_ENABLE)
3524 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3526 /*initialise the pools of CC and CE*/
3527 if(rgSchSFRTotalPoolInit(cell, cell->subFrms[i]))
3535 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3537 /*initialise the pools of CC and CE*/
3538 rgSchSFRTotalPoolFree(&cell->subFrms[i]->sfrTotalPoolInfo, cell);
3541 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3543 /* releasing rntp info val from each subframe */
3544 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3546 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3549 /* releasing RNTP Aggregation Info from CellCb*/
3550 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3552 cell->lteAdvCb.dsfrCfg.status = RGR_DISABLE;
3556 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** Start */
3557 if(cellRecfg->rgrLteAdvCfg.pres & RGR_DSFR)
3559 cell->lteAdvCb.dsfrCfg =
3560 cellRecfg->rgrLteAdvCfg.dsfrCfg;
3561 if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
3563 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3565 /*initialise the pools of CC and CE*/
3566 if(rgSchDSFRRntpInfoInit(&cell->subFrms[i]->rntpInfo,cell,cell->bwCfg.dlTotalBw))
3571 /*Calculating the length of RNTP array based on Dl Bandwidth */
3572 len = (uint16_t)((cell->bwCfg.dlTotalBw % 8 == 0) ? (cell->bwCfg.dlTotalBw/8) : (cell->bwCfg.dlTotalBw/8 + 1)); /* KW fix for LTE_ADV */
3573 if(cell->rntpAggrInfo.pres == NOTPRSNT)
3575 if((rgSCHUtlAllocSBuf(inst, (Data**)&(cell->rntpAggrInfo.val),
3576 (len * sizeof(uint8_t)))) != ROK)
3578 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for RNTP Alloc");
3581 cell->rntpAggrInfo.pres = PRSNT_NODEF;
3582 cell->rntpAggrInfo.len = len;
3585 /* in case if DSFR is disabled, need to free RNTP pattern val*/
3588 /* releasing rntp info val from each subframe */
3589 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
3591 rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
3594 /* releasing RNTP Aggregation Info from CellCb*/
3595 rgSchDSFRRntpInfoFree(&cell->rntpAggrInfo, cell, cell->bwCfg.dlTotalBw);
3598 /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** End */
3600 /* LTE_ADV_FLAG_REMOVED_END */
3602 /* Dynamic CFI cell Reconfiguration */
3603 if(cellRecfg->recfgTypes & RGR_CELL_DYN_CFI_RECFG)
3605 if(cell->dynCfiCb.isDynCfiEnb != cellRecfg->isDynCfiEnb)
3607 if(cell->dynCfiCb.switchOvrInProgress)
3609 cell->dynCfiCb.dynCfiRecfgPend = TRUE;
3613 cell->dynCfiCb.isDynCfiEnb = cellRecfg->isDynCfiEnb;
3614 rgSCHDynCfiReCfg(cell, cellRecfg->isDynCfiEnb);
3619 /* To hanlde the case where reconfiguration comes for disabling
3620 * and then enabling before switchover period expires */
3621 cell->dynCfiCb.dynCfiRecfgPend = FALSE;
3624 /* Dynamic config of AUTO chnage flag */
3625 if(cellRecfg->recfgTypes & RGR_CELL_AUTO_CFG_MODE_RECFG)
3627 if(cell->isAutoCfgModeEnb != cellRecfg->isAutoCfgModeEnb)
3629 cell->isAutoCfgModeEnb = cellRecfg->isAutoCfgModeEnb;
3633 if(cell->isAutoCfgModeEnb)
3635 DU_LOG("\nINFO --> SCH : Auto Mode Cfg enabled durint cell recfg\n");
3639 if (cellRecfg->recfgTypes & RGR_CELL_CSG_PARAM_RECFG)
3641 cell->minDlResNonCsg = cellRecfg->csgParamCfg.minDlResNonCsg;
3642 cell->minUlResNonCsg = cellRecfg->csgParamCfg.minUlResNonCsg;
3645 errInfo->errCause = RGSCHERR_NONE;
3647 } /* rgSCHCfgRgrCellRecfg */
3650 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3654 * Function : rgSCHCfgRgrUeRecfgRntiChg
3657 * - If rnti changes,
3658 * - Invoke RAM for UE reconfiguration.
3659 * - Delete old UE from the list.
3660 * - Update the new rnti and re-insert the UE in the list.
3661 * - If successful, return ROK else RFAILED.
3663 * @param[in] RgSchCellCb *cell
3664 * @param[in] RgSchUeCb *ue
3665 * @param[in] RgrUeRecfg *ueRecfg
3666 * @param[out] RgSchErrInfo *errInfo
3671 static S16 rgSCHCfgRgrUeRecfgRntiChg
3675 RgrUeRecfg *ueRecfg,
3676 RgSchErrInfo *errInfo
3685 RgSchDlHqEnt **hqEnt = &(RG_SCH_CMN_GET_UE_HQE(ue, cell));
3688 /* Handle CRNTI change in reconfiguration */
3689 if (ueRecfg->oldCrnti != ueRecfg->newCrnti)
3691 RgSchRntiLnk *oldRntiLnk=NULLP;
3692 CmLteRnti oldRnti = 0;
3693 if ((raCb = rgSCHDbmGetRaCb(cell, ueRecfg->newCrnti)) == NULLP)
3695 DU_LOG("\nERROR --> SCH : UEID:No RaCb exists while"
3696 "Reconfig for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3700 /* rntiLnk does not exist for a HandIn UE. Hence this check. */
3703 oldRntiLnk = ue->rntiLnk;
3707 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3711 DU_LOG("\nINFO --> SCH : UE ID CHNG OLD %d new %d",ueRecfg->oldCrnti, ueRecfg->newCrnti);
3713 /* Fix : syed Deleting Old DL HqEnt. It would be assigned after
3714 * reest RACH(msg4) is completed. */
3715 rgSCHDhmDelHqEnt(cell, hqEnt);
3717 /* Initialize RAM related information for UE */
3718 ret = rgSCHRamRgrUeCfg(cell, ue, raCb, errInfo);
3721 DU_LOG("\nERROR --> SCH : RAM Handling for UE Reconfig failed"
3722 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3725 /* Delete Ue from the ue list */
3726 rgSCHDbmDelUeCb(cell, ue);
3731 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3733 if(ue->cellInfo[sCellIdx] != NULLP)
3735 rgSCHDbmDelUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3741 /* Inititialize Ue control block */
3742 ue->ueId = ueRecfg->newCrnti;
3743 DU_LOG("\nDEBUG --> SCH : Changing RNTI from %d to %d",
3749 rgSCHUtlUpdEmtcY(ue);
3753 /* Fix ccpu00122631: PCell_Reest: Updating new Rnti in all the cells
3756 for(idx = 0; idx < CM_LTE_MAX_CELLS; idx++)
3758 if(ue->cellInfo[idx])
3760 ue->cellInfo[idx]->dlAllocCb.rnti = ueRecfg->newCrnti;
3764 rgSCHUtlRecMsg3Alloc(cell, ue, raCb);
3766 /* If raCb received PHR, update scheduler */
3767 if(raCb->phr.pres == TRUE)
3769 ue->macCeRptTime = raCb->msg3AllocTime;
3770 rgSCHUtlUpdPhr(cell, ue, raCb->phr.val, errInfo);
3773 #ifdef RGR_V2 /* Acc Fix */
3774 if(TRUE == ue->isDrxEnabled)
3776 ueRecfg->ueDrxRecfg.isDrxEnabled = TRUE;
3777 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
3781 DU_LOG("\nERROR --> SCH : UE DRX re-est failed"
3782 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3786 #endif /* Acc Fix */
3788 /* Re-insert updated Ue */
3789 rgSCHDbmInsUeCb(cell, ue);
3794 for ( sCellIdx = 1; sCellIdx < CM_LTE_MAX_CELLS; sCellIdx++)
3796 if(ue->cellInfo[sCellIdx] != NULLP)
3798 rgSCHDbmInsUeCb(ue->cellInfo[sCellIdx]->cell, ue);
3806 ue->tenbStats->stats.rnti = ue->ueId;
3809 /* Fix : syed If MSG4 is done, since corresponding ueCb
3810 * is ready, the raCb should be cleared immediately.
3811 * Otherwise it would remain in the cell until timed out
3812 * and till then the hq Feedbacks will be assumed to be
3814 if (raCb->raState == RGSCH_RA_MSG4_DONE)
3816 DU_LOG("\nDEBUG --> SCH : RNTI:%d with RaCb deleted as Msg4 transmission is done",
3818 rgSCHRamDelRaCb(cell, raCb, FALSE);
3820 /* Fix : syed moving the UL CQI initialization to UERESET */
3822 /* Release Older rnti */
3825 /* This is the rare case in which back to back reestablishment is
3826 * happening and previous re-est was not done completely (MSG4 was
3827 * not done) for an UE, and again re-est is triggered for the same
3828 * UE. We are deleting the old RA CB for the previous re-est which
3829 * still exist due to MSG4 not transmitted successfully */
3830 if ((oldRaCb = rgSCHDbmGetRaCb(cell, oldRntiLnk->rnti)) != NULLP)
3832 rgSCHRamDelRaCb(cell, oldRaCb, FALSE);
3835 rgSCHUtlRlsRnti(cell, oldRntiLnk, TRUE, ueRecfg->newCrnti);
3839 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
3840 /* Just indicate to MAC, no need to release at SCH */
3841 DU_LOG("\nDEBUG --> SCH : HO OldRnti:%d RLS and NewRnti:%d CHNG IND TO MAC",
3842 oldRnti, ueRecfg->newCrnti);
3843 rgSCHUtlIndRntiRls2Mac(cell, oldRnti, TRUE, ueRecfg->newCrnti);
3849 * @brief Handler for the UE reconfiguration request from RRC to MAC.
3853 * Function : rgSCHCfgRgrUeRecfg
3856 * - If rnti changes,
3857 * - Invoke RAM for UE reconfiguration.
3858 * - Delete old UE from the list.
3859 * - Update the new rnti and re-insert the UE in the list.
3860 * - Update the UE control block with the reconfigured values.
3861 * - Invoke SCH, UHM and DHM with updated UE control block to
3862 * update scheduler, uplink HARQ and downlink HARQ specific
3864 * - If successful, return ROK else RFAILED.
3866 * @param[in] RgSchCellCb *cell
3867 * @param[in] RgSchUeCb *ue
3868 * @param[in] RgrUeRecfg *ueRecfg
3869 * @param[out] RgSchErrInfo *errInfo
3874 S16 rgSCHCfgRgrUeRecfg
3878 RgrUeRecfg *ueRecfg,
3879 RgSchErrInfo *errInfo
3884 Bool dciChange = TRUE;
3887 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RECFG;
3890 if (ue->numSCells > 0)
3894 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3895 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3897 ue->accessStratumRls = ueRecfg->accessStratumRls;
3901 /* if SCELL_RECFG is present , no other
3902 * type will be present. Process Scell addition
3905 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_ADD_RECFG)
3907 ret = rgSCHSCellCfgUeCfg(cell, ue, ueRecfg, errInfo);
3910 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_RECFG;
3911 /*FH: SCell config failed for a scell index hence revert all successful
3912 * Scell config and send negative confirmation to APP*/
3913 rgSCHSCellCfgUeCfgRollBack(cell, ue, ueRecfg);
3917 if (dciChange == TRUE)
3919 if (ue->numSCells > 0)
3922 rgSCHUtlUpdUeDciSize(cell, ue, TRUE);
3926 /* 1 bit CSI Access Stratum Release Change */
3927 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3930 if (ueRecfg->ueRecfgTypes & RGR_UE_SCELL_PUCCH_RECFG)
3932 ret = rgSCHSCellCfgUePucchReCfg(cell, ue, ueRecfg, errInfo);
3935 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_UE_SCELL_PUCCH_RECFG;
3940 if ((ueRecfg->ueRecfgTypes & RGR_UE_UE_ACCESS_STRATUM_REL_RECFG) && \
3941 (ue->accessStratumRls != ueRecfg->accessStratumRls))
3943 ue->accessStratumRls = ueRecfg->accessStratumRls;
3944 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
3946 #endif /* LTE_ADV */
3948 if (ueRecfg->ueRecfgTypes)
3950 /* Update scheduler related information for UE */
3951 ret = rgSCHUtlRgrUeRecfg(cell, ue, ueRecfg, errInfo);
3954 DU_LOG("\nERROR --> SCH : Scheduler handling while reconfig failed"
3955 "for OLD CRNTI:%d NEW CRNTI:%d",ueRecfg->oldCrnti,ueRecfg->newCrnti);
3959 /* Update uplink HARQ related information for UE */
3960 rgSCHUhmRgrUeRecfg(cell, ue, ueRecfg);
3962 /* Update TA related information for UE */
3963 if (ueRecfg->ueRecfgTypes & RGR_UE_TATMR_RECFG)
3965 rgSCHCfgUeTaRecfg(cell, ue, ueRecfg, errInfo);
3968 /*Update Measurement Gap and AckNack Details */
3969 /* After merging from 2.2 */
3970 if (ueRecfg->ueRecfgTypes & RGR_UE_ACKNACK_MEASGAP_RECFG)
3972 ret = rgSCHMeasGapANRepUeRecfg(cell, ue, ueRecfg);
3975 DU_LOG("\nERROR --> SCH : Measurement Gap and"
3976 "AckNack Rep Recfg failed for OLD CRNTI:%d NEW CRNTI:%d",
3977 ueRecfg->oldCrnti,ueRecfg->newCrnti);
3981 if (ueRecfg->ueRecfgTypes & RGR_UE_BSRTMR_RECFG)
3983 cmInitTimers(&ue->bsrTmr, 1);
3984 ue->ul.bsrTmrCfg = ueRecfg->ueBsrTmrRecfg;
3985 if ((ue->ul.bsrTmrCfg.isPrdBsrTmrPres) &&
3986 (ue->ul.bsrTmrCfg.prdBsrTmr == 0xFFFF))
3988 ue->ul.bsrTmrCfg.isPrdBsrTmrPres = FALSE;
3993 if (RFAILED == rgSCHCfgRgrUeRecfgRntiChg (cell, ue, ueRecfg, errInfo))
3995 DU_LOG("\nERROR --> SCH : RNTI change "
3996 "failed for OLD CRNTI:%d NEW CRNTI:%d",
3997 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4002 /* Re-Initialize Aperiodic CQI Information for UE*/
4003 if ( ueRecfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
4005 ret = rgSCHCfgAcqiUeReCfg(cell, ue, &ueRecfg->aprdDlCqiRecfg,
4008 /* Re-Initialize Periodic CQI/PMI, RI Information for UE */
4009 if ( ueRecfg->ueRecfgTypes & RGR_UE_PCQI_RECFG)
4011 ret = rgSCHCfgPCqiUeReCfg(cell, ue, &ueRecfg->cqiCfg,
4014 /* Re-Initialize UL SRS Information for UE */
4015 if ( ueRecfg->ueRecfgTypes & RGR_UE_SRS_RECFG)
4017 ret = rgSCHCfgSrsUeReCfg(cell, ue, &ueRecfg->srsCfg);
4019 /* Re-Initialize SR Information for UE */
4020 if ( ueRecfg->ueRecfgTypes & RGR_UE_SR_RECFG)
4022 ret = rgSCHCfgSrUeReCfg(cell, ue, &ueRecfg->srCfg);
4027 if(ueRecfg->isHdFddEnbld)
4029 ret = rgSCHHdFddUeCfg(cell, ue, ueRecfg->isHdFddEnbld);
4032 errInfo->errCause = RGSCHERR_HDFDD_SPSCFGRD;
4036 #endif /* LTEMAC_HDFDD */
4038 if ( ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
4040 ret = rgSCHDrxUeReCfg(cell,ue,ueRecfg);
4044 DU_LOG("\nERROR --> SCH : UE DRX reconfig failed"
4045 "failed for OLD CRNTI:%d NEW CRNTI:%d",
4046 ueRecfg->oldCrnti,ueRecfg->newCrnti);
4051 /* ccpu00117452 - MOD - Changed macro name from
4052 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
4054 /* CQI Reporting (N) Re-configuration */
4055 if(ueRecfg->ueRecfgTypes & RGR_UE_CQIREPT_RECFG)
4057 ret = rgSCHCfgUeCqiReptReCfg(cell, ue, ueRecfg);
4060 errInfo->errCause = RGSCHERR_CQIREPT;
4064 #endif /* End of RGR_CQI_REPT */
4066 /* pA Re-configuration */
4067 if((ueRecfg->ueRecfgTypes & RGR_UE_PA_RECFG) &&
4068 RG_SCH_UE_CFG_ISPAPRSNT(ueRecfg->uePdschDedCfg.uepACfg))
4070 RG_SCH_CMN_GET_PA(ue,cell).pres = TRUE;
4071 RG_SCH_CMN_GET_PA(ue,cell).val = ueRecfg->uePdschDedCfg.uepACfg.pA;
4075 /* LTE_ADV_FLAG_REMOVED_START */
4076 if(ueRecfg->ueRecfgTypes & RGR_UE_LTEA_RECFG)
4078 if(ueRecfg->ueLteAdvCfg.pres & RGR_ABS)
4080 ue->lteAdvUeCb.rgrLteAdvUeCfg.isAbsUe = ueRecfg->ueLteAdvCfg.isAbsUe;
4083 if(ueRecfg->ueLteAdvCfg.pres & RGR_SFR)
4085 ue->lteAdvUeCb.rgrLteAdvUeCfg.isUeCellEdge = ueRecfg->ueLteAdvCfg.isUeCellEdge;
4088 /* LTE_ADV_FLAG_REMOVED_END */
4090 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_DPLXMODE_RECFG)
4092 rgSCHEmtcHdFddUeCfg (cell, ue,
4093 ueRecfg->emtcUeRecfg.isHdFddEnbld);
4095 if(ueRecfg->ueRecfgTypes & RGR_UE_EMTC_PO_TRIGGER)
4097 rgSCHEmtcPOTrigger(cell, ue);
4100 errInfo->errCause = RGSCHERR_NONE;
4103 } /* rgSCHCfgRgrUeRecfg */
4107 * @brief Handler for the logical channel reconfiguration request from
4112 * Function : rgSCHCfgRgrLchRecfg
4115 * - Invoke scheduler to update scheduler specific information.
4116 * - Update the dedicated logical channel Cb with the reconfigured
4118 * - If successful, return ROK else RFAILED.
4120 * @param[in] RgUlCellCb *cell
4121 * @param[in] RgUlUeCb *ue
4122 * @param[in] RgSchUlLcCb *ulLc
4123 * @param[in] RgSchDlLcCb *dlLc
4124 * @param[in] RgrLchRecfg *lcRecfg
4125 * @param[out] RgSchErrInfo *errInfo
4130 S16 rgSCHCfgRgrLchRecfg
4135 RgrLchRecfg *lcRecfg,
4136 RgSchErrInfo *errInfo
4141 errInfo->errCause = RGSCHERR_CFG_RGR_LC_RECFG;
4142 /* Invoke Scheduler to update the new configuration */
4143 ret = rgSCHUtlRgrLcRecfg(cell, ue, dlLc, lcRecfg, errInfo);
4146 DU_LOG("\nERROR --> SCH : Scheduler handling for LC Recfg"
4147 " failed for CRNTI:%d LCID:%d",lcRecfg->crnti,lcRecfg->lcId);
4151 errInfo->errCause = RGSCHERR_NONE;
4153 } /* rgSCHCfgRgrLchRecfg */
4155 * @brief Handler for the logical channel reconfiguration request from
4160 * Function : rgSCHCfgRgrLcgRecfg
4163 * - Invoke scheduler to update scheduler specific information.
4164 * - Update the dedicated logical channel Cb with the re-configured
4166 * - If successful, return ROK else RFAILED.
4168 * @param[in] RgUlCellCb *cell
4169 * @param[in] RgUlUeCb *ue
4170 * @param[in] RgrLcgRecfg *lcgRecfg
4171 * @param[out] RgSchErrInfo *errInfo
4176 S16 rgSCHCfgRgrLcgRecfg
4180 RgrLcgRecfg *lcgRecfg,
4181 RgSchErrInfo *errInfo
4186 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_RECFG;
4188 /*Added for handling LCG ReConfig if the LCG was deleted */
4189 ue->ul.lcgArr[lcgRecfg->ulRecfg.lcgId].lcgId = lcgRecfg->ulRecfg.lcgId;
4191 /* Invoke Scheduler to update the new configuration */
4192 ret = rgSCHUtlRgrLcgRecfg(cell, ue, lcgRecfg, errInfo);
4195 DU_LOG("\nERROR --> SCH : Scheduler handling for LCG Recfg"
4196 " failed for CRNTI:%d LCGID:%d",lcgRecfg->crnti,lcgRecfg->ulRecfg.lcgId);
4200 errInfo->errCause = RGSCHERR_NONE;
4202 } /* rgSCHCfgRgrLcgRecfg */
4205 * @brief Handler for the UE Reset request from RRM to MAC.
4209 * Function : rgSCHCfgRgrUeReset
4212 * - Call Measument Gap Module and Ack/Nack Module for resetting UE.
4213 * - Call Common Schduler UE rest API which inturn will call scheduler
4214 * specific UE Reset APis to reset UE.
4216 * @param[in] RgSchCellCb *cell
4217 * @param[in] RgSchUeCb *ue
4218 * @param[in] RgrRst *reset
4219 * @param[out] RgSchErrInfo *errInfo
4224 S16 rgSCHCfgRgrUeReset
4229 RgSchErrInfo *errInfo
4235 errInfo->errCause = RGSCHERR_CFG_RGR_UE_RESET;
4237 /* Setting BO of Each Logical Channel of the UE to 0 */
4238 for (idx = 0; idx < RGSCH_MAX_LC_PER_UE; idx++)
4240 if(ue->dl.lcCb[idx] != NULLP)
4241 ue->dl.lcCb[idx]->bo = 0;
4244 /* Reset the totalBo */
4246 /* Call DRX module to stop all DRX timers */
4248 if(ue->drxCb != NULLP)
4250 (Void)rgSCHDrxUeDel(cell,ue);
4253 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4254 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4256 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4257 ue->txModeTransCmplt =TRUE;
4260 /* ccpu00133470- Meas Gap should be released during RRC re-establishment */
4261 rgSCHMeasGapANRepUeDel(cell, ue, FALSE);
4263 /* Call Common scheduler which in turn will call specific scheduler for UE
4265 rgSCHUtlUeReset(cell, ue);
4267 /*PCell which is at idx 0 is always active. Adding a line after the loop
4268 *setting RGSCH_PCELL_INDEX to SCELL ACTIVE*/
4269 ue->cellInfo[RGSCH_PCELL_INDEX]->sCellState = RG_SCH_SCELL_ACTIVE;
4272 /* In case of back to back reestablishments, when this UE's
4273 * previous ReEst is still in progress and has got RESET
4274 * as part of new ReEst */
4275 if((raCb = rgSCHDbmGetRaCb(cell, ue->ueId)) != NULLP)
4277 rgSCHRamDelRaCb(cell, raCb, FALSE);
4279 /* Fix : syed set UE inactive in DL until UE is reinitialization completed */
4280 ue->dl.dlInactvMask |= RG_HQENT_INACTIVE;
4281 ue->ul.ulInactvMask |= RG_HQENT_INACTIVE;
4282 /* [ccpu00127141] Resetting TA related parameters */
4283 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
4284 ue->dl.taCb.state = RGSCH_TA_IDLE;
4286 /*[ccpu00121813]-ADD-Initializing outstanding TA value */
4287 ue->dl.taCb.outStndngTa = FALSE;
4288 ue->dl.taCb.outStndngTaval = RGSCH_NO_TA_RQD;
4290 if (ue->dl.taCb.cfgTaTmr)
4292 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
4296 /* Resetting the Tx mode change factor on UE reset */
4297 ue->mimoInfo.txModUpChgFactor = 0;
4298 ue->mimoInfo.txModDownChgFactor = 0;
4301 errInfo->errCause = RGSCHERR_NONE;
4303 } /* rgSCHCfgRgrUeReset */
4306 * @brief Handler for the cell delete request from RRM to MAC.
4310 * Function : rgSCHCfgRgrCellDel
4313 * - Fetch the cell control block.
4314 * - Remove the cell control block from the hash list of cells.
4315 * - Free the cell control block.
4316 * - If successful, return ROK else return RFAILED.
4318 * @param[in] RgSchCellCb *cell
4319 * @param[in] RgrDel *cellDelInfo
4320 * @param[out] RgSchErrInfo *errInfo
4325 S16 rgSCHCfgRgrCellDel
4328 RgrDel *cellDelInfo,
4329 RgSchErrInfo *errInfo
4333 errInfo->errCause = RGSCHERR_CFG_RGR_CELL_DEL;
4335 if (cell->cellId != cellDelInfo->u.cellDel.cellId)
4337 DU_LOG("\nERROR --> SCH : Cell does not exist");
4341 /* Free the active cell */
4342 rgSCHCfgFreeCellCb(cell);
4344 errInfo->errCause = RGSCHERR_NONE;
4346 } /* rgSCHCfgRgrCellDel */
4350 * @brief Handler for the UE delete request from RRM to MAC.
4354 * Function : rgSCHCfgRgrUeDel
4357 * - Fetch the UE control block.
4358 * - Remove the UE control block from the hash list of UEs for the cell.
4359 * - Free the UE control block.
4360 * - If successful, return ROK else return RFAILED.
4362 * @param[in] RgSchCellCb *cell
4363 * @param[in] RgrDel *ueDelInfo
4364 * @param[out] RgSchErrInfo *errInfo
4369 S16 rgSCHCfgRgrUeDel
4373 RgSchErrInfo *errInfo
4379 Inst inst = cell->instIdx;
4380 RgSchCellCb *secCellCb = NULLP;
4383 errInfo->errCause = RGSCHERR_CFG_RGR_UE_DEL;
4385 if (cell->cellId != ueDelInfo->u.ueDel.cellId)
4387 DU_LOG("\nERROR --> SCH : Cell does not exist CRNTI:%d",
4388 ueDelInfo->u.ueDel.crnti);
4391 if ((ue = rgSCHDbmGetUeCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4393 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) == NULLP)
4395 DU_LOG("\nERROR --> SCH : RaCb does not exist for CRNTI:%d",ueDelInfo->u.ueDel.crnti);
4400 /* This happens in case of Msg4 rejection */
4408 if(ueDelInfo->u.ueScellRel.ueDelTypes & RGR_UE_SCELL_DEL_RECFG)
4410 for(uint8_t idx = 0; idx < ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.numSCells; idx++)
4412 if(NULLP != (secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, \
4413 ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellId)))
4415 rgSCHUtlSndUeSCellDel2Mac(secCellCb, ue->ueId);
4416 rgSCHSCellDelUeSCell(cell,ue,ueDelInfo->u.ueScellRel.ueSCellRelCfgInfo.ueSCellRelDedCfg[idx].sCellIdx);
4418 if ( ue->numSCells == 0)
4420 ue->allocCmnUlPdcch = TRUE;
4424 if (ue->numSCells == 0)
4426 /* As there is no SCell left so DCI 0 size at UE specific search space
4427 * will be recalculated as the CSI is reduced to 1 bit */
4428 rgSCHUtlUpdUeDciSize(cell, ue, FALSE);
4434 /* Delete Ue from the UE list of CELL*/
4435 rgSCHDbmDelUeCb(cell, ue);
4438 rgSCHDbmDelL2MUe(cell, ue);
4441 /* Call MeasGap and AckNakRep processing module */
4442 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
4444 /* ccpu00140894- Stop TXMode transiition timer if it is running*/
4445 if (ue->txModeTransTmr.tmrEvnt != TMR_NONE)
4447 rgSCHTmrStopTmr(cell, RG_SCH_TMR_TXMODE_TRNSTN, ue);
4450 /* Call DRX module to remove UEs from various
4454 if(ue->drxCb != NULLP)
4456 (Void)rgSCHDrxUeDel(cell,ue);
4459 /*Fix: If RA CB exists, delete it*/
4460 if((raCb = rgSCHDbmGetRaCb(cell, ueDelInfo->u.ueDel.crnti)) != NULLP)
4462 /* Fix : syed RNTI was getting released twice, once by racb del
4463 * and subsequently by ueDel. Let it get released by ueDel alone */
4464 rgSCHRamDelRaCb(cell, raCb, FALSE);
4469 rgSCHEmtcUeDel(cell, ue);
4473 rgSCHCfgFreeUeCb(cell, ue);
4475 errInfo->errCause = RGSCHERR_NONE;
4480 } /* rgSCHCfgRgrUeDel */
4484 * @brief Handler for the logical channel delete request from
4489 * Function : rgSCHCfgRgrLcDel
4492 * - Fetch the logical channel control block.
4493 * - Free the logical channel control block.
4494 * - If successful, return ROK else return RFAILED.
4496 * @param[in] RgrDel *lcDelInfo
4497 * @param[out] RgSchErrInfo *errInfo
4502 S16 rgSCHCfgRgrLcDel
4506 RgSchErrInfo *errInfo
4517 errInfo->errCause = RGSCHERR_CFG_RGR_LC_DEL;
4519 /* Fetch the Active cell */
4520 if (cell->cellId != lcDelInfo->u.lchDel.cellId)
4522 DU_LOG("\nERROR --> SCH : Cell does not exist %d",
4523 lcDelInfo->u.lchDel.cellId);
4528 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lchDel.crnti)) == NULLP)
4530 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d LCID:%d",
4531 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4534 if (lcDelInfo->u.lchDel.lcgId > 3)
4536 DU_LOG("\nERROR --> SCH : [%d]UEID:For LC %d, LCGid %d is invalid",
4537 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId,
4538 lcDelInfo->u.lchDel.lcgId);
4541 if ((dlLc = rgSCHDbmGetDlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
4544 DU_LOG("\nERROR --> SCH : LC does not exist for CRNTI:%d LCID:%d",
4545 lcDelInfo->u.lchDel.crnti, lcDelInfo->u.lchDel.lcId);
4548 rgSCHUtlRgrLcDel(cell, ue, lcDelInfo->u.lchDel.lcId,lcDelInfo->u.lchDel.lcgId);
4550 /* Reduce any pending bo from this LC(if any)
4551 * from the UE's total BO */
4554 if(ue->totalBo >= dlLc->bo)
4556 ue->totalBo -= dlLc->bo;
4560 ue->totalBo = 0; /* this scenario should not occur */
4563 rgSCHDbmDelDlDedLcCb(ue, dlLc);
4564 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
4567 lcId = lcDelInfo->u.lchDel.lcId;
4568 if (TRUE == ue->ul.lcCb[lcId -1].isValid)
4570 ulLc = &(ue->ul.lcCb[lcId -1]);
4571 ue->ul.lcCb[lcId -1].isValid = FALSE;
4573 if((ulLc->qciCb->ulUeCount) &&
4574 (ue->ulActiveLCs & (1 << (ulLc->qciCb->qci -1))))
4576 ulLc->qciCb->ulUeCount--;
4577 ue->ulActiveLCs &= ~(1 << (ulLc->qciCb->qci -1));
4579 /* Shifting LCs in LCG Array because of LC deletion */
4580 for (idx = ulLc->lcgArrIdx +1; idx < ulLc->lcg->numLch;
4583 ulLc->lcg->lcArray[idx -1] =
4584 ulLc->lcg->lcArray[idx];
4585 ulLc->lcg->lcArray[idx -1]->lcgArrIdx = idx -1;
4587 ulLc->lcg->numLch--;
4588 ulLc->lcg->lcArray[idx -1] = NULLP;
4590 #endif /* LTE_L2_MEAS */
4593 errInfo->errCause = RGSCHERR_NONE;
4595 } /* rgSCHCfgRgrLcDel */
4600 * @brief Handler for the logical channel delete request from
4605 * Function : rgSCHCfgRgrLcgDel
4608 * - Fetch the logical channel control block.
4609 * - Free the logical channel control block.
4610 * - If successful, return ROK else return RFAILED.
4612 * @param[in] RgrDel *lcDelInfo
4613 * @param[out] RgSchErrInfo *errInfo
4618 S16 rgSCHCfgRgrLcgDel
4622 RgSchErrInfo *errInfo
4625 RgSchUeCb *ue = NULLP;
4627 uint8_t lcCount = 0;
4631 lcgId = lcDelInfo->u.lcgDel.lcgId;
4633 errInfo->errCause = RGSCHERR_CFG_RGR_LCG_DEL;
4635 /* Fetch the Active cell */
4636 if (cell->cellId != lcDelInfo->u.lcgDel.cellId)
4638 DU_LOG("\nERROR --> SCH : CELL does not exist for CRNTI:%d LCGID:%d",
4639 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4644 if ((ue = rgSCHDbmGetUeCb(cell, lcDelInfo->u.lcgDel.crnti)) == NULLP)
4646 DU_LOG("\nERROR --> SCH : UE does not exist for CRNTI:%d LCGID:%d",
4647 lcDelInfo->u.lchDel.crnti,lcDelInfo->u.lchDel.lcId);
4651 /* set lcgId in UEs lcg cntrl blk to invalid */
4652 rgSCHUtlRgrLcgDel(cell, ue, lcgId);
4653 ue->ul.lcgArr[lcgId].lcgId = RGSCH_INVALID_LCG_ID;
4656 /* Since LCs are being deleted, if any of them are contributing
4657 to Active UE count for a QCI, decrease the count */
4658 for (lcCount =0; (lcCount < RGSCH_MAX_LC_PER_UE) &&
4659 (lcCount < ue->ul.lcgArr[lcgId].numLch) ; lcCount++)
4661 if (ue->ul.lcgArr[lcgId].lcArray[lcCount])
4663 if((ue->ul.lcgArr[lcgId].
4664 lcArray[lcCount]->qciCb->ulUeCount) &&
4666 (1 << ((ue->ul.lcgArr[lcgId].
4667 lcArray[lcCount])->qciCb->qci -1))))
4670 ue->ul.lcgArr[lcgId].
4671 lcArray[lcCount]->qciCb->ulUeCount--;
4672 ue->ulActiveLCs &= ~(1 <<
4673 (ue->ul.lcgArr[lcgId].
4674 lcArray[lcCount]->qciCb->qci -1));
4680 errInfo->errCause = RGSCHERR_NONE;
4682 } /* rgSCHCfgRgrLcgDel */
4686 /***********************************************************
4688 * Func : rgSCHCfgVldtRgrLcCfg
4691 * Desc : Validates dedicated logical channel configuration recieved from RRM.
4701 **********************************************************/
4702 S16 rgSCHCfgVldtRgrLcCfg
4708 RgSchErrInfo *errInfo
4712 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LC_CFG;
4714 if (((*cell) == NULLP) ||
4715 ((*cell)->cellId != lcCfg->cellId))
4717 DU_LOG("\nERROR --> SCH : Cell does not existi for "
4718 "CRNTI:%d LCID:%d",lcCfg->crnti, lcCfg->lcId);
4723 if ((*ue = rgSCHDbmGetUeCb(*cell, lcCfg->crnti)) == NULLP)
4725 DU_LOG("\nERROR --> SCH : UE does not exist for dedicated"
4726 " logical channel CRNTI:%d LCID:%d", lcCfg->crnti, lcCfg->lcId);
4730 /* Validate logical channel Id */
4731 if ((lcCfg->lcId < RGSCH_DEDLC_MIN_LCID)
4732 ||(lcCfg->lcId > RGSCH_DEDLC_MAX_LCID))
4734 DU_LOG("\nERROR --> SCH : Invalid logical channel Id:%d"
4735 "for CRNTI:%d",lcCfg->lcId,lcCfg->crnti);
4739 if (lcCfg->lcType != CM_LTE_LCH_DTCH && lcCfg->lcType != CM_LTE_LCH_DCCH)
4741 DU_LOG("\nERROR --> SCH : Invalid logical channel Type %d"
4742 "CRNTI:%d LCID:%d",lcCfg->lcType,lcCfg->crnti, lcCfg->lcId);
4747 } /* rgSCHCfgVldtRgrLcCfg */
4749 /***********************************************************
4751 * Func : rgSCHCfgVldtRgrLcgCfg
4754 * Desc : Validates dedicated logical channel group configuration recieved from RRM.
4764 **********************************************************/
4765 S16 rgSCHCfgVldtRgrLcgCfg
4771 RgSchErrInfo *errInfo
4775 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_DED_LCG_CFG;
4777 if (((*cell) == NULLP) ||
4778 ((*cell)->cellId != lcgCfg->cellId))
4780 DU_LOG("\nERROR --> SCH : Cell does not exist for"
4781 "CRNTI:%d LCGID:%d",lcgCfg->crnti,lcgCfg->ulInfo.lcgId);
4786 if ((*ue = rgSCHDbmGetUeCb(*cell, lcgCfg->crnti)) == NULLP)
4788 DU_LOG("\nERROR --> SCH : UE does not exist for "
4789 "dedicated logical channel CRNTI:%d LCGID:%d", lcgCfg->crnti, lcgCfg->ulInfo.lcgId);
4793 if ((lcgCfg->ulInfo.gbr != 0) && (lcgCfg->ulInfo.mbr < lcgCfg->ulInfo.gbr))
4799 } /* rgSCHCfgVldtRgrLcgCfg */
4802 /***********************************************************
4804 * Func : rgSCHCfgVldtRgrCellPwrCfg
4806 * Desc : Validates cell power configuration.
4816 **********************************************************/
4817 static S16 rgSCHCfgVldtRgrCellPwrCfg
4820 RgrCellCfg *cellCfg,
4821 RgSchErrInfo *errInfo
4828 /* This function does nothing now, placeholder for
4829 * subsequent power config validations that may be needed */
4833 } /* rgSCHCfgVldtRgrCellPwrCfg */
4836 /***********************************************************
4838 * Func : rgSCHCfgVldtRgrCmnLcCfg
4841 * Desc : Validates common logical channel configuration recieved from RRM.
4843 * @param[in] Inst inst
4844 * @param[in] RgrCellCfg *cellCfg
4845 * @param[out] RgSchErrInfo *errInfo
4854 **********************************************************/
4855 static S16 rgSCHCfgVldtRgrCmnLcCfg
4858 RgrCellCfg *cellCfg,
4859 RgSchErrInfo *errInfo
4863 RgrCmnLchCfg *lcCfg;
4864 uint8_t dirVld = FALSE;
4865 uint8_t bitMask = 0x00;
4868 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_CMN_LC_CFG;
4870 for (idx = 0; idx < cellCfg->numCmnLcs; idx++)
4872 lcCfg = &(cellCfg->cmnLcCfg[idx]);
4873 /* Validate downlink info */
4874 if (lcCfg->dir & RGR_DIR_TX)
4876 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
4878 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
4882 bitMask |= RGSCH_BCCH_DLSCH_CFG1;
4889 (cellCfg->siCfg.siWinSize == 1) ||
4890 (cellCfg->siCfg.siWinSize == 2) ||
4891 (cellCfg->siCfg.siWinSize == 5) ||
4892 (cellCfg->siCfg.siWinSize == 10) ||
4893 (cellCfg->siCfg.siWinSize == 15) ||
4894 (cellCfg->siCfg.siWinSize == 20) ||
4895 (cellCfg->siCfg.siWinSize == 40)) &&
4896 (cellCfg->siCfg.retxCnt>0)
4899 bitMask |= RGSCH_BCCH_DLSCH_CFG2;
4903 DU_LOG("\nERROR --> SCH : Invalid si config for cell");
4908 else if (lcCfg->dlTrchType == CM_LTE_TRCH_BCH)
4910 bitMask |= RGSCH_BCCH_BCH_CFG;
4914 DU_LOG("\nERROR --> SCH : Invalid transport channel %d for cell", lcCfg->dlTrchType);
4918 else if (lcCfg->lcType == CM_LTE_LCH_PCCH)
4920 bitMask |= RGSCH_PCCH_CFG;
4922 else if (lcCfg->lcType == CM_LTE_LCH_CCCH)
4924 bitMask |= RGSCH_DL_CCCH_CFG;
4929 /* Validate uplink info */
4930 if (lcCfg->dir & RGR_DIR_RX)
4933 if (lcCfg->lcType != CM_LTE_LCH_CCCH)
4935 DU_LOG("\nERROR --> SCH : Invalid UL common lcType %d for cell", lcCfg->lcType);
4940 bitMask |= RGSCH_UL_CCCH_CFG;
4945 /* Invalid direction */
4948 DU_LOG("\nERROR --> SCH : Invalid Direction %d", lcCfg->dir);
4952 if (bitMask != RGSCH_CELL_ACTIVE_CFG)
4954 DU_LOG("\nERROR --> SCH : Invalid Common channel config for cell");
4959 } /* rgSCHCfgVldtRgrCmnLcCfg */
4962 /***********************************************************
4964 * Func : rgSCHCfgVldtUeCqiModeCfg
4967 * Desc : Validates UE CQI modes Configuration recieved from RRC.
4977 **********************************************************/
4978 static S16 rgSCHCfgVldtUeCqiModeCfg
4981 RgrUeDlCqiCfg *ueDlCqiCfg
4986 if((ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx < 1) ||
4987 (ueDlCqiCfg->prdCqiCfg.cqiPmiCfgIdx > 1024))
4989 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI Info");
4993 /* Validate UE Aperiodic CQI mode */
4994 if ((ueDlCqiCfg->aprdCqiCfg.pres == TRUE) &&
4995 ((ueDlCqiCfg->aprdCqiCfg.aprdModeEnum > RGR_APRD_CQI_MOD31) ||
4996 (cell->bwCfg.dlTotalBw <= 7)))
4998 DU_LOG("\nERROR --> SCH : Invalid Aperiodic mode config for DL CQI");
5002 /* Validate UE Periodic CQI mode */
5003 if (ueDlCqiCfg->prdCqiCfg.prdModeEnum > RGR_PRD_CQI_MOD21)
5005 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for DL CQI");
5008 /* Validate K value in periodic CQI Config */
5009 if(((ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD20) ||
5010 (ueDlCqiCfg->prdCqiCfg.prdModeEnum == RGR_PRD_CQI_MOD21)) &&
5011 ((ueDlCqiCfg->prdCqiCfg.k < 1)||
5012 (ueDlCqiCfg->prdCqiCfg.k > 4)))
5014 DU_LOG("\nERROR --> SCH : Invalid K for Subband CQI reporting");
5018 if ((ueDlCqiCfg->prdCqiCfg.type == 1) &&
5019 (ueDlCqiCfg->prdCqiCfg.cqiSetup.prdModeEnum > RGR_PRD_CQI_MOD21))
5021 DU_LOG("\nERROR --> SCH : Invalid periodic mode config for DL CQI");
5030 /***********************************************************
5032 * Func : rgSCHCfgVldtUeMeasGapAckNakRepCfg
5035 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5045 **********************************************************/
5046 static S16 rgSCHCfgVldtUeMeasGapAckNakRepCfg
5054 if ((ueCfg->ackNackModeEnum == RGR_TDD_ACKNACK_MODE_MULT) &&
5055 (ueCfg->ueAckNackCfg.isAckNackEnabled == TRUE))
5057 DU_LOG("\nERROR --> SCH : TDD ACK NACK Multiplexing Mode"
5058 "is not allowed when Ack/Nack is Enabled: %d CRNTI:%d",
5059 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5062 #endif /* LTE_TDD */
5063 /* Validate AckNackRep Factor */
5064 if((ueCfg->ueAckNackCfg.isAckNackEnabled == FALSE) &&
5065 (!ueCfg->ueMesGapCfg.isMesGapEnabled))
5070 if(ueCfg->ueAckNackCfg.isAckNackEnabled)
5072 if ( (ueCfg->ueAckNackCfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5073 || (ueCfg->ueAckNackCfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5075 DU_LOG("\nERROR --> SCH : Invalid ACK NACK REP Factor:%d CRNTI:%d",
5076 ueCfg->ueAckNackCfg.ackNackRepFactor,ueCfg->crnti);
5080 if(ueCfg->ueMesGapCfg.isMesGapEnabled)
5082 switch(ueCfg->ueMesGapCfg.gapPrd)
5084 case RG_MEAS_GAPPRD_40:
5085 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_40)
5087 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d CRNTI:%d",
5088 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5092 case RG_MEAS_GAPPRD_80:
5093 if(ueCfg->ueMesGapCfg.gapOffst >= RG_MEAS_GAPPRD_80)
5095 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d CRNTI:%d",
5096 ueCfg->ueMesGapCfg.gapOffst,ueCfg->crnti);
5102 DU_LOG("\nERROR --> SCH : Invalid GAP Periodicity Settings:%d"
5103 "CRNTI:%d", ueCfg->ueMesGapCfg.gapPrd,ueCfg->crnti);
5110 } /* rgSCHCfgVldtUeMeasGapAckNakRepCfg*/
5113 /***********************************************************
5115 * Func : rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5118 * Desc : Validates UE Measurement Gap and Ack Nack Repetition Configuration recieved from RRC.
5128 **********************************************************/
5129 static S16 rgSCHCfgVldtUeMeasGapAckNakRepRecfg
5136 if((ueRecfg->ueAckNackRecfg.isAckNackEnabled == FALSE) &&
5137 (!ueRecfg->ueMeasGapRecfg.isMesGapEnabled))
5142 if(ueRecfg->ueAckNackRecfg.isAckNackEnabled )
5144 /* Validate AckNackRep Factor */
5145 if ( (ueRecfg->ueAckNackRecfg.ackNackRepFactor < RGR_ACKNACK_REPFACT_N2)
5146 || (ueRecfg->ueAckNackRecfg.ackNackRepFactor > RGR_ACKNACK_REPFACT_N6))
5148 DU_LOG("\nERROR --> SCH : Invalid ACK NACK REP Factor:%d"
5149 "NEW CRNTI:%d",ueRecfg->ueAckNackRecfg.ackNackRepFactor,ueRecfg->newCrnti);
5153 if(ueRecfg->ueMeasGapRecfg.isMesGapEnabled)
5155 switch(ueRecfg->ueMeasGapRecfg.gapPrd)
5157 case RG_MEAS_GAPPRD_40:
5158 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_40)
5160 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d"
5161 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5165 case RG_MEAS_GAPPRD_80:
5166 if(ueRecfg->ueMeasGapRecfg.gapOffst >= RG_MEAS_GAPPRD_80)
5168 DU_LOG("\nERROR --> SCH : Invalid GAP Offset:%d"
5169 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapOffst,ueRecfg->newCrnti);
5175 DU_LOG("\nERROR --> SCH : Invalid GAP Periodicity Settings:%d"
5176 "NEW CRNTI:%d",ueRecfg->ueMeasGapRecfg.gapPrd,ueRecfg->newCrnti);
5183 } /* rgSCHCfgVldtUeMeasGapAckNakRepRecfg*/
5186 /***********************************************************
5188 * Func : rgSCHCfgVldtUeDlSpsCfg
5191 * Desc : Validates UE's DL SPS configuration recieved from RRC.
5201 **********************************************************/
5202 static S16 rgSCHCfgVldtUeDlSpsCfg
5205 RgrUeSpsDlCfg *dlSpsCfg
5211 /* peridicity validation done in SPS module */
5212 if ((dlSpsCfg->numPucchVal > RG_SCH_MAX_NUM_N1PUCCH_PER_UE) ||
5213 (dlSpsCfg->numPucchVal == 0))
5215 DU_LOG("\nERROR --> SCH : Invalid number of n1Pucch values"
5216 " in DL SPS Config");
5220 for (idx = 0; idx < dlSpsCfg->numPucchVal; ++idx)
5222 if (dlSpsCfg->n1PucchVal[idx] > RG_SCH_MAX_N1PUCCH_VAL)
5225 DU_LOG("\nERROR --> SCH : Invalid N1Pucch value"
5226 " in DL SPS Config %u", dlSpsCfg->n1PucchVal[idx]);
5228 DU_LOG("\nERROR --> SCH : Invalid N1Pucch value"
5229 " in DL SPS Config %lu", dlSpsCfg->n1PucchVal[idx]);
5234 /* SPS_TODO: check will change for TDD */
5235 if ((dlSpsCfg->numSpsHqProc == 0) ||
5236 (dlSpsCfg->numSpsHqProc > RGSCH_MAX_DL_HQ_PROC))
5238 DU_LOG("\nERROR --> SCH : Invalid number of SPS HARQ procs"
5239 " in DL SPS Config");
5244 } /* rgSCHCfgVldtDlSpsCfg */
5245 #endif /* LTEMAC_SPS */
5247 /***********************************************************
5249 * Func : rgSCHCfgVldtUePwrCfg
5252 * Desc : Validates UE Group power configuration recieved from RRC.
5262 **********************************************************/
5263 static S16 rgSCHCfgVldtUePwrCfg
5266 RgrUeUlPwrCfg *pwrCfg
5270 /* Group power control works only in accumulated mode */
5271 if (!pwrCfg->isAccumulated)
5274 if (pwrCfg->uePuschPwr.pres)
5276 DU_LOG("\nERROR --> SCH : Accumulation configutation"
5277 " not in sync with group power configuration");
5282 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePuschPwr) != ROK)
5284 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
5288 if (rgSCHCfgVldtUeGrpPwrCfg(cell, &pwrCfg->uePucchPwr) != ROK)
5290 DU_LOG("\nERROR --> SCH : Invalid PUSCH Group power"
5296 } /* rgSCHCfgVldtUePwrCfg */
5298 /***********************************************************
5300 * Func : rgSCHCfgVldtUeGrpPwrCfg
5303 * Desc : Validates UE Group power configuration recieved from RRC.
5313 **********************************************************/
5314 static S16 rgSCHCfgVldtUeGrpPwrCfg
5317 RgrUeGrpPwrCfg *grpPwrCfg
5321 if ((grpPwrCfg->pres) &&
5322 (((grpPwrCfg->tpcRnti > cell->rntiDb.rntiStart) &&
5323 ((grpPwrCfg->tpcRnti <
5324 (cell->rntiDb.rntiStart + cell->rntiDb.maxRntis))))))
5326 DU_LOG("\nERROR --> SCH : Invalid Uplink Group power "
5332 } /* rgSCHCfgVldtUeGrpPwrCfg */
5335 /***********************************************************
5337 * Func : rgSCHCfgVldtSpsReCfg
5340 * Desc : Validates UE SPS and other SPS dependent
5341 * configuration recieved from RRC.
5351 **********************************************************/
5352 static S16 rgSCHCfgVldtSpsReCfg
5360 if ((ueRecfg->ueRecfgTypes & RGR_UE_DLSPS_RECFG) &&
5361 (ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled))
5363 /* Validating SPS RNTI */
5364 if (((ueRecfg->ueSpsRecfg.spsRnti >= cell->rntiDb.rntiStart) &&
5365 (ueRecfg->ueSpsRecfg.spsRnti<=
5366 (cell->rntiDb.rntiStart+cell->rntiDb.maxRntis)))||
5367 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_SI_RNTI) ||
5368 (ueRecfg->ueSpsRecfg.spsRnti == RGSCH_P_RNTI))
5370 DU_LOG("\nERROR --> SCH : Invalid SPS RNTI "
5371 " in DL SPS Recfg OLD CRNTI:%d NEW CCRNTI:%d",
5372 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5375 if (rgSCHCfgVldtUeDlSpsCfg(cell, &ueRecfg->ueSpsRecfg.dlSpsCfg) != ROK)
5377 DU_LOG("\nERROR --> SCH : Invalid DL SPS configuration"
5378 " for the OLD CRNTI:%d NEW CRNTI:%d",
5379 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5385 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5387 if (ueRecfg->ueRecfgTypes & RGR_UE_DRX_RECFG)
5389 /* ccpu00117035 - MOD - changed instIdx to inst */
5390 /* ccpu00117035 - MOD - changed ueID to oldCrnti*/
5391 DU_LOG("\nERROR --> SCH : DRX reconfig not supported DL SPS enabled for OLD CRNTI:%d NEW CRNTI:%d",
5392 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5397 /* ccpu00117627 - ADD - SPS recfg validation against HDFDD */
5399 if(ueRecfg->ueSpsRecfg.dlSpsCfg.isDlSpsEnabled)
5401 if(ue->hdFddEnbld == TRUE)
5403 DU_LOG("\nERROR --> SCH : DL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5404 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5408 if(ueRecfg->ueSpsRecfg.ulSpsCfg.isUlSpsEnabled)
5410 if(ue->hdFddEnbld == TRUE)
5412 DU_LOG("\nERROR --> SCH : UL SPS is not supported for HDFDD enabled for OLD CRNTI:%d NEW CRNTI:%d",
5413 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5420 } /*rgSCHCfgVldtSpsReCfg*/
5423 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
5424 /***********************************************************
5426 * Func : rgSCHCfgVldtCqiReptReCfg
5429 * Desc : Validates UE CQI report for DL Power control
5430 * configuration recieved from RRC.
5440 **********************************************************/
5441 static S16 rgSCHCfgVldtCqiReptReCfg
5448 /* Validate DL Power Control Config parameters */
5449 if (ueRecfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
5451 DU_LOG("\nERROR --> SCH : Invalide numColltdCqiRept,"
5452 "MAX supported %d for OLD CRNTI:%d NEW CRNTI:%d",RGR_CQIRPTS_MAXN,
5453 ueRecfg->oldCrnti,ueRecfg->newCrnti);
5458 } /*rgSCHCfgVldtCqiReptReCfg*/
5461 /***********************************************************
5463 * Func : rgSCHCfgRgrLcChfg
5466 * Desc : Handles dedicated logical channel configuration
5467 * recieved from RRC.
5477 **********************************************************/
5478 S16 rgSCHCfgRgrLchCfg
5483 RgSchErrInfo *errInfo
5487 RgSchDlLcCb *dlLc = NULLP;
5488 Inst inst = cell->instIdx;
5493 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LC_CFG;
5495 /* Allocate the downlink logical channel control block */
5496 if((ret = rgSCHUtlAllocSBuf(inst, (Data**)&dlLc,
5497 sizeof(RgSchDlLcCb))) != ROK)
5499 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
5500 "Downlink LCId:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5503 if ((uint8_t *)dlLc == NULLP)
5505 DU_LOG("\nERROR --> SCH : Memory allocation FAILED for "
5506 "Downlink LCID:%d CRNTI:%d", lcCfg->lcId,lcCfg->crnti);
5509 dlLc->lcId = lcCfg->lcId;
5511 rgSCHLaaLcCfg(cell, dlLc, lcCfg);
5514 rgSCHDbmInsDlDedLcCb(ue, dlLc);
5516 ret = rgSCHUtlRgrLcCfg(cell, ue, dlLc, lcCfg, errInfo);
5523 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5524 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5527 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5528 "configuration failed at SCH:UEID:%d LCID:%d CRNTI:%d",
5529 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5533 RGSCH_ARRAY_BOUND_CHECK(inst, ue->ul.lcCb, (lcCfg->lcId -1));
5534 if ( !lcCfg->lcId ||
5535 (TRUE == ue->ul.lcCb[lcCfg->lcId -1].isValid))
5540 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5541 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5544 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5545 "configuration failed at SCH: UL LC CB already existing"
5546 " UEID:%d LCID:%d CRNTI:%d",
5547 ue->ueId, lcCfg->lcId,lcCfg->crnti);
5551 /* Create UL LC context to maintain LCG to LC mapping and
5552 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5554 ue->ul.lcCb[lcCfg->lcId -1].isValid = TRUE;
5555 ulLc = &(ue->ul.lcCb[lcCfg->lcId -1]);
5557 ulLc->lcId = lcCfg->lcId;
5558 ulLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5559 ulLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5560 ue->ul.lcgArr[lcCfg->lcgId].lcArray[ue->ul.lcgArr[lcCfg->lcgId].numLch] = ulLc;
5561 ulLc->lcg = &ue->ul.lcgArr[lcCfg->lcgId];
5562 ulLc->lcgArrIdx = ue->ul.lcgArr[lcCfg->lcgId].numLch;
5563 ue->ul.lcgArr[lcCfg->lcgId].numLch++;
5565 dlLc->qciCb = &(cell->qciArray[lcCfg->dlInfo.dlQos.qci]);
5566 dlLc->qciCb->qci = lcCfg->dlInfo.dlQos.qci;
5567 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
5569 rgSchAddToL2Meas(cell,dlLc); /*LTE_L2_MEAS_PHASE2*/
5571 #endif /* LTE_L2_MEAS */
5574 } /* rgSCHCfgRgrLchCfg */
5576 /***********************************************************
5578 * Func : rgSCHCfgRgrLcgCfg
5581 * Desc : Handles dedicated logical channel group configuration
5582 * recieved from RRM.
5592 **********************************************************/
5593 S16 rgSCHCfgRgrLcgCfg
5598 RgSchErrInfo *errInfo
5604 //#ifdef LTE_L2_MEAS
5609 errInfo->errCause = RGSCHERR_CFG_RGR_DED_LCG_CFG;
5611 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = lcgCfg->ulInfo.lcgId;
5613 ret = rgSCHUtlRgrLcgCfg(cell, ue, lcgCfg, errInfo);
5616 DU_LOG("\nERROR --> SCH : Dedicated logical channel "
5617 "configuration failed at SCH: UEID:%d LCGID:%d CRNTI:%d",
5618 ue->ueId, lcgCfg->ulInfo.lcgId,lcgCfg->crnti);
5619 /* Roll back lcgCfg */
5620 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcgId = RGSCH_INVALID_LCG_ID;
5621 rgSCHUtlRgrLcgDel(cell, ue, lcgCfg->ulInfo.lcgId);
5625 //#ifdef LTE_L2_MEAS
5626 /* Copy all info of UL LCH in cfg to ulLcgCb */
5627 for (idx = 0; idx < lcgCfg->ulInfo.numLch; idx++)
5629 /* Allocate the uplink logical channel control block */
5630 if((ret = rgSCHUtlAllocSBuf(cell->instIdx, (Data**)&ulLc,
5631 sizeof(RgSchUlLcCb))) != ROK)
5633 DU_LOG("\nERROR --> SCH : Memory allocation FAILED ");
5636 if ((uint8_t *)ulLc == NULLP)
5638 DU_LOG("\nERROR --> SCH : Memory allocation FAILED ");
5641 /* Create UL LC context to maintain LCG to LC mapping and
5642 LC and QCI mapping, this is for L2 Counters :UL ACTIVE UE
5644 ulLc->lcId = lcgCfg->ulInfo.lchUlCfg[idx].lcId;
5645 ulLc->qciCb = &(cell->qciArray[lcgCfg->ulInfo.lchUlCfg[idx].qci]);
5646 ulLc->qciCb->qci = lcgCfg->ulInfo.lchUlCfg[idx].qci;
5647 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].lcArray[idx] = ulLc;
5649 ue->ul.lcCb[ulLc->lcId -1] = ulLc;
5650 ulLc->lcg = &ue->ul.lcgArr[lcgCfg->ulInfo.lcgId];
5651 ulLc->lcgArrIdx = idx;
5653 ue->ul.lcgArr[lcgCfg->ulInfo.lcgId].numLch = lcgCfg->ulInfo.numLch;
5654 #endif /* LTE_L2_MEAS */
5657 } /* rgSCHCfgRgrLcgCfg */
5661 /***********************************************************
5663 * Func : rgSCHCfgRgrCmnLcCfg
5666 * Desc : Handles dedicated logical channel configuration
5667 * recieved from RRC.
5677 **********************************************************/
5678 static S16 rgSCHCfgRgrCmnLcCfg
5681 RgrCmnLchCfg *lcCfg,
5682 RgSchErrInfo *errInfo
5685 RgSchClcDlLcCb cmnLcCb;
5687 errInfo->errCause = RGSCHERR_CFG_RGR_CMN_LC_CFG;
5689 memset(&cmnLcCb, 0, sizeof(cmnLcCb));
5691 /* Handle configuration for CCCH/BCCH/PCCH */
5692 if (lcCfg->lcType == CM_LTE_LCH_CCCH)
5694 /* UL and DL CCCH configuration */
5695 if (lcCfg->dir & RGR_DIR_TX)
5697 cell->dlCcchId = lcCfg->lcId;
5700 if (lcCfg->dir & RGR_DIR_RX)
5702 cell->ulCcchId = lcCfg->lcId;
5707 cmnLcCb.lcId = lcCfg->lcId;
5708 rgSCHDbmInitCmnLcBoLst(&cmnLcCb);
5709 if (lcCfg->lcType == CM_LTE_LCH_BCCH)
5711 /* BCCH on BCH and DLSCH configuration */
5712 if (lcCfg->dlTrchType == CM_LTE_TRCH_DL_SCH)
5714 rgSCHDbmInsBcchOnDlsch(cell, &cmnLcCb);
5718 rgSCHDbmInsBcchOnBch(cell, &cmnLcCb);
5721 else /* PCCH configuration */
5723 rgSCHDbmInsPcch(cell, &cmnLcCb);
5728 } /* rgSCHCfgRgrCmnLcCfg */
5732 /***********************************************************
5734 * Func : rgSCHCfgFreeDlDedLcCb
5738 * - Processing Steps:
5739 * - Frees downlink dedicated logical channel control block.
5747 **********************************************************/
5748 static Void rgSCHCfgFreeDlDedLcCb
5755 Inst inst = cell->instIdx;
5757 rgSCHUtlFreeDlLc(cell, ue, dlLc);
5759 /* De-allocate the Cb */
5760 /* ccpu00117052 - MOD - Passing double pointer
5761 for proper NULLP assignment*/
5762 rgSCHUtlFreeSBuf(inst, (Data **)&dlLc, sizeof(*dlLc));
5765 /* Stack Crash problem for TRACE5 changes. Added the return below */
5768 } /* rgSCHCfgFreeDlDedLcCb */
5771 /***********************************************************
5773 * Func : rgSCHCfgFreeDlCmnLcCb
5777 * - Processing Steps:
5778 * - Frees downlink common logical channel control block.
5786 **********************************************************/
5787 static Void rgSCHCfgFreeDlCmnLcCb(RgSchClcDlLcCb *cmnDlLc)
5790 memset(cmnDlLc, 0, sizeof(*cmnDlLc));
5791 cmnDlLc->lcId = RGSCH_INVALID_LC_ID;
5793 } /* rgSCHCfgFreeDlCmnLcCb */
5796 /***********************************************************
5798 * Func : rgSCHCfgFreeCellCb
5802 * - Processing Steps:
5803 * - Frees scheduler cell control block.
5811 **********************************************************/
5812 Void rgSCHCfgFreeCellCb(RgSchCellCb *cell)
5814 Inst inst = cell->instIdx;
5817 RgSchWarningSiInfo *warningSi;
5818 RgSchWarningSiPdu *warningSiPdu;
5821 /* ccpu00132385- SI Warning PDUs which are not processed need to be deleted */
5822 /* Search for used index in WarningSi */
5823 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
5825 if(cell->siCb.warningSi[idx].siId == 0)
5827 cell->siCb.siCtx.siId = cell->siCb.warningSi[idx].siId;
5828 warningSi = (RgSchWarningSiInfo *) cell->siCb.
5829 siArray[cell->siCb.siCtx.siId-1].si;
5830 if(warningSi != NULLP)
5832 /* ccpu00136659: CMAS ETWS design change */
5833 while (CM_LLIST_FIRST_NODE(&warningSi->warningSiMsg.segLstCp, node))
5835 warningSiPdu = (RgSchWarningSiPdu *)node->node;
5836 pdu = warningSiPdu->pdu;
5837 /* ccpu00136659: CMAS ETWS design change */
5838 cmLListDelFrm(&warningSi->warningSiMsg.segLstCp, node);
5839 RGSCH_FREE_MSG(pdu);
5841 cell->siCb.siArray[cell->siCb.siCtx.siId-1].si = NULLP;
5844 /* Free lists of the cell */
5845 rgSCHCfgFreeUeLst(cell);
5847 rgSCHCfgFreeSpsUeLst(cell);
5848 #endif /* LTEMAC_SPS */
5850 if ( TRUE == cell->emtcEnable )
5852 rgSCHEmtcCellDel(cell);
5855 rgSCHRamFreeCell(cell);
5857 rgSCHDbmRntiDbDeInit(cell);
5858 /* Deallocate the subframe allocation information */
5859 rgSCHUtlPutSfAlloc(cell);
5860 rgSCHUtlFreeCell(cell);
5862 rgSCHCfgFreeRgrCfgLst(cell);
5863 rgSCHCfgFreeCmnLcLst(cell);
5865 rgSCHUtlPutRlsHqAlloc(cell);
5868 rgSCHDbmDeInitUeTfuPendLst(cell);
5869 #endif /* LTE_TDD */
5872 rgSCHUtlPutSiInfo(cell);
5873 #endif/*RGR_SI_SCH*/
5875 (Void)rgSCHDrxCellDel(cell);
5877 rgSCHUtlFreeSBuf(inst, (Data**)&(cell->dynCfiCb.cceFailSamples),
5878 (cell->dynCfiCb.numFailSamples * sizeof(uint16_t)));
5881 TSL2DeallocCellStatsBlk(cell->cellId);
5885 /* LAA_SCELL: Trigger the De-Init function for the LAA Module */
5886 rgSCHLaaSCellCbDeInit(cell);
5890 if(cell->emtcEnable)
5892 rgSCHEmtcCellFree(cell);
5895 /* De-allocate the Cell */
5896 /* ccpu00117052 - MOD - Passing double pointer
5897 for proper NULLP assignment*/
5898 rgSCHUtlFreeSBuf(inst, (Data **)&cell, sizeof(*cell));
5902 /* Stack Crash problem for TRACE5 changes. Added the return below */
5905 } /* rgSCHCfgFreeCellCb */
5908 /***********************************************************
5910 * Func : rgSCHCfgFreeUeCb
5914 * - Processing Steps:
5915 * - Frees UE control block.
5923 **********************************************************/
5924 static Void rgSCHCfgFreeUeCb
5930 RgSchCmnUlUe *ueUl = RG_SCH_CMN_GET_UL_UE(ue, cell);
5931 RgUeUlHqCb *ulHqEnt;
5933 Inst inst = cell->instIdx;
5937 /* Free all logical channel info per UE */
5938 while((dlLc = rgSCHDbmGetNextDlDedLcCb(ue, NULLP)) != NULLP)
5940 rgSCHDbmDelDlDedLcCb(ue, dlLc);
5941 rgSCHCfgFreeDlDedLcCb(cell, ue, dlLc);
5943 for (lcCnt =0; lcCnt<RGSCH_MAX_LC_PER_UE; lcCnt++)
5945 if(ue->ul.lcCb[lcCnt].isValid == TRUE)
5947 lcgId = ue->ul.lcCb[lcCnt].lcg->lcgId;
5950 rgSCHUtlRgrLcDel(cell, ue, ue->ul.lcCb[lcCnt].lcId,lcgId);
5951 ue->ul.lcCb[lcCnt].isValid = FALSE;
5956 ulHqEnt = &(ueUl->hqEnt);
5957 /* Free Scheduler specific information per UE */
5958 rgSCHUtlFreeUe(cell, ue);
5960 /* Free Uplink HARQ specific information per UE */
5961 rgSCHUhmFreeUe(cell, ulHqEnt);
5963 if ( ue->drxCb != NULLP)
5966 /* ccpu00117052 - MOD - Passing double pointer
5967 for proper NULLP assignment*/
5968 rgSCHUtlFreeSBuf(cell->instIdx,
5969 (Data**)(&(ue->drxCb)),
5970 sizeof(RgSchDrxUeCb));
5973 ue->drxCb = (RgSchDrxUeCb *)NULLP;
5974 /* Free Downlink HARQ specific information per UE */
5976 /* Release the RNTI */
5979 rgSCHUtlRlsRnti(cell, ue->rntiLnk, FALSE, 0);
5983 /* Fix : syed HO UE does not have a valid ue->rntiLnk */
5984 /* Just indicate to MAC, no need to release at SCH */
5985 rgSCHUtlIndRntiRls2Mac(cell, ue->ueId, FALSE, 0);
5987 /* rg009.201. Added changes of TFU_UPGRADE */
5989 rgSCHCfgPCqiSrsSrUeDel(cell,ue);
5992 rgSCHHdFddUeDel(cell, ue);
5997 TSL2DeallocUeStatsBlk(ue->ueId, ue->tenbStats);
6001 /* CA TODO Some handling needed while SCell Delete*/
6003 /* Delete the UE from the PCell secCellActCeLst*/
6004 rgSCHSCellRmvFrmActLst(cell, ue);
6005 rgSCHSCellDelUe(cell,ue);
6009 rgSCHLaaDeInitDlRbAllocCb(cell, &ue->cellInfo[RGSCH_PCELL_INDEX]->dlAllocCb);
6012 rgSCHUtlFreeSBuf(inst, (Data **)&ue->cellInfo[0], sizeof(RgSchUeCellInfo));
6013 /* De-allocate the Ue */
6014 /* ccpu00117052 - MOD - Passing double pointer
6015 for proper NULLP assignment*/
6019 rgSCHEmtcUeInfoFree(cell, ue);
6022 rgSCHUtlFreeSBuf(inst, (Data **)&ue, sizeof(*ue));
6024 /* Stack Crash problem for TRACE5 changes. Added the return below */
6027 } /* rgSCHCfgFreeUeCb */
6029 /***********************************************************
6031 * Func : rgSCHCfgFreeRgrCfgLst
6035 * - Processing Steps:
6036 * - Frees configuration lists in cell control block.
6044 **********************************************************/
6045 static Void rgSCHCfgFreeRgrCfgLst
6050 RgSchCfgElem *rgCfgElem;
6051 Inst inst = cell->instIdx;
6053 /* Free CURRENT RGR cfg list */
6054 while ((rgCfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
6056 rgSCHDbmDelCrntRgrCfgElem(cell, rgCfgElem);
6057 /* ccpu00117052 - MOD - Passing double pointer
6058 for proper NULLP assignment*/
6059 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6062 /* Free PENDING RGR cfg list */
6063 while ((rgCfgElem = rgSCHDbmGetNextPndngRgrCfgElem(cell, NULLP)) != NULLP)
6065 rgSCHDbmDelPndngRgrCfgElem(cell, rgCfgElem);
6066 /* ccpu00117052 - MOD - Passing double pointer
6067 for proper NULLP assignment*/
6068 rgSCHUtlFreeSBuf(inst, (Data **)&rgCfgElem, sizeof(*rgCfgElem));
6072 /* Stack Crash problem for TRACE5 changes. Added the return below */
6075 } /* rgSCHCfgFreeRgrCfgLst */
6078 /***********************************************************
6080 * Func : rgSCHCfgFreeCmnLcLst
6084 * - Processing Steps:
6085 * - Frees common logical channels in cell control block.
6093 **********************************************************/
6094 static Void rgSCHCfgFreeCmnLcLst
6099 RgSchClcDlLcCb *dlCmnLc;
6102 if ((dlCmnLc = rgSCHDbmGetBcchOnBch(cell)) != NULLP)
6104 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6106 if ((dlCmnLc = rgSCHDbmGetFirstBcchOnDlsch(cell)) != NULLP)
6108 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6110 if ((dlCmnLc = rgSCHDbmGetSecondBcchOnDlsch(cell)) != NULLP)
6112 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6114 if ((dlCmnLc = rgSCHDbmGetPcch(cell)) != NULLP)
6116 rgSCHCfgFreeDlCmnLcCb(dlCmnLc);
6120 /* Stack Crash problem for TRACE5 changes. Added the return below */
6123 } /* rgSCHCfgFreeCmnLcLst */
6126 /***********************************************************
6128 * Func : rgSCHCfgFreeUeLst
6132 * - Processing Steps:
6133 * - Frees UE list in cell control block.
6141 **********************************************************/
6142 static Void rgSCHCfgFreeUeLst
6149 RgSchUeCellInfo *sCellInfo;
6153 /* Free Ues in the list */
6154 while ((ue = rgSCHDbmGetNextUeCb(cell, NULLP)) != NULLP)
6156 rgSCHDbmDelUeCb(cell, ue);
6159 if(ue->cell != cell)
6165 /* Call MeasGap and AckNakRep processing module */
6166 rgSCHMeasGapANRepUeDel(cell, ue, TRUE);
6168 rgSCHCfgFreeUeCb(cell, ue);
6171 /* De-initialize the Ue list */
6172 rgSCHDbmDeInitUeCbLst(cell);
6176 node = cell->sCellUeLst.first;
6179 sCellInfo = (RgSchUeCellInfo *)node->node;
6181 rgSCHSCellDelUeSCell(sCellInfo->ue->cell, sCellInfo->ue, sCellInfo->sCellIdx);
6185 /* Stack Crash problem for TRACE5 changes. Added the return below */
6188 } /* rgSCHCfgFreeUeLst */
6191 /***********************************************************
6193 * Func : rgSCHCfgFreeSpsUeLst
6197 * - Processing Steps:
6198 * - Frees Sps UE list in cell control block.
6206 **********************************************************/
6207 static Void rgSCHCfgFreeSpsUeLst(RgSchCellCb *cell)
6211 /* Free Ues in the list */
6212 while ((ue = rgSCHDbmGetNextSpsUeCb(cell, NULLP)))
6214 rgSCHDbmDelSpsUeCb(cell, ue);
6217 /* De-initialize the Ue list */
6218 rgSCHDbmDeInitSpsUeCbLst(cell);
6220 } /* rgSCHCfgFreeSpsUeLst */
6222 #endif /* LTEMAC_SPS */
6225 /***********************************************************
6227 * Func : rgSCHCfgVldtRgrCellSiCfg
6229 * Desc : Validates SI Configuration for SI
6239 **********************************************************/
6240 static S16 rgSCHCfgVldtRgrCellSiCfg
6246 uint8_t idx; /* idx for iteration */
6251 /* Check that retxCnt value should be <= value of siWinSize.
6252 This validation is only applicable for FDD mode. */
6253 if(siCfg->retxCnt > siCfg->siWinSize)
6255 DU_LOG("\nERROR --> SCH : retxCnt is greater than siWinSize, validation failed");
6260 /* Validate that a valid value for numSi has been specified */
6261 if(siCfg->numSi > RGR_MAX_NUM_SI)
6263 DU_LOG("\nERROR --> SCH : Validation for numSi in SI CFG failed");
6267 /* MinPeriodicity will have the least configured periodicity
6268 * Hence initializing with Max periodicity */
6269 siCfg->minPeriodicity = RGR_SI_PERD_512;
6271 /*Validate the value of periodicity specified for SIs */
6272 for(idx = 0;idx < siCfg->numSi;idx++)
6274 siCfg->minPeriodicity = RGSCH_MIN(siCfg->minPeriodicity,
6275 siCfg->siPeriodicity[idx]);
6276 /* Set the siPeriodicity as a multiple of 80 subframes */
6277 switch(siCfg->siPeriodicity[idx])
6280 case RGR_SI_PERD_16:
6281 case RGR_SI_PERD_32:
6282 case RGR_SI_PERD_64:
6283 case RGR_SI_PERD_128:
6284 case RGR_SI_PERD_256:
6285 case RGR_SI_PERD_512:
6289 DU_LOG("\nERROR --> SCH : Validation for SI Periodicity in SI-CFG failed");
6295 } /* rgSCHCfgVldtRgrCellSiCfg */
6297 /* LTE_ADV_FLAG_REMOVED_START */
6298 /***********************************************************
6300 * Func : rgSCHCfgVldtRgrCellLtrAdvCfg
6302 * Desc : Validates Lte Adv Configuration
6312 **********************************************************/
6313 static S16 rgSCHCfgVldtRgrCellLteAdvCfg
6316 RgrLteAdvancedCellConfig *lteAdvCfg,
6320 uint8_t temp[RGR_ABS_PATTERN_LEN];
6324 if((lteAdvCfg->pres & RGR_SFR) && (RGR_ENABLE == lteAdvCfg->sfrCfg.status))
6326 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.startRb > lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb)
6328 DU_LOG("\nERROR --> SCH : Invalid configuration of cell edge bandwidth for SFR feature");
6332 if(lteAdvCfg->sfrCfg.cellEdgeRbRange.endRb >= dlTotalBw)
6334 DU_LOG("\nERROR --> SCH : Invalid configuration of cell edge end RB for SFR feature");
6339 if(lteAdvCfg->sfrCfg.pwrThreshold.pLow >= lteAdvCfg->sfrCfg.pwrThreshold.pHigh)
6341 DU_LOG("\nERROR --> SCH : Invalid configuration of power threshold for SFR feature");
6347 if((lteAdvCfg->pres & RGR_ABS) && (RGR_ENABLE == lteAdvCfg->absCfg.status))
6349 if((RGR_ABS_MUTE != lteAdvCfg->absCfg.absPatternType) &&
6350 (RGR_ABS_TRANSMIT != lteAdvCfg->absCfg.absPatternType))
6352 DU_LOG("\nERROR --> SCH : Invalid configuration of ABS pattern type");
6356 memcpy(temp, lteAdvCfg->absCfg.absPattern,RGR_ABS_PATTERN_LEN);
6358 /* Added validation for ABS pattern len */
6359 for(idx = 0; idx < RGR_ABS_PATTERN_LEN; idx++)
6361 if((temp[idx] != 1) && (temp[idx] != 0))
6363 DU_LOG("\nERROR --> SCH : Invalid configuration of ABS pattern type");
6371 /* LTE_ADV_FLAG_REMOVED_END */
6374 /***********************************************************
6376 * Func : rgSCHCfgVldtRgrCellCsgParamCfg
6378 * Desc : Validates CSG Parameter Configuration
6388 **********************************************************/
6389 static S16 rgSCHCfgVldtRgrCellCsgParamCfg
6392 RgrCellCsgParamCfg *csgParam
6396 DU_LOG("\nDEBUG --> SCH : Validating CSG Parameters \n");
6398 if(csgParam->minDlResNonCsg > 100)
6400 DU_LOG("\nERROR --> SCH : Invalid Configuration of minimum DL resources "
6404 if(csgParam->minUlResNonCsg > 100)
6406 DU_LOG("\nERROR --> SCH : Invalid Configuration of minimum UL resources "
6414 * @brief Validates the SI configuration request from RRM to MAC.
6418 * Function : rgSCHCfgVldtRgrSiCfg
6421 * - Validate the range of configured values recieved in
6422 * configuration request.
6423 * - If validated successfully,
6427 * - Else return RFAILED.
6428 * @param[in] Inst inst
6429 * @param[in] RgrCellCfg *siCfg
6430 * @param[out] RgSchCellCb *cell
6431 * @param[out] RgSchErrInfo *errInfo
6436 S16 rgSCHCfgVldtRgrSiCfg
6439 RgrSiCfgReqInfo *siCfg,
6441 RgSchErrInfo *errInfo
6447 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_SI_CFG;
6449 /*Validate the cfgType parameter */
6450 switch(siCfg->cfgType)
6454 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6455 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6456 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6457 (siCfg->siId > numSi))
6459 DU_LOG("\nERROR --> SCH : Invalid SI Id value"
6463 errInfo->errCause = RGSCHERR_NONE;
6466 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
6467 case RGR_SI_CFG_TYPE_SIB1: /* SI CFG TYPE SIB1 */
6468 case RGR_SI_CFG_TYPE_SIB1_PWS: /* SI CFG TYPE SIB1_PWS */
6469 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
6471 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR:
6472 case RGR_SI_CFG_EMTC_TYPE_SIB1_BR_PER:
6476 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
6477 /*Check that value of SI should be less than equal
6478 to configured numSi parameter value */
6479 /* Added siId validation for lower limit */
6480 numSi = (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD) ?
6481 cell->siCb.newSiCfg.numSi : cell->siCfg.numSi;
6482 if((siCfg->siId < RGSCH_SI_SIID_LOWER_LMT) ||
6483 (siCfg->siId > numSi))
6485 DU_LOG("\nERROR --> SCH : Invalid SI Id value"
6490 if(siCfg->siId > ((cell->siCfg.minPeriodicity * 10)/cell->siCfg.siWinSize))
6492 DU_LOG("\nERROR --> SCH : SiId can not be scheduled ");
6498 case RGR_SI_CFG_EMTC_TYPE_SI:
6499 case RGR_SI_CFG_EMTC_TYPE_SI_PER:
6500 if(ROK != rgEmtcvalidateSiCfg(siCfg,cell))
6507 DU_LOG("\nERROR --> SCH : Invalid cfgType "
6512 /*Validate the specified pdu */
6513 if(NULLP == siCfg->pdu)
6515 DU_LOG("\nERROR --> SCH : Invalid NULLP pdu "
6520 /*Check if PDU is of 0 length*/
6521 SFndLenMsg(siCfg->pdu, &msgLen);
6524 DU_LOG("\nERROR --> SCH : Invalid pdu "
6529 errInfo->errCause = RGSCHERR_NONE;
6533 } /* rgSCHCfgVldtRgrSiCfg */
6534 #endif /*RGR_SI_SCH*/
6536 /* LTE_ADV_FLAG_REMOVED_START */
6538 * @brief Validates the RNTP INF request from RRM to MAC.
6542 * Function : rgSCHCfgVldtRgrLoadInf
6545 * - Validate the range of configured values recieved in
6547 * - If validated successfully,
6551 * - Else return RFAILED.
6552 * @param[in] Inst inst
6553 * @param[in] RgrLoadInfReqInfo *loadInfReq
6554 * @param[out] RgSchCellCb *cell
6555 * @param[out] RgSchErrInfo *errInfo
6560 S16 rgSCHCfgVldtRgrLoadInf
6563 RgrLoadInfReqInfo *loadInfReq,
6565 RgSchErrInfo *errInfo
6569 errInfo->errCause = RGSCHERR_CFG_INVALID_RGR_LOAD_INF;
6571 /* Validate if the CC startRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6572 if((loadInfReq->rgrCcPHighStartRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6573 (loadInfReq->rgrCcPHighStartRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6575 DU_LOG("\nERROR --> SCH : Invalid rgrCcPHighStartRb received specified");
6579 /* Validate if the CC endRb which we have received from DSFR lies in CE sub-band of the receiving eNB */
6580 if((loadInfReq->rgrCcPHighEndRb >= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.startRb) &&
6581 (loadInfReq->rgrCcPHighEndRb <= cell->lteAdvCb.sfrCfg.cellEdgeRbRange.endRb))
6583 DU_LOG("\nERROR --> SCH : Invalid rgrCcPHighEndRb received specified");
6587 errInfo->errCause = RGSCHERR_NONE;
6591 } /* rgSCHCfgVldtRgrLoadInf */
6592 /* LTE_ADV_FLAG_REMOVED_END */
6596 /********************************************************************
6597 * UE ACQI, PCQI, RI, SRS and SR Re/Configuration Validation Functions *
6599 *********************************************************************/
6602 * @brief Validates the Tx Mode and PUSCH Mode configuration.
6606 * Function : rgSCHCfgVldtRgrTxmodePuschMode
6609 * - Validate whether the configured PUSCH Mode and the
6610 * Configured Tx Mode are in the right combination
6611 * - If validated successfully,
6616 * @param[in] RgSchCellCb *cellCb
6617 * @param[in] RgrTxMode txMde
6618 * @param[in] RgrAprdCqiMode puschMode
6619 * @param[out] RgSchErrInfo *errInfo
6624 S16 rgSCHCfgVldtRgrTxmodePuschMode
6626 RgSchCellCb *cellCb,
6628 RgrAprdCqiMode puschMode,
6629 RgSchErrInfo *errInfo
6633 if (txMde == RGR_UE_TM_1 || txMde == RGR_UE_TM_2 ||
6634 txMde == RGR_UE_TM_3 || txMde == RGR_UE_TM_7)
6636 if (puschMode == RGR_APRD_CQI_MOD12 ||
6637 puschMode == RGR_APRD_CQI_MOD22 ||
6638 puschMode == RGR_APRD_CQI_MOD31)
6644 if (txMde == RGR_UE_TM_4 || txMde == RGR_UE_TM_6)
6646 if (puschMode == RGR_APRD_CQI_MOD20 ||
6647 puschMode == RGR_APRD_CQI_MOD30)
6653 if (txMde == RGR_UE_TM_5 )
6655 if (puschMode != RGR_APRD_CQI_MOD31)
6661 /* TOODO:: Tm8 and TM9 validation has to
6662 * be changed as mentioned inthe commented
6664 /* TM8 and TM9 supports all modes
6665 * Mode 1-2, 2-2, 3-1 if pmi/ri reporting enabled
6666 * 2-0,3-0 of pmi/ri reporitng isdisabled *
6667 * if pmi/ri is enabled
6668 * Mode 1-2, 2-2, 3-1 if with pmi/ri and csi-rs ports > 1
6669 * 2-0,3-0 of pmi/ri reporitng isdisabled and csi-rs ports == 1*/
6673 }/*rgSCHCfgVldtRgrTxmodePuschMode ends*/
6676 * @brief Validates the UE ACQI configuration request from RRM to MAC.
6680 * Function : rgSCHCfgVldtRgrUeACqiCfg
6683 * - Validate the UE configuration request from RRC to MAC at CFG:
6684 * validate the ACQI Configuration
6685 * - If validated successfully,
6690 * @param[in] RgSchCellCb *cellCb,
6691 * @param[in] CmLteRnti crnti,
6692 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg,
6693 * @param[in] RgrUeTxModeCfg txMode,
6694 * @param[out] RgSchErrInfo *errInfo
6700 S16 rgSCHCfgVldtRgrUeACqiCfg
6702 RgSchCellCb *cellCb,
6704 RgrUeAprdDlCqiCfg *acqiCfg,
6705 RgrUeTxModeCfg txMode,
6706 RgSchErrInfo *errInfo
6710 RgrAprdCqiMode puschMode;
6714 if(txMode.pres == TRUE)
6716 txMde = txMode.txModeEnum;
6717 puschMode = acqiCfg->aprdModeEnum;
6718 if ( ROK != rgSCHCfgVldtRgrTxmodePuschMode(cellCb, txMde,
6719 puschMode, errInfo))
6721 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration CRNTI:%d",crnti);
6730 * @brief Validates the Tx Mode and PUCCH Mode configuration.
6734 * Function : rgSCHCfgVldtRgrTxmodePucchMode
6737 * - Validate whether the configured PUCCH Mode and the
6738 * Configured Tx Mode are in the right combination
6739 * - If validated successfully,
6744 * @param[in] RgSchCellCb *cellCb
6745 * @param[in] RgrTxMode txMde
6746 * @param[in] RgrPrdCqiMode pucchMode
6747 * @param[out] RgSchErrInfo *errInfo
6752 S16 rgSCHCfgVldtRgrTxmodePucchMode
6754 RgSchCellCb *cellCb,
6756 RgrPrdCqiMode pucchMode,
6757 RgSchErrInfo *errInfo
6761 if (pucchMode == RGR_PRD_CQI_MOD10 || pucchMode == RGR_PRD_CQI_MOD20 )
6763 if (txMde ==RGR_UE_TM_4 || txMde ==RGR_UE_TM_5 || txMde ==RGR_UE_TM_6)
6768 else if (pucchMode == RGR_PRD_CQI_MOD11 || pucchMode == RGR_PRD_CQI_MOD21)
6770 if (txMde ==RGR_UE_TM_1 || txMde ==RGR_UE_TM_2 || txMde ==RGR_UE_TM_3 \
6771 || txMde ==RGR_UE_TM_7)
6776 /* TODO:: Tm8 and TM9 validation needs to be added */
6781 * @brief Validates the UE Periodic CQI, PMI, RI, re/configuration request from RRM to MAC.
6785 * Function : rgSCHCfgVldtRgrUePCqiCfg
6788 * - Validate the UE configuration request from RRC to MAC at CFG:
6789 * validate the value range for Periodic CQI, PMI, RI values.
6790 * - If validated successfully,
6795 * @param[in] RgSchCellCb *cellCb,
6796 * @param[in] CmLteRnti crnti,
6797 * @param[in] RgrUePrdDlCqiCfg *cqiCfg,
6798 * @param[in] RgrUeTxModeCfg txMode,
6799 * @param[out] RgSchErrInfo *errInfo
6805 S16 rgSCHCfgVldtRgrUePCqiCfg
6807 RgSchCellCb *cellCb,
6809 RgrUePrdDlCqiCfg *cqiCfg,
6811 RgrUeTxModeCfg txMode,
6812 RgSchErrInfo *errInfo
6815 S16 rgSCHCfgVldtRgrUePCqiCfg
6817 RgSchCellCb *cellCb,
6819 RgrUePrdDlCqiCfg *cqiCfg,
6820 RgrUeTxModeCfg txMode,
6821 RgSchErrInfo *errInfo
6826 RgrPrdCqiMode pucchMode;
6828 txMde = RGR_UE_TM_1;
6829 pucchMode = RGR_PRD_CQI_MOD20;
6830 if ( RGR_SCH_PCQI_SETUP == cqiCfg->type )
6832 /*1. Validate for Tx Mode and PUCCH Mode combination*/
6833 if(txMode.pres == TRUE)
6835 txMde = txMode.txModeEnum;
6836 pucchMode = cqiCfg->cqiSetup.prdModeEnum;
6837 if ( ROK != rgSCHCfgVldtRgrTxmodePucchMode(cellCb, txMde,
6838 pucchMode, errInfo))
6840 DU_LOG("\nERROR --> SCH : Invalid Tx Mode-PUCCH Mode combination CRNTI:%d",crnti);
6845 /*2. Validate for PCQI Reporting Type and PUCCH Mode combination*/
6846 if((cqiCfg->cqiSetup.cqiRepType==1) &&
6847 ((pucchMode == RGR_PRD_CQI_MOD20) ||
6848 (pucchMode == RGR_PRD_CQI_MOD21)))
6850 DU_LOG("\nERROR --> SCH : Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6854 if((cqiCfg->cqiSetup.cqiRepType==2) &&
6855 ((pucchMode == RGR_PRD_CQI_MOD10) ||
6856 (pucchMode == RGR_PRD_CQI_MOD11)))
6858 DU_LOG("\nERROR --> SCH : Invalid Reporting Type-PUCCH Mode combination CRNTI:%d",crnti);
6862 /*3. Validate CQI/PMI and RI Configuration related parameter values */
6863 /*TODO- To be compared with configured n2Pucch Index*/
6864 if (cqiCfg->cqiSetup.cqiPResIdx > RG_SCH_PUCCH_RES_MAX_SUPP )
6866 DU_LOG("\nERROR --> SCH : Not Supported or Invalid CQI-PUCCH resourceIndex=%d Cfg Val=%d CRNTI:%d",
6867 RG_SCH_PUCCH_RES_MAX_SUPP, cqiCfg->type,crnti);
6874 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6875 (cqiCfg->cqiSetup.cqiPCfgIdx < 7) ||
6876 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6878 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6879 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6880 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6886 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6887 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6889 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d "
6890 "Max Index Sup=%d Cfg Val=%d CRNTI:%d", RG_SCH_ICQI_MIN_SUPP,
6891 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6896 if((cqiCfg->cqiSetup.cqiPCfgIdx > RG_SCH_ICQI_MAX_SUPP)||
6897 (cqiCfg->cqiSetup.cqiPCfgIdx == 317))
6899 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg CQI Min Index Sup =%d"
6900 "Max Index Sup=%d Cfg Val=%d CRNTI;%d", RG_SCH_ICQI_MIN_SUPP,
6901 RG_SCH_ICQI_MAX_SUPP, cqiCfg->type,crnti);
6906 if((cqiCfg->cqiSetup.cqiRepType < RGR_UE_PCQI_WB_REP) ||
6907 (cqiCfg->cqiSetup.cqiRepType > RGR_UE_PCQI_SB_REP))
6909 DU_LOG("\nERROR --> SCH : Invalid Cfg CQI Report"
6910 "ModeCfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6914 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6915 ((cqiCfg->cqiSetup.k < RG_SCH_CQI_K_MIN) ||
6916 (cqiCfg->cqiSetup.k > RG_SCH_CQI_K_MAX)))
6918 DU_LOG("\nERROR --> SCH : Invalid CQI Cfg K Cfg Val=%d CRNTI:%d", cqiCfg->type,crnti);
6922 if((cqiCfg->cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP) &&
6923 (cellCb->bwCfg.dlTotalBw <= 7))
6925 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI mode Cfg for dlTotalBw (%d) for CRNTI:%d",
6926 cellCb->bwCfg.dlTotalBw, crnti);
6931 if (cqiCfg->cqiSetup.cqiPCfgIdx == RG_SCH_ICQI_RESV_FDD )
6933 DU_LOG("\nERROR --> SCH : Reserved value Cfg =%d CRNTI:%d",
6934 cqiCfg->cqiSetup.cqiPResIdx,crnti);
6939 /* 4. Check RI Configuration values */
6940 if(cqiCfg->cqiSetup.riEna == TRUE)
6942 if(txMode.pres == TRUE)
6944 if((txMde != RGR_UE_TM_3)
6945 && (txMde != RGR_UE_TM_4)
6946 && (txMde != RGR_UE_TM_8)
6948 && (txMde != RGR_UE_TM_9)
6952 DU_LOG("\nERROR --> SCH : Invalid Transmission Mode =%d CRNTI:%d",
6958 if(cqiCfg->cqiSetup.riCfgIdx > RG_SCH_IRI_MAX_SUPP)
6960 DU_LOG("\nERROR --> SCH : Invalid Index RI value Cfg =%d CRNTI:%d",
6961 cqiCfg->cqiSetup.riCfgIdx,crnti);
6972 * @brief Validates the UE SRS Re/Configuation request from RRM to MAC.
6976 * Function : rgSCHCfgVldtRgrUeUlSrsCfg
6979 * - Validate the UE configuration request from RRC to MAC at CFG:
6980 * validate the value range for SRS values.
6981 * - If validated successfully,
6986 * @param[in] RgSchCellCb *cellCb,
6987 * @param[in] CmLteRnti crnti,
6988 * @param[in] RgrUeUlSrsCfg *srsCfg,
6989 * @param[out] RgSchErrInfo *errInfo
6995 S16 rgSCHCfgVldtRgrUeUlSrsCfg
6997 RgSchCellCb *cellCb,
6999 RgrUeUlSrsCfg *srsCfg,
7001 RgSchErrInfo *errInfo
7004 S16 rgSCHCfgVldtRgrUeUlSrsCfg
7006 RgSchCellCb *cellCb,
7008 RgrUeUlSrsCfg *srsCfg,
7009 RgSchErrInfo *errInfo
7014 uint16_t srsOffset=0;
7015 uint8_t srsSubframe=0;
7017 if ( RGR_SCH_SRS_SETUP == srsCfg->type )
7020 /*ccpu00130768 - ADD - if cell specific SRS is not configured*/
7021 if(cellCb->srsCfg.isSrsCfgPres == FALSE)
7023 DU_LOG("\nERROR --> SCH : Cell specific SRS is not configured CRNTI:%d",crnti);
7027 /* 1. Validate SRS Configuration related parameter values */
7028 /* 1.1 iSRS should be 0-636; Ref: 36.213. Table 8.2-1 */
7032 if ( (srsCfg->srsSetup.srsCfgIdx < 7) ||
7033 (srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP) )
7035 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg "
7036 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7037 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7038 srsCfg->srsSetup.srsCfgIdx,crnti);
7044 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7046 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7047 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7048 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7049 srsCfg->srsSetup.srsCfgIdx,crnti);
7055 if ( srsCfg->srsSetup.srsCfgIdx > RG_SCH_ISRS_MAX_SUPP )
7057 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7058 "SRS Min Index Sup =%d Max Index Sup=%d Cfg Val=%d CRNTI:%d",
7059 RG_SCH_ISRS_MIN_SUPP, RG_SCH_ISRS_MAX_SUPP,
7060 srsCfg->srsSetup.srsCfgIdx,crnti);
7065 /* Compute SRS Offset and Periodicity */
7066 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7067 srsCfg->srsSetup.srsCfgIdx,
7068 &srsPeri, &srsOffset);
7070 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7071 srsCfg->srsSetup.srsCfgIdx,
7072 &srsPeri, &srsOffset);
7074 srsSubframe = srsOffset%RGSCH_NUM_SUB_FRAMES;
7076 if(rgSchTddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7078 if(rgSchFddCellSpSrsSubfrmTbl[cellCb->srsCfg.srsSubFrameCfg][srsSubframe] == FALSE) {
7080 DU_LOG("\nERROR --> SCH : UE specific SRS is not occuring in Cell specific SRS subframe"
7081 "srs Cfg Idx =%d CRNTI:%d",
7082 srsCfg->srsSetup.srsCfgIdx,crnti);
7087 if ( srsCfg->srsSetup.fDomPosi > RG_SCH_SRS_FREQDOM_POS_MAX )
7089 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7090 "SRS Min Freq Domain Position =%d"
7091 "Max Freq Domain Position =%d Cfg Val=%d CRNTI:%d",
7092 RG_SCH_SRS_FREQDOM_POS_MIN, RG_SCH_SRS_FREQDOM_POS_MAX,
7093 srsCfg->srsSetup.srsCfgIdx,crnti);
7097 if ( srsCfg->srsSetup.txComb > RG_SCH_SRS_TXCOMB_MAX )
7099 DU_LOG("\nERROR --> SCH : Not Supported or Invalid Cfg"
7100 "SRS Min TX Comb =%d Max TX Comb =%d Cfg Val=%d CRNTI:%d",
7101 RG_SCH_SRS_TXCOMB_MIN, RG_SCH_SRS_TXCOMB_MAX,
7102 srsCfg->srsSetup.srsCfgIdx,crnti);
7110 * @brief Validates the UE SR Re/configuration request from RRM to MAC.
7114 * Function : rgSCHCfgVldtRgrUeSrCfg
7117 * - Validate the UE re/configuration request from RRC to MAC at CFG:
7118 * validate the value range for SR values.
7119 * - If validated successfully,
7124 * @param[in] RgSchCellCb *cellCb,
7125 * @param[in] CmLteRnti crnti,
7126 * @param[in] RgrUeSrCfg *srCfg,
7127 * @param[out] RgSchErrInfo *errInfo
7133 S16 rgSCHCfgVldtRgrUeSrCfg
7135 RgSchCellCb *cellCb,
7139 RgSchErrInfo *errInfo
7142 S16 rgSCHCfgVldtRgrUeSrCfg
7144 RgSchCellCb *cellCb,
7147 RgSchErrInfo *errInfo
7152 if ( RGR_SCH_SR_SETUP == srCfg->type )
7154 /* 1. Validate SR Configuration related parameter values */
7158 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7159 ( srCfg->srSetup.srCfgIdx < 5 ) ||
7160 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7162 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7163 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7164 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7171 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7172 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7174 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7175 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7176 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7182 if (( srCfg->srSetup.srResIdx > RG_SCH_SR_RES_IDX ) ||
7183 ( srCfg->srSetup.srCfgIdx > RG_SCH_ISR_MAX_SUPP ))
7185 DU_LOG("\nERROR --> SCH : Invalid SR Index Cfg =%d"
7186 "Max Supp=%d,Min Supp=%d CRNTI:%d", srCfg->srSetup.srCfgIdx,
7187 RG_SCH_ISR_MAX_SUPP, RG_SCH_ISR_MIN_SUPP,crnti);
7198 * @brief Validates the UE Aperiodic & Periodic CQI, PMI, RI, SRS and SR Configuration
7199 * request from RRM to MAC.
7203 * Function :rgSCHCfgVldtCqiSrSrsUeCfg
7206 * - Validate the UE configuration request from RRC to MAC at CFG:
7207 * validate the value range for Aperiodic & Periodic CQI, PMI, RI , SRS and SR values.
7208 * - If validated successfully,
7213 * @param[in] RgSchCellCb *cellCb
7214 * @param[in] RgrUeCfg *ueCfg
7215 * @param[out] RgSchErrInfo *errInfo
7220 static S16 rgSCHCfgVldtCqiSrSrsUeCfg
7222 RgSchCellCb *cellCb,
7224 RgSchErrInfo *errInfo
7228 /* 1. Validate UE Aperiodic CQI related parameters */
7229 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueCfg->crnti,
7230 &ueCfg->ueDlCqiCfg.aprdCqiCfg, ueCfg->txMode, errInfo ))
7232 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration CRNTI:%d",ueCfg->crnti);
7236 /* 1. Validate UE Periodic CQI/PMI, SRS and SR related parameters */
7238 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7239 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->isHdFddEnbld,
7240 ueCfg->txMode, errInfo ))
7242 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueCfg->crnti,
7243 &ueCfg->ueDlCqiCfg.prdCqiCfg, ueCfg->txMode, errInfo ))
7246 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI configuration CRNTI:%d",ueCfg->crnti);
7250 /* 2. Validate SRS Configuration related parameter values */
7252 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti, &ueCfg->srsCfg,
7253 ueCfg->isHdFddEnbld, errInfo ))
7255 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueCfg->crnti,
7256 &ueCfg->srsCfg, errInfo ))
7259 DU_LOG("\nERROR --> SCH : Invalid SRS configuration CRNTI:%d",ueCfg->crnti);
7263 /* 3. Validate SR Configuration related parameter values */
7265 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti, &ueCfg->srCfg,
7266 ueCfg->isHdFddEnbld, errInfo))
7268 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueCfg->crnti,
7269 &ueCfg->srCfg, errInfo))
7272 DU_LOG("\nERROR --> SCH : Invalid SR configuration CRNTI:%d",ueCfg->crnti);
7282 /*****************************************************************
7283 * UE PCQI, RI, SRS and SR Re Configuration Validation Functions *
7285 ******************************************************************/
7287 * @brief Validates the UE Periodic CQI, PMI, RI, SRS and SR
7288 * Re-configuration request from RRM to MAC.
7292 * Function : rgSCHCfgVldtCqiSrSrsUeReCfg
7295 * - Validate the UE Re configuration request from RRC to MAC at CFG:
7296 * validate the value range for Periodic CQI, PMI, RI, SRS and SR values.
7297 * - If validated successfully,
7302 * @param[in] RgSchCellCb *cellCb
7303 * @param[in] RgSchUeCb *ueCb
7304 * @param[in] RgrUeCfg *ueCfg
7305 * @param[out] RgSchErrInfo *errInfo
7310 static S16 rgSCHCfgVldtCqiSrSrsUeReCfg
7312 RgSchCellCb *cellCb,
7314 RgrUeRecfg *ueReCfg,
7315 RgSchErrInfo *errInfo
7318 RgrUeTxModeCfg txMode;
7321 txMode.tmTrnstnState = RGR_TXMODE_RECFG_CMPLT;
7322 if ((ueReCfg->ueRecfgTypes & RGR_UE_TXMODE_RECFG) &&
7323 (ueReCfg->txMode.pres == TRUE))
7325 txMode.txModeEnum = ueReCfg->txMode.txModeEnum;
7329 txMode.txModeEnum = ueCb->mimoInfo.txMode;
7332 /* 1. Validate UE CQI/PMI, SRS and SR related parameters */
7334 if ( ueReCfg->ueRecfgTypes & RGR_UE_APRD_DLCQI_RECFG )
7336 if ( ROK != rgSCHCfgVldtRgrUeACqiCfg (cellCb, ueReCfg->oldCrnti,
7337 &ueReCfg->aprdDlCqiRecfg, txMode, errInfo ))
7339 DU_LOG("\nERROR --> SCH : Invalid Aperiodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7345 /* 2. Validate UE CQI/PMI, SRS and SR related parameters */
7347 if ( ueReCfg->ueRecfgTypes & RGR_UE_PCQI_RECFG )
7350 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7351 &ueReCfg->cqiCfg, ueReCfg->isHdFddEnbld, txMode, errInfo ))
7353 if ( ROK != rgSCHCfgVldtRgrUePCqiCfg (cellCb, ueReCfg->oldCrnti,
7354 &ueReCfg->cqiCfg, txMode, errInfo ))
7358 DU_LOG("\nERROR --> SCH : Invalid Periodic CQI configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7363 if(ueReCfg->ueRecfgTypes & RGR_UE_SRS_RECFG )
7366 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7367 &ueReCfg->srsCfg, ueReCfg->isHdFddEnbld, errInfo ))
7369 if ( ROK != rgSCHCfgVldtRgrUeUlSrsCfg(cellCb, ueReCfg->oldCrnti,
7370 &ueReCfg->srsCfg, errInfo ))
7373 DU_LOG("\nERROR --> SCH : Invalid SRS configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7379 if ( ueReCfg->ueRecfgTypes & RGR_UE_SR_RECFG )
7382 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7383 &ueReCfg->srCfg, ueReCfg->isHdFddEnbld, errInfo))
7385 if ( ROK != rgSCHCfgVldtRgrUeSrCfg (cellCb, ueReCfg->oldCrnti,
7386 &ueReCfg->srCfg, errInfo))
7389 DU_LOG("\nERROR --> SCH : Invalid SR configuration OLD CRNTI:%d",ueReCfg->oldCrnti);
7398 /*****************************************************************
7399 * UE ACQI, PCQI, RI, SRS SR Configuration Functions *
7401 ******************************************************************/
7403 * @brief Handles Aperiodic CQI , PMI, RI configuration for a UE.
7407 * Function : rgSCHCfgACqiUeCfg
7409 * Invoking Module Processing:
7410 * - This shall be invoked by SCH_GOM at UE configuration. It
7411 * shall do the validations for the spec-defined values.
7417 * @param[in] RgSchCellCb *cell
7418 * @param[in] RgrTxMode txMode
7419 * @param[in] RgrUeAprdDlCqiCfg *aCqiCfg
7420 * @param[in] CmLteUeCategory ueCat
7425 S16 rgSCHCfgACqiUeCfg
7427 RgSchCellCb *cellCb,
7429 RgSchUeACqiCb *acqiCb,
7431 RgrUeAprdDlCqiCfg *aCqiCfg,
7432 CmLteUeCategory ueCat
7435 uint8_t M; /*Num of Subbands -- Applicable only for Mode 2-0 and 2-2*/
7436 uint8_t k; /*SubBand Size (RB) --
7437 Holds different values depending on Mode*/
7438 uint8_t cqiPmiSzR1; /*CQIPMI Size for Rank =1*/
7439 uint8_t cqiPmiSzRn1; /*CQIPMI Size for Rank > 1*/
7444 acqiCb->aCqiCfg.pres = aCqiCfg->pres;
7445 acqiCb->aCqiCfg.aprdModeEnum = aCqiCfg->aprdModeEnum;
7450 /*Store Trigger Set Bit String to UE */
7451 RgSchUeCellInfo *pCellInfo = RG_SCH_CMN_GET_PCELL_INFO(ue);
7452 pCellInfo->acqiCb.aCqiCfg.triggerSet1 = aCqiCfg->triggerSet1;
7453 pCellInfo->acqiCb.aCqiCfg.triggerSet2 = aCqiCfg->triggerSet2;
7457 switch(aCqiCfg->aprdModeEnum)
7459 case RGR_APRD_CQI_MOD12:
7460 case RGR_APRD_CQI_MOD30:
7461 case RGR_APRD_CQI_MOD31:
7462 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7463 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7467 case RGR_APRD_CQI_MOD20:
7468 case RGR_APRD_CQI_MOD22:
7469 RG_SCH_GET_SBCQI_M_K_VAL(cellCb->bwCfg.dlTotalBw, M, k);
7470 acqiCb->N = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, k);
7473 acqiCb->L = RgSCHUeAcqi2022LBitWidth[M-1][acqiCb->N-1];
7479 if((ueTxMode == RGR_UE_TM_3) ||
7480 (ueTxMode == RGR_UE_TM_4))
7482 if(cellCb->numTxAntPorts ==2)
7484 acqiCb->riNumBits = 1;
7486 else if(cellCb->numTxAntPorts ==4)
7488 if(ueCat == CM_LTE_UE_CAT_8)
7490 acqiCb->riNumBits = 3;
7492 else if(ueCat >= CM_LTE_UE_CAT_5)
7494 acqiCb->riNumBits = 2;
7498 acqiCb->riNumBits = 1;
7502 rgSCHCfgUtlFetchAcqiBitSz(acqiCb, cellCb->numTxAntPorts,
7503 &cqiPmiSzR1, &cqiPmiSzRn1);
7504 acqiCb->cqiPmiSzR1 = cqiPmiSzR1;
7505 acqiCb->cqiPmiSzRn1 = cqiPmiSzRn1;
7507 acqiCb->cqiReqField = TRUE;
7509 rgSchCmnSetCqiReqField(RG_SCH_CMN_GET_SCELL_INFO(ue, cellCb),ue,&acqiCb->cqiReqField);
7516 * @brief Handles Periodic CQI , PMI, RI configuration for a UE.
7520 * Function : rgSCHCfgPCqiUeCfg
7522 * Invoking Module Processing:
7523 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7524 * validations for the spec-defined values.
7527 * - For UE-specific Periodic CQI related configuration,
7528 * - If Periodic CQI/PMI is configured,
7529 * - Update UE with the configured values.
7530 - Compute and Update next occurance of CQI/PMI or RI Tranmission instance.
7531 - Update the CQI offset and CQI perodicity information
7532 - Add Ue to cell's list
7535 * - For UE-specific Periodic RI related configuration,
7536 * - If Periodic RI is configured,
7537 * - Update UE with the configured values.
7538 - Compute and Update next occurance of RI Tranmission instance.
7539 - Update the RI offset and RI perodicity information
7544 * @param[in] RgSchCellCb *cell
7545 * @param[in] RgSchUeCb *ue
7546 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7547 * @param[in] CmLteUeCategory ueCat
7552 S16 rgSCHCfgPCqiUeCfg
7554 RgSchCellCb *cellCb,
7556 RgrUePrdDlCqiCfg *cqiCfg,
7557 CmLteUeCategory ueCat
7560 CmLteTimingInfo timingInfo;
7562 uint16_t cqiTrInstTime;
7563 uint8_t j; /*Bandwidth Parts*/
7566 RgSchUePCqiCb *cqiCb = NULLP;
7568 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
7569 (cellCb->crntTime.slot);
7570 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7571 cqiCb->servCellInfo = ueCb->cellInfo[0];
7572 /* Periodic CQI is setup */
7573 if (cqiCfg->type == RGR_SCH_PCQI_SETUP)
7575 for(loop = 0; loop < MAX_CQI_RI_RPT_BUFF;loop++)
7577 ueCb->rawCqiBitW[loop].type = TFU_RECP_REQ_INVLD; /* setting invalid type*/
7579 /* 1. Copy the Received CQI Cfg parameters to ueCb */
7580 memcpy(&cqiCb->cqiCfg, cqiCfg,
7581 sizeof(RgrUePrdDlCqiCfg));
7583 /* 2. Compute Periodic CQI Periodicity and subframe offset */
7585 rgSCHUtlGetCfgPerOff(RG_SCH_FDD_PCQI_TBL, cqiCfg->cqiSetup.cqiPCfgIdx,
7586 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7588 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_PCQI_TBL,
7589 cqiCfg->cqiSetup.cqiPCfgIdx,
7590 &cqiCb->cqiPeri, &cqiCb->cqiOffset);
7592 DU_LOG("\nDEBUG --> SCH : rgSCHCfgPCqiUeCfg(): UEID:%d CQI Peri=%d, CQI Offset=%d",
7598 cqiTrInstTime = ((cqiCb->cqiPeri+crntTime) - cqiCb->cqiOffset)
7600 cqiCb->nCqiTrIdx = (crntTime +
7601 (cqiCb->cqiPeri - cqiTrInstTime));
7602 /* Introduced timing delta for reception req
7604 if(cqiCb->nCqiTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7606 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx + cqiCb->cqiPeri;
7609 /* To handle the SFN wrap around case */
7610 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx % (RGSCH_MAX_SFN * RGSCH_NUM_SUB_FRAMES_5G);
7612 timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
7613 timingInfo.slot = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
7615 cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
7616 %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7619 /*CQI Repetition configuration*/
7622 rgSchfillPucchCqiRepNumCountemtc(cqiCb, ueCb);
7626 if(RGR_UE_PCQI_SB_REP == cqiCfg->cqiSetup.cqiRepType)
7628 uint8_t k; /*SubBand Size (RB) */
7629 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7630 RG_SCH_GET_CQI_K_VAL(cellCb->bwCfg.dlTotalBw, k);
7631 cqiCb->J = j; /*Number of Bandwidth Parts*/
7632 /*h: reporting instances required for a complete CQI/PMI report */
7633 /*j:Number of bandwidth parts; k: Subband Size*/
7634 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7635 /* ccpu00140905- L-size is coming as 3 for 100Rbs where it should be 2*/
7636 temp = RGSCH_CEIL(cellCb->bwCfg.dlTotalBw, (j*k));
7637 cqiCb->label = (temp & (temp-1)) ?
7638 (1+ rgSCHUtlLog32bitNbase2(temp)) : rgSCHUtlLog32bitNbase2(temp);
7640 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ueCb, cqiCb);
7645 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
7649 /* Place the UE in cellCb->tIUeLstCp */
7650 cqiCb->cqiLstEnt.node=(PTR) cqiCb;
7652 cqiCb->isCqiIgnoByCollsn = FALSE;
7653 cqiCb->isRiIgnoByCollsn = FALSE;
7657 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
7661 /* 4. Rank Indicator Cfg handler */
7662 rgSCHCfgRiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
7666 cqiCb->cqiCfg.type = RGR_SCH_PCQI_REL;
7667 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
7669 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,\
7672 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
7674 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst, \
7676 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
7677 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7679 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
7680 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7681 cqiCb->riDist = RG_SCH_INVALID_IDX;
7683 ueCb->nPCqiCb = cqiCb;
7684 ueCb->nPRiCb = cqiCb;
7689 * @brief Handles Periodic RI configuration for a UE.
7693 * Function : rgSCHCfgRiUeCfg
7695 * Invoking Module Processing:
7696 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7697 * validations for the spec-defined values.
7700 * - For UE-specific Periodic RI related configuration,
7701 * - If Periodic RI is configured,
7702 * - Update UE with the configured values.
7703 - Compute and Update next occurance of RI Tranmission instance.
7704 - Update the RI offset and RI perodicity information
7708 * @param[in] RgSchCellCb *cell
7709 * @param[in] RgSchUeCb *ue
7710 * @param[in] RgrUePrdDlCqiCfg *cqiCfg
7711 * @param[in] CmLteUeCategory ueCat
7718 RgSchCellCb *cellCb,
7720 RgrUePrdDlCqiCfg *cqiCfg,
7721 CmLteUeCategory ueCat
7725 uint16_t riTrInsTime;
7726 uint8_t j; /*Bandwidth parts. Valid for Modes 2-0, 2-1*/
7727 uint16_t periodicity;
7729 RgSchUePCqiCb *cqiCb = NULLP;
7731 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7732 +(cellCb->crntTime.slot);
7733 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
7734 /* 1. Rank Indicator is enabled */
7735 if(cqiCfg->cqiSetup.riEna)
7738 rgSCHUtlGetCfgPerOff(RG_SCH_RI_TBL,
7739 cqiCfg->cqiSetup.riCfgIdx,
7740 &cqiCb->riPeri, &cqiCb->riOffset);
7742 DU_LOG("\nDEBUG --> SCH : rgSCHCfgRiUeCfg(): RI Peri=%d, RI Offset=%d UEID:%d",
7743 cqiCb->riPeri, cqiCb->riOffset,ueCb->ueId);
7745 cqiCb->perRiVal = 1;
7746 cqiCb->invalidateCqi = FALSE;
7748 if(RGR_UE_PCQI_WB_REP == cqiCfg->cqiSetup.cqiRepType)
7751 1. wideband RI reporting is configured
7753 (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )Mod(NCqiperiod
7756 periodicity = cqiCb->cqiPeri * cqiCb->riPeri;
7761 * Where Widesband and Subband RI reporting is configured
7762 * (Mode 2-0 or 2-1 )
7763 * (10*sfn+floor(subframe)-Noffsetcqi-NoffsetRI )
7764 * Mod(H. NCqiperiod *MriPeriod )=0
7765 * where H= J * K +1; J=Number of bandwidth parts(BW/subsize).
7766 * K is RGR interf input
7769 RG_SCH_GET_CQI_J_VAL(cellCb->bwCfg.dlTotalBw, j);
7770 cqiCb->h = (cqiCb->cqiCfg.cqiSetup.k *j )+1;
7771 periodicity = cqiCb->h * cqiCb->cqiPeri *
7775 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
7776 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
7777 * accordingly. WBCQI handling is naturally accomplished */
7778 if (periodicity >= RGSCH_MAX_SUBFRM_5G)
7780 periodicity = cqiCb->cqiOffset - cqiCb->riOffset +
7781 RGSCH_MAX_SUBFRM_5G - (crntTime);
7782 tempIdx = crntTime + periodicity;
7783 DU_LOG("\nINFO --> SCH : CHECK_SID - periodicity %d tempIdx %d\n", periodicity, tempIdx);
7787 if ((crntTime + TFU_RECPREQ_DLDELTA + periodicity) >
7788 (RGSCH_MAX_SUBFRM_5G - 1))
7790 riTrInsTime = (periodicity - cqiCb->cqiOffset + cqiCb->riOffset) % periodicity;
7791 tempIdx = RGSCH_MAX_SUBFRM_5G + (periodicity - riTrInsTime);
7795 riTrInsTime = ((periodicity +crntTime )- \
7796 cqiCb->cqiOffset + cqiCb->riOffset)\
7798 tempIdx = (crntTime + (periodicity -riTrInsTime));
7801 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7803 tempIdx = tempIdx + periodicity;
7805 cqiCb->nRiTrIdx = tempIdx
7806 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
7807 if(periodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
7809 cqiCb->riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
7810 (uint16_t) tempIdx);
7816 if(ueCb->mimoInfo.txMode == RGR_UE_TM_3
7817 || ueCb->mimoInfo.txMode == RGR_UE_TM_4)
7819 if (cellCb->numTxAntPorts ==2)
7821 cqiCb->riNumBits = 1;
7823 else if(cellCb->numTxAntPorts ==4)
7825 if(ueCat == CM_LTE_UE_CAT_8)
7827 cqiCb->riNumBits = 3;
7829 else if(ueCat >= CM_LTE_UE_CAT_5)
7831 cqiCb->riNumBits = 2;
7835 cqiCb->riNumBits = 1;
7839 /* Place the UE in cellCb->tIUeLstCp */
7840 cqiCb->riLstEnt.node=(PTR) cqiCb;
7842 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
7844 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_ADD,
7845 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
7851 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
7852 cqiCb->riDist = RG_SCH_INVALID_IDX;
7859 /* @brief Handles SRS configuration for a UE.
7863 * Function : rgSCHCfgSrsUeCfg
7865 * Invoking Module Processing:
7866 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
7867 * validations for the spec-defined values.
7870 * - For UE-specific SRS related configuration,
7871 * - If SRS is configured,
7872 * - Update UE with the configured values.
7873 - Compute and Update next occurance of SRS Tranmission instance.
7874 - Update the SRS offset and SRS perodicity information
7875 - Add Ue to cell's srs list
7877 * - next occurance transmission instance of SRS = RG_SCH_INVALID_IDX
7881 * @param[in] RgSchCellCb *cell
7882 * @param[in] RgSchUeCb *ue
7883 * @param[in] RgrUeUlSrsCfg *srsCfg
7889 S16 rgSCHCfgSrsUeCfg
7891 RgSchCellCb *cellCb,
7893 RgrUeUlSrsCfg *srsCfg
7896 uint16_t srsTrInsTime;
7900 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
7901 +(cellCb->crntTime.slot);
7903 if(RGR_SCH_SRS_SETUP == srsCfg->type)
7905 /* 1. Copy the Received Cfg parameters to local cb */
7906 memcpy(&ueCb->srsCb.srsCfg, srsCfg, sizeof(RgrUeUlSrsCfg));
7909 /* 2. Compute SRS Offset and Periodicity */
7910 rgSCHUtlGetCfgPerOff( RG_SCH_FDD_SRS_TBL,
7911 srsCfg->srsSetup.srsCfgIdx,
7912 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
7914 rgSCHUtlGetCfgPerOff( RG_SCH_TDD_SRS_TBL,
7915 srsCfg->srsSetup.srsCfgIdx,
7916 &ueCb->srsCb.peri, &ueCb->srsCb.offset);
7919 DU_LOG("\nDEBUG --> SCH : rgSCHCfgSrsUeCfg(): SRS Peri=%d, SRS Offset=%d UEID:%d",
7920 ueCb->srsCb.peri,ueCb->srsCb.offset,ueCb->ueId);
7922 /* 3. Compute next Tranmission index for SRS */
7923 /* Referenence: 36.213 Section:8.2
7924 i. SRS transmission instances for TDD with period > 2 and for FDD are
7925 ((10*sfn +Ksrs-suframeoffset))/mod(periodicity))
7927 TDD: Ksrs Table 8.2-3:
7928 ii.The SRS transmission instances for TDD (periodicity == 2)
7929 (Ksrs-Toffset)mod(5)==0. Note: This is not supported now
7932 srsTrInsTime = ((ueCb->srsCb.peri+crntTime) - ueCb->srsCb.offset)
7934 tempIdx = (crntTime + (ueCb->srsCb.peri - srsTrInsTime));
7936 if (tempIdx <= (crntTime + TFU_DELTA))
7938 if (tempIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
7941 tempIdx = tempIdx + ueCb->srsCb.peri;
7943 ueCb->srsCb.nSrsTrIdx =(uint16_t) (tempIdx
7944 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE);
7945 if(ueCb->srsCb.peri >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
7948 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime+TFU_DELTA),
7951 ueCb->srsCb.srsDist = rgSCHUtlFindDist((uint8_t)(crntTime + TFU_RECPREQ_DLDELTA),
7957 ueCb->srsCb.srsDist = 0;
7960 /*UE Tx Antenna Selection - START*/
7961 if(ueCb->ul.ulTxAntSel.pres == TRUE )
7963 /*for both partial and full sounding bandwidth,
7964 and when frequency hopping is disabled */
7965 ueCb->srsCb.selectedAnt = (crntTime/ueCb->srsCb.peri)%2;
7969 /* TS 36.213 specifies that if Tx Antenna Selection is
7970 disabled/not supported then its Port 0*/
7971 ueCb->srsCb.selectedAnt=0;
7973 ueCb->validTxAnt = ueCb->srsCb.selectedAnt;
7974 /*UE Tx Antenna Selection - ENDS*/
7976 ueCb->srsCb.srsLstEnt.node=(PTR)ueCb;
7977 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
7978 &ueCb->srsCb.srsLstEnt);
7984 /* SRS Release / Not configured */
7985 ueCb->srsCb.srsCfg.type = RGR_SCH_SRS_REL;
7986 if(ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
7988 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
7989 &ueCb->srsCb.srsLstEnt);
7991 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
7992 ueCb->srsCb.srsLstEnt.node =(PTR) NULLP;
7999 /* * @brief Handles SR configuration for a UE.
8003 * Function : rgSCHCfgSrUeCfg
8005 * Invoking Module Processing:
8006 * - This shall be invoked by SCH_GOM at UE configuration. It shall do the
8007 * validations for the spec-defined values.
8009 * - If SR is configured,
8010 * - Update UE with the configured values.
8011 - Compute and Update next occurance of SR Tranmission instance.
8012 - Update the SR offset and SR perodicity information
8013 - Add Ue to cell->tIUeLstCp[n]
8015 * - next occurance transmission instance of SR = RG_INVALID_SR_ID
8020 * @param[in] RgSchCellCb *cell
8021 * @param[in] RgSchUeCb *ue
8022 * @param[in] RgrUeSrCfg *srCfg
8030 RgSchCellCb *cellCb,
8035 uint16_t srTrInsTime;
8039 crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
8040 +(cellCb->crntTime.slot);
8041 if(srCfg->type == RGR_SCH_SR_SETUP)
8043 /* 1. Copy the Received Cfg parameters to local cb */
8044 memcpy(&ueCb->srCb.srCfg, srCfg, sizeof(RgrUeSrCfg));
8047 /* 2. Compute SR periodicity and offset */
8048 rgSCHUtlGetCfgPerOff( RG_SCH_SR_TBL,
8049 srCfg->srSetup.srCfgIdx,
8050 &ueCb->srCb.peri, &ueCb->srCb.offset);
8052 DU_LOG("\nDEBUG --> SCH : SR Config: idx(%u), period (%u) offset (%u) UEID:%d",
8053 srCfg->srSetup.srCfgIdx,
8060 rgSchfillPucchSrRepNumCountemtc(ueCb);
8063 /* 3. Compute Next Transmission Instance */
8065 srTrInsTime = ((ueCb->srCb.peri+crntTime) - ueCb->srCb.offset)
8067 ueCb->srCb.nSrTrIdx = (crntTime + (ueCb->srCb.peri- srTrInsTime));
8069 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_DELTA))
8071 if (ueCb->srCb.nSrTrIdx <= (crntTime + TFU_RECPREQ_DLDELTA))
8074 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx + ueCb->srCb.peri;
8076 ueCb->srCb.nSrTrIdx = ueCb->srCb.nSrTrIdx
8077 % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
8078 ueCb->srCb.srLstEnt.node= (PTR) ueCb;
8080 /* 4. Place UE in Cell SR Tranmisison Instance List */
8081 cmLListAdd2Tail(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8082 &ueCb->srCb.srLstEnt);
8086 ueCb->srCb.srCfg.type = RGR_SCH_SR_REL;
8088 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8090 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8091 &ueCb->srCb.srLstEnt);
8093 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8094 ueCb->srCb.srLstEnt.node = (PTR)NULLP;
8101 /*****************************************************************
8102 * UE PCQI, RI, SRS and SR Re Configuration Functions *
8104 ******************************************************************/
8107 /* * @brief Handles Periodic CQI, PMI, RI Re-configuration for a UE.
8111 * Function : rgSCHCfgPCqiUeReCfg
8113 * Invoking Module Processing:
8114 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8115 * validations for the spec-defined values.
8118 * - For UE-specific Periodic CQI related configuration,
8119 * - If Periodic CQI/PMI is re configured(first time enabled),
8120 * - Update UE with the configured values.
8121 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8123 * - Update the CQI offset and CQI perodicity information
8124 * - Add Ue to cell's list
8125 * - If Periodic CQI/PMI is re configured(modify),
8126 * - Update UE with the configured values.
8127 * - Del Ue from cell->tIUeLstCp list
8128 * - Compute and Update next occurance of CQI/PMI or RI Tranmission
8130 * - Update the CQI offset and CQI perodicity information
8131 * - Add Ue to cell's list
8132 * - If Periodic CQI/PMI is re configured(disabled),
8133 * - Update UE with the configured values.
8134 * - Del Ue from cell's list
8135 * - Update next occurance of CQI/PMI or RI Tranmission instance.
8136 * - next occurance of CQI/PMI = RG_INVALID_CQIPMI_ID
8138 * - For UE-specific Periodic RI related configuration,
8139 * - If Periodic RI is configured(first time enabled),
8140 * - Update UE with the configured values.
8141 * - Compute and Update next occurance of RI Tranmission instance.
8142 * - Update the RI offset and RI perodicity information
8143 * - If Periodic RI is configured(modify),
8144 * - Update UE with the configured values.
8145 * - Compute and Update next occurance of RI Tranmission instance.
8146 * - Update the RI offset and RI perodicity information
8148 * - next occurance of RI = RG_INVALID_CQIPMI_ID
8152 * @param[in] RgSchCellCb *cell
8153 * @param[in] RgSchUeCb *ue
8154 * @param[in] RgrUeCfg *ueCfg
8160 S16 rgSCHCfgPCqiUeReCfg
8162 RgSchCellCb *cellCb,
8164 RgrUePrdDlCqiCfg *cqiCfg,
8165 CmLteUeCategory ueCat
8169 RgSchUePCqiCb *cqiCb = NULLP;
8171 cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8172 /* Fix: ccpu00124008 Fix for incorrect check causing missed CQI reception instance */
8173 if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8174 (cqiCb->cqiCfg.type != RGR_SCH_PCQI_SETUP))
8176 /* 1. cqi is in Release (Disable) state, Recfg is allowing Setup (Enable)
8178 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8181 else if((cqiCfg->type == RGR_SCH_PCQI_SETUP) &&
8182 (cqiCb->cqiCfg.type == RGR_SCH_PCQI_SETUP ))
8186 2. Present is SETUP(Enable) state, Recfg is modifying SETUP(Enable)
8188 2.1 Delete UE from the cqiList
8189 2.2 Set next occurance Transmission instace to "INVALID"
8190 2.3 Compute Next occurance Transmission instace
8191 2.4 Placed ue in Transmission instance list.
8193 if(cqiCb->nCqiTrIdx != RG_SCH_INVALID_IDX )
8194 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
8197 if(cqiCb->nRiTrIdx != RG_SCH_INVALID_IDX )
8199 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst,
8201 RG_SCH_RECORD(&cqiCb->histElem,RGSCH_ACTION_DEL,
8202 &cellCb->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst);
8206 cqiCb->cqiLstEnt.next = NULLP;
8207 cqiCb->cqiLstEnt.prev = NULLP;
8208 cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8209 cqiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8210 cqiCb->riDist = RG_SCH_INVALID_IDX;
8212 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8216 /* Present is SETUP(Enable) state, Recfg is Release(Disable) */
8217 rgSCHCfgPCqiUeCfg(cellCb, ueCb, cqiCfg, ueCat);
8220 /* ccpu00140578:: */
8221 cqiCb->riRecpPrcsd = FALSE;
8226 /* * @brief Handles SRS Re-configuration for a UE.
8230 * Function : rgSCHCfgSrsUeReCfg
8232 * Invoking Module Processing:
8233 * - This shall be invoked by SCH_GOM at UE Re configuration. It shall do the
8234 * validations for the spec-defined values.
8237 * - For UE-specific SRS related re configuration,
8238 * - If SRS is configured modified(First time Enabled),
8239 * - Update UE with the configured values.
8240 * - Compute and Update next occurance of SRS Tranmission instance.
8241 * - Update the SRS offset and SRS perodicity information
8242 * - Add Ue to cell's list
8243 * - If SRS is configured modified(Changed offset or index ),
8244 * - Delete UE from cell->tIUeLstCp[n] if present
8245 * - Update UE with the configured values.
8246 * - Compute and Update next occurance of SRS Tranmission instance.
8247 * - Update the SRS offset and SRS perodicity information
8248 * - Add Ue to cell's list
8249 * - If SRS is configured modified(disabled),
8250 * - Delete UE from cell->tIUeLstCp[n] if present
8251 * - Update next occurance of SRS Tranmission instance to "INVALID".
8252 * - Update the SRS offset and SRS perodicity information "INVALID"
8258 * @param[in] RgSchCellCb *cell
8259 * @param[in] RgSchUeCb *ue
8260 * @param[in] RgrUeUlSrsCfg *srsCfg
8266 S16 rgSCHCfgSrsUeReCfg
8268 RgSchCellCb *cellCb,
8270 RgrUeUlSrsCfg *srsCfg
8275 if(( RGR_SCH_SRS_SETUP == srsCfg->type) ||
8276 ( RGR_SCH_SRS_SETUP != ueCb->srsCb.srsCfg.type ))
8278 /* 1. Present is Release(Disable) state, Recfg is allowing
8280 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8282 else if (( RGR_SCH_SRS_SETUP == srsCfg->type ) &&
8283 ( RGR_SCH_SRS_SETUP == ueCb->srsCb.srsCfg.type))
8286 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8288 2.1 Delete UE from the cqiList
8289 2.2 Set next occurance Transmission instance to "INVALID"
8290 2.3 Compute Next occurance Transmission instance
8291 2.4 Placed ue in Transmission instance list.
8293 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8295 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8296 &ueCb->srsCb.srsLstEnt);
8297 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8300 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8304 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable)*/
8305 rgSCHCfgSrsUeCfg(cellCb, ueCb, srsCfg);
8307 /* ccpu00140578:: */
8308 ueCb->srsCb.srsRecpPrcsd = FALSE;
8313 /* @brief Handles SR Re-configuration for a UE.
8317 * Function : rgSCHCfgSrUeReCfg
8319 * Invoking Module Processing:
8320 * - This shall be invoked by SCH_GOM at UE Re configuration.
8321 * It shall do the validations for the spec-defined values.
8324 * - For UE-specific SR related re configuration,
8325 * - If SR is configured modified(First time Enabled),
8326 * - Update UE with the configured values.
8327 * - Compute and Update next occurance of SR Tranmission instance.
8328 * - Update the SR offset and SR perodicity information
8329 * - Add Ue to cell->tIUeLstCp[n]
8330 * - If SR is configured modified(Changed offset or index ),
8331 * - Delete UE from cell->tIUeLstCp[n] if present
8332 * - Update UE with the configured values.
8333 * - Compute and Update next occurance of SR Tranmission instance.
8334 * - Update the SR offset and SR perodicity information
8335 * - Add Ue to cell->tIUeLstCp[n]
8336 * - If SR is configured modified(disabled),
8337 * - Delete UE from cell->tIUeLstCp[n] if present
8338 * - Update next occurance of SR Tranmission instance to "INVALID".
8339 * - Update the SR offset and SR perodicity information "INVALID"
8347 * @param[in] RgSchCellCb *cell
8348 * @param[in] RgSchUeCb *ue
8349 * @param[in] RgrUeCfg *ueCfg
8355 S16 rgSCHCfgSrUeReCfg
8357 RgSchCellCb *cellCb,
8363 /* Fix : syed Incorrect check for SR RECFG */
8364 if((srCfg->type == RGR_SCH_SR_SETUP) &&
8365 (ueCb->srCb.srCfg.type != RGR_SCH_SR_SETUP))
8368 1. Present is Release(Disable) state, Recfg is allowing SETUP(Enable)
8370 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8372 else if((srCfg->type == RGR_SCH_SR_SETUP) &&
8373 (ueCb->srCb.srCfg.type == RGR_SCH_SR_SETUP))
8376 /* 2. Present is SETUP(Eanble) state, Recfg is modifying SETUP(Enable)
8378 2.1 Delete UE from the cqiList
8379 2.2 Compute Next occurance Transmission instace
8381 if(ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX )
8383 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8384 &ueCb->srCb.srLstEnt);
8385 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8387 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8392 /* 3. Present is SETUP(Enable) state, Recfg is Release(Disable) */
8393 rgSCHCfgSrUeCfg(cellCb, ueCb, srCfg);
8399 /* @brief Handles ACQI Re-configuration for a UE.
8403 * Function : rgSCHCfgAcqiUeReCfg
8405 * Invoking Module Processing:
8406 * - This shall be invoked by SCH_GOM at UE Re configuration.
8407 * It shall do the validations for the spec-defined values.
8410 * - For UE-specific ACQI related re configuration,
8411 * - Check if the ACQI Mode has been changed from the
8412 * existing Configuration.
8413 * - If the configuration has been changed,
8414 * - Call Aperiodic Config function to change the config
8421 * @param[in] RgSchCellCb *cell
8422 * @param[in] RgSchUeCb *ue
8423 * @param[in] RgrUeAprdDlCqiCfg *acqiCfg
8429 S16 rgSCHCfgAcqiUeReCfg
8431 RgSchCellCb *cellCb,
8433 RgrUeAprdDlCqiCfg *acqiCfg,
8434 CmLteUeCategory ueCat
8438 return (rgSCHCfgACqiUeCfg(cellCb,ueCb,(RG_SCH_CMN_GET_ACQICB(ueCb,cellCb))
8439 ,ueCb->mimoInfo.txMode, acqiCfg, ueCat));
8443 /*****************************************************************
8444 * UE PCQI, RI, SRS and SR Configuration Delete *
8446 *****************************************************************/
8448 /* @brief Free Periodic CQI/PMI/RI, SRS and SR transmission instance
8449 * related data structures of this UE from CellCb
8453 * Function : rgSCHCfgPCqiSrsSrUeDel
8455 * Invoking Module Processing:
8456 * - This shall be invoked by SCH_GOM at Ue deletion.
8459 * - For SRS Transmission Instance
8460 * - if (srsTxInst!= RG_INVALID)
8461 * - Remove from the cellCb->tIUeLstCp[srsTxInst*3+2]
8464 * - For SR Transmission Instance
8465 * - if (srTxInst!= RG_INVALID)
8466 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+1]
8469 * - For Periodic CQI/PMI RI Transmission Instance
8470 * - if (pCqiTxInst!= RG_INVALID)
8471 * - Remove from the cellCb->tIUeLstCp[srTxInst*3+0]
8475 * @param[in] RgSchCellCb *cell
8476 * @param[in] RgSchUeCb *ue
8481 S16 rgSCHCfgPCqiSrsSrUeDel
8483 RgSchCellCb *cellCb,
8489 uint32_t sCellCnt = 0;
8491 RgSchUePCqiCb *cqiRiCb = NULLP;
8493 cqiRiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
8497 /* Delete SRS Transmission Instance */
8498 if (ueCb->srsCb.nSrsTrIdx != RG_SCH_INVALID_IDX)
8500 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srsCb.nSrsTrIdx].srsLst,
8501 &ueCb->srsCb.srsLstEnt);
8502 ueCb->srsCb.nSrsTrIdx = RG_SCH_INVALID_IDX;
8505 /* Delete SR Transmission Instance */
8506 if (ueCb->srCb.nSrTrIdx != RG_SCH_INVALID_IDX)
8508 cmLListDelFrm(&cellCb->pCqiSrsSrLst[ueCb->srCb.nSrTrIdx].srLst,
8509 &ueCb->srCb.srLstEnt);
8510 ueCb->srCb.nSrTrIdx = RG_SCH_INVALID_IDX;
8513 /* Delete Periodic CQI/PMI Transmission Instance */
8514 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8516 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8517 &cqiRiCb->cqiLstEnt);
8518 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8520 /* Delete Periodic RI Transmission Instance */
8522 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8524 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8525 &cqiRiCb->riLstEnt);
8526 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8527 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8528 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8533 for (cellIdx =1; cellIdx <= RG_SCH_MAX_SCELL; cellIdx++)
8535 /* If a serving cell is configured */
8536 if(ueCb->cellInfo[cellIdx] != NULLP)
8538 /* If the serving cell is in ACTIVE state and
8539 If it is not the same serving cell as cqiRiCb for which
8540 collision is being checked */
8541 cqiRiCb = &ueCb->cellInfo[cellIdx]->cqiCb;
8542 /* Delete Periodic CQI/PMI Transmission Instance */
8543 if (cqiRiCb->nCqiTrIdx != RG_SCH_INVALID_IDX)
8545 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nCqiTrIdx].cqiLst,
8546 &cqiRiCb->cqiLstEnt);
8547 cqiRiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
8549 /* Delete Periodic RI Transmission Instance */
8551 if (cqiRiCb->nRiTrIdx != RG_SCH_INVALID_IDX)
8553 cmLListDelFrm(&cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst,
8554 &cqiRiCb->riLstEnt);
8555 RG_SCH_RECORD(&cqiRiCb->histElem,RGSCH_ACTION_DEL,
8556 &cellCb->pCqiSrsSrLst[cqiRiCb->nRiTrIdx].riLst);
8557 cqiRiCb->nRiTrIdx = RG_SCH_INVALID_IDX;
8561 /* If all of the num of configured scells are checked then break */
8562 if (sCellCnt == ueCb->numSCells)
8574 /* @brief Search the cfgIdx in given table and retrive periodicity & offset
8577 * Function : rgSCHUtlGetCfgPerOff
8579 * Invoking Module Processing:
8580 * - This shall be invoked by Cfg Module
8583 * binary search for given entry in table
8584 * find the periodicty, offset for a given config index from the table
8586 * @param[in] RgSchPerTbl tbl
8587 * @param[in] uint16_t cfgIdx
8588 * @param[out] uint16_t *peri
8589 * @param[out] uint16_t *offset
8595 S16 rgSCHUtlGetCfgPerOff
8606 const RgSchUePCqiSrsSrCfgIdxTbl* table;
8608 /* Added the function instead of the MACRO to get the
8609 * periodicity table */
8610 table = rgSCHCfgUtlGetPcqiSrsSrRiTbl ( tbl,&min,&max );
8613 if (( cfgIdx >= table[mid].min) &&
8614 ( cfgIdx <= table[mid].max))
8616 *peri = table[mid].peri;
8617 *offset = cfgIdx - table[mid].offset;
8621 if ( cfgIdx > table[mid].min)
8630 }while( min <= max );
8636 /***********************************************************
8638 * Func : rgSCHCfgUtlFetchAcqiBitSz
8641 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
8651 **********************************************************/
8652 static Void rgSCHCfgUtlFetchAcqiBitSz
8654 RgSchUeACqiCb *acqiCb,
8656 uint8_t* cqiPmiSzR1,
8657 uint8_t* cqiPmiSzRn1
8661 uint32_t confRepMode;
8663 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
8666 case RGR_APRD_CQI_MOD12:
8670 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8671 *cqiPmiSzRn1 = 8+ acqiCb->N;
8673 else if(numTxAnt == 4)
8675 *cqiPmiSzR1 = 4 + 4*acqiCb->N;
8676 *cqiPmiSzRn1 = 8 + 4*acqiCb->N;
8681 case RGR_APRD_CQI_MOD20:
8683 *cqiPmiSzR1 = 6 + acqiCb->L;
8684 *cqiPmiSzRn1 = 6 + acqiCb->L;
8688 case RGR_APRD_CQI_MOD22:
8692 *cqiPmiSzR1 = 10 + acqiCb->L;
8693 *cqiPmiSzRn1 = 14 + acqiCb->L;
8695 else if(numTxAnt == 4)
8697 *cqiPmiSzR1 = 14 + acqiCb->L;
8698 *cqiPmiSzRn1 = 20 + acqiCb->L;
8703 case RGR_APRD_CQI_MOD30:
8705 *cqiPmiSzR1 = 4 + 2*acqiCb->N;
8706 *cqiPmiSzRn1 = 4 + 2*acqiCb->N;
8710 case RGR_APRD_CQI_MOD31:
8714 *cqiPmiSzR1 = 6 + 2*acqiCb->N;
8715 *cqiPmiSzRn1 = 9 + 4*acqiCb->N;
8717 else if(numTxAnt == 4)
8719 *cqiPmiSzR1 = 8 + 2*acqiCb->N;
8720 *cqiPmiSzRn1 = 12 + 4*acqiCb->N;
8729 /* Added the function rgSCHCfgUtlGetPcqiCrsSrRiTbl to be used
8730 * instead of the MACRO RG_SCH_GET_PERIODICITY_TBL */
8731 /***********************************************************
8733 * Func : rgSCHCfgUtlGetPcqiCrsSrRiTbl
8736 * Desc : Get the Srs Cqi Crs Ri Table
8745 **********************************************************/
8747 static const RgSchUePCqiSrsSrCfgIdxTbl * rgSCHCfgUtlGetPcqiSrsSrRiTbl
8749 RgSchPerTbl tblType,
8754 const RgSchUePCqiSrsSrCfgIdxTbl * table;
8759 case RG_SCH_FDD_PCQI_TBL:
8761 table = rgSchUePCqiCfgIdxFddTbl;
8763 * max=RG_SCH_CQIPMI_CFGIDX_MAX_FDD;
8766 case RG_SCH_TDD_PCQI_TBL:
8768 table = rgSchUeCqiPmiCfgIdxTddTbl;
8770 * max=RG_SCH_CQIPMI_CFGIDX_MAX_TDD;
8775 table = rgSchUeRiCfgIdxTbl;
8777 * max=RG_SCH_RI_CFGIDX_MAX;
8780 case RG_SCH_FDD_SRS_TBL:
8782 table = rgSchUeSrsCfgIdxFddTbl;
8784 * max=RG_SCH_SRS_ISRS_INDX_MAX_FDD;
8787 case RG_SCH_TDD_SRS_TBL:
8789 table = rgSchUeSrsCfgIdxTddTbl;
8791 * max=RG_SCH_SRS_ISRS_INDX_MAX_TDD;
8796 table = rgSchUeSrCfgIdxTbl;
8798 * max=RG_SCH_ISR_INDX_MAX;
8803 table = (const RgSchUePCqiSrsSrCfgIdxTbl *) 0;
8813 #endif /* TFU_UPGRADE */
8815 /***********************************************************
8817 * Func : rgSCHCfgVldtDrxUeCfg
8820 * Desc : Validates UE DRX Timers Configuration recieved from RRC.
8830 **********************************************************/
8831 static S16 rgSCHCfgVldtDrxUeCfg
8834 RgrUeDrxCfg *ueDrxCfg
8838 if (ueDrxCfg->isDrxEnabled == FALSE)
8844 if ( ueDrxCfg->cqiMask.pres )
8846 if ( ueDrxCfg->cqiMask.val != RGR_DRX_SETUP )
8849 DU_LOG("\nERROR --> SCH : Invalid cqiMask configuration (%d)",
8850 ueDrxCfg->cqiMask.val);
8852 DU_LOG("\nERROR --> SCH : Invalid cqiMask configuration(%ld)",
8853 ueDrxCfg->cqiMask.val);
8858 #endif /*LTEMAC_R9*/
8860 if(ueDrxCfg->isEmtcUe)
8862 if(ueDrxCfg->drxOnDurTmrR13Pres)
8864 if ( rgSCHEmtcCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8866 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d)",
8867 ueDrxCfg->drxOnDurTmr);
8873 if (rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8875 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d) for EMTC",
8876 ueDrxCfg->drxOnDurTmr);
8885 if ( rgSCHCfgVldtDrxOnDurCfg(ueDrxCfg->drxOnDurTmr) != ROK )
8887 DU_LOG("\nERROR --> SCH : Invalid onDurTimer configuration(%d) for EMTC",
8888 ueDrxCfg->drxOnDurTmr);
8893 if ( rgSCHCfgVldtDrxInActvCfg(ueDrxCfg->drxInactvTmr) != ROK )
8895 DU_LOG("\nERROR --> SCH : Invalid Inactivity configuration(%d)",
8896 ueDrxCfg->drxInactvTmr);
8900 if(ueDrxCfg->isEmtcUe)
8902 if(ueDrxCfg->drxRetxTmrR13Pres)
8904 if ( rgSCHEmtcCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8906 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d) for EMTC",
8907 ueDrxCfg->drxRetxTmr);
8913 if (rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8915 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d)",
8916 ueDrxCfg->drxRetxTmr);
8925 if ( rgSCHCfgVldtDrxReTxCfg(ueDrxCfg->drxRetxTmr) != ROK )
8927 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d)",
8928 ueDrxCfg->drxRetxTmr);
8933 if(ueDrxCfg->isEmtcUe)
8935 if ( rgSCHEmtcCfgVldtDrxUlReTxCfg(ueDrxCfg->emtcDrxUlRetxTmr) != ROK )
8937 DU_LOG("\nERROR --> SCH : Invalid DrxReTX configuration(%d) for EMTC",
8938 ueDrxCfg->drxRetxTmr);
8945 if ( rgSCHCfgVldtDrxLngCycCfg(ueDrxCfg->drxLongCycleOffst) != ROK )
8947 DU_LOG("\nERROR --> SCH : Invalid LongCycle configuration");
8951 if ( ueDrxCfg->drxLongCycleOffst.longDrxCycle < ueDrxCfg->drxOnDurTmr )
8953 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
8954 " and onDuration timer values");
8959 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxLongCycleOffst.longDrxCycle,
8960 ueDrxCfg->drxOnDurTmr, ueDrxCfg->drxLongCycleOffst.drxStartOffst) != ROK)
8962 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
8963 " and onDuration timer values");
8968 if( TRUE == ueDrxCfg->drxShortDrx.pres )
8970 if ( ueDrxCfg->drxShortDrx.shortDrxCycle < ueDrxCfg->drxOnDurTmr )
8972 DU_LOG("\nERROR --> SCH : Invalid combination of short DRX "
8973 "Cycle and onDuration timer values");
8977 if ( (ueDrxCfg->drxLongCycleOffst.longDrxCycle %
8978 ueDrxCfg->drxShortDrx.shortDrxCycle) != 0)
8980 DU_LOG("\nERROR --> SCH : Long DRX cycle is not multiple of "
8985 if ( rgSCHCfgVldtDrxShrtCycCfg(ueDrxCfg->drxShortDrx) != ROK )
8987 DU_LOG("\nERROR --> SCH : Invalid Short Cycle configuration");
8992 if( rgSCHCfgVldtTddDrxCycCfg(cell, ueDrxCfg->drxShortDrx.shortDrxCycle,
8993 ueDrxCfg->drxOnDurTmr,
8994 ueDrxCfg->drxLongCycleOffst.drxStartOffst %
8995 ueDrxCfg->drxShortDrx.shortDrxCycle) != ROK)
8997 DU_LOG("\nERROR --> SCH : Invalid combination of Long DRX Cycle "
8998 " and onDuration timer values");
9005 }/*rgSCHCfgVldtDrxUeCfg*/
9007 /***********************************************************
9009 * Func : rgSCHCfgVldtDrxOnDurCfg
9012 * Desc : Validates UE DRX On Duration configuration
9013 * recieved from RRC.
9023 **********************************************************/
9024 static S16 rgSCHCfgVldtDrxOnDurCfg
9032 case RGR_DRX_PRD_1PSF:
9033 case RGR_DRX_PRD_2PSF:
9034 case RGR_DRX_PRD_3PSF:
9035 case RGR_DRX_PRD_4PSF:
9036 case RGR_DRX_PRD_5PSF:
9037 case RGR_DRX_PRD_6PSF:
9038 case RGR_DRX_PRD_8PSF:
9039 case RGR_DRX_PRD_10PSF:
9040 case RGR_DRX_PRD_20PSF:
9041 case RGR_DRX_PRD_30PSF:
9042 case RGR_DRX_PRD_40PSF:
9043 case RGR_DRX_PRD_50PSF:
9044 case RGR_DRX_PRD_60PSF:
9045 case RGR_DRX_PRD_80PSF:
9046 case RGR_DRX_PRD_100PSF:
9047 case RGR_DRX_PRD_200PSF:
9054 }/*switch(onDurTmr)*/
9057 }/*rgSCHCfgVldtOnDurCfg*/
9059 /***********************************************************
9061 * Func : rgSCHCfgVldtDrxInActvCfg
9064 * Desc : Validates UE DRX InActivity configuration
9065 * recieved from RRC.
9075 **********************************************************/
9076 static S16 rgSCHCfgVldtDrxInActvCfg(uint16_t inActvTmr)
9078 switch ( inActvTmr )
9080 case RGR_DRX_PRD_1PSF:
9081 case RGR_DRX_PRD_2PSF:
9082 case RGR_DRX_PRD_3PSF:
9083 case RGR_DRX_PRD_4PSF:
9084 case RGR_DRX_PRD_5PSF:
9085 case RGR_DRX_PRD_6PSF:
9086 case RGR_DRX_PRD_8PSF:
9087 case RGR_DRX_PRD_10PSF:
9088 case RGR_DRX_PRD_20PSF:
9089 case RGR_DRX_PRD_30PSF:
9090 case RGR_DRX_PRD_40PSF:
9091 case RGR_DRX_PRD_50PSF:
9092 case RGR_DRX_PRD_60PSF:
9093 case RGR_DRX_PRD_80PSF:
9094 case RGR_DRX_PRD_100PSF:
9095 case RGR_DRX_PRD_200PSF:
9096 case RGR_DRX_PRD_300PSF:
9097 case RGR_DRX_PRD_500PSF:
9098 case RGR_DRX_PRD_750PSF:
9099 case RGR_DRX_PRD_1280PSF:
9100 case RGR_DRX_PRD_1920PSF:
9101 case RGR_DRX_PRD_2560PSF:
9108 }/*switch(InactvTmr)*/
9111 }/*rgSCHCfgVldtDrxInActvCfg*/
9113 /***********************************************************
9115 * Func : rgSCHCfgVldtDrxReTxCfg
9118 * Desc : Validates DRX ReTx timer configuration
9119 * recieved from RRC.
9129 **********************************************************/
9130 static S16 rgSCHCfgVldtDrxReTxCfg(uint8_t reTxTmr)
9134 case RGR_DRX_PRD_1PSF:
9135 case RGR_DRX_PRD_2PSF:
9136 case RGR_DRX_PRD_4PSF:
9137 case RGR_DRX_PRD_6PSF:
9138 case RGR_DRX_PRD_8PSF:
9139 case RGR_DRX_PRD_16PSF:
9140 case RGR_DRX_PRD_24PSF:
9141 case RGR_DRX_PRD_33PSF:
9148 }/*switch(drxRetxTmr)*/
9151 }/*rgSCHCfgVldtDrxReTxCfg*/
9153 /***********************************************************
9155 * Func : rgSCHCfgVldtDrxShrtCycCfg
9158 * Desc : Validates DRX Short Cycle timer configuration
9159 * recieved from RRC.
9170 **********************************************************/
9171 static S16 rgSCHCfgVldtDrxLngCycCfg(RgrDrxLongCycleOffst lngCycleOffst)
9173 if ( rgSCHCfgVldtDrxLngCyclTmrs(lngCycleOffst.longDrxCycle) != ROK )
9178 if ( lngCycleOffst.drxStartOffst >= lngCycleOffst.longDrxCycle )
9184 }/*rgSCHCfgVldtDrxLngCycCfg*/
9186 /***********************************************************
9188 * Func : rgSCHCfgVldtDrxLngCyclTmrs
9191 * Desc : Validates DRX Long Cycle timer values
9192 * recieved from RRC.
9203 **********************************************************/
9204 static S16 rgSCHCfgVldtDrxLngCyclTmrs(uint16_t val)
9209 case RGR_DRX_PRD_10SF:
9210 case RGR_DRX_PRD_20SF:
9211 case RGR_DRX_PRD_32SF:
9212 case RGR_DRX_PRD_40SF:
9213 case RGR_DRX_PRD_64SF:
9214 case RGR_DRX_PRD_80SF:
9215 case RGR_DRX_PRD_128SF:
9216 case RGR_DRX_PRD_160SF:
9217 case RGR_DRX_PRD_256SF:
9218 case RGR_DRX_PRD_320SF:
9219 case RGR_DRX_PRD_512SF:
9220 case RGR_DRX_PRD_640SF:
9221 case RGR_DRX_PRD_1024SF:
9222 case RGR_DRX_PRD_1280SF:
9223 case RGR_DRX_PRD_2048SF:
9224 case RGR_DRX_PRD_2560SF:
9231 }/*switch(longDrxCycle)*/
9234 }/*rgSCHCfgVldtDrxLngCyclTmrs*/
9236 /***********************************************************
9238 * Func : rgSCHCfgVldtDrxShrtCycCfg
9241 * Desc : Validates DRX Short Cycle timer configuration
9242 * recieved from RRC.
9253 **********************************************************/
9254 static S16 rgSCHCfgVldtDrxShrtCycCfg(RgrDrxShortDrx shrtCycCfg )
9256 switch(shrtCycCfg.shortDrxCycle)
9258 case RGR_DRX_PRD_2SF:
9259 case RGR_DRX_PRD_5SF:
9260 case RGR_DRX_PRD_8SF:
9261 case RGR_DRX_PRD_10SF:
9262 case RGR_DRX_PRD_16SF:
9263 case RGR_DRX_PRD_20SF:
9264 case RGR_DRX_PRD_32SF:
9265 case RGR_DRX_PRD_40SF:
9266 case RGR_DRX_PRD_64SF:
9267 case RGR_DRX_PRD_80SF:
9268 case RGR_DRX_PRD_128SF:
9269 case RGR_DRX_PRD_160SF:
9270 case RGR_DRX_PRD_256SF:
9271 case RGR_DRX_PRD_320SF:
9272 case RGR_DRX_PRD_640SF:
9280 }/*switch(shortDrxCycle)*/
9282 if ( (shrtCycCfg.drxShortCycleTmr < RGR_DRX_SHRTCYCLE_MIN) ||
9283 (shrtCycCfg.drxShortCycleTmr > RGR_DRX_SHRTCYCLE_MAX)
9293 * @brief Handler for TA related UE Reconfiguration.
9297 * Function : rgSCHCfgUeTaRecfg
9299 * This function shall fetch the TA timer related information into the
9300 * respective ueCb from the UE configuration as provided by the
9303 * @param[in] RgSchCellCb *cell
9304 * @param[in] RgSchUeCb *ueCb
9305 * @param[in] RgrUeCfg *ueCfg
9306 * @param[out] RgSchErrInfo *errInfo
9311 static Void rgSCHCfgUeTaRecfg
9321 /* Update the TA related information */
9323 if (ueCfg->ueTaTmrRecfg.pres)
9325 /* Configuring taTmr with 30 deficit, to enable eNodeB sending
9326 * TA command before the expiry of TA at UE. Also considering for
9327 * possible retx for this TA command */
9328 /* [ccpu00121813]-ADD-Added chk if tatmr val > 30 */
9329 if(ueCfg->ueTaTmrRecfg.taTmr > 30)
9331 ueCb->dl.taCb.cfgTaTmr = ueCfg->ueTaTmrRecfg.taTmr - 30;
9333 /* If TA Timer is running. Stop it and then start it*/
9334 if (ueCb->taTmr.tmrEvnt != TMR_NONE)
9336 rgSCHTmrStopTmr(cell, ueCb->taTmr.tmrEvnt, ueCb);
9337 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9341 rgSCHTmrStartTmr(cell, ueCb, RG_SCH_TMR_TA, ueCb->dl.taCb.cfgTaTmr);
9345 } /* rgSCHCfgUeTaRecfg */
9347 /* ccpu00117452 - MOD - Changed macro name from
9348 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
9349 #if ((defined (RGR_CQI_REPT)) && (defined (RGR_V2)))
9350 /***********************************************************
9352 * Func : rgSCHCfgUeCqiReptReCfg
9355 * Desc : Reconfiguration of PUSH N CQI Reporting
9357 * Ret : RFAILED in case of failure
9364 **********************************************************/
9365 static S16 rgSCHCfgUeCqiReptReCfg
9374 /* Check has it been disabled */
9375 if(ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9377 /* Check if we need to send CQI reports collagted so far and send if so */
9378 if(ue->schCqiInfo.cqiCount >=
9379 ueRecfg->ueCqiReptCfg.numColltdCqiRept)
9381 RgrStaIndInfo *staInfo;
9382 /* if yes, Send StaInd to RRM */
9383 retVal = rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&staInfo,
9384 sizeof(RgrStaIndInfo));
9387 DU_LOG("\nERROR --> SCH : Could not allocate memory for sending StaInd OLD CRNTI:%d",ueRecfg->oldCrnti);
9391 /* Fill StaInd for sending collated N CQI rpeort */
9392 rgSCHUtlFillSndStaInd(cell, ue, staInfo,
9393 ueRecfg->ueCqiReptCfg.numColltdCqiRept);
9398 ue->schCqiInfo.cqiCount = 0;
9401 ue->cqiReptCfgInfo.numColltdCqiRept =
9402 ueRecfg->ueCqiReptCfg.numColltdCqiRept;
9404 } /* End of rgSCHCfgUeCqiReptReCfg */
9405 #endif /* End of RGR_CQI_REPT */
9406 /*This function Added Ue in ongoing L2 Meas*/
9407 /*LTE_L2_MEAS_PHASE2*/
9409 static S16 rgSchAddToL2Meas(RgSchCellCb *cellCb,RgSchDlLcCb *dlLc)
9413 RgSchL2MeasCb *measCb = NULLP;
9414 lnk = cellCb->l2mList.first;
9418 /* Get the MeasCb : RgSchL2MeasCb */
9419 measCb = (RgSchL2MeasCb *)lnk->node;
9420 if (measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
9422 for(idx = 0;idx < measCb->measReq.avgPrbQciDl.numQci;idx++)
9424 if(measCb->measReq.avgPrbQciDl.qci[idx] == dlLc->qciCb->qci)
9426 break; /*exit from for loop*/
9429 if(idx == measCb->measReq.avgPrbQciDl.numQci)
9431 measCb->measReq.avgPrbQciDl.qci[measCb->measReq.avgPrbQciDl.numQci++] = dlLc->qciCb->qci;
9435 }/*End of while loop*/
9442 * @brief UE SCell Buffer Free
9446 * Function : rgSCHSCellFreeBuf
9448 * This functions will free allocated memory
9449 * for UE secondart cellCB
9452 * @param[in] Inst inst
9453 * @param[in] RgSchUeCb *ue
9454 * @param[int] RgrUeRecfg *ueRecfg
9455 * @param[out] uint8_t idx
9458 Void rgSCHSCellFreeBuf
9462 RgrUeRecfg *ueRecfg,
9466 RgSchUeCellInfo *sCellInfo = NULLP;
9467 RgrUeSecCellCfg *sCellInfoRecfg = NULLP;
9470 for(uint8_t i = 0; i <= idx; i++)
9472 sCellInfoRecfg = &ueRecfg->ueSCellCfgInfo.ueSCellDedCfg[i];
9473 sCellInfo = ue->cellInfo[(sCellInfoRecfg->sCellIdx)];
9475 if (NULLP != sCellInfo)
9477 rgSCHUtlFreeSBuf(inst, (Data**)&(sCellInfo),
9478 sizeof(RgSchUeCellInfo));
9479 ue->cellInfo[(sCellInfoRecfg->sCellIdx)] = NULLP;
9486 /**********************************************************************
9489 **********************************************************************/