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