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 SSI Interface Implementation
29 **********************************************************************/
32 @brief This file contains the implementation of callback functions
33 registered with SSI during the LTE MAC Task initialization.
35 /* header include files -- defines (.h) */
36 #include "envopt.h" /* environment options */
37 #include "envdep.h" /* environment dependent */
38 #include "envind.h" /* environment independent */
39 #include "gen.h" /* general layer */
40 #include "ssi.h" /* system services */
41 #include "cm5.h" /* common timers defines */
42 #include "cm_hash.h" /* common hash list defines */
43 #include "cm_llist.h" /* common linked list defines */
44 #include "cm_mblk.h" /* memory management */
45 #include "cm_tkns.h" /* common tokens */
46 #include "cm_lte.h" /* common tokens */
47 #include "rgu.h" /* RGU defines */
48 #include "tfu.h" /* RGU defines */
49 #include "lrg.h" /* layer management defines for LTE-MAC */
50 #include "rgr.h" /* layer management defines for LTE-MAC */
51 #include "crg.h" /* CRG interface includes */
52 #include "rg_sch_inf.h" /* SCH interface includes */
53 #include "rg_prg.h" /* PRG interface includes */
54 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
55 #include "rg.h" /* defines and macros for MAC */
56 #include "rgr.h" /* defines and macros for SCH */
59 /* header/extern include files (.x) */
60 #include "gen.x" /* general layer typedefs */
61 #include "ssi.x" /* system services typedefs */
62 #include "cm5.x" /* common timers */
63 #include "cm_hash.x" /* common hash list */
64 #include "cm_lib.x" /* common library */
65 #include "cm_llist.x" /* common linked list */
66 #include "cm_mblk.x" /* memory management */
67 #include "cm_tkns.x" /* common tokens */
68 #include "cm_lte.x" /* common tokens */
69 #include "rgu.x" /* RGU types */
70 #include "tfu.x" /* RGU types */
71 #include "lrg.x" /* layer management typedefs for MAC */
72 #include "rgr.x" /* layer management typedefs for MAC */
73 #include "crg.x" /* CRG interface typedes */
74 #include "rg_sch_inf.x" /* SCH interface typedefs */
75 #include "rg_prg.x" /*PRG interface includes*/
76 #include "rg.x" /* typedefs for MAC */
80 * @brief Task Activation callback function Entity SM.
84 * Function : rgHdlSMEvents
86 * Process Messages received from Entity SM
88 * @param[in] Pst *pst, Post structure of the primitive.
89 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
90 * @param[in] Reason reason.
94 PRIVATE INLINE void rgHdlSMEvents
96 Pst *pst, /* post structure */
97 Buffer *mBuf /* message buffer */
100 PRIVATE INLINE void rgHdlSMEvents(pst, mBuf)
101 Pst *pst; /* post structure */
102 Buffer *mBuf; /* message buffer */
111 /* Process a config. request */
112 cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
114 case EVTMACSCHGENCFGREQ:
115 /* Process a config. request */
116 cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
118 case EVTMACSCHCFGREQ:
119 cmUnpkRgrCfgReq(MacSchCfgReq, pst, mBuf);
122 /* Process a control request */
123 cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
126 /* Process a status request */
127 cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
130 /* Process a statistics request */
131 cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
133 #endif /* LCRGMILRG */
142 * @brief Task Activation callback function Entity NH.
146 * Function : rgHdlNHEvents
148 * Process Messages received from Entity NH
150 * @param[in] Pst *pst, Post structure of the primitive.
151 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
152 * @param[in] Reason reason.
156 PRIVATE INLINE void rgHdlNHEvents
158 Pst *pst, /* post structure */
159 Buffer *mBuf /* message buffer */
162 PRIVATE INLINE void rgHdlNHEvents(pst, mBuf)
163 Pst *pst; /* post structure */
164 Buffer *mBuf; /* message buffer */
173 cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
176 cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
179 cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
189 * @brief Task Activation callback function Entity KW.
193 * Function : rgHdlKWEvents
195 * Process Messages received from Entity KW
197 * @param[in] Pst *pst, Post structure of the primitive.
198 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
199 * @param[in] Reason reason.
203 PRIVATE INLINE void rgHdlKWEvents
205 Pst *pst, /* post structure */
206 Buffer *mBuf /* message buffer */
209 PRIVATE INLINE void rgHdlKWEvents(pst, mBuf)
210 Pst *pst; /* post structure */
211 Buffer *mBuf; /* message buffer */
220 cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
223 cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
226 cmUnpkRguCDatReq(RgUiRguCDatReq, pst, mBuf);
229 cmUnpkRguDDatReq(RgUiRguDDatReq, pst, mBuf);
232 cmUnpkRguCStaRsp(RgUiRguCStaRsp, pst, mBuf);
235 cmUnpkRguDStaRsp(RgUiRguDStaRsp, pst, mBuf);
239 case EVTRGUL2MULTHRPMEASREQ:
240 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
252 * @brief Task Activation callback function Entity TF.
256 * Function : rgHdlTFEvents
258 * Process Messages received from Entity TF
260 * @param[in] Pst *pst, Post structure of the primitive.
261 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
262 * @param[in] Reason reason.
266 PRIVATE INLINE void rgHdlTFEvents
268 Pst *pst, /* post structure */
269 Buffer *mBuf /* message buffer */
272 PRIVATE INLINE void rgHdlTFEvents(pst, mBuf)
273 Pst *pst; /* post structure */
274 Buffer *mBuf; /* message buffer */
281 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
283 cmUnpkTfuBndCfm(RgLiTfuBndCfm, pst, mBuf);
286 cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
289 cmUnpkTfuTtiInd(RgLiTfuTtiInd, pst, mBuf);
291 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
293 cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
305 * @brief Task Activation callback function Entity RG SCH.
309 * Function : rgHdlRGEvents
311 * Process Messages received from Entity RG SCH
313 * @param[in] Pst *pst, Post structure of the primitive.
314 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
315 * @param[in] Reason reason.
319 PRIVATE INLINE void rgHdlRGEvents
321 Pst *pst, /* post structure */
322 Buffer *mBuf /* message buffer */
325 PRIVATE INLINE void rgHdlRGEvents(pst, mBuf)
326 Pst *pst; /* post structure */
327 Buffer *mBuf; /* message buffer */
335 case EVTINFCELLREGREQ:
336 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
338 case EVTINFSFALLOCREQ:
339 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
342 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
344 case EVTINFHQENTRESET:
345 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
347 case EVTINFRLSRNTIREQ:
348 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
352 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
354 case EVTINFSPSLCDEREG:
355 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
358 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
360 #endif /* LTEMAC_SPS */
362 case EVTINFL2MEASREQ:
363 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
365 case EVTINFL2MEASSENDREQ :
366 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
368 case EVTINFL2MEASSTOPREQ:
369 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
371 #endif/* LTE_L2_MEAS */
373 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
376 #if defined(LTE_ADV) && defined(LCPRG)
377 case EVTPRGUESCELLCFGREQ:
379 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
382 case EVTPRGUESCELLCFGCFM:
383 case EVTPRGUESCELLLCHMODCFM:
384 case EVTPRGUESCELLLCHDELCFMDEL:
385 case EVTPRGUESCELLLCHADDCFM:
387 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
390 case EVTPRGUESCELLDELREQ:
392 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
395 case EVTPRGUESCELLLCHMODREQ:
397 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
401 case EVTPRGUESCELLLCHDELREQ:
403 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
407 case EVTPRGUESCELLLCHADDREQ:
409 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
427 * @brief Task Activation callback function.
431 * Function : rgActvTsk
433 * Primitives invoked by MAC's users/providers through
434 * a loosely coupled interface arrive here by means of
435 * SSI's message handling. This API is registered with
436 * SSI during the Task Registration of MAC.
438 * @param[in] Pst *pst, Post structure of the primitive.
439 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
440 * @param[in] Reason reason.
447 Pst *pst, /* post structure */
448 Buffer *mBuf /* message buffer */
451 PUBLIC S16 rgActvTsk(pst, mBuf)
452 Pst *pst; /* post structure */
453 Buffer *mBuf; /* message buffer */
460 /* The originator of this message is the stack manager,
461 * unpack and go to the respective primitive processing function */
463 rgHdlSMEvents(pst, mBuf);
466 rgHdlNHEvents(pst, mBuf);
469 rgHdlKWEvents(pst, mBuf);
472 rgHdlTFEvents(pst, mBuf);
474 case ENTRG: /* When scheduler instance sends msg to MAC */
475 rgHdlRGEvents(pst, mBuf);
483 }/* end of rgActvTsk */
486 /**********************************************************************
489 **********************************************************************/