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 /********************************************************************20**
21 Name: RLC Layer Management interface
25 Desc: This file contains source code for RLC layer management
26 interface primitives. It includes the definition of the
27 following functions and their portable function
36 *********************************************************************21*/
39 /* header (.h) include files */
40 #include "envopt.h" /* environment options */
41 #include "envdep.h" /* environment dependent */
42 #include "envind.h" /* environment independent */
44 #include "gen.h" /* general */
45 #include "ssi.h" /* system services */
46 #include "cm5.h" /* common timer defines */
47 #include "cm_tkns.h" /* common tokens defines */
48 #include "cm_mblk.h" /* common memory allocation library defines */
49 #include "cm_llist.h" /* common link list defines */
50 #include "cm_hash.h" /* common hash list defines */
51 #include "cm_lte.h" /* common LTE defines */
52 #include "lkw.h" /* LKW defines */
53 #include "ckw.h" /* CKW defines */
54 #include "kwu.h" /* KWU defines */
55 #include "rgu.h" /* RGU defines */
57 #include "kw_env.h" /* RLC environment options */
58 #include "kw.h" /* RLC defines */
60 /* extern (.x) include files */
61 #include "gen.x" /* general */
62 #include "ssi.x" /* system services */
64 #include "cm5.x" /* common timer library */
65 #include "cm_tkns.x" /* common tokens */
66 #include "cm_mblk.x" /* common memory allocation */
67 #include "cm_llist.x" /* common link list */
68 #include "cm_hash.x" /* common hash list */
69 #include "cm_lte.x" /* common LTE includes */
70 #include "cm_lib.x" /* common memory allocation library */
71 #include "lkw.x" /* LKW */
72 #include "ckw.x" /* CKW */
73 #include "kwu.x" /* KWU */
74 #include "rgu.x" /* RGU */
79 #define MAXKWMI 2 /* max. layer management interfaces */
93 /* portable functions */
95 PRIVATE S16 PtMiLkwCfgCfm ARGS((Pst *pst, KwMngmt *cfm));
96 PRIVATE S16 PtMiLkwCntrlCfm ARGS((Pst *pst, KwMngmt *cfm));
97 PRIVATE S16 PtMiLkwStaInd ARGS((Pst *pst, KwMngmt *usta));
99 PRIVATE S16 PtMiLkwStaCfm ARGS((Pst *pst, KwMngmt *cfm));
100 PRIVATE S16 PtMiLkwStsCfm ARGS((Pst *pst, Action action,
102 PRIVATE S16 PtMiLkwTrcInd ARGS((Pst *pst, KwMngmt *trc,
104 /* kw005.201 added support for L2 Measurement */
106 PRIVATE S16 PtMiLkwL2MeasCfm ARGS((Pst *pst, KwL2MeasCfmEvt *measEvt));
107 PRIVATE S16 PtMiLkwL2MeasStopCfm ARGS((Pst *pst, U8 measType,U8 status));
108 #endif /* LTE_L2_MEAS */
112 /*********************************************************************
113 * Primitives for LKW interface
114 ********************************************************************/
115 /* Configuration confirmation primitive */
117 PRIVATE LkwCfgCfm kwMiLkwCfgCfmMt[MAXKWMI] =
120 cmPkLkwCfgCfm, /* 0 - loosely coupled - fc */
122 PtMiLkwCfgCfm, /* 0 - tightly coupled portable */
123 #endif /* LCRLMILKW */
125 SmMiLkwCfgCfm, /* 1 - tightly coupled layer management*/
127 PtMiLkwCfgCfm, /* 1 - tightly coupled portable */
131 /* control confirmation primitives */
133 PRIVATE LkwCntrlCfm kwMiLkwCntrlCfmMt[MAXKWMI] =
136 cmPkLkwCntrlCfm, /* 0 - loosely coupled - fc */
138 PtMiLkwCntrlCfm, /* 0 - tightly coupled portable */
139 #endif /* LCRLMILKW */
141 SmMiLkwCntrlCfm, /* 1 - tightly coupled layer management*/
143 PtMiLkwCntrlCfm, /* 1 - tightly coupled portable */
147 /* Status Indication primitive */
149 PRIVATE LkwStaInd kwMiLkwStaIndMt[MAXKWMI] =
152 cmPkLkwStaInd, /* 0 - loosely coupled */
154 PtMiLkwStaInd, /* 0 - tightly coupled, portable */
155 #endif /* LCKWMILKW */
157 SmMiLkwStaInd, /* 1 - tightly coupled, layer management */
159 PtMiLkwStaInd, /* 1 - tightly coupled, portable */
163 /* Status confirm primitive */
165 PRIVATE LkwStaCfm kwMiLkwStaCfmMt[MAXKWMI] =
168 cmPkLkwStaCfm, /* 0 - loosely coupled */
170 PtMiLkwStaCfm, /* 0 - tightly coupled, portable */
171 #endif /* LCKWMILKW */
173 SmMiLkwStaCfm, /* 1 - tightly coupled, layer management */
175 PtMiLkwStaCfm, /* 1 - tightly coupled, portable */
179 /* Statistics confirm primitive */
181 PRIVATE LkwStsCfm kwMiLkwStsCfmMt[MAXKWMI] =
184 cmPkLkwStsCfm, /* 0 - loosely coupled */
186 PtMiLkwStsCfm, /* 0 - tightly coupled, portable */
187 #endif /* LCRLMILKW */
189 SmMiLkwStsCfm, /* 1 - tightly coupled, layer management */
191 PtMiLkwStsCfm, /* 1 - tightly coupled, portable */
195 /* Trace indication primitive */
197 PRIVATE LkwTrcInd kwMiLkwTrcIndMt[MAXKWMI] =
200 cmPkLkwTrcInd, /* 0 - loosely coupled */
202 PtMiLkwTrcInd, /* 0 - tightly coupled, portable */
203 #endif /* LCKWMILKW */
205 SmMiLkwTrcInd, /* 1 - tightly coupled, layer management */
207 PtMiLkwTrcInd, /* 1 - tightly coupled, portable */
211 /* kw005.201 added support for L2 Measurement */
213 PRIVATE CONSTANT LkwL2MeasCfm KwMiLkwL2MeasCfmMt[] =
226 PRIVATE CONSTANT LkwL2MeasStopCfm KwMiLkwL2MeasStopCfmMt[] =
229 cmPkLkwL2MeasStopCfm,
231 PtMiLkwL2MeasStopCfm,
234 SmMiLkwL2MeasStopCfm,
236 PtMiLkwL2MeasStopCfm,
239 #endif /* LTE_L2_MEAS */
241 /****************************************************************************
242 * LKW Interface Mt functions
243 ***************************************************************************/
246 This function is called by the KwMiLkwCfgReq function for responding
247 to configuration requests.The cfm field in the KwMngmt structure contains
250 - This function calls the mapping matrix for sending the configuration
252 - The actual function called depends on the coupling at the LKW interface.
253 - For a loosely coupled interface, a common packing function is called.
254 - The packing function packs the parameter in a message buffer and posts
255 the message to the target task.
256 - For a tightly coupled interface, the actual function called depends on
257 the layer manager API provided.
261 PUBLIC S16 KwMiLkwCfgCfm
263 Pst *pst, /* post structure */
264 KwMngmt *cfm /* Layer Management structure */
267 PUBLIC S16 KwMiLkwCfgCfm(pst, cfm)
268 Pst *pst; /* post structure */
269 KwMngmt *cfm; /* Layer Management structure */
274 /* jump to specific primitive depending on configured selector */
275 (*kwMiLkwCfgCfmMt[pst->selector])(pst, cfm);
283 This function is called by the KwMiLkwCntrlReq function to send a control confirm to the layer management module.
285 - This function calls the mapping matrix for sending the control confirmation.
286 - Actual function called depends on the coupling of the LKW interface.
287 - For a loosely coupled interface, a common packing function is called.
288 - The packing function packs the parameter in a message buffer and posts the
289 message to the target task.
290 - For a tightly coupled interface, the actual function called depends on the
291 layer manager API provided.
295 PUBLIC S16 KwMiLkwCntrlCfm
297 Pst *pst, /* post structure */
298 KwMngmt *cfm /* configure */
301 PUBLIC S16 KwMiLkwCntrlCfm(pst, cfm)
302 Pst *pst; /* post structure */
303 KwMngmt *cfm; /* confirm */
306 TRC3(KwMiLkwCntrlCfm)
308 /* jump to specific primitive depending on configured selector */
309 (*kwMiLkwCntrlCfmMt[pst->selector])(pst, cfm);
313 } /* end of KwMiLkwCntrlCfm */
318 - This function can be used by RLC to send unsolicited status information
319 to the layer manager, when the unsolicited status flag is enabled by the
320 layer manager through a previous control request.
322 - This function calls the mapping matrix for sending the unsolicited status
323 indication.The actual function called depends on the coupling of the
326 - For a loosely coupled interface, a common packing function is called. The
327 packing function packs the parameter in a message buffer and posts the
328 message to the target task.
330 - For a tightly coupled interface, the actual function called depends on
331 the layer manager API provided.
334 PUBLIC S16 KwMiLkwStaInd
336 Pst *pst, /* post structure */
337 KwMngmt *usta /* unsolicited status */
340 PUBLIC S16 KwMiLkwStaInd(pst, usta)
341 Pst *pst; /* post structure */
342 KwMngmt *usta; /* unsolicited status */
347 /* jump to specific primitive depending on configured selector */
348 (*kwMiLkwStaIndMt[pst->selector])(pst, usta);
351 } /* end of KwMiLkwStaInd */
356 - This function is called by the KwMiLkwStaReq function to send
357 the requested status information to the layer manager.
359 - This function calls the mapping matrix for sending the status
360 confirmation. The actual function called depends on the coupling
361 of the LKW interface.
363 - For a loosely coupled interface, a common packing function is called.
364 The packing function packs the parameter in a message buffer and
365 posts the message to the target task.
367 - For a tightly coupled interface, the actual function called depends
368 on the layer manager API provided.
372 PUBLIC S16 KwMiLkwStaCfm
374 Pst *pst, /* post structure */
375 KwMngmt *cfm /* solicited status confirmation */
378 PUBLIC S16 KwMiLkwStaCfm(pst, cfm)
379 Pst *pst; /* post structure */
380 KwMngmt *cfm; /* solicited status confirmation */
385 /* jump to specific primitive depending on configured selector */
386 (*kwMiLkwStaCfmMt[pst->selector])(pst, cfm);
390 } /* end of KwMiLkwStaCfm */
395 - This function is called by the KwMiLkwStsReq function for responding
396 to statistics requests.
398 - This function calls the mapping matrix for sending the statistics
399 confirmation. The actual function called depends on the coupling
400 of the LKW interface.
402 - For a loosely coupled interface, a common packing function is called.
403 The packing function packs the parameter in a message buffer and
404 posts the message to the target task.
406 - For a tightly coupled interface, the actual function called depends
407 on the layer manager API provided.
411 PUBLIC S16 KwMiLkwStsCfm
413 Pst *pst, /* post structure */
414 Action action, /* action */
415 KwMngmt *cfm /* statistics confirmation */
418 PUBLIC S16 KwMiLkwStsCfm(pst, action, cfm)
419 Pst *pst; /* post structure */
420 Action action; /* action */
421 KwMngmt *cfm; /* statistics confirmation */
426 /* jump to specific primitive depending on configured selector */
427 (*kwMiLkwStsCfmMt[pst->selector])(pst, action, cfm);
431 } /* end of KwMiLkwStsCfm */
435 - This function can be used by RLC module to send unsolicited trace
436 indications to the layer manager, when tracing is enabled by the
437 layer manager through a previous control request.
439 - This function calls the mapping matrix for sending the trace indication.
440 The actual function called depends on the coupling of the LKW interface.
442 - For a loosely coupled interface, a common packing function is called.
443 The packing function packs the parameter in a message buffer and posts
444 the message to the target task.
446 - For a tightly coupled interface, the actual function called depends on
447 the layer manager API provided.
451 PUBLIC S16 KwMiLkwTrcInd
453 Pst *pst, /* post structure */
454 KwMngmt *trc, /* trace indication */
455 Buffer *mBuf /* message buffer */
458 PUBLIC S16 KwMiLkwTrcInd(pst, trc, mBuf)
459 Pst *pst; /* post structure */
460 KwMngmt *trc; /* trace indication */
461 Buffer *mBuf; /* message buffer */
466 /* jump to specific primitive depending on configured selector */
467 (*kwMiLkwTrcIndMt[pst->selector])(pst, trc, mBuf);
471 } /* end of KwMiLkwTrcInd */
474 /* kw005.201 added support for L2 Measurement */
477 PUBLIC S16 KwMiLkwL2MeasCfm
480 KwL2MeasCfmEvt *measEvt
483 PUBLIC S16 KwMiLkwL2MeasCfm(pst, measEvt)
485 KwL2MeasCfmEvt *measEvt;
489 TRC3(KwMiLkwL2MeasCfm)
491 (*KwMiLkwL2MeasCfmMt[pst->selector])(pst, measEvt);
497 PUBLIC S16 KwMiLkwL2MeasStopCfm
504 PUBLIC S16 KwMiLkwL2MeasStopCfm(pst, measType,status)
511 TRC3(KwMiLkwL2MeasStopCfm)
513 (*KwMiLkwL2MeasStopCfmMt[pst->selector])(pst, measType,status);
518 #endif /* LTE_L2_MEAS */
522 /*************************************************************************
524 ************************************************************************/
527 * Fun: configuration Confirm
529 * Desc: This function is used to confirm the receipt of configuration
530 * request from layer management.
541 PUBLIC S16 PtMiLkwCfgCfm
543 Pst *pst, /* post structure */
544 KwMngmt *cfm /* Layer Management structure */
547 PUBLIC S16 PtMiLkwCfgCfm(pst, cfm)
548 Pst *pst; /* post structure */
549 KwMngmt *cfm; /* Layer Management structure */
557 TRC2(PtMiLkwCfgCfm() : function is not implemented)
560 } /* end of PtMiLkwCfgCfm */
564 * Fun: Control Confirmation
566 * Desc: This function is the portable version of used to
567 * confirm the receipt of configuration request from
579 PRIVATE S16 PtMiLkwCntrlCfm
581 Pst *pst, /* Post structure */
582 KwMngmt *cfm /* Layer Management structure */
585 PRIVATE S16 PtMiLkwCntrlCfm(pst, cfm)
586 Pst *pst; /* Post structure */
587 KwMngmt *cfm; /* Layer Management structure */
590 TRC3(PtMiLkwCntrlCfm);
595 TRC2(PtMiLkwCntrlCfm() : function is not implemented)
598 } /* end of PtMiLkwCntrlCfm */
603 * Fun: unsolicited status indication
605 * Desc: This function is the portable version used to
606 * send the status indication to the layer manager
616 PRIVATE S16 PtMiLkwStaInd
618 Pst *pst, /* post structure */
619 KwMngmt *usta /* unsolicited status */
622 PRIVATE S16 PtMiLkwStaInd(pst, usta)
623 Pst *pst; /* post structure */
624 KwMngmt *usta; /* unsolicited status */
632 TRC2(PtMiLkwStaInd() : function is not implemented)
635 } /* end of PtMiLkwStaInd */
640 * Fun: portable function for solicited status confirmation
642 * Desc: This function is the portable version used to
643 * send the status confirmation to the layer manager
653 PRIVATE S16 PtMiLkwStaCfm
655 Pst *pst, /* post structure */
656 KwMngmt *cfm /* solicited status confirmation */
659 PRIVATE S16 PtMiLkwStaCfm(pst, cfm)
660 Pst *pst; /* post structure */
661 KwMngmt *cfm; /* solicited status confirmation */
670 } /* end of PtMiLkwStaCfm */
675 * Fun: portable function for statistics confirmation
677 * Desc: This function is the portable version used to
678 * send the statistics confirmation to the layer manager
688 PRIVATE S16 PtMiLkwStsCfm
690 Pst *pst, /* post structure */
691 Action action, /* action */
692 KwMngmt *cfm /* statistics confirmation */
695 PRIVATE S16 PtMiLkwStsCfm(pst, action, cfm)
696 Pst *pst; /* post structure */
697 Action action; /* action */
698 KwMngmt *cfm; /* statistics confirmation */
708 } /* end of PtMiLkwStsCfm */
713 * Fun: portable function for trace indication
715 * Desc: This function is the portable version used to
716 * send trace indication to the layer manager
726 PRIVATE S16 PtMiLkwTrcInd
728 Pst *pst, /* post structure */
729 KwMngmt *trc, /* trace indication */
730 Buffer *mBuf /* message buffer */
733 PRIVATE S16 PtMiLkwTrcInd(pst, trc, mBuf)
734 Pst *pst; /* post structure */
735 KwMngmt *trc; /* trace indication */
736 Buffer *mBuf; /* message buffer */
746 } /* end of PtMiLkwTrcInd */
748 /* kw005.201 added support for L2 Measurement */
751 PRIVATE S16 PtMiLkwL2MeasCfm
754 KwL2MeasCfmEvt * measEvt
757 PRIVATE S16 PtMiLkwL2MeasCfm(pst, measEvt)
759 KwL2MeasCfmEvt * measEvt;
763 TRC3(PtMiLkwL2MeasCfm)
772 PRIVATE S16 PtMiLkwL2MeasStopCfm
779 PRIVATE S16 PtMiLkwL2MeasStopCfm(pst, measType,status)
786 TRC3(PtMiLkwL2MeasStopCfm)
795 #endif /* LTE_L2_MEAS */
799 /********************************************************************30**
802 **********************************************************************/