SLice Mapping to RLC DB [ Jira Id - ODUHIGH-371 ]
[o-du/l2.git] / src / 5gnrrlc / rlc_dbm_dl.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 - Database module file
22     
23         Type:    C source file
24   
25         Desc:    Source code for Database Module functions such as, 
26
27                  - rlcDbmInit
28                  - kwDbmDeInit
29                  - kwDbmCreateRbCb
30                  - kwDbmFetchRbCb 
31                  - kwDbmUpdateRbCb
32                  - kwDbmDelRbCb
33                  - kwDbmDelAllRb
34                  - kwDbmCreateUeCb
35                  - kwDbmFetchUeCb
36                  - kwDbmUpdateUeCb
37                  - kwDbmDelUeCb
38                  - kwDbmDelAllUe
39                  - kwDbmDelMeasEvtCb
40                  - kwDbmCreateCellCb
41                  - kwDbmFetchCellCb
42                  - kwDbmUpdateCellCb
43                  - kwDbmDelCellCb
44                  - kwDbmDelAllCell
45                  - kwDbmShutdown
46
47         File:    rlc_dbm_dl.c
48   
49 *********************************************************************21*/
50
51 \f
52 /* header (.h) include files */
53 #include "common_def.h"
54 #include "lkw.h"           /* LKW defines */
55 #include "ckw.h"           /* CKW defines */
56 #include "rgu.h"           /* RGU defines */
57 #include "kwu.h"           /* KWU defines */
58 #include "rlc_err.h"        /* Err defines */
59 #include "rlc_env.h"        /* RLC environment options */
60
61
62 /* extern (.x) include files */
63 #include "lkw.x"           /* LKW */
64 #include "ckw.x"           /* CKW */
65 #include "rgu.x"           /* RGU */
66 #include "kwu.x"           /* KWU */
67
68 #include "rlc_utils.h"            /* RLC defines */
69 #include "rlc_dl_ul_inf.h"
70 #include "rlc_dl.h"
71
72 #ifdef TENB_STATS
73 TSL2UeStatsCb* TSL2MapUeStatsBlk (uint16_t rnti);
74 #endif
75 /** 
76  * @file gp_dbm_dl.c
77  * @brief RLC Downlink database module
78 */
79 #define RLC_MODULE RLC_DBGMASK_DUT
80 \f
81
82 /**
83  * @brief Handler to initialize hash list
84  *       
85  * @details
86  *    This function initializes the UeCb, CellCb hash lists
87  *
88  *  @return  S16
89  *     -# ROK 
90  *     -# RFAILED 
91 */
92 S16 rlcDbmDlInit(RlcCb *gCb)
93 {
94
95    /* Initialize ueCb Hash List */
96    if(ROK != cmHashListInit(&(gCb->u.dlCb->ueLstCp), 
97                             (uint16_t) RLC_UE_LIST_BUCKET_SIZE,
98                             (uint16_t) 0, 
99                             (Bool) FALSE, 
100                             (uint16_t) CM_HASH_KEYTYPE_CONID,
101                             RLC_GET_MEM_REGION(gCb), 
102                             RLC_GET_MEM_POOL(gCb)))
103    {   
104       DU_LOG("\nERROR  -->  RLC_DL : UeLstCp Initialization Failed");
105       return RFAILED;
106    }
107
108    /* Initialize cellCb Hash List */
109    if(ROK != cmHashListInit(&(gCb->u.dlCb->cellLstCp), 
110                             (uint16_t) RLC_CELL_LIST_BUCKET_SIZE,
111                             (uint16_t) 0, 
112                             (Bool) FALSE, 
113                             (uint16_t) CM_HASH_KEYTYPE_CONID,
114                             RLC_GET_MEM_REGION(gCb), 
115                             RLC_GET_MEM_POOL(gCb)))
116    {
117       cmHashListDeinit(&gCb->u.dlCb->ueLstCp);
118       DU_LOG("\nERROR  -->  RLC_DL : CellLstCp Initialization Failed");
119       return RFAILED;
120    }
121
122 /* kw005.201 added support for L2 Measurement */         
123 #ifdef LTE_L2_MEAS_RLC
124    /* Initialize qcI Hash List */
125    if(ROK != cmHashListInit(&(rlcCb.rlcL2Cb.qciHlCp), 
126                             (uint16_t) RLC_QCI_LIST_BUCKET_SIZE,
127                             (uint16_t) 0, 
128                             (Bool) TRUE, 
129                             (uint16_t) CM_HASH_KEYTYPE_DEF,
130                             rlcCb.init.region, 
131                             rlcCb.init.pool))
132    {
133       cmHashListDeinit(&gCb->u.dlCb->cellLstCp);
134       cmHashListDeinit(&gCb->u.dlCb->ueLstCp);
135       DU_LOG("\nERROR  -->  RLC_DL : rlcDbmInit: cmHashListInit Failed for rlcCb.qciHlCp");
136       return RFAILED;
137    }
138    
139    /* Initialize tbHlCp Hash List */
140    if(ROK != cmHashListInit(&(rlcCb.rlcL2Cb.tbHlCp), 
141                             (uint16_t) RLC_TB_LIST_BUCKET_SIZE,
142                             (uint16_t) 0, 
143                             (Bool) FALSE, 
144                             (uint16_t) CM_HASH_KEYTYPE_DEF,
145                             rlcCb.init.region, 
146                             rlcCb.init.pool))
147    {
148       cmHashListDeinit(&rlcCb.rlcL2Cb.qciHlCp);
149       cmHashListDeinit(&gCb->u.dlCb->cellLstCp);
150       cmHashListDeinit(&gCb->u.dlCb->ueLstCp);
151       DU_LOG("\nERROR  -->  RLC_DL : rlcDbmInit: cmHashListInit Failed for rlcCb.tbHlCp");
152       return RFAILED;
153    }
154 #endif /* LTE_L2_MEAS */
155
156    return ROK;
157 } /* rlcDbmDlInit */
158
159 \f
160 /**
161  * @brief Handler to De initialize hash list
162  *       
163  * @param[in]    gCb      RLC Instance Control Block
164  *
165  * @return  Void
166 */
167 Void rlcDbmDlDeInit(RlcCb *gCb)
168 {
169
170
171    /* De Initialize ueCb Hash List */
172    cmHashListDeinit(&(gCb->u.dlCb->ueLstCp));
173
174    /* De Initialize cellCb Hash List */
175    cmHashListDeinit(&(gCb->u.dlCb->cellLstCp));
176
177 /* kw005.201 added support for L2 Measurement */         
178 #ifdef LTE_L2_MEAS_RLC
179    /* De Initialize qciCb Hash List */
180    cmHashListDeinit(&(rlcCb.rlcL2Cb.qciHlCp));
181
182    /* De Initialize tbHlCp Hash List */
183    cmHashListDeinit(&(rlcCb.rlcL2Cb.tbHlCp));
184    
185 #endif /* LTE_L2_MEAS */
186
187    return;
188 } /* rlcDbmDlDeInit */
189
190 \f
191 /**
192  * @brief Handler to fetch rbCb by the rlcId
193  *       
194  * @details
195  *    This function is invoked by CFG to fetch rbCb from the cellCb/ueCb in
196  *    the upper interface (CKW/KWU).
197  *
198  *  @param[in]    gCb     RLC Instance Control Block
199  *  @param[in]    rlcId   RLC Identifier 
200  *  @param[out]   rbCb    RB Control Block
201  *
202  *  @return  Void
203 */
204 void rlcDbmFetchDlRbCbByRbId(RlcCb *gCb,CmLteRlcId *rlcId, RlcDlRbCb **rbCb)
205 {
206    *rbCb= NULLP;
207    
208    /* Check for UE CB or CELL CB */
209    if (rlcId->ueId == 0)
210    {
211       RlcDlCellCb *cellCb;
212       
213       if(rlcId->rbId >= RLC_MAX_RB_PER_CELL)
214       {
215          DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbByRbId : Invalid RbId, Max is [%d] \
216             UEID:%d CELLID:%d", RLC_MAX_RB_PER_CELL, rlcId->ueId, rlcId->cellId);
217          return;
218       }
219
220       rlcDbmFetchDlCellCb(gCb,rlcId->cellId, &cellCb);
221       if(!cellCb)
222       {
223          DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbByRbId : CellCb[%d] not found UEID:%d \
224             RBID:%d", rlcId->cellId, rlcId->ueId, rlcId->rbId);
225          return;
226       }
227
228       *rbCb = cellCb->rbCb[rlcId->rbId];
229    }
230    else
231    {
232       RlcDlUeCb *ueCb;
233       if (!(RLC_VALIDATE_UE_RBID(rlcId->rbType, rlcId->rbId)))
234       {
235          DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbByRbId : Invalid RbId[%d] for RbType[%d] \
236             RBID:%d CELLID:%d", rlcId->rbId, rlcId->rbType, rlcId->ueId, rlcId->cellId);
237          return;
238       }
239       
240       if (ROK != rlcDbmFetchDlUeCb(gCb,rlcId->ueId, rlcId->cellId, &ueCb))
241       {
242          DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbByRbId : UeId [%d]: UeCb not found RBID:%d",\
243             rlcId->ueId, rlcId->rbId);
244          return;
245       }
246
247       RLC_DBM_GET_RBCB_FROM_UECB(rlcId->rbId, rlcId->rbType, ueCb, *rbCb);
248    }
249
250    return;
251 } /* rlcDbmFetchDlRbCbByRbId */
252
253 \f
254 /**
255  * @brief Handler to fetch rbCb from Local Channel Id 
256  *
257  * @details
258  *    This function is invoked by CFG to fetch rbCb from the cellCb/ueCb
259  *    from local Channel Id (CKW/KWU).
260  *
261  * @param[in]    gCb      -  RLC Instance Control Block
262  * @param[in]    cellId   -  CELL Identifier 
263  * @param[in]    ueId     -  UE Identifier 
264  * @param[in]    lcId     -  Logical Channel Identifier
265  * @param[out]   rbCb     -  RB Control Block
266  *
267  * @return  Void
268  *
269 */
270 void rlcDbmFetchDlRbCbFromLchId(RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId, \
271 CmLteLcId lcId, RlcDlRbCb **rbCb)
272 {
273    RlcDlUeCb *ueCb;
274    
275    /* Check for UE CB or CELL CB */
276    if (ueId == 0)
277    {
278       RlcDlCellCb *cellCb;
279       
280       rlcDbmFetchDlCellCb(gCb, cellId, &cellCb);
281       if(!cellCb)
282       {
283          DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbFromLchId: CellCb[%d] not found UEID:%d", \
284             cellId, ueId);
285          return;
286       }
287
288       *rbCb = cellCb->lCh[lcId - 1].dlRbCb;
289       return;
290    }
291
292    if (rlcDbmFetchDlUeCb(gCb, ueId, cellId, &ueCb) != ROK)
293    {
294       DU_LOG("\nERROR  -->  RLC_DL : rlcDbmFetchDlRbCbFromLchId: UeId [%d]: UeCb not found",ueId);
295       return;
296    }
297
298    *rbCb = ueCb->lCh[lcId - 1].dlRbCb;
299
300    return;
301 } /* rlcDbmFetchDlRbCbFromLchId */
302
303 \f
304 /**
305  * @brief Handler to delete RbCb
306  *       
307  * @details 
308  *    This function is invoked by CFG to remove RbCb from Ue/Cell hashlist 
309  *
310  * @param[in] gCb       - RLC Instance Control Block
311  * @param[in] rbCbLst   - Rb Cb List
312  * @param[in] numRbCb   - Number of rbCbs
313  *
314  * @return  Void
315  *
316 */
317 Void rlcDbmDelAllDlRb(RlcCb *gCb,RlcDlRbCb **rbCbLst,uint8_t numRbCb)
318 {
319    uint32_t idx;
320
321
322    for (idx = 0; idx < numRbCb; idx++)
323    {
324       if (rbCbLst[idx] != NULLP)
325       {
326 #ifdef LTE_L2_MEAS
327          RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(gCb, (rbCbLst[idx]));
328 #endif
329          if( RLC_MODE_UM == rbCbLst[idx]->mode)
330          {
331             rlcUmmFreeDlRbCb(gCb,rbCbLst[idx]);
332             RLC_FREE (gCb,rbCbLst[idx], sizeof (RlcDlRbCb));       
333          }
334          else if( RLC_MODE_AM == rbCbLst[idx]->mode)
335          {
336             rlcAmmFreeDlRbCb(gCb,rbCbLst[idx]);
337          }
338          /* ccpu00136940 */
339          else if(RLC_MODE_TM == rbCbLst[idx]->mode)
340          {
341             cmLListCatLList(&(gCb->u.dlCb->toBeFreed.sduLst),&(rbCbLst[idx]->m.tm.sduQ));
342             RLC_FREE (gCb,rbCbLst[idx]->snssai, sizeof (Snssai));
343             RLC_FREE (gCb,rbCbLst[idx], sizeof (RlcDlRbCb));       
344          }
345
346       }
347
348    }
349
350    return;
351 } /* rlcDbmDelAllDlRb */
352
353 \f
354 /**
355  * @brief  Handler to create an UeCb
356  *
357  * @details  
358  *    This function is invoked by CFG to create UeCb and insert into the 
359  *    Ue hashlist of RlcCb.
360  *
361  * @param[in] gCb       RLC Instance Control Block
362  * @param[in] ueId      UE Identifier 
363  * @param[in] cellId    Cell Identifier 
364  * @param[in] ueCb      UE Control Block 
365  *
366  * @return  S16
367  *    -# ROK 
368  *    -# RFAILED 
369  *
370 */
371 S16 rlcDbmCreateDlUeCb(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcDlUeCb **ueCb)
372 {
373    RlcDlUeCb *tUeCb;        
374
375    RLC_ALLOC(gCb,*ueCb, sizeof(RlcDlUeCb));
376
377 #if (ERRCLASS & ERRCLS_ADD_RES)
378    if (*ueCb == NULLP)
379    {   
380       DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed cellID:%d",
381             cellId);
382       return RFAILED;
383    }
384 #endif /* ERRCLASS & ERRCLS_ADD_RES */
385
386    tUeCb = *ueCb;
387    tUeCb->ueId = ueId;
388    tUeCb->cellId = cellId;
389
390    if (ROK != cmHashListInsert(&(gCb->u.dlCb->ueLstCp), 
391                                (PTR)tUeCb, 
392                                (uint8_t *)&(tUeCb->ueId),
393                                (uint16_t) sizeof(CmLteRnti)))
394    {
395       DU_LOG("\nERROR  -->  RLC_DL : UeId[%u] HashList Insertion Failed",
396             ueId);
397       return RFAILED;
398    }
399    /* kw005.201 ccpu00117318, updating the statistics */
400    gCb->genSts.numUe++;
401
402
403    return ROK;
404 } /* kwDbmCreateUeCb */
405
406 \f
407 /**
408  * @brief Handler to Fetch an UeCb
409  *
410  * @details
411  *    This function is invoked by CFG to fetch UeCb from the Ue hashlist 
412  *    of RlcCb.
413  *
414  * @param[in]    gCb       RLC Instance Control Block 
415  * @param[in]    ueId      UE Identifier 
416  * @param[in]    cellId    Cell Identifier 
417  * @param[out]   ueCb      UE Control Block
418  *
419  * @return  S16
420  *    -# ROK 
421  *    -# RFAILED 
422 */
423 uint8_t rlcDbmFetchDlUeCb(RlcCb *gCb, CmLteRnti ueId, CmLteCellId  cellId, RlcDlUeCb **ueCb)
424 {
425    return (cmHashListFind(&(gCb->u.dlCb->ueLstCp), 
426                            (uint8_t *)&(ueId), 
427                            sizeof(CmLteRnti),
428                            RLC_DEF_SEQ_NUM, 
429                            (PTR *) ueCb));
430 } /* rlcDbmFetchDlUeCb */
431
432 \f
433 /**
434  * @brief Handler to delete an UeCb
435  *
436  * @details
437  *    This function is invoked by CFG to delete UeCb from the Ue hashlist 
438  *    of RlcCb.
439  *
440  *
441  * @param[in] gCb      RLC Instance Control Block
442  * @param[in] ueCb     UE Control Block
443  * @param[in] abrtFlag Abort Flag
444  *
445  * @return Void
446  *
447 */
448 Void rlcDbmDelDlUeCb(RlcCb *gCb,RlcDlUeCb *ueCb,Bool abortFlag)
449 {
450
451 #if  (!defined(KW_PDCP) || !(defined(PJ_SEC_ASYNC) || defined(PJ_CMP_ASYNC)))
452    UNUSED(abortFlag);
453 #endif /* (!defined(KW_PDCP) || ! (defined(PJ_SEC_ASYNC) || 
454           defined(PJ_CMP_ASYNC)))*/
455
456    /* Delete all logical channels */
457    RLC_MEM_ZERO(ueCb->lCh,sizeof(RlcDlLch) * RLC_MAX_LCH_PER_UE);
458
459    /* Delete all SRB RbCbs in UeCb */
460    rlcDbmDelAllDlRb(gCb,ueCb->srbCb, RLC_MAX_SRB_PER_UE);
461
462    /* Delete all DRB RbCbs in UeCb */
463    rlcDbmDelAllDlRb(gCb,ueCb->drbCb, RLC_MAX_DRB_PER_UE);
464
465    /* Delete ueCb entry from ueLstCp */
466    if(ROK != cmHashListDelete(&(gCb->u.dlCb->ueLstCp), (PTR) ueCb))
467    {
468       DU_LOG("\nERROR  -->  RLC_DL : UeId[%u] HashList Insertion Failed",
469             ueCb->ueId);
470    }
471    memset(&gCb->rlcThpt.thptPerUe[ueCb->ueId -1], 0, sizeof(RlcThptPerUe));
472    gCb->rlcThpt.numActvUe--;
473    
474    /* kw005.201 ccpu00117318, updating the statistics */
475    gCb->genSts.numUe--;
476    
477    /* Deallocate ueCb */
478    RLC_FREE(gCb,ueCb, sizeof(RlcDlUeCb));
479
480    return;
481 } /* kwDbmDelUeCb */
482
483 \f
484 /**
485  * @brief Handler to delete all UeCbs
486  *
487  * @details
488  *    This function is invoked by CFG to delete all UeCbs from the Ue 
489  *    hashlist of RlcCb.
490  *
491  * @param[in] gCb      RLC Instance Control Block
492  *
493  * @return  Void
494 */
495 Void rlcDbmDelAllDlUe(RlcCb  *gCb)
496 {
497    RlcDlUeCb *ueCb = NULLP; 
498
499    /* Until no more ueCb is ueLstCp hash list get and delete ueCb */
500    while (ROK == cmHashListGetNext(&(gCb->u.dlCb->ueLstCp), 
501                                    (PTR) ueCb, 
502                                    (PTR *)&ueCb))
503    {
504       /* Delete ueCb */
505       rlcDbmDelDlUeCb(gCb,ueCb, TRUE);
506
507       ueCb = NULLP;
508    }
509
510    return;
511 } /* kwDbmDelAllUe */
512
513 /* kw005.201 added support for L2 Measurement */         
514 #ifdef LTE_L2_MEAS
515 Void rlcDbmDelAllDlL2MeasTbFrmUe(RlcCb *gCb,RlcDlUeCb  *ueCb)
516 {
517    uint8_t       tbIdx;
518    RlcL2MeasTb   *l2MeasTb = NULLP;
519    for(tbIdx = 0; tbIdx < RLC_MAX_TB_PER_UE; tbIdx++)
520    { 
521        l2MeasTb = ueCb->l2MeasTbCb[tbIdx];
522        if(l2MeasTb != NULLP)
523        {
524           RLC_FREE(gCb,l2MeasTb, sizeof(RlcL2MeasTb));
525           ueCb->l2MeasTbCb[tbIdx] = NULLP;
526        }       
527    }  
528    return;   
529 }/* End of kwDbmDelL2MeasTb */
530 #endif /* LTE_L2_MEAS */
531 \f
532 /**
533  * @brief Handler to create CellCb
534  *
535  * @details
536  *    This function is invoked by CFG to create CellCb and insert into
537  *    the Cell hashlist of RlcCb.
538  *
539  *  @param[in] gCb      RLC Instance Control Block
540  *  @param[in] cellId   Cell Identifier 
541  *  @param[in] cellCb   Cell Control Block 
542  *
543  *  @return  S16
544  *     -# ROK 
545  *     -# RFAILED 
546 */
547 S16 rlcDbmCreateDlCellCb(RlcCb *gCb,CmLteCellId cellId,RlcDlCellCb **cellCb)
548 {
549    RlcDlCellCb *tCellCb; 
550    
551
552    RLC_ALLOC(gCb,*cellCb, sizeof(RlcDlCellCb));
553 #if (ERRCLASS & ERRCLS_ADD_RES)
554    if (*cellCb == NULLP)
555    {
556       DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed");
557       return RFAILED;
558    }
559 #endif /* ERRCLASS & ERRCLS_ADD_RES */
560
561    tCellCb = *cellCb;
562    tCellCb->cellId = cellId;
563
564    if(ROK != cmHashListInsert(&(gCb->u.dlCb->cellLstCp), 
565                               (PTR) tCellCb,
566                               (uint8_t *)&(tCellCb->cellId), 
567                               (uint16_t) sizeof(CmLteCellId)))
568    {
569       DU_LOG("\nERROR  -->  RLC_DL : HashList Insertion Failed");
570       return RFAILED;
571    }
572
573    return (ROK);
574 } /* rlcDbmCreateDlCellCb */
575
576 \f
577 /**
578  * @brief Handler to Fetch an CellCb
579  *       
580  * @details
581  *    This function is invoked by CFG to fetch UeCb from the Ue hashlist 
582  *    of RlcCb.
583  *
584  * @param[in]    gCb      RLC Instance Control Block
585  * @param[in]    cellId   Cell Identifier 
586  * @param[out]   cellCb   UE Control Block
587  *
588  * @return  S16
589  *    -# ROK 
590  *    -# RFAILED 
591  *
592 */
593 uint8_t rlcDbmFetchDlCellCb(RlcCb *gCb, CmLteCellId  cellId, RlcDlCellCb **cellCb)
594 {
595    *cellCb = NULLP;
596    
597    if(ROK != cmHashListFind(&(gCb->u.dlCb->cellLstCp), 
598                             (uint8_t *)&(cellId),
599                             sizeof(CmLteCellId), 
600                             RLC_DEF_SEQ_NUM, 
601                             (PTR*) cellCb))
602    {
603       DU_LOG("\nERROR  -->  RLC_DL : CellCb [%d] not found", cellId);
604       return RFAILED;
605    }
606
607    return ROK;
608 } /* kwDbmFetchCellCb */
609
610 \f
611 /**
612  * @brief Handler to delete CellCb
613  *
614  * @details
615  *    This function is invoked by CFG to delete CellCb from the Cell hashlist 
616  *    of RlcCb.
617  *
618  *  @param[in] gCb      RLC Instance Control Block
619  *  @param[in] cellCb   Cell Control Block
620  *
621  *  @return  Void
622 */
623 Void rlcDbmDelDlCellCb(RlcCb *gCb,RlcDlCellCb *cellCb)
624 {
625
626    /* Delete all rbCbs in cellCb */
627    rlcDbmDelAllDlRb(gCb,cellCb->rbCb, RLC_MAX_RB_PER_CELL);
628    
629    /* Delete cellCb entry in hash list cellLstCp */
630    if(ROK != cmHashListDelete(&(gCb->u.dlCb->cellLstCp), (PTR) cellCb))
631    {
632       DU_LOG("\nERROR  -->  RLC_DL : HashList Deletion Failed");
633    }
634
635    /* Deallocate cellCb */
636    RLC_FREE(gCb, cellCb, sizeof(RlcDlCellCb));
637
638    return;
639 } /* kwDbmDelCellCb */
640
641 \f
642 /**
643  * @brief Handler to delete all UeCbs
644  *       
645  * @details
646  *    This function is invoked by CFG to delete all UeCbs from the Ue
647  *    hashlist of RlcCb.
648  * @param[in] gCb      RLC Instance Control Block
649  *
650  * @return  Void
651 */
652 Void rlcDbmDelAllDlCell(RlcCb *gCb)
653 {
654    RlcDlCellCb *cellCb = NULLP;
655
656    /* Until no more cellCb is ueLstCp hash list get and delete cellCb */
657    while (ROK == cmHashListGetNext(&(gCb->u.dlCb->cellLstCp), 
658                                    (PTR) cellCb, 
659                                    (PTR *)&cellCb))
660    {
661       rlcDbmDelDlCellCb(gCb, cellCb);
662       
663       cellCb = NULLP;
664    }
665
666    return;
667 } /* rlcDbmDelAllDlCell */
668
669 \f
670 /**
671  * @brief Handler to delete all UeCbs and CellCbs
672  *       
673  * @details
674  *    This function is invoked by LMM to delete all UeCbs from the Ue
675  *    hashlist of RlcCb and cellCbs from the Cell hashlist of rlcCb.
676  * 
677  * @param[in] gCb      RLC Instance Control Block
678  *
679  * @return  Void
680 */
681 S16 rlcDbmDlShutdown(RlcCb *gCb)
682 {
683
684    rlcDbmDelAllDlCell(gCb);
685
686    rlcDbmDelAllDlUe(gCb);
687
688    rlcDbmDlDeInit(gCb);
689
690
691    return ROK;
692 } /* kwDbmShutdown */
693
694
695 /********************************************************************30**
696   
697          End of file
698 **********************************************************************/