[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[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 #endif /*--#ifdef PTRGUIRGR--*/
153
154 #ifdef PTRGUIRGM
155 S16 PtUiRgmPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
156 S16 PtUiRgmTransModeInd  ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
157 #endif
158 S16 RgUiRgmSendPrbRprtInd ARGS((Pst* pst, SuId suId, RgmPrbRprtInd *prbRprtInd));
159 S16 RgUiRgmChangeTransModeInd ARGS((Pst* pst, SuId suId, RgmTransModeInd *transModeInd));
160
161 S16 RgUiRguFlowCntrlInd ARGS((Pst* pst, SuId suId, RguFlowCntrlInd *flowCntrlInd));
162 /* Added for sending TTI tick to RRM */
163 /** @brief TTI indication from MAC to RRM */
164 static const RgrTtiInd RgUiRgrTtiIndMt[RG_MAX_RGR_USR] =
165 {
166 #ifdef LCRGUIRGR
167    cmPkRgrTtiInd,
168 #else
169    PtUiRgrTtiInd,
170 #endif
171 #ifdef NX
172    NxLiRgrTtiInd,
173 #else
174    PtUiRgrTtiInd,
175 #endif
176 };
177
178 /** @brief Configuration Confirm from MAC to RRM */
179 static const RgrCfgCfm RgUiRgrCfgCfmMt[RG_MAX_RGR_USR] =
180 {
181 #ifdef LCRGUIRGR
182    cmPkRgrCfgCfm,
183 #else
184    PtUiRgrCfgCfm,
185 #endif
186 #ifdef NX
187    NxLiRgrCfgCfm,
188 #endif
189 };
190
191 /* Added for SI Enhancement*/
192 /** @brief Confirmation from MAC to RRC for the bind/Unbind 
193  * request for the interface saps */
194 static const CrgBndCfm RgUiCrgBndCfmMt[RG_MAX_CRG_USR] =
195 {
196 #ifdef LCRGUICRG
197    cmPkCrgBndCfm,
198 #else
199    PtUiCrgBndCfm,
200 #endif
201 #ifdef NH
202    NhLiCrgBndCfm,
203 #else
204    PtUiCrgBndCfm,
205 #endif
206 };
207
208 /** @brief Configuration Confirm from MAC to RRC */
209 static const CrgCfgCfm RgUiCrgCfgCfmMt[RG_MAX_CRG_USR] =
210 {
211 #ifdef LCRGUICRG
212    cmPkCrgCfgCfm,
213 #else
214    PtUiCrgCfgCfm,
215 #endif
216 #ifdef NH
217    NhLiCrgCfgCfm,
218 #else
219    PtUiCrgCfgCfm,
220 #endif
221 };
222
223
224 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
225  * request for the interface saps */
226 static const RguBndCfm RgUiRguBndCfmMt[RG_MAX_RGU_USR] =
227 {
228 #ifdef LCRGUIRGU
229    cmPkRguBndCfm,
230 #else
231    PtUiRguBndCfm,
232 #endif
233 #ifdef KW
234    RlcLiRguBndCfm,
235 #else
236    PtUiRguBndCfm,
237 #endif
238 #ifdef LWLCRGUIRGU
239    cmPkRguBndCfm,
240 #else
241    PtUiRguBndCfm,
242 #endif
243 };
244
245 /** @brief Data Indication from MAC to RLC to 
246  * forward the data received for common channels*/
247 static const RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
248 {
249 #ifdef LCRGUIRGU
250 //   cmPkRguCDatInd, /* TODO : Call packRcvdUlData instead */
251 #else
252    PtUiRguCDatInd,
253 #endif
254 #ifdef KW
255    //RlcProcCommLcUlData,
256 #else
257    PtUiRguCDatInd,
258 #endif
259 #ifdef LWLCRGUIRGU
260 //   cmPkRguCDatInd, /* TODO:Call packRcvdUlData instead */
261 #else
262    PtUiRguCDatInd,
263 #endif
264 };
265
266 /** @brief Data Indication from MAC to RLC to 
267  * forward the data received for dedicated channels*/
268 static const RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
269 {
270 #ifdef LCRGUIRGU
271 //   cmPkRguDDatInd,  /* TODO: Call packRcvdUlData instead */
272 #else
273    PtUiRguDDatInd,
274 #endif
275 #ifdef KW
276    //RlcProcDedLcUlData,
277 #else
278    PtUiRguDDatInd,
279 #endif
280 #ifdef LWLCRGUIRGU
281 //   cmPkRguDDatInd, /* TODO: Call packRcvdUlData instead */
282 #else
283    PtUiRguDDatInd,
284 #endif
285 };
286
287 /** @brief Status Indication from MAC to RLC  
288  * as a response to the staRsp primitive from RLC.
289  * Informs RLC of the totalBufferSize and Timing Info 
290  * for the transmission on common channels. */
291 static const RguCStaInd RgUiRguCStaIndMt[RG_MAX_RGU_USR] =
292 {
293 #ifdef LCRGUIRGU
294    //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
295 #else
296    PtUiRguCStaInd,
297 #endif
298 #ifdef KW
299    //RlcMacProcSchedRep,
300 #else
301    PtUiRguCStaInd,
302 #endif
303 #ifdef LWLCRGUIRGU
304    //cmPkRguCStaInd, /* TODO: Call packSchedRep instead of cmPkRguCStaInd */
305 #else
306    PtUiRguCStaInd,
307 #endif
308 };
309
310 /** @brief Status Indication from MAC to RLC  
311  * as a response to the staRsp primitive from RLC.
312  * Informs RLC of the totalBufferSize and Timing Info 
313  * for the transmission on dedicated channels. */
314 static const RguDStaInd RgUiRguDStaIndMt[RG_MAX_RGU_USR] =
315 {
316 #ifdef LCRGUIRGU
317    //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
318 #else
319    PtUiRguDStaInd,
320 #endif
321 #ifdef KW
322    //RlcMacProcSchedRep,
323 #else
324    PtUiRguDStaInd,
325 #endif
326 #ifdef LWLCRGUIRGU
327    //cmPkRguDStaInd, /* TODO: Call packSchedRep instead of cmPkRguDStaInd */
328 #else
329    PtUiRguDStaInd,
330 #endif
331 };
332
333 #ifdef LTE_L2_MEAS
334 /** @brief HARQ Status Indication from MAC to RLC  
335  * as a response to the DdatReq primitive from RLC.
336  * Informs RLC of the successful transmission of TB's 
337  * (ACK/NACK) along with Mapping Info. */
338 static const RguHqStaInd RgUiRguHqStaIndMt[RG_MAX_RGU_USR] =
339 {
340 #ifdef LCRGUIRGU
341    cmPkRguHqStaInd,
342 #else
343    PtUiRguHqStaInd,
344 #endif
345 #ifdef KW
346    RlcLiRguHqStaInd,
347 #else
348    PtUiRguHqStaInd,
349 #endif
350 #ifdef LWLCRGUIRGU
351    cmPkRguHqStaInd,
352 #else
353    PtUiRguHqStaInd,
354 #endif
355 };
356 #endif /* LTE_L2_MEAS */
357
358 /* ccpu00117452 - MOD - Changed macro name from
359    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
360 #ifdef RGR_CQI_REPT
361 /** @brief TTI indication from MAC to RRM */
362 static const RgrStaInd RgUiRgrStaIndMt[RG_MAX_RGR_USR] =
363 {
364 #ifdef LCRGUIRGR
365    cmPkRgrStaInd,
366 #else
367    PtUiRgrStaInd,
368 #endif
369 #ifdef NX
370    NxLiRgrStaInd,
371 #else
372    PtUiRgrStaInd,
373 #endif
374 };
375 #endif /* RGR_CQI_REPT */
376
377 /* LTE_ADV_FLAG_REMOVED_START */
378 /** @brief LOAD INF indication from MAC to RRM */
379 static const RgrLoadInfInd RgUiRgrLoadInfIndMt[RG_MAX_RGR_USR] =
380 {
381 #ifdef LCRGUIRGR
382    cmPkRgrLoadInfInd,
383 #else
384    PtUiRgrLoadInfInd,
385 #endif
386 #ifdef NX
387    NxLiRgrLoadInfInd,
388 #else
389    PtUiRgrLoadInfInd,
390 #endif
391 };
392 /* LTE_ADV_FLAG_REMOVED_END */
393
394 /** @brief TTI indication from MAC to RRM */
395 static const RgrUeStaInd RgUiRgrUeStaIndMt[RG_MAX_RGR_USR] =
396 {
397 #ifdef LCRGUIRGR
398    cmPkRgrUeStaInd,
399 #else
400    PtUiRgrUeStaInd,
401 #endif
402 #ifdef NX
403    NxLiRgrUeStaInd,
404 #else
405    PtUiRgrUeStaInd,
406 #endif
407 };
408
409 /** @brief Average PRB usage indication from MAC to RRM */
410 static const RgmPrbRprtIndFptr RgUiRgmSendPrbRprtIndMt[RG_MAX_RGM_USR] =
411 {
412 #ifdef RGM_LC
413    cmPkRgmPrbRprtInd,
414 #else
415    PtUiRgmPrbRprtInd,
416 #endif
417 #ifdef RM
418    RmLiRgmPrbRprtInd,
419 #else
420    PtUiRgmPrbRprtInd,
421 #endif
422 };
423
424
425 /** @brief Transmission Mode Change indication from MAC to RRM */
426 static const RgmTransModeIndFptr RgUiRgmChangeTransModeIndMt[RG_MAX_RGM_USR] =
427 {
428 #ifdef RGM_LC
429    cmPkRgmTransModeInd,
430 #else
431    PtUiRgmTransModeInd,
432 #endif
433 #ifdef RM
434    RmLiRgmTransModeInd,
435 #else
436    PtUiRgmTransModeInd,
437 #endif
438 };
439
440 static const RguFlowCntrlIndInfo RgUiRguFlowCntrlIndMt[RG_MAX_RGU_USR] =
441 {
442 #ifdef LCRGUIRGU
443    cmPkRguFlowCntrlInd,
444 #else
445    PtUiRguFlowCntrlInd,
446 #endif
447 #ifdef KW
448    RlcLiRguFlowCntrlInd,
449 #else
450    PtUiRguFlowCntrlInd,
451 #endif
452 #ifdef LWLCRGUIRGU
453    cmPkRguFlowCntrlInd,
454 #else
455    PtUiRguFlowCntrlInd,
456 #endif
457 };
458 #ifdef __cplusplus
459 }
460 #endif /* __cplusplus */
461
462 #ifdef RG
463
464 /* Added for sending TTI tick to RRM */
465 \f
466 /**
467 * @brief TTI indication from MAC to RGR user.
468 *
469 * @details
470 *
471 *     Function : RgUiRgrTtiInd
472 *
473 *  @param[in]   Pst*  pst
474 *  @param[in]   SuId  suId
475 *  @param[in]   RgrTtiIndInfo  ttiInd
476 *  @return   S16
477 *      -# ROK
478 **/
479 S16 RgUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
480 {
481
482    return ((*RgUiRgrTtiIndMt[pst->selector])(pst, suId, ttiInd));
483
484 }
485
486
487 \f
488 /**
489 * @brief Configuration Confirm from MAC to RRM
490 *
491 * @details
492 *
493 *     Function : RgUiRgrCfgCfm
494 *
495 *  @param[in]   Pst*  pst
496 *  @param[in]   SuId  suId
497 *  @param[in]   RgrCfgTransId  transId
498 *  @param[in]   uint8_t  status
499 *  @return   S16
500 *      -# ROK
501 **/
502 S16 RgUiRgrCfgCfm(Pst* pst,RgrCfgTransId transId,uint8_t status)
503 {
504
505    return ((*RgUiRgrCfgCfmMt[pst->selector])(pst, transId, status));
506
507 }
508
509 \f
510 /**
511 * @brief Confirmation from MAC to RRC for the bind/Unbind 
512  * request for the interface saps
513 *
514 * @details
515 *
516 *     Function : RgUiCrgBndCfm
517 *
518 *  @param[in]   Pst*  pst
519 *  @param[in]   SuId  suId
520 *  @param[in]   uint8_t  status
521 *  @return   S16
522 *      -# ROK
523 **/
524 S16 RgUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
525 {
526
527    return ((*RgUiCrgBndCfmMt[pst->selector])(pst, suId, status));
528
529 }
530
531
532 \f
533 /**
534 * @brief Configuration Confirm from MAC to RRC
535 *
536 * @details
537 *
538 *     Function : RgUiCrgCfgCfm
539 *
540 *  @param[in]   Pst*  pst
541 *  @param[in]   SuId  suId
542 *  @param[in]   CrgCfgTransId  transId
543 *  @param[in]   uint8_t  status
544 *  @return   S16
545 *      -# ROK
546 **/
547 S16 RgUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
548 {
549
550    return ((*RgUiCrgCfgCfmMt[pst->selector])(pst, suId, transId, status));
551
552 }
553
554 \f
555 /**
556 * @brief Confirmation from MAC to RLC for the bind/Unbind 
557  * request for the interface saps
558 *
559 * @details
560 *
561 *     Function : RgUiRguBndCfm
562 *
563 *  @param[in]   Pst*  pst
564 *  @param[in]   SuId  suId
565 *  @param[in]   uint8_t  status
566 *  @return   S16
567 *      -# ROK
568 **/
569 S16 RgUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
570 {
571
572    return ((*RgUiRguBndCfmMt[pst->selector])(pst, suId, status));
573
574 }
575
576 int macDDatIndSnt;
577 int macCDatIndSnt;
578
579 \f
580 /**
581 * @brief Data Indication from MAC to RLC to 
582  * forward the data received for common channels
583 *
584 * @details
585 *
586 *     Function : RgUiRguCDatInd
587 *
588 *  @param[in]   Pst*  pst
589 *  @param[in]   SuId  suId
590 *  @param[in]   RguCDatIndInfo  *  datInd
591 *  @return   S16
592 *      -# ROK
593 **/
594 S16 RgUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo *datInd)
595 {
596    macCDatIndSnt++;
597
598    return ((*RgUiRguCDatIndMt[pst->selector])(pst, suId, datInd));
599
600 }
601
602 \f
603 /**
604 * @brief Data Indication from MAC to RLC to 
605  * forward the data received for dedicated channels
606 *
607 * @details
608 *
609 *     Function : RgUiRguDDatInd
610 *
611 *  @param[in]   Pst*  pst
612 *  @param[in]   SuId  suId
613 *  @param[in]   RguDDatIndInfo  *  datInd
614 *  @return   S16
615 *      -# ROK
616 **/
617 S16 RgUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo *datInd)
618 {
619    macDDatIndSnt++;
620
621 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
622    return (RgUiRguDDatIndRbuf(datInd));
623 #else 
624    return ((*RgUiRguDDatIndMt[pst->selector])(pst, suId, datInd));
625 #endif    
626 }
627
628
629 \f
630 /**
631 * @brief Status Indication from MAC to RLC  
632  * as a response to the staRsp primitive from RLC.
633  * Informs RLC of the totalBufferSize and Timing Info 
634  * for the transmission on common channels.
635 *
636 * @details
637 *
638 *     Function : RgUiRguCStaInd
639 *
640 *  @param[in]   Pst*  pst
641 *  @param[in]   SuId  suId
642 *  @param[in]   RguCStaIndInfo  *  staInd
643 *  @return   S16
644 *      -# ROK
645 **/
646 S16 RgUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
647 {
648
649    return ((*RgUiRguCStaIndMt[pst->selector])(pst, suId, staInd));
650
651 }
652
653
654 \f
655 /**
656 * @brief Status Indication from MAC to RLC  
657  * as a response to the staRsp primitive from RLC.
658  * Informs RLC of the totalBufferSize and Timing Info 
659  * for the transmission on dedicated channels.
660 *
661 * @details
662 *
663 *     Function : RgUiRguDStaInd
664 *
665 *  @param[in]   Pst*  pst
666 *  @param[in]   SuId  suId
667 *  @param[in]   RguDStaIndInfo  *  staInd
668 *  @return   S16
669 *      -# ROK
670 **/
671 S16 RgUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo  *staInd)
672 {
673
674    return ((*RgUiRguDStaIndMt[pst->selector])(pst, suId, staInd));
675
676 }
677 #ifdef LTE_L2_MEAS
678 /* TODO: Function header */
679 S16 RgUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
680 {
681
682 #if defined(SPLIT_RLC_DL_TASK) && defined(MAC_RLC_HARQ_STA_RBUF)
683    S16 ret=ROK;
684    ret = RgUiRguHqStaIndRbuf(pst,suId,harqStatusInd);
685    return (ret);
686 #else 
687    return ((*RgUiRguHqStaIndMt[pst->selector])(pst, suId, harqStatusInd));
688 #endif 
689
690 } /* RgUiRguHqStaInd */
691 #endif /* LTE_L2_MEAS */
692
693 S16 RgUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
694 {
695   return ((*RgUiRguFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlInd));
696 }
697 /* Added for SI Enhancement*/
698
699 \f
700 /* ccpu00117452 - MOD - Changed macro name from
701    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
702 #ifdef RGR_CQI_REPT
703 /**
704 * @brief STA indication from MAC to RGR user.
705 *
706 * @details
707 *
708 *     Function : RgUiRgrStaInd
709 *
710 *  @param[in]   Pst*  pst
711 *  @param[in]   SuId  suId
712 *  @param[in]   RgrStaIndInfo  *staInd
713 *  @return   S16
714 *      -# ROK
715 **/
716 S16 RgUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
717 {
718
719    return ((*RgUiRgrStaIndMt[pst->selector])(pst, suId, staInd));
720
721 }
722 #endif /* End of RGR_CQI_REPT */
723
724 /* LTE_ADV_FLAG_REMOVED_START */
725 /**
726  * @brief LOAD INF indication from MAC to RGR user.
727  *
728  * @details
729  *
730  *     Function : RgUiRgrLoadInfInd
731  *
732  *  @param[in]   Pst*  pst
733  *  @param[in]   SuId  suId
734  *  @param[in]   RgrLoadInfIndInfo  *loadInfInd
735  *  @return   S16
736  *      -# ROK
737  **/
738 S16 RgUiRgrLoadInfInd( Pst* pst, SuId suId,RgrLoadInfIndInfo *loadInfInd )
739 {
740
741    return ((*RgUiRgrLoadInfIndMt[pst->selector])(pst, suId, loadInfInd));
742
743 }
744 /* LTE_ADV_FLAG_REMOVED_END */
745
746 /**
747 * @brief UESTA indication from MAC to RGR user.
748 *
749 * @details
750 *
751 *     Function : RgUiRgrUeStaInd
752 *
753 *  @param[in]   Pst*  pst
754 *  @param[in]   SuId  suId
755 *  @param[in]   RgrStaIndInfo  *staInd
756 *  @return   S16
757 *      -# ROK
758 **/
759 S16 RgUiRgrUeStaInd(Pst  *pst,SuId  suId,RgrUeStaIndInfo *ueStaInd)
760 {
761
762    return ((*RgUiRgrUeStaIndMt[pst->selector])(pst, suId, ueStaInd));
763
764 }
765 #endif /*--ifdef RG--*/
766
767 #ifdef PTRGUICRG
768 \f
769 /**
770 * @brief Confirmation from MAC to RRC for the bind/Unbind 
771  * request for the interface saps
772 *
773 * @details
774 *
775 *     Function : PtUiCrgBndCfm
776 *
777 *  @param[in]   Pst*  pst
778 *  @param[in]   SuId  suId
779 *  @param[in]   uint8_t  status
780 *  @return   S16
781 *      -# ROK
782 **/
783 S16 PtUiCrgBndCfm(Pst* pst,SuId suId,uint8_t status)
784 {
785
786    UNUSED(pst);
787    UNUSED(suId);
788    UNUSED(status);
789
790    return ROK;
791
792 }
793
794
795 \f
796 /**
797 * @brief Configuration Confirm from MAC to RRC
798 *
799 * @details
800 *
801 *     Function : PtUiCrgCfgCfm
802 *
803 *  @param[in]   Pst*  pst
804 *  @param[in]   SuId  suId
805 *  @param[in]   CrgCfgTransId  transId
806 *  @param[in]   uint8_t  status
807 *  @return   S16
808 *      -# ROK
809 **/
810 S16 PtUiCrgCfgCfm(Pst* pst,SuId suId,CrgCfgTransId transId,uint8_t status)
811 {
812
813    UNUSED(pst);
814    UNUSED(suId);
815    UNUSED(transId);
816    UNUSED(status);
817
818    return ROK;
819
820 }
821 #endif /*--ifdef PTRGUICRG--*/
822
823 #ifdef PTRGUIRGU
824 \f
825 /**
826 * @brief Confirmation from MAC to RLC for the bind/Unbind 
827  * request for the interface saps
828 *
829 * @details
830 *
831 *     Function : PtUiRguBndCfm
832 *
833 *  @param[in]   Pst*  pst
834 *  @param[in]   SuId  suId
835 *  @param[in]   uint8_t  status
836 *  @return   S16
837 *      -# ROK
838 **/
839 S16 PtUiRguBndCfm(Pst* pst,SuId suId,uint8_t status)
840 {
841
842    UNUSED(pst);
843    UNUSED(suId);
844    UNUSED(status);
845
846    return ROK;
847
848 }
849
850
851 \f
852 /**
853 * @brief Data Indication from MAC to RLC to 
854  * forward the data received for common channels
855 *
856 * @details
857 *
858 *     Function : PtUiRguCDatInd
859 *
860 *  @param[in]   Pst*  pst
861 *  @param[in]   SuId  suId
862 *  @param[in]   RguCDatIndInfo  *  datInd
863 *  @return   S16
864 *      -# ROK
865 **/
866 S16 PtUiRguCDatInd(Pst* pst,SuId suId,RguCDatIndInfo  *datInd)
867 {
868
869    UNUSED(pst);
870    UNUSED(suId);
871    UNUSED(datInd);
872
873    return ROK;
874
875 }
876
877
878 \f
879 /**
880 * @brief Data Indication from MAC to RLC to 
881  * forward the data received for dedicated channels
882 *
883 * @details
884 *
885 *     Function : PtUiRguDDatInd
886 *
887 *  @param[in]   Pst*  pst
888 *  @param[in]   SuId  suId
889 *  @param[in]   RguDDatIndInfo  *  datInd
890 *  @return   S16
891 *      -# ROK
892 **/
893 S16 PtUiRguDDatInd(Pst* pst,SuId suId,RguDDatIndInfo  *datInd)
894 {
895
896    UNUSED(pst);
897    UNUSED(suId);
898    UNUSED(datInd);
899
900    return ROK;
901
902 }
903
904
905 \f
906 /**
907 * @brief Status Indication from MAC to RLC  
908  * as a response to the staRsp primitive from RLC.
909  * Informs RLC of the totalBufferSize and Timing Info 
910  * for the transmission on common channels.
911 *
912 * @details
913 *
914 *     Function : PtUiRguCStaInd
915 *
916 *  @param[in]   Pst*  pst
917 *  @param[in]   SuId  suId
918 *  @param[in]   RguCStaIndInfo  *  staInd
919 *  @return   S16
920 *      -# ROK
921 **/
922 S16 PtUiRguCStaInd(Pst* pst,SuId suId,RguCStaIndInfo *staInd)
923 {
924
925    UNUSED(pst);
926    UNUSED(suId);
927    UNUSED(staInd);
928
929    return ROK;
930
931 }
932
933
934 \f
935 /**
936 * @brief Status Indication from MAC to RLC  
937  * as a response to the staRsp primitive from RLC.
938  * Informs RLC of the totalBufferSize and Timing Info 
939  * for the transmission on dedicated channels.
940 *
941 * @details
942 *
943 *     Function : PtUiRguDStaInd
944 *
945 *  @param[in]   Pst*  pst
946 *  @param[in]   SuId  suId
947 *  @param[in]   RguDStaIndInfo  *  staInd
948 *  @return   S16
949 *      -# ROK
950 **/
951 S16 PtUiRguDStaInd(Pst* pst,SuId suId,RguDStaIndInfo *staInd)
952 {
953
954    UNUSED(pst);
955    UNUSED(suId);
956    UNUSED(staInd);
957
958    return ROK;
959
960 }
961 #ifdef LTE_L2_MEAS
962 /* TODO: Function Header */
963 S16 PtUiRguHqStaInd(Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
964 {
965
966    UNUSED(pst);
967    UNUSED(suId);
968    UNUSED(harqStatusInd);
969
970    return ROK;
971
972 }
973 #endif /* LTE_L2_MEAS */
974
975 S16 PtUiRguFlowCntrlInd(Pst* pst,SuId suId,RguFlowCntrlInd *flowCntrlInd)
976 {
977
978    UNUSED(pst);
979    UNUSED(suId);
980    UNUSED(flowCntrlInd);
981
982    return ROK;
983
984 }
985 \f
986 #endif /*--ifdef PTRGUIRGU--*/
987
988 #ifdef PTRGUIRGR
989 \f
990 /**
991 * @brief Confirmation from MAC to RRM for the bind/Unbind 
992  * request for the interface saps
993 *
994 * @details
995 *
996 *     Function : PtUiRgrBndCfm
997 *
998 *  @param[in]   Pst*  pst
999 *  @param[in]   SuId  suId
1000 *  @param[in]   uint8_t  status
1001 *  @return   S16
1002 *      -# ROK
1003 **/
1004 S16 PtUiRgrBndCfm(Pst* pst,SuId suId,uint8_t status)
1005 {
1006
1007    UNUSED(pst);
1008    UNUSED(suId);
1009    UNUSED(status);
1010
1011    return ROK;
1012
1013 }
1014
1015 /* Added for sending TTI tick to RRM */
1016 \f
1017 /**
1018 * @brief TTI indication from MAC to RGR user.
1019 *
1020 * @details
1021 *
1022 *     Function : PtUiRgrTtiInd
1023 *
1024 *  @param[in]   Pst*  pst
1025 *  @param[in]   SuId  suId
1026 *  @param[in]   RgrTtiIndInfo  *ttiInd
1027 *  @return   S16
1028 *      -# ROK
1029 **/
1030 S16 PtUiRgrTtiInd(Pst* pst,SuId suId,RgrTtiIndInfo *ttiInd)
1031 {
1032
1033    UNUSED(pst);
1034    UNUSED(suId);
1035    UNUSED(ttiInd);
1036
1037    return ROK;
1038
1039 }
1040
1041
1042 \f
1043 /**
1044 * @brief Configuration Confirm from MAC to RRM
1045 *
1046 * @details
1047 *
1048 *     Function : PtUiRgrCfgCfm
1049 *
1050 *  @param[in]   Pst*  pst
1051 *  @param[in]   SuId  suId
1052 *  @param[in]   RgrCfgTransId  transId
1053 *  @param[in]   uint8_t  status
1054 *  @return   S16
1055 *      -# ROK
1056 **/
1057 S16 PtUiRgrCfgCfm(Pst* pst,SuId suId,RgrCfgTransId transId,uint8_t status)
1058 {
1059
1060    UNUSED(pst);
1061    UNUSED(suId);
1062    UNUSED(transId);
1063    UNUSED(status);
1064
1065    return ROK;
1066
1067 }
1068
1069 /* Added for SI Enhancement*/
1070 \f
1071 /* ccpu00117452 - MOD - Changed macro name from
1072    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
1073 #ifdef RGR_CQI_REPT
1074 /**
1075 * @brief STA indication from MAC to RGR user.
1076 *
1077 * @details
1078 *
1079 *     Function : PtUiRgrStaInd
1080 *
1081 *  @param[in]   Pst*  pst
1082 *  @param[in]   SuId  suId
1083 *  @param[in]   RgrStaIndInfo  *staInd
1084 *  @return   S16
1085 *      -# ROK
1086 **/
1087 S16 PtUiRgrStaInd(Pst* pst,SuId suId,RgrStaIndInfo *staInd)
1088 {
1089
1090    UNUSED(pst);
1091    UNUSED(suId);
1092    UNUSED(staInd);
1093
1094    return ROK;
1095
1096 }
1097 #endif /* End of RGR_CQI_REPT */
1098 /* LTE_ADV_FLAG_REMOVED_START */
1099 /**
1100  * @brief LOAD INF indication from MAC to RGR user.
1101  *
1102  * @details
1103  *
1104  *     Function : PtUiRgrLoadInfInd
1105  *
1106  *  @param[in]   Pst*  pst
1107  *  @param[in]   SuId  suId
1108  *  @param[in]   RgrLoadInfIndInfo  *loadInfInd
1109  *  @return   S16
1110  *      -# ROK
1111  **/
1112 S16 PtUiRgrLoadInfInd( Pst* pst, SuId suId, RgrLoadInfIndInfo *loadInfInd )
1113 {
1114
1115    UNUSED(pst);
1116    UNUSED(suId);
1117    UNUSED(loadInfInd);
1118
1119    return ROK;
1120
1121 }
1122 /* LTE_ADV_FLAG_REMOVED_END */
1123
1124 /**
1125 * @brief STA indication from MAC to RGR user.
1126 *
1127 * @details
1128 *
1129 *     Function : PtUiRgrUeStaInd
1130 *
1131 *  @param[in]   Pst*  pst
1132 *  @param[in]   SuId  suId
1133 *  @param[in]   RgrUeStaIndInfo  *ueStaInd
1134 *  @return   S16
1135 *      -# ROK
1136 **/
1137 S16 PtUiRgrUeStaInd(Pst* pst,SuId suId,RgrUeStaIndInfo  *ueStaInd)
1138 {
1139
1140    UNUSED(pst);
1141    UNUSED(suId);
1142    UNUSED(ueStaInd);
1143
1144    return ROK;
1145
1146 }
1147 #endif /*--ifdef PTRGUIRGR--*/
1148
1149
1150 #ifdef PTRGUIRGM
1151
1152 /**
1153 * @brief Average PRB indication from MAC to RRM
1154 *
1155 * @details
1156 *
1157 *     Function : PtUiRgmPrbRprtInd
1158 *
1159 *  @param[in]   Pst*  pst
1160 *  @param[in]   SuId  suId
1161 *  @param[in]   RgrUeStaIndInfo  *ueStaInd
1162 *  @return   S16
1163 *      -# ROK
1164 **/
1165 S16 PtUiRgmPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1166 {
1167
1168    UNUSED(pst);
1169    UNUSED(suId);
1170    UNUSED(prbRprtInd);
1171
1172    return ROK;
1173
1174 }
1175
1176 /**
1177 * @brief Transmission Mode Change indication from MAC to RRM
1178 *
1179 * @details
1180 *
1181 *     Function : PtUiRgmTransModeInd
1182 *
1183 *  @param[in]   Pst*  pst
1184 *  @param[in]   SuId  suId
1185 *  @param[in]   RgmTransModeInd *transModeInd
1186 *  @return   S16
1187 *      -# ROK
1188 **/
1189 S16 PtUiRgmTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1190 {
1191
1192    UNUSED(pst);
1193    UNUSED(suId);
1194    UNUSED(transModeInd);
1195
1196    return ROK;
1197
1198 }
1199 #endif
1200
1201 /**
1202 * @brief Average PRB indication from MAC to RRM
1203 *
1204 * @details
1205 *
1206 *     Function : RgUiRgmSendPrbRprtInd
1207 *
1208 *  @param[in]   Pst*  pst
1209 *  @param[in]   SuId  suId
1210 *  @param[in]   RgmPrbRprtInd prbRprtInd
1211 *  @return   S16
1212 *      -# ROK
1213 **/
1214 S16 RgUiRgmSendPrbRprtInd(Pst* pst,SuId suId,RgmPrbRprtInd *prbRprtInd)
1215 {
1216    return ((*RgUiRgmSendPrbRprtIndMt[pst->selector])(pst, suId, prbRprtInd));
1217 }
1218
1219 /**
1220 * @brief Transmission Mode change indication from MAC to RRM
1221 *
1222 * @details
1223 *
1224 *     Function : RgUiRgmChangeTransModeInd
1225 *
1226 *  @param[in]   Pst*  pst
1227 *  @param[in]   SuId  suId
1228 *  @param[in]   RgmTransModeInd transModeInd
1229 *  @return   S16
1230 *      -# ROK
1231 **/
1232 S16 RgUiRgmChangeTransModeInd(Pst* pst,SuId suId,RgmTransModeInd *transModeInd)
1233 {
1234    return ((*RgUiRgmChangeTransModeIndMt[pst->selector])(pst, suId, transModeInd));
1235 }
1236
1237 #if defined(MAC_RLC_UL_RBUF) && !defined(SS_RBUF)
1238 static S16 RgUiRguDDatIndRbuf(RguDDatIndInfo  *datInd)
1239 {
1240       S16  ret = ROK;
1241       Void *elem = NULLP;
1242       RguDedDatInd1 *rguDatIndl = NULLP;
1243       elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1244       rguDatIndl = (RguDedDatInd1 *) elem;
1245       if (NULLP == elem)
1246       {
1247          SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktDrop++;
1248          uint32_t i,j;
1249          for(i = 0; i< datInd->numLch; i++)
1250          {
1251             for(j = 0; j < datInd->lchData[i].pdu.numPdu; j++)
1252             {
1253                if(datInd->lchData[i].pdu.mBuf[j])
1254                {
1255                   ODU_PUT_MSG_BUF(datInd->lchData[i].pdu.mBuf[j]);
1256                }
1257             }
1258          }
1259          rgFreeSharableSBuf((Data **)&datInd,sizeof(RguDDatIndInfo));
1260          ret = RFAILED;
1261       }
1262       else
1263       {
1264          rguDatIndl->msg = datInd;
1265          SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
1266          SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
1267       }
1268   return (ret);
1269 }
1270 #endif
1271
1272 #ifdef LTE_L2_MEAS
1273 #ifdef MAC_RLC_HARQ_STA_RBUF
1274 S16 RgUiRguHqStaIndRbuf (Pst* pst,SuId suId,RguHarqStatusInd *harqStatusInd)
1275 {
1276    S16  ret = ROK;
1277    Void *elem = NULLP;
1278    RguHarqStaInd *harqStaInd = NULLP;
1279    elem = SRngGetWIndx(SS_RNG_BUF_MAC_HARQ);
1280    harqStaInd = (RguHarqStaInd*) elem;
1281    if (NULLP == elem )
1282    {
1283       SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktDrop++;
1284       ret = RFAILED;
1285    }
1286    else
1287    {
1288       memcpy(&(harqStaInd->hqStatusInd), harqStatusInd, sizeof(RguHarqStatusInd));
1289       memcpy(&(harqStaInd->pst), pst, sizeof(Pst));
1290       SRngIncrWIndx(SS_RNG_BUF_MAC_HARQ);
1291       SsRngInfoTbl[SS_RNG_BUF_MAC_HARQ].pktRate++;
1292    }
1293    return (ret);
1294 }
1295 #endif
1296 #endif
1297
1298 \f
1299 /**********************************************************************
1300  
1301          End of file
1302 **********************************************************************/