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*/
34 /** @file rlc_cfg_ul.c
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 "rlc_err.h" /* RLC error options */
46 #include "rlc_env.h" /* RLC environment options */
48 /* extern (.x) include files */
49 #include "lkw.x" /* LKW */
50 #include "ckw.x" /* CKW */
51 #include "kwu.x" /* KWU */
52 #include "rgu.x" /* RGU */
54 #include "rlc_utils.h" /* RLC defines */
58 #include "l2_tenb_stats.x" /* Total EnodeB Stats declarations */
61 S16 rlcValidateRbCfgParams (RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId,
62 RlcEntCfgInfo *cfgToValidate, CmStatus *status);
63 #define RLC_MODULE RLC_DBGMASK_CFG
67 * @brief Handle modification of UE ID for L2 Meas data structs
70 * @param[in] ueId ue ID
77 static S16 rlcHdlMeasUlUeIdChg(RlcCb *gCb, uint8_t cellId,uint8_t oldUeId, uint8_t newUeId)
79 RlcL2MeasCb *measCb = NULLP;
83 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
85 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
87 if( measCb->measType & LKW_L2MEAS_UL_IP)
90 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
92 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == oldUeId)
94 measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = newUeId;
105 * @brief Handler to delete an UE's L2 Meas ctxt
108 * @param[in] ueId ue ID
115 static S16 rlcDelFrmUlL2Meas(RlcCb *gCb, uint8_t cellId,uint8_t ueId)
117 RlcL2MeasCb *measCb = NULLP;
121 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
123 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
126 if( measCb->measType & LKW_L2MEAS_UL_IP)
129 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
131 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
133 measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid = FALSE;
134 if (measCb->val.ipThMeas.numUes-1 == ueIdx)
136 measCb->val.ipThMeas.numUes--;
146 S16 ret; /* Return value */
147 RlcUlUeCb *ueCb = NULL;
149 for (myIdx = 0; myIdx < measCb->val.ipThMeas.numUes; myIdx++)
152 ret = rlcDbmFetchUlUeCb(gCb, measCb->val.ipThMeas.ueInfoLst[myIdx].ueId, cellId, &ueCb);
163 static S16 rlcAddToUlL2Meas(RlcCb *gCb, RlcUlRbCb *rlcRbCb,uint8_t cellId,uint8_t ueId)
165 RlcL2MeasCb *measCb = NULLP;
171 #ifndef XEON_SPECIFIC_CHANGES
172 uint8_t freeIdx = gCb->genCfg.maxUe;
174 uint16_t freeIdx = LKW_MAX_UE;
177 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
179 measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
181 freeIdx = gCb->genCfg.maxUe;
183 if(measCb->measType & LKW_L2MEAS_ACT_UE )
185 for(cntr1 =0;cntr1<measCb->val.nonIpThMeas.numQci;cntr1++)
187 if(measCb->val.nonIpThMeas.qci[cntr1] != rlcRbCb->qci)
189 measCb->val.nonIpThMeas.qci[cntr1] = rlcRbCb->qci;
190 gCb->u.ulCb->rlcL2Cb.measOn[rlcRbCb->qci] |=measCb->measType;
196 if(((rlcRbCb->rbL2Cb.measOn & measCb->measType) == LKW_L2MEAS_NONE))
198 #ifdef LTE_L2_MEAS_RLC
199 if (measCb->measType & LKW_L2MEAS_ACT_UE)
201 if((rlcRbCb->mode == RLC_MODE_UM) &&
202 (rlcRbCb->dir & RLC_DIR_DL ))
204 if (rlcRbCb->m.um.umDl.sduQ.count)
206 if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
208 rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
209 gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
213 else if (rlcRbCb->mode == RLC_MODE_AM)
215 if ((rlcRbCb->m.am.amDl.cntrlBo) ||
216 (rlcRbCb->m.am.amDl.retxBo) ||
217 (rlcRbCb->m.am.amDl.bo))
219 if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
221 rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
222 gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
229 if((measCb->measType & LKW_L2MEAS_UL_IP))
232 for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
234 if ((freeIdx == gCb->genCfg.maxUe) &&
235 (measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid == FALSE))
240 if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
246 if (ueIdx == measCb->val.ipThMeas.numUes)
248 if (gCb->genCfg.maxUe == measCb->val.ipThMeas.numUes)
252 if (gCb->genCfg.maxUe == freeIdx)
254 measCb->val.ipThMeas.numUes++;
260 measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid = TRUE;
261 memset(&measCb->val.ipThMeas.ueInfoLst[ueIdx].measData[0],0x00,(sizeof(RlcL2Cntr) *LKW_MAX_QCI));
262 measCb->val.ipThMeas.ueInfoLst[ueIdx].numQci = 0;
264 measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = ueId;
265 measCb->val.ipThMeas.ueInfoLst[ueIdx].cellId = cellId;
266 numQci = &(measCb->val.ipThMeas.ueInfoLst[ueIdx].numQci);
268 for (qciIdx =0; qciIdx < *numQci; qciIdx++)
270 if (measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] == rlcRbCb->qci)
276 if (qciIdx == *numQci)
278 measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] = rlcRbCb->qci;
282 rlcUtlPlcMeasDatInL2Sts(&measCb->val.ipThMeas.ueInfoLst[ueIdx].measData[rlcRbCb->qci],
283 &rlcRbCb->rbL2Cb, measCb->measType);
285 rlcRbCb->rbL2Cb.measOn |= measCb->measType;
288 }/*rlcAddToDlL2Meas*/
289 #endif /*LTE_L2_MEAS*/
293 * This primitive fills the RbCb
295 * @param [in] gCb - RLC Instance Control Block
296 * @param [out] rbCb - RB Control Block
297 * @param [out] ueCb - UE Control Block
298 * @param [in] entCfg - RLC Entity configuration
304 static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfgInfo *entCfg)
307 DU_LOG("\nDEBUG --> RLC_UL : rlcCfgFillRbCb(cellId(%d), rbId(%d), rbType(%d))",
312 /* Initialize according to entMode */
313 switch (entCfg->entMode)
317 rbCb->lch.lChId = entCfg->lCh[0].lChId;
318 rbCb->lch.lChType = entCfg->lCh[0].type;
319 rbCb->dir = entCfg->dir;
324 rbCb->lch.lChId = entCfg->lCh[0].lChId;
325 rbCb->lch.lChType = entCfg->lCh[0].type;
326 rbCb->dir = entCfg->dir;
328 rbCb->m.umUl.snLen = entCfg->m.umInfo.ul.snLen;
330 /* the bitmask for SN = 10 is 0x3ff and for SN = 5 is 0x1f */
331 rbCb->m.umUl.modBitMask = (rbCb->m.umUl.umWinSz << 1) - 1;
333 rbCb->m.umUl.reAsmblTmrInt =
334 entCfg->m.umInfo.ul.reAsmblTmr;
335 cmInitTimers(&(rbCb->m.umUl.reAsmblTmr), 1);
336 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
341 /* Down Link Information
342 * indx = 1 as Up Link */
343 rbCb->lch.lChId = entCfg->lCh[1].lChId;
344 rbCb->lch.lChType = entCfg->lCh[1].type;
345 rbCb->dir = RLC_DIR_BOTH;
347 rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
348 rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
350 rbCb->m.amUl.snLen = entCfg->m.amInfo.ul.snLen; /* 5GNR */
352 if(RLC_AM_CFG_12BIT_SN_LEN == rbCb->m.amUl.snLen)
354 rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_12BITS) - 1; /* 5GNR */
358 rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_18BITS) - 1; /* 5GNR */
361 cmInitTimers(&(rbCb->m.amUl.reAsmblTmr), 1);
362 cmInitTimers(&(rbCb->m.amUl.staProhTmr), 1);
364 rbCb->m.amUl.vrMr = rbCb->m.amUl.rxNext + (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen));
366 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
372 DU_LOG("\nERROR --> RLC_UL : INVALID RB Mode cellId(%d), rbId(%d)",
383 RLC_ALLOC(gCb, rbCb->snssai, sizeof(Snssai));
384 if(rbCb->snssai == NULLP)
386 DU_LOG("\nERROR --> RLC_UL : rlcCfgFillUlRbCb(): Failed to allocate memory for snssai ");
390 memcpy(rbCb->snssai, entCfg->snssai, sizeof(Snssai));
392 /*Create the entry of this SNSSAI if not exist in Snssai Tput list*/
393 if(rlcHandleSnssaiTputlist(gCb, rbCb->snssai, CREATE, DIR_UL) == NULLP)
395 DU_LOG("\nERROR --> RLC_UL : rlcCfgFillUlRbCb(): SNSSAI insertion in Tput list failed");
398 rbCb->mode = entCfg->entMode;
405 * @brief This primitive Initializes the RB Cb
407 * @param [in] gCb - RLC Instance Control Block
408 * @param [out] rbCb - RB Control Block
409 * @param [in] ptr - Void pointer
410 * @param [in] entCfg - Entity Configuration
416 static S16 rlcCfgUpdateUlRb(RlcCb *gCb,RlcUlRbCb *rbCb,void *ptr,RlcEntCfgInfo *entCfg)
423 RlcUlCellCb *cellCb = (RlcUlCellCb *)ptr;
424 rbCb->dir = entCfg->dir;
425 rbCb->lch.lChId = entCfg->lCh[0].lChId;
426 rbCb->lch.lChType = entCfg->lCh[0].type;
427 cellCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
432 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
433 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
434 rlcCfgFillUlRbCb(gCb,rbCb, ueCb, entCfg);
439 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
441 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
442 ueCb->lCh[entCfg->lCh[1].lChId - 1].ulRbCb = rbCb;
444 rbCb->lch.lChId = entCfg->lCh[1].lChId;
445 rbCb->lch.lChType = entCfg->lCh[1].type;
446 rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
447 rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
456 RLC_ALLOC(gCb, rbCb->snssai, sizeof(Snssai));
457 if(rbCb->snssai == NULLP)
459 DU_LOG("\nERROR --> RLC_UL : rlcCfgUpdateUlRb(): Failed to allocate memory for snssai ");
463 memcpy(rbCb->snssai,entCfg->snssai,sizeof(Snssai));
466 return (CKW_CFG_REAS_NONE);
472 * This primitive validates uplink Add RB Configuration and reserve memory
475 * @param [in] gCb - RLC Instance Control Block
476 * @param [in] ueId - UE Identifier
477 * @param [in] cellId - CELL Identifier
478 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
479 * @param [out] status - status of configuration
485 S16 rlcValidateRbCfgParams(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcEntCfgInfo *cfgToValidate,CmStatus *status)
489 status->reason = CKW_CFG_REAS_CELL_UNKWN;
492 if ((cfgToValidate->rguSapId >= gCb->genCfg.maxRguSaps) || (cfgToValidate->rguSapId < 0))
494 RLCDBGP_ERROR(gCb, "rlcValidateRbCfgParams ueId (%u) cellId (%u) Invalid rguSapId (%d))\n",
495 ueId, cellId, cfgToValidate->rguSapId);
496 status->reason = CKW_CFG_REAS_INVALID_RGUSAP;
500 if((CKW_CFG_ADD == cfgToValidate->cfgType) ||
501 (CKW_CFG_MODIFY == cfgToValidate->cfgType))
503 /* Validate LChId for UM and AM modes */
504 if ((cfgToValidate->lCh[0].lChId <= 0) ||
505 ((cfgToValidate->entMode == RLC_MODE_AM) &&
506 (cfgToValidate->lCh[1].lChId <= 0)))
508 status->reason = CKW_CFG_REAS_INVALID_LCHID;
511 if((cfgToValidate->entMode == RLC_MODE_UM) &&
512 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_6BIT_SN_LEN) &&
513 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_12BIT_SN_LEN))
515 DU_LOG("\nERROR --> RLC_UL : UM Mode RB[%d],Invalid SN Len[%d]",
517 cfgToValidate->m.umInfo.ul.snLen);
518 status->reason = CKW_CFG_REAS_INVALID_SNLEN;
521 /* Process Adding new RB */
524 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
526 status->reason = CKW_CFG_REAS_RB_UNKWN;
530 if ((cfgToValidate->lCh[0].type != CM_LTE_LCH_CCCH) &&
531 (cfgToValidate->entMode != RLC_MODE_TM))
533 status->reason= (cfgToValidate->entMode != RLC_MODE_TM)? CKW_CFG_REAS_RB_MODE_MIS:
534 CKW_CFG_REAS_LCHTYPE_MIS;
540 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
542 status->reason = CKW_CFG_REAS_RB_UNKWN;
546 if(cfgToValidate->entMode == RLC_MODE_TM)
548 status->reason = CKW_CFG_REAS_LCHTYPE_MIS;
551 if (!(((cfgToValidate->lCh[0].type == CM_LTE_LCH_DCCH) &&
552 (cfgToValidate->entMode != RLC_MODE_UM))||
553 (cfgToValidate->lCh[0].type == CM_LTE_LCH_DTCH)) )
555 status->reason = CKW_CFG_REAS_RB_MODE_MIS;
560 else /* cfgType is CKW_CFG_DELETE */
564 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
566 status->reason = CKW_CFG_REAS_RB_UNKWN;
573 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
575 status->reason = CKW_CFG_REAS_RB_UNKWN;
586 * This primitive validates uplink Add RB Configuration and reserve memory
589 * @param [in] gCb - RLC Instance Control Block
590 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
591 * @param [out] cfgEntData - Configuration Temporary Data Entity
592 * @param [out] cfgTmpData - Configuration Temporary Data
598 S16 rlcCfgValidateUlRb
601 RlcEntCfgInfo *cfgToValidate,
602 RlcUlEntTmpData *cfgEntData,
603 RlcUlCfgTmpData *cfgTmpData
607 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
609 cfgToValidate->cfgType);
611 if(ROK != rlcValidateRbCfgParams(gCb,
615 &cfgEntData->entUlCfgCfm.status))
620 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_NONE;
621 switch(cfgToValidate->cfgType)
625 if (cfgTmpData->ueId == 0)
627 /* Cell Cb is added if it not present , it is not roll backed if the
628 * configuration fails */
629 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
630 if(!cfgTmpData->cellCb)
632 /* cell cb does not exist we need to create a new one */
633 RLC_ALLOC(gCb,cfgTmpData->cellCb, sizeof(RlcUlCellCb));
634 if(!cfgTmpData->cellCb)
636 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
638 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_CREAT_FAIL;
641 rlcDbmAddUlCellCb(gCb, cfgTmpData->cellId, cfgTmpData->cellCb);
645 if (( cfgTmpData->cellCb->rbCb[cfgToValidate->rbId] != NULLP))
647 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
652 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
653 if (!cfgEntData->rbCb)
655 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
661 /* Ue Cb is added if it not present , it is not roll backed if the
662 * configuration fails */
663 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
664 if(!cfgTmpData->ueCb)
666 RLC_ALLOC(gCb,cfgTmpData->ueCb, sizeof(RlcUlUeCb));
667 if(!cfgTmpData->ueCb)
669 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
671 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_CREAT_FAIL;
674 rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
675 cfgTmpData->ueCb->ueDeleteInfo.ueDelTmr.tmrEvnt = TMR_NONE;
679 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
680 cfgToValidate->rbType,
683 if(cfgEntData->rbCb != NULLP)
685 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
689 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
690 if (!cfgEntData->rbCb)
692 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
696 /*Allocating the memory for receive buffer */
697 if(RLC_MODE_UM == cfgToValidate->entMode)
701 /* Spec 38.322 Section 7.2
702 * UM_Window_Size = 32 when a 6 bit SN is configured,
703 * UM_Window_Size = 2048 when a 12 bit SN is configured.
705 cfgEntData->rbCb->m.umUl.umWinSz = RLC_POWER(2,
706 ((cfgToValidate->m.umInfo.ul.snLen *6)-1));
707 RLC_ALLOC(gCb, cfgEntData->rbCb->m.umUl.recBufLst,
708 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
709 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++ )
711 cmLListInit(&(cfgEntData->rbCb->m.umUl.recBufLst[hashIndex]));
714 else if(RLC_MODE_AM == cfgToValidate->entMode)
719 cfgEntData->rbCb->m.amUl.recBufLst,
720 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp )));
721 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++)
723 cmLListInit(&(cfgEntData->rbCb->m.amUl.recBufLst[hashIndex]));
732 if (cfgTmpData->ueId == 0)
734 /* Try to get the CellCb if it already exists */
735 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
736 if(!cfgTmpData->cellCb)
738 DU_LOG("\nERROR --> RLC_UL : CellCb not found UEID:%d",
740 /*how can a modify request come for a cell which does not exist*/
741 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
745 cfgEntData->rbCb = cfgTmpData->cellCb->rbCb[cfgToValidate->rbId];
746 if (!cfgEntData->rbCb)
748 /* something is wrong the rbId for this cell does not exist */
749 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
756 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
757 if(!cfgTmpData->ueCb)
759 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
761 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
766 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
767 cfgToValidate->rbType,
770 if ( cfgEntData->rbCb == NULLP)
772 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
781 if(cfgToValidate->cfgType == CKW_CFG_MODIFY)
783 if(cfgToValidate->entMode != cfgEntData->rbCb->mode)
785 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_MODE_MIS;
789 if(cfgToValidate->m.umInfo.ul.snLen != cfgEntData->rbCb->m.umUl.snLen)
791 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_SNLEN_MIS;
801 * This primitive roll back the RB Configuration
803 * @param [in] gCb - RLC Instance Control Block
804 * @param [in] ueId - UE Identifier
805 * @param [in] cfg - Configuration entity.
806 * @param [out] cfgEntData - Configuration Temporary Data Entity
812 S16 rlcCfgRollBackUlRb
817 RlcUlEntTmpData *cfgEntData
821 if(CKW_CFG_ADD == cfg->cfgType)
823 if(RLC_MODE_UM == cfg->entMode)
825 RLC_FREE(gCb, cfgEntData->rbCb->m.umUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
827 else if(RLC_MODE_AM == cfg->entMode)
830 RLC_FREE(gCb,cfgEntData->rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
833 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
842 * This primitive apply RB Configuration.
844 * @param [in] gCb - RLC Instance Control Block
845 * @param [in] cfgToAply - Configuration to be applied
846 * @param [out] cfgEntData - Configuration Temporary Data Entity
847 * @param [out] cfgTmpData - Configuration Temporary Data
856 RlcEntCfgInfo *cfgToAply,
857 RlcUlEntTmpData *cfgEntData,
858 RlcUlCfgTmpData *cfgTmpData
862 switch(cfgToAply->cfgType)
866 /* copy the RB Cb into UeCb */
867 cfgEntData->rbCb->rlcId.rbId = cfgToAply->rbId;
868 if (cfgTmpData->ueId == 0)
870 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = cfgEntData->rbCb;
871 cfgTmpData->cellCb->lCh[cfgToAply->lCh[0].lChId -1].ulRbCb = cfgEntData->rbCb;
875 if(cfgToAply->rbType == CM_LTE_SRB)
877 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = cfgEntData->rbCb;
881 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = cfgEntData->rbCb;
885 RLC_LMM_RB_STS_INC(gCb);
887 cfgEntData->rbCb->rlcId.cellId = cfgTmpData->cellId;
888 cfgEntData->rbCb->rlcId.ueId = cfgTmpData->ueId;
889 cfgEntData->rbCb->rlcId.rbType = cfgToAply->rbType;
890 cfgEntData->rbCb->inst = gCb->init.inst;
893 rlcCfgFillUlRbCb(gCb,
899 cfgEntData->rbCb->qci = cfgToAply->qci;
900 cfgEntData->rbCb->ueCb = cfgTmpData->ueCb;
901 if (cfgToAply->lCh[1].type == CM_LTE_LCH_DTCH)
904 rlcAddToUlL2Meas(gCb, cfgEntData->rbCb,
905 cfgTmpData->cellId,cfgTmpData->ueId);
907 #endif /* LTE_L2_MEAS */
912 if(cfgTmpData->ueId == 0)
914 rlcCfgUpdateUlRb(gCb,
916 (void *)cfgTmpData->cellCb,
921 rlcCfgUpdateUlRb(gCb,
923 (void*)cfgTmpData->ueCb,
930 if (cfgTmpData->ueId == 0)
932 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = NULLP;
933 cfgTmpData->cellCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
938 cfgTmpData->ueCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
941 /* Free the Buffers of RbCb */
942 if( RLC_MODE_UM == cfgEntData->rbCb->mode )
944 rlcUmmFreeUlRbCb(gCb, cfgEntData->rbCb);
946 else if(RLC_MODE_AM == cfgEntData->rbCb->mode)
948 rlcAmmFreeUlRbCb(gCb,cfgEntData->rbCb);
951 /* Assign NULLP to rbCb in rbCbLst */
952 if ( cfgToAply->rbType == CM_LTE_SRB )
954 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = NULLP;
958 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = NULLP;
962 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
964 RLC_LMM_RB_STS_DEC(gCb);
974 * This primitive validates uplink Delete UE request
977 * @param [in] gCb - RLC Instance Control Block
978 * @param [in] cfgToValidate - Entity Configuration to be validated.
979 * @param [out] cfgEntData - Configuration Temporary Data Entity
980 * @param [out] cfgTmpData - Configuration Temporary Data
986 S16 rlcCfgValidateDelUlUe
989 RlcEntCfgInfo *cfgToValidate,
990 RlcUlEntTmpData *cfgEntData,
991 RlcUlCfgTmpData *cfgTmpData
995 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
996 cfgTmpData->cellId,cfgToValidate->cfgType);
998 /* Check for ueId is present or not */
999 if ( cfgTmpData->ueId == 0 )
1001 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
1002 DU_LOG("\nERROR --> RLC_UL : UeId is 0 for CELLID;%d",
1003 cfgTmpData->cellId);
1008 if(ROK != rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb))
1010 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
1012 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
1021 * This primitive apply Uplink Delete Ue request
1023 * @param [in] gCb - RLC Instance Control Block
1024 * @param [in] cfgTmpData - Configuration Temporary Data
1029 Void rlcCfgApplyDelUlUe
1032 RlcUlCfgTmpData *cfgTmpData
1037 rlcDelFrmUlL2Meas(gCb,cfgTmpData->cellId,cfgTmpData->ueId);
1039 rlcDbmDelUlUeCb(gCb,cfgTmpData->ueCb, FALSE);
1046 * This primitive validates uplink Delete UE request
1049 * @param [in] gCb - RLC Instance Control Block
1050 * @param [in] ueId - UE Identifier
1051 * @param [in] cfgToValidate - Entity Configuration to be done.
1052 * @param [in] cfgEntData - Configuration Temporary Data Entity
1053 * @param [in] cfgTmpData - Configuration Temporary Data
1059 S16 rlcCfgValidateDelUlCell
1063 RlcEntCfgInfo *cfgToValidate,
1064 RlcUlEntTmpData *cfgEntData,
1065 RlcUlCfgTmpData *cfgTmpData
1069 DU_LOG("\nDEBUG --> RLC_UL : cfgType(%d)",
1070 cfgToValidate->cfgType);
1072 cfgTmpData->cellCb = NULLP;
1074 /* Check for cellId is present or not */
1077 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1078 DU_LOG("\nERROR --> RLC_UL : CellId is 0");
1083 rlcDbmFetchUlCellCb(gCb,cellId, &cfgTmpData->cellCb);
1084 if (!cfgTmpData->cellCb)
1086 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1087 DU_LOG("\nERROR --> RLC_UL : CellCb not found");
1096 * This primitive apply Uplink Delete Ue request
1098 * @param [in] gCb - RLC Instance Control Block
1099 * @param [in] cfgEntData - Temporary Data maintained for a transaction
1104 Void rlcCfgApplyDelUlCell(RlcCb *gCb,RlcUlCfgTmpData *cfgInfo)
1107 rlcDbmDelUlCellCb(gCb,cfgInfo->cellCb);
1113 * This primitive validates reestablishment of RB.
1115 * @param [in] gCb - RLC Instance Control Block
1116 * @param [in] ueId - UE Identifier
1117 * @param [in] cellId - CELL Identifier
1118 * @param [in] cfgToValidate - Entity Configuration to be done.
1119 * @param [out] cfgEntData - Configuration Temporary Data Entity
1125 S16 rlcCfgValidateReEstRb
1130 RlcEntCfgInfo *cfgToValidate,
1131 RlcUlEntTmpData *cfgEntData
1134 CmLteRlcId rlcId; /* RLC Identifier */
1136 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d) RBID:%d",
1138 cfgToValidate->rbId);
1142 rlcId.cellId = cellId;
1143 rlcId.rbId = cfgToValidate->rbId;
1144 rlcId.rbType = cfgToValidate->rbType;
1146 rlcDbmFetchUlRbCbByRbId(gCb,&rlcId, &cfgEntData->rbCb);
1147 if (cfgEntData->rbCb == NULLP)
1149 DU_LOG("\nERROR --> RLC_UL : CellId [%u]: rbId [%d] not found",
1151 cfgToValidate->rbId);
1152 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
1163 * This primitive apply reestablishment of RB.
1165 * @param [in] gCb - RLC Instance Control Block
1166 * @param [in] ueId - UE Identifier
1167 * @param [in] cellId - CELL Identifier
1168 * @param [in] sndReEstInd - ReEstablish Indication Flag
1169 * @param [in] cfgEntData - Configuration Temporary Data Entity
1174 Void rlcCfgApplyReEstUlRb
1180 RlcUlEntTmpData *cfgEntData
1183 CmLteRlcId rlcId; /* RLC Identifier */
1186 rlcId.cellId = cellId;
1187 rlcId.rbId = cfgEntData->entUlCfgCfm.rbId;
1188 rlcId.rbType = cfgEntData->entUlCfgCfm.rbType;
1189 cfgEntData->rbCb->rlcId.ueId = ueId;
1190 switch (cfgEntData->rbCb->mode)
1194 rlcTmmUlReEstablish(gCb,cfgEntData->rbCb);
1200 rlcUmmUlReEstablish(gCb,&rlcId,cfgEntData->rbCb);
1206 rlcAmmUlReEstablish(gCb,rlcId,sndReEstInd,cfgEntData->rbCb);
1215 * This primitive validates reestablishment of RB.
1217 * @param [in] gCb - RLC Instance Control Block
1218 * @param [in] ueInfo - UE Identifier
1219 * @param [in] newUeInfo - CELL Identifier
1220 * @param [in] cfgTmpData - Configuration Temporary Data
1226 S16 rlcCfgValidateUeIdChng
1230 CkwUeInfo *newUeInfo,
1231 RlcUlCfgTmpData *cfgTmpData
1236 #define CFM_STATUS cfgTmpData->cfgEntData[0].entUlCfgCfm.status
1237 if ( (ueInfo->ueId == newUeInfo->ueId) &&
1238 (ueInfo->cellId == newUeInfo->cellId))
1240 CFM_STATUS.reason = CKW_CFG_REAS_SAME_UEID;
1241 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1245 if(ROK == rlcDbmFetchUlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
1247 DU_LOG("\nERROR --> RLC_UL : NewUeId[%d]:ueCb already exists",
1249 CFM_STATUS.reason = CKW_CFG_REAS_UE_EXISTS;
1250 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1254 if(ROK != rlcDbmFetchUlUeCb(gCb,ueInfo->ueId, ueInfo->cellId,
1257 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
1259 CFM_STATUS.reason = CKW_CFG_REAS_UE_UNKWN;
1260 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1271 * This primitive apply reestablishment of RB.
1273 * @param [in] gCb - RLC Instance Control Block
1274 * @param [in] ueInfo - UE Identifier
1275 * @param [in] newUeInfo - CELL Identifier
1276 * @param [in] cfgTmpData - Configuration Temporary Data
1281 Void rlcCfgApplyUlUeIdChng
1285 CkwUeInfo *newUeInfo,
1286 RlcUlCfgTmpData *cfgTmpData
1291 rlcHdlMeasUlUeIdChg(gCb, ueInfo->cellId, ueInfo->ueId, newUeInfo->ueId);
1293 cmHashListDelete(&(gCb->u.ulCb->ueLstCp), (PTR) cfgTmpData->ueCb);
1294 /* update the hash key with new values */
1295 cfgTmpData->ueCb->ueId = newUeInfo->ueId;
1296 cfgTmpData->ueCb->cellId =newUeInfo->cellId;
1297 if(ROK != cmHashListInsert(&(gCb->u.ulCb->ueLstCp),
1298 (PTR)cfgTmpData->ueCb,
1299 (uint8_t *)&(cfgTmpData->ueCb->ueId),
1300 (uint16_t) sizeof(CmLteRnti)))
1303 DU_LOG("\nERROR --> RLC_UL : UeId[%u] HashList Insertion Failed",
1309 /********************************************************************30**
1312 **********************************************************************/