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 /************************************************************************
25 Desc: C source code for Upper Interface Module
29 **********************************************************************/
32 @brief This file contains the definitions for Upper Interface(RGR/CRG/RGU)
33 primitives that are invoked from MAC to its service users.
34 Portable functions corresponding to these primitives are also defined.
36 /* header include files (.h) */
37 #include "envopt.h" /* environment options */
38 #include "envdep.h" /* environment dependent */
39 #include "envind.h" /* environment independent */
40 #include "gen.h" /* general */
41 #include "ssi.h" /* system services */
42 #include "cm_tkns.h" /* Common Token Defines */
43 #include "cm_llist.h" /* Common Link List Defines */
44 #include "cm_hash.h" /* Common Hash List Defines */
45 #include "cm_lte.h" /* Common LTE Defines */
46 #include "rg_env.h" /* MAC Environment Defines */
47 #include "crg.h" /* CRG Interface defines */
48 #include "rgr.h" /* RGR Interface defines */
49 #include "rgu.h" /* RGU Interface defines */
50 #include "rgm.h" /* RGM Interface defines*/
52 /* header/extern include files (.x) */
53 #include "gen.x" /* general */
54 #include "ssi.x" /* system services */
55 #include "cm_tkns.x" /* Common Token Definitions */
56 #include "cm_llist.x" /* Common Link List Definitions */
57 #include "cm_lib.x" /* Common Library Definitions */
58 #include "cm_hash.x" /* Common Hash List Definitions */
59 #include "cm_lte.x" /* Common LTE Defines */
60 #include "crg.x" /* CRG Interface includes */
61 #include "rgr.x" /* RGR Interface includes */
62 #include "rgu.x" /* RGU Interface includes */
63 #include "rgm.x" /* RGM Interface includes*/
69 #endif /* __cplusplus */
71 #if !(defined(LCRGUIRGU) && defined(LWLCRGUIRGU) && defined(KW))
75 #if !(defined(LCRGUICRG) && defined(NH))
79 #if !(defined(LCRGUIRGR) && defined(NX))
83 #if !(defined(LCRGUIRGM) && defined(RM))
87 /* MAX Number of Service Users of RG */
88 #define RG_MAX_RGU_USR 3
90 /* MAX Number of Service Users of RG */
91 #define RG_MAX_CRG_USR 2
93 /* MAX Number of Service Users of RG */
94 #define RG_MAX_RGR_USR 2
96 /* MAX Number of Service Users of RG */
97 #define RG_MAX_RGM_USR 2
99 /** @brief Confirmation from MAC to RLC for the bind/Unbind
100 * request for the interface saps */
101 EXTERN S16 PtUiRguBndCfm ARGS((Pst* pst, SuId suId, U8 status));
102 /** @brief Data Indication from MAC to RLC to
103 * forward the data received for common channels*/
104 EXTERN S16 PtUiRguCDatInd ARGS((Pst* pst, SuId suId, RguCDatIndInfo * datInd));
105 /** @brief Data Indication from MAC to RLC to
106 * forward the data received for dedicated channels*/
107 EXTERN S16 PtUiRguDDatInd ARGS((Pst* pst, SuId suId, RguDDatIndInfo * datInd));
108 /** @brief Status Indication from MAC to RLC
109 * as a response to the staRsp primitive from RLC.
110 * Informs RLC of the totalBufferSize and Timing Info
111 * for the transmission on common channels. */
112 EXTERN S16 PtUiRguCStaInd ARGS((Pst* pst, SuId suId, RguCStaIndInfo * staInd));
113 /** @brief Status Indication from MAC to RLC
114 * as a response to the staRsp primitive from RLC.
115 * Informs RLC of the totalBufferSize and Timing Info
116 * for the transmission on dedicated channels. */
117 EXTERN S16 PtUiRguDStaInd ARGS((Pst* pst, SuId suId, RguDStaIndInfo * staInd));
119 /**@brief HARQ Status Indication from MAC to RLC */
120 EXTERN S16 PtUiRguHqStaInd ARGS((Pst* pst,SuId suId,
121 RguHarqStatusInd *harqStatusInd));
123 /**@brief PDB FLow Control Indication from MAC to RLC */
124 EXTERN S16 PtUiRguFlowCntrlInd ARGS((Pst* pst,SuId suId,
125 RguFlowCntrlInd *flowCntrlInd));
126 #endif /*--#ifdef PTRGUIRGU--*/
127 S16 RgUiRguFlowCntrlInd(Pst* pst, SuId suId, RguFlowCntrlInd *flowCntrlInd);
129 #ifdef MAC_RLC_HARQ_STA_RBUF
130 PUBLIC S16 RgUiRguHqStaIndRbuf ARGS((Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd));
134 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
135 PRIVATE S16 RgUiRguDDatIndRbuf ARGS((RguDDatIndInfo *datInd));
137 EXTERN Void rgFreeSharableSBuf ARGS((Data **data, Size size));
140 EXTERN S16 PtUiRgrStaInd ARGS(( Pst* pst, SuId suId, RgrStaIndInfo *staInd));
142 /* LTE_ADV_FLAG_REMOVED_START */
143 EXTERN S16 PtUiRgrLoadInfInd ARGS(( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd));
144 /* LTE_ADV_FLAG_REMOVED_END */
145 EXTERN S16 PtUiRgrUeStaInd ARGS
149 RgrUeStaIndInfo *staInd
152 /** @brief Confirmation from MAC to RRC for the bind/Unbind
153 * request for the interface saps */
154 EXTERN S16 PtUiCrgBndCfm ARGS((Pst* pst, SuId suId, U8 status));
155 /** @brief Configuration Confirm from MAC to RRC */
156 EXTERN S16 PtUiCrgCfgCfm ARGS((Pst* pst, SuId suId, CrgCfgTransId transId, U8 status));
157 #endif /*--#ifdef PTRGUICRG--*/
160 /** @brief Confirmation from MAC to RRM for the bind/Unbind
161 * request for the interface saps */
162 EXTERN S16 PtUiRgrBndCfm ARGS((Pst* pst, SuId suId, U8 status));
163 /** @brief Configuration Confirm from MAC to RRM */
164 EXTERN S16 PtUiRgrCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, U8 status));
165 EXTERN S16 PtUiRgrTtiInd ARGS((Pst* pst, SuId suId, RgrTtiIndInfo *ttiInd));
166 /* Added for SI Enhancement*/
168 EXTERN S16 PtUiRgrSiCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, U8 status));
169 EXTERN S16 PtUiRgrWarningSiCfgCfm ARGS((Pst* pst, SuId suId,
170 RgrCfgTransId transId, U8 siId, U8 status));
172 #endif /*--#ifdef PTRGUIRGR--*/
175 PUBLIC S16 PtUiRgmPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
176 PUBLIC S16 PtUiRgmBndCfm ARGS((Pst* pst, SuId suId, U8 status));
177 PUBLIC S16 PtUiRgmTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
179 PUBLIC S16 RgUiRgmSendPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
180 PUBLIC S16 RgUiRgmChangeTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
182 PUBLIC S16 RgUiRguFlowCntrlInd ARGS((Pst* pst, SuId suId, RguFlowCntrlInd *flowCntrlInd));
183 /* Added for sending TTI tick to RRM */
184 /** @brief TTI indication from MAC to RRM */
185 PRIVATE CONSTANT RgrTtiInd RgUiRgrTtiIndMt[RG_MAX_RGR_USR] =
200 /** @brief Confirmation from MAC to RRM for the bind/Unbind
201 * request for the interface saps */
202 PRIVATE CONSTANT RgrBndCfm RgUiRgrBndCfmMt[RG_MAX_RGR_USR] =
216 /** @brief Confirmation from MAC to RRM for the bind/Unbind
217 * request for the interface saps via RGM interface*/
218 PRIVATE CONSTANT RgmBndCfm RgUiRgmBndCfmMt[RG_MAX_RGM_USR] =
226 RmLiRgmBndCfm, /*To be added by RRM*/
233 /** @brief Configuration Confirm from MAC to RRM */
234 PRIVATE CONSTANT RgrCfgCfm RgUiRgrCfgCfmMt[RG_MAX_RGR_USR] =
248 /* Added for SI Enhancement*/
250 /** @brief SI Configuration Confirm from MAC to RRM */
251 PRIVATE CONSTANT RgrSiCfgCfm RgUiRgrSiCfgCfmMt[RG_MAX_RGR_USR] =
266 /** @brief Warning SI Configuration Confirm from MAC to RRM */
267 PRIVATE CONSTANT RgrWarningSiCfgCfm RgUiRgrWarningSiCfgCfmMt[RG_MAX_RGR_USR] =
270 cmPkRgrWarningSiCfgCfm,
272 PtUiRgrWarningSiCfgCfm,
275 NxLiRgrWarningSiCfgCfm,
277 PtUiRgrWarningSiCfgCfm,
281 #endif/*RGR_SI_SCH */
282 /** @brief Confirmation from MAC to RRC for the bind/Unbind
283 * request for the interface saps */
284 PRIVATE CONSTANT CrgBndCfm RgUiCrgBndCfmMt[RG_MAX_CRG_USR] =
298 /** @brief Configuration Confirm from MAC to RRC */
299 PRIVATE CONSTANT CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
314 /** @brief Confirmation from MAC to RLC for the bind/Unbind
315 * request for the interface saps */
316 PRIVATE CONSTANT RguBndCfm RgUiRguBndCfmMt[RG_MAX_RGU_USR] =
335 /** @brief Data Indication from MAC to RLC to
336 * forward the data received for common channels*/
337 PRIVATE CONSTANT RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
356 /** @brief Data Indication from MAC to RLC to
357 * forward the data received for dedicated channels*/
358 PRIVATE CONSTANT RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
377 /** @brief Status Indication from MAC to RLC
378 * as a response to the staRsp primitive from RLC.
379 * Informs RLC of the totalBufferSize and Timing Info
380 * for the transmission on common channels. */
381 PRIVATE CONSTANT RguCStaInd RgUiRguCStaIndMt[RG_MAX_RGU_USR] =
400 /** @brief Status Indication from MAC to RLC
401 * as a response to the staRsp primitive from RLC.
402 * Informs RLC of the totalBufferSize and Timing Info
403 * for the transmission on dedicated channels. */
404 PRIVATE CONSTANT RguDStaInd RgUiRguDStaIndMt[RG_MAX_RGU_USR] =
424 /** @brief HARQ Status Indication from MAC to RLC
425 * as a response to the DdatReq primitive from RLC.
426 * Informs RLC of the successful transmission of TB's
427 * (ACK/NACK) along with Mapping Info. */
428 PRIVATE CONSTANT RguHqStaInd RgUiRguHqStaIndMt[RG_MAX_RGU_USR] =
446 #endif /* LTE_L2_MEAS */
448 /* ccpu00117452 - MOD - Changed macro name from
449 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
451 /** @brief TTI indication from MAC to RRM */
452 PRIVATE CONSTANT RgrStaInd RgUiRgrStaIndMt[RG_MAX_RGR_USR] =
465 #endif /* RGR_CQI_REPT */
467 /* LTE_ADV_FLAG_REMOVED_START */
468 /** @brief LOAD INF indication from MAC to RRM */
469 PRIVATE CONSTANT RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
482 /* LTE_ADV_FLAG_REMOVED_END */
484 /** @brief TTI indication from MAC to RRM */
485 PRIVATE CONSTANT RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
499 /** @brief Average PRB usage indication from MAC to RRM */
500 PRIVATE CONSTANT RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
515 /** @brief Transmission Mode Change indication from MAC to RRM */
516 PRIVATE CONSTANT RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
530 PRIVATE CONSTANT RguFlowCntrlIndInfo RgUiRguFlowCntrlIndMt[RG_MAX_RGU_USR] =
550 #endif /* __cplusplus */
555 * @brief Confirmation from MAC to RRM for the bind/Unbind
556 * request for the interface saps
560 * Function : RgUiRgrBndCfm
562 * @param[in] Pst* pst
563 * @param[in] SuId suId
564 * @param[in] U8 status
569 PUBLIC S16 RgUiRgrBndCfm
576 PUBLIC S16 RgUiRgrBndCfm(pst, suId, status)
585 RETVALUE((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
589 * @brief Confirmation from MAC to RRM for the bind/Unbind
590 * request for the interface saps via RGM interface
594 * Function : RgUiRgmBndCfm
596 * @param[in] Pst* pst
597 * @param[in] SuId suId
598 * @param[in] U8 status
603 PUBLIC S16 RgUiRgmBndCfm
610 PUBLIC S16 RgUiRgmBndCfm(pst, suId, status)
619 RETVALUE((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
625 /* Added for sending TTI tick to RRM */
628 * @brief TTI indication from MAC to RGR user.
632 * Function : RgUiRgrTtiInd
634 * @param[in] Pst* pst
635 * @param[in] SuId suId
636 * @param[in] RgrTtiIndInfo ttiInd
641 PUBLIC S16 RgUiRgrTtiInd
645 RgrTtiIndInfo *ttiInd
648 PUBLIC S16 RgUiRgrTtiInd(pst, suId, ttiInd)
651 RgrTtiIndInfo *ttiInd;
657 RETVALUE((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
664 * @brief Configuration Confirm from MAC to RRM
668 * Function : RgUiRgrCfgCfm
670 * @param[in] Pst* pst
671 * @param[in] SuId suId
672 * @param[in] RgrCfgTransId transId
673 * @param[in] U8 status
678 PUBLIC S16 RgUiRgrCfgCfm
682 RgrCfgTransId transId,
686 PUBLIC S16 RgUiRgrCfgCfm(pst, suId, transId, status)
689 RgrCfgTransId transId;
696 RETVALUE((*RgUiRgrCfgCfmMt[pst->selector])(pst, suId, transId, status));
702 * @brief Confirmation from MAC to RRC for the bind/Unbind
703 * request for the interface saps
707 * Function : RgUiCrgBndCfm
709 * @param[in] Pst* pst
710 * @param[in] SuId suId
711 * @param[in] U8 status
716 PUBLIC S16 RgUiCrgBndCfm
723 PUBLIC S16 RgUiCrgBndCfm(pst, suId, status)
732 RETVALUE((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
739 * @brief Configuration Confirm from MAC to RRC
743 * Function : RgUiCrgCfgCfm
745 * @param[in] Pst* pst
746 * @param[in] SuId suId
747 * @param[in] CrgCfgTransId transId
748 * @param[in] U8 status
753 PUBLIC S16 RgUiCrgCfgCfm
757 CrgCfgTransId transId,
761 PUBLIC S16 RgUiCrgCfgCfm(pst, suId, transId, status)
764 CrgCfgTransId transId;
771 RETVALUE((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
777 * @brief Confirmation from MAC to RLC for the bind/Unbind
778 * request for the interface saps
782 * Function : RgUiRguBndCfm
784 * @param[in] Pst* pst
785 * @param[in] SuId suId
786 * @param[in] U8 status
791 PUBLIC S16 RgUiRguBndCfm
798 PUBLIC S16 RgUiRguBndCfm(pst, suId, status)
807 RETVALUE((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
811 PUBLIC int macDDatIndSnt;
812 PUBLIC int macCDatIndSnt;
816 * @brief Data Indication from MAC to RLC to
817 * forward the data received for common channels
821 * Function : RgUiRguCDatInd
823 * @param[in] Pst* pst
824 * @param[in] SuId suId
825 * @param[in] RguCDatIndInfo * datInd
830 PUBLIC S16 RgUiRguCDatInd
834 RguCDatIndInfo * datInd
837 PUBLIC S16 RgUiRguCDatInd(pst, suId, datInd)
840 RguCDatIndInfo * datInd;
845 TRC3(RgUiRguCDatInd);
847 RETVALUE((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
853 * @brief Data Indication from MAC to RLC to
854 * forward the data received for dedicated channels
858 * Function : RgUiRguDDatInd
860 * @param[in] Pst* pst
861 * @param[in] SuId suId
862 * @param[in] RguDDatIndInfo * datInd
867 PUBLIC S16 RgUiRguDDatInd
871 RguDDatIndInfo * datInd
874 PUBLIC S16 RgUiRguDDatInd(pst, suId, datInd)
877 RguDDatIndInfo * datInd;
882 TRC3(RgUiRguDDatInd);
884 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
885 RETVALUE(RgUiRguDDatIndRbuf(datInd));
887 RETVALUE((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
894 * @brief Status Indication from MAC to RLC
895 * as a response to the staRsp primitive from RLC.
896 * Informs RLC of the totalBufferSize and Timing Info
897 * for the transmission on common channels.
901 * Function : RgUiRguCStaInd
903 * @param[in] Pst* pst
904 * @param[in] SuId suId
905 * @param[in] RguCStaIndInfo * staInd
910 PUBLIC S16 RgUiRguCStaInd
914 RguCStaIndInfo * staInd
917 PUBLIC S16 RgUiRguCStaInd(pst, suId, staInd)
920 RguCStaIndInfo * staInd;
924 TRC3(RgUiRguCStaInd);
926 RETVALUE((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
933 * @brief Status Indication from MAC to RLC
934 * as a response to the staRsp primitive from RLC.
935 * Informs RLC of the totalBufferSize and Timing Info
936 * for the transmission on dedicated channels.
940 * Function : RgUiRguDStaInd
942 * @param[in] Pst* pst
943 * @param[in] SuId suId
944 * @param[in] RguDStaIndInfo * staInd
949 PUBLIC S16 RgUiRguDStaInd
953 RguDStaIndInfo * staInd
956 PUBLIC S16 RgUiRguDStaInd(pst, suId, staInd)
959 RguDStaIndInfo * staInd;
963 TRC3(RgUiRguDStaInd);
965 RETVALUE((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
969 /* TODO: Function header */
971 PUBLIC S16 RgUiRguHqStaInd
975 RguHarqStatusInd *harqStatusInd
978 PUBLIC S16 RgUiRguHqStaInd(pst, suId, harqStatusInd)
981 RguHarqStatusInd *harqStatusInd;
985 TRC3(RgUiRguHqStaInd);
986 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
988 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
991 RETVALUE((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
994 } /* RgUiRguHqStaInd */
995 #endif /* LTE_L2_MEAS */
998 PUBLIC S16 RgUiRguFlowCntrlInd
1002 RguFlowCntrlInd *flowCntrlInd
1005 PUBLIC S16 RgUiRguFlowCntrlInd(pst, suId, harqStatusInd)
1008 RguFlowCntrlInd *flowCntrlInd;
1011 RETVALUE((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
1013 /* Added for SI Enhancement*/
1016 * @brief SI Configuration Confirm from MAC to RRM
1020 * Function : RgUiRgrSiCfgCfm
1022 * @param[in] Pst* pst
1023 * @param[in] SuId suId
1024 * @param[in] RgrCfgTransId transId
1025 * @param[in] U8 status
1030 PUBLIC S16 RgUiRgrSiCfgCfm
1034 RgrCfgTransId transId,
1038 PUBLIC S16 RgUiRgrSiCfgCfm(pst, suId, transId, status)
1041 RgrCfgTransId transId;
1046 TRC3(RgUiRgrSiCfgCfm);
1048 RETVALUE((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
1053 * @brief Warning SI Configuration Confirm from MAC to RRM
1057 * Function : RgUiRgrWarningSiCfgCfm
1059 * @param[in] Pst* pst
1060 * @param[in] SuId suId
1061 * @param[in] RgrCfgTransId transId
1062 * @param[in] U8 siId
1063 * @param[in] U8 status
1068 PUBLIC S16 RgUiRgrWarningSiCfgCfm
1072 RgrCfgTransId transId,
1077 PUBLIC S16 RgUiRgrWarningSiCfgCfm(pst, suId, transId, siId,status)
1080 RgrCfgTransId transId;
1085 TRC3(RgUiRgrWarningSiCfgCfm);
1087 RETVALUE((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
1088 (pst, suId, transId, siId, status));
1091 #endif/*RGR_SI_SCH*/
1094 /* ccpu00117452 - MOD - Changed macro name from
1095 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1098 * @brief STA indication from MAC to RGR user.
1102 * Function : RgUiRgrStaInd
1104 * @param[in] Pst* pst
1105 * @param[in] SuId suId
1106 * @param[in] RgrStaIndInfo *staInd
1111 PUBLIC S16 RgUiRgrStaInd
1115 RgrStaIndInfo *staInd
1118 PUBLIC S16 RgUiRgrStaInd(pst, suId, staInd)
1121 RgrStaIndInfo *staInd;
1125 TRC3(RgUiRgrStaInd);
1127 RETVALUE((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
1130 #endif /* End of RGR_CQI_REPT */
1132 /* LTE_ADV_FLAG_REMOVED_START */
1134 * @brief LOAD INF indication from MAC to RGR user.
1138 * Function : RgUiRgrLoadInfInd
1140 * @param[in] Pst* pst
1141 * @param[in] SuId suId
1142 * @param[in] RgrLoadInfIndInfo *loadInfInd
1147 PUBLIC S16 RgUiRgrLoadInfInd
1151 RgrLoadInfIndInfo *loadInfInd
1154 PUBLIC S16 RgUiRgrLoadInfInd(pst, suId, loadInfInd)
1157 RgrLoadInfIndInfo *loadInfInd;
1161 TRC3(RgUiRgrLoadInfInd);
1163 RETVALUE((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
1166 /* LTE_ADV_FLAG_REMOVED_END */
1169 * @brief UESTA indication from MAC to RGR user.
1173 * Function : RgUiRgrUeStaInd
1175 * @param[in] Pst* pst
1176 * @param[in] SuId suId
1177 * @param[in] RgrStaIndInfo *staInd
1182 PUBLIC S16 RgUiRgrUeStaInd
1186 RgrUeStaIndInfo *ueStaInd
1189 PUBLIC S16 RgUiRgrUeStaInd(pst, suId, ueStaInd)
1192 RgrUeStaIndInfo *ueStaInd;
1196 TRC3(RgUiRgrUeStaInd);
1198 RETVALUE((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
1201 #endif /*--ifdef RG--*/
1206 * @brief Confirmation from MAC to RRC for the bind/Unbind
1207 * request for the interface saps
1211 * Function : PtUiCrgBndCfm
1213 * @param[in] Pst* pst
1214 * @param[in] SuId suId
1215 * @param[in] U8 status
1220 PUBLIC S16 PtUiCrgBndCfm
1227 PUBLIC S16 PtUiCrgBndCfm(pst, suId, status)
1234 TRC3(PtUiCrgBndCfm);
1247 * @brief Configuration Confirm from MAC to RRC
1251 * Function : PtUiCrgCfgCfm
1253 * @param[in] Pst* pst
1254 * @param[in] SuId suId
1255 * @param[in] CrgCfgTransId transId
1256 * @param[in] U8 status
1261 PUBLIC S16 PtUiCrgCfgCfm
1265 CrgCfgTransId transId,
1269 PUBLIC S16 PtUiCrgCfgCfm(pst, suId, transId, status)
1272 CrgCfgTransId transId;
1277 TRC3(PtUiCrgCfgCfm);
1287 #endif /*--ifdef PTRGUICRG--*/
1292 * @brief Confirmation from MAC to RLC for the bind/Unbind
1293 * request for the interface saps
1297 * Function : PtUiRguBndCfm
1299 * @param[in] Pst* pst
1300 * @param[in] SuId suId
1301 * @param[in] U8 status
1306 PUBLIC S16 PtUiRguBndCfm
1313 PUBLIC S16 PtUiRguBndCfm(pst, suId, status)
1320 TRC3(PtUiRguBndCfm);
1333 * @brief Data Indication from MAC to RLC to
1334 * forward the data received for common channels
1338 * Function : PtUiRguCDatInd
1340 * @param[in] Pst* pst
1341 * @param[in] SuId suId
1342 * @param[in] RguCDatIndInfo * datInd
1347 PUBLIC S16 PtUiRguCDatInd
1351 RguCDatIndInfo * datInd
1354 PUBLIC S16 PtUiRguCDatInd(pst, suId, datInd)
1357 RguCDatIndInfo * datInd;
1361 TRC3(PtUiRguCDatInd);
1374 * @brief Data Indication from MAC to RLC to
1375 * forward the data received for dedicated channels
1379 * Function : PtUiRguDDatInd
1381 * @param[in] Pst* pst
1382 * @param[in] SuId suId
1383 * @param[in] RguDDatIndInfo * datInd
1388 PUBLIC S16 PtUiRguDDatInd
1392 RguDDatIndInfo * datInd
1395 PUBLIC S16 PtUiRguDDatInd(pst, suId, datInd)
1398 RguDDatIndInfo * datInd;
1402 TRC3(PtUiRguDDatInd);
1415 * @brief Status Indication from MAC to RLC
1416 * as a response to the staRsp primitive from RLC.
1417 * Informs RLC of the totalBufferSize and Timing Info
1418 * for the transmission on common channels.
1422 * Function : PtUiRguCStaInd
1424 * @param[in] Pst* pst
1425 * @param[in] SuId suId
1426 * @param[in] RguCStaIndInfo * staInd
1431 PUBLIC S16 PtUiRguCStaInd
1435 RguCStaIndInfo * staInd
1438 PUBLIC S16 PtUiRguCStaInd(pst, suId, staInd)
1441 RguCStaIndInfo * staInd;
1445 TRC3(PtUiRguCStaInd);
1458 * @brief Status Indication from MAC to RLC
1459 * as a response to the staRsp primitive from RLC.
1460 * Informs RLC of the totalBufferSize and Timing Info
1461 * for the transmission on dedicated channels.
1465 * Function : PtUiRguDStaInd
1467 * @param[in] Pst* pst
1468 * @param[in] SuId suId
1469 * @param[in] RguDStaIndInfo * staInd
1474 PUBLIC S16 PtUiRguDStaInd
1478 RguDStaIndInfo * staInd
1481 PUBLIC S16 PtUiRguDStaInd(pst, suId, staInd)
1484 RguDStaIndInfo * staInd;
1488 TRC3(PtUiRguDStaInd);
1498 /* TODO: Function Header */
1500 PUBLIC S16 PtUiRguHqStaInd
1504 RguHarqStatusInd *harqStatusInd
1507 PUBLIC S16 PtUiRguHqStaInd(pst, suId, harqStatusInd)
1510 RguHarqStatusInd *harqStatusInd;
1514 TRC3(PtUiRguHqStaInd);
1518 UNUSED(harqStatusInd);
1523 #endif /* LTE_L2_MEAS */
1526 PUBLIC S16 PtUiRguFlowCntrlInd
1530 RguFlowCntrlInd *flowCntrlInd
1533 PUBLIC S16 PtUiRguFlowCntrlInd(pst, suId, flowCntrlInd)
1536 RguHarqStatusInd *flowCntrlInd;
1540 TRC3(PtUiRguFlowCntrlInd);
1544 UNUSED(flowCntrlInd);
1550 #endif /*--ifdef PTRGUIRGU--*/
1555 * @brief Confirmation from MAC to RRM for the bind/Unbind
1556 * request for the interface saps
1560 * Function : PtUiRgrBndCfm
1562 * @param[in] Pst* pst
1563 * @param[in] SuId suId
1564 * @param[in] U8 status
1569 PUBLIC S16 PtUiRgrBndCfm
1576 PUBLIC S16 PtUiRgrBndCfm(pst, suId, status)
1583 TRC3(PtUiRgrBndCfm);
1593 /* Added for sending TTI tick to RRM */
1596 * @brief TTI indication from MAC to RGR user.
1600 * Function : PtUiRgrTtiInd
1602 * @param[in] Pst* pst
1603 * @param[in] SuId suId
1604 * @param[in] RgrTtiIndInfo *ttiInd
1609 PUBLIC S16 PtUiRgrTtiInd
1613 RgrTtiIndInfo *ttiInd
1616 PUBLIC S16 PtUiRgrTtiInd(pst, suId, ttiInd)
1619 RgrTtiIndInfo *ttiInd;
1623 TRC3(PtUiRgrTtiInd);
1636 * @brief Configuration Confirm from MAC to RRM
1640 * Function : PtUiRgrCfgCfm
1642 * @param[in] Pst* pst
1643 * @param[in] SuId suId
1644 * @param[in] RgrCfgTransId transId
1645 * @param[in] U8 status
1650 PUBLIC S16 PtUiRgrCfgCfm
1654 RgrCfgTransId transId,
1658 PUBLIC S16 PtUiRgrCfgCfm(pst, suId, transId, status)
1661 RgrCfgTransId transId;
1666 TRC3(PtUiRgrCfgCfm);
1677 /* Added for SI Enhancement*/
1680 * @brief SI Configuration Confirm from MAC to RRM
1684 * Function : PtUiRgrSiCfgCfm
1686 * @param[in] Pst* pst
1687 * @param[in] SuId suId
1688 * @param[in] RgrCfgTransId transId
1689 * @param[in] U8 status
1694 PUBLIC S16 PtUiRgrSiCfgCfm
1698 RgrCfgTransId transId,
1702 PUBLIC S16 PtUiRgrSiCfgCfm(pst, suId, transId, status)
1705 RgrCfgTransId transId;
1710 TRC3(PtUiRgrSiCfgCfm);
1722 * @brief Warning SI Configuration Confirm from MAC to RRM
1726 * Function : PtUiRgrWarningSiCfgCfm
1728 * @param[in] Pst* pst
1729 * @param[in] SuId suId
1730 * @param[in] RgrCfgTransId transId
1731 * @param[in] U8 siId
1732 * @param[in] U8 status
1737 PUBLIC S16 PtUiRgrWarningSiCfgCfm
1741 RgrCfgTransId transId,
1746 PUBLIC S16 PtUiRgrWarningSiCfgCfm(pst, suId, transId, siId, status)
1749 RgrCfgTransId transId;
1754 TRC3(PtUiRgrWarningSiCfgCfm);
1764 #endif/* RGR_SI_SCH */
1767 /* ccpu00117452 - MOD - Changed macro name from
1768 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1771 * @brief STA indication from MAC to RGR user.
1775 * Function : PtUiRgrStaInd
1777 * @param[in] Pst* pst
1778 * @param[in] SuId suId
1779 * @param[in] RgrStaIndInfo *staInd
1784 PUBLIC S16 PtUiRgrStaInd
1788 RgrStaIndInfo *staInd
1791 PUBLIC S16 PtUiRgrStaInd(pst, suId, staInd)
1794 RgrStaIndInfo *staInd;
1798 TRC3(PtUiRgrStaInd);
1807 #endif /* End of RGR_CQI_REPT */
1808 /* LTE_ADV_FLAG_REMOVED_START */
1810 * @brief LOAD INF indication from MAC to RGR user.
1814 * Function : PtUiRgrLoadInfInd
1816 * @param[in] Pst* pst
1817 * @param[in] SuId suId
1818 * @param[in] RgrLoadInfIndInfo *loadInfInd
1823 PUBLIC S16 PtUiRgrLoadInfInd
1827 RgrLoadInfIndInfo *loadInfInd
1830 PUBLIC S16 PtUiRgrLoadInfInd(pst, suId, loadInfInd)
1833 RgrLoadInfIndInfo *loadInfInd;
1837 TRC3(PtUiRgrLoadInfInd);
1846 /* LTE_ADV_FLAG_REMOVED_END */
1849 * @brief STA indication from MAC to RGR user.
1853 * Function : PtUiRgrUeStaInd
1855 * @param[in] Pst* pst
1856 * @param[in] SuId suId
1857 * @param[in] RgrUeStaIndInfo *ueStaInd
1862 PUBLIC S16 PtUiRgrUeStaInd
1866 RgrUeStaIndInfo *ueStaInd
1869 PUBLIC S16 PtUiRgrUeStaInd(pst, suId, ueStaInd)
1872 RgrUeStaIndInfo *ueStaInd;
1876 TRC3(PtUiRgrUeStaInd);
1885 #endif /*--ifdef PTRGUIRGR--*/
1890 * @brief Confirmation from MAC to RRM for the bind/Unbind
1891 * request for the interface saps via RGM interface
1895 * Function : PtUiRgmBndCfm
1897 * @param[in] Pst* pst
1898 * @param[in] SuId suId
1899 * @param[in] U8 status
1904 PUBLIC S16 PtUiRgmBndCfm
1911 PUBLIC S16 PtUiRgmBndCfm(pst, suId, status)
1918 TRC3(PtUiRgmBndCfm);
1929 * @brief Average PRB indication from MAC to RRM
1933 * Function : PtUiRgmPrbRprtInd
1935 * @param[in] Pst* pst
1936 * @param[in] SuId suId
1937 * @param[in] RgrUeStaIndInfo *ueStaInd
1942 PUBLIC S16 PtUiRgmPrbRprtInd
1946 RgmPrbRprtInd *prbRprtInd
1949 PUBLIC S16 PtUiRgmPrbRprtInd(pst, suId, prbRprtInd)
1952 RgmPrbRprtInd *prbRprtInd;
1956 TRC3(PtUiRgmPrbRprtInd);
1967 * @brief Transmission Mode Change indication from MAC to RRM
1971 * Function : PtUiRgmTransModeInd
1973 * @param[in] Pst* pst
1974 * @param[in] SuId suId
1975 * @param[in] RgmTransModeInd *transModeInd
1980 PUBLIC S16 PtUiRgmTransModeInd
1984 RgmTransModeInd *transModeInd
1987 PUBLIC S16 PtUiRgmTransModeInd(pst, suId, transModeInd)
1990 RgmTransModeInd *transModeInd;
1994 TRC3(PtUiRgmTransModeInd);
1998 UNUSED(transModeInd);
2006 * @brief Average PRB indication from MAC to RRM
2010 * Function : RgUiRgmSendPrbRprtInd
2012 * @param[in] Pst* pst
2013 * @param[in] SuId suId
2014 * @param[in] RgmPrbRprtInd prbRprtInd
2019 PUBLIC S16 RgUiRgmSendPrbRprtInd
2023 RgmPrbRprtInd *prbRprtInd
2026 PUBLIC S16 RgUiRgmSendPrbRprtInd(pst, suId, prbRprtInd)
2029 RgmPrbRprtInd *prbRprtInd;
2033 TRC2(RgUiRgmSendPrbRprtInd);
2034 RETVALUE((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
2038 * @brief Transmission Mode change indication from MAC to RRM
2042 * Function : RgUiRgmChangeTransModeInd
2044 * @param[in] Pst* pst
2045 * @param[in] SuId suId
2046 * @param[in] RgmTransModeInd transModeInd
2051 PUBLIC S16 RgUiRgmChangeTransModeInd
2055 RgmTransModeInd *transModeInd
2058 PUBLIC S16 RgUiRgmChangeTransModeInd(pst, suId, transModeInd)
2061 RgmTransModeInd *transModeInd;
2065 TRC2(RgUiRgmChangeTransModeInd);
2066 RETVALUE((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
2069 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
2070 PRIVATE S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
2074 RguDedDatInd1 *rguDatIndl = NULLP;
2075 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2076 rguDatIndl = (RguDedDatInd1 *) elem;
2079 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
2081 for(i = 0; i< datInd->numLch; i++)
2083 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
2085 if(datInd->lchData[i].pdu.mBuf[j])
2087 SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
2091 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
2096 rguDatIndl->msg = datInd;
2097 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2098 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
2103 #ifdef RLC_MAC_DAT_REQ_RBUF
2105 PUBLIC S16 rgDlDatReqBatchProc
2110 PUBLIC S16 rgDlDatReqBatchProc()
2114 /* Read from Ring Buffer and process PDCP packets */
2116 U8 rngBufDeqIndx = 0;
2117 PRIVATE Pst rgDDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
2118 PRIVATE Pst rgCDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
2119 Void *elmIndx = NULLP;
2120 RguInfoRingElem *datReqRing=NULLP;
2121 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2122 while(NULLP != elmIndx)
2124 datReqRing= (RguInfoRingElem *)elmIndx;
2125 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;;//Number of pkt processed in tti
2128 if(datReqRing->event == EVTRGUDDATREQ)
2130 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2134 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
2135 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2140 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2141 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2142 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2145 if(datReqRing->event == EVTRGUDDATREQ)
2146 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2148 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2151 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2152 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2155 datReqRing->msg=NULLP;
2156 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2157 datReqRing->event=0;
2162 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
2165 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
2173 #ifdef RLC_MAC_STA_RSP_RBUF
2175 PUBLIC S16 rgDlStaRspBatchProc
2180 PUBLIC S16 rgDlStaRspBatchProc()
2184 /* Read from Ring Buffer and process PDCP packets */
2186 U8 rngBufDeqIndx = 0;
2187 PRIVATE Pst rgDStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
2188 PRIVATE Pst rgCStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
2189 Void *elmIndx = NULLP;
2190 RguInfoRingElem *staRspRing=NULLP;
2192 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2193 while(NULLP != elmIndx)
2195 staRspRing= (RguInfoRingElem *)elmIndx;
2196 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;;//Number of pkt processed in tti
2198 if(staRspRing->msg!= NULLP)
2200 if( staRspRing->event == EVTRGUDSTARSP)
2202 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2206 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2211 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2212 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2213 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2214 if(staRspRing->msg!= NULLP)
2216 if( staRspRing->event == EVTRGUDSTARSP)
2217 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2219 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2222 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2223 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2226 staRspRing->msg=NULLP;
2227 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2228 staRspRing->event =0;
2234 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
2237 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
2245 #ifdef MAC_RLC_HARQ_STA_RBUF
2247 PUBLIC S16 RgUiRguHqStaIndRbuf
2251 RguHarqStatusInd *harqStatusInd
2254 PUBLIC S16 RgUiRguHqStaIndRbuf(pst, suId, harqStatusInd)
2257 RguHarqStatusInd *harqStatusInd;
2262 RguHarqStaInd *harqStaInd = NULLP;
2263 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
2264 harqStaInd = (RguHarqStaInd*) elem;
2267 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
2272 cmMemcpy((U8 *)&(harqStaInd->hqStatusInd), (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
2273 cmMemcpy((U8 *)&(harqStaInd->pst), (U8 *)pst, sizeof(Pst));
2274 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
2275 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
2283 /**********************************************************************
2286 **********************************************************************/