[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / 5gnrmac / rg_ptmi.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 portable definitions for Layer Manager
26                Interface primitives.
27   
28      File:     rg_ptmi.c 
29   
30 **********************************************************************/
31
32 /** @file rg_ptmi.c
33 @brief This file contains the definitions for Layer Manager
34        Interface primitives that are invoked from MAC to Layer Manager
35        (Confirmations and Indications) Portable functions corresponding
36        to these primitives are also defined.
37 */
38
39 /* header include files (.h) */
40 #include "common_def.h"
41 #include "lrg.h"           /* LRG Interface defines */
42 /* header/extern include files (.x) */
43 #include "lrg.x"           /* LRG Interface includes */
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48
49 #if !(defined(LCRGMILRG) && defined(SM))
50 #define PTRGMILRG
51 #endif
52
53 #define RG_MAX_LRG_USR 2 
54
55 /* portable functions at LRG interface */
56 #ifdef PTRGMILRG
57 S16 PtMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
58 S16 PtMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
59 S16 PtMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
60 S16 PtMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
61 S16 PtMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
62 S16 PtMiLrgCntrlCfm ARGS((Pst *pst, RgMngmt *cfm));
63 S16 PtMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc,Buffer *mBuf));
64 #ifdef LTE_L2_MEAS
65 S16 PtMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *cfm));
66 S16 PtMiLrgSchL2MeasStopCfm ARGS((Pst *pst,LrgSchMeasCfmInfo *cfm ));
67 #endif
68 #endif
69
70 /* ***********LRG interface Mapping matrices ********************/
71
72 /** @brief Configuration Confirm primitive Matrix 
73  *  This matrix defines the mapping between the configuration confirm
74  *  primitive called by the upper interface of MAC layer and the 
75  *  corresponding primitives of the MAC layer service user(s).
76  *
77  *  The parameter RG_MAX_LRG_USR defines the maximum number of Layer 
78  *  managers of MAC at the LRG interface. This is an array of functions
79  *  per primitive invoked by MAC whose size is RG_MAX_LRG_USR.
80  * 
81  *  The dispatching is performed by the configurable variable: selector.
82  *  The selector is configured on a per SAP basis. The selectors are:
83  *
84  *  LCRGMILRG - loosely coupled LMK interface
85  *  TCRGMILRG - Tightly coupled LMK interface
86  *  
87  *  In a similar fashion, the matrices for Status, Statistics and
88  *  Control confirms and, Status and trace indications are defined.
89  **/
90 static const LrgCfgCfm RgMiLrgCfgCfmMt[RG_MAX_LRG_USR] =
91 {
92 #ifdef LCRGMILRG
93    cmPkLrgCfgCfm,                  /* 0 - loosely coupled */
94 #else
95    PtMiLrgCfgCfm,                  /* 0 - loosely coupled */
96 #endif
97 #ifdef SM 
98    SmMiLrgCfgCfm,                  /* 1 - Tightly coupled SM */
99 #else
100    //PtMiLrgCfgCfm,                  /* 1 - Tightly coupled SM  */
101 #endif
102 };
103
104 /** @brief Scheduler Config Confirm primitive Matrix */
105 static const LrgSchCfgCfm RgMiLrgSchCfgCfmMt[RG_MAX_LRG_USR] =
106 {
107 #ifdef LCRGMILRG
108    cmPkLrgSchCfgCfm,                  /* 0 - loosely coupled */
109 #else
110    PtMiLrgSchCfgCfm,                  /* 0 - loosely coupled */
111 #endif
112 #ifdef SM 
113    SmMiLrgSchCfgCfm,                  /* 1 - Tightly coupled SM */
114 #else
115    //PtMiLrgSchCfgCfm,                  /* 1 - Tightly coupled SM  */
116 #endif
117 };
118
119 /** @brief Statistics Confirm primitive Matrix */
120 static const LrgStsCfm RgMiLrgStsCfmMt[RG_MAX_LRG_USR] =
121 {
122 #ifdef LCRGMILRG
123    cmPkLrgStsCfm,                  /* 0 - loosely coupled */
124 #else
125    PtMiLrgStsCfm,                  /* 0 - loosely coupled */
126 #endif
127 #ifdef SM 
128    SmMiLrgStsCfm,                  /* 1 - Tightly coupled SM */
129 #else
130    PtMiLrgStsCfm,                  /* 1 - Tightly coupled SM  */
131 #endif
132 };
133
134 /** @brief Status Indication primitive Matrix */
135 static const LrgStaInd RgMiLrgStaIndMt[RG_MAX_LRG_USR] =
136 {
137 #ifdef LCRGMILRG
138    cmPkLrgStaInd,                  /* 0 - loosely coupled */
139 #else
140    PtMiLrgStaInd,                  /* 0 - loosely coupled */
141 #endif
142 #ifdef SM 
143    SmMiLrgStaInd,                  /* 1 - Tightly coupled SM */
144 #else
145    PtMiLrgStaInd,                  /* 1 - Tightly coupled SM  */
146 #endif
147 };
148
149 /** @brief Scheduler  Status Indication primitive Matrix */
150 static const LrgSchStaInd RgMiLrgSchStaIndMt[RG_MAX_LRG_USR] =
151 {
152 #ifdef LCRGMILRG
153    cmPkLrgSchStaInd,                  /* 0 - loosely coupled */
154 #else
155    PtMiLrgSchStaInd,                  /* 0 - loosely coupled */
156 #endif
157 #ifdef SM 
158    SmMiLrgSchStaInd,                  /* 1 - Tightly coupled SM */
159 #else
160    PtMiLrgSchStaInd,                  /* 1 - Tightly coupled SM  */
161 #endif
162 };
163
164 #ifdef LTE_L2_MEAS
165 /** @brief L2 Meas Cfm primitive Matrix */
166 static const LrgSchL2MeasCfm RgMiLrgSchL2mMeasCfmMt[RG_MAX_LRG_USR] =
167 {
168 #ifdef LCRGMILRG
169    cmPkLrgSchL2MeasCfm,                /* 0 - loosely coupled */
170 #else
171    PtMiLrgSchL2MeasCfm,                  /* 0 - loosely coupled */
172 #endif
173 #ifdef SM 
174    SmMiLrgSchL2MeasCfm,                  /* 1 - Tightly coupled SM */
175 #else
176    PtMiLrgSchL2MeasCfm,                  /* 1 - loosely coupled */
177 #endif
178 };
179 /** @brief L2 Meas Stop Cfm primitive Matrix */
180 static const LrgSchL2MeasStopCfm RgMiLrgSchL2mMeasStopCfmMt[RG_MAX_LRG_USR] =
181 {
182 #ifdef LCRGMILRG
183    cmPkLrgSchL2MeasStopCfm,                /* 0 - loosely coupled */
184 #else
185    PtMiLrgSchL2MeasStopCfm,                  /* 0 - loosely coupled */
186 #endif
187 #ifdef SM 
188    SmMiLrgSchL2MeasStopCfm,                  /* 1 - Tightly coupled SM */
189 #else
190    PtMiLrgSchL2MeasStopCfm,                  /* 1 - loosely coupled */
191 #endif
192 };
193 #endif /* LTE_L2_MEAS */
194
195 #ifdef __cplusplus
196 }
197 #endif /* __cplusplus */
198
199 #ifdef RG
200
201 \f
202 /**
203  * @brief Layer Manager Configuration confirm handler. 
204  *
205  * @details
206  *
207  *     Function : RgMiLrgCfgCfm
208  *     
209  *     This function handles the configuration
210  *     confirm invoked by MAC to Layer Manager.
211  *     -# Based on the pst->selector value it invokes one of the
212  *        functions cmPkLrgCfgCfm() or SmMiLrgCfgCfm().
213  *     
214  *  @param[in]  Pst *pst, the post structure     
215  *  @param[in]  RgMngmt *cfm, the configuration confirm structure
216  *  @return  S16
217  *      -# ROK
218  **/
219 S16 RgMiLrgCfgCfm
220 (
221 Pst      *pst,    /* post structure  */
222 RgMngmt  *cfm     /* config confirm structure  */
223 )
224 {
225    
226    (*RgMiLrgCfgCfmMt[pst->selector])(pst, cfm);
227
228    return ROK;
229    
230 }/*-- RgMiLrgCfgCfm --*/
231
232 /**
233  * @brief Layer Manager scheduler Configuration confirm handler. 
234  *
235  * @details
236  *
237  *     Function : RgMiLrgSchCfgCfm
238  *     
239  *     This function handles the configuration
240  *     confirm invoked by Scheduler to Layer Manager.
241  *     -# Based on the pst->selector value it invokes one of the
242  *        functions cmPkLrgSchCfgCfm() or SmMiLrgSchCfgCfm().
243  *     
244  *  @param[in]  Pst *pst, the post structure     
245  *  @param[in]  RgMngmt *cfm, the configuration confirm structure
246  *  @return  S16
247  *      -# ROK
248  **/
249 S16 RgMiLrgSchCfgCfm
250 (
251 Pst      *pst,    /* post structure  */
252 RgMngmt  *cfm     /* config confirm structure  */
253 )
254 {
255    
256    (*RgMiLrgSchCfgCfmMt[pst->selector])(pst, cfm);
257
258    return ROK;
259    
260 }/*-- RgMiLrgSchCfgCfm --*/
261
262
263 \f
264 /**
265  * @brief Layer Manager Statistics confirm handler. 
266  *
267  * @details
268  *
269  *     Function : RgMiLrgStsCfm
270  *     
271  *     This function handles the statistics
272  *     confirm invoked by MAC to Layer Manager.
273  *     -# Based on the pst->selector value it invokes one of the
274  *        functions cmPkLrgStsCfm() or SmMiLrgStsCfm().
275  *     
276  *  @param[in]  Pst *pst, the post structure     
277  *  @param[in]  RgMngmt *cfm, the statistics confirm structure
278  *  @return  S16
279  *      -# ROK
280  **/
281 S16 RgMiLrgStsCfm
282 (
283 Pst      *pst,    /* post structure  */
284 RgMngmt  *cfm     /* statistics confirm structure  */
285 )
286 {
287    
288    (*RgMiLrgStsCfmMt[pst->selector])(pst, cfm);
289
290    return ROK;
291    
292 }/*-- RgMiLrgStsCfm --*/
293
294 \f
295 /**
296  * @brief Layer Manager Unsolicited Status Indication handler. 
297  *
298  * @details
299  *
300  *     Function : RgMiLrgStaInd
301  *     
302  *     This function handles the unsolicited status
303  *     Indication invoked by MAC to Layer Manager.
304  *     -# Based on the pst->selector value it invokes one of the
305  *        functions cmPkLrgStaInd() or SmMiLrgStaInd().
306  *     
307  *  @param[in]  Pst *pst, the post structure     
308  *  @param[in]  RgMngmt *usta, the status indication structure
309  *  @return  S16
310  *      -# ROK
311  **/
312 S16 RgMiLrgStaInd
313 (
314 Pst      *pst,    /* post structure  */
315 RgMngmt  *usta    /* status indication structure  */
316 )
317 {
318    
319    (*RgMiLrgStaIndMt[pst->selector])(pst,usta);
320
321    return ROK;
322    
323 }/*-- RgMiLrgStaInd --*/
324
325 /**
326  * @brief Layer Manager Unsolicited Status Indication handler from scheduler 
327  *
328  * @details
329  *
330  *     Function : RgMiLrgSchStaInd
331  *     
332  *     This function handles the unsolicited status
333  *     Indication invoked by Scheduler to Layer Manager.
334  *     -# Based on the pst->selector value it invokes one of the
335  *        functions cmPkLrgSchStaInd() or SmMiLrgSchStaInd().
336  *     
337  *  @param[in]  Pst *pst, the post structure     
338  *  @param[in]  RgMngmt *usta, the status indication structure
339  *  @return  S16
340  *      -# ROK
341  **/
342 S16 RgMiLrgSchStaInd
343 (
344 Pst      *pst,    /* post structure  */
345 RgMngmt  *usta    /* status indication structure  */
346 )
347 {
348    
349    (*RgMiLrgSchStaIndMt[pst->selector])(pst,usta);
350
351    return ROK;
352    
353 }/*-- RgMiLrgSchStaInd --*/
354
355 #ifdef LTE_L2_MEAS
356
357 /* TODO: Function header */
358 S16 RgMiLrgSchL2MeasCfm
359 (
360 Pst               *pst,          /* post structure  */
361 LrgSchMeasCfmInfo *cfm       /* Meas Cfm Info */
362 )
363 {
364    
365    (*RgMiLrgSchL2mMeasCfmMt[pst->selector])(pst,cfm);
366    
367    return ROK;
368
369 } /* RgMiLrgSchL2MeasCfm */
370
371 /**
372  * @brief This function used to send L2 measurement stop confirmation 
373  *        to Layer manager.
374  *         
375  *
376  * @details
377  *
378  *     Function : RgMiLrgSchL2MeasStopCfm
379  *     This function sends reposnes to L2 Measurement stop request
380  *
381  *
382  *  @param[in]  Pst *pst, the post structure
383  *  @param[in]  LrgSchMeasCfmInfo *cfm, theconfirm structure
384  *  @return  S16
385  *      -# ROK
386  **/
387
388 S16 RgMiLrgSchL2MeasStopCfm
389 (        
390 Pst               *pst,          /* post structure  */
391 LrgSchMeasCfmInfo *cfm       /* Meas Cfm Info */
392 )        
393 {
394    (*RgMiLrgSchL2mMeasStopCfmMt[pst->selector])(pst,cfm);
395           
396    return ROK;
397         
398 } /* RgMiLrgSchL2MeasStopCfm */
399
400 #endif /* LTE_L2_MEAS */
401
402 #endif /*-- MK --*/
403
404 #ifdef PTRGMILRG
405 \f
406 /**
407  * @brief Portable Function definition for Layer Manager Configuration
408  *         confirm handler. 
409  *
410  * @details
411  *
412  *     Function : PtMiLrgCfgCfm
413  *     
414  *     This function handles the configuration
415  *     confirm invoked by MAC to Layer Manager.
416  *     Users of MAC who intend to provide a glue logic 
417  *     for portability of Configuration Confirm are expected 
418  *     to fill in the code in this function definition.
419  *     
420  *  @param[in]  Pst *pst, the post structure     
421  *  @param[in]  RgMngmt *cfm, the configuration confirm structure
422  *  @return  S16
423  *      -# ROK
424  **/
425 S16 PtMiLrgCfgCfm
426 (
427 Pst *pst,               /* post structure */
428 RgMngmt *cfm            /* Config Confirm */
429 )
430 {
431    return ROK;
432 }/* end of PtMiLrgCfgCfm */
433
434 /**
435  * @brief Portable Function definition for Layer Manager Configuration
436  *         confirm handler. 
437  *
438  * @details
439  *
440  *     Function : PtMiLrgSchCfgCfm
441  *     
442  *     This function handles the configuration
443  *     confirm invoked by scheduler to Layer Manager.
444  *     Users of MAC who intend to provide a glue logic 
445  *     for portability of Configuration Confirm are expected 
446  *     to fill in the code in this function definition.
447  *     
448  *  @param[in]  Pst *pst, the post structure     
449  *  @param[in]  RgMngmt *cfm, the configuration confirm structure
450  *  @return  S16
451  *      -# ROK
452  **/
453 S16 PtMiLrgSchCfgCfm
454 (
455 Pst *pst,               /* post structure */
456 RgMngmt *cfm            /* Config Confirm */
457 )
458 {
459
460    return ROK;
461 }/* end of PtMiLrgSchCfgCfm */
462
463
464 \f
465 /**
466  * @brief Portable Function definition for Layer Manager Statistics 
467  *         confirm handler. 
468  *
469  * @details
470  *
471  *     Function : PtMiLrgStsCfm 
472  *     
473  *     This function handles the statistics 
474  *     confirm invoked by MAC to Layer Manager.
475  *     Users of MAC who intend to provide a glue logic 
476  *     for portability of statistics Confirm are expected 
477  *     to fill in the code in this function definition.
478  *     
479  *  @param[in]  Pst *pst, the post structure     
480  *  @param[in]  RgMngmt *cfm, the statistics confirm structure
481  *  @return  S16
482  *      -# ROK
483  **/
484 S16 PtMiLrgStsCfm
485 (
486 Pst *pst,               /* post structure */
487 RgMngmt *cfm            /* Statistics Confirm */
488 )
489 {
490
491    return ROK;
492 }/* end of PtMiLrgStsCfm */
493
494
495 \f
496 /**
497  * @brief Portable Function definition for Layer Manager Status 
498  *        Indication handler. 
499  *
500  * @details
501  *
502  *     Function : PtMiLrgStaInd 
503  *     
504  *     This function handles the status 
505  *     indication invoked by MAC to Layer Manager.
506  *     Users of MAC who intend to provide a glue logic 
507  *     for portability of status indication are expected 
508  *     to fill in the code in this function definition.
509  *     
510  *  @param[in]  Pst *pst, the post structure     
511  *  @param[in]  RgMngmt *cfm, the status indication structure
512  *  @return  S16
513  *      -# ROK
514  **/
515 S16 PtMiLrgStaInd
516 (
517 Pst *pst,               /* post structure */
518 RgMngmt *usta           /* Status Indication */
519 )
520 {
521    return ROK;
522 }/* end of PtMiLrgStaInd */
523
524 /**
525  * @brief Portable Function definition for Layer Manager Status 
526  *        Indication handler. 
527  *
528  * @details
529  *
530  *     Function : PtMiLrgSchStaInd 
531  *     
532  *     This function handles the status 
533  *     indication invoked by Scheduler to Layer Manager.
534  *     Users of MAC who intend to provide a glue logic 
535  *     for portability of status indication are expected 
536  *     to fill in the code in this function definition.
537  *     
538  *  @param[in]  Pst *pst, the post structure     
539  *  @param[in]  RgMngmt *cfm, the status indication structure
540  *  @return  S16
541  *      -# ROK
542  **/
543 S16 PtMiLrgSchStaInd
544 (
545 Pst *pst,               /* post structure */
546 RgMngmt *usta           /* Status Indication */
547 )
548 {
549    return ROK;
550 }/* end of PtMiLrgSchStaInd */
551
552 \f
553 /**
554  * @brief Portable Function definition for Layer Manager Control 
555  *         confirm handler. 
556  *
557  * @details
558  *
559  *     Function : PtMiLrgCntrlCfm 
560  *     
561  *     This function handles the control 
562  *     confirm invoked by MAC to Layer Manager.
563  *     Users of MAC who intend to provide a glue logic 
564  *     for portability of control Confirm are expected 
565  *     to fill in the code in this function definition.
566  *     
567  *  @param[in]  Pst *pst, the post structure     
568  *  @param[in]  RgMngmt *cfm, the control confirm structure
569  *  @return  S16
570  *      -# ROK
571  **/
572 S16 PtMiLrgCntrlCfm
573 (
574 Pst *pst,               /* post structure */
575 RgMngmt *cfm            /* Control Confirm */
576 )
577 {
578    return ROK;
579 }/* end of PtMiLrgCntrlCfm */
580
581 #ifdef LTE_L2_MEAS
582 /**
583  * @brief Portable Function definition for L2 Measurement Configuration
584  *         confirm handler. 
585  *
586  * @details
587  *
588  *     Function : PtMiLrgSchL2MeasCfm
589  *     
590  *     
591  *  @param[in]  Pst *pst, the post structure     
592  *  @param[in]  *cfm, the measurement confirm structure
593  *  @return  S16
594  *      -# ROK
595  **/
596 S16 PtMiLrgSchL2MeasCfm
597 (
598 Pst *pst,               /* post structure */
599 LrgSchMeasCfmInfo *cfm  /* Measurement Confirm */
600 )
601 {
602
603    return ROK;
604 }/* end of PtMiLrgSchL2MeasCfm */
605
606 /**
607  * @brief Portable Function definition for L2 Measurement stop 
608  *         confirm handler. 
609  *
610  * @details
611  *
612  *     Function : PtMiLrgSchL2MeasStopCfm
613  *     
614  *     
615  *  @param[in]  Pst *pst, the post structure     
616  *  @param[in]  *cfm, the measurement confirm structure
617  *  @return  S16
618  *      -# ROK
619  **/
620 S16 PtMiLrgSchL2MeasStopCfm
621 (
622 Pst *pst,               /* post structure */
623 LrgSchMeasCfmInfo *cfm  /* Measurement Confirm */
624 )
625 {
626
627    return ROK;
628 }/* end of PtMiLrgSchL2MeasStopCfm */
629 #endif
630 #endif /*--PTRGMILRG--*/
631
632 \f
633 /**********************************************************************
634  
635          End of file
636 **********************************************************************/