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"
30 #include "du_app_mac_inf.h"
31 #include "du_app_rlc_inf.h"
37 #include "du_f1ap_msg_hdl.h"
38 #include "du_e2ap_msg_hdl.h"
39 #include "du_app_mac_inf.h"
40 #include "du_ue_mgr.h"
43 uint8_t unpackRlcConfigCfm(RlcConfigCfm func,Pst *pst, Buffer *mBuf);
44 uint8_t cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
45 uint8_t cmUnpkLrgCfgCfm(LrgCfgCfm func,Pst *pst, Buffer *mBuf);
46 uint8_t cmUnpkKwuDatInd(KwuDatInd func,Pst *pst, Buffer *mBuf);
47 uint8_t cmUnpkLrgSchCfgCfm(LrgSchCfgCfm func,Pst *pst,Buffer *mBuf);
48 /**************************************************************************
49 * @brief Task Initiation callback function.
53 * Function : duActvInit
56 * This function is supplied as one of parameters during DU APP's
57 * task registration. SSI will invoke this function once, after
58 * it creates and attaches this TAPA Task to a system task.
60 * @param[in] Ent entity, the entity ID of this task.
61 * @param[in] Inst inst, the instance ID of this task.
62 * @param[in] Region region, the region ID registered for memory
64 * @param[in] Reason reason.
65 * @return ROK - success
67 ***************************************************************************/
68 uint8_t duActvInit(Ent entity, Inst inst, Region region, Reason reason)
72 memset(&duCb, 0, sizeof(DuCb));
74 duCb.init.procId = ODU_GET_PROCID();
75 duCb.init.ent = entity;
76 duCb.init.inst = inst;
77 duCb.init.region = region;
78 duCb.init.reason = reason;
79 duCb.init.cfgDone = FALSE;
80 duCb.init.pool = DU_POOL;
81 duCb.init.acnt = FALSE;
82 duCb.init.trc = FALSE;
83 duCb.init.usta = TRUE;
84 duCb.mem.region = DFLT_REGION;
85 duCb.mem.pool = DU_POOL;
87 duCb.f1Status = FALSE;
88 duCb.e2Status = FALSE;
90 for(id = 0; id < MAX_NUM_CELL; id ++)
92 duCb.cfgCellLst[id] = NULL;
93 duCb.actvCellLst[id] = NULL;
96 memset(duCb.ueCcchCtxt, 0, MAX_NUM_UE * sizeof(UeCcchCtxt));
98 duCb.numActvCells = 0;
100 ODU_SET_PROC_ID(DU_PROC);
106 /**************************************************************************
107 * @brief Task Activation callback function.
111 * Function : duActvTsk
114 * Primitives invoked by DU APP's users/providers through
115 * a loosely coupled interface arrive here by means of
116 * SSI's message handling. This API is registered with
117 * SSI during the Task Registration of DU APP.
119 * @param[in] Pst *pst, Post structure of the primitive.
120 * @param[in] Buffer *mBuf, Packed primitive parameters in the
122 * @return ROK - success
125 ***************************************************************************/
126 uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
138 DU_LOG("\n****** Received initial configs at DU APP ******\n");
140 ODU_PUT_MSG_BUF(mBuf);
145 DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTDUAPP");
146 ODU_PUT_MSG_BUF(mBuf);
157 case LKW_EVT_CFG_CFM:
159 ret = unpackRlcConfigCfm(DuHdlRlcCfgComplete, pst, mBuf);
162 case LKW_EVT_CNTRL_CFM:
164 ret = cmUnpkLkwCntrlCfm(duHdlRlcCntrlCfgComplete, pst, mBuf);
167 case LKW_EVT_STA_IND:
171 case EVENT_RLC_UE_CREATE_RSP:
173 ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
176 case EVENT_RLC_UE_RECONFIG_RSP:
178 ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
181 case EVENT_UL_RRC_MSG_TRANS_TO_DU:
183 ret = unpackRlcUlRrcMsgToDu(DuProcRlcUlRrcMsgTrans, pst, mBuf);
186 case EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU:
188 ret = unpackRrcDeliveryReportToDu(DuProcRlcRrcDeliveryReport, pst, mBuf);
191 case EVENT_DL_RRC_MSG_RSP_TO_DU:
193 ret = unpackRlcDlRrcMsgRspToDu(DuProcRlcDlRrcMsgRsp, pst, mBuf);
196 case EVENT_UL_USER_DATA_TRANS_TO_DU:
198 ret = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf);
203 DU_LOG("\nERROR --> DU_APP : Invalid event %d received at duActvTsk from ENTRLC", \
205 ODU_PUT_MSG_BUF(mBuf);
218 ODU_PUT_MSG_BUF(mBuf);
223 ret = cmUnpkLrgCfgCfm(duHdlMacCfgComplete, pst, mBuf);
230 case EVTMACSCHGENCFGCFM:
232 ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
235 case EVENT_MAC_CELL_CONFIG_CFM:
237 ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
240 case EVENT_MAC_CELL_UP_IND:
242 ret = unpackMacCellUpInd(duHandleCellUpInd, pst, mBuf);
245 case EVENT_MAC_STOP_IND:
247 ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
250 case EVENT_MAC_UL_CCCH_IND:
252 ret = unpackMacUlCcchInd(duHandleUlCcchInd, pst, mBuf);
255 case EVENT_MAC_UE_CREATE_RSP:
257 ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf);
260 case EVENT_MAC_UE_RECONFIG_RSP:
262 ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf);
267 DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTMAC");
268 ODU_PUT_MSG_BUF(mBuf);
284 case EVENT_SCTP_NTFY:
286 ret = cmUnpkSctpNtfy(duSctpNtfyHdl, pst, mBuf);
296 DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTSCTP");
301 ODU_PUT_MSG_BUF(mBuf);
310 unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
315 unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
320 unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
325 DU_LOG("\nERROR --> DU_APP : Invalid event[%d] received at duActvTsk from ENTEGTP", pst->event);
329 ODU_PUT_MSG_BUF(mBuf);
334 DU_LOG("\nERROR --> DU_APP : DU APP can not process message from Entity %d", pst->srcEnt);
335 ODU_PUT_MSG_BUF(mBuf);
344 /**********************************************************************
346 **********************************************************************/