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 "envopt.h" /* environment options */
37 #include "envdep.h" /* environment dependent */
38 #include "envind.h" /* environment independent */
39 #include "gen.h" /* general layer */
40 #include "ssi.h" /* system services */
41 #include "cm5.h" /* common timers defines */
42 #include "cm_hash.h" /* common hash list defines */
43 #include "cm_llist.h" /* common linked list defines */
44 #include "cm_mblk.h" /* memory management */
45 #include "cm_tkns.h" /* common tokens */
46 #include "cm_lte.h" /* common tokens */
47 #include "tfu.h" /* RGU defines */
48 #include "lrg.h" /* layer management defines for LTE-MAC */
49 #include "rgr.h" /* layer management defines for LTE-MAC */
50 #include "rgm.h" /* layer management defines for LTE-MAC */
51 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
52 #include "rg_sch_err.h" /* defines and macros for Scheduler */
53 #include "rg_sch_inf.h" /* defines and macros for Scheduler */
54 #include "rg_sch.h" /* defines and macros for Scheduler */
57 /* header/extern include files (.x) */
58 #include "gen.x" /* general layer typedefs */
59 #include "ssi.x" /* system services typedefs */
60 #include "cm5.x" /* common timers */
61 #include "cm_hash.x" /* common hash list */
62 #include "cm_lib.x" /* common library */
63 #include "cm_llist.x" /* common linked list */
64 #include "cm_mblk.x" /* memory management */
65 #include "cm_tkns.x" /* common tokens */
66 #include "cm_lte.x" /* common tokens */
67 #include "tfu.x" /* RGU types */
68 #include "lrg.x" /* layer management typedefs for MAC */
69 #include "rgr.x" /* layer management typedefs for MAC */
70 #include "rgm.x" /* layer management typedefs for MAC */
71 #include "rg_sch_inf.x" /* typedefs for Scheduler */
72 #include "rg_sch.x" /* typedefs for Scheduler */
78 * @brief Task Activation callback function.
82 * Function : schActvTsk
84 * Primitives invoked by MAC's users/providers through
85 * a loosely coupled interface arrive here by means of
86 * SSI's message handling. This API is registered with
87 * SSI during the Task Registration of MAC.
89 * @param[in] Pst *pst, post structure of the Primitive.
90 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
91 * @param[in] Reason reason.
98 Pst *pst, /* post structure */
99 Buffer *mBuf /* message buffer */
102 PUBLIC S16 schActvTsk(pst, mBuf)
103 Pst *pst; /* post structure */
104 Buffer *mBuf; /* message buffer */
111 /* The originator of this message is the stack manager,
112 * unpack and go to the respective primitive processing function */
117 case EVTMACSCHGENCFGREQ:
118 /* Process a config. request */
119 cmUnpkLrgSchCfgReq(HandleSchGenCfgReq, pst, mBuf);
121 case EVTLRGSCHCNTRLREQ:
122 /* Process a control request */
123 cmUnpkLrgSchCntrlReq(RgMiLrgSchCntrlReq, pst, mBuf);
125 case EVTLRGSCHSTAIND:
126 /* Process a control request */
127 cmUnpkLrgSchStaInd(RgMiLrgSchStaInd, pst, mBuf);
130 case EVTLRGSCHL2MEASREQ:
131 /* Process L2 Measurement request */
132 cmUnpkLrgSchL2MeasReq(RgMiLrgSchL2MeasReq, pst, mBuf);
134 case EVTLRGSCHL2MEASSTOPREQ:
135 /* Process L2 Measurement Stop request */
136 cmUnpkLrgSchL2MeasStopReq(RgMiLrgSchL2MeasStopReq, pst, mBuf);
138 case EVTLRGSCHL2MEASSENDREQ:
139 /* Process L2 Measurement Send request */
140 cmUnpkLrgSchL2MeasSendReq(RgMiLrgSchL2MeasSendReq, pst, mBuf);
143 #endif /* LCRGMILRG */
145 RGSCH_FREE_MSG(mBuf);
154 cmUnpkRgrBndReq(RgUiRgrBndReq, pst, mBuf);
157 cmUnpkRgrUbndReq(RgUiRgrUbndReq, pst, mBuf);
161 cmUnpkRgrSiCfgReq(RgUiRgrSiCfgReq, pst, mBuf);
163 case EVTRGRWARNINGSICFGREQ:
164 cmUnpkRgrWarningSiCfgReq(RgUiRgrWarningSiCfgReq, pst, mBuf);
167 case EVTRGRWARNINGSISTOPREQ:
168 cmUnpkRgrWarningSiStopReq(RgUiRgrWarningSiStopReq, pst, mBuf);
170 #endif/*RGR_SI_SCH */
171 /* LTE_ADV_FLAG_REMOVED_START */
172 case EVTRGRLOADINFREQ:
173 cmUnpkRgrLoadInfReq(RgUiRgrLoadInfReq, pst, mBuf);
175 /* LTE_ADV_FLAG_REMOVED_END */
178 RGSCH_FREE_MSG(mBuf);
185 /*#ifdef LCRGLITFU L2Split */
186 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
187 case EVTTFUSCHBNDCFM:
188 cmUnpkTfuBndCfm(RgLiTfuSchBndCfm, pst, mBuf);
191 cmUnpkTfuRaReqInd(RgLiTfuRaReqInd, pst, mBuf);
194 cmUnpkTfuUlCqiInd(RgLiTfuUlCqiInd, pst, mBuf);
197 cmUnpkTfuHqInd(RgLiTfuHqInd, pst, mBuf);
200 cmUnpkTfuSrInd(RgLiTfuSrInd, pst, mBuf);
203 cmUnpkTfuDlCqiInd(RgLiTfuDlCqiInd, pst, mBuf);
206 /*cmUnpkTfuCrcIndInfo(RgLiTfuCrcInd, pst, mBuf); */
207 cmUnpkTfuCrcInd(RgLiTfuCrcInd, pst, mBuf);
209 case EVTTFUTIMINGADVIND:
210 cmUnpkTfuTimingAdvInd(RgLiTfuTimingAdvInd, pst, mBuf);
212 case EVTTFUSCHTTIIND:
213 cmUnpkTfuSchTtiInd(RgLiTfuSchTtiInd, pst, mBuf);
215 case EVTTFUPUCCHDELPWR:
216 cmUnpkTfuPucchDeltaPwr(RgLiTfuPucchDeltaPwrInd, pst, mBuf);
219 cmUnpkTfuDoaInd(RgLiTfuDoaInd, pst, mBuf);
222 case EVTTFURAWCQIIND:
223 cmUnpkTfuRawCqiInd(RgLiTfuRawCqiInd, pst, mBuf);
226 cmUnpkTfuSrsInd(RgLiTfuSrsInd, pst, mBuf);
229 /*LAA: Error Indication on SCell*/
231 cmUnpkTfuErrInd(RgLiTfuErrInd, pst, mBuf);
235 RGSCH_FREE_MSG(mBuf);
239 case ENTRG: /* When MAC sends a msg to Scheduler instance */
243 case EVTINFDEDBOUPDTREQ:
244 cmUnpkMacSchDedBoUpdtReq(RgMacSchDedBoUpdtReq, pst, mBuf);
246 case EVTINFCMNBOUPDTREQ:
247 cmUnpkMacSchCmnBoUpdtReq(RgMacSchCmnBoUpdtReq, pst, mBuf);
249 case EVTINFSFRECPIND:
250 cmUnpkMacSchSfRecpInd(RgMacSchSfRecpInd, pst, mBuf);
252 /*Fix: start: Inform UE delete to scheduler*/
254 cmUnpkMacSchUeDelInd(RgMacSchUeDelInd, pst, mBuf);
256 /*Fix: end: Inform UE delete to scheduler*/
258 case EVTINFL2MEASCFM:
259 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasCfm, pst, mBuf);
261 case EVTINFL2MEASSTOPCFM:
262 cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasStopCfm, pst, mBuf);
267 RGSCH_FREE_MSG(mBuf);
271 case ENTRM: /* When RRM sends msg to scheduler */
275 cmUnpkRgmBndReq(RgUiRgmBndReq, pst, mBuf);
278 cmUnpkRgmUbndReq(RgUiRgmUbndReq, pst, mBuf);
280 case EVTRGMCFGPRBRPRT:
281 cmUnpkRgmCfgPrbRprt(RgUiRgmCfgPrbRprt, pst, mBuf);
284 RGSCH_FREE_MSG(mBuf);
289 RGSCH_FREE_MSG(mBuf);
294 }/* end of schActvTsk */
297 /**********************************************************************
300 **********************************************************************/