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-RLC Layer - Upper Interface
25 Desc: C source code for the upper interface of LTE-RLC
29 *********************************************************************21*/
30 static const char* RLOG_MODULE_NAME="UIM";
31 static int RLOG_MODULE_ID=2048;
32 static int RLOG_FILE_ID=199;
35 @brief RLC Upper Interface
39 /* header (.h) include files */
40 #include "envopt.h" /* environment options */
41 #include "envdep.h" /* environment dependent */
42 #include "envind.h" /* environment independent */
44 #include "gen.h" /* general */
45 #include "ssi.h" /* system services */
46 #include "cm5.h" /* common timer defines */
47 #include "cm_tkns.h" /* common tokens defines */
48 #include "cm_mblk.h" /* common memory allocation library defines */
49 #include "cm_llist.h" /* common link list defines */
50 #include "cm_hash.h" /* common hash list defines */
51 #include "cm_lte.h" /* common LTE defines */
52 #include "lkw.h" /* LKW defines */
53 #include "ckw.h" /* CKW defines */
54 #include "kwu.h" /* KWU defines */
55 #include "rgu.h" /* RGU defines */
58 #include "kw_env.h" /* RLC environment options */
59 #include "kw.h" /* RLC defines */
61 /* extern (.x) include files */
62 #include "gen.x" /* general */
63 #include "ssi.x" /* system services */
65 #include "cm5.x" /* common timer library */
66 #include "cm_tkns.x" /* common tokens */
67 #include "cm_mblk.x" /* common memory allocation */
68 #include "cm_llist.x" /* common link list */
69 #include "cm_hash.x" /* common hash list */
70 #include "cm_lte.x" /* common LTE includes */
71 #include "cm_lib.x" /* common memory allocation library */
72 #include "lkw.x" /* LKW */
73 #include "ckw.x" /* CKW */
74 #include "kwu.x" /* KWU */
75 #include "rgu.x" /* RGU */
76 #if defined(MAC_RLC_UL_RBUF) || (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)) || defined(SS_RBUF)
81 #if defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)
82 #include "mt_plat_t33.h"
83 #include "mt_plat_t33.x"
107 #endif /* __cplusplus */
110 /*********************************************************************
111 * Forward Declartion for KWU Porting Functions
112 ********************************************************************/
113 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
114 PUBLIC S16 kwDlBatchProc ARGS ((Void));
115 PUBLIC S16 kwUtlDlFreeRlcRBuf ARGS((Void));
116 EXTERN void kwUtlDlBatchProcHqStaInd ARGS ((Void));
117 EXTERN Void kwUtlFreeDlMem ARGS((Void));
118 EXTERN SsRngBufCnt rngCb;
119 EXTERN S16 kwUtlDlBatchProcPkts ARGS((Void));
122 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
123 PUBLIC S16 kwDlBatchProcSplit ARGS((Void));
127 PRIVATE S16 PtUiKwuBndCfm ARGS ((
128 Pst *pst, /* post structure */
129 SuId suId, /* Service User Id */
130 U8 status /* status */
135 PUBLIC S16 PtUiKwuDatCfm ARGS ((
138 KwuDatCfmInfo *datCfm
141 PUBLIC S16 PtUiKwuStaInd ARGS ((
144 KwuStaIndInfo *staInd
147 PUBLIC S16 PtUiKwuReEstCmpInd ARGS ((
152 /* kw005.201 added support for L2 Measurement */
153 PUBLIC S16 PtUiKwuDiscSduCfm ARGS((
156 KwuDiscSduInfo *discCfm
158 PUBLIC S16 PtUiKwuFlowCntrlInd ARGS((
161 KwuFlowCntrlIndInfo *flowCntrlIndInfo
164 PUBLIC S16 PtUiKwuDatAckInd ARGS((
167 KwuDatAckInfo *datAckInd
170 #if (defined(PTKWKWU) || defined(KW_PDCP))
171 PUBLIC S16 PtUiKwuDatInd ARGS ((
174 KwuDatIndInfo *datInd,
177 #endif /* PTKWKWU || KW_PDCP */
181 /*********************************************************************
182 * Forward Declartion for CKW Porting Functions
183 ********************************************************************/
185 PRIVATE S16 PtUiCkwBndCfm ARGS ((
186 Pst *pst, /* post structure */
187 SuId suId, /* Service User Id */
188 U8 status /* status */
191 PUBLIC S16 PtUiCkwCfgCfm ARGS ((
192 Pst *pst, /* post structure */
193 SuId suId, /* Service User Id */
194 CkwCfgCfmInfo *cfmInfo /* Configuration Confirm */
197 PUBLIC S16 PtUiCkwUeIdChgCfm ARGS((
198 Pst *pst, /* post structure */
199 SuId suId, /* Service User Id */
209 /*********************************************************************
210 * Primitives for KWU interface
211 ********************************************************************/
213 /* KWU Bind Confirm primitive */
215 PUBLIC KwuBndCfm kwUiKwuBndCfmMt[] =
218 cmPkKwuBndCfm, /* 0 - loosely coupled */
220 PtUiKwuBndCfm, /* 0 - loosely coupled, portable */
221 #endif /* LCKWUIKWU */
223 NhLiKwuBndCfm, /* 1 - tightly coupled, RRC */
225 PtUiKwuBndCfm, /* 1 - tightly coupled, portable */
229 PjLiKwuBndCfm, /* 2 - tightly coupled, PDCP */
231 PtUiKwuBndCfm, /* 2 - tightly coupled, portable */
236 cmPkKwuBndCfm, /* 3 - light weight loosely coupled */
238 PtUiKwuBndCfm, /* 3 - light weight loosely coupled, portable */
239 #endif /* LCKWUIKWU */
243 /* KWU Data Indication primitive */
245 PUBLIC KwuDatInd kwUiKwuDatIndMt[] =
248 cmPkKwuDatInd, /* 0 - loosely coupled */
250 PtUiKwuDatInd, /* 0 - loosely coupled, portable */
251 #endif /* LCKWUIKWU */
253 NhLiKwuDatInd, /* 1 - tightly coupled, RRC */
255 PtUiKwuDatInd, /* 1 - tightly coupled, portable */
260 PjLiKwuDatInd, /* 2 - tightly coupled, PDCP */
262 PtUiKwuDatInd, /* 2 - tightly coupled, portable */
266 cmPkKwuDatInd, /* 3 - light weight loosely coupled */
268 PtUiKwuDatInd, /* 3 - light weight loosely coupled, portable */
269 #endif /* LCKWUIKWU */
275 PUBLIC KwuDatCfm kwUiKwuDatCfmMt[] =
278 cmPkKwuDatCfm, /* 0 - loosely coupled */
280 PtUiKwuDatCfm, /* 0 - loosely coupled, portable */
281 #endif /* LCKWUIKWU */
282 PtUiKwuDatCfm, /* 1 - tightly coupled, portable */
284 PjLiKwuDatCfm, /* 2 - tightly coupled, PDCP */
286 PtUiKwuDatCfm, /* 2 - tightly coupled, portable */
290 cmPkKwuDatCfm, /* 3 - light weight loosely coupled */
292 PtUiKwuDatCfm, /* 3 - light weight loosely coupled, portable */
293 #endif /* LCKWUIKWU */
297 /* KWU AM Status Indication primitive */
299 PUBLIC KwuStaInd kwUiKwuStaIndMt[] =
302 cmPkKwuStaInd, /* 0 - loosely coupled */
304 PtUiKwuStaInd, /* 0 - loosely coupled, portable */
305 #endif /* LCKWUIKWU */
306 PtUiKwuStaInd, /* 2 - tightly coupled, portable */
308 PjLiKwuStaInd, /* 2 - tightly coupled, PDCP */
310 PtUiKwuStaInd, /* 2 - tightly coupled, portable */
314 cmPkKwuStaInd, /* 3 - light weight loosely coupled */
316 PtUiKwuStaInd, /* 3 - light weight loosely coupled, portable */
317 #endif /* LCKWUIKWU */
321 PUBLIC KwuReEstCmpInd kwUiKwuReEstCmpIndMt[] =
324 cmPkKwuReEstCmpInd, /* 0 - loosely coupled */
326 PtUiKwuReEstCmpInd, /* 0 - loosely coupled, portable */
327 #endif /* LCKWUIKWU */
328 PtUiKwuReEstCmpInd, /* 1 - loosely coupled, portable */
330 PjLiKwuReEstCmpInd, /* 2 - tightly coupled, PDCP */
332 PtUiKwuReEstCmpInd, /* 2 - tightly coupled, portable */
336 cmPkKwuReEstCmpInd, /* 3 - light weight loosely coupled */
338 PtUiKwuReEstCmpInd, /* 3 - light weight loosely coupled, portable */
339 #endif /* LCKWUIKWU */
343 /* kw005.201 added support for L2 measurement */
344 PUBLIC KwuDiscSduCfm kwUiKwuDiscSduCfmMt[] =
347 cmPkKwuDiscSduCfm, /* 0 - loosely coupled */
349 PtUiKwuDiscSduCfm, /* 0 - loosely coupled, portable */
350 #endif /* LCKWUIKWU */
351 PtUiKwuDiscSduCfm, /* 1 - loosely coupled portable */
353 PjLiKwuDiscSduCfm, /* 2 - tightly coupled, PDCP */
355 PtUiKwuDiscSduCfm, /* 2 - tightly coupled, PDCP */
359 cmPkKwuDiscSduCfm, /* 3 - light weight loosely coupled */
361 PtUiKwuDiscSduCfm, /* 3 - light weight loosely coupled, portable */
365 PUBLIC KwuFlowCntrlInd kwUiKwuFlowCntrlIndMt[] =
368 cmPkKwuFlowCntrlInd, /* 0 - loosely coupled */
370 PtUiKwuFlowCntrlInd, /* 0 - loosely coupled, portable */
371 #endif /* LCKWUIKWU */
372 PtUiKwuFlowCntrlInd, /* 1 - loosely coupled portable */
374 PjLiKwuFlowCntrlInd, /* 2 - tightly coupled, PDCP */
376 PtUiKwuFlowCntrlInd, /* 2 - tightly coupled, portable */
379 cmPkKwuFlowCntrlInd, /* 3 - light weight loosely coupled */
381 PtUiKwuFlowCntrlInd, /* 3 - light weight loosely coupled, portable */
382 #endif /* LCKWUIKWU */
385 PUBLIC KwuDatAckInd kwUiKwuDatAckIndMt[] =
388 cmPkKwuDatAckInd, /* 0 - loosely coupled */
390 PtUiKwuDatAckInd, /* 0 - loosely coupled, portable */
391 #endif /* LCKWUIKWU */
392 PtUiKwuDatAckInd, /* 1 - loosely coupled, portable */
394 PjLiKwuDatAckInd, /* 2 - tightly coupled, PDCP */
396 PtUiKwuDatAckInd, /* 1 - tightly coupled, portable */
400 cmPkKwuDatAckInd, /* 3 - light weight loosely coupled, portable */
402 PtUiKwuDatAckInd, /* 3 - light weight loosely coupled */
406 #endif /* LTE_L2_MEAS */
407 /* KWU AM Data confirm primitive */
412 /****************************************************************************
413 * KWU Interface Mt functions
414 ***************************************************************************/
\f
419 * Handler for confirming the bind request received from KWU
424 * This function send the bind confirm primitive to the RLC user,
425 * when it receives a bind request from its service user.
427 * @param[in] pst Post structure
428 * @param[in] suId Service user SAP ID
429 * @param[in] status Status of Confirmation
436 PUBLIC S16 KwUiKwuBndCfm
438 Pst *pst, /* post structure */
439 SuId suId, /* Service User Id */
440 U8 status /* Status */
443 PUBLIC S16 KwUiKwuBndCfm(pst, suId, status)
444 Pst *pst; /* post structure */
445 SuId suId; /* Service User Id */
446 U8 status; /* Status */
451 /* jump to specific primitive depending on configured selector */
452 (*kwUiKwuBndCfmMt[pst->selector])(pst, suId, status);
456 } /* end of KwUiKwuBndCfm */
463 * Handler for sending the data(SDU) from upper layer.
467 * This function is used to transfer a SDU received from the peer
468 * RLC entity to the service user(RRC/PDCP).
470 * @param[in] pst Post structure
471 * @param[in] suId Service User SAP ID
472 * @param[in] datIndInfo Data Request Information
473 * @param[in] mBuf Data Buffer (SDU)
480 PUBLIC S16 KwUiKwuDatInd
484 KwuDatIndInfo *datInd,
488 PUBLIC S16 KwUiKwuDatInd(pst, suId, datInd, mBuf)
491 KwuDatIndInfo *datInd;
497 /* jump to specific primitive depending on configured selector */
498 (*kwUiKwuDatIndMt[pst->selector])(pst, suId, datInd, mBuf);
502 } /* end of KwUiKwuDatInd */
504 PUBLIC int rlcDatCfmsSent = 0;
511 * Handler for sending the data confirmation to upper layer.
515 * This function is used to send a confirmation to the service
516 * user about the data received by the peer RLC entity.
518 * @param[in] pst Post structure
519 * @param[in] suId Service User SAP ID
520 * @param[in] datCfmInfo Data Confirmation Information
527 PUBLIC S16 KwUiKwuDatCfm
531 KwuDatCfmInfo *datCfm
534 PUBLIC S16 KwUiKwuDatCfm(pst, suId, datCfm)
537 KwuDatCfmInfo *datCfm;
543 /* jump to specific primitive depending on configured selector */
544 (*kwUiKwuDatCfmMt[pst->selector])(pst, suId, datCfm);
548 } /* end of KwUiKwuDatCfm */
555 * Handler for sending the Status Indication to the upper layer.
559 * This function is used only by RLC AM entity.It send status
560 * indication to the upper layer about the maximum number of
561 * re-transmissions reached for a RLC AM entity.
563 * @param[in] pst Post structure
564 * @param[in] suId Service User SAP ID
565 * @param[in] staInd RLC Entity Id
572 PUBLIC S16 KwUiKwuStaInd
576 KwuStaIndInfo *staInd
579 PUBLIC S16 KwUiKwuStaInd(pst, suId, staInd)
582 KwuStaIndInfo *staInd;
587 /* jump to specific primitive depending on configured selector */
588 (*kwUiKwuStaIndMt[pst->selector])(pst, suId, staInd);
592 } /* end of KwUiKwuStaInd */
599 * Handler for sending the Status Indication to the upper layer.
603 * This function is used only by RLC AM entity.It send status
604 * indication to the upper layer about the maximum number of
605 * re-transmissions reached for a RLC AM entity.
607 * @param[in] pst Post structure
608 * @param[in] suId Service User SAP ID
609 * @param[in] staInd RLC Entity Id
616 PUBLIC S16 KwUiKwuReEstCmpInd
623 PUBLIC S16 KwUiKwuReEstCmpInd(pst, suId, rlcId)
629 TRC3(KwUiKwuReEstCmpInd)
630 RLOG0(L_DEBUG, "In KwUiKwuReEstCmpInd");
632 /* jump to specific primitive depending on configured selector */
633 (*kwUiKwuReEstCmpIndMt[pst->selector])(pst, suId, rlcId);
637 } /* end of KwUiKwuReEstCmpInd */
638 /* kw005.201 added support for L2 Measurement */
644 * Handler for sending the Sdu Disc Cfm to the upper layer.
648 * This function confirms the discard of an SDU .
650 * @param[in] pst Post structure
651 * @param[in] suId Service User SAP ID
652 * @param[in] discCfm Disc information.
659 PUBLIC S16 KwUiKwuDiscSduCfm
663 KwuDiscSduInfo *discCfm
666 PUBLIC S16 KwUiKwuDiscSduCfm(pst, suId, discCfm)
669 KwuDiscSduInfo *discCfm;
672 TRC3(KwUiKwuDiscSduCfm)
674 /* jump to specific primitive depending on configured selector */
675 (*kwUiKwuDiscSduCfmMt[pst->selector])(pst, suId, discCfm);
679 } /* end of KwUiKwuDiscSduCfm */
685 * Handler for sending Flow indication to the upper layer.
689 * This function indicates to PDCP if packets need to be stopped or
690 * started for a particular RB
692 * @param[in] pst Post structure
693 * @param[in] suId Service User SAP ID
694 * @param[in] flowCntrlIndInfo Flow control information.
701 PUBLIC S16 KwUiKwuFlowCntrlInd
705 KwuFlowCntrlIndInfo *flowCntrlIndInfo
708 PUBLIC S16 KwUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
711 KwuFlowCntrlIndInfo *flowCntrlIndInfo;
714 TRC3(KwUiKwuFlowCntrlInd)
716 /* jump to specific primitive depending on configured selector */
717 (*kwUiKwuFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlIndInfo);
721 } /* end of KwUiKwuFlowCntrlInd */
728 * Handler for sending the Data ack indication to the upper layer.
732 * This function confirms the succesfull transmission of SDU
734 * @param[in] pst Post structure
735 * @param[in] suId Service User SAP ID
736 * @param[in] datAckInd DatAckInd
743 PUBLIC S16 KwUiKwuDatAckInd
747 KwuDatAckInfo *datAckInd
750 PUBLIC S16 KwUiKwuDatAckInd(pst, suId, datAckInd)
753 KwuDatAckInfo *datAckInd;
756 TRC3(KwUiKwuDatAckInd)
758 /* jump to specific primitive depending on configured selector */
759 (*kwUiKwuDatAckIndMt[pst->selector])(pst, suId, datAckInd);
763 } /* end of KwUiKwuDatAckInd */
764 #endif /* LTE_L2_MEAS */
769 /*************************************************************************
770 * KWU Porting Functions
771 ************************************************************************/
776 * PtUiKwuBndCfm - Portable SAP bind confirm
778 * @param[in] pst - Post structure
779 * @param[in] suId - Service user SAP ID
780 * @param[in] status - Status
786 PRIVATE S16 PtUiKwuBndCfm
788 Pst *pst, /* post structure */
789 SuId suId, /* Service User Id */
790 U8 status /* status */
793 PRIVATE S16 PtUiKwuBndCfm(pst, suId, status)
794 Pst *pst; /* post structure */
795 SuId suId; /* Service User Id */
796 U8 status; /* status */
799 #if (ERRCLASS & ERRCLS_DEBUG)
806 #if (ERRCLASS & ERRCLS_DEBUG)
807 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
812 tKwCb = KW_GET_KWCB(pst->srcInst);
813 RLOG0(L_ERROR, "Improper selector value");
814 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
817 } /* end of PtUiKwuBndCfm */
825 * PtUiKwuDatCfm - Portable common channel data request
827 * @param[in] pst - Post structure
828 * @param[in] suId - Service user SAP ID
829 * @param[in] datCfm - Data Request
835 PUBLIC S16 PtUiKwuDatCfm
839 KwuDatCfmInfo *datCfm
842 PUBLIC S16 PtUiKwuDatCfm(pst, suId, datCfm)
845 KwuDatCfmInfo *datCfm;
848 #if (ERRCLASS & ERRCLS_DEBUG)
856 #if (ERRCLASS & ERRCLS_DEBUG)
857 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
861 tKwCb = KW_GET_KWCB(pst->srcInst);
863 RLOG0(L_ERROR, "Improper selector value");
864 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
868 } /* end of PtUiKwuDatCfm */
875 * PtUiKwuStaInd - Portable common channel data request
877 * @param[in] pst - Post structure
878 * @param[in] suId - Service user SAP ID
879 * @param[in] staInd - Data Request
885 PUBLIC S16 PtUiKwuStaInd
889 KwuStaIndInfo *staInd
892 PUBLIC S16 PtUiKwuStaInd(pst, suId, staInd)
895 KwuStaIndInfo *staInd;
898 #if (ERRCLASS & ERRCLS_DEBUG)
907 #if (ERRCLASS & ERRCLS_DEBUG)
908 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
912 tKwCb = KW_GET_KWCB(pst->srcInst);
913 RLOG0(L_ERROR, "Improper selector value");
914 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
918 } /* end of PtUiKwuStaInd */
925 * PtUiKwuReEstCmpInd - Portable common channel data request
927 * @param[in] pst - Post structure
928 * @param[in] suId - Service user SAP ID
929 * @param[in] staInd - Data Request
935 PUBLIC S16 PtUiKwuReEstCmpInd
942 PUBLIC S16 PtUiKwuReEstCmpInd(pst, suId, rlcId)
948 #if (ERRCLASS & ERRCLS_DEBUG)
951 TRC3(PtUiKwuReEstCmpInd)
957 #if (ERRCLASS & ERRCLS_DEBUG)
958 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
962 tKwCb = KW_GET_KWCB(pst->srcInst);
963 RLOG0(L_ERROR, "Improper selector value");
964 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
968 } /* end of PtUiKwuReEstCmpInd */
970 /* kw005.201 added support for L2 Measurement */
974 * PtUiKwuDiscSduCfm - Portable common channel data request
976 * @param[in] pst - Post structure
977 * @param[in] suId - Service user SAP ID
978 * @param[in] staInd - Data Request
984 PUBLIC S16 PtUiKwuDiscSduCfm
988 KwuDiscSduInfo *discCfm
991 PUBLIC S16 PtUiKwuDiscSduCfm(pst, suId, discCfm)
994 KwuDiscSduInfo *discCfm;
997 #if (ERRCLASS & ERRCLS_DEBUG)
1000 TRC3(PtUiKwuDiscSduCfm)
1006 #if (ERRCLASS & ERRCLS_DEBUG)
1007 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1011 tKwCb = KW_GET_KWCB(pst->srcInst);
1012 RLOG0(L_ERROR, "Improper selector value");
1013 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1017 } /* end of PtUiKwuDiscSduCfm */
1022 * PtUiKwuFlowCntrlInd - Portable Flow control idication
1024 * @param[in] pst - Post structure
1025 * @param[in] suId - Service user SAP ID
1026 * @param[in] flowCntrlInd - Flow control information
1032 PUBLIC S16 PtUiKwuFlowCntrlInd
1036 KwuFlowCntrlIndInfo *flowCntrlIndInfo
1039 PUBLIC S16 PtUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
1042 KwuFlowCntrlIndInfo *flowCntrlIndInfo;
1045 #if (ERRCLASS & ERRCLS_DEBUG)
1048 TRC3(PtUiKwuFlowCntrlInd)
1052 UNUSED(flowCntrlIndInfo);
1054 #if (ERRCLASS & ERRCLS_DEBUG)
1055 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1059 tKwCb = KW_GET_KWCB(pst->srcInst);
1060 RLOG0(L_ERROR, "Improper selector value");
1061 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1065 } /* end of PtUiKwuFlowCntrlInd */
1072 * Handler for sending the Data ack indication to the upper layer.
1076 * This function confirms the succesfull transmission of SDU
1078 * @param[in] pst Post structure
1079 * @param[in] suId Service User SAP ID
1080 * @param[in] datAckInd DatAckInd
1087 PUBLIC S16 PtUiKwuDatAckInd
1091 KwuDatAckInfo *datAckInd
1094 PUBLIC S16 PtUiKwuDatAckInd(pst, suId, datAckInd)
1097 KwuDatAckInfo *datAckInd;
1100 #if (ERRCLASS & ERRCLS_DEBUG)
1103 TRC3(PtUiKwuDatAckInd)
1108 #if (ERRCLASS & ERRCLS_DEBUG)
1109 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1113 tKwCb = KW_GET_KWCB(pst->srcInst);
1115 RLOG0(L_ERROR, "Improper selector value");
1116 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1118 }/* end of PtUiKwuDatAckInd */
1119 #endif /* LTE_L2_MEAS */
1120 #if (defined(PTKWKWU) || defined(KW_PDCP))
1126 * PtUiKwuDatInd - Portable common channel data request
1128 * @param[in] pst - Post structure
1129 * @param[in] suId - Service user SAP ID
1130 * @param[in] datInd - Data Request
1136 PUBLIC S16 PtUiKwuDatInd
1140 KwuDatIndInfo *datInd,
1144 PUBLIC S16 PtUiKwuDatInd(pst, suId, datInd, mBuf)
1147 KwuDatIndInfo *datInd;
1151 #if (ERRCLASS & ERRCLS_DEBUG)
1161 #if (ERRCLASS & ERRCLS_DEBUG)
1162 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1166 tKwCb = KW_GET_KWCB(pst->srcInst);
1167 RLOG0(L_ERROR, "Improper selector value");
1168 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1172 } /* end of PtUiKwuDatInd */
1173 #endif /* PTKWKWU || KW_PDCP */
1177 /*********************************************************************
1178 * Primitives for CKW interface
1179 ********************************************************************/
1181 /* CKW Bind Confirm primitive */
1183 PUBLIC CkwBndCfm kwUiCkwBndCfmMt[] =
1186 cmPkCkwBndCfm, /* 0 - loosely coupled */
1188 PtUiCkwBndCfm, /* 0 - loosely coupled, portable */
1189 #endif /* LCCKUICKW */
1191 NhLiCkwBndCfm, /* 1 - tightly coupled, RRC */
1193 PtUiCkwBndCfm, /* 1 - tightly coupled, portable */
1197 /* CKW Configuration confirm primitive */
1199 PUBLIC CkwCfgCfm kwUiCkwCfgCfmMt[] =
1202 cmPkCkwCfgCfm, /* 0 - loosely coupled */
1204 PtUiCkwCfgCfm, /* 0 - loosely coupled, portable */
1205 #endif /* LCKWUICKW */
1207 NhLiCkwCfgCfm, /* 1 - tightly coupled, RRC */
1209 PtUiCkwCfgCfm, /* 1 - tightly coupled, portable */
1213 PUBLIC CkwUeIdChgCfm kwUiCkwUeIdChgCfmMt[] =
1216 cmPkCkwUeIdChgCfm, /* 0 - loosely coupled */
1218 PtUiCkwUeIdChgCfm, /* 0 - loosely coupled, portable */
1219 #endif /* LCKWUICKW */
1221 NhLiCkwUeIdChgCfm, /* 1 - tightly coupled, RRC */
1223 PtUiCkwUeIdChgCfm, /* 1 - tightly coupled, portable */
1229 /****************************************************************************
1230 * CKW Interface Mt functions
1231 ***************************************************************************/
1236 * Handler for confirming the bind request received from CKW
1241 * This function send the bind confirm primitive to the RLC user,
1242 * when it receives a bind request from its service user.
1244 * @param[in] pst - Post structure
1245 * @param[in] suId - Service user SAP ID
1246 * @param[in] status - Status
1252 PUBLIC S16 KwUiCkwBndCfm
1254 Pst *pst, /* post structure */
1255 SuId suId, /* Service User Id */
1256 U8 status /* Status */
1259 PUBLIC S16 KwUiCkwBndCfm(pst, suId, status)
1260 Pst *pst; /* post structure */
1261 SuId suId; /* Service User Id */
1262 U8 status; /* Status */
1267 /* jump to specific primitive depending on configured selector */
1268 (*kwUiCkwBndCfmMt[pst->selector])(pst, suId, status);
1272 } /* end of KwUiCkwBndCfm */
1279 * Handler for sending a configuration confirm to RRC.
1283 * This function is used by RLC user to send a configuration
1284 * confirmation to RRC after configuring(add/delete/modify)
1287 * @param[in] pst Post structure
1288 * @param[in] transId Transaction Id
1289 * @param[in] cfmInfo Config Confirmation Info
1296 PUBLIC S16 KwUiCkwCfgCfm
1298 Pst *pst, /* post structure */
1299 SuId suId, /* Service User Id */
1300 CkwCfgCfmInfo *cfmInfo /* Configuration Confirm */
1303 PUBLIC S16 KwUiCkwCfgCfm(pst, suId, cfmInfo)
1304 Pst *pst; /* post structure */
1305 SuId suId; /* Service User Id */
1306 CkwCfgCfmInfo *cfmInfo; /* Configuration Confirm */
1311 /* jump to specific primitive depending on configured selector */
1312 (*kwUiCkwCfgCfmMt[pst->selector])(pst, suId, cfmInfo);
1316 } /* end of KwUiCkwCfgCfm */
1323 * Handler for sending a configuration for UE ID change.
1327 * This function is used by RLC to send a configuration
1328 * confirm for UE ID change.
1330 * @param[in] pst Post structure
1331 * @param[in] suId Service User Id
1332 * @param[in] transId Transaction Id
1333 * @param[in] cfmInfo Config Confirmation Info
1340 PUBLIC S16 KwUiCkwUeIdChgCfm
1342 Pst *pst, /* post structure */
1343 SuId suId, /* Service User Id */
1349 PUBLIC S16 KwUiCkwUeIdChgCfm(pst, suId, transId,ueInfo,status)
1350 Pst *pst; /* post structure */
1351 SuId suId; /* Service User Id */
1357 TRC3(KwUiCkwUeIdChgCfm)
1359 /* jump to specific primitive depending on configured selector */
1360 (*kwUiCkwUeIdChgCfmMt[pst->selector])(pst, suId, transId, ueInfo, status);
1364 } /* end of KwUiCkwCfgCfm */
1368 /*************************************************************************
1369 * CKW Porting Functions
1370 ************************************************************************/
1375 * KwUiCkwBndCfm - CKW SAP bind confirm
1377 * @param[in] pst - Post structure
1378 * @param[in] suId - Service user SAP ID
1379 * @param[in] status - Status
1385 PRIVATE S16 PtUiCkwBndCfm
1387 Pst *pst, /* post structure */
1388 SuId suId, /* Service User Id */
1389 U8 status /* status */
1392 PRIVATE S16 PtUiCkwBndCfm(pst, suId, status)
1393 Pst *pst; /* post structure */
1394 SuId suId; /* Service User Id */
1395 U8 status; /* status */
1398 #if (ERRCLASS & ERRCLS_DEBUG)
1401 TRC3(PtUiCkwBndCfm);
1407 #if (ERRCLASS & ERRCLS_DEBUG)
1408 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1412 tKwCb = KW_GET_KWCB(pst->srcInst);
1413 RLOG0(L_ERROR, "Improper selector value");
1414 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1417 } /* end of PtUiCkwBndCfm */
1424 * PtUiCkwCfgCfm - KWU SAP bind confirm
1426 * @param[in] pst - Post structure
1427 * @param[in] suId - Service user SAP ID
1428 * @param[in] cfmInfo - Configuration confirm
1434 PUBLIC S16 PtUiCkwCfgCfm
1436 Pst *pst, /* post structure */
1437 SuId suId, /* Service User Id */
1438 CkwCfgCfmInfo *cfmInfo /* Configuration Confirm */
1441 PUBLIC S16 PtUiCkwCfgCfm(pst, suId, cfmInfo)
1442 Pst *pst; /* post structure */
1443 SuId suId; /* Service User Id */
1444 CkwCfgCfmInfo *cfmInfo; /* Configuration Confirm */
1447 #if (ERRCLASS & ERRCLS_DEBUG)
1450 TRC3(PtUiCkwCfgCfm);
1456 #if (ERRCLASS & ERRCLS_DEBUG)
1457 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1461 tKwCb = KW_GET_KWCB(pst->srcInst);
1462 RLOG0(L_ERROR, "Improper selector value");
1463 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1467 } /* end of PtUiCkwCfgCfm */
1470 PUBLIC S16 PtUiCkwUeIdChgCfm
1472 Pst *pst, /* post structure */
1473 SuId suId, /* Service User Id */
1479 PUBLIC S16 PtUiCkwUeIdChgCfm(pst, suId,transId,ueInfo,status)
1480 Pst *pst; /* post structure */
1481 SuId suId; /* Service User Id */
1487 #if (ERRCLASS & ERRCLS_DEBUG)
1490 TRC3(PtUiCkwUeIdChgCfm);
1498 #if (ERRCLASS & ERRCLS_DEBUG)
1499 if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1503 tKwCb = KW_GET_KWCB(pst->srcInst);
1504 RLOG0(L_ERROR, "Improper selector value");
1505 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1509 } /* end of PtUiCkwUeIdChgCfm */
1510 #endif /* PTKWCKW */
1512 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
1517 * kwDlBatchProcSplit- process rbug messages
1523 PUBLIC S16 kwDlBatchProcSplit
1528 PUBLIC S16 kwDlBatchProcSplit()
1533 /* Read from Ring Buffer and process PDCP packets */
1534 Void *elmIndx = NULLP;
1535 RxmBufReq *datReq = NULLP;
1539 U8 rngBufDeqIndx = 0;
1540 U32 rngBufDeqMaxCnt;
1543 rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
1544 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1545 rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_RX_TO_DLRLC);
1546 if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1548 if ( rngBufCurrCnt > (6 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1550 /* Restablishment scenario */
1551 rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1555 rngBufDeqMaxCnt = (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT)/2;
1559 elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC);
1560 while(NULLP != elmIndx)
1562 datReq = (RxmBufReq *)elmIndx;
1563 if(datReq->mBuf != NULLP)
1565 cmUnpkKwuDatReq(KwUiKwuDatReq, &datReq->pst, datReq->mBuf);
1569 RLOG0(L_ERROR, "mBuf is NULL");
1571 cmUnpkKwuDatReq(KwUiKwuDatReq, &datReq->pst, datReq->mBuf);
1574 SsRngInfoTbl[SS_RNG_BUF_RX_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
1575 datReq->mBuf = NULLP;
1576 SRngIncrRIndx(SS_RNG_BUF_RX_TO_DLRLC);
1578 if(rngBufDeqIndx >= rngBufDeqMaxCnt)
1591 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC)) == NULLP)
1601 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
1603 PUBLIC S16 kwDlBatchProc
1608 PUBLIC S16 kwDlBatchProc()
1612 /* Read from Ring Buffer and process PDCP packets */
1614 U8 rngBufDeqIndx = 0;
1615 U32 rngBufDeqMaxCnt;
1616 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1619 /* Memory regions different for BRCM and Intel */
1620 /*dstProcId,srcProcId,dstEnt,dstInst,srcEnt,srcInst,prior,route,event,region,pool,selector*/
1622 PRIVATE Pst rlcDlRbfuPst ={1,1,ENTKW,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,1,1,0,0};
1624 PRIVATE Pst rlcDlRbfuPst ={1,1,ENTKW,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,2,1,0,0};
1626 Void *elmIndx = NULLP;
1627 KwuDatReqDetl *kwuDatReqDetl = NULLP;
1628 KwuDatReqInfo datReq;
1630 rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
1631 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1632 rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1633 if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1635 if ( rngBufCurrCnt > (5 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1637 /* Restablishment scenario */
1638 rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1642 rngBufDeqMaxCnt = (2 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1646 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1647 while(NULLP != elmIndx)
1649 kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
1650 datReq.rlcId = kwuDatReqDetl->rlcId;
1651 datReq.sduId = kwuDatReqDetl->sduId;
1652 datReq.lcType = kwuDatReqDetl->lcType;
1653 SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;;//Number of pkt processed in tti
1654 if(kwuDatReqDetl->mBuf != NULLP)
1656 KwUiKwuDatReq(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
1658 SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1661 if(rngBufDeqIndx >= rngBufDeqMaxCnt)
1665 elmIndx = (Void *)SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1673 PUBLIC S16 kwUtlDlBatchProcPkts
1678 PUBLIC S16 kwUtlDlBatchProcPkts
1685 kwUtlDlBatchProcHqStaInd();
1694 PUBLIC S16 kwUtlDlFreeRlcRBuf
1699 PUBLIC S16 kwUtlDlFreeRlcRBuf
1703 /* Read from Ring Buffer and process PDCP packets */
1704 Void *elmIndx = NULLP;
1705 KwuDatReqDetl *kwuDatReqDetl = NULLP;
1706 /* Free SS_RNG_BUF_DLPDCP_TO_DLRLC */
1707 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1708 while(NULLP != elmIndx)
1710 kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
1711 SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1712 SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;
1713 SPutMsg(kwuDatReqDetl->mBuf);
1715 kwuDatReqDetl = NULLP;
1716 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC)) == NULLP)
1726 #endif /* __cplusplus */
1727 /********************************************************************30**
1729 **********************************************************************/