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.
37 /* header include files -- defines (.h) */
38 #include "common_def.h"
43 #include "rg_sch_inf.h"
45 #include "rg_sch_err.h"
47 /* header/extern include files (.x) */
51 #include "rg_sch_inf.x"
55 static S16 rgSCHGomHndlCfgReq ARGS((RgSchCb *instCb, SpId spId,
56 RgrCfg *cfg, RgSchErrInfo *errInfo));
57 static S16 rgSCHGomHndlRecfgReq ARGS((RgSchCb *instCb, SpId spId,
58 RgrRecfg *recfg, RgSchErrInfo *errInfo));
59 static S16 rgSCHGomHndlResetReq ARGS((RgSchCb *instCb,SpId spId,RgrRst *reset,
60 RgSchErrInfo *errInfo));
61 static S16 rgSCHGomGetCellIdFrmCfgReq ARGS((RgrCfgReqInfo *rgrCfgReq,
62 CmLteCellId *cellId));
63 static S16 rgSCHGomCfgReq ARGS((Region reg, Pool pool, RgSchCb *instCb,
64 RgrCfgTransId transId, RgrCfgReqInfo *cfgReqInfo));
65 static S16 rgSCHGomEnqCfgReq ARGS((Region reg, Pool pool, RgSchCellCb *cell,
66 RgrCfgTransId transId, RgrCfgReqInfo *rgrCfgReq));
67 static S16 rgSCHGomHndlDelReq ARGS((RgSchCb *instCb,SpId spId,
68 RgrDel *del,RgSchErrInfo *errInfo));
70 static S16 rgSCHGomHndlSCellActDeactReq ARGS((RgSchCb *instCb, SpId spId,
71 RgrSCellActDeactEvnt *sCellActDeactEvnt, RgSchErrInfo *errInfo, uint8_t action));
74 S16 rgSchEmtcGetSiWinPerd ARGS((
79 extern S16 rgSCHEmtcUtlCalMcsAndNPrb
87 S32 rgSCHEmtcUtlGetAllwdCchTbSzForSI ARGS(
92 Void rgSCHEmtcWarningSiCfg ARGS(
95 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo,
105 /* forward references */
110 * @brief Handler for config request from RRM to Schedular.
114 * Function: rgSCHGomHndlCfg
116 * This API is called from schedulers UIM and it handles config request
117 * from RRM to Scheduler.
120 * - If the request is for the inactive cell,
121 * - Handle request.Call rgSCHGomCfgReq.
123 * - Enqueue the request. Call rgSCHGomEnqCfgReq.
125 * @param[in] Pst *pst
126 * @param[in] RgSchCb *instCb
127 * @param[in] RgrCfgTransId transId
128 * @param[in] RgrCfgReqInfo *cfgReqInfo
133 S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo)
138 RgSchCellCb *cell = NULLP;
139 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
141 /* Apply the configuration for Cell Configuration or Delete */
142 if (cfgReqInfo->action != RGR_RECONFIG)
144 ret = rgSCHGomCfgReq (pst->region, pst->pool, instCb,
145 transId, cfgReqInfo);
149 /* Fetch the cell Id for the recieved request */
150 if((rgSCHGomGetCellIdFrmCfgReq(cfgReqInfo, &cellId)) != ROK)
152 DU_LOG("\nERROR --> SCH : Action.Config Type Error");
154 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
155 (Size)sizeof(*cfgReqInfo));
157 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
160 /* Extract the cell and Enquee Config Request */
161 if(NULLP != instCb->rgrSap[spId].cell)
163 if(cellId != instCb->rgrSap[spId].cell->cellId)
165 DU_LOG("\nERROR --> SCH : Cell with Id %d already exists "
166 "on sap %d", instCb->rgrSap[spId].cell->cellId, spId);
168 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
169 (Size)sizeof(*cfgReqInfo));
171 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
174 cell = instCb->rgrSap[spId].cell;
176 /* Enqueue the configuration */
177 ret = rgSCHGomEnqCfgReq(pst->region, pst->pool, cell, transId, cfgReqInfo);
180 DU_LOG("\nERROR --> SCH : rgSCHGomHndlCfg: Enqueuing CfgReq "
183 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
184 (Size)sizeof(*cfgReqInfo));
186 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
192 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
193 (Size)sizeof(*cfgReqInfo));
195 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
198 }/* rgSCHGomHndlCfg */
202 * @brief Handler to handle config request from RRM to Scheduler.
206 * Function: rgSCHGomCfgReq
208 * This API handles processing for config request from RRM to Scheduler.
211 * - If Configuration request, call rgSCHGomHndlCfgReq.
212 * - Else if Reconfiguration request, call rgSCHGomHndlRecfgReq.
213 * - If successful, send configuration confirm to RRM.
214 * Call schSendCfgCfm else FAIL.
216 * @param[in] Region reg
217 * @param[in] Pool pool
218 * @param[in] RgSchCb *instCb
219 * @param[in] RgrCfgTransId transId
220 * @param[in] RgrCfgReqInfo *cfgReqInfo
225 static S16 rgSCHGomCfgReq(Region reg,Pool pool,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo)
228 uint8_t cfmStatus = RGR_CFG_CFM_OK;
230 RgSchErrInfo errInfo;
232 printf("\nDEBUG --> SCH: AT MAC rgSCHGomCfgReq \n");
235 /* Process Config/Reconfig/Delete request from RRM */
236 switch (cfgReqInfo->action)
240 ret = rgSCHGomHndlCfgReq(instCb, spId,
241 &cfgReqInfo->u.cfgInfo, &errInfo);
246 ret = rgSCHGomHndlRecfgReq(instCb, spId,
247 &cfgReqInfo->u.recfgInfo, &errInfo);
252 ret = rgSCHGomHndlResetReq(instCb, spId,
253 &cfgReqInfo->u.rstInfo, &errInfo);
258 ret = rgSCHGomHndlDelReq(instCb, spId,
259 &cfgReqInfo->u.delInfo, &errInfo);
264 case RGR_SCELL_DEACT:
265 case RGR_SCELL_READY:
267 ret = rgSCHGomHndlSCellActDeactReq(instCb, spId,
268 &cfgReqInfo->u.sCellActDeactEvnt, &errInfo, cfgReqInfo->action);
274 DU_LOG("\nERROR --> SCH : Invalid configuration "
275 "action %d", cfgReqInfo->action);
278 } /* End of switch */
282 cfmStatus = RGR_CFG_CFM_NOK;
285 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
286 (Size)sizeof(*cfgReqInfo));
289 printf("\nDEBUG --> SCH: AT MAC sending RGR cfg cfm \n");
292 /* Send back confirmation status to RRM */
293 schSendCfgCfm(reg, pool, transId, cfmStatus);
295 printf("\nDEBUG --> SCH: AT MAC RGR cfg cfm sent\n");
299 } /* rgSCHGomCfgReq */
303 * @brief Handler to enqueuing config request from RRM to Scheduler.
307 * Function: rgSCHGomEnqCfgReq
309 * This API enqueues config request from RRM to MAC.
312 * - Allocate the configuration request element.
313 * - Copy the contents of the recieved configuration to config request
314 * element and free the recieved configuration pointer.
315 * - If the configuration is without activation time,
316 * - Enqueue the request in crntRgrCfgLst of the cell at the end of
319 * - Enqueue the request in pndngRgrCfgLst of the cell.
321 * @param[in] Region reg,
322 * @param[in] Pool pool
323 * @param[in] RgSchCellCb *cell
324 * @param[in] RgrCfgTransId transId
325 * @param[in] RgrCfgReqInfo *rgrCfgReq
330 static S16 rgSCHGomEnqCfgReq(Region reg,Pool pool,RgSchCellCb *cell,RgrCfgTransId transId,RgrCfgReqInfo *rgrCfgReq)
334 RgSchCfgElem *rgrCfgElem = NULLP;
335 CmLteTimingInfo actvTime;
336 Inst inst = cell->instIdx;
338 /* Allocate memory for config Element */
339 ret = rgSCHUtlAllocSBuf(inst, (Data **)&rgrCfgElem, sizeof(RgSchCfgElem));
340 if ((ret != ROK) || ((uint8_t *)rgrCfgElem == NULLP))
345 /* Initialize the configuration element */
346 memcpy(rgrCfgElem->rgrCfg.transId.trans,transId.trans,
347 sizeof(transId.trans));
348 rgrCfgElem->rgrCfg.reg = reg;
349 rgrCfgElem->rgrCfg.pool = pool;
350 rgrCfgElem->rgrCfg.rgrCfgReq = rgrCfgReq;
351 rgrCfgElem->cfgReqLstEnt.prev = NULLP;
352 rgrCfgElem->cfgReqLstEnt.next = NULLP;
353 rgrCfgElem->cfgReqLstEnt.node = (PTR )rgrCfgElem;
355 /* Add configuration element to current/pending cfgLst */
356 if (((rgrCfgReq->action == RGR_RECONFIG) &&
357 (rgrCfgReq->u.recfgInfo.recfgType == RGR_CELL_CFG) &&
358 (rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.pres == TRUE)))
362 rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.actvTime;
364 /* Check if the activation time is valid */
365 if (actvTime.sfn >= RGSCH_MAX_SFN
366 || actvTime.slot >= RGSCH_NUM_SUB_FRAMES_5G)
368 DU_LOG("\nERROR --> SCH : Invalid activation time for RGR "
369 "config request: activation sfn %d activation slot %d current "
370 "sfn %d current slot %d", actvTime.sfn, actvTime.slot,
371 cell->crntTime.sfn, cell->crntTime.slot);
372 /* ccpu00117052 - MOD - Passing double pointer
373 for proper NULLP assignment*/
374 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
378 sfDiff = RGSCH_CALC_SF_DIFF(actvTime, cell->crntTime);
380 if (sfDiff > (RGR_ACTV_WIN_SIZE * RGSCH_NUM_SUB_FRAMES_5G))
382 DU_LOG("\nERROR --> SCH : Invalid activation time for RGR"
383 " config request: activation sfn %d activation slot %d "
384 "current sfn %d current slot %d", actvTime.sfn,
385 actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot);
386 /* ccpu00117052 - MOD - Passing double pointer
387 for proper NULLP assignment*/
388 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
394 /* Add to pending cfgReqLst */
395 rgrCfgElem->actvTime = actvTime;
396 rgSCHDbmInsPndngRgrCfgElem(cell, rgrCfgElem);
397 /* Cfm to be sent only after applying request */
402 /* Add to current cfgReq list */
403 rgSCHDbmInsCrntRgrCfgElem(cell, rgrCfgElem);
404 /* Cfm to be sent only after applying request */
406 } /* rgSCHGomEnqCfgReq */
410 * @brief Handler for TTI processing for configurations recieved from RRM.
414 * Function: rgSCHGomTtiHndlr
416 * This API does TTI processing for configurations recieved from RRM.
419 * - It dequeues config request from the current configuration list.
420 * For each config request in the list:
421 * - Processes the request. Call rgSCHGomCfgReq.
422 * - It dequeues config request for the current tti from the pending
423 * configuration list. For each config request in the list:
424 * - Processes the request. Call rgSCHGomCfgReq.
426 * @param[in] RgSchCellCb *cell
431 S16 rgSCHGomTtiHndlr(RgSchCellCb *cell,SpId spId)
433 RgSchCfgElem *cfgElem;
434 Inst inst= cell->instIdx;
436 /* Dequeue from current config list */
437 while ((cfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
439 rgSCHDbmDelCrntRgrCfgElem(cell, cfgElem);
440 rgSCHGomCfgReq(cfgElem->rgrCfg.reg,cfgElem->rgrCfg.pool,
441 &rgSchCb[inst], cfgElem->rgrCfg.transId,
442 cfgElem->rgrCfg.rgrCfgReq);
443 /* ccpu00117052 - MOD - Passing double pointer
444 for proper NULLP assignment*/
445 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
448 /* Handle config requests from pending config list */
449 while((cfgElem = rgSCHDbmGetPndngRgrCfgElemByKey(cell, cell->crntTime)) != NULLP)
451 rgSCHDbmDelPndngRgrCfgElem(cell, cfgElem);
452 rgSCHGomCfgReq(cfgElem->rgrCfg.reg, cfgElem->rgrCfg.pool,
453 &rgSchCb[inst], cfgElem->rgrCfg.transId,
454 cfgElem->rgrCfg.rgrCfgReq);
455 /* ccpu00117052 - MOD - Passing double pointer
456 for proper NULLP assignment*/
457 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
465 * @brief Handler to handle configuration request from RRM to MAC.
469 * Function: rgSCHGomHndlCfgReq
471 * This API handles processing for configuration request from RRM to MAC.
473 * - Processing Steps:
474 * - Validate configuration request parameters at CFG module.
475 * Call rgSCHCfgVldtRgrCellCfg for cell configuration.
476 * - If validated successfully, send configuration request to CFG.
477 * Call rgSCHCfgRgrCellCfg else FAIL.
479 * @param[in] RgSchCb *instCb
480 * @param[in] SpId spId
481 * @param[in] RgrCfg *cfg
482 * @param[out] RgSchErrInfo *errInfo
487 static S16 rgSCHGomHndlCfgReq(RgSchCb *instCb,SpId spId,RgrCfg *cfg,RgSchErrInfo *errInfo)
490 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
491 Inst inst = (instCb->rgSchInit.inst );
494 errInfo->errType = RGSCHERR_GOM_CFG_REQ;
496 /* Validate and process the configuration request */
497 switch (cfg->cfgType)
501 ret = rgSCHCfgVldtRgrCellCfg(inst, &cfg->u.cellCfg, cell, errInfo);
504 DU_LOG("\nERROR --> SCH : Rgr Cell configuration "
505 "validation FAILED: Cell %d", cfg->u.cellCfg.cellId);
508 ret = rgSCHCfgRgrCellCfg(instCb, spId, &cfg->u.cellCfg, errInfo);
512 case RGR_SCELL_UE_CFG:
514 ret = rgSCHCfgVldtRgrUeCfg(inst, &cfg->u.ueCfg, &cell, errInfo);
517 DU_LOG("\nERROR --> SCH : Ue configuration validation"
518 " FAILED: CRNTI:%d", cfg->u.ueCfg.crnti);
521 ret = rgSCHCfgRgrUeCfg(cell, &cfg->u.ueCfg, errInfo);
526 ret = rgSCHCfgVldtRgrLcCfg(inst, &cfg->u.lchCfg, &cell, &ue, errInfo);
529 DU_LOG("\nERROR --> SCH : LC configuration validation "
530 "FAILED: LCID:%d", cfg->u.lchCfg.lcId);
533 ret = rgSCHCfgRgrLchCfg(cell, ue, &cfg->u.lchCfg, errInfo);
538 ret = rgSCHCfgVldtRgrLcgCfg(inst, &cfg->u.lcgCfg, &cell, &ue, errInfo);
541 DU_LOG("\nERROR --> SCH : LCG configuration validation "
542 "FAILED: LCGID:%d", cfg->u.lcgCfg.ulInfo.lcgId);
545 ret = rgSCHCfgRgrLcgCfg(cell, ue, &cfg->u.lcgCfg, errInfo);
550 ret = rgSCHCfgVldtRgrSchedEnbCfg(inst, &cfg->u.schedEnbCfg, errInfo);
553 DU_LOG("\nERROR --> SCH : SCH ENB configuration validation FAILED: \n");
556 ret = rgSCHCfgRgrSchedEnbCfg(inst, spId, &cfg->u.schedEnbCfg, errInfo);
561 #if(ERRCLASS & ERRCLS_INT_PAR)
562 DU_LOG("\nERROR --> SCH : Should never come here: "
563 "cfgType %d", cfg->cfgType);
570 } /* rgSCHGomHndlCfgReq */
574 * @brief Handler to handle re-configuration request from RRM to MAC.
578 * Function: rgSCHGomHndlSCellActDeactReq
580 * This API handles processing for SCell Activation Request from RRM to SCH.
582 * - Processing Steps:
583 * - Validate sCell Actication request parameters at CFG module.
584 * - If validated successfully, send configuration request to CFG.
585 * - call activation function for each SCells configured
587 * @param[in] RgSchCb *instCb
588 * @param[in] SpId spId
589 * @param[in] RgrSCellActDeactEvnt *sCellActDeactEvnt
590 * @param[in] uint8_t action
591 * @param[out] RgSchErrInfo *errInfo
596 static S16 rgSCHGomHndlSCellActDeactReq(RgSchCb *instCb,SpId spId,RgrSCellActDeactEvnt *sCellActDeactEvnt,RgSchErrInf *errInfo,uint8_t action)
598 RgSchUeCb *ue = NULLP;
600 uint16_t sCellIdx = 0;
601 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
602 Inst inst = (instCb->rgSchInit.inst);
604 DU_LOG(("\nDEBUG --> SCH : Processing RGR SCell Actication request:"
605 "%d\n", sCellActDeactEvnt->crnti));
607 errInfo->errType = RGSCHERR_GOM_SCELL_REQ;
610 if ((ue = rgSCHDbmGetUeCb(cell, sCellActDeactEvnt->crnti)) == NULLP)
612 DU_LOG(("\nERROR --> SCH : [%d]UE: does not exist\n",
613 sCellActDeactEvnt->crnti));
617 for(idx = 0; idx < sCellActDeactEvnt->numOfSCells; idx++)
619 sCellIdx = sCellActDeactEvnt->sCellActDeactInfo[idx].sCellIdx;
621 if (ROK != (rgSCHSCellTrigActDeact(cell, ue, sCellIdx, action)))
623 DU_LOG("\nERROR --> SCH : SCell Actication failed"
624 "for UE [%d] with SCellIdx [%d]\n",
625 sCellActDeactEvnt->crnti, idx);
630 DU_LOG("\nINFO --> SCH : RGR Reconfiguration processed\n");
632 } /* rgSCHGomHndlSCellActDeactReq */
636 * @brief Handler to handle re-configuration request from RRM to MAC.
640 * Function: rgSCHGomHndlRecfgReq
642 * This API handles processing for re-configuration request from RRM to MAC.
644 * - Processing Steps:
645 * - Validate re-configuration request parameters at CFG module.
646 * Call rgSCHCfgVldtRgrCellRecfg for cell re-configuration.
647 * - If validated successfully, send configuration request to CFG.
648 * Call rgSCHCfgRgrCellRecfg else FAIL.
650 * @param[in] RgSchCb *instCb
651 * @param[in] SpId spId
652 * @param[in] RgrRecfg *recfg
653 * @param[out] RgSchErrInfo *errInfo
658 static S16 rgSCHGomHndlRecfgReq(RgSchCb *instCb,SpId spId,RgrRecfg *recfg,RgSchErrInfo *errInfo)
660 RgSchUeCb *ue = NULLP;
661 RgSchDlLcCb *dlLc = NULLP; /* PURIFY_FIX:UMR */
663 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
664 Inst inst = (instCb->rgSchInit.inst );
666 errInfo->errType = RGSCHERR_GOM_RECFG_REQ;
668 /* Validate and process the re-configuration request */
669 switch (recfg->recfgType)
673 ret = rgSCHCfgVldtRgrCellRecfg(inst, &recfg->u.cellRecfg, &cell,
677 DU_LOG("\nERROR --> SCH : Rgr Cell Recfg Validation "
681 ret = rgSCHCfgRgrCellRecfg(cell, &recfg->u.cellRecfg, errInfo);
685 case RGR_SCELL_UE_CFG:
687 ret = rgSCHCfgVldtRgrUeRecfg(inst, &recfg->u.ueRecfg, &cell, &ue, errInfo);
690 DU_LOG("\nERROR --> SCH : Ue Recfg Validation FAILED"
691 "OLD CRNTI:%d",recfg->u.ueRecfg.oldCrnti);
694 ret = rgSCHCfgRgrUeRecfg(cell, ue, &recfg->u.ueRecfg, errInfo);
699 ret = rgSCHCfgVldtRgrLchRecfg(inst, &recfg->u.lchRecfg, &cell, &ue,
703 DU_LOG("\nERROR --> SCH : Lc Recfg Validation FAILED"
704 "LCID:%d",recfg->u.lchRecfg.lcId);
707 ret = rgSCHCfgRgrLchRecfg(cell, ue, dlLc, &recfg->u.lchRecfg, errInfo);
712 ret = rgSCHCfgVldtRgrLcgRecfg(inst, &recfg->u.lcgRecfg, cell, &ue,
716 DU_LOG("\nERROR --> SCH : Lcg Recfg Validation FAILED"
717 "LCGID:%d",recfg->u.lcgRecfg.ulRecfg.lcgId);
720 ret = rgSCHCfgRgrLcgRecfg(cell, ue, &recfg->u.lcgRecfg, errInfo);
725 #if(ERRCLASS & ERRCLS_INT_PAR)
726 DU_LOG("\nERROR --> SCH : Should never come here: recfgType %d", recfg->recfgType);
733 } /* rgSCHGomHndlRecfgReq */
736 * @brief Handler to handle UE reset request from RRM to Scheduler.
740 * Function: rgSCHGomHndlResetReq
742 * This API handles processing for UE reset request from RRM to Scheduler.
744 * - Processing Steps:
745 * - Validate UE reset request parameters at CFG module.
746 * Call rgSCHCfgVldtRgrUeReset for UE reset.
747 * - If validated successfully, send UE reset request to CFG.
748 * Call rgSCHCfgRgrUeReset else FAIL.
750 * @param[in] RgrRst *rstInfo
751 * @param[out] RgSchErrInfo *errInfo
756 static S16 rgSCHGomHndlResetReq(RgSchCb *instCb,SpId spId,RgrRst *reset,RgSchErrInfo *errInfo)
759 RgSchCellCb *cell= instCb->rgrSap[spId].cell;
760 Inst inst = (instCb->rgSchInit.inst );
761 RgSchUeCb *ue = NULLP;
763 errInfo->errType = RGSCHERR_GOM_RESET_REQ;
765 /* Validate and process the UE reset request */
766 ret = rgSCHCfgVldtRgrUeReset(inst, reset, cell, &ue, errInfo);
769 DU_LOG("\nERROR --> SCH : Rgr UE Reset Validation FAILED"
770 "CRNTI:%d",reset->crnti);
774 ret = rgSCHCfgRgrUeReset(cell, ue, reset, errInfo);
777 DU_LOG("\nERROR --> SCH : Rgr UE Reset FAILED"
778 "CRNTI:%d",reset->crnti);
783 } /* rgSCHGomHndlResetReq */
787 * @brief Handler for processing Cell/Ue/Logical channel delete request
792 * Function: rgSCHGomHndlDelReq
794 * This API handles processing of delete request from RRM to MAC.
797 * - Fetch corresponding control block and pass it to CFG module.
798 * - If control block does not exist, FAIL.
800 * @param[in] RgSchCb *instCb
801 * @param[in] SpId spId
802 * @param[in] RgrDel *del
803 * @param[out] RgSchErrInfo *errInfo
808 static S16 rgSCHGomHndlDelReq(RgSchCb *instCb,SpId spId,RgrDel *del,RgSchErrInfo *errInfo)
812 volatile uint32_t startTime=0;
814 errInfo->errType = RGSCHERR_GOM_DEL_REQ;
816 if(instCb->rgrSap[spId].cell == NULLP)
818 DU_LOG("\nERROR --> SCH : Cell doesnt exist");
822 /* Process the delete request */
823 switch (del->delType)
827 ret = rgSCHCfgRgrCellDel(instCb->rgrSap[spId].cell, del, errInfo);
830 /* TODO::Needs to be revisited after tti flow CaDev Start */
831 uint8_t idx = (uint8_t)((instCb->rgrSap[spId].cell->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
832 instCb->cells[idx] = NULLP;
834 instCb->rgrSap[spId].cell = NULLP;
835 instCb->tfuSap[spId].cell = NULLP;
840 case RGR_SCELL_UE_CFG:
844 SStartTask(&startTime, PID_SCH_UE_DEL);
846 ret = rgSCHCfgRgrUeDel(instCb->rgrSap[spId].cell, del, errInfo);
849 SStopTask(startTime, PID_SCH_UE_DEL);
855 ret = rgSCHCfgRgrLcDel(instCb->rgrSap[spId].cell, del, errInfo);
860 ret = rgSCHCfgRgrLcgDel(instCb->rgrSap[spId].cell, del, errInfo);
865 #if(ERRCLASS & ERRCLS_INT_PAR)
866 DU_LOG("\nERROR --> SCH : Should never come here: delType %d", del->delType);
873 } /* rgSCHGomHndlDelReq */
878 /***********************************************************
880 * Func : rgSCHGomGetCellIdFrmCfgReq
884 * - Processing Steps:
885 * - Retrieves the cell Id for a config request.
887 * @param[in] RgrCfgReqInfo *rgrCfgReq
888 * @param[out] CmLteCellId *cellId
889 * Ret : ROK on fetching cellId
894 * File : rg_sch_gom.c
896 **********************************************************/
897 static S16 rgSCHGomGetCellIdFrmCfgReq(RgrCfgReqInfo *rgrCfgReq,CmLteCellId *cellId)
900 /* Extract CellId depending on the action and Config Type in the Request
901 * As of now this function is called for only re configuration so removed
902 * othe CASES below if needed we can add them*/
903 switch (rgrCfgReq->action)
907 if (rgrCfgReq->u.recfgInfo.recfgType ==RGR_CELL_CFG)
909 *cellId = rgrCfgReq->u.recfgInfo.u.cellRecfg.cellId;
911 else if ((rgrCfgReq->u.recfgInfo.recfgType == RGR_SCELL_UE_CFG) ||
912 (rgrCfgReq->u.recfgInfo.recfgType == RGR_UE_CFG))
914 *cellId = rgrCfgReq->u.recfgInfo.u.ueRecfg.cellId;
916 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCH_CFG)
918 *cellId = rgrCfgReq->u.recfgInfo.u.lchRecfg.cellId;
920 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCG_CFG)
922 *cellId = rgrCfgReq->u.recfgInfo.u.lcgRecfg.cellId;
934 } /* End of Switch */
937 } /* rgSCHGomGetCellIdFrmCfgReq */
941 * @brief Handler to handle SI configuration request from RRM to MAC.
945 * Function: rgSCHGomHndlSiCfg
947 * This API handles processing for SI configuration request from RRM to MAC.
949 * - Processing Steps:
950 * - Validate SI configuration request parameters at CFG module.
951 * Call rgSCHCfgVldtSiCfg for SI configuration.
952 * - If validated successfully, send configuration request to CFG.
953 * Call rgSCHCfgRgrCellCfg else FAIL.
955 * @param[in] Region reg
956 * @param[in] Pool pool
957 * @param[in] RgSchCb *instCb
958 * @param[in] SpId spId
959 * @param[in] RgrCfgTransId transId
960 * @param[in] RgrSiCfgReqInfo *cfgReqInfo
965 S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrSiCfgReqInfo *cfgReqInfo)
968 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
969 Inst inst = (instCb->rgSchInit.inst );
970 RgSchErrInfo errInfo;
971 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
972 MsgLen msgLen = 0, pduLen;
978 /* check if cell does not exists */
979 if (((uint8_t *)cell == NULLP) || (cell->cellId != cfgReqInfo->cellId))
981 DU_LOG("\nERROR --> SCH : Cell Control block does not exist");
982 RGSCH_FREE_MSG(cfgReqInfo->pdu);
983 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
985 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
989 /*Validate the received SI configuration */
990 ret = rgSCHCfgVldtRgrSiCfg(inst, cfgReqInfo, cell, &errInfo);
993 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
994 "validation FAILED");
995 RGSCH_FREE_MSG(cfgReqInfo->pdu);
996 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
998 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1001 /*ccpu00140789: Stopping SI scheduling*/
1002 if(RGR_SI_STOP == cfgReqInfo->cfgType)
1004 if((cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)&&
1005 (cell->siCb.siArray[cfgReqInfo->siId-1].si != NULLP))
1007 cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1008 RGSCH_FREE_MSG(cell->siCb.siArray[cfgReqInfo->siId-1].si);
1009 cell->siCb.siArray[cfgReqInfo->siId-1].si = NULLP;
1010 if(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)
1012 RGSCH_FREE_MSG(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si);
1013 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1015 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1017 cfmStatus = RGR_CFG_CFM_OK;
1018 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1023 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1025 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1030 /* Check if the pdu sent from application
1031 * matches a transport block size. if not,
1032 * add padding bytes. This is usually done
1033 * by RRC but since we are bypassing RRC,
1034 * MAC is taking over that responsibility
1036 if ( RGR_SI_CFG_TYPE_MIB != cfgReqInfo->cfgType )
1038 SFndLenMsg(cfgReqInfo->pdu, &msgLen);
1040 /* check if the application pdu matches a tb size */
1041 tbSz = rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs);
1043 if ( tbSz != (msgLen*8) )
1045 MsgLen nmPadBytes = 0;
1046 Data* padding = NULLP;
1048 /* need to add padding bytes */
1049 nmPadBytes = (tbSz - (msgLen*8))/8;
1051 if ( SGetSBuf(reg,pool,&padding,nmPadBytes) != ROK)
1053 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
1054 "SGetSBuf failed for padding failed");
1055 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1057 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1062 memset(padding,0,nmPadBytes);
1064 #ifdef MS_MBUF_CORRUPTION
1065 MS_BUF_ADD_ALLOC_CALLER();
1067 if ( SAddPstMsgMult((Data*)padding,nmPadBytes,cfgReqInfo->pdu) != ROK)
1069 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
1070 "Failed to add padding bytes");
1071 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1073 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1075 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1079 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1081 }/* if (tbSz != ...*/
1082 }/* if (RGR_SI_CFG_TYPE_SI...*/
1084 /*Set the received pdu at the appropriate place */
1085 switch(cfgReqInfo->cfgType)
1087 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
1088 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.mib,
1089 cell->siCb.newSiInfo.mib,
1090 cfgReqInfo->pdu, cell->siCb.siBitMask,
1094 case RGR_SI_CFG_TYPE_SIB1_PWS:
1096 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1097 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1100 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1102 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1103 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1105 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1110 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1111 cell->siCb.newSiInfo.sib1Info.sib1,
1112 cfgReqInfo->pdu, cell->siCb.siBitMask,
1113 RGSCH_SI_SIB1_PWS_UPD);
1117 case RGR_SI_CFG_TYPE_SIB1:
1118 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1119 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1122 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1124 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1125 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1127 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1131 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1132 cell->siCb.newSiInfo.sib1Info.sib1,
1133 cfgReqInfo->pdu, cell->siCb.siBitMask,
1137 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
1138 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1139 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1143 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1145 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1146 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1148 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1152 /* Si recfg, where numSi changes */
1153 if (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD)
1155 Buffer **newSiPdu = &cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si;
1156 if(*newSiPdu != NULLP)
1158 RGSCH_FREE_MSG(*newSiPdu);
1160 *newSiPdu = (Buffer *)cfgReqInfo->pdu;
1161 cell->siCb.siBitMask |= RGSCH_SI_SI_UPD;
1163 else /* Initial Si cfg or si recfg where numSi did not change */
1166 /* Initial Si cfg */
1167 if (cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si == NULLP)
1169 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1170 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1171 bitMask = RGSCH_SI_DFLT;
1175 bitMask = RGSCH_SI_SI_UPD;
1178 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1179 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si,
1181 cell->siCb.siBitMask, bitMask);
1185 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
1186 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1187 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1191 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1193 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1194 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1196 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1200 /* No need to wait for Modification period boundary */
1201 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1202 RGSCH_SET_SI_INFO(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1204 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1207 DU_LOG("\nERROR --> SCH : Invalid cfgType "
1209 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1210 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
1211 (Size)sizeof(*cfgReqInfo));
1213 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1218 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1220 cfmStatus = RGR_CFG_CFM_OK;
1221 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1225 } /* rgSCHGomHndlSiCfg */
1229 * @brief Handler to handle Warning SI configuration request from RRM to MAC.
1233 * Function: rgSCHGomHndlWarningSiCfg
1235 * This API handles processing for Warning SI configuration request from
1239 * @param[in] Region reg
1240 * @param[in] Pool pool
1241 * @param[in] RgSchCb *instCb
1242 * @param[in] SpId spId
1243 * @param[in] RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1248 S16 rgSCHGomHndlWarningSiCfg
1254 RgrCfgTransId transId,
1255 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1258 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1259 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
1261 uint8_t siId = warningSiCfgReqInfo->siId;
1262 uint8_t j, mcs=0, nPrb=0;
1263 RgSchWarningSiSeg *warningSiMsg;
1264 RgSchWarningSiPdu *pduNode;
1267 Bool freeNodeFound = FALSE;
1268 uint16_t siWinSize = 0;
1269 uint16_t minPeriod = 0;
1271 uint8_t isEmtc = warningSiCfgReqInfo->emtcEnable;
1277 rgSchEmtcGetSiWinPerd(cell, &siWinSize, &minPeriod);
1282 siWinSize = cell->siCfg.siWinSize;
1283 minPeriod = cell->siCfg.minPeriodicity;
1285 /* check if cell does not exists */
1286 if (((uint8_t *)cell == NULLP) ||
1287 (cell->cellId != warningSiCfgReqInfo->cellId) ||
1288 (warningSiCfgReqInfo->siId >
1289 ((minPeriod * 10)/siWinSize)))
1291 DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed for siId = %d"
1292 "warning cellID:%d",warningSiCfgReqInfo->siId,warningSiCfgReqInfo->cellId);
1293 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1294 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1295 sizeof(RgrWarningSiCfgReqInfo));
1296 warningSiCfgReqInfo = NULLP;
1297 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1302 /* Search for free index in WarningSi */
1303 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1305 if((cell->siCb.warningSi[idx].siId == 0 ||
1306 cell->siCb.warningSi[idx].siId == warningSiCfgReqInfo->siId))
1308 warningSiMsg = (RgSchWarningSiSeg *)&cell->siCb.warningSi[idx].warningSiMsg;
1310 /* Search for free SI node */
1311 /* ccpu00136659: CMAS ETWS design changes */
1312 if (warningSiMsg->segLstCp.first == NULLP) /* Free SI Node */
1314 warningSiMsg->transId = transId;
1315 pduNode = (RgSchWarningSiPdu *)&cell->siCb.warningSi[idx].
1316 warningSiMsg.pduNode;
1317 CM_LLIST_FIRST_NODE(&warningSiCfgReqInfo->siPduLst, node);
1320 /* Get the PDUs one by one from the received pduLst of warning
1321 * message and calculate the MCS and nPrb of each pdu once.
1322 * Store the pdu in warningSiMsg pduLst, which will be scheduled
1323 * later while sending warning message as part of SIB11/SIB12
1325 while((node != NULLP) && (j < RGR_MAX_WARNING_SI_SEG))
1328 pduNode[j].pdu = (Buffer *)node->node;
1329 if(pduNode[j].pdu != NULLP)
1331 SFndLenMsg(pduNode[j].pdu, &msgLen);
1332 /*Get the nPrb and mcs parametr values */
1334 if (rgSCHEmtcUtlGetAllwdCchTbSzForSI(msgLen*8) != (msgLen*8))
1336 if (rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs) != (msgLen*8))
1340 DU_LOG("\nERROR --> SCH : rgSCHGomHndlWarningSiCfg():msgLen does not match\
1341 any valid TB Size.");
1342 DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed"
1343 "for siId = %d", warningSiCfgReqInfo->siId);
1344 rgSCHUtlFreeWarningSiSeg(reg, pool,
1345 &warningSiCfgReqInfo->siPduLst);
1346 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1347 sizeof(RgrWarningSiCfgReqInfo));
1348 warningSiCfgReqInfo = NULLP;
1349 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId,
1350 siId, transId,cfmStatus);
1355 pduNode[j].mcs = mcs;
1356 pduNode[j].nPrb = nPrb;
1357 pduNode[j].msgLen = msgLen;
1358 /* ccpu00136659: CMAS ETWS design changes */
1359 cmLListAdd2Tail(&warningSiMsg->segLstCp, &pduNode[j].lnk);
1360 pduNode[j].lnk.node = (PTR)&pduNode[j];
1365 /* ccpu00132385- nodes in received SI config linked list should
1366 * be freed after processing the config.*/
1367 while(warningSiCfgReqInfo->siPduLst.first != NULLP)
1369 node = warningSiCfgReqInfo->siPduLst.first;
1370 cmLListDelFrm(&(warningSiCfgReqInfo->siPduLst), node);
1371 SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList));
1375 cell->siCb.warningSi[idx].siId = warningSiCfgReqInfo->siId;
1376 cell->siCb.warningSi[idx].idx = idx;
1380 rgSCHEmtcWarningSiCfg(cell,warningSiCfgReqInfo,idx);
1385 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].si =
1386 &cell->siCb.warningSi[idx];
1387 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].isWarningSi =
1390 freeNodeFound = TRUE;
1396 if (freeNodeFound == FALSE)
1398 DU_LOG("\nDEBUG --> SCH : No SI Index is free");
1399 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1400 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1401 sizeof(RgrWarningSiCfgReqInfo));
1402 warningSiCfgReqInfo = NULLP;
1403 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1408 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1409 sizeof(RgrWarningSiCfgReqInfo));
1410 warningSiCfgReqInfo = NULLP;
1416 * @brief Handler to handle SI Stop request from RRM to MAC.
1420 * Function: rgSCHGomHndlWarningSiStopReq
1422 * This API handles processing for SI stop request from RRM to MAC.
1424 * @param[in] Region reg
1425 * @param[in] Pool pool
1426 * @param[in] RgSchCb *instCb
1427 * @param[in] SpId siId
1430 Void rgSCHGomHndlWarningSiStopReq(Region reg,Pool pool,RgSchCb *instCb,uint8_t siId,RgrCfgTransId transId,SpId spId)
1432 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1435 RgSchWarningSiPdu *warningSiPdu;
1438 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1440 if(cell->siCb.warningSi[idx].siId == siId)
1442 if ((cmMemcmp ((uint8_t *)&cell->siCb.warningSi[idx].warningSiMsg.transId,
1443 (uint8_t *)&transId, sizeof(RgrCfgTransId))) == 0)
1445 /* ccpu00136659: CMAS ETWS design changes */
1446 CM_LLIST_FIRST_NODE(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1447 while(node != NULLP)
1449 /* On receiving the warning stop message, remove one by one
1450 * each PDU from the warning SI list
1452 /* ccpu00136659: CMAS ETWS design changes */
1453 node = (CmLList *)&cell->siCb.warningSi[idx].warningSiMsg.segLstCp.first;
1454 warningSiPdu = (RgSchWarningSiPdu *)node->node;
1455 pdu = warningSiPdu->pdu;
1456 cmLListDelFrm(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1457 RGSCH_FREE_MSG(pdu);
1466 #endif/*RGR_SI_SCH */
1468 /* LTE_ADV_FLAG_REMOVED_START */
1471 * @brief This function sets the Phigh range for CC users corresponding to the CC Pool
1474 * Function: rgSchUpdtRNTPInfo
1476 * Invoked by: rgSCHGomHndlLoadInf
1478 * @param[in] RgSchCellCb* cell
1479 * @param[in] RgSubFrm* subFrm
1480 * @param[in] RgrLoadInfReqInfo *loadInfReq
1484 S16 rgSchUpdtRNTPInfo(RgSchCellCb *cell,RgSchDlSf *sf,RgrLoadInfReqInfo *loadInfReq)
1486 /* Initialise the variables */
1487 RgSchSFRPoolInfo *sfrCCPool;
1492 l = &sf->sfrTotalPoolInfo.ccPool;
1494 /*Get the first node from the CC Pool*/
1495 n = cmLListFirst(l);
1498 sfrCCPool = (RgSchSFRPoolInfo*)n->node;
1499 if (sfrCCPool->poolendRB == loadInfReq->rgrCcPHighEndRb)
1501 sfrCCPool->pwrHiCCRange.endRb = loadInfReq->rgrCcPHighEndRb;
1502 sfrCCPool->pwrHiCCRange.startRb = loadInfReq->rgrCcPHighStartRb;
1513 * @brief Handler to handle LOAD INF request from RRM to MAC.
1517 * Function: rgSCHGomHndlLoadInf
1519 * This API handles processing for LOAD INF request from RRM to MAC.
1521 * - Processing Steps:
1522 * - Validate LOAD INF request parameters at CFG module.
1523 * Call rgSCHCfgVldtRgrLoadInf for SI configuration.
1524 * - If validated successfully, send configuration request.
1526 * @param[in] Region reg
1527 * @param[in] Pool pool
1528 * @param[in] RgSchCb *instCb
1529 * @param[in] SpId spId
1530 * @param[in] RgrCfgTransId transId
1531 * @param[in] RgrLoadInfReqInfo *loadInfReq
1536 S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrLoadInfReqInfo *loadInfReq)
1539 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1540 Inst inst = (instCb->rgSchInit.inst );
1541 RgSchErrInfo errInfo;
1544 /* check if cell does not exists */
1545 if (((uint8_t *)cell == NULLP) || (cell->cellId != loadInfReq->cellId))
1547 DU_LOG("\nERROR --> SCH : Cell Control block does not exist"
1548 "for load cellId:%d",loadInfReq->cellId);
1549 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1553 if (cell->lteAdvCb.dsfrCfg.status == RGR_DISABLE)
1555 DU_LOG("\nERROR --> SCH : rgSCHGomHndlLoadInf(): DSFR Feature not enabled");
1556 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1559 /* Validate the received LOAD INF Configuration */
1560 ret = rgSCHCfgVldtRgrLoadInf(inst, loadInfReq, cell, &errInfo);
1563 DU_LOG("\nERROR --> SCH : Rgr LOAD INF Configuration "
1564 "validation FAILED");
1565 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1568 /* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be
1569 sent for the UEs scheduled in that particular RB range*/
1570 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
1572 if((rgSchUpdtRNTPInfo(cell, cell->subFrms[i], loadInfReq) != ROK))
1578 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1582 } /* rgSCHGomHndlLoadInf */
1583 /* LTE_ADV_FLAG_REMOVED_END */
1585 /**********************************************************************
1588 **********************************************************************/