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"
46 #include "rl_interface.h"
47 #include "rl_common.h"
49 /* header/extern include files (.x) */
53 #include "rg_sch_inf.x"
57 static S16 rgSCHGomHndlCfgReq ARGS((RgSchCb *instCb, SpId spId,
58 RgrCfg *cfg, RgSchErrInfo *errInfo));
59 static S16 rgSCHGomHndlRecfgReq ARGS((RgSchCb *instCb, SpId spId,
60 RgrRecfg *recfg, RgSchErrInfo *errInfo));
61 static S16 rgSCHGomHndlResetReq ARGS((RgSchCb *instCb,SpId spId,RgrRst *reset,
62 RgSchErrInfo *errInfo));
63 static S16 rgSCHGomGetCellIdFrmCfgReq ARGS((RgrCfgReqInfo *rgrCfgReq,
64 CmLteCellId *cellId));
65 static S16 rgSCHGomCfgReq ARGS((Region reg, Pool pool, RgSchCb *instCb,
66 RgrCfgTransId transId, RgrCfgReqInfo *cfgReqInfo));
67 static S16 rgSCHGomEnqCfgReq ARGS((Region reg, Pool pool, RgSchCellCb *cell,
68 RgrCfgTransId transId, RgrCfgReqInfo *rgrCfgReq));
69 static S16 rgSCHGomHndlDelReq ARGS((RgSchCb *instCb,SpId spId,
70 RgrDel *del,RgSchErrInfo *errInfo));
72 static S16 rgSCHGomHndlSCellActDeactReq ARGS((RgSchCb *instCb, SpId spId,
73 RgrSCellActDeactEvnt *sCellActDeactEvnt, RgSchErrInfo *errInfo, uint8_t action));
76 S16 rgSchEmtcGetSiWinPerd ARGS((
81 extern S16 rgSCHEmtcUtlCalMcsAndNPrb
89 S32 rgSCHEmtcUtlGetAllwdCchTbSzForSI ARGS(
94 Void rgSCHEmtcWarningSiCfg ARGS(
97 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo,
107 /* forward references */
112 * @brief Handler for config request from RRM to Schedular.
116 * Function: rgSCHGomHndlCfg
118 * This API is called from schedulers UIM and it handles config request
119 * from RRM to Scheduler.
122 * - If the request is for the inactive cell,
123 * - Handle request.Call rgSCHGomCfgReq.
125 * - Enqueue the request. Call rgSCHGomEnqCfgReq.
127 * @param[in] Pst *pst
128 * @param[in] RgSchCb *instCb
129 * @param[in] RgrCfgTransId transId
130 * @param[in] RgrCfgReqInfo *cfgReqInfo
135 S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo)
140 RgSchCellCb *cell = NULLP;
141 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
143 /* Apply the configuration for Cell Configuration or Delete */
144 if (cfgReqInfo->action != RGR_RECONFIG)
146 ret = rgSCHGomCfgReq (pst->region, pst->pool, instCb,
147 transId, cfgReqInfo);
151 /* Fetch the cell Id for the recieved request */
152 if((rgSCHGomGetCellIdFrmCfgReq(cfgReqInfo, &cellId)) != ROK)
154 DU_LOG("\nERROR --> SCH : Action.Config Type Error");
156 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
157 (Size)sizeof(*cfgReqInfo));
159 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
162 /* Extract the cell and Enquee Config Request */
163 if(NULLP != instCb->rgrSap[spId].cell)
165 if(cellId != instCb->rgrSap[spId].cell->cellId)
167 DU_LOG("\nERROR --> SCH : Cell with Id %d already exists "
168 "on sap %d", instCb->rgrSap[spId].cell->cellId, spId);
170 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
171 (Size)sizeof(*cfgReqInfo));
173 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
176 cell = instCb->rgrSap[spId].cell;
178 /* Enqueue the configuration */
179 ret = rgSCHGomEnqCfgReq(pst->region, pst->pool, cell, transId, cfgReqInfo);
182 DU_LOG("\nERROR --> SCH : rgSCHGomHndlCfg: Enqueuing CfgReq "
185 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
186 (Size)sizeof(*cfgReqInfo));
188 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
194 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
195 (Size)sizeof(*cfgReqInfo));
197 schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
200 }/* rgSCHGomHndlCfg */
204 * @brief Handler to handle config request from RRM to Scheduler.
208 * Function: rgSCHGomCfgReq
210 * This API handles processing for config request from RRM to Scheduler.
213 * - If Configuration request, call rgSCHGomHndlCfgReq.
214 * - Else if Reconfiguration request, call rgSCHGomHndlRecfgReq.
215 * - If successful, send configuration confirm to RRM.
216 * Call schSendCfgCfm else FAIL.
218 * @param[in] Region reg
219 * @param[in] Pool pool
220 * @param[in] RgSchCb *instCb
221 * @param[in] RgrCfgTransId transId
222 * @param[in] RgrCfgReqInfo *cfgReqInfo
227 static S16 rgSCHGomCfgReq(Region reg,Pool pool,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo)
230 uint8_t cfmStatus = RGR_CFG_CFM_OK;
232 RgSchErrInfo errInfo;
234 printf("\nDEBUG --> SCH: AT MAC rgSCHGomCfgReq \n");
237 /* Process Config/Reconfig/Delete request from RRM */
238 switch (cfgReqInfo->action)
242 ret = rgSCHGomHndlCfgReq(instCb, spId,
243 &cfgReqInfo->u.cfgInfo, &errInfo);
248 ret = rgSCHGomHndlRecfgReq(instCb, spId,
249 &cfgReqInfo->u.recfgInfo, &errInfo);
254 ret = rgSCHGomHndlResetReq(instCb, spId,
255 &cfgReqInfo->u.rstInfo, &errInfo);
260 ret = rgSCHGomHndlDelReq(instCb, spId,
261 &cfgReqInfo->u.delInfo, &errInfo);
266 case RGR_SCELL_DEACT:
267 case RGR_SCELL_READY:
269 ret = rgSCHGomHndlSCellActDeactReq(instCb, spId,
270 &cfgReqInfo->u.sCellActDeactEvnt, &errInfo, cfgReqInfo->action);
276 DU_LOG("\nERROR --> SCH : Invalid configuration "
277 "action %d", cfgReqInfo->action);
280 } /* End of switch */
284 cfmStatus = RGR_CFG_CFM_NOK;
287 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
288 (Size)sizeof(*cfgReqInfo));
291 printf("\nDEBUG --> SCH: AT MAC sending RGR cfg cfm \n");
294 /* Send back confirmation status to RRM */
295 schSendCfgCfm(reg, pool, transId, cfmStatus);
297 printf("\nDEBUG --> SCH: AT MAC RGR cfg cfm sent\n");
301 } /* rgSCHGomCfgReq */
305 * @brief Handler to enqueuing config request from RRM to Scheduler.
309 * Function: rgSCHGomEnqCfgReq
311 * This API enqueues config request from RRM to MAC.
314 * - Allocate the configuration request element.
315 * - Copy the contents of the recieved configuration to config request
316 * element and free the recieved configuration pointer.
317 * - If the configuration is without activation time,
318 * - Enqueue the request in crntRgrCfgLst of the cell at the end of
321 * - Enqueue the request in pndngRgrCfgLst of the cell.
323 * @param[in] Region reg,
324 * @param[in] Pool pool
325 * @param[in] RgSchCellCb *cell
326 * @param[in] RgrCfgTransId transId
327 * @param[in] RgrCfgReqInfo *rgrCfgReq
332 static S16 rgSCHGomEnqCfgReq(Region reg,Pool pool,RgSchCellCb *cell,RgrCfgTransId transId,RgrCfgReqInfo *rgrCfgReq)
336 RgSchCfgElem *rgrCfgElem = NULLP;
337 CmLteTimingInfo actvTime;
338 Inst inst = cell->instIdx;
340 /* Allocate memory for config Element */
341 ret = rgSCHUtlAllocSBuf(inst, (Data **)&rgrCfgElem, sizeof(RgSchCfgElem));
342 if ((ret != ROK) || ((uint8_t *)rgrCfgElem == NULLP))
347 /* Initialize the configuration element */
348 memcpy(rgrCfgElem->rgrCfg.transId.trans,transId.trans,
349 sizeof(transId.trans));
350 rgrCfgElem->rgrCfg.reg = reg;
351 rgrCfgElem->rgrCfg.pool = pool;
352 rgrCfgElem->rgrCfg.rgrCfgReq = rgrCfgReq;
353 rgrCfgElem->cfgReqLstEnt.prev = NULLP;
354 rgrCfgElem->cfgReqLstEnt.next = NULLP;
355 rgrCfgElem->cfgReqLstEnt.node = (PTR )rgrCfgElem;
357 /* Add configuration element to current/pending cfgLst */
358 if (((rgrCfgReq->action == RGR_RECONFIG) &&
359 (rgrCfgReq->u.recfgInfo.recfgType == RGR_CELL_CFG) &&
360 (rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.pres == TRUE)))
364 rgrCfgReq->u.recfgInfo.u.cellRecfg.recfgActvTime.actvTime;
366 /* Check if the activation time is valid */
367 if (actvTime.sfn >= RGSCH_MAX_SFN
368 || actvTime.slot >= RGSCH_NUM_SUB_FRAMES_5G)
370 DU_LOG("\nERROR --> SCH : Invalid activation time for RGR "
371 "config request: activation sfn %d activation slot %d current "
372 "sfn %d current slot %d", actvTime.sfn, actvTime.slot,
373 cell->crntTime.sfn, cell->crntTime.slot);
374 /* ccpu00117052 - MOD - Passing double pointer
375 for proper NULLP assignment*/
376 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
380 sfDiff = RGSCH_CALC_SF_DIFF(actvTime, cell->crntTime);
382 if (sfDiff > (RGR_ACTV_WIN_SIZE * RGSCH_NUM_SUB_FRAMES_5G))
384 DU_LOG("\nERROR --> SCH : Invalid activation time for RGR"
385 " config request: activation sfn %d activation slot %d "
386 "current sfn %d current slot %d", actvTime.sfn,
387 actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot);
388 /* ccpu00117052 - MOD - Passing double pointer
389 for proper NULLP assignment*/
390 rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
396 /* Add to pending cfgReqLst */
397 rgrCfgElem->actvTime = actvTime;
398 rgSCHDbmInsPndngRgrCfgElem(cell, rgrCfgElem);
399 /* Cfm to be sent only after applying request */
404 /* Add to current cfgReq list */
405 rgSCHDbmInsCrntRgrCfgElem(cell, rgrCfgElem);
406 /* Cfm to be sent only after applying request */
408 } /* rgSCHGomEnqCfgReq */
412 * @brief Handler for TTI processing for configurations recieved from RRM.
416 * Function: rgSCHGomTtiHndlr
418 * This API does TTI processing for configurations recieved from RRM.
421 * - It dequeues config request from the current configuration list.
422 * For each config request in the list:
423 * - Processes the request. Call rgSCHGomCfgReq.
424 * - It dequeues config request for the current tti from the pending
425 * configuration list. For each config request in the list:
426 * - Processes the request. Call rgSCHGomCfgReq.
428 * @param[in] RgSchCellCb *cell
433 S16 rgSCHGomTtiHndlr(RgSchCellCb *cell,SpId spId)
435 RgSchCfgElem *cfgElem;
436 Inst inst= cell->instIdx;
438 /* Dequeue from current config list */
439 while ((cfgElem = rgSCHDbmGetNextCrntRgrCfgElem(cell, NULLP)) != NULLP)
441 rgSCHDbmDelCrntRgrCfgElem(cell, cfgElem);
442 rgSCHGomCfgReq(cfgElem->rgrCfg.reg,cfgElem->rgrCfg.pool,
443 &rgSchCb[inst], cfgElem->rgrCfg.transId,
444 cfgElem->rgrCfg.rgrCfgReq);
445 /* ccpu00117052 - MOD - Passing double pointer
446 for proper NULLP assignment*/
447 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
450 /* Handle config requests from pending config list */
451 while((cfgElem = rgSCHDbmGetPndngRgrCfgElemByKey(cell, cell->crntTime)) != NULLP)
453 rgSCHDbmDelPndngRgrCfgElem(cell, cfgElem);
454 rgSCHGomCfgReq(cfgElem->rgrCfg.reg, cfgElem->rgrCfg.pool,
455 &rgSchCb[inst], cfgElem->rgrCfg.transId,
456 cfgElem->rgrCfg.rgrCfgReq);
457 /* ccpu00117052 - MOD - Passing double pointer
458 for proper NULLP assignment*/
459 rgSCHUtlFreeSBuf(inst, (Data **)&cfgElem, sizeof(*cfgElem));
467 * @brief Handler to handle configuration request from RRM to MAC.
471 * Function: rgSCHGomHndlCfgReq
473 * This API handles processing for configuration request from RRM to MAC.
475 * - Processing Steps:
476 * - Validate configuration request parameters at CFG module.
477 * Call rgSCHCfgVldtRgrCellCfg for cell configuration.
478 * - If validated successfully, send configuration request to CFG.
479 * Call rgSCHCfgRgrCellCfg else FAIL.
481 * @param[in] RgSchCb *instCb
482 * @param[in] SpId spId
483 * @param[in] RgrCfg *cfg
484 * @param[out] RgSchErrInfo *errInfo
489 static S16 rgSCHGomHndlCfgReq(RgSchCb *instCb,SpId spId,RgrCfg *cfg,RgSchErrInfo *errInfo)
492 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
493 Inst inst = (instCb->rgSchInit.inst );
496 errInfo->errType = RGSCHERR_GOM_CFG_REQ;
498 /* Validate and process the configuration request */
499 switch (cfg->cfgType)
503 ret = rgSCHCfgVldtRgrCellCfg(inst, &cfg->u.cellCfg, cell, errInfo);
506 DU_LOG("\nERROR --> SCH : Rgr Cell configuration "
507 "validation FAILED: Cell %d", cfg->u.cellCfg.cellId);
510 ret = rgSCHCfgRgrCellCfg(instCb, spId, &cfg->u.cellCfg, errInfo);
514 case RGR_SCELL_UE_CFG:
516 ret = rgSCHCfgVldtRgrUeCfg(inst, &cfg->u.ueCfg, &cell, errInfo);
519 DU_LOG("\nERROR --> SCH : Ue configuration validation"
520 " FAILED: CRNTI:%d", cfg->u.ueCfg.crnti);
523 ret = rgSCHCfgRgrUeCfg(cell, &cfg->u.ueCfg, errInfo);
528 ret = rgSCHCfgVldtRgrLcCfg(inst, &cfg->u.lchCfg, &cell, &ue, errInfo);
531 DU_LOG("\nERROR --> SCH : LC configuration validation "
532 "FAILED: LCID:%d", cfg->u.lchCfg.lcId);
535 ret = rgSCHCfgRgrLchCfg(cell, ue, &cfg->u.lchCfg, errInfo);
540 ret = rgSCHCfgVldtRgrLcgCfg(inst, &cfg->u.lcgCfg, &cell, &ue, errInfo);
543 DU_LOG("\nERROR --> SCH : LCG configuration validation "
544 "FAILED: LCGID:%d", cfg->u.lcgCfg.ulInfo.lcgId);
547 ret = rgSCHCfgRgrLcgCfg(cell, ue, &cfg->u.lcgCfg, errInfo);
552 ret = rgSCHCfgVldtRgrSchedEnbCfg(inst, &cfg->u.schedEnbCfg, errInfo);
555 DU_LOG("\nERROR --> SCH : SCH ENB configuration validation FAILED: \n");
558 ret = rgSCHCfgRgrSchedEnbCfg(inst, spId, &cfg->u.schedEnbCfg, errInfo);
563 #if(ERRCLASS & ERRCLS_INT_PAR)
564 DU_LOG("\nERROR --> SCH : Should never come here: "
565 "cfgType %d", cfg->cfgType);
572 } /* rgSCHGomHndlCfgReq */
576 * @brief Handler to handle re-configuration request from RRM to MAC.
580 * Function: rgSCHGomHndlSCellActDeactReq
582 * This API handles processing for SCell Activation Request from RRM to SCH.
584 * - Processing Steps:
585 * - Validate sCell Actication request parameters at CFG module.
586 * - If validated successfully, send configuration request to CFG.
587 * - call activation function for each SCells configured
589 * @param[in] RgSchCb *instCb
590 * @param[in] SpId spId
591 * @param[in] RgrSCellActDeactEvnt *sCellActDeactEvnt
592 * @param[in] uint8_t action
593 * @param[out] RgSchErrInfo *errInfo
598 static S16 rgSCHGomHndlSCellActDeactReq(RgSchCb *instCb,SpId spId,RgrSCellActDeactEvnt *sCellActDeactEvnt,RgSchErrInf *errInfo,uint8_t action)
600 RgSchUeCb *ue = NULLP;
602 uint16_t sCellIdx = 0;
603 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
604 Inst inst = (instCb->rgSchInit.inst);
606 DU_LOG(("\nDEBUG --> SCH : Processing RGR SCell Actication request:"
607 "%d\n", sCellActDeactEvnt->crnti));
609 errInfo->errType = RGSCHERR_GOM_SCELL_REQ;
612 if ((ue = rgSCHDbmGetUeCb(cell, sCellActDeactEvnt->crnti)) == NULLP)
614 DU_LOG(("\nERROR --> SCH : [%d]UE: does not exist\n",
615 sCellActDeactEvnt->crnti));
619 for(idx = 0; idx < sCellActDeactEvnt->numOfSCells; idx++)
621 sCellIdx = sCellActDeactEvnt->sCellActDeactInfo[idx].sCellIdx;
623 if (ROK != (rgSCHSCellTrigActDeact(cell, ue, sCellIdx, action)))
625 DU_LOG("\nERROR --> SCH : SCell Actication failed"
626 "for UE [%d] with SCellIdx [%d]\n",
627 sCellActDeactEvnt->crnti, idx);
632 DU_LOG("\nINFO --> SCH : RGR Reconfiguration processed\n");
634 } /* rgSCHGomHndlSCellActDeactReq */
638 * @brief Handler to handle re-configuration request from RRM to MAC.
642 * Function: rgSCHGomHndlRecfgReq
644 * This API handles processing for re-configuration request from RRM to MAC.
646 * - Processing Steps:
647 * - Validate re-configuration request parameters at CFG module.
648 * Call rgSCHCfgVldtRgrCellRecfg for cell re-configuration.
649 * - If validated successfully, send configuration request to CFG.
650 * Call rgSCHCfgRgrCellRecfg else FAIL.
652 * @param[in] RgSchCb *instCb
653 * @param[in] SpId spId
654 * @param[in] RgrRecfg *recfg
655 * @param[out] RgSchErrInfo *errInfo
660 static S16 rgSCHGomHndlRecfgReq(RgSchCb *instCb,SpId spId,RgrRecfg *recfg,RgSchErrInfo *errInfo)
662 RgSchUeCb *ue = NULLP;
663 RgSchDlLcCb *dlLc = NULLP; /* PURIFY_FIX:UMR */
665 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
666 Inst inst = (instCb->rgSchInit.inst );
668 errInfo->errType = RGSCHERR_GOM_RECFG_REQ;
670 /* Validate and process the re-configuration request */
671 switch (recfg->recfgType)
675 ret = rgSCHCfgVldtRgrCellRecfg(inst, &recfg->u.cellRecfg, &cell,
679 DU_LOG("\nERROR --> SCH : Rgr Cell Recfg Validation "
683 ret = rgSCHCfgRgrCellRecfg(cell, &recfg->u.cellRecfg, errInfo);
687 case RGR_SCELL_UE_CFG:
689 ret = rgSCHCfgVldtRgrUeRecfg(inst, &recfg->u.ueRecfg, &cell, &ue, errInfo);
692 DU_LOG("\nERROR --> SCH : Ue Recfg Validation FAILED"
693 "OLD CRNTI:%d",recfg->u.ueRecfg.oldCrnti);
696 ret = rgSCHCfgRgrUeRecfg(cell, ue, &recfg->u.ueRecfg, errInfo);
701 ret = rgSCHCfgVldtRgrLchRecfg(inst, &recfg->u.lchRecfg, &cell, &ue,
705 DU_LOG("\nERROR --> SCH : Lc Recfg Validation FAILED"
706 "LCID:%d",recfg->u.lchRecfg.lcId);
709 ret = rgSCHCfgRgrLchRecfg(cell, ue, dlLc, &recfg->u.lchRecfg, errInfo);
714 ret = rgSCHCfgVldtRgrLcgRecfg(inst, &recfg->u.lcgRecfg, cell, &ue,
718 DU_LOG("\nERROR --> SCH : Lcg Recfg Validation FAILED"
719 "LCGID:%d",recfg->u.lcgRecfg.ulRecfg.lcgId);
722 ret = rgSCHCfgRgrLcgRecfg(cell, ue, &recfg->u.lcgRecfg, errInfo);
727 #if(ERRCLASS & ERRCLS_INT_PAR)
728 DU_LOG("\nERROR --> SCH : Should never come here: recfgType %d", recfg->recfgType);
735 } /* rgSCHGomHndlRecfgReq */
738 * @brief Handler to handle UE reset request from RRM to Scheduler.
742 * Function: rgSCHGomHndlResetReq
744 * This API handles processing for UE reset request from RRM to Scheduler.
746 * - Processing Steps:
747 * - Validate UE reset request parameters at CFG module.
748 * Call rgSCHCfgVldtRgrUeReset for UE reset.
749 * - If validated successfully, send UE reset request to CFG.
750 * Call rgSCHCfgRgrUeReset else FAIL.
752 * @param[in] RgrRst *rstInfo
753 * @param[out] RgSchErrInfo *errInfo
758 static S16 rgSCHGomHndlResetReq(RgSchCb *instCb,SpId spId,RgrRst *reset,RgSchErrInfo *errInfo)
761 RgSchCellCb *cell= instCb->rgrSap[spId].cell;
762 Inst inst = (instCb->rgSchInit.inst );
763 RgSchUeCb *ue = NULLP;
765 errInfo->errType = RGSCHERR_GOM_RESET_REQ;
767 /* Validate and process the UE reset request */
768 ret = rgSCHCfgVldtRgrUeReset(inst, reset, cell, &ue, errInfo);
771 DU_LOG("\nERROR --> SCH : Rgr UE Reset Validation FAILED"
772 "CRNTI:%d",reset->crnti);
776 ret = rgSCHCfgRgrUeReset(cell, ue, reset, errInfo);
779 DU_LOG("\nERROR --> SCH : Rgr UE Reset FAILED"
780 "CRNTI:%d",reset->crnti);
785 } /* rgSCHGomHndlResetReq */
789 * @brief Handler for processing Cell/Ue/Logical channel delete request
794 * Function: rgSCHGomHndlDelReq
796 * This API handles processing of delete request from RRM to MAC.
799 * - Fetch corresponding control block and pass it to CFG module.
800 * - If control block does not exist, FAIL.
802 * @param[in] RgSchCb *instCb
803 * @param[in] SpId spId
804 * @param[in] RgrDel *del
805 * @param[out] RgSchErrInfo *errInfo
810 static S16 rgSCHGomHndlDelReq(RgSchCb *instCb,SpId spId,RgrDel *del,RgSchErrInfo *errInfo)
814 volatile uint32_t startTime=0;
816 errInfo->errType = RGSCHERR_GOM_DEL_REQ;
818 if(instCb->rgrSap[spId].cell == NULLP)
820 DU_LOG("\nERROR --> SCH : Cell doesnt exist");
824 /* Process the delete request */
825 switch (del->delType)
829 ret = rgSCHCfgRgrCellDel(instCb->rgrSap[spId].cell, del, errInfo);
832 /* TODO::Needs to be revisited after tti flow CaDev Start */
833 uint8_t idx = (uint8_t)((instCb->rgrSap[spId].cell->cellId - instCb->genCfg.startCellId)&(CM_LTE_MAX_CELLS-1));
834 instCb->cells[idx] = NULLP;
836 instCb->rgrSap[spId].cell = NULLP;
837 instCb->tfuSap[spId].cell = NULLP;
842 case RGR_SCELL_UE_CFG:
846 SStartTask(&startTime, PID_SCH_UE_DEL);
848 ret = rgSCHCfgRgrUeDel(instCb->rgrSap[spId].cell, del, errInfo);
851 SStopTask(startTime, PID_SCH_UE_DEL);
857 ret = rgSCHCfgRgrLcDel(instCb->rgrSap[spId].cell, del, errInfo);
862 ret = rgSCHCfgRgrLcgDel(instCb->rgrSap[spId].cell, del, errInfo);
867 #if(ERRCLASS & ERRCLS_INT_PAR)
868 DU_LOG("\nERROR --> SCH : Should never come here: delType %d", del->delType);
875 } /* rgSCHGomHndlDelReq */
880 /***********************************************************
882 * Func : rgSCHGomGetCellIdFrmCfgReq
886 * - Processing Steps:
887 * - Retrieves the cell Id for a config request.
889 * @param[in] RgrCfgReqInfo *rgrCfgReq
890 * @param[out] CmLteCellId *cellId
891 * Ret : ROK on fetching cellId
896 * File : rg_sch_gom.c
898 **********************************************************/
899 static S16 rgSCHGomGetCellIdFrmCfgReq(RgrCfgReqInfo *rgrCfgReq,CmLteCellId *cellId)
902 /* Extract CellId depending on the action and Config Type in the Request
903 * As of now this function is called for only re configuration so removed
904 * othe CASES below if needed we can add them*/
905 switch (rgrCfgReq->action)
909 if (rgrCfgReq->u.recfgInfo.recfgType ==RGR_CELL_CFG)
911 *cellId = rgrCfgReq->u.recfgInfo.u.cellRecfg.cellId;
913 else if ((rgrCfgReq->u.recfgInfo.recfgType == RGR_SCELL_UE_CFG) ||
914 (rgrCfgReq->u.recfgInfo.recfgType == RGR_UE_CFG))
916 *cellId = rgrCfgReq->u.recfgInfo.u.ueRecfg.cellId;
918 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCH_CFG)
920 *cellId = rgrCfgReq->u.recfgInfo.u.lchRecfg.cellId;
922 else if (rgrCfgReq->u.recfgInfo.recfgType == RGR_LCG_CFG)
924 *cellId = rgrCfgReq->u.recfgInfo.u.lcgRecfg.cellId;
936 } /* End of Switch */
939 } /* rgSCHGomGetCellIdFrmCfgReq */
943 * @brief Handler to handle SI configuration request from RRM to MAC.
947 * Function: rgSCHGomHndlSiCfg
949 * This API handles processing for SI configuration request from RRM to MAC.
951 * - Processing Steps:
952 * - Validate SI configuration request parameters at CFG module.
953 * Call rgSCHCfgVldtSiCfg for SI configuration.
954 * - If validated successfully, send configuration request to CFG.
955 * Call rgSCHCfgRgrCellCfg else FAIL.
957 * @param[in] Region reg
958 * @param[in] Pool pool
959 * @param[in] RgSchCb *instCb
960 * @param[in] SpId spId
961 * @param[in] RgrCfgTransId transId
962 * @param[in] RgrSiCfgReqInfo *cfgReqInfo
967 S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrSiCfgReqInfo *cfgReqInfo)
970 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
971 Inst inst = (instCb->rgSchInit.inst );
972 RgSchErrInfo errInfo;
973 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
974 MsgLen msgLen = 0, pduLen;
980 /* check if cell does not exists */
981 if (((uint8_t *)cell == NULLP) || (cell->cellId != cfgReqInfo->cellId))
983 DU_LOG("\nERROR --> SCH : Cell Control block does not exist");
984 RGSCH_FREE_MSG(cfgReqInfo->pdu);
985 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
987 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
991 /*Validate the received SI configuration */
992 ret = rgSCHCfgVldtRgrSiCfg(inst, cfgReqInfo, cell, &errInfo);
995 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
996 "validation FAILED");
997 RGSCH_FREE_MSG(cfgReqInfo->pdu);
998 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1000 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1003 /*ccpu00140789: Stopping SI scheduling*/
1004 if(RGR_SI_STOP == cfgReqInfo->cfgType)
1006 if((cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)&&
1007 (cell->siCb.siArray[cfgReqInfo->siId-1].si != NULLP))
1009 cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1010 RGSCH_FREE_MSG(cell->siCb.siArray[cfgReqInfo->siId-1].si);
1011 cell->siCb.siArray[cfgReqInfo->siId-1].si = NULLP;
1012 if(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si != NULLP)
1014 RGSCH_FREE_MSG(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si);
1015 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
1017 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1019 cfmStatus = RGR_CFG_CFM_OK;
1020 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1025 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1027 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1032 /* Check if the pdu sent from application
1033 * matches a transport block size. if not,
1034 * add padding bytes. This is usually done
1035 * by RRC but since we are bypassing RRC,
1036 * MAC is taking over that responsibility
1038 if ( RGR_SI_CFG_TYPE_MIB != cfgReqInfo->cfgType )
1040 SFndLenMsg(cfgReqInfo->pdu, &msgLen);
1042 /* check if the application pdu matches a tb size */
1043 tbSz = rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs);
1045 if ( tbSz != (msgLen*8) )
1047 MsgLen nmPadBytes = 0;
1048 Data* padding = NULLP;
1050 /* need to add padding bytes */
1051 nmPadBytes = (tbSz - (msgLen*8))/8;
1053 if ( SGetSBuf(reg,pool,&padding,nmPadBytes) != ROK)
1055 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
1056 "SGetSBuf failed for padding failed");
1057 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1059 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1064 memset(padding,0,nmPadBytes);
1066 #ifdef MS_MBUF_CORRUPTION
1067 MS_BUF_ADD_ALLOC_CALLER();
1069 if ( SAddPstMsgMult((Data*)padding,nmPadBytes,cfgReqInfo->pdu) != ROK)
1071 DU_LOG("\nERROR --> SCH : Rgr SI configuration "
1072 "Failed to add padding bytes");
1073 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1075 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1077 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1081 SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
1083 }/* if (tbSz != ...*/
1084 }/* if (RGR_SI_CFG_TYPE_SI...*/
1086 /*Set the received pdu at the appropriate place */
1087 switch(cfgReqInfo->cfgType)
1089 case RGR_SI_CFG_TYPE_MIB: /* SI CFG Type MIB */
1090 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.mib,
1091 cell->siCb.newSiInfo.mib,
1092 cfgReqInfo->pdu, cell->siCb.siBitMask,
1096 case RGR_SI_CFG_TYPE_SIB1_PWS:
1098 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1099 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1102 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1104 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1105 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1107 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1112 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1113 cell->siCb.newSiInfo.sib1Info.sib1,
1114 cfgReqInfo->pdu, cell->siCb.siBitMask,
1115 RGSCH_SI_SIB1_PWS_UPD);
1119 case RGR_SI_CFG_TYPE_SIB1:
1120 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1121 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0);
1124 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1126 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1127 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1129 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1133 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.sib1Info.sib1,
1134 cell->siCb.newSiInfo.sib1Info.sib1,
1135 cfgReqInfo->pdu, cell->siCb.siBitMask,
1139 case RGR_SI_CFG_TYPE_SI: /* SI CFG TYPE SI */
1140 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1141 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1145 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1147 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1148 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1150 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1154 /* Si recfg, where numSi changes */
1155 if (cell->siCb.siBitMask & RGSCH_SI_SICFG_UPD)
1157 Buffer **newSiPdu = &cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si;
1158 if(*newSiPdu != NULLP)
1160 RGSCH_FREE_MSG(*newSiPdu);
1162 *newSiPdu = (Buffer *)cfgReqInfo->pdu;
1163 cell->siCb.siBitMask |= RGSCH_SI_SI_UPD;
1165 else /* Initial Si cfg or si recfg where numSi did not change */
1168 /* Initial Si cfg */
1169 if (cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si == NULLP)
1171 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1172 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1173 bitMask = RGSCH_SI_DFLT;
1177 bitMask = RGSCH_SI_SI_UPD;
1180 RGSCHCHKNUPDSIPDU(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1181 cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si,
1183 cell->siCb.siBitMask, bitMask);
1187 case RGR_SI_CFG_TYPE_SIB8_CDMA: /* SI CFG TYPE SIB 8 CDMA */
1188 SFndLenMsg(cfgReqInfo->pdu, &pduLen);
1189 ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,
1193 DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB"
1195 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1196 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1198 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1202 /* No need to wait for Modification period boundary */
1203 cell->siCb.siArray[cfgReqInfo->siId-1].si = cfgReqInfo->pdu;
1204 RGSCH_SET_SI_INFO(cell->siCb.crntSiInfo.siInfo[cfgReqInfo->siId-1].si,
1206 cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE;
1209 DU_LOG("\nERROR --> SCH : Invalid cfgType "
1211 RGSCH_FREE_MSG(cfgReqInfo->pdu);
1212 SPutSBuf(reg, pool, (Data *)cfgReqInfo,
1213 (Size)sizeof(*cfgReqInfo));
1215 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId,
1220 SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
1222 cfmStatus = RGR_CFG_CFM_OK;
1223 rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
1227 } /* rgSCHGomHndlSiCfg */
1231 * @brief Handler to handle Warning SI configuration request from RRM to MAC.
1235 * Function: rgSCHGomHndlWarningSiCfg
1237 * This API handles processing for Warning SI configuration request from
1241 * @param[in] Region reg
1242 * @param[in] Pool pool
1243 * @param[in] RgSchCb *instCb
1244 * @param[in] SpId spId
1245 * @param[in] RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1250 S16 rgSCHGomHndlWarningSiCfg
1256 RgrCfgTransId transId,
1257 RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
1260 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1261 uint8_t cfmStatus = RGR_CFG_CFM_NOK;
1263 uint8_t siId = warningSiCfgReqInfo->siId;
1264 uint8_t j, mcs=0, nPrb=0;
1265 RgSchWarningSiSeg *warningSiMsg;
1266 RgSchWarningSiPdu *pduNode;
1269 Bool freeNodeFound = FALSE;
1270 uint16_t siWinSize = 0;
1271 uint16_t minPeriod = 0;
1273 uint8_t isEmtc = warningSiCfgReqInfo->emtcEnable;
1279 rgSchEmtcGetSiWinPerd(cell, &siWinSize, &minPeriod);
1284 siWinSize = cell->siCfg.siWinSize;
1285 minPeriod = cell->siCfg.minPeriodicity;
1287 /* check if cell does not exists */
1288 if (((uint8_t *)cell == NULLP) ||
1289 (cell->cellId != warningSiCfgReqInfo->cellId) ||
1290 (warningSiCfgReqInfo->siId >
1291 ((minPeriod * 10)/siWinSize)))
1293 DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed for siId = %d"
1294 "warning cellID:%d",warningSiCfgReqInfo->siId,warningSiCfgReqInfo->cellId);
1295 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1296 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1297 sizeof(RgrWarningSiCfgReqInfo));
1298 warningSiCfgReqInfo = NULLP;
1299 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1304 /* Search for free index in WarningSi */
1305 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1307 if((cell->siCb.warningSi[idx].siId == 0 ||
1308 cell->siCb.warningSi[idx].siId == warningSiCfgReqInfo->siId))
1310 warningSiMsg = (RgSchWarningSiSeg *)&cell->siCb.warningSi[idx].warningSiMsg;
1312 /* Search for free SI node */
1313 /* ccpu00136659: CMAS ETWS design changes */
1314 if (warningSiMsg->segLstCp.first == NULLP) /* Free SI Node */
1316 warningSiMsg->transId = transId;
1317 pduNode = (RgSchWarningSiPdu *)&cell->siCb.warningSi[idx].
1318 warningSiMsg.pduNode;
1319 CM_LLIST_FIRST_NODE(&warningSiCfgReqInfo->siPduLst, node);
1322 /* Get the PDUs one by one from the received pduLst of warning
1323 * message and calculate the MCS and nPrb of each pdu once.
1324 * Store the pdu in warningSiMsg pduLst, which will be scheduled
1325 * later while sending warning message as part of SIB11/SIB12
1327 while((node != NULLP) && (j < RGR_MAX_WARNING_SI_SEG))
1330 pduNode[j].pdu = (Buffer *)node->node;
1331 if(pduNode[j].pdu != NULLP)
1333 SFndLenMsg(pduNode[j].pdu, &msgLen);
1334 /*Get the nPrb and mcs parametr values */
1336 if (rgSCHEmtcUtlGetAllwdCchTbSzForSI(msgLen*8) != (msgLen*8))
1338 if (rgSCHUtlGetAllwdCchTbSz(msgLen*8, &nPrb, &mcs) != (msgLen*8))
1342 DU_LOG("\nERROR --> SCH : rgSCHGomHndlWarningSiCfg():msgLen does not match\
1343 any valid TB Size.");
1344 DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed"
1345 "for siId = %d", warningSiCfgReqInfo->siId);
1346 rgSCHUtlFreeWarningSiSeg(reg, pool,
1347 &warningSiCfgReqInfo->siPduLst);
1348 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1349 sizeof(RgrWarningSiCfgReqInfo));
1350 warningSiCfgReqInfo = NULLP;
1351 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId,
1352 siId, transId,cfmStatus);
1357 pduNode[j].mcs = mcs;
1358 pduNode[j].nPrb = nPrb;
1359 pduNode[j].msgLen = msgLen;
1360 /* ccpu00136659: CMAS ETWS design changes */
1361 cmLListAdd2Tail(&warningSiMsg->segLstCp, &pduNode[j].lnk);
1362 pduNode[j].lnk.node = (PTR)&pduNode[j];
1367 /* ccpu00132385- nodes in received SI config linked list should
1368 * be freed after processing the config.*/
1369 while(warningSiCfgReqInfo->siPduLst.first != NULLP)
1371 node = warningSiCfgReqInfo->siPduLst.first;
1372 cmLListDelFrm(&(warningSiCfgReqInfo->siPduLst), node);
1373 SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList));
1377 cell->siCb.warningSi[idx].siId = warningSiCfgReqInfo->siId;
1378 cell->siCb.warningSi[idx].idx = idx;
1382 rgSCHEmtcWarningSiCfg(cell,warningSiCfgReqInfo,idx);
1387 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].si =
1388 &cell->siCb.warningSi[idx];
1389 cell->siCb.siArray[warningSiCfgReqInfo->siId-1].isWarningSi =
1392 freeNodeFound = TRUE;
1398 if (freeNodeFound == FALSE)
1400 DU_LOG("\nDEBUG --> SCH : No SI Index is free");
1401 rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
1402 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1403 sizeof(RgrWarningSiCfgReqInfo));
1404 warningSiCfgReqInfo = NULLP;
1405 rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId,
1410 SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo,
1411 sizeof(RgrWarningSiCfgReqInfo));
1412 warningSiCfgReqInfo = NULLP;
1418 * @brief Handler to handle SI Stop request from RRM to MAC.
1422 * Function: rgSCHGomHndlWarningSiStopReq
1424 * This API handles processing for SI stop request from RRM to MAC.
1426 * @param[in] Region reg
1427 * @param[in] Pool pool
1428 * @param[in] RgSchCb *instCb
1429 * @param[in] SpId siId
1432 Void rgSCHGomHndlWarningSiStopReq(Region reg,Pool pool,RgSchCb *instCb,uint8_t siId,RgrCfgTransId transId,SpId spId)
1434 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1437 RgSchWarningSiPdu *warningSiPdu;
1440 for(idx = 0; idx < RGR_MAX_NUM_WARNING_SI; idx++)
1442 if(cell->siCb.warningSi[idx].siId == siId)
1444 if ((cmMemcmp ((uint8_t *)&cell->siCb.warningSi[idx].warningSiMsg.transId,
1445 (uint8_t *)&transId, sizeof(RgrCfgTransId))) == 0)
1447 /* ccpu00136659: CMAS ETWS design changes */
1448 CM_LLIST_FIRST_NODE(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1449 while(node != NULLP)
1451 /* On receiving the warning stop message, remove one by one
1452 * each PDU from the warning SI list
1454 /* ccpu00136659: CMAS ETWS design changes */
1455 node = (CmLList *)&cell->siCb.warningSi[idx].warningSiMsg.segLstCp.first;
1456 warningSiPdu = (RgSchWarningSiPdu *)node->node;
1457 pdu = warningSiPdu->pdu;
1458 cmLListDelFrm(&cell->siCb.warningSi[idx].warningSiMsg.segLstCp, node);
1459 RGSCH_FREE_MSG(pdu);
1468 #endif/*RGR_SI_SCH */
1470 /* LTE_ADV_FLAG_REMOVED_START */
1473 * @brief This function sets the Phigh range for CC users corresponding to the CC Pool
1476 * Function: rgSchUpdtRNTPInfo
1478 * Invoked by: rgSCHGomHndlLoadInf
1480 * @param[in] RgSchCellCb* cell
1481 * @param[in] RgSubFrm* subFrm
1482 * @param[in] RgrLoadInfReqInfo *loadInfReq
1486 S16 rgSchUpdtRNTPInfo(RgSchCellCb *cell,RgSchDlSf *sf,RgrLoadInfReqInfo *loadInfReq)
1488 /* Initialise the variables */
1489 RgSchSFRPoolInfo *sfrCCPool;
1494 l = &sf->sfrTotalPoolInfo.ccPool;
1496 /*Get the first node from the CC Pool*/
1497 n = cmLListFirst(l);
1500 sfrCCPool = (RgSchSFRPoolInfo*)n->node;
1501 if (sfrCCPool->poolendRB == loadInfReq->rgrCcPHighEndRb)
1503 sfrCCPool->pwrHiCCRange.endRb = loadInfReq->rgrCcPHighEndRb;
1504 sfrCCPool->pwrHiCCRange.startRb = loadInfReq->rgrCcPHighStartRb;
1515 * @brief Handler to handle LOAD INF request from RRM to MAC.
1519 * Function: rgSCHGomHndlLoadInf
1521 * This API handles processing for LOAD INF request from RRM to MAC.
1523 * - Processing Steps:
1524 * - Validate LOAD INF request parameters at CFG module.
1525 * Call rgSCHCfgVldtRgrLoadInf for SI configuration.
1526 * - If validated successfully, send configuration request.
1528 * @param[in] Region reg
1529 * @param[in] Pool pool
1530 * @param[in] RgSchCb *instCb
1531 * @param[in] SpId spId
1532 * @param[in] RgrCfgTransId transId
1533 * @param[in] RgrLoadInfReqInfo *loadInfReq
1538 S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrLoadInfReqInfo *loadInfReq)
1541 RgSchCellCb *cell = instCb->rgrSap[spId].cell;
1542 Inst inst = (instCb->rgSchInit.inst );
1543 RgSchErrInfo errInfo;
1546 /* check if cell does not exists */
1547 if (((uint8_t *)cell == NULLP) || (cell->cellId != loadInfReq->cellId))
1549 DU_LOG("\nERROR --> SCH : Cell Control block does not exist"
1550 "for load cellId:%d",loadInfReq->cellId);
1551 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1555 if (cell->lteAdvCb.dsfrCfg.status == RGR_DISABLE)
1557 DU_LOG("\nERROR --> SCH : rgSCHGomHndlLoadInf(): DSFR Feature not enabled");
1558 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1561 /* Validate the received LOAD INF Configuration */
1562 ret = rgSCHCfgVldtRgrLoadInf(inst, loadInfReq, cell, &errInfo);
1565 DU_LOG("\nERROR --> SCH : Rgr LOAD INF Configuration "
1566 "validation FAILED");
1567 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1570 /* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be
1571 sent for the UEs scheduled in that particular RB range*/
1572 for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
1574 if((rgSchUpdtRNTPInfo(cell, cell->subFrms[i], loadInfReq) != ROK))
1580 SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
1584 } /* rgSCHGomHndlLoadInf */
1585 /* LTE_ADV_FLAG_REMOVED_END */
1587 /**********************************************************************
1590 **********************************************************************/