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
27 File: sch_msg_router.c
29 **********************************************************************/
31 /** @file sch_msg_router.c
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 "tfu.h" /* RGU defines */
38 #include "lrg.h" /* layer management defines for LTE-MAC */
39 #include "rgr.h" /* layer management defines for LTE-MAC */
40 #include "rgm.h" /* layer management defines for LTE-MAC */
41 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
42 #include "rg_sch_err.h" /* defines and macros for Scheduler */
43 #include "rg_sch_inf.h" /* defines and macros for Scheduler */
44 #include "rg_sch.h" /* defines and macros for Scheduler */
47 /* header/extern include files (.x) */
48 #include "tfu.x" /* RGU types */
49 #include "lrg.x" /* layer management typedefs for MAC */
50 #include "rgr.x" /* layer management typedefs for MAC */
51 #include "rgm.x" /* layer management typedefs for MAC */
52 #include "rg_sch_inf.x" /* typedefs for Scheduler */
53 #include "rg_sch.x" /* typedefs for Scheduler */
54 #include "mac_sch_interface.h"
60 * name : callFlowSchActvTsk
63 * Function used to print values of src, dest, message
64 * received at the layer
66 * @param[in] pst - Pst Structure
71 void callFlowSchActvTsk(Pst *pst)
74 char destTask[50]="ENTSCH";
79 case ENTMAC: /* When MAC sends a msg to Scheduler instance */
81 strcpy(sourceTask,"ENTMAC");
85 case EVTINFDEDBOUPDTREQ:
86 strcpy(message,"EVTINFDEDBOUPDTREQ");
88 case EVTINFCMNBOUPDTREQ:
89 strcpy(message,"EVTINFCMNBOUPDTREQ");
92 strcpy(message,"EVTINFSFRECPIND");
94 /*Fix: start: Inform UE delete to scheduler*/
96 strcpy(message,"EVTINFUEDELIND");
98 /*Fix: end: Inform UE delete to scheduler*/
100 case EVTINFL2MEASCFM:
101 strcpy(message,"EVTINFL2MEASCFM");
103 case EVTINFL2MEASSTOPCFM:
104 strcpy(message,"EVTINFL2MEASSTOPCFM");
108 case EVENT_SLOT_IND_TO_SCH:
109 strcpy(message,"EVENT_SLOT_IND_TO_SCH");
112 strcpy(message,"Invalid Event");
118 strcpy(sourceTask,"Invalid Source Entity Id");
121 DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
125 * @brief Task Activation callback function.
129 * Function : schActvTsk
131 * Primitives invoked by MAC's users/providers through
132 * a loosely coupled interface arrive here by means of
133 * SSI's message handling. This API is registered with
134 * SSI during the Task Registration of MAC.
136 * @param[in] Pst *pst, post structure of the Primitive.
137 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
138 * @param[in] Reason reason.
144 Pst *pst, /* post structure */
145 Buffer *mBuf /* message buffer */
149 #ifdef CALL_FLOW_DEBUG_LOG
150 callFlowSchActvTsk(pst);
155 /* The originator of this message is the stack manager,
156 * unpack and go to the respective primitive processing function */
161 case EVTMACSCHGENCFGREQ:
162 /* Process a config. request */
163 cmUnpkLrgSchCfgReq(SchProcGenCfgReq, pst, mBuf);
165 case EVTLRGSCHCNTRLREQ:
166 /* Process a control request */
167 cmUnpkLrgSchCntrlReq(RgMiLrgSchCntrlReq, pst, mBuf);
169 case EVTLRGSCHSTAIND:
170 /* Process a control request */
171 cmUnpkLrgSchStaInd(RgMiLrgSchStaInd, pst, mBuf);
174 case EVTLRGSCHL2MEASREQ:
175 /* Process L2 Measurement request */
176 cmUnpkLrgSchL2MeasReq(RgMiLrgSchL2MeasReq, pst, mBuf);
178 case EVTLRGSCHL2MEASSTOPREQ:
179 /* Process L2 Measurement Stop request */
180 cmUnpkLrgSchL2MeasStopReq(RgMiLrgSchL2MeasStopReq, pst, mBuf);
182 case EVTLRGSCHL2MEASSENDREQ:
183 /* Process L2 Measurement Send request */
184 cmUnpkLrgSchL2MeasSendReq(RgMiLrgSchL2MeasSendReq, pst, mBuf);
187 #endif /* LCRGMILRG */
189 RGSCH_FREE_MSG(mBuf);
198 cmUnpkRgrBndReq(RgUiRgrBndReq, pst, mBuf);
201 cmUnpkRgrUbndReq(RgUiRgrUbndReq, pst, mBuf);
205 cmUnpkRgrSiCfgReq(RgUiRgrSiCfgReq, pst, mBuf);
207 case EVTRGRWARNINGSICFGREQ:
208 cmUnpkRgrWarningSiCfgReq(RgUiRgrWarningSiCfgReq, pst, mBuf);
211 case EVTRGRWARNINGSISTOPREQ:
212 cmUnpkRgrWarningSiStopReq(RgUiRgrWarningSiStopReq, pst, mBuf);
214 #endif/*RGR_SI_SCH */
215 /* LTE_ADV_FLAG_REMOVED_START */
216 case EVTRGRLOADINFREQ:
217 cmUnpkRgrLoadInfReq(RgUiRgrLoadInfReq, pst, mBuf);
219 /* LTE_ADV_FLAG_REMOVED_END */
222 RGSCH_FREE_MSG(mBuf);
226 case ENTMAC: /* When MAC sends a msg to Scheduler instance */
230 case EVTINFDEDBOUPDTREQ:
231 cmUnpkMacSchDedBoUpdtReq(RgMacSchDedBoUpdtReq, pst, mBuf);
233 case EVTINFCMNBOUPDTREQ:
234 cmUnpkMacSchCmnBoUpdtReq(RgMacSchCmnBoUpdtReq, pst, mBuf);
236 case EVTINFSFRECPIND:
237 cmUnpkMacSchSfRecpInd(RgMacSchSfRecpInd, pst, mBuf);
239 /*Fix: start: Inform UE delete to scheduler*/
241 cmUnpkMacSchUeDelInd(RgMacSchUeDelInd, pst, mBuf);
243 /*Fix: end: Inform UE delete to scheduler*/
245 case EVTINFL2MEASCFM:
246 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasCfm, pst, mBuf);
248 case EVTINFL2MEASSTOPCFM:
249 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasStopCfm, pst, mBuf);
253 case EVENT_SLOT_IND_TO_SCH:
254 unpackMacSchSlotInd(MacSchSlotInd, pst, mBuf);
257 RGSCH_FREE_MSG(mBuf);
261 case ENTRM: /* When RRM sends msg to scheduler */
265 cmUnpkRgmBndReq(RgUiRgmBndReq, pst, mBuf);
268 cmUnpkRgmUbndReq(RgUiRgmUbndReq, pst, mBuf);
270 case EVTRGMCFGPRBRPRT:
271 cmUnpkRgmCfgPrbRprt(RgUiRgmCfgPrbRprt, pst, mBuf);
274 RGSCH_FREE_MSG(mBuf);
279 RGSCH_FREE_MSG(mBuf);
284 }/* end of schActvTsk */
287 /**********************************************************************
290 **********************************************************************/