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 /************************************************************************
21 Name: NR RLC - Layer Manager file
25 Desc: It contains the following common functions for processing
26 the all the external interfaces.
40 ************************************************************************/
41 /** @file rlc_layer_mgr.c
42 @brief RLC Layer Manager Module
46 /* header (.h) include files */
47 #include "common_def.h"
48 #include "lkw.h" /* LKW defines */
49 #include "ckw.h" /* CKW defines */
50 #include "kwu.h" /* KWU defines */
51 #include "rgu.h" /* RGU defines */
52 #include "rlc_err.h" /* Err defines */
53 #include "rlc_env.h" /* RLC environment options */
56 /* extern (.x) include files */
57 #include "lkw.x" /* LKW */
58 #include "ckw.x" /* CKW */
59 #include "kwu.x" /* KWU */
60 #include "rgu.x" /* RGU */
62 #include "rlc_utils.h" /* RLC defines */
63 #include "rlc_dl_ul_inf.h"
67 #define RLC_MODULE RLC_DBGMASK_LMM
71 /*********************************************************************
72 * Forward Declaration of LKW Porting Functions
73 ********************************************************************/
74 RlcCb *rlcCb[MAX_RLC_INSTANCES];
75 S16 rlcActvTmr ARGS ((Ent ent, Inst inst));
77 static Void rlcLmmSendCfm ARGS ((RlcCb *gCb,Pst *pst,RlcMngmt *cfm,uint8_t type,
79 static S16 rlcLmmGenCfg ARGS ((RlcCb *gCb, RlcGenCfg *cfg));
80 static S16 rlcLmmCfgKwuSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
81 static S16 rlcLmmCfgUdxSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
82 static S16 rlcLmmCfgCkwSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
83 static S16 rlcLmmCfgRguSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
84 static S16 rlcLmmGenCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
85 static S16 rlcLmmUdxSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
86 static S16 rlcLmmLSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
87 static S16 rlcLmmGetKwuSapSta ARGS ((RlcCb *gCb,RlcKwuSapSta *sta));
88 static S16 rlcLmmGetRguSapSta ARGS ((RlcCb *gCb,RlcRguSapSta *sta));
89 static S16 rlcLmmGetCkwCntSapSta ARGS ((RlcCb *gCb,RlcCkwCntSapSta *sta));
90 static S16 rlcLmmGetGenSts ARGS ((RlcCb *gCb,RlcGenSts *sts,Action action));
91 static S16 rlcLmmGetSapSts ARGS ((RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt,Action
95 /*********************************************************************
96 * Primitives for RGU interface
97 ********************************************************************/
100 * Stores the general RLC configuration.
102 * It calculates the memory requirement of the Saps
103 * It also initializes the control blocks, the hash lists and registers
104 * the timers. In case of error it rolls back and reports error in the
105 * confirm.If the general configuration is already done it is treated as
106 * reconfiguration, but right now reconfiguration is not supported.
108 * @param[in] gCb RLC Instance Control Block
109 * @param[in] cfm RLC LM general config structure
112 * LCM_REASON_NOT_APPL (SUCCESS)
113 * LCM_REASON_MEM_NOAVAIL
114 * LCM_REASON_REGTMR_FAIL
115 * LCM_REASON_INVALID_PAR_VAL
116 * LCM_REASON_HASHING_FAILED
118 static S16 rlcLmmGenCfg(RlcCb *gCb,RlcGenCfg *cfg)
126 if(cfg->maxUe > RLC_MAX_UE)
128 #if (ERRCLASS & ERRCLS_INT_PAR)
129 DU_LOG("\nERROR --> RLC : Invalid maxUe : Max [%lu] Received [%lu]",
132 #endif /* ERRCLASS & ERRCLS_INT_PAR */
133 return (LCM_REASON_INVALID_PAR_VAL);
136 if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
138 #if (ERRCLASS & ERRCLS_INT_PAR)
139 DU_LOG("\nERROR --> RLC : Invalid maxKwuSaps : Max [%lu] Received [%lu]",
142 #endif /* ERRCLASS & ERRCLS_INT_PAR */
143 return (LCM_REASON_INVALID_PAR_VAL);
146 if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
148 #if (ERRCLASS & ERRCLS_INT_PAR)
149 DU_LOG("\nERROR --> RLC : Invalid maxUduSaps : Max [%lu] Received [%lu]",
152 #endif /* ERRCLASS & ERRCLS_INT_PAR */
153 return (LCM_REASON_INVALID_PAR_VAL);
156 if((cfg->maxRguSaps == 0) || (cfg->maxRguSaps > RLC_MAX_RGUSAPS))
160 return (LCM_REASON_INVALID_PAR_VAL);
162 if(gCb->init.cfgDone == TRUE)
164 /* reconfiguration not supported */
165 return (LCM_REASON_RECONFIG_FAIL);
170 /* Timer Queue Control point initialization */
171 rlcTqCp = &(gCb->rlcTqCp);
172 rlcTqCp->tmrLen = RLC_TMR_LEN;
175 gCb->rlcThpt.inst = gCb->init.inst;
176 gCb->rlcThpt.thptTmr.tmrEvnt = TMR_NONE;
177 gCb->rlcThpt.numActvUe = 0;
178 memset(gCb->rlcThpt.thptPerUe, 0, MAX_NUM_UE * sizeof(RlcThptPerUe));
180 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
182 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
183 if (gCb->u.dlCb == NULLP)
185 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
186 return (LCM_REASON_MEM_NOAVAIL);
189 /* allocate memory to the KWU sap's */
190 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
191 (Size)sizeof(RlcKwuSapCb));
193 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
195 #if (ERRCLASS & ERRCLS_INT_PAR)
196 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
198 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
199 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
200 return (LCM_REASON_MEM_NOAVAIL);
202 #endif /* ERRCLASS & ERRCLS_INT_PAR */
204 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
206 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
207 (Size)sizeof(RlcUdxDlSapCb));
209 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
210 #if (ERRCLASS & ERRCLS_INT_PAR)
211 if(gCb->u.dlCb->udxDlSap == NULLP)
213 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
214 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
215 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
216 return (LCM_REASON_MEM_NOAVAIL);
218 #endif /* ERRCLASS & ERRCLS_INT_PAR */
220 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
221 (Size)sizeof(RlcRguSapCb));
222 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
223 #if (ERRCLASS & ERRCLS_INT_PAR)
224 if(gCb->u.dlCb->rguDlSap == NULLP)
226 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
227 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
228 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
230 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
231 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
232 return (LCM_REASON_MEM_NOAVAIL);
234 #endif /* ERRCLASS & ERRCLS_INT_PAR */
237 /* Initialize the Ue and Cell hash list */
238 ret = rlcDbmDlInit(gCb);
241 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
242 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
243 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
244 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
245 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
246 return (LCM_REASON_MEM_NOAVAIL);
249 /* Register the timer */
250 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
253 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
254 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
255 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
256 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
258 return (LCM_REASON_REGTMR_FAIL);
261 /* initializations for background processing of freeing memory */
262 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
263 rlcUtlInitializeSelfPst(gCb);
265 if(SGetMsg(gCb->init.region,
267 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
269 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
270 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
271 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
272 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
274 return (LCM_REASON_MEM_NOAVAIL);
278 rlcUtlL2MeasDlInit(gCb);
281 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
283 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
284 if (gCb->u.ulCb == NULLP)
286 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
287 return (LCM_REASON_MEM_NOAVAIL);
290 /* allocate memory to the KWU sap's */
291 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
292 (Size)sizeof(RlcKwuSapCb));
294 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
296 #if (ERRCLASS & ERRCLS_INT_PAR)
297 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
299 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
300 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
301 return (LCM_REASON_MEM_NOAVAIL);
303 #endif /* ERRCLASS & ERRCLS_INT_PAR */
305 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
307 /* allocate memory to the KWU sap's */
308 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
309 (Size)sizeof(RlcUdxUlSapCb));
311 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
313 #if (ERRCLASS & ERRCLS_INT_PAR)
314 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
316 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
317 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
318 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
319 return (LCM_REASON_MEM_NOAVAIL);
321 #endif /* ERRCLASS & ERRCLS_INT_PAR */
323 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
324 (Size)sizeof(RlcRguSapCb));
325 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
326 #if (ERRCLASS & ERRCLS_INT_PAR)
327 if(gCb->u.ulCb->rguUlSap == NULLP)
329 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
330 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
331 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
333 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
334 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
335 return (LCM_REASON_MEM_NOAVAIL);
337 #endif /* ERRCLASS & ERRCLS_INT_PAR */
339 /* Initialize the Ue and Cell hash list */
340 ret = rlcDbmUlInit(gCb);
343 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
344 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
345 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
346 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
347 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
350 /* Register the timer */
351 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
354 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
355 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
356 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
357 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
359 return (LCM_REASON_REGTMR_FAIL);
363 rlcUtlL2MeasUlInit(gCb);
368 #if (ERRCLASS & ERRCLS_INT_PAR)
369 DU_LOG("\nERROR --> RLC : Received Invalid RLC Mode");
370 #endif /* ERRCLASS & ERRCLS_INT_PAR */
372 return (LCM_REASON_INVALID_PAR_VAL);
374 /* Timer Initialization */
375 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
377 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
379 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
381 gCb->init.lmPst.srcProcId = gCb->init.procId;
382 gCb->init.lmPst.srcEnt = gCb->init.ent;
383 gCb->init.lmPst.srcInst = gCb->init.inst;
384 gCb->init.lmPst.event = EVTNONE;
386 /* kw002.201 For multi core and multi region,no need to reinitiailize the
387 * region again . This would be done with kwActvInit from SSI */
388 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
389 gCb->init.region = cfg->lmPst.region;
390 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
391 gCb->init.pool = cfg->lmPst.pool;
393 gCb->init.cfgDone = TRUE;
395 return (LCM_REASON_NOT_APPL);
400 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
402 * @param[in] gCb RLC Instance Control Block
403 * @param[in] pst Post structure
404 * @param[in] cfm RLC LM structure
405 * @param[in] type Type of LM message
406 * @param[in] hdr Message header
411 static Void rlcLmmSendCfm
420 Pst rPst; /* Reply post structure */
422 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
424 /* reply post structure for confirmation */
427 rPst.srcEnt = gCb->init.ent;
428 rPst.srcInst = gCb->init.inst;
429 cfm->hdr.entId.ent = gCb->init.ent;
430 cfm->hdr.entId.inst = gCb->init.inst;
434 rPst.srcEnt = pst->dstEnt;
435 rPst.srcInst = pst->dstInst;
436 cfm->hdr.entId.ent = pst->dstEnt;
437 cfm->hdr.entId.inst = pst->dstInst;
439 rPst.srcProcId = SFndProcId();
440 rPst.dstEnt = pst->srcEnt;
441 rPst.dstInst = pst->srcInst;
442 rPst.dstProcId = pst->srcProcId;
443 rPst.selector = hdr->response.selector;
444 rPst.prior = hdr->response.prior;
445 rPst.route = hdr->response.route;
446 rPst.region = hdr->response.mem.region;
447 rPst.pool= hdr->response.mem.pool;
449 /* Fill the reply header */
450 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
451 cfm->hdr.transId = hdr->transId;
456 RlcMiRlcConfigCfm(&rPst,cfm);
459 SGetDateTime(&(cfm->t.cntrl.dt));
460 RlcMiLkwCntrlCfm(&rPst,cfm);
463 SGetDateTime(&(cfm->t.sts.dt));
464 RlcMiLkwStsCfm(&rPst,0,cfm);
467 SGetDateTime(&(cfm->t.ssta.dt));
468 RlcMiLkwStaCfm(&rPst,cfm);
471 #if (ERRCLASS & ERRCLS_INT_PAR)
472 DU_LOG("\nERROR --> RLC : Received Invalid Message Type");
477 #endif /* ERRCLASS & ERRCLS_INT_PAR */
487 * This function processes configuration requests received from the layer
491 * The configuration requests can be for general configuration, or
492 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
493 * request can be determined from the elmId field in the header of the layer
494 * manager message.This function is called by the layer manager to configure
497 * This function implements the following logic:
499 * - if genCfg is not done, send negative Cfm to the layer manager;
501 * - switch (cfg->hdr.elmId.elmnt)
503 * - update the genCfg field in RlCb;
504 * - allocate the maximum static memory required by the RLC product;
505 * - register the timer service by calling SReqTmr;
506 * - set CfgDone for not configuring again;
508 * - if all the parameters are valid, then allocate the KwuSap control
510 * - update the SAP control block with the information provided in the
511 * - configuration request;
512 * - send configuration confirm with the status, success;
514 * - if all the parametes are valid, then allocate the CkwSap control
516 * - update the SAP control block with the information provided in the
517 * configuration request;
518 * - send configuration confirm with the status, success;
520 * - if all the parametes are valid, then allocate the rguSap control
522 * - update the SAP control block with the information provided in the
523 * configuration request;
524 * - send configuration confirm with the status, success;
526 * - if all the parametes are valid, then allocate the udxSap control
528 * - update the SAP control block with the information provided in the
529 * configuration request;
530 * - send configuration confirm with the status, success;
533 * @param[in] pst post structure
534 * @param[in] cfg LM management structure
538 * -# Failure : RFAILED
541 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
543 Reason reason; /* failure reason */
546 #if (ERRCLASS & ERRCLS_INT_PAR)
547 /* Check if the instance is configured */
548 if (pst->dstInst >= MAX_RLC_INSTANCES)
550 cfg->cfm.status = LCM_PRIM_NOK;
551 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
552 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
557 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
561 cfg->cfm.status = LCM_PRIM_NOK;
562 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
563 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
566 /* check configuration is done or not */
567 if ((tRlcCb->init.cfgDone != TRUE) &&
568 (cfg->hdr.elmId.elmnt != STGEN))
571 * if general config is not over then use pst structure
572 * in primitive to communicate to stack manager
575 cfg->cfm.status = LCM_PRIM_NOK;
576 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
577 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
581 DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
583 switch(cfg->hdr.elmId.elmnt)
587 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
592 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
597 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
602 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
607 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
612 reason = LCM_REASON_INVALID_ELMNT;
617 if (reason == LCM_REASON_NOT_APPL)
619 cfg->cfm.status = LCM_PRIM_OK;
620 cfg->cfm.reason = LCM_REASON_NOT_APPL;
621 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
626 cfg->cfm.status = LCM_PRIM_NOK;
627 cfg->cfm.reason = reason;
628 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
635 * The layer manager initiates and uses the management-control procedure to
636 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
637 * can be called more than once and at any time after the
638 * management-configuration procedure.The control request primitive
639 * is confirmed by a RlcMiLkwCntrlCfm primitive.
642 * This function implements the following logic:
644 * - if(cfgDone = FALSE)
645 * - send negative confirmation to the layer manager;
648 * - switch(cntrl->hdr.elmId.elmnt)
652 * - switch(subAction)
654 * - enable the unsolicited status flag;
655 * - send the control Cfm with success;
657 * - set the debug mask;
658 * - send the control Cfm with success;
660 * - enable the trace flag;
661 * - send the control Cfm with success;
663 * - switch(subAction)
665 * - disable the unsolicited status flag;
666 * - send the control Cfm with success;
668 * - disable the trace flag;
669 * - send the control Cfm with success;
678 * @param[in] pst post structure
679 * @param[in] cntrl LM management structure
685 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
687 Reason reason; /* failure reason */
690 #if (ERRCLASS & ERRCLS_INT_PAR)
691 /* Check if the instance is configured */
692 if (pst->dstInst >= MAX_RLC_INSTANCES)
694 cntrl->cfm.status = LCM_PRIM_NOK;
695 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
697 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
702 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
706 cntrl->cfm.status = LCM_PRIM_NOK;
707 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
708 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
712 if (!(tRlcCb->init.cfgDone))
714 cntrl->cfm.status = LCM_PRIM_NOK;
715 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
716 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
719 DU_LOG("\nDEBUG --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
721 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
722 * In all error cases appropriate reason is returned
723 * by the functions below
726 switch (cntrl->hdr.elmId.elmnt)
730 /* general control */
731 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
736 /* Lower SAP control */
737 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
743 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
748 reason = LCM_REASON_INVALID_ELMNT;
753 if (reason == LCM_REASON_NOT_APPL)
755 cntrl->cfm.status = LCM_PRIM_OK;
756 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
760 cntrl->cfm.status = LCM_PRIM_NOK;
761 cntrl->cfm.reason = reason;
764 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
771 * This function processes solicited status requests received from the layer
772 * manager. The layer manager can request status information regarding the
773 * system ID, RGUSAP,KWUSAP, or CKWSAP.
775 * @param[in] pst post structure
776 * @param[in] sta LM management structure
781 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
783 RlcMngmt rSta; /* Status */
784 Reason reason; /* Failure reason */
787 #if (ERRCLASS & ERRCLS_INT_PAR)
788 /* Check if the instance is configured */
789 if (pst->dstInst >= MAX_RLC_INSTANCES)
791 sta->cfm.status = LCM_PRIM_NOK;
792 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
794 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
799 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
802 sta->cfm.status = LCM_PRIM_NOK;
803 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
805 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
809 DU_LOG("\nDEBUG --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
811 reason = LCM_REASON_NOT_APPL;
813 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
814 switch (sta->hdr.elmId.elmnt)
818 reason = LCM_REASON_NOT_APPL;
819 rlcGetSId(&rSta.t.ssta.s.sysId);
824 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
825 &sta->t.ssta.s.rlckwuSap,
826 sizeof (RlcKwuSapSta));
828 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
833 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
834 &sta->t.ssta.s.rguSap,
835 sizeof (RlcRguSapSta));
837 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
842 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
843 &sta->t.ssta.s.ckwSap,
844 sizeof (RlcCkwCntSapSta));
846 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
851 reason = LCM_REASON_INVALID_ELMNT;
854 } /* end of switch */
856 if (reason == LCM_REASON_NOT_APPL)
858 rSta.cfm.status = LCM_PRIM_OK;
859 rSta.cfm.reason = LCM_REASON_NOT_APPL;
863 rSta.cfm.status = LCM_PRIM_NOK;
864 rSta.cfm.reason = reason;
866 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
873 * This function processes statistics requests received from the layer
877 * After collecting the statistics, ir calls the statistics confirm function
878 * to send the statistics to the layer manager.
880 * - switch(sts->hdr.elmId.elmnt)
882 * - get the general statistics from the KW control block;
883 * - if (action = RESET)
884 * - reset the general statistic field in the RlCb;
885 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
889 * - get the SAP specific statistics from KW control block;
890 * - if (action = RESET)
891 * - reset the general statistic field in the RlCb;
892 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
895 * @param[in] pst post structure
896 * @param[in] action action
897 * @param[in] sts LM management structure
903 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
905 RlcMngmt rSts; /* Statistics */
906 Reason reason; /* Reason for failure */
909 #if (ERRCLASS & ERRCLS_INT_PAR)
910 /* Check if the instance is configured */
911 if (pst->dstInst >= MAX_RLC_INSTANCES)
913 rSts.cfm.status = LCM_PRIM_NOK;
914 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
916 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
921 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
924 rSts.cfm.status = LCM_PRIM_NOK;
925 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
927 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
931 DU_LOG("\nDEBUG --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))",
933 sts->hdr.elmId.elmnt);
935 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
937 switch (sts->hdr.elmId.elmnt)
941 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
947 if( sts->hdr.elmId.elmnt == STKWUSAP)
949 /* kw005.201, modified the element of rlckwuSap from suId to spId */
950 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
952 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
957 reason = LCM_REASON_INVALID_ELMNT;
962 if (reason == LCM_REASON_NOT_APPL)
964 rSts.cfm.status = LCM_PRIM_OK;
965 rSts.cfm.reason = LCM_REASON_NOT_APPL;
969 rSts.cfm.status = LCM_PRIM_NOK;
970 rSts.cfm.reason = reason;
972 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
977 /* kw005.201 added support for L2 Measurement */
981 This function processes L2 Measurement requests received from the layer manager.
982 The L2 Measurement is start for a time period and after the timer expiry, the
983 measurement confirm is sent.
985 - Accept only one set of measurements.
986 - Allocate and initialise RlcL2MeasEvtCb.
987 - Validate if the measurement is already in progress.
988 - Loop through the existing measEvtCb with matching measType
989 - Check if measurement is running for any qci present in the measReq
990 - If present, move the qCi to list of invalid qCIs.
991 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
992 - For the number of measurements requested.
993 - For all Ues with RBs matching qCI.
994 - Add RbCb to the RB linked list.
995 - Set rlcRbCb.measOn to measurement type.
996 - If Meas type is DL_DELAY
997 - Update COUNT to startCount.
1000 * @param[in] pst post structure
1001 * @param[in] action action
1002 * @param[in] cfg LM management structure
1005 * -# Failure : RFAILED
1007 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1012 RlcL2MeasCfmEvt measCfmEvt;
1016 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1018 /* Initialize measCfmEvt */
1019 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1020 /* validate the received measReqEvt */
1021 /*LTE_L2_MEAS_PHASE2*/
1022 if(measReqEvt->measPeriod != 0)
1024 /* L2 MEAS AGHOSH */
1025 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1026 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1028 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1033 #if (ERRCLASS & ERRCLS_ADD_RES)
1034 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1035 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1036 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1041 measType = measReqEvt->measReq.measType;
1043 if((measType != LKW_L2MEAS_DL_IP) &&
1044 (measType != LKW_L2MEAS_ACT_UE) &&
1045 (measType != LKW_L2MEAS_DL_DISC) &&
1046 (measType != LKW_L2MEAS_DL_DELAY) &&
1047 (measType != LKW_L2MEAS_UU_LOSS) &&
1048 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1050 measCfmEvt.transId = measReqEvt->transId;
1051 measCfmEvt.measType = measType;
1052 measCfmEvt.status.status = LCM_PRIM_NOK;
1053 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1054 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1055 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1059 /* for UL IP throughput meas enable for all QCIs */
1060 if(measType & LKW_L2MEAS_UL_IP)
1062 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1064 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1069 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1070 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1072 RlcL2MeasReqEvt *measEvt;
1075 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1077 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1080 sizeof(RlcL2MeasReqEvt));
1082 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1083 if(measEvt == NULLP)
1085 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
1089 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1090 /*Redirect the request to DL task */
1091 /* NOTE:As of today, there are no cases where the Req will fail at DL
1092 as long as it reached the DL, so we don't wait for a confirmation from
1093 DL to send the confirmation to LM*/
1094 /* The interface for sending a confirmation back does not exist today;
1095 it needs to be created when the need arises */
1096 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1099 /* We need to copy the transId for sending back confirms later */
1100 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1102 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1103 if(measEvtCb->measCb.measType & measType)
1105 measEvtCb->transId= measReqEvt->transId;
1108 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1111 } /* RlcMiLkwL2MeasReq */
1115 This function processes L2 Measurement stop request received from the layer manager.
1116 After receving this request, RLC stops L2 Measurement
1117 * @param[in] pst post structure
1118 * @param[in] measType meas Type
1121 * -# Failure : RFAILED
1124 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1127 RlcL2MeasEvtCb *measEvtCb = NULLP;
1130 uint8_t status = ROK;
1133 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1135 /* reset the counter values for the measurement that is stopped */
1136 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1138 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1139 if(measEvtCb->measCb.measType & measType)
1141 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1146 /* for UL IP throughput meas disable for all QCIs */
1147 if(measType & LKW_L2MEAS_UL_IP)
1149 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1151 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1155 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1156 || (measType & LKW_L2MEAS_DL_DELAY))
1158 /*Redirect the request to DL task */
1159 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1162 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1164 status = LCM_PRIM_OK;
1165 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1171 This function processes L2 Measurement Send request received from the layer manager.
1172 After receving this request, RLC sends L2 Measurement
1173 * @param[in] pst post structure
1174 * @param[in] measType meas Type
1177 * -# Failure : RFAILED
1180 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1183 RlcL2MeasEvtCb *measEvtCb = NULLP;
1187 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1189 /* In case of addition of any new measType here ,appropriate handling
1190 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1192 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1193 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1195 /*Redirect the request to DL task */
1196 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1197 /* L2 MEAS AGHOSH */
1201 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1203 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1204 /* L2 MEAS AGHOSH */
1205 if(measEvtCb->measCb.measType & measType)
1207 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1213 #endif /* LTE_L2_MEAS */
1217 * This function configures the RLC data sap
1219 * @param[in] gCb RLC Instance Control Block
1220 * @param[in] cfg RLC LM Sap configuration structure
1223 * -# LCM_REASON_NOT_APPL (SUCCESS)
1224 * -# LCM_REASON_INVALID_SAP
1225 * -# LCM_REASON_MEM_NOAVAIL
1226 * -# LCM_REASON_RECONFIG_FAIL
1228 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1230 RlcKwuSapCb *rlcKwuSapCb;
1232 #if (ERRCLASS & ERRCLS_INT_PAR)
1233 /* Validate the protocol parameters */
1234 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1236 return (LCM_REASON_INVALID_PAR_VAL);
1238 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1240 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1241 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1242 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1244 #if (ERRCLASS & ERRCLS_INT_PAR)
1245 /* Check for reconfiguration */
1246 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1248 DU_LOG("\nERROR --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1249 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1250 /* reconfiguration not allowed */
1251 return (LCM_REASON_RECONFIG_FAIL);
1253 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1255 /* Fill the parameters */
1256 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1258 return (LCM_REASON_NOT_APPL);
1263 * This function configures the RLC control sap
1265 * @param[in] gCb RLC Instance Control Block
1266 * @param[in] cfg RLC LM Sap configuration structure
1269 * -# LCM_REASON_NOT_APPL (SUCCESS)
1270 * -# LCM_REASON_INVALID_SAP
1271 * -# LCM_REASON_INVALID_SAP
1272 * -# LCM_REASON_RECONFIG_FAIL
1274 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1276 RlcCkwSapCb *ckwSap;
1278 #if (ERRCLASS & ERRCLS_INT_PAR)
1279 /* Validate config parameters */
1280 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1282 return (LCM_REASON_INVALID_PAR_VAL);
1285 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1287 /* Get Sap control block */
1288 return (LCM_REASON_INVALID_PAR_VAL);
1292 ckwSap = &(gCb->u.ulCb->ckwSap);
1294 #if (ERRCLASS & ERRCLS_INT_PAR)
1295 /* Check for reconfiguration */
1296 if(ckwSap->state != RLC_SAP_NOT_CFG)
1298 DU_LOG("\nERROR --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
1299 return (LCM_REASON_RECONFIG_FAIL);
1301 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1303 /* Fill the parameters */
1304 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1306 return (LCM_REASON_NOT_APPL);
1311 * This function configures the UDX sap
1313 * @param[in] gCb RLC Instance Control Block
1314 * @param[in] cfg RLC LM Sap configuration structure
1317 * -# LCM_REASON_NOT_APPL (SUCCESS)
1318 * -# LCM_REASON_INVALID_SAP
1319 * -# LCM_REASON_INVALID_SAP
1320 * -# LCM_REASON_RECONFIG_FAIL
1322 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1324 RlcUdxDlSapCb *udxDlSap;
1325 RlcUdxUlSapCb *udxUlSap;
1327 #if (ERRCLASS & ERRCLS_INT_PAR)
1328 /* Validate the protocol parameters */
1329 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1331 return (LCM_REASON_INVALID_PAR_VAL);
1334 /* Get Sap control block */
1335 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1337 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1338 #if (ERRCLASS & ERRCLS_INT_PAR)
1339 /* Check for reconfiguration */
1340 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1342 DU_LOG("\nERROR --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
1343 return (LCM_REASON_RECONFIG_FAIL);
1345 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1347 /* Fill the parameters */
1348 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1352 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1354 #if (ERRCLASS & ERRCLS_INT_PAR)
1355 /* Check for reconfiguration */
1356 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1358 DU_LOG("\nERROR --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
1359 return (LCM_REASON_RECONFIG_FAIL);
1361 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1363 /* Fill the parameters */
1364 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1366 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1367 udxUlSap->retryCnt = 0;
1368 cmInitTimers(&(udxUlSap->bndTmr), 1);
1371 return (LCM_REASON_NOT_APPL);
1376 * This function configures the RGU sap
1378 * @param[in] gCb RLC Instance Control Block
1379 * @param[in] cfg RLC LM Sap configuration structure
1381 * -# LCM_REASON_NOT_APPL (SUCCESS)
1382 * -# LCM_REASON_INVALID_SAP
1383 * -# LCM_REASON_INVALID_SAP
1384 * -# LCM_REASON_RECONFIG_FAIL
1386 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1388 RlcRguSapCb *rguSap;
1390 #if (ERRCLASS & ERRCLS_INT_PAR)
1391 /* Validate the protocol parameters */
1392 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1395 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1396 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1397 return (LCM_REASON_INVALID_PAR_VAL);
1401 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1402 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1404 #if (ERRCLASS & ERRCLS_INT_PAR)
1405 /* Check for reconfiguration */
1406 if(rguSap->state != RLC_SAP_NOT_CFG)
1408 DU_LOG("\nERROR --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
1409 gCb->genCfg.rlcMode, rguSap->state);
1410 return (LCM_REASON_RECONFIG_FAIL);
1412 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1414 /* Fill the parameters */
1415 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1416 rguSap->suId = cfg->sapId;
1417 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1418 rguSap->retryCnt = 0;
1419 rguSap->state = RLC_SAP_CFG;
1421 cmInitTimers(&(rguSap->bndTmr), 1);
1423 return (LCM_REASON_NOT_APPL);
1428 * Validates the RLC general control parameters
1430 * @param[in] cntrl RLC LM structure
1433 * -# LCM_REASON_NOT_APPL (SUCCESS)
1434 * -# LCM_REASON_INVALID_SUBACTION
1435 * -# LCM_REASON_INVALID_ACTION
1437 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1439 S16 reason; /* reason for failure */
1440 uint8_t sAction; /* subaction field */
1442 reason = LCM_REASON_NOT_APPL;
1443 sAction = cntrl->t.cntrl.subAction;
1445 switch (cntrl->t.cntrl.action)
1449 if ((sAction != SAUSTA) &&
1450 (sAction != SADBG) &&
1453 reason = LCM_REASON_INVALID_SUBACTION;
1459 reason = LCM_REASON_INVALID_ACTION;
1468 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1470 * @param[in] gCb RLC Instance Control Block
1474 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1479 if (gCb->init.cfgDone)
1481 /* Deregister the timers */
1482 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1483 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1484 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1485 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1486 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1488 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1490 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1492 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1495 gCb->u.dlCb->shutdownReceived = TRUE;
1496 rlcUtlFreeDlMemory(gCb);
1497 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1499 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1502 if(gCb->u.dlCb->udxDlSap != NULLP)
1504 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1507 if(gCb->u.dlCb->rguDlSap != NULLP)
1509 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1510 gCb->genCfg.maxRguSaps = 0;
1512 if (gCb->u.dlCb->shutdownReceived)
1514 if (gCb->u.dlCb->selfPstMBuf != NULL)
1516 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1518 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1525 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1528 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1530 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1533 if(gCb->u.ulCb->udxUlSap != NULLP)
1535 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1538 if(gCb->u.ulCb->rguUlSap != NULLP)
1540 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1541 gCb->genCfg.maxRguSaps = 0;
1544 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1548 gCb->init.cfgDone = FALSE;
1549 gCb->init.acnt = FALSE;
1550 gCb->init.trc = FALSE;
1552 gCb->init.usta = FALSE;
1560 * Delete all SAPs and Control Blocks
1563 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1564 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1565 * control blocks and lists.
1567 * @params[in] gCb RLC instance control block
1570 * -# LCM_REASON_NOT_APPL (SUCCESS)
1571 * -# LCM_REASON_HASHING_FAILED
1573 static S16 rlcLmmShutdown(RlcCb *gCb)
1575 RlcRguSapCb *rguSap;
1578 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1580 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1582 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1583 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1585 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1591 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1593 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1594 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1596 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1601 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1603 rlcDbmDlShutdown(gCb);
1607 rlcDbmUlShutdown(gCb);
1610 rlcLmmCleanGblRsrcs(gCb);
1612 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1614 return (LCM_REASON_NOT_APPL);
1619 * Function processes the general control request
1621 * @param[in] gCb RLC instance control block
1622 * @param[in] cntrl RLC LM structure
1625 * -# LCM_REASON_NOT_APPL (SUCCESS)
1626 * -# LCM_REASON_INVALID_SUBACTION
1627 * -# LCM_REASON_INVALID_ACTION
1629 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1631 RlcTrcCntrl *trcCntrl; /* trace */
1633 RlcDbgCntrl *dbgCntrl; /* debug */
1635 S16 reason; /* reason for failure */
1637 /* Validate control parameters */
1638 reason = rlcLmmValidateGenCntrl (cntrl);
1640 if (reason != LCM_REASON_NOT_APPL)
1645 switch(cntrl->t.cntrl.action)
1649 switch(cntrl->t.cntrl.subAction)
1653 RLC_SET_USTA_FLAG(gCb, TRUE);
1659 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1660 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1666 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1667 gCb->init.trc = TRUE;
1668 gCb->trcLen = trcCntrl->trcLen;
1669 (gCb->trcMask) |= trcCntrl->trcMask;
1677 switch(cntrl->t.cntrl.subAction)
1681 gCb->init.usta = FALSE;
1687 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1688 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1694 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1695 gCb->init.trc = FALSE;
1696 gCb->trcMask &= ~(trcCntrl->trcMask);
1704 reason = rlcLmmShutdown(gCb);
1713 * Bind/Unbind RLC UDX sap
1715 * @param[in] gCb RLC Instance Control Block
1716 * @param[in] cntrl RLC LM structure
1719 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1720 * -# LCM_REASON_INVALID_SAP
1721 * -# LCM_REASON_INVALID_STATE
1722 * -# LCM_REASON_INVALID_ACTION
1724 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1727 #if (ERRCLASS & ERRCLS_INT_PAR)
1728 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1730 return (LCM_REASON_INVALID_SAP);
1733 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1734 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1736 return (LCM_REASON_INVALID_SAP);
1738 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1740 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1741 #if (ERRCLASS & ERRCLS_INT_PAR)
1743 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1745 DU_LOG("\nERROR --> RLC : udxUlSap not configured yet");
1746 return (LCM_REASON_INVALID_STATE);
1748 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1750 switch(cntrl->t.cntrl.action)
1754 if(UDX_SAP.state != RLC_SAP_BND)
1756 /* start timer to wait for bind confirm */
1757 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1758 UDX_SAP.state = RLC_SAP_BINDING;
1759 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1763 /* control request received for an already bound SAP */
1764 return (LCM_REASON_INVALID_STATE);
1770 /* make the state of UDXSAP configured but not bound */
1771 UDX_SAP.state = RLC_SAP_CFG;
1772 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1776 return (LCM_REASON_INVALID_ACTION);
1778 } /* end of switch */
1780 return (LCM_REASON_NOT_APPL);
1785 * Bind/Unbind RLC lower sap
1787 * @param[in] gCb RLC Instance Control Block
1788 * @param[in] cntrl RLC LM structure
1790 * -# LCM_REASON_NOT_APPL (SUCCESS)
1791 * -# LCM_REASON_INVALID_SAP
1792 * -# LCM_REASON_INVALID_STATE
1793 * -# LCM_REASON_INVALID_ACTION
1795 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1797 RlcRguSapCb *rguSap; /* rgu sap pointer */
1799 #if (ERRCLASS & ERRCLS_INT_PAR)
1801 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1802 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1804 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1805 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1806 return (LCM_REASON_INVALID_SAP);
1808 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1809 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1810 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1811 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1813 #if (ERRCLASS & ERRCLS_INT_PAR)
1815 if(rguSap->state == RLC_SAP_NOT_CFG)
1817 DU_LOG("\nERROR --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1818 return (LCM_REASON_INVALID_STATE);
1820 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1822 switch(cntrl->t.cntrl.action)
1826 if(rguSap->state != RLC_SAP_BND)
1828 /* start timer to wait for bind confirm */
1829 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1830 rguSap->state = RLC_SAP_BINDING;
1831 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1832 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1833 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1837 /* control request received for an already bound SAP */
1838 return (LCM_REASON_INVALID_STATE);
1844 /* make the state of RGUSAP is configure but not bound */
1845 rguSap->state = RLC_SAP_CFG;
1846 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1850 return (LCM_REASON_INVALID_ACTION);
1852 } /* end of switch */
1854 return (LCM_REASON_NOT_APPL);
1859 * Function gather the general KWU SAP status
1861 * @param[in] gCb RLC Instance Control Block
1862 * @param[in] sta LM KWU Sap Status structure
1865 * -# LCM_REASON_NOT_APPL (SUCCESS)
1866 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1868 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1870 RlcKwuSapCb *rlcKwSapCb;
1872 #if (ERRCLASS & ERRCLS_INT_PAR)
1873 /* Validate the protocol parameters */
1874 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1877 return (LCM_REASON_INVALID_PAR_VAL);
1881 /* Get Sap control block */
1882 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1883 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1884 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1886 sta->state = rlcKwSapCb->state;
1888 return (LCM_REASON_NOT_APPL);
1893 * Function gather the general RGU SAP status
1895 * @param[in] gCb RLC Instance Control Block
1896 * @param[in] sta LM RGU Sap Status structure
1898 * -# LCM_REASON_NOT_APPL (SUCCESS)
1899 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1901 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1904 #if (ERRCLASS & ERRCLS_INT_PAR)
1905 /* Validate the protocol parameters */
1906 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1908 return (LCM_REASON_INVALID_PAR_VAL);
1912 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1913 gCb->u.dlCb->rguDlSap[sta->suId].state :
1914 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1916 return (LCM_REASON_NOT_APPL);
1921 * Function gather the general CKW SAP status
1923 * @param[in] gCb RLC Instance Control Block
1924 * @param[in] sta LM CKW Sap Status structure
1926 * -# LCM_REASON_NOT_APPL (SUCCESS)
1927 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1929 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1932 #if (ERRCLASS & ERRCLS_INT_PAR)
1933 /* Validate config parameters */
1934 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1936 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1938 return (LCM_REASON_INVALID_PAR_VAL);
1941 sta->state = gCb->u.ulCb->ckwSap.state;
1943 return (LCM_REASON_NOT_APPL);
1949 * Gather the general statistics
1951 * @param[in] gCb RLC Instance Control Block
1952 * @param[in] sts LM general statistics structure
1953 * @param[in] action action
1955 * -# LCM_REASON_NOT_APPL (SUCCESS)
1956 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1958 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1961 #if (ERRCLASS & ERRCLS_INT_PAR)
1962 /* Validate protocol parameters */
1963 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1965 return (LCM_REASON_INVALID_PAR_VAL);
1971 if(action == LKW_ZEROSTS)
1973 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1976 return (LCM_REASON_NOT_APPL);
1981 * Gather the SAP statistics
1983 * @param[in] gCb RLC Instance Control Block
1984 * @param[in] sts LM general statistics structure
1985 * @param[in] elmnt element
1986 * @param[in] action action
1989 * -# LCM_REASON_NOT_APPL (SUCCESS)
1990 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1992 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
1995 /* Validate protocol parameters */
1996 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
1998 return (LCM_REASON_INVALID_PAR_VAL);
2004 RlcKwuSapSts *rlckwuSap;
2005 RlcKwuSapCb *rlcKwuSapCb;
2006 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2008 /* Get Sap control block */
2009 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2010 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2011 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2012 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2015 *rlckwuSap = rlcKwuSapCb->sts;
2017 if (action == LKW_ZEROSTS)
2019 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2023 /* kw005.201 removed RGUSAP statistics support */
2026 RlcCkwCntSts *ckwSap;
2027 ckwSap = &sts->t.sts.s.ckwSap;
2028 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2030 return (LCM_REASON_INVALID_PAR_VAL);
2033 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2035 if (action == LKW_ZEROSTS)
2037 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2042 return (LCM_REASON_INVALID_ELMNT);
2045 SGetDateTime(&sts->t.sts.dt);
2047 return (LCM_REASON_NOT_APPL);
2052 * This function sends Unsolicited Status Indication to the Layer Management
2055 * @param[in] gCb RLC Instance Control Block
2056 * @param[in] category Category
2057 * @param[in] event event
2058 * @param[in] cause cause
2059 * @param[in] UeId ueId
2060 * @param[in] Qci qci
2065 Void rlcLmmSendAlarm
2075 #else /* LTE_L2_MEAS */
2076 Void rlcLmmSendAlarm
2085 #endif /* LTE_L2_MEAS */
2087 RlcMngmt usta; /* Rlc Management Structure */
2089 if(gCb->init.usta == FALSE)
2094 usta.hdr.elmId.elmnt = STGEN;
2095 usta.hdr.entId.ent = gCb->init.ent;
2096 usta.hdr.entId.inst = gCb->init.inst;
2098 /* fill in the event and category */
2099 usta.t.usta.alarm.category = category;
2100 usta.t.usta.alarm.event = event;
2101 usta.t.usta.alarm.cause = cause;
2103 /* set the suId and ueId */
2104 usta.t.usta.ueId = ueId;
2105 usta.t.usta.suId = suId;
2106 /* kw005.201 added support for L2 Measurement */
2108 if(event == LKW_EVT_MEAS_HALT)
2110 usta.t.usta.qci = qci;
2112 #endif /* LTE_L2_MEAS */
2113 /* update the date and time */
2114 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2116 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2124 * This function sends trace indication to LM
2126 * @param[in] gCb RLC Instance Control Block
2127 * @param[in] event event
2128 * @param[in] mBuf meessage buffer
2134 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2136 RlcMngmt trc; /* RLC management control block */
2143 DU_LOG("\nDEBUG --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2147 memset(&trc, 0, sizeof(RlcMngmt));
2149 pst = gCb->init.lmPst;
2151 trc.t.trc.event = event;
2152 SGetDateTime(&trc.t.trc.dt);
2153 trc.cfm.status = LCM_PRIM_OK;
2154 trc.cfm.reason = LCM_REASON_NOT_APPL;
2158 /* Check if the whole buffer is to be sent in Trace indication */
2159 if(gCb->trcLen == LKW_FULL_TRACE)
2161 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2164 /* rg005.201 removed SPutSBuf on error */
2165 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2168 /* Send Trace Indication to Layer manager */
2169 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2171 /* check if only a specified number of bytes are to be sent */
2172 else if(gCb->trcLen > 0)
2174 /* Get the length of the recvd message buffer */
2175 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2177 DU_LOG("\nERROR --> RLC : SFndLenMsg Failed");
2180 /* Check if the recvd buffer size is less than request trace len */
2181 if(bufLen < gCb->trcLen)
2183 /* Copy the whole of the recvd buffer in trace indication */
2185 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2188 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2192 /* Send Trace Indication to Layer manager */
2193 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2197 /* if the recvd buffer size is greater than request trace len */
2198 /* Get a temporary buffer to store the msg */
2199 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2201 #if (ERRCLASS & ERRCLS_INT_PAR)
2202 if(tempBuf == NULLP)
2204 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2206 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2207 return (LCM_REASON_MEM_NOAVAIL);
2209 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2211 /* Copy trcLen nos of bytes from the recvd message */
2212 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2214 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2218 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2220 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2223 /* Copy the tempBuf data to dst mBuf */
2224 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2226 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2230 /* Free the memory allocated for tempBuf */
2231 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2232 /* Send Trace Indication to Layer manager */
2233 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2239 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2248 * Activate Task - timer
2251 * Invoked by system services to activate a task with a timer tick.
2253 * @param[in] ent entity
2254 * @param[in] inst instance
2262 S16 rlcActvTmr(Ent ent,Inst inst)
2266 if (inst >= MAX_RLC_INSTANCES)
2270 gCb = RLC_GET_RLCCB(inst);
2271 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2274 } /* end of rlcActvTmr */
2277 /********************************************************************30**
2280 **********************************************************************/