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
551 S16 RgUiRgrBndCfm(Pst* pst,SuId suId,uint8_t status)
554 return ((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
558 * @brief Confirmation from MAC to RRM for the bind/Unbind
559 * request for the interface saps via RGM interface
563 * Function : RgUiRgmBndCfm
565 * @param[in] Pst* pst
566 * @param[in] SuId suId
567 * @param[in] uint8_t status
571 S16 RgUiRgmBndCfm(Pst* pst,SuId suId,uint8_t status)
574 return ((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
580 /* Added for sending TTI tick to RRM */
583 * @brief TTI indication from MAC to RGR user.
587 * Function : RgUiRgrTtiInd
589 * @param[in] Pst* pst
590 * @param[in] SuId suId
591 * @param[in] RgrTtiIndInfo ttiInd
595 S16 RgUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
598 return ((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
605 * @brief Configuration Confirm from MAC to RRM
609 * Function : RgUiRgrCfgCfm
611 * @param[in] Pst* pst
612 * @param[in] SuId suId
613 * @param[in] RgrCfgTransId transId
614 * @param[in] uint8_t status
618 S16 RgUiRgrCfgCfm(Pst* pst,RgrCfgTransId transId,uint8_t status)
621 return ((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
627 * @brief Confirmation from MAC to RRC for the bind/Unbind
628 * request for the interface saps
632 * Function : RgUiCrgBndCfm
634 * @param[in] Pst* pst
635 * @param[in] SuId suId
636 * @param[in] uint8_t status
640 S16 RgUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
643 return ((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
650 * @brief Configuration Confirm from MAC to RRC
654 * Function : RgUiCrgCfgCfm
656 * @param[in] Pst* pst
657 * @param[in] SuId suId
658 * @param[in] CrgCfgTransId transId
659 * @param[in] uint8_t status
663 S16 RgUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
666 return ((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
672 * @brief Confirmation from MAC to RLC for the bind/Unbind
673 * request for the interface saps
677 * Function : RgUiRguBndCfm
679 * @param[in] Pst* pst
680 * @param[in] SuId suId
681 * @param[in] uint8_t status
685 S16 RgUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
688 return ((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
697 * @brief Data Indication from MAC to RLC to
698 * forward the data received for common channels
702 * Function : RgUiRguCDatInd
704 * @param[in] Pst* pst
705 * @param[in] SuId suId
706 * @param[in] RguCDatIndInfo * datInd
710 S16 RgUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo *datInd)
714 return ((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
720 * @brief Data Indication from MAC to RLC to
721 * forward the data received for dedicated channels
725 * Function : RgUiRguDDatInd
727 * @param[in] Pst* pst
728 * @param[in] SuId suId
729 * @param[in] RguDDatIndInfo * datInd
733 S16 RgUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo *datInd)
737 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
738 return (RgUiRguDDatIndRbuf(datInd));
740 return ((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
747 * @brief Status Indication from MAC to RLC
748 * as a response to the staRsp primitive from RLC.
749 * Informs RLC of the totalBufferSize and Timing Info
750 * for the transmission on common channels.
754 * Function : RgUiRguCStaInd
756 * @param[in] Pst* pst
757 * @param[in] SuId suId
758 * @param[in] RguCStaIndInfo * staInd
762 S16 RgUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
765 return ((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
772 * @brief Status Indication from MAC to RLC
773 * as a response to the staRsp primitive from RLC.
774 * Informs RLC of the totalBufferSize and Timing Info
775 * for the transmission on dedicated channels.
779 * Function : RgUiRguDStaInd
781 * @param[in] Pst* pst
782 * @param[in] SuId suId
783 * @param[in] RguDStaIndInfo * staInd
787 S16 RgUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo *staInd)
790 return ((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
794 /* TODO: Function header */
795 S16 RgUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
798 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
800 ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
803 return ((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
806 } /* RgUiRguHqStaInd */
807 #endif /* LTE_L2_MEAS */
809 S16 RgUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
811 return ((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
813 /* Added for SI Enhancement*/
816 * @brief SI Configuration Confirm from MAC to RRM
820 * Function : RgUiRgrSiCfgCfm
822 * @param[in] Pst* pst
823 * @param[in] SuId suId
824 * @param[in] RgrCfgTransId transId
825 * @param[in] uint8_t status
829 S16 RgUiRgrSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
832 return ((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
837 * @brief Warning SI Configuration Confirm from MAC to RRM
841 * Function : RgUiRgrWarningSiCfgCfm
843 * @param[in] Pst* pst
844 * @param[in] SuId suId
845 * @param[in] RgrCfgTransId transId
846 * @param[in] uint8_t siId
847 * @param[in] uint8_t status
851 S16 RgUiRgrWarningSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t siId,uint8_t status)
853 return ((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
854 (pst, suId, transId, siId, status));
860 /* ccpu00117452 - MOD - Changed macro name from
861 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
864 * @brief STA indication from MAC to RGR user.
868 * Function : RgUiRgrStaInd
870 * @param[in] Pst* pst
871 * @param[in] SuId suId
872 * @param[in] RgrStaIndInfo *staInd
876 S16 RgUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
879 return ((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
882 #endif /* End of RGR_CQI_REPT */
884 /* LTE_ADV_FLAG_REMOVED_START */
886 * @brief LOAD INF indication from MAC to RGR user.
890 * Function : RgUiRgrLoadInfInd
892 * @param[in] Pst* pst
893 * @param[in] SuId suId
894 * @param[in] RgrLoadInfIndInfo *loadInfInd
898 S16 RgUiRgrLoadInfInd( Pst* pst, SuId suId,RgrLoadInfIndInfo *loadInfInd )
901 return ((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
904 /* LTE_ADV_FLAG_REMOVED_END */
907 * @brief UESTA indication from MAC to RGR user.
911 * Function : RgUiRgrUeStaInd
913 * @param[in] Pst* pst
914 * @param[in] SuId suId
915 * @param[in] RgrStaIndInfo *staInd
919 S16 RgUiRgrUeStaInd(Pst *pst,SuId suId,RgrUeStaIndInfo *ueStaInd)
922 return ((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
925 #endif /*--ifdef RG--*/
930 * @brief Confirmation from MAC to RRC for the bind/Unbind
931 * request for the interface saps
935 * Function : PtUiCrgBndCfm
937 * @param[in] Pst* pst
938 * @param[in] SuId suId
939 * @param[in] uint8_t status
943 S16 PtUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
957 * @brief Configuration Confirm from MAC to RRC
961 * Function : PtUiCrgCfgCfm
963 * @param[in] Pst* pst
964 * @param[in] SuId suId
965 * @param[in] CrgCfgTransId transId
966 * @param[in] uint8_t status
970 S16 PtUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
981 #endif /*--ifdef PTRGUICRG--*/
986 * @brief Confirmation from MAC to RLC for the bind/Unbind
987 * request for the interface saps
991 * Function : PtUiRguBndCfm
993 * @param[in] Pst* pst
994 * @param[in] SuId suId
995 * @param[in] uint8_t status
999 S16 PtUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
1013 * @brief Data Indication from MAC to RLC to
1014 * forward the data received for common channels
1018 * Function : PtUiRguCDatInd
1020 * @param[in] Pst* pst
1021 * @param[in] SuId suId
1022 * @param[in] RguCDatIndInfo * datInd
1026 S16 PtUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo *datInd)
1040 * @brief Data Indication from MAC to RLC to
1041 * forward the data received for dedicated channels
1045 * Function : PtUiRguDDatInd
1047 * @param[in] Pst* pst
1048 * @param[in] SuId suId
1049 * @param[in] RguDDatIndInfo * datInd
1053 S16 PtUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo *datInd)
1067 * @brief Status Indication from MAC to RLC
1068 * as a response to the staRsp primitive from RLC.
1069 * Informs RLC of the totalBufferSize and Timing Info
1070 * for the transmission on common channels.
1074 * Function : PtUiRguCStaInd
1076 * @param[in] Pst* pst
1077 * @param[in] SuId suId
1078 * @param[in] RguCStaIndInfo * staInd
1082 S16 PtUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
1096 * @brief Status Indication from MAC to RLC
1097 * as a response to the staRsp primitive from RLC.
1098 * Informs RLC of the totalBufferSize and Timing Info
1099 * for the transmission on dedicated channels.
1103 * Function : PtUiRguDStaInd
1105 * @param[in] Pst* pst
1106 * @param[in] SuId suId
1107 * @param[in] RguDStaIndInfo * staInd
1111 S16 PtUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo *staInd)
1122 /* TODO: Function Header */
1123 S16 PtUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
1128 UNUSED(harqStatusInd);
1133 #endif /* LTE_L2_MEAS */
1135 S16 PtUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
1140 UNUSED(flowCntrlInd);
1146 #endif /*--ifdef PTRGUIRGU--*/
1151 * @brief Confirmation from MAC to RRM for the bind/Unbind
1152 * request for the interface saps
1156 * Function : PtUiRgrBndCfm
1158 * @param[in] Pst* pst
1159 * @param[in] SuId suId
1160 * @param[in] uint8_t status
1164 S16 PtUiRgrBndCfm(Pst* pst,SuId suId,uint8_t status)
1175 /* Added for sending TTI tick to RRM */
1178 * @brief TTI indication from MAC to RGR user.
1182 * Function : PtUiRgrTtiInd
1184 * @param[in] Pst* pst
1185 * @param[in] SuId suId
1186 * @param[in] RgrTtiIndInfo *ttiInd
1190 S16 PtUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
1204 * @brief Configuration Confirm from MAC to RRM
1208 * Function : PtUiRgrCfgCfm
1210 * @param[in] Pst* pst
1211 * @param[in] SuId suId
1212 * @param[in] RgrCfgTransId transId
1213 * @param[in] uint8_t status
1217 S16 PtUiRgrCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
1229 /* Added for SI Enhancement*/
1232 * @brief SI Configuration Confirm from MAC to RRM
1236 * Function : PtUiRgrSiCfgCfm
1238 * @param[in] Pst* pst
1239 * @param[in] SuId suId
1240 * @param[in] RgrCfgTransId transId
1241 * @param[in] uint8_t status
1245 S16 PtUiRgrSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
1258 * @brief Warning SI Configuration Confirm from MAC to RRM
1262 * Function : PtUiRgrWarningSiCfgCfm
1264 * @param[in] Pst* pst
1265 * @param[in] SuId suId
1266 * @param[in] RgrCfgTransId transId
1267 * @param[in] uint8_t siId
1268 * @param[in] uint8_t status
1272 S16 PtUiRgrWarningSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t siId,uint8_t status)
1282 #endif/* RGR_SI_SCH */
1285 /* ccpu00117452 - MOD - Changed macro name from
1286 RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1289 * @brief STA indication from MAC to RGR user.
1293 * Function : PtUiRgrStaInd
1295 * @param[in] Pst* pst
1296 * @param[in] SuId suId
1297 * @param[in] RgrStaIndInfo *staInd
1301 S16 PtUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
1311 #endif /* End of RGR_CQI_REPT */
1312 /* LTE_ADV_FLAG_REMOVED_START */
1314 * @brief LOAD INF indication from MAC to RGR user.
1318 * Function : PtUiRgrLoadInfInd
1320 * @param[in] Pst* pst
1321 * @param[in] SuId suId
1322 * @param[in] RgrLoadInfIndInfo *loadInfInd
1326 S16 PtUiRgrLoadInfInd( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd )
1336 /* LTE_ADV_FLAG_REMOVED_END */
1339 * @brief STA indication from MAC to RGR user.
1343 * Function : PtUiRgrUeStaInd
1345 * @param[in] Pst* pst
1346 * @param[in] SuId suId
1347 * @param[in] RgrUeStaIndInfo *ueStaInd
1351 S16 PtUiRgrUeStaInd(Pst* pst,SuId suId,RgrUeStaIndInfo *ueStaInd)
1361 #endif /*--ifdef PTRGUIRGR--*/
1366 * @brief Confirmation from MAC to RRM for the bind/Unbind
1367 * request for the interface saps via RGM interface
1371 * Function : PtUiRgmBndCfm
1373 * @param[in] Pst* pst
1374 * @param[in] SuId suId
1375 * @param[in] uint8_t status
1379 S16 PtUiRgmBndCfm(Pst* pst,SuId suId,uint8_t status)
1391 * @brief Average PRB indication from MAC to RRM
1395 * Function : PtUiRgmPrbRprtInd
1397 * @param[in] Pst* pst
1398 * @param[in] SuId suId
1399 * @param[in] RgrUeStaIndInfo *ueStaInd
1403 S16 PtUiRgmPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1415 * @brief Transmission Mode Change indication from MAC to RRM
1419 * Function : PtUiRgmTransModeInd
1421 * @param[in] Pst* pst
1422 * @param[in] SuId suId
1423 * @param[in] RgmTransModeInd *transModeInd
1427 S16 PtUiRgmTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1432 UNUSED(transModeInd);
1440 * @brief Average PRB indication from MAC to RRM
1444 * Function : RgUiRgmSendPrbRprtInd
1446 * @param[in] Pst* pst
1447 * @param[in] SuId suId
1448 * @param[in] RgmPrbRprtInd prbRprtInd
1452 S16 RgUiRgmSendPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1454 return ((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
1458 * @brief Transmission Mode change indication from MAC to RRM
1462 * Function : RgUiRgmChangeTransModeInd
1464 * @param[in] Pst* pst
1465 * @param[in] SuId suId
1466 * @param[in] RgmTransModeInd transModeInd
1470 S16 RgUiRgmChangeTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1472 return ((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
1475 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
1476 static S16 RgUiRguDDatIndRbuf(RguDDatIndInfo *datInd)
1480 RguDedDatInd1 *rguDatIndl = NULLP;
1481 elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1482 rguDatIndl = (RguDedDatInd1 *) elem;
1485 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
1487 for(i = 0; i< datInd->numLch; i++)
1489 for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
1491 if(datInd->lchData[i].pdu.mBuf[j])
1493 ODU_PUT_MSG_BUF(datInd->lchData[i].pdu.mBuf[j]);
1497 rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
1502 rguDatIndl->msg = datInd;
1503 SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1504 SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
1509 #ifdef RLC_MAC_DAT_REQ_RBUF
1510 S16 rgDlDatReqBatchProc
1515 /* Read from Ring Buffer and process PDCP packets */
1517 uint8_t rngBufDeqIndx = 0;
1518 static Pst rgDDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDDATREQ,0,0,2,0};
1519 static Pst rgCDatRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCDATREQ,0,0,2,0};
1520 Void *elmIndx = NULLP;
1521 RguInfoRingElem *datReqRing=NULLP;
1522 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
1523 while(NULLP != elmIndx)
1525 datReqRing= (RguInfoRingElem *)elmIndx;
1526 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;//Number of pkt processed in tti
1529 if(datReqRing->event == EVTRGUDDATREQ)
1531 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
1535 // printf("CSHP:*** Received CDatReq in MAC Ring \n");
1536 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
1541 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
1542 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
1543 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
1546 if(datReqRing->event == EVTRGUDDATREQ)
1547 RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
1549 RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg);
1552 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->read,
1553 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].r_addr->write);
1556 datReqRing->msg=NULLP;
1557 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
1558 datReqRing->event=0;
1563 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
1566 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
1574 #ifdef RLC_MAC_STA_RSP_RBUF
1575 S16 rgDlStaRspBatchProc(Void)
1577 /* Read from Ring Buffer and process PDCP packets */
1579 uint8_t rngBufDeqIndx = 0;
1580 static Pst rgDStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUDSTARSP,0,0,2,0};
1581 static Pst rgCStaRbfuPst ={1,1,ENTMAC,0,ENTRLC,1,PRIOR0,RTESPEC,EVTRGUCSTARSP,0,0,2,0};
1582 Void *elmIndx = NULLP;
1583 RguInfoRingElem *staRspRing=NULLP;
1585 elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1586 while(NULLP != elmIndx)
1588 staRspRing= (RguInfoRingElem *)elmIndx;
1589 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;//Number of pkt processed in tti
1591 if(staRspRing->msg!= NULLP)
1593 if( staRspRing->event == EVTRGUDSTARSP)
1595 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
1599 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
1604 printf(" Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
1605 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
1606 /* Due to the cache issue we are verifying the mbuf pointer again and sending it to rlc if avilable*/
1607 if(staRspRing->msg!= NULLP)
1609 if( staRspRing->event == EVTRGUDSTARSP)
1610 RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
1612 RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
1615 printf(" still Buf Pinter is NULL RBUF Read(%ld) write (%ld) \n",SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->read,
1616 SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].r_addr->write);
1619 staRspRing->msg=NULLP;
1620 SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1621 staRspRing->event =0;
1627 if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
1630 if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
1638 #ifdef MAC_RLC_HARQ_STA_RBUF
1639 S16 RgUiRguHqStaIndRbuf (Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
1643 RguHarqStaInd *harqStaInd = NULLP;
1644 elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
1645 harqStaInd = (RguHarqStaInd*) elem;
1648 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
1653 memcpy(&(harqStaInd->hqStatusInd), harqStatusInd, sizeof(RguHarqStatusInd));
1654 memcpy(&(harqStaInd->pst), pst, sizeof(Pst));
1655 SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
1656 SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
1664 /**********************************************************************
1667 **********************************************************************/