5423a037f058cfe3c0ab2ee4406cdc88197d4b31
[o-du/l2.git] / src / 5gnrmac / rg_ptui.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /************************************************************************
20  
21      Name:     LTE-MAC layer
22   
23      Type:     C source file
24   
25      Desc:     C source code for Upper Interface Module 
26   
27      File:     rg_ptui.c 
28   
29 **********************************************************************/
30
31 /** @file rg_ptui.c
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.
35 */
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*/
43
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*/
49 #include "ss_rbuf.h"
50 #include "ss_rbuf.x"
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif /* __cplusplus */
55
56 #if !(defined(LCRGUIRGU) && defined(LWLCRGUIRGU)  && defined(KW))
57 #define PTRGUIRGU
58 #endif
59
60 #if !(defined(LCRGUICRG)  && defined(NH))
61 #define PTRGUICRG
62 #endif
63
64 #if !(defined(LCRGUIRGR)  && defined(NX))
65 #define PTRGUIRGR
66 #endif
67
68 #if !(defined(LCRGUIRGM)  && defined(RM))
69 #define PTRGUIRGM
70 #endif
71
72 /* MAX Number of Service Users of RG */
73 #define RG_MAX_RGU_USR   3
74
75 /* MAX Number of Service Users of RG */
76 #define RG_MAX_CRG_USR   2
77
78 /* MAX Number of Service Users of RG */
79 #define RG_MAX_RGR_USR   2
80
81 /* MAX Number of Service Users of RG */
82 #define RG_MAX_RGM_USR   2
83 #ifdef PTRGUIRGU
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));
103 #ifdef LTE_L2_MEAS
104 /**@brief HARQ Status Indication from MAC to RLC */
105 S16 PtUiRguHqStaInd ARGS((Pst* pst,SuId suId,
106          RguHarqStatusInd *harqStatusInd));
107 #endif
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);
113 #ifdef LTE_L2_MEAS
114 #ifdef MAC_RLC_HARQ_STA_RBUF
115 S16 RgUiRguHqStaIndRbuf ARGS((Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd));
116 #endif 
117 #endif
118
119 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
120 static S16  RgUiRguDDatIndRbuf ARGS((RguDDatIndInfo  *datInd));
121 #endif
122 Void rgFreeSharableSBuf ARGS((Data **data, Size size));
123
124 #ifdef RGR_CQI_REPT 
125 S16 PtUiRgrStaInd ARGS(( Pst* pst, SuId suId, RgrStaIndInfo *staInd));
126 #endif
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
131 ((
132 Pst* pst, 
133 SuId suId, 
134 RgrUeStaIndInfo *staInd
135 ));
136 #ifdef PTRGUICRG
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--*/
143
144 #ifdef PTRGUIRGR
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*/
152 #ifdef RGR_SI_SCH
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));
156 #endif/*RGR_SI_SCH*/
157 #endif /*--#ifdef PTRGUIRGR--*/
158
159 #ifdef PTRGUIRGM
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));
163 #endif
164 S16 RgUiRgmSendPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
165 S16 RgUiRgmChangeTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
166
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] =
171 {
172 #ifdef LCRGUIRGR
173    cmPkRgrTtiInd,
174 #else
175    PtUiRgrTtiInd,
176 #endif
177 #ifdef NX
178    NxLiRgrTtiInd,
179 #else
180    PtUiRgrTtiInd,
181 #endif
182 };
183
184
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] =
188 {
189 #ifdef LCRGUIRGR
190    cmPkRgrBndCfm,
191 #else
192    PtUiRgrBndCfm,
193 #endif
194 #ifdef NX
195    NxLiRgrBndCfm,
196 #else
197    PtUiRgrBndCfm,
198 #endif
199 };
200
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] =
204 {
205 #ifdef RGM_LC
206    cmPkRgmBndCfm,
207 #else
208    PtUiRgmBndCfm,
209 #endif
210 #ifdef RM
211    RmLiRgmBndCfm, /*To be added by RRM*/
212 #else
213    PtUiRgmBndCfm,
214 #endif
215 };
216
217
218 /** @brief Configuration Confirm from MAC to RRM */
219 static const RgrCfgCfm RgUiRgrCfgCfmMt[RG_MAX_RGR_USR] =
220 {
221 #ifdef LCRGUIRGR
222    cmPkRgrCfgCfm,
223 #else
224    PtUiRgrCfgCfm,
225 #endif
226 #ifdef NX
227    NxLiRgrCfgCfm,
228 #endif
229 };
230
231 /* Added for SI Enhancement*/
232 #ifdef RGR_SI_SCH
233 /** @brief SI Configuration Confirm from MAC to RRM */
234 static const RgrSiCfgCfm RgUiRgrSiCfgCfmMt[RG_MAX_RGR_USR] =
235 {
236 #ifdef LCRGUIRGR
237    cmPkRgrSiCfgCfm,
238 #else
239    PtUiRgrSiCfgCfm,
240 #endif
241 #ifdef NX
242    NxLiRgrSiCfgCfm,
243 #else
244    PtUiRgrSiCfgCfm,
245 #endif
246 };
247
248
249 /** @brief Warning SI Configuration Confirm from MAC to RRM */
250 static const RgrWarningSiCfgCfm RgUiRgrWarningSiCfgCfmMt[RG_MAX_RGR_USR] =
251 {
252 #ifdef LCRGUIRGR
253    cmPkRgrWarningSiCfgCfm,
254 #else
255    PtUiRgrWarningSiCfgCfm,
256 #endif
257 #ifdef NX
258    NxLiRgrWarningSiCfgCfm,
259 #else
260    PtUiRgrWarningSiCfgCfm,
261 #endif
262 };
263
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] =
268 {
269 #ifdef LCRGUICRG
270    cmPkCrgBndCfm,
271 #else
272    PtUiCrgBndCfm,
273 #endif
274 #ifdef NH
275    NhLiCrgBndCfm,
276 #else
277    PtUiCrgBndCfm,
278 #endif
279 };
280
281 /** @brief Configuration Confirm from MAC to RRC */
282 static const CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
283 {
284 #ifdef LCRGUICRG
285    cmPkCrgCfgCfm,
286 #else
287    PtUiCrgCfgCfm,
288 #endif
289 #ifdef NH
290    NhLiCrgCfgCfm,
291 #else
292    PtUiCrgCfgCfm,
293 #endif
294 };
295
296
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] =
300 {
301 #ifdef LCRGUIRGU
302    cmPkRguBndCfm,
303 #else
304    PtUiRguBndCfm,
305 #endif
306 #ifdef KW
307    RlcLiRguBndCfm,
308 #else
309    PtUiRguBndCfm,
310 #endif
311 #ifdef LWLCRGUIRGU
312    cmPkRguBndCfm,
313 #else
314    PtUiRguBndCfm,
315 #endif
316 };
317
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] =
321 {
322 #ifdef LCRGUIRGU
323 //   cmPkRguCDatInd, /* TODO : Call packRcvdUlData instead */
324 #else
325    PtUiRguCDatInd,
326 #endif
327 #ifdef KW
328    //RlcProcCommLcUlData,
329 #else
330    PtUiRguCDatInd,
331 #endif
332 #ifdef LWLCRGUIRGU
333 //   cmPkRguCDatInd, /* TODO:Call packRcvdUlData instead */
334 #else
335    PtUiRguCDatInd,
336 #endif
337 };
338
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] =
342 {
343 #ifdef LCRGUIRGU
344 //   cmPkRguDDatInd,  /* TODO: Call packRcvdUlData instead */
345 #else
346    PtUiRguDDatInd,
347 #endif
348 #ifdef KW
349    //RlcProcDedLcUlData,
350 #else
351    PtUiRguDDatInd,
352 #endif
353 #ifdef LWLCRGUIRGU
354 //   cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
355 #else
356    PtUiRguDDatInd,
357 #endif
358 };
359
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] =
365 {
366 #ifdef LCRGUIRGU
367    //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
368 #else
369    PtUiRguCStaInd,
370 #endif
371 #ifdef KW
372    //RlcMacProcSchedRep,
373 #else
374    PtUiRguCStaInd,
375 #endif
376 #ifdef LWLCRGUIRGU
377    //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
378 #else
379    PtUiRguCStaInd,
380 #endif
381 };
382
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] =
388 {
389 #ifdef LCRGUIRGU
390    //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
391 #else
392    PtUiRguDStaInd,
393 #endif
394 #ifdef KW
395    //RlcMacProcSchedRep,
396 #else
397    PtUiRguDStaInd,
398 #endif
399 #ifdef LWLCRGUIRGU
400    //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
401 #else
402    PtUiRguDStaInd,
403 #endif
404 };
405
406 #ifdef LTE_L2_MEAS
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] =
412 {
413 #ifdef LCRGUIRGU
414    cmPkRguHqStaInd,
415 #else
416    PtUiRguHqStaInd,
417 #endif
418 #ifdef KW
419    RlcLiRguHqStaInd,
420 #else
421    PtUiRguHqStaInd,
422 #endif
423 #ifdef LWLCRGUIRGU
424    cmPkRguHqStaInd,
425 #else
426    PtUiRguHqStaInd,
427 #endif
428 };
429 #endif /* LTE_L2_MEAS */
430
431 /* ccpu00117452 - MOD - Changed macro name from
432    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
433 #ifdef RGR_CQI_REPT
434 /** @brief TTI indication from MAC to RRM */
435 static const RgrStaInd RgUiRgrStaIndMt[RG_MAX_RGR_USR] =
436 {
437 #ifdef LCRGUIRGR
438    cmPkRgrStaInd,
439 #else
440    PtUiRgrStaInd,
441 #endif
442 #ifdef NX
443    NxLiRgrStaInd,
444 #else
445    PtUiRgrStaInd,
446 #endif
447 };
448 #endif /* RGR_CQI_REPT */
449
450 /* LTE_ADV_FLAG_REMOVED_START */
451 /** @brief LOAD INF indication from MAC to RRM */
452 static const RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
453 {
454 #ifdef LCRGUIRGR
455    cmPkRgrLoadInfInd,
456 #else
457    PtUiRgrLoadInfInd,
458 #endif
459 #ifdef NX
460    NxLiRgrLoadInfInd,
461 #else
462    PtUiRgrLoadInfInd,
463 #endif
464 };
465 /* LTE_ADV_FLAG_REMOVED_END */
466
467 /** @brief TTI indication from MAC to RRM */
468 static const RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
469 {
470 #ifdef LCRGUIRGR
471    cmPkRgrUeStaInd,
472 #else
473    PtUiRgrUeStaInd,
474 #endif
475 #ifdef NX
476    NxLiRgrUeStaInd,
477 #else
478    PtUiRgrUeStaInd,
479 #endif
480 };
481
482 /** @brief Average PRB usage indication from MAC to RRM */
483 static const RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
484 {
485 #ifdef RGM_LC
486    cmPkRgmPrbRprtInd,
487 #else
488    PtUiRgmPrbRprtInd,
489 #endif
490 #ifdef RM
491    RmLiRgmPrbRprtInd,
492 #else
493    PtUiRgmPrbRprtInd,
494 #endif
495 };
496
497
498 /** @brief Transmission Mode Change indication from MAC to RRM */
499 static const RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
500 {
501 #ifdef RGM_LC
502    cmPkRgmTransModeInd,
503 #else
504    PtUiRgmTransModeInd,
505 #endif
506 #ifdef RM
507    RmLiRgmTransModeInd,
508 #else
509    PtUiRgmTransModeInd,
510 #endif
511 };
512
513 static const RguFlowCntrlIndInfo RgUiRguFlowCntrlIndMt[RG_MAX_RGU_USR] =
514 {
515 #ifdef LCRGUIRGU
516    cmPkRguFlowCntrlInd,
517 #else
518    PtUiRguFlowCntrlInd,
519 #endif
520 #ifdef KW
521    RlcLiRguFlowCntrlInd,
522 #else
523    PtUiRguFlowCntrlInd,
524 #endif
525 #ifdef LWLCRGUIRGU
526    cmPkRguFlowCntrlInd,
527 #else
528    PtUiRguFlowCntrlInd,
529 #endif
530 };
531 #ifdef __cplusplus
532 }
533 #endif /* __cplusplus */
534
535 #ifdef RG
536 \f
537 /**
538 * @brief Confirmation from MAC to RRM for the bind/Unbind 
539  * request for the interface saps
540 *
541 * @details
542 *
543 *     Function : RgUiRgrBndCfm
544 *
545 *  @param[in]   Pst*  pst
546 *  @param[in]   SuId  suId
547 *  @param[in]   uint8_t  status
548 *  @return   S16
549 *      -# ROK
550 **/
551 S16 RgUiRgrBndCfm(Pst* pst,SuId suId,uint8_t status)
552 {
553
554    return ((*RgUiRgrBndCfmMt[pst->selector])(pst, suId, status));
555
556 }
557 /**
558 * @brief Confirmation from MAC to RRM for the bind/Unbind 
559  * request for the interface saps via RGM interface
560 *
561 * @details
562 *
563 *     Function : RgUiRgmBndCfm
564 *
565 *  @param[in]   Pst*  pst
566 *  @param[in]   SuId  suId
567 *  @param[in]   uint8_t  status
568 *  @return   S16
569 *      -# ROK
570 **/
571 S16 RgUiRgmBndCfm(Pst* pst,SuId suId,uint8_t status)
572 {
573
574    return ((*RgUiRgmBndCfmMt[pst->selector])(pst, suId, status));
575
576 }
577
578
579
580 /* Added for sending TTI tick to RRM */
581 \f
582 /**
583 * @brief TTI indication from MAC to RGR user.
584 *
585 * @details
586 *
587 *     Function : RgUiRgrTtiInd
588 *
589 *  @param[in]   Pst*  pst
590 *  @param[in]   SuId  suId
591 *  @param[in]   RgrTtiIndInfo  ttiInd
592 *  @return   S16
593 *      -# ROK
594 **/
595 S16 RgUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
596 {
597
598    return ((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
599
600 }
601
602
603 \f
604 /**
605 * @brief Configuration Confirm from MAC to RRM
606 *
607 * @details
608 *
609 *     Function : RgUiRgrCfgCfm
610 *
611 *  @param[in]   Pst*  pst
612 *  @param[in]   SuId  suId
613 *  @param[in]   RgrCfgTransId  transId
614 *  @param[in]   uint8_t  status
615 *  @return   S16
616 *      -# ROK
617 **/
618 S16 RgUiRgrCfgCfm(Pst* pst,RgrCfgTransId transId,uint8_t status)
619 {
620
621    return ((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
622
623 }
624
625 \f
626 /**
627 * @brief Confirmation from MAC to RRC for the bind/Unbind 
628  * request for the interface saps
629 *
630 * @details
631 *
632 *     Function : RgUiCrgBndCfm
633 *
634 *  @param[in]   Pst*  pst
635 *  @param[in]   SuId  suId
636 *  @param[in]   uint8_t  status
637 *  @return   S16
638 *      -# ROK
639 **/
640 S16 RgUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
641 {
642
643    return ((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
644
645 }
646
647
648 \f
649 /**
650 * @brief Configuration Confirm from MAC to RRC
651 *
652 * @details
653 *
654 *     Function : RgUiCrgCfgCfm
655 *
656 *  @param[in]   Pst*  pst
657 *  @param[in]   SuId  suId
658 *  @param[in]   CrgCfgTransId  transId
659 *  @param[in]   uint8_t  status
660 *  @return   S16
661 *      -# ROK
662 **/
663 S16 RgUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
664 {
665
666    return ((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
667
668 }
669
670 \f
671 /**
672 * @brief Confirmation from MAC to RLC for the bind/Unbind 
673  * request for the interface saps
674 *
675 * @details
676 *
677 *     Function : RgUiRguBndCfm
678 *
679 *  @param[in]   Pst*  pst
680 *  @param[in]   SuId  suId
681 *  @param[in]   uint8_t  status
682 *  @return   S16
683 *      -# ROK
684 **/
685 S16 RgUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
686 {
687
688    return ((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
689
690 }
691
692 int macDDatIndSnt;
693 int macCDatIndSnt;
694
695 \f
696 /**
697 * @brief Data Indication from MAC to RLC to 
698  * forward the data received for common channels
699 *
700 * @details
701 *
702 *     Function : RgUiRguCDatInd
703 *
704 *  @param[in]   Pst*  pst
705 *  @param[in]   SuId  suId
706 *  @param[in]   RguCDatIndInfo  *  datInd
707 *  @return   S16
708 *      -# ROK
709 **/
710 S16 RgUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo *datInd)
711 {
712    macCDatIndSnt++;
713
714    return ((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
715
716 }
717
718 \f
719 /**
720 * @brief Data Indication from MAC to RLC to 
721  * forward the data received for dedicated channels
722 *
723 * @details
724 *
725 *     Function : RgUiRguDDatInd
726 *
727 *  @param[in]   Pst*  pst
728 *  @param[in]   SuId  suId
729 *  @param[in]   RguDDatIndInfo  *  datInd
730 *  @return   S16
731 *      -# ROK
732 **/
733 S16 RgUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo *datInd)
734 {
735    macDDatIndSnt++;
736
737 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
738    return (RgUiRguDDatIndRbuf(datInd));
739 #else 
740    return ((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
741 #endif    
742 }
743
744
745 \f
746 /**
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.
751 *
752 * @details
753 *
754 *     Function : RgUiRguCStaInd
755 *
756 *  @param[in]   Pst*  pst
757 *  @param[in]   SuId  suId
758 *  @param[in]   RguCStaIndInfo  *  staInd
759 *  @return   S16
760 *      -# ROK
761 **/
762 S16 RgUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
763 {
764
765    return ((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
766
767 }
768
769
770 \f
771 /**
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.
776 *
777 * @details
778 *
779 *     Function : RgUiRguDStaInd
780 *
781 *  @param[in]   Pst*  pst
782 *  @param[in]   SuId  suId
783 *  @param[in]   RguDStaIndInfo  *  staInd
784 *  @return   S16
785 *      -# ROK
786 **/
787 S16 RgUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo  *staInd)
788 {
789
790    return ((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
791
792 }
793 #ifdef LTE_L2_MEAS
794 /* TODO: Function header */
795 S16 RgUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
796 {
797
798 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
799    S16 ret=ROK;
800    ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
801    return (ret);
802 #else 
803    return ((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
804 #endif 
805
806 } /* RgUiRguHqStaInd */
807 #endif /* LTE_L2_MEAS */
808
809 S16 RgUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
810 {
811   return ((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
812 }
813 /* Added for SI Enhancement*/
814 #ifdef RGR_SI_SCH
815 /**
816 * @brief SI Configuration Confirm from MAC to RRM
817 *
818 * @details
819 *
820 *     Function : RgUiRgrSiCfgCfm
821 *
822 *  @param[in]   Pst*  pst
823 *  @param[in]   SuId  suId
824 *  @param[in]   RgrCfgTransId  transId
825 *  @param[in]   uint8_t  status
826 *  @return   S16
827 *      -# ROK
828 **/
829 S16 RgUiRgrSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
830 {
831
832    return ((*RgUiRgrSiCfgCfmMt[pst->selector])(pst, suId, transId, status));
833
834 }
835
836 /**
837 * @brief Warning SI Configuration Confirm from MAC to RRM
838 *
839 * @details
840 *
841 *     Function : RgUiRgrWarningSiCfgCfm
842 *
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
848 *  @return   S16
849 *      -# ROK
850 **/
851 S16 RgUiRgrWarningSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t siId,uint8_t status)
852 {
853    return ((*RgUiRgrWarningSiCfgCfmMt[pst->selector])
854          (pst, suId, transId, siId, status));
855 }
856
857 #endif/*RGR_SI_SCH*/
858
859 \f
860 /* ccpu00117452 - MOD - Changed macro name from
861    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
862 #ifdef RGR_CQI_REPT
863 /**
864 * @brief STA indication from MAC to RGR user.
865 *
866 * @details
867 *
868 *     Function : RgUiRgrStaInd
869 *
870 *  @param[in]   Pst*  pst
871 *  @param[in]   SuId  suId
872 *  @param[in]   RgrStaIndInfo  *staInd
873 *  @return   S16
874 *      -# ROK
875 **/
876 S16 RgUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
877 {
878
879    return ((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
880
881 }
882 #endif /* End of RGR_CQI_REPT */
883
884 /* LTE_ADV_FLAG_REMOVED_START */
885 /**
886  * @brief LOAD INF indication from MAC to RGR user.
887  *
888  * @details
889  *
890  *     Function : RgUiRgrLoadInfInd
891  *
892  *  @param[in]   Pst*  pst
893  *  @param[in]   SuId  suId
894  *  @param[in]   RgrLoadInfIndInfo  *loadInfInd
895  *  @return   S16
896  *      -# ROK
897  **/
898 S16 RgUiRgrLoadInfInd( Pst* pst, SuId suId,RgrLoadInfIndInfo *loadInfInd )
899 {
900
901    return ((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
902
903 }
904 /* LTE_ADV_FLAG_REMOVED_END */
905
906 /**
907 * @brief UESTA indication from MAC to RGR user.
908 *
909 * @details
910 *
911 *     Function : RgUiRgrUeStaInd
912 *
913 *  @param[in]   Pst*  pst
914 *  @param[in]   SuId  suId
915 *  @param[in]   RgrStaIndInfo  *staInd
916 *  @return   S16
917 *      -# ROK
918 **/
919 S16 RgUiRgrUeStaInd(Pst  *pst,SuId  suId,RgrUeStaIndInfo *ueStaInd)
920 {
921
922    return ((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
923
924 }
925 #endif /*--ifdef RG--*/
926
927 #ifdef PTRGUICRG
928 \f
929 /**
930 * @brief Confirmation from MAC to RRC for the bind/Unbind 
931  * request for the interface saps
932 *
933 * @details
934 *
935 *     Function : PtUiCrgBndCfm
936 *
937 *  @param[in]   Pst*  pst
938 *  @param[in]   SuId  suId
939 *  @param[in]   uint8_t  status
940 *  @return   S16
941 *      -# ROK
942 **/
943 S16 PtUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
944 {
945
946    UNUSED(pst);
947    UNUSED(suId);
948    UNUSED(status);
949
950    return ROK;
951
952 }
953
954
955 \f
956 /**
957 * @brief Configuration Confirm from MAC to RRC
958 *
959 * @details
960 *
961 *     Function : PtUiCrgCfgCfm
962 *
963 *  @param[in]   Pst*  pst
964 *  @param[in]   SuId  suId
965 *  @param[in]   CrgCfgTransId  transId
966 *  @param[in]   uint8_t  status
967 *  @return   S16
968 *      -# ROK
969 **/
970 S16 PtUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
971 {
972
973    UNUSED(pst);
974    UNUSED(suId);
975    UNUSED(transId);
976    UNUSED(status);
977
978    return ROK;
979
980 }
981 #endif /*--ifdef PTRGUICRG--*/
982
983 #ifdef PTRGUIRGU
984 \f
985 /**
986 * @brief Confirmation from MAC to RLC for the bind/Unbind 
987  * request for the interface saps
988 *
989 * @details
990 *
991 *     Function : PtUiRguBndCfm
992 *
993 *  @param[in]   Pst*  pst
994 *  @param[in]   SuId  suId
995 *  @param[in]   uint8_t  status
996 *  @return   S16
997 *      -# ROK
998 **/
999 S16 PtUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
1000 {
1001
1002    UNUSED(pst);
1003    UNUSED(suId);
1004    UNUSED(status);
1005
1006    return ROK;
1007
1008 }
1009
1010
1011 \f
1012 /**
1013 * @brief Data Indication from MAC to RLC to 
1014  * forward the data received for common channels
1015 *
1016 * @details
1017 *
1018 *     Function : PtUiRguCDatInd
1019 *
1020 *  @param[in]   Pst*  pst
1021 *  @param[in]   SuId  suId
1022 *  @param[in]   RguCDatIndInfo  *  datInd
1023 *  @return   S16
1024 *      -# ROK
1025 **/
1026 S16 PtUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo  *datInd)
1027 {
1028
1029    UNUSED(pst);
1030    UNUSED(suId);
1031    UNUSED(datInd);
1032
1033    return ROK;
1034
1035 }
1036
1037
1038 \f
1039 /**
1040 * @brief Data Indication from MAC to RLC to 
1041  * forward the data received for dedicated channels
1042 *
1043 * @details
1044 *
1045 *     Function : PtUiRguDDatInd
1046 *
1047 *  @param[in]   Pst*  pst
1048 *  @param[in]   SuId  suId
1049 *  @param[in]   RguDDatIndInfo  *  datInd
1050 *  @return   S16
1051 *      -# ROK
1052 **/
1053 S16 PtUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo  *datInd)
1054 {
1055
1056    UNUSED(pst);
1057    UNUSED(suId);
1058    UNUSED(datInd);
1059
1060    return ROK;
1061
1062 }
1063
1064
1065 \f
1066 /**
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.
1071 *
1072 * @details
1073 *
1074 *     Function : PtUiRguCStaInd
1075 *
1076 *  @param[in]   Pst*  pst
1077 *  @param[in]   SuId  suId
1078 *  @param[in]   RguCStaIndInfo  *  staInd
1079 *  @return   S16
1080 *      -# ROK
1081 **/
1082 S16 PtUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
1083 {
1084
1085    UNUSED(pst);
1086    UNUSED(suId);
1087    UNUSED(staInd);
1088
1089    return ROK;
1090
1091 }
1092
1093
1094 \f
1095 /**
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.
1100 *
1101 * @details
1102 *
1103 *     Function : PtUiRguDStaInd
1104 *
1105 *  @param[in]   Pst*  pst
1106 *  @param[in]   SuId  suId
1107 *  @param[in]   RguDStaIndInfo  *  staInd
1108 *  @return   S16
1109 *      -# ROK
1110 **/
1111 S16 PtUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo *staInd)
1112 {
1113
1114    UNUSED(pst);
1115    UNUSED(suId);
1116    UNUSED(staInd);
1117
1118    return ROK;
1119
1120 }
1121 #ifdef LTE_L2_MEAS
1122 /* TODO: Function Header */
1123 S16 PtUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
1124 {
1125
1126    UNUSED(pst);
1127    UNUSED(suId);
1128    UNUSED(harqStatusInd);
1129
1130    return ROK;
1131
1132 }
1133 #endif /* LTE_L2_MEAS */
1134
1135 S16 PtUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
1136 {
1137
1138    UNUSED(pst);
1139    UNUSED(suId);
1140    UNUSED(flowCntrlInd);
1141
1142    return ROK;
1143
1144 }
1145 \f
1146 #endif /*--ifdef PTRGUIRGU--*/
1147
1148 #ifdef PTRGUIRGR
1149 \f
1150 /**
1151 * @brief Confirmation from MAC to RRM for the bind/Unbind 
1152  * request for the interface saps
1153 *
1154 * @details
1155 *
1156 *     Function : PtUiRgrBndCfm
1157 *
1158 *  @param[in]   Pst*  pst
1159 *  @param[in]   SuId  suId
1160 *  @param[in]   uint8_t  status
1161 *  @return   S16
1162 *      -# ROK
1163 **/
1164 S16 PtUiRgrBndCfm(Pst* pst,SuId suId,uint8_t status)
1165 {
1166
1167    UNUSED(pst);
1168    UNUSED(suId);
1169    UNUSED(status);
1170
1171    return ROK;
1172
1173 }
1174
1175 /* Added for sending TTI tick to RRM */
1176 \f
1177 /**
1178 * @brief TTI indication from MAC to RGR user.
1179 *
1180 * @details
1181 *
1182 *     Function : PtUiRgrTtiInd
1183 *
1184 *  @param[in]   Pst*  pst
1185 *  @param[in]   SuId  suId
1186 *  @param[in]   RgrTtiIndInfo  *ttiInd
1187 *  @return   S16
1188 *      -# ROK
1189 **/
1190 S16 PtUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
1191 {
1192
1193    UNUSED(pst);
1194    UNUSED(suId);
1195    UNUSED(ttiInd);
1196
1197    return ROK;
1198
1199 }
1200
1201
1202 \f
1203 /**
1204 * @brief Configuration Confirm from MAC to RRM
1205 *
1206 * @details
1207 *
1208 *     Function : PtUiRgrCfgCfm
1209 *
1210 *  @param[in]   Pst*  pst
1211 *  @param[in]   SuId  suId
1212 *  @param[in]   RgrCfgTransId  transId
1213 *  @param[in]   uint8_t  status
1214 *  @return   S16
1215 *      -# ROK
1216 **/
1217 S16 PtUiRgrCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
1218 {
1219
1220    UNUSED(pst);
1221    UNUSED(suId);
1222    UNUSED(transId);
1223    UNUSED(status);
1224
1225    return ROK;
1226
1227 }
1228
1229 /* Added for SI Enhancement*/
1230 #ifdef RGR_SI_SCH
1231 /**
1232 * @brief SI Configuration Confirm from MAC to RRM
1233 *
1234 * @details
1235 *
1236 *     Function : PtUiRgrSiCfgCfm
1237 *
1238 *  @param[in]   Pst*  pst
1239 *  @param[in]   SuId  suId
1240 *  @param[in]   RgrCfgTransId  transId
1241 *  @param[in]   uint8_t  status
1242 *  @return   S16
1243 *      -# ROK
1244 **/
1245 S16 PtUiRgrSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
1246 {
1247
1248    UNUSED(pst);
1249    UNUSED(suId);
1250    UNUSED(transId);
1251    UNUSED(status);
1252
1253    return ROK;
1254
1255 }
1256
1257 /**
1258 * @brief Warning SI Configuration Confirm from MAC to RRM
1259 *
1260 * @details
1261 *
1262 *     Function : PtUiRgrWarningSiCfgCfm
1263 *
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
1269 *  @return   S16
1270 *      -# ROK
1271 **/
1272 S16 PtUiRgrWarningSiCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t siId,uint8_t status)
1273 {
1274    UNUSED(pst);
1275    UNUSED(suId);
1276    UNUSED(transId);
1277    UNUSED(siId);
1278    UNUSED(status);
1279
1280    return ROK;
1281 }
1282 #endif/* RGR_SI_SCH */
1283
1284 \f
1285 /* ccpu00117452 - MOD - Changed macro name from
1286    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1287 #ifdef RGR_CQI_REPT
1288 /**
1289 * @brief STA indication from MAC to RGR user.
1290 *
1291 * @details
1292 *
1293 *     Function : PtUiRgrStaInd
1294 *
1295 *  @param[in]   Pst*  pst
1296 *  @param[in]   SuId  suId
1297 *  @param[in]   RgrStaIndInfo  *staInd
1298 *  @return   S16
1299 *      -# ROK
1300 **/
1301 S16 PtUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
1302 {
1303
1304    UNUSED(pst);
1305    UNUSED(suId);
1306    UNUSED(staInd);
1307
1308    return ROK;
1309
1310 }
1311 #endif /* End of RGR_CQI_REPT */
1312 /* LTE_ADV_FLAG_REMOVED_START */
1313 /**
1314  * @brief LOAD INF indication from MAC to RGR user.
1315  *
1316  * @details
1317  *
1318  *     Function : PtUiRgrLoadInfInd
1319  *
1320  *  @param[in]   Pst*  pst
1321  *  @param[in]   SuId  suId
1322  *  @param[in]   RgrLoadInfIndInfo  *loadInfInd
1323  *  @return   S16
1324  *      -# ROK
1325  **/
1326 S16 PtUiRgrLoadInfInd( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd )
1327 {
1328
1329    UNUSED(pst);
1330    UNUSED(suId);
1331    UNUSED(loadInfInd);
1332
1333    return ROK;
1334
1335 }
1336 /* LTE_ADV_FLAG_REMOVED_END */
1337
1338 /**
1339 * @brief STA indication from MAC to RGR user.
1340 *
1341 * @details
1342 *
1343 *     Function : PtUiRgrUeStaInd
1344 *
1345 *  @param[in]   Pst*  pst
1346 *  @param[in]   SuId  suId
1347 *  @param[in]   RgrUeStaIndInfo  *ueStaInd
1348 *  @return   S16
1349 *      -# ROK
1350 **/
1351 S16 PtUiRgrUeStaInd(Pst* pst,SuId suId,RgrUeStaIndInfo  *ueStaInd)
1352 {
1353
1354    UNUSED(pst);
1355    UNUSED(suId);
1356    UNUSED(ueStaInd);
1357
1358    return ROK;
1359
1360 }
1361 #endif /*--ifdef PTRGUIRGR--*/
1362
1363
1364 #ifdef PTRGUIRGM
1365 /**
1366 * @brief Confirmation from MAC to RRM for the bind/Unbind 
1367  * request for the interface saps via RGM interface
1368 *
1369 * @details
1370 *
1371 *     Function : PtUiRgmBndCfm
1372 *
1373 *  @param[in]   Pst*  pst
1374 *  @param[in]   SuId  suId
1375 *  @param[in]   uint8_t  status
1376 *  @return   S16
1377 *      -# ROK
1378 **/
1379 S16 PtUiRgmBndCfm(Pst* pst,SuId suId,uint8_t status)
1380 {
1381
1382    UNUSED(pst);
1383    UNUSED(suId);
1384    UNUSED(status);
1385
1386    return ROK;
1387
1388 }
1389
1390 /**
1391 * @brief Average PRB indication from MAC to RRM
1392 *
1393 * @details
1394 *
1395 *     Function : PtUiRgmPrbRprtInd
1396 *
1397 *  @param[in]   Pst*  pst
1398 *  @param[in]   SuId  suId
1399 *  @param[in]   RgrUeStaIndInfo  *ueStaInd
1400 *  @return   S16
1401 *      -# ROK
1402 **/
1403 S16 PtUiRgmPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1404 {
1405
1406    UNUSED(pst);
1407    UNUSED(suId);
1408    UNUSED(prbRprtInd);
1409
1410    return ROK;
1411
1412 }
1413
1414 /**
1415 * @brief Transmission Mode Change indication from MAC to RRM
1416 *
1417 * @details
1418 *
1419 *     Function : PtUiRgmTransModeInd
1420 *
1421 *  @param[in]   Pst*  pst
1422 *  @param[in]   SuId  suId
1423 *  @param[in]   RgmTransModeInd *transModeInd
1424 *  @return   S16
1425 *      -# ROK
1426 **/
1427 S16 PtUiRgmTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1428 {
1429
1430    UNUSED(pst);
1431    UNUSED(suId);
1432    UNUSED(transModeInd);
1433
1434    return ROK;
1435
1436 }
1437 #endif
1438
1439 /**
1440 * @brief Average PRB indication from MAC to RRM
1441 *
1442 * @details
1443 *
1444 *     Function : RgUiRgmSendPrbRprtInd
1445 *
1446 *  @param[in]   Pst*  pst
1447 *  @param[in]   SuId  suId
1448 *  @param[in]   RgmPrbRprtInd prbRprtInd
1449 *  @return   S16
1450 *      -# ROK
1451 **/
1452 S16 RgUiRgmSendPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1453 {
1454    return ((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
1455 }
1456
1457 /**
1458 * @brief Transmission Mode change indication from MAC to RRM
1459 *
1460 * @details
1461 *
1462 *     Function : RgUiRgmChangeTransModeInd
1463 *
1464 *  @param[in]   Pst*  pst
1465 *  @param[in]   SuId  suId
1466 *  @param[in]   RgmTransModeInd transModeInd
1467 *  @return   S16
1468 *      -# ROK
1469 **/
1470 S16 RgUiRgmChangeTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1471 {
1472    return ((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
1473 }
1474
1475 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
1476 static S16 RgUiRguDDatIndRbuf(RguDDatIndInfo  *datInd)
1477 {
1478       S16  ret = ROK;
1479       Void *elem = NULLP;
1480       RguDedDatInd1 *rguDatIndl = NULLP;
1481       elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1482       rguDatIndl = (RguDedDatInd1 *) elem;
1483       if (NULLP == elem)
1484       {
1485          SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
1486          uint32_t i,j;
1487          for(i = 0; i< datInd->numLch; i++)
1488          {
1489             for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
1490             {
1491                if(datInd->lchData[i].pdu.mBuf[j])
1492                {
1493                   ODU_PUT_MSG_BUF(datInd->lchData[i].pdu.mBuf[j]);
1494                }
1495             }
1496          }
1497          rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
1498          ret = RFAILED;
1499       }
1500       else
1501       {
1502          rguDatIndl->msg = datInd;
1503          SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1504          SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
1505       }
1506   return (ret);
1507 }
1508 #endif
1509 #ifdef RLC_MAC_DAT_REQ_RBUF
1510 S16 rgDlDatReqBatchProc
1511 (
1512 Void
1513 )
1514 {
1515 /* Read from Ring Buffer and process PDCP packets */
1516
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)
1524    {
1525       datReqRing= (RguInfoRingElem *)elmIndx;
1526       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].nPktProc++;//Number of pkt processed in tti
1527       if(datReqRing->msg)
1528       {
1529          if(datReqRing->event == EVTRGUDDATREQ)
1530          {
1531          RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
1532          }
1533          else
1534          { 
1535           //  printf("CSHP:*** Received CDatReq in MAC Ring  \n");
1536          RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg); 
1537          }
1538       }
1539       else
1540       {
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*/
1544               if(datReqRing->msg)
1545               {
1546                       if(datReqRing->event == EVTRGUDDATREQ)
1547                               RgUiRguDDatReq(&rgDDatRbfuPst, datReqRing->spId, (RguDDatReqInfo *) datReqRing->msg);
1548                       else 
1549                               RgUiRguCDatReq(&rgCDatRbfuPst, datReqRing->spId, (RguCDatReqInfo *) datReqRing->msg); 
1550               }else 
1551               {
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);
1554               } 
1555       }
1556       datReqRing->msg=NULLP;
1557       SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ);
1558       datReqRing->event=0; 
1559       elmIndx = NULLP;
1560       datReqRing= NULLP;
1561       rngBufDeqIndx++;
1562
1563       if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_DAT_REQ_DQ_CNT)
1564         break;
1565
1566       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ)) == NULLP)
1567       break;
1568    }
1569  
1570    return ROK;
1571 }
1572 #endif 
1573
1574 #ifdef RLC_MAC_STA_RSP_RBUF
1575 S16 rgDlStaRspBatchProc(Void)
1576 {
1577 /* Read from Ring Buffer and process PDCP packets */
1578
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;
1584
1585    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1586    while(NULLP != elmIndx)
1587    {
1588       staRspRing= (RguInfoRingElem *)elmIndx;
1589       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].nPktProc++;//Number of pkt processed in tti
1590       
1591       if(staRspRing->msg!= NULLP)
1592       {
1593          if( staRspRing->event == EVTRGUDSTARSP)
1594          {
1595          RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
1596          }
1597          else
1598          {
1599          RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
1600          } 
1601       }
1602       else
1603       {
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)
1608               {
1609                       if( staRspRing->event == EVTRGUDSTARSP)
1610                               RgUiRguDStaRsp(&rgDStaRbfuPst, staRspRing->spId, (RguDStaRspInfo *) staRspRing->msg);
1611                       else  
1612                               RgUiRguCStaRsp(&rgCStaRbfuPst, staRspRing->spId, (RguCStaRspInfo *) staRspRing->msg);
1613               }else 
1614               {
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);
1617               } 
1618       }
1619       staRspRing->msg=NULLP;
1620       SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1621       staRspRing->event =0;    
1622       elmIndx = NULLP;
1623       staRspRing= NULLP;
1624
1625       rngBufDeqIndx++;
1626
1627       if(rngBufDeqIndx >= SS_RNG_MAX_DLRLC_TO_DLMAC_STA_RSP_DQ_CNT)
1628         break;
1629
1630       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
1631       break;
1632    }
1633  
1634    return ROK;
1635 }
1636 #endif 
1637 #ifdef LTE_L2_MEAS
1638 #ifdef MAC_RLC_HARQ_STA_RBUF
1639 S16 RgUiRguHqStaIndRbuf (Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
1640 {
1641    S16  ret = ROK;
1642    Void *elem = NULLP;
1643    RguHarqStaInd *harqStaInd = NULLP;
1644    elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
1645    harqStaInd = (RguHarqStaInd*) elem;
1646    if (NULLP == elem )
1647    {
1648       SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
1649       ret = RFAILED;
1650    }
1651    else
1652    {
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++;
1657    }
1658    return (ret);
1659 }
1660 #endif
1661 #endif
1662
1663 \f
1664 /**********************************************************************
1665  
1666          End of file
1667 **********************************************************************/