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
30 *********************************************************************21*/
32 /** @file kw_ul_ex_ms.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 "kw_err.h" /* Err defines */
44 #include "kw_env.h" /* RLC environment options */
45 #include "kw.h" /* RLC defines */
49 /* extern (.x) include files */
50 #include "lkw.x" /* LKW */
51 #include "ckw.x" /* CKW */
52 #include "kwu.x" /* KWU */
53 #include "rgu.x" /* RGU */
58 #include "rlc_mac_inf.h"
59 #include "du_app_rlc_inf.h"
62 #include "l2_tenb_stats.x"
65 S16 rlcUlInitExt ARGS (( Void ));
71 * <b> Initialize External </b>
74 * Initializes variables used to interface with Upper/Lower Layer
89 /***********************************************************************
90 System Service Interface Functions
91 ***********************************************************************/
96 * <b> Activates Initialization </b>
99 * This function is invoked by system services to initialize the NR RLC
100 * layer. This is an entry point used by LTE_RLC layer to initialize its
101 * global variables, before becoming operational.
103 * Allowable values for parameters are specified in ssi.h.
105 * @param[in] ent - Specify the entity id of the NR RLC task.
106 * @param[in] inst - Specify the entity id of the NR RLC task.
107 * @param[in] region - Specifies the memory region from which
108 * NR RLC should allocate structures and buffers.
109 * @param[in] reason - Specifies the reason for calling this
110 * initialization function.
118 Ent ent, /* entity */
119 Inst inst, /* instance */
120 Region region, /* region */
121 Reason reason /* reason */
126 if (inst >= MAX_RLC_INSTANCES)
128 /* intance greater than MAX instances */
132 if (rlcCb[inst] != NULLP)
137 if (SGetSBuf(region, 0, (Data **)&tRlcCb,
138 (Size)sizeof (RlcCb)) != ROK)
143 /* Initialize rlcCb */
144 RLC_MEM_SET(tRlcCb, 0, sizeof(RlcCb));
146 /* Initialize task configuration parameters */
147 tRlcCb->init.ent = ent; /* entity */
148 tRlcCb->init.inst = inst; /* instance */
149 tRlcCb->init.region = region; /* static region */
150 tRlcCb->init.pool = 0; /* static pool */
151 tRlcCb->init.reason = reason; /* reason */
152 tRlcCb->init.cfgDone = FALSE; /* configuration done */
153 tRlcCb->init.acnt = TRUE; /* enable accounting */
154 tRlcCb->init.usta = TRUE; /* enable unsolicited status */
155 tRlcCb->init.trc = FALSE; /* enable trace */
156 tRlcCb->init.procId = ODU_GET_PROCID();
158 rlcCb[inst] = tRlcCb;
160 /* call external function for intialization */
165 TSL2AllocStatsMem(tRlcCb->init.region, tRlcCb->init.pool);
169 } /* rlcUlActvInit */
176 * <b> Activation Task </b>
179 * Processes events received for NR RLC layer via System Services from
182 * @param[in] pst - Pst Structure
183 * @param[in] mBuf - Message Buffer
191 Pst *pst, /* pst structure */
192 Buffer *mBuf /* message buffer */
205 case LKW_EVT_CFG_REQ:
207 ret = unpackRlcConfigReq(RlcMiRlcConfigReq, pst, mBuf);
211 case LKW_EVT_CNTRL_REQ:
213 ret = cmUnpkLkwCntrlReq(RlcMiLkwCntrlReq, pst, mBuf);
217 case EVENT_RLC_UE_CREATE_REQ: /* UE Create Request */
219 ret = unpackRlcUeCreateReq(RlcProcUeCreateReq, pst, mBuf);
222 case EVENT_RLC_UE_RECONFIG_REQ: /* UE Reconfig Request */
224 ret = unpackRlcUeReconfigReq(RlcProcUeReconfigReq, pst, mBuf);
227 case EVENT_RLC_UE_DELETE_REQ:
229 ret = unpackRlcUeDeleteReq(RlcProcUeDeleteReq, pst, mBuf);
233 case LKW_EVT_STS_REQ:
235 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
239 case LKW_EVT_STA_REQ:
241 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
244 /* kw005.201 added support for L2 Measurement */
246 case LKW_EVT_L2MEAS_REQ:
248 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
251 case LKW_EVT_L2MEAS_SEND_REQ:
254 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
258 case LKW_EVT_L2MEAS_STOP_REQ:
260 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
266 ODU_PUT_MSG_BUF(mBuf);
267 if (pst->dstInst < MAX_RLC_INSTANCES)
269 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from SM",
284 case UDX_EVT_BND_CFM: /* Bind request */
286 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
290 case UDX_EVT_CFG_CFM: /* Unbind request */
292 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
296 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
298 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
302 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
304 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
311 ODU_PUT_MSG_BUF(mBuf);
312 if (pst->dstInst < MAX_RLC_INSTANCES)
314 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RLC UL",
329 case CKW_EVT_BND_REQ: /* Bind request */
331 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
335 case CKW_EVT_UBND_REQ: /* Unbind request */
337 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
341 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
343 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
350 case KWU_EVT_BND_REQ: /* Bind request */
352 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
356 case KWU_EVT_UBND_REQ: /* Unbind request */
358 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
363 ODU_PUT_MSG_BUF(mBuf);
364 if (pst->dstInst < MAX_RLC_INSTANCES)
366 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RRC",
381 case KWU_EVT_BND_REQ: /* Bind request */
383 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
387 case KWU_EVT_UBND_REQ: /* Unbind request */
389 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
394 ODU_PUT_MSG_BUF(mBuf);
395 if (pst->dstInst < MAX_RLC_INSTANCES)
397 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from PDCP",
412 case EVTRGUBNDCFM: /* Bind request */
414 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
418 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
420 ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
427 ODU_PUT_MSG_BUF(mBuf);
428 if (pst->dstInst < MAX_RLC_INSTANCES)
430 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from MAC",
438 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
443 case KWU_EVT_TTI_IND:
446 ODU_PUT_MSG_BUF(mBuf);
452 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
453 #ifndef UL_RLC_NET_CLUSTER
463 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
465 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
466 ODU_PUT_MSG_BUF(mBuf);
471 DU_LOG("\nERROR --> RLC_UL : Invalid Event[%d] from CL to PDCPUL\n",
473 ODU_PUT_MSG_BUF(mBuf);
483 if (pst->dstInst < MAX_RLC_INSTANCES)
485 DU_LOG("\nERROR --> RLC_UL : Received Invalid Source Entity[%d]",pst->event);
487 ODU_PUT_MSG_BUF(mBuf);
499 /********************************************************************30**
501 **********************************************************************/