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 PUBLIC S16 RgPrgPMacSMacUeSCellLchModReq
91 RgPrgUeSCellLchModInfo *lchCfgCb
94 PUBLIC S16 RgPrgPMacSMacUeSCellLchModReq(pst, lchCfgCb)
96 RgPrgUeSCellLchModInfo *lchCfgCb;
99 RgPrgCfgCfmInfo cfgCfm;
100 Inst inst = pst->dstInst;
107 TRC2(RgPrgPMacSMacUeSCellLchModReq);
109 RGDBGPRM(inst,(rgPBuf(inst),
110 "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d lcId %d lcgId %d\n",
111 lchCfgCb->cellId, lchCfgCb->crnti,lchCfgCb->lcId,lchCfgCb->ulLchRecfg.lcgId));
113 cfgCfm.ueId = lchCfgCb->crnti;
114 cfgCfm.sCellId = lchCfgCb->cellId;
115 cfgCfm.status = PRG_CFG_CFM_OK;
116 cfgCfm.event = EVTPRGUESCELLLCHMODCFM;
117 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
119 ret = rgPomVltdModLch(inst,lchCfgCb, &cell, &ue,&ulLc);
122 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMAC SCell Lc Cfg failed:\
123 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
124 /* Set status as Not OK*/
125 cfgCfm.status = PRG_CFG_CFM_NOK;
129 ret = rgPomUeSCellLcMod(inst, ue, ulLc, lchCfgCb);
132 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
133 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
134 /* Set status as Not OK*/
135 cfgCfm.status = PRG_CFG_CFM_NOK;
139 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
140 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
142 /* Send positive confirmation to primary cell*/
143 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
145 } /* RgPrgPMacSMacUeSCellLchModReq */
149 * @brief A wrapper class to send the LCH Del req from PMAC to SMAC
153 * Function : rgPomSndUeSCellLchDelToSmac
156 * - Retrieve the cell control block.
158 * - Validate the range of values received in
160 * - Checks if the Ue has any scell added.
161 * - If validated successfully,
162 * - if SCells have been added ,then
163 * send the lchDel structure to update the same values to SMAC.
165 * - Else return RFAILED.
167 * @param[in] Inst inst
168 * @param[in] CrgDel *lcDel
169 * @param[in] Bool *isCfmRqrd
175 PUBLIC S16 rgPomSndUeSCellLchDelToSmac
182 PUBLIC S16 rgPomSndUeSCellLchDelToSmac(inst,lcDel,isCfmRqrd)
191 RgPrgUeSCellLchDelInfo delLcCb;
195 TRC2(rgPomSndUeSCellLchDelToSmac);
197 /* Fetch the Active cell */
198 if(((cell = rgCb[inst].cell) == NULLP) ||
199 (cell->cellId != lcDel->u.lchDel.cellId))
201 RGDBGERRNEW(inst,(rgPBuf(inst),
202 "[%d]Active Cell does not exist %d\n",
203 lcDel->u.lchDel.crnti, lcDel->u.lchDel.cellId));
207 RGDBGPRM(inst,(rgPBuf(inst),
208 "Filling SCell LCh Config : cellId %d ueId %d\n",
209 cell->cellId, cell->ueId));
211 if ((ue = rgDBMGetUeCb(cell, lcDel->u.lchDel.crnti)) == NULLP)
213 RGDBGERRNEW(inst,(rgPBuf(inst),
214 "[%d]Ue does not exist\n", lcDel->u.lchDel.crnti));
217 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
219 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
221 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
222 delLcCb.cellId = ue->sCelInfo[idx].sCellId;
223 delLcCb.crnti = lcDel->u.lchDel.crnti;
224 delLcCb.lcId = lcDel->u.lchDel.lcId;
225 delLcCb.dir = lcDel->u.lchDel.dir;
227 /* Get post structure of the cell to whom delLcCb needs to be sent
228 * And then send the lch recfg based on Mac instances */
229 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
230 RgPrgPMacSMacUeScellLchDel(&dstInstPst, &delLcCb);
239 * @brief A wrapper class to send the LCH reconfig req from PMAC to SMAC
243 * Function : rgPomSndUeSCellLchModToSmac
246 * - Retrieve the cell control block.
248 * - Validate the range of re-configured values recieved in
249 * re-configuration request.
250 * - Checks if the Ue has any scell added.
251 * - If validated successfully,
252 * - if SCells have been added ,then
253 * send the lchRecfg structure to update the same values to SMAC.
255 * - Else return RFAILED.
257 * @param[in] Inst inst
258 * @param[in] RgCellCb *cell
259 @param[in] RgUeCb *ue,
260 @param[in] CrgLchRecfg *lchRecfg,
261 @param[in] Bool *isCfmRqrd
267 PUBLIC S16 rgPomSndUeSCellLchModToSmac
272 CrgLchRecfg *lchRecfg,
276 PUBLIC S16 rgPomSndUeSCellLchModToSmac(inst, cell, ue, lchRecfg, isCfmRqrd)
280 CrgLchRecfg *lchRecfg;
286 RgPrgUeSCellLchModInfo lchCfgCb;
289 TRC2(rgPomSndUeSCellLchModToSmac);
291 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
293 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
295 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
296 lchCfgCb.cellId = ue->sCelInfo[idx].sCellId;
297 lchCfgCb.crnti = lchRecfg->crnti;
298 lchCfgCb.lcId = lchRecfg->lcId;
299 lchCfgCb.ulLchRecfg.lcgId = lchRecfg->ulRecfg.lcgId;
301 /* Get post structure of the cell to whom lchCfgCb needs to be sent
302 * And then send the lch recfg based on Mac instances */
303 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
304 RgPrgPMacSMacUeScellLchMod(&dstInstPst, &lchCfgCb);
312 * @brief A wrapper class to send the LCH config req from PMAC to SMAC
316 * Function : rgPomSndUeSCellLchAddToSmac
319 * - Checks if the Ue has any scell added.
320 * - if SCells have been added ,then
321 * send the lchCfgCb structure to update the same values to SMAC.
323 * - Else return RFAILED.
325 * @param[in] Inst insg
327 * @param[in] RgCellCb *cell
328 * @paran[in] RgUeCb *ue
329 * @paran[in] CrgLchCfg *lchCfg
330 * @paran[in] Bool *isCfmRqrd
336 PUBLIC S16 rgPomSndUeSCellLchAddToSmac
345 PUBLIC S16 rgPomSndUeSCellLchAddToSmac(inst, cell, ue, lchCfg, isCfmRqrd)
355 RgPrgUeSCellLchAddInfo lchCfgCb;
358 TRC2(rgPomSndUeSCellLchAddToSmac);
360 for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
362 if(TRUE == ue->sCelInfo[idx].isSCellAdded)
364 dstMacInst = ue->sCelInfo[idx].macInst - RG_INST_START;
365 lchCfgCb.cellId = ue->sCelInfo[idx].sCellId;
366 lchCfgCb.crnti = lchCfg->crnti;
367 lchCfgCb.lcId = lchCfg->lcId;
368 lchCfgCb.lcType = lchCfg->lcType;
369 lchCfgCb.dir = lchCfg->dir;
370 lchCfgCb.dlInfo.dlTrchType = lchCfg->dlInfo.dlTrchType;
371 lchCfgCb.ulInfo.ulTrchType = lchCfg->ulInfo.ulTrchType;
372 lchCfgCb.ulInfo.lcgId = lchCfg->ulInfo.lcgId;
374 lchCfgCb.qci = lchCfg->qci;
375 #endif /* LTE_L2_MEAS */
377 /* Get post structure of the cell to whom lchCfgCb needs to be sent
378 * And then send the lch recfg based on Mac instances */
379 rgGetPstToInst(&dstInstPst, inst, dstMacInst);
380 RgPrgPMacSMacUeScellLchAdd(&dstInstPst, &lchCfgCb);
385 } /* rgPomSndUeSCellLchAddToSmac */
388 * @brief Handler for the Lch delete request from PMAC to SMAC.
392 * Function : RgPrgPMacSMacUeSCellLchDelReq
395 * - calls the function for validating cell, uecb and Lch sent by PMAC
396 * - If successful, delete the logical channel
397 * else Rollback and FAIL.
399 * @param[in] Pst *pst
400 * @param[in] RgPrgUeSCellLchDelInfo *lchCfgCb
406 PUBLIC S16 RgPrgPMacSMacUeSCellLchDelReq
409 RgPrgUeSCellLchDelInfo *delLcCb
412 PUBLIC S16 RgPrgPMacSMacUeSCellLchDelReq(pst, delLcCb)
414 RgPrgUeSCellLchDelInfo *delLcCb;
417 RgPrgCfgCfmInfo cfgCfm;
418 Inst inst = pst->dstInst;
426 TRC2(RgPrgPMacSMacUeSCellLchDelReq);
428 RGDBGPRM(inst,(rgPBuf(inst),
429 "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n",
430 lchCfgCb->cellId, lchCfgCb->crnti));
432 cfgCfm.ueId = delLcCb->crnti;
433 cfgCfm.sCellId = delLcCb->cellId;
434 cfgCfm.status = PRG_CFG_CFM_OK;
435 cfgCfm.event = EVTPRGUESCELLLCHDELCFM;
436 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
438 ret = rgPomVltdDelLch(inst,delLcCb, &cell, &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 ret = rgPomUeSCellLcDel(inst, delLcCb, ue, ulLc,dlLc);
451 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
452 cellId %d\n", delLcCb->crnti, delLcCb->cellId));
453 /* Set status as Not OK*/
454 cfgCfm.status = PRG_CFG_CFM_NOK;
458 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
459 cellId %d\n", delLcCb->crnti, delLcCb->cellId));
461 /* Send positive confirmation to primary cell*/
462 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
464 } /* RgPrgPMacSMacUeSCellLchDelReq */
468 * @brief Handler for the Lch configuration request from PMAC to SMAC.
472 * Function : RgPrgPMacSMacUeSCellLchAddReq
475 * - calls the function for validating cell, uecb and Lch sent by PMAC
476 * - Updates the lch recfg into ueCb.
477 * - If successful, add the control block to hash list of UEs for the cell
478 * else Rollback and FAIL.
480 * @param[in] Pst *pst
481 * @param[in] RgPrgLchRecfgInfo *lchCfgCb
487 PUBLIC S16 RgPrgPMacSMacUeSCellLchAddReq
490 RgPrgUeSCellLchAddInfo *lchCfgCb
493 PUBLIC S16 RgPrgPMacSMacUeSCellLchAddReq(pst, lchCfgCb)
495 RgPrgUeSCellLchAddInfo *lchCfgCb;
498 RgPrgCfgCfmInfo cfgCfm;
499 Inst inst = pst->dstInst;
505 TRC2(RgPrgPMacSMacUeSCellLchAddReq);
507 RGDBGPRM(inst,(rgPBuf(inst),
508 "APPLYING UE SCELL CONFIG AT SMAC : cellId %d ueId %d\n",
509 lchCfgCb->cellId, lchCfgCb->crnti));
511 cfgCfm.ueId = lchCfgCb->crnti;
512 cfgCfm.sCellId = lchCfgCb->cellId;
513 cfgCfm.status = PRG_CFG_CFM_OK;
514 cfgCfm.event = EVTPRGUESCELLLCHADDCFM;
515 rgGetPstToInst(&cfmPst, inst, pst->srcInst);
517 ret = rgPomVldtAddLch(inst,lchCfgCb, &cell, &ue);
520 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMAC SCell Lc Cfg failed:\
521 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
522 /* Set status as Not OK*/
523 cfgCfm.status = PRG_CFG_CFM_NOK;
527 ret = rgPomUeSCellLcAdd(inst, cell, ue, lchCfgCb);
530 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d] SMac SCell lc cfg failed:\
531 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
532 /* Set status as Not OK*/
533 cfgCfm.status = PRG_CFG_CFM_NOK;
537 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d] Scell Lch Config done:\
538 cellId %d\n", lchCfgCb->crnti, lchCfgCb->cellId));
540 /* Send positive confirmation to primary cell*/
541 RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
543 } /* RgPrgPMacSMacUeSCellLchAddReq */
545 * @brief Validates the logical channel configuration request from PMAC to SMAC.
549 * Function : rPommVldtAddLch
552 * - Validate the logical channel configuration request from PMAC to
553 * SMAC : validate if configured values are within the range.
554 * - If validated successfully,
555 * - Return ROK and pointer to cell and UE for dedicated logical channels.
559 * @param[in] Inst inst
560 * @param[in] RgPrgUeSCellLchAddInfo *lcCfg
561 * @param[out] RgCellCb **cell
562 * @param[out] RgUeCb **ue
568 PUBLIC S16 rgPomVldtAddLch
571 RgPrgUeSCellLchAddInfo *lcCfg,
576 PUBLIC S16 rgPomVldtAddLch(inst,lcCfg, cell, ue)
578 RgPrgUeSCellLchAddInfo *lcCfg;
584 TRC2(rgPomVldtAddLch);
585 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC CONFIG: cellId %d ueId %d lcId %d\
586 cell %p ue %p\n", lcCfg->cellId, lcCfg->crnti, lcCfg->lcId,
587 (void*)*cell, (void*)*ue));
589 if (lcCfg->lcType == CM_LTE_LCH_DTCH || lcCfg->lcType == CM_LTE_LCH_DCCH)
591 /* Dedicated logical channels */
592 if ((rgPomVldtSCellDedLchCfg(inst,lcCfg, cell, ue)) != ROK)
594 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Validation for dedicated LC failed\n",
601 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Invalid logical channel type %d\n",\
602 lcCfg->crnti, lcCfg->lcType));
606 if ( lcCfg->qci < RG_QCI_MIN ||
607 lcCfg->qci > RG_QCI_MAX
610 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UEID Invalid qci %x\n",
611 lcCfg->crnti, lcCfg->qci));
615 #endif /*LTE_L2_MEAS */
617 RGDBGINFONEW(inst,(rgPBuf(inst),"[%d]UEID CRG LCconfig validation done:cellId:%d lcId:%d\n",
618 lcCfg->crnti, lcCfg->cellId, lcCfg->lcId));
622 * @brief Handler for the logical channel configuration request from
627 * Function : rgPomUeSCellLcAdd
630 * - Update the dedicated logical channel Cb with the configured values.
631 * - If successful, return ROK else RFAILED.
633 * @param[in] Inst inst
634 * @param[in] RgCellCb *cell
635 * @param[in] RgUeCb *ue
636 * @param[in] CrgLchCfg *lcCfg
637 * @param[out] RgErrInfo *errInfo
643 PUBLIC S16 rgPomUeSCellLcAdd
648 RgPrgUeSCellLchAddInfo *lcCfg
651 PUBLIC S16 rgPomUeSCellLcAdd(inst,cell, ue, lcCfg)
655 RgPrgUeSCellLchAddInfo *lcCfg;
659 TRC2(rgPomUeSCellLcAdd);
660 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING CRG LC CONFIG: cellId %d ueId %d\
661 lcId %d dir %d cell %p ue %p\n", lcCfg->cellId, lcCfg->crnti,
662 lcCfg->lcId, lcCfg->dir, (void*)cell, (void*)ue));
664 if ((rgPomUeSCellDedLcCfg(cell, ue, lcCfg)) != ROK)
666 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated logical channel configuration"
667 "failed in SCell%d\n", lcCfg->crnti, lcCfg->lcId));
671 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]SCell LC config done: cellId %d lcId %d\n",
672 lcCfg->crnti, lcCfg->cellId, lcCfg->lcId));
674 } /* rgPomUeSCellLcAdd */
676 /***********************************************************
678 * Func : rgPomVldtSCellDedLchCfg
681 * Desc : Validates dedicated logical channel configuration received from PMAC.
683 * @param[in] Inst inst
684 * @param[in] RgPrgUeScellLchAddInfo *lcCfg
685 * @param[in] RgCellCb **cell
686 * @param[in] RgUeCb **ue
696 **********************************************************/
698 PRIVATE S16 rgPomVldtSCellDedLchCfg
701 RgPrgUeSCellLchAddInfo *lcCfg,
706 PRIVATE S16 rgPomVldtSCellDedLchCfg(inst,lcCfg, cell, ue)
708 RgPrgUeSCellLchAddInfo *lcCfg;
713 TRC2(rgPomVldtSCellDedLchCfg);
714 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATING CRG DEDICATED LC CONFIG \n"));
717 /* Fetch the Active cell */
718 if (((*cell = rgCb[inst].cell) == NULLP)
719 || ((*cell)->cellId != lcCfg->cellId))
721 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist: Cell %d\n",
722 lcCfg->crnti, lcCfg->cellId));
727 if ((*ue = rgDBMGetUeCb(*cell, lcCfg->crnti)) == NULLP)
729 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE does not exist for dedicated logical"
730 "channel %d\n", lcCfg->crnti, lcCfg->lcId));
734 /* Validate logical channel Id */
735 /*if ((lcCfg->lcId < RG_DEDLC_MIN_LCID)
736 ||(lcCfg->lcId > RG_DEDLC_MAX_LCID))
738 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid logical channel Id %d\n",
739 lcCfg->crnti, lcCfg->lcId));
742 /* Validate downlink info */
743 if (lcCfg->dir & PRG_DIR_TX)
745 if (rgDBMGetDlDedLcCb((*ue), lcCfg->lcId) != NULLP)
747 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Dedicated DL LC %d already configured\n",
748 lcCfg->crnti, lcCfg->lcId));
754 /* Validate uplink info */
755 if (lcCfg->dir & PRG_DIR_RX)
757 if (lcCfg->ulInfo.lcgId > (RG_MAX_LCG_PER_UE - 1))
759 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Invalid lcgId for uplink logical"
760 "channel %d\n", lcCfg->crnti, lcCfg->ulInfo.lcgId));
763 if (rgDBMGetUlDedLcCb((*ue), lcCfg->lcId) != NULLP)
765 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE: Dedicated UL LC %d already configured\n",
766 lcCfg->crnti, lcCfg->lcId));
774 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid Direction %d \n",
775 lcCfg->crnti, lcCfg->dir));
779 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]Dedicated logical channel %d validated"
780 "for cell %d\n", lcCfg->crnti, lcCfg->lcId, lcCfg->cellId));
782 } /* rgPomVldtSCellDedLchCfg */
783 /***********************************************************
785 * Func : rgPomUeSCellDedLcCfg
788 * Desc : Validates dedicated logical channel configuration received from PMAC.
790 * @param[in] RgCellCb *cell
791 * @param[in] RgUeCb *ue
792 * @param[in] RgPrgUeSCellLchAddInfo *lcCfg
802 **********************************************************/
804 PRIVATE S16 rgPomUeSCellDedLcCfg
808 RgPrgUeSCellLchAddInfo *lcCfg
811 PRIVATE S16 rgPomUeSCellDedLcCfg(cell, ue, lcCfg)
814 RgPrgUeSCellLchAddInfo *lcCfg;
817 //Inst inst = cell->macInst - RG_INST_START;
818 TRC2(rgPomUeSCellDedLcCfg);
819 //RGDBGPRM(inst,(rgPBuf(inst), "APPLYING DEDICATED LC CONFIG\n"));
821 /* Uplink/Bi-directional logical channel */
822 if (lcCfg->dir & PRG_DIR_RX)
825 rgDBMInsUlDedLcCb(ue, lcCfg->lcId, lcCfg->ulInfo.lcgId, lcCfg->qci);
826 cell->qciArray[lcCfg->qci].qci = lcCfg->qci;
827 if(lcCfg->lcType == CM_LTE_LCH_DTCH)
829 rgAddToL2MeasPerQci(cell,lcCfg->qci);/*LTE_L2_MEAS_PHASE2*/
832 rgDBMInsUlDedLcCb(ue, lcCfg->lcId, lcCfg->ulInfo.lcgId);
836 /* Downlink/Bi-directional logical channel */
837 if (lcCfg->dir & PRG_DIR_TX)
839 rgDBMInsDlDedLcCb(ue, lcCfg->lcId);
841 RGDBGINFO(inst,(rgPBuf(inst), "Dedicated LC config done\n"));
844 } /* rgPomUeSCellDedLcCfg */
846 * @brief Function to validate SCellLchReCfg.
850 * Function : rgPomVltdModLch
853 * @param[in] inst instance number to fetch rgCb instance
854 * @param[in] lchCfg Cb lchCfg CB for validation
855 * @param[out] cell cell control block
856 * @param[out] RgCellCb **cell
857 * @param[out] RgUeCb **ue
858 * @param[out] RgUlLcCb **ulLc
863 PUBLIC S16 rgPomVltdModLch
866 RgPrgUeSCellLchModInfo *lchCfgCb,
872 PUBLIC S16 rgPomVltdModLch(inst, lchCfgCb, cell, ue, ulLc)
874 RgPrgUeSCellLchModInfo *lchCfgCb;
880 TRC2(rgPomVltdModLch);
881 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC RECONFIG: cellId %d ueId %d \
882 lcId %d cell %p ue %p ulLc %p\n",lchCfgCb->cellId,
883 lchCfgCb->crnti,lchCfgCb->lcId, (void*)*cell, (void*)*ue,
886 if ((((*cell = rgCb[inst].cell)) == NULLP)
887 || ((*cell)->cellId != lchCfgCb->cellId))
889 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist %d\n",lchCfgCb->crnti, lchCfgCb->cellId));
892 /* Fetch the Ue for dedicated channels */
893 if ((*ue = rgDBMGetUeCb(*cell, lchCfgCb->crnti)) == NULLP)
895 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue does not exist for dedicated logical channel\n",
899 if ((*ulLc = rgDBMGetUlDedLcCb((*ue), lchCfgCb->lcId)) == NULLP)
901 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated UL LC does not exist %d\n",
902 lchCfgCb->crnti, lchCfgCb->lcId));
905 /* if (lchCfgCb->ulLchRecfg.lcgId > (RG_MAX_LCG_PER_UE - 1))
907 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid lcgId for uplink logical channel: lcg %d"
908 "lc %d\n",lchCfgCb->crnti, lchCfgCb->ulLchRecfg.lcgId, lchCfgCb->lcId));
912 } /*rgPomVltdModLch*/
914 * @brief Handler for the logical channel re-configuration request from
919 * Function : rgPomUeSCellLcMod
922 * - Update the dedicated logical channel Cb with the re-configured
924 * - If successful, return ROK else RFAILED.
926 * @param[in] Inst inst
927 * @param[in] RgUlUeCb *ue
928 * @param[in] RgUlLcCb *ulLc
929 * @param[in] RgPrgLchRecfgInfo *lchCfgCb
935 PUBLIC S16 rgPomUeSCellLcMod
940 RgPrgUeSCellLchModInfo *lchCfgCb
943 PUBLIC S16 rgPomUeSCellLcMod(inst,cell, ue, ulLc, lchCfgCb)
947 RgPrgUeSCellLchModInfo *lchCfgCb;
950 TRC2(rgPomUeSCellLcMod);
951 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING SMAC LC RECONFIG: cellId %d ueId %d\
953 lchCfgCb->cellId, lchCfgCb->crnti, lchCfgCb->lcId));
955 if (ulLc->lcgId != lchCfgCb->ulLchRecfg.lcgId)
957 rgDBMUpdUlDedLcCb(ue, ulLc, lchCfgCb->ulLchRecfg.lcgId);
960 RGDBGINFO(inst,(rgPBuf(inst), "LC %d of Ue %d of cell %d Reconfigured\n",
961 lchCfgCb->lcId, ue->ueId, cell->cellId));
963 } /* rgPomUeSCellLcMod */
965 * @brief Function to validate SCellLchDel.
969 * Function : rgPomVltdDelLch
972 * @param[in] inst instance number to fetch rgCb instance
973 * @param[in] lchCfg Cb lchCfg CB for validation
974 * @param[out] cell cell control block
975 * @param[out] RgCellCb **cell
976 * @param[out] RgUeCb **ue
977 * @param[out] RgUlLcCb **ulLc
982 PUBLIC S16 rgPomVltdDelLch
985 RgPrgUeSCellLchDelInfo *delLcCb,
992 PUBLIC S16 rgPomVltdDelLch(inst, delLcCb, cell, ue, ulLc, dlLc)
994 RgPrgUeSCellLchDelInfo *delLcCb;
1001 TRC2(rgPomVltdDelLch);
1002 RGDBGPRM(inst,(rgPBuf(inst), "VALIDATE SMAC LC RECONFIG: cellId %d ueId %d \
1003 lcId %d cell %p ue %p ulLc %p\n",delLcCb->cellId,
1004 delLcCb->crnti,delLcCb->lcId, (void*)*cell, (void*)*ue,
1006 /* Fetch the cell */
1007 if ((((*cell = rgCb[inst].cell)) == NULLP)
1008 || ((*cell)->cellId != delLcCb->cellId))
1010 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist %d\n",delLcCb->crnti, delLcCb->cellId));
1013 /* Fetch the Ue for dedicated channels */
1014 if ((*ue = rgDBMGetUeCb(*cell, delLcCb->crnti)) == NULLP)
1016 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue does not exist for dedicated logical channel\n",
1020 if ((*ulLc = rgDBMGetUlDedLcCb((*ue), delLcCb->lcId)) == NULLP)
1022 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Dedicated UL LC does not exist %d\n",
1023 delLcCb->crnti, delLcCb->lcId));
1026 if ((*dlLc = rgDBMGetDlDedLcCb((*ue), delLcCb->lcId)) == NULLP)
1028 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]DL LC %d does not exist\n",
1029 delLcCb->crnti, delLcCb->lcId));
1033 } /*rgPomVltdDelLch*/
1035 * @brief Handler for the logical channel delete request from
1040 * Function : rgPomUeSCellLcDel
1043 * - Fetch the logical channel control block.
1044 * - Free the logical channel control block.
1045 * - If successful, return ROK else return RFAILED.
1047 * @param[in] Inst inst
1048 * @param[in] RgPrgUeSCellLchDelInfo *delLcCb
1049 * @param[in] RgUeCb *ue
1050 * @param[in] RgUlLcCb *ulLc
1056 PUBLIC S16 rgPomUeSCellLcDel
1059 RgPrgUeSCellLchDelInfo *delLcCb,
1065 PUBLIC S16 rgPomUeSCellLcDel(inst,delLcCb,ue,ulLc,dlLc)
1067 RgPrgUeSCellLchDelInfo *delLcCb;
1074 TRC2(rgPomUeSCellLcDel);
1075 RGDBGPRM(inst,(rgPBuf(inst), "APPLYING CRG LC DELETE: cellId %d ueId %d\
1076 lcId %d dir %d\n", delLcCb->cellId,
1077 delLcCb->crnti, delLcCb->lcId,
1081 /* Validate downlink info */
1082 if (delLcCb->dir & PRG_DIR_TX)
1084 rgDBMDelDlDedLcCb(ue, dlLc);
1088 /* Validate uplink info */
1089 if (delLcCb->dir & PRG_DIR_RX)
1091 rgDBMDelUlDedLcCb(ue, ulLc);
1097 RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Invalid direction %d for LC Delete\n",
1098 delLcCb->crnti, delLcCb->dir));
1101 RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]UE's Logical channel %d deleted from cell %d\n",
1102 delLcCb->crnti, delLcCb->lcId,
1105 } /* rgPomUeSCellLcDel */
1107 /**********************************************************************
1110 **********************************************************************/