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
681 RgrCfgTransId transId,
685 PUBLIC S16 RgUiRgrCfgCfm(pst, transId, status)
687 RgrCfgTransId transId;
694 RETVALUE((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
700 * @brief Confirmation from MAC to RRC for the bind/Unbind
701 * request for the interface saps
705 * Function : RgUiCrgBndCfm
707 * @param[in] Pst* pst
708 * @param[in] SuId suId
709 * @param[in] U8 status
714 PUBLIC S16 RgUiCrgBndCfm
721 PUBLIC S16 RgUiCrgBndCfm(pst, suId, status)
730 RETVALUE((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
737 * @brief Configuration Confirm from MAC to RRC
741 * Function : RgUiCrgCfgCfm
743 * @param[in] Pst* pst
744 * @param[in] SuId suId
745 * @param[in] CrgCfgTransId transId
746 * @param[in] U8 status
751 PUBLIC S16 RgUiCrgCfgCfm
755 CrgCfgTransId transId,
759 PUBLIC S16 RgUiCrgCfgCfm(pst, suId, transId, status)
762 CrgCfgTransId transId;
769 RETVALUE((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
775 * @brief Confirmation from MAC to RLC for the bind/Unbind
776 * request for the interface saps
780 * Function : RgUiRguBndCfm
782 * @param[in] Pst* pst
783 * @param[in] SuId suId
784 * @param[in] U8 status
789 PUBLIC S16 RgUiRguBndCfm
796 PUBLIC S16 RgUiRguBndCfm(pst, suId, status)
805 RETVALUE((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
809 PUBLIC int macDDatIndSnt;
810 PUBLIC int macCDatIndSnt;
814 * @brief Data Indication from MAC to RLC to
815 * forward the data received for common channels
819 * Function : RgUiRguCDatInd
821 * @param[in] Pst* pst
822 * @param[in] SuId suId
823 * @param[in] RguCDatIndInfo * datInd
828 PUBLIC S16 RgUiRguCDatInd
832 RguCDatIndInfo * datInd
835 PUBLIC S16 RgUiRguCDatInd(pst, suId, datInd)
838 RguCDatIndInfo * datInd;
843 TRC3(RgUiRguCDatInd);
845 RETVALUE((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
851 * @brief Data Indication from MAC to RLC to
852 * forward the data received for dedicated channels
856 * Function : RgUiRguDDatInd
858 * @param[in] Pst* pst
859 * @param[in] SuId suId
860 * @param[in] RguDDatIndInfo * datInd
865 PUBLIC S16 RgUiRguDDatInd
869 RguDDatIndInfo * datInd
872 PUBLIC S16 RgUiRguDDatInd(pst, suId, datInd)
875 RguDDatIndInfo * datInd;
880 TRC3(RgUiRguDDatInd);
882 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
883 RETVALUE(RgUiRguDDatIndRbuf(datInd));
885 RETVALUE((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
892 * @brief Status Indication from MAC to RLC
893 * as a response to the staRsp primitive from RLC.
894 * Informs RLC of the totalBufferSize and Timing Info
895 * for the transmission on common channels.
899 * Function : RgUiRguCStaInd
901 * @param[in] Pst* pst
902 * @param[in] SuId suId
903 * @param[in] RguCStaIndInfo * staInd
908 PUBLIC S16 RgUiRguCStaInd
912 RguCStaIndInfo * staInd
915 PUBLIC S16 RgUiRguCStaInd(pst, suId, staInd)
918 RguCStaIndInfo * staInd;
922 TRC3(RgUiRguCStaInd);
924 RETVALUE((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
931 * @brief Status Indication from MAC to RLC
932 * as a response to the staRsp primitive from RLC.
933 * Informs RLC of the totalBufferSize and Timing Info
934 * for the transmission on dedicated channels.
938 * Function : RgUiRguDStaInd
940 * @param[in] Pst* pst
941 * @param[in] SuId suId
942 * @param[in] RguDStaIndInfo * staInd
947 PUBLIC S16 RgUiRguDStaInd
951 RguDStaIndInfo * staInd
954 PUBLIC S16 RgUiRguDStaInd(pst, suId, staInd)
957 RguDStaIndInfo * staInd;
961 TRC3(RgUiRguDStaInd);
963 RETVALUE((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
967 /* TODO: Function header */
969 PUBLIC S16 RgUiRguHqStaInd
973 RguHarqStatusInd *harqStatusInd
976 PUBLIC S16 RgUiRguHqStaInd(pst, suId, harqStatusInd)
979 RguHarqStatusInd *harqStatusInd;
983 TRC3(RgUiRguHqStaInd);
984 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
986 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
989 RETVALUE((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
992 } /* RgUiRguHqStaInd */
993 #endif /* LTE_L2_MEAS */
996 PUBLIC S16 RgUiRguFlowCntrlInd
1000 RguFlowCntrlInd *flowCntrlInd
1003 PUBLIC S16 RgUiRguFlowCntrlInd(pst, suId, harqStatusInd)
1006 RguFlowCntrlInd *flowCntrlInd;
1009 RETVALUE((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
1011 /* Added for SI Enhancement*/
1014 * @brief SI Configuration Confirm from MAC to RRM
1018 * Function : RgUiRgrSiCfgCfm
1020 * @param[in] Pst* pst
1021 * @param[in] SuId suId
1022 * @param[in] RgrCfgTransId transId
1023 * @param[in] U8 status
1028 PUBLIC S16 RgUiRgrSiCfgCfm
1032 RgrCfgTransId transId,
1036 PUBLIC S16 RgUiRgrSiCfgCfm(pst, suId, transId, status)
1039 RgrCfgTransId transId;
1044 TRC3(RgUiRgrSiCfgCfm);
1046 RETVALUE((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
1051 * @brief Warning SI Configuration Confirm from MAC to RRM
1055 * Function : RgUiRgrWarningSiCfgCfm
1057 * @param[in] Pst* pst
1058 * @param[in] SuId suId
1059 * @param[in] RgrCfgTransId transId
1060 * @param[in] U8 siId
1061 * @param[in] U8 status
1066 PUBLIC S16 RgUiRgrWarningSiCfgCfm
1070 RgrCfgTransId transId,
1075 PUBLIC S16 RgUiRgrWarningSiCfgCfm(pst, suId, transId, siId,status)
1078 RgrCfgTransId transId;
1083 TRC3(RgUiRgrWarningSiCfgCfm);
1085 RETVALUE((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
1086 (pst, suId, transId, siId, status));
1089 #endif/*RGR_SI_SCH*/
1092 /* ccpu00117452 - MOD - Changed macro name from
1093 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1096 * @brief STA indication from MAC to RGR user.
1100 * Function : RgUiRgrStaInd
1102 * @param[in] Pst* pst
1103 * @param[in] SuId suId
1104 * @param[in] RgrStaIndInfo *staInd
1109 PUBLIC S16 RgUiRgrStaInd
1113 RgrStaIndInfo *staInd
1116 PUBLIC S16 RgUiRgrStaInd(pst, suId, staInd)
1119 RgrStaIndInfo *staInd;
1123 TRC3(RgUiRgrStaInd);
1125 RETVALUE((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
1128 #endif /* End of RGR_CQI_REPT */
1130 /* LTE_ADV_FLAG_REMOVED_START */
1132 * @brief LOAD INF indication from MAC to RGR user.
1136 * Function : RgUiRgrLoadInfInd
1138 * @param[in] Pst* pst
1139 * @param[in] SuId suId
1140 * @param[in] RgrLoadInfIndInfo *loadInfInd
1145 PUBLIC S16 RgUiRgrLoadInfInd
1149 RgrLoadInfIndInfo *loadInfInd
1152 PUBLIC S16 RgUiRgrLoadInfInd(pst, suId, loadInfInd)
1155 RgrLoadInfIndInfo *loadInfInd;
1159 TRC3(RgUiRgrLoadInfInd);
1161 RETVALUE((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
1164 /* LTE_ADV_FLAG_REMOVED_END */
1167 * @brief UESTA indication from MAC to RGR user.
1171 * Function : RgUiRgrUeStaInd
1173 * @param[in] Pst* pst
1174 * @param[in] SuId suId
1175 * @param[in] RgrStaIndInfo *staInd
1180 PUBLIC S16 RgUiRgrUeStaInd
1184 RgrUeStaIndInfo *ueStaInd
1187 PUBLIC S16 RgUiRgrUeStaInd(pst, suId, ueStaInd)
1190 RgrUeStaIndInfo *ueStaInd;
1194 TRC3(RgUiRgrUeStaInd);
1196 RETVALUE((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
1199 #endif /*--ifdef RG--*/
1204 * @brief Confirmation from MAC to RRC for the bind/Unbind
1205 * request for the interface saps
1209 * Function : PtUiCrgBndCfm
1211 * @param[in] Pst* pst
1212 * @param[in] SuId suId
1213 * @param[in] U8 status
1218 PUBLIC S16 PtUiCrgBndCfm
1225 PUBLIC S16 PtUiCrgBndCfm(pst, suId, status)
1232 TRC3(PtUiCrgBndCfm);
1245 * @brief Configuration Confirm from MAC to RRC
1249 * Function : PtUiCrgCfgCfm
1251 * @param[in] Pst* pst
1252 * @param[in] SuId suId
1253 * @param[in] CrgCfgTransId transId
1254 * @param[in] U8 status
1259 PUBLIC S16 PtUiCrgCfgCfm
1263 CrgCfgTransId transId,
1267 PUBLIC S16 PtUiCrgCfgCfm(pst, suId, transId, status)
1270 CrgCfgTransId transId;
1275 TRC3(PtUiCrgCfgCfm);
1285 #endif /*--ifdef PTRGUICRG--*/
1290 * @brief Confirmation from MAC to RLC for the bind/Unbind
1291 * request for the interface saps
1295 * Function : PtUiRguBndCfm
1297 * @param[in] Pst* pst
1298 * @param[in] SuId suId
1299 * @param[in] U8 status
1304 PUBLIC S16 PtUiRguBndCfm
1311 PUBLIC S16 PtUiRguBndCfm(pst, suId, status)
1318 TRC3(PtUiRguBndCfm);
1331 * @brief Data Indication from MAC to RLC to
1332 * forward the data received for common channels
1336 * Function : PtUiRguCDatInd
1338 * @param[in] Pst* pst
1339 * @param[in] SuId suId
1340 * @param[in] RguCDatIndInfo * datInd
1345 PUBLIC S16 PtUiRguCDatInd
1349 RguCDatIndInfo * datInd
1352 PUBLIC S16 PtUiRguCDatInd(pst, suId, datInd)
1355 RguCDatIndInfo * datInd;
1359 TRC3(PtUiRguCDatInd);
1372 * @brief Data Indication from MAC to RLC to
1373 * forward the data received for dedicated channels
1377 * Function : PtUiRguDDatInd
1379 * @param[in] Pst* pst
1380 * @param[in] SuId suId
1381 * @param[in] RguDDatIndInfo * datInd
1386 PUBLIC S16 PtUiRguDDatInd
1390 RguDDatIndInfo * datInd
1393 PUBLIC S16 PtUiRguDDatInd(pst, suId, datInd)
1396 RguDDatIndInfo * datInd;
1400 TRC3(PtUiRguDDatInd);
1413 * @brief Status Indication from MAC to RLC
1414 * as a response to the staRsp primitive from RLC.
1415 * Informs RLC of the totalBufferSize and Timing Info
1416 * for the transmission on common channels.
1420 * Function : PtUiRguCStaInd
1422 * @param[in] Pst* pst
1423 * @param[in] SuId suId
1424 * @param[in] RguCStaIndInfo * staInd
1429 PUBLIC S16 PtUiRguCStaInd
1433 RguCStaIndInfo * staInd
1436 PUBLIC S16 PtUiRguCStaInd(pst, suId, staInd)
1439 RguCStaIndInfo * staInd;
1443 TRC3(PtUiRguCStaInd);
1456 * @brief Status Indication from MAC to RLC
1457 * as a response to the staRsp primitive from RLC.
1458 * Informs RLC of the totalBufferSize and Timing Info
1459 * for the transmission on dedicated channels.
1463 * Function : PtUiRguDStaInd
1465 * @param[in] Pst* pst
1466 * @param[in] SuId suId
1467 * @param[in] RguDStaIndInfo * staInd
1472 PUBLIC S16 PtUiRguDStaInd
1476 RguDStaIndInfo * staInd
1479 PUBLIC S16 PtUiRguDStaInd(pst, suId, staInd)
1482 RguDStaIndInfo * staInd;
1486 TRC3(PtUiRguDStaInd);
1496 /* TODO: Function Header */
1498 PUBLIC S16 PtUiRguHqStaInd
1502 RguHarqStatusInd *harqStatusInd
1505 PUBLIC S16 PtUiRguHqStaInd(pst, suId, harqStatusInd)
1508 RguHarqStatusInd *harqStatusInd;
1512 TRC3(PtUiRguHqStaInd);
1516 UNUSED(harqStatusInd);
1521 #endif /* LTE_L2_MEAS */
1524 PUBLIC S16 PtUiRguFlowCntrlInd
1528 RguFlowCntrlInd *flowCntrlInd
1531 PUBLIC S16 PtUiRguFlowCntrlInd(pst, suId, flowCntrlInd)
1534 RguHarqStatusInd *flowCntrlInd;
1538 TRC3(PtUiRguFlowCntrlInd);
1542 UNUSED(flowCntrlInd);
1548 #endif /*--ifdef PTRGUIRGU--*/
1553 * @brief Confirmation from MAC to RRM for the bind/Unbind
1554 * request for the interface saps
1558 * Function : PtUiRgrBndCfm
1560 * @param[in] Pst* pst
1561 * @param[in] SuId suId
1562 * @param[in] U8 status
1567 PUBLIC S16 PtUiRgrBndCfm
1574 PUBLIC S16 PtUiRgrBndCfm(pst, suId, status)
1581 TRC3(PtUiRgrBndCfm);
1591 /* Added for sending TTI tick to RRM */
1594 * @brief TTI indication from MAC to RGR user.
1598 * Function : PtUiRgrTtiInd
1600 * @param[in] Pst* pst
1601 * @param[in] SuId suId
1602 * @param[in] RgrTtiIndInfo *ttiInd
1607 PUBLIC S16 PtUiRgrTtiInd
1611 RgrTtiIndInfo *ttiInd
1614 PUBLIC S16 PtUiRgrTtiInd(pst, suId, ttiInd)
1617 RgrTtiIndInfo *ttiInd;
1621 TRC3(PtUiRgrTtiInd);
1634 * @brief Configuration Confirm from MAC to RRM
1638 * Function : PtUiRgrCfgCfm
1640 * @param[in] Pst* pst
1641 * @param[in] SuId suId
1642 * @param[in] RgrCfgTransId transId
1643 * @param[in] U8 status
1648 PUBLIC S16 PtUiRgrCfgCfm
1652 RgrCfgTransId transId,
1656 PUBLIC S16 PtUiRgrCfgCfm(pst, suId, transId, status)
1659 RgrCfgTransId transId;
1664 TRC3(PtUiRgrCfgCfm);
1675 /* Added for SI Enhancement*/
1678 * @brief SI Configuration Confirm from MAC to RRM
1682 * Function : PtUiRgrSiCfgCfm
1684 * @param[in] Pst* pst
1685 * @param[in] SuId suId
1686 * @param[in] RgrCfgTransId transId
1687 * @param[in] U8 status
1692 PUBLIC S16 PtUiRgrSiCfgCfm
1696 RgrCfgTransId transId,
1700 PUBLIC S16 PtUiRgrSiCfgCfm(pst, suId, transId, status)
1703 RgrCfgTransId transId;
1708 TRC3(PtUiRgrSiCfgCfm);
1720 * @brief Warning SI Configuration Confirm from MAC to RRM
1724 * Function : PtUiRgrWarningSiCfgCfm
1726 * @param[in] Pst* pst
1727 * @param[in] SuId suId
1728 * @param[in] RgrCfgTransId transId
1729 * @param[in] U8 siId
1730 * @param[in] U8 status
1735 PUBLIC S16 PtUiRgrWarningSiCfgCfm
1739 RgrCfgTransId transId,
1744 PUBLIC S16 PtUiRgrWarningSiCfgCfm(pst, suId, transId, siId, status)
1747 RgrCfgTransId transId;
1752 TRC3(PtUiRgrWarningSiCfgCfm);
1762 #endif/* RGR_SI_SCH */
1765 /* ccpu00117452 - MOD - Changed macro name from
1766 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1769 * @brief STA indication from MAC to RGR user.
1773 * Function : PtUiRgrStaInd
1775 * @param[in] Pst* pst
1776 * @param[in] SuId suId
1777 * @param[in] RgrStaIndInfo *staInd
1782 PUBLIC S16 PtUiRgrStaInd
1786 RgrStaIndInfo *staInd
1789 PUBLIC S16 PtUiRgrStaInd(pst, suId, staInd)
1792 RgrStaIndInfo *staInd;
1796 TRC3(PtUiRgrStaInd);
1805 #endif /* End of RGR_CQI_REPT */
1806 /* LTE_ADV_FLAG_REMOVED_START */
1808 * @brief LOAD INF indication from MAC to RGR user.
1812 * Function : PtUiRgrLoadInfInd
1814 * @param[in] Pst* pst
1815 * @param[in] SuId suId
1816 * @param[in] RgrLoadInfIndInfo *loadInfInd
1821 PUBLIC S16 PtUiRgrLoadInfInd
1825 RgrLoadInfIndInfo *loadInfInd
1828 PUBLIC S16 PtUiRgrLoadInfInd(pst, suId, loadInfInd)
1831 RgrLoadInfIndInfo *loadInfInd;
1835 TRC3(PtUiRgrLoadInfInd);
1844 /* LTE_ADV_FLAG_REMOVED_END */
1847 * @brief STA indication from MAC to RGR user.
1851 * Function : PtUiRgrUeStaInd
1853 * @param[in] Pst* pst
1854 * @param[in] SuId suId
1855 * @param[in] RgrUeStaIndInfo *ueStaInd
1860 PUBLIC S16 PtUiRgrUeStaInd
1864 RgrUeStaIndInfo *ueStaInd
1867 PUBLIC S16 PtUiRgrUeStaInd(pst, suId, ueStaInd)
1870 RgrUeStaIndInfo *ueStaInd;
1874 TRC3(PtUiRgrUeStaInd);
1883 #endif /*--ifdef PTRGUIRGR--*/
1888 * @brief Confirmation from MAC to RRM for the bind/Unbind
1889 * request for the interface saps via RGM interface
1893 * Function : PtUiRgmBndCfm
1895 * @param[in] Pst* pst
1896 * @param[in] SuId suId
1897 * @param[in] U8 status
1902 PUBLIC S16 PtUiRgmBndCfm
1909 PUBLIC S16 PtUiRgmBndCfm(pst, suId, status)
1916 TRC3(PtUiRgmBndCfm);
1927 * @brief Average PRB indication from MAC to RRM
1931 * Function : PtUiRgmPrbRprtInd
1933 * @param[in] Pst* pst
1934 * @param[in] SuId suId
1935 * @param[in] RgrUeStaIndInfo *ueStaInd
1940 PUBLIC S16 PtUiRgmPrbRprtInd
1944 RgmPrbRprtInd *prbRprtInd
1947 PUBLIC S16 PtUiRgmPrbRprtInd(pst, suId, prbRprtInd)
1950 RgmPrbRprtInd *prbRprtInd;
1954 TRC3(PtUiRgmPrbRprtInd);
1965 * @brief Transmission Mode Change indication from MAC to RRM
1969 * Function : PtUiRgmTransModeInd
1971 * @param[in] Pst* pst
1972 * @param[in] SuId suId
1973 * @param[in] RgmTransModeInd *transModeInd
1978 PUBLIC S16 PtUiRgmTransModeInd
1982 RgmTransModeInd *transModeInd
1985 PUBLIC S16 PtUiRgmTransModeInd(pst, suId, transModeInd)
1988 RgmTransModeInd *transModeInd;
1992 TRC3(PtUiRgmTransModeInd);
1996 UNUSED(transModeInd);
2004 * @brief Average PRB indication from MAC to RRM
2008 * Function : RgUiRgmSendPrbRprtInd
2010 * @param[in] Pst* pst
2011 * @param[in] SuId suId
2012 * @param[in] RgmPrbRprtInd prbRprtInd
2017 PUBLIC S16 RgUiRgmSendPrbRprtInd
2021 RgmPrbRprtInd *prbRprtInd
2024 PUBLIC S16 RgUiRgmSendPrbRprtInd(pst, suId, prbRprtInd)
2027 RgmPrbRprtInd *prbRprtInd;
2031 TRC2(RgUiRgmSendPrbRprtInd);
2032 RETVALUE((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
2036 * @brief Transmission Mode change indication from MAC to RRM
2040 * Function : RgUiRgmChangeTransModeInd
2042 * @param[in] Pst* pst
2043 * @param[in] SuId suId
2044 * @param[in] RgmTransModeInd transModeInd
2049 PUBLIC S16 RgUiRgmChangeTransModeInd
2053 RgmTransModeInd *transModeInd
2056 PUBLIC S16 RgUiRgmChangeTransModeInd(pst, suId, transModeInd)
2059 RgmTransModeInd *transModeInd;
2063 TRC2(RgUiRgmChangeTransModeInd);
2064 RETVALUE((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
2067 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
2068 PRIVATE S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
2072 RguDedDatInd1 *rguDatIndl = NULLP;
2073 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2074 rguDatIndl = (RguDedDatInd1 *) elem;
2077 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
2079 for(i = 0; i< datInd->numLch; i++)
2081 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
2083 if(datInd->lchData[i].pdu.mBuf[j])
2085 SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
2089 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
2094 rguDatIndl->msg = datInd;
2095 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2096 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
2101 #ifdef RLC_MAC_DAT_REQ_RBUF
2103 PUBLIC S16 rgDlDatReqBatchProc
2108 PUBLIC S16 rgDlDatReqBatchProc()
2112 /* Read from Ring Buffer and process PDCP packets */
2114 U8 rngBufDeqIndx = 0;
2115 PRIVATE Pst rgDDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
2116 PRIVATE Pst rgCDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
2117 Void *elmIndx = NULLP;
2118 RguInfoRingElem *datReqRing=NULLP;
2119 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2120 while(NULLP != elmIndx)
2122 datReqRing= (RguInfoRingElem *)elmIndx;
2123 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;;//Number of pkt processed in tti
2126 if(datReqRing->event == EVTRGUDDATREQ)
2128 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2132 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
2133 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2138 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2139 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2140 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2143 if(datReqRing->event == EVTRGUDDATREQ)
2144 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2146 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2149 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2150 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2153 datReqRing->msg=NULLP;
2154 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2155 datReqRing->event=0;
2160 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
2163 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
2171 #ifdef RLC_MAC_STA_RSP_RBUF
2173 PUBLIC S16 rgDlStaRspBatchProc
2178 PUBLIC S16 rgDlStaRspBatchProc()
2182 /* Read from Ring Buffer and process PDCP packets */
2184 U8 rngBufDeqIndx = 0;
2185 PRIVATE Pst rgDStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
2186 PRIVATE Pst rgCStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
2187 Void *elmIndx = NULLP;
2188 RguInfoRingElem *staRspRing=NULLP;
2190 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2191 while(NULLP != elmIndx)
2193 staRspRing= (RguInfoRingElem *)elmIndx;
2194 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;;//Number of pkt processed in tti
2196 if(staRspRing->msg!= NULLP)
2198 if( staRspRing->event == EVTRGUDSTARSP)
2200 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2204 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2209 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2210 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2211 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2212 if(staRspRing->msg!= NULLP)
2214 if( staRspRing->event == EVTRGUDSTARSP)
2215 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2217 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2220 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2221 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2224 staRspRing->msg=NULLP;
2225 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2226 staRspRing->event =0;
2232 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
2235 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
2243 #ifdef MAC_RLC_HARQ_STA_RBUF
2245 PUBLIC S16 RgUiRguHqStaIndRbuf
2249 RguHarqStatusInd *harqStatusInd
2252 PUBLIC S16 RgUiRguHqStaIndRbuf(pst, suId, harqStatusInd)
2255 RguHarqStatusInd *harqStatusInd;
2260 RguHarqStaInd *harqStaInd = NULLP;
2261 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
2262 harqStaInd = (RguHarqStaInd*) elem;
2265 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
2270 cmMemcpy((U8 *)&(harqStaInd->hqStatusInd), (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
2271 cmMemcpy((U8 *)&(harqStaInd->pst), (U8 *)pst, sizeof(Pst));
2272 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
2273 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
2281 /**********************************************************************
2284 **********************************************************************/