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 "du_app_rlc_inf.h"
64 #include "l2_tenb_stats.x"
67 S16 rlcUlInitExt ARGS (( Void ));
73 * <b> Initialize External </b>
76 * Initializes variables used to interface with Upper/Lower Layer
98 /***********************************************************************
99 System Service Interface Functions
100 ***********************************************************************/
105 * <b> Activates Initialization </b>
108 * This function is invoked by system services to initialize the LTE-RLC
109 * layer. This is an entry point used by LTE_RLC layer to initialize its
110 * global variables, before becoming operational.
112 * Allowable values for parameters are specified in ssi.h.
114 * @param[in] ent - Specify the entity id of the LTE-RLC task.
115 * @param[in] inst - Specify the entity id of the LTE-RLC task.
116 * @param[in] region - Specifies the memory region from which
117 * LTE-RLC should allocate structures and buffers.
118 * @param[in] reason - Specifies the reason for calling this
119 * initialization function.
128 Ent ent, /* entity */
129 Inst inst, /* instance */
130 Region region, /* region */
131 Reason reason /* reason */
134 S16 rlcUlActvInit(ent, inst, region, reason)
135 Ent ent; /* entity */
136 Inst inst; /* instance */
137 Region region; /* region */
138 Reason reason; /* reason */
144 if (inst >= MAX_RLC_INSTANCES)
146 /* intance greater than MAX instances */
150 if (rlcCb[inst] != NULLP)
155 if (SGetSBuf(region, 0, (Data **)&tRlcCb,
156 (Size)sizeof (RlcCb)) != ROK)
161 /* Initialize rlcCb */
162 RLC_MEM_SET(tRlcCb, 0, sizeof(RlcCb));
164 /* Initialize task configuration parameters */
165 tRlcCb->init.ent = ent; /* entity */
166 tRlcCb->init.inst = inst; /* instance */
167 tRlcCb->init.region = region; /* static region */
168 tRlcCb->init.pool = 0; /* static pool */
169 tRlcCb->init.reason = reason; /* reason */
170 tRlcCb->init.cfgDone = FALSE; /* configuration done */
171 tRlcCb->init.acnt = TRUE; /* enable accounting */
172 tRlcCb->init.usta = TRUE; /* enable unsolicited status */
173 tRlcCb->init.trc = FALSE; /* enable trace */
174 tRlcCb->init.procId = SFndProcId();
176 rlcCb[inst] = tRlcCb;
178 /* call external function for intialization */
183 TSL2AllocStatsMem(tRlcCb->init.region, tRlcCb->init.pool);
187 } /* rlcUlActvInit */
194 * <b> Activation Task </b>
197 * Processes events received for MLTE-RLC layer via System Services from
200 * @param[in] pst - Pst Structure
201 * @param[in] mBuf - Message Buffer
210 Pst *pst, /* pst structure */
211 Buffer *mBuf /* message buffer */
214 S16 rlcUlActvTsk(pst, mBuf)
215 Pst *pst; /* pst structure */
216 Buffer *mBuf; /* message buffer */
230 case LKW_EVT_CFG_REQ:
232 ret = unpackRlcConfigReq(RlcMiRlcConfigReq, pst, mBuf);
236 case LKW_EVT_CNTRL_REQ:
238 ret = cmUnpkLkwCntrlReq(RlcMiLkwCntrlReq, pst, mBuf);
242 case EVENT_RLC_UL_UE_CREATE_REQ: /* UE Create Request */
244 ret = unpackRlcUlUeCreateReq(RlcUlProcUeCreateReq, pst, mBuf);
248 case LKW_EVT_STS_REQ:
250 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
254 case LKW_EVT_STA_REQ:
256 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
259 /* kw005.201 added support for L2 Measurement */
261 case LKW_EVT_L2MEAS_REQ:
263 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
266 case LKW_EVT_L2MEAS_SEND_REQ:
269 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
273 case LKW_EVT_L2MEAS_STOP_REQ:
275 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
282 if (pst->dstInst < MAX_RLC_INSTANCES)
284 RLOG1(L_FATAL,"Received Invalid Event[%d] from SM",
299 case UDX_EVT_BND_CFM: /* Bind request */
301 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
305 case UDX_EVT_CFG_CFM: /* Unbind request */
307 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
311 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
313 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
317 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
319 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
327 if (pst->dstInst < MAX_RLC_INSTANCES)
329 RLOG1(L_ERROR,"Received Invalid Event[%d] from RLC UL",
344 case CKW_EVT_BND_REQ: /* Bind request */
346 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
350 case CKW_EVT_UBND_REQ: /* Unbind request */
352 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
356 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
358 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
365 case KWU_EVT_BND_REQ: /* Bind request */
367 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
371 case KWU_EVT_UBND_REQ: /* Unbind request */
373 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
379 if (pst->dstInst < MAX_RLC_INSTANCES)
381 RLOG1(L_ERROR,"Received Invalid Event[%d] from RRC",
396 case KWU_EVT_BND_REQ: /* Bind request */
398 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
402 case KWU_EVT_UBND_REQ: /* Unbind request */
404 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
410 if (pst->dstInst < MAX_RLC_INSTANCES)
412 RLOG1(L_ERROR,"Received Invalid Event[%d] from PDCP",
427 case EVTRGUBNDCFM: /* Bind request */
429 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
433 case EVTRLCULDAT: /* Dedicated Channel Data request */
435 ret = unpackRcvdUlData(RlcProcUlData, pst, mBuf);
443 if (pst->dstInst < MAX_RLC_INSTANCES)
445 RLOG1(L_ERROR,"Received Invalid Event[%d] from MAC",
453 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
458 case KWU_EVT_TTI_IND:
467 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
468 #ifndef UL_RLC_NET_CLUSTER
478 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
480 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
486 printf("\n ERROR Invalid Event[%d] from CL to PDCPUL\n",
498 if (pst->dstInst < MAX_RLC_INSTANCES)
500 RLOG1(L_ERROR, "Received Invalid Source Entity[%d]",pst->event);
514 /********************************************************************30**
516 **********************************************************************/