Deleted the rlog folder
[o-du/l2.git] / src / 5gnrrlc / kw_cfg_ul.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /********************************************************************20**
20
21         Name:    NR RLC - Configuration Manager file
22
23         Type:    C source file
24
25         Desc:    It contains the following configuraiton primtives
26                  for different actions
27                     -- rlcCfgValdtEntCfg
28                     -- rlcCfgFillRbCb
29                     -- rlcCfgRbInit
30
31         File:     kw_cfg_ul.c
32
33 *********************************************************************21*/
34 /** @file kw_cfg_ul.c
35 @brief RLC Uplink Configuration Module
36 **/
37
38 \f
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 */
48 #include "kw_ul.h"
49
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 */
55
56 #include "kw.x"
57 #include "kw_ul.x"
58 #ifdef TENB_STATS
59 #ifdef L2_L3_SPLIT
60 #include "l2_tenb_stats.x"    /* Total EnodeB Stats declarations */
61 #endif
62 #endif
63 S16 rlcValidateRbCfgParams (RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId,
64                                   RlcEntCfgInfo *cfgToValidate, CmStatus *status);
65 #define RLC_MODULE RLC_DBGMASK_CFG
66 #ifdef LTE_L2_MEAS
67 /**
68  *
69  * @brief Handle modification of UE ID for L2 Meas data structs
70  *       
71  *
72  *  @param[in] ueId     ue ID
73  *
74  *  @return  S16
75  *      -# ROK 
76  *      -# RFAILED 
77  *
78 */
79 static S16 rlcHdlMeasUlUeIdChg(RlcCb *gCb, uint8_t cellId,uint8_t oldUeId, uint8_t newUeId)
80 {
81    RlcL2MeasCb    *measCb    = NULLP;
82    uint16_t       cntr;
83    uint16_t       ueIdx = 0;     
84
85    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
86    {
87       measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
88
89       if( measCb->measType & LKW_L2MEAS_UL_IP)
90       {
91
92          for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
93          {
94             if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == oldUeId)
95             {
96                measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = newUeId;
97                break;
98             }
99          }
100       }
101    }
102    return ROK;
103 }
104
105 /**
106  *
107  * @brief Handler to delete an UE's L2 Meas ctxt
108  *       
109 *
110  *  @param[in] ueId     ue ID
111  *
112  *  @return  S16
113  *      -# ROK 
114  *      -# RFAILED 
115  *
116 */
117 static S16 rlcDelFrmUlL2Meas(RlcCb *gCb, uint8_t cellId,uint8_t ueId)
118 {
119    RlcL2MeasCb    *measCb    = NULLP;
120    uint16_t       cntr;
121    uint16_t       ueIdx = 0;     
122
123    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
124    {
125       measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
126
127
128       if( measCb->measType & LKW_L2MEAS_UL_IP)
129       {
130
131          for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
132          {
133             if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
134             {
135                measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid = FALSE;
136                if (measCb->val.ipThMeas.numUes-1 == ueIdx)
137                {
138                   measCb->val.ipThMeas.numUes--;
139                }
140                break;
141             }
142          }
143
144
145
146       {
147          uint32_t myIdx =0;
148          S16                  ret;           /* Return value */
149             RlcUlUeCb             *ueCb = NULL;  
150
151             for (myIdx = 0; myIdx < measCb->val.ipThMeas.numUes; myIdx++)
152             {
153                ueCb = NULL;
154                ret = rlcDbmFetchUlUeCb(gCb, measCb->val.ipThMeas.ueInfoLst[myIdx].ueId, cellId, &ueCb);
155             }
156          }
157
158       }
159    }
160
161    return ROK;
162 }
163
164
165 static S16 rlcAddToUlL2Meas(RlcCb *gCb, RlcUlRbCb *rlcRbCb,uint8_t cellId,uint8_t ueId)
166 {
167    RlcL2MeasCb    *measCb    = NULLP;
168    uint16_t       cntr;
169    uint16_t       cntr1;
170    uint16_t       ueIdx = 0;
171    uint16_t       qciIdx = 0;
172    uint16_t       *numQci;
173    #ifndef XEON_SPECIFIC_CHANGES
174    uint8_t        freeIdx = gCb->genCfg.maxUe;
175    #else
176    uint16_t       freeIdx = LKW_MAX_UE;
177    #endif 
178
179    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
180    {
181       measCb = &(gCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr].measCb);
182
183       freeIdx = gCb->genCfg.maxUe;
184
185       if(measCb->measType & LKW_L2MEAS_ACT_UE )
186       {
187          for(cntr1 =0;cntr1<measCb->val.nonIpThMeas.numQci;cntr1++)
188          {
189             if(measCb->val.nonIpThMeas.qci[cntr1] != rlcRbCb->qci)
190             {
191                measCb->val.nonIpThMeas.qci[cntr1]  = rlcRbCb->qci;
192                gCb->u.ulCb->rlcL2Cb.measOn[rlcRbCb->qci] |=measCb->measType;
193                break;
194             }
195          }
196       }
197
198       if(((rlcRbCb->rbL2Cb.measOn & measCb->measType) == LKW_L2MEAS_NONE))
199       {
200 #ifdef LTE_L2_MEAS_RLC
201          if (measCb->measType & LKW_L2MEAS_ACT_UE)
202          {
203             if((rlcRbCb->mode == RLC_MODE_UM) &&
204                   (rlcRbCb->dir & RLC_DIR_DL ))
205             {
206                if (rlcRbCb->m.um.umDl.sduQ.count)
207                {
208                   if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
209                   {
210                      rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
211                      gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
212                   }
213                }
214             }
215             else if (rlcRbCb->mode == RLC_MODE_AM)
216             {
217                if ((rlcRbCb->m.am.amDl.cntrlBo) ||
218                      (rlcRbCb->m.am.amDl.retxBo)  ||
219                      (rlcRbCb->m.am.amDl.bo))
220                {
221                   if (rlcRbCb->ueCb->numActRb[rlcRbCb->qci] == 0)
222                   {
223                      rlcRbCb->ueCb->numActRb[rlcRbCb->qci]++;
224                      gCb->u.ulCb->rlcL2Cb.numActUe[rlcRbCb->qci]++;
225                   }
226                }
227             }
228          }
229 #endif
230       }
231       if((measCb->measType & LKW_L2MEAS_UL_IP))
232       {
233
234          for(ueIdx = 0; ueIdx < measCb->val.ipThMeas.numUes; ueIdx++)
235          {
236             if ((freeIdx == gCb->genCfg.maxUe) && 
237                   (measCb->val.ipThMeas.ueInfoLst[ueIdx].isValid == FALSE))
238             {
239                freeIdx = ueIdx;
240                continue;
241             }
242             if((measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId) == ueId)
243             {
244                break;
245             }
246          }
247
248          if (ueIdx ==  measCb->val.ipThMeas.numUes)
249          {
250             if (gCb->genCfg.maxUe == measCb->val.ipThMeas.numUes)
251             {
252                return RFAILED;  
253             }
254             if (gCb->genCfg.maxUe == freeIdx)
255             {               
256                measCb->val.ipThMeas.numUes++;
257             }
258             else
259             {
260                ueIdx = freeIdx;
261             }
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;
265          }
266          measCb->val.ipThMeas.ueInfoLst[ueIdx].ueId = ueId;
267          measCb->val.ipThMeas.ueInfoLst[ueIdx].cellId = cellId;
268          numQci = &(measCb->val.ipThMeas.ueInfoLst[ueIdx].numQci);
269
270          for (qciIdx =0; qciIdx <  *numQci; qciIdx++)
271          {
272             if (measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] == rlcRbCb->qci)
273             {
274                break;
275             }
276          }
277
278          if (qciIdx == *numQci)
279          {
280             measCb->val.ipThMeas.ueInfoLst[ueIdx].qci[qciIdx] = rlcRbCb->qci;
281             (*numQci)++;
282          }
283 \f
284          rlcUtlPlcMeasDatInL2Sts(&measCb->val.ipThMeas.ueInfoLst[ueIdx].measData[rlcRbCb->qci],
285                &rlcRbCb->rbL2Cb, measCb->measType);
286       }
287       rlcRbCb->rbL2Cb.measOn |= measCb->measType;      
288    }
289    return (ROK);
290 }/*rlcAddToDlL2Meas*/ 
291 #endif /*LTE_L2_MEAS*/
292 \f
293 /** 
294  * @brief
295  *     This primitive fills the RbCb 
296  *
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
301  *
302  * @return  S16
303  *    -#ROK
304  *    -#RFAILED
305  */
306 static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfgInfo *entCfg)
307 {
308
309    DU_LOG("\nDEBUG  -->  RLC_UL : rlcCfgFillRbCb(cellId(%d), rbId(%d), rbType(%d))",
310                 rbCb->rlcId.cellId, 
311                 entCfg->rbId, 
312                 entCfg->rbType);
313
314    /* Initialize according to entMode */
315    switch (entCfg->entMode)
316    {
317       case RLC_MODE_TM:
318       {
319          rbCb->lch.lChId  = entCfg->lCh[0].lChId;
320          rbCb->lch.lChType = entCfg->lCh[0].type;
321          rbCb->dir = entCfg->dir;
322          break;
323       }
324       case RLC_MODE_UM:
325       {
326          rbCb->lch.lChId  = entCfg->lCh[0].lChId;
327          rbCb->lch.lChType = entCfg->lCh[0].type;
328
329          rbCb->dir = entCfg->dir;
330
331          rbCb->m.umUl.snLen = entCfg->m.umInfo.ul.snLen;
332
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; 
335
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;
340          break;
341       }
342       case RLC_MODE_AM:
343       {
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;
349
350          rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr;
351          rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr;
352
353          rbCb->m.amUl.snLen = entCfg->m.amInfo.ul.snLen; /* 5GNR */
354          
355          if(RLC_AM_CFG_12BIT_SN_LEN == rbCb->m.amUl.snLen)
356          {
357             rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_12BITS) - 1; /* 5GNR */
358          }
359          else 
360          {
361             rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_18BITS) - 1; /* 5GNR */
362          }
363
364          cmInitTimers(&(rbCb->m.amUl.reAsmblTmr), 1);
365          cmInitTimers(&(rbCb->m.amUl.staProhTmr), 1);
366
367          rbCb->m.amUl.vrMr = rbCb->m.amUl.rxNext + (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen));
368
369          ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
370
371          break;
372       }
373       default:
374       {
375          DU_LOG("\nERROR  -->  RLC_UL : INVALID RB Mode cellId(%d), rbId(%d)",
376                 rbCb->rlcId.cellId, 
377                 entCfg->rbId); 
378          return RFAILED;
379       }
380    }
381    rbCb->mode = entCfg->entMode;
382    
383    return ROK;
384
385
386 \f
387 /** 
388  * @brief This primitive Initializes the RB Cb
389  *
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
394  *
395  * @return  S16
396  *    -#ROK
397  *    -#RFAILED
398  */
399 static S16 rlcCfgUpdateUlRb(RlcCb *gCb,RlcUlRbCb *rbCb,void *ptr,RlcEntCfgInfo *entCfg)
400 {
401    
402    switch (rbCb->mode)
403    {
404       case RLC_MODE_TM:
405       {
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;
410
411          cellCb->lCh[rbCb->lch.lChId - 1].ulRbCb = rbCb;
412          break;
413       }
414       case RLC_MODE_UM:
415       {
416          RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
417          ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
418          rlcCfgFillUlRbCb(gCb,rbCb, ueCb, entCfg);
419          break;
420       }
421       case RLC_MODE_AM:
422       {
423          RlcUlUeCb *ueCb = (RlcUlUeCb *)ptr;
424
425          ueCb->lCh[rbCb->lch.lChId - 1].ulRbCb = NULLP;
426          ueCb->lCh[entCfg->lCh[1].lChId - 1].ulRbCb = rbCb;
427          /* Up Link */
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;
432          break;
433       }
434    }
435    return (CKW_CFG_REAS_NONE);
436
437
438 \f
439 /** 
440  * @brief 
441  *    This primitive validates uplink Add RB Configuration and reserve memory
442  *    for RB creation.
443  *  
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
449  *
450  * @return  S16
451  *    -# ROK
452  *    -# RFAILED
453  */
454 S16 rlcValidateRbCfgParams(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcEntCfgInfo *cfgToValidate,CmStatus *status)
455 {
456    if (cellId == 0)
457    {
458       status->reason = CKW_CFG_REAS_CELL_UNKWN;
459       return  (RFAILED);
460    }
461    if ((cfgToValidate->rguSapId >= gCb->genCfg.maxRguSaps) || (cfgToValidate->rguSapId < 0))
462    {
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;
466       return RFAILED; 
467    }  
468   
469    if((CKW_CFG_ADD == cfgToValidate->cfgType) ||
470       (CKW_CFG_MODIFY == cfgToValidate->cfgType))
471    {
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)))
476       {
477          status->reason = CKW_CFG_REAS_INVALID_LCHID;
478          return RFAILED; 
479       }  
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))
483       {   
484          DU_LOG("\nERROR  -->  RLC_UL : UM Mode RB[%d],Invalid SN Len[%d]",
485                cfgToValidate->rbId,
486                cfgToValidate->m.umInfo.ul.snLen);
487          status->reason = CKW_CFG_REAS_INVALID_SNLEN;
488          return RFAILED; 
489       }
490       /* Process Adding new RB */
491       if (ueId == 0)
492       {
493          if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
494          {
495             status->reason = CKW_CFG_REAS_RB_UNKWN;
496             return RFAILED;
497          }
498
499          if ((cfgToValidate->lCh[0].type != CM_LTE_LCH_CCCH) &&
500                (cfgToValidate->entMode != RLC_MODE_TM))
501          {
502             status->reason= (cfgToValidate->entMode != RLC_MODE_TM)? CKW_CFG_REAS_RB_MODE_MIS:
503                CKW_CFG_REAS_LCHTYPE_MIS;
504             return RFAILED;
505          }
506       }
507       else
508       {
509          if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
510          {
511             status->reason = CKW_CFG_REAS_RB_UNKWN;
512             return RFAILED;
513          }
514
515          if(cfgToValidate->entMode == RLC_MODE_TM)
516          {
517             status->reason = CKW_CFG_REAS_LCHTYPE_MIS;
518             return RFAILED;
519          }
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)) )
523          {
524             status->reason = CKW_CFG_REAS_RB_MODE_MIS;
525             return RFAILED;
526          }
527       }
528    }
529    else /* cfgType is CKW_CFG_DELETE */
530    {
531       if (ueId == 0)
532       {
533          if(cfgToValidate->rbId >= RLC_MAX_RB_PER_CELL)
534          {
535             status->reason = CKW_CFG_REAS_RB_UNKWN;
536             return RFAILED;
537          }
538
539       }
540       else
541       {
542          if (!(RLC_VALIDATE_UE_RBID(cfgToValidate->rbType, cfgToValidate->rbId)))
543          {
544             status->reason = CKW_CFG_REAS_RB_UNKWN;
545             return RFAILED;
546          }
547       }
548    }
549    return ROK;
550 }
551
552 \f
553 /** 
554  * @brief 
555  *    This primitive validates uplink Add RB Configuration and reserve memory
556  *    for RB creation.
557  *  
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 
562  *
563  * @return  S16
564  *    -# ROK
565  *    -# RFAILED
566  */
567 S16 rlcCfgValidateUlRb
568 (
569 RlcCb             *gCb,
570 RlcEntCfgInfo    *cfgToValidate,
571 RlcUlEntTmpData   *cfgEntData,
572 RlcUlCfgTmpData   *cfgTmpData 
573 )
574 {
575
576    DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d), cfgType(%d)",
577                 cfgTmpData->cellId,
578                 cfgToValidate->cfgType);
579
580    if(ROK != rlcValidateRbCfgParams(gCb, 
581                                    cfgTmpData->ueId, 
582                                    cfgTmpData->cellId, 
583                                    cfgToValidate, 
584                                    &cfgEntData->entUlCfgCfm.status))
585    {
586       return RFAILED;
587    }
588    
589    cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_NONE;
590    switch(cfgToValidate->cfgType)
591    {
592       case CKW_CFG_ADD:
593       {
594          if (cfgTmpData->ueId == 0)
595          {
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)
600             {
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)
604                {
605                   DU_LOG("\nERROR  -->  RLC_UL : Memory allocation failure CELLID:%d",
606                         cfgTmpData->cellId);
607                   cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_CREAT_FAIL;
608                   return RFAILED;
609                }
610                rlcDbmAddUlCellCb(gCb, cfgTmpData->cellId, cfgTmpData->cellCb);
611             }
612             else
613             {
614                if (( cfgTmpData->cellCb->rbCb[cfgToValidate->rbId] != NULLP))
615                {
616                   cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_RB_PRSNT;
617                   return RFAILED;
618                }
619             }
620
621             RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
622             if (!cfgEntData->rbCb)
623             {
624                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
625                return RFAILED;
626             }
627          }
628          else
629          {
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)
634             {
635                RLC_ALLOC(gCb,cfgTmpData->ueCb, sizeof(RlcUlUeCb));
636                if(!cfgTmpData->ueCb)
637                {
638                   DU_LOG("\nERROR  -->  RLC_UL : Memory allocation failure CELLID:%d",
639                         cfgTmpData->cellId);
640                   cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_CREAT_FAIL;
641                   return RFAILED;
642                }
643                rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
644             }
645             else
646             {
647                RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId, 
648                      cfgToValidate->rbType,
649                      cfgTmpData->ueCb,
650                      cfgEntData->rbCb);
651                if(cfgEntData->rbCb != NULLP)
652                {
653                   cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_RB_PRSNT;
654                   return RFAILED;
655                }
656             }
657             RLC_ALLOC(gCb,cfgEntData->rbCb, sizeof (RlcUlRbCb));
658             if (!cfgEntData->rbCb)
659             {
660                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_CREAT_FAIL;
661                return RFAILED;
662             }
663          }
664          /*Allocating the memory for receive buffer */
665          if(RLC_MODE_UM == cfgToValidate->entMode)
666          {
667             uint16_t hashIndex;
668         
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.
672              */
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++ )
678             {
679                cmLListInit(&(cfgEntData->rbCb->m.umUl.recBufLst[hashIndex]));
680             }
681          }
682          else if(RLC_MODE_AM == cfgToValidate->entMode)
683          {
684 #ifndef LTE_TDD 
685              uint32_t hashIndex;
686               RLC_ALLOC(gCb,
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++)
690               {
691                   cmLListInit(&(cfgEntData->rbCb->m.amUl.recBufLst[hashIndex]));
692               }
693 #endif
694          }
695          break;
696       }
697       case CKW_CFG_MODIFY: 
698       case CKW_CFG_DELETE:
699       {
700          if (cfgTmpData->ueId == 0)
701          {
702             /* Try to get the CellCb if it already exists */
703             rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
704             if(!cfgTmpData->cellCb)
705             {
706                DU_LOG("\nERROR  -->  RLC_UL : CellCb not found UEID:%d",
707                       cfgTmpData->ueId);
708                /*how can a modify request come for a cell which does not exist*/
709                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
710                return RFAILED;
711             }
712
713             cfgEntData->rbCb = cfgTmpData->cellCb->rbCb[cfgToValidate->rbId];
714             if (!cfgEntData->rbCb)
715             {
716                /* something is wrong the rbId for this cell does not exist */
717                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
718                return RFAILED;
719             }
720             return ROK;
721          }
722          else
723          {
724             rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
725             if(!cfgTmpData->ueCb)
726             {   
727                DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
728                      cfgTmpData->ueId);
729                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
730                return RFAILED;
731             }
732
733             /* Get rbCb */
734             RLC_DBM_GET_RBCB_FROM_UECB(cfgToValidate->rbId, 
735                                       cfgToValidate->rbType, 
736                                       cfgTmpData->ueCb, 
737                                       cfgEntData->rbCb);
738             if ( cfgEntData->rbCb == NULLP)
739             {
740                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_UNKWN;
741                return RFAILED;
742             }
743             return ROK;
744          }
745          break;
746       }
747    }
748
749    if(cfgToValidate->cfgType == CKW_CFG_MODIFY)
750    {
751       if(cfgToValidate->entMode != cfgEntData->rbCb->mode)
752       {
753          cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_RB_MODE_MIS;
754          return RFAILED;
755       }
756
757       if(cfgToValidate->m.umInfo.ul.snLen != cfgEntData->rbCb->m.umUl.snLen)
758       {
759          cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_SNLEN_MIS;
760          return RFAILED;
761       }
762    }
763    return ROK;
764 }
765
766 \f
767 /** 
768  * @brief 
769  *    This primitive roll back the RB Configuration
770  *  
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
775  *
776  * @return  S16
777  *    -# ROK
778  *    -# RFAILED
779  */
780 S16 rlcCfgRollBackUlRb
781 (
782 RlcCb             *gCb,
783 CmLteRnti        ueId,
784 RlcEntCfgInfo    *cfg,
785 RlcUlEntTmpData   *cfgEntData
786 )
787 {
788
789    if(CKW_CFG_ADD == cfg->cfgType)
790    {
791       if(RLC_MODE_UM == cfg->entMode)
792       {
793          RLC_FREE(gCb, cfgEntData->rbCb->m.umUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
794       }
795       else if(RLC_MODE_AM == cfg->entMode)
796       {
797 #ifndef LTE_TDD 
798       RLC_FREE(gCb,cfgEntData->rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp)));
799 #endif
800       }
801       RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
802    }
803
804    return ROK;
805 }
806
807 \f
808 /** 
809  * @brief 
810  *    This primitive apply RB Configuration. 
811  *  
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 
816  *
817  * @return  S16
818  *    -# ROK
819  *    -# RFAILED
820  */
821 Void rlcCfgApplyUlRb
822 (
823 RlcCb             *gCb,
824 RlcEntCfgInfo    *cfgToAply,
825 RlcUlEntTmpData   *cfgEntData,
826 RlcUlCfgTmpData   *cfgTmpData
827 )
828 {
829   
830    switch(cfgToAply->cfgType)
831    {
832       case CKW_CFG_ADD:
833       {
834          /* copy the RB Cb into UeCb */
835          cfgEntData->rbCb->rlcId.rbId = cfgToAply->rbId;
836          if (cfgTmpData->ueId == 0)
837          {
838             cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = cfgEntData->rbCb;
839             cfgTmpData->cellCb->lCh[cfgToAply->lCh[0].lChId -1].ulRbCb = cfgEntData->rbCb;
840          }
841          else
842          {
843             if(cfgToAply->rbType == CM_LTE_SRB)
844             {
845                cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = cfgEntData->rbCb;
846             }
847             else
848             {
849                cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = cfgEntData->rbCb;
850             }
851          }
852
853          RLC_LMM_RB_STS_INC(gCb);
854
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;
859
860          /* Fill RB CB */
861          rlcCfgFillUlRbCb(gCb,
862                          cfgEntData->rbCb, 
863                          cfgTmpData->ueCb,
864                          cfgToAply);
865
866 #ifdef LTE_L2_MEAS
867          cfgEntData->rbCb->qci = cfgToAply->qci;
868          cfgEntData->rbCb->ueCb =  cfgTmpData->ueCb;
869          if (cfgToAply->lCh[1].type == CM_LTE_LCH_DTCH)
870          {
871             /* ccpu00129778 */
872             rlcAddToUlL2Meas(gCb, cfgEntData->rbCb,
873                   cfgTmpData->cellId,cfgTmpData->ueId); 
874          }
875 #endif /* LTE_L2_MEAS */
876          break;
877       }
878       case CKW_CFG_MODIFY:
879       {
880          if(cfgTmpData->ueId == 0)
881          {
882             rlcCfgUpdateUlRb(gCb,
883                             cfgEntData->rbCb, 
884                             (void *)cfgTmpData->cellCb, 
885                             cfgToAply);
886          }
887          else
888          {
889             rlcCfgUpdateUlRb(gCb,
890                             cfgEntData->rbCb, 
891                             (void*)cfgTmpData->ueCb, 
892                             cfgToAply);
893          }
894          break;
895       }
896       case CKW_CFG_DELETE:
897       {
898          if (cfgTmpData->ueId == 0)
899          {
900             cfgTmpData->cellCb->rbCb[cfgToAply->rbId] = NULLP;
901             cfgTmpData->cellCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb = 
902                                                                         NULLP;
903          }
904          else
905          {
906             cfgTmpData->ueCb->lCh[cfgEntData->rbCb->lch.lChId - 1].ulRbCb = 
907                                                                        NULLP;
908
909             /* Free the Buffers of RbCb */
910             if( RLC_MODE_UM == cfgEntData->rbCb->mode )
911             {
912                rlcUmmFreeUlRbCb(gCb, cfgEntData->rbCb);
913             }
914             else if(RLC_MODE_AM == cfgEntData->rbCb->mode)
915             {
916                rlcAmmFreeUlRbCb(gCb,cfgEntData->rbCb);
917             }
918
919             /* Assign NULLP to rbCb in rbCbLst */
920             if ( cfgToAply->rbType == CM_LTE_SRB )
921             {
922                cfgTmpData->ueCb->srbCb[cfgToAply->rbId] = NULLP;
923             }
924             else
925             {
926                cfgTmpData->ueCb->drbCb[cfgToAply->rbId] = NULLP;
927             }
928          }
929          /* Delete RbCb  */
930          RLC_FREE(gCb,cfgEntData->rbCb, sizeof(RlcUlRbCb));
931
932          RLC_LMM_RB_STS_DEC(gCb);
933          break;
934       }
935    }
936    return;
937 }
938
939 \f
940 /** 
941  * @brief 
942  *    This primitive validates uplink Delete UE request 
943  *    for RB creation.
944  *  
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 
949  *
950  * @return  S16
951  *    -# ROK
952  *    -# RFAILED
953  */
954 S16 rlcCfgValidateDelUlUe
955 (
956 RlcCb             *gCb,
957 RlcEntCfgInfo    *cfgToValidate,
958 RlcUlEntTmpData   *cfgEntData,
959 RlcUlCfgTmpData   *cfgTmpData
960 )
961 {
962
963     DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d), cfgType(%d)",
964               cfgTmpData->cellId,cfgToValidate->cfgType);
965    
966    /* Check for ueId is present or not */
967    if ( cfgTmpData->ueId == 0 )
968    {
969       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_UE_UNKWN;
970       DU_LOG("\nERROR  -->  RLC_UL : UeId is 0 for CELLID;%d",
971             cfgTmpData->cellId);
972       return RFAILED;
973    }
974
975    /* Fetch Ue Cb */
976    if(ROK != rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb))
977    {
978       DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
979             cfgTmpData->ueId);
980       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_UE_UNKWN;
981       return RFAILED;
982    }
983    return ROK;
984 }
985
986 \f
987 /** 
988  * @brief 
989  *    This primitive apply Uplink Delete Ue request 
990  *  
991  * @param [in] gCb      -  RLC Instance Control Block
992  * @param [in] cfgTmpData    -  Configuration Temporary Data 
993  *
994  * @return  S16
995  *    -# ROK
996  */
997 Void rlcCfgApplyDelUlUe
998 (
999 RlcCb             *gCb,
1000 RlcUlCfgTmpData   *cfgTmpData
1001 )
1002 {
1003    
1004 #ifdef LTE_L2_MEAS
1005    rlcDelFrmUlL2Meas(gCb,cfgTmpData->cellId,cfgTmpData->ueId);
1006 #endif
1007    rlcDbmDelUlUeCb(gCb,cfgTmpData->ueCb, FALSE);
1008    return;
1009 }
1010   
1011 \f
1012 /** 
1013  * @brief 
1014  *    This primitive validates uplink Delete UE request 
1015  *    for RB creation.
1016  *  
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 
1022  *
1023  * @return  S16
1024  *    -# ROK
1025  *    -# RFAILED
1026  */
1027 S16 rlcCfgValidateDelUlCell
1028 (
1029 RlcCb             *gCb,
1030 CmLteCellId      cellId,
1031 RlcEntCfgInfo    *cfgToValidate,
1032 RlcUlEntTmpData   *cfgEntData,
1033 RlcUlCfgTmpData   *cfgTmpData
1034 )
1035 {
1036
1037    DU_LOG("\nDEBUG  -->  RLC_UL : cfgType(%d)",
1038               cfgToValidate->cfgType);
1039    
1040    cfgTmpData->cellCb = NULLP;
1041
1042    /* Check for cellId is present or not */
1043    if ( cellId == 0 )
1044    {
1045       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_CELL_UNKWN;
1046       DU_LOG("\nERROR  -->  RLC_UL : CellId is 0");
1047       return RFAILED;
1048    }
1049
1050    /* Fetch Cell Cb */
1051    rlcDbmFetchUlCellCb(gCb,cellId, &cfgTmpData->cellCb);
1052    if (!cfgTmpData->cellCb)
1053    {
1054       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_CELL_UNKWN;
1055       DU_LOG("\nERROR  -->  RLC_UL : CellCb not found");
1056       return RFAILED;
1057    }
1058    return ROK;
1059 }
1060
1061 \f
1062 /** 
1063  * @brief 
1064  *    This primitive apply Uplink Delete Ue request 
1065  *  
1066  * @param [in] gCb      -  RLC Instance Control Block
1067  * @param [in] cfgEntData  - Temporary Data maintained for a transaction 
1068  *
1069  * @return  S16
1070  *    -# ROK
1071  */
1072 Void rlcCfgApplyDelUlCell(RlcCb *gCb,RlcUlCfgTmpData *cfgInfo)
1073 {
1074    
1075    rlcDbmDelUlCellCb(gCb,cfgInfo->cellCb);
1076    return;
1077 }
1078 \f
1079 /** 
1080  * @brief 
1081  *    This primitive validates reestablishment of RB.
1082  *  
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
1088  *
1089  * @return  S16
1090  *    -# ROK
1091  *    -# RFAILED
1092  */
1093 S16 rlcCfgValidateReEstRb
1094 (
1095 RlcCb             *gCb,
1096 CmLteRnti        ueId,
1097 CmLteCellId      cellId,
1098 RlcEntCfgInfo    *cfgToValidate,
1099 RlcUlEntTmpData   *cfgEntData
1100 )
1101 {
1102    CmLteRlcId   rlcId;   /* RLC Identifier */
1103
1104     DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d) RBID:%d",
1105          cellId,
1106          cfgToValidate->rbId); 
1107
1108    /* Get rlcId */
1109    rlcId.ueId = ueId;
1110    rlcId.cellId = cellId;
1111    rlcId.rbId = cfgToValidate->rbId;
1112    rlcId.rbType = cfgToValidate->rbType;
1113
1114    rlcDbmFetchUlRbCbByRbId(gCb,&rlcId, &cfgEntData->rbCb);
1115    if (cfgEntData->rbCb == NULLP)
1116    {
1117       DU_LOG("\nERROR  -->  RLC_UL : CellId [%u]: rbId [%d] not found",
1118              cellId,
1119              cfgToValidate->rbId);
1120       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_RB_UNKWN;
1121       return RFAILED;
1122    }
1123
1124    return ROK;
1125 }
1126
1127
1128 \f
1129 /** 
1130  * @brief 
1131  *    This primitive apply reestablishment of RB.
1132  *  
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 
1138  *
1139  * @return  S16
1140  *    -# ROK
1141  */
1142 Void rlcCfgApplyReEstUlRb
1143 (
1144 RlcCb           *gCb,
1145 CmLteRnti       ueId,
1146 CmLteCellId     cellId,
1147 Bool            sndReEstInd,
1148 RlcUlEntTmpData *cfgEntData
1149 )
1150 {
1151    CmLteRlcId   rlcId;   /* RLC Identifier */
1152    
1153    rlcId.ueId = ueId;
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)
1159    {
1160       case RLC_MODE_TM:
1161          {
1162             rlcTmmUlReEstablish(gCb,cfgEntData->rbCb);
1163             break;
1164          }
1165
1166       case RLC_MODE_UM:
1167          {
1168             rlcUmmUlReEstablish(gCb,&rlcId,cfgEntData->rbCb);
1169             break;
1170          }
1171
1172       case RLC_MODE_AM:
1173          {
1174             rlcAmmUlReEstablish(gCb,rlcId,sndReEstInd,cfgEntData->rbCb);
1175             break;
1176          }
1177    }
1178    return;
1179 }
1180 \f
1181 /** 
1182  * @brief 
1183  *    This primitive validates reestablishment of RB.
1184  *  
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 
1189  *
1190  * @return  S16
1191  *    -# ROK
1192  *    -# RFAILED
1193  */
1194 S16 rlcCfgValidateUeIdChng
1195 (
1196 RlcCb            *gCb,
1197 CkwUeInfo        *ueInfo,
1198 CkwUeInfo        *newUeInfo,
1199 RlcUlCfgTmpData  *cfgTmpData
1200 )
1201 {
1202    RlcUlUeCb   *ueCb;
1203
1204 #define CFM_STATUS  cfgTmpData->cfgEntData[0].entUlCfgCfm.status
1205    if ( (ueInfo->ueId == newUeInfo->ueId) && 
1206         (ueInfo->cellId == newUeInfo->cellId))
1207    {
1208       CFM_STATUS.reason = CKW_CFG_REAS_SAME_UEID;
1209       CFM_STATUS.status = CKW_CFG_CFM_NOK; 
1210       return RFAILED;
1211    } 
1212    
1213    if(ROK == rlcDbmFetchUlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
1214    {
1215       DU_LOG("\nERROR  -->  RLC_UL : NewUeId[%d]:ueCb already exists",
1216              newUeInfo->ueId);
1217       CFM_STATUS.reason = CKW_CFG_REAS_UE_EXISTS;
1218       CFM_STATUS.status = CKW_CFG_CFM_NOK;
1219       return RFAILED;
1220    }
1221   
1222    if(ROK != rlcDbmFetchUlUeCb(gCb,ueInfo->ueId, ueInfo->cellId, 
1223                               &cfgTmpData->ueCb))
1224    {
1225       DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
1226             ueInfo->ueId);
1227       CFM_STATUS.reason = CKW_CFG_REAS_UE_UNKWN;
1228       CFM_STATUS.status = CKW_CFG_CFM_NOK;
1229       return RFAILED;
1230    }
1231 #undef CFM_STATUS
1232    return ROK;
1233 }
1234
1235
1236 \f
1237 /** 
1238  * @brief 
1239  *    This primitive apply reestablishment of RB.
1240  *  
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 
1245  *
1246  * @return  S16
1247  *    -# ROK
1248  */
1249 Void rlcCfgApplyUlUeIdChng
1250 (
1251 RlcCb            *gCb,
1252 CkwUeInfo        *ueInfo,
1253 CkwUeInfo        *newUeInfo,
1254 RlcUlCfgTmpData  *cfgTmpData
1255 )
1256 {
1257    
1258 #ifdef LTE_L2_MEAS
1259    rlcHdlMeasUlUeIdChg(gCb, ueInfo->cellId, ueInfo->ueId, newUeInfo->ueId);
1260 #endif   
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)))
1269
1270    {
1271        DU_LOG("\nERROR  -->  RLC_UL : UeId[%u] HashList Insertion Failed",
1272             newUeInfo->ueId);
1273    }
1274
1275    return;
1276 }
1277 /********************************************************************30**
1278
1279          End of file
1280 **********************************************************************/