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 "common_def.h"
37 #include "rgu.h" /* RGU defines */
38 #include "tfu.h" /* RGU defines */
39 #include "lrg.h" /* layer management defines for LTE-MAC */
40 #include "rgr.h" /* layer management defines for LTE-MAC */
41 #include "crg.h" /* CRG interface includes */
42 #include "rg_sch_inf.h" /* SCH interface includes */
43 #include "rg_prg.h" /* PRG interface includes */
44 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
45 #include "rg.h" /* defines and macros for MAC */
46 #include "rgr.h" /* defines and macros for SCH */
49 /* header/extern include files (.x) */
50 #include "rgu.x" /* RGU types */
51 #include "tfu.x" /* RGU types */
52 #include "lrg.x" /* layer management typedefs for MAC */
53 #include "rgr.x" /* layer management typedefs for MAC */
54 #include "crg.x" /* CRG interface typedes */
55 #include "rg_sch_inf.x" /* SCH interface typedefs */
56 #include "rg_prg.x" /*PRG interface includes*/
57 #include "du_app_mac_inf.h"
58 #include "rg.x" /* typedefs for MAC */
61 * @brief Task Activation callback function Entity SM.
65 * Function : rgHdlSMEvents
67 * Process Messages received from Entity SM
69 * @param[in] Pst *pst, Post structure of the primitive.
70 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
71 * @param[in] Reason reason.
75 PRIVATE INLINE void rgHdlSMEvents
77 Pst *pst, /* post structure */
78 Buffer *mBuf /* message buffer */
81 PRIVATE INLINE void rgHdlSMEvents(pst, mBuf)
82 Pst *pst; /* post structure */
83 Buffer *mBuf; /* message buffer */
92 /* Process a config. request */
93 cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
95 case EVTMACSCHGENCFGREQ:
96 /* Process a config. request */
97 cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
100 /* Process a control request */
101 cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
104 /* Process a status request */
105 cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
108 /* Process a statistics request */
109 cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
111 #endif /* LCRGMILRG */
112 case EVENT_MAC_CELL_CONFIG_REQ:
113 /* Process MAC cell config */
114 unpackDuMacCellCfg(MacProcCellCfgReq, pst, mBuf);
116 case EVENT_MAC_CELL_START_REQ:
117 /* Process MAC cell start request */
118 unpackMacCellStartReq(MacProcCellStartReq, pst, mBuf);
120 case EVENT_MAC_CELL_STOP_REQ:
121 /* Process MAC cell stop request */
122 unpackMacCellStopReq(MacProcCellStopReq, pst, mBuf);
124 case EVENT_MAC_DL_CCCH_IND:
125 /* Process DL CCCH Ind */
126 unpackMacDlCcchInd(MacProcDlCcchInd, pst, mBuf);
128 case EVENT_MAC_UE_CREATE_REQ:
129 /* Process Ue Create Request */
130 unpackMacUeCreateReq(MacProcUeCreateReq, pst, mBuf);
140 * @brief Task Activation callback function Entity NH.
144 * Function : rgHdlNHEvents
146 * Process Messages received from Entity NH
148 * @param[in] Pst *pst, Post structure of the primitive.
149 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
150 * @param[in] Reason reason.
154 PRIVATE INLINE void rgHdlNHEvents
156 Pst *pst, /* post structure */
157 Buffer *mBuf /* message buffer */
160 PRIVATE INLINE void rgHdlNHEvents(pst, mBuf)
161 Pst *pst; /* post structure */
162 Buffer *mBuf; /* message buffer */
171 cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
174 cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
177 cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
187 * @brief Task Activation callback function Entity KW.
191 * Function : rgHdlKWEvents
193 * Process Messages received from Entity KW
195 * @param[in] Pst *pst, Post structure of the primitive.
196 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
197 * @param[in] Reason reason.
201 PRIVATE INLINE void rgHdlKWEvents
203 Pst *pst, /* post structure */
204 Buffer *mBuf /* message buffer */
207 PRIVATE INLINE void rgHdlKWEvents(pst, mBuf)
208 Pst *pst; /* post structure */
209 Buffer *mBuf; /* message buffer */
218 cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
221 cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
224 unpackDlData(MacRlcProcDlData, pst, mBuf);
227 unpackBOStatus(MacRlcProcBOStatus, pst, mBuf);
231 case EVTRGUL2MULTHRPMEASREQ:
232 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
244 * @brief Task Activation callback function Entity TF.
248 * Function : rgHdlTFEvents
250 * Process Messages received from Entity TF
252 * @param[in] Pst *pst, Post structure of the primitive.
253 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
254 * @param[in] Reason reason.
258 PRIVATE INLINE void rgHdlTFEvents
260 Pst *pst, /* post structure */
261 Buffer *mBuf /* message buffer */
264 PRIVATE INLINE void rgHdlTFEvents(pst, mBuf)
265 Pst *pst; /* post structure */
266 Buffer *mBuf; /* message buffer */
273 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
275 cmUnpkTfuBndCfm(RgLiTfuBndCfm, pst, mBuf);
278 cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
280 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
282 cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
294 * @brief Task Activation callback function Entity RG SCH.
298 * Function : rgHdlRGEvents
300 * Process Messages received from Entity RG SCH
302 * @param[in] Pst *pst, Post structure of the primitive.
303 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
304 * @param[in] Reason reason.
308 PRIVATE INLINE void rgHdlRGEvents
310 Pst *pst, /* post structure */
311 Buffer *mBuf /* message buffer */
314 PRIVATE INLINE void rgHdlRGEvents(pst, mBuf)
315 Pst *pst; /* post structure */
316 Buffer *mBuf; /* message buffer */
324 case EVTINFCELLREGREQ:
325 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
327 case EVTINFSFALLOCREQ:
328 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
331 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
333 case EVTINFHQENTRESET:
334 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
336 case EVTINFRLSRNTIREQ:
337 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
341 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
343 case EVTINFSPSLCDEREG:
344 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
347 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
349 #endif /* LTEMAC_SPS */
351 case EVTINFL2MEASREQ:
352 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
354 case EVTINFL2MEASSENDREQ :
355 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
357 case EVTINFL2MEASSTOPREQ:
358 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
360 #endif/* LTE_L2_MEAS */
362 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
365 #if defined(LTE_ADV) && defined(LCPRG)
366 case EVTPRGUESCELLCFGREQ:
368 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
371 case EVTPRGUESCELLCFGCFM:
372 case EVTPRGUESCELLLCHMODCFM:
373 case EVTPRGUESCELLLCHDELCFMDEL:
374 case EVTPRGUESCELLLCHADDCFM:
376 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
379 case EVTPRGUESCELLDELREQ:
381 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
384 case EVTPRGUESCELLLCHMODREQ:
386 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
390 case EVTPRGUESCELLLCHDELREQ:
392 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
396 case EVTPRGUESCELLLCHADDREQ:
398 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
416 * @brief Task Activation callback function.
420 * Function : rgActvTsk
422 * Primitives invoked by MAC's users/providers through
423 * a loosely coupled interface arrive here by means of
424 * SSI's message handling. This API is registered with
425 * SSI during the Task Registration of MAC.
427 * @param[in] Pst *pst, Post structure of the primitive.
428 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
429 * @param[in] Reason reason.
436 Pst *pst, /* post structure */
437 Buffer *mBuf /* message buffer */
440 PUBLIC S16 rgActvTsk(pst, mBuf)
441 Pst *pst; /* post structure */
442 Buffer *mBuf; /* message buffer */
449 /* The originator of this message is the stack manager,
450 * unpack and go to the respective primitive processing function */
452 rgHdlSMEvents(pst, mBuf);
455 rgHdlNHEvents(pst, mBuf);
458 rgHdlKWEvents(pst, mBuf);
461 rgHdlTFEvents(pst, mBuf);
463 case ENTRG: /* When scheduler instance sends msg to MAC */
464 rgHdlRGEvents(pst, mBuf);
472 }/* end of rgActvTsk */
475 /**********************************************************************
478 **********************************************************************/