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: LTE-RLC Layer - System Services Interface Functions
25 Desc: C source code for the interface to System Services
30 *********************************************************************21*/
31 static const char* RLOG_MODULE_NAME="RLC_UL";
32 static int RLOG_MODULE_ID=2048;
33 static int RLOG_FILE_ID=206;
35 /** @file kw_ul_ex_ms.c
36 @brief RLC System Services Interface
40 /* header (.h) include files */
41 #include "common_def.h"
42 #include "lkw.h" /* LKW defines */
43 #include "ckw.h" /* CKW defines */
44 #include "kwu.h" /* KWU defines */
45 #include "rgu.h" /* RGU defines */
46 #include "kw_err.h" /* Err defines */
47 #include "kw_env.h" /* RLC environment options */
48 #include "kw.h" /* RLC defines */
52 /* extern (.x) include files */
53 #include "lkw.x" /* LKW */
54 #include "ckw.x" /* CKW */
55 #include "kwu.x" /* KWU */
56 #include "rgu.x" /* RGU */
61 #include "l2_tenb_stats.x"
64 PUBLIC S16 kwUlInitExt ARGS (( Void ));
70 * <b> Initialize External </b>
73 * Initializes variables used to interface with Upper/Lower Layer
81 PUBLIC S16 kwUlInitExt
85 PUBLIC S16 kwUlInitExt()
95 /***********************************************************************
96 System Service Interface Functions
97 ***********************************************************************/
102 * <b> Activates Initialization </b>
105 * This function is invoked by system services to initialize the LTE-RLC
106 * layer. This is an entry point used by LTE_RLC layer to initialize its
107 * global variables, before becoming operational.
109 * Allowable values for parameters are specified in ssi.h.
111 * @param[in] ent - Specify the entity id of the LTE-RLC task.
112 * @param[in] inst - Specify the entity id of the LTE-RLC task.
113 * @param[in] region - Specifies the memory region from which
114 * LTE-RLC should allocate structures and buffers.
115 * @param[in] reason - Specifies the reason for calling this
116 * initialization function.
123 PUBLIC S16 kwUlActvInit
125 Ent ent, /* entity */
126 Inst inst, /* instance */
127 Region region, /* region */
128 Reason reason /* reason */
131 PUBLIC S16 kwUlActvInit(ent, inst, region, reason)
132 Ent ent; /* entity */
133 Inst inst; /* instance */
134 Region region; /* region */
135 Reason reason; /* reason */
141 if (inst >= KW_MAX_RLC_INSTANCES)
143 /* intance greater than MAX instances */
147 if (kwCb[inst] != NULLP)
152 if (SGetSBuf(region, 0, (Data **)&tKwCb,
153 (Size)sizeof (KwCb)) != ROK)
158 /* Initialize kwCb */
159 KW_MEM_SET(tKwCb, 0, sizeof(KwCb));
161 /* Initialize task configuration parameters */
162 tKwCb->init.ent = ent; /* entity */
163 tKwCb->init.inst = inst; /* instance */
164 tKwCb->init.region = region; /* static region */
165 tKwCb->init.pool = 0; /* static pool */
166 tKwCb->init.reason = reason; /* reason */
167 tKwCb->init.cfgDone = FALSE; /* configuration done */
168 tKwCb->init.acnt = TRUE; /* enable accounting */
169 tKwCb->init.usta = TRUE; /* enable unsolicited status */
170 tKwCb->init.trc = FALSE; /* enable trace */
171 tKwCb->init.procId = SFndProcId();
175 /* call external function for intialization */
180 TSL2AllocStatsMem(tKwCb->init.region, tKwCb->init.pool);
191 * <b> Activation Task </b>
194 * Processes events received for MLTE-RLC layer via System Services from
197 * @param[in] pst - Pst Structure
198 * @param[in] mBuf - Message Buffer
205 PUBLIC S16 kwUlActvTsk
207 Pst *pst, /* pst structure */
208 Buffer *mBuf /* message buffer */
211 PUBLIC S16 kwUlActvTsk(pst, mBuf)
212 Pst *pst; /* pst structure */
213 Buffer *mBuf; /* message buffer */
227 case LKW_EVT_CFG_REQ:
229 ret = cmUnpkLkwCfgReq(KwMiLkwCfgReq, pst, mBuf);
233 case LKW_EVT_CNTRL_REQ:
235 ret = cmUnpkLkwCntrlReq(KwMiLkwCntrlReq, pst, mBuf);
239 case RLC_EVT_UE_CREATE_REQ: /* UE Create Request */
241 ret = unpackUeCreateReq(RlcDuappProcUeCreateReq, pst, mBuf);
245 case LKW_EVT_STS_REQ:
247 ret = cmUnpkLkwStsReq(KwMiLkwStsReq, pst, mBuf);
251 case LKW_EVT_STA_REQ:
253 ret = cmUnpkLkwStaReq(KwMiLkwStaReq, pst, mBuf);
256 /* kw005.201 added support for L2 Measurement */
258 case LKW_EVT_L2MEAS_REQ:
260 ret = cmUnpkLkwL2MeasReq(KwMiLkwL2MeasReq, pst, mBuf);
263 case LKW_EVT_L2MEAS_SEND_REQ:
266 ret = cmUnpkLkwL2MeasSendReq(KwMiLkwL2MeasSendReq, pst, mBuf);
270 case LKW_EVT_L2MEAS_STOP_REQ:
272 ret = cmUnpkLkwL2MeasStopReq(KwMiLkwL2MeasStopReq, pst, mBuf);
279 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
281 RLOG1(L_FATAL,"Received Invalid Event[%d] from SM",
296 case UDX_EVT_BND_CFM: /* Bind request */
298 ret = cmUnpkUdxBndCfm(KwUlUdxBndCfm, pst, mBuf );
302 case UDX_EVT_CFG_CFM: /* Unbind request */
304 ret = cmUnpkUdxCfgCfm(KwUlUdxCfgCfm, pst, mBuf );
308 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
310 ret = cmUnpkUdxUeIdChgCfm(KwUlUdxUeIdChgCfm, pst, mBuf);
314 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
316 ret = cmUnpkUdxStaProhTmrStart(KwUlUdxStaProhTmrStart, pst, mBuf);
324 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
326 RLOG1(L_ERROR,"Received Invalid Event[%d] from RLC UL",
341 case CKW_EVT_BND_REQ: /* Bind request */
343 ret = cmUnpkCkwBndReq(KwUiCkwBndReq, pst, mBuf );
347 case CKW_EVT_UBND_REQ: /* Unbind request */
349 ret = cmUnpkCkwUbndReq(KwUiCkwUbndReq, pst, mBuf );
353 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
355 ret = cmUnpkCkwUeIdChgReq(KwUiCkwUeIdChgReq, pst, mBuf);
362 case KWU_EVT_BND_REQ: /* Bind request */
364 ret = cmUnpkKwuBndReq(KwUiKwuBndReq, pst, mBuf );
368 case KWU_EVT_UBND_REQ: /* Unbind request */
370 ret = cmUnpkKwuUbndReq(KwUiKwuUbndReq, pst, mBuf );
376 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
378 RLOG1(L_ERROR,"Received Invalid Event[%d] from RRC",
393 case KWU_EVT_BND_REQ: /* Bind request */
395 ret = cmUnpkKwuBndReq(KwUiKwuBndReq, pst, mBuf );
399 case KWU_EVT_UBND_REQ: /* Unbind request */
401 ret = cmUnpkKwuUbndReq(KwUiKwuUbndReq, pst, mBuf );
407 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
409 RLOG1(L_ERROR,"Received Invalid Event[%d] from PDCP",
424 case EVTRGUBNDCFM: /* Bind request */
426 ret = cmUnpkRguBndCfm(KwLiRguBndCfm, pst, mBuf );
430 case EVTRLCULDAT: /* Dedicated Channel Data request */
432 ret = unpackRcvdUlData(RlcMacProcUlData, pst, mBuf);
440 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
442 RLOG1(L_ERROR,"Received Invalid Event[%d] from MAC",
450 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
455 case KWU_EVT_TTI_IND:
464 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
465 #ifndef UL_RLC_NET_CLUSTER
475 tKwCb = KW_GET_KWCB(pst->dstInst);
477 TSL2SendStatsToApp(&(tKwCb->genCfg.lmPst), 0);
483 printf("\n ERROR Invalid Event[%d] from CL to PDCPUL\n",
495 if (pst->dstInst < KW_MAX_RLC_INSTANCES)
497 RLOG1(L_ERROR, "Received Invalid Source Entity[%d]",pst->event);
511 /********************************************************************30**
513 **********************************************************************/