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
25 Desc: C source code for the upper interface of LTE-PDCP
29 *********************************************************************21*/
32 @brief PDCP Upper Interface
36 /* header (.h) include files */
37 #include "envopt.h" /* environment options */
38 #include "envdep.h" /* environment dependent */
39 #include "envind.h" /* environment independent */
41 #include "gen.h" /* general */
42 #include "ssi.h" /* system services */
43 #include "cm5.h" /* common timer defines */
44 #include "cm_tkns.h" /* common tokens defines */
45 #include "cm_mblk.h" /* common memory allocation library defines */
46 #include "cm_llist.h" /* common link list defines */
47 #include "cm_hash.h" /* common hash list defines */
48 #include "cm_lte.h" /* common LTE defines */
49 #include "cpj.h" /* CPJ defines */
50 #include "pju.h" /* PJU defines */
54 #include "pj_env.h" /* RLC environment options */
56 /* extern (.x) include files */
57 #include "gen.x" /* general */
58 #include "ssi.x" /* system services */
60 #include "cm5.x" /* common timer library */
61 #include "cm_tkns.x" /* common tokens */
62 #include "cm_mblk.x" /* common memory allocation */
63 #include "cm_llist.x" /* common link list */
64 #include "cm_hash.x" /* common hash list */
65 #include "cm_lte.x" /* common LTE includes */
66 #include "cm_lib.x" /* common memory allocation library */
67 #include "cpj.x" /* CPJ defines */
68 #include "pju.x" /* PJU defines */
69 #include "lpj.x" /* LPJ defines */
72 #if !(defined(LCPJUICPJ) && defined(NH))
76 #if !(defined(LCPJUIPJU) && (defined(PX))) || !(defined(NH))
82 #endif /* __cplusplus */
85 /*********************************************************************
86 * Forward Declartion for CPJ Porting Functions
87 ********************************************************************/
90 EXTERN S16 PtUiCpjBndCfm ARGS((Pst * pst, SuId suId, U8 status));
92 EXTERN S16 PtUiCpjCfgCfm ARGS((Pst * pst, SuId suId, CpjCfgCfmInfo * cfgCfm));
94 EXTERN S16 PtUiCpjReEstCfm ARGS((Pst * pst, SuId suId, CpjReEstCfmInfo * reEstCfm));
96 EXTERN S16 PtUiCpjSecCfgCfm ARGS((Pst * pst, SuId suId, CpjSecCfgCfmInfo * secCfgCfm));
98 EXTERN S16 PtUiCpjUeIdChgCfm ARGS((Pst * pst, SuId suId, U32 transId, CpjUeInfo * ueInfo, CmStatus status));
100 EXTERN S16 PtUiCpjCountCfm ARGS((Pst * pst, SuId suId, CpjCountCfmInfo * countCfm));
102 EXTERN S16 PtUiCpjSduStaCfm ARGS((Pst * pst, SuId suId, CpjSduStaCfmInfo * staCfm));
103 EXTERN S16 PtUiCpjKdfCfm ARGS((Pst* pst, SuId suId, CpjCfgTransId transId, CpjKdfCfmInfo *kdfCfmInf,
106 EXTERN S16 PtUiCpjDatResumeCfm ARGS(( Pst *pst, SuId suId, CpjDatResumeCfmInfo *datResumeCfm));
110 /*********************************************************************
111 * Forward Declartion for PJU Porting Functions
112 ********************************************************************/
115 EXTERN S16 PtUiPjuBndReq ARGS((Pst* pst, SpId spId, SuId suId));
117 EXTERN S16 PtUiPjuBndCfm ARGS((Pst* pst, SuId suId, U8 status));
119 EXTERN S16 PtUiPjuDatCfm ARGS((Pst* pst, SuId suId, CmLtePdcpId * pdcpId, PjuDatCfmInfo * datCfm));
121 EXTERN S16 PtUiPjuDatInd ARGS((Pst* pst, SuId suId, CmLtePdcpId * pdcpId, Buffer * mBuf));
123 EXTERN S16 PtUiPjuStaInd ARGS((Pst* pst, SuId suId, CmLtePdcpId * pdcpId, PjuStaIndInfo * staInd, Buffer *mBuf));
125 EXTERN S16 PtUiPjuDatFwdInd ARGS((Pst* pst, SuId suId, CmLtePdcpId * pdcpId, PjuDatFwdIndInfo * datFwdInd));
126 #endif /*--#ifdef PTPJPJU--*/
129 /*********************************************************************
130 * Primitives for CPJ interface
131 ********************************************************************/
132 PRIVATE CONSTANT CpjBndCfm PjUiCpjBndCfmMt[] =
147 PRIVATE CONSTANT CpjCfgCfm PjUiCpjCfgCfmMt[] =
162 PRIVATE CONSTANT CpjReEstCfm PjUiCpjReEstCfmMt[] =
177 PRIVATE CONSTANT CpjSecCfgCfm PjUiCpjSecCfgCfmMt[] =
192 PRIVATE CONSTANT CpjUeIdChgCfm PjUiCpjUeIdChgCfmMt[] =
207 PRIVATE CONSTANT CpjCountCfm PjUiCpjCountCfmMt[] =
222 PRIVATE CONSTANT CpjSduStaCfm PjUiCpjSduStaCfmMt[] =
236 PRIVATE CONSTANT CpjDatResumeCfm PjUiCpjDatResumeCfmMt[] =
250 /** @brief This API is used to receive a Config confirm from PDCP to
253 PRIVATE CONSTANT CpjKdfCfm PjUiCpjKdfCfmMt[] =
269 /****************************************************************************
270 * CPJ Interface Mt functions
271 ***************************************************************************/
\f
274 PUBLIC S16 PjUiCpjBndCfm
281 PUBLIC S16 PjUiCpjBndCfm(pst, suId, status)
290 (*PjUiCpjBndCfmMt[pst->selector])(pst, suId, status);
296 PUBLIC S16 PjUiCpjCfgCfm
300 CpjCfgCfmInfo * cfgCfm
303 PUBLIC S16 PjUiCpjCfgCfm(pst, suId, cfgCfm)
306 CpjCfgCfmInfo * cfgCfm;
312 (*PjUiCpjCfgCfmMt[pst->selector])(pst, suId, cfgCfm);
318 PUBLIC S16 PjUiCpjReEstCfm
322 CpjReEstCfmInfo * reEstCfm
325 PUBLIC S16 PjUiCpjReEstCfm(pst, suId, reEstCfm)
328 CpjReEstCfmInfo * reEstCfm;
332 TRC3(PjUiCpjReEstCfm)
334 (*PjUiCpjReEstCfmMt[pst->selector])(pst, suId, reEstCfm);
340 PUBLIC S16 PjUiCpjSecCfgCfm
344 CpjSecCfgCfmInfo * secCfgCfm
347 PUBLIC S16 PjUiCpjSecCfgCfm(pst, suId, secCfgCfm)
350 CpjSecCfgCfmInfo * secCfgCfm;
354 TRC3(PjUiCpjSecCfgCfm)
356 (*PjUiCpjSecCfgCfmMt[pst->selector])(pst, suId, secCfgCfm);
362 PUBLIC S16 PjUiCpjUeIdChgCfm
371 PUBLIC S16 PjUiCpjUeIdChgCfm(pst, suId, transId, ueInfo, status)
380 TRC3(PjUiCpjUeIdChgCfm)
382 (*PjUiCpjUeIdChgCfmMt[pst->selector])(pst, suId, transId, ueInfo, status);
388 PUBLIC S16 PjUiCpjCountCfm
392 CpjCountCfmInfo * countCfm
395 PUBLIC S16 PjUiCpjCountCfm(pst, suId, countCfm)
398 CpjCountCfmInfo * countCfm;
402 TRC3(PjUiCpjCountCfm)
404 (*PjUiCpjCountCfmMt[pst->selector])(pst, suId, countCfm);
410 PUBLIC S16 PjUiCpjSduStaCfm
414 CpjSduStaCfmInfo * staCfm
417 PUBLIC S16 PjUiCpjSduStaCfm(pst, suId, staCfm)
420 CpjSduStaCfmInfo * staCfm;
424 TRC3(PjUiCpjSduStaCfm)
426 (*PjUiCpjSduStaCfmMt[pst->selector])(pst, suId, staCfm);
432 PUBLIC S16 PjUiCpjDatResumeCfm
436 CpjDatResumeCfmInfo *datResCfm
439 PUBLIC S16 PjUiCpjDatResumeCfm(pst, suId, datResCfm)
442 CpjDatResumeCfmInfo *datResCfm;
446 TRC3(PjUiCpjDataResumeCfm)
448 (*PjUiCpjDatResumeCfmMt[pst->selector])(pst, suId, datResCfm);
453 * @brief This API is used to receive a Bind confirm from PDCP to Application.
457 * Function : PjUiCpjKdfCfm
459 * @param[in] pst - Post structure
460 * @param[in] suId - Service User Id
461 * @param[in] transId - Transaction Id
462 * @param[in] kdfCfmInf - Generated keys
463 * @param[in] status - status of KDF request
468 PUBLIC S16 PjUiCpjKdfCfm
472 CpjCfgTransId transId,
473 CpjKdfCfmInfo *kdfCfmInf,
477 PUBLIC S16 PjUiCpjKdfCfm(pst, suId, transId, status)
480 CpjCfgTransId transId;
481 CpjKdfCfmInfo *kdfCfmInf;
488 (*PjUiCpjKdfCfmMt[pst->selector])(pst, suId, transId,kdfCfmInf, status);
492 #endif /*--ifdef PJ--*/
495 /*************************************************************************
496 * CPJ Porting Functions
497 ************************************************************************/
501 PUBLIC S16 PtUiCpjBndCfm
508 PUBLIC S16 PtUiCpjBndCfm(pst, suId, status)
527 PUBLIC S16 PtUiCpjCfgCfm
531 CpjCfgCfmInfo * cfgCfm
534 PUBLIC S16 PtUiCpjCfgCfm(pst, suId, cfgCfm)
537 CpjCfgCfmInfo * cfgCfm;
553 PUBLIC S16 PtUiCpjReEstCfm
557 CpjReEstCfmInfo * reEstCfm
560 PUBLIC S16 PtUiCpjReEstCfm(pst, suId, reEstCfm)
563 CpjReEstCfmInfo *reEstCfm;
567 TRC3(PtUiCpjReEstCfm)
579 PUBLIC S16 PtUiCpjSecCfgCfm
583 CpjSecCfgCfmInfo * secCfgCfm
586 PUBLIC S16 PtUiCpjSecCfgCfm(pst, suId, secCfgCfm)
589 CpjSecCfgCfmInfo * secCfgCfm;
593 TRC3(PtUiCpjSecCfgCfm)
605 PUBLIC S16 PtUiCpjUeIdChgCfm
614 PUBLIC S16 PtUiCpjUeIdChgCfm(pst, suId, transId, ueInfo, status)
623 TRC3(PtUiCpjUeIdChgCfm)
637 PUBLIC S16 PtUiCpjCountCfm
641 CpjCountCfmInfo * countCfm
644 PUBLIC S16 PtUiCpjCountCfm(pst, suId, countCfm)
647 CpjCountCfmInfo * countCfm;
651 TRC3(PtUiCpjCountCfm)
663 PUBLIC S16 PtUiCpjSduStaCfm
667 CpjSduStaCfmInfo * staCfm
670 PUBLIC S16 PtUiCpjSduStaCfm(pst, suId, staCfm)
673 CpjSduStaCfmInfo * staCfm;
677 TRC3(PtUiCpjSduStaCfm)
688 PUBLIC S16 PtUiCpjDatResumeCfm
692 CpjDatResumeCfmInfo *datResumeCfm
695 PUBLIC S16 PtUiCpjDatResumeCfm(pst, suId, dataResCfm)
698 CpjDataResumeCfmInfo *datResumeCfm;
702 TRC3(PtUiCpjDataResCfm)
706 UNUSED(datResumeCfm);
713 * @brief This is a portable API for KDF function
717 * Function : PtUiCpjKdfCfm
719 * @param[in] pst - Post structure
720 * @param[in] suId - Service User Id
721 * @param[in] transId - Transaction Id
722 * @param[in] kdfCfmInf - Generated keys
723 * @param[in] status - status of KDF request
728 PUBLIC S16 PtUiCpjKdfCfm
732 CpjCfgTransId transId,
733 CpjKdfCfmInfo *kdfCfmInf,
737 PUBLIC S16 PtUiCpjKdfCfm(pst, suId, transId, status)
740 CpjCfgTransId transId;
741 CpjKdfCfmInfo *kdfCfmInf;
756 #endif /*--ifdef PTPJCPJ--*/
759 /*********************************************************************
760 * Primitives for PJU interface
761 ********************************************************************/
763 PRIVATE CONSTANT PjuBndCfm PjUiPjuBndCfmMt[] =
783 PRIVATE CONSTANT PjuDatCfm PjUiPjuDatCfmMt[] =
803 PRIVATE CONSTANT PjuDatInd PjUiPjuDatIndMt[] =
833 PRIVATE CONSTANT PjuStaInd PjUiPjuStaIndMt[] =
853 PRIVATE CONSTANT PjuDatFwdInd PjUiPjuDatFwdIndMt[] =
873 /****************************************************************************
874 * PJU Interface Mt functions
875 ***************************************************************************/
\f
879 PUBLIC S16 PjUiPjuBndCfm
886 PUBLIC S16 PjUiPjuBndCfm(pst, suId, status)
895 (*PjUiPjuBndCfmMt[pst->selector])(pst, suId, status);
903 PUBLIC S16 PjUiPjuDatCfm
907 CmLtePdcpId * pdcpId,
908 PjuDatCfmInfo * datCfm
911 PUBLIC S16 PjUiPjuDatCfm(pst, suId, pdcpId, datCfm)
914 CmLtePdcpId * pdcpId;
915 PjuDatCfmInfo * datCfm;
921 (*PjUiPjuDatCfmMt[pst->selector])(pst, suId, pdcpId, datCfm);
929 PUBLIC S16 PjUiPjuDatInd
933 CmLtePdcpId * pdcpId,
937 PUBLIC S16 PjUiPjuDatInd(pst, suId, pdcpId, mBuf)
940 CmLtePdcpId * pdcpId;
947 (*PjUiPjuDatIndMt[pst->selector])(pst, suId, pdcpId, mBuf);
955 PUBLIC S16 PjUiPjuStaInd
959 CmLtePdcpId * pdcpId,
960 PjuStaIndInfo * staInd,
964 PUBLIC S16 PjUiPjuStaInd(pst, suId, pdcpId, staInd, mBuf)
967 CmLtePdcpId * pdcpId;
968 PjuStaIndInfo * staInd;
975 (*PjUiPjuStaIndMt[pst->selector])(pst, suId, pdcpId, staInd, mBuf);
983 PUBLIC S16 PjUiPjuDatFwdInd
987 CmLtePdcpId * pdcpId,
988 PjuDatFwdIndInfo * datFwdInd
991 PUBLIC S16 PjUiPjuDatFwdInd(pst, suId, pdcpId, datFwdInd)
994 CmLtePdcpId * pdcpId;
995 PjuDatFwdIndInfo * datFwdInd;
999 TRC3(PjUiPjuDatFwdInd)
1001 (*PjUiPjuDatFwdIndMt[pst->selector])(pst, suId, pdcpId, datFwdInd);
1006 #endif /*--ifdef PJ--*/
1009 /*************************************************************************
1010 * PJU Porting Functions
1011 ************************************************************************/
1015 PUBLIC S16 PtUiPjuBndReq
1022 PUBLIC S16 PtUiPjuBndReq(pst, spId, suId)
1041 PUBLIC S16 PtUiPjuBndCfm
1048 PUBLIC S16 PtUiPjuBndCfm(pst, suId, status)
1067 PUBLIC S16 PtUiPjuDatCfm
1071 CmLtePdcpId * pdcpId,
1072 PjuDatCfmInfo * datCfm
1075 PUBLIC S16 PtUiPjuDatCfm(pst, suId, pdcpId, datCfm)
1078 CmLtePdcpId * pdcpId;
1079 PjuDatCfmInfo * datCfm;
1096 PUBLIC S16 PtUiPjuDatInd
1100 CmLtePdcpId * pdcpId,
1104 PUBLIC S16 PtUiPjuDatInd(pst, suId, pdcpId, mBuf)
1107 CmLtePdcpId * pdcpId;
1125 PUBLIC S16 PtUiPjuStaInd
1129 CmLtePdcpId * pdcpId,
1130 PjuStaIndInfo * staInd,
1134 PUBLIC S16 PtUiPjuStaInd(pst, suId, pdcpId, staInd, mBuf)
1137 CmLtePdcpId * pdcpId;
1138 PjuStaIndInfo * staInd;
1156 PUBLIC S16 PtUiPjuDatFwdInd
1160 CmLtePdcpId * pdcpId,
1161 PjuDatFwdIndInfo * datFwdInd
1164 PUBLIC S16 PtUiPjuDatFwdInd(pst, suId, pdcpId, datFwdInd)
1167 CmLtePdcpId * pdcpId;
1168 PjuDatFwdIndInfo * datFwdInd;
1172 TRC3(PtUiPjuDatFwdInd)
1182 #endif /*--ifdef PTPJPJU--*/
1186 #endif /* __cplusplus */
1187 /********************************************************************30**
1189 **********************************************************************/