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);
228 case LKW_EVT_STS_REQ:
230 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
234 case LKW_EVT_STA_REQ:
236 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
239 /* kw005.201 added support for L2 Measurement */
241 case LKW_EVT_L2MEAS_REQ:
243 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
246 case LKW_EVT_L2MEAS_SEND_REQ:
249 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
253 case LKW_EVT_L2MEAS_STOP_REQ:
255 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
261 ODU_PUT_MSG_BUF(mBuf);
262 if (pst->dstInst < MAX_RLC_INSTANCES)
264 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from SM",
279 case UDX_EVT_BND_CFM: /* Bind request */
281 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
285 case UDX_EVT_CFG_CFM: /* Unbind request */
287 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
291 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
293 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
297 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
299 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
306 ODU_PUT_MSG_BUF(mBuf);
307 if (pst->dstInst < MAX_RLC_INSTANCES)
309 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RLC UL",
324 case CKW_EVT_BND_REQ: /* Bind request */
326 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
330 case CKW_EVT_UBND_REQ: /* Unbind request */
332 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
336 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
338 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
345 case KWU_EVT_BND_REQ: /* Bind request */
347 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
351 case KWU_EVT_UBND_REQ: /* Unbind request */
353 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
358 ODU_PUT_MSG_BUF(mBuf);
359 if (pst->dstInst < MAX_RLC_INSTANCES)
361 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RRC",
376 case KWU_EVT_BND_REQ: /* Bind request */
378 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
382 case KWU_EVT_UBND_REQ: /* Unbind request */
384 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
389 ODU_PUT_MSG_BUF(mBuf);
390 if (pst->dstInst < MAX_RLC_INSTANCES)
392 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from PDCP",
407 case EVTRGUBNDCFM: /* Bind request */
409 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
413 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
415 ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
422 ODU_PUT_MSG_BUF(mBuf);
423 if (pst->dstInst < MAX_RLC_INSTANCES)
425 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from MAC",
433 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
438 case KWU_EVT_TTI_IND:
441 ODU_PUT_MSG_BUF(mBuf);
447 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
448 #ifndef UL_RLC_NET_CLUSTER
458 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
460 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
461 ODU_PUT_MSG_BUF(mBuf);
466 DU_LOG("\nERROR --> RLC_UL : Invalid Event[%d] from CL to PDCPUL\n",
468 ODU_PUT_MSG_BUF(mBuf);
478 if (pst->dstInst < MAX_RLC_INSTANCES)
480 DU_LOG("\nERROR --> RLC_UL : Received Invalid Source Entity[%d]",pst->event);
482 ODU_PUT_MSG_BUF(mBuf);
494 /********************************************************************30**
496 **********************************************************************/