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"
26 #include "du_app_mac_inf.h"
30 #include "du_f1ap_msg_hdl.h"
31 #include "du_e2ap_msg_hdl.h"
34 #include "du_app_mac_inf.h"
35 #include "du_ue_mgr.h"
38 extern S16 cmUnpkLkwCfgCfm(LkwCfgCfm func,Pst *pst, Buffer *mBuf);
39 extern S16 cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
40 extern S16 cmUnpkLrgCfgCfm(LrgCfgCfm func,Pst *pst, Buffer *mBuf);
41 extern S16 cmUnpkKwuDatInd(KwuDatInd func,Pst *pst, Buffer *mBuf);
42 extern S16 cmUnpkLrgSchCfgCfm(LrgSchCfgCfm func,Pst *pst,Buffer *mBuf);
43 /**************************************************************************
44 * @brief Task Initiation callback function.
48 * Function : duActvInit
51 * This function is supplied as one of parameters during DU APP's
52 * task registration. SSI will invoke this function once, after
53 * it creates and attaches this TAPA Task to a system task.
55 * @param[in] Ent entity, the entity ID of this task.
56 * @param[in] Inst inst, the instance ID of this task.
57 * @param[in] Region region, the region ID registered for memory
59 * @param[in] Reason reason.
60 * @return ROK - success
62 ***************************************************************************/
63 S16 duActvInit(Ent entity, Inst inst, Region region, Reason reason)
67 memset(&duCb, 0, sizeof(DuCb));
69 duCb.init.procId = SFndProcId();
70 duCb.init.ent = entity;
71 duCb.init.inst = inst;
72 duCb.init.region = region;
73 duCb.init.reason = reason;
74 duCb.init.cfgDone = FALSE;
75 duCb.init.pool = DU_POOL;
76 duCb.init.acnt = FALSE;
77 duCb.init.trc = FALSE;
78 duCb.init.usta = TRUE;
79 duCb.mem.region = DFLT_REGION;
80 duCb.mem.pool = DU_POOL;
82 duCb.f1Status = FALSE;
83 duCb.e2Status = FALSE;
85 for(id = 0; id < MAX_NUM_CELL; id ++)
87 duCb.cfgCellLst[id] = NULL;
88 duCb.actvCellLst[id] = NULL;
91 memset(duCb.ueCcchCtxt, 0, MAX_NUM_UE * sizeof(UeCcchCtxt));
93 duCb.numActvCells = 0;
101 /**************************************************************************
102 * @brief Task Activation callback function.
106 * Function : duActvTsk
109 * Primitives invoked by DU APP's users/providers through
110 * a loosely coupled interface arrive here by means of
111 * SSI's message handling. This API is registered with
112 * SSI during the Task Registration of DU APP.
114 * @param[in] Pst *pst, Post structure of the primitive.
115 * @param[in] Buffer *mBuf, Packed primitive parameters in the
117 * @return ROK - success
120 ***************************************************************************/
121 S16 duActvTsk(Pst *pst, Buffer *mBuf)
133 DU_LOG("\n****** Received initial configs at DU APP ******\n");
140 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTDUAPP");
152 case LKW_EVT_CFG_CFM:
154 ret = cmUnpkLkwCfgCfm(duHdlRlcCfgComplete, pst, mBuf);
157 case LKW_EVT_CNTRL_CFM:
159 ret = cmUnpkLkwCntrlCfm(duHdlRlcCntrlCfgComplete, pst, mBuf);
162 case LKW_EVT_STA_IND:
166 case KWU_EVT_DAT_IND:
168 ret = cmUnpkKwuDatInd(duHdlRlcUlData, pst, mBuf);
173 DU_LOG("\nDU_APP : Invalid event %d received at duActvTsk from ENTKW", \
193 ret = cmUnpkLrgCfgCfm(duHdlMacCfgComplete, pst, mBuf);
200 case EVTMACSCHGENCFGCFM:
202 ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
205 case EVENT_MAC_CELL_CONFIG_CFM:
207 ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
210 case EVENT_MAC_SLOT_IND:
212 ret = unpackMacSlotInd(duHandleSlotInd, pst, mBuf);
215 case EVENT_MAC_STOP_IND:
217 ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
220 case EVENT_MAC_UL_CCCH_IND:
222 ret = unpackMacUlCcchInd(duHandleUlCcchInd, pst, mBuf);
225 case EVENT_MAC_UE_CREATE_RSP:
227 ret = unpackDuMacUeCreateRsp(duHandleMacUeCreateRsp, pst, mBuf);
233 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTRG");
250 case EVENT_SCTP_NTFY:
252 ret = cmUnpkSctpNtfy(duSctpNtfyHdl, pst, mBuf);
262 DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTSCTP");
276 unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
281 unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
286 unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
291 DU_LOG("\nDU_APP : Invalid event[%d] received at duActvTsk from ENTEGTP", pst->event);
300 DU_LOG("\nDU_APP : DU APP can not process message from Entity %d", pst->srcEnt);
310 /**********************************************************************
312 **********************************************************************/