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: LTE-PDCP Layer - Upper Interface Functions
25 Desc: Source code for PDCP Upper Interface Module
26 This file contains following functions
39 **********************************************************************/
40 static const char* RLOG_MODULE_NAME="PDCP";
41 static int RLOG_MODULE_ID=1024;
42 static int RLOG_FILE_ID=225;
44 @brief PDCP Upper Interface Module
48 /* header (.h) include files */
49 #include "envopt.h" /* environment options */
50 #include "envdep.h" /* environment dependent */
51 #include "envind.h" /* environment independent */
53 #include "gen.h" /* general */
54 #include "ssi.h" /* system services */
55 #include "cm5.h" /* common timer defines */
56 #include "cm_tkns.h" /* common tokens defines */
57 #include "cm_mblk.h" /* common memory allocation library defines */
58 #include "cm_llist.h" /* common link list defines */
59 #include "cm_hash.h" /* common hash list defines */
60 #include "cm_lte.h" /* common LTE defines */
61 #include "lpj.h" /* LPJ define */
62 #include "cpj.h" /* RRC layer */
63 #include "pju.h" /* PDCP service user */
64 #include "pj_env.h" /* RLC environment options */
65 #include "pj.h" /* RLC defines */
69 /* extern (.x) include files */
70 #include "gen.x" /* general */
71 #include "ssi.x" /* system services */
73 #include "cm5.x" /* common timer library */
74 #include "cm_tkns.x" /* common tokens */
75 #include "cm_mblk.x" /* common memory allocation */
76 #include "cm_llist.x" /* common link list */
77 #include "cm_hash.x" /* common hash list */
78 #include "cm_lte.x" /* common LTE includes */
79 #include "cm_lib.x" /* common memory allocation library */
80 #include "lpj.x" /* LM(PDCP) */
81 #include "cpj.x" /* RRC layer */
82 #include "pju.x" /* PDCP service user */
85 #include "pj_udx.h" /* LIB */
86 #include "pj_udx.x" /* LIB */
90 /* kw004.201 Assigned build issue in LTE RLC pj_uim.c */
94 /*****************************************************************************
96 ****************************************************************************/
101 * Handler for binding the PDCP upper layer service user with
106 * 1. This function is used by PDCP user to request for binding to
108 * 2. This function is called by the UDX interface to bind
109 * PDCP's SAP (identified by spId) with the service user's
110 * SAP (identified by suId). @n
112 * @param[in] pst Post structure
113 * @param[in] suId Service user SAP ID
114 * @param[in] spId Service provider ID
121 PUBLIC S16 PjDlUdxBndReq
128 PUBLIC S16 PjDlUdxBndReq (pst, suId, spId)
134 PjUdxDlSapCb *udxSap; /* pointer to session SAP */
135 S16 ret; /* return value */
142 tPjCb = PJ_GET_PJCB(pst->dstInst);
144 RLOG2(L_DEBUG, "PjDlUdxBndReq(pst, spId(%d), suId(%d))", spId, suId);
146 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
148 /* Verify UDX SAP State */
149 switch(udxSap->state)
151 /* SAP is configured but not bound */
155 /* copy bind configuration parameters in SSAP sap */
157 udxSap->pst.dstProcId = pst->srcProcId;
158 udxSap->pst.dstEnt = pst->srcEnt;
159 udxSap->pst.dstInst = pst->srcInst;
161 /* Update the State */
162 udxSap->state = PJ_SAP_BND;
164 RLOG1(L_DEBUG, "PjDlUdxBndReq: state (%d)", udxSap->state);
168 /* SAP is already bound */
172 * Sap is already bound check source, destination Entity and
175 if (udxSap->pst.dstProcId != pst->srcProcId
176 || udxSap->pst.dstEnt != pst->srcEnt
177 || udxSap->pst.dstInst != pst->srcInst
178 || udxSap->suId != suId)
181 RLOG1(L_DEBUG, "PjDlUdxBndReq: SAP already bound -- state(%d)",
190 RLOG0(L_ERROR, "Invalid UDX DL SAP State in Bind Req");
198 PjDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_OK);
202 PjDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_NOK);
206 } /* PjDlUdxBndReq */
213 * Handler for unbinding the RLC upper layer service user UDX with
218 * 1. This function is used by RLC user to request for unbinding
220 * 2. This function is called by the UDX interface to
221 * unbind with RLC. @n
223 * @param[in] pst Post structure
224 * @param[in] spId Service provider SAP ID
225 * @param[in] reason Reason for Unbinding
232 PUBLIC S16 PjDlUdxUbndReq
239 PUBLIC S16 PjDlUdxUbndReq(pst, spId, reason)
245 PjUdxDlSapCb *udxSap; /* UDX SAP control block */
250 tPjCb = PJ_GET_PJCB(pst->dstInst);
251 RLOG2(L_DEBUG, "PjDlUdxUbndReq(pst, spId(%d), reason(%d))", spId, reason);
256 /* disable upper sap (UDX) */
257 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
259 udxSap->state = PJ_SAP_CFG;
262 } /* PjDlUdxUbndReq */
269 * Handler for Sending the PDCP Status Report.
273 * This function is used by PDCP-DL to send PDCP Status Report.
275 * @param[in] pst - Post structure
276 * @param[in] spId - Serive Provider ID
277 * @param[in] staRep - PDCP Status Report.
284 PUBLIC S16 PjDlUdxUlStaRep
288 UdxUlStaRepInfo *staRep
291 PUBLIC S16 PjDlUdxUlStaRep(pst, spId, staRep)
294 UdxUlStaRepInfo *staRep;
300 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
301 S16 ret; /* Return Value */
303 TRC3(PjDlUdxUlStaRep);
307 tPjCb = PJ_GET_PJCB(pst->dstInst);
309 RLOG1(L_DEBUG, "PjDlUdxUlStaRep(pst, spId(%d))", spId);
311 RLOG1(L_DEBUG, "PjDlUdxUlStaRep(pst, spId(%d))", spId);
315 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
317 /* Validate SAP ID under ERRORCLS */
318 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
321 /* pj002.201 Freeing from proper region */
322 PJ_FREE_BUF(staRep->sta);
323 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxUlStaRepInfo));
328 ret = pjDbmFetchDlUeCb(tPjCb, staRep->pdcpId.ueId, staRep->pdcpId.cellId, &ueCb);
330 /* Ue Cb is not present */
331 if( ROK != ret || NULLP == ueCb)
333 RLOG_ARG1(L_ERROR, DBG_CELLID, staRep->pdcpId.cellId,"UeId[%u] not found",
334 staRep->pdcpId.ueId);
335 PJ_FREE_BUF(staRep->sta);
336 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxUlStaRepInfo));
341 PJ_DBM_FETCH_DL_RBCB(staRep->pdcpId.rbId, staRep->pdcpId.rbType, ueCb, tRbCb);
343 /* Rb Cb is not present or Rb Cb is not configured for PDCP */
346 RLOG_ARG2(L_WARNING, DBG_UEID,staRep->pdcpId.ueId, "CellId[%u]:RbId[%d] not found",
347 staRep->pdcpId.cellId, staRep->pdcpId.rbId);
348 PJ_FREE_BUF(staRep->sta);
349 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxUlStaRepInfo));
353 /* This will go to the RLC as a datReq. So we will get a confirm for it
354 * we have to make sure that the count does not clash with the existing
355 * counts. So pick a value that is least expected to clash. */
356 if (tRbCb->state != PJ_STATE_NORMAL)
358 if (tRbCb->dlCb.staRep != NULL)
360 PJ_FREE_BUF(tRbCb->dlCb.staRep);
362 tRbCb->dlCb.staRep = staRep->sta;
366 pjDlmSendDatReq(tPjCb,tRbCb,0xffffffff, staRep->sta);
369 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxUlStaRepInfo));
372 } /* PjDlUdxUlStaRep */
378 * Handler for Handling the PDCP Status Report.
382 * This function is used by PDCP-DL to handle the PDCP Status Report
383 * from peer PDCP entity.
385 * @param[in] pst - Post structure
386 * @param[in] spId - Serive Provider ID
387 * @param[in] staRep - PDCP Status Report.
394 PUBLIC S16 PjDlUdxDlStaRep
398 UdxDlStaRepInfo *staRep
401 PUBLIC S16 PjDlUdxDlStaRep(pst, spId, staRep)
404 UdxDlStaRepInfo *staRep;
410 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
411 S16 ret; /* Return Value */
413 TRC3(PjDlUdxDlStaRep);
417 tPjCb = PJ_GET_PJCB(pst->dstInst);
419 RLOG1(L_DEBUG, "PjDlUdxDlStaRep(pst, spId(%d))", spId);
421 RLOG1(L_DEBUG, "PjDlUdxDlStaRep(pst, spId(%d))", spId);
425 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
427 /* Validate SAP ID under ERRORCLS */
428 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
431 /* pj002.201 Freeing from proper region */
432 PJ_FREE_BUF(staRep->staPdu);
433 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxDlStaRepInfo));
438 ret = pjDbmFetchDlUeCb(tPjCb, staRep->pdcpId.ueId, staRep->pdcpId.cellId, &ueCb);
440 /* Ue Cb is not present */
441 if( ROK != ret || NULLP == ueCb)
443 RLOG_ARG1(L_ERROR, DBG_CELLID, staRep->pdcpId.cellId,"UeId[%u] not found",
444 staRep->pdcpId.ueId);
445 PJ_FREE_BUF(staRep->staPdu);
446 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxDlStaRepInfo));
451 PJ_DBM_FETCH_DL_RBCB(staRep->pdcpId.rbId, staRep->pdcpId.rbType, ueCb, tRbCb);
453 /* Rb Cb is not present or Rb Cb is not configured for PDCP */
456 RLOG_ARG2(L_WARNING, DBG_UEID,staRep->pdcpId.ueId, "CellId[%u]:RbId[%d] not found",
457 staRep->pdcpId.cellId, staRep->pdcpId.rbId);
458 PJ_FREE_BUF(staRep->staPdu);
459 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxDlStaRepInfo));
463 ret = pjDlmHndlStaRep(tPjCb, tRbCb, staRep->fmc, staRep->staPdu);
465 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staRep, sizeof(UdxDlStaRepInfo));
468 } /* PjUdxDlStaRep */
476 * Handler for configuring Downlink PDCP entities.
480 * This function is used by RRC to configure(add/delete/modify/
481 * reestalish/delete all RB in a UE) one or more PDCP entities.
483 * - UDX_CFG_ADD => pjCfgAddRb
484 * - UDX_CFG_MODIFY => pjCfgReCfgRb
485 * - UDX_CFG_DELETE => pjCfgDelRb
486 * - UDX_CFG_REESTABLISH => pjCfgReEstRb
487 * - UDX_CFG_DELETE_UE => pjCfgDelUe
489 * @param[in] pst - Post structure
490 * @param[in] spId - Service Provider ID
491 * @param[in] cfg - Configuration information for one or more PDCP entities.
498 PUBLIC S16 PjDlUdxCfgReq
505 PUBLIC S16 PjDlUdxCfgReq(pst, spId, cfg)
512 UdxCfgCfmInfo *cfgCfm; /* Configuraiton Confirm */
514 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
515 Bool reEstPres; /* ReEstablishment present */
516 Bool startTmr; /* Add present */
517 S16 ret; /* Return Value */
518 PjDlUeCb *ueCb; /* UE Control Block for storing the
519 cfg structure in case of ReEstablishment */
533 tPjCb = PJ_GET_PJCB(pst->dstInst);
535 RLOG2(L_DEBUG, "PjDlUdxCfgReq(pst, spId(%d), TransId(%ld))",
538 RLOG2(L_DEBUG, "PjDlUdxCfgReq(pst, spId(%d), TransId(%d))",
543 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
545 /* Validate SAP ID under ERRORCLS */
546 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
549 /* pj002.201 Freeing from proper region */
550 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, cfg, sizeof(UdxCfgReqInfo));
555 PJ_ALLOC_BUF_SHRABL(udxSap->pst, cfgCfm,
556 sizeof (UdxCfgCfmInfo), ret);
557 /* Allocate memory and memset to 0 for cfmInfo */
560 RLOG0(L_FATAL, "Memory Allocation failed.");
561 /* pj002.201 Freeing from proper region */
562 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, cfg, sizeof(UdxCfgReqInfo));
567 pjDbmFetchDlUeCb(tPjCb, cfg->ueId, cfg->cellId, &ueCb);
568 /* KW_FIX : UDX_MAX_CFG , UDX_MAX_CFM have the same value , hence checking for only one */
569 /* For every entity configuration process by cfgType */
570 for (idx = 0; idx < cfg->numEnt && idx < UDX_MAX_CFG; idx++)
572 UdxCfmEnt *entCfgCfm;
575 entCfg = (UdxCfgEnt *)&(cfg->cfgEnt[idx]);
576 entCfgCfm = (UdxCfmEnt *)&(cfgCfm->cfmEnt[idx]);
580 /* Fill the detault values here */
581 PJ_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType, UDX_CFG_CFM_OK,\
586 RLOG_ARG1(L_WARNING, DBG_CELLID,cfg->cellId,"UeId[%u] not found",
588 PJ_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType, CPJ_CFG_CFM_NOK,\
589 CPJ_CFG_REAS_UE_UNKWN);
591 RLOG_ARG1(L_WARNING,DBG_UEID,cfg->ueId,
592 "Dl RB Config Req- UE CB is not found for cellid (%d)",cfg->cellId);
593 if (entCfg->cfgType != UDX_CFG_ADD)
595 /* all other requests require ueCb mandatorily */
600 switch (entCfg->cfgType)
604 if (entCfg->m.addCfg.rlcInfo.dir & PJ_DIR_DL)
609 /* Add a new RB entity configuration */
610 if (pjCfgAddDlRb(tPjCb,cfg->ueId, cfg->cellId, isHo,
611 entCfg, &ueCb,entCfgCfm) != ROK)
613 RLOG_ARG3(L_ERROR,DBG_UEID,cfg->ueId, "Dl Cfg RB Add Req"
614 " for cellId(%d), rbId(%d) Failed: reason (%d)",
615 cfg->cellId, cfg->cfgEnt[idx].rbId, entCfgCfm->reason);
617 /* Only In case of DRB only we need to set this flag */
619 else if(PJ_DRB == entCfg->rbType)
621 if(entCfg->m.addCfg.hdrCompCfg.hdrCompUsed)
623 cfmType |= PJ_CFG_ASYNC_CFM;
627 #endif /* PJ_CMP_ASYNC */
634 /* Re-configure the existing RB entity configuration */
635 if ((entCfg->m.modCfg.bitFlag & 0x02) ||
636 (entCfg->m.modCfg.hdrCompCfg.hdrCompUsed) ||
637 (entCfg->m.modCfg.hoInfo.isHoPres & CPJ_HO_DL))
639 if (pjCfgReCfgDlRb(tPjCb,ueCb, entCfg, entCfgCfm) != ROK)
641 RLOG_ARG3(L_ERROR,DBG_UEID,cfg->ueId,"Dl RB Modify Req"
642 "for cellId(%d),rbId(%d) not done as RbCb not found: reason(%d)",
643 cfg->cellId,cfg->cfgEnt[idx].rbId, entCfgCfm->reason);
646 else if(PJ_DRB == entCfg->rbType)
648 if(entCfg->m.modCfg.hdrCompCfg.hdrCompUsed)
650 cfmType |= PJ_CFG_ASYNC_CFM;
654 #endif /* PJ_CMP_ASYNC */
661 /* Delete the existing RB entity configuration */
662 if (pjCfgDelDlRb(tPjCb, ueCb, entCfg, entCfgCfm) != ROK)
664 RLOG_ARG3(L_WARNING,DBG_UEID,cfg->ueId, "Dl RB Delete Req for"
665 "for cellId(%d), rbId(%d) not done as RbCb not found: reason (%d)",
666 cfg->cellId, cfg->cfgEnt[idx].rbId, entCfgCfm->reason);
671 case UDX_CFG_REESTABLISH:
673 if (pjCfgReEstDlRb(tPjCb, ueCb, entCfg, entCfgCfm) != ROK)
675 RLOG_ARG3(L_ERROR,DBG_UEID,cfg->ueId, "Dl RB Re-establih Req"
676 "for cellId(%d), rbId(%d) Failed: reason (%d)",
677 cfg->cellId, cfg->cfgEnt[idx].rbId, entCfgCfm->reason);
681 cfmType |= PJ_CFG_REEST_ASYNC_CFM;
688 case UDX_CFG_DELETE_UE:
690 /* Delete all RB entity configuration under UE */
691 if (pjCfgDelDlUe(tPjCb, ueCb,entCfg, entCfgCfm) != ROK)
694 RLOG_ARG3(L_ERROR,DBG_UEID,cfg->ueId, "Dl UE Delete Req for"
695 "cellId(%d), rbId(%d) Failed: reason (%d)",
696 cfg->cellId, cfg->cfgEnt[idx].rbId, entCfgCfm->reason);
698 #if (defined(PJ_SEC_ASYNC) || defined(PJ_CMP_ASYNC))
701 /* Wait for any messages in the Demand q to be processed */
702 cfmType |= PJ_CFG_UEDEL_ASYNC_CFM;
705 #endif /* (defined(PJ_SEC_ASYNC) || defined(PJ_CMP_ASYNC)) */
711 PJ_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType, UDX_CFG_CFM_NOK,\
712 UDX_CFG_REAS_INVALID_CFG);
714 RLOG_ARG3(L_ERROR,DBG_UEID,cfg->ueId, "Dl Cfg Req with Invalid"
715 "config type,cellId(%d),cfgType(%d),rbId(%d) ",
716 cfg->cellId, entCfg->cfgType, cfg->cfgEnt[idx].rbId);
721 /* Assign number of entity configuraitons and suId */
722 cfgCfm->transId = cfg->transId;
723 cfgCfm->ueId = cfg->ueId;
724 cfgCfm->cellId = cfg->cellId;
725 cfgCfm->numEnt = cfg->numEnt;
731 if(TRUE == reEstPres )
734 pjUtlDlSaveCfmInfo(tPjCb, ueCb, cfmType, startTmr, ENTPJ, (PTR)cfgCfm, (PTR)cfg);
736 pjUtlDlUpdUpSecKeys(tPjCb, ueCb);
738 PJ_PST_FREE(udxSap->pst.region, udxSap->pst.pool, cfgCfm, sizeof(UdxCfgCfmInfo));
740 PjDlUdxCfgCfm(&(udxSap->pst), udxSap->suId, cfgCfm);
746 pjUtlDlSaveCfmInfo(tPjCb, ueCb, cfmType, startTmr, ENTPJ, (PTR)cfgCfm, (PTR)cfg);
747 PJ_PST_FREE(udxSap->pst.region, udxSap->pst.pool, cfgCfm, sizeof(UdxCfgCfmInfo));
750 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, cfg, sizeof(UdxCfgReqInfo));
754 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, cfg, sizeof(UdxCfgReqInfo));
755 PjDlUdxCfgCfm(&(udxSap->pst), udxSap->suId, cfgCfm);
760 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, cfg, sizeof(UdxCfgReqInfo));
761 PjDlUdxCfgCfm(&(udxSap->pst), udxSap->suId, cfgCfm);
765 } /* PjDlUdxCfgReq */
768 *@details This primitive is used by RRC to change the UeId for the existing UE
771 * @param pst - Point to the pst structure
772 * @param spId - The ID of the service provider SAP in the PDCP layer
773 * @param transId - Transaction ID. This field uniquily identifies
774 * transaction between RRC and PDCP.
775 * @param ueInfo - Old UE Id Info for which the change request has come
776 * @param newUeInfo - New UE Id Info for existing UE context
780 PUBLIC S16 PjDlUdxUeIdChgReq
789 PUBLIC S16 PjDlUdxUeIdChgReq(pst,spId,transId,ueInfo,newUeInfo)
794 UdxUeInfo *newUeInfo;
797 S16 ret; /* Return Value */
798 CmStatus status; /* Status of the request */
799 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
800 UdxUeInfo *tUeInfo; /* Temporary UE info */
803 TRC3(PjDlUdxUeIdChgReq)
805 tPjCb = PJ_GET_PJCB(pst->dstInst);
808 RLOG2(L_DEBUG, "PjDlUdxUeIdChgReq(pst, spId(%d), transId(%ld))", spId, transId);
810 RLOG2(L_DEBUG, "PjDlUdxUeIdChgReq(pst, spId(%d), transId(%d))", spId, transId);
815 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
816 status.reason = UDX_CFG_REAS_NONE;
817 status.status = UDX_CFG_CFM_OK;
819 /* Validate SAP ID under ERRORCLS */
820 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
823 /* kw002.201 Freeing from proper region */
824 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, ueInfo, sizeof(UdxUeInfo));
825 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, newUeInfo, sizeof(UdxUeInfo));
829 if (pjCfgDlUeIdChng(tPjCb, ueInfo,
830 newUeInfo, &status) != ROK)
832 RLOG_ARG4(L_ERROR,DBG_UEID,ueInfo->ueId,"Dl UeId Change Req old-ueId(%d),"
833 "new-ueId(%d), cellId(%d) Failed: reason (%d)",
834 ueInfo->ueId, newUeInfo->ueId, newUeInfo->cellId, status.reason);
837 /* Allocate memory for UdxUeInfo */
838 /* Memory leak fix ccpu00135359 */
839 PJ_ALLOC_BUF_SHRABL(udxSap->pst, tUeInfo,
840 sizeof (UdxUeInfo), ret);
843 /* Free memory for UdxUeInfo */
844 /* kw002.201 Freeing from proper region */
845 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, ueInfo, sizeof(UdxUeInfo));
846 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, newUeInfo, sizeof(UdxUeInfo));
848 RLOG0(L_FATAL, "Memory Allocation failed.");
852 tUeInfo->ueId = ueInfo->ueId;
853 tUeInfo->cellId = ueInfo->cellId;
855 /* Free memory for CkwUeInfo */
856 /* kw002.201 Freeing from proper region */
857 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, ueInfo, sizeof(UdxUeInfo));
858 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, newUeInfo, sizeof(UdxUeInfo));
860 PjDlUdxUeIdChgCfm(&(udxSap->pst), udxSap->suId, transId, tUeInfo, status);
863 } /* PjDlUdxUeIdChgReq */
868 * 1. RRC uses this primitive to configure PDCP security parameters.
869 * Integrity protection and/or Ciphering are configured by RRC based on the
871 * 2. Integirty Protection/Ciphering are configured per UE and applicable
872 * to all pdcp entities in that UE. Both Integrity protection and ciphering are
873 * re-configured during re-establishment. @n
875 * @param pst - Point to the pst structure
876 * @param spId - The ID of the service provider SAP in the PDCP layer
877 * @param secCfg - Security Configuration Info per UE.
884 PUBLIC S16 PjDlUdxSecCfgReq
888 UdxSecCfgReqInfo *secCfg
891 PUBLIC S16 PjDlUdxSecCfgReq(pst,spId,secCfg)
894 UdxSecCfgReqInfo *secCfg;
897 S16 ret; /* Return Value */
898 UdxSecCfgCfmInfo *cfgCfm; /* Security Cfg Confirm structure */
899 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
901 PjDlUeCb *ueCb; /* UE Control Block */
905 TRC2(PjDlUdxSecCfgReq)
906 tPjCb = PJ_GET_PJCB(pst->dstInst);
909 RLOG2(L_DEBUG, "PjDlUdxSecCfgReq(pst, spId(%d), TransId(%ld))", spId,
912 RLOG2(L_DEBUG, "PjDlUdxSecCfgReq(pst, spId(%d), TransId(%d))", spId,
920 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
925 PJ_ALLOC_BUF_SHRABL(udxSap->pst, cfgCfm,
926 sizeof (UdxSecCfgCfmInfo), ret);
929 /* Free memory for CfgReqInfo */
930 /* kw002.201 Freeing from proper region */
931 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, secCfg, sizeof(UdxSecCfgReqInfo));
933 RLOG0(L_FATAL, "Memory Allocation failed.");
937 if ( pjCfgPrcSecDlCfg(tPjCb,secCfg,
940 RLOG_ARG2(L_ERROR,DBG_UEID,secCfg->ueId, " Dl Sec Cfg Req for cellId(%d)"
941 " Failed: reason (%d)", secCfg->cellId, cfgCfm->reason);
945 ret = pjDbmFetchDlUeCb(tPjCb,secCfg->ueId, secCfg->cellId, &ueCb);
948 pjUtlDlSaveCfmInfo(tPjCb, ueCb, PJ_SEC_ASYNC_CFM, TRUE, ENTPJ, (PTR)cfgCfm, NULLP);
949 PJ_FREE(tPjCb, cfgCfm, sizeof(UdxSecCfgCfmInfo));
953 RLOG_ARG1(L_ERROR, DBG_CELLID, secCfg->cellId,"UeId[%u] not found",
955 PjDlUdxSecCfgCfm(&(udxSap->pst), udxSap->suId, cfgCfm);
958 PjDlUdxSecCfgCfm(&(udxSap->pst), udxSap->suId, cfgCfm);
961 /* Configuration information needs to be freed from proper region */
962 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, secCfg, sizeof(UdxSecCfgReqInfo));
971 * 1. RRC uses this primitive to re-establish the PDCP entity. @n
972 * 2. This primitive is initiation of re-establishment procedure. @n
973 * 3. This prmitive and corresponding confirmation shall be followed by
974 * PjDlUdxCfgReq procedure for entire re-establishment procedure to complete.
976 * @param[in] pst - Pointer to post structure.
977 * @param[in] spId - Service provider ID. This is the reference number used by
978 * PDCP to identify its SAP.
979 * @param[in] reEstReq - PDCP re-establishment request structure.
983 PUBLIC S16 PjDlUdxReEstReq
987 UdxReEstReqInfo *reEstReq
990 PUBLIC S16 PjDlUdxReEstReq(pst,spId,reEstReq)
993 UdxReEstReqInfo *reEstReq;
996 S16 ret; /* Return Value */
997 UdxReEstCfmInfo *reEstCfm; /* Re-Establish Confirm */
998 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
1001 TRC2(PjDlUdxReEstReq);
1003 tPjCb = PJ_GET_PJCB(pst->dstInst);
1004 RLOG1(L_DEBUG, "PjDlUdxReEstReq(pst, spId(%d))", spId);
1007 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
1009 /* Validate SAP ID under ERRORCLS */
1010 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
1013 /* pj002.201 Freeing from proper region */
1014 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, reEstReq, sizeof(UdxReEstReqInfo));
1017 PJ_ALLOC_BUF_SHRABL(udxSap->pst , reEstCfm,
1018 sizeof (UdxReEstCfmInfo), ret);
1021 /* Free memory for CfgReqInfo */
1022 /* kw002.201 Freeing from proper region */
1023 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, reEstReq, sizeof(UdxReEstReqInfo));
1025 RLOG0(L_FATAL, "Memory Allocation failed.");
1029 if ( pjCfgDlReEstReq(tPjCb,(UdxReEstReqInfo *)reEstReq,
1030 (UdxReEstCfmInfo *)reEstCfm) != ROK )
1032 RLOG_ARG2(L_ERROR,DBG_UEID,reEstReq->pdcpId.ueId, "Dl Re-Est Req Cfg for"
1033 " cellId(%d) Failed: reason (%u)",
1034 reEstReq->pdcpId.cellId, reEstCfm->status);
1036 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, reEstReq, sizeof(UdxReEstReqInfo));
1037 PjDlUdxReEstCfm(&(udxSap->pst), udxSap->suId, reEstCfm);
1041 /* kw002.201 Freeing from proper region */
1042 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, reEstReq, sizeof(UdxReEstReqInfo));
1045 /* If Async is enabled then we need to wait for confirmation */
1048 PjDlUdxReEstCfm(&(udxSap->pst), udxSap->suId, reEstCfm);
1055 * 1. RRC uses this primitive to request count value for all DRBs in a UE. @n
1056 * 2. PDCP sends the UL and DL count values in the confirmation of this request.
1058 * @param[in] pst - Pointer to post structure.
1059 * @param[in] spId - Service provider ID. This is the reference number used
1060 * by PDCP to identify its SAP.
1061 * @param[in] countReq - PDCP Count Request Information.
1066 PUBLIC S16 PjDlUdxCountReq
1070 UdxCountReqInfo *countReq
1073 PUBLIC S16 PjDlUdxCountReq(pst,spId,countReq)
1076 UdxCountReqInfo *countReq;
1080 S16 ret; /* Return Value */
1081 UdxCountCfmInfo *countCfm; /* Count Confirm structure */
1082 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
1085 TRC2(PjDlUdxCountReq);
1087 tPjCb = PJ_GET_PJCB(pst->dstInst);
1088 RLOG1(L_DEBUG, "PjDlUdxCountReq(pst, spId(%d))", spId);
1092 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
1093 PJ_ALLOC_BUF_SHRABL(udxSap->pst, countCfm,
1094 sizeof (UdxCountCfmInfo), ret);
1097 /* Free memory for CfgReqInfo */
1098 /* kw002.201 Freeing from proper region */
1099 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, countReq, sizeof(UdxCountReqInfo));
1101 RLOG0(L_FATAL, "Memory Allocation failed.");
1104 if ( pjCfgPrcDlCount(tPjCb, countReq,
1107 RLOG_ARG2(L_ERROR,DBG_UEID,countReq->ueId, "Dl Count Req for cellId(%d)"
1108 " Failed: reason (%d)",
1109 countReq->cellId, countCfm->reason);
1113 /* Freeing from proper region */
1114 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, countReq, sizeof(UdxCountReqInfo));
1116 PjDlUdxCountCfm(&(udxSap->pst), udxSap->suId,countCfm);
1125 * 1. RRC uses this primitive to request the status of the SDUs for DRBs in an UE. @n
1126 * 2. Its used as a reestablishment request during handover. @n
1127 * 3. This primitive is used to forward the handover control Information to the target
1130 * @param[in] pst - Pointer to post structure.
1131 * @param[in] spId - Service provider ID. This is the reference number used
1132 * by PDCP to identify its SAP.
1133 * @param[in] sduStaReq - PDCP SDU Status Request Information.
1138 PUBLIC S16 PjDlUdxSduStaReq
1142 UdxSduStaReqInfo *staReq
1145 PUBLIC S16 PjDlUdxSduStaReq(pst,spId,staReq)
1148 UdxSduStaReqInfo *staReq;
1152 S16 ret; /* Return Value */
1153 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
1156 TRC2(PjDlUdxSduStaReq);
1161 tPjCb = PJ_GET_PJCB(pst->dstInst);
1162 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
1164 RLOG1(L_DEBUG, "PjDlUdxSduStaReq(pst, spId(%d))", spId);
1167 /* Validate SAP ID under ERRORCLS */
1168 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
1171 /* kw002.201 Freeing from proper region */
1172 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staReq, sizeof(UdxSduStaReqInfo));
1176 if (pjCfgPrcDlSduSta(tPjCb,(UdxSduStaReqInfo *) staReq) != ROK )
1178 RLOG_ARG1(L_ERROR,DBG_UEID,staReq->ueId,
1179 "Dl Sdu Sta Req for cellId(%d) Failed",staReq->cellId);
1183 /* kw002.201 Freeing from proper region */
1184 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, staReq, sizeof(UdxSduStaReqInfo));
1193 * Handler for Sending the Feed back Packet Info to DL-RLC.
1197 * This function is used by PDCP-DL to send Feedback Packet Info to DL-RLC.
1199 * @param[in] pst - Post structure
1200 * @param[in] spId - Serive Provider ID
1201 * @param[in] fdbkPktInfo - Feedback Packet Info.
1208 PUBLIC S16 PjDlUdxUlFdbkPktInfo
1212 UdxUlFdbkPktInfo *fdbkPktInfo
1215 PUBLIC S16 PjDlUdxUlFdbkPktInfo(pst, spId, fdbkPktInfo)
1218 UdxUlFdbkPktInfo *fdbkPktInfo;
1224 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
1225 S16 ret; /* Return Value */
1228 Buffer *rohcFdbPdu = NULLP;
1230 TRC3(PjDlUdxUlFdbkPktInfo);
1233 tPjCb = PJ_GET_PJCB(pst->dstInst);
1235 RLOG1(L_DEBUG, "PjDlUdxUlFdbkPktInfo(pst, spId(%d))", spId);
1237 RLOG1(L_DEBUG, "PjDlUdxUlFdbkPktInfo(pst, spId(%d))", spId);
1240 /* Get the udxSap */
1241 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
1243 /* Validate SAP ID under ERRORCLS */
1244 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
1247 /* pj002.201 Freeing from proper region */
1248 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1249 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1254 ret = pjDbmFetchDlUeCb(tPjCb, fdbkPktInfo->pdcpId.ueId, fdbkPktInfo->pdcpId.cellId, &ueCb);
1256 /* Ue Cb is not present */
1257 if( ROK != ret || NULLP == ueCb)
1259 RLOG_ARG1(L_ERROR, DBG_CELLID, fdbkPktInfo->pdcpId.cellId,"UeId[%u] not found",
1260 fdbkPktInfo->pdcpId.ueId);
1261 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1262 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1267 PJ_DBM_FETCH_DL_RBCB(fdbkPktInfo->pdcpId.rbId, fdbkPktInfo->pdcpId.rbType, ueCb, tRbCb);
1269 /* Rb Cb is not present or Rb Cb is not configured for PDCP */
1270 if( NULLP == tRbCb )
1272 RLOG_ARG2(L_WARNING, DBG_UEID,fdbkPktInfo->pdcpId.ueId, "CellId[%u]:RbId[%d] not found",
1273 fdbkPktInfo->pdcpId.cellId, fdbkPktInfo->pdcpId.rbId);
1274 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1275 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1279 hdr |= PJ_ROHC_FEEDBACK_HDR;
1280 rohcFdbPdu = fdbkPktInfo->fbPkt;
1282 ret = SAddPreMsg((Data) hdr, rohcFdbPdu);
1285 RLOG0(L_ERROR, "SAddPreMsg failed for ROHC Feedbck pdu");
1286 PJ_FREE_BUF(rohcFdbPdu);
1290 if(tRbCb->mode == PJ_DRB_UM)
1292 count = tRbCb->dlCb.nxtToSub - 1;
1296 count = tRbCb->dlCb.cfmExp - 1;
1299 pjDlmSendDatReq(tPjCb, tRbCb, count, rohcFdbPdu);
1300 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1303 } /* PjUlUdxUlFdbkPktInfo*/
1309 * Handler for Sending the Feed back Packet Info to Compression entity.
1313 * This function is used by PDCP-DL to send Feedback Packet Info to Compression entity.
1315 * @param[in] pst - Post structure
1316 * @param[in] spId - Serive Provider ID
1317 * @param[in] fdbkPktInfo - Feedback Packet Info.
1324 PUBLIC S16 PjDlUdxDlFdbkPktInfo
1328 UdxDlFdbkPktInfo *fdbkPktInfo
1331 PUBLIC S16 PjDlUdxDlFdbkPktInfo(pst, spId, fdbkPktInfo)
1334 UdxDlFdbkPktInfo *fdbkPktInfo;
1340 PjUdxDlSapCb *udxSap; /* UDX SAP Control Block */
1341 S16 ret; /* Return Value */
1344 PjLibTrans libTrans; /* Transaction Id for compression */
1345 #endif /* PJ_SEC_ASYNC */
1347 TRC3(PjDlUdxDlFdbkPktInfo);
1350 tPjCb = PJ_GET_PJCB(pst->dstInst);
1352 RLOG1(L_DEBUG, "PjDlUdxDlFdbkPktInfo(pst, spId(%d))", spId);
1354 RLOG1(L_DEBUG, "PjDlUdxDlFdbkPktInfo(pst, spId(%d))", spId);
1357 /* Get the udxSap */
1358 udxSap = (tPjCb->u.dlCb->udxDlSap + spId);
1360 /* Validate SAP ID under ERRORCLS */
1361 PJ_VALDATE_SAP(tPjCb,spId, udxSap, ret);
1364 /* pj002.201 Freeing from proper region */
1365 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1366 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1371 ret = pjDbmFetchDlUeCb(tPjCb, fdbkPktInfo->pdcpId.ueId, fdbkPktInfo->pdcpId.cellId, &ueCb);
1373 /* Ue Cb is not present */
1374 if( ROK != ret || NULLP == ueCb)
1376 RLOG_ARG1(L_ERROR, DBG_CELLID, fdbkPktInfo->pdcpId.cellId,"UeId[%u] not found",
1377 fdbkPktInfo->pdcpId.ueId);
1378 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1379 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1384 PJ_DBM_FETCH_DL_RBCB(fdbkPktInfo->pdcpId.rbId, fdbkPktInfo->pdcpId.rbType, ueCb, tRbCb);
1386 /* Rb Cb is not present or Rb Cb is not configured for PDCP */
1387 if( NULLP == tRbCb )
1389 RLOG_ARG2(L_WARNING, DBG_UEID,fdbkPktInfo->pdcpId.ueId, "CellId[%u]:RbId[%d] not found",
1390 fdbkPktInfo->pdcpId.cellId, fdbkPktInfo->pdcpId.rbId);
1391 PJ_FREE_BUF(fdbkPktInfo->fbPkt);
1392 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1397 /* Assign transId and cxtId */
1398 libTrans.count = tRbCb->dlCb.nxtToSub;
1399 /* pj005.201 ccpu00114955 corrected the RB ID calculation */
1400 libTrans.rbId = tRbCb->rbId - 1;
1401 libTrans.rbType = tRbCb->rbType;
1402 libTrans.ueCb = (PTR)tRbCb->ueCb;
1404 PjLibObdCmpFbReq(&(tPjCb->pjGenCfg.obdPst.cmpPst), tRbCb->cmpCxtId, libTrans,
1405 fdbkPktInfo->fbPkt);
1407 pjLibCmpFbReq(tRbCb->cmpCxtId, fdbkPktInfo->fbPkt);
1410 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, fdbkPktInfo, sizeof(UdxDlFdbkPktInfo));
1413 } /* PjDlUdxDlFdbkPktInfo*/
1420 PUBLIC S16 PjDlUdxL2MeasReq
1423 PjL2MeasReqEvt *measReqEvt
1426 PUBLIC S16 PjDlUdxL2MeasReq (pst, measReqEvt)
1428 PjL2MeasReqEvt *measReqEvt;
1435 TRC3(PjDlUdxL2MeasReq);
1437 tPjCb = PJ_GET_PJCB(pst->dstInst);
1438 /* Initialize measCfmEvt */
1441 measType = measReqEvt->measReq.measType;
1443 RLOG1(L_DEBUG, "L2_MEAS START Measurement type is %u",
1446 for(cntr = 0; cntr < LPJ_MAX_QCI; cntr++)
1448 tPjCb->u.dlCb->pjL2Cb.measOn[cntr] |= measType;
1450 #ifdef SS_LOCKLESS_MEMORY
1451 PJ_FREE_SHRABL_BUF(tPjCb,measReqEvt, sizeof(PjL2MeasReqEvt));
1453 PJ_FREE(tPjCb,measReqEvt, sizeof(PjL2MeasReqEvt));
1458 } /* KwDlUdxMeasReq */
1462 This function processes L2 Measurement stop request received from the layer manager.
1463 After receving this request, RLC stops L2 Measurement
1464 * @param[in] pst post structure
1465 * @param[in] measType meas Type
1468 * -# Failure : RFAILED
1472 PUBLIC S16 PjDlUdxL2MeasStopReq
1478 PUBLIC S16 PjDlUdxL2MeasStopReq (pst, measType)
1484 PjL2MeasEvtCb *measEvtCb = NULLP;
1485 PjL2MeasCb *measCb = NULLP;
1488 PjL2MeasCfmEvt measCfmEvt;
1490 TRC3(PjDlUdxMeasStopReq);
1491 tPjCb = PJ_GET_PJCB(pst->dstInst);
1492 RLOG0(L_DEBUG, "L2_MEAS Received stopReq\n");
1493 cmMemset((U8*)&measCfmEvt, 0, sizeof(PjL2MeasCfmEvt));
1494 for(cntr = 0; cntr < LPJ_MAX_L2MEAS; cntr++)
1496 measEvtCb = &(tPjCb->u.dlCb->pjL2Cb.pjL2EvtCb[cntr]);
1497 if(measEvtCb->measCb.measType & measType)
1499 measCb = &measEvtCb->measCb;
1500 pjUtlResetDlL2MeasCntr(tPjCb, measCb, measType);
1504 status = LCM_PRIM_OK;
1505 PjMiLpjL2MeasStopCfm(&tPjCb->pjGenCfg.lmPst, measType,status);
1510 This function processes L2 Measurement Send request received from the layer manager.
1511 After receving this request, RLC sends L2 Measurement
1512 * @param[in] pst post structure
1513 * @param[in] measType meas Type
1516 * -# Failure : RFAILED
1520 PUBLIC S16 PjDlUdxL2MeasSendReq
1526 PUBLIC S16 PjDlUdxL2MeasSendReq (pst, measType)
1532 PjL2MeasEvtCb *measEvtCb = NULLP;
1535 TRC3(PjDlUdxMeasSendReq);
1537 tPjCb = PJ_GET_PJCB(pst->dstInst);
1538 RLOG1(L_DEBUG, "L2_MEAS: Sending Meas for meastype %u",
1541 for(cntr = 0; cntr < LPJ_MAX_L2MEAS; cntr++)
1543 measEvtCb = &(tPjCb->u.dlCb->pjL2Cb.pjL2EvtCb[cntr]);
1544 if(measEvtCb->measCb.measType & measType)
1546 pjUtlSndDlL2MeasCfm(tPjCb, measEvtCb);
1553 #endif /* LTE_L2_MEAS */
1556 This function processes Data Resume request received from the Application.
1557 * @param[in] pst post structure
1558 * @param[in] measType meas Type
1561 * -# Failure : RFAILED
1565 PUBLIC S16 PjDlUdxDatResumeReq
1568 UdxDatResumeInfo *datResumeInfo
1571 PUBLIC S16 PjDlUdxDatResumeReq (pst, *datResumeInfo)
1573 UdxDatResumeInfo *datResumeInfo;
1581 UdxDatResumeCfmInfo *cfmInfo;
1582 PjUdxDlSapCb *udxSap;
1584 tPjCb = PJ_GET_PJCB(pst->dstInst);
1587 /* Perform processing for filling up cfm structures */
1588 /* Memory leak fix ccpu00135359 */
1589 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
1590 PJ_ALLOC_BUF_SHRABL(udxSap->pst, cfmInfo,
1591 sizeof (UdxDatResumeCfmInfo), ret);
1594 RLOG0(L_FATAL, "Memory Allocation failed.");
1595 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datResumeInfo, sizeof(UdxDatResumeInfo));
1599 cfmInfo->ueId = datResumeInfo->ueId;
1600 cfmInfo->cellId = datResumeInfo->cellId;
1601 cfmInfo->transId = datResumeInfo->transId;
1602 cfmInfo->status = CPJ_CFG_CFM_OK;
1603 cfmInfo->reason = CPJ_CFG_REAS_NONE;
1605 ret = pjDbmFetchDlUeCb(tPjCb, datResumeInfo->ueId,
1606 datResumeInfo->cellId, &ueCb);
1608 /* Ue Cb is not present */
1609 if( ROK != ret || NULLP == ueCb)
1611 RLOG_ARG1(L_ERROR, DBG_CELLID, datResumeInfo->cellId,"UeId[%u] not found",
1612 datResumeInfo->ueId);
1613 cfmInfo->status = CPJ_CFG_CFM_NOK;
1614 cfmInfo->reason = CPJ_CFG_REAS_UE_UNKWN;
1615 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datResumeInfo, sizeof(UdxDatResumeInfo));
1616 /* Send Failure SduStaCfm */
1617 PjDlUdxDatResumeCfm(&tPjCb->u.dlCb->udxDlSap[0].pst,
1618 tPjCb->u.dlCb->udxDlSap[0].suId, cfmInfo);
1622 for(rbCnt = 0; rbCnt < PJ_MAX_DRB_PER_UE; rbCnt ++)
1624 /* Check of rbCb available */
1625 if( (pjRbCb = ueCb->drbCb[rbCnt]) == NULLP)
1630 pjDlmRbDataResume(tPjCb,pjRbCb);
1631 pjRbCb->state = PJ_STATE_NORMAL;
1634 ueCb->libInfo.state = PJ_STATE_NORMAL;
1635 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datResumeInfo, sizeof(UdxDatResumeInfo));
1637 PjDlUdxDatResumeCfm(&tPjCb->u.dlCb->udxDlSap[0].pst,
1638 tPjCb->u.dlCb->udxDlSap[0].suId, cfmInfo);
1646 This function processes Start Data Forwarding request received from UL
1647 * @param[in] pst post structure
1648 * @param[in] measType meas Type
1651 * -# Failure : RFAILED
1655 PUBLIC S16 PjDlUdxDatForwardReq
1658 UdxDatForwardInfo *datFwdInfo
1661 PUBLIC S16 PjDlUdxDatForwardReq (pst, *datFwdInfo)
1663 UdxDatForwardInfo *datFwdInfo;
1668 PjDlUeCb *ueCb =NULLP;
1669 PjDlRbCb *pjRbCb = NULLP;
1671 UdxDatFwdCfmInfo *cfmInfo = NULLP;
1672 PjUdxDlSapCb *udxSap;
1674 tPjCb = PJ_GET_PJCB(pst->dstInst);
1677 udxSap = &(tPjCb->u.dlCb->udxDlSap[0]);
1678 /* Allocate MEM and fill the DatFwd Cfm Struct */
1679 PJ_ALLOC_BUF_SHRABL(udxSap->pst, cfmInfo,
1680 sizeof (UdxDatFwdCfmInfo), ret);
1684 #if (ERRCLASS & ERRCLS_DEBUG)
1685 RLOG0(L_FATAL, "Memory Allocation failed.");
1686 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datFwdInfo, sizeof(UdxDatForwardInfo));
1691 cfmInfo->ueId = datFwdInfo->ueId;
1692 cfmInfo->cellId = datFwdInfo->cellId;
1693 cfmInfo->status = CPJ_CFG_CFM_OK;
1695 ret = pjDbmFetchDlUeCb(tPjCb,datFwdInfo->ueId,
1696 datFwdInfo->cellId, &ueCb);
1698 /* Ue Cb is not present */
1699 if( ROK != ret || NULLP == ueCb)
1701 RLOG_ARG1(L_ERROR, DBG_CELLID, datFwdInfo->cellId,"UeId[%u] not found",
1703 cfmInfo->status = CPJ_CFG_CFM_NOK;
1704 cfmInfo->reason = CPJ_CFG_REAS_UE_UNKWN;
1705 /* Send Cfm to UL so that it can fwd the UL Pkts */
1706 PjDlUdxDatFwdCfm(&tPjCb->u.dlCb->udxDlSap[0].pst,
1707 tPjCb->u.dlCb->udxDlSap[0].suId, cfmInfo);
1708 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datFwdInfo, sizeof(UdxDatForwardInfo));
1712 for(rbCnt = 0; rbCnt < PJ_MAX_DRB_PER_UE; rbCnt ++)
1714 /* Check of rbCb available */
1715 if( (pjRbCb = ueCb->drbCb[rbCnt]) == NULLP)
1720 if(pjRbCb->mode == PJ_DRB_AM)
1722 pjDlmStartDataFrwdPerRb(tPjCb,pjRbCb);
1725 /* Send Data Fwd Cfm to the UL PDCP Module
1726 * The UL PDCP Module will forward UL Pkts
1727 * after receiving this cfm Info */
1728 PjDlUdxDatFwdCfm(&tPjCb->u.dlCb->udxDlSap[0].pst,
1729 tPjCb->u.dlCb->udxDlSap[0].suId, cfmInfo);
1731 PJ_FREE_SHRABL_BUF_PST(pst->region, pst->pool, datFwdInfo, sizeof(UdxDatForwardInfo));
1738 /********************************************************************30**
1740 **********************************************************************/