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 /* This file contains message handling functionality for DU APP */
20 #include "common_def.h"
29 #include "du_f1ap_msg_hdl.h"
30 #include "du_e2ap_msg_hdl.h"
33 #include "du_app_mac_inf.h"
34 #include "du_ue_mgr.h"
37 extern S16 cmUnpkLkwCfgCfm(LkwCfgCfm func,Pst *pst, Buffer *mBuf);
38 extern S16 cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
39 extern S16 cmUnpkLrgCfgCfm(LrgCfgCfm func,Pst *pst, Buffer *mBuf);
40 extern S16 cmUnpkKwuDatInd(KwuDatInd func,Pst *pst, Buffer *mBuf);
41 extern S16 cmUnpkLrgSchCfgCfm(LrgSchCfgCfm func,Pst *pst,Buffer *mBuf);
42 /**************************************************************************
43 * @brief Task Initiation callback function.
47 * Function : duActvInit
50 * This function is supplied as one of parameters during DU APP's
51 * task registration. SSI will invoke this function once, after
52 * it creates and attaches this TAPA Task to a system task.
54 * @param[in] Ent entity, the entity ID of this task.
55 * @param[in] Inst inst, the instance ID of this task.
56 * @param[in] Region region, the region ID registered for memory
58 * @param[in] Reason reason.
59 * @return ROK - success
61 ***************************************************************************/
62 S16 duActvInit(Ent entity, Inst inst, Region region, Reason reason)
66 memset(&duCb, 0, sizeof(DuCb));
68 duCb.init.procId = SFndProcId();
69 duCb.init.ent = entity;
70 duCb.init.inst = inst;
71 duCb.init.region = region;
72 duCb.init.reason = reason;
73 duCb.init.cfgDone = FALSE;
74 duCb.init.pool = DU_POOL;
75 duCb.init.acnt = FALSE;
76 duCb.init.trc = FALSE;
77 duCb.init.usta = TRUE;
78 duCb.mem.region = DFLT_REGION;
79 duCb.mem.pool = DU_POOL;
81 duCb.f1Status = FALSE;
82 duCb.e2Status = FALSE;
84 for(id = 0; id < DU_MAX_CELLS; id ++)
86 duCb.cfgCellLst[id] = NULL;
87 duCb.actvCellLst[id] = NULL;
90 memset(duCb.ueCcchCtxt, 0, DU_MAX_UE * sizeof(UeCcchCtxt));
98 /**************************************************************************
99 * @brief Task Activation callback function.
103 * Function : duActvTsk
106 * Primitives invoked by DU APP's users/providers through
107 * a loosely coupled interface arrive here by means of
108 * SSI's message handling. This API is registered with
109 * SSI during the Task Registration of DU APP.
111 * @param[in] Pst *pst, Post structure of the primitive.
112 * @param[in] Buffer *mBuf, Packed primitive parameters in the
114 * @return ROK - success
117 ***************************************************************************/
118 S16 duActvTsk(Pst *pst, Buffer *mBuf)
130 DU_LOG("\n****** Received initial configs at DU APP ******\n");
137 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTDUAPP");
149 case LKW_EVT_CFG_CFM:
151 ret = cmUnpkLkwCfgCfm(duHdlRlcCfgComplete, pst, mBuf);
154 case LKW_EVT_CNTRL_CFM:
156 ret = cmUnpkLkwCntrlCfm(duHdlRlcCntrlCfgComplete, pst, mBuf);
159 case LKW_EVT_STA_IND:
163 case KWU_EVT_DAT_IND:
165 ret = cmUnpkKwuDatInd(duHdlRlcUlData, pst, mBuf);
170 DU_LOG("\nDU_APP : Invalid event %d received at duActvTsk from ENTKW", \
190 ret = cmUnpkLrgCfgCfm(duHdlMacCfgComplete, pst, mBuf);
197 case EVTMACSCHGENCFGCFM:
199 ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
202 case EVENT_MAC_CELL_CONFIG_CFM:
204 ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
207 case EVENT_MAC_SLOT_IND:
209 ret = unpackMacSlotInd(duHandleSlotInd, pst, mBuf);
212 case EVENT_MAC_STOP_IND:
214 ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
217 case EVENT_MAC_UL_CCCH_IND:
219 ret = unpackMacUlCcchInd(duHandleUlCcchInd, pst, mBuf);
225 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTRG");
242 case EVENT_SCTP_NTFY:
244 ret = cmUnpkSctpNtfy(duSctpNtfyHdl, pst, mBuf);
254 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTSCTP");
268 unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
273 unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
278 unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
283 DU_LOG("\nDU_APP : Invalid event[%d] received at duActvTsk from ENTEGTP", pst->event);
292 DU_LOG("\nDU_APP : DU APP can not process message from Entity %d", pst->srcEnt);
302 /**********************************************************************
304 **********************************************************************/