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
28 File: rlc_ul_msg_router.c
30 *********************************************************************21*/
32 /** @file rlc_ul_msg_router.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 "rlc_err.h" /* Err defines */
44 #include "rlc_env.h" /* RLC environment options */
47 /* extern (.x) include files */
48 #include "lkw.x" /* LKW */
49 #include "ckw.x" /* CKW */
50 #include "kwu.x" /* KWU */
51 #include "rgu.x" /* RGU */
53 #include "rlc_utils.h" /* RLC defines */
54 #include "rlc_dl_ul_inf.h"
56 #include "rlc_mac_inf.h"
57 #include "du_app_rlc_inf.h"
60 #include "l2_tenb_stats.x"
64 S16 rlcUlInitExt ARGS (( Void ));
70 * <b> Initialize External </b>
73 * Initializes variables used to interface with Upper/Lower Layer
88 /***********************************************************************
89 System Service Interface Functions
90 ***********************************************************************/
95 * <b> Activates Initialization </b>
98 * This function is invoked by system services to initialize the NR RLC
99 * layer. This is an entry point used by LTE_RLC layer to initialize its
100 * global variables, before becoming operational.
102 * Allowable values for parameters are specified in ssi.h.
104 * @param[in] ent - Specify the entity id of the NR RLC task.
105 * @param[in] inst - Specify the entity id of the NR RLC task.
106 * @param[in] region - Specifies the memory region from which
107 * NR RLC should allocate structures and buffers.
108 * @param[in] reason - Specifies the reason for calling this
109 * initialization function.
117 Ent ent, /* entity */
118 Inst inst, /* instance */
119 Region region, /* region */
120 Reason reason /* reason */
125 if (inst >= MAX_RLC_INSTANCES)
127 /* intance greater than MAX instances */
131 if (rlcCb[inst] != NULLP)
136 if (SGetSBuf(region, 0, (Data **)&tRlcCb,
137 (Size)sizeof (RlcCb)) != ROK)
142 /* Initialize rlcCb */
143 RLC_MEM_SET(tRlcCb, 0, sizeof(RlcCb));
145 /* Initialize task configuration parameters */
146 tRlcCb->init.ent = ent; /* entity */
147 tRlcCb->init.inst = inst; /* instance */
148 tRlcCb->init.region = region; /* static region */
149 tRlcCb->init.pool = 0; /* static pool */
150 tRlcCb->init.reason = reason; /* reason */
151 tRlcCb->init.cfgDone = FALSE; /* configuration done */
152 tRlcCb->init.acnt = TRUE; /* enable accounting */
153 tRlcCb->init.usta = TRUE; /* enable unsolicited status */
154 tRlcCb->init.trc = FALSE; /* enable trace */
155 tRlcCb->init.procId = ODU_GET_PROCID();
157 rlcCb[inst] = tRlcCb;
159 /* call external function for intialization */
164 TSL2AllocStatsMem(tRlcCb->init.inst);
168 } /* rlcUlActvInit */
174 * name : callFlowRlcUlActvTsk
177 * Function used to print values of src, dest, message
178 * received at the layer
180 * @param[in] pst - Pst Structure
185 void callFlowRlcUlActvTsk(Pst *pst)
188 char destTask[50]="ENTRLCUL";
195 strcpy(sourceTask,"ENTDUAPP");
199 case LKW_EVT_CFG_REQ:
201 strcpy(message,"LKW_EVT_CFG_REQ");
205 case LKW_EVT_CNTRL_REQ:
207 strcpy(message,"LKW_EVT_CNTRL_REQ");
211 case EVENT_RLC_UE_CREATE_REQ: /* UE Create Request */
213 strcpy(message,"EVENT_RLC_UE_CREATE_REQ");
216 case EVENT_RLC_UE_RECONFIG_REQ: /* UE Reconfig Request */
218 strcpy(message,"EVENT_RLC_UE_RECONFIG_REQ");
221 case EVENT_RLC_UE_DELETE_REQ:
223 strcpy(message,"EVENT_RLC_UE_DELETE_REQ");
227 case LKW_EVT_STS_REQ:
229 strcpy(message,"LKW_EVT_STS_REQ");
233 case LKW_EVT_STA_REQ:
235 strcpy(message,"LKW_EVT_STA_REQ");
238 /* kw005.201 added support for L2 Measurement */
242 strcpy(message,"Invalid Event");
251 strcpy(sourceTask,"ENTRLC");
255 case UDX_EVT_BND_CFM: /* Bind request */
257 strcpy(message,"UDX_EVT_BND_CFM");
261 case UDX_EVT_CFG_CFM: /* Unbind request */
263 strcpy(message,"UDX_EVT_CFG_CFM");
267 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
269 strcpy(message,"UDX_EVT_UEIDCHG_CFM");
273 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
275 strcpy(message,"UDX_EVT_STA_PHBT_TMR_START");
282 strcpy(message,"Invalid Event");
291 strcpy(sourceTask,"ENTMAC");
295 case EVTRGUBNDCFM: /* Bind request */
297 strcpy(message,"EVTRGUBNDCFM");
301 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
303 strcpy(message,"EVENT_UL_DATA_TO_RLC");
310 strcpy(message,"Invalid Event");
317 strcpy(sourceTask,"Invalid Source Entity Id");
320 DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
331 * <b> Activation Task </b>
334 * Processes events received for NR RLC layer via System Services from
337 * @param[in] pst - Pst Structure
338 * @param[in] mBuf - Message Buffer
346 Pst *pst, /* pst structure */
347 Buffer *mBuf /* message buffer */
352 #ifdef CALL_FLOW_DEBUG_LOG
353 callFlowRlcUlActvTsk(pst);
363 case LKW_EVT_CFG_REQ:
365 ret = unpackRlcConfigReq(RlcMiRlcConfigReq, pst, mBuf);
369 case LKW_EVT_CNTRL_REQ:
371 ret = cmUnpkLkwCntrlReq(RlcMiLkwCntrlReq, pst, mBuf);
375 case EVENT_RLC_UE_CREATE_REQ: /* UE Create Request */
377 ret = unpackRlcUeCreateReq(RlcProcUeCreateReq, pst, mBuf);
380 case EVENT_RLC_UE_RECONFIG_REQ: /* UE Reconfig Request */
382 ret = unpackRlcUeReconfigReq(RlcProcUeReconfigReq, pst, mBuf);
385 case EVENT_RLC_UE_DELETE_REQ:
387 ret = unpackRlcUeDeleteReq(RlcProcUeDeleteReq, pst, mBuf);
391 case LKW_EVT_STS_REQ:
393 ret = cmUnpkLkwStsReq(RlcMiLkwStsReq, pst, mBuf);
397 case LKW_EVT_STA_REQ:
399 ret = cmUnpkLkwStaReq(RlcMiLkwStaReq, pst, mBuf);
402 /* kw005.201 added support for L2 Measurement */
404 case LKW_EVT_L2MEAS_REQ:
406 ret = cmUnpkLkwL2MeasReq(RlcMiLkwL2MeasReq, pst, mBuf);
409 case LKW_EVT_L2MEAS_SEND_REQ:
412 ret = cmUnpkLkwL2MeasSendReq(RlcMiLkwL2MeasSendReq, pst, mBuf);
416 case LKW_EVT_L2MEAS_STOP_REQ:
418 ret = cmUnpkLkwL2MeasStopReq(RlcMiLkwL2MeasStopReq, pst, mBuf);
424 ODU_PUT_MSG_BUF(mBuf);
425 if (pst->dstInst < MAX_RLC_INSTANCES)
427 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from SM",
442 case UDX_EVT_BND_CFM: /* Bind request */
444 ret = cmUnpkUdxBndCfm(rlcUlUdxBndCfm, pst, mBuf );
448 case UDX_EVT_CFG_CFM: /* Unbind request */
450 ret = cmUnpkUdxCfgCfm(rlcUlUdxCfgCfm, pst, mBuf );
454 case UDX_EVT_UEIDCHG_CFM: /* Configuration request */
456 ret = cmUnpkUdxUeIdChgCfm(rlcUlUdxUeIdChgCfm, pst, mBuf);
460 case UDX_EVT_STA_PHBT_TMR_START: /* Status Prohibit Timer Start */
462 ret = cmUnpkUdxStaProhTmrStart(rlcUlUdxStaProhTmrStart, pst, mBuf);
469 ODU_PUT_MSG_BUF(mBuf);
470 if (pst->dstInst < MAX_RLC_INSTANCES)
472 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RLC UL",
487 case CKW_EVT_BND_REQ: /* Bind request */
489 ret = cmUnpkCkwBndReq(RlcUiCkwBndReq, pst, mBuf );
493 case CKW_EVT_UBND_REQ: /* Unbind request */
495 ret = cmUnpkCkwUbndReq(RlcUiCkwUbndReq, pst, mBuf );
499 case CKW_EVT_UEIDCHG_REQ: /* Configuration request */
501 ret = cmUnpkCkwUeIdChgReq(RlcUiCkwUeIdChgReq, pst, mBuf);
508 case KWU_EVT_BND_REQ: /* Bind request */
510 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
514 case KWU_EVT_UBND_REQ: /* Unbind request */
516 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
521 ODU_PUT_MSG_BUF(mBuf);
522 if (pst->dstInst < MAX_RLC_INSTANCES)
524 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RRC",
539 case KWU_EVT_BND_REQ: /* Bind request */
541 ret = cmUnpkKwuBndReq(RlcUiKwuBndReq, pst, mBuf );
545 case KWU_EVT_UBND_REQ: /* Unbind request */
547 ret = cmUnpkKwuUbndReq(RlcUiKwuUbndReq, pst, mBuf );
552 ODU_PUT_MSG_BUF(mBuf);
553 if (pst->dstInst < MAX_RLC_INSTANCES)
555 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from PDCP",
570 case EVTRGUBNDCFM: /* Bind request */
572 ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
576 case EVENT_UL_DATA_TO_RLC: /* UL Data request */
578 ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
585 ODU_PUT_MSG_BUF(mBuf);
586 if (pst->dstInst < MAX_RLC_INSTANCES)
588 DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from MAC",
596 #if defined(L2_L3_SPLIT) && defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined (MAC_RLC_UL_RBUF)
601 case KWU_EVT_TTI_IND:
604 ODU_PUT_MSG_BUF(mBuf);
610 #endif/* End for TENB_T2K3K_SPECIFIC_CHANGES and L2_L3_SPLIT */
611 #ifndef UL_RLC_NET_CLUSTER
621 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
623 TSL2SendStatsToApp(&(tRlcCb->genCfg.lmPst), 0);
624 ODU_PUT_MSG_BUF(mBuf);
629 DU_LOG("\nERROR --> RLC_UL : Invalid Event[%d] from CL to PDCPUL\n",
631 ODU_PUT_MSG_BUF(mBuf);
641 if (pst->dstInst < MAX_RLC_INSTANCES)
643 DU_LOG("\nERROR --> RLC_UL : Received Invalid Source Entity[%d]",pst->event);
645 ODU_PUT_MSG_BUF(mBuf);
657 /********************************************************************30**
659 **********************************************************************/