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] =
246 /* Added for SI Enhancement*/
248 /** @brief SI Configuration Confirm from MAC to RRM */
249 PRIVATE CONSTANT RgrSiCfgCfm RgUiRgrSiCfgCfmMt[RG_MAX_RGR_USR] =
264 /** @brief Warning SI Configuration Confirm from MAC to RRM */
265 PRIVATE CONSTANT RgrWarningSiCfgCfm RgUiRgrWarningSiCfgCfmMt[RG_MAX_RGR_USR] =
268 cmPkRgrWarningSiCfgCfm,
270 PtUiRgrWarningSiCfgCfm,
273 NxLiRgrWarningSiCfgCfm,
275 PtUiRgrWarningSiCfgCfm,
279 #endif/*RGR_SI_SCH */
280 /** @brief Confirmation from MAC to RRC for the bind/Unbind
281 * request for the interface saps */
282 PRIVATE CONSTANT CrgBndCfm RgUiCrgBndCfmMt[RG_MAX_CRG_USR] =
296 /** @brief Configuration Confirm from MAC to RRC */
297 PRIVATE CONSTANT CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
312 /** @brief Confirmation from MAC to RLC for the bind/Unbind
313 * request for the interface saps */
314 PRIVATE CONSTANT RguBndCfm RgUiRguBndCfmMt[RG_MAX_RGU_USR] =
333 /** @brief Data Indication from MAC to RLC to
334 * forward the data received for common channels*/
335 PRIVATE CONSTANT RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
338 // cmPkRguCDatInd, /* TODO : Call packRcvdUlData instead */
348 // cmPkRguCDatInd, /* TODO:Call packRcvdUlData instead */
354 /** @brief Data Indication from MAC to RLC to
355 * forward the data received for dedicated channels*/
356 PRIVATE CONSTANT RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
359 // cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
369 // cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
375 /** @brief Status Indication from MAC to RLC
376 * as a response to the staRsp primitive from RLC.
377 * Informs RLC of the totalBufferSize and Timing Info
378 * for the transmission on common channels. */
379 PRIVATE CONSTANT RguCStaInd RgUiRguCStaIndMt[RG_MAX_RGU_USR] =
382 //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
387 //RlcMacProcSchedRep,
392 //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
398 /** @brief Status Indication from MAC to RLC
399 * as a response to the staRsp primitive from RLC.
400 * Informs RLC of the totalBufferSize and Timing Info
401 * for the transmission on dedicated channels. */
402 PRIVATE CONSTANT RguDStaInd RgUiRguDStaIndMt[RG_MAX_RGU_USR] =
405 //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
410 //RlcMacProcSchedRep,
415 //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
422 /** @brief HARQ Status Indication from MAC to RLC
423 * as a response to the DdatReq primitive from RLC.
424 * Informs RLC of the successful transmission of TB's
425 * (ACK/NACK) along with Mapping Info. */
426 PRIVATE CONSTANT RguHqStaInd RgUiRguHqStaIndMt[RG_MAX_RGU_USR] =
444 #endif /* LTE_L2_MEAS */
446 /* ccpu00117452 - MOD - Changed macro name from
447 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
449 /** @brief TTI indication from MAC to RRM */
450 PRIVATE CONSTANT RgrStaInd RgUiRgrStaIndMt[RG_MAX_RGR_USR] =
463 #endif /* RGR_CQI_REPT */
465 /* LTE_ADV_FLAG_REMOVED_START */
466 /** @brief LOAD INF indication from MAC to RRM */
467 PRIVATE CONSTANT RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
480 /* LTE_ADV_FLAG_REMOVED_END */
482 /** @brief TTI indication from MAC to RRM */
483 PRIVATE CONSTANT RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
497 /** @brief Average PRB usage indication from MAC to RRM */
498 PRIVATE CONSTANT RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
513 /** @brief Transmission Mode Change indication from MAC to RRM */
514 PRIVATE CONSTANT RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
528 PRIVATE CONSTANT RguFlowCntrlIndInfo RgUiRguFlowCntrlIndMt[RG_MAX_RGU_USR] =
548 #endif /* __cplusplus */
553 * @brief Confirmation from MAC to RRM for the bind/Unbind
554 * request for the interface saps
558 * Function : RgUiRgrBndCfm
560 * @param[in] Pst* pst
561 * @param[in] SuId suId
562 * @param[in] U8 status
567 PUBLIC S16 RgUiRgrBndCfm
574 PUBLIC S16 RgUiRgrBndCfm(pst, suId, status)
583 RETVALUE((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
587 * @brief Confirmation from MAC to RRM for the bind/Unbind
588 * request for the interface saps via RGM interface
592 * Function : RgUiRgmBndCfm
594 * @param[in] Pst* pst
595 * @param[in] SuId suId
596 * @param[in] U8 status
601 PUBLIC S16 RgUiRgmBndCfm
608 PUBLIC S16 RgUiRgmBndCfm(pst, suId, status)
617 RETVALUE((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
623 /* Added for sending TTI tick to RRM */
626 * @brief TTI indication from MAC to RGR user.
630 * Function : RgUiRgrTtiInd
632 * @param[in] Pst* pst
633 * @param[in] SuId suId
634 * @param[in] RgrTtiIndInfo ttiInd
639 PUBLIC S16 RgUiRgrTtiInd
643 RgrTtiIndInfo *ttiInd
646 PUBLIC S16 RgUiRgrTtiInd(pst, suId, ttiInd)
649 RgrTtiIndInfo *ttiInd;
655 RETVALUE((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
662 * @brief Configuration Confirm from MAC to RRM
666 * Function : RgUiRgrCfgCfm
668 * @param[in] Pst* pst
669 * @param[in] SuId suId
670 * @param[in] RgrCfgTransId transId
671 * @param[in] U8 status
676 PUBLIC S16 RgUiRgrCfgCfm
679 RgrCfgTransId transId,
683 PUBLIC S16 RgUiRgrCfgCfm(pst, transId, status)
685 RgrCfgTransId transId;
692 RETVALUE((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
698 * @brief Confirmation from MAC to RRC for the bind/Unbind
699 * request for the interface saps
703 * Function : RgUiCrgBndCfm
705 * @param[in] Pst* pst
706 * @param[in] SuId suId
707 * @param[in] U8 status
712 PUBLIC S16 RgUiCrgBndCfm
719 PUBLIC S16 RgUiCrgBndCfm(pst, suId, status)
728 RETVALUE((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
735 * @brief Configuration Confirm from MAC to RRC
739 * Function : RgUiCrgCfgCfm
741 * @param[in] Pst* pst
742 * @param[in] SuId suId
743 * @param[in] CrgCfgTransId transId
744 * @param[in] U8 status
749 PUBLIC S16 RgUiCrgCfgCfm
753 CrgCfgTransId transId,
757 PUBLIC S16 RgUiCrgCfgCfm(pst, suId, transId, status)
760 CrgCfgTransId transId;
767 RETVALUE((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
773 * @brief Confirmation from MAC to RLC for the bind/Unbind
774 * request for the interface saps
778 * Function : RgUiRguBndCfm
780 * @param[in] Pst* pst
781 * @param[in] SuId suId
782 * @param[in] U8 status
787 PUBLIC S16 RgUiRguBndCfm
794 PUBLIC S16 RgUiRguBndCfm(pst, suId, status)
803 RETVALUE((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
807 PUBLIC int macDDatIndSnt;
808 PUBLIC int macCDatIndSnt;
812 * @brief Data Indication from MAC to RLC to
813 * forward the data received for common channels
817 * Function : RgUiRguCDatInd
819 * @param[in] Pst* pst
820 * @param[in] SuId suId
821 * @param[in] RguCDatIndInfo * datInd
826 PUBLIC S16 RgUiRguCDatInd
830 RguCDatIndInfo * datInd
833 PUBLIC S16 RgUiRguCDatInd(pst, suId, datInd)
836 RguCDatIndInfo * datInd;
841 TRC3(RgUiRguCDatInd);
843 RETVALUE((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
849 * @brief Data Indication from MAC to RLC to
850 * forward the data received for dedicated channels
854 * Function : RgUiRguDDatInd
856 * @param[in] Pst* pst
857 * @param[in] SuId suId
858 * @param[in] RguDDatIndInfo * datInd
863 PUBLIC S16 RgUiRguDDatInd
867 RguDDatIndInfo * datInd
870 PUBLIC S16 RgUiRguDDatInd(pst, suId, datInd)
873 RguDDatIndInfo * datInd;
878 TRC3(RgUiRguDDatInd);
880 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
881 RETVALUE(RgUiRguDDatIndRbuf(datInd));
883 RETVALUE((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
890 * @brief Status Indication from MAC to RLC
891 * as a response to the staRsp primitive from RLC.
892 * Informs RLC of the totalBufferSize and Timing Info
893 * for the transmission on common channels.
897 * Function : RgUiRguCStaInd
899 * @param[in] Pst* pst
900 * @param[in] SuId suId
901 * @param[in] RguCStaIndInfo * staInd
906 PUBLIC S16 RgUiRguCStaInd
910 RguCStaIndInfo * staInd
913 PUBLIC S16 RgUiRguCStaInd(pst, suId, staInd)
916 RguCStaIndInfo * staInd;
920 TRC3(RgUiRguCStaInd);
922 RETVALUE((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
929 * @brief Status Indication from MAC to RLC
930 * as a response to the staRsp primitive from RLC.
931 * Informs RLC of the totalBufferSize and Timing Info
932 * for the transmission on dedicated channels.
936 * Function : RgUiRguDStaInd
938 * @param[in] Pst* pst
939 * @param[in] SuId suId
940 * @param[in] RguDStaIndInfo * staInd
945 PUBLIC S16 RgUiRguDStaInd
949 RguDStaIndInfo * staInd
952 PUBLIC S16 RgUiRguDStaInd(pst, suId, staInd)
955 RguDStaIndInfo * staInd;
959 TRC3(RgUiRguDStaInd);
961 RETVALUE((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
965 /* TODO: Function header */
967 PUBLIC S16 RgUiRguHqStaInd
971 RguHarqStatusInd *harqStatusInd
974 PUBLIC S16 RgUiRguHqStaInd(pst, suId, harqStatusInd)
977 RguHarqStatusInd *harqStatusInd;
981 TRC3(RgUiRguHqStaInd);
982 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
984 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
987 RETVALUE((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
990 } /* RgUiRguHqStaInd */
991 #endif /* LTE_L2_MEAS */
994 PUBLIC S16 RgUiRguFlowCntrlInd
998 RguFlowCntrlInd *flowCntrlInd
1001 PUBLIC S16 RgUiRguFlowCntrlInd(pst, suId, harqStatusInd)
1004 RguFlowCntrlInd *flowCntrlInd;
1007 RETVALUE((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
1009 /* Added for SI Enhancement*/
1012 * @brief SI Configuration Confirm from MAC to RRM
1016 * Function : RgUiRgrSiCfgCfm
1018 * @param[in] Pst* pst
1019 * @param[in] SuId suId
1020 * @param[in] RgrCfgTransId transId
1021 * @param[in] U8 status
1026 PUBLIC S16 RgUiRgrSiCfgCfm
1030 RgrCfgTransId transId,
1034 PUBLIC S16 RgUiRgrSiCfgCfm(pst, suId, transId, status)
1037 RgrCfgTransId transId;
1042 TRC3(RgUiRgrSiCfgCfm);
1044 RETVALUE((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
1049 * @brief Warning SI Configuration Confirm from MAC to RRM
1053 * Function : RgUiRgrWarningSiCfgCfm
1055 * @param[in] Pst* pst
1056 * @param[in] SuId suId
1057 * @param[in] RgrCfgTransId transId
1058 * @param[in] U8 siId
1059 * @param[in] U8 status
1064 PUBLIC S16 RgUiRgrWarningSiCfgCfm
1068 RgrCfgTransId transId,
1073 PUBLIC S16 RgUiRgrWarningSiCfgCfm(pst, suId, transId, siId,status)
1076 RgrCfgTransId transId;
1081 TRC3(RgUiRgrWarningSiCfgCfm);
1083 RETVALUE((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
1084 (pst, suId, transId, siId, status));
1087 #endif/*RGR_SI_SCH*/
1090 /* ccpu00117452 - MOD - Changed macro name from
1091 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1094 * @brief STA indication from MAC to RGR user.
1098 * Function : RgUiRgrStaInd
1100 * @param[in] Pst* pst
1101 * @param[in] SuId suId
1102 * @param[in] RgrStaIndInfo *staInd
1107 PUBLIC S16 RgUiRgrStaInd
1111 RgrStaIndInfo *staInd
1114 PUBLIC S16 RgUiRgrStaInd(pst, suId, staInd)
1117 RgrStaIndInfo *staInd;
1121 TRC3(RgUiRgrStaInd);
1123 RETVALUE((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
1126 #endif /* End of RGR_CQI_REPT */
1128 /* LTE_ADV_FLAG_REMOVED_START */
1130 * @brief LOAD INF indication from MAC to RGR user.
1134 * Function : RgUiRgrLoadInfInd
1136 * @param[in] Pst* pst
1137 * @param[in] SuId suId
1138 * @param[in] RgrLoadInfIndInfo *loadInfInd
1143 PUBLIC S16 RgUiRgrLoadInfInd
1147 RgrLoadInfIndInfo *loadInfInd
1150 PUBLIC S16 RgUiRgrLoadInfInd(pst, suId, loadInfInd)
1153 RgrLoadInfIndInfo *loadInfInd;
1157 TRC3(RgUiRgrLoadInfInd);
1159 RETVALUE((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
1162 /* LTE_ADV_FLAG_REMOVED_END */
1165 * @brief UESTA indication from MAC to RGR user.
1169 * Function : RgUiRgrUeStaInd
1171 * @param[in] Pst* pst
1172 * @param[in] SuId suId
1173 * @param[in] RgrStaIndInfo *staInd
1178 PUBLIC S16 RgUiRgrUeStaInd
1182 RgrUeStaIndInfo *ueStaInd
1185 PUBLIC S16 RgUiRgrUeStaInd(pst, suId, ueStaInd)
1188 RgrUeStaIndInfo *ueStaInd;
1192 TRC3(RgUiRgrUeStaInd);
1194 RETVALUE((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
1197 #endif /*--ifdef RG--*/
1202 * @brief Confirmation from MAC to RRC for the bind/Unbind
1203 * request for the interface saps
1207 * Function : PtUiCrgBndCfm
1209 * @param[in] Pst* pst
1210 * @param[in] SuId suId
1211 * @param[in] U8 status
1216 PUBLIC S16 PtUiCrgBndCfm
1223 PUBLIC S16 PtUiCrgBndCfm(pst, suId, status)
1230 TRC3(PtUiCrgBndCfm);
1243 * @brief Configuration Confirm from MAC to RRC
1247 * Function : PtUiCrgCfgCfm
1249 * @param[in] Pst* pst
1250 * @param[in] SuId suId
1251 * @param[in] CrgCfgTransId transId
1252 * @param[in] U8 status
1257 PUBLIC S16 PtUiCrgCfgCfm
1261 CrgCfgTransId transId,
1265 PUBLIC S16 PtUiCrgCfgCfm(pst, suId, transId, status)
1268 CrgCfgTransId transId;
1273 TRC3(PtUiCrgCfgCfm);
1283 #endif /*--ifdef PTRGUICRG--*/
1288 * @brief Confirmation from MAC to RLC for the bind/Unbind
1289 * request for the interface saps
1293 * Function : PtUiRguBndCfm
1295 * @param[in] Pst* pst
1296 * @param[in] SuId suId
1297 * @param[in] U8 status
1302 PUBLIC S16 PtUiRguBndCfm
1309 PUBLIC S16 PtUiRguBndCfm(pst, suId, status)
1316 TRC3(PtUiRguBndCfm);
1329 * @brief Data Indication from MAC to RLC to
1330 * forward the data received for common channels
1334 * Function : PtUiRguCDatInd
1336 * @param[in] Pst* pst
1337 * @param[in] SuId suId
1338 * @param[in] RguCDatIndInfo * datInd
1343 PUBLIC S16 PtUiRguCDatInd
1347 RguCDatIndInfo * datInd
1350 PUBLIC S16 PtUiRguCDatInd(pst, suId, datInd)
1353 RguCDatIndInfo * datInd;
1357 TRC3(PtUiRguCDatInd);
1370 * @brief Data Indication from MAC to RLC to
1371 * forward the data received for dedicated channels
1375 * Function : PtUiRguDDatInd
1377 * @param[in] Pst* pst
1378 * @param[in] SuId suId
1379 * @param[in] RguDDatIndInfo * datInd
1384 PUBLIC S16 PtUiRguDDatInd
1388 RguDDatIndInfo * datInd
1391 PUBLIC S16 PtUiRguDDatInd(pst, suId, datInd)
1394 RguDDatIndInfo * datInd;
1398 TRC3(PtUiRguDDatInd);
1411 * @brief Status Indication from MAC to RLC
1412 * as a response to the staRsp primitive from RLC.
1413 * Informs RLC of the totalBufferSize and Timing Info
1414 * for the transmission on common channels.
1418 * Function : PtUiRguCStaInd
1420 * @param[in] Pst* pst
1421 * @param[in] SuId suId
1422 * @param[in] RguCStaIndInfo * staInd
1427 PUBLIC S16 PtUiRguCStaInd
1431 RguCStaIndInfo * staInd
1434 PUBLIC S16 PtUiRguCStaInd(pst, suId, staInd)
1437 RguCStaIndInfo * staInd;
1441 TRC3(PtUiRguCStaInd);
1454 * @brief Status Indication from MAC to RLC
1455 * as a response to the staRsp primitive from RLC.
1456 * Informs RLC of the totalBufferSize and Timing Info
1457 * for the transmission on dedicated channels.
1461 * Function : PtUiRguDStaInd
1463 * @param[in] Pst* pst
1464 * @param[in] SuId suId
1465 * @param[in] RguDStaIndInfo * staInd
1470 PUBLIC S16 PtUiRguDStaInd
1474 RguDStaIndInfo * staInd
1477 PUBLIC S16 PtUiRguDStaInd(pst, suId, staInd)
1480 RguDStaIndInfo * staInd;
1484 TRC3(PtUiRguDStaInd);
1494 /* TODO: Function Header */
1496 PUBLIC S16 PtUiRguHqStaInd
1500 RguHarqStatusInd *harqStatusInd
1503 PUBLIC S16 PtUiRguHqStaInd(pst, suId, harqStatusInd)
1506 RguHarqStatusInd *harqStatusInd;
1510 TRC3(PtUiRguHqStaInd);
1514 UNUSED(harqStatusInd);
1519 #endif /* LTE_L2_MEAS */
1522 PUBLIC S16 PtUiRguFlowCntrlInd
1526 RguFlowCntrlInd *flowCntrlInd
1529 PUBLIC S16 PtUiRguFlowCntrlInd(pst, suId, flowCntrlInd)
1532 RguHarqStatusInd *flowCntrlInd;
1536 TRC3(PtUiRguFlowCntrlInd);
1540 UNUSED(flowCntrlInd);
1546 #endif /*--ifdef PTRGUIRGU--*/
1551 * @brief Confirmation from MAC to RRM for the bind/Unbind
1552 * request for the interface saps
1556 * Function : PtUiRgrBndCfm
1558 * @param[in] Pst* pst
1559 * @param[in] SuId suId
1560 * @param[in] U8 status
1565 PUBLIC S16 PtUiRgrBndCfm
1572 PUBLIC S16 PtUiRgrBndCfm(pst, suId, status)
1579 TRC3(PtUiRgrBndCfm);
1589 /* Added for sending TTI tick to RRM */
1592 * @brief TTI indication from MAC to RGR user.
1596 * Function : PtUiRgrTtiInd
1598 * @param[in] Pst* pst
1599 * @param[in] SuId suId
1600 * @param[in] RgrTtiIndInfo *ttiInd
1605 PUBLIC S16 PtUiRgrTtiInd
1609 RgrTtiIndInfo *ttiInd
1612 PUBLIC S16 PtUiRgrTtiInd(pst, suId, ttiInd)
1615 RgrTtiIndInfo *ttiInd;
1619 TRC3(PtUiRgrTtiInd);
1632 * @brief Configuration Confirm from MAC to RRM
1636 * Function : PtUiRgrCfgCfm
1638 * @param[in] Pst* pst
1639 * @param[in] SuId suId
1640 * @param[in] RgrCfgTransId transId
1641 * @param[in] U8 status
1646 PUBLIC S16 PtUiRgrCfgCfm
1650 RgrCfgTransId transId,
1654 PUBLIC S16 PtUiRgrCfgCfm(pst, suId, transId, status)
1657 RgrCfgTransId transId;
1662 TRC3(PtUiRgrCfgCfm);
1673 /* Added for SI Enhancement*/
1676 * @brief SI Configuration Confirm from MAC to RRM
1680 * Function : PtUiRgrSiCfgCfm
1682 * @param[in] Pst* pst
1683 * @param[in] SuId suId
1684 * @param[in] RgrCfgTransId transId
1685 * @param[in] U8 status
1690 PUBLIC S16 PtUiRgrSiCfgCfm
1694 RgrCfgTransId transId,
1698 PUBLIC S16 PtUiRgrSiCfgCfm(pst, suId, transId, status)
1701 RgrCfgTransId transId;
1706 TRC3(PtUiRgrSiCfgCfm);
1718 * @brief Warning SI Configuration Confirm from MAC to RRM
1722 * Function : PtUiRgrWarningSiCfgCfm
1724 * @param[in] Pst* pst
1725 * @param[in] SuId suId
1726 * @param[in] RgrCfgTransId transId
1727 * @param[in] U8 siId
1728 * @param[in] U8 status
1733 PUBLIC S16 PtUiRgrWarningSiCfgCfm
1737 RgrCfgTransId transId,
1742 PUBLIC S16 PtUiRgrWarningSiCfgCfm(pst, suId, transId, siId, status)
1745 RgrCfgTransId transId;
1750 TRC3(PtUiRgrWarningSiCfgCfm);
1760 #endif/* RGR_SI_SCH */
1763 /* ccpu00117452 - MOD - Changed macro name from
1764 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1767 * @brief STA indication from MAC to RGR user.
1771 * Function : PtUiRgrStaInd
1773 * @param[in] Pst* pst
1774 * @param[in] SuId suId
1775 * @param[in] RgrStaIndInfo *staInd
1780 PUBLIC S16 PtUiRgrStaInd
1784 RgrStaIndInfo *staInd
1787 PUBLIC S16 PtUiRgrStaInd(pst, suId, staInd)
1790 RgrStaIndInfo *staInd;
1794 TRC3(PtUiRgrStaInd);
1803 #endif /* End of RGR_CQI_REPT */
1804 /* LTE_ADV_FLAG_REMOVED_START */
1806 * @brief LOAD INF indication from MAC to RGR user.
1810 * Function : PtUiRgrLoadInfInd
1812 * @param[in] Pst* pst
1813 * @param[in] SuId suId
1814 * @param[in] RgrLoadInfIndInfo *loadInfInd
1819 PUBLIC S16 PtUiRgrLoadInfInd
1823 RgrLoadInfIndInfo *loadInfInd
1826 PUBLIC S16 PtUiRgrLoadInfInd(pst, suId, loadInfInd)
1829 RgrLoadInfIndInfo *loadInfInd;
1833 TRC3(PtUiRgrLoadInfInd);
1842 /* LTE_ADV_FLAG_REMOVED_END */
1845 * @brief STA indication from MAC to RGR user.
1849 * Function : PtUiRgrUeStaInd
1851 * @param[in] Pst* pst
1852 * @param[in] SuId suId
1853 * @param[in] RgrUeStaIndInfo *ueStaInd
1858 PUBLIC S16 PtUiRgrUeStaInd
1862 RgrUeStaIndInfo *ueStaInd
1865 PUBLIC S16 PtUiRgrUeStaInd(pst, suId, ueStaInd)
1868 RgrUeStaIndInfo *ueStaInd;
1872 TRC3(PtUiRgrUeStaInd);
1881 #endif /*--ifdef PTRGUIRGR--*/
1886 * @brief Confirmation from MAC to RRM for the bind/Unbind
1887 * request for the interface saps via RGM interface
1891 * Function : PtUiRgmBndCfm
1893 * @param[in] Pst* pst
1894 * @param[in] SuId suId
1895 * @param[in] U8 status
1900 PUBLIC S16 PtUiRgmBndCfm
1907 PUBLIC S16 PtUiRgmBndCfm(pst, suId, status)
1914 TRC3(PtUiRgmBndCfm);
1925 * @brief Average PRB indication from MAC to RRM
1929 * Function : PtUiRgmPrbRprtInd
1931 * @param[in] Pst* pst
1932 * @param[in] SuId suId
1933 * @param[in] RgrUeStaIndInfo *ueStaInd
1938 PUBLIC S16 PtUiRgmPrbRprtInd
1942 RgmPrbRprtInd *prbRprtInd
1945 PUBLIC S16 PtUiRgmPrbRprtInd(pst, suId, prbRprtInd)
1948 RgmPrbRprtInd *prbRprtInd;
1952 TRC3(PtUiRgmPrbRprtInd);
1963 * @brief Transmission Mode Change indication from MAC to RRM
1967 * Function : PtUiRgmTransModeInd
1969 * @param[in] Pst* pst
1970 * @param[in] SuId suId
1971 * @param[in] RgmTransModeInd *transModeInd
1976 PUBLIC S16 PtUiRgmTransModeInd
1980 RgmTransModeInd *transModeInd
1983 PUBLIC S16 PtUiRgmTransModeInd(pst, suId, transModeInd)
1986 RgmTransModeInd *transModeInd;
1990 TRC3(PtUiRgmTransModeInd);
1994 UNUSED(transModeInd);
2002 * @brief Average PRB indication from MAC to RRM
2006 * Function : RgUiRgmSendPrbRprtInd
2008 * @param[in] Pst* pst
2009 * @param[in] SuId suId
2010 * @param[in] RgmPrbRprtInd prbRprtInd
2015 PUBLIC S16 RgUiRgmSendPrbRprtInd
2019 RgmPrbRprtInd *prbRprtInd
2022 PUBLIC S16 RgUiRgmSendPrbRprtInd(pst, suId, prbRprtInd)
2025 RgmPrbRprtInd *prbRprtInd;
2029 TRC2(RgUiRgmSendPrbRprtInd);
2030 RETVALUE((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
2034 * @brief Transmission Mode change indication from MAC to RRM
2038 * Function : RgUiRgmChangeTransModeInd
2040 * @param[in] Pst* pst
2041 * @param[in] SuId suId
2042 * @param[in] RgmTransModeInd transModeInd
2047 PUBLIC S16 RgUiRgmChangeTransModeInd
2051 RgmTransModeInd *transModeInd
2054 PUBLIC S16 RgUiRgmChangeTransModeInd(pst, suId, transModeInd)
2057 RgmTransModeInd *transModeInd;
2061 TRC2(RgUiRgmChangeTransModeInd);
2062 RETVALUE((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
2065 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
2066 PRIVATE S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
2070 RguDedDatInd1 *rguDatIndl = NULLP;
2071 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2072 rguDatIndl = (RguDedDatInd1 *) elem;
2075 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
2077 for(i = 0; i< datInd->numLch; i++)
2079 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
2081 if(datInd->lchData[i].pdu.mBuf[j])
2083 SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
2087 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
2092 rguDatIndl->msg = datInd;
2093 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2094 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
2099 #ifdef RLC_MAC_DAT_REQ_RBUF
2101 PUBLIC S16 rgDlDatReqBatchProc
2106 PUBLIC S16 rgDlDatReqBatchProc()
2110 /* Read from Ring Buffer and process PDCP packets */
2112 U8 rngBufDeqIndx = 0;
2113 PRIVATE Pst rgDDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
2114 PRIVATE Pst rgCDatRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
2115 Void *elmIndx = NULLP;
2116 RguInfoRingElem *datReqRing=NULLP;
2117 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2118 while(NULLP != elmIndx)
2120 datReqRing= (RguInfoRingElem *)elmIndx;
2121 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;;//Number of pkt processed in tti
2124 if(datReqRing->event == EVTRGUDDATREQ)
2126 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2130 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
2131 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2136 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2137 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2138 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2141 if(datReqRing->event == EVTRGUDDATREQ)
2142 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2144 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2147 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2148 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2151 datReqRing->msg=NULLP;
2152 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2153 datReqRing->event=0;
2158 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
2161 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
2169 #ifdef RLC_MAC_STA_RSP_RBUF
2171 PUBLIC S16 rgDlStaRspBatchProc
2176 PUBLIC S16 rgDlStaRspBatchProc()
2180 /* Read from Ring Buffer and process PDCP packets */
2182 U8 rngBufDeqIndx = 0;
2183 PRIVATE Pst rgDStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
2184 PRIVATE Pst rgCStaRbfuPst ={1,1,ENTRG,0,ENTKW,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
2185 Void *elmIndx = NULLP;
2186 RguInfoRingElem *staRspRing=NULLP;
2188 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2189 while(NULLP != elmIndx)
2191 staRspRing= (RguInfoRingElem *)elmIndx;
2192 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;;//Number of pkt processed in tti
2194 if(staRspRing->msg!= NULLP)
2196 if( staRspRing->event == EVTRGUDSTARSP)
2198 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2202 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2207 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2208 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2209 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2210 if(staRspRing->msg!= NULLP)
2212 if( staRspRing->event == EVTRGUDSTARSP)
2213 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2215 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2218 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2219 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2222 staRspRing->msg=NULLP;
2223 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2224 staRspRing->event =0;
2230 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
2233 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
2241 #ifdef MAC_RLC_HARQ_STA_RBUF
2243 PUBLIC S16 RgUiRguHqStaIndRbuf
2247 RguHarqStatusInd *harqStatusInd
2250 PUBLIC S16 RgUiRguHqStaIndRbuf(pst, suId, harqStatusInd)
2253 RguHarqStatusInd *harqStatusInd;
2258 RguHarqStaInd *harqStaInd = NULLP;
2259 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
2260 harqStaInd = (RguHarqStaInd*) elem;
2263 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
2268 cmMemcpy((U8 *)&(harqStaInd->hqStatusInd), (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
2269 cmMemcpy((U8 *)&(harqStaInd->pst), (U8 *)pst, sizeof(Pst));
2270 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
2271 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
2279 /**********************************************************************
2282 **********************************************************************/