1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for Entry point fucntions
29 **********************************************************************/
31 /** @file rg_sch_gom.c
32 @brief This module does processing related to handling of upper interface APIs
33 invoked by RRM towards MAC.
36 static const char* RLOG_MODULE_NAME="MAC";
37 static int RLOG_MODULE_ID=4096;
38 static int RLOG_FILE_ID=164;
40 /* header include files -- defines (.h) */
41 #include "common_def.h"
46 #include "rg_sch_inf.h"
48 #include "rg_sch_err.h"
49 #include "rl_interface.h"
50 #include "rl_common.h"
52 /* header/extern include files (.x) */
56 #include "rg_sch_inf.x"
60 PRIVATE S16 rgSCHGomHndlCfgReq ARGS((RgSchCb *instCb, SpId spId,
61 RgrCfg *cfg, RgSchErrInfo *errInfo));
62 PRIVATE S16 rgSCHGomHndlRecfgReq ARGS((RgSchCb *instCb, SpId spId,
63 RgrRecfg *recfg, RgSchErrInfo *errInfo));
64 PRIVATE S16 rgSCHGomHndlResetReq ARGS((RgSchCb *instCb,SpId spId,RgrRst *reset,
65 RgSchErrInfo *errInfo));
66 PRIVATE S16 rgSCHGomGetCellIdFrmCfgReq ARGS((RgrCfgReqInfo *rgrCfgReq,
67 CmLteCellId *cellId));
68 PRIVATE S16 rgSCHGomCfgReq ARGS((Region reg, Pool pool, RgSchCb *instCb,
69 RgrCfgTransId transId, RgrCfgReqInfo *cfgReqInfo));
70 PRIVATE S16 rgSCHGomEnqCfgReq ARGS((Region reg, Pool pool, RgSchCellCb *cell,
71 RgrCfgTransId transId, RgrCfgReqInfo *rgrCfgReq));
72 PRIVATE S16 rgSCHGomHndlDelReq ARGS((RgSchCb *instCb,SpId spId,
73 RgrDel *del,RgSchErrInfo *errInfo));
75 PRIVATE S16 rgSCHGomHndlSCellActDeactReq ARGS((RgSchCb *instCb, SpId spId,
76 RgrSCellActDeactEvnt *sCellActDeactEvnt, RgSchErrInfo *errInfo, U8 action));
79 EXTERN S16 rgSchEmtcGetSiWinPerd ARGS((
84 extern S16 rgSCHEmtcUtlCalMcsAndNPrb
92 EXTERN S32 rgSCHEmtcUtlGetAllwdCchTbSzForSI ARGS(
97 EXTERN Void rgSCHEmtcWarningSiCfg ARGS(
100 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo,
110 /* forward references */
115 * @brief Handler for config request from RRM to Schedular.
119 * Function: rgSCHGomHndlCfg
121 * This API is called from schedulers UIM and it handles config request
122 * from RRM to Scheduler.
125 * - If the request is for the inactive cell,
126 * - Handle request.Call rgSCHGomCfgReq.
128 * - Enqueue the request. Call rgSCHGomEnqCfgReq.
130 * @param[in] Pst *pst
131 * @param[in] RgSchCb *instCb
132 * @param[in] RgrCfgTransId transId
133 * @param[in] RgrCfgReqInfo *cfgReqInfo
139 PUBLIC S16 rgSCHGomHndlCfg
143 RgrCfgTransId transId,
144 RgrCfgReqInfo *cfgReqInfo
147 PUBLIC S16 rgSCHGomHndlCfg(pst, instCb, transId, cfgReqInfo)
150 RgrCfgTransId transId;
151 RgrCfgReqInfo *cfgReqInfo;
157 RgSchCellCb *cell = NULLP;
158 U8 cfmStatus = RGR_CFG_CFM_NOK;
160 Inst inst = (instCb->rgSchInit.inst );
163 TRC2(rgSCHGomHndlCfg);
164 /* Apply the configuration for Cell Configuration or Delete */
165 if (cfgReqInfo->action != RGR_RECONFIG)
167 ret = rgSCHGomCfgReq (pst->region, pst->pool, instCb,
168 transId, cfgReqInfo);
172 /* Fetch the cell Id for the recieved request */
173 if((rgSCHGomGetCellIdFrmCfgReq(cfgReqInfo, &cellId)) != ROK)
175 RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "Action.Config Type Error");
177 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
178 (Size)sizeof(*cfgReqInfo));
180 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
183 /* Extract the cell and Enquee Config Request */
184 if(NULLP != instCb->rgrSap[spId].cell)
186 if(cellId != instCb->rgrSap[spId].cell->cellId)
188 RLOG_ARG2(L_ERROR,DBG_CELLID,cellId, "Cell with Id %d already exists "
189 "on sap %d", instCb->rgrSap[spId].cell->cellId, spId);
191 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
192 (Size)sizeof(*cfgReqInfo));
194 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
197 cell = instCb->rgrSap[spId].cell;
199 /* Enqueue the configuration */
200 ret = rgSCHGomEnqCfgReq(pst->region, pst->pool, cell, transId, cfgReqInfo);
203 RLOG_ARG0(L_ERROR,DBG_CELLID,cellId, "rgSCHGomHndlCfg: Enqueuing CfgReq "
206 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
207 (Size)sizeof(*cfgReqInfo));
209 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
215 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
216 (Size)sizeof(*cfgReqInfo));
218 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
221 }/* rgSCHGomHndlCfg */
225 * @brief Handler to handle config request from RRM to Scheduler.
229 * Function: rgSCHGomCfgReq
231 * This API handles processing for config request from RRM to Scheduler.
234 * - If Configuration request, call rgSCHGomHndlCfgReq.
235 * - Else if Reconfiguration request, call rgSCHGomHndlRecfgReq.
236 * - If successful, send configuration confirm to RRM.
237 * Call schSendCfgCfm else FAIL.
239 * @param[in] Region reg
240 * @param[in] Pool pool
241 * @param[in] RgSchCb *instCb
242 * @param[in] RgrCfgTransId transId
243 * @param[in] RgrCfgReqInfo *cfgReqInfo
249 PRIVATE S16 rgSCHGomCfgReq
254 RgrCfgTransId transId,
255 RgrCfgReqInfo *cfgReqInfo
258 PRIVATE S16 rgSCHGomCfgReq(reg, pool, instCb, transId, cfgReqInfo)
262 RgrCfgTransId transId;
263 RgrCfgReqInfo *cfgReqInfo;
267 U8 cfmStatus = RGR_CFG_CFM_OK;
269 RgSchErrInfo errInfo;
271 Inst inst = (instCb->rgSchInit.inst );
273 TRC2(rgSCHGomCfgReq);
275 printf("\n AT MAC rgSCHGomCfgReq \n");
278 /* Process Config/Reconfig/Delete request from RRM */
279 switch (cfgReqInfo->action)
283 ret = rgSCHGomHndlCfgReq(instCb, spId,
284 &cfgReqInfo->u.cfgInfo, &errInfo);
289 ret = rgSCHGomHndlRecfgReq(instCb, spId,
290 &cfgReqInfo->u.recfgInfo, &errInfo);
295 ret = rgSCHGomHndlResetReq(instCb, spId,
296 &cfgReqInfo->u.rstInfo, &errInfo);
301 ret = rgSCHGomHndlDelReq(instCb, spId,
302 &cfgReqInfo->u.delInfo, &errInfo);
307 case RGR_SCELL_DEACT:
308 case RGR_SCELL_READY:
310 ret = rgSCHGomHndlSCellActDeactReq(instCb, spId,
311 &cfgReqInfo->u.sCellActDeactEvnt, &errInfo, cfgReqInfo->action);
317 RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "Invalid configuration "
318 "action %d", cfgReqInfo->action);
321 } /* End of switch */
325 cfmStatus = RGR_CFG_CFM_NOK;
328 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
329 (Size)sizeof(*cfgReqInfo));
332 printf("\n AT MAC sending RGR cfg cfm \n");
335 /* Send back confirmation status to RRM */
336 schSendCfgCfm(reg, pool, transId, cfmStatus);
338 printf("\n AT MAC RGR cfg cfm sent\n");
342 } /* rgSCHGomCfgReq */
346 * @brief Handler to enqueuing config request from RRM to Scheduler.
350 * Function: rgSCHGomEnqCfgReq
352 * This API enqueues config request from RRM to MAC.
355 * - Allocate the configuration request element.
356 * - Copy the contents of the recieved configuration to config request
357 * element and free the recieved configuration pointer.
358 * - If the configuration is without activation time,
359 * - Enqueue the request in crntRgrCfgLst of the cell at the end of
362 * - Enqueue the request in pndngRgrCfgLst of the cell.
364 * @param[in] Region reg,
365 * @param[in] Pool pool
366 * @param[in] RgSchCellCb *cell
367 * @param[in] RgrCfgTransId transId
368 * @param[in] RgrCfgReqInfo *rgrCfgReq
374 PRIVATE S16 rgSCHGomEnqCfgReq
379 RgrCfgTransId transId,
380 RgrCfgReqInfo *rgrCfgReq
383 PRIVATE S16 rgSCHGomEnqCfgReq(reg, pool, cell, transId, rgrCfgReq)
387 RgrCfgTransId transId;
388 RgrCfgReqInfo *rgrCfgReq;
393 RgSchCfgElem *rgrCfgElem = NULLP;
394 CmLteTimingInfo actvTime;
395 Inst inst = cell->instIdx;
397 TRC2(rgSCHGomEnqCfgReq);
399 /* Allocate memory for config Element */
400 ret = rgSCHUtlAllocSBuf(inst, (Data **)&rgrCfgElem, sizeof(RgSchCfgElem));
401 if ((ret != ROK) || ((U8 *)rgrCfgElem == NULLP))
406 /* Initialize the configuration element */
407 cmMemcpy((U8*)rgrCfgElem->rgrCfg.transId.trans,(U8*)transId.trans,
408 sizeof(transId.trans));
409 rgrCfgElem->rgrCfg.reg = reg;
410 rgrCfgElem->rgrCfg.pool = pool;
411 rgrCfgElem->rgrCfg.rgrCfgReq = rgrCfgReq;
412 rgrCfgElem->cfgReqLstEnt.prev = NULLP;
413 rgrCfgElem->cfgReqLstEnt.next = NULLP;
414 rgrCfgElem->cfgReqLstEnt.node = (PTR )rgrCfgElem;
416 /* Add configuration element to current/pending cfgLst */
417 if (((rgrCfgReq->action == RGR_RECONFIG) &&
418 (rgrCfgReq->u.recfgInfo.recfgType == RGR_CELL_CFG) &&
419 (rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.pres == TRUE)))
423 rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.actvTime;
425 /* Check if the activation time is valid */
426 if (actvTime.sfn >= RGSCH_MAX_SFN
427 || actvTime.slot >= RGSCH_NUM_SUB_FRAMES_5G)
429 RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId, "Invalid activation time for RGR "
430 "config request: activation sfn %d activation slot %d current "
431 "sfn %d current slot %d", actvTime.sfn, actvTime.slot,
432 cell->crntTime.sfn, cell->crntTime.slot);
433 /* ccpu00117052 - MOD - Passing double pointer
434 for proper NULLP assignment*/
435 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
439 sfDiff = RGSCH_CALC_SF_DIFF(actvTime, cell->crntTime);
441 if (sfDiff > (RGR_ACTV_WIN_SIZE * RGSCH_NUM_SUB_FRAMES_5G))
443 RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId,"Invalid activation time for RGR"
444 " config request: activation sfn %d activation slot %d "
445 "current sfn %d current slot %d", actvTime.sfn,
446 actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot);
447 /* ccpu00117052 - MOD - Passing double pointer
448 for proper NULLP assignment*/
449 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
455 /* Add to pending cfgReqLst */
456 rgrCfgElem->actvTime = actvTime;
457 rgSCHDbmInsPndngRgrCfgElem(cell, rgrCfgElem);
458 /* Cfm to be sent only after applying request */
463 /* Add to current cfgReq list */
464 rgSCHDbmInsCrntRgrCfgElem(cell, rgrCfgElem);
465 /* Cfm to be sent only after applying request */
467 } /* rgSCHGomEnqCfgReq */
471 * @brief Handler for TTI processing for configurations recieved from RRM.
475 * Function: rgSCHGomTtiHndlr
477 * This API does TTI processing for configurations recieved from RRM.
480 * - It dequeues config request from the current configuration list.
481 * For each config request in the list:
482 * - Processes the request. Call rgSCHGomCfgReq.
483 * - It dequeues config request for the current tti from the pending
484 * configuration list. For each config request in the list:
485 * - Processes the request. Call rgSCHGomCfgReq.
487 * @param[in] RgSchCellCb *cell
493 PUBLIC S16 rgSCHGomTtiHndlr
499 PUBLIC S16 rgSCHGomTtiHndlr(cell, spId)
504 RgSchCfgElem *cfgElem;
505 Inst inst= cell->instIdx;
506 TRC2(rgSCHGomTtiHndlr);
508 /* Dequeue from current config list */
509 while ((cfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
511 rgSCHDbmDelCrntRgrCfgElem(cell, cfgElem);
512 rgSCHGomCfgReq(cfgElem->rgrCfg.reg,cfgElem->rgrCfg.pool,
513 &rgSchCb[inst], cfgElem->rgrCfg.transId,
514 cfgElem->rgrCfg.rgrCfgReq);
515 /* ccpu00117052 - MOD - Passing double pointer
516 for proper NULLP assignment*/
517 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
520 /* Handle config requests from pending config list */
521 while((cfgElem = rgSCHDbmGetPndngRgrCfgElemByKey(cell, cell->crntTime)) != NULLP)
523 rgSCHDbmDelPndngRgrCfgElem(cell, cfgElem);
524 rgSCHGomCfgReq(cfgElem->rgrCfg.reg, cfgElem->rgrCfg.pool,
525 &rgSchCb[inst], cfgElem->rgrCfg.transId,
526 cfgElem->rgrCfg.rgrCfgReq);
527 /* ccpu00117052 - MOD - Passing double pointer
528 for proper NULLP assignment*/
529 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
537 * @brief Handler to handle configuration request from RRM to MAC.
541 * Function: rgSCHGomHndlCfgReq
543 * This API handles processing for configuration request from RRM to MAC.
545 * - Processing Steps:
546 * - Validate configuration request parameters at CFG module.
547 * Call rgSCHCfgVldtRgrCellCfg for cell configuration.
548 * - If validated successfully, send configuration request to CFG.
549 * Call rgSCHCfgRgrCellCfg else FAIL.
551 * @param[in] RgSchCb *instCb
552 * @param[in] SpId spId
553 * @param[in] RgrCfg *cfg
554 * @param[out] RgSchErrInfo *errInfo
560 PRIVATE S16 rgSCHGomHndlCfgReq
565 RgSchErrInfo *errInfo
568 PRIVATE S16 rgSCHGomHndlCfgReq(instCb, spId, cfg, errInfo)
572 RgSchErrInfo *errInfo;
576 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
577 Inst inst = (instCb->rgSchInit.inst );
580 TRC2(rgSCHGomHndlCfgReq);
582 errInfo->errType = RGSCHERR_GOM_CFG_REQ;
584 /* Validate and process the configuration request */
585 switch (cfg->cfgType)
589 ret = rgSCHCfgVldtRgrCellCfg(inst, &cfg->u.cellCfg, cell, errInfo);
592 RLOG1(L_ERROR,"Rgr Cell configuration "
593 "validation FAILED: Cell %d", cfg->u.cellCfg.cellId);
596 ret = rgSCHCfgRgrCellCfg(instCb, spId, &cfg->u.cellCfg, errInfo);
600 case RGR_SCELL_UE_CFG:
602 ret = rgSCHCfgVldtRgrUeCfg(inst, &cfg->u.ueCfg, &cell, errInfo);
605 RLOG1(L_ERROR,"Ue configuration validation"
606 " FAILED: CRNTI:%d", cfg->u.ueCfg.crnti);
609 ret = rgSCHCfgRgrUeCfg(cell, &cfg->u.ueCfg, errInfo);
614 ret = rgSCHCfgVldtRgrLcCfg(inst, &cfg->u.lchCfg, &cell, &ue, errInfo);
617 RLOG1(L_ERROR,"LC configuration validation "
618 "FAILED: LCID:%d", cfg->u.lchCfg.lcId);
621 ret = rgSCHCfgRgrLchCfg(cell, ue, &cfg->u.lchCfg, errInfo);
626 ret = rgSCHCfgVldtRgrLcgCfg(inst, &cfg->u.lcgCfg, &cell, &ue, errInfo);
629 RLOG1(L_ERROR,"LCG configuration validation "
630 "FAILED: LCGID:%d", cfg->u.lcgCfg.ulInfo.lcgId);
633 ret = rgSCHCfgRgrLcgCfg(cell, ue, &cfg->u.lcgCfg, errInfo);
638 ret = rgSCHCfgVldtRgrSchedEnbCfg(inst, &cfg->u.schedEnbCfg, errInfo);
641 RGSCHDBGERR(inst,(rgSchPBuf(inst), "SCH ENB configuration validation "
645 ret = rgSCHCfgRgrSchedEnbCfg(inst, spId, &cfg->u.schedEnbCfg, errInfo);
650 #if(ERRCLASS & ERRCLS_INT_PAR)
651 RLOG1(L_ERROR,"Should never come here: "
652 "cfgType %d", cfg->cfgType);
659 } /* rgSCHGomHndlCfgReq */
663 * @brief Handler to handle re-configuration request from RRM to MAC.
667 * Function: rgSCHGomHndlSCellActDeactReq
669 * This API handles processing for SCell Activation Request from RRM to SCH.
671 * - Processing Steps:
672 * - Validate sCell Actication request parameters at CFG module.
673 * - If validated successfully, send configuration request to CFG.
674 * - call activation function for each SCells configured
676 * @param[in] RgSchCb *instCb
677 * @param[in] SpId spId
678 * @param[in] RgrSCellActDeactEvnt *sCellActDeactEvnt
679 * @param[in] U8 action
680 * @param[out] RgSchErrInfo *errInfo
686 PRIVATE S16 rgSCHGomHndlSCellActDeactReq
690 RgrSCellActDeactEvnt *sCellActDeactEvnt,
691 RgSchErrInfo *errInfo,
695 PRIVATE S16 rgSCHGomHndlSCellActDeactReq(instCb, spId, sCellActDeactEvnt, errInfo, action)
698 RgrSCellActDeactEvnt *sCellActDeactEvnt;
699 RgSchErrInfo *errInfo;
703 RgSchUeCb *ue = NULLP;
706 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
707 Inst inst = (instCb->rgSchInit.inst);
709 TRC2(rgSCHGomHndlSCellActDeactReq);
710 RGSCHDBGPRM(inst,(rgSchPBuf(inst), "Processing RGR SCell Actication request:"
711 "%d\n", sCellActDeactEvnt->crnti));
713 errInfo->errType = RGSCHERR_GOM_SCELL_REQ;
716 if ((ue = rgSCHDbmGetUeCb(cell, sCellActDeactEvnt->crnti)) == NULLP)
718 RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UE: does not exist\n",
719 sCellActDeactEvnt->crnti));
723 for(idx = 0; idx < sCellActDeactEvnt->numOfSCells; idx++)
725 sCellIdx = sCellActDeactEvnt->sCellActDeactInfo[idx].sCellIdx;
727 if (ROK != (rgSCHSCellTrigActDeact(cell, ue, sCellIdx, action)))
729 RGSCHDBGERR(inst,(rgSchPBuf(inst), "SCell Actication failed"
730 "for UE [%d] with SCellIdx [%d]\n",
731 sCellActDeactEvnt->crnti, idx));
737 RGSCHDBGINFO(inst,(rgSchPBuf(inst), "RGR Reconfiguration processed\n"));
739 } /* rgSCHGomHndlSCellActDeactReq */
743 * @brief Handler to handle re-configuration request from RRM to MAC.
747 * Function: rgSCHGomHndlRecfgReq
749 * This API handles processing for re-configuration request from RRM to MAC.
751 * - Processing Steps:
752 * - Validate re-configuration request parameters at CFG module.
753 * Call rgSCHCfgVldtRgrCellRecfg for cell re-configuration.
754 * - If validated successfully, send configuration request to CFG.
755 * Call rgSCHCfgRgrCellRecfg else FAIL.
757 * @param[in] RgSchCb *instCb
758 * @param[in] SpId spId
759 * @param[in] RgrRecfg *recfg
760 * @param[out] RgSchErrInfo *errInfo
766 PRIVATE S16 rgSCHGomHndlRecfgReq
771 RgSchErrInfo *errInfo
774 PRIVATE S16 rgSCHGomHndlRecfgReq(instCb, spId, recfg, errInfo)
778 RgSchErrInfo *errInfo;
781 RgSchUeCb *ue = NULLP;
782 RgSchDlLcCb *dlLc = NULLP; /* PURIFY_FIX:UMR */
784 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
785 Inst inst = (instCb->rgSchInit.inst );
787 TRC2(rgSCHGomHndlRecfgReq);
789 errInfo->errType = RGSCHERR_GOM_RECFG_REQ;
791 /* Validate and process the re-configuration request */
792 switch (recfg->recfgType)
796 ret = rgSCHCfgVldtRgrCellRecfg(inst, &recfg->u.cellRecfg, &cell,
800 RLOG_ARG0(L_ERROR,DBG_CELLID,recfg->u.cellRecfg.cellId,"Rgr Cell Recfg Validation "
804 ret = rgSCHCfgRgrCellRecfg(cell, &recfg->u.cellRecfg, errInfo);
808 case RGR_SCELL_UE_CFG:
810 ret = rgSCHCfgVldtRgrUeRecfg(inst, &recfg->u.ueRecfg, &cell, &ue, errInfo);
813 RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.ueRecfg.cellId,"Ue Recfg Validation FAILED"
814 "OLD CRNTI:%d",recfg->u.ueRecfg.oldCrnti);
817 ret = rgSCHCfgRgrUeRecfg(cell, ue, &recfg->u.ueRecfg, errInfo);
822 ret = rgSCHCfgVldtRgrLchRecfg(inst, &recfg->u.lchRecfg, &cell, &ue,
826 RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.lchRecfg.cellId,"Lc Recfg Validation FAILED"
827 "LCID:%d",recfg->u.lchRecfg.lcId);
830 ret = rgSCHCfgRgrLchRecfg(cell, ue, dlLc, &recfg->u.lchRecfg, errInfo);
835 ret = rgSCHCfgVldtRgrLcgRecfg(inst, &recfg->u.lcgRecfg, cell, &ue,
839 RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.lcgRecfg.cellId, "Lcg Recfg Validation FAILED"
840 "LCGID:%d",recfg->u.lcgRecfg.ulRecfg.lcgId);
843 ret = rgSCHCfgRgrLcgRecfg(cell, ue, &recfg->u.lcgRecfg, errInfo);
848 #if(ERRCLASS & ERRCLS_INT_PAR)
849 RLOG1(L_ERROR,"Should never come here: recfgType %d", recfg->recfgType);
856 } /* rgSCHGomHndlRecfgReq */
859 * @brief Handler to handle UE reset request from RRM to Scheduler.
863 * Function: rgSCHGomHndlResetReq
865 * This API handles processing for UE reset request from RRM to Scheduler.
867 * - Processing Steps:
868 * - Validate UE reset request parameters at CFG module.
869 * Call rgSCHCfgVldtRgrUeReset for UE reset.
870 * - If validated successfully, send UE reset request to CFG.
871 * Call rgSCHCfgRgrUeReset else FAIL.
873 * @param[in] RgrRst *rstInfo
874 * @param[out] RgSchErrInfo *errInfo
880 PRIVATE S16 rgSCHGomHndlResetReq
885 RgSchErrInfo *errInfo
888 PRIVATE S16 rgSCHGomHndlResetReq(instCb, spId, reset, errInfo)
892 RgSchErrInfo *errInfo;
896 RgSchCellCb *cell= instCb->rgrSap[spId].cell;
897 Inst inst = (instCb->rgSchInit.inst );
898 RgSchUeCb *ue = NULLP;
900 TRC2(rgSCHGomHndlResetReq);
903 errInfo->errType = RGSCHERR_GOM_RESET_REQ;
905 /* Validate and process the UE reset request */
906 ret = rgSCHCfgVldtRgrUeReset(inst, reset, cell, &ue, errInfo);
909 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"Rgr UE Reset Validation FAILED"
910 "CRNTI:%d",reset->crnti);
914 ret = rgSCHCfgRgrUeReset(cell, ue, reset, errInfo);
917 RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"Rgr UE Reset FAILED"
918 "CRNTI:%d",reset->crnti);
923 } /* rgSCHGomHndlResetReq */
927 * @brief Handler for processing Cell/Ue/Logical channel delete request
932 * Function: rgSCHGomHndlDelReq
934 * This API handles processing of delete request from RRM to MAC.
937 * - Fetch corresponding control block and pass it to CFG module.
938 * - If control block does not exist, FAIL.
940 * @param[in] RgSchCb *instCb
941 * @param[in] SpId spId
942 * @param[in] RgrDel *del
943 * @param[out] RgSchErrInfo *errInfo
949 PRIVATE S16 rgSCHGomHndlDelReq
954 RgSchErrInfo *errInfo
957 PRIVATE S16 rgSCHGomHndlDelReq(instCb, spId, del, errInfo)
961 RgSchErrInfo *errInfo;
967 Inst inst = (instCb->rgSchInit.inst);
969 VOLATILE U32 startTime=0;
971 TRC2(rgSCHGomHndlDelReq);
973 errInfo->errType = RGSCHERR_GOM_DEL_REQ;
975 if(instCb->rgrSap[spId].cell == NULLP)
977 RLOG_ARG0(L_ERROR,DBG_INSTID,inst,"Cell doesnt exist");
981 /* Process the delete request */
982 switch (del->delType)
986 ret = rgSCHCfgRgrCellDel(instCb->rgrSap[spId].cell, del, errInfo);
989 /* TODO::Needs to be revisited after tti flow CaDev Start */
990 U8 idx = (U8)((instCb->rgrSap[spId].cell->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
991 instCb->cells[idx] = NULLP;
993 instCb->rgrSap[spId].cell = NULLP;
994 instCb->tfuSap[spId].cell = NULLP;
999 case RGR_SCELL_UE_CFG:
1003 SStartTask(&startTime, PID_SCH_UE_DEL);
1005 ret = rgSCHCfgRgrUeDel(instCb->rgrSap[spId].cell, del, errInfo);
1008 SStopTask(startTime, PID_SCH_UE_DEL);
1014 ret = rgSCHCfgRgrLcDel(instCb->rgrSap[spId].cell, del, errInfo);
1019 ret = rgSCHCfgRgrLcgDel(instCb->rgrSap[spId].cell, del, errInfo);
1024 #if(ERRCLASS & ERRCLS_INT_PAR)
1025 RLOG1(L_ERROR,"Should never come here: delType %d", del->delType);
1032 } /* rgSCHGomHndlDelReq */
1037 /***********************************************************
1039 * Func : rgSCHGomGetCellIdFrmCfgReq
1043 * - Processing Steps:
1044 * - Retrieves the cell Id for a config request.
1046 * @param[in] RgrCfgReqInfo *rgrCfgReq
1047 * @param[out] CmLteCellId *cellId
1048 * Ret : ROK on fetching cellId
1049 * RFAILED on failure
1053 * File : rg_sch_gom.c
1055 **********************************************************/
1057 PRIVATE S16 rgSCHGomGetCellIdFrmCfgReq
1059 RgrCfgReqInfo *rgrCfgReq,
1063 PRIVATE S16 rgSCHGomGetCellIdFrmCfgReq(rgrCfgReq, cellId)
1064 RgrCfgReqInfo *rgrCfgReq;
1065 CmLteCellId *cellId;
1069 TRC2(rgSCHGomGetCellIdFrmCfgReq);
1072 /* Extract CellId depending on the action and Config Type in the Request
1073 * As of now this function is called for only re configuration so removed
1074 * othe CASES below if needed we can add them*/
1075 switch (rgrCfgReq->action)
1079 if (rgrCfgReq->u.recfgInfo.recfgType ==RGR_CELL_CFG)
1081 *cellId = rgrCfgReq->u.recfgInfo.u.cellRecfg.cellId;
1083 else if ((rgrCfgReq->u.recfgInfo.recfgType == RGR_SCELL_UE_CFG) ||
1084 (rgrCfgReq->u.recfgInfo.recfgType == RGR_UE_CFG))
1086 *cellId = rgrCfgReq->u.recfgInfo.u.ueRecfg.cellId;
1088 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCH_CFG)
1090 *cellId = rgrCfgReq->u.recfgInfo.u.lchRecfg.cellId;
1092 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCG_CFG)
1094 *cellId = rgrCfgReq->u.recfgInfo.u.lcgRecfg.cellId;
1106 } /* End of Switch */
1109 } /* rgSCHGomGetCellIdFrmCfgReq */
1113 * @brief Handler to handle SI configuration request from RRM to MAC.
1117 * Function: rgSCHGomHndlSiCfg
1119 * This API handles processing for SI configuration request from RRM to MAC.
1121 * - Processing Steps:
1122 * - Validate SI configuration request parameters at CFG module.
1123 * Call rgSCHCfgVldtSiCfg for SI configuration.
1124 * - If validated successfully, send configuration request to CFG.
1125 * Call rgSCHCfgRgrCellCfg else FAIL.
1127 * @param[in] Region reg
1128 * @param[in] Pool pool
1129 * @param[in] RgSchCb *instCb
1130 * @param[in] SpId spId
1131 * @param[in] RgrCfgTransId transId
1132 * @param[in] RgrSiCfgReqInfo *cfgReqInfo
1138 PUBLIC S16 rgSCHGomHndlSiCfg
1144 RgrCfgTransId transId,
1145 RgrSiCfgReqInfo *cfgReqInfo
1148 PUBLIC S16 rgSCHGomHndlSiCfg(reg, pool, instCb, spId, transId, cfgReqInfo)
1153 RgrCfgTransId transId;
1154 RgrSiCfgReqInfo *cfgReqInfo;
1158 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1159 Inst inst = (instCb->rgSchInit.inst );
1160 RgSchErrInfo errInfo;
1161 U8 cfmStatus = RGR_CFG_CFM_NOK;
1162 MsgLen msgLen = 0, pduLen;
1167 TRC2(rgSCHGomHndlSiCfg);
1170 /* check if cell does not exists */
1171 if (((U8 *)cell == NULLP) || (cell->cellId != cfgReqInfo->cellId))
1173 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Cell Control block does not exist"
1175 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1176 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1178 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1182 /*Validate the received SI configuration */
1183 ret = rgSCHCfgVldtRgrSiCfg(inst, cfgReqInfo, cell, &errInfo);
1186 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration "
1187 "validation FAILED");
1188 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1189 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1191 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1194 /*ccpu00140789: Stopping SI scheduling*/
1195 if(RGR_SI_STOP == cfgReqInfo->cfgType)
1197 if((cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)&&
1198 (cell->siCb.siArray[cfgReqInfo->siId-1].si != NULLP))
1200 cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1201 RGSCH_FREE_MSG(cell->siCb.siArray[cfgReqInfo->siId-1].si);
1202 cell->siCb.siArray[cfgReqInfo->siId-1].si = NULLP;
1203 if(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)
1205 RGSCH_FREE_MSG(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si);
1206 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1208 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1210 cfmStatus = RGR_CFG_CFM_OK;
1211 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1216 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1218 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1223 /* Check if the pdu sent from application
1224 * matches a transport block size. if not,
1225 * add padding bytes. This is usually done
1226 * by RRC but since we are bypassing RRC,
1227 * MAC is taking over that responsibility
1229 if ( RGR_SI_CFG_TYPE_MIB != cfgReqInfo->cfgType )
1231 SFndLenMsg(cfgReqInfo->pdu, &msgLen);
1233 /* check if the application pdu matches a tb size */
1234 tbSz = rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs);
1236 if ( tbSz != (msgLen*8) )
1238 MsgLen nmPadBytes = 0;
1239 Data* padding = NULLP;
1241 /* need to add padding bytes */
1242 nmPadBytes = (tbSz - (msgLen*8))/8;
1244 if ( SGetSBuf(reg,pool,&padding,nmPadBytes) != ROK)
1246 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration "
1247 "SGetSBuf failed for padding failed");
1248 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1250 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1255 cmMemset((U8*)padding,(U8)0,nmPadBytes);
1257 #ifdef MS_MBUF_CORRUPTION
1258 MS_BUF_ADD_ALLOC_CALLER();
1260 if ( SAddPstMsgMult((Data*)padding,nmPadBytes,cfgReqInfo->pdu) != ROK)
1262 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration "
1263 "Failed to add padding bytes");
1264 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1266 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1268 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1272 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1274 }/* if (tbSz != ...*/
1275 }/* if (RGR_SI_CFG_TYPE_SI...*/
1277 /*Set the received pdu at the appropriate place */
1278 switch(cfgReqInfo->cfgType)
1280 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
1281 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.mib,
1282 cell->siCb.newSiInfo.mib,
1283 cfgReqInfo->pdu, cell->siCb.siBitMask,
1287 case RGR_SI_CFG_TYPE_SIB1_PWS:
1289 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1290 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1293 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB"
1295 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1296 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1298 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1303 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1304 cell->siCb.newSiInfo.sib1Info.sib1,
1305 cfgReqInfo->pdu, cell->siCb.siBitMask,
1306 RGSCH_SI_SIB1_PWS_UPD);
1310 case RGR_SI_CFG_TYPE_SIB1:
1311 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1312 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1315 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB"
1317 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1318 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1320 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1324 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1325 cell->siCb.newSiInfo.sib1Info.sib1,
1326 cfgReqInfo->pdu, cell->siCb.siBitMask,
1330 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
1331 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1332 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1336 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB"
1338 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1339 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1341 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1345 /* Si recfg, where numSi changes */
1346 if (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD)
1348 Buffer **newSiPdu = &cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si;
1349 if(*newSiPdu != NULLP)
1351 RGSCH_FREE_MSG(*newSiPdu);
1353 *newSiPdu = (Buffer *)cfgReqInfo->pdu;
1354 cell->siCb.siBitMask |= RGSCH_SI_SI_UPD;
1356 else /* Initial Si cfg or si recfg where numSi did not change */
1359 /* Initial Si cfg */
1360 if (cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si == NULLP)
1362 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1363 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1364 bitMask = RGSCH_SI_DFLT;
1368 bitMask = RGSCH_SI_SI_UPD;
1371 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1372 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si,
1374 cell->siCb.siBitMask, bitMask);
1378 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
1379 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1380 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1384 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB"
1386 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1387 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1389 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1393 /* No need to wait for Modification period boundary */
1394 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1395 RGSCH_SET_SI_INFO(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1397 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1400 RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Invalid cfgType "
1402 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1403 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
1404 (Size)sizeof(*cfgReqInfo));
1406 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1411 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1413 cfmStatus = RGR_CFG_CFM_OK;
1414 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1418 } /* rgSCHGomHndlSiCfg */
1422 * @brief Handler to handle Warning SI configuration request from RRM to MAC.
1426 * Function: rgSCHGomHndlWarningSiCfg
1428 * This API handles processing for Warning SI configuration request from
1432 * @param[in] Region reg
1433 * @param[in] Pool pool
1434 * @param[in] RgSchCb *instCb
1435 * @param[in] SpId spId
1436 * @param[in] RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1442 PUBLIC S16 rgSCHGomHndlWarningSiCfg
1448 RgrCfgTransId transId,
1449 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1452 PUBLIC S16 rgSCHGomHndlWarningSiCfg(reg, pool, instCb, spId, transId,
1453 warningSiCfgReqInfo)
1458 RgrCfgTransId transId;
1459 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo;
1462 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1463 U8 cfmStatus = RGR_CFG_CFM_NOK;
1465 U8 siId = warningSiCfgReqInfo->siId;
1466 U8 j, mcs=0, nPrb=0;
1467 RgSchWarningSiSeg *warningSiMsg;
1468 RgSchWarningSiPdu *pduNode;
1471 Bool freeNodeFound = FALSE;
1475 U8 isEmtc = warningSiCfgReqInfo->emtcEnable;
1478 TRC2(rgSCHGomHndlWarningSiCfg);
1483 rgSchEmtcGetSiWinPerd(cell, &siWinSize, &minPeriod);
1488 siWinSize = cell->siCfg.siWinSize;
1489 minPeriod = cell->siCfg.minPeriodicity;
1491 /* check if cell does not exists */
1492 if (((U8 *)cell == NULLP) ||
1493 (cell->cellId != warningSiCfgReqInfo->cellId) ||
1494 (warningSiCfgReqInfo->siId >
1495 ((minPeriod * 10)/siWinSize)))
1497 RLOG_ARG2(L_ERROR,DBG_CELLID,warningSiCfgReqInfo->cellId,"Warning SI Cfg Failed for siId = %d"
1498 "warning cellID:%d",warningSiCfgReqInfo->siId,warningSiCfgReqInfo->cellId);
1499 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1500 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1501 sizeof(RgrWarningSiCfgReqInfo));
1502 warningSiCfgReqInfo = NULLP;
1503 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1508 /* Search for free index in WarningSi */
1509 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1511 if((cell->siCb.warningSi[idx].siId == 0 ||
1512 cell->siCb.warningSi[idx].siId == warningSiCfgReqInfo->siId))
1514 warningSiMsg = (RgSchWarningSiSeg *)&cell->siCb.warningSi[idx].warningSiMsg;
1516 /* Search for free SI node */
1517 /* ccpu00136659: CMAS ETWS design changes */
1518 if (warningSiMsg->segLstCp.first == NULLP) /* Free SI Node */
1520 warningSiMsg->transId = transId;
1521 pduNode = (RgSchWarningSiPdu *)&cell->siCb.warningSi[idx].
1522 warningSiMsg.pduNode;
1523 CM_LLIST_FIRST_NODE(&warningSiCfgReqInfo->siPduLst, node);
1526 /* Get the PDUs one by one from the received pduLst of warning
1527 * message and calculate the MCS and nPrb of each pdu once.
1528 * Store the pdu in warningSiMsg pduLst, which will be scheduled
1529 * later while sending warning message as part of SIB11/SIB12
1531 while((node != NULLP) && (j < RGR_MAX_WARNING_SI_SEG))
1534 pduNode[j].pdu = (Buffer *)node->node;
1535 if(pduNode[j].pdu != NULLP)
1537 SFndLenMsg(pduNode[j].pdu, &msgLen);
1538 /*Get the nPrb and mcs parametr values */
1540 if (rgSCHEmtcUtlGetAllwdCchTbSzForSI(msgLen*8) != (msgLen*8))
1542 if (rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs) != (msgLen*8))
1546 RGSCHLOGERROR(cell->instIdx,ERRCLS_INT_PAR,ERG011,
1548 "rgSCHGomHndlWarningSiCfg():msgLen does not match\
1549 any valid TB Size.");
1550 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Warning SI Cfg Failed"
1551 "for siId = %d", warningSiCfgReqInfo->siId);
1552 rgSCHUtlFreeWarningSiSeg(reg, pool,
1553 &warningSiCfgReqInfo->siPduLst);
1554 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1555 sizeof(RgrWarningSiCfgReqInfo));
1556 warningSiCfgReqInfo = NULLP;
1557 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId,
1558 siId, transId,cfmStatus);
1563 pduNode[j].mcs = mcs;
1564 pduNode[j].nPrb = nPrb;
1565 pduNode[j].msgLen = msgLen;
1566 /* ccpu00136659: CMAS ETWS design changes */
1567 cmLListAdd2Tail(&warningSiMsg->segLstCp, &pduNode[j].lnk);
1568 pduNode[j].lnk.node = (PTR)&pduNode[j];
1573 /* ccpu00132385- nodes in received SI config linked list should
1574 * be freed after processing the config.*/
1575 while(warningSiCfgReqInfo->siPduLst.first != NULLP)
1577 node = warningSiCfgReqInfo->siPduLst.first;
1578 cmLListDelFrm(&(warningSiCfgReqInfo->siPduLst), node);
1579 SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList));
1583 cell->siCb.warningSi[idx].siId = warningSiCfgReqInfo->siId;
1584 cell->siCb.warningSi[idx].idx = idx;
1588 rgSCHEmtcWarningSiCfg(cell,warningSiCfgReqInfo,idx);
1593 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].si =
1594 &cell->siCb.warningSi[idx];
1595 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].isWarningSi =
1598 freeNodeFound = TRUE;
1604 if (freeNodeFound == FALSE)
1606 RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId,"No SI Index is free");
1607 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1608 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1609 sizeof(RgrWarningSiCfgReqInfo));
1610 warningSiCfgReqInfo = NULLP;
1611 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1616 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1617 sizeof(RgrWarningSiCfgReqInfo));
1618 warningSiCfgReqInfo = NULLP;
1624 * @brief Handler to handle SI Stop request from RRM to MAC.
1628 * Function: rgSCHGomHndlWarningSiStopReq
1630 * This API handles processing for SI stop request from RRM to MAC.
1632 * @param[in] Region reg
1633 * @param[in] Pool pool
1634 * @param[in] RgSchCb *instCb
1635 * @param[in] SpId siId
1639 PUBLIC Void rgSCHGomHndlWarningSiStopReq
1645 RgrCfgTransId transId,
1649 PUBLIC Void rgSCHGomHndlWarningSiStopReq(reg, pool, instCb, siId, transId, spId)
1654 RgrCfgTransId transId;
1658 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1661 RgSchWarningSiPdu *warningSiPdu;
1664 TRC3(rgSCHGomHndlWarningSiStopReq)
1666 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1668 if(cell->siCb.warningSi[idx].siId == siId)
1670 if ((cmMemcmp ((U8 *)&cell->siCb.warningSi[idx].warningSiMsg.transId,
1671 (U8 *)&transId, sizeof(RgrCfgTransId))) == 0)
1673 /* ccpu00136659: CMAS ETWS design changes */
1674 CM_LLIST_FIRST_NODE(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1675 while(node != NULLP)
1677 /* On receiving the warning stop message, remove one by one
1678 * each PDU from the warning SI list
1680 /* ccpu00136659: CMAS ETWS design changes */
1681 node = (CmLList *)&cell->siCb.warningSi[idx].warningSiMsg.segLstCp.first;
1682 warningSiPdu = (RgSchWarningSiPdu *)node->node;
1683 pdu = warningSiPdu->pdu;
1684 cmLListDelFrm(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1685 RGSCH_FREE_MSG(pdu);
1694 #endif/*RGR_SI_SCH */
1696 /* LTE_ADV_FLAG_REMOVED_START */
1699 * @brief This function sets the Phigh range for CC users corresponding to the CC Pool
1702 * Function: rgSchUpdtRNTPInfo
1704 * Invoked by: rgSCHGomHndlLoadInf
1706 * @param[in] RgSchCellCb* cell
1707 * @param[in] RgSubFrm* subFrm
1708 * @param[in] RgrLoadInfReqInfo *loadInfReq
1713 PUBLIC S16 rgSchUpdtRNTPInfo
1717 RgrLoadInfReqInfo *loadInfReq
1720 PRIVATE Void rgSchUpdtRNTPInfo(cell, sf)
1723 RgrLoadInfReqInfo *loadInfReq;
1727 /* Initialise the variables */
1728 RgSchSFRPoolInfo *sfrCCPool;
1733 TRC2(rgSchUpdtRNTPInfo);
1735 l = &sf->sfrTotalPoolInfo.ccPool;
1737 /*Get the first node from the CC Pool*/
1738 n = cmLListFirst(l);
1741 sfrCCPool = (RgSchSFRPoolInfo*)n->node;
1742 if (sfrCCPool->poolendRB == loadInfReq->rgrCcPHighEndRb)
1744 sfrCCPool->pwrHiCCRange.endRb = loadInfReq->rgrCcPHighEndRb;
1745 sfrCCPool->pwrHiCCRange.startRb = loadInfReq->rgrCcPHighStartRb;
1756 * @brief Handler to handle LOAD INF request from RRM to MAC.
1760 * Function: rgSCHGomHndlLoadInf
1762 * This API handles processing for LOAD INF request from RRM to MAC.
1764 * - Processing Steps:
1765 * - Validate LOAD INF request parameters at CFG module.
1766 * Call rgSCHCfgVldtRgrLoadInf for SI configuration.
1767 * - If validated successfully, send configuration request.
1769 * @param[in] Region reg
1770 * @param[in] Pool pool
1771 * @param[in] RgSchCb *instCb
1772 * @param[in] SpId spId
1773 * @param[in] RgrCfgTransId transId
1774 * @param[in] RgrLoadInfReqInfo *loadInfReq
1780 PUBLIC S16 rgSCHGomHndlLoadInf
1786 RgrCfgTransId transId,
1787 RgrLoadInfReqInfo *loadInfReq
1790 PUBLIC S16 rgSCHGomHndlLoadInf(reg, pool, instCb, spId, transId, loadInfReq)
1795 RgrCfgTransId transId;
1796 RgrLoadInfReqInfo *loadInfReq;
1800 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1801 Inst inst = (instCb->rgSchInit.inst );
1802 RgSchErrInfo errInfo;
1805 TRC2(rgSCHGomHndlLoadInf);
1808 /* check if cell does not exists */
1809 if (((U8 *)cell == NULLP) || (cell->cellId != loadInfReq->cellId))
1811 RLOG_ARG1(L_ERROR,DBG_CELLID,loadInfReq->cellId,"Cell Control block does not exist"
1812 "for load cellId:%d",loadInfReq->cellId);
1813 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1817 if (cell->lteAdvCb.dsfrCfg.status == RGR_DISABLE)
1819 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "rgSCHGomHndlLoadInf(): DSFR Feature not enabled");
1820 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1823 /* Validate the received LOAD INF Configuration */
1824 ret = rgSCHCfgVldtRgrLoadInf(inst, loadInfReq, cell, &errInfo);
1827 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Rgr LOAD INF Configuration "
1828 "validation FAILED");
1829 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1832 /* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be
1833 sent for the UEs scheduled in that particular RB range*/
1834 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
1836 if((rgSchUpdtRNTPInfo(cell, cell->subFrms[i], loadInfReq) != ROK))
1842 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1846 } /* rgSCHGomHndlLoadInf */
1847 /* LTE_ADV_FLAG_REMOVED_END */
1849 /**********************************************************************
1852 **********************************************************************/