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 /********************************************************************20**
21 Name: NR RLC Layer - System Services Interface Functions
25 Desc: C source code for the interface to System Services
28 File: rlc_ul_msg_router.c
30 *********************************************************************21*/
32 /** @file rlc_ul_msg_router.c
33 @brief RLC System Services Interface
37 /* header (.h) include files */
38 #include "common_def.h"
39 #include "lkw.h" /* LKW defines */
40 #include "ckw.h" /* CKW defines */
41 #include "kwu.h" /* KWU defines */
42 #include "rgu.h" /* RGU defines */
43 #include "rlc_err.h" /* Err defines */
44 #include "rlc_env.h" /* RLC environment options */
47 /* extern (.x) include files */
48 #include "lkw.x" /* LKW */
49 #include "ckw.x" /* CKW */
50 #include "kwu.x" /* KWU */
51 #include "rgu.x" /* RGU */
53 #include "rlc_utils.h" /* RLC defines */
54 #include "rlc_dl_ul_inf.h"
56 #include "rlc_mac_inf.h"
57 #include "du_app_rlc_inf.h"
60 #include "l2_tenb_stats.x"
64 S16 rlcUlInitExt ARGS (( Void ));
70 * <b> Initialize External </b>
73 * Initializes variables used to interface with Upper/Lower Layer
88 /***********************************************************************
89 System Service Interface Functions
90 ***********************************************************************/
95 * <b> Activates Initialization </b>
98 * This function is invoked by system services to initialize the NR RLC
99 * layer. This is an entry point used by LTE_RLC layer to initialize its
100 * global variables, before becoming operational.
102 * Allowable values for parameters are specified in ssi.h.
104 * @param[in] ent - Specify the entity id of the NR RLC task.
105 * @param[in] inst - Specify the entity id of the NR RLC task.
106 * @param[in] region - Specifies the memory region from which
107 * NR RLC should allocate structures and buffers.
108 * @param[in] reason - Specifies the reason for calling this
109 * initialization function.
117 Ent ent, /* entity */
118 Inst inst, /* instance */
119 Region region, /* region */
120 Reason reason /* reason */
125 if (inst >= MAX_RLC_INSTANCES)
127 /* intance greater than MAX instances */
131 if (rlcCb[inst] != NULLP)
136 if (SGetSBuf(region, 0, (Data **)&tRlcCb,
137 (Size)sizeof (RlcCb)) != ROK)
142 /* Initialize rlcCb */
143 RLC_MEM_SET(tRlcCb, 0, sizeof(RlcCb));
145 /* Initialize task configuration parameters */
146 tRlcCb->init.ent = ent; /* entity */
147 tRlcCb->init.inst = inst; /* instance */
148 tRlcCb->init.region = region; /* static region */
149 tRlcCb->init.pool = 0; /* static pool */
150 tRlcCb->init.reason = reason; /* reason */
151 tRlcCb->init.cfgDone = FALSE; /* configuration done */
152 tRlcCb->init.acnt = TRUE; /* enable accounting */
153 tRlcCb->init.usta = TRUE; /* enable unsolicited status */
154 tRlcCb->init.trc = FALSE; /* enable trace */
155 tRlcCb->init.procId = ODU_GET_PROCID();
157 rlcCb[inst] = tRlcCb;
159 /* call external function for intialization */
164 TSL2AllocStatsMem(tRlcCb->init.inst);
168 } /* rlcUlActvInit */
175 * <b> Activation Task </b>
178 * Processes events received for NR RLC layer via System Services from
181 * @param[in] pst - Pst Structure
182 * @param[in] mBuf - Message Buffer
190 Pst *pst, /* pst structure */
191 Buffer *mBuf /* message buffer */
204 case LKW_EVT_CFG_REQ:
206 ret = unpackRlcConfigReq(RlcMiRlcConfigReq, pst, mBuf);
210 case LKW_EVT_CNTRL_REQ:
212 ret = cmUnpkLkwCntrlReq(RlcMiLkwCntrlReq, pst, mBuf);
216 case EVENT_RLC_UE_CREATE_REQ: /* UE Create Request */
218 ret = unpackRlcUeCreateReq(RlcProcUeCreateReq, pst, mBuf);
221 case EVENT_RLC_UE_RECONFIG_REQ: /* UE Reconfig Request */
223 ret = unpackRlcUeReconfigReq(RlcProcUeReconfigReq, pst, mBuf);
226 case EVENT_RLC_UE_DELETE_REQ:
228 ret = unpackRlcUeDeleteReq(RlcProcUeDeleteReq, pst, mBuf);
232 case LKW_EVT_STS_REQ:
234 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
238 case LKW_EVT_STA_REQ:
240 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
243 /* kw005.201 added support for L2 Measurement */
245 case LKW_EVT_L2MEAS_REQ:
247 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
250 case LKW_EVT_L2MEAS_SEND_REQ:
253 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
257 case LKW_EVT_L2MEAS_STOP_REQ:
259 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
265 ODU_PUT_MSG_BUF(mBuf);
266 if (pst->dstInst < MAX_RLC_INSTANCES)
268 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from SM",
283 case UDX_EVT_BND_CFM: /* Bind request */
285 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
289 case UDX_EVT_CFG_CFM: /* Unbind request */
291 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
295 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
297 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
301 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
303 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
310 ODU_PUT_MSG_BUF(mBuf);
311 if (pst->dstInst < MAX_RLC_INSTANCES)
313 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RLC UL",
328 case CKW_EVT_BND_REQ: /* Bind request */
330 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
334 case CKW_EVT_UBND_REQ: /* Unbind request */
336 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
340 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
342 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
349 case KWU_EVT_BND_REQ: /* Bind request */
351 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
355 case KWU_EVT_UBND_REQ: /* Unbind request */
357 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
362 ODU_PUT_MSG_BUF(mBuf);
363 if (pst->dstInst < MAX_RLC_INSTANCES)
365 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RRC",
380 case KWU_EVT_BND_REQ: /* Bind request */
382 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
386 case KWU_EVT_UBND_REQ: /* Unbind request */
388 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
393 ODU_PUT_MSG_BUF(mBuf);
394 if (pst->dstInst < MAX_RLC_INSTANCES)
396 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from PDCP",
411 case EVTRGUBNDCFM: /* Bind request */
413 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
417 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
419 ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
426 ODU_PUT_MSG_BUF(mBuf);
427 if (pst->dstInst < MAX_RLC_INSTANCES)
429 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from MAC",
437 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
442 case KWU_EVT_TTI_IND:
445 ODU_PUT_MSG_BUF(mBuf);
451 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
452 #ifndef UL_RLC_NET_CLUSTER
462 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
464 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
465 ODU_PUT_MSG_BUF(mBuf);
470 DU_LOG("\nERROR --> RLC_UL : Invalid Event[%d] from CL to PDCPUL\n",
472 ODU_PUT_MSG_BUF(mBuf);
482 if (pst->dstInst < MAX_RLC_INSTANCES)
484 DU_LOG("\nERROR --> RLC_UL : Received Invalid Source Entity[%d]",pst->event);
486 ODU_PUT_MSG_BUF(mBuf);
498 /********************************************************************30**
500 **********************************************************************/