[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / 5gnrrlc / rlc_tmr.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:    RLC - TMR module file
22     
23         Type:    C source file
24   
25         Desc:    Source code for timer functions such as, 
26
27                  - rlcStartTmr
28                  - rlcStopTmr
29                  - rlcTmrExpiry
30                  - rlcBndTmrExpiry  
31                   
32         File:    rlc_tmr.c
33   
34 *********************************************************************21*/
35
36 /* header (.h) include files */
37 #include "common_def.h"
38 #include "lkw.h"           /* LKW defines */
39 #include "ckw.h"           /* CKW defines */
40 #include "kwu.h"           /* KWU defines */
41 #include "rgu.h"           /* RGU defines */
42 #include "rlc_env.h"        /* RLC environment options */
43 #include "rlc_err.h"        /* Error defines */
44
45 /* extern (.x) include files */
46 #include "lkw.x"           /* LKW */
47 #include "ckw.x"           /* CKW */
48 #include "kwu.x"           /* KWU */
49 #include "rgu.x"           /* RGU */
50
51 #include "du_app_rlc_inf.h"
52 #include "rlc_utils.h"            /* RLC defines */
53 #include "rlc_dl_ul_inf.h"
54 #include "rlc_dl.h"
55 #include "rlc_ul.h"
56 #include "rlc_mgr.h"
57
58 /** 
59  * @file gp_tmr.c
60  * @brief RLC Timer Module
61 */
62
63 /* private function declarations */
64 static Void rlcBndTmrExpiry(PTR cb);
65
66
67 /**
68  * @brief Handler to start timer
69  *       
70  * @param[in] gCb       Pointer to the RLC instance control block
71  * @param[in] cb        Control block depending on the type of the timer event. 
72  *                      It can be uplink/downlink rbCb or rgu sap control block
73  * @param[in] tmrEvnt   Timer event to be started
74  *
75  * @return  Void
76 */
77 void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt)
78 {
79 /* kw005.201 added support for L2 Measurement */
80 #ifdef LTE_L2_MEAS
81    RlcL2MeasEvtCb *measEvtCb = NULLP;
82 #endif
83
84    CmTmrArg arg;
85    arg.wait = 0;
86
87    /* kw002.201 Adjusting the wait time as per timeRes configured by layer manager */
88    switch (tmrEvnt)
89    {
90       case EVENT_RLC_UMUL_REASSEMBLE_TMR:
91       {
92          RlcUmUl* umUl = &(((RlcUlRbCb *)cb)->m.umUl);
93          /* kw005.201 Changed wait calculation ccpu00117634*/ 
94          TMR_CALCUATE_WAIT(arg.wait, umUl->reAsmblTmrInt, gCb->genCfg.timeRes);
95
96          arg.timers = &umUl->reAsmblTmr;
97          arg.max = RLC_MAX_UM_TMR;
98          break;
99       }
100       case EVENT_RLC_AMUL_REASSEMBLE_TMR:
101       {
102          RlcAmUl* amUl = &(((RlcUlRbCb *)cb)->m.amUl);
103          /* kw005.201 Changed wait calculation ccpu00117634*/ 
104          TMR_CALCUATE_WAIT(arg.wait, amUl->reAsmblTmrInt, gCb->genCfg.timeRes);         
105
106          arg.timers = &amUl->reAsmblTmr;
107          arg.max = RLC_MAX_AM_TMR;
108          break;
109       }
110       case EVENT_RLC_AMUL_STA_PROH_TMR:
111       {
112          RlcAmUl* amUl = &(((RlcUlRbCb *)cb)->m.amUl);
113          /* kw005.201 Changed wait calculation ccpu00117634*/ 
114          TMR_CALCUATE_WAIT(arg.wait,
115                               amUl->staProhTmrInt,
116                               gCb->genCfg.timeRes);                  
117
118          arg.timers = &amUl->staProhTmr;
119          arg.max = RLC_MAX_AM_TMR;
120          break;
121       } 
122       case EVENT_RLC_AMDL_POLL_RETX_TMR:
123       {
124          RlcAmDl* amDl = &(((RlcDlRbCb *)cb)->m.amDl);
125          /* kw005.201 Changed wait calculation ccpu00117634*/ 
126          TMR_CALCUATE_WAIT(arg.wait, 
127                               amDl->pollRetxTmrInt, 
128                               gCb->genCfg.timeRes);                  
129
130          arg.timers = &amDl->pollRetxTmr;
131          arg.max = RLC_MAX_AM_TMR;
132          break;
133       } 
134       case EVENT_RLC_WAIT_BNDCFM:
135       {
136          RlcRguSapCb* rguSap = (RlcRguSapCb *)cb;
137          /* kw005.201 Changed wait calculation ccpu00117634*/ 
138          TMR_CALCUATE_WAIT(arg.wait, rguSap->bndTmrInt, gCb->genCfg.timeRes);                  
139
140          arg.timers = &rguSap->bndTmr;
141          arg.max = RLC_MAX_RGUSAP_TMR;
142          break;
143       }
144 /* kw005.201 added support for L2 Measurement */
145 #ifdef LTE_L2_MEAS
146       case EVENT_RLC_L2_TMR:
147       {
148          measEvtCb = (RlcL2MeasEvtCb *)cb;
149          /* kw005.201 Changed wait calculation ccpu00117634*/ 
150          TMR_CALCUATE_WAIT(arg.wait, 
151                               measEvtCb->l2TmrCfg.val, 
152                               gCb->genCfg.timeRes);                  
153
154          arg.timers = &measEvtCb->l2Tmr;
155          arg.max = RLC_L2_MAX_TIMERS;
156          break;
157       }
158 #endif
159       case EVENT_RLC_UE_THROUGHPUT_TMR:
160       {
161          RlcThpt *thptCb = (RlcThpt *)cb;
162          TMR_CALCUATE_WAIT(arg.wait, gConfigInfo.gUeThrptTimeIntervl, gCb->genCfg.timeRes);
163          arg.timers = &thptCb->ueTputInfo.ueThptTmr;
164          arg.max = RLC_MAX_THPT_TMR; 
165          break;
166       }
167       case EVENT_RLC_UE_DELETE_TMR:
168       {
169          RlcUlUeCb *ulUeCb = (RlcUlUeCb*)cb;
170          TMR_CALCUATE_WAIT(arg.wait, RLC_UE_DELETE_WAIT_TIME, gCb->genCfg.timeRes);
171          arg.timers = &ulUeCb->ueDeleteInfo.ueDelTmr;
172          arg.max = RLC_MAX_UE_TMR;
173          break;
174       }
175       case EVENT_RLC_SNSSAI_THROUGHPUT_TMR:
176       {
177          RlcThpt *thptCb = (RlcThpt *)cb;
178          TMR_CALCUATE_WAIT(arg.wait, gConfigInfo.gSnssaiThrptTimeIntervl, gCb->genCfg.timeRes);
179          arg.timers = &thptCb->snssaiTputInfo.snssaiThptTmr;
180          arg.max = RLC_MAX_THPT_TMR; 
181          break;
182       }
183       default:
184       {
185          DU_LOG("\nERROR  -->  RLC : rlcStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
186       }
187    } 
188
189    if(arg.wait != 0)
190    {
191       arg.tqCp   = &gCb->rlcTqCp;
192       arg.tq     = gCb->rlcTq;
193       arg.cb     = cb;
194       arg.evnt   = tmrEvnt;
195       arg.tNum   = 0;
196
197       cmPlcCbTq(&arg);
198    }
199
200    return;
201 }
202
203 /**
204  * @brief Handler to stop a timer
205  *       
206  * @param[in] gCb       Pointer to the RLC instance control block
207  * @param[in] cb        Control block depending on the type of the timer event. 
208  *                      It can be uplink/downlink rbCb or rgu sap control block
209  * @param[in] tmrType   Timer event to be started
210  *
211  * @return  Void
212 */
213 void rlcStopTmr(RlcCb *gCb, PTR cb, uint8_t tmrType)
214 {
215    CmTmrArg   arg;
216 /* kw005.201 added support for L2 Measurement */
217 #ifdef LTE_L2_MEAS
218    RlcL2MeasEvtCb *measEvtCb = NULLP;
219 #endif
220
221    arg.timers = NULLP;
222
223    switch (tmrType)
224    {
225       case EVENT_RLC_UMUL_REASSEMBLE_TMR:
226       {
227          arg.timers  = &((RlcUlRbCb *)cb)->m.umUl.reAsmblTmr;
228          arg.max = RLC_MAX_UM_TMR;
229          break;
230       }
231       case EVENT_RLC_AMUL_REASSEMBLE_TMR:
232       {
233          arg.timers = &((RlcUlRbCb *)cb)->m.amUl.reAsmblTmr;
234          arg.max = RLC_MAX_AM_TMR;
235          break;
236       }
237       case EVENT_RLC_AMUL_STA_PROH_TMR:
238       {
239          arg.timers = &((RlcUlRbCb *)cb)->m.amUl.staProhTmr;
240          arg.max = RLC_MAX_AM_TMR;
241          break;
242       } 
243       case EVENT_RLC_AMDL_POLL_RETX_TMR:
244       {
245          arg.timers = &((RlcDlRbCb *)cb)->m.amDl.pollRetxTmr;
246          arg.max = RLC_MAX_AM_TMR;
247          break;
248       } 
249       case EVENT_RLC_WAIT_BNDCFM:
250       {
251          arg.timers = &((RlcRguSapCb *)cb)->bndTmr;
252          arg.max = RLC_MAX_RGUSAP_TMR;
253          break;
254       }
255 /* kw005.201 added support for L2 Measurement */
256 #ifdef LTE_L2_MEAS
257       case EVENT_RLC_L2_TMR:
258       {
259          measEvtCb = (RlcL2MeasEvtCb *)cb;
260          arg.timers   = &measEvtCb->l2Tmr;
261          arg.max  = RLC_L2_MAX_TIMERS;
262          break;
263       }
264 #endif
265       case EVENT_RLC_UE_THROUGHPUT_TMR:
266       {
267          arg.timers   = &((RlcThpt *)cb)->ueTputInfo.ueThptTmr;
268          arg.max  = RLC_MAX_THPT_TMR;
269          break;
270       }
271       case EVENT_RLC_UE_DELETE_TMR:
272       {
273          arg.timers   = &((RlcUlUeCb*)cb)->ueDeleteInfo.ueDelTmr;
274          arg.max  = EVENT_RLC_UE_DELETE_TMR;
275          break;
276       }
277       case EVENT_RLC_SNSSAI_THROUGHPUT_TMR:
278       {
279          arg.timers   = &((RlcThpt *)cb)->snssaiTputInfo.snssaiThptTmr;
280          arg.max  = RLC_MAX_THPT_TMR;
281          break;
282       }
283       default:
284       {
285          DU_LOG("\nERROR  -->  RLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType);
286          break;
287       }
288    } 
289    if (tmrType != TMR0)
290    {
291       arg.tqCp   = &gCb->rlcTqCp;
292       arg.tq     = gCb->rlcTq;
293       arg.cb     = cb;
294       arg.evnt   = tmrType;
295       arg.wait   = 0;
296       arg.tNum   = 0;
297       cmRmvCbTq(&arg);
298    }
299    
300    return;
301 }
302
303 /**
304  * @brief Handler to invoke events on expiry of timer.
305  *
306  * @details
307  *    This function is used to handle expiry of timer,it invokes relevant 
308  *    functions.
309  *       
310  * @param[in] cb        Control block depending on the type of the timer event. 
311  *                      It can be uplink/downlink rbCb or rgu sap control block
312  * @param[in] tmrEvnt   Timer event to be started
313  *
314  * @return  Void
315 */
316 Void rlcTmrExpiry(PTR cb,S16 tmrEvnt)
317 {
318 /* kw005.201 added support for L2 Measurement */
319
320    switch (tmrEvnt)
321    {
322       case EVENT_RLC_UMUL_REASSEMBLE_TMR:
323       {
324          RlcUlRbCb *ulRbCb = (RlcUlRbCb *)cb;
325          rlcUmmReAsmblTmrExp(RLC_GET_RLCCB(ulRbCb->inst), ulRbCb);
326
327          break;
328       }
329       case EVENT_RLC_AMUL_REASSEMBLE_TMR:
330       {
331          RlcUlRbCb *ulRbCb = (RlcUlRbCb *)cb;
332          rlcAmmReAsmblTmrExp(RLC_GET_RLCCB(ulRbCb->inst), ulRbCb);
333          break;
334       }
335       case EVENT_RLC_AMUL_STA_PROH_TMR:
336       {
337          RlcUlRbCb *ulRbCb = (RlcUlRbCb *)cb;
338          rlcAmmStaProTmrExp(RLC_GET_RLCCB(ulRbCb->inst), ulRbCb);
339
340          break;
341       }
342       case EVENT_RLC_AMDL_POLL_RETX_TMR:
343       {
344          RlcDlRbCb *dlRbCb = (RlcDlRbCb *)cb;
345          RlcCb *gCb = RLC_GET_RLCCB(dlRbCb->inst);
346          
347          rlcAmmPollRetxTmrExp(gCb, dlRbCb);
348
349          gCb->genSts.protTimeOut++;
350          break;
351       }
352       case EVENT_RLC_WAIT_BNDCFM:
353       {
354          rlcBndTmrExpiry(cb);
355          break;
356       }
357       case EVENT_RLC_UE_THROUGHPUT_TMR:
358       {
359          rlcUeThptTmrExpiry(cb);
360          break;
361       }
362       case EVENT_RLC_UE_DELETE_TMR:
363       {
364          rlcUeDeleteTmrExpiry(cb);
365          break;
366       }
367       case EVENT_RLC_SNSSAI_THROUGHPUT_TMR:
368       {
369          rlcSnssaiThptTmrExpiry(cb);
370          break;
371       }
372       default:
373       {
374          break;
375       }
376    }
377
378    return;
379 }
380
381 /**
382  * @brief Handler to check if the timer is running
383  *       
384  * @param[in] gCb       Pointer to the RLC instance control block
385  * @param[in] cb        Control block depending on the type of the timer event. 
386  *                      It can be uplink/downlink rbCb or rgu sap control block
387  * @param[in] tmrEvnt   Timer event to be started
388  *
389  * @return  Bool indicating whether the timer is running or not
390  *      -# ROK 
391  *      -# RFAILED 
392 */
393 bool rlcChkTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt)
394 {
395    switch (tmrEvnt)
396    {
397       case EVENT_RLC_UMUL_REASSEMBLE_TMR:
398       {
399          return (((RlcUlRbCb *)cb)->m.umUl.reAsmblTmr.tmrEvnt == 
400                   EVENT_RLC_UMUL_REASSEMBLE_TMR);
401       }
402       case EVENT_RLC_AMUL_REASSEMBLE_TMR:
403       {
404          return (((RlcUlRbCb *)cb)->m.amUl.reAsmblTmr.tmrEvnt == 
405                   EVENT_RLC_AMUL_REASSEMBLE_TMR);
406       }
407       case EVENT_RLC_AMUL_STA_PROH_TMR:
408       {
409          return (((RlcUlRbCb *)cb)->m.amUl.staProhTmr.tmrEvnt == 
410                   EVENT_RLC_AMUL_STA_PROH_TMR);
411       } 
412       case EVENT_RLC_AMDL_POLL_RETX_TMR:
413       {
414          return (((RlcDlRbCb *)cb)->m.amDl.pollRetxTmr.tmrEvnt == 
415                   EVENT_RLC_AMDL_POLL_RETX_TMR);
416       } 
417       case EVENT_RLC_WAIT_BNDCFM:
418       {
419          return (((RlcRguSapCb *)cb)->bndTmr.tmrEvnt == EVENT_RLC_WAIT_BNDCFM);
420       }
421       case EVENT_RLC_UE_THROUGHPUT_TMR:
422       {
423          return (((RlcThpt *)cb)->ueTputInfo.ueThptTmr.tmrEvnt == EVENT_RLC_UE_THROUGHPUT_TMR);
424       }
425       case EVENT_RLC_UE_DELETE_TMR:
426       {
427          return (((RlcUlUeCb *)cb)->ueDeleteInfo.ueDelTmr.tmrEvnt == EVENT_RLC_UE_DELETE_TMR);
428       }
429       case EVENT_RLC_SNSSAI_THROUGHPUT_TMR:
430       {
431          return (((RlcThpt *)cb)->snssaiTputInfo.snssaiThptTmr.tmrEvnt == EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
432       }
433       default:
434       {
435          DU_LOG("\nERROR  -->  RLC : rlcChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
436       }
437    } 
438
439    return FALSE;
440 }
441
442 /**
443  * @brief Handler to do processing on expiry of the bind timer
444  *
445  * @details
446  *    This function processes the RLC bind timer expiry. If the number of
447  *    retries is less than the maximum retry counter, bind request is sent
448  *    again, else an alarm is raised to the layer manager.
449  *
450  * @param[in] cb  Pointer to the Rgu sap
451  *
452  * @return  Void
453 */
454 static Void rlcBndTmrExpiry(PTR cb)
455 {
456    RlcRguSapCb *rguSapCb;
457
458    rguSapCb = (RlcRguSapCb *) cb;
459
460    if (rguSapCb->state == RLC_SAP_BINDING)
461    {
462       if (rguSapCb->retryCnt < RLC_MAX_SAP_BND_RETRY)
463       {
464          /* start timer to wait for bind confirm */
465          rlcStartTmr(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
466                     (PTR)rguSapCb,
467                     EVENT_RLC_WAIT_BNDCFM);
468
469          /* Send bind request */
470          rguSapCb->retryCnt++;
471          RlcLiRguBndReq (&rguSapCb->pst, rguSapCb->suId, rguSapCb->spId);
472       }
473       else
474       {
475          rguSapCb->retryCnt = 0;
476          rguSapCb->state = RLC_SAP_CFG;
477
478          /* Send alarm to the layer manager */
479 #ifdef LTE_L2_MEAS
480          rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
481                         LCM_CATEGORY_INTERFACE,
482                         LCM_EVENT_BND_FAIL,
483                         LCM_CAUSE_TMR_EXPIRED,
484                         0,
485                         0,
486                         0);
487 #else
488          rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
489                         LCM_CATEGORY_INTERFACE,
490                         LCM_EVENT_BND_FAIL,
491                         LCM_CAUSE_TMR_EXPIRED,
492                         0, /* suId */
493                         0 /* ueId */);
494 #endif
495       }
496    }
497
498    return;
499 }
500
501 /**
502  * @brief Handler to do processing on expiry of UE throughput timer
503  *
504  * @details
505  *    This function processes the RLC UE throughput timer expiry.
506  *
507  * @param[in] cb  Pointer to the RLC throughput struct
508  *
509  * @return  Void
510  */
511 void rlcUeThptTmrExpiry(PTR cb)
512 {
513    uint16_t  ueIdx;
514    long double tpt;
515    RlcThpt *rlcThptCb = (RlcThpt*)cb; 
516    
517    /* If cell is not up, throughput details cannot be printed */
518    if(gConfigInfo.gCellStatus != CELL_UP)
519    {
520       /* Restart timer */
521       rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_UE_THROUGHPUT_TMR);
522       return;
523    }
524
525    /* If cell is up, print throughout for each UE attached to the cell */
526    DU_LOG("\n===================== DL Throughput Per UE==============================");
527    DU_LOG("\nNumber of UEs : %d", rlcThptCb->ueTputInfo.numActvUe);
528    if(rlcThptCb->ueTputInfo.numActvUe)
529    {
530       for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
531       {
532          if(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].ueId)
533          {
534             /* Spec 28.552, section 5.1.1.3 : 
535              * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds
536              * 
537              * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e. 
538              * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms
539              */
540              tpt = (double)(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol * 8)/(double)gConfigInfo.gUeThrptTimeIntervl;
541       
542              DU_LOG("\nUE Id : %d   DL Tpt : %.2Lf", rlcThptCb->ueTputInfo.thptPerUe[ueIdx].ueId, tpt);
543              rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol = 0;
544          }
545       }
546    }
547    DU_LOG("\n==================================================================");
548
549    /* Restart timer */
550    rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_UE_THROUGHPUT_TMR);
551
552    return;
553 }
554
555 /**
556  * @brief Handler to do processing on expiry of the SNSSAI throughput timer
557  *
558  * @details
559  *    This function processes the RLC SNSSAI throughput timer expiry.
560  *
561  * @param[in] cb  Pointer to the RLC throughput struct
562  *
563  * @return  Void
564  */
565 void rlcSnssaiThptTmrExpiry(PTR cb)
566 {
567    RlcThpt *rlcThptCb = (RlcThpt*)cb; 
568    
569    static uint8_t snssaiCntDl = 0, snssaiCntUl = 0;
570    /*Bit map to keep record of reception of DL and UL Snssai Tput expiry*/
571    static uint8_t snssaiTputBitmap = DIR_NONE;
572
573    /* If cell is not up, throughput details cannot be printed */
574    if(gConfigInfo.gCellStatus != CELL_UP)
575    {
576       /* Restart timer */
577       rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
578       return;
579    }
580    
581    if(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList != NULLP)
582    {
583       snssaiCntDl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList, DIR_DL);
584       snssaiTputBitmap |= DIR_DL;
585       arrTputPerSnssai[DIR_DL] = rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList;
586    }
587    if(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList != NULLP)
588    {
589       snssaiCntUl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList, DIR_UL);
590       snssaiTputBitmap |= DIR_UL;
591       arrTputPerSnssai[DIR_UL] = rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList;
592    }
593    if(snssaiTputBitmap == DIR_BOTH)
594    {
595       //call the function
596       BuildSliceReportToDu(MAX(snssaiCntUl, snssaiCntDl));
597       snssaiTputBitmap = DIR_NONE;
598    }
599    /* Restart timer */
600    rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
601    return;
602 }
603 /**
604 *
605 * @brief filling RLC UE delete configuration
606 *
607 * @details
608 *    filling RLC UE delete configuration
609 *
610 * @params[in] RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg
611 *
612 * @return void
613 *
614 */
615
616 void fillRlcUeDelInfo(RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg)
617 {
618    uint8_t lcIdx;
619
620    rlcUeCfg->ueId    = ueCb->ueId;
621    rlcUeCfg->cellId  = ueCb->cellId;
622    rlcUeCfg->numEnt = 0;
623    for(lcIdx=0; lcIdx<RLC_MAX_LCH_PER_UE && rlcUeCfg->numEnt < 1; lcIdx++)
624    {
625       if(ueCb->lCh[lcIdx].ulRbCb != NULLP)
626       {
627          rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbId    = 0;
628          rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbType  = 0;
629          rlcUeCfg->entCfg[rlcUeCfg->numEnt].cfgType = CKW_CFG_DELETE_UE;
630          rlcUeCfg->numEnt++;
631       }
632    }
633 }
634
635 /**
636 * @brief Handler to do processing on expiry of the UE delete timer
637 *
638 * @details
639 *    This function processes the RLC UE delete timer expiry.
640 *
641 * @param[in] cb  Pointer to the RlcUlUeCb  
642 *
643 * @return  uint8_t
644 */
645
646 uint8_t rlcUeDeleteTmrExpiry(PTR cb)
647 {
648    RlcCb *gRlcCb = NULLP;
649    RlcCfgInfo *rlcUeCfg = NULLP;
650    RlcUlUeCb *ueCb = (RlcUlUeCb*)cb;
651
652    gRlcCb = RLC_GET_RLCCB(ueCb->ueDeleteInfo.pst.dstInst);
653    RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
654    if(rlcUeCfg == NULLP)
655    {
656       DU_LOG("\nERROR  -->  RLC: rlcUeDeleteTmrExpiry(): Failed to allocate memory");
657       return RFAILED;
658    }
659    memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
660    fillRlcUeDelInfo(ueCb, rlcUeCfg);
661    if(RlcProcCfgReq(&ueCb->ueDeleteInfo.pst, rlcUeCfg) != ROK)
662    {
663       DU_LOG("\nERROR  -->  RLC: rlcUeDeleteTmrExpiry(): Failed to delete UE");
664       if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, UEID_INVALID) != ROK)
665       {
666          DU_LOG("ERROR  --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response ");
667          return RFAILED;
668       }
669    }
670    return ROK;
671 }
672 \f  
673 /********************************************************************30**
674   
675          End of file
676 **********************************************************************/