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