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 #if 0 /*MAC-SCH Interface working as Tightly Coupled thus Commenting*/
33 /** @file sch_msg_router.c
34 @brief This file contains the implementation of callback functions
35 registered with SSI during the LTE MAC Task initialization.
37 /* header include files -- defines (.h) */
38 #include "common_def.h"
39 #include "tfu.h" /* RGU defines */
40 #include "lrg.h" /* layer management defines for LTE-MAC */
41 #include "rgr.h" /* layer management defines for LTE-MAC */
42 #include "rgm.h" /* layer management defines for LTE-MAC */
43 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
44 #include "rg_sch_err.h" /* defines and macros for Scheduler */
45 #include "rg_sch_inf.h" /* defines and macros for Scheduler */
46 #include "rg_sch.h" /* defines and macros for Scheduler */
49 /* header/extern include files (.x) */
50 #include "tfu.x" /* RGU types */
51 #include "lrg.x" /* layer management typedefs for MAC */
52 #include "rgr.x" /* layer management typedefs for MAC */
53 #include "rgm.x" /* layer management typedefs for MAC */
54 #include "rg_sch_inf.x" /* typedefs for Scheduler */
55 #include "rg_sch.x" /* typedefs for Scheduler */
56 #include "mac_sch_interface.h"
58 #ifdef CALL_FLOW_DEBUG_LOG
63 * name : callFlowSchActvTsk
66 * Function used to print values of src, dest, message
67 * received at the layer
69 * @param[in] pst - Pst Structure
74 void callFlowSchActvTsk(Pst *pst)
77 char destTask[50]="ENTSCH";
82 case ENTMAC: /* When MAC sends a msg to Scheduler instance */
84 strcpy(sourceTask,"ENTMAC");
88 case EVTINFDEDBOUPDTREQ:
89 strcpy(message,"EVTINFDEDBOUPDTREQ");
91 case EVTINFCMNBOUPDTREQ:
92 strcpy(message,"EVTINFCMNBOUPDTREQ");
95 strcpy(message,"EVTINFSFRECPIND");
97 /*Fix: start: Inform UE delete to scheduler*/
99 strcpy(message,"EVTINFUEDELIND");
101 /*Fix: end: Inform UE delete to scheduler*/
103 case EVTINFL2MEASCFM:
104 strcpy(message,"EVTINFL2MEASCFM");
106 case EVTINFL2MEASSTOPCFM:
107 strcpy(message,"EVTINFL2MEASSTOPCFM");
111 case EVENT_SLOT_IND_TO_SCH:
112 strcpy(message,"EVENT_SLOT_IND_TO_SCH");
115 strcpy(message,"Invalid Event");
121 strcpy(sourceTask,"Invalid Source Entity Id");
124 DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
129 * @brief Task Activation callback function.
133 * Function : schActvTsk
135 * Primitives invoked by MAC's users/providers through
136 * a loosely coupled interface arrive here by means of
137 * SSI's message handling. This API is registered with
138 * SSI during the Task Registration of MAC.
140 * @param[in] Pst *pst, post structure of the Primitive.
141 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
142 * @param[in] Reason reason.
148 Pst *pst, /* post structure */
149 Buffer *mBuf /* message buffer */
153 #ifdef CALL_FLOW_DEBUG_LOG
154 callFlowSchActvTsk(pst);
159 /* The originator of this message is the stack manager,
160 * unpack and go to the respective primitive processing function */
165 case EVTMACSCHGENCFGREQ:
166 /* Process a config. request */
167 cmUnpkLrgSchCfgReq(SchProcGenCfgReq, 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);
193 case ENTMAC: /* When MAC sends a msg to Scheduler instance */
197 case EVTINFDEDBOUPDTREQ:
198 cmUnpkMacSchDedBoUpdtReq(RgMacSchDedBoUpdtReq, pst, mBuf);
200 case EVTINFCMNBOUPDTREQ:
201 cmUnpkMacSchCmnBoUpdtReq(RgMacSchCmnBoUpdtReq, pst, mBuf);
203 case EVTINFSFRECPIND:
204 cmUnpkMacSchSfRecpInd(RgMacSchSfRecpInd, pst, mBuf);
206 /*Fix: start: Inform UE delete to scheduler*/
208 cmUnpkMacSchUeDelInd(RgMacSchUeDelInd, pst, mBuf);
210 /*Fix: end: Inform UE delete to scheduler*/
212 case EVTINFL2MEASCFM:
213 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasCfm, pst, mBuf);
215 case EVTINFL2MEASSTOPCFM:
216 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasStopCfm, pst, mBuf);
220 case EVENT_SLOT_IND_TO_SCH:
221 unpackMacSchSlotInd(MacSchSlotInd, pst, mBuf);
224 RGSCH_FREE_MSG(mBuf);
229 RGSCH_FREE_MSG(mBuf);
234 }/* end of schActvTsk */
238 /**********************************************************************
241 **********************************************************************/