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 /********************************************************************20**
21 Name: NR RLC - Configuration Manager file
25 Desc: It contains the following configuraiton primtives
33 *********************************************************************21*/
35 @brief RLC Uplink Configuration Module
39 /* header (.h) include files */
40 #include "common_def.h"
41 #include "lkw.h" /* LKW defines */
42 #include "ckw.h" /* CKW defines */
43 #include "kwu.h" /* KWU defines */
44 #include "rgu.h" /* RGU defines */
45 #include "kw_err.h" /* RLC error options */
46 #include "kw_env.h" /* RLC environment options */
47 #include "kw.h" /* RLC defines */
50 /* extern (.x) include files */
51 #include "lkw.x" /* LKW */
52 #include "ckw.x" /* CKW */
53 #include "kwu.x" /* KWU */
54 #include "rgu.x" /* RGU */
60 #include "l2_tenb_stats.x" /* Total EnodeB Stats declarations */
63 S16 rlcValidateRbCfgParams (RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId,
64 RlcEntCfgInfo *cfgToValidate, CmStatus *status);
65 #define RLC_MODULE RLC_DBGMASK_CFG
69 * @brief Handle modification of UE ID for L2 Meas data structs
72 * @param[in] ueId ue ID
79 static S16 rlcHdlMeasUlUeIdChg(RlcCb *gCb, uint8_t cellId,uint8_t oldUeId, uint8_t newUeId)
81 RlcL2MeasCb *measCb = NULLP;
85 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
87 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
89 if( measCb->measType & LKW_L2MEAS_UL_IP)
92 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
94 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == oldUeId)
96 measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = newUeId;
107 * @brief Handler to delete an UE's L2 Meas ctxt
110 * @param[in] ueId ue ID
117 static S16 rlcDelFrmUlL2Meas(RlcCb *gCb, uint8_t cellId,uint8_t ueId)
119 RlcL2MeasCb *measCb = NULLP;
123 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
125 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
128 if( measCb->measType & LKW_L2MEAS_UL_IP)
131 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
133 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
135 measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid = FALSE;
136 if (measCb->val.ipThMeas.numUes-1 == ueIdx)
138 measCb->val.ipThMeas.numUes--;
148 S16 ret; /* Return value */
149 RlcUlUeCb *ueCb = NULL;
151 for (myIdx = 0; myIdx < measCb->val.ipThMeas.numUes; myIdx++)
154 ret = rlcDbmFetchUlUeCb(gCb, measCb->val.ipThMeas.ueInfoLst[myIdx].ueId, cellId, &ueCb);
165 static S16 rlcAddToUlL2Meas(RlcCb *gCb, RlcUlRbCb *rlcRbCb,uint8_t cellId,uint8_t ueId)
167 RlcL2MeasCb *measCb = NULLP;
173 #ifndef XEON_SPECIFIC_CHANGES
174 uint8_t freeIdx = gCb->genCfg.maxUe;
176 uint16_t freeIdx = LKW_MAX_UE;
179 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
181 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
183 freeIdx = gCb->genCfg.maxUe;
185 if(measCb->measType & LKW_L2MEAS_ACT_UE )
187 for(cntr1 =0;cntr1<measCb->val.nonIpThMeas.numQci;cntr1++)
189 if(measCb->val.nonIpThMeas.qci[cntr1] != rlcRbCb->qci)
191 measCb->val.nonIpThMeas.qci[cntr1] = rlcRbCb->qci;
192 gCb->u.ulCb->rlcL2Cb.measOn[rlcRbCb->qci] |=measCb->measType;
198 if(((rlcRbCb->rbL2Cb.measOn & measCb->measType) == LKW_L2MEAS_NONE))
200 #ifdef LTE_L2_MEAS_RLC
201 if (measCb->measType & LKW_L2MEAS_ACT_UE)
203 if((rlcRbCb->mode == RLC_MODE_UM) &&
204 (rlcRbCb->dir & RLC_DIR_DL ))
206 if (rlcRbCb->m.um.umDl.sduQ.count)
208 if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
210 rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
211 gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
215 else if (rlcRbCb->mode == RLC_MODE_AM)
217 if ((rlcRbCb->m.am.amDl.cntrlBo) ||
218 (rlcRbCb->m.am.amDl.retxBo) ||
219 (rlcRbCb->m.am.amDl.bo))
221 if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
223 rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
224 gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
231 if((measCb->measType & LKW_L2MEAS_UL_IP))
234 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
236 if ((freeIdx == gCb->genCfg.maxUe) &&
237 (measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid == FALSE))
242 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
248 if (ueIdx == measCb->val.ipThMeas.numUes)
250 if (gCb->genCfg.maxUe == measCb->val.ipThMeas.numUes)
254 if (gCb->genCfg.maxUe == freeIdx)
256 measCb->val.ipThMeas.numUes++;
262 measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid = TRUE;
263 memset(&measCb->val.ipThMeas.ueInfoLst[ueIdx].measData[0],0x00,(sizeof(RlcL2Cntr) *LKW_MAX_QCI));
264 measCb->val.ipThMeas.ueInfoLst[ueIdx].numQci = 0;
266 measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = ueId;
267 measCb->val.ipThMeas.ueInfoLst[ueIdx].cellId = cellId;
268 numQci = &(measCb->val.ipThMeas.ueInfoLst[ueIdx].numQci);
270 for (qciIdx =0; qciIdx < *numQci; qciIdx++)
272 if (measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] == rlcRbCb->qci)
278 if (qciIdx == *numQci)
280 measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] = rlcRbCb->qci;
284 rlcUtlPlcMeasDatInL2Sts(&measCb->val.ipThMeas.ueInfoLst[ueIdx].measData[rlcRbCb->qci],
285 &rlcRbCb->rbL2Cb, measCb->measType);
287 rlcRbCb->rbL2Cb.measOn |= measCb->measType;
290 }/*rlcAddToDlL2Meas*/
291 #endif /*LTE_L2_MEAS*/
295 * This primitive fills the RbCb
297 * @param [in] gCb - RLC Instance Control Block
298 * @param [out] rbCb - RB Control Block
299 * @param [out] ueCb - UE Control Block
300 * @param [in] entCfg - RLC Entity configuration
306 static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfgInfo *entCfg)
309 DU_LOG("\nDEBUG --> RLC_UL : rlcCfgFillRbCb(cellId(%d), rbId(%d), rbType(%d))",
314 /* Initialize according to entMode */
315 switch (entCfg->entMode)
319 rbCb->lch.lChId = entCfg->lCh[0].lChId;
320 rbCb->lch.lChType = entCfg->lCh[0].type;
321 rbCb->dir = entCfg->dir;
326 rbCb->lch.lChId = entCfg->lCh[0].lChId;
327 rbCb->lch.lChType = entCfg->lCh[0].type;
329 rbCb->dir = entCfg->dir;
331 rbCb->m.umUl.snLen = entCfg->m.umInfo.ul.snLen;
333 /* the bitmask for SN = 10 is 0x3ff and for SN = 5 is 0x1f */
334 rbCb->m.umUl.modBitMask = (rbCb->m.umUl.umWinSz << 1) - 1;
336 rbCb->m.umUl.reAsmblTmrInt =
337 entCfg->m.umInfo.ul.reAsmblTmr;
338 cmInitTimers(&(rbCb->m.umUl.reAsmblTmr), 1);
339 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
344 /* Down Link Information
345 * indx = 1 as Up Link */
346 rbCb->lch.lChId = entCfg->lCh[1].lChId;
347 rbCb->lch.lChType = entCfg->lCh[1].type;
348 rbCb->dir = RLC_DIR_BOTH;
350 rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
351 rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
353 rbCb->m.amUl.snLen = entCfg->m.amInfo.ul.snLen; /* 5GNR */
355 if(RLC_AM_CFG_12BIT_SN_LEN == rbCb->m.amUl.snLen)
357 rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_12BITS) - 1; /* 5GNR */
361 rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_18BITS) - 1; /* 5GNR */
364 cmInitTimers(&(rbCb->m.amUl.reAsmblTmr), 1);
365 cmInitTimers(&(rbCb->m.amUl.staProhTmr), 1);
367 rbCb->m.amUl.vrMr = rbCb->m.amUl.rxNext + (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen));
369 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
375 DU_LOG("\nERROR --> RLC_UL : INVALID RB Mode cellId(%d), rbId(%d)",
381 rbCb->mode = entCfg->entMode;
388 * @brief This primitive Initializes the RB Cb
390 * @param [in] gCb - RLC Instance Control Block
391 * @param [out] rbCb - RB Control Block
392 * @param [in] ptr - Void pointer
393 * @param [in] entCfg - Entity Configuration
399 static S16 rlcCfgUpdateUlRb(RlcCb *gCb,RlcUlRbCb *rbCb,void *ptr,RlcEntCfgInfo *entCfg)
406 RlcUlCellCb *cellCb = (RlcUlCellCb *)ptr;
407 rbCb->dir = entCfg->dir;
408 rbCb->lch.lChId = entCfg->lCh[0].lChId;
409 rbCb->lch.lChType = entCfg->lCh[0].type;
411 cellCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
416 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
417 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
418 rlcCfgFillUlRbCb(gCb,rbCb, ueCb, entCfg);
423 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
425 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
426 ueCb->lCh[entCfg->lCh[1].lChId - 1].ulRbCb = rbCb;
428 rbCb->lch.lChId = entCfg->lCh[1].lChId;
429 rbCb->lch.lChType = entCfg->lCh[1].type;
430 rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
431 rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
435 return (CKW_CFG_REAS_NONE);
441 * This primitive validates uplink Add RB Configuration and reserve memory
444 * @param [in] gCb - RLC Instance Control Block
445 * @param [in] ueId - UE Identifier
446 * @param [in] cellId - CELL Identifier
447 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
448 * @param [out] status - status of configuration
454 S16 rlcValidateRbCfgParams(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcEntCfgInfo *cfgToValidate,CmStatus *status)
458 status->reason = CKW_CFG_REAS_CELL_UNKWN;
461 if ((cfgToValidate->rguSapId >= gCb->genCfg.maxRguSaps) || (cfgToValidate->rguSapId < 0))
463 RLCDBGP_ERROR(gCb, "rlcValidateRbCfgParams ueId (%u) cellId (%u) Invalid rguSapId (%d))\n",
464 ueId, cellId, cfgToValidate->rguSapId);
465 status->reason = CKW_CFG_REAS_INVALID_RGUSAP;
469 if((CKW_CFG_ADD == cfgToValidate->cfgType) ||
470 (CKW_CFG_MODIFY == cfgToValidate->cfgType))
472 /* Validate LChId for UM and AM modes */
473 if ((cfgToValidate->lCh[0].lChId <= 0) ||
474 ((cfgToValidate->entMode == RLC_MODE_AM) &&
475 (cfgToValidate->lCh[1].lChId <= 0)))
477 status->reason = CKW_CFG_REAS_INVALID_LCHID;
480 if((cfgToValidate->entMode == RLC_MODE_UM) &&
481 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_6BIT_SN_LEN) &&
482 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_12BIT_SN_LEN))
484 DU_LOG("\nERROR --> RLC_UL : UM Mode RB[%d],Invalid SN Len[%d]",
486 cfgToValidate->m.umInfo.ul.snLen);
487 status->reason = CKW_CFG_REAS_INVALID_SNLEN;
490 /* Process Adding new RB */
493 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
495 status->reason = CKW_CFG_REAS_RB_UNKWN;
499 if ((cfgToValidate->lCh[0].type != CM_LTE_LCH_CCCH) &&
500 (cfgToValidate->entMode != RLC_MODE_TM))
502 status->reason= (cfgToValidate->entMode != RLC_MODE_TM)? CKW_CFG_REAS_RB_MODE_MIS:
503 CKW_CFG_REAS_LCHTYPE_MIS;
509 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
511 status->reason = CKW_CFG_REAS_RB_UNKWN;
515 if(cfgToValidate->entMode == RLC_MODE_TM)
517 status->reason = CKW_CFG_REAS_LCHTYPE_MIS;
520 if (!(((cfgToValidate->lCh[0].type == CM_LTE_LCH_DCCH) &&
521 (cfgToValidate->entMode != RLC_MODE_UM))||
522 (cfgToValidate->lCh[0].type == CM_LTE_LCH_DTCH)) )
524 status->reason = CKW_CFG_REAS_RB_MODE_MIS;
529 else /* cfgType is CKW_CFG_DELETE */
533 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
535 status->reason = CKW_CFG_REAS_RB_UNKWN;
542 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
544 status->reason = CKW_CFG_REAS_RB_UNKWN;
555 * This primitive validates uplink Add RB Configuration and reserve memory
558 * @param [in] gCb - RLC Instance Control Block
559 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
560 * @param [out] cfgEntData - Configuration Temporary Data Entity
561 * @param [out] cfgTmpData - Configuration Temporary Data
567 S16 rlcCfgValidateUlRb
570 RlcEntCfgInfo *cfgToValidate,
571 RlcUlEntTmpData *cfgEntData,
572 RlcUlCfgTmpData *cfgTmpData
576 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
578 cfgToValidate->cfgType);
580 if(ROK != rlcValidateRbCfgParams(gCb,
584 &cfgEntData->entUlCfgCfm.status))
589 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_NONE;
590 switch(cfgToValidate->cfgType)
594 if (cfgTmpData->ueId == 0)
596 /* Cell Cb is added if it not present , it is not roll backed if the
597 * configuration fails */
598 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
599 if(!cfgTmpData->cellCb)
601 /* cell cb does not exist we need to create a new one */
602 RLC_ALLOC(gCb,cfgTmpData->cellCb, sizeof(RlcUlCellCb));
603 if(!cfgTmpData->cellCb)
605 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
607 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_CREAT_FAIL;
610 rlcDbmAddUlCellCb(gCb, cfgTmpData->cellId, cfgTmpData->cellCb);
614 if (( cfgTmpData->cellCb->rbCb[cfgToValidate->rbId] != NULLP))
616 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
621 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
622 if (!cfgEntData->rbCb)
624 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
630 /* Ue Cb is added if it not present , it is not roll backed if the
631 * configuration fails */
632 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
633 if(!cfgTmpData->ueCb)
635 RLC_ALLOC(gCb,cfgTmpData->ueCb, sizeof(RlcUlUeCb));
636 if(!cfgTmpData->ueCb)
638 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
640 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_CREAT_FAIL;
643 rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
647 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
648 cfgToValidate->rbType,
651 if(cfgEntData->rbCb != NULLP)
653 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
657 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
658 if (!cfgEntData->rbCb)
660 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
664 /*Allocating the memory for receive buffer */
665 if(RLC_MODE_UM == cfgToValidate->entMode)
669 /* Spec 38.322 Section 7.2
670 * UM_Window_Size = 32 when a 6 bit SN is configured,
671 * UM_Window_Size = 2048 when a 12 bit SN is configured.
673 cfgEntData->rbCb->m.umUl.umWinSz = RLC_POWER(2,
674 ((cfgToValidate->m.umInfo.ul.snLen *6)-1));
675 RLC_ALLOC(gCb, cfgEntData->rbCb->m.umUl.recBufLst,
676 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
677 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++ )
679 cmLListInit(&(cfgEntData->rbCb->m.umUl.recBufLst[hashIndex]));
682 else if(RLC_MODE_AM == cfgToValidate->entMode)
687 cfgEntData->rbCb->m.amUl.recBufLst,
688 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp )));
689 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++)
691 cmLListInit(&(cfgEntData->rbCb->m.amUl.recBufLst[hashIndex]));
700 if (cfgTmpData->ueId == 0)
702 /* Try to get the CellCb if it already exists */
703 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
704 if(!cfgTmpData->cellCb)
706 DU_LOG("\nERROR --> RLC_UL : CellCb not found UEID:%d",
708 /*how can a modify request come for a cell which does not exist*/
709 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
713 cfgEntData->rbCb = cfgTmpData->cellCb->rbCb[cfgToValidate->rbId];
714 if (!cfgEntData->rbCb)
716 /* something is wrong the rbId for this cell does not exist */
717 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
724 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
725 if(!cfgTmpData->ueCb)
727 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
729 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
734 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
735 cfgToValidate->rbType,
738 if ( cfgEntData->rbCb == NULLP)
740 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
749 if(cfgToValidate->cfgType == CKW_CFG_MODIFY)
751 if(cfgToValidate->entMode != cfgEntData->rbCb->mode)
753 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_MODE_MIS;
757 if(cfgToValidate->m.umInfo.ul.snLen != cfgEntData->rbCb->m.umUl.snLen)
759 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_SNLEN_MIS;
769 * This primitive roll back the RB Configuration
771 * @param [in] gCb - RLC Instance Control Block
772 * @param [in] ueId - UE Identifier
773 * @param [in] cfg - Configuration entity.
774 * @param [out] cfgEntData - Configuration Temporary Data Entity
780 S16 rlcCfgRollBackUlRb
785 RlcUlEntTmpData *cfgEntData
789 if(CKW_CFG_ADD == cfg->cfgType)
791 if(RLC_MODE_UM == cfg->entMode)
793 RLC_FREE(gCb, cfgEntData->rbCb->m.umUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
795 else if(RLC_MODE_AM == cfg->entMode)
798 RLC_FREE(gCb,cfgEntData->rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
801 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
810 * This primitive apply RB Configuration.
812 * @param [in] gCb - RLC Instance Control Block
813 * @param [in] cfgToAply - Configuration to be applied
814 * @param [out] cfgEntData - Configuration Temporary Data Entity
815 * @param [out] cfgTmpData - Configuration Temporary Data
824 RlcEntCfgInfo *cfgToAply,
825 RlcUlEntTmpData *cfgEntData,
826 RlcUlCfgTmpData *cfgTmpData
830 switch(cfgToAply->cfgType)
834 /* copy the RB Cb into UeCb */
835 cfgEntData->rbCb->rlcId.rbId = cfgToAply->rbId;
836 if (cfgTmpData->ueId == 0)
838 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = cfgEntData->rbCb;
839 cfgTmpData->cellCb->lCh[cfgToAply->lCh[0].lChId -1].ulRbCb = cfgEntData->rbCb;
843 if(cfgToAply->rbType == CM_LTE_SRB)
845 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = cfgEntData->rbCb;
849 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = cfgEntData->rbCb;
853 RLC_LMM_RB_STS_INC(gCb);
855 cfgEntData->rbCb->rlcId.cellId = cfgTmpData->cellId;
856 cfgEntData->rbCb->rlcId.ueId = cfgTmpData->ueId;
857 cfgEntData->rbCb->rlcId.rbType = cfgToAply->rbType;
858 cfgEntData->rbCb->inst = gCb->init.inst;
861 rlcCfgFillUlRbCb(gCb,
867 cfgEntData->rbCb->qci = cfgToAply->qci;
868 cfgEntData->rbCb->ueCb = cfgTmpData->ueCb;
869 if (cfgToAply->lCh[1].type == CM_LTE_LCH_DTCH)
872 rlcAddToUlL2Meas(gCb, cfgEntData->rbCb,
873 cfgTmpData->cellId,cfgTmpData->ueId);
875 #endif /* LTE_L2_MEAS */
880 if(cfgTmpData->ueId == 0)
882 rlcCfgUpdateUlRb(gCb,
884 (void *)cfgTmpData->cellCb,
889 rlcCfgUpdateUlRb(gCb,
891 (void*)cfgTmpData->ueCb,
898 if (cfgTmpData->ueId == 0)
900 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = NULLP;
901 cfgTmpData->cellCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
906 cfgTmpData->ueCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
909 /* Free the Buffers of RbCb */
910 if( RLC_MODE_UM == cfgEntData->rbCb->mode )
912 rlcUmmFreeUlRbCb(gCb, cfgEntData->rbCb);
914 else if(RLC_MODE_AM == cfgEntData->rbCb->mode)
916 rlcAmmFreeUlRbCb(gCb,cfgEntData->rbCb);
919 /* Assign NULLP to rbCb in rbCbLst */
920 if ( cfgToAply->rbType == CM_LTE_SRB )
922 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = NULLP;
926 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = NULLP;
930 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
932 RLC_LMM_RB_STS_DEC(gCb);
942 * This primitive validates uplink Delete UE request
945 * @param [in] gCb - RLC Instance Control Block
946 * @param [in] cfgToValidate - Entity Configuration to be validated.
947 * @param [out] cfgEntData - Configuration Temporary Data Entity
948 * @param [out] cfgTmpData - Configuration Temporary Data
954 S16 rlcCfgValidateDelUlUe
957 RlcEntCfgInfo *cfgToValidate,
958 RlcUlEntTmpData *cfgEntData,
959 RlcUlCfgTmpData *cfgTmpData
963 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
964 cfgTmpData->cellId,cfgToValidate->cfgType);
966 /* Check for ueId is present or not */
967 if ( cfgTmpData->ueId == 0 )
969 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
970 DU_LOG("\nERROR --> RLC_UL : UeId is 0 for CELLID;%d",
976 if(ROK != rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb))
978 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
980 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
989 * This primitive apply Uplink Delete Ue request
991 * @param [in] gCb - RLC Instance Control Block
992 * @param [in] cfgTmpData - Configuration Temporary Data
997 Void rlcCfgApplyDelUlUe
1000 RlcUlCfgTmpData *cfgTmpData
1005 rlcDelFrmUlL2Meas(gCb,cfgTmpData->cellId,cfgTmpData->ueId);
1007 rlcDbmDelUlUeCb(gCb,cfgTmpData->ueCb, FALSE);
1014 * This primitive validates uplink Delete UE request
1017 * @param [in] gCb - RLC Instance Control Block
1018 * @param [in] ueId - UE Identifier
1019 * @param [in] cfgToValidate - Entity Configuration to be done.
1020 * @param [in] cfgEntData - Configuration Temporary Data Entity
1021 * @param [in] cfgTmpData - Configuration Temporary Data
1027 S16 rlcCfgValidateDelUlCell
1031 RlcEntCfgInfo *cfgToValidate,
1032 RlcUlEntTmpData *cfgEntData,
1033 RlcUlCfgTmpData *cfgTmpData
1037 DU_LOG("\nDEBUG --> RLC_UL : cfgType(%d)",
1038 cfgToValidate->cfgType);
1040 cfgTmpData->cellCb = NULLP;
1042 /* Check for cellId is present or not */
1045 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1046 DU_LOG("\nERROR --> RLC_UL : CellId is 0");
1051 rlcDbmFetchUlCellCb(gCb,cellId, &cfgTmpData->cellCb);
1052 if (!cfgTmpData->cellCb)
1054 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1055 DU_LOG("\nERROR --> RLC_UL : CellCb not found");
1064 * This primitive apply Uplink Delete Ue request
1066 * @param [in] gCb - RLC Instance Control Block
1067 * @param [in] cfgEntData - Temporary Data maintained for a transaction
1072 Void rlcCfgApplyDelUlCell(RlcCb *gCb,RlcUlCfgTmpData *cfgInfo)
1075 rlcDbmDelUlCellCb(gCb,cfgInfo->cellCb);
1081 * This primitive validates reestablishment of RB.
1083 * @param [in] gCb - RLC Instance Control Block
1084 * @param [in] ueId - UE Identifier
1085 * @param [in] cellId - CELL Identifier
1086 * @param [in] cfgToValidate - Entity Configuration to be done.
1087 * @param [out] cfgEntData - Configuration Temporary Data Entity
1093 S16 rlcCfgValidateReEstRb
1098 RlcEntCfgInfo *cfgToValidate,
1099 RlcUlEntTmpData *cfgEntData
1102 CmLteRlcId rlcId; /* RLC Identifier */
1104 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d) RBID:%d",
1106 cfgToValidate->rbId);
1110 rlcId.cellId = cellId;
1111 rlcId.rbId = cfgToValidate->rbId;
1112 rlcId.rbType = cfgToValidate->rbType;
1114 rlcDbmFetchUlRbCbByRbId(gCb,&rlcId, &cfgEntData->rbCb);
1115 if (cfgEntData->rbCb == NULLP)
1117 DU_LOG("\nERROR --> RLC_UL : CellId [%u]: rbId [%d] not found",
1119 cfgToValidate->rbId);
1120 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
1131 * This primitive apply reestablishment of RB.
1133 * @param [in] gCb - RLC Instance Control Block
1134 * @param [in] ueId - UE Identifier
1135 * @param [in] cellId - CELL Identifier
1136 * @param [in] sndReEstInd - ReEstablish Indication Flag
1137 * @param [in] cfgEntData - Configuration Temporary Data Entity
1142 Void rlcCfgApplyReEstUlRb
1148 RlcUlEntTmpData *cfgEntData
1151 CmLteRlcId rlcId; /* RLC Identifier */
1154 rlcId.cellId = cellId;
1155 rlcId.rbId = cfgEntData->entUlCfgCfm.rbId;
1156 rlcId.rbType = cfgEntData->entUlCfgCfm.rbType;
1157 cfgEntData->rbCb->rlcId.ueId = ueId;
1158 switch (cfgEntData->rbCb->mode)
1162 rlcTmmUlReEstablish(gCb,cfgEntData->rbCb);
1168 rlcUmmUlReEstablish(gCb,&rlcId,cfgEntData->rbCb);
1174 rlcAmmUlReEstablish(gCb,rlcId,sndReEstInd,cfgEntData->rbCb);
1183 * This primitive validates reestablishment of RB.
1185 * @param [in] gCb - RLC Instance Control Block
1186 * @param [in] ueInfo - UE Identifier
1187 * @param [in] newUeInfo - CELL Identifier
1188 * @param [in] cfgTmpData - Configuration Temporary Data
1194 S16 rlcCfgValidateUeIdChng
1198 CkwUeInfo *newUeInfo,
1199 RlcUlCfgTmpData *cfgTmpData
1204 #define CFM_STATUS cfgTmpData->cfgEntData[0].entUlCfgCfm.status
1205 if ( (ueInfo->ueId == newUeInfo->ueId) &&
1206 (ueInfo->cellId == newUeInfo->cellId))
1208 CFM_STATUS.reason = CKW_CFG_REAS_SAME_UEID;
1209 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1213 if(ROK == rlcDbmFetchUlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
1215 DU_LOG("\nERROR --> RLC_UL : NewUeId[%d]:ueCb already exists",
1217 CFM_STATUS.reason = CKW_CFG_REAS_UE_EXISTS;
1218 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1222 if(ROK != rlcDbmFetchUlUeCb(gCb,ueInfo->ueId, ueInfo->cellId,
1225 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
1227 CFM_STATUS.reason = CKW_CFG_REAS_UE_UNKWN;
1228 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1239 * This primitive apply reestablishment of RB.
1241 * @param [in] gCb - RLC Instance Control Block
1242 * @param [in] ueInfo - UE Identifier
1243 * @param [in] newUeInfo - CELL Identifier
1244 * @param [in] cfgTmpData - Configuration Temporary Data
1249 Void rlcCfgApplyUlUeIdChng
1253 CkwUeInfo *newUeInfo,
1254 RlcUlCfgTmpData *cfgTmpData
1259 rlcHdlMeasUlUeIdChg(gCb, ueInfo->cellId, ueInfo->ueId, newUeInfo->ueId);
1261 cmHashListDelete(&(gCb->u.ulCb->ueLstCp), (PTR) cfgTmpData->ueCb);
1262 /* update the hash key with new values */
1263 cfgTmpData->ueCb->ueId = newUeInfo->ueId;
1264 cfgTmpData->ueCb->cellId =newUeInfo->cellId;
1265 if(ROK != cmHashListInsert(&(gCb->u.ulCb->ueLstCp),
1266 (PTR)cfgTmpData->ueCb,
1267 (uint8_t *)&(cfgTmpData->ueCb->ueId),
1268 (uint16_t) sizeof(CmLteRnti)))
1271 DU_LOG("\nERROR --> RLC_UL : UeId[%u] HashList Insertion Failed",
1277 /********************************************************************30**
1280 **********************************************************************/