1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: PDCP - Database module file
25 Desc: Source code for Database Module functions such as,
40 *********************************************************************21*/
41 static const char* RLOG_MODULE_NAME="PDCP";
42 static int RLOG_MODULE_ID=1024;
43 static int RLOG_FILE_ID=216;
46 /* header (.h) include files */
47 #include "envopt.h" /* environment options */
48 #include "envdep.h" /* environment dependent */
49 #include "envind.h" /* environment independent */
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 */
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 */
86 /* forward references */
88 /* public variable declarations */
89 PUBLIC S16 pjDeciphStateChek ARGS ((PjCb *gCb, PjRxEnt *delEnt));
90 /* This structure holds all the global structs we need. */
92 /* private variable declarations */
94 /* private function declarations */
97 @brief PDCP DBM Module
100 /*****************************************************************************
101 * HANDLER FOR THE TRANSMISSION BUFFER
102 ****************************************************************************/
104 /*****************************************************************************
105 * HANDLERS FOR THE RECEPTION BUFFER
106 ****************************************************************************/
109 * @brief Handler to insert packets In-Sequence into RX Buffer
114 PRIVATE S16 pjDbmInsInSeqRxEnt
116 PjBuf *buf, /* !< Rx Buffer */
117 PjRxEnt *rxEnt /* !< Rx Entry */
120 PRIVATE S16 pjDbmInsInSeqRxEnt(buf, rxEnt)
126 PjRxEnt *tmpEnt = NULLP;
128 tmpEnt = (PjRxEnt *) cmLListNode(cmLListFirst(&buf->datPktQ));
129 if((rxEnt->count) < (tmpEnt->count))
131 rxEnt->datPktEnt.node = (PTR) rxEnt;
132 cmLListInsCrnt(&buf->datPktQ, &rxEnt->datPktEnt);
136 tmpEnt = (PjRxEnt *) cmLListNode(cmLListLast(&buf->datPktQ));
137 while((rxEnt->count) < (tmpEnt->count))
139 cmLListPrev(&buf->datPktQ);
140 tmpEnt = (PjRxEnt *) cmLListNode(cmLListCrnt(&buf->datPktQ));
142 rxEnt->datPktEnt.node = (PTR) rxEnt;
143 cmLListInsAfterCrnt(&buf->datPktQ, &rxEnt->datPktEnt);
152 * @brief Handler to insert into a RX Buffer
155 * This function is invoked by to insert into
156 * the reception buffer hash List
158 * @param[in] buf Rx Buffer
159 * @param[in] rxEnt Reception Entry
160 * @param[in] dupFlag Search for duplicates(Should be TRUE for AM)
168 PUBLIC S16 pjDbmInsRxEnt
171 PjBuf *buf, /* !< Rx Buffer */
172 PjRxEnt *rxEnt, /* !< Rx Entry */
173 Bool dupFlag /* !< Boolean to check for duplicate entries */
176 PUBLIC S16 pjDbmInsRxEnt(gCb, buf, rxEnt, dupFlag)
178 PjBuf *buf; /* !< Rx Buffer */
179 PjRxEnt *rxEnt; /* !< Rx Entry */
180 Bool dupFlag; /* !< Boolean to check for duplicate entries */
183 U8 hashKey; /* Computed hash key */
184 PjRxEnt *tmpEnt = NULLP; /* Rx Entry Ptr */
188 PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
189 "pjDbmInsRxEnt buf, rxEnt(%ld), dupFlag(%d)\n",\
190 rxEnt->count, dupFlag));
192 PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
193 "pjDbmInsRxEnt buf, rxEnt(%d), dupFlag(%d)\n",\
194 rxEnt->count, dupFlag));
199 /* Search for duplicates */
200 tmpEnt = pjDbmGetRxEnt(gCb, buf, rxEnt->count);
207 /* Compute the hash index */
208 hashKey = (U8)PJ_HASH_FN(buf, rxEnt->count); /*KW_FIX*/
210 rxEnt->lstEnt.node = (PTR) rxEnt;
211 cmLListAdd2Tail(&buf->datQ[hashKey], &rxEnt->lstEnt);
214 if(buf->datPktQ.count == 0)
216 rxEnt->datPktEnt.node = (PTR) rxEnt;
217 cmLListAdd2Tail(&buf->datPktQ, &rxEnt->datPktEnt);
221 pjDbmInsInSeqRxEnt(buf, rxEnt);
225 } /* pjDbmRxBufIns */
230 * @brief Handler to fetch from a RX Buffer
233 * This function is invoked to fetch an entry from
234 * the transaction buffer hash List
236 * @param[in] buf Rx Buffer
237 * @param[in] count Count value of the entry to retrieve
245 PUBLIC PjRxEnt* pjDbmGetRxEnt
248 PjBuf *buf, /* !< Rx Buffer */
249 U32 count /* !< Count value of the entry to retrieve */
252 PUBLIC PjRxEnt* pjDbmGetRxEnt(gCb, buf, count)
254 PjBuf *buf; /* !< Rx Buffer */
255 U32 count; /* !< Count value of the entry to retrieve */
258 U8 hashKey; /* Computed hashKey */
259 CmLListCp *datQ; /* Ptr to the CmLListCp */
260 PjRxEnt *tmpEnt = NULLP; /* Loop var - Rx Entr Ptr */
263 /* Compute the hask key*/
264 hashKey = (U8)PJ_HASH_FN(buf, count); /*KW_FIX*/
266 datQ = &buf->datQ[hashKey];
268 /* Loop through and search */
270 while(cmLListCrnt(datQ))
272 tmpEnt = (PjRxEnt *)cmLListNode(cmLListCrnt(datQ));
273 if((tmpEnt->count) == count)
280 } /* pjDbmGetRxEnt */
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
286 * Function : pjDeciphStateChek
293 * -# Failure : RFAILED
297 #if (defined (LTE_PAL_ENB) || defined (TENB_ACC))
299 PUBLIC S16 pjDeciphStateChek
305 PUBLIC S16 pjDeciphStateChek(gCb, delEnt)
310 TRC3(pjDeciphStateChek);
311 PJ_FREE_BUF(delEnt->mBuf);
312 PJ_FREE(gCb, delEnt, sizeof(PjRxEnt));
320 * @brief Handler to delete from a RX Buffer
323 * This function is invoked by to delete from
324 * the transaction buffer hash List
326 * @param[in] buf Rx Buffer Control Point
327 * @param[in] count Count value of the Rx Entry to delete
335 PUBLIC S16 pjDbmDelRxEnt
338 PjBuf *buf, /* !< Rx Buffer */
339 U32 count /* !< Count value of the entry to retrieve */
342 PUBLIC S16 pjDbmDelRxEnt(gCb, buf, count)
344 PjBuf *buf; /* !< Rx Buffer */
345 U32 count; /* !< Count value of the entry to retrieve */
348 U8 hashKey; /* Computed hash value */
349 CmLListCp *datQ; /* Pointer to the the ListCp */
350 PjRxEnt *delEnt; /* Loop var - entry to be deleted */
354 PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
355 "pjDbmDelRxEnt(buf, count(%ld)\n", count));
357 PJDBGP(gCb,(PJ_DBGMASK_UTL | PJ_DBGMASK_DETAIL), (gCb->init.prntBuf,\
358 "pjDbmDelRxEnt(buf, count(%d)\n", count));
362 delEnt = pjDbmGetRxEnt(gCb, buf, count);
369 hashKey = (U8)PJ_HASH_FN(buf, count); /*KW_FIX*/
370 datQ = &buf->datQ[hashKey];
372 /* delete the entity and free it*/
373 cmLListDelFrm(datQ, &delEnt->lstEnt);
374 if(delEnt->datPktEnt.node != NULLP)
376 cmLListDelFrm(&buf->datPktQ, &delEnt->datPktEnt);
377 delEnt->datPktEnt.node = NULLP;
380 pjDeciphStateChek(gCb, delEnt);
384 } /* pjDbmDelRxEnt */
389 * @brief Handler to Delete all the elements in the hashlist
393 * This function is invoked by delete all the elements in th3
402 PUBLIC S16 pjDbmRxDelAll
405 PjBuf *buf /* !< Rx Buffer */
408 PUBLIC S16 pjDbmRxDelAll(gCb,buf)
410 PjBuf *buf; /* !< Rx Buffer */
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 */
420 RLOG0(L_DEBUG, "pjDbmRxDelAll(buf)");
422 for(listInd = 0; listInd< buf->numBins; listInd++)
424 datQ = &buf->datQ[listInd];
425 while(cmLListFirst(datQ))
427 lstEnt = cmLListDelFrm(datQ, cmLListCrnt(datQ));
430 delEnt = (PjRxEnt *)cmLListNode(lstEnt);
431 if(delEnt->datPktEnt.node != NULLP)
433 cmLListDelFrm(&buf->datPktQ, &delEnt->datPktEnt);
434 delEnt->datPktEnt.node = NULLP;
437 pjDeciphStateChek(gCb, delEnt);
444 } /* pjDbmRxDelAll */
448 * @brief Handler to De initialize hash list
452 * This function is invoked by LMM to De initialize the
461 PUBLIC S16 pjDbmRxDeInit
464 PjBuf *buf /* !< Rx Buffer */
467 PUBLIC S16 pjDbmRxDeInit(gCb,buf)
469 PjBuf *buf; /* !< Rx Buffer */
475 RLOG0(L_DEBUG, "pjDbmRxDeInit(buf)");
477 /* Cleanup all entries */
478 pjDbmRxDelAll(gCb,buf);
480 /* Cleanup hashlist */
481 PJ_FREE(gCb, buf->datQ, (sizeof(CmLListCp) * buf->numBins));
482 buf->numBins = NULLP;
490 * @brief Handler to initialize hash list
494 * This function is invoked by LMM to initialize the UeCb and CellCb
503 PUBLIC S16 pjDbmUlInit
508 PUBLIC S16 pjDbmUlInit(gCb)
512 S16 ret; /* Return Value */
517 RLOG0(L_DEBUG, "pjDbmInit()");
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);
527 RLOG0(L_ERROR, "cmHashListInit Failed for gCb.ueLstCp.");
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));
538 cmHashListDeinit(&gCb->u.ulCb->ueLstCp);
540 RLOG0(L_ERROR, "cmHashListInit Failed for pjCb.transIdLstCp.");
551 * @brief Handler to De initialize hash list
555 * This function is invoked by LMM to De initialize the UeCb and CellCb
564 PUBLIC S16 pjDbmUlDeInit
569 PUBLIC S16 pjDbmUlDeInit(gCb)
573 S16 ret; /* Return Value */
578 RLOG0(L_DEBUG, "pjDbmDeInit()");
581 /* Initialize ueCb Hash List */
582 ret = cmHashListDeinit(&(gCb->u.ulCb->ueLstCp));
586 RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb.ueLstCp.");
590 /* Initialize transId Hash List */
592 ret = cmHashListDeinit(&(gCb->u.ulCb->transIdLstCp));
596 RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb.transIdLstCp.");
601 ret = cmHashListDeinit(&(gCb->u.ulCb->transIdLstCp));
605 RLOG0(L_ERROR, "cmHashListDeinit Failed for gCb->u.ulCb->transIdLstCp");
615 * @brief Handler to fetch rbCb in the Upper Interface
619 * This function is invoked by CFG to fetch rbCb from the cellCb/ueCb in
620 * the upper interface (CPJ/PJU).
622 * @param[in] rlcId RLC Identifier
623 * @param[out] rbCb RB Control Block
631 PUBLIC S16 pjDbmFetchUlRbCb
634 CmLteRlcId rlcId, /* RLC Identifier */
635 PjUlRbCb **rbCb /* RB Cb */
638 PUBLIC S16 pjDbmFetchUlRbCb(gCb, rlcId, rbCb)
640 CmLteRlcId rlcId; /* RLC Identifier */
641 PjUlRbCb **rbCb; /* RB Cb */
644 PjUlUeCb *ueCb; /* UE Control Block */
645 PjUlRbCb *tRbCb; /* Local RB CB */
646 S16 ret; /* Return Value */
648 TRC3(pjDbmFetchUlRbCb)
653 /* Validate the RBID in case of TM/UM/AM */
654 PJ_VALIDATE_RBID(rlcId.ueId, rlcId.rbId, rlcId.rbType, ret);
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);
665 if (pjDbmFetchUlUeCb(gCb, rlcId.ueId, rlcId.cellId, &ueCb) != ROK)
668 RLOG_ARG0(L_ERROR,DBG_UEID,rlcId.ueId, "Failed to Fetch UE Cb");
674 PJ_DBM_FETCH_UL_RBCB(rlcId.rbId, rlcId.rbType, ueCb, tRbCb);
679 RLOG_ARG2(L_ERROR, DBG_UEID,rlcId.ueId, "CellId[%u]:RbId[%d] not found",
680 rlcId.cellId, rlcId.rbId);
687 } /* pjDbmFetchRbCb */
693 * @brief Handler to delete RbCb
697 * This function is invoked by CFG to remove RbCb from Ue/Cell hashlist
700 * @param[in] rbCbLst - Rb Cb List
701 * @param[in] numRbCb - Number of rbCbs
709 PUBLIC S16 pjDbmDelAllUlRb
712 PjUlRbCb **rbCbLst, /* RB Cb list */
713 U8 numRbCb /* Number of rbCbs */
716 PUBLIC S16 pjDbmDelAllUlRb(gCb,rbCbLst, numRbCb)
718 PjUlRbCb **rbCbLst; /* RB Cb list */
719 U8 numRbCb; /* Number of rbCbs */
723 PjUlRbCb *rbCb; /* RB Control Block */
725 TRC3(pjDbmDelAllUlRb)
728 RLOG1(L_DEBUG, "pjDbmDelAllRb(rbCbLst, numRbCb(%d))", numRbCb);
731 for (idx = 0; idx < numRbCb; idx++)
736 PJ_DBM_DELETE_UL_RBCB(gCb,rbCb);
737 rbCbLst[idx] = NULLP;
742 } /* pjDbmDelAllRb */
747 * @brief Handler to create an UeCb
751 * This function is invoked by CFG to create UeCb and insert into the Ue hashlist
755 * @param[in] ueId UE Identifier
756 * @param[in] cellId Cell Identifier
764 PUBLIC S16 pjDbmCreateUlUeCb
767 CmLteRnti ueId, /* UE Identifier */
768 CmLteCellId cellId, /* Cell Identifier */
769 PjUlUeCb **ueCb /* UE Control Block */
772 PUBLIC S16 pjDbmCreateUlUeCb(gCb, ueId, cellId, ueCb)
774 CmLteRnti ueId; /* UE Identifier */
775 CmLteCellId cellId; /* Cell Identifier */
776 PjUlUeCb **ueCb; /* UE Control Block */
779 S16 ret; /* Return Value */
780 PjUlUeCb *tUeCb; /* UE Control Block */
782 TRC3(pjDbmCreateUlUeCb)
785 RLOG2(L_DEBUG, "pjDbmCreateUeCb(ueId(%d), cellId(%d))", ueId, cellId);
788 PJ_ALLOC(gCb, *ueCb, sizeof(PjUlUeCb));
790 #if (ERRCLASS & ERRCLS_ADD_RES)
794 RLOG0(L_FATAL, "Memory Allocation failure");
797 #endif /* ERRCLASS & ERRCLS_ADD_RES */
800 tUeCb->key.ueId = ueId;
801 tUeCb->key.cellId = cellId;
803 ret = cmHashListInsert(&(gCb->u.ulCb->ueLstCp), (PTR)tUeCb, (U8 *)&(tUeCb->key),
804 (U16) sizeof(PjUeKey));
808 RLOG_ARG1(L_ERROR,DBG_UEID,ueId,"Ul UeCb Hash Insert Failed : cellId(%d)",
814 /* kw005.201 ccpu00117318, updating the statistics */
815 gCb->pjGenSts.numUe++;
817 (*ueCb)->libInfo.state = PJ_STATE_NORMAL;
818 cmInitTimers(&((*ueCb)->libInfo.obdTmr), 1);
820 } /* kwDbmCreateUeCb */
825 * @brief Handler to Fetch an UeCb
829 * This function is invoked by CFG to fetch UeCb from the Ue hashlist
833 * @param[in] ueId UE Identifier
834 * @param[in] cellId Cell Identifier
835 * @param[out] ueCb UE Control Block
843 PUBLIC S16 pjDbmFetchUlUeCb
846 CmLteRnti ueId, /* UE Identifier */
847 CmLteCellId cellId, /* Cell Identifier */
848 PjUlUeCb **ueCb /* UE Control Block */
851 PUBLIC S16 pjDbmFetchUlUeCb(gCb, ueId, cellId, ueCb)
853 CmLteRnti ueId; /* UE Identifier */
854 CmLteCellId cellId; /* Cell Identifier */
855 PjUlUeCb **ueCb; /* UE Control Block */
858 S16 ret; /* Return Value */
859 PjUeKey key; /* Key for UE Hash List */
861 TRC3(pjDbmFetchUlUeCb)
867 ret = cmHashListFind(&(gCb->u.ulCb->ueLstCp), (U8 *)&(key), sizeof(PjUeKey),
868 PJ_DEF_SEQ_NUM, (PTR *) ueCb);
872 RLOG_ARG0(L_INFO,DBG_UEID,ueId, "Hash Find Failed for fetching ueCb");
878 } /* pjDbmFetchUeCb */
883 * @brief Handler to delete an UeCb
887 * This function is invoked by CFG to delete UeCb from the Ue hashlist
891 * @param[in] ueCb UE Control Block
892 * @param[in] abrtFlag Abort Flag
900 PUBLIC S16 pjDbmDelUlUeCb
903 PjUlUeCb *ueCb, /* UE Identifier */
904 Bool abortFlag /* Abort Flag */
907 PUBLIC S16 pjDbmDelUlUeCb(gCb, ueCb, abortFlag)
909 PjUlUeCb *ueCb; /* UE Identifier */
910 Bool abortFlag; /* Abort Flag */
913 S16 ret; /* Return Value */
919 RLOG2(L_DEBUG, "pjDbmDelUeCb(ueId(%d), cellId(%d))",
920 ueCb->key.ueId, ueCb->key.cellId);
923 /* kw005.201 Check to see if there is atleast one logical channel */
925 for ( idx = 0; idx< PJ_MAX_SRB_PER_UE; idx++)
926 pjCfgDelPjUlRbCb(gCb, ueCb, ueCb->srbCb[idx]);
928 for ( idx = 0; idx< PJ_MAX_DRB_PER_UE; idx++)
929 pjCfgDelPjUlRbCb(gCb, ueCb, ueCb->drbCb[idx]);
931 /* Close the Integrity/Ciphering channels */
932 if(ueCb->secInfo.secAct)
935 pjUtlUlIntClose(gCb,ueCb->secInfo.cpIntSessCxtId);
936 pjUtlUlCipherClose(gCb,ueCb->secInfo.cpCiphSessCxtId);
937 pjUtlUlCipherClose(gCb,ueCb->secInfo.upCiphSessCxtId);
939 pjUtlUlIntClose(gCb,ueCb->secInfo.intCxtId);
940 pjUtlUlCipherClose(gCb,ueCb->secInfo.cpCxtId);
941 pjUtlUlCipherClose(gCb,ueCb->secInfo.upCxtId);
945 /* Delete hoInfo if present */
946 if (ueCb->hoInfo != NULLP)
948 for (idx = 0; idx < PJ_MAX_DRB_PER_UE; idx++)
950 if (ueCb->hoInfo->hoCfmInfo[idx].pres == TRUE)
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 ));
959 PJ_FREE(gCb, ueCb->hoInfo->hoCfmInfo,
960 (PJ_MAX_DRB_PER_UE * sizeof(PjUlHoCfmInfo)));
961 PJ_FREE(gCb, ueCb->hoInfo, sizeof(PjUlHoInfo));
964 /* Delete ueCb entry from ueLstCp */
965 ret = cmHashListDelete(&(gCb->u.ulCb->ueLstCp), (PTR) ueCb);
970 RLOG_ARG0(L_ERROR,DBG_UEID,ueCb->key.ueId,
971 "Hash Delete Failed for deleting ueCb.");
974 /* kw005.201 ccpu00117318, updating the statistics */
975 gCb->pjGenSts.numUe--;
977 /* Deallocate ueCb */
978 PJ_FREE(gCb, ueCb, sizeof(PjUlUeCb));
986 * @brief Handler to delete all UeCbs
990 * This function is invoked by CFG to delete all UeCbs from the Ue
999 PUBLIC S16 pjDbmDelAllUlUe
1004 PUBLIC S16 pjDbmDelAllUlUe(gCb)
1009 PjUlUeCb *ueCb; /* UE Control Block */
1011 TRC3(pjDbmDelAllUlUe)
1014 RLOG0(L_DEBUG, "pjDbmDelAllUe()");
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)
1024 ret = pjDbmDelUlUeCb(gCb,ueCb, TRUE);
1028 RLOG_ARG0(L_ERROR,DBG_UEID,ueCb->key.ueId, "UE deletion Failed");
1036 } /* pjDbmDelAllUe */
1040 * @brief Handler to Shutdown all UeCbs
1044 * This function is invoked by CFG to shutdown UeCbs from the PjCb.
1052 PUBLIC S16 pjDbmUlShutdown
1057 PUBLIC S16 pjDbmUlShutdown(gCb)
1061 #if (ERRCLASS & ERRCLS_DEBUG)
1065 TRC3(pjDbmUlShutdown)
1067 #if (ERRCLASS & ERRCLS_DEBUG)
1068 ret = pjDbmUlDeInit(gCb);
1071 RLOG0(L_FATAL, "UL DeInitialization Failed");
1075 #endif /* ERRCLASS & ERRCLS_DEBUG */
1078 } /* pjDbmShutdown */
1082 * @brief Handler to create a RB control block.
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
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
1106 PUBLIC PjUlRbCb* pjDbmCreateUlRbCb
1115 PUBLIC PjUlRbCb* pjDbmCreateUlRbCb(gCb,rbId,rbType,ueCb,rb)
1126 TRC2(pjDbmCreateUlRbCb)
1130 PJ_ALLOC(gCb, rbCb, sizeof(PjUlRbCb) );
1131 if ( rbCb == NULLP )
1133 RLOG0(L_FATAL, "Memory Allocation failed");
1137 rbCb->rbType = rbType;
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);
1146 } /* pjDbmCreateRbCb */
1150 * @brief Handler to fetch a PDCP RB control block.
1154 * This function is used to fetch the PDCP RB control block based on
1155 * the RB id. The pointer to PjUlRbCb is returned.
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.
1167 PUBLIC S16 pjDbmFetchPjUlRbCb
1175 PUBLIC S16 pjDbmFetchPjUlRbCb(ueCb,rbId,rbType,pjRbCb)
1184 TRC2(pjDbmFetchPjUlRbCb)
1188 PJ_DBM_FETCH_UL_RBCB(rbId, rbType, ueCb, rbCb);
1189 if ( rbCb != NULLP )
1196 } /* pjDbmFetchPjUlRbCb */
1200 * @brief Handler to delete a PDCP/RLC RB control block.
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.
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
1221 PUBLIC S16 pjDbmDelUlRbCb
1231 PUBLIC S16 pjDbmDelUlRbCb(gCb,rbId,rbType,rbCb,rb)
1244 TRC2(pjDbmDelUlRbCb)
1247 /*updating rbCbList */
1248 rbCbLst = ((rbType == CM_LTE_SRB)? ueCb->srbCb:ueCb->drbCb);
1249 if ( (*rbCb) != NULLP )
1251 PJ_DBM_DELETE_UL_RBCB(gCb,(*rbCb));
1253 /*updating rbCbList */
1254 rbCbLst[rbId] = NULLP;
1258 } /* pjDbmDelRbCb */
1262 * @brief Handler to add UL Transaction Id to List
1266 * This function is invoked by CFG to add all itransaction IDs to
1275 PUBLIC S16 pjDbmAddUlTransIdLst
1278 PjCfgInfo *cfg /* UE Control Block */
1281 PUBLIC S16 pjDbmAddUlTransIdLst(gCb,cfg)
1283 PjCfgInfo *cfg; /* UE Control Block */
1286 S16 ret; /* Return Value */
1288 TRC3(pjDbmAddUlTransIdLst)
1292 RLOG1(L_UNUSED, "pjDbmAddUlTransIdLst(transId(%ld))", cfg->transId);
1294 RLOG1(L_UNUSED, "pjDbmAddUlTransIdLst(transId(%d))", cfg->transId);
1298 ret = cmHashListInsert(&(gCb->u.ulCb->transIdLstCp), (PTR)cfg,
1299 (U8 *)&(cfg->transId), (U16) sizeof(cfg->transId));
1303 RLOG0(L_ERROR, "Hash Insert Failed for Inserting UL transId");
1309 } /* pjDbmAddUlTransIdLst */
1313 * @brief Handler to Find UL Transaction Id in the List
1317 * This function is invoked by CFG to Find transaction IDs in the
1326 PUBLIC S16 pjDbmFindUlTransIdLst
1330 PjCfgInfo **cfg /* UE Control Block */
1333 PUBLIC S16 pjDbmFindUlTransIdLst(gCb,cfg)
1336 PjCfgInfo *cfg; /* UE Control Block */
1339 S16 ret; /* Return Value */
1341 TRC3(pjDbmFindUlTransIdLst)
1345 RLOG1(L_DEBUG, "pjDbmFindUlTransIdLst(transId(%ld))", transId);
1347 RLOG1(L_DEBUG, "pjDbmFindUlTransIdLst(transId(%d))", transId);
1351 ret = cmHashListFind(&(gCb->u.ulCb->transIdLstCp),(U8 *) &transId,
1352 sizeof (transId), PJ_DEF_SEQ_NUM,(PTR *) cfg);
1356 RLOG1(L_ERROR,"Hash Find Failed Fetch for transId [%d]", transId);
1359 ret = pjDbmDelUlTransIdLst(gCb, cfg);
1363 RLOG0(L_ERROR,"Deleting Trans ID Failed");
1369 } /* pjDbmAddUlTransIdLst */
1373 * @brief Handler to Delete UL Transaction Id to List
1377 * This function is invoked by CFG to Delete transaction IDs From the
1386 PUBLIC S16 pjDbmDelUlTransIdLst
1389 PjCfgInfo **cfg /* UE Control Block */
1392 PUBLIC S16 pjDbmDelUlTransIdLst(gCb,cfg)
1394 PjCfgInfo **cfg; /* UE Control Block */
1397 S16 ret; /* Return Value */
1399 TRC3(pjDbmDelUlTransIdLst)
1402 RLOG0(L_DEBUG, "pjDbmFindUlTransIdLst(transId()" );
1405 ret = cmHashListDelete(&(gCb->u.ulCb->transIdLstCp),(PTR) (*cfg));
1409 RLOG1(L_ERROR," Hash Delete Failed for transId(%d)",(*cfg)->transId);
1414 } /* pjDbmAddUlTransIdLst */
1418 * @brief Handler to Delete All UL Transaction Ids from the List
1422 * This function is invoked by CFG to Delete all itransaction IDs from the
1431 PUBLIC S16 pjDbmDelAllUlTransIdLst
1436 PUBLIC S16 pjDbmDelAllUlTransIdLst(gCb)
1440 S16 ret; /* Return Value */
1443 TRC3(pjDbmDelAllUlTransIdLst)
1446 RLOG0(L_DEBUG, "pjDbmFindUlTransIdLst");
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)
1456 ret = pjDbmDelUlTransIdLst(gCb,&cfg);
1460 RLOG0(L_ERROR, " pjDbmDelTransIdLst Failed.");
1469 } /* pjDbmAddUlTransIdLst */
1476 /********************************************************************30**
1479 **********************************************************************/