1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /********************************************************************20**
21 Name: NR RLC - Layer Manager file
25 Desc: It contains the following common functions for processing
26 the all the external interfaces.
40 *********************************************************************21*/
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 "kw_err.h" /* Err defines */
53 #include "kw_env.h" /* RLC environment options */
55 #include "kw.h" /* RLC defines */
60 /* extern (.x) include files */
61 #include "lkw.x" /* LKW */
62 #include "ckw.x" /* CKW */
63 #include "kwu.x" /* KWU */
64 #include "rgu.x" /* RGU */
71 #define RLC_MODULE RLC_DBGMASK_LMM
75 /*********************************************************************
76 * Forward Declaration of LKW Porting Functions
77 ********************************************************************/
78 RlcCb *rlcCb[MAX_RLC_INSTANCES];
79 S16 rlcActvTmr ARGS ((Ent ent, Inst inst));
81 static Void rlcLmmSendCfm ARGS ((RlcCb *gCb,Pst *pst,RlcMngmt *cfm,uint8_t type,
83 static S16 rlcLmmGenCfg ARGS ((RlcCb *gCb, RlcGenCfg *cfg));
84 static S16 rlcLmmCfgKwuSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
85 static S16 rlcLmmCfgUdxSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
86 static S16 rlcLmmCfgCkwSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
87 static S16 rlcLmmCfgRguSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
88 static S16 rlcLmmGenCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
89 static S16 rlcLmmUdxSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
90 static S16 rlcLmmLSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
91 static S16 rlcLmmGetKwuSapSta ARGS ((RlcCb *gCb,RlcKwuSapSta *sta));
92 static S16 rlcLmmGetRguSapSta ARGS ((RlcCb *gCb,RlcRguSapSta *sta));
93 static S16 rlcLmmGetCkwCntSapSta ARGS ((RlcCb *gCb,RlcCkwCntSapSta *sta));
94 static S16 rlcLmmGetGenSts ARGS ((RlcCb *gCb,RlcGenSts *sts,Action action));
95 static S16 rlcLmmGetSapSts ARGS ((RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt,Action
99 /*********************************************************************
100 * Primitives for RGU interface
101 ********************************************************************/
104 * Stores the general RLC configuration.
106 * It calculates the memory requirement of the Saps
107 * It also initializes the control blocks, the hash lists and registers
108 * the timers. In case of error it rolls back and reports error in the
109 * confirm.If the general configuration is already done it is treated as
110 * reconfiguration, but right now reconfiguration is not supported.
112 * @param[in] gCb RLC Instance Control Block
113 * @param[in] cfm RLC LM general config structure
116 * LCM_REASON_NOT_APPL (SUCCESS)
117 * LCM_REASON_MEM_NOAVAIL
118 * LCM_REASON_REGTMR_FAIL
119 * LCM_REASON_INVALID_PAR_VAL
120 * LCM_REASON_HASHING_FAILED
122 static S16 rlcLmmGenCfg(RlcCb *gCb,RlcGenCfg *cfg)
130 if(cfg->maxUe > RLC_MAX_UE)
132 #if (ERRCLASS & ERRCLS_INT_PAR)
133 DU_LOG("\nERROR --> RLC : Invalid maxUe : Max [%lu] Received [%lu]",
136 #endif /* ERRCLASS & ERRCLS_INT_PAR */
137 return (LCM_REASON_INVALID_PAR_VAL);
140 if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
142 #if (ERRCLASS & ERRCLS_INT_PAR)
143 DU_LOG("\nERROR --> RLC : Invalid maxKwuSaps : Max [%lu] Received [%lu]",
146 #endif /* ERRCLASS & ERRCLS_INT_PAR */
147 return (LCM_REASON_INVALID_PAR_VAL);
150 if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
152 #if (ERRCLASS & ERRCLS_INT_PAR)
153 DU_LOG("\nERROR --> RLC : Invalid maxUduSaps : Max [%lu] Received [%lu]",
156 #endif /* ERRCLASS & ERRCLS_INT_PAR */
157 return (LCM_REASON_INVALID_PAR_VAL);
160 if((cfg->maxRguSaps == 0) || (cfg->maxRguSaps > RLC_MAX_RGUSAPS))
164 return (LCM_REASON_INVALID_PAR_VAL);
166 if(gCb->init.cfgDone == TRUE)
168 /* reconfiguration not supported */
169 return (LCM_REASON_RECONFIG_FAIL);
174 /* Timer Queue Control point initialization */
175 rlcTqCp = &(gCb->rlcTqCp);
176 rlcTqCp->tmrLen = RLC_TMR_LEN;
179 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
181 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
182 if (gCb->u.dlCb == NULLP)
184 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
185 return (LCM_REASON_MEM_NOAVAIL);
188 /* allocate memory to the KWU sap's */
189 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
190 (Size)sizeof(RlcKwuSapCb));
192 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
194 #if (ERRCLASS & ERRCLS_INT_PAR)
195 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
197 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
198 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
199 return (LCM_REASON_MEM_NOAVAIL);
201 #endif /* ERRCLASS & ERRCLS_INT_PAR */
203 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
205 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
206 (Size)sizeof(RlcUdxDlSapCb));
208 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
209 #if (ERRCLASS & ERRCLS_INT_PAR)
210 if(gCb->u.dlCb->udxDlSap == NULLP)
212 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
213 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
214 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
215 return (LCM_REASON_MEM_NOAVAIL);
217 #endif /* ERRCLASS & ERRCLS_INT_PAR */
219 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
220 (Size)sizeof(RlcRguSapCb));
221 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
222 #if (ERRCLASS & ERRCLS_INT_PAR)
223 if(gCb->u.dlCb->rguDlSap == NULLP)
225 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
226 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
227 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
229 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
230 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
231 return (LCM_REASON_MEM_NOAVAIL);
233 #endif /* ERRCLASS & ERRCLS_INT_PAR */
236 /* Initialize the Ue and Cell hash list */
237 ret = rlcDbmDlInit(gCb);
240 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
241 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
242 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
243 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
244 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
245 return (LCM_REASON_MEM_NOAVAIL);
248 /* Register the timer */
249 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
252 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
253 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
254 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
255 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
257 return (LCM_REASON_REGTMR_FAIL);
260 /* initializations for background processing of freeing memory */
261 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
262 rlcUtlInitializeSelfPst(gCb);
264 if(SGetMsg(gCb->init.region,
266 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
268 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
269 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
270 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
271 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
273 return (LCM_REASON_MEM_NOAVAIL);
277 rlcUtlL2MeasDlInit(gCb);
280 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
282 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
283 if (gCb->u.ulCb == NULLP)
285 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
286 return (LCM_REASON_MEM_NOAVAIL);
289 /* allocate memory to the KWU sap's */
290 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
291 (Size)sizeof(RlcKwuSapCb));
293 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
295 #if (ERRCLASS & ERRCLS_INT_PAR)
296 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
298 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
299 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
300 return (LCM_REASON_MEM_NOAVAIL);
302 #endif /* ERRCLASS & ERRCLS_INT_PAR */
304 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
306 /* allocate memory to the KWU sap's */
307 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
308 (Size)sizeof(RlcUdxUlSapCb));
310 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
312 #if (ERRCLASS & ERRCLS_INT_PAR)
313 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
315 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
316 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
317 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
318 return (LCM_REASON_MEM_NOAVAIL);
320 #endif /* ERRCLASS & ERRCLS_INT_PAR */
322 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
323 (Size)sizeof(RlcRguSapCb));
324 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
325 #if (ERRCLASS & ERRCLS_INT_PAR)
326 if(gCb->u.ulCb->rguUlSap == NULLP)
328 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
329 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
330 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
332 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
333 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
334 return (LCM_REASON_MEM_NOAVAIL);
336 #endif /* ERRCLASS & ERRCLS_INT_PAR */
338 /* Initialize the Ue and Cell hash list */
339 ret = rlcDbmUlInit(gCb);
342 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
343 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
344 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
345 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
346 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
349 /* Register the timer */
350 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
353 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
354 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
355 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
356 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
358 return (LCM_REASON_REGTMR_FAIL);
362 rlcUtlL2MeasUlInit(gCb);
367 #if (ERRCLASS & ERRCLS_INT_PAR)
368 DU_LOG("\nERROR --> RLC : Received Invalid RLC Mode");
369 #endif /* ERRCLASS & ERRCLS_INT_PAR */
371 return (LCM_REASON_INVALID_PAR_VAL);
373 /* Timer Initialization */
374 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
376 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
378 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
380 gCb->init.lmPst.srcProcId = gCb->init.procId;
381 gCb->init.lmPst.srcEnt = gCb->init.ent;
382 gCb->init.lmPst.srcInst = gCb->init.inst;
383 gCb->init.lmPst.event = EVTNONE;
385 /* kw002.201 For multi core and multi region,no need to reinitiailize the
386 * region again . This would be done with kwActvInit from SSI */
387 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
388 gCb->init.region = cfg->lmPst.region;
389 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
390 gCb->init.pool = cfg->lmPst.pool;
392 gCb->init.cfgDone = TRUE;
394 return (LCM_REASON_NOT_APPL);
399 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
401 * @param[in] gCb RLC Instance Control Block
402 * @param[in] pst Post structure
403 * @param[in] cfm RLC LM structure
404 * @param[in] type Type of LM message
405 * @param[in] hdr Message header
410 static Void rlcLmmSendCfm
419 Pst rPst; /* Reply post structure */
421 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
423 /* reply post structure for confirmation */
426 rPst.srcEnt = gCb->init.ent;
427 rPst.srcInst = gCb->init.inst;
428 cfm->hdr.entId.ent = gCb->init.ent;
429 cfm->hdr.entId.inst = gCb->init.inst;
433 rPst.srcEnt = pst->dstEnt;
434 rPst.srcInst = pst->dstInst;
435 cfm->hdr.entId.ent = pst->dstEnt;
436 cfm->hdr.entId.inst = pst->dstInst;
438 rPst.srcProcId = SFndProcId();
439 rPst.dstEnt = pst->srcEnt;
440 rPst.dstInst = pst->srcInst;
441 rPst.dstProcId = pst->srcProcId;
442 rPst.selector = hdr->response.selector;
443 rPst.prior = hdr->response.prior;
444 rPst.route = hdr->response.route;
445 rPst.region = hdr->response.mem.region;
446 rPst.pool= hdr->response.mem.pool;
448 /* Fill the reply header */
449 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
450 cfm->hdr.transId = hdr->transId;
455 RlcMiRlcConfigCfm(&rPst,cfm);
458 SGetDateTime(&(cfm->t.cntrl.dt));
459 RlcMiLkwCntrlCfm(&rPst,cfm);
462 SGetDateTime(&(cfm->t.sts.dt));
463 RlcMiLkwStsCfm(&rPst,0,cfm);
466 SGetDateTime(&(cfm->t.ssta.dt));
467 RlcMiLkwStaCfm(&rPst,cfm);
470 #if (ERRCLASS & ERRCLS_INT_PAR)
471 DU_LOG("\nERROR --> RLC : Received Invalid Message Type");
476 #endif /* ERRCLASS & ERRCLS_INT_PAR */
486 * This function processes configuration requests received from the layer
490 * The configuration requests can be for general configuration, or
491 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
492 * request can be determined from the elmId field in the header of the layer
493 * manager message.This function is called by the layer manager to configure
496 * This function implements the following logic:
498 * - if genCfg is not done, send negative Cfm to the layer manager;
500 * - switch (cfg->hdr.elmId.elmnt)
502 * - update the genCfg field in RlCb;
503 * - allocate the maximum static memory required by the RLC product;
504 * - register the timer service by calling SReqTmr;
505 * - set CfgDone for not configuring again;
507 * - if all the parameters are valid, then allocate the KwuSap control
509 * - update the SAP control block with the information provided in the
510 * - configuration request;
511 * - send configuration confirm with the status, success;
513 * - if all the parametes are valid, then allocate the CkwSap control
515 * - update the SAP control block with the information provided in the
516 * configuration request;
517 * - send configuration confirm with the status, success;
519 * - if all the parametes are valid, then allocate the rguSap control
521 * - update the SAP control block with the information provided in the
522 * configuration request;
523 * - send configuration confirm with the status, success;
525 * - if all the parametes are valid, then allocate the udxSap control
527 * - update the SAP control block with the information provided in the
528 * configuration request;
529 * - send configuration confirm with the status, success;
532 * @param[in] pst post structure
533 * @param[in] cfg LM management structure
537 * -# Failure : RFAILED
540 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
542 Reason reason; /* failure reason */
545 #if (ERRCLASS & ERRCLS_INT_PAR)
546 /* Check if the instance is configured */
547 if (pst->dstInst >= MAX_RLC_INSTANCES)
549 cfg->cfm.status = LCM_PRIM_NOK;
550 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
551 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
556 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
560 cfg->cfm.status = LCM_PRIM_NOK;
561 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
562 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
565 /* check configuration is done or not */
566 if ((tRlcCb->init.cfgDone != TRUE) &&
567 (cfg->hdr.elmId.elmnt != STGEN))
570 * if general config is not over then use pst structure
571 * in primitive to communicate to stack manager
574 cfg->cfm.status = LCM_PRIM_NOK;
575 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
576 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
580 DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
582 switch(cfg->hdr.elmId.elmnt)
586 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
591 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
596 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
601 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
606 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
611 reason = LCM_REASON_INVALID_ELMNT;
616 if (reason == LCM_REASON_NOT_APPL)
618 cfg->cfm.status = LCM_PRIM_OK;
619 cfg->cfm.reason = LCM_REASON_NOT_APPL;
620 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
625 cfg->cfm.status = LCM_PRIM_NOK;
626 cfg->cfm.reason = reason;
627 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
634 * The layer manager initiates and uses the management-control procedure to
635 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
636 * can be called more than once and at any time after the
637 * management-configuration procedure.The control request primitive
638 * is confirmed by a RlcMiLkwCntrlCfm primitive.
641 * This function implements the following logic:
643 * - if(cfgDone = FALSE)
644 * - send negative confirmation to the layer manager;
647 * - switch(cntrl->hdr.elmId.elmnt)
651 * - switch(subAction)
653 * - enable the unsolicited status flag;
654 * - send the control Cfm with success;
656 * - set the debug mask;
657 * - send the control Cfm with success;
659 * - enable the trace flag;
660 * - send the control Cfm with success;
662 * - switch(subAction)
664 * - disable the unsolicited status flag;
665 * - send the control Cfm with success;
667 * - disable the trace flag;
668 * - send the control Cfm with success;
677 * @param[in] pst post structure
678 * @param[in] cntrl LM management structure
684 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
686 Reason reason; /* failure reason */
689 #if (ERRCLASS & ERRCLS_INT_PAR)
690 /* Check if the instance is configured */
691 if (pst->dstInst >= MAX_RLC_INSTANCES)
693 cntrl->cfm.status = LCM_PRIM_NOK;
694 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
696 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
701 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
705 cntrl->cfm.status = LCM_PRIM_NOK;
706 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
707 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
711 if (!(tRlcCb->init.cfgDone))
713 cntrl->cfm.status = LCM_PRIM_NOK;
714 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
715 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
718 DU_LOG("\nDEBUG --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
720 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
721 * In all error cases appropriate reason is returned
722 * by the functions below
725 switch (cntrl->hdr.elmId.elmnt)
729 /* general control */
730 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
735 /* Lower SAP control */
736 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
742 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
747 reason = LCM_REASON_INVALID_ELMNT;
752 if (reason == LCM_REASON_NOT_APPL)
754 cntrl->cfm.status = LCM_PRIM_OK;
755 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
759 cntrl->cfm.status = LCM_PRIM_NOK;
760 cntrl->cfm.reason = reason;
763 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
770 * This function processes solicited status requests received from the layer
771 * manager. The layer manager can request status information regarding the
772 * system ID, RGUSAP,KWUSAP, or CKWSAP.
774 * @param[in] pst post structure
775 * @param[in] sta LM management structure
780 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
782 RlcMngmt rSta; /* Status */
783 Reason reason; /* Failure reason */
786 #if (ERRCLASS & ERRCLS_INT_PAR)
787 /* Check if the instance is configured */
788 if (pst->dstInst >= MAX_RLC_INSTANCES)
790 sta->cfm.status = LCM_PRIM_NOK;
791 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
793 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
798 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
801 sta->cfm.status = LCM_PRIM_NOK;
802 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
804 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
808 DU_LOG("\nDEBUG --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
810 reason = LCM_REASON_NOT_APPL;
812 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
813 switch (sta->hdr.elmId.elmnt)
817 reason = LCM_REASON_NOT_APPL;
818 rlcGetSId(&rSta.t.ssta.s.sysId);
823 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
824 &sta->t.ssta.s.rlckwuSap,
825 sizeof (RlcKwuSapSta));
827 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
832 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
833 &sta->t.ssta.s.rguSap,
834 sizeof (RlcRguSapSta));
836 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
841 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
842 &sta->t.ssta.s.ckwSap,
843 sizeof (RlcCkwCntSapSta));
845 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
850 reason = LCM_REASON_INVALID_ELMNT;
853 } /* end of switch */
855 if (reason == LCM_REASON_NOT_APPL)
857 rSta.cfm.status = LCM_PRIM_OK;
858 rSta.cfm.reason = LCM_REASON_NOT_APPL;
862 rSta.cfm.status = LCM_PRIM_NOK;
863 rSta.cfm.reason = reason;
865 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
872 * This function processes statistics requests received from the layer
876 * After collecting the statistics, ir calls the statistics confirm function
877 * to send the statistics to the layer manager.
879 * - switch(sts->hdr.elmId.elmnt)
881 * - get the general statistics from the KW control block;
882 * - if (action = RESET)
883 * - reset the general statistic field in the RlCb;
884 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
888 * - get the SAP specific statistics from KW control block;
889 * - if (action = RESET)
890 * - reset the general statistic field in the RlCb;
891 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
894 * @param[in] pst post structure
895 * @param[in] action action
896 * @param[in] sts LM management structure
902 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
904 RlcMngmt rSts; /* Statistics */
905 Reason reason; /* Reason for failure */
908 #if (ERRCLASS & ERRCLS_INT_PAR)
909 /* Check if the instance is configured */
910 if (pst->dstInst >= MAX_RLC_INSTANCES)
912 rSts.cfm.status = LCM_PRIM_NOK;
913 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
915 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
920 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
923 rSts.cfm.status = LCM_PRIM_NOK;
924 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
926 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
930 DU_LOG("\nDEBUG --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))",
932 sts->hdr.elmId.elmnt);
934 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
936 switch (sts->hdr.elmId.elmnt)
940 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
946 if( sts->hdr.elmId.elmnt == STKWUSAP)
948 /* kw005.201, modified the element of rlckwuSap from suId to spId */
949 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
951 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
956 reason = LCM_REASON_INVALID_ELMNT;
961 if (reason == LCM_REASON_NOT_APPL)
963 rSts.cfm.status = LCM_PRIM_OK;
964 rSts.cfm.reason = LCM_REASON_NOT_APPL;
968 rSts.cfm.status = LCM_PRIM_NOK;
969 rSts.cfm.reason = reason;
971 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
976 /* kw005.201 added support for L2 Measurement */
980 This function processes L2 Measurement requests received from the layer manager.
981 The L2 Measurement is start for a time period and after the timer expiry, the
982 measurement confirm is sent.
984 - Accept only one set of measurements.
985 - Allocate and initialise RlcL2MeasEvtCb.
986 - Validate if the measurement is already in progress.
987 - Loop through the existing measEvtCb with matching measType
988 - Check if measurement is running for any qci present in the measReq
989 - If present, move the qCi to list of invalid qCIs.
990 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
991 - For the number of measurements requested.
992 - For all Ues with RBs matching qCI.
993 - Add RbCb to the RB linked list.
994 - Set rlcRbCb.measOn to measurement type.
995 - If Meas type is DL_DELAY
996 - Update COUNT to startCount.
999 * @param[in] pst post structure
1000 * @param[in] action action
1001 * @param[in] cfg LM management structure
1004 * -# Failure : RFAILED
1006 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1011 RlcL2MeasCfmEvt measCfmEvt;
1015 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1017 /* Initialize measCfmEvt */
1018 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1019 /* validate the received measReqEvt */
1020 /*LTE_L2_MEAS_PHASE2*/
1021 if(measReqEvt->measPeriod != 0)
1023 /* L2 MEAS AGHOSH */
1024 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1025 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1027 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1032 #if (ERRCLASS & ERRCLS_ADD_RES)
1033 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1034 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1035 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1040 measType = measReqEvt->measReq.measType;
1042 if((measType != LKW_L2MEAS_DL_IP) &&
1043 (measType != LKW_L2MEAS_ACT_UE) &&
1044 (measType != LKW_L2MEAS_DL_DISC) &&
1045 (measType != LKW_L2MEAS_DL_DELAY) &&
1046 (measType != LKW_L2MEAS_UU_LOSS) &&
1047 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1049 measCfmEvt.transId = measReqEvt->transId;
1050 measCfmEvt.measType = measType;
1051 measCfmEvt.status.status = LCM_PRIM_NOK;
1052 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1053 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1054 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1058 /* for UL IP throughput meas enable for all QCIs */
1059 if(measType & LKW_L2MEAS_UL_IP)
1061 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1063 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1068 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1069 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1071 RlcL2MeasReqEvt *measEvt;
1074 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1076 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1079 sizeof(RlcL2MeasReqEvt));
1081 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1082 if(measEvt == NULLP)
1084 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
1088 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1089 /*Redirect the request to DL task */
1090 /* NOTE:As of today, there are no cases where the Req will fail at DL
1091 as long as it reached the DL, so we don't wait for a confirmation from
1092 DL to send the confirmation to LM*/
1093 /* The interface for sending a confirmation back does not exist today;
1094 it needs to be created when the need arises */
1095 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1098 /* We need to copy the transId for sending back confirms later */
1099 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1101 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1102 if(measEvtCb->measCb.measType & measType)
1104 measEvtCb->transId= measReqEvt->transId;
1107 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1110 } /* RlcMiLkwL2MeasReq */
1114 This function processes L2 Measurement stop request received from the layer manager.
1115 After receving this request, RLC stops L2 Measurement
1116 * @param[in] pst post structure
1117 * @param[in] measType meas Type
1120 * -# Failure : RFAILED
1123 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1126 RlcL2MeasEvtCb *measEvtCb = NULLP;
1129 uint8_t status = ROK;
1132 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1134 /* reset the counter values for the measurement that is stopped */
1135 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1137 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1138 if(measEvtCb->measCb.measType & measType)
1140 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1145 /* for UL IP throughput meas disable for all QCIs */
1146 if(measType & LKW_L2MEAS_UL_IP)
1148 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1150 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1154 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1155 || (measType & LKW_L2MEAS_DL_DELAY))
1157 /*Redirect the request to DL task */
1158 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1161 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1163 status = LCM_PRIM_OK;
1164 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1170 This function processes L2 Measurement Send request received from the layer manager.
1171 After receving this request, RLC sends L2 Measurement
1172 * @param[in] pst post structure
1173 * @param[in] measType meas Type
1176 * -# Failure : RFAILED
1179 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1182 RlcL2MeasEvtCb *measEvtCb = NULLP;
1186 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1188 /* In case of addition of any new measType here ,appropriate handling
1189 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1191 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1192 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1194 /*Redirect the request to DL task */
1195 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1196 /* L2 MEAS AGHOSH */
1200 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1202 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1203 /* L2 MEAS AGHOSH */
1204 if(measEvtCb->measCb.measType & measType)
1206 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1212 #endif /* LTE_L2_MEAS */
1216 * This function configures the RLC data sap
1218 * @param[in] gCb RLC Instance Control Block
1219 * @param[in] cfg RLC LM Sap configuration structure
1222 * -# LCM_REASON_NOT_APPL (SUCCESS)
1223 * -# LCM_REASON_INVALID_SAP
1224 * -# LCM_REASON_MEM_NOAVAIL
1225 * -# LCM_REASON_RECONFIG_FAIL
1227 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1229 RlcKwuSapCb *rlcKwuSapCb;
1231 #if (ERRCLASS & ERRCLS_INT_PAR)
1232 /* Validate the protocol parameters */
1233 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1235 return (LCM_REASON_INVALID_PAR_VAL);
1237 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1239 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1240 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1241 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1243 #if (ERRCLASS & ERRCLS_INT_PAR)
1244 /* Check for reconfiguration */
1245 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1247 DU_LOG("\nERROR --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1248 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1249 /* reconfiguration not allowed */
1250 return (LCM_REASON_RECONFIG_FAIL);
1252 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1254 /* Fill the parameters */
1255 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1257 return (LCM_REASON_NOT_APPL);
1262 * This function configures the RLC control sap
1264 * @param[in] gCb RLC Instance Control Block
1265 * @param[in] cfg RLC LM Sap configuration structure
1268 * -# LCM_REASON_NOT_APPL (SUCCESS)
1269 * -# LCM_REASON_INVALID_SAP
1270 * -# LCM_REASON_INVALID_SAP
1271 * -# LCM_REASON_RECONFIG_FAIL
1273 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1275 RlcCkwSapCb *ckwSap;
1277 #if (ERRCLASS & ERRCLS_INT_PAR)
1278 /* Validate config parameters */
1279 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1281 return (LCM_REASON_INVALID_PAR_VAL);
1284 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1286 /* Get Sap control block */
1287 return (LCM_REASON_INVALID_PAR_VAL);
1291 ckwSap = &(gCb->u.ulCb->ckwSap);
1293 #if (ERRCLASS & ERRCLS_INT_PAR)
1294 /* Check for reconfiguration */
1295 if(ckwSap->state != RLC_SAP_NOT_CFG)
1297 DU_LOG("\nERROR --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
1298 return (LCM_REASON_RECONFIG_FAIL);
1300 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1302 /* Fill the parameters */
1303 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1305 return (LCM_REASON_NOT_APPL);
1310 * This function configures the UDX sap
1312 * @param[in] gCb RLC Instance Control Block
1313 * @param[in] cfg RLC LM Sap configuration structure
1316 * -# LCM_REASON_NOT_APPL (SUCCESS)
1317 * -# LCM_REASON_INVALID_SAP
1318 * -# LCM_REASON_INVALID_SAP
1319 * -# LCM_REASON_RECONFIG_FAIL
1321 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1323 RlcUdxDlSapCb *udxDlSap;
1324 RlcUdxUlSapCb *udxUlSap;
1326 #if (ERRCLASS & ERRCLS_INT_PAR)
1327 /* Validate the protocol parameters */
1328 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1330 return (LCM_REASON_INVALID_PAR_VAL);
1333 /* Get Sap control block */
1334 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1336 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1337 #if (ERRCLASS & ERRCLS_INT_PAR)
1338 /* Check for reconfiguration */
1339 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1341 DU_LOG("\nERROR --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
1342 return (LCM_REASON_RECONFIG_FAIL);
1344 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1346 /* Fill the parameters */
1347 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1351 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1353 #if (ERRCLASS & ERRCLS_INT_PAR)
1354 /* Check for reconfiguration */
1355 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1357 DU_LOG("\nERROR --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
1358 return (LCM_REASON_RECONFIG_FAIL);
1360 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1362 /* Fill the parameters */
1363 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1365 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1366 udxUlSap->retryCnt = 0;
1367 cmInitTimers(&(udxUlSap->bndTmr), 1);
1370 return (LCM_REASON_NOT_APPL);
1375 * This function configures the RGU sap
1377 * @param[in] gCb RLC Instance Control Block
1378 * @param[in] cfg RLC LM Sap configuration structure
1380 * -# LCM_REASON_NOT_APPL (SUCCESS)
1381 * -# LCM_REASON_INVALID_SAP
1382 * -# LCM_REASON_INVALID_SAP
1383 * -# LCM_REASON_RECONFIG_FAIL
1385 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1387 RlcRguSapCb *rguSap;
1389 #if (ERRCLASS & ERRCLS_INT_PAR)
1390 /* Validate the protocol parameters */
1391 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1394 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1395 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1396 return (LCM_REASON_INVALID_PAR_VAL);
1400 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1401 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1403 #if (ERRCLASS & ERRCLS_INT_PAR)
1404 /* Check for reconfiguration */
1405 if(rguSap->state != RLC_SAP_NOT_CFG)
1407 DU_LOG("\nERROR --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
1408 gCb->genCfg.rlcMode, rguSap->state);
1409 return (LCM_REASON_RECONFIG_FAIL);
1411 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1413 /* Fill the parameters */
1414 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1415 rguSap->suId = cfg->sapId;
1416 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1417 rguSap->retryCnt = 0;
1418 rguSap->state = RLC_SAP_CFG;
1420 cmInitTimers(&(rguSap->bndTmr), 1);
1422 return (LCM_REASON_NOT_APPL);
1427 * Validates the RLC general control parameters
1429 * @param[in] cntrl RLC LM structure
1432 * -# LCM_REASON_NOT_APPL (SUCCESS)
1433 * -# LCM_REASON_INVALID_SUBACTION
1434 * -# LCM_REASON_INVALID_ACTION
1436 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1438 S16 reason; /* reason for failure */
1439 uint8_t sAction; /* subaction field */
1441 reason = LCM_REASON_NOT_APPL;
1442 sAction = cntrl->t.cntrl.subAction;
1444 switch (cntrl->t.cntrl.action)
1448 if ((sAction != SAUSTA) &&
1449 (sAction != SADBG) &&
1452 reason = LCM_REASON_INVALID_SUBACTION;
1458 reason = LCM_REASON_INVALID_ACTION;
1467 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1469 * @param[in] gCb RLC Instance Control Block
1473 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1478 if (gCb->init.cfgDone)
1480 /* Deregister the timers */
1481 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1482 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1483 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1484 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1485 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1487 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1489 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1491 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1494 gCb->u.dlCb->shutdownReceived = TRUE;
1495 rlcUtlFreeDlMemory(gCb);
1496 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1498 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1501 if(gCb->u.dlCb->udxDlSap != NULLP)
1503 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1506 if(gCb->u.dlCb->rguDlSap != NULLP)
1508 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1509 gCb->genCfg.maxRguSaps = 0;
1511 if (gCb->u.dlCb->shutdownReceived)
1513 if (gCb->u.dlCb->selfPstMBuf != NULL)
1515 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1517 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1524 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1527 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1529 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1532 if(gCb->u.ulCb->udxUlSap != NULLP)
1534 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1537 if(gCb->u.ulCb->rguUlSap != NULLP)
1539 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1540 gCb->genCfg.maxRguSaps = 0;
1543 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1547 gCb->init.cfgDone = FALSE;
1548 gCb->init.acnt = FALSE;
1549 gCb->init.trc = FALSE;
1551 gCb->init.usta = FALSE;
1559 * Delete all SAPs and Control Blocks
1562 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1563 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1564 * control blocks and lists.
1566 * @params[in] gCb RLC instance control block
1569 * -# LCM_REASON_NOT_APPL (SUCCESS)
1570 * -# LCM_REASON_HASHING_FAILED
1572 static S16 rlcLmmShutdown(RlcCb *gCb)
1574 RlcRguSapCb *rguSap;
1577 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1579 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1581 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1582 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1584 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1590 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1592 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1593 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1595 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1600 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1602 rlcDbmDlShutdown(gCb);
1606 rlcDbmUlShutdown(gCb);
1609 rlcLmmCleanGblRsrcs(gCb);
1611 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1613 return (LCM_REASON_NOT_APPL);
1618 * Function processes the general control request
1620 * @param[in] gCb RLC instance control block
1621 * @param[in] cntrl RLC LM structure
1624 * -# LCM_REASON_NOT_APPL (SUCCESS)
1625 * -# LCM_REASON_INVALID_SUBACTION
1626 * -# LCM_REASON_INVALID_ACTION
1628 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1630 RlcTrcCntrl *trcCntrl; /* trace */
1632 RlcDbgCntrl *dbgCntrl; /* debug */
1634 S16 reason; /* reason for failure */
1636 /* Validate control parameters */
1637 reason = rlcLmmValidateGenCntrl (cntrl);
1639 if (reason != LCM_REASON_NOT_APPL)
1644 switch(cntrl->t.cntrl.action)
1648 switch(cntrl->t.cntrl.subAction)
1652 RLC_SET_USTA_FLAG(gCb, TRUE);
1658 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1659 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1665 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1666 gCb->init.trc = TRUE;
1667 gCb->trcLen = trcCntrl->trcLen;
1668 (gCb->trcMask) |= trcCntrl->trcMask;
1676 switch(cntrl->t.cntrl.subAction)
1680 gCb->init.usta = FALSE;
1686 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1687 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1693 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1694 gCb->init.trc = FALSE;
1695 gCb->trcMask &= ~(trcCntrl->trcMask);
1703 reason = rlcLmmShutdown(gCb);
1712 * Bind/Unbind RLC UDX sap
1714 * @param[in] gCb RLC Instance Control Block
1715 * @param[in] cntrl RLC LM structure
1718 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1719 * -# LCM_REASON_INVALID_SAP
1720 * -# LCM_REASON_INVALID_STATE
1721 * -# LCM_REASON_INVALID_ACTION
1723 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1726 #if (ERRCLASS & ERRCLS_INT_PAR)
1727 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1729 return (LCM_REASON_INVALID_SAP);
1732 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1733 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1735 return (LCM_REASON_INVALID_SAP);
1737 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1739 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1740 #if (ERRCLASS & ERRCLS_INT_PAR)
1742 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1744 DU_LOG("\nERROR --> RLC : udxUlSap not configured yet");
1745 return (LCM_REASON_INVALID_STATE);
1747 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1749 switch(cntrl->t.cntrl.action)
1753 if(UDX_SAP.state != RLC_SAP_BND)
1755 /* start timer to wait for bind confirm */
1756 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1757 UDX_SAP.state = RLC_SAP_BINDING;
1758 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1762 /* control request received for an already bound SAP */
1763 return (LCM_REASON_INVALID_STATE);
1769 /* make the state of UDXSAP configured but not bound */
1770 UDX_SAP.state = RLC_SAP_CFG;
1771 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1775 return (LCM_REASON_INVALID_ACTION);
1777 } /* end of switch */
1779 return (LCM_REASON_NOT_APPL);
1784 * Bind/Unbind RLC lower sap
1786 * @param[in] gCb RLC Instance Control Block
1787 * @param[in] cntrl RLC LM structure
1789 * -# LCM_REASON_NOT_APPL (SUCCESS)
1790 * -# LCM_REASON_INVALID_SAP
1791 * -# LCM_REASON_INVALID_STATE
1792 * -# LCM_REASON_INVALID_ACTION
1794 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1796 RlcRguSapCb *rguSap; /* rgu sap pointer */
1798 #if (ERRCLASS & ERRCLS_INT_PAR)
1800 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1801 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1803 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1804 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1805 return (LCM_REASON_INVALID_SAP);
1807 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1808 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1809 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1810 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1812 #if (ERRCLASS & ERRCLS_INT_PAR)
1814 if(rguSap->state == RLC_SAP_NOT_CFG)
1816 DU_LOG("\nERROR --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1817 return (LCM_REASON_INVALID_STATE);
1819 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1821 switch(cntrl->t.cntrl.action)
1825 if(rguSap->state != RLC_SAP_BND)
1827 /* start timer to wait for bind confirm */
1828 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1829 rguSap->state = RLC_SAP_BINDING;
1830 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1831 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1832 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1836 /* control request received for an already bound SAP */
1837 return (LCM_REASON_INVALID_STATE);
1843 /* make the state of RGUSAP is configure but not bound */
1844 rguSap->state = RLC_SAP_CFG;
1845 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1849 return (LCM_REASON_INVALID_ACTION);
1851 } /* end of switch */
1853 return (LCM_REASON_NOT_APPL);
1858 * Function gather the general KWU SAP status
1860 * @param[in] gCb RLC Instance Control Block
1861 * @param[in] sta LM KWU Sap Status structure
1864 * -# LCM_REASON_NOT_APPL (SUCCESS)
1865 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1867 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1869 RlcKwuSapCb *rlcKwSapCb;
1871 #if (ERRCLASS & ERRCLS_INT_PAR)
1872 /* Validate the protocol parameters */
1873 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1876 return (LCM_REASON_INVALID_PAR_VAL);
1880 /* Get Sap control block */
1881 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1882 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1883 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1885 sta->state = rlcKwSapCb->state;
1887 return (LCM_REASON_NOT_APPL);
1892 * Function gather the general RGU SAP status
1894 * @param[in] gCb RLC Instance Control Block
1895 * @param[in] sta LM RGU Sap Status structure
1897 * -# LCM_REASON_NOT_APPL (SUCCESS)
1898 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1900 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1903 #if (ERRCLASS & ERRCLS_INT_PAR)
1904 /* Validate the protocol parameters */
1905 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1907 return (LCM_REASON_INVALID_PAR_VAL);
1911 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1912 gCb->u.dlCb->rguDlSap[sta->suId].state :
1913 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1915 return (LCM_REASON_NOT_APPL);
1920 * Function gather the general CKW SAP status
1922 * @param[in] gCb RLC Instance Control Block
1923 * @param[in] sta LM CKW Sap Status structure
1925 * -# LCM_REASON_NOT_APPL (SUCCESS)
1926 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1928 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1931 #if (ERRCLASS & ERRCLS_INT_PAR)
1932 /* Validate config parameters */
1933 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1935 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1937 return (LCM_REASON_INVALID_PAR_VAL);
1940 sta->state = gCb->u.ulCb->ckwSap.state;
1942 return (LCM_REASON_NOT_APPL);
1948 * Gather the general statistics
1950 * @param[in] gCb RLC Instance Control Block
1951 * @param[in] sts LM general statistics structure
1952 * @param[in] action action
1954 * -# LCM_REASON_NOT_APPL (SUCCESS)
1955 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1957 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1960 #if (ERRCLASS & ERRCLS_INT_PAR)
1961 /* Validate protocol parameters */
1962 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1964 return (LCM_REASON_INVALID_PAR_VAL);
1970 if(action == LKW_ZEROSTS)
1972 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1975 return (LCM_REASON_NOT_APPL);
1980 * Gather the SAP statistics
1982 * @param[in] gCb RLC Instance Control Block
1983 * @param[in] sts LM general statistics structure
1984 * @param[in] elmnt element
1985 * @param[in] action action
1988 * -# LCM_REASON_NOT_APPL (SUCCESS)
1989 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1991 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
1994 /* Validate protocol parameters */
1995 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
1997 return (LCM_REASON_INVALID_PAR_VAL);
2003 RlcKwuSapSts *rlckwuSap;
2004 RlcKwuSapCb *rlcKwuSapCb;
2005 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2007 /* Get Sap control block */
2008 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2009 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2010 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2011 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2014 *rlckwuSap = rlcKwuSapCb->sts;
2016 if (action == LKW_ZEROSTS)
2018 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2022 /* kw005.201 removed RGUSAP statistics support */
2025 RlcCkwCntSts *ckwSap;
2026 ckwSap = &sts->t.sts.s.ckwSap;
2027 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2029 return (LCM_REASON_INVALID_PAR_VAL);
2032 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2034 if (action == LKW_ZEROSTS)
2036 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2041 return (LCM_REASON_INVALID_ELMNT);
2044 SGetDateTime(&sts->t.sts.dt);
2046 return (LCM_REASON_NOT_APPL);
2051 * This function sends Unsolicited Status Indication to the Layer Management
2054 * @param[in] gCb RLC Instance Control Block
2055 * @param[in] category Category
2056 * @param[in] event event
2057 * @param[in] cause cause
2058 * @param[in] UeId ueId
2059 * @param[in] Qci qci
2064 Void rlcLmmSendAlarm
2074 #else /* LTE_L2_MEAS */
2075 Void rlcLmmSendAlarm
2084 #endif /* LTE_L2_MEAS */
2086 RlcMngmt usta; /* Rlc Management Structure */
2088 if(gCb->init.usta == FALSE)
2093 usta.hdr.elmId.elmnt = STGEN;
2094 usta.hdr.entId.ent = gCb->init.ent;
2095 usta.hdr.entId.inst = gCb->init.inst;
2097 /* fill in the event and category */
2098 usta.t.usta.alarm.category = category;
2099 usta.t.usta.alarm.event = event;
2100 usta.t.usta.alarm.cause = cause;
2102 /* set the suId and ueId */
2103 usta.t.usta.ueId = ueId;
2104 usta.t.usta.suId = suId;
2105 /* kw005.201 added support for L2 Measurement */
2107 if(event == LKW_EVT_MEAS_HALT)
2109 usta.t.usta.qci = qci;
2111 #endif /* LTE_L2_MEAS */
2112 /* update the date and time */
2113 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2115 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2123 * This function sends trace indication to LM
2125 * @param[in] gCb RLC Instance Control Block
2126 * @param[in] event event
2127 * @param[in] mBuf meessage buffer
2133 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2135 RlcMngmt trc; /* RLC management control block */
2142 DU_LOG("\nDEBUG --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2146 memset(&trc, 0, sizeof(RlcMngmt));
2148 pst = gCb->init.lmPst;
2150 trc.t.trc.event = event;
2151 SGetDateTime(&trc.t.trc.dt);
2152 trc.cfm.status = LCM_PRIM_OK;
2153 trc.cfm.reason = LCM_REASON_NOT_APPL;
2157 /* Check if the whole buffer is to be sent in Trace indication */
2158 if(gCb->trcLen == LKW_FULL_TRACE)
2160 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2163 /* rg005.201 removed SPutSBuf on error */
2164 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2167 /* Send Trace Indication to Layer manager */
2168 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2170 /* check if only a specified number of bytes are to be sent */
2171 else if(gCb->trcLen > 0)
2173 /* Get the length of the recvd message buffer */
2174 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2176 DU_LOG("\nERROR --> RLC : SFndLenMsg Failed");
2179 /* Check if the recvd buffer size is less than request trace len */
2180 if(bufLen < gCb->trcLen)
2182 /* Copy the whole of the recvd buffer in trace indication */
2184 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2187 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2191 /* Send Trace Indication to Layer manager */
2192 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2196 /* if the recvd buffer size is greater than request trace len */
2197 /* Get a temporary buffer to store the msg */
2198 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2200 #if (ERRCLASS & ERRCLS_INT_PAR)
2201 if(tempBuf == NULLP)
2203 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2205 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2206 return (LCM_REASON_MEM_NOAVAIL);
2208 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2210 /* Copy trcLen nos of bytes from the recvd message */
2211 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2213 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2217 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2219 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2222 /* Copy the tempBuf data to dst mBuf */
2223 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2225 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2229 /* Free the memory allocated for tempBuf */
2230 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2231 /* Send Trace Indication to Layer manager */
2232 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2238 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2247 * Activate Task - timer
2250 * Invoked by system services to activate a task with a timer tick.
2252 * @param[in] ent entity
2253 * @param[in] inst instance
2261 S16 rlcActvTmr(Ent ent,Inst inst)
2265 if (inst >= MAX_RLC_INSTANCES)
2269 gCb = RLC_GET_RLCCB(inst);
2270 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2273 } /* end of rlcActvTmr */
2276 /********************************************************************30**
2279 **********************************************************************/