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 "rgu.h" /* RGU defines */
48 #include "tfu.h" /* RGU defines */
49 #include "lrg.h" /* layer management defines for LTE-MAC */
50 #include "rgr.h" /* layer management defines for LTE-MAC */
51 #include "crg.h" /* CRG interface includes */
52 #include "rg_sch_inf.h" /* SCH interface includes */
53 #include "rg_prg.h" /* PRG interface includes */
54 #include "rg_env.h" /* customisable defines and macros for LTE-MAC */
55 #include "rg.h" /* defines and macros for MAC */
56 #include "rgr.h" /* defines and macros for SCH */
59 /* header/extern include files (.x) */
60 #include "gen.x" /* general layer typedefs */
61 #include "ssi.x" /* system services typedefs */
62 #include "cm5.x" /* common timers */
63 #include "cm_hash.x" /* common hash list */
64 #include "cm_lib.x" /* common library */
65 #include "cm_llist.x" /* common linked list */
66 #include "cm_mblk.x" /* memory management */
67 #include "cm_tkns.x" /* common tokens */
68 #include "cm_lte.x" /* common tokens */
69 #include "rgu.x" /* RGU types */
70 #include "tfu.x" /* RGU types */
71 #include "lrg.x" /* layer management typedefs for MAC */
72 #include "rgr.x" /* layer management typedefs for MAC */
73 #include "crg.x" /* CRG interface typedes */
74 #include "rg_sch_inf.x" /* SCH interface typedefs */
75 #include "rg_prg.x" /*PRG interface includes*/
76 #include "du_app_mac_inf.h"
77 #include "rg.x" /* typedefs for MAC */
78 int unpackDuMacCellCfg(DuMacCellCfgReq func,Pst *pst,Buffer *mBuf);
81 * @brief Task Activation callback function Entity SM.
85 * Function : rgHdlSMEvents
87 * Process Messages received from Entity SM
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.
95 PRIVATE INLINE void rgHdlSMEvents
97 Pst *pst, /* post structure */
98 Buffer *mBuf /* message buffer */
101 PRIVATE INLINE void rgHdlSMEvents(pst, mBuf)
102 Pst *pst; /* post structure */
103 Buffer *mBuf; /* message buffer */
112 /* Process a config. request */
113 cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
115 case EVTMACSCHGENCFGREQ:
116 /* Process a config. request */
117 cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
120 /* Process a control request */
121 cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
124 /* Process a status request */
125 cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
128 /* Process a statistics request */
129 cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
131 #endif /* LCRGMILRG */
132 case EVENT_MAC_CELL_CONFIG_REQ:
133 /* Process MAC cell config */
134 unpackDuMacCellCfg(MacHdlCellCfgReq, pst, mBuf);
136 case EVENT_MAC_CELL_START_REQ:
137 /* Process MAC cell start request */
138 unpackMacCellStartReq(MacHdlCellStartReq, pst, mBuf);
140 case EVENT_MAC_CELL_STOP_REQ:
141 /* Process MAC cell stop request */
142 unpackMacCellStopReq(MacHdlCellStopReq, pst, mBuf);
144 case EVENT_MAC_DL_CCCH_IND:
145 /* Process DL CCCH Ind */
146 unpackMacDlCcchInd(MacHdlDlCcchInd, pst, mBuf);
156 * @brief Task Activation callback function Entity NH.
160 * Function : rgHdlNHEvents
162 * Process Messages received from Entity NH
164 * @param[in] Pst *pst, Post structure of the primitive.
165 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
166 * @param[in] Reason reason.
170 PRIVATE INLINE void rgHdlNHEvents
172 Pst *pst, /* post structure */
173 Buffer *mBuf /* message buffer */
176 PRIVATE INLINE void rgHdlNHEvents(pst, mBuf)
177 Pst *pst; /* post structure */
178 Buffer *mBuf; /* message buffer */
187 cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
190 cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
193 cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
203 * @brief Task Activation callback function Entity KW.
207 * Function : rgHdlKWEvents
209 * Process Messages received from Entity KW
211 * @param[in] Pst *pst, Post structure of the primitive.
212 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
213 * @param[in] Reason reason.
217 PRIVATE INLINE void rgHdlKWEvents
219 Pst *pst, /* post structure */
220 Buffer *mBuf /* message buffer */
223 PRIVATE INLINE void rgHdlKWEvents(pst, mBuf)
224 Pst *pst; /* post structure */
225 Buffer *mBuf; /* message buffer */
234 cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
237 cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
240 unpackDlData(MacRlcProcDlData, pst, mBuf);
243 unpackBOStatus(MacRlcProcBOStatus, pst, mBuf);
247 case EVTRGUL2MULTHRPMEASREQ:
248 cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
260 * @brief Task Activation callback function Entity TF.
264 * Function : rgHdlTFEvents
266 * Process Messages received from Entity TF
268 * @param[in] Pst *pst, Post structure of the primitive.
269 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
270 * @param[in] Reason reason.
274 PRIVATE INLINE void rgHdlTFEvents
276 Pst *pst, /* post structure */
277 Buffer *mBuf /* message buffer */
280 PRIVATE INLINE void rgHdlTFEvents(pst, mBuf)
281 Pst *pst; /* post structure */
282 Buffer *mBuf; /* message buffer */
289 #if (defined(LCRGLITFU) || defined(LWLCRGLITFU))
291 cmUnpkTfuBndCfm(RgLiTfuBndCfm, pst, mBuf);
294 cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
296 case EVENT_SLOT_IND_TO_MAC:
297 cmUnpackSlotInd(fapiMacSlotInd, pst, mBuf);
299 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
301 cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
313 * @brief Task Activation callback function Entity RG SCH.
317 * Function : rgHdlRGEvents
319 * Process Messages received from Entity RG SCH
321 * @param[in] Pst *pst, Post structure of the primitive.
322 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
323 * @param[in] Reason reason.
327 PRIVATE INLINE void rgHdlRGEvents
329 Pst *pst, /* post structure */
330 Buffer *mBuf /* message buffer */
333 PRIVATE INLINE void rgHdlRGEvents(pst, mBuf)
334 Pst *pst; /* post structure */
335 Buffer *mBuf; /* message buffer */
343 case EVTINFCELLREGREQ:
344 cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
346 case EVTINFSFALLOCREQ:
347 cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
350 cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
352 case EVTINFHQENTRESET:
353 cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
355 case EVTINFRLSRNTIREQ:
356 cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
360 cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
362 case EVTINFSPSLCDEREG:
363 cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
366 cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
368 #endif /* LTEMAC_SPS */
370 case EVTINFL2MEASREQ:
371 cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
373 case EVTINFL2MEASSENDREQ :
374 cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
376 case EVTINFL2MEASSTOPREQ:
377 cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
379 #endif/* LTE_L2_MEAS */
381 cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
384 #if defined(LTE_ADV) && defined(LCPRG)
385 case EVTPRGUESCELLCFGREQ:
387 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
390 case EVTPRGUESCELLCFGCFM:
391 case EVTPRGUESCELLLCHMODCFM:
392 case EVTPRGUESCELLLCHDELCFMDEL:
393 case EVTPRGUESCELLLCHADDCFM:
395 cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
398 case EVTPRGUESCELLDELREQ:
400 cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
403 case EVTPRGUESCELLLCHMODREQ:
405 cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
409 case EVTPRGUESCELLLCHDELREQ:
411 cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
415 case EVTPRGUESCELLLCHADDREQ:
417 cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
435 * @brief Task Activation callback function.
439 * Function : rgActvTsk
441 * Primitives invoked by MAC's users/providers through
442 * a loosely coupled interface arrive here by means of
443 * SSI's message handling. This API is registered with
444 * SSI during the Task Registration of MAC.
446 * @param[in] Pst *pst, Post structure of the primitive.
447 * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer.
448 * @param[in] Reason reason.
455 Pst *pst, /* post structure */
456 Buffer *mBuf /* message buffer */
459 PUBLIC S16 rgActvTsk(pst, mBuf)
460 Pst *pst; /* post structure */
461 Buffer *mBuf; /* message buffer */
468 /* The originator of this message is the stack manager,
469 * unpack and go to the respective primitive processing function */
471 rgHdlSMEvents(pst, mBuf);
474 rgHdlNHEvents(pst, mBuf);
477 rgHdlKWEvents(pst, mBuf);
480 rgHdlTFEvents(pst, mBuf);
482 case ENTRG: /* When scheduler instance sends msg to MAC */
483 rgHdlRGEvents(pst, mBuf);
491 }/* end of rgActvTsk */
494 /**********************************************************************
497 **********************************************************************/