1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for portable definitions for Layer Manager
30 **********************************************************************/
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.
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 */
47 #endif /* __cplusplus */
49 #if !(defined(LCRGMILRG) && defined(SM))
53 #define RG_MAX_LRG_USR 2
55 /* portable functions at LRG interface */
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 PtMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
61 S16 PtMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
62 S16 PtMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
63 S16 PtMiLrgCntrlCfm ARGS((Pst *pst, RgMngmt *cfm));
64 S16 PtMiLrgSchCntrlCfm ARGS((Pst *pst, RgMngmt *cfm));
65 S16 PtMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc,Buffer *mBuf));
67 S16 PtMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *cfm));
68 S16 PtMiLrgSchL2MeasStopCfm ARGS((Pst *pst,LrgSchMeasCfmInfo *cfm ));
72 /* ***********LRG interface Mapping matrices ********************/
74 /** @brief Configuration Confirm primitive Matrix
75 * This matrix defines the mapping between the configuration confirm
76 * primitive called by the upper interface of MAC layer and the
77 * corresponding primitives of the MAC layer service user(s).
79 * The parameter RG_MAX_LRG_USR defines the maximum number of Layer
80 * managers of MAC at the LRG interface. This is an array of functions
81 * per primitive invoked by MAC whose size is RG_MAX_LRG_USR.
83 * The dispatching is performed by the configurable variable: selector.
84 * The selector is configured on a per SAP basis. The selectors are:
86 * LCRGMILRG - loosely coupled LMK interface
87 * TCRGMILRG - Tightly coupled LMK interface
89 * In a similar fashion, the matrices for Status, Statistics and
90 * Control confirms and, Status and trace indications are defined.
92 static const LrgCfgCfm RgMiLrgCfgCfmMt[RG_MAX_LRG_USR] =
95 cmPkLrgCfgCfm, /* 0 - loosely coupled */
97 PtMiLrgCfgCfm, /* 0 - loosely coupled */
100 SmMiLrgCfgCfm, /* 1 - Tightly coupled SM */
102 //PtMiLrgCfgCfm, /* 1 - Tightly coupled SM */
106 /** @brief Scheduler Config Confirm primitive Matrix */
107 static const LrgSchCfgCfm RgMiLrgSchCfgCfmMt[RG_MAX_LRG_USR] =
110 cmPkLrgSchCfgCfm, /* 0 - loosely coupled */
112 PtMiLrgSchCfgCfm, /* 0 - loosely coupled */
115 SmMiLrgSchCfgCfm, /* 1 - Tightly coupled SM */
117 //PtMiLrgSchCfgCfm, /* 1 - Tightly coupled SM */
121 /** @brief Statistics Confirm primitive Matrix */
122 static const LrgStsCfm RgMiLrgStsCfmMt[RG_MAX_LRG_USR] =
125 cmPkLrgStsCfm, /* 0 - loosely coupled */
127 PtMiLrgStsCfm, /* 0 - loosely coupled */
130 SmMiLrgStsCfm, /* 1 - Tightly coupled SM */
132 PtMiLrgStsCfm, /* 1 - Tightly coupled SM */
136 /** @brief Status Confirm primitive Matrix */
137 static const LrgStaCfm RgMiLrgStaCfmMt[RG_MAX_LRG_USR] =
140 cmPkLrgStaCfm, /* 0 - loosely coupled */
142 PtMiLrgStaCfm, /* 0 - loosely coupled */
145 SmMiLrgStaCfm, /* 1 - Tightly coupled SM */
147 PtMiLrgStaCfm, /* 1 - Tightly coupled SM */
152 /** @brief Status Indication primitive Matrix */
153 static const LrgStaInd RgMiLrgStaIndMt[RG_MAX_LRG_USR] =
156 cmPkLrgStaInd, /* 0 - loosely coupled */
158 PtMiLrgStaInd, /* 0 - loosely coupled */
161 SmMiLrgStaInd, /* 1 - Tightly coupled SM */
163 PtMiLrgStaInd, /* 1 - Tightly coupled SM */
167 /** @brief Scheduler Status Indication primitive Matrix */
168 static const LrgSchStaInd RgMiLrgSchStaIndMt[RG_MAX_LRG_USR] =
171 cmPkLrgSchStaInd, /* 0 - loosely coupled */
173 PtMiLrgSchStaInd, /* 0 - loosely coupled */
176 SmMiLrgSchStaInd, /* 1 - Tightly coupled SM */
178 PtMiLrgSchStaInd, /* 1 - Tightly coupled SM */
183 /** @brief Control Confirm primitive Matrix */
184 static const LrgCntrlCfm RgMiLrgCntrlCfmMt[RG_MAX_LRG_USR] =
187 cmPkLrgCntrlCfm, /* 0 - loosely coupled */
189 PtMiLrgCntrlCfm, /* 0 - loosely coupled */
192 SmMiLrgCntrlCfm, /* 1 - Tightly coupled SM */
194 PtMiLrgCntrlCfm, /* 1 - Tightly coupled SM */
198 /** @brief Scheduler Control Confirm primitive Matrix */
199 static const LrgSchCntrlCfm RgMiLrgSchCntrlCfmMt[RG_MAX_LRG_USR] =
202 cmPkLrgSchCntrlCfm, /* 0 - loosely coupled */
204 PtMiLrgSchCntrlCfm, /* 0 - loosely coupled */
207 SmMiLrgSchCntrlCfm, /* 1 - Tightly coupled SM */
209 PtMiLrgSchCntrlCfm, /* 1 - Tightly coupled SM */
213 /** @brief Trace Indication primitive Matrix */
214 static const LrgTrcInd RgMiLrgTrcIndMt[RG_MAX_LRG_USR] =
217 cmPkLrgTrcInd, /* 0 - loosely coupled */
219 PtMiLrgTrcInd, /* 0 - loosely coupled */
222 SmMiLrgTrcInd, /* 1 - Tightly coupled SM */
224 PtMiLrgTrcInd, /* 1 - Tightly coupled SM */
228 /** @brief L2 Meas Cfm primitive Matrix */
229 static const LrgSchL2MeasCfm RgMiLrgSchL2mMeasCfmMt[RG_MAX_LRG_USR] =
232 cmPkLrgSchL2MeasCfm, /* 0 - loosely coupled */
234 PtMiLrgSchL2MeasCfm, /* 0 - loosely coupled */
237 SmMiLrgSchL2MeasCfm, /* 1 - Tightly coupled SM */
239 PtMiLrgSchL2MeasCfm, /* 1 - loosely coupled */
242 /** @brief L2 Meas Stop Cfm primitive Matrix */
243 static const LrgSchL2MeasStopCfm RgMiLrgSchL2mMeasStopCfmMt[RG_MAX_LRG_USR] =
246 cmPkLrgSchL2MeasStopCfm, /* 0 - loosely coupled */
248 PtMiLrgSchL2MeasStopCfm, /* 0 - loosely coupled */
251 SmMiLrgSchL2MeasStopCfm, /* 1 - Tightly coupled SM */
253 PtMiLrgSchL2MeasStopCfm, /* 1 - loosely coupled */
256 #endif /* LTE_L2_MEAS */
260 #endif /* __cplusplus */
266 * @brief Layer Manager Configuration confirm handler.
270 * Function : RgMiLrgCfgCfm
272 * This function handles the configuration
273 * confirm invoked by MAC to Layer Manager.
274 * -# Based on the pst->selector value it invokes one of the
275 * functions cmPkLrgCfgCfm() or SmMiLrgCfgCfm().
277 * @param[in] Pst *pst, the post structure
278 * @param[in] RgMngmt *cfm, the configuration confirm structure
284 Pst *pst, /* post structure */
285 RgMngmt *cfm /* config confirm structure */
289 (*RgMiLrgCfgCfmMt[pst->selector])(pst, cfm);
293 }/*-- RgMiLrgCfgCfm --*/
296 * @brief Layer Manager scheduler Configuration confirm handler.
300 * Function : RgMiLrgSchCfgCfm
302 * This function handles the configuration
303 * confirm invoked by Scheduler to Layer Manager.
304 * -# Based on the pst->selector value it invokes one of the
305 * functions cmPkLrgSchCfgCfm() or SmMiLrgSchCfgCfm().
307 * @param[in] Pst *pst, the post structure
308 * @param[in] RgMngmt *cfm, the configuration confirm structure
314 Pst *pst, /* post structure */
315 RgMngmt *cfm /* config confirm structure */
319 (*RgMiLrgSchCfgCfmMt[pst->selector])(pst, cfm);
323 }/*-- RgMiLrgSchCfgCfm --*/
328 * @brief Layer Manager Statistics confirm handler.
332 * Function : RgMiLrgStsCfm
334 * This function handles the statistics
335 * confirm invoked by MAC to Layer Manager.
336 * -# Based on the pst->selector value it invokes one of the
337 * functions cmPkLrgStsCfm() or SmMiLrgStsCfm().
339 * @param[in] Pst *pst, the post structure
340 * @param[in] RgMngmt *cfm, the statistics confirm structure
346 Pst *pst, /* post structure */
347 RgMngmt *cfm /* statistics confirm structure */
351 (*RgMiLrgStsCfmMt[pst->selector])(pst, cfm);
355 }/*-- RgMiLrgStsCfm --*/
359 * @brief Layer Manager Status confirm handler.
363 * Function : RgMiLrgStaCfm
365 * This function handles the status
366 * confirm invoked by MAC to Layer Manager.
367 * -# Based on the pst->selector value it invokes one of the
368 * functions cmPkLrgStaCfm() or SmMiLrgStaCfm().
370 * @param[in] Pst *pst, the post structure
371 * @param[in] RgMngmt *cfm, the status confirm structure
377 Pst *pst, /* post structure */
378 RgMngmt *cfm /* status confirm structure */
382 (*RgMiLrgStaCfmMt[pst->selector])(pst,cfm);
386 }/*-- RgMiLrgStaCfm --*/
390 * @brief Layer Manager Control confirm handler.
394 * Function : RgMiLrgCntrlCfm
396 * This function handles the control
397 * confirm invoked by MAC to Layer Manager.
398 * -# Based on the pst->selector value it invokes one of the
399 * functions cmPkLrgCntrlCfm() or SmMiLrgCntrlCfm().
401 * @param[in] Pst *pst, the post structure
402 * @param[in] RgMngmt *cfm, the control confirm structure
408 Pst *pst, /* post structure */
409 RgMngmt *cfm /* control confirm structure */
413 (*RgMiLrgCntrlCfmMt[pst->selector])(pst,cfm);
417 }/*-- RgMiLrgCntrlCfm --*/
420 * @brief Layer Manager scheduler Control confirm handler.
424 * Function : RgMiLrgSchCntrlCfm
426 * This function handles the control
427 * confirm invoked by scheduler to Layer Manager.
428 * -# Based on the pst->selector value it invokes one of the
429 * functions cmPkLrgSchCntrlCfm() or SmMiLrgSchCntrlCfm().
431 * @param[in] Pst *pst, the post structure
432 * @param[in] RgMngmt *cfm, the control confirm structure
436 S16 RgMiLrgSchCntrlCfm
438 Pst *pst, /* post structure */
439 RgMngmt *cfm /* control confirm structure */
443 (*RgMiLrgSchCntrlCfmMt[pst->selector])(pst,cfm);
447 }/*-- RgMiLrgSchCntrlCfm --*/
451 * @brief Layer Manager Unsolicited Status Indication handler.
455 * Function : RgMiLrgStaInd
457 * This function handles the unsolicited status
458 * Indication invoked by MAC to Layer Manager.
459 * -# Based on the pst->selector value it invokes one of the
460 * functions cmPkLrgStaInd() or SmMiLrgStaInd().
462 * @param[in] Pst *pst, the post structure
463 * @param[in] RgMngmt *usta, the status indication structure
469 Pst *pst, /* post structure */
470 RgMngmt *usta /* status indication structure */
474 (*RgMiLrgStaIndMt[pst->selector])(pst,usta);
478 }/*-- RgMiLrgStaInd --*/
481 * @brief Layer Manager Unsolicited Status Indication handler from scheduler
485 * Function : RgMiLrgSchStaInd
487 * This function handles the unsolicited status
488 * Indication invoked by Scheduler to Layer Manager.
489 * -# Based on the pst->selector value it invokes one of the
490 * functions cmPkLrgSchStaInd() or SmMiLrgSchStaInd().
492 * @param[in] Pst *pst, the post structure
493 * @param[in] RgMngmt *usta, the status indication structure
499 Pst *pst, /* post structure */
500 RgMngmt *usta /* status indication structure */
504 (*RgMiLrgSchStaIndMt[pst->selector])(pst,usta);
508 }/*-- RgMiLrgSchStaInd --*/
512 * @brief Layer Manager Trace Indication handler.
516 * Function : RgMiLrgTrcInd
518 * This function handles the trace
519 * Indication invoked by MAC to Layer Manager.
520 * -# Based on the pst->selector value it invokes one of the
521 * functions cmPkLrgTrcInd() or SmMiLrgTrcInd().
523 * @param[in] Pst *pst, the post structure
524 * @param[in] RgMngmt *trc, the trace event
525 * @param[in] Buffer *mBuf, the trace message
531 Pst *pst, /* post structure */
532 RgMngmt *trc, /* Trace event */
533 Buffer *mBuf /* Trace message */
537 (*RgMiLrgTrcIndMt[pst->selector])(pst,trc,mBuf);
541 }/*-- RgMiLrgTrcInd --*/
545 /* TODO: Function header */
546 S16 RgMiLrgSchL2MeasCfm
548 Pst *pst, /* post structure */
549 LrgSchMeasCfmInfo *cfm /* Meas Cfm Info */
553 (*RgMiLrgSchL2mMeasCfmMt[pst->selector])(pst,cfm);
557 } /* RgMiLrgSchL2MeasCfm */
560 * @brief This function used to send L2 measurement stop confirmation
566 * Function : RgMiLrgSchL2MeasStopCfm
567 * This function sends reposnes to L2 Measurement stop request
570 * @param[in] Pst *pst, the post structure
571 * @param[in] LrgSchMeasCfmInfo *cfm, theconfirm structure
576 S16 RgMiLrgSchL2MeasStopCfm
578 Pst *pst, /* post structure */
579 LrgSchMeasCfmInfo *cfm /* Meas Cfm Info */
582 (*RgMiLrgSchL2mMeasStopCfmMt[pst->selector])(pst,cfm);
586 } /* RgMiLrgSchL2MeasStopCfm */
588 #endif /* LTE_L2_MEAS */
595 * @brief Portable Function definition for Layer Manager Configuration
600 * Function : PtMiLrgCfgCfm
602 * This function handles the configuration
603 * confirm invoked by MAC to Layer Manager.
604 * Users of MAC who intend to provide a glue logic
605 * for portability of Configuration Confirm are expected
606 * to fill in the code in this function definition.
608 * @param[in] Pst *pst, the post structure
609 * @param[in] RgMngmt *cfm, the configuration confirm structure
615 Pst *pst, /* post structure */
616 RgMngmt *cfm /* Config Confirm */
620 }/* end of PtMiLrgCfgCfm */
623 * @brief Portable Function definition for Layer Manager Configuration
628 * Function : PtMiLrgSchCfgCfm
630 * This function handles the configuration
631 * confirm invoked by scheduler to Layer Manager.
632 * Users of MAC who intend to provide a glue logic
633 * for portability of Configuration Confirm are expected
634 * to fill in the code in this function definition.
636 * @param[in] Pst *pst, the post structure
637 * @param[in] RgMngmt *cfm, the configuration confirm structure
643 Pst *pst, /* post structure */
644 RgMngmt *cfm /* Config Confirm */
649 }/* end of PtMiLrgSchCfgCfm */
654 * @brief Portable Function definition for Layer Manager Statistics
659 * Function : PtMiLrgStsCfm
661 * This function handles the statistics
662 * confirm invoked by MAC to Layer Manager.
663 * Users of MAC who intend to provide a glue logic
664 * for portability of statistics Confirm are expected
665 * to fill in the code in this function definition.
667 * @param[in] Pst *pst, the post structure
668 * @param[in] RgMngmt *cfm, the statistics confirm structure
674 Pst *pst, /* post structure */
675 RgMngmt *cfm /* Statistics Confirm */
680 }/* end of PtMiLrgStsCfm */
685 * @brief Portable Function definition for Layer Manager Status
690 * Function : PtMiLrgStaCfm
692 * This function handles the status
693 * confirm invoked by MAC to Layer Manager.
694 * Users of MAC who intend to provide a glue logic
695 * for portability of status Confirm are expected
696 * to fill in the code in this function definition.
698 * @param[in] Pst *pst, the post structure
699 * @param[in] RgMngmt *cfm, the status confirm structure
705 Pst *pst, /* post structure */
706 RgMngmt *cfm /* Status Confirm */
710 }/* end of PtMiLrgStaCfm */
715 * @brief Portable Function definition for Layer Manager Status
716 * Indication handler.
720 * Function : PtMiLrgStaInd
722 * This function handles the status
723 * indication invoked by MAC to Layer Manager.
724 * Users of MAC who intend to provide a glue logic
725 * for portability of status indication are expected
726 * to fill in the code in this function definition.
728 * @param[in] Pst *pst, the post structure
729 * @param[in] RgMngmt *cfm, the status indication structure
735 Pst *pst, /* post structure */
736 RgMngmt *usta /* Status Indication */
740 }/* end of PtMiLrgStaInd */
743 * @brief Portable Function definition for Layer Manager Status
744 * Indication handler.
748 * Function : PtMiLrgSchStaInd
750 * This function handles the status
751 * indication invoked by Scheduler to Layer Manager.
752 * Users of MAC who intend to provide a glue logic
753 * for portability of status indication are expected
754 * to fill in the code in this function definition.
756 * @param[in] Pst *pst, the post structure
757 * @param[in] RgMngmt *cfm, the status indication structure
763 Pst *pst, /* post structure */
764 RgMngmt *usta /* Status Indication */
768 }/* end of PtMiLrgSchStaInd */
772 * @brief Portable Function definition for Layer Manager Control
777 * Function : PtMiLrgCntrlCfm
779 * This function handles the control
780 * confirm invoked by MAC to Layer Manager.
781 * Users of MAC who intend to provide a glue logic
782 * for portability of control Confirm are expected
783 * to fill in the code in this function definition.
785 * @param[in] Pst *pst, the post structure
786 * @param[in] RgMngmt *cfm, the control confirm structure
792 Pst *pst, /* post structure */
793 RgMngmt *cfm /* Control Confirm */
797 }/* end of PtMiLrgCntrlCfm */
800 * @brief Portable Function definition for Layer Manager Control
805 * Function : PtMiLrgSchCntrlCfm
807 * This function handles the control
808 * confirm invoked by scheduler to Layer Manager.
809 * Users of MAC who intend to provide a glue logic
810 * for portability of control Confirm are expected
811 * to fill in the code in this function definition.
813 * @param[in] Pst *pst, the post structure
814 * @param[in] RgMngmt *cfm, the control confirm structure
818 S16 PtMiLrgSchCntrlCfm
820 Pst *pst, /* post structure */
821 RgMngmt *cfm /* Control Confirm */
825 }/* end of PtMiLrgSchCntrlCfm */
829 * @brief Portable Function definition for Layer Manager Trace
830 * Indication handler.
834 * Function : PtMiLrgTrcInd
836 * This function handles the trace
837 * indication invoked by MAC to Layer Manager.
838 * Users of MAC who intend to provide a glue logic
839 * for portability of trace indication are expected
840 * to fill in the code in this function definition.
842 * @param[in] Pst *pst, the post structure
843 * @param[in] RgMngmt *cfm, the trace indication structure
849 Pst *pst, /* post structure */
850 RgMngmt *trc, /* Trace Event */
851 Buffer *mBuf /* Trace message */
855 }/* end of PtMiLrgTrcInd */
858 * @brief Portable Function definition for L2 Measurement Configuration
863 * Function : PtMiLrgSchL2MeasCfm
866 * @param[in] Pst *pst, the post structure
867 * @param[in] *cfm, the measurement confirm structure
871 S16 PtMiLrgSchL2MeasCfm
873 Pst *pst, /* post structure */
874 LrgSchMeasCfmInfo *cfm /* Measurement Confirm */
879 }/* end of PtMiLrgSchL2MeasCfm */
882 * @brief Portable Function definition for L2 Measurement stop
887 * Function : PtMiLrgSchL2MeasStopCfm
890 * @param[in] Pst *pst, the post structure
891 * @param[in] *cfm, the measurement confirm structure
895 S16 PtMiLrgSchL2MeasStopCfm
897 Pst *pst, /* post structure */
898 LrgSchMeasCfmInfo *cfm /* Measurement Confirm */
903 }/* end of PtMiLrgSchL2MeasStopCfm */
905 #endif /*--PTRGMILRG--*/
908 /**********************************************************************
911 **********************************************************************/