1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for Entry point functions
29 **********************************************************************/
31 /** @file rg_pom_scell.c
32 @brief This module does processing related to handling of SCell related function.
35 /* header include files -- defines (.h) */
36 #include "common_def.h"
41 #include "rg_sch_inf.h"
42 #include "rg_prg.h" /* PRG interface includes*/
47 /* header/extern include files (.x) */
52 #include "rg_sch_inf.x"
53 #include "rg_prg.x" /* PRG interface typedefs*/
54 #include "du_app_mac_inf.h"
57 #include "rg_pom_scell.x"
58 PRIVATE S16 rgPomVldtSCellDedLchCfg ARGS((
60 RgPrgUeSCellLchAddInfo *lcCfg,
64 PRIVATE S16 rgPomUeSCellDedLcCfg ARGS((RgCellCb *cell,
66 RgPrgUeSCellLchAddInfo *lcCfg
69 * @brief Handler for the Lch reconfiguration request from PMAC to SMAC.
73 * Function : RgPrgPMacSMacUeSCellLchModReq
76 * - calls the function for validating cell, uecb and lch sent by PMAC
77 * - Updates the lch recfg into ueCb.
78 * - If successful, add the control block to hash list of UEs for the cell
79 * else Rollback and FAIL.
82 * @param[in] RgPrgUeSCellLchModInfo *lchCfgCb
88 S16 RgPrgPMacSMacUeSCellLchModReq
91 RgPrgUeSCellLchModInfo *lchCfgCb
94 S16 RgPrgPMacSMacUeSCellLchModReq(pst, lchCfgCb)
96 RgPrgUeSCellLchModInfo *lchCfgCb;
99 RgPrgCfgCfmInfo cfgCfm;
100 Inst inst = pst->dstInst;
107 RGDBGPRM(inst,(rgPBuf(inst),
108 "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d lcId %d lcgId %d\n",
109 lchCfgCb->cellId, lchCfgCb->crnti,lchCfgCb->lcId,lchCfgCb->ulLchRecfg.lcgId));
111 cfgCfm.ueId = lchCfgCb->crnti;
112 cfgCfm.sCellId = lchCfgCb->cellId;
113 cfgCfm.status = PRG_CFG_CFM_OK;
114 cfgCfm.event = EVTPRGUESCELLLCHMODCFM;
115 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
117 ret = rgPomVltdModLch(inst,lchCfgCb, &cell, &ue,&ulLc);
120 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMAC SCell Lc Cfg failed:\
121 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
122 /* Set status as Not OK*/
123 cfgCfm.status = PRG_CFG_CFM_NOK;
127 ret = rgPomUeSCellLcMod(inst, ue, ulLc, lchCfgCb);
130 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
131 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
132 /* Set status as Not OK*/
133 cfgCfm.status = PRG_CFG_CFM_NOK;
137 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
138 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
140 /* Send positive confirmation to primary cell*/
141 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
143 } /* RgPrgPMacSMacUeSCellLchModReq */
147 * @brief A wrapper class to send the LCH Del req from PMAC to SMAC
151 * Function : rgPomSndUeSCellLchDelToSmac
154 * - Retrieve the cell control block.
156 * - Validate the range of values received in
158 * - Checks if the Ue has any scell added.
159 * - If validated successfully,
160 * - if SCells have been added ,then
161 * send the lchDel structure to update the same values to SMAC.
163 * - Else return RFAILED.
165 * @param[in] Inst inst
166 * @param[in] CrgDel *lcDel
167 * @param[in] Bool *isCfmRqrd
173 S16 rgPomSndUeSCellLchDelToSmac
180 S16 rgPomSndUeSCellLchDelToSmac(inst,lcDel,isCfmRqrd)
189 RgPrgUeSCellLchDelInfo delLcCb;
193 /* Fetch the Active cell */
194 if(((cell = rgCb[inst].cell) == NULLP) ||
195 (cell->cellId != lcDel->u.lchDel.cellId))
197 RGDBGERRNEW(inst,(rgPBuf(inst),
198 "[%d]Active Cell does not exist %d\n",
199 lcDel->u.lchDel.crnti, lcDel->u.lchDel.cellId));
203 RGDBGPRM(inst,(rgPBuf(inst),
204 "Filling SCell LCh Config : cellId %d ueId %d\n",
205 cell->cellId, cell->ueId));
207 if ((ue = rgDBMGetUeCb(cell, lcDel->u.lchDel.crnti)) == NULLP)
209 RGDBGERRNEW(inst,(rgPBuf(inst),
210 "[%d]Ue does not exist\n", lcDel->u.lchDel.crnti));
213 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
215 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
217 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
218 delLcCb.cellId = ue->sCelInfo[idx].sCellId;
219 delLcCb.crnti = lcDel->u.lchDel.crnti;
220 delLcCb.lcId = lcDel->u.lchDel.lcId;
221 delLcCb.dir = lcDel->u.lchDel.dir;
223 /* Get post structure of the cell to whom delLcCb needs to be sent
224 * And then send the lch recfg based on Mac instances */
225 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
226 RgPrgPMacSMacUeScellLchDel(&dstInstPst, &delLcCb);
235 * @brief A wrapper class to send the LCH reconfig req from PMAC to SMAC
239 * Function : rgPomSndUeSCellLchModToSmac
242 * - Retrieve the cell control block.
244 * - Validate the range of re-configured values recieved in
245 * re-configuration request.
246 * - Checks if the Ue has any scell added.
247 * - If validated successfully,
248 * - if SCells have been added ,then
249 * send the lchRecfg structure to update the same values to SMAC.
251 * - Else return RFAILED.
253 * @param[in] Inst inst
254 * @param[in] RgCellCb *cell
255 @param[in] RgUeCb *ue,
256 @param[in] CrgLchRecfg *lchRecfg,
257 @param[in] Bool *isCfmRqrd
263 S16 rgPomSndUeSCellLchModToSmac
268 CrgLchRecfg *lchRecfg,
272 S16 rgPomSndUeSCellLchModToSmac(inst, cell, ue, lchRecfg, isCfmRqrd)
276 CrgLchRecfg *lchRecfg;
282 RgPrgUeSCellLchModInfo lchCfgCb;
285 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
287 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
289 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
290 lchCfgCb.cellId = ue->sCelInfo[idx].sCellId;
291 lchCfgCb.crnti = lchRecfg->crnti;
292 lchCfgCb.lcId = lchRecfg->lcId;
293 lchCfgCb.ulLchRecfg.lcgId = lchRecfg->ulRecfg.lcgId;
295 /* Get post structure of the cell to whom lchCfgCb needs to be sent
296 * And then send the lch recfg based on Mac instances */
297 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
298 RgPrgPMacSMacUeScellLchMod(&dstInstPst, &lchCfgCb);
306 * @brief A wrapper class to send the LCH config req from PMAC to SMAC
310 * Function : rgPomSndUeSCellLchAddToSmac
313 * - Checks if the Ue has any scell added.
314 * - if SCells have been added ,then
315 * send the lchCfgCb structure to update the same values to SMAC.
317 * - Else return RFAILED.
319 * @param[in] Inst insg
321 * @param[in] RgCellCb *cell
322 * @paran[in] RgUeCb *ue
323 * @paran[in] CrgLchCfg *lchCfg
324 * @paran[in] Bool *isCfmRqrd
330 S16 rgPomSndUeSCellLchAddToSmac
339 S16 rgPomSndUeSCellLchAddToSmac(inst, cell, ue, lchCfg, isCfmRqrd)
349 RgPrgUeSCellLchAddInfo lchCfgCb;
352 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
354 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
356 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
357 lchCfgCb.cellId = ue->sCelInfo[idx].sCellId;
358 lchCfgCb.crnti = lchCfg->crnti;
359 lchCfgCb.lcId = lchCfg->lcId;
360 lchCfgCb.lcType = lchCfg->lcType;
361 lchCfgCb.dir = lchCfg->dir;
362 lchCfgCb.dlInfo.dlTrchType = lchCfg->dlInfo.dlTrchType;
363 lchCfgCb.ulInfo.ulTrchType = lchCfg->ulInfo.ulTrchType;
364 lchCfgCb.ulInfo.lcgId = lchCfg->ulInfo.lcgId;
366 lchCfgCb.qci = lchCfg->qci;
367 #endif /* LTE_L2_MEAS */
369 /* Get post structure of the cell to whom lchCfgCb needs to be sent
370 * And then send the lch recfg based on Mac instances */
371 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
372 RgPrgPMacSMacUeScellLchAdd(&dstInstPst, &lchCfgCb);
377 } /* rgPomSndUeSCellLchAddToSmac */
380 * @brief Handler for the Lch delete request from PMAC to SMAC.
384 * Function : RgPrgPMacSMacUeSCellLchDelReq
387 * - calls the function for validating cell, uecb and Lch sent by PMAC
388 * - If successful, delete the logical channel
389 * else Rollback and FAIL.
391 * @param[in] Pst *pst
392 * @param[in] RgPrgUeSCellLchDelInfo *lchCfgCb
398 S16 RgPrgPMacSMacUeSCellLchDelReq
401 RgPrgUeSCellLchDelInfo *delLcCb
404 S16 RgPrgPMacSMacUeSCellLchDelReq(pst, delLcCb)
406 RgPrgUeSCellLchDelInfo *delLcCb;
409 RgPrgCfgCfmInfo cfgCfm;
410 Inst inst = pst->dstInst;
418 RGDBGPRM(inst,(rgPBuf(inst),
419 "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n",
420 lchCfgCb->cellId, lchCfgCb->crnti));
422 cfgCfm.ueId = delLcCb->crnti;
423 cfgCfm.sCellId = delLcCb->cellId;
424 cfgCfm.status = PRG_CFG_CFM_OK;
425 cfgCfm.event = EVTPRGUESCELLLCHDELCFM;
426 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
428 ret = rgPomVltdDelLch(inst,delLcCb, &cell, &ue,&ulLc,&dlLc);
431 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMAC SCell Lc Cfg failed:\
432 cellId %d\n", delLcCb->crnti, delLcCb->cellId));
433 /* Set status as Not OK*/
434 cfgCfm.status = PRG_CFG_CFM_NOK;
438 ret = rgPomUeSCellLcDel(inst, delLcCb, ue, ulLc,dlLc);
441 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
442 cellId %d\n", delLcCb->crnti, delLcCb->cellId));
443 /* Set status as Not OK*/
444 cfgCfm.status = PRG_CFG_CFM_NOK;
448 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
449 cellId %d\n", delLcCb->crnti, delLcCb->cellId));
451 /* Send positive confirmation to primary cell*/
452 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
454 } /* RgPrgPMacSMacUeSCellLchDelReq */
458 * @brief Handler for the Lch configuration request from PMAC to SMAC.
462 * Function : RgPrgPMacSMacUeSCellLchAddReq
465 * - calls the function for validating cell, uecb and Lch sent by PMAC
466 * - Updates the lch recfg into ueCb.
467 * - If successful, add the control block to hash list of UEs for the cell
468 * else Rollback and FAIL.
470 * @param[in] Pst *pst
471 * @param[in] RgPrgLchRecfgInfo *lchCfgCb
477 S16 RgPrgPMacSMacUeSCellLchAddReq
480 RgPrgUeSCellLchAddInfo *lchCfgCb
483 S16 RgPrgPMacSMacUeSCellLchAddReq(pst, lchCfgCb)
485 RgPrgUeSCellLchAddInfo *lchCfgCb;
488 RgPrgCfgCfmInfo cfgCfm;
489 Inst inst = pst->dstInst;
495 RGDBGPRM(inst,(rgPBuf(inst),
496 "APPLYING UE SCELL CONFIG AT SMAC : cellId %d ueId %d\n",
497 lchCfgCb->cellId, lchCfgCb->crnti));
499 cfgCfm.ueId = lchCfgCb->crnti;
500 cfgCfm.sCellId = lchCfgCb->cellId;
501 cfgCfm.status = PRG_CFG_CFM_OK;
502 cfgCfm.event = EVTPRGUESCELLLCHADDCFM;
503 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
505 ret = rgPomVldtAddLch(inst,lchCfgCb, &cell, &ue);
508 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMAC SCell Lc Cfg failed:\
509 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
510 /* Set status as Not OK*/
511 cfgCfm.status = PRG_CFG_CFM_NOK;
515 ret = rgPomUeSCellLcAdd(inst, cell, ue, lchCfgCb);
518 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
519 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
520 /* Set status as Not OK*/
521 cfgCfm.status = PRG_CFG_CFM_NOK;
525 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
526 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
528 /* Send positive confirmation to primary cell*/
529 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
531 } /* RgPrgPMacSMacUeSCellLchAddReq */
533 * @brief Validates the logical channel configuration request from PMAC to SMAC.
537 * Function : rPommVldtAddLch
540 * - Validate the logical channel configuration request from PMAC to
541 * SMAC : validate if configured values are within the range.
542 * - If validated successfully,
543 * - Return ROK and pointer to cell and UE for dedicated logical channels.
547 * @param[in] Inst inst
548 * @param[in] RgPrgUeSCellLchAddInfo *lcCfg
549 * @param[out] RgCellCb **cell
550 * @param[out] RgUeCb **ue
559 RgPrgUeSCellLchAddInfo *lcCfg,
564 S16 rgPomVldtAddLch(inst,lcCfg, cell, ue)
566 RgPrgUeSCellLchAddInfo *lcCfg;
572 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC CONFIG: cellId %d ueId %d lcId %d\
573 cell %p ue %p\n", lcCfg->cellId, lcCfg->crnti, lcCfg->lcId,
574 (void*)*cell, (void*)*ue));
576 if (lcCfg->lcType == CM_LTE_LCH_DTCH || lcCfg->lcType == CM_LTE_LCH_DCCH)
578 /* Dedicated logical channels */
579 if ((rgPomVldtSCellDedLchCfg(inst,lcCfg, cell, ue)) != ROK)
581 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Validation for dedicated LC failed\n",
588 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Invalid logical channel type %d\n",\
589 lcCfg->crnti, lcCfg->lcType));
593 if ( lcCfg->qci < RG_QCI_MIN ||
594 lcCfg->qci > RG_QCI_MAX
597 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Invalid qci %x\n",
598 lcCfg->crnti, lcCfg->qci));
602 #endif /*LTE_L2_MEAS */
604 RGDBGINFONEW(inst,(rgPBuf(inst),"[%d]UEID CRG LCconfig validation done:cellId:%d lcId:%d\n",
605 lcCfg->crnti, lcCfg->cellId, lcCfg->lcId));
609 * @brief Handler for the logical channel configuration request from
614 * Function : rgPomUeSCellLcAdd
617 * - Update the dedicated logical channel Cb with the configured values.
618 * - If successful, return ROK else RFAILED.
620 * @param[in] Inst inst
621 * @param[in] RgCellCb *cell
622 * @param[in] RgUeCb *ue
623 * @param[in] CrgLchCfg *lcCfg
624 * @param[out] RgErrInfo *errInfo
630 S16 rgPomUeSCellLcAdd
635 RgPrgUeSCellLchAddInfo *lcCfg
638 S16 rgPomUeSCellLcAdd(inst,cell, ue, lcCfg)
642 RgPrgUeSCellLchAddInfo *lcCfg;
646 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING CRG LC CONFIG: cellId %d ueId %d\
647 lcId %d dir %d cell %p ue %p\n", lcCfg->cellId, lcCfg->crnti,
648 lcCfg->lcId, lcCfg->dir, (void*)cell, (void*)ue));
650 if ((rgPomUeSCellDedLcCfg(cell, ue, lcCfg)) != ROK)
652 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated logical channel configuration"
653 "failed in SCell%d\n", lcCfg->crnti, lcCfg->lcId));
657 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]SCell LC config done: cellId %d lcId %d\n",
658 lcCfg->crnti, lcCfg->cellId, lcCfg->lcId));
660 } /* rgPomUeSCellLcAdd */
662 /***********************************************************
664 * Func : rgPomVldtSCellDedLchCfg
667 * Desc : Validates dedicated logical channel configuration received from PMAC.
669 * @param[in] Inst inst
670 * @param[in] RgPrgUeScellLchAddInfo *lcCfg
671 * @param[in] RgCellCb **cell
672 * @param[in] RgUeCb **ue
682 **********************************************************/
684 PRIVATE S16 rgPomVldtSCellDedLchCfg
687 RgPrgUeSCellLchAddInfo *lcCfg,
692 PRIVATE S16 rgPomVldtSCellDedLchCfg(inst,lcCfg, cell, ue)
694 RgPrgUeSCellLchAddInfo *lcCfg;
699 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATING CRG DEDICATED LC CONFIG \n"));
702 /* Fetch the Active cell */
703 if (((*cell = rgCb[inst].cell) == NULLP)
704 || ((*cell)->cellId != lcCfg->cellId))
706 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist: Cell %d\n",
707 lcCfg->crnti, lcCfg->cellId));
712 if ((*ue = rgDBMGetUeCb(*cell, lcCfg->crnti)) == NULLP)
714 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE does not exist for dedicated logical"
715 "channel %d\n", lcCfg->crnti, lcCfg->lcId));
719 /* Validate logical channel Id */
720 /*if ((lcCfg->lcId < RG_DEDLC_MIN_LCID)
721 ||(lcCfg->lcId > RG_DEDLC_MAX_LCID))
723 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid logical channel Id %d\n",
724 lcCfg->crnti, lcCfg->lcId));
727 /* Validate downlink info */
728 if (lcCfg->dir & PRG_DIR_TX)
730 if (rgDBMGetDlDedLcCb((*ue), lcCfg->lcId) != NULLP)
732 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Dedicated DL LC %d already configured\n",
733 lcCfg->crnti, lcCfg->lcId));
739 /* Validate uplink info */
740 if (lcCfg->dir & PRG_DIR_RX)
742 if (lcCfg->ulInfo.lcgId > (RG_MAX_LCG_PER_UE - 1))
744 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Invalid lcgId for uplink logical"
745 "channel %d\n", lcCfg->crnti, lcCfg->ulInfo.lcgId));
748 if (rgDBMGetUlDedLcCb((*ue), lcCfg->lcId) != NULLP)
750 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Dedicated UL LC %d already configured\n",
751 lcCfg->crnti, lcCfg->lcId));
759 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid Direction %d \n",
760 lcCfg->crnti, lcCfg->dir));
764 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]Dedicated logical channel %d validated"
765 "for cell %d\n", lcCfg->crnti, lcCfg->lcId, lcCfg->cellId));
767 } /* rgPomVldtSCellDedLchCfg */
768 /***********************************************************
770 * Func : rgPomUeSCellDedLcCfg
773 * Desc : Validates dedicated logical channel configuration received from PMAC.
775 * @param[in] RgCellCb *cell
776 * @param[in] RgUeCb *ue
777 * @param[in] RgPrgUeSCellLchAddInfo *lcCfg
787 **********************************************************/
789 PRIVATE S16 rgPomUeSCellDedLcCfg
793 RgPrgUeSCellLchAddInfo *lcCfg
796 PRIVATE S16 rgPomUeSCellDedLcCfg(cell, ue, lcCfg)
799 RgPrgUeSCellLchAddInfo *lcCfg;
802 //Inst inst = cell->macInst - RG_INST_START;
803 //RGDBGPRM(inst,(rgPBuf(inst), "APPLYING DEDICATED LC CONFIG\n"));
805 /* Uplink/Bi-directional logical channel */
806 if (lcCfg->dir & PRG_DIR_RX)
809 rgDBMInsUlDedLcCb(ue, lcCfg->lcId, lcCfg->ulInfo.lcgId, lcCfg->qci);
810 cell->qciArray[lcCfg->qci].qci = lcCfg->qci;
811 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
813 rgAddToL2MeasPerQci(cell,lcCfg->qci);/*LTE_L2_MEAS_PHASE2*/
816 rgDBMInsUlDedLcCb(ue, lcCfg->lcId, lcCfg->ulInfo.lcgId);
820 /* Downlink/Bi-directional logical channel */
821 if (lcCfg->dir & PRG_DIR_TX)
823 rgDBMInsDlDedLcCb(ue, lcCfg->lcId);
825 RGDBGINFO(inst,(rgPBuf(inst), "Dedicated LC config done\n"));
828 } /* rgPomUeSCellDedLcCfg */
830 * @brief Function to validate SCellLchReCfg.
834 * Function : rgPomVltdModLch
837 * @param[in] inst instance number to fetch rgCb instance
838 * @param[in] lchCfg Cb lchCfg CB for validation
839 * @param[out] cell cell control block
840 * @param[out] RgCellCb **cell
841 * @param[out] RgUeCb **ue
842 * @param[out] RgUlLcCb **ulLc
850 RgPrgUeSCellLchModInfo *lchCfgCb,
856 S16 rgPomVltdModLch(inst, lchCfgCb, cell, ue, ulLc)
858 RgPrgUeSCellLchModInfo *lchCfgCb;
864 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC RECONFIG: cellId %d ueId %d \
865 lcId %d cell %p ue %p ulLc %p\n",lchCfgCb->cellId,
866 lchCfgCb->crnti,lchCfgCb->lcId, (void*)*cell, (void*)*ue,
869 if ((((*cell = rgCb[inst].cell)) == NULLP)
870 || ((*cell)->cellId != lchCfgCb->cellId))
872 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist %d\n",lchCfgCb->crnti, lchCfgCb->cellId));
875 /* Fetch the Ue for dedicated channels */
876 if ((*ue = rgDBMGetUeCb(*cell, lchCfgCb->crnti)) == NULLP)
878 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue does not exist for dedicated logical channel\n",
882 if ((*ulLc = rgDBMGetUlDedLcCb((*ue), lchCfgCb->lcId)) == NULLP)
884 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated UL LC does not exist %d\n",
885 lchCfgCb->crnti, lchCfgCb->lcId));
888 /* if (lchCfgCb->ulLchRecfg.lcgId > (RG_MAX_LCG_PER_UE - 1))
890 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid lcgId for uplink logical channel: lcg %d"
891 "lc %d\n",lchCfgCb->crnti, lchCfgCb->ulLchRecfg.lcgId, lchCfgCb->lcId));
895 } /*rgPomVltdModLch*/
897 * @brief Handler for the logical channel re-configuration request from
902 * Function : rgPomUeSCellLcMod
905 * - Update the dedicated logical channel Cb with the re-configured
907 * - If successful, return ROK else RFAILED.
909 * @param[in] Inst inst
910 * @param[in] RgUlUeCb *ue
911 * @param[in] RgUlLcCb *ulLc
912 * @param[in] RgPrgLchRecfgInfo *lchCfgCb
918 S16 rgPomUeSCellLcMod
923 RgPrgUeSCellLchModInfo *lchCfgCb
926 S16 rgPomUeSCellLcMod(inst,cell, ue, ulLc, lchCfgCb)
930 RgPrgUeSCellLchModInfo *lchCfgCb;
933 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING SMAC LC RECONFIG: cellId %d ueId %d\
935 lchCfgCb->cellId, lchCfgCb->crnti, lchCfgCb->lcId));
937 if (ulLc->lcgId != lchCfgCb->ulLchRecfg.lcgId)
939 rgDBMUpdUlDedLcCb(ue, ulLc, lchCfgCb->ulLchRecfg.lcgId);
942 RGDBGINFO(inst,(rgPBuf(inst), "LC %d of Ue %d of cell %d Reconfigured\n",
943 lchCfgCb->lcId, ue->ueId, cell->cellId));
945 } /* rgPomUeSCellLcMod */
947 * @brief Function to validate SCellLchDel.
951 * Function : rgPomVltdDelLch
954 * @param[in] inst instance number to fetch rgCb instance
955 * @param[in] lchCfg Cb lchCfg CB for validation
956 * @param[out] cell cell control block
957 * @param[out] RgCellCb **cell
958 * @param[out] RgUeCb **ue
959 * @param[out] RgUlLcCb **ulLc
967 RgPrgUeSCellLchDelInfo *delLcCb,
974 S16 rgPomVltdDelLch(inst, delLcCb, cell, ue, ulLc, dlLc)
976 RgPrgUeSCellLchDelInfo *delLcCb;
983 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC RECONFIG: cellId %d ueId %d \
984 lcId %d cell %p ue %p ulLc %p\n",delLcCb->cellId,
985 delLcCb->crnti,delLcCb->lcId, (void*)*cell, (void*)*ue,
988 if ((((*cell = rgCb[inst].cell)) == NULLP)
989 || ((*cell)->cellId != delLcCb->cellId))
991 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist %d\n",delLcCb->crnti, delLcCb->cellId));
994 /* Fetch the Ue for dedicated channels */
995 if ((*ue = rgDBMGetUeCb(*cell, delLcCb->crnti)) == NULLP)
997 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue does not exist for dedicated logical channel\n",
1001 if ((*ulLc = rgDBMGetUlDedLcCb((*ue), delLcCb->lcId)) == NULLP)
1003 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated UL LC does not exist %d\n",
1004 delLcCb->crnti, delLcCb->lcId));
1007 if ((*dlLc = rgDBMGetDlDedLcCb((*ue), delLcCb->lcId)) == NULLP)
1009 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]DL LC %d does not exist\n",
1010 delLcCb->crnti, delLcCb->lcId));
1014 } /*rgPomVltdDelLch*/
1016 * @brief Handler for the logical channel delete request from
1021 * Function : rgPomUeSCellLcDel
1024 * - Fetch the logical channel control block.
1025 * - Free the logical channel control block.
1026 * - If successful, return ROK else return RFAILED.
1028 * @param[in] Inst inst
1029 * @param[in] RgPrgUeSCellLchDelInfo *delLcCb
1030 * @param[in] RgUeCb *ue
1031 * @param[in] RgUlLcCb *ulLc
1037 S16 rgPomUeSCellLcDel
1040 RgPrgUeSCellLchDelInfo *delLcCb,
1046 S16 rgPomUeSCellLcDel(inst,delLcCb,ue,ulLc,dlLc)
1048 RgPrgUeSCellLchDelInfo *delLcCb;
1055 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING CRG LC DELETE: cellId %d ueId %d\
1056 lcId %d dir %d\n", delLcCb->cellId,
1057 delLcCb->crnti, delLcCb->lcId,
1061 /* Validate downlink info */
1062 if (delLcCb->dir & PRG_DIR_TX)
1064 rgDBMDelDlDedLcCb(ue, dlLc);
1068 /* Validate uplink info */
1069 if (delLcCb->dir & PRG_DIR_RX)
1071 rgDBMDelUlDedLcCb(ue, ulLc);
1077 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid direction %d for LC Delete\n",
1078 delLcCb->crnti, delLcCb->dir));
1081 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]UE's Logical channel %d deleted from cell %d\n",
1082 delLcCb->crnti, delLcCb->lcId,
1085 } /* rgPomUeSCellLcDel */
1087 /**********************************************************************
1090 **********************************************************************/