Committing in PDCP code
[o-du/l2.git] / src / 5gnrpdcp / pj_dbm_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:    PDCP - Database module file
22     
23         Type:    C source file
24   
25         Desc:    Source code for Database Module functions such as, 
26
27                   -  pjDbmBufInit
28                   -  pjDbmInsTxEnt
29                   -  pjDbmGetTxEnt
30                   -  pjDbmGetTxEntSn
31                   -  pjDbmDelTxEnt
32                   -  pjDbmTxDeInit
33                   -  pjDbmInsRxEnt
34                   -  pjDbmGetRxEnt
35                   -  pjDbmDelRxEnt
36                   -  pjDbmRxDeInit
37
38         File:    pj_dbm_ul.c
39   
40 *********************************************************************21*/
41 static const char* RLOG_MODULE_NAME="PDCP";
42 static int RLOG_MODULE_ID=1024;
43 static int RLOG_FILE_ID=216;
44
45 \f
46 /* header (.h) include files */
47 #include "envopt.h"        /* environment options */
48 #include "envdep.h"        /* environment dependent */
49 #include "envind.h"        /* environment independent */
50
51 #include "gen.h"                /* general */
52 #include "ssi.h"                /* system services interface */
53 #include "cm5.h"                /* Timer Functions */
54 #include "cm_lte.h"             /* common LTE header file */
55 #include "cm_hash.h"            /* common hash module  file */
56 #include "cm_llist.h"           /* common list header file */
57 #include "cpj.h"                /* RRC layer */
58 #include "pju.h"                /* PDCP service user */
59 #include "lpj.h"                /* RRC layer */
60 #include "pj_env.h"             /* RLC environment options */
61 #include "pj.h"                 /* RLC layer */
62 #include "pj_ul.h"                 /* RLC layer */
63 #include "pj_err.h"
64 /* extern (.x) include files */
65 #include "gen.x"                /* general */
66 #include "ssi.x"                /* system services interface */
67 #include "cm_lib.x"             /* common library */
68 #include "cm5.x"                /* Timer Functions */
69 #include "cm_hash.x"            /* common hash module */
70 #include "cm_lte.x"             /* common LTE file */
71 #include "cm_llist.x"           /* common list header file */
72 #include "cpj.x"                /* RRC layer */
73 #include "pju.x"                /* PDCP service user */
74 #include "lpj.x"                /* LM Interface */
75 #include "pj.x"                 /* RLC layer */
76 #include "pj_udx.h"
77 #include "pj_udx.x"
78 #include "pj_dl.x"
79 #include "pj_ul.x"
80
81 \f
82 /* local defines */
83
84 /* local externs */
85
86 /* forward references */
87
88 /* public variable declarations */
89 PUBLIC S16 pjDeciphStateChek ARGS ((PjCb *gCb, PjRxEnt *delEnt));
90 /* This structure holds all the global structs we need. */
91
92 /* private variable declarations */
93
94 /* private function declarations */
95
96 /** @file gp_pj_dbm.c
97 @brief PDCP DBM Module
98 **/
99
100 /*****************************************************************************
101  *                  HANDLER FOR THE TRANSMISSION BUFFER
102  ****************************************************************************/
103
104 /*****************************************************************************
105  *                  HANDLERS FOR THE RECEPTION BUFFER
106  ****************************************************************************/
107 \f
108 /**
109  * @brief Handler to insert packets In-Sequence into RX Buffer
110  *
111  *
112  */
113 #ifdef ANSI
114 PRIVATE S16 pjDbmInsInSeqRxEnt
115 (
116 PjBuf       *buf,          /* !< Rx Buffer  */
117 PjRxEnt     *rxEnt         /* !< Rx Entry   */              
118 )
119 #else
120 PRIVATE S16 pjDbmInsInSeqRxEnt(buf, rxEnt)
121 PjBuf       *buf;
122 PjRxEnt     *rxEnt;
123 #endif
124 {
125
126    PjRxEnt     *tmpEnt = NULLP;
127
128    tmpEnt = (PjRxEnt *) cmLListNode(cmLListFirst(&buf->datPktQ));
129    if((rxEnt->count) < (tmpEnt->count))
130    {         
131       rxEnt->datPktEnt.node = (PTR) rxEnt;
132       cmLListInsCrnt(&buf->datPktQ, &rxEnt->datPktEnt);
133    }
134    else
135    {
136       tmpEnt = (PjRxEnt *) cmLListNode(cmLListLast(&buf->datPktQ));
137       while((rxEnt->count) < (tmpEnt->count))
138       {
139          cmLListPrev(&buf->datPktQ);
140          tmpEnt = (PjRxEnt *) cmLListNode(cmLListCrnt(&buf->datPktQ));
141       }
142       rxEnt->datPktEnt.node = (PTR) rxEnt;
143       cmLListInsAfterCrnt(&buf->datPktQ, &rxEnt->datPktEnt);
144    }
145    RETVALUE(ROK);
146 }
147
148
149 \f
150 /**
151  *
152  * @brief Handler to insert into a RX Buffer
153  *
154  * @b Description
155  *        This function is invoked by to insert into
156  *         the reception buffer hash List
157  *
158  *  @param[in]  buf      Rx Buffer 
159  *  @param[in]  rxEnt    Reception Entry
160  *  @param[in]  dupFlag  Search for duplicates(Should be TRUE for AM)
161  *
162  *  @return  S16
163  *      -# ROK 
164  *      -# RFAILED 
165  *
166 */
167 #ifdef ANSI
168 PUBLIC S16 pjDbmInsRxEnt
169 (
170 PjCb        *gCb,
171 PjBuf       *buf,          /* !< Rx Buffer  */
172 PjRxEnt     *rxEnt,        /* !< Rx Entry   */              
173 Bool        dupFlag        /* !< Boolean to check for duplicate  entries */
174 )
175 #else
176 PUBLIC S16 pjDbmInsRxEnt(gCb, buf, rxEnt, dupFlag)
177 PjCb        *gCb;
178 PjBuf       *buf;          /* !< Rx Buffer  */
179 PjRxEnt     *rxEnt;        /* !< Rx Entry   */                              
180 Bool        dupFlag;       /* !< Boolean to check for duplicate  entries */ 
181 #endif
182 {
183    U8       hashKey;          /* Computed hash key */
184    PjRxEnt  *tmpEnt = NULLP;  /* Rx Entry Ptr */
185
186    TRC3(pjDbmInsRxEnt)
187 #ifndef ALIGN_64BIT
188    PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
189             "pjDbmInsRxEnt buf, rxEnt(%ld), dupFlag(%d)\n",\
190             rxEnt->count, dupFlag));
191 #else
192    PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
193             "pjDbmInsRxEnt buf, rxEnt(%d), dupFlag(%d)\n",\
194             rxEnt->count, dupFlag));
195 #endif
196
197    if(dupFlag)
198    {
199       /* Search for duplicates */
200       tmpEnt = pjDbmGetRxEnt(gCb, buf, rxEnt->count);
201       if(tmpEnt != NULLP)
202       {
203          RETVALUE(ROKDUP);
204       }
205    }
206
207    /* Compute the hash index */
208    hashKey = (U8)PJ_HASH_FN(buf, rxEnt->count);  /*KW_FIX*/
209
210    rxEnt->lstEnt.node   =  (PTR) rxEnt;
211    cmLListAdd2Tail(&buf->datQ[hashKey], &rxEnt->lstEnt);
212    buf->numEntries ++;
213
214    if(buf->datPktQ.count == 0)
215    {
216       rxEnt->datPktEnt.node = (PTR) rxEnt;
217       cmLListAdd2Tail(&buf->datPktQ, &rxEnt->datPktEnt);
218    }
219    else
220    {
221       pjDbmInsInSeqRxEnt(buf, rxEnt);
222    }
223
224    RETVALUE(ROK);
225 } /* pjDbmRxBufIns */
226
227 \f
228 /**
229  *
230  * @brief Handler to fetch from a RX Buffer
231  *
232  * @b Description
233  *        This function is invoked to fetch an entry from
234  *         the transaction buffer hash List
235  *
236  *  @param[in]    buf         Rx Buffer 
237  *  @param[in]    count       Count value of the entry to retrieve
238  *
239  *  @return  S16
240  *      -# ROK 
241  *      -# RFAILED 
242  *
243 */
244 #ifdef ANSI
245 PUBLIC PjRxEnt* pjDbmGetRxEnt
246 (
247 PjCb   *gCb,
248 PjBuf  *buf,       /* !< Rx Buffer  */                               
249 U32    count       /* !< Count value of the entry to retrieve */                               
250 )
251 #else
252 PUBLIC PjRxEnt* pjDbmGetRxEnt(gCb, buf, count)
253 PjCb   *gCb;
254 PjBuf  *buf;       /* !< Rx Buffer  */                               
255 U32    count;      /* !< Count value of the entry to retrieve */   
256 #endif
257 {
258    U8         hashKey;   /* Computed hashKey */
259    CmLListCp *datQ;      /* Ptr to the CmLListCp */
260    PjRxEnt   *tmpEnt = NULLP;  /* Loop var - Rx Entr Ptr */
261
262    TRC3(pjDbmGetRxEnt)
263    /* Compute the hask key*/
264    hashKey = (U8)PJ_HASH_FN(buf, count); /*KW_FIX*/
265
266    datQ = &buf->datQ[hashKey];
267
268    /* Loop through and search */
269    cmLListFirst(datQ);
270    while(cmLListCrnt(datQ))
271    {
272       tmpEnt = (PjRxEnt *)cmLListNode(cmLListCrnt(datQ));
273       if((tmpEnt->count) == count)
274       {
275          RETVALUE(tmpEnt);
276       }
277       cmLListNext(datQ);
278    }
279    RETVALUE(NULLP);
280 } /* pjDbmGetRxEnt */
281 /**
282  *  @brief This fn is called to chek the state of the PDCP pkts in UL before Deciphering operation
283  *         and appropriate action is taken accordingly
284  *
285  *  @details
286  *      Function : pjDeciphStateChek
287  *
288  *  Processing Steps:
289  *
290  *
291  * @return  S16
292  *        -# Success : ROK
293  *        -# Failure : RFAILED
294 */
295
296 /* ccpu00136902 */
297 #if (defined (LTE_PAL_ENB) || defined (TENB_ACC))
298 #ifdef ANSI
299 PUBLIC S16 pjDeciphStateChek
300 (
301 PjCb        *gCb,
302 PjRxEnt     *delEnt
303 )
304 #else
305 PUBLIC S16 pjDeciphStateChek(gCb, delEnt)
306 PjCb        *gCb;
307 PjRxEnt     *delEnt;
308 #endif
309 {
310   TRC3(pjDeciphStateChek);
311   PJ_FREE_BUF(delEnt->mBuf);
312   PJ_FREE(gCb, delEnt, sizeof(PjRxEnt));
313   RETVALUE(ROK);
314 }
315 #endif
316
317 \f
318 /**
319  *
320  * @brief Handler to delete from a RX Buffer
321  *
322  * @b Description
323  *        This function is invoked by to delete from
324  *         the transaction buffer hash List
325  *
326  *  @param[in]    buf         Rx Buffer Control Point
327  *  @param[in]    count       Count value of the Rx Entry to delete
328  *
329  *  @return  S16
330  *      -# ROK 
331  *      -# RFAILED 
332  *
333 */
334 #ifdef ANSI
335 PUBLIC S16 pjDbmDelRxEnt
336 (
337 PjCb   *gCb,
338 PjBuf  *buf,        /* !< Rx Buffer  */                                                          
339 U32    count        /* !< Count value of the entry to retrieve */                                
340 )
341 #else
342 PUBLIC S16 pjDbmDelRxEnt(gCb, buf, count)
343 PjCb   *gCb;
344 PjBuf  *buf;        /* !< Rx Buffer  */                                                          
345 U32    count;       /* !< Count value of the entry to retrieve */                                
346 #endif
347 {
348    U8          hashKey;      /* Computed hash value */
349    CmLListCp   *datQ;        /* Pointer to the the ListCp */
350    PjRxEnt     *delEnt;      /* Loop var - entry to be deleted */
351
352    TRC3(pjDbmDelRxEnt)
353 #ifndef ALIGN_64BIT
354    PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
355             "pjDbmDelRxEnt(buf, count(%ld)\n", count));
356 #else
357    PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
358             "pjDbmDelRxEnt(buf, count(%d)\n", count));
359 #endif
360
361    /* Get the node */
362    delEnt   =  pjDbmGetRxEnt(gCb, buf, count);
363
364    if(delEnt == NULLP)
365    {
366       RETVALUE(ROK);
367    }
368
369    hashKey = (U8)PJ_HASH_FN(buf, count); /*KW_FIX*/
370    datQ = &buf->datQ[hashKey];
371
372    /* delete the entity and free it*/
373    cmLListDelFrm(datQ, &delEnt->lstEnt);
374    if(delEnt->datPktEnt.node != NULLP)
375    {
376       cmLListDelFrm(&buf->datPktQ, &delEnt->datPktEnt);
377       delEnt->datPktEnt.node = NULLP;
378    }
379    /* ccpu00136902 */
380    pjDeciphStateChek(gCb, delEnt);
381    buf->numEntries --;
382
383    RETVALUE(ROK);
384 } /* pjDbmDelRxEnt */
385
386 \f
387 /**
388  *
389  * @brief Handler to Delete all the elements in the hashlist
390  *       
391  *
392  * @b Description
393  *        This function is invoked by delete all the elements in th3
394  *        hash List
395  *
396  *  @return  S16
397  *      -# ROK 
398  *      -# RFAILED 
399  *
400 */
401 #ifdef ANSI
402 PUBLIC S16 pjDbmRxDelAll
403 (
404 PjCb  *gCb,
405 PjBuf *buf        /* !< Rx Buffer  */                                                          
406 )                 
407 #else
408 PUBLIC S16 pjDbmRxDelAll(gCb,buf)
409 PjCb  *gCb;
410 PjBuf *buf;       /* !< Rx Buffer  */                                                          
411 #endif
412 {
413    U8         listInd;   /* loop index */
414    CmLListCp *datQ;      /* CmLListCp Ptr */
415    CmLList   *lstEnt;   /* loop ptr to CmLlistEnt */
416    PjRxEnt   *delEnt;    /* loop ptr to entry to be deleted */
417
418    TRC3(pjDbmRxDelAll);
419
420    RLOG0(L_DEBUG, "pjDbmRxDelAll(buf)");
421
422    for(listInd = 0; listInd< buf->numBins; listInd++)
423    {
424       datQ = &buf->datQ[listInd];
425       while(cmLListFirst(datQ))
426       {
427          lstEnt = cmLListDelFrm(datQ, cmLListCrnt(datQ));
428          if(lstEnt != NULLP)
429          {
430             delEnt   =  (PjRxEnt *)cmLListNode(lstEnt);
431             if(delEnt->datPktEnt.node != NULLP)
432             {
433                cmLListDelFrm(&buf->datPktQ, &delEnt->datPktEnt);
434                delEnt->datPktEnt.node = NULLP;
435             }
436             /* ccpu00136902 */
437             pjDeciphStateChek(gCb, delEnt);
438          }
439       }
440       cmLListInit(datQ);
441    }
442
443    RETVALUE(ROK);
444 } /* pjDbmRxDelAll */
445 \f
446 /**
447  *
448  * @brief Handler to De initialize hash list
449  *       
450  *
451  * @b Description
452  *        This function is invoked by LMM to De initialize the 
453  *        hash List
454  *
455  *  @return  S16
456  *      -# ROK 
457  *      -# RFAILED 
458  *
459 */
460 #ifdef ANSI
461 PUBLIC S16 pjDbmRxDeInit
462 (
463 PjCb  *gCb,
464 PjBuf *buf        /* !< Rx Buffer  */                                                          
465 )                 
466 #else
467 PUBLIC S16 pjDbmRxDeInit(gCb,buf)
468 PjCb  *gCb;
469 PjBuf *buf;       /* !< Rx Buffer  */                                                          
470 #endif
471 {
472
473    TRC3(pjDbmRxDeInit);
474
475    RLOG0(L_DEBUG, "pjDbmRxDeInit(buf)");
476
477    /* Cleanup all entries */
478    pjDbmRxDelAll(gCb,buf);
479
480    /* Cleanup hashlist */
481    PJ_FREE(gCb, buf->datQ, (sizeof(CmLListCp) * buf->numBins));
482    buf->numBins   =  NULLP;
483
484    RETVALUE(ROK);
485 } /* pjDbmDeInit */
486
487 \f
488 /**
489  *
490  * @brief Handler to initialize hash list
491  *       
492  *
493  * @b Description
494  *        This function is invoked by LMM to initialize the UeCb and CellCb
495  *        hash List
496  *
497  *  @return  S16
498  *      -# ROK 
499  *      -# RFAILED 
500  *
501 */
502 #ifdef ANSI
503 PUBLIC S16 pjDbmUlInit  
504 (
505 PjCb *gCb
506 )
507 #else
508 PUBLIC S16 pjDbmUlInit(gCb)
509 PjCb *gCb;
510 #endif
511 {
512    S16      ret;              /* Return Value */
513
514    TRC3(pjDbmUlInit)
515
516 #ifdef DEBUGP
517    RLOG0(L_DEBUG, "pjDbmInit()");
518 #endif
519
520    /* Initialize ueCb Hash List */
521    ret = cmHashListInit(&(gCb->u.ulCb->ueLstCp), (U16) PJ_UE_LIST_BUCKET_SIZE,
522          (U16) 0, (Bool) FALSE, (U16) CM_HASH_KEYTYPE_DEF,
523          gCb->init.region, gCb->init.pool);
524    if (ret != ROK)
525    {
526 #ifdef DEBUGP
527       RLOG0(L_ERROR, "cmHashListInit Failed for gCb.ueLstCp.");
528 #endif
529       RETVALUE(ret);
530    }
531
532    ret = cmHashListInit(&(gCb->u.ulCb->transIdLstCp), 
533                         (U16) PJ_TRANS_ID_LST_BKT_SIZE,
534          (U16) 0, (Bool) FALSE, (U16) CM_HASH_KEYTYPE_DEF,
535          PJ_GET_MEM_REGION(gCb), PJ_GET_MEM_POOL(gCb));
536    if (ret != ROK)
537    {
538       cmHashListDeinit(&gCb->u.ulCb->ueLstCp);
539 #ifdef DEBUGP
540       RLOG0(L_ERROR, "cmHashListInit Failed for pjCb.transIdLstCp.");
541 #endif
542    }
543
544
545    RETVALUE(ROK);
546 } /* pjDbmInit */
547
548 \f
549 /**
550  *
551  * @brief Handler to De initialize hash list
552  *       
553  *
554  * @b Description
555  *        This function is invoked by LMM to De initialize the UeCb and CellCb
556  *        hash List
557  *
558  *  @return  S16
559  *      -# ROK 
560  *      -# RFAILED 
561  *
562 */
563 #ifdef ANSI
564 PUBLIC S16 pjDbmUlDeInit
565 (
566 PjCb *gCb
567 )
568 #else
569 PUBLIC S16 pjDbmUlDeInit(gCb)
570 PjCb *gCb;
571 #endif
572 {
573    S16      ret;                       /* Return Value */
574
575    TRC3(pjDbmUlDeInit);
576
577 #ifdef DEBUGP
578    RLOG0(L_DEBUG, "pjDbmDeInit()");
579 #endif
580
581    /* Initialize ueCb Hash List */
582    ret = cmHashListDeinit(&(gCb->u.ulCb->ueLstCp));
583    if (ret != ROK)
584    {
585 #ifdef DEBUGP
586       RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb.ueLstCp.");
587 #endif
588       RETVALUE(ret);
589    }
590    /* Initialize transId Hash List */
591    /*MEM_LEAK_FIX*/
592    ret = cmHashListDeinit(&(gCb->u.ulCb->transIdLstCp));
593    if (ret != ROK)
594    {
595 #ifdef DEBUGP
596       RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb.transIdLstCp.");
597 #endif
598       RETVALUE(ret);
599    }
600
601    ret = cmHashListDeinit(&(gCb->u.ulCb->transIdLstCp));
602    if (ret != ROK)
603    {
604 #ifdef DEBUGP
605       RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb->u.ulCb->transIdLstCp");
606 #endif
607       RETVALUE(ret);
608    }
609    RETVALUE(ROK);
610 } /* pjDbmDeInit */
611
612 \f
613 /**
614  *
615  * @brief Handler to fetch rbCb in the Upper Interface
616  *       
617  *
618  * @b Description
619  *        This function is invoked by CFG to fetch rbCb from the cellCb/ueCb in
620  *        the upper interface (CPJ/PJU).
621  *
622  *  @param[in]    rlcId    RLC Identifier 
623  *  @param[out]   rbCb     RB Control Block
624  *
625  *  @return  S16
626  *      -# ROK 
627  *      -# RFAILED 
628  *
629 */
630 #ifdef ANSI
631 PUBLIC S16 pjDbmFetchUlRbCb
632 (
633 PjCb           *gCb,
634 CmLteRlcId     rlcId,      /* RLC Identifier */
635 PjUlRbCb       **rbCb       /* RB Cb */
636 )
637 #else
638 PUBLIC S16 pjDbmFetchUlRbCb(gCb, rlcId, rbCb)
639 PjCb           *gCb;
640 CmLteRlcId     rlcId;      /* RLC Identifier */
641 PjUlRbCb         **rbCb;      /* RB Cb */
642 #endif
643 {
644    PjUlUeCb      *ueCb;                  /* UE Control Block */
645    PjUlRbCb        *tRbCb;                 /* Local RB CB */
646    S16         ret;                    /* Return Value */
647
648    TRC3(pjDbmFetchUlRbCb)
649
650    ueCb = NULLP;
651    ret = ROK;
652
653    /* Validate the RBID in case of TM/UM/AM */
654    PJ_VALIDATE_RBID(rlcId.ueId, rlcId.rbId, rlcId.rbType, ret);
655    if (ret != ROK)
656    {
657 #ifdef DEBUGP
658       /* DEBUG_PRINT EROR */
659       RLOG_ARG2(L_ERROR,DBG_UEID,rlcId.ueId, 
660             "PJ_VALIDATE_RBID Failed rbId(%d), cellId(%d)",
661                        rlcId.rbId, rlcId.cellId);
662 #endif
663       RETVALUE(ret);
664    }
665    if (pjDbmFetchUlUeCb(gCb, rlcId.ueId, rlcId.cellId, &ueCb) != ROK)
666    {
667 #ifdef DEBUGP
668       RLOG_ARG0(L_ERROR,DBG_UEID,rlcId.ueId, "Failed to Fetch UE Cb");
669 #endif
670       RETVALUE(RFAILED);
671    }
672    else
673    {
674       PJ_DBM_FETCH_UL_RBCB(rlcId.rbId, rlcId.rbType, ueCb, tRbCb);
675    }
676
677    if (tRbCb == NULLP)
678    {
679       RLOG_ARG2(L_ERROR, DBG_UEID,rlcId.ueId, "CellId[%u]:RbId[%d] not found",
680             rlcId.cellId, rlcId.rbId);
681       RETVALUE(RFAILED);
682    }
683
684    *rbCb = tRbCb;
685
686    RETVALUE(ROK);
687 } /* pjDbmFetchRbCb */
688
689
690 \f
691 /**
692  *
693  * @brief Handler to delete RbCb
694  *       
695  *
696  * @b Description
697  *        This function is invoked by CFG to remove RbCb from Ue/Cell hashlist 
698  *
699  *
700  *  @param[in] rbCbLst   - Rb Cb List
701  *  @param[in] numRbCb   - Number of rbCbs
702  *
703  *  @return  S16
704  *      -# ROK 
705  *      -# RFAILED 
706  *
707 */
708 #ifdef ANSI
709 PUBLIC S16 pjDbmDelAllUlRb
710 (
711 PjCb             *gCb,
712 PjUlRbCb         **rbCbLst,              /* RB Cb list */
713 U8             numRbCb                 /* Number of rbCbs */
714 )
715 #else
716 PUBLIC S16 pjDbmDelAllUlRb(gCb,rbCbLst, numRbCb)
717 PjCb             *gCb;
718 PjUlRbCb         **rbCbLst;              /* RB Cb list */
719 U8             numRbCb;                /* Number of rbCbs */
720 #endif
721 {
722    U8          idx;                    /* Index */
723    PjUlRbCb        *rbCb;                  /* RB Control Block */
724
725    TRC3(pjDbmDelAllUlRb)
726
727 #ifdef DEBUGP
728    RLOG1(L_DEBUG, "pjDbmDelAllRb(rbCbLst, numRbCb(%d))", numRbCb);
729 #endif
730
731    for (idx = 0; idx < numRbCb; idx++)
732    {
733       rbCb = rbCbLst[idx];
734       if (rbCb != NULLP)
735       {
736          PJ_DBM_DELETE_UL_RBCB(gCb,rbCb);
737          rbCbLst[idx] = NULLP;
738       }
739    }
740
741    RETVALUE(ROK);
742 } /* pjDbmDelAllRb */
743
744 \f
745 /**
746  *
747  * @brief Handler to create an UeCb
748  *       
749  *
750  * @b Description
751  *        This function is invoked by CFG to create UeCb and insert into the Ue hashlist 
752  *        of PjCb.
753  *
754  *
755  *  @param[in] ueId     UE Identifier 
756  *  @param[in] cellId   Cell Identifier 
757  *
758  *  @return  S16
759  *      -# ROK 
760  *      -# RFAILED 
761  *
762 */
763 #ifdef ANSI
764 PUBLIC S16 pjDbmCreateUlUeCb
765 (
766 PjCb              *gCb,
767 CmLteRnti         ueId,       /* UE Identifier */
768 CmLteCellId       cellId,     /* Cell Identifier */
769 PjUlUeCb            **ueCb       /* UE Control Block */
770 )
771 #else
772 PUBLIC S16 pjDbmCreateUlUeCb(gCb, ueId, cellId, ueCb)
773 PjCb              *gCb; 
774 CmLteRnti         ueId;       /* UE Identifier */
775 CmLteCellId       cellId;     /* Cell Identifier */
776 PjUlUeCb            **ueCb;     /* UE Control Block */
777 #endif
778 {
779    S16      ret;              /* Return Value */
780    PjUlUeCb   *tUeCb;           /* UE Control Block */
781
782    TRC3(pjDbmCreateUlUeCb)
783
784 #ifdef DEBUGP
785    RLOG2(L_DEBUG, "pjDbmCreateUeCb(ueId(%d), cellId(%d))", ueId, cellId);
786 #endif
787
788    PJ_ALLOC(gCb, *ueCb, sizeof(PjUlUeCb));
789
790 #if (ERRCLASS & ERRCLS_ADD_RES)
791    if (*ueCb == NULLP)
792    {
793       ret = RFAILED;
794       RLOG0(L_FATAL, "Memory Allocation failure");
795       RETVALUE(ret);
796    }
797 #endif /* ERRCLASS & ERRCLS_ADD_RES */
798
799    tUeCb = *ueCb;
800    tUeCb->key.ueId = ueId;
801    tUeCb->key.cellId = cellId;
802
803    ret = cmHashListInsert(&(gCb->u.ulCb->ueLstCp), (PTR)tUeCb, (U8 *)&(tUeCb->key),
804          (U16) sizeof(PjUeKey));
805    if (ret != ROK)
806    {
807 #ifdef DEBUGP
808       RLOG_ARG1(L_ERROR,DBG_UEID,ueId,"Ul UeCb Hash Insert Failed : cellId(%d)",
809                             cellId);
810 #endif
811       RETVALUE(ret);
812    }
813
814    /* kw005.201 ccpu00117318, updating the statistics */
815    gCb->pjGenSts.numUe++;
816
817    (*ueCb)->libInfo.state =  PJ_STATE_NORMAL;
818    cmInitTimers(&((*ueCb)->libInfo.obdTmr), 1);
819    RETVALUE(ret);
820 } /* kwDbmCreateUeCb */
821
822 \f
823 /**
824  *
825  * @brief Handler to Fetch an UeCb
826  *       
827  *
828  * @b Description
829  *        This function is invoked by CFG to fetch UeCb from the Ue hashlist 
830  *        of PjCb.
831  *
832  *
833  *  @param[in]    ueId     UE Identifier 
834  *  @param[in]    cellId   Cell Identifier 
835  *  @param[out]   ueCb     UE Control Block
836  *
837  *  @return  S16
838  *      -# ROK 
839  *      -# RFAILED 
840  *
841 */
842 #ifdef ANSI
843 PUBLIC S16 pjDbmFetchUlUeCb
844 (
845 PjCb              *gCb,
846 CmLteRnti         ueId,       /* UE Identifier */
847 CmLteCellId       cellId,     /* Cell Identifier */
848 PjUlUeCb            **ueCb       /* UE Control Block */
849 )
850 #else
851 PUBLIC S16 pjDbmFetchUlUeCb(gCb, ueId, cellId, ueCb)
852 PjCb              *gCb;
853 CmLteRnti         ueId;       /* UE Identifier */
854 CmLteCellId       cellId;     /* Cell Identifier */
855 PjUlUeCb            **ueCb;      /* UE Control Block */
856 #endif
857 {
858    S16      ret;              /* Return Value */
859    PjUeKey  key;              /* Key for UE Hash List */
860
861    TRC3(pjDbmFetchUlUeCb)
862
863
864    key.ueId = ueId;
865    key.cellId = cellId;
866
867    ret = cmHashListFind(&(gCb->u.ulCb->ueLstCp), (U8 *)&(key), sizeof(PjUeKey),
868          PJ_DEF_SEQ_NUM, (PTR *) ueCb);
869    if (ret != ROK)
870    {
871 #ifdef DEBUGP
872       RLOG_ARG0(L_INFO,DBG_UEID,ueId, "Hash Find Failed for fetching ueCb");
873 #endif
874       RETVALUE(ret);
875    }
876
877    RETVALUE(ROK);
878 } /* pjDbmFetchUeCb */
879
880 \f
881 /**
882  *
883  * @brief Handler to delete an UeCb
884  *       
885  *
886  * @b Description
887  *        This function is invoked by CFG to delete UeCb from the Ue hashlist 
888  *        of PjCb.
889  *
890  *
891  *  @param[in] ueCb     UE Control Block
892  *  @param[in] abrtFlag Abort Flag
893  *
894  *  @return  S16
895  *      -# ROK 
896  *      -# RFAILED 
897  *
898 */
899 #ifdef ANSI
900 PUBLIC S16 pjDbmDelUlUeCb
901 (
902 PjCb        *gCb,
903 PjUlUeCb      *ueCb,       /* UE Identifier */
904 Bool        abortFlag    /* Abort Flag */
905 )
906 #else
907 PUBLIC S16 pjDbmDelUlUeCb(gCb, ueCb, abortFlag)
908 PjCb        *gCb;
909 PjUlUeCb      *ueCb;       /* UE Identifier */
910 Bool        abortFlag;   /* Abort Flag */
911 #endif
912 {
913    S16         ret;      /* Return Value */
914    U8          idx;      /* Index */
915
916    TRC3(pjDbmDelUlUeCb)
917
918 #ifdef DEBUGP
919    RLOG2(L_DEBUG, "pjDbmDelUeCb(ueId(%d), cellId(%d))",
920             ueCb->key.ueId, ueCb->key.cellId);
921 #endif
922
923 /* kw005.201 Check to see if there is atleast one logical channel */
924
925    for ( idx = 0; idx< PJ_MAX_SRB_PER_UE; idx++)
926        pjCfgDelPjUlRbCb(gCb, ueCb, ueCb->srbCb[idx]);
927
928    for ( idx = 0; idx< PJ_MAX_DRB_PER_UE; idx++) 
929        pjCfgDelPjUlRbCb(gCb, ueCb, ueCb->drbCb[idx]);
930
931    /* Close the Integrity/Ciphering channels */
932    if(ueCb->secInfo.secAct)
933    {
934 #ifdef INTEL_QAT_DP
935       pjUtlUlIntClose(gCb,ueCb->secInfo.cpIntSessCxtId);
936       pjUtlUlCipherClose(gCb,ueCb->secInfo.cpCiphSessCxtId);
937       pjUtlUlCipherClose(gCb,ueCb->secInfo.upCiphSessCxtId);
938 #else
939       pjUtlUlIntClose(gCb,ueCb->secInfo.intCxtId); 
940       pjUtlUlCipherClose(gCb,ueCb->secInfo.cpCxtId);
941       pjUtlUlCipherClose(gCb,ueCb->secInfo.upCxtId);
942 #endif
943    }
944
945    /* Delete hoInfo if present */
946    if (ueCb->hoInfo != NULLP)
947    {
948       for (idx = 0; idx < PJ_MAX_DRB_PER_UE; idx++)
949       {
950          if (ueCb->hoInfo->hoCfmInfo[idx].pres == TRUE)
951          {
952             PJ_FREE(gCb, ueCb->hoInfo->hoCfmInfo[idx].ulBitMap,
953                   (ueCb->hoInfo->hoCfmInfo[idx].numBits % 8)?
954                   ((ueCb->hoInfo->hoCfmInfo[idx].numBits / 8) + 1):
955                   (ueCb->hoInfo->hoCfmInfo[idx].numBits / 8 ));
956          }
957       }
958
959       PJ_FREE(gCb, ueCb->hoInfo->hoCfmInfo, 
960                  (PJ_MAX_DRB_PER_UE * sizeof(PjUlHoCfmInfo)));
961       PJ_FREE(gCb, ueCb->hoInfo, sizeof(PjUlHoInfo));  
962    }
963
964    /* Delete ueCb entry from ueLstCp */
965    ret = cmHashListDelete(&(gCb->u.ulCb->ueLstCp), (PTR) ueCb);
966    if (ret != ROK)
967    {
968
969 #ifdef DEBUGP
970       RLOG_ARG0(L_ERROR,DBG_UEID,ueCb->key.ueId, 
971             "Hash Delete Failed for deleting ueCb.");
972 #endif
973    }
974    /* kw005.201 ccpu00117318, updating the statistics */
975    gCb->pjGenSts.numUe--;
976
977    /* Deallocate ueCb */
978    PJ_FREE(gCb, ueCb, sizeof(PjUlUeCb));
979
980    RETVALUE(ret);
981 } /* pjDbmDelUeCb */
982
983 \f
984 /**
985  *
986  * @brief Handler to delete all UeCbs
987  *       
988  *
989  * @b Description
990  *        This function is invoked by CFG to delete all UeCbs from the Ue
991  *        hashlist of PjCb.
992  *
993  *  @return  S16
994  *      -# ROK 
995  *      -# RFAILED 
996  *
997 */
998 #ifdef ANSI
999 PUBLIC S16 pjDbmDelAllUlUe
1000 (
1001 PjCb  *gCb
1002 )
1003 #else
1004 PUBLIC S16 pjDbmDelAllUlUe(gCb)
1005 PjCb  *gCb;
1006 #endif
1007 {
1008    S16         ret;
1009    PjUlUeCb      *ueCb;            /* UE Control Block */
1010
1011    TRC3(pjDbmDelAllUlUe)
1012
1013 #ifdef DEBUGP
1014    RLOG0(L_DEBUG, "pjDbmDelAllUe()");
1015 #endif
1016
1017    ret = ROK;
1018    ueCb = NULLP;
1019
1020    /* Until no more ueCb is ueLstCp hash list get and delete ueCb */
1021    while (cmHashListGetNext(&(gCb->u.ulCb->ueLstCp), (PTR) ueCb, (PTR *)&ueCb) == ROK)
1022    {
1023       /* Delete ueCb */
1024       ret = pjDbmDelUlUeCb(gCb,ueCb, TRUE);
1025       if (ret != ROK)
1026       {
1027 #ifdef DEBUGP
1028          RLOG_ARG0(L_ERROR,DBG_UEID,ueCb->key.ueId, "UE deletion Failed");
1029 #endif
1030          RETVALUE(ret);
1031       }
1032       ueCb = NULLP;
1033    }
1034
1035    RETVALUE(ret);
1036 } /* pjDbmDelAllUe */
1037
1038 /**
1039  *
1040  * @brief Handler to Shutdown all UeCbs
1041  *       
1042  *
1043  * @b Description
1044  *        This function is invoked by CFG to shutdown UeCbs from the PjCb.
1045  *
1046  *  @return  S16
1047  *      -# ROK 
1048  *      -# RFAILED 
1049  *
1050 */
1051 #ifdef ANSI
1052 PUBLIC S16 pjDbmUlShutdown 
1053 (
1054 PjCb *gCb
1055 )
1056 #else
1057 PUBLIC S16 pjDbmUlShutdown(gCb)
1058 PjCb *gCb;
1059 #endif
1060 {
1061 #if (ERRCLASS & ERRCLS_DEBUG)
1062 S16  ret
1063 #endif
1064
1065    TRC3(pjDbmUlShutdown)
1066
1067 #if (ERRCLASS & ERRCLS_DEBUG)
1068    ret = pjDbmUlDeInit(gCb);
1069    if (ret != ROK)
1070    {
1071       RLOG0(L_FATAL, "UL DeInitialization Failed");
1072    }
1073 #else
1074    pjDbmUlDeInit(gCb);
1075 #endif /* ERRCLASS & ERRCLS_DEBUG */
1076
1077    RETVALUE(ROK);
1078 } /* pjDbmShutdown */
1079
1080 /**
1081  *
1082  * @brief Handler to create a RB control block.
1083  *       
1084  *
1085  * @b Description
1086  *        This function is called to create a RLC control block or PDCP 
1087  *        control block based on rb flag and update the pointers in RbCb.
1088  *        If the RbCb is already allocated, the rbId is updated in PjRbCb
1089  *        or PjUlRbCb based on rb. If the RbCb has not been allocated earlier,
1090  *        a new RbCb is created and the pointers are updated along with the
1091  *        rbIds.
1092  *
1093  *  @param[in] rbId      RB ID of the entity
1094  *  @param[in] rbCbLst   List of the RBs in the UeCb
1095  *  @param[in] rb        The RB to be created. This can be
1096  *                       PJ_CFG_PDCP when PDCP is created
1097  *                       or PJ_CFG_RLC when RLC is being
1098  *                       created. 
1099  *  
1100  *  @return  S16
1101  *      -# ROK 
1102  *      -# RFAILED 
1103  *
1104 */
1105 #ifdef ANSI
1106 PUBLIC PjUlRbCb* pjDbmCreateUlRbCb
1107 (
1108 PjCb    *gCb,
1109 U8      rbId,
1110 U8      rbType, 
1111 PjUlUeCb  *ueCb, 
1112 U8      rb
1113 )
1114 #else
1115 PUBLIC PjUlRbCb* pjDbmCreateUlRbCb(gCb,rbId,rbType,ueCb,rb)
1116 PjCb    *gCb;
1117 U8      rbId; 
1118 U8      rbType;
1119 PjUlUeCb  *ueCb; 
1120 U8      rb;
1121 #endif
1122 {
1123    PjUlRbCb   *rbCb;
1124    PjUlRbCb   **rbCbLst;
1125
1126    TRC2(pjDbmCreateUlRbCb)
1127
1128    rbCb = NULLP;
1129    rbCbLst = NULLP;
1130    PJ_ALLOC(gCb, rbCb, sizeof(PjUlRbCb) );
1131    if ( rbCb == NULLP )
1132    {
1133       RLOG0(L_FATAL, "Memory Allocation failed");
1134       RETVALUE(rbCb);
1135    }
1136    rbCb->rbId   = rbId;
1137    rbCb->rbType = rbType;
1138
1139    rbCbLst = ((rbType == CM_LTE_SRB)? ueCb->srbCb:ueCb->drbCb); 
1140    rbCbLst[rbId] = rbCb;
1141    /* kw005.201 ccpu00117318, updating the statistics */   
1142    PJ_LMM_RB_STS_INC(gCb);                                    
1143    
1144    RETVALUE(rbCb); 
1145    
1146 } /* pjDbmCreateRbCb */
1147
1148 /**
1149  *
1150  * @brief Handler to fetch a  PDCP RB control block.
1151  *       
1152  *
1153  * @b Description
1154  *        This function is used to fetch the PDCP RB control block based on 
1155  *        the RB id. The pointer to PjUlRbCb is returned.
1156  *       
1157  *  @param[in]  ueCb    UE control block of the PDCP RB
1158  *  @param[in]  rbId    RB ID of the required PDCP entity.
1159  *  @param[out] pjRbCb  PDCP RB Control Block.
1160  *
1161  *  @return  S16
1162  *      -# ROK 
1163  *      -# RFAILED 
1164  *
1165  */
1166 #ifdef ANSI
1167 PUBLIC S16 pjDbmFetchPjUlRbCb
1168 (
1169 PjUlUeCb  *ueCb,
1170 U8       rbId,
1171 U8       rbType,
1172 PjUlRbCb  **pjRbCb 
1173 )
1174 #else
1175 PUBLIC S16 pjDbmFetchPjUlRbCb(ueCb,rbId,rbType,pjRbCb)
1176 PjUlUeCb  *ueCb;      
1177 U8       rbId;
1178 U8       rbType;
1179 PjUlRbCb  **pjRbCb;
1180 #endif
1181 {
1182    PjUlRbCb    *rbCb;
1183
1184    TRC2(pjDbmFetchPjUlRbCb)
1185
1186    *pjRbCb = NULLP;
1187
1188    PJ_DBM_FETCH_UL_RBCB(rbId, rbType, ueCb, rbCb);
1189    if ( rbCb != NULLP )
1190    {
1191       *pjRbCb = rbCb;
1192    }
1193
1194    RETVALUE(ROK);
1195
1196 } /* pjDbmFetchPjUlRbCb */
1197
1198 /**
1199  *
1200  * @brief Handler to delete a PDCP/RLC RB control block.
1201  *       
1202  *
1203  * @b Description
1204  *        This function is used to delete the PDCP/RLC RB control block based 
1205  *        on RB id and the RB type (PDCP/RLC). If the corresponding RB is 
1206  *        present, the cfgStat flag is unset. If the cfgStat flag is zero,
1207  *        the RBCB is freed.
1208  *
1209  *  @param[in]  rbId    RB ID of the to be deleted RB
1210  *  @param[in]  rbCbLst RbCb list in UE CB
1211  *  @param[in]  rb      The RB to be deleted. This can be
1212  *                      PJ_CFG_PDCP when PDCP is created
1213  *                      or PJ_CFG_RLC when RLC is being
1214  *                      created.
1215  *  @return  S16
1216  *      -# ROK 
1217  *      -# RFAILED 
1218  *
1219  */
1220 #ifdef ANSI
1221 PUBLIC S16 pjDbmDelUlRbCb
1222 (
1223 PjCb   *gCb,
1224 U8      rbId,
1225 U8      rbType,
1226 PjUlRbCb   **rbCb, 
1227 U8      rb,
1228 PjUlUeCb  *ueCb
1229 )
1230 #else
1231 PUBLIC S16 pjDbmDelUlRbCb(gCb,rbId,rbType,rbCb,rb)
1232 PjCb   *gCb;
1233 U8      rbId;
1234 U8      rbType;
1235 PjUlRbCb   **rbCb;
1236 U8      rb;
1237 PjUlUeCb  *ueCb;
1238 #endif
1239 {
1240    S16      ret;
1241    PjUlRbCb   **rbCbLst;
1242    rbCbLst = NULLP;     
1243  
1244    TRC2(pjDbmDelUlRbCb)
1245
1246    ret   = RFAILED;
1247    /*updating rbCbList */                              
1248    rbCbLst = ((rbType == CM_LTE_SRB)? ueCb->srbCb:ueCb->drbCb); 
1249    if ( (*rbCb) != NULLP )
1250    {
1251       PJ_DBM_DELETE_UL_RBCB(gCb,(*rbCb));
1252       ret = ROK;
1253       /*updating rbCbList */
1254       rbCbLst[rbId] = NULLP;         
1255    }
1256    RETVALUE(ret);
1257
1258 } /* pjDbmDelRbCb */
1259
1260 /**
1261  *
1262  * @brief Handler to add UL Transaction Id to List 
1263  *       
1264  *
1265  * @b Description
1266  *        This function is invoked by CFG to add all itransaction IDs to
1267  *        hashlist of PjCb.
1268  *
1269  *  @return  S16
1270  *      -# ROK 
1271  *      -# RFAILED 
1272  *
1273 */
1274 #ifdef ANSI
1275 PUBLIC S16 pjDbmAddUlTransIdLst
1276 (
1277 PjCb              *gCb,
1278 PjCfgInfo         *cfg       /* UE Control Block */
1279 )
1280 #else
1281 PUBLIC S16 pjDbmAddUlTransIdLst(gCb,cfg)
1282 PjCb              *gCb;
1283 PjCfgInfo         *cfg;     /* UE Control Block */
1284 #endif
1285 {
1286    S16      ret;              /* Return Value */
1287
1288    TRC3(pjDbmAddUlTransIdLst)
1289
1290 #ifdef DEBUGP
1291 #ifndef ALIGN_64BIT
1292    RLOG1(L_UNUSED, "pjDbmAddUlTransIdLst(transId(%ld))", cfg->transId);
1293 #else
1294    RLOG1(L_UNUSED, "pjDbmAddUlTransIdLst(transId(%d))", cfg->transId);
1295 #endif
1296 #endif
1297
1298    ret = cmHashListInsert(&(gCb->u.ulCb->transIdLstCp), (PTR)cfg, 
1299          (U8 *)&(cfg->transId), (U16) sizeof(cfg->transId));
1300    if (ret != ROK)
1301    {
1302 #ifdef DEBUGP
1303       RLOG0(L_ERROR, "Hash Insert Failed for Inserting UL transId");
1304 #endif
1305       RETVALUE(ret);
1306    }
1307
1308    RETVALUE(ret);
1309 } /* pjDbmAddUlTransIdLst */
1310
1311 /**
1312  *
1313  * @brief Handler to Find UL Transaction Id in the List 
1314  *       
1315  *
1316  * @b Description
1317  *        This function is invoked by CFG to Find transaction IDs in the
1318  *        hashlist of PjCb.
1319  *
1320  *  @return  S16
1321  *      -# ROK 
1322  *      -# RFAILED 
1323  *
1324 */
1325 #ifdef ANSI
1326 PUBLIC S16 pjDbmFindUlTransIdLst
1327 (
1328 PjCb              *gCb,
1329 U32               transId,
1330 PjCfgInfo         **cfg       /* UE Control Block */
1331 )
1332 #else
1333 PUBLIC S16 pjDbmFindUlTransIdLst(gCb,cfg)
1334 PjCb              *gCb;
1335 U32                transId;
1336 PjCfgInfo         *cfg;     /* UE Control Block */
1337 #endif
1338 {
1339    S16      ret;              /* Return Value */
1340
1341    TRC3(pjDbmFindUlTransIdLst)
1342
1343 #ifdef DEBUGP
1344 #ifndef ALIGN_64BIT
1345    RLOG1(L_DEBUG, "pjDbmFindUlTransIdLst(transId(%ld))", transId);
1346 #else
1347    RLOG1(L_DEBUG, "pjDbmFindUlTransIdLst(transId(%d))", transId);
1348 #endif
1349 #endif
1350
1351    ret = cmHashListFind(&(gCb->u.ulCb->transIdLstCp),(U8 *) &transId, 
1352                   sizeof (transId), PJ_DEF_SEQ_NUM,(PTR *) cfg); 
1353    if (ret != ROK)
1354    {
1355 #ifdef DEBUGP
1356       RLOG1(L_ERROR,"Hash Find Failed Fetch for transId [%d]", transId);
1357 #endif
1358    }
1359    ret = pjDbmDelUlTransIdLst(gCb, cfg);
1360    if (ret != ROK)
1361    {
1362 #ifdef DEBUGP
1363       RLOG0(L_ERROR,"Deleting Trans ID Failed");
1364 #endif
1365       RETVALUE(ret);
1366    }
1367
1368    RETVALUE(ret);
1369 } /* pjDbmAddUlTransIdLst */
1370
1371 /**
1372  *
1373  * @brief Handler to Delete UL Transaction Id to List 
1374  *       
1375  *
1376  * @b Description
1377  *        This function is invoked by CFG to Delete transaction IDs From the
1378  *        hashlist of PjCb.
1379  *
1380  *  @return  S16
1381  *      -# ROK 
1382  *      -# RFAILED 
1383  *
1384 */
1385 #ifdef ANSI
1386 PUBLIC S16 pjDbmDelUlTransIdLst
1387 (
1388 PjCb              *gCb,
1389 PjCfgInfo         **cfg       /* UE Control Block */
1390 )
1391 #else
1392 PUBLIC S16 pjDbmDelUlTransIdLst(gCb,cfg)
1393 PjCb              *gCb;
1394 PjCfgInfo         **cfg;     /* UE Control Block */
1395 #endif
1396 {
1397    S16      ret;              /* Return Value */
1398
1399    TRC3(pjDbmDelUlTransIdLst)
1400
1401 #ifdef DEBUGP
1402    RLOG0(L_DEBUG, "pjDbmFindUlTransIdLst(transId()" );
1403 #endif
1404
1405    ret = cmHashListDelete(&(gCb->u.ulCb->transIdLstCp),(PTR) (*cfg)); 
1406    if (ret != ROK)
1407    {
1408 #ifdef DEBUGP
1409       RLOG1(L_ERROR," Hash Delete Failed for transId(%d)",(*cfg)->transId);
1410 #endif
1411    }
1412
1413    RETVALUE(ret);
1414 } /* pjDbmAddUlTransIdLst */
1415
1416 /**
1417  *
1418  * @brief Handler to Delete All  UL Transaction Ids from the List 
1419  *       
1420  *
1421  * @b Description
1422  *        This function is invoked by CFG to Delete all itransaction IDs from the
1423  *        hashlist of PjCb.
1424  *
1425  *  @return  S16
1426  *      -# ROK 
1427  *      -# RFAILED 
1428  *
1429 */
1430 #ifdef ANSI
1431 PUBLIC S16 pjDbmDelAllUlTransIdLst
1432 (
1433 PjCb              *gCb
1434 )
1435 #else
1436 PUBLIC S16 pjDbmDelAllUlTransIdLst(gCb)
1437 PjCb              *gCb;
1438 #endif
1439 {
1440    S16      ret;              /* Return Value */
1441    PjCfgInfo *cfg;
1442
1443    TRC3(pjDbmDelAllUlTransIdLst)
1444
1445 #ifdef DEBUGP
1446    RLOG0(L_DEBUG, "pjDbmFindUlTransIdLst");
1447 #endif
1448    ret = ROK;
1449    cfg = NULLP; /*KW_FIX*/
1450    /* Until no more ueCb is ueLstCp hash list get and delete ueCb */
1451    while (cmHashListGetNext(&(gCb->u.ulCb->transIdLstCp), 
1452                (PTR) cfg, (PTR *)&cfg) == ROK)
1453
1454    {
1455       /* Delete ueCb */
1456       ret = pjDbmDelUlTransIdLst(gCb,&cfg);
1457       if (ret != ROK)
1458       {
1459 #ifdef DEBUGP
1460          RLOG0(L_ERROR, " pjDbmDelTransIdLst Failed.");
1461 #endif
1462          RETVALUE(ret);
1463       }
1464       
1465       cfg = NULLP;
1466    }
1467
1468    RETVALUE(ret);
1469 } /* pjDbmAddUlTransIdLst */
1470
1471
1472
1473
1474
1475
1476 /********************************************************************30**
1477   
1478          End of file
1479 **********************************************************************/