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"
60 #include "lwr_mac_upr_inf.h"
63 * @brief Task Activation callback function Entity SM.
67 * Function : rgHdlSMEvents
69 * Process Messages received from Entity SM
71 * @param[in] Pst *pst, Post structure of the primitive.
72 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
73 * @param[in] Reason reason.
76 static inline void rgHdlSMEvents
78 Pst *pst, /* post structure */
79 Buffer *mBuf /* message buffer */
86 /* Process a config. request */
87 cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
89 case EVTMACSCHGENCFGREQ:
90 /* Process a config. request */
91 cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
94 /* Process a control request */
95 cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
98 /* Process a status request */
99 cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
102 /* Process a statistics request */
103 cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
105 #endif /* LCRGMILRG */
106 case EVENT_MAC_CELL_CONFIG_REQ:
107 /* Process MAC cell config */
108 unpackDuMacCellCfg(MacProcCellCfgReq, pst, mBuf);
110 case EVENT_MAC_CELL_START:
111 /* Process MAC cell start request */
112 unpackMacCellStart(MacProcCellStart, pst, mBuf);
114 case EVENT_MAC_CELL_STOP:
115 /* Process MAC cell stop request */
116 unpackMacCellStop(MacProcCellStop, pst, mBuf);
118 case EVENT_MAC_DL_CCCH_IND:
119 /* Process DL CCCH Ind */
120 unpackMacDlCcchInd(MacProcDlCcchInd, pst, mBuf);
122 case EVENT_MAC_UE_CREATE_REQ:
123 /* Process Ue Create Request */
124 unpackMacUeCreateReq(MacProcUeCreateReq, pst, mBuf);
126 case EVENT_MAC_UE_RECONFIG_REQ:
127 /* Process Ue Reconfig Request */
128 unpackMacUeReconfigReq(MacProcUeReconfigReq, pst, mBuf);
130 case EVENT_MAC_UE_DELETE_REQ:
132 unpackMacUeDeleteReq(MacProcUeDeleteReq, pst, mBuf);
143 * @brief Task Activation callback function Entity NH.
147 * Function : rgHdlNHEvents
149 * Process Messages received from Entity NH
151 * @param[in] Pst *pst, Post structure of the primitive.
152 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
153 * @param[in] Reason reason.
156 static inline void rgHdlNHEvents
158 Pst *pst, /* post structure */
159 Buffer *mBuf /* message buffer */
166 cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
169 cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
172 cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
182 * @brief Task Activation callback function Entity KW.
186 * Function : rgHdlKWEvents
188 * Process Messages received from Entity KW
190 * @param[in] Pst *pst, Post structure of the primitive.
191 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
192 * @param[in] Reason reason.
195 static inline void rgHdlKWEvents
197 Pst *pst, /* post structure */
198 Buffer *mBuf /* message buffer */
205 cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
208 cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
210 case EVENT_DL_DATA_TO_MAC:
211 unpackRlcDlData(MacProcRlcDlData, pst, mBuf);
213 case EVENT_BO_STATUS_TO_MAC:
214 unpackRlcBoStatus(MacProcRlcBoStatus, pst, mBuf);
218 case EVTRGUL2MULTHRPMEASREQ:
219 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
231 * @brief Task Activation callback function Entity TF.
235 * Function : rgHdlTFEvents
237 * Process Messages received from Entity TF
239 * @param[in] Pst *pst, Post structure of the primitive.
240 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
241 * @param[in] Reason reason.
244 static inline void rgHdlTFEvents
246 Pst *pst, /* post structure */
247 Buffer *mBuf /* message buffer */
252 case EVENT_SLOT_IND_TO_MAC:
253 unpackSlotInd(fapiMacSlotInd, pst, mBuf);
255 case EVENT_STOP_IND_TO_MAC:
256 unpackStopInd(fapiMacStopInd, pst, mBuf);
258 case EVENT_RACH_IND_TO_MAC:
259 unpackRachInd(fapiMacRachInd, pst, mBuf);
261 case EVENT_CRC_IND_TO_MAC:
262 unpackCrcInd(fapiMacCrcInd, pst, mBuf);
264 case EVENT_RX_DATA_IND_TO_MAC:
265 unpackRxDataInd(fapiMacRxDataInd, pst, mBuf);
267 case EVENT_UCI_IND_TO_MAC:
268 unpackUciInd(FapiMacUciInd, pst, mBuf);
278 * @brief Task Activation callback function Entity RG SCH.
282 * Function : rgHdlRGEvents
284 * Process Messages received from Entity RG SCH
286 * @param[in] Pst *pst, Post structure of the primitive.
287 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
288 * @param[in] Reason reason.
291 static inline void rgHdlRGEvents
293 Pst *pst, /* post structure */
294 Buffer *mBuf /* message buffer */
300 case EVTINFCELLREGREQ:
301 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
303 case EVTINFSFALLOCREQ:
304 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
307 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
309 case EVTINFHQENTRESET:
310 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
312 case EVTINFRLSRNTIREQ:
313 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
317 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
319 case EVTINFSPSLCDEREG:
320 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
323 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
325 #endif /* LTEMAC_SPS */
327 case EVTINFL2MEASREQ:
328 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
330 case EVTINFL2MEASSENDREQ :
331 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
333 case EVTINFL2MEASSTOPREQ:
334 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
336 #endif/* LTE_L2_MEAS */
338 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
341 #if defined(LTE_ADV) && defined(LCPRG)
342 case EVTPRGUESCELLCFGREQ:
344 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
347 case EVTPRGUESCELLCFGCFM:
348 case EVTPRGUESCELLLCHMODCFM:
349 case EVTPRGUESCELLLCHDELCFMDEL:
350 case EVTPRGUESCELLLCHADDCFM:
352 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
355 case EVTPRGUESCELLDELREQ:
357 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
360 case EVTPRGUESCELLLCHMODREQ:
362 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
366 case EVTPRGUESCELLLCHDELREQ:
368 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
372 case EVTPRGUESCELLLCHADDREQ:
374 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
392 * @brief Task Activation callback function.
396 * Function : rgActvTsk
398 * Primitives invoked by MAC's users/providers through
399 * a loosely coupled interface arrive here by means of
400 * SSI's message handling. This API is registered with
401 * SSI during the Task Registration of MAC.
403 * @param[in] Pst *pst, Post structure of the primitive.
404 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
405 * @param[in] Reason reason.
411 Pst *pst, /* post structure */
412 Buffer *mBuf /* message buffer */
417 /* The originator of this message is the stack manager,
418 * unpack and go to the respective primitive processing function */
420 rgHdlSMEvents(pst, mBuf);
423 rgHdlNHEvents(pst, mBuf);
426 rgHdlKWEvents(pst, mBuf);
429 rgHdlTFEvents(pst, mBuf);
431 case ENTMAC: /* When scheduler instance sends msg to MAC */
432 rgHdlRGEvents(pst, mBuf);
440 }/* end of rgActvTsk */
443 /**********************************************************************
446 **********************************************************************/