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 unpackSendDlData(RgUiRguDDatReq, pst, mBuf);
229 unpackSendBOStatus(RgUiRguDStaRsp, pst, mBuf);
233 case EVTRGUL2MULTHRPMEASREQ:
234 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
246 * @brief Task Activation callback function Entity TF.
250 * Function : rgHdlTFEvents
252 * Process Messages received from Entity TF
254 * @param[in] Pst *pst, Post structure of the primitive.
255 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
256 * @param[in] Reason reason.
260 PRIVATE INLINE void rgHdlTFEvents
262 Pst *pst, /* post structure */
263 Buffer *mBuf /* message buffer */
266 PRIVATE INLINE void rgHdlTFEvents(pst, mBuf)
267 Pst *pst; /* post structure */
268 Buffer *mBuf; /* message buffer */
275 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
277 cmUnpkTfuBndCfm(RgLiTfuBndCfm, pst, mBuf);
280 cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
283 cmUnpkTfuTtiInd(RgLiTfuTtiInd, pst, mBuf);
285 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
287 cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
299 * @brief Task Activation callback function Entity RG SCH.
303 * Function : rgHdlRGEvents
305 * Process Messages received from Entity RG SCH
307 * @param[in] Pst *pst, Post structure of the primitive.
308 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
309 * @param[in] Reason reason.
313 PRIVATE INLINE void rgHdlRGEvents
315 Pst *pst, /* post structure */
316 Buffer *mBuf /* message buffer */
319 PRIVATE INLINE void rgHdlRGEvents(pst, mBuf)
320 Pst *pst; /* post structure */
321 Buffer *mBuf; /* message buffer */
329 case EVTINFCELLREGREQ:
330 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
332 case EVTINFSFALLOCREQ:
333 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
336 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
338 case EVTINFHQENTRESET:
339 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
341 case EVTINFRLSRNTIREQ:
342 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
346 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
348 case EVTINFSPSLCDEREG:
349 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
352 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
354 #endif /* LTEMAC_SPS */
356 case EVTINFL2MEASREQ:
357 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
359 case EVTINFL2MEASSENDREQ :
360 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
362 case EVTINFL2MEASSTOPREQ:
363 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
365 #endif/* LTE_L2_MEAS */
367 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
370 #if defined(LTE_ADV) && defined(LCPRG)
371 case EVTPRGUESCELLCFGREQ:
373 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
376 case EVTPRGUESCELLCFGCFM:
377 case EVTPRGUESCELLLCHMODCFM:
378 case EVTPRGUESCELLLCHDELCFMDEL:
379 case EVTPRGUESCELLLCHADDCFM:
381 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
384 case EVTPRGUESCELLDELREQ:
386 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
389 case EVTPRGUESCELLLCHMODREQ:
391 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
395 case EVTPRGUESCELLLCHDELREQ:
397 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
401 case EVTPRGUESCELLLCHADDREQ:
403 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
421 * @brief Task Activation callback function.
425 * Function : rgActvTsk
427 * Primitives invoked by MAC's users/providers through
428 * a loosely coupled interface arrive here by means of
429 * SSI's message handling. This API is registered with
430 * SSI during the Task Registration of MAC.
432 * @param[in] Pst *pst, Post structure of the primitive.
433 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
434 * @param[in] Reason reason.
441 Pst *pst, /* post structure */
442 Buffer *mBuf /* message buffer */
445 PUBLIC S16 rgActvTsk(pst, mBuf)
446 Pst *pst; /* post structure */
447 Buffer *mBuf; /* message buffer */
454 /* The originator of this message is the stack manager,
455 * unpack and go to the respective primitive processing function */
457 rgHdlSMEvents(pst, mBuf);
460 rgHdlNHEvents(pst, mBuf);
463 rgHdlKWEvents(pst, mBuf);
466 rgHdlTFEvents(pst, mBuf);
468 case ENTRG: /* When scheduler instance sends msg to MAC */
469 rgHdlRGEvents(pst, mBuf);
477 }/* end of rgActvTsk */
480 /**********************************************************************
483 **********************************************************************/