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 "common_def.h"
38 #include "rg_env.h" /* MAC Environment Defines */
39 #include "crg.h" /* CRG Interface defines */
40 #include "rgr.h" /* RGR Interface defines */
41 #include "rgu.h" /* RGU Interface defines */
42 #include "rgm.h" /* RGM Interface defines*/
44 /* header/extern include files (.x) */
45 #include "crg.x" /* CRG Interface includes */
46 #include "rgr.x" /* RGR Interface includes */
47 #include "rgu.x" /* RGU Interface includes */
48 #include "rgm.x" /* RGM Interface includes*/
54 #endif /* __cplusplus */
56 #if !(defined(LCRGUIRGU) && defined(LWLCRGUIRGU) && defined(KW))
60 #if !(defined(LCRGUICRG) && defined(NH))
64 #if !(defined(LCRGUIRGR) && defined(NX))
68 #if !(defined(LCRGUIRGM) && defined(RM))
72 /* MAX Number of Service Users of RG */
73 #define RG_MAX_RGU_USR 3
75 /* MAX Number of Service Users of RG */
76 #define RG_MAX_CRG_USR 2
78 /* MAX Number of Service Users of RG */
79 #define RG_MAX_RGR_USR 2
81 /* MAX Number of Service Users of RG */
82 #define RG_MAX_RGM_USR 2
84 /** @brief Confirmation from MAC to RLC for the bind/Unbind
85 * request for the interface saps */
86 EXTERN S16 PtUiRguBndCfm ARGS((Pst* pst, SuId suId, U8 status));
87 /** @brief Data Indication from MAC to RLC to
88 * forward the data received for common channels*/
89 EXTERN S16 PtUiRguCDatInd ARGS((Pst* pst, SuId suId, RguCDatIndInfo * datInd));
90 /** @brief Data Indication from MAC to RLC to
91 * forward the data received for dedicated channels*/
92 EXTERN S16 PtUiRguDDatInd ARGS((Pst* pst, SuId suId, RguDDatIndInfo * datInd));
93 /** @brief Status Indication from MAC to RLC
94 * as a response to the staRsp primitive from RLC.
95 * Informs RLC of the totalBufferSize and Timing Info
96 * for the transmission on common channels. */
97 EXTERN S16 PtUiRguCStaInd ARGS((Pst* pst, SuId suId, RguCStaIndInfo * staInd));
98 /** @brief Status Indication from MAC to RLC
99 * as a response to the staRsp primitive from RLC.
100 * Informs RLC of the totalBufferSize and Timing Info
101 * for the transmission on dedicated channels. */
102 EXTERN S16 PtUiRguDStaInd ARGS((Pst* pst, SuId suId, RguDStaIndInfo * staInd));
104 /**@brief HARQ Status Indication from MAC to RLC */
105 EXTERN S16 PtUiRguHqStaInd ARGS((Pst* pst,SuId suId,
106 RguHarqStatusInd *harqStatusInd));
108 /**@brief PDB FLow Control Indication from MAC to RLC */
109 EXTERN S16 PtUiRguFlowCntrlInd ARGS((Pst* pst,SuId suId,
110 RguFlowCntrlInd *flowCntrlInd));
111 #endif /*--#ifdef PTRGUIRGU--*/
112 S16 RgUiRguFlowCntrlInd(Pst* pst, SuId suId, RguFlowCntrlInd *flowCntrlInd);
114 #ifdef MAC_RLC_HARQ_STA_RBUF
115 S16 RgUiRguHqStaIndRbuf ARGS((Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd));
119 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
120 PRIVATE S16 RgUiRguDDatIndRbuf ARGS((RguDDatIndInfo *datInd));
122 EXTERN Void rgFreeSharableSBuf ARGS((Data **data, Size size));
125 EXTERN S16 PtUiRgrStaInd ARGS(( Pst* pst, SuId suId, RgrStaIndInfo *staInd));
127 /* LTE_ADV_FLAG_REMOVED_START */
128 EXTERN S16 PtUiRgrLoadInfInd ARGS(( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd));
129 /* LTE_ADV_FLAG_REMOVED_END */
130 EXTERN S16 PtUiRgrUeStaInd ARGS
134 RgrUeStaIndInfo *staInd
137 /** @brief Confirmation from MAC to RRC for the bind/Unbind
138 * request for the interface saps */
139 EXTERN S16 PtUiCrgBndCfm ARGS((Pst* pst, SuId suId, U8 status));
140 /** @brief Configuration Confirm from MAC to RRC */
141 EXTERN S16 PtUiCrgCfgCfm ARGS((Pst* pst, SuId suId, CrgCfgTransId transId, U8 status));
142 #endif /*--#ifdef PTRGUICRG--*/
145 /** @brief Confirmation from MAC to RRM for the bind/Unbind
146 * request for the interface saps */
147 EXTERN S16 PtUiRgrBndCfm ARGS((Pst* pst, SuId suId, U8 status));
148 /** @brief Configuration Confirm from MAC to RRM */
149 EXTERN S16 PtUiRgrCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, U8 status));
150 EXTERN S16 PtUiRgrTtiInd ARGS((Pst* pst, SuId suId, RgrTtiIndInfo *ttiInd));
151 /* Added for SI Enhancement*/
153 EXTERN S16 PtUiRgrSiCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, U8 status));
154 EXTERN S16 PtUiRgrWarningSiCfgCfm ARGS((Pst* pst, SuId suId,
155 RgrCfgTransId transId, U8 siId, U8 status));
157 #endif /*--#ifdef PTRGUIRGR--*/
160 S16 PtUiRgmPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
161 S16 PtUiRgmBndCfm ARGS((Pst* pst, SuId suId, U8 status));
162 S16 PtUiRgmTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
164 S16 RgUiRgmSendPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
165 S16 RgUiRgmChangeTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
167 S16 RgUiRguFlowCntrlInd ARGS((Pst* pst, SuId suId, RguFlowCntrlInd *flowCntrlInd));
168 /* Added for sending TTI tick to RRM */
169 /** @brief TTI indication from MAC to RRM */
170 PRIVATE CONSTANT RgrTtiInd RgUiRgrTtiIndMt[RG_MAX_RGR_USR] =
185 /** @brief Confirmation from MAC to RRM for the bind/Unbind
186 * request for the interface saps */
187 PRIVATE CONSTANT RgrBndCfm RgUiRgrBndCfmMt[RG_MAX_RGR_USR] =
201 /** @brief Confirmation from MAC to RRM for the bind/Unbind
202 * request for the interface saps via RGM interface*/
203 PRIVATE CONSTANT RgmBndCfm RgUiRgmBndCfmMt[RG_MAX_RGM_USR] =
211 RmLiRgmBndCfm, /*To be added by RRM*/
218 /** @brief Configuration Confirm from MAC to RRM */
219 PRIVATE CONSTANT RgrCfgCfm RgUiRgrCfgCfmMt[RG_MAX_RGR_USR] =
231 /* Added for SI Enhancement*/
233 /** @brief SI Configuration Confirm from MAC to RRM */
234 PRIVATE CONSTANT RgrSiCfgCfm RgUiRgrSiCfgCfmMt[RG_MAX_RGR_USR] =
249 /** @brief Warning SI Configuration Confirm from MAC to RRM */
250 PRIVATE CONSTANT RgrWarningSiCfgCfm RgUiRgrWarningSiCfgCfmMt[RG_MAX_RGR_USR] =
253 cmPkRgrWarningSiCfgCfm,
255 PtUiRgrWarningSiCfgCfm,
258 NxLiRgrWarningSiCfgCfm,
260 PtUiRgrWarningSiCfgCfm,
264 #endif/*RGR_SI_SCH */
265 /** @brief Confirmation from MAC to RRC for the bind/Unbind
266 * request for the interface saps */
267 PRIVATE CONSTANT CrgBndCfm RgUiCrgBndCfmMt[RG_MAX_CRG_USR] =
281 /** @brief Configuration Confirm from MAC to RRC */
282 PRIVATE CONSTANT CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
297 /** @brief Confirmation from MAC to RLC for the bind/Unbind
298 * request for the interface saps */
299 PRIVATE CONSTANT RguBndCfm RgUiRguBndCfmMt[RG_MAX_RGU_USR] =
318 /** @brief Data Indication from MAC to RLC to
319 * forward the data received for common channels*/
320 PRIVATE CONSTANT RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
323 // cmPkRguCDatInd, /* TODO : Call packRcvdUlData instead */
333 // cmPkRguCDatInd, /* TODO:Call packRcvdUlData instead */
339 /** @brief Data Indication from MAC to RLC to
340 * forward the data received for dedicated channels*/
341 PRIVATE CONSTANT RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
344 // cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
354 // cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
360 /** @brief Status Indication from MAC to RLC
361 * as a response to the staRsp primitive from RLC.
362 * Informs RLC of the totalBufferSize and Timing Info
363 * for the transmission on common channels. */
364 PRIVATE CONSTANT RguCStaInd RgUiRguCStaIndMt[RG_MAX_RGU_USR] =
367 //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
372 //RlcMacProcSchedRep,
377 //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
383 /** @brief Status Indication from MAC to RLC
384 * as a response to the staRsp primitive from RLC.
385 * Informs RLC of the totalBufferSize and Timing Info
386 * for the transmission on dedicated channels. */
387 PRIVATE CONSTANT RguDStaInd RgUiRguDStaIndMt[RG_MAX_RGU_USR] =
390 //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
395 //RlcMacProcSchedRep,
400 //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
407 /** @brief HARQ Status Indication from MAC to RLC
408 * as a response to the DdatReq primitive from RLC.
409 * Informs RLC of the successful transmission of TB's
410 * (ACK/NACK) along with Mapping Info. */
411 PRIVATE CONSTANT RguHqStaInd RgUiRguHqStaIndMt[RG_MAX_RGU_USR] =
429 #endif /* LTE_L2_MEAS */
431 /* ccpu00117452 - MOD - Changed macro name from
432 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
434 /** @brief TTI indication from MAC to RRM */
435 PRIVATE CONSTANT RgrStaInd RgUiRgrStaIndMt[RG_MAX_RGR_USR] =
448 #endif /* RGR_CQI_REPT */
450 /* LTE_ADV_FLAG_REMOVED_START */
451 /** @brief LOAD INF indication from MAC to RRM */
452 PRIVATE CONSTANT RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
465 /* LTE_ADV_FLAG_REMOVED_END */
467 /** @brief TTI indication from MAC to RRM */
468 PRIVATE CONSTANT RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
482 /** @brief Average PRB usage indication from MAC to RRM */
483 PRIVATE CONSTANT RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
498 /** @brief Transmission Mode Change indication from MAC to RRM */
499 PRIVATE CONSTANT RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
513 PRIVATE CONSTANT RguFlowCntrlIndInfo RgUiRguFlowCntrlIndMt[RG_MAX_RGU_USR] =
521 RlcLiRguFlowCntrlInd,
533 #endif /* __cplusplus */
538 * @brief Confirmation from MAC to RRM for the bind/Unbind
539 * request for the interface saps
543 * Function : RgUiRgrBndCfm
545 * @param[in] Pst* pst
546 * @param[in] SuId suId
547 * @param[in] U8 status
559 S16 RgUiRgrBndCfm(pst, suId, status)
568 return ((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
572 * @brief Confirmation from MAC to RRM for the bind/Unbind
573 * request for the interface saps via RGM interface
577 * Function : RgUiRgmBndCfm
579 * @param[in] Pst* pst
580 * @param[in] SuId suId
581 * @param[in] U8 status
593 S16 RgUiRgmBndCfm(pst, suId, status)
602 return ((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
608 /* Added for sending TTI tick to RRM */
611 * @brief TTI indication from MAC to RGR user.
615 * Function : RgUiRgrTtiInd
617 * @param[in] Pst* pst
618 * @param[in] SuId suId
619 * @param[in] RgrTtiIndInfo ttiInd
628 RgrTtiIndInfo *ttiInd
631 S16 RgUiRgrTtiInd(pst, suId, ttiInd)
634 RgrTtiIndInfo *ttiInd;
640 return ((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
647 * @brief Configuration Confirm from MAC to RRM
651 * Function : RgUiRgrCfgCfm
653 * @param[in] Pst* pst
654 * @param[in] SuId suId
655 * @param[in] RgrCfgTransId transId
656 * @param[in] U8 status
664 RgrCfgTransId transId,
668 S16 RgUiRgrCfgCfm(pst, transId, status)
670 RgrCfgTransId transId;
677 return ((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
683 * @brief Confirmation from MAC to RRC for the bind/Unbind
684 * request for the interface saps
688 * Function : RgUiCrgBndCfm
690 * @param[in] Pst* pst
691 * @param[in] SuId suId
692 * @param[in] U8 status
704 S16 RgUiCrgBndCfm(pst, suId, status)
713 return ((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
720 * @brief Configuration Confirm from MAC to RRC
724 * Function : RgUiCrgCfgCfm
726 * @param[in] Pst* pst
727 * @param[in] SuId suId
728 * @param[in] CrgCfgTransId transId
729 * @param[in] U8 status
738 CrgCfgTransId transId,
742 S16 RgUiCrgCfgCfm(pst, suId, transId, status)
745 CrgCfgTransId transId;
752 return ((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
758 * @brief Confirmation from MAC to RLC for the bind/Unbind
759 * request for the interface saps
763 * Function : RgUiRguBndCfm
765 * @param[in] Pst* pst
766 * @param[in] SuId suId
767 * @param[in] U8 status
779 S16 RgUiRguBndCfm(pst, suId, status)
788 return ((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
797 * @brief Data Indication from MAC to RLC to
798 * forward the data received for common channels
802 * Function : RgUiRguCDatInd
804 * @param[in] Pst* pst
805 * @param[in] SuId suId
806 * @param[in] RguCDatIndInfo * datInd
815 RguCDatIndInfo * datInd
818 S16 RgUiRguCDatInd(pst, suId, datInd)
821 RguCDatIndInfo * datInd;
826 TRC3(RgUiRguCDatInd);
828 return ((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
834 * @brief Data Indication from MAC to RLC to
835 * forward the data received for dedicated channels
839 * Function : RgUiRguDDatInd
841 * @param[in] Pst* pst
842 * @param[in] SuId suId
843 * @param[in] RguDDatIndInfo * datInd
852 RguDDatIndInfo * datInd
855 S16 RgUiRguDDatInd(pst, suId, datInd)
858 RguDDatIndInfo * datInd;
863 TRC3(RgUiRguDDatInd);
865 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
866 return (RgUiRguDDatIndRbuf(datInd));
868 return ((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
875 * @brief Status Indication from MAC to RLC
876 * as a response to the staRsp primitive from RLC.
877 * Informs RLC of the totalBufferSize and Timing Info
878 * for the transmission on common channels.
882 * Function : RgUiRguCStaInd
884 * @param[in] Pst* pst
885 * @param[in] SuId suId
886 * @param[in] RguCStaIndInfo * staInd
895 RguCStaIndInfo * staInd
898 S16 RgUiRguCStaInd(pst, suId, staInd)
901 RguCStaIndInfo * staInd;
905 TRC3(RgUiRguCStaInd);
907 return ((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
914 * @brief Status Indication from MAC to RLC
915 * as a response to the staRsp primitive from RLC.
916 * Informs RLC of the totalBufferSize and Timing Info
917 * for the transmission on dedicated channels.
921 * Function : RgUiRguDStaInd
923 * @param[in] Pst* pst
924 * @param[in] SuId suId
925 * @param[in] RguDStaIndInfo * staInd
934 RguDStaIndInfo * staInd
937 S16 RgUiRguDStaInd(pst, suId, staInd)
940 RguDStaIndInfo * staInd;
944 TRC3(RgUiRguDStaInd);
946 return ((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
950 /* TODO: Function header */
956 RguHarqStatusInd *harqStatusInd
959 S16 RgUiRguHqStaInd(pst, suId, harqStatusInd)
962 RguHarqStatusInd *harqStatusInd;
966 TRC3(RgUiRguHqStaInd);
967 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
969 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
972 return ((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
975 } /* RgUiRguHqStaInd */
976 #endif /* LTE_L2_MEAS */
979 S16 RgUiRguFlowCntrlInd
983 RguFlowCntrlInd *flowCntrlInd
986 S16 RgUiRguFlowCntrlInd(pst, suId, harqStatusInd)
989 RguFlowCntrlInd *flowCntrlInd;
992 return ((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
994 /* Added for SI Enhancement*/
997 * @brief SI Configuration Confirm from MAC to RRM
1001 * Function : RgUiRgrSiCfgCfm
1003 * @param[in] Pst* pst
1004 * @param[in] SuId suId
1005 * @param[in] RgrCfgTransId transId
1006 * @param[in] U8 status
1015 RgrCfgTransId transId,
1019 S16 RgUiRgrSiCfgCfm(pst, suId, transId, status)
1022 RgrCfgTransId transId;
1027 TRC3(RgUiRgrSiCfgCfm);
1029 return ((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
1034 * @brief Warning SI Configuration Confirm from MAC to RRM
1038 * Function : RgUiRgrWarningSiCfgCfm
1040 * @param[in] Pst* pst
1041 * @param[in] SuId suId
1042 * @param[in] RgrCfgTransId transId
1043 * @param[in] U8 siId
1044 * @param[in] U8 status
1049 S16 RgUiRgrWarningSiCfgCfm
1053 RgrCfgTransId transId,
1058 S16 RgUiRgrWarningSiCfgCfm(pst, suId, transId, siId,status)
1061 RgrCfgTransId transId;
1066 TRC3(RgUiRgrWarningSiCfgCfm);
1068 return ((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
1069 (pst, suId, transId, siId, status));
1072 #endif/*RGR_SI_SCH*/
1075 /* ccpu00117452 - MOD - Changed macro name from
1076 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1079 * @brief STA indication from MAC to RGR user.
1083 * Function : RgUiRgrStaInd
1085 * @param[in] Pst* pst
1086 * @param[in] SuId suId
1087 * @param[in] RgrStaIndInfo *staInd
1096 RgrStaIndInfo *staInd
1099 S16 RgUiRgrStaInd(pst, suId, staInd)
1102 RgrStaIndInfo *staInd;
1106 TRC3(RgUiRgrStaInd);
1108 return ((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
1111 #endif /* End of RGR_CQI_REPT */
1113 /* LTE_ADV_FLAG_REMOVED_START */
1115 * @brief LOAD INF indication from MAC to RGR user.
1119 * Function : RgUiRgrLoadInfInd
1121 * @param[in] Pst* pst
1122 * @param[in] SuId suId
1123 * @param[in] RgrLoadInfIndInfo *loadInfInd
1128 S16 RgUiRgrLoadInfInd
1132 RgrLoadInfIndInfo *loadInfInd
1135 S16 RgUiRgrLoadInfInd(pst, suId, loadInfInd)
1138 RgrLoadInfIndInfo *loadInfInd;
1142 TRC3(RgUiRgrLoadInfInd);
1144 return ((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
1147 /* LTE_ADV_FLAG_REMOVED_END */
1150 * @brief UESTA indication from MAC to RGR user.
1154 * Function : RgUiRgrUeStaInd
1156 * @param[in] Pst* pst
1157 * @param[in] SuId suId
1158 * @param[in] RgrStaIndInfo *staInd
1167 RgrUeStaIndInfo *ueStaInd
1170 S16 RgUiRgrUeStaInd(pst, suId, ueStaInd)
1173 RgrUeStaIndInfo *ueStaInd;
1177 TRC3(RgUiRgrUeStaInd);
1179 return ((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
1182 #endif /*--ifdef RG--*/
1187 * @brief Confirmation from MAC to RRC for the bind/Unbind
1188 * request for the interface saps
1192 * Function : PtUiCrgBndCfm
1194 * @param[in] Pst* pst
1195 * @param[in] SuId suId
1196 * @param[in] U8 status
1208 S16 PtUiCrgBndCfm(pst, suId, status)
1215 TRC3(PtUiCrgBndCfm);
1228 * @brief Configuration Confirm from MAC to RRC
1232 * Function : PtUiCrgCfgCfm
1234 * @param[in] Pst* pst
1235 * @param[in] SuId suId
1236 * @param[in] CrgCfgTransId transId
1237 * @param[in] U8 status
1246 CrgCfgTransId transId,
1250 S16 PtUiCrgCfgCfm(pst, suId, transId, status)
1253 CrgCfgTransId transId;
1258 TRC3(PtUiCrgCfgCfm);
1268 #endif /*--ifdef PTRGUICRG--*/
1273 * @brief Confirmation from MAC to RLC for the bind/Unbind
1274 * request for the interface saps
1278 * Function : PtUiRguBndCfm
1280 * @param[in] Pst* pst
1281 * @param[in] SuId suId
1282 * @param[in] U8 status
1294 S16 PtUiRguBndCfm(pst, suId, status)
1301 TRC3(PtUiRguBndCfm);
1314 * @brief Data Indication from MAC to RLC to
1315 * forward the data received for common channels
1319 * Function : PtUiRguCDatInd
1321 * @param[in] Pst* pst
1322 * @param[in] SuId suId
1323 * @param[in] RguCDatIndInfo * datInd
1332 RguCDatIndInfo * datInd
1335 S16 PtUiRguCDatInd(pst, suId, datInd)
1338 RguCDatIndInfo * datInd;
1342 TRC3(PtUiRguCDatInd);
1355 * @brief Data Indication from MAC to RLC to
1356 * forward the data received for dedicated channels
1360 * Function : PtUiRguDDatInd
1362 * @param[in] Pst* pst
1363 * @param[in] SuId suId
1364 * @param[in] RguDDatIndInfo * datInd
1373 RguDDatIndInfo * datInd
1376 S16 PtUiRguDDatInd(pst, suId, datInd)
1379 RguDDatIndInfo * datInd;
1383 TRC3(PtUiRguDDatInd);
1396 * @brief Status Indication from MAC to RLC
1397 * as a response to the staRsp primitive from RLC.
1398 * Informs RLC of the totalBufferSize and Timing Info
1399 * for the transmission on common channels.
1403 * Function : PtUiRguCStaInd
1405 * @param[in] Pst* pst
1406 * @param[in] SuId suId
1407 * @param[in] RguCStaIndInfo * staInd
1416 RguCStaIndInfo * staInd
1419 S16 PtUiRguCStaInd(pst, suId, staInd)
1422 RguCStaIndInfo * staInd;
1426 TRC3(PtUiRguCStaInd);
1439 * @brief Status Indication from MAC to RLC
1440 * as a response to the staRsp primitive from RLC.
1441 * Informs RLC of the totalBufferSize and Timing Info
1442 * for the transmission on dedicated channels.
1446 * Function : PtUiRguDStaInd
1448 * @param[in] Pst* pst
1449 * @param[in] SuId suId
1450 * @param[in] RguDStaIndInfo * staInd
1459 RguDStaIndInfo * staInd
1462 S16 PtUiRguDStaInd(pst, suId, staInd)
1465 RguDStaIndInfo * staInd;
1469 TRC3(PtUiRguDStaInd);
1479 /* TODO: Function Header */
1485 RguHarqStatusInd *harqStatusInd
1488 S16 PtUiRguHqStaInd(pst, suId, harqStatusInd)
1491 RguHarqStatusInd *harqStatusInd;
1495 TRC3(PtUiRguHqStaInd);
1499 UNUSED(harqStatusInd);
1504 #endif /* LTE_L2_MEAS */
1507 S16 PtUiRguFlowCntrlInd
1511 RguFlowCntrlInd *flowCntrlInd
1514 S16 PtUiRguFlowCntrlInd(pst, suId, flowCntrlInd)
1517 RguHarqStatusInd *flowCntrlInd;
1521 TRC3(PtUiRguFlowCntrlInd);
1525 UNUSED(flowCntrlInd);
1531 #endif /*--ifdef PTRGUIRGU--*/
1536 * @brief Confirmation from MAC to RRM for the bind/Unbind
1537 * request for the interface saps
1541 * Function : PtUiRgrBndCfm
1543 * @param[in] Pst* pst
1544 * @param[in] SuId suId
1545 * @param[in] U8 status
1557 S16 PtUiRgrBndCfm(pst, suId, status)
1564 TRC3(PtUiRgrBndCfm);
1574 /* Added for sending TTI tick to RRM */
1577 * @brief TTI indication from MAC to RGR user.
1581 * Function : PtUiRgrTtiInd
1583 * @param[in] Pst* pst
1584 * @param[in] SuId suId
1585 * @param[in] RgrTtiIndInfo *ttiInd
1594 RgrTtiIndInfo *ttiInd
1597 S16 PtUiRgrTtiInd(pst, suId, ttiInd)
1600 RgrTtiIndInfo *ttiInd;
1604 TRC3(PtUiRgrTtiInd);
1617 * @brief Configuration Confirm from MAC to RRM
1621 * Function : PtUiRgrCfgCfm
1623 * @param[in] Pst* pst
1624 * @param[in] SuId suId
1625 * @param[in] RgrCfgTransId transId
1626 * @param[in] U8 status
1635 RgrCfgTransId transId,
1639 S16 PtUiRgrCfgCfm(pst, suId, transId, status)
1642 RgrCfgTransId transId;
1647 TRC3(PtUiRgrCfgCfm);
1658 /* Added for SI Enhancement*/
1661 * @brief SI Configuration Confirm from MAC to RRM
1665 * Function : PtUiRgrSiCfgCfm
1667 * @param[in] Pst* pst
1668 * @param[in] SuId suId
1669 * @param[in] RgrCfgTransId transId
1670 * @param[in] U8 status
1679 RgrCfgTransId transId,
1683 S16 PtUiRgrSiCfgCfm(pst, suId, transId, status)
1686 RgrCfgTransId transId;
1691 TRC3(PtUiRgrSiCfgCfm);
1703 * @brief Warning SI Configuration Confirm from MAC to RRM
1707 * Function : PtUiRgrWarningSiCfgCfm
1709 * @param[in] Pst* pst
1710 * @param[in] SuId suId
1711 * @param[in] RgrCfgTransId transId
1712 * @param[in] U8 siId
1713 * @param[in] U8 status
1718 S16 PtUiRgrWarningSiCfgCfm
1722 RgrCfgTransId transId,
1727 S16 PtUiRgrWarningSiCfgCfm(pst, suId, transId, siId, status)
1730 RgrCfgTransId transId;
1735 TRC3(PtUiRgrWarningSiCfgCfm);
1745 #endif/* RGR_SI_SCH */
1748 /* ccpu00117452 - MOD - Changed macro name from
1749 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1752 * @brief STA indication from MAC to RGR user.
1756 * Function : PtUiRgrStaInd
1758 * @param[in] Pst* pst
1759 * @param[in] SuId suId
1760 * @param[in] RgrStaIndInfo *staInd
1769 RgrStaIndInfo *staInd
1772 S16 PtUiRgrStaInd(pst, suId, staInd)
1775 RgrStaIndInfo *staInd;
1779 TRC3(PtUiRgrStaInd);
1788 #endif /* End of RGR_CQI_REPT */
1789 /* LTE_ADV_FLAG_REMOVED_START */
1791 * @brief LOAD INF indication from MAC to RGR user.
1795 * Function : PtUiRgrLoadInfInd
1797 * @param[in] Pst* pst
1798 * @param[in] SuId suId
1799 * @param[in] RgrLoadInfIndInfo *loadInfInd
1804 S16 PtUiRgrLoadInfInd
1808 RgrLoadInfIndInfo *loadInfInd
1811 S16 PtUiRgrLoadInfInd(pst, suId, loadInfInd)
1814 RgrLoadInfIndInfo *loadInfInd;
1818 TRC3(PtUiRgrLoadInfInd);
1827 /* LTE_ADV_FLAG_REMOVED_END */
1830 * @brief STA indication from MAC to RGR user.
1834 * Function : PtUiRgrUeStaInd
1836 * @param[in] Pst* pst
1837 * @param[in] SuId suId
1838 * @param[in] RgrUeStaIndInfo *ueStaInd
1847 RgrUeStaIndInfo *ueStaInd
1850 S16 PtUiRgrUeStaInd(pst, suId, ueStaInd)
1853 RgrUeStaIndInfo *ueStaInd;
1857 TRC3(PtUiRgrUeStaInd);
1866 #endif /*--ifdef PTRGUIRGR--*/
1871 * @brief Confirmation from MAC to RRM for the bind/Unbind
1872 * request for the interface saps via RGM interface
1876 * Function : PtUiRgmBndCfm
1878 * @param[in] Pst* pst
1879 * @param[in] SuId suId
1880 * @param[in] U8 status
1892 S16 PtUiRgmBndCfm(pst, suId, status)
1899 TRC3(PtUiRgmBndCfm);
1910 * @brief Average PRB indication from MAC to RRM
1914 * Function : PtUiRgmPrbRprtInd
1916 * @param[in] Pst* pst
1917 * @param[in] SuId suId
1918 * @param[in] RgrUeStaIndInfo *ueStaInd
1923 S16 PtUiRgmPrbRprtInd
1927 RgmPrbRprtInd *prbRprtInd
1930 S16 PtUiRgmPrbRprtInd(pst, suId, prbRprtInd)
1933 RgmPrbRprtInd *prbRprtInd;
1937 TRC3(PtUiRgmPrbRprtInd);
1948 * @brief Transmission Mode Change indication from MAC to RRM
1952 * Function : PtUiRgmTransModeInd
1954 * @param[in] Pst* pst
1955 * @param[in] SuId suId
1956 * @param[in] RgmTransModeInd *transModeInd
1961 S16 PtUiRgmTransModeInd
1965 RgmTransModeInd *transModeInd
1968 S16 PtUiRgmTransModeInd(pst, suId, transModeInd)
1971 RgmTransModeInd *transModeInd;
1975 TRC3(PtUiRgmTransModeInd);
1979 UNUSED(transModeInd);
1987 * @brief Average PRB indication from MAC to RRM
1991 * Function : RgUiRgmSendPrbRprtInd
1993 * @param[in] Pst* pst
1994 * @param[in] SuId suId
1995 * @param[in] RgmPrbRprtInd prbRprtInd
2000 S16 RgUiRgmSendPrbRprtInd
2004 RgmPrbRprtInd *prbRprtInd
2007 S16 RgUiRgmSendPrbRprtInd(pst, suId, prbRprtInd)
2010 RgmPrbRprtInd *prbRprtInd;
2014 TRC2(RgUiRgmSendPrbRprtInd);
2015 return ((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
2019 * @brief Transmission Mode change indication from MAC to RRM
2023 * Function : RgUiRgmChangeTransModeInd
2025 * @param[in] Pst* pst
2026 * @param[in] SuId suId
2027 * @param[in] RgmTransModeInd transModeInd
2032 S16 RgUiRgmChangeTransModeInd
2036 RgmTransModeInd *transModeInd
2039 S16 RgUiRgmChangeTransModeInd(pst, suId, transModeInd)
2042 RgmTransModeInd *transModeInd;
2046 TRC2(RgUiRgmChangeTransModeInd);
2047 return ((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
2050 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
2051 PRIVATE S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
2055 RguDedDatInd1 *rguDatIndl = NULLP;
2056 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2057 rguDatIndl = (RguDedDatInd1 *) elem;
2060 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
2062 for(i = 0; i< datInd->numLch; i++)
2064 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
2066 if(datInd->lchData[i].pdu.mBuf[j])
2068 SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
2072 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
2077 rguDatIndl->msg = datInd;
2078 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2079 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
2084 #ifdef RLC_MAC_DAT_REQ_RBUF
2086 S16 rgDlDatReqBatchProc
2091 S16 rgDlDatReqBatchProc()
2095 /* Read from Ring Buffer and process PDCP packets */
2097 U8 rngBufDeqIndx = 0;
2098 PRIVATE Pst rgDDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
2099 PRIVATE Pst rgCDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
2100 Void *elmIndx = NULLP;
2101 RguInfoRingElem *datReqRing=NULLP;
2102 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2103 while(NULLP != elmIndx)
2105 datReqRing= (RguInfoRingElem *)elmIndx;
2106 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;;//Number of pkt processed in tti
2109 if(datReqRing->event == EVTRGUDDATREQ)
2111 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2115 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
2116 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2121 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2122 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2123 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2126 if(datReqRing->event == EVTRGUDDATREQ)
2127 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2129 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2132 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2133 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2136 datReqRing->msg=NULLP;
2137 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2138 datReqRing->event=0;
2143 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
2146 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
2154 #ifdef RLC_MAC_STA_RSP_RBUF
2156 S16 rgDlStaRspBatchProc
2161 S16 rgDlStaRspBatchProc()
2165 /* Read from Ring Buffer and process PDCP packets */
2167 U8 rngBufDeqIndx = 0;
2168 PRIVATE Pst rgDStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
2169 PRIVATE Pst rgCStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
2170 Void *elmIndx = NULLP;
2171 RguInfoRingElem *staRspRing=NULLP;
2173 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2174 while(NULLP != elmIndx)
2176 staRspRing= (RguInfoRingElem *)elmIndx;
2177 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;;//Number of pkt processed in tti
2179 if(staRspRing->msg!= NULLP)
2181 if( staRspRing->event == EVTRGUDSTARSP)
2183 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2187 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2192 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2193 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2194 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2195 if(staRspRing->msg!= NULLP)
2197 if( staRspRing->event == EVTRGUDSTARSP)
2198 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2200 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2203 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2204 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2207 staRspRing->msg=NULLP;
2208 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2209 staRspRing->event =0;
2215 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
2218 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
2226 #ifdef MAC_RLC_HARQ_STA_RBUF
2228 S16 RgUiRguHqStaIndRbuf
2232 RguHarqStatusInd *harqStatusInd
2235 S16 RgUiRguHqStaIndRbuf(pst, suId, harqStatusInd)
2238 RguHarqStatusInd *harqStatusInd;
2243 RguHarqStaInd *harqStaInd = NULLP;
2244 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
2245 harqStaInd = (RguHarqStaInd*) elem;
2248 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
2253 cmMemcpy((U8 *)&(harqStaInd->hqStatusInd), (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
2254 cmMemcpy((U8 *)&(harqStaInd->pst), (U8 *)pst, sizeof(Pst));
2255 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
2256 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
2264 /**********************************************************************
2267 **********************************************************************/