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(ODU_GET_MSG_BUF(gCb->init.region, gCb->init.pool, &(gCb->u.dlCb->selfPstMBuf)) != ROK)
267 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
268 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
269 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
270 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
272 return (LCM_REASON_MEM_NOAVAIL);
276 rlcUtlL2MeasDlInit(gCb);
279 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
281 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
282 if (gCb->u.ulCb == NULLP)
284 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
285 return (LCM_REASON_MEM_NOAVAIL);
288 /* allocate memory to the KWU sap's */
289 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
290 (Size)sizeof(RlcKwuSapCb));
292 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
294 #if (ERRCLASS & ERRCLS_INT_PAR)
295 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
297 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
298 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
299 return (LCM_REASON_MEM_NOAVAIL);
301 #endif /* ERRCLASS & ERRCLS_INT_PAR */
303 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
305 /* allocate memory to the KWU sap's */
306 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
307 (Size)sizeof(RlcUdxUlSapCb));
309 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
311 #if (ERRCLASS & ERRCLS_INT_PAR)
312 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
314 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
315 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
316 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
317 return (LCM_REASON_MEM_NOAVAIL);
319 #endif /* ERRCLASS & ERRCLS_INT_PAR */
321 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
322 (Size)sizeof(RlcRguSapCb));
323 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
324 #if (ERRCLASS & ERRCLS_INT_PAR)
325 if(gCb->u.ulCb->rguUlSap == NULLP)
327 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
328 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
329 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
331 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
332 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
333 return (LCM_REASON_MEM_NOAVAIL);
335 #endif /* ERRCLASS & ERRCLS_INT_PAR */
337 /* Initialize the Ue and Cell hash list */
338 ret = rlcDbmUlInit(gCb);
341 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
342 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
343 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
344 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
345 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
348 /* Register the timer */
349 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
352 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
353 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
354 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
355 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
357 return (LCM_REASON_REGTMR_FAIL);
361 rlcUtlL2MeasUlInit(gCb);
366 #if (ERRCLASS & ERRCLS_INT_PAR)
367 DU_LOG("\nERROR --> RLC : Received Invalid RLC Mode");
368 #endif /* ERRCLASS & ERRCLS_INT_PAR */
370 return (LCM_REASON_INVALID_PAR_VAL);
372 /* Timer Initialization */
373 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
375 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
377 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
379 gCb->init.lmPst.srcProcId = gCb->init.procId;
380 gCb->init.lmPst.srcEnt = gCb->init.ent;
381 gCb->init.lmPst.srcInst = gCb->init.inst;
382 gCb->init.lmPst.event = EVTNONE;
384 /* kw002.201 For multi core and multi region,no need to reinitiailize the
385 * region again . This would be done with kwActvInit from SSI */
386 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
387 gCb->init.region = cfg->lmPst.region;
388 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
389 gCb->init.pool = cfg->lmPst.pool;
391 gCb->init.cfgDone = TRUE;
393 /* TODO : make this generic for DL and UL after support for UL throughput calculation is added */
394 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
396 /* Starting timer to print throughput */
397 if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
399 DU_LOG("\nINFO --> RLC_DL : Starting Throughput timer");
400 rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
404 return (LCM_REASON_NOT_APPL);
409 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
411 * @param[in] gCb RLC Instance Control Block
412 * @param[in] pst Post structure
413 * @param[in] cfm RLC LM structure
414 * @param[in] type Type of LM message
415 * @param[in] hdr Message header
420 static Void rlcLmmSendCfm
429 Pst rPst; /* Reply post structure */
431 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
433 /* reply post structure for confirmation */
436 rPst.srcEnt = gCb->init.ent;
437 rPst.srcInst = gCb->init.inst;
438 cfm->hdr.entId.ent = gCb->init.ent;
439 cfm->hdr.entId.inst = gCb->init.inst;
443 rPst.srcEnt = pst->dstEnt;
444 rPst.srcInst = pst->dstInst;
445 cfm->hdr.entId.ent = pst->dstEnt;
446 cfm->hdr.entId.inst = pst->dstInst;
448 rPst.srcProcId = SFndProcId();
449 rPst.dstEnt = pst->srcEnt;
450 rPst.dstInst = pst->srcInst;
451 rPst.dstProcId = pst->srcProcId;
452 rPst.selector = hdr->response.selector;
453 rPst.prior = hdr->response.prior;
454 rPst.route = hdr->response.route;
455 rPst.region = hdr->response.mem.region;
456 rPst.pool= hdr->response.mem.pool;
458 /* Fill the reply header */
459 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
460 cfm->hdr.transId = hdr->transId;
465 RlcMiRlcConfigCfm(&rPst,cfm);
468 SGetDateTime(&(cfm->t.cntrl.dt));
469 RlcMiLkwCntrlCfm(&rPst,cfm);
472 SGetDateTime(&(cfm->t.sts.dt));
473 RlcMiLkwStsCfm(&rPst,0,cfm);
476 SGetDateTime(&(cfm->t.ssta.dt));
477 RlcMiLkwStaCfm(&rPst,cfm);
480 #if (ERRCLASS & ERRCLS_INT_PAR)
481 DU_LOG("\nERROR --> RLC : Received Invalid Message Type");
486 #endif /* ERRCLASS & ERRCLS_INT_PAR */
496 * This function processes configuration requests received from the layer
500 * The configuration requests can be for general configuration, or
501 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
502 * request can be determined from the elmId field in the header of the layer
503 * manager message.This function is called by the layer manager to configure
506 * This function implements the following logic:
508 * - if genCfg is not done, send negative Cfm to the layer manager;
510 * - switch (cfg->hdr.elmId.elmnt)
512 * - update the genCfg field in RlCb;
513 * - allocate the maximum static memory required by the RLC product;
514 * - register the timer service by calling SReqTmr;
515 * - set CfgDone for not configuring again;
517 * - if all the parameters are valid, then allocate the KwuSap control
519 * - update the SAP control block with the information provided in the
520 * - configuration request;
521 * - send configuration confirm with the status, success;
523 * - if all the parametes are valid, then allocate the CkwSap control
525 * - update the SAP control block with the information provided in the
526 * configuration request;
527 * - send configuration confirm with the status, success;
529 * - if all the parametes are valid, then allocate the rguSap control
531 * - update the SAP control block with the information provided in the
532 * configuration request;
533 * - send configuration confirm with the status, success;
535 * - if all the parametes are valid, then allocate the udxSap control
537 * - update the SAP control block with the information provided in the
538 * configuration request;
539 * - send configuration confirm with the status, success;
542 * @param[in] pst post structure
543 * @param[in] cfg LM management structure
547 * -# Failure : RFAILED
550 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
552 Reason reason; /* failure reason */
555 #if (ERRCLASS & ERRCLS_INT_PAR)
556 /* Check if the instance is configured */
557 if (pst->dstInst >= MAX_RLC_INSTANCES)
559 cfg->cfm.status = LCM_PRIM_NOK;
560 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
561 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
566 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
570 cfg->cfm.status = LCM_PRIM_NOK;
571 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
572 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
575 /* check configuration is done or not */
576 if ((tRlcCb->init.cfgDone != TRUE) &&
577 (cfg->hdr.elmId.elmnt != STGEN))
580 * if general config is not over then use pst structure
581 * in primitive to communicate to stack manager
584 cfg->cfm.status = LCM_PRIM_NOK;
585 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
586 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
590 DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
592 switch(cfg->hdr.elmId.elmnt)
596 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
601 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
606 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
611 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
616 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
621 reason = LCM_REASON_INVALID_ELMNT;
626 if (reason == LCM_REASON_NOT_APPL)
628 cfg->cfm.status = LCM_PRIM_OK;
629 cfg->cfm.reason = LCM_REASON_NOT_APPL;
630 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
635 cfg->cfm.status = LCM_PRIM_NOK;
636 cfg->cfm.reason = reason;
637 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
644 * The layer manager initiates and uses the management-control procedure to
645 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
646 * can be called more than once and at any time after the
647 * management-configuration procedure.The control request primitive
648 * is confirmed by a RlcMiLkwCntrlCfm primitive.
651 * This function implements the following logic:
653 * - if(cfgDone = FALSE)
654 * - send negative confirmation to the layer manager;
657 * - switch(cntrl->hdr.elmId.elmnt)
661 * - switch(subAction)
663 * - enable the unsolicited status flag;
664 * - send the control Cfm with success;
666 * - set the debug mask;
667 * - send the control Cfm with success;
669 * - enable the trace flag;
670 * - send the control Cfm with success;
672 * - switch(subAction)
674 * - disable the unsolicited status flag;
675 * - send the control Cfm with success;
677 * - disable the trace flag;
678 * - send the control Cfm with success;
687 * @param[in] pst post structure
688 * @param[in] cntrl LM management structure
694 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
696 Reason reason; /* failure reason */
699 #if (ERRCLASS & ERRCLS_INT_PAR)
700 /* Check if the instance is configured */
701 if (pst->dstInst >= MAX_RLC_INSTANCES)
703 cntrl->cfm.status = LCM_PRIM_NOK;
704 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
706 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
711 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
715 cntrl->cfm.status = LCM_PRIM_NOK;
716 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
717 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
721 if (!(tRlcCb->init.cfgDone))
723 cntrl->cfm.status = LCM_PRIM_NOK;
724 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
725 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
728 DU_LOG("\nDEBUG --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
730 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
731 * In all error cases appropriate reason is returned
732 * by the functions below
735 switch (cntrl->hdr.elmId.elmnt)
739 /* general control */
740 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
745 /* Lower SAP control */
746 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
752 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
757 reason = LCM_REASON_INVALID_ELMNT;
762 if (reason == LCM_REASON_NOT_APPL)
764 cntrl->cfm.status = LCM_PRIM_OK;
765 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
769 cntrl->cfm.status = LCM_PRIM_NOK;
770 cntrl->cfm.reason = reason;
773 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
780 * This function processes solicited status requests received from the layer
781 * manager. The layer manager can request status information regarding the
782 * system ID, RGUSAP,KWUSAP, or CKWSAP.
784 * @param[in] pst post structure
785 * @param[in] sta LM management structure
790 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
792 RlcMngmt rSta; /* Status */
793 Reason reason; /* Failure reason */
796 #if (ERRCLASS & ERRCLS_INT_PAR)
797 /* Check if the instance is configured */
798 if (pst->dstInst >= MAX_RLC_INSTANCES)
800 sta->cfm.status = LCM_PRIM_NOK;
801 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
803 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
808 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
811 sta->cfm.status = LCM_PRIM_NOK;
812 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
814 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
818 DU_LOG("\nDEBUG --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
820 reason = LCM_REASON_NOT_APPL;
822 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
823 switch (sta->hdr.elmId.elmnt)
827 reason = LCM_REASON_NOT_APPL;
828 rlcGetSId(&rSta.t.ssta.s.sysId);
833 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
834 &sta->t.ssta.s.rlckwuSap,
835 sizeof (RlcKwuSapSta));
837 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
842 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
843 &sta->t.ssta.s.rguSap,
844 sizeof (RlcRguSapSta));
846 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
851 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
852 &sta->t.ssta.s.ckwSap,
853 sizeof (RlcCkwCntSapSta));
855 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
860 reason = LCM_REASON_INVALID_ELMNT;
863 } /* end of switch */
865 if (reason == LCM_REASON_NOT_APPL)
867 rSta.cfm.status = LCM_PRIM_OK;
868 rSta.cfm.reason = LCM_REASON_NOT_APPL;
872 rSta.cfm.status = LCM_PRIM_NOK;
873 rSta.cfm.reason = reason;
875 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
882 * This function processes statistics requests received from the layer
886 * After collecting the statistics, ir calls the statistics confirm function
887 * to send the statistics to the layer manager.
889 * - switch(sts->hdr.elmId.elmnt)
891 * - get the general statistics from the KW control block;
892 * - if (action = RESET)
893 * - reset the general statistic field in the RlCb;
894 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
898 * - get the SAP specific statistics from KW control block;
899 * - if (action = RESET)
900 * - reset the general statistic field in the RlCb;
901 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
904 * @param[in] pst post structure
905 * @param[in] action action
906 * @param[in] sts LM management structure
912 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
914 RlcMngmt rSts; /* Statistics */
915 Reason reason; /* Reason for failure */
918 #if (ERRCLASS & ERRCLS_INT_PAR)
919 /* Check if the instance is configured */
920 if (pst->dstInst >= MAX_RLC_INSTANCES)
922 rSts.cfm.status = LCM_PRIM_NOK;
923 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
925 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
930 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
933 rSts.cfm.status = LCM_PRIM_NOK;
934 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
936 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
940 DU_LOG("\nDEBUG --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))",
942 sts->hdr.elmId.elmnt);
944 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
946 switch (sts->hdr.elmId.elmnt)
950 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
956 if( sts->hdr.elmId.elmnt == STKWUSAP)
958 /* kw005.201, modified the element of rlckwuSap from suId to spId */
959 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
961 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
966 reason = LCM_REASON_INVALID_ELMNT;
971 if (reason == LCM_REASON_NOT_APPL)
973 rSts.cfm.status = LCM_PRIM_OK;
974 rSts.cfm.reason = LCM_REASON_NOT_APPL;
978 rSts.cfm.status = LCM_PRIM_NOK;
979 rSts.cfm.reason = reason;
981 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
986 /* kw005.201 added support for L2 Measurement */
990 This function processes L2 Measurement requests received from the layer manager.
991 The L2 Measurement is start for a time period and after the timer expiry, the
992 measurement confirm is sent.
994 - Accept only one set of measurements.
995 - Allocate and initialise RlcL2MeasEvtCb.
996 - Validate if the measurement is already in progress.
997 - Loop through the existing measEvtCb with matching measType
998 - Check if measurement is running for any qci present in the measReq
999 - If present, move the qCi to list of invalid qCIs.
1000 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
1001 - For the number of measurements requested.
1002 - For all Ues with RBs matching qCI.
1003 - Add RbCb to the RB linked list.
1004 - Set rlcRbCb.measOn to measurement type.
1005 - If Meas type is DL_DELAY
1006 - Update COUNT to startCount.
1009 * @param[in] pst post structure
1010 * @param[in] action action
1011 * @param[in] cfg LM management structure
1014 * -# Failure : RFAILED
1016 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1021 RlcL2MeasCfmEvt measCfmEvt;
1025 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1027 /* Initialize measCfmEvt */
1028 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1029 /* validate the received measReqEvt */
1030 /*LTE_L2_MEAS_PHASE2*/
1031 if(measReqEvt->measPeriod != 0)
1033 /* L2 MEAS AGHOSH */
1034 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1035 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1037 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1042 #if (ERRCLASS & ERRCLS_ADD_RES)
1043 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1044 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1045 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1050 measType = measReqEvt->measReq.measType;
1052 if((measType != LKW_L2MEAS_DL_IP) &&
1053 (measType != LKW_L2MEAS_ACT_UE) &&
1054 (measType != LKW_L2MEAS_DL_DISC) &&
1055 (measType != LKW_L2MEAS_DL_DELAY) &&
1056 (measType != LKW_L2MEAS_UU_LOSS) &&
1057 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1059 measCfmEvt.transId = measReqEvt->transId;
1060 measCfmEvt.measType = measType;
1061 measCfmEvt.status.status = LCM_PRIM_NOK;
1062 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1063 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1064 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1068 /* for UL IP throughput meas enable for all QCIs */
1069 if(measType & LKW_L2MEAS_UL_IP)
1071 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1073 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1078 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1079 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1081 RlcL2MeasReqEvt *measEvt;
1084 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1086 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1089 sizeof(RlcL2MeasReqEvt));
1091 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1092 if(measEvt == NULLP)
1094 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
1098 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1099 /*Redirect the request to DL task */
1100 /* NOTE:As of today, there are no cases where the Req will fail at DL
1101 as long as it reached the DL, so we don't wait for a confirmation from
1102 DL to send the confirmation to LM*/
1103 /* The interface for sending a confirmation back does not exist today;
1104 it needs to be created when the need arises */
1105 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1108 /* We need to copy the transId for sending back confirms later */
1109 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1111 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1112 if(measEvtCb->measCb.measType & measType)
1114 measEvtCb->transId= measReqEvt->transId;
1117 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1120 } /* RlcMiLkwL2MeasReq */
1124 This function processes L2 Measurement stop request received from the layer manager.
1125 After receving this request, RLC stops L2 Measurement
1126 * @param[in] pst post structure
1127 * @param[in] measType meas Type
1130 * -# Failure : RFAILED
1133 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1136 RlcL2MeasEvtCb *measEvtCb = NULLP;
1139 uint8_t status = ROK;
1142 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1144 /* reset the counter values for the measurement that is stopped */
1145 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1147 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1148 if(measEvtCb->measCb.measType & measType)
1150 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1155 /* for UL IP throughput meas disable for all QCIs */
1156 if(measType & LKW_L2MEAS_UL_IP)
1158 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1160 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1164 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1165 || (measType & LKW_L2MEAS_DL_DELAY))
1167 /*Redirect the request to DL task */
1168 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1171 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1173 status = LCM_PRIM_OK;
1174 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1180 This function processes L2 Measurement Send request received from the layer manager.
1181 After receving this request, RLC sends L2 Measurement
1182 * @param[in] pst post structure
1183 * @param[in] measType meas Type
1186 * -# Failure : RFAILED
1189 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1192 RlcL2MeasEvtCb *measEvtCb = NULLP;
1196 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1198 /* In case of addition of any new measType here ,appropriate handling
1199 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1201 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1202 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1204 /*Redirect the request to DL task */
1205 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1206 /* L2 MEAS AGHOSH */
1210 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1212 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1213 /* L2 MEAS AGHOSH */
1214 if(measEvtCb->measCb.measType & measType)
1216 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1222 #endif /* LTE_L2_MEAS */
1226 * This function configures the RLC data sap
1228 * @param[in] gCb RLC Instance Control Block
1229 * @param[in] cfg RLC LM Sap configuration structure
1232 * -# LCM_REASON_NOT_APPL (SUCCESS)
1233 * -# LCM_REASON_INVALID_SAP
1234 * -# LCM_REASON_MEM_NOAVAIL
1235 * -# LCM_REASON_RECONFIG_FAIL
1237 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1239 RlcKwuSapCb *rlcKwuSapCb;
1241 #if (ERRCLASS & ERRCLS_INT_PAR)
1242 /* Validate the protocol parameters */
1243 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1245 return (LCM_REASON_INVALID_PAR_VAL);
1247 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1249 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1250 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1251 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1253 #if (ERRCLASS & ERRCLS_INT_PAR)
1254 /* Check for reconfiguration */
1255 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1257 DU_LOG("\nERROR --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1258 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1259 /* reconfiguration not allowed */
1260 return (LCM_REASON_RECONFIG_FAIL);
1262 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1264 /* Fill the parameters */
1265 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1267 return (LCM_REASON_NOT_APPL);
1272 * This function configures the RLC control sap
1274 * @param[in] gCb RLC Instance Control Block
1275 * @param[in] cfg RLC LM Sap configuration structure
1278 * -# LCM_REASON_NOT_APPL (SUCCESS)
1279 * -# LCM_REASON_INVALID_SAP
1280 * -# LCM_REASON_INVALID_SAP
1281 * -# LCM_REASON_RECONFIG_FAIL
1283 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1285 RlcCkwSapCb *ckwSap;
1287 #if (ERRCLASS & ERRCLS_INT_PAR)
1288 /* Validate config parameters */
1289 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1291 return (LCM_REASON_INVALID_PAR_VAL);
1294 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1296 /* Get Sap control block */
1297 return (LCM_REASON_INVALID_PAR_VAL);
1301 ckwSap = &(gCb->u.ulCb->ckwSap);
1303 #if (ERRCLASS & ERRCLS_INT_PAR)
1304 /* Check for reconfiguration */
1305 if(ckwSap->state != RLC_SAP_NOT_CFG)
1307 DU_LOG("\nERROR --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
1308 return (LCM_REASON_RECONFIG_FAIL);
1310 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1312 /* Fill the parameters */
1313 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1315 return (LCM_REASON_NOT_APPL);
1320 * This function configures the UDX sap
1322 * @param[in] gCb RLC Instance Control Block
1323 * @param[in] cfg RLC LM Sap configuration structure
1326 * -# LCM_REASON_NOT_APPL (SUCCESS)
1327 * -# LCM_REASON_INVALID_SAP
1328 * -# LCM_REASON_INVALID_SAP
1329 * -# LCM_REASON_RECONFIG_FAIL
1331 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1333 RlcUdxDlSapCb *udxDlSap;
1334 RlcUdxUlSapCb *udxUlSap;
1336 #if (ERRCLASS & ERRCLS_INT_PAR)
1337 /* Validate the protocol parameters */
1338 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1340 return (LCM_REASON_INVALID_PAR_VAL);
1343 /* Get Sap control block */
1344 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1346 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1347 #if (ERRCLASS & ERRCLS_INT_PAR)
1348 /* Check for reconfiguration */
1349 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1351 DU_LOG("\nERROR --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
1352 return (LCM_REASON_RECONFIG_FAIL);
1354 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1356 /* Fill the parameters */
1357 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1361 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1363 #if (ERRCLASS & ERRCLS_INT_PAR)
1364 /* Check for reconfiguration */
1365 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1367 DU_LOG("\nERROR --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
1368 return (LCM_REASON_RECONFIG_FAIL);
1370 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1372 /* Fill the parameters */
1373 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1375 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1376 udxUlSap->retryCnt = 0;
1377 cmInitTimers(&(udxUlSap->bndTmr), 1);
1380 return (LCM_REASON_NOT_APPL);
1385 * This function configures the RGU sap
1387 * @param[in] gCb RLC Instance Control Block
1388 * @param[in] cfg RLC LM Sap configuration structure
1390 * -# LCM_REASON_NOT_APPL (SUCCESS)
1391 * -# LCM_REASON_INVALID_SAP
1392 * -# LCM_REASON_INVALID_SAP
1393 * -# LCM_REASON_RECONFIG_FAIL
1395 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1397 RlcRguSapCb *rguSap;
1399 #if (ERRCLASS & ERRCLS_INT_PAR)
1400 /* Validate the protocol parameters */
1401 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1404 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1405 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1406 return (LCM_REASON_INVALID_PAR_VAL);
1410 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1411 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1413 #if (ERRCLASS & ERRCLS_INT_PAR)
1414 /* Check for reconfiguration */
1415 if(rguSap->state != RLC_SAP_NOT_CFG)
1417 DU_LOG("\nERROR --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
1418 gCb->genCfg.rlcMode, rguSap->state);
1419 return (LCM_REASON_RECONFIG_FAIL);
1421 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1423 /* Fill the parameters */
1424 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1425 rguSap->suId = cfg->sapId;
1426 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1427 rguSap->retryCnt = 0;
1428 rguSap->state = RLC_SAP_CFG;
1430 cmInitTimers(&(rguSap->bndTmr), 1);
1432 return (LCM_REASON_NOT_APPL);
1437 * Validates the RLC general control parameters
1439 * @param[in] cntrl RLC LM structure
1442 * -# LCM_REASON_NOT_APPL (SUCCESS)
1443 * -# LCM_REASON_INVALID_SUBACTION
1444 * -# LCM_REASON_INVALID_ACTION
1446 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1448 S16 reason; /* reason for failure */
1449 uint8_t sAction; /* subaction field */
1451 reason = LCM_REASON_NOT_APPL;
1452 sAction = cntrl->t.cntrl.subAction;
1454 switch (cntrl->t.cntrl.action)
1458 if ((sAction != SAUSTA) &&
1459 (sAction != SADBG) &&
1462 reason = LCM_REASON_INVALID_SUBACTION;
1468 reason = LCM_REASON_INVALID_ACTION;
1477 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1479 * @param[in] gCb RLC Instance Control Block
1483 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1488 if (gCb->init.cfgDone)
1490 /* Deregister the timers */
1491 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1492 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1493 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1494 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1495 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1497 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1499 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1501 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1504 gCb->u.dlCb->shutdownReceived = TRUE;
1505 rlcUtlFreeDlMemory(gCb);
1506 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1508 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1511 if(gCb->u.dlCb->udxDlSap != NULLP)
1513 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1516 if(gCb->u.dlCb->rguDlSap != NULLP)
1518 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1519 gCb->genCfg.maxRguSaps = 0;
1521 if (gCb->u.dlCb->shutdownReceived)
1523 if (gCb->u.dlCb->selfPstMBuf != NULL)
1525 ODU_PUT_MSG_BUF(gCb->u.dlCb->selfPstMBuf);
1527 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1534 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1537 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1539 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1542 if(gCb->u.ulCb->udxUlSap != NULLP)
1544 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1547 if(gCb->u.ulCb->rguUlSap != NULLP)
1549 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1550 gCb->genCfg.maxRguSaps = 0;
1553 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1557 gCb->init.cfgDone = FALSE;
1558 gCb->init.acnt = FALSE;
1559 gCb->init.trc = FALSE;
1561 gCb->init.usta = FALSE;
1569 * Delete all SAPs and Control Blocks
1572 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1573 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1574 * control blocks and lists.
1576 * @params[in] gCb RLC instance control block
1579 * -# LCM_REASON_NOT_APPL (SUCCESS)
1580 * -# LCM_REASON_HASHING_FAILED
1582 static S16 rlcLmmShutdown(RlcCb *gCb)
1584 RlcRguSapCb *rguSap;
1587 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1589 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1591 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1592 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1594 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1600 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1602 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1603 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1605 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1610 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1612 rlcDbmDlShutdown(gCb);
1616 rlcDbmUlShutdown(gCb);
1619 rlcLmmCleanGblRsrcs(gCb);
1621 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1623 return (LCM_REASON_NOT_APPL);
1628 * Function processes the general control request
1630 * @param[in] gCb RLC instance control block
1631 * @param[in] cntrl RLC LM structure
1634 * -# LCM_REASON_NOT_APPL (SUCCESS)
1635 * -# LCM_REASON_INVALID_SUBACTION
1636 * -# LCM_REASON_INVALID_ACTION
1638 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1640 RlcTrcCntrl *trcCntrl; /* trace */
1642 RlcDbgCntrl *dbgCntrl; /* debug */
1644 S16 reason; /* reason for failure */
1646 /* Validate control parameters */
1647 reason = rlcLmmValidateGenCntrl (cntrl);
1649 if (reason != LCM_REASON_NOT_APPL)
1654 switch(cntrl->t.cntrl.action)
1658 switch(cntrl->t.cntrl.subAction)
1662 RLC_SET_USTA_FLAG(gCb, TRUE);
1668 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1669 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1675 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1676 gCb->init.trc = TRUE;
1677 gCb->trcLen = trcCntrl->trcLen;
1678 (gCb->trcMask) |= trcCntrl->trcMask;
1686 switch(cntrl->t.cntrl.subAction)
1690 gCb->init.usta = FALSE;
1696 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1697 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1703 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1704 gCb->init.trc = FALSE;
1705 gCb->trcMask &= ~(trcCntrl->trcMask);
1713 reason = rlcLmmShutdown(gCb);
1722 * Bind/Unbind RLC UDX sap
1724 * @param[in] gCb RLC Instance Control Block
1725 * @param[in] cntrl RLC LM structure
1728 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1729 * -# LCM_REASON_INVALID_SAP
1730 * -# LCM_REASON_INVALID_STATE
1731 * -# LCM_REASON_INVALID_ACTION
1733 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1736 #if (ERRCLASS & ERRCLS_INT_PAR)
1737 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1739 return (LCM_REASON_INVALID_SAP);
1742 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1743 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1745 return (LCM_REASON_INVALID_SAP);
1747 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1749 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1750 #if (ERRCLASS & ERRCLS_INT_PAR)
1752 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1754 DU_LOG("\nERROR --> RLC : udxUlSap not configured yet");
1755 return (LCM_REASON_INVALID_STATE);
1757 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1759 switch(cntrl->t.cntrl.action)
1763 if(UDX_SAP.state != RLC_SAP_BND)
1765 /* start timer to wait for bind confirm */
1766 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1767 UDX_SAP.state = RLC_SAP_BINDING;
1768 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1772 /* control request received for an already bound SAP */
1773 return (LCM_REASON_INVALID_STATE);
1779 /* make the state of UDXSAP configured but not bound */
1780 UDX_SAP.state = RLC_SAP_CFG;
1781 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1785 return (LCM_REASON_INVALID_ACTION);
1787 } /* end of switch */
1789 return (LCM_REASON_NOT_APPL);
1794 * Bind/Unbind RLC lower sap
1796 * @param[in] gCb RLC Instance Control Block
1797 * @param[in] cntrl RLC LM structure
1799 * -# LCM_REASON_NOT_APPL (SUCCESS)
1800 * -# LCM_REASON_INVALID_SAP
1801 * -# LCM_REASON_INVALID_STATE
1802 * -# LCM_REASON_INVALID_ACTION
1804 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1806 RlcRguSapCb *rguSap; /* rgu sap pointer */
1808 #if (ERRCLASS & ERRCLS_INT_PAR)
1810 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1811 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1813 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1814 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1815 return (LCM_REASON_INVALID_SAP);
1817 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1818 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1819 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1820 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1822 #if (ERRCLASS & ERRCLS_INT_PAR)
1824 if(rguSap->state == RLC_SAP_NOT_CFG)
1826 DU_LOG("\nERROR --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1827 return (LCM_REASON_INVALID_STATE);
1829 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1831 switch(cntrl->t.cntrl.action)
1835 if(rguSap->state != RLC_SAP_BND)
1837 /* start timer to wait for bind confirm */
1838 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1839 rguSap->state = RLC_SAP_BINDING;
1840 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1841 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1842 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1846 /* control request received for an already bound SAP */
1847 return (LCM_REASON_INVALID_STATE);
1853 /* make the state of RGUSAP is configure but not bound */
1854 rguSap->state = RLC_SAP_CFG;
1855 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1859 return (LCM_REASON_INVALID_ACTION);
1861 } /* end of switch */
1863 return (LCM_REASON_NOT_APPL);
1868 * Function gather the general KWU SAP status
1870 * @param[in] gCb RLC Instance Control Block
1871 * @param[in] sta LM KWU Sap Status structure
1874 * -# LCM_REASON_NOT_APPL (SUCCESS)
1875 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1877 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1879 RlcKwuSapCb *rlcKwSapCb;
1881 #if (ERRCLASS & ERRCLS_INT_PAR)
1882 /* Validate the protocol parameters */
1883 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1886 return (LCM_REASON_INVALID_PAR_VAL);
1890 /* Get Sap control block */
1891 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1892 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1893 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1895 sta->state = rlcKwSapCb->state;
1897 return (LCM_REASON_NOT_APPL);
1902 * Function gather the general RGU SAP status
1904 * @param[in] gCb RLC Instance Control Block
1905 * @param[in] sta LM RGU Sap Status structure
1907 * -# LCM_REASON_NOT_APPL (SUCCESS)
1908 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1910 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1913 #if (ERRCLASS & ERRCLS_INT_PAR)
1914 /* Validate the protocol parameters */
1915 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1917 return (LCM_REASON_INVALID_PAR_VAL);
1921 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1922 gCb->u.dlCb->rguDlSap[sta->suId].state :
1923 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1925 return (LCM_REASON_NOT_APPL);
1930 * Function gather the general CKW SAP status
1932 * @param[in] gCb RLC Instance Control Block
1933 * @param[in] sta LM CKW Sap Status structure
1935 * -# LCM_REASON_NOT_APPL (SUCCESS)
1936 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1938 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1941 #if (ERRCLASS & ERRCLS_INT_PAR)
1942 /* Validate config parameters */
1943 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1945 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1947 return (LCM_REASON_INVALID_PAR_VAL);
1950 sta->state = gCb->u.ulCb->ckwSap.state;
1952 return (LCM_REASON_NOT_APPL);
1958 * Gather the general statistics
1960 * @param[in] gCb RLC Instance Control Block
1961 * @param[in] sts LM general statistics structure
1962 * @param[in] action action
1964 * -# LCM_REASON_NOT_APPL (SUCCESS)
1965 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1967 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1970 #if (ERRCLASS & ERRCLS_INT_PAR)
1971 /* Validate protocol parameters */
1972 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1974 return (LCM_REASON_INVALID_PAR_VAL);
1980 if(action == LKW_ZEROSTS)
1982 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1985 return (LCM_REASON_NOT_APPL);
1990 * Gather the SAP statistics
1992 * @param[in] gCb RLC Instance Control Block
1993 * @param[in] sts LM general statistics structure
1994 * @param[in] elmnt element
1995 * @param[in] action action
1998 * -# LCM_REASON_NOT_APPL (SUCCESS)
1999 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
2001 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
2004 /* Validate protocol parameters */
2005 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2007 return (LCM_REASON_INVALID_PAR_VAL);
2013 RlcKwuSapSts *rlckwuSap;
2014 RlcKwuSapCb *rlcKwuSapCb;
2015 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2017 /* Get Sap control block */
2018 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2019 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2020 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2021 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2024 *rlckwuSap = rlcKwuSapCb->sts;
2026 if (action == LKW_ZEROSTS)
2028 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2032 /* kw005.201 removed RGUSAP statistics support */
2035 RlcCkwCntSts *ckwSap;
2036 ckwSap = &sts->t.sts.s.ckwSap;
2037 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2039 return (LCM_REASON_INVALID_PAR_VAL);
2042 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2044 if (action == LKW_ZEROSTS)
2046 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2051 return (LCM_REASON_INVALID_ELMNT);
2054 SGetDateTime(&sts->t.sts.dt);
2056 return (LCM_REASON_NOT_APPL);
2061 * This function sends Unsolicited Status Indication to the Layer Management
2064 * @param[in] gCb RLC Instance Control Block
2065 * @param[in] category Category
2066 * @param[in] event event
2067 * @param[in] cause cause
2068 * @param[in] UeId ueId
2069 * @param[in] Qci qci
2074 Void rlcLmmSendAlarm
2084 #else /* LTE_L2_MEAS */
2085 Void rlcLmmSendAlarm
2094 #endif /* LTE_L2_MEAS */
2096 RlcMngmt usta; /* Rlc Management Structure */
2098 if(gCb->init.usta == FALSE)
2103 usta.hdr.elmId.elmnt = STGEN;
2104 usta.hdr.entId.ent = gCb->init.ent;
2105 usta.hdr.entId.inst = gCb->init.inst;
2107 /* fill in the event and category */
2108 usta.t.usta.alarm.category = category;
2109 usta.t.usta.alarm.event = event;
2110 usta.t.usta.alarm.cause = cause;
2112 /* set the suId and ueId */
2113 usta.t.usta.ueId = ueId;
2114 usta.t.usta.suId = suId;
2115 /* kw005.201 added support for L2 Measurement */
2117 if(event == LKW_EVT_MEAS_HALT)
2119 usta.t.usta.qci = qci;
2121 #endif /* LTE_L2_MEAS */
2122 /* update the date and time */
2123 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2125 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2133 * This function sends trace indication to LM
2135 * @param[in] gCb RLC Instance Control Block
2136 * @param[in] event event
2137 * @param[in] mBuf meessage buffer
2143 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2145 RlcMngmt trc; /* RLC management control block */
2152 DU_LOG("\nDEBUG --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2156 memset(&trc, 0, sizeof(RlcMngmt));
2158 pst = gCb->init.lmPst;
2160 trc.t.trc.event = event;
2161 SGetDateTime(&trc.t.trc.dt);
2162 trc.cfm.status = LCM_PRIM_OK;
2163 trc.cfm.reason = LCM_REASON_NOT_APPL;
2167 /* Check if the whole buffer is to be sent in Trace indication */
2168 if(gCb->trcLen == LKW_FULL_TRACE)
2170 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2173 /* rg005.201 removed SPutSBuf on error */
2174 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2177 /* Send Trace Indication to Layer manager */
2178 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2180 /* check if only a specified number of bytes are to be sent */
2181 else if(gCb->trcLen > 0)
2183 /* Get the length of the recvd message buffer */
2184 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2186 DU_LOG("\nERROR --> RLC : SFndLenMsg Failed");
2189 /* Check if the recvd buffer size is less than request trace len */
2190 if(bufLen < gCb->trcLen)
2192 /* Copy the whole of the recvd buffer in trace indication */
2194 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2197 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2201 /* Send Trace Indication to Layer manager */
2202 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2206 /* if the recvd buffer size is greater than request trace len */
2207 /* Get a temporary buffer to store the msg */
2208 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2210 #if (ERRCLASS & ERRCLS_INT_PAR)
2211 if(tempBuf == NULLP)
2213 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2215 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2216 return (LCM_REASON_MEM_NOAVAIL);
2218 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2220 /* Copy trcLen nos of bytes from the recvd message */
2221 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2223 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2227 if (ODU_GET_MSG_BUF(pst.region, pst.pool, &dstMbuf) != ROK)
2229 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2232 /* Copy the tempBuf data to dst mBuf */
2233 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2235 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2239 /* Free the memory allocated for tempBuf */
2240 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2241 /* Send Trace Indication to Layer manager */
2242 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2248 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2257 * Activate Task - timer
2260 * Invoked by system services to activate a task with a timer tick.
2262 * @param[in] ent entity
2263 * @param[in] inst instance
2271 S16 rlcActvTmr(Ent ent,Inst inst)
2275 if (inst >= MAX_RLC_INSTANCES)
2279 gCb = RLC_GET_RLCCB(inst);
2280 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2283 } /* end of rlcActvTmr */
2286 /********************************************************************30**
2289 **********************************************************************/