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 "rlc_mac_inf.h"
62 #include "du_app_rlc_inf.h"
65 #include "l2_tenb_stats.x"
68 S16 rlcUlInitExt ARGS (( Void ));
74 * <b> Initialize External </b>
77 * Initializes variables used to interface with Upper/Lower Layer
99 /***********************************************************************
100 System Service Interface Functions
101 ***********************************************************************/
106 * <b> Activates Initialization </b>
109 * This function is invoked by system services to initialize the LTE-RLC
110 * layer. This is an entry point used by LTE_RLC layer to initialize its
111 * global variables, before becoming operational.
113 * Allowable values for parameters are specified in ssi.h.
115 * @param[in] ent - Specify the entity id of the LTE-RLC task.
116 * @param[in] inst - Specify the entity id of the LTE-RLC task.
117 * @param[in] region - Specifies the memory region from which
118 * LTE-RLC should allocate structures and buffers.
119 * @param[in] reason - Specifies the reason for calling this
120 * initialization function.
129 Ent ent, /* entity */
130 Inst inst, /* instance */
131 Region region, /* region */
132 Reason reason /* reason */
135 S16 rlcUlActvInit(ent, inst, region, reason)
136 Ent ent; /* entity */
137 Inst inst; /* instance */
138 Region region; /* region */
139 Reason reason; /* reason */
145 if (inst >= MAX_RLC_INSTANCES)
147 /* intance greater than MAX instances */
151 if (rlcCb[inst] != NULLP)
156 if (SGetSBuf(region, 0, (Data **)&tRlcCb,
157 (Size)sizeof (RlcCb)) != ROK)
162 /* Initialize rlcCb */
163 RLC_MEM_SET(tRlcCb, 0, sizeof(RlcCb));
165 /* Initialize task configuration parameters */
166 tRlcCb->init.ent = ent; /* entity */
167 tRlcCb->init.inst = inst; /* instance */
168 tRlcCb->init.region = region; /* static region */
169 tRlcCb->init.pool = 0; /* static pool */
170 tRlcCb->init.reason = reason; /* reason */
171 tRlcCb->init.cfgDone = FALSE; /* configuration done */
172 tRlcCb->init.acnt = TRUE; /* enable accounting */
173 tRlcCb->init.usta = TRUE; /* enable unsolicited status */
174 tRlcCb->init.trc = FALSE; /* enable trace */
175 tRlcCb->init.procId = ODU_GET_PROCID();
177 rlcCb[inst] = tRlcCb;
179 /* call external function for intialization */
184 TSL2AllocStatsMem(tRlcCb->init.region, tRlcCb->init.pool);
188 } /* rlcUlActvInit */
195 * <b> Activation Task </b>
198 * Processes events received for MLTE-RLC layer via System Services from
201 * @param[in] pst - Pst Structure
202 * @param[in] mBuf - Message Buffer
211 Pst *pst, /* pst structure */
212 Buffer *mBuf /* message buffer */
215 S16 rlcUlActvTsk(pst, mBuf)
216 Pst *pst; /* pst structure */
217 Buffer *mBuf; /* message buffer */
231 case LKW_EVT_CFG_REQ:
233 ret = unpackRlcConfigReq(RlcMiRlcConfigReq, pst, mBuf);
237 case LKW_EVT_CNTRL_REQ:
239 ret = cmUnpkLkwCntrlReq(RlcMiLkwCntrlReq, pst, mBuf);
243 case EVENT_RLC_UL_UE_CREATE_REQ: /* UE Create Request */
245 ret = unpackRlcUlUeCreateReq(RlcUlProcUeCreateReq, pst, mBuf);
249 case LKW_EVT_STS_REQ:
251 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
255 case LKW_EVT_STA_REQ:
257 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
260 /* kw005.201 added support for L2 Measurement */
262 case LKW_EVT_L2MEAS_REQ:
264 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
267 case LKW_EVT_L2MEAS_SEND_REQ:
270 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
274 case LKW_EVT_L2MEAS_STOP_REQ:
276 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
282 ODU_PUT_MSG_BUF(mBuf);
283 if (pst->dstInst < MAX_RLC_INSTANCES)
285 RLOG1(L_FATAL,"Received Invalid Event[%d] from SM",
300 case UDX_EVT_BND_CFM: /* Bind request */
302 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
306 case UDX_EVT_CFG_CFM: /* Unbind request */
308 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
312 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
314 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
318 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
320 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
327 ODU_PUT_MSG_BUF(mBuf);
328 if (pst->dstInst < MAX_RLC_INSTANCES)
330 RLOG1(L_ERROR,"Received Invalid Event[%d] from RLC UL",
345 case CKW_EVT_BND_REQ: /* Bind request */
347 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
351 case CKW_EVT_UBND_REQ: /* Unbind request */
353 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
357 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
359 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
366 case KWU_EVT_BND_REQ: /* Bind request */
368 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
372 case KWU_EVT_UBND_REQ: /* Unbind request */
374 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
379 ODU_PUT_MSG_BUF(mBuf);
380 if (pst->dstInst < MAX_RLC_INSTANCES)
382 RLOG1(L_ERROR,"Received Invalid Event[%d] from RRC",
397 case KWU_EVT_BND_REQ: /* Bind request */
399 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
403 case KWU_EVT_UBND_REQ: /* Unbind request */
405 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
410 ODU_PUT_MSG_BUF(mBuf);
411 if (pst->dstInst < MAX_RLC_INSTANCES)
413 RLOG1(L_ERROR,"Received Invalid Event[%d] from PDCP",
428 case EVTRGUBNDCFM: /* Bind request */
430 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
434 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
436 ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
443 ODU_PUT_MSG_BUF(mBuf);
444 if (pst->dstInst < MAX_RLC_INSTANCES)
446 RLOG1(L_ERROR,"Received Invalid Event[%d] from MAC",
454 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
459 case KWU_EVT_TTI_IND:
462 ODU_PUT_MSG_BUF(mBuf);
468 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
469 #ifndef UL_RLC_NET_CLUSTER
479 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
481 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
482 ODU_PUT_MSG_BUF(mBuf);
487 printf("\n ERROR Invalid Event[%d] from CL to PDCPUL\n",
489 ODU_PUT_MSG_BUF(mBuf);
499 if (pst->dstInst < MAX_RLC_INSTANCES)
501 RLOG1(L_ERROR, "Received Invalid Source Entity[%d]",pst->event);
503 ODU_PUT_MSG_BUF(mBuf);
515 /********************************************************************30**
517 **********************************************************************/