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 S16 PtUiRguBndCfm ARGS((Pst* pst, SuId suId, uint8_t status));
87 /** @brief Data Indication from MAC to RLC to
88 * forward the data received for common channels*/
89 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 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 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 S16 PtUiRguDStaInd ARGS((Pst* pst, SuId suId, RguDStaIndInfo * staInd));
104 /**@brief HARQ Status Indication from MAC to RLC */
105 S16 PtUiRguHqStaInd ARGS((Pst* pst,SuId suId,
106 RguHarqStatusInd *harqStatusInd));
108 /**@brief PDB FLow Control Indication from MAC to RLC */
109 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 static S16 RgUiRguDDatIndRbuf ARGS((RguDDatIndInfo *datInd));
122 Void rgFreeSharableSBuf ARGS((Data **data, Size size));
125 S16 PtUiRgrStaInd ARGS(( Pst* pst, SuId suId, RgrStaIndInfo *staInd));
127 /* LTE_ADV_FLAG_REMOVED_START */
128 S16 PtUiRgrLoadInfInd ARGS(( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd));
129 /* LTE_ADV_FLAG_REMOVED_END */
130 S16 PtUiRgrUeStaInd ARGS
134 RgrUeStaIndInfo *staInd
137 /** @brief Confirmation from MAC to RRC for the bind/Unbind
138 * request for the interface saps */
139 S16 PtUiCrgBndCfm ARGS((Pst* pst, SuId suId, uint8_t status));
140 /** @brief Configuration Confirm from MAC to RRC */
141 S16 PtUiCrgCfgCfm ARGS((Pst* pst, SuId suId, CrgCfgTransId transId, uint8_t status));
142 #endif /*--#ifdef PTRGUICRG--*/
145 /** @brief Confirmation from MAC to RRM for the bind/Unbind
146 * request for the interface saps */
147 S16 PtUiRgrBndCfm ARGS((Pst* pst, SuId suId, uint8_t status));
148 /** @brief Configuration Confirm from MAC to RRM */
149 S16 PtUiRgrCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, uint8_t status));
150 S16 PtUiRgrTtiInd ARGS((Pst* pst, SuId suId, RgrTtiIndInfo *ttiInd));
151 /* Added for SI Enhancement*/
153 S16 PtUiRgrSiCfgCfm ARGS((Pst* pst, SuId suId, RgrCfgTransId transId, uint8_t status));
154 S16 PtUiRgrWarningSiCfgCfm ARGS((Pst* pst, SuId suId,
155 RgrCfgTransId transId, uint8_t siId, uint8_t status));
157 #endif /*--#ifdef PTRGUIRGR--*/
160 S16 PtUiRgmPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
161 S16 PtUiRgmBndCfm ARGS((Pst* pst, SuId suId, uint8_t 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 static const RgrTtiInd RgUiRgrTtiIndMt[RG_MAX_RGR_USR] =
185 /** @brief Confirmation from MAC to RRM for the bind/Unbind
186 * request for the interface saps */
187 static const 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 static const RgmBndCfm RgUiRgmBndCfmMt[RG_MAX_RGM_USR] =
211 RmLiRgmBndCfm, /*To be added by RRM*/
218 /** @brief Configuration Confirm from MAC to RRM */
219 static const RgrCfgCfm RgUiRgrCfgCfmMt[RG_MAX_RGR_USR] =
231 /* Added for SI Enhancement*/
233 /** @brief SI Configuration Confirm from MAC to RRM */
234 static const RgrSiCfgCfm RgUiRgrSiCfgCfmMt[RG_MAX_RGR_USR] =
249 /** @brief Warning SI Configuration Confirm from MAC to RRM */
250 static const 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 static const CrgBndCfm RgUiCrgBndCfmMt[RG_MAX_CRG_USR] =
281 /** @brief Configuration Confirm from MAC to RRC */
282 static const CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
297 /** @brief Confirmation from MAC to RLC for the bind/Unbind
298 * request for the interface saps */
299 static const RguBndCfm RgUiRguBndCfmMt[RG_MAX_RGU_USR] =
318 /** @brief Data Indication from MAC to RLC to
319 * forward the data received for common channels*/
320 static const RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
323 // cmPkRguCDatInd, /* TODO : Call packRcvdUlData instead */
328 //RlcProcCommLcUlData,
333 // cmPkRguCDatInd, /* TODO:Call packRcvdUlData instead */
339 /** @brief Data Indication from MAC to RLC to
340 * forward the data received for dedicated channels*/
341 static const RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
344 // cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
349 //RlcProcDedLcUlData,
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 static const 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 static const 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 static const 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 static const 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 static const RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
465 /* LTE_ADV_FLAG_REMOVED_END */
467 /** @brief TTI indication from MAC to RRM */
468 static const RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
482 /** @brief Average PRB usage indication from MAC to RRM */
483 static const RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
498 /** @brief Transmission Mode Change indication from MAC to RRM */
499 static const RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
513 static const 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] uint8_t status
559 S16 RgUiRgrBndCfm(pst, suId, status)
566 return ((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
570 * @brief Confirmation from MAC to RRM for the bind/Unbind
571 * request for the interface saps via RGM interface
575 * Function : RgUiRgmBndCfm
577 * @param[in] Pst* pst
578 * @param[in] SuId suId
579 * @param[in] uint8_t status
591 S16 RgUiRgmBndCfm(pst, suId, status)
598 return ((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
604 /* Added for sending TTI tick to RRM */
607 * @brief TTI indication from MAC to RGR user.
611 * Function : RgUiRgrTtiInd
613 * @param[in] Pst* pst
614 * @param[in] SuId suId
615 * @param[in] RgrTtiIndInfo ttiInd
624 RgrTtiIndInfo *ttiInd
627 S16 RgUiRgrTtiInd(pst, suId, ttiInd)
630 RgrTtiIndInfo *ttiInd;
634 return ((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
641 * @brief Configuration Confirm from MAC to RRM
645 * Function : RgUiRgrCfgCfm
647 * @param[in] Pst* pst
648 * @param[in] SuId suId
649 * @param[in] RgrCfgTransId transId
650 * @param[in] uint8_t status
658 RgrCfgTransId transId,
662 S16 RgUiRgrCfgCfm(pst, transId, status)
664 RgrCfgTransId transId;
669 return ((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
675 * @brief Confirmation from MAC to RRC for the bind/Unbind
676 * request for the interface saps
680 * Function : RgUiCrgBndCfm
682 * @param[in] Pst* pst
683 * @param[in] SuId suId
684 * @param[in] uint8_t status
696 S16 RgUiCrgBndCfm(pst, suId, status)
703 return ((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
710 * @brief Configuration Confirm from MAC to RRC
714 * Function : RgUiCrgCfgCfm
716 * @param[in] Pst* pst
717 * @param[in] SuId suId
718 * @param[in] CrgCfgTransId transId
719 * @param[in] uint8_t status
728 CrgCfgTransId transId,
732 S16 RgUiCrgCfgCfm(pst, suId, transId, status)
735 CrgCfgTransId transId;
740 return ((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
746 * @brief Confirmation from MAC to RLC for the bind/Unbind
747 * request for the interface saps
751 * Function : RgUiRguBndCfm
753 * @param[in] Pst* pst
754 * @param[in] SuId suId
755 * @param[in] uint8_t status
767 S16 RgUiRguBndCfm(pst, suId, status)
774 return ((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
783 * @brief Data Indication from MAC to RLC to
784 * forward the data received for common channels
788 * Function : RgUiRguCDatInd
790 * @param[in] Pst* pst
791 * @param[in] SuId suId
792 * @param[in] RguCDatIndInfo * datInd
801 RguCDatIndInfo * datInd
804 S16 RgUiRguCDatInd(pst, suId, datInd)
807 RguCDatIndInfo * datInd;
812 return ((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
818 * @brief Data Indication from MAC to RLC to
819 * forward the data received for dedicated channels
823 * Function : RgUiRguDDatInd
825 * @param[in] Pst* pst
826 * @param[in] SuId suId
827 * @param[in] RguDDatIndInfo * datInd
836 RguDDatIndInfo * datInd
839 S16 RgUiRguDDatInd(pst, suId, datInd)
842 RguDDatIndInfo * datInd;
847 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
848 return (RgUiRguDDatIndRbuf(datInd));
850 return ((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
857 * @brief Status Indication from MAC to RLC
858 * as a response to the staRsp primitive from RLC.
859 * Informs RLC of the totalBufferSize and Timing Info
860 * for the transmission on common channels.
864 * Function : RgUiRguCStaInd
866 * @param[in] Pst* pst
867 * @param[in] SuId suId
868 * @param[in] RguCStaIndInfo * staInd
877 RguCStaIndInfo * staInd
880 S16 RgUiRguCStaInd(pst, suId, staInd)
883 RguCStaIndInfo * staInd;
887 return ((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
894 * @brief Status Indication from MAC to RLC
895 * as a response to the staRsp primitive from RLC.
896 * Informs RLC of the totalBufferSize and Timing Info
897 * for the transmission on dedicated channels.
901 * Function : RgUiRguDStaInd
903 * @param[in] Pst* pst
904 * @param[in] SuId suId
905 * @param[in] RguDStaIndInfo * staInd
914 RguDStaIndInfo * staInd
917 S16 RgUiRguDStaInd(pst, suId, staInd)
920 RguDStaIndInfo * staInd;
924 return ((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
928 /* TODO: Function header */
934 RguHarqStatusInd *harqStatusInd
937 S16 RgUiRguHqStaInd(pst, suId, harqStatusInd)
940 RguHarqStatusInd *harqStatusInd;
944 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
946 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
949 return ((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
952 } /* RgUiRguHqStaInd */
953 #endif /* LTE_L2_MEAS */
956 S16 RgUiRguFlowCntrlInd
960 RguFlowCntrlInd *flowCntrlInd
963 S16 RgUiRguFlowCntrlInd(pst, suId, harqStatusInd)
966 RguFlowCntrlInd *flowCntrlInd;
969 return ((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
971 /* Added for SI Enhancement*/
974 * @brief SI Configuration Confirm from MAC to RRM
978 * Function : RgUiRgrSiCfgCfm
980 * @param[in] Pst* pst
981 * @param[in] SuId suId
982 * @param[in] RgrCfgTransId transId
983 * @param[in] uint8_t status
992 RgrCfgTransId transId,
996 S16 RgUiRgrSiCfgCfm(pst, suId, transId, status)
999 RgrCfgTransId transId;
1004 return ((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
1009 * @brief Warning SI Configuration Confirm from MAC to RRM
1013 * Function : RgUiRgrWarningSiCfgCfm
1015 * @param[in] Pst* pst
1016 * @param[in] SuId suId
1017 * @param[in] RgrCfgTransId transId
1018 * @param[in] uint8_t siId
1019 * @param[in] uint8_t status
1024 S16 RgUiRgrWarningSiCfgCfm
1028 RgrCfgTransId transId,
1033 S16 RgUiRgrWarningSiCfgCfm(pst, suId, transId, siId,status)
1036 RgrCfgTransId transId;
1041 return ((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
1042 (pst, suId, transId, siId, status));
1045 #endif/*RGR_SI_SCH*/
1048 /* ccpu00117452 - MOD - Changed macro name from
1049 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1052 * @brief STA indication from MAC to RGR user.
1056 * Function : RgUiRgrStaInd
1058 * @param[in] Pst* pst
1059 * @param[in] SuId suId
1060 * @param[in] RgrStaIndInfo *staInd
1069 RgrStaIndInfo *staInd
1072 S16 RgUiRgrStaInd(pst, suId, staInd)
1075 RgrStaIndInfo *staInd;
1079 return ((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
1082 #endif /* End of RGR_CQI_REPT */
1084 /* LTE_ADV_FLAG_REMOVED_START */
1086 * @brief LOAD INF indication from MAC to RGR user.
1090 * Function : RgUiRgrLoadInfInd
1092 * @param[in] Pst* pst
1093 * @param[in] SuId suId
1094 * @param[in] RgrLoadInfIndInfo *loadInfInd
1099 S16 RgUiRgrLoadInfInd
1103 RgrLoadInfIndInfo *loadInfInd
1106 S16 RgUiRgrLoadInfInd(pst, suId, loadInfInd)
1109 RgrLoadInfIndInfo *loadInfInd;
1113 return ((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
1116 /* LTE_ADV_FLAG_REMOVED_END */
1119 * @brief UESTA indication from MAC to RGR user.
1123 * Function : RgUiRgrUeStaInd
1125 * @param[in] Pst* pst
1126 * @param[in] SuId suId
1127 * @param[in] RgrStaIndInfo *staInd
1136 RgrUeStaIndInfo *ueStaInd
1139 S16 RgUiRgrUeStaInd(pst, suId, ueStaInd)
1142 RgrUeStaIndInfo *ueStaInd;
1146 return ((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
1149 #endif /*--ifdef RG--*/
1154 * @brief Confirmation from MAC to RRC for the bind/Unbind
1155 * request for the interface saps
1159 * Function : PtUiCrgBndCfm
1161 * @param[in] Pst* pst
1162 * @param[in] SuId suId
1163 * @param[in] uint8_t status
1175 S16 PtUiCrgBndCfm(pst, suId, status)
1193 * @brief Configuration Confirm from MAC to RRC
1197 * Function : PtUiCrgCfgCfm
1199 * @param[in] Pst* pst
1200 * @param[in] SuId suId
1201 * @param[in] CrgCfgTransId transId
1202 * @param[in] uint8_t status
1211 CrgCfgTransId transId,
1215 S16 PtUiCrgCfgCfm(pst, suId, transId, status)
1218 CrgCfgTransId transId;
1231 #endif /*--ifdef PTRGUICRG--*/
1236 * @brief Confirmation from MAC to RLC for the bind/Unbind
1237 * request for the interface saps
1241 * Function : PtUiRguBndCfm
1243 * @param[in] Pst* pst
1244 * @param[in] SuId suId
1245 * @param[in] uint8_t status
1257 S16 PtUiRguBndCfm(pst, suId, status)
1275 * @brief Data Indication from MAC to RLC to
1276 * forward the data received for common channels
1280 * Function : PtUiRguCDatInd
1282 * @param[in] Pst* pst
1283 * @param[in] SuId suId
1284 * @param[in] RguCDatIndInfo * datInd
1293 RguCDatIndInfo * datInd
1296 S16 PtUiRguCDatInd(pst, suId, datInd)
1299 RguCDatIndInfo * datInd;
1314 * @brief Data Indication from MAC to RLC to
1315 * forward the data received for dedicated channels
1319 * Function : PtUiRguDDatInd
1321 * @param[in] Pst* pst
1322 * @param[in] SuId suId
1323 * @param[in] RguDDatIndInfo * datInd
1332 RguDDatIndInfo * datInd
1335 S16 PtUiRguDDatInd(pst, suId, datInd)
1338 RguDDatIndInfo * datInd;
1353 * @brief Status Indication from MAC to RLC
1354 * as a response to the staRsp primitive from RLC.
1355 * Informs RLC of the totalBufferSize and Timing Info
1356 * for the transmission on common channels.
1360 * Function : PtUiRguCStaInd
1362 * @param[in] Pst* pst
1363 * @param[in] SuId suId
1364 * @param[in] RguCStaIndInfo * staInd
1373 RguCStaIndInfo * staInd
1376 S16 PtUiRguCStaInd(pst, suId, staInd)
1379 RguCStaIndInfo * staInd;
1394 * @brief Status Indication from MAC to RLC
1395 * as a response to the staRsp primitive from RLC.
1396 * Informs RLC of the totalBufferSize and Timing Info
1397 * for the transmission on dedicated channels.
1401 * Function : PtUiRguDStaInd
1403 * @param[in] Pst* pst
1404 * @param[in] SuId suId
1405 * @param[in] RguDStaIndInfo * staInd
1414 RguDStaIndInfo * staInd
1417 S16 PtUiRguDStaInd(pst, suId, staInd)
1420 RguDStaIndInfo * staInd;
1432 /* TODO: Function Header */
1438 RguHarqStatusInd *harqStatusInd
1441 S16 PtUiRguHqStaInd(pst, suId, harqStatusInd)
1444 RguHarqStatusInd *harqStatusInd;
1450 UNUSED(harqStatusInd);
1455 #endif /* LTE_L2_MEAS */
1458 S16 PtUiRguFlowCntrlInd
1462 RguFlowCntrlInd *flowCntrlInd
1465 S16 PtUiRguFlowCntrlInd(pst, suId, flowCntrlInd)
1468 RguHarqStatusInd *flowCntrlInd;
1474 UNUSED(flowCntrlInd);
1480 #endif /*--ifdef PTRGUIRGU--*/
1485 * @brief Confirmation from MAC to RRM for the bind/Unbind
1486 * request for the interface saps
1490 * Function : PtUiRgrBndCfm
1492 * @param[in] Pst* pst
1493 * @param[in] SuId suId
1494 * @param[in] uint8_t status
1506 S16 PtUiRgrBndCfm(pst, suId, status)
1521 /* Added for sending TTI tick to RRM */
1524 * @brief TTI indication from MAC to RGR user.
1528 * Function : PtUiRgrTtiInd
1530 * @param[in] Pst* pst
1531 * @param[in] SuId suId
1532 * @param[in] RgrTtiIndInfo *ttiInd
1541 RgrTtiIndInfo *ttiInd
1544 S16 PtUiRgrTtiInd(pst, suId, ttiInd)
1547 RgrTtiIndInfo *ttiInd;
1562 * @brief Configuration Confirm from MAC to RRM
1566 * Function : PtUiRgrCfgCfm
1568 * @param[in] Pst* pst
1569 * @param[in] SuId suId
1570 * @param[in] RgrCfgTransId transId
1571 * @param[in] uint8_t status
1580 RgrCfgTransId transId,
1584 S16 PtUiRgrCfgCfm(pst, suId, transId, status)
1587 RgrCfgTransId transId;
1601 /* Added for SI Enhancement*/
1604 * @brief SI Configuration Confirm from MAC to RRM
1608 * Function : PtUiRgrSiCfgCfm
1610 * @param[in] Pst* pst
1611 * @param[in] SuId suId
1612 * @param[in] RgrCfgTransId transId
1613 * @param[in] uint8_t status
1622 RgrCfgTransId transId,
1626 S16 PtUiRgrSiCfgCfm(pst, suId, transId, status)
1629 RgrCfgTransId transId;
1644 * @brief Warning SI Configuration Confirm from MAC to RRM
1648 * Function : PtUiRgrWarningSiCfgCfm
1650 * @param[in] Pst* pst
1651 * @param[in] SuId suId
1652 * @param[in] RgrCfgTransId transId
1653 * @param[in] uint8_t siId
1654 * @param[in] uint8_t status
1659 S16 PtUiRgrWarningSiCfgCfm
1663 RgrCfgTransId transId,
1668 S16 PtUiRgrWarningSiCfgCfm(pst, suId, transId, siId, status)
1671 RgrCfgTransId transId;
1684 #endif/* RGR_SI_SCH */
1687 /* ccpu00117452 - MOD - Changed macro name from
1688 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1691 * @brief STA indication from MAC to RGR user.
1695 * Function : PtUiRgrStaInd
1697 * @param[in] Pst* pst
1698 * @param[in] SuId suId
1699 * @param[in] RgrStaIndInfo *staInd
1708 RgrStaIndInfo *staInd
1711 S16 PtUiRgrStaInd(pst, suId, staInd)
1714 RgrStaIndInfo *staInd;
1725 #endif /* End of RGR_CQI_REPT */
1726 /* LTE_ADV_FLAG_REMOVED_START */
1728 * @brief LOAD INF indication from MAC to RGR user.
1732 * Function : PtUiRgrLoadInfInd
1734 * @param[in] Pst* pst
1735 * @param[in] SuId suId
1736 * @param[in] RgrLoadInfIndInfo *loadInfInd
1741 S16 PtUiRgrLoadInfInd
1745 RgrLoadInfIndInfo *loadInfInd
1748 S16 PtUiRgrLoadInfInd(pst, suId, loadInfInd)
1751 RgrLoadInfIndInfo *loadInfInd;
1762 /* LTE_ADV_FLAG_REMOVED_END */
1765 * @brief STA indication from MAC to RGR user.
1769 * Function : PtUiRgrUeStaInd
1771 * @param[in] Pst* pst
1772 * @param[in] SuId suId
1773 * @param[in] RgrUeStaIndInfo *ueStaInd
1782 RgrUeStaIndInfo *ueStaInd
1785 S16 PtUiRgrUeStaInd(pst, suId, ueStaInd)
1788 RgrUeStaIndInfo *ueStaInd;
1799 #endif /*--ifdef PTRGUIRGR--*/
1804 * @brief Confirmation from MAC to RRM for the bind/Unbind
1805 * request for the interface saps via RGM interface
1809 * Function : PtUiRgmBndCfm
1811 * @param[in] Pst* pst
1812 * @param[in] SuId suId
1813 * @param[in] uint8_t status
1825 S16 PtUiRgmBndCfm(pst, suId, status)
1841 * @brief Average PRB indication from MAC to RRM
1845 * Function : PtUiRgmPrbRprtInd
1847 * @param[in] Pst* pst
1848 * @param[in] SuId suId
1849 * @param[in] RgrUeStaIndInfo *ueStaInd
1854 S16 PtUiRgmPrbRprtInd
1858 RgmPrbRprtInd *prbRprtInd
1861 S16 PtUiRgmPrbRprtInd(pst, suId, prbRprtInd)
1864 RgmPrbRprtInd *prbRprtInd;
1877 * @brief Transmission Mode Change indication from MAC to RRM
1881 * Function : PtUiRgmTransModeInd
1883 * @param[in] Pst* pst
1884 * @param[in] SuId suId
1885 * @param[in] RgmTransModeInd *transModeInd
1890 S16 PtUiRgmTransModeInd
1894 RgmTransModeInd *transModeInd
1897 S16 PtUiRgmTransModeInd(pst, suId, transModeInd)
1900 RgmTransModeInd *transModeInd;
1906 UNUSED(transModeInd);
1914 * @brief Average PRB indication from MAC to RRM
1918 * Function : RgUiRgmSendPrbRprtInd
1920 * @param[in] Pst* pst
1921 * @param[in] SuId suId
1922 * @param[in] RgmPrbRprtInd prbRprtInd
1927 S16 RgUiRgmSendPrbRprtInd
1931 RgmPrbRprtInd *prbRprtInd
1934 S16 RgUiRgmSendPrbRprtInd(pst, suId, prbRprtInd)
1937 RgmPrbRprtInd *prbRprtInd;
1941 return ((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
1945 * @brief Transmission Mode change indication from MAC to RRM
1949 * Function : RgUiRgmChangeTransModeInd
1951 * @param[in] Pst* pst
1952 * @param[in] SuId suId
1953 * @param[in] RgmTransModeInd transModeInd
1958 S16 RgUiRgmChangeTransModeInd
1962 RgmTransModeInd *transModeInd
1965 S16 RgUiRgmChangeTransModeInd(pst, suId, transModeInd)
1968 RgmTransModeInd *transModeInd;
1972 return ((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
1975 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
1976 static S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
1980 RguDedDatInd1 *rguDatIndl = NULLP;
1981 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1982 rguDatIndl = (RguDedDatInd1 *) elem;
1985 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
1987 for(i = 0; i< datInd->numLch; i++)
1989 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
1991 if(datInd->lchData[i].pdu.mBuf[j])
1993 SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
1997 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
2002 rguDatIndl->msg = datInd;
2003 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
2004 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
2009 #ifdef RLC_MAC_DAT_REQ_RBUF
2011 S16 rgDlDatReqBatchProc
2016 S16 rgDlDatReqBatchProc()
2020 /* Read from Ring Buffer and process PDCP packets */
2022 uint8_t rngBufDeqIndx = 0;
2023 static Pst rgDDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
2024 static Pst rgCDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
2025 Void *elmIndx = NULLP;
2026 RguInfoRingElem *datReqRing=NULLP;
2027 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2028 while(NULLP != elmIndx)
2030 datReqRing= (RguInfoRingElem *)elmIndx;
2031 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;//Number of pkt processed in tti
2034 if(datReqRing->event == EVTRGUDDATREQ)
2036 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2040 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
2041 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2046 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2047 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2048 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2051 if(datReqRing->event == EVTRGUDDATREQ)
2052 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
2054 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
2057 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
2058 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
2061 datReqRing->msg=NULLP;
2062 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
2063 datReqRing->event=0;
2068 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
2071 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
2079 #ifdef RLC_MAC_STA_RSP_RBUF
2081 S16 rgDlStaRspBatchProc
2086 S16 rgDlStaRspBatchProc()
2090 /* Read from Ring Buffer and process PDCP packets */
2092 uint8_t rngBufDeqIndx = 0;
2093 static Pst rgDStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
2094 static Pst rgCStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
2095 Void *elmIndx = NULLP;
2096 RguInfoRingElem *staRspRing=NULLP;
2098 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2099 while(NULLP != elmIndx)
2101 staRspRing= (RguInfoRingElem *)elmIndx;
2102 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;//Number of pkt processed in tti
2104 if(staRspRing->msg!= NULLP)
2106 if( staRspRing->event == EVTRGUDSTARSP)
2108 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2112 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2117 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2118 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2119 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
2120 if(staRspRing->msg!= NULLP)
2122 if( staRspRing->event == EVTRGUDSTARSP)
2123 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
2125 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
2128 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
2129 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
2132 staRspRing->msg=NULLP;
2133 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
2134 staRspRing->event =0;
2140 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
2143 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
2151 #ifdef MAC_RLC_HARQ_STA_RBUF
2153 S16 RgUiRguHqStaIndRbuf
2157 RguHarqStatusInd *harqStatusInd
2160 S16 RgUiRguHqStaIndRbuf(pst, suId, harqStatusInd)
2163 RguHarqStatusInd *harqStatusInd;
2168 RguHarqStaInd *harqStaInd = NULLP;
2169 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
2170 harqStaInd = (RguHarqStaInd*) elem;
2173 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
2178 memcpy(&(harqStaInd->hqStatusInd), harqStatusInd, sizeof(RguHarqStatusInd));
2179 memcpy(&(harqStaInd->pst), pst, sizeof(Pst));
2180 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
2181 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
2189 /**********************************************************************
2192 **********************************************************************/