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 rbCb->mode = entCfg->entMode;
399 * @brief This primitive Initializes the RB Cb
401 * @param [in] gCb - RLC Instance Control Block
402 * @param [out] rbCb - RB Control Block
403 * @param [in] ptr - Void pointer
404 * @param [in] entCfg - Entity Configuration
410 static S16 rlcCfgUpdateUlRb(RlcCb *gCb,RlcUlRbCb *rbCb,void *ptr,RlcEntCfgInfo *entCfg)
417 RlcUlCellCb *cellCb = (RlcUlCellCb *)ptr;
418 rbCb->dir = entCfg->dir;
419 rbCb->lch.lChId = entCfg->lCh[0].lChId;
420 rbCb->lch.lChType = entCfg->lCh[0].type;
421 cellCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
426 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
427 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
428 rlcCfgFillUlRbCb(gCb,rbCb, ueCb, entCfg);
433 RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
435 ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
436 ueCb->lCh[entCfg->lCh[1].lChId - 1].ulRbCb = rbCb;
438 rbCb->lch.lChId = entCfg->lCh[1].lChId;
439 rbCb->lch.lChType = entCfg->lCh[1].type;
440 rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
441 rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
450 RLC_ALLOC(gCb, rbCb->snssai, sizeof(Snssai));
451 if(rbCb->snssai == NULLP)
453 DU_LOG("\nERROR --> RLC_UL : rlcCfgUpdateUlRb(): Failed to allocate memory for snssai ");
457 memcpy(rbCb->snssai,entCfg->snssai,sizeof(Snssai));
460 return (CKW_CFG_REAS_NONE);
466 * This primitive validates uplink Add RB Configuration and reserve memory
469 * @param [in] gCb - RLC Instance Control Block
470 * @param [in] ueId - UE Identifier
471 * @param [in] cellId - CELL Identifier
472 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
473 * @param [out] status - status of configuration
479 S16 rlcValidateRbCfgParams(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcEntCfgInfo *cfgToValidate,CmStatus *status)
483 status->reason = CKW_CFG_REAS_CELL_UNKWN;
486 if ((cfgToValidate->rguSapId >= gCb->genCfg.maxRguSaps) || (cfgToValidate->rguSapId < 0))
488 RLCDBGP_ERROR(gCb, "rlcValidateRbCfgParams ueId (%u) cellId (%u) Invalid rguSapId (%d))\n",
489 ueId, cellId, cfgToValidate->rguSapId);
490 status->reason = CKW_CFG_REAS_INVALID_RGUSAP;
494 if((CKW_CFG_ADD == cfgToValidate->cfgType) ||
495 (CKW_CFG_MODIFY == cfgToValidate->cfgType))
497 /* Validate LChId for UM and AM modes */
498 if ((cfgToValidate->lCh[0].lChId <= 0) ||
499 ((cfgToValidate->entMode == RLC_MODE_AM) &&
500 (cfgToValidate->lCh[1].lChId <= 0)))
502 status->reason = CKW_CFG_REAS_INVALID_LCHID;
505 if((cfgToValidate->entMode == RLC_MODE_UM) &&
506 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_6BIT_SN_LEN) &&
507 (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_12BIT_SN_LEN))
509 DU_LOG("\nERROR --> RLC_UL : UM Mode RB[%d],Invalid SN Len[%d]",
511 cfgToValidate->m.umInfo.ul.snLen);
512 status->reason = CKW_CFG_REAS_INVALID_SNLEN;
515 /* Process Adding new RB */
518 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
520 status->reason = CKW_CFG_REAS_RB_UNKWN;
524 if ((cfgToValidate->lCh[0].type != CM_LTE_LCH_CCCH) &&
525 (cfgToValidate->entMode != RLC_MODE_TM))
527 status->reason= (cfgToValidate->entMode != RLC_MODE_TM)? CKW_CFG_REAS_RB_MODE_MIS:
528 CKW_CFG_REAS_LCHTYPE_MIS;
534 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
536 status->reason = CKW_CFG_REAS_RB_UNKWN;
540 if(cfgToValidate->entMode == RLC_MODE_TM)
542 status->reason = CKW_CFG_REAS_LCHTYPE_MIS;
545 if (!(((cfgToValidate->lCh[0].type == CM_LTE_LCH_DCCH) &&
546 (cfgToValidate->entMode != RLC_MODE_UM))||
547 (cfgToValidate->lCh[0].type == CM_LTE_LCH_DTCH)) )
549 status->reason = CKW_CFG_REAS_RB_MODE_MIS;
554 else /* cfgType is CKW_CFG_DELETE */
558 if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
560 status->reason = CKW_CFG_REAS_RB_UNKWN;
567 if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
569 status->reason = CKW_CFG_REAS_RB_UNKWN;
580 * This primitive validates uplink Add RB Configuration and reserve memory
583 * @param [in] gCb - RLC Instance Control Block
584 * @param [in] cfgToValidate - Entity Configuration needs to be validated.
585 * @param [out] cfgEntData - Configuration Temporary Data Entity
586 * @param [out] cfgTmpData - Configuration Temporary Data
592 S16 rlcCfgValidateUlRb
595 RlcEntCfgInfo *cfgToValidate,
596 RlcUlEntTmpData *cfgEntData,
597 RlcUlCfgTmpData *cfgTmpData
601 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
603 cfgToValidate->cfgType);
605 if(ROK != rlcValidateRbCfgParams(gCb,
609 &cfgEntData->entUlCfgCfm.status))
614 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_NONE;
615 switch(cfgToValidate->cfgType)
619 if (cfgTmpData->ueId == 0)
621 /* Cell Cb is added if it not present , it is not roll backed if the
622 * configuration fails */
623 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
624 if(!cfgTmpData->cellCb)
626 /* cell cb does not exist we need to create a new one */
627 RLC_ALLOC(gCb,cfgTmpData->cellCb, sizeof(RlcUlCellCb));
628 if(!cfgTmpData->cellCb)
630 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
632 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_CREAT_FAIL;
635 rlcDbmAddUlCellCb(gCb, cfgTmpData->cellId, cfgTmpData->cellCb);
639 if (( cfgTmpData->cellCb->rbCb[cfgToValidate->rbId] != NULLP))
641 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
646 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
647 if (!cfgEntData->rbCb)
649 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
655 /* Ue Cb is added if it not present , it is not roll backed if the
656 * configuration fails */
657 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
658 if(!cfgTmpData->ueCb)
660 RLC_ALLOC(gCb,cfgTmpData->ueCb, sizeof(RlcUlUeCb));
661 if(!cfgTmpData->ueCb)
663 DU_LOG("\nERROR --> RLC_UL : Memory allocation failure CELLID:%d",
665 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_CREAT_FAIL;
668 rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
669 cfgTmpData->ueCb->ueDeleteInfo.ueDelTmr.tmrEvnt = TMR_NONE;
673 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
674 cfgToValidate->rbType,
677 if(cfgEntData->rbCb != NULLP)
679 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_PRSNT;
683 RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
684 if (!cfgEntData->rbCb)
686 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
690 /*Allocating the memory for receive buffer */
691 if(RLC_MODE_UM == cfgToValidate->entMode)
695 /* Spec 38.322 Section 7.2
696 * UM_Window_Size = 32 when a 6 bit SN is configured,
697 * UM_Window_Size = 2048 when a 12 bit SN is configured.
699 cfgEntData->rbCb->m.umUl.umWinSz = RLC_POWER(2,
700 ((cfgToValidate->m.umInfo.ul.snLen *6)-1));
701 RLC_ALLOC(gCb, cfgEntData->rbCb->m.umUl.recBufLst,
702 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
703 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++ )
705 cmLListInit(&(cfgEntData->rbCb->m.umUl.recBufLst[hashIndex]));
708 else if(RLC_MODE_AM == cfgToValidate->entMode)
713 cfgEntData->rbCb->m.amUl.recBufLst,
714 (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp )));
715 for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++)
717 cmLListInit(&(cfgEntData->rbCb->m.amUl.recBufLst[hashIndex]));
726 if (cfgTmpData->ueId == 0)
728 /* Try to get the CellCb if it already exists */
729 rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
730 if(!cfgTmpData->cellCb)
732 DU_LOG("\nERROR --> RLC_UL : CellCb not found UEID:%d",
734 /*how can a modify request come for a cell which does not exist*/
735 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
739 cfgEntData->rbCb = cfgTmpData->cellCb->rbCb[cfgToValidate->rbId];
740 if (!cfgEntData->rbCb)
742 /* something is wrong the rbId for this cell does not exist */
743 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
750 rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
751 if(!cfgTmpData->ueCb)
753 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
755 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
760 RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId,
761 cfgToValidate->rbType,
764 if ( cfgEntData->rbCb == NULLP)
766 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
775 if(cfgToValidate->cfgType == CKW_CFG_MODIFY)
777 if(cfgToValidate->entMode != cfgEntData->rbCb->mode)
779 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_MODE_MIS;
783 if(cfgToValidate->m.umInfo.ul.snLen != cfgEntData->rbCb->m.umUl.snLen)
785 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_SNLEN_MIS;
795 * This primitive roll back the RB Configuration
797 * @param [in] gCb - RLC Instance Control Block
798 * @param [in] ueId - UE Identifier
799 * @param [in] cfg - Configuration entity.
800 * @param [out] cfgEntData - Configuration Temporary Data Entity
806 S16 rlcCfgRollBackUlRb
811 RlcUlEntTmpData *cfgEntData
815 if(CKW_CFG_ADD == cfg->cfgType)
817 if(RLC_MODE_UM == cfg->entMode)
819 RLC_FREE(gCb, cfgEntData->rbCb->m.umUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
821 else if(RLC_MODE_AM == cfg->entMode)
824 RLC_FREE(gCb,cfgEntData->rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
827 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
836 * This primitive apply RB Configuration.
838 * @param [in] gCb - RLC Instance Control Block
839 * @param [in] cfgToAply - Configuration to be applied
840 * @param [out] cfgEntData - Configuration Temporary Data Entity
841 * @param [out] cfgTmpData - Configuration Temporary Data
850 RlcEntCfgInfo *cfgToAply,
851 RlcUlEntTmpData *cfgEntData,
852 RlcUlCfgTmpData *cfgTmpData
856 switch(cfgToAply->cfgType)
860 /* copy the RB Cb into UeCb */
861 cfgEntData->rbCb->rlcId.rbId = cfgToAply->rbId;
862 if (cfgTmpData->ueId == 0)
864 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = cfgEntData->rbCb;
865 cfgTmpData->cellCb->lCh[cfgToAply->lCh[0].lChId -1].ulRbCb = cfgEntData->rbCb;
869 if(cfgToAply->rbType == CM_LTE_SRB)
871 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = cfgEntData->rbCb;
875 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = cfgEntData->rbCb;
879 RLC_LMM_RB_STS_INC(gCb);
881 cfgEntData->rbCb->rlcId.cellId = cfgTmpData->cellId;
882 cfgEntData->rbCb->rlcId.ueId = cfgTmpData->ueId;
883 cfgEntData->rbCb->rlcId.rbType = cfgToAply->rbType;
884 cfgEntData->rbCb->inst = gCb->init.inst;
887 rlcCfgFillUlRbCb(gCb,
893 cfgEntData->rbCb->qci = cfgToAply->qci;
894 cfgEntData->rbCb->ueCb = cfgTmpData->ueCb;
895 if (cfgToAply->lCh[1].type == CM_LTE_LCH_DTCH)
898 rlcAddToUlL2Meas(gCb, cfgEntData->rbCb,
899 cfgTmpData->cellId,cfgTmpData->ueId);
901 #endif /* LTE_L2_MEAS */
906 if(cfgTmpData->ueId == 0)
908 rlcCfgUpdateUlRb(gCb,
910 (void *)cfgTmpData->cellCb,
915 rlcCfgUpdateUlRb(gCb,
917 (void*)cfgTmpData->ueCb,
924 if (cfgTmpData->ueId == 0)
926 cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = NULLP;
927 cfgTmpData->cellCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
932 cfgTmpData->ueCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb =
935 /* Free the Buffers of RbCb */
936 if( RLC_MODE_UM == cfgEntData->rbCb->mode )
938 rlcUmmFreeUlRbCb(gCb, cfgEntData->rbCb);
940 else if(RLC_MODE_AM == cfgEntData->rbCb->mode)
942 rlcAmmFreeUlRbCb(gCb,cfgEntData->rbCb);
945 /* Assign NULLP to rbCb in rbCbLst */
946 if ( cfgToAply->rbType == CM_LTE_SRB )
948 cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = NULLP;
952 cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = NULLP;
956 RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
958 RLC_LMM_RB_STS_DEC(gCb);
968 * This primitive validates uplink Delete UE request
971 * @param [in] gCb - RLC Instance Control Block
972 * @param [in] cfgToValidate - Entity Configuration to be validated.
973 * @param [out] cfgEntData - Configuration Temporary Data Entity
974 * @param [out] cfgTmpData - Configuration Temporary Data
980 S16 rlcCfgValidateDelUlUe
983 RlcEntCfgInfo *cfgToValidate,
984 RlcUlEntTmpData *cfgEntData,
985 RlcUlCfgTmpData *cfgTmpData
989 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d), cfgType(%d)",
990 cfgTmpData->cellId,cfgToValidate->cfgType);
992 /* Check for ueId is present or not */
993 if ( cfgTmpData->ueId == 0 )
995 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
996 DU_LOG("\nERROR --> RLC_UL : UeId is 0 for CELLID;%d",
1002 if(ROK != rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb))
1004 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
1006 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
1015 * This primitive apply Uplink Delete Ue request
1017 * @param [in] gCb - RLC Instance Control Block
1018 * @param [in] cfgTmpData - Configuration Temporary Data
1023 Void rlcCfgApplyDelUlUe
1026 RlcUlCfgTmpData *cfgTmpData
1031 rlcDelFrmUlL2Meas(gCb,cfgTmpData->cellId,cfgTmpData->ueId);
1033 rlcDbmDelUlUeCb(gCb,cfgTmpData->ueCb, FALSE);
1040 * This primitive validates uplink Delete UE request
1043 * @param [in] gCb - RLC Instance Control Block
1044 * @param [in] ueId - UE Identifier
1045 * @param [in] cfgToValidate - Entity Configuration to be done.
1046 * @param [in] cfgEntData - Configuration Temporary Data Entity
1047 * @param [in] cfgTmpData - Configuration Temporary Data
1053 S16 rlcCfgValidateDelUlCell
1057 RlcEntCfgInfo *cfgToValidate,
1058 RlcUlEntTmpData *cfgEntData,
1059 RlcUlCfgTmpData *cfgTmpData
1063 DU_LOG("\nDEBUG --> RLC_UL : cfgType(%d)",
1064 cfgToValidate->cfgType);
1066 cfgTmpData->cellCb = NULLP;
1068 /* Check for cellId is present or not */
1071 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1072 DU_LOG("\nERROR --> RLC_UL : CellId is 0");
1077 rlcDbmFetchUlCellCb(gCb,cellId, &cfgTmpData->cellCb);
1078 if (!cfgTmpData->cellCb)
1080 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
1081 DU_LOG("\nERROR --> RLC_UL : CellCb not found");
1090 * This primitive apply Uplink Delete Ue request
1092 * @param [in] gCb - RLC Instance Control Block
1093 * @param [in] cfgEntData - Temporary Data maintained for a transaction
1098 Void rlcCfgApplyDelUlCell(RlcCb *gCb,RlcUlCfgTmpData *cfgInfo)
1101 rlcDbmDelUlCellCb(gCb,cfgInfo->cellCb);
1107 * This primitive validates reestablishment of RB.
1109 * @param [in] gCb - RLC Instance Control Block
1110 * @param [in] ueId - UE Identifier
1111 * @param [in] cellId - CELL Identifier
1112 * @param [in] cfgToValidate - Entity Configuration to be done.
1113 * @param [out] cfgEntData - Configuration Temporary Data Entity
1119 S16 rlcCfgValidateReEstRb
1124 RlcEntCfgInfo *cfgToValidate,
1125 RlcUlEntTmpData *cfgEntData
1128 CmLteRlcId rlcId; /* RLC Identifier */
1130 DU_LOG("\nDEBUG --> RLC_UL : cellId(%d) RBID:%d",
1132 cfgToValidate->rbId);
1136 rlcId.cellId = cellId;
1137 rlcId.rbId = cfgToValidate->rbId;
1138 rlcId.rbType = cfgToValidate->rbType;
1140 rlcDbmFetchUlRbCbByRbId(gCb,&rlcId, &cfgEntData->rbCb);
1141 if (cfgEntData->rbCb == NULLP)
1143 DU_LOG("\nERROR --> RLC_UL : CellId [%u]: rbId [%d] not found",
1145 cfgToValidate->rbId);
1146 cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
1157 * This primitive apply reestablishment of RB.
1159 * @param [in] gCb - RLC Instance Control Block
1160 * @param [in] ueId - UE Identifier
1161 * @param [in] cellId - CELL Identifier
1162 * @param [in] sndReEstInd - ReEstablish Indication Flag
1163 * @param [in] cfgEntData - Configuration Temporary Data Entity
1168 Void rlcCfgApplyReEstUlRb
1174 RlcUlEntTmpData *cfgEntData
1177 CmLteRlcId rlcId; /* RLC Identifier */
1180 rlcId.cellId = cellId;
1181 rlcId.rbId = cfgEntData->entUlCfgCfm.rbId;
1182 rlcId.rbType = cfgEntData->entUlCfgCfm.rbType;
1183 cfgEntData->rbCb->rlcId.ueId = ueId;
1184 switch (cfgEntData->rbCb->mode)
1188 rlcTmmUlReEstablish(gCb,cfgEntData->rbCb);
1194 rlcUmmUlReEstablish(gCb,&rlcId,cfgEntData->rbCb);
1200 rlcAmmUlReEstablish(gCb,rlcId,sndReEstInd,cfgEntData->rbCb);
1209 * This primitive validates reestablishment of RB.
1211 * @param [in] gCb - RLC Instance Control Block
1212 * @param [in] ueInfo - UE Identifier
1213 * @param [in] newUeInfo - CELL Identifier
1214 * @param [in] cfgTmpData - Configuration Temporary Data
1220 S16 rlcCfgValidateUeIdChng
1224 CkwUeInfo *newUeInfo,
1225 RlcUlCfgTmpData *cfgTmpData
1230 #define CFM_STATUS cfgTmpData->cfgEntData[0].entUlCfgCfm.status
1231 if ( (ueInfo->ueId == newUeInfo->ueId) &&
1232 (ueInfo->cellId == newUeInfo->cellId))
1234 CFM_STATUS.reason = CKW_CFG_REAS_SAME_UEID;
1235 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1239 if(ROK == rlcDbmFetchUlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
1241 DU_LOG("\nERROR --> RLC_UL : NewUeId[%d]:ueCb already exists",
1243 CFM_STATUS.reason = CKW_CFG_REAS_UE_EXISTS;
1244 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1248 if(ROK != rlcDbmFetchUlUeCb(gCb,ueInfo->ueId, ueInfo->cellId,
1251 DU_LOG("\nERROR --> RLC_UL : UeId [%d]: UeCb not found",
1253 CFM_STATUS.reason = CKW_CFG_REAS_UE_UNKWN;
1254 CFM_STATUS.status = CKW_CFG_CFM_NOK;
1265 * This primitive apply reestablishment of RB.
1267 * @param [in] gCb - RLC Instance Control Block
1268 * @param [in] ueInfo - UE Identifier
1269 * @param [in] newUeInfo - CELL Identifier
1270 * @param [in] cfgTmpData - Configuration Temporary Data
1275 Void rlcCfgApplyUlUeIdChng
1279 CkwUeInfo *newUeInfo,
1280 RlcUlCfgTmpData *cfgTmpData
1285 rlcHdlMeasUlUeIdChg(gCb, ueInfo->cellId, ueInfo->ueId, newUeInfo->ueId);
1287 cmHashListDelete(&(gCb->u.ulCb->ueLstCp), (PTR) cfgTmpData->ueCb);
1288 /* update the hash key with new values */
1289 cfgTmpData->ueCb->ueId = newUeInfo->ueId;
1290 cfgTmpData->ueCb->cellId =newUeInfo->cellId;
1291 if(ROK != cmHashListInsert(&(gCb->u.ulCb->ueLstCp),
1292 (PTR)cfgTmpData->ueCb,
1293 (uint8_t *)&(cfgTmpData->ueCb->ueId),
1294 (uint16_t) sizeof(CmLteRnti)))
1297 DU_LOG("\nERROR --> RLC_UL : UeId[%u] HashList Insertion Failed",
1303 /********************************************************************30**
1306 **********************************************************************/