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 */
59 #include "rlc_mac_inf.h"
62 * @brief Task Activation callback function Entity SM.
66 * Function : rgHdlSMEvents
68 * Process Messages received from Entity SM
70 * @param[in] Pst *pst, Post structure of the primitive.
71 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
72 * @param[in] Reason reason.
76 PRIVATE INLINE void rgHdlSMEvents
78 Pst *pst, /* post structure */
79 Buffer *mBuf /* message buffer */
82 PRIVATE INLINE void rgHdlSMEvents(pst, mBuf)
83 Pst *pst; /* post structure */
84 Buffer *mBuf; /* message buffer */
93 /* Process a config. request */
94 cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
96 case EVTMACSCHGENCFGREQ:
97 /* Process a config. request */
98 cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
101 /* Process a control request */
102 cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
105 /* Process a status request */
106 cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
109 /* Process a statistics request */
110 cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
112 #endif /* LCRGMILRG */
113 case EVENT_MAC_CELL_CONFIG_REQ:
114 /* Process MAC cell config */
115 unpackDuMacCellCfg(MacProcCellCfgReq, pst, mBuf);
117 case EVENT_MAC_CELL_START_REQ:
118 /* Process MAC cell start request */
119 unpackMacCellStartReq(MacProcCellStartReq, pst, mBuf);
121 case EVENT_MAC_CELL_STOP_REQ:
122 /* Process MAC cell stop request */
123 unpackMacCellStopReq(MacProcCellStopReq, pst, mBuf);
125 case EVENT_MAC_DL_CCCH_IND:
126 /* Process DL CCCH Ind */
127 unpackMacDlCcchInd(MacProcDlCcchInd, pst, mBuf);
129 case EVENT_MAC_UE_CREATE_REQ:
130 /* Process Ue Create Request */
131 unpackMacUeCreateReq(MacProcUeCreateReq, pst, mBuf);
141 * @brief Task Activation callback function Entity NH.
145 * Function : rgHdlNHEvents
147 * Process Messages received from Entity NH
149 * @param[in] Pst *pst, Post structure of the primitive.
150 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
151 * @param[in] Reason reason.
155 PRIVATE INLINE void rgHdlNHEvents
157 Pst *pst, /* post structure */
158 Buffer *mBuf /* message buffer */
161 PRIVATE INLINE void rgHdlNHEvents(pst, mBuf)
162 Pst *pst; /* post structure */
163 Buffer *mBuf; /* message buffer */
172 cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
175 cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
178 cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
188 * @brief Task Activation callback function Entity KW.
192 * Function : rgHdlKWEvents
194 * Process Messages received from Entity KW
196 * @param[in] Pst *pst, Post structure of the primitive.
197 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
198 * @param[in] Reason reason.
202 PRIVATE INLINE void rgHdlKWEvents
204 Pst *pst, /* post structure */
205 Buffer *mBuf /* message buffer */
208 PRIVATE INLINE void rgHdlKWEvents(pst, mBuf)
209 Pst *pst; /* post structure */
210 Buffer *mBuf; /* message buffer */
219 cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
222 cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
224 case EVENT_DL_DATA_TO_MAC:
225 unpackRlcDlData(MacProcRlcDlData, pst, mBuf);
227 case EVENT_BO_STATUS_TO_MAC:
228 unpackRlcBoStatus(MacProcRlcBoStatus, pst, mBuf);
232 case EVTRGUL2MULTHRPMEASREQ:
233 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
245 * @brief Task Activation callback function Entity TF.
249 * Function : rgHdlTFEvents
251 * Process Messages received from Entity TF
253 * @param[in] Pst *pst, Post structure of the primitive.
254 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
255 * @param[in] Reason reason.
259 PRIVATE INLINE void rgHdlTFEvents
261 Pst *pst, /* post structure */
262 Buffer *mBuf /* message buffer */
265 PRIVATE INLINE void rgHdlTFEvents(pst, mBuf)
266 Pst *pst; /* post structure */
267 Buffer *mBuf; /* message buffer */
274 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
276 cmUnpkTfuBndCfm(RgLiTfuBndCfm, pst, mBuf);
279 cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
281 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
283 cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
295 * @brief Task Activation callback function Entity RG SCH.
299 * Function : rgHdlRGEvents
301 * Process Messages received from Entity RG SCH
303 * @param[in] Pst *pst, Post structure of the primitive.
304 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
305 * @param[in] Reason reason.
309 PRIVATE INLINE void rgHdlRGEvents
311 Pst *pst, /* post structure */
312 Buffer *mBuf /* message buffer */
315 PRIVATE INLINE void rgHdlRGEvents(pst, mBuf)
316 Pst *pst; /* post structure */
317 Buffer *mBuf; /* message buffer */
325 case EVTINFCELLREGREQ:
326 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
328 case EVTINFSFALLOCREQ:
329 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
332 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
334 case EVTINFHQENTRESET:
335 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
337 case EVTINFRLSRNTIREQ:
338 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
342 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
344 case EVTINFSPSLCDEREG:
345 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
348 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
350 #endif /* LTEMAC_SPS */
352 case EVTINFL2MEASREQ:
353 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
355 case EVTINFL2MEASSENDREQ :
356 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
358 case EVTINFL2MEASSTOPREQ:
359 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
361 #endif/* LTE_L2_MEAS */
363 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
366 #if defined(LTE_ADV) && defined(LCPRG)
367 case EVTPRGUESCELLCFGREQ:
369 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
372 case EVTPRGUESCELLCFGCFM:
373 case EVTPRGUESCELLLCHMODCFM:
374 case EVTPRGUESCELLLCHDELCFMDEL:
375 case EVTPRGUESCELLLCHADDCFM:
377 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
380 case EVTPRGUESCELLDELREQ:
382 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
385 case EVTPRGUESCELLLCHMODREQ:
387 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
391 case EVTPRGUESCELLLCHDELREQ:
393 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
397 case EVTPRGUESCELLLCHADDREQ:
399 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
417 * @brief Task Activation callback function.
421 * Function : rgActvTsk
423 * Primitives invoked by MAC's users/providers through
424 * a loosely coupled interface arrive here by means of
425 * SSI's message handling. This API is registered with
426 * SSI during the Task Registration of MAC.
428 * @param[in] Pst *pst, Post structure of the primitive.
429 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
430 * @param[in] Reason reason.
437 Pst *pst, /* post structure */
438 Buffer *mBuf /* message buffer */
441 S16 rgActvTsk(pst, mBuf)
442 Pst *pst; /* post structure */
443 Buffer *mBuf; /* message buffer */
450 /* The originator of this message is the stack manager,
451 * unpack and go to the respective primitive processing function */
453 rgHdlSMEvents(pst, mBuf);
456 rgHdlNHEvents(pst, mBuf);
459 rgHdlKWEvents(pst, mBuf);
462 rgHdlTFEvents(pst, mBuf);
464 case ENTMAC: /* When scheduler instance sends msg to MAC */
465 rgHdlRGEvents(pst, mBuf);
473 }/* end of rgActvTsk */
476 /**********************************************************************
479 **********************************************************************/