1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /********************************************************************20**
21 Name: LTE - RLC - Layer Manager file
25 Desc: It contains the following common functions for processing
26 the all the external interfaces.
40 *********************************************************************21*/
41 static const char* RLOG_MODULE_NAME="LMM";
42 static int RLOG_MODULE_ID=2048;
43 static int RLOG_FILE_ID=197;
45 @brief RLC Layer Manager Module
49 /* header (.h) include files */
50 #include "common_def.h"
51 #include "lkw.h" /* LKW defines */
52 #include "ckw.h" /* CKW defines */
53 #include "kwu.h" /* KWU defines */
54 #include "rgu.h" /* RGU defines */
55 #include "kw_err.h" /* Err defines */
56 #include "kw_env.h" /* RLC environment options */
58 #include "kw.h" /* RLC defines */
63 /* extern (.x) include files */
64 #include "lkw.x" /* LKW */
65 #include "ckw.x" /* CKW */
66 #include "kwu.x" /* KWU */
67 #include "rgu.x" /* RGU */
74 #define RLC_MODULE RLC_DBGMASK_LMM
78 /*********************************************************************
79 * Forward Declaration of LKW Porting Functions
80 ********************************************************************/
81 RlcCb *rlcCb[MAX_RLC_INSTANCES];
82 S16 rlcActvTmr ARGS ((Ent ent, Inst inst));
84 static Void rlcLmmSendCfm ARGS ((RlcCb *gCb,Pst *pst,RlcMngmt *cfm,uint8_t type,
86 static S16 rlcLmmGenCfg ARGS ((RlcCb *gCb, RlcGenCfg *cfg));
87 static S16 rlcLmmCfgKwuSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
88 static S16 rlcLmmCfgUdxSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
89 static S16 rlcLmmCfgCkwSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
90 static S16 rlcLmmCfgRguSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
91 static S16 rlcLmmGenCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
92 static S16 rlcLmmUdxSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
93 static S16 rlcLmmLSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
94 static S16 rlcLmmGetKwuSapSta ARGS ((RlcCb *gCb,RlcKwuSapSta *sta));
95 static S16 rlcLmmGetRguSapSta ARGS ((RlcCb *gCb,RlcRguSapSta *sta));
96 static S16 rlcLmmGetCkwCntSapSta ARGS ((RlcCb *gCb,RlcCkwCntSapSta *sta));
97 static S16 rlcLmmGetGenSts ARGS ((RlcCb *gCb,RlcGenSts *sts,Action action));
98 static S16 rlcLmmGetSapSts ARGS ((RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt,Action
102 /*********************************************************************
103 * Primitives for RGU interface
104 ********************************************************************/
107 * Stores the general RLC configuration.
109 * It calculates the memory requirement of the Saps
110 * It also initializes the control blocks, the hash lists and registers
111 * the timers. In case of error it rolls back and reports error in the
112 * confirm.If the general configuration is already done it is treated as
113 * reconfiguration, but right now reconfiguration is not supported.
115 * @param[in] gCb RLC Instance Control Block
116 * @param[in] cfm RLC LM general config structure
119 * LCM_REASON_NOT_APPL (SUCCESS)
120 * LCM_REASON_MEM_NOAVAIL
121 * LCM_REASON_REGTMR_FAIL
122 * LCM_REASON_INVALID_PAR_VAL
123 * LCM_REASON_HASHING_FAILED
125 static S16 rlcLmmGenCfg(RlcCb *gCb,RlcGenCfg *cfg)
133 if(cfg->maxUe > RLC_MAX_UE)
135 #if (ERRCLASS & ERRCLS_INT_PAR)
136 RLOG2(L_ERROR, "Invalid maxUe : Max [%lu] Received [%lu]",
139 #endif /* ERRCLASS & ERRCLS_INT_PAR */
140 return (LCM_REASON_INVALID_PAR_VAL);
143 if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
145 #if (ERRCLASS & ERRCLS_INT_PAR)
146 RLOG2(L_ERROR, "Invalid maxKwuSaps : Max [%lu] Received [%lu]",
149 #endif /* ERRCLASS & ERRCLS_INT_PAR */
150 return (LCM_REASON_INVALID_PAR_VAL);
153 if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
155 #if (ERRCLASS & ERRCLS_INT_PAR)
156 RLOG2(L_ERROR, "Invalid maxUduSaps : Max [%lu] Received [%lu]",
159 #endif /* ERRCLASS & ERRCLS_INT_PAR */
160 return (LCM_REASON_INVALID_PAR_VAL);
163 if((cfg->maxRguSaps == 0) || (cfg->maxRguSaps > RLC_MAX_RGUSAPS))
167 return (LCM_REASON_INVALID_PAR_VAL);
169 if(gCb->init.cfgDone == TRUE)
171 /* reconfiguration not supported */
172 return (LCM_REASON_RECONFIG_FAIL);
177 /* Timer Queue Control point initialization */
178 rlcTqCp = &(gCb->rlcTqCp);
179 rlcTqCp->tmrLen = RLC_TMR_LEN;
182 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
184 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
185 if (gCb->u.dlCb == NULLP)
187 RLOG0(L_FATAL,"Memory Allocation failed");
188 return (LCM_REASON_MEM_NOAVAIL);
191 /* allocate memory to the KWU sap's */
192 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
193 (Size)sizeof(RlcKwuSapCb));
195 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
197 #if (ERRCLASS & ERRCLS_INT_PAR)
198 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
200 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
201 RLOG0(L_FATAL,"Memory Allocation failed");
202 return (LCM_REASON_MEM_NOAVAIL);
204 #endif /* ERRCLASS & ERRCLS_INT_PAR */
206 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
208 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
209 (Size)sizeof(RlcUdxDlSapCb));
211 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
212 #if (ERRCLASS & ERRCLS_INT_PAR)
213 if(gCb->u.dlCb->udxDlSap == NULLP)
215 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
216 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
217 RLOG0(L_FATAL,"Memory Allocation failed");
218 return (LCM_REASON_MEM_NOAVAIL);
220 #endif /* ERRCLASS & ERRCLS_INT_PAR */
222 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
223 (Size)sizeof(RlcRguSapCb));
224 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
225 #if (ERRCLASS & ERRCLS_INT_PAR)
226 if(gCb->u.dlCb->rguDlSap == NULLP)
228 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
229 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
230 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
232 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
233 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
234 return (LCM_REASON_MEM_NOAVAIL);
236 #endif /* ERRCLASS & ERRCLS_INT_PAR */
239 /* Initialize the Ue and Cell hash list */
240 ret = rlcDbmDlInit(gCb);
243 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
244 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
245 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
246 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
247 RLOG0(L_FATAL,"RLC DL Initialization failed");
248 return (LCM_REASON_MEM_NOAVAIL);
251 /* Register the timer */
252 /*Pradeep: changing the SRegTmrMt() to SRegTmr()*/
253 if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
256 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
257 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
258 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
259 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
261 return (LCM_REASON_REGTMR_FAIL);
264 /* initializations for background processing of freeing memory */
265 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
266 rlcUtlInitializeSelfPst(gCb);
268 if(SGetMsg(gCb->init.region,
270 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
272 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
273 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
274 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
275 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
277 return (LCM_REASON_MEM_NOAVAIL);
281 rlcUtlL2MeasDlInit(gCb);
284 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
286 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
287 if (gCb->u.ulCb == NULLP)
289 RLOG0(L_FATAL,"Memory Allocation failed");
290 return (LCM_REASON_MEM_NOAVAIL);
293 /* allocate memory to the KWU sap's */
294 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
295 (Size)sizeof(RlcKwuSapCb));
297 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
299 #if (ERRCLASS & ERRCLS_INT_PAR)
300 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
302 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
303 RLOG0(L_FATAL,"Memory Allocation failed");
304 return (LCM_REASON_MEM_NOAVAIL);
306 #endif /* ERRCLASS & ERRCLS_INT_PAR */
308 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
310 /* allocate memory to the KWU sap's */
311 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
312 (Size)sizeof(RlcUdxUlSapCb));
314 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
316 #if (ERRCLASS & ERRCLS_INT_PAR)
317 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
319 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
320 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
321 RLOG0(L_FATAL,"Memory Allocation failed");
322 return (LCM_REASON_MEM_NOAVAIL);
324 #endif /* ERRCLASS & ERRCLS_INT_PAR */
326 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
327 (Size)sizeof(RlcRguSapCb));
328 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
329 #if (ERRCLASS & ERRCLS_INT_PAR)
330 if(gCb->u.ulCb->rguUlSap == NULLP)
332 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
333 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
334 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
336 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
337 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
338 return (LCM_REASON_MEM_NOAVAIL);
340 #endif /* ERRCLASS & ERRCLS_INT_PAR */
342 /* Initialize the Ue and Cell hash list */
343 ret = rlcDbmUlInit(gCb);
346 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
347 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
348 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
349 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
350 RLOG0(L_FATAL,"RLC DL Initialization failed");
353 /* Register the timer */
355 if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
358 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
359 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
360 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
361 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
363 return (LCM_REASON_REGTMR_FAIL);
367 rlcUtlL2MeasUlInit(gCb);
372 #if (ERRCLASS & ERRCLS_INT_PAR)
373 RLOG0(L_ERROR, "Received Invalid RLC Mode");
374 #endif /* ERRCLASS & ERRCLS_INT_PAR */
376 return (LCM_REASON_INVALID_PAR_VAL);
378 /* Timer Initialization */
379 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
381 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
383 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
385 gCb->init.lmPst.srcProcId = gCb->init.procId;
386 gCb->init.lmPst.srcEnt = gCb->init.ent;
387 gCb->init.lmPst.srcInst = gCb->init.inst;
388 gCb->init.lmPst.event = EVTNONE;
390 /* kw002.201 For multi core and multi region,no need to reinitiailize the
391 * region again . This would be done with kwActvInit from SSI */
392 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
393 gCb->init.region = cfg->lmPst.region;
394 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
395 gCb->init.pool = cfg->lmPst.pool;
397 gCb->init.cfgDone = TRUE;
399 return (LCM_REASON_NOT_APPL);
404 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
406 * @param[in] gCb RLC Instance Control Block
407 * @param[in] pst Post structure
408 * @param[in] cfm RLC LM structure
409 * @param[in] type Type of LM message
410 * @param[in] hdr Message header
415 static Void rlcLmmSendCfm
424 Pst rPst; /* Reply post structure */
426 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
428 /* reply post structure for confirmation */
431 rPst.srcEnt = gCb->init.ent;
432 rPst.srcInst = gCb->init.inst;
433 cfm->hdr.entId.ent = gCb->init.ent;
434 cfm->hdr.entId.inst = gCb->init.inst;
438 rPst.srcEnt = pst->dstEnt;
439 rPst.srcInst = pst->dstInst;
440 cfm->hdr.entId.ent = pst->dstEnt;
441 cfm->hdr.entId.inst = pst->dstInst;
443 rPst.srcProcId = SFndProcId();
444 rPst.dstEnt = pst->srcEnt;
445 rPst.dstInst = pst->srcInst;
446 rPst.dstProcId = pst->srcProcId;
447 rPst.selector = hdr->response.selector;
448 rPst.prior = hdr->response.prior;
449 rPst.route = hdr->response.route;
450 rPst.region = hdr->response.mem.region;
451 rPst.pool= hdr->response.mem.pool;
453 /* Fill the reply header */
454 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
455 cfm->hdr.transId = hdr->transId;
460 RlcMiRlcConfigCfm(&rPst,cfm);
463 SGetDateTime(&(cfm->t.cntrl.dt));
464 RlcMiLkwCntrlCfm(&rPst,cfm);
467 SGetDateTime(&(cfm->t.sts.dt));
468 RlcMiLkwStsCfm(&rPst,0,cfm);
471 SGetDateTime(&(cfm->t.ssta.dt));
472 RlcMiLkwStaCfm(&rPst,cfm);
475 #if (ERRCLASS & ERRCLS_INT_PAR)
476 RLOG0(L_ERROR, "Received Invalid Message Type");
481 #endif /* ERRCLASS & ERRCLS_INT_PAR */
491 * This function processes configuration requests received from the layer
495 * The configuration requests can be for general configuration, or
496 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
497 * request can be determined from the elmId field in the header of the layer
498 * manager message.This function is called by the layer manager to configure
501 * This function implements the following logic:
503 * - if genCfg is not done, send negative Cfm to the layer manager;
505 * - switch (cfg->hdr.elmId.elmnt)
507 * - update the genCfg field in RlCb;
508 * - allocate the maximum static memory required by the RLC product;
509 * - register the timer service by calling SReqTmr;
510 * - set CfgDone for not configuring again;
512 * - if all the parameters are valid, then allocate the KwuSap control
514 * - update the SAP control block with the information provided in the
515 * - configuration request;
516 * - send configuration confirm with the status, success;
518 * - if all the parametes are valid, then allocate the CkwSap control
520 * - update the SAP control block with the information provided in the
521 * configuration request;
522 * - send configuration confirm with the status, success;
524 * - if all the parametes are valid, then allocate the rguSap control
526 * - update the SAP control block with the information provided in the
527 * configuration request;
528 * - send configuration confirm with the status, success;
530 * - if all the parametes are valid, then allocate the udxSap control
532 * - update the SAP control block with the information provided in the
533 * configuration request;
534 * - send configuration confirm with the status, success;
537 * @param[in] pst post structure
538 * @param[in] cfg LM management structure
542 * -# Failure : RFAILED
545 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
547 Reason reason; /* failure reason */
550 #if (ERRCLASS & ERRCLS_INT_PAR)
551 /* Check if the instance is configured */
552 if (pst->dstInst >= MAX_RLC_INSTANCES)
554 cfg->cfm.status = LCM_PRIM_NOK;
555 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
556 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
561 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
565 cfg->cfm.status = LCM_PRIM_NOK;
566 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
567 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
570 /* check configuration is done or not */
571 if ((tRlcCb->init.cfgDone != TRUE) &&
572 (cfg->hdr.elmId.elmnt != STGEN))
575 * if general config is not over then use pst structure
576 * in primitive to communicate to stack manager
579 cfg->cfm.status = LCM_PRIM_NOK;
580 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
581 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
585 RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
587 switch(cfg->hdr.elmId.elmnt)
591 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
596 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
601 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
606 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
611 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
616 reason = LCM_REASON_INVALID_ELMNT;
621 if (reason == LCM_REASON_NOT_APPL)
623 cfg->cfm.status = LCM_PRIM_OK;
624 cfg->cfm.reason = LCM_REASON_NOT_APPL;
625 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
630 cfg->cfm.status = LCM_PRIM_NOK;
631 cfg->cfm.reason = reason;
632 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
639 * The layer manager initiates and uses the management-control procedure to
640 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
641 * can be called more than once and at any time after the
642 * management-configuration procedure.The control request primitive
643 * is confirmed by a RlcMiLkwCntrlCfm primitive.
646 * This function implements the following logic:
648 * - if(cfgDone = FALSE)
649 * - send negative confirmation to the layer manager;
652 * - switch(cntrl->hdr.elmId.elmnt)
656 * - switch(subAction)
658 * - enable the unsolicited status flag;
659 * - send the control Cfm with success;
661 * - set the debug mask;
662 * - send the control Cfm with success;
664 * - enable the trace flag;
665 * - send the control Cfm with success;
667 * - switch(subAction)
669 * - disable the unsolicited status flag;
670 * - send the control Cfm with success;
672 * - disable the trace flag;
673 * - send the control Cfm with success;
682 * @param[in] pst post structure
683 * @param[in] cntrl LM management structure
689 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
691 Reason reason; /* failure reason */
694 #if (ERRCLASS & ERRCLS_INT_PAR)
695 /* Check if the instance is configured */
696 if (pst->dstInst >= MAX_RLC_INSTANCES)
698 cntrl->cfm.status = LCM_PRIM_NOK;
699 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
701 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
706 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
710 cntrl->cfm.status = LCM_PRIM_NOK;
711 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
712 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
716 if (!(tRlcCb->init.cfgDone))
718 cntrl->cfm.status = LCM_PRIM_NOK;
719 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
720 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
723 RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
725 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
726 * In all error cases appropriate reason is returned
727 * by the functions below
730 switch (cntrl->hdr.elmId.elmnt)
734 /* general control */
735 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
740 /* Lower SAP control */
741 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
747 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
752 reason = LCM_REASON_INVALID_ELMNT;
757 if (reason == LCM_REASON_NOT_APPL)
759 cntrl->cfm.status = LCM_PRIM_OK;
760 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
764 cntrl->cfm.status = LCM_PRIM_NOK;
765 cntrl->cfm.reason = reason;
768 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
775 * This function processes solicited status requests received from the layer
776 * manager. The layer manager can request status information regarding the
777 * system ID, RGUSAP,KWUSAP, or CKWSAP.
779 * @param[in] pst post structure
780 * @param[in] sta LM management structure
785 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
787 RlcMngmt rSta; /* Status */
788 Reason reason; /* Failure reason */
791 #if (ERRCLASS & ERRCLS_INT_PAR)
792 /* Check if the instance is configured */
793 if (pst->dstInst >= MAX_RLC_INSTANCES)
795 sta->cfm.status = LCM_PRIM_NOK;
796 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
798 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
803 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
806 sta->cfm.status = LCM_PRIM_NOK;
807 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
809 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
813 RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
815 reason = LCM_REASON_NOT_APPL;
817 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
818 switch (sta->hdr.elmId.elmnt)
822 reason = LCM_REASON_NOT_APPL;
823 rlcGetSId(&rSta.t.ssta.s.sysId);
828 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
829 &sta->t.ssta.s.rlckwuSap,
830 sizeof (RlcKwuSapSta));
832 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
837 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
838 &sta->t.ssta.s.rguSap,
839 sizeof (RlcRguSapSta));
841 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
846 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
847 &sta->t.ssta.s.ckwSap,
848 sizeof (RlcCkwCntSapSta));
850 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
855 reason = LCM_REASON_INVALID_ELMNT;
858 } /* end of switch */
860 if (reason == LCM_REASON_NOT_APPL)
862 rSta.cfm.status = LCM_PRIM_OK;
863 rSta.cfm.reason = LCM_REASON_NOT_APPL;
867 rSta.cfm.status = LCM_PRIM_NOK;
868 rSta.cfm.reason = reason;
870 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
877 * This function processes statistics requests received from the layer
881 * After collecting the statistics, ir calls the statistics confirm function
882 * to send the statistics to the layer manager.
884 * - switch(sts->hdr.elmId.elmnt)
886 * - get the general statistics from the KW control block;
887 * - if (action = RESET)
888 * - reset the general statistic field in the RlCb;
889 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
893 * - get the SAP specific statistics from KW control block;
894 * - if (action = RESET)
895 * - reset the general statistic field in the RlCb;
896 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
899 * @param[in] pst post structure
900 * @param[in] action action
901 * @param[in] sts LM management structure
907 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
909 RlcMngmt rSts; /* Statistics */
910 Reason reason; /* Reason for failure */
913 #if (ERRCLASS & ERRCLS_INT_PAR)
914 /* Check if the instance is configured */
915 if (pst->dstInst >= MAX_RLC_INSTANCES)
917 rSts.cfm.status = LCM_PRIM_NOK;
918 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
920 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
925 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
928 rSts.cfm.status = LCM_PRIM_NOK;
929 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
931 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
935 RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
937 sts->hdr.elmId.elmnt);
939 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
941 switch (sts->hdr.elmId.elmnt)
945 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
951 if( sts->hdr.elmId.elmnt == STKWUSAP)
953 /* kw005.201, modified the element of rlckwuSap from suId to spId */
954 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
956 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
961 reason = LCM_REASON_INVALID_ELMNT;
966 if (reason == LCM_REASON_NOT_APPL)
968 rSts.cfm.status = LCM_PRIM_OK;
969 rSts.cfm.reason = LCM_REASON_NOT_APPL;
973 rSts.cfm.status = LCM_PRIM_NOK;
974 rSts.cfm.reason = reason;
976 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
981 /* kw005.201 added support for L2 Measurement */
985 This function processes L2 Measurement requests received from the layer manager.
986 The L2 Measurement is start for a time period and after the timer expiry, the
987 measurement confirm is sent.
989 - Accept only one set of measurements.
990 - Allocate and initialise RlcL2MeasEvtCb.
991 - Validate if the measurement is already in progress.
992 - Loop through the existing measEvtCb with matching measType
993 - Check if measurement is running for any qci present in the measReq
994 - If present, move the qCi to list of invalid qCIs.
995 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
996 - For the number of measurements requested.
997 - For all Ues with RBs matching qCI.
998 - Add RbCb to the RB linked list.
999 - Set rlcRbCb.measOn to measurement type.
1000 - If Meas type is DL_DELAY
1001 - Update COUNT to startCount.
1004 * @param[in] pst post structure
1005 * @param[in] action action
1006 * @param[in] cfg LM management structure
1009 * -# Failure : RFAILED
1011 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1016 RlcL2MeasCfmEvt measCfmEvt;
1020 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1022 /* Initialize measCfmEvt */
1023 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1024 /* validate the received measReqEvt */
1025 /*LTE_L2_MEAS_PHASE2*/
1026 if(measReqEvt->measPeriod != 0)
1028 /* L2 MEAS AGHOSH */
1029 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1030 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1032 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1037 #if (ERRCLASS & ERRCLS_ADD_RES)
1038 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1039 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1040 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1045 measType = measReqEvt->measReq.measType;
1047 if((measType != LKW_L2MEAS_DL_IP) &&
1048 (measType != LKW_L2MEAS_ACT_UE) &&
1049 (measType != LKW_L2MEAS_DL_DISC) &&
1050 (measType != LKW_L2MEAS_DL_DELAY) &&
1051 (measType != LKW_L2MEAS_UU_LOSS) &&
1052 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1054 measCfmEvt.transId = measReqEvt->transId;
1055 measCfmEvt.measType = measType;
1056 measCfmEvt.status.status = LCM_PRIM_NOK;
1057 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1058 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1059 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1063 /* for UL IP throughput meas enable for all QCIs */
1064 if(measType & LKW_L2MEAS_UL_IP)
1066 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1068 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1073 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1074 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1076 RlcL2MeasReqEvt *measEvt;
1079 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1081 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1084 sizeof(RlcL2MeasReqEvt));
1086 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1087 if(measEvt == NULLP)
1089 RLOG0(L_FATAL,"Memory Allocation failed");
1093 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1094 /*Redirect the request to DL task */
1095 /* NOTE:As of today, there are no cases where the Req will fail at DL
1096 as long as it reached the DL, so we don't wait for a confirmation from
1097 DL to send the confirmation to LM*/
1098 /* The interface for sending a confirmation back does not exist today;
1099 it needs to be created when the need arises */
1100 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1103 /* We need to copy the transId for sending back confirms later */
1104 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1106 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1107 if(measEvtCb->measCb.measType & measType)
1109 measEvtCb->transId= measReqEvt->transId;
1112 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1115 } /* RlcMiLkwL2MeasReq */
1119 This function processes L2 Measurement stop request received from the layer manager.
1120 After receving this request, RLC stops L2 Measurement
1121 * @param[in] pst post structure
1122 * @param[in] measType meas Type
1125 * -# Failure : RFAILED
1128 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1131 RlcL2MeasEvtCb *measEvtCb = NULLP;
1134 uint8_t status = ROK;
1137 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1139 /* reset the counter values for the measurement that is stopped */
1140 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1142 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1143 if(measEvtCb->measCb.measType & measType)
1145 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1150 /* for UL IP throughput meas disable for all QCIs */
1151 if(measType & LKW_L2MEAS_UL_IP)
1153 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1155 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1159 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1160 || (measType & LKW_L2MEAS_DL_DELAY))
1162 /*Redirect the request to DL task */
1163 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1166 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1168 status = LCM_PRIM_OK;
1169 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1175 This function processes L2 Measurement Send request received from the layer manager.
1176 After receving this request, RLC sends L2 Measurement
1177 * @param[in] pst post structure
1178 * @param[in] measType meas Type
1181 * -# Failure : RFAILED
1184 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1187 RlcL2MeasEvtCb *measEvtCb = NULLP;
1191 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1193 /* In case of addition of any new measType here ,appropriate handling
1194 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1196 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1197 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1199 /*Redirect the request to DL task */
1200 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1201 /* L2 MEAS AGHOSH */
1205 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1207 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1208 /* L2 MEAS AGHOSH */
1209 if(measEvtCb->measCb.measType & measType)
1211 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1217 #endif /* LTE_L2_MEAS */
1221 * This function configures the RLC data sap
1223 * @param[in] gCb RLC Instance Control Block
1224 * @param[in] cfg RLC LM Sap configuration structure
1227 * -# LCM_REASON_NOT_APPL (SUCCESS)
1228 * -# LCM_REASON_INVALID_SAP
1229 * -# LCM_REASON_MEM_NOAVAIL
1230 * -# LCM_REASON_RECONFIG_FAIL
1232 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1234 RlcKwuSapCb *rlcKwuSapCb;
1236 #if (ERRCLASS & ERRCLS_INT_PAR)
1237 /* Validate the protocol parameters */
1238 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1240 return (LCM_REASON_INVALID_PAR_VAL);
1242 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1244 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1245 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1246 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1248 #if (ERRCLASS & ERRCLS_INT_PAR)
1249 /* Check for reconfiguration */
1250 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1252 RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1253 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1254 /* reconfiguration not allowed */
1255 return (LCM_REASON_RECONFIG_FAIL);
1257 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1259 /* Fill the parameters */
1260 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1262 return (LCM_REASON_NOT_APPL);
1267 * This function configures the RLC control sap
1269 * @param[in] gCb RLC Instance Control Block
1270 * @param[in] cfg RLC LM Sap configuration structure
1273 * -# LCM_REASON_NOT_APPL (SUCCESS)
1274 * -# LCM_REASON_INVALID_SAP
1275 * -# LCM_REASON_INVALID_SAP
1276 * -# LCM_REASON_RECONFIG_FAIL
1278 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1280 RlcCkwSapCb *ckwSap;
1282 #if (ERRCLASS & ERRCLS_INT_PAR)
1283 /* Validate config parameters */
1284 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1286 return (LCM_REASON_INVALID_PAR_VAL);
1289 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1291 /* Get Sap control block */
1292 return (LCM_REASON_INVALID_PAR_VAL);
1296 ckwSap = &(gCb->u.ulCb->ckwSap);
1298 #if (ERRCLASS & ERRCLS_INT_PAR)
1299 /* Check for reconfiguration */
1300 if(ckwSap->state != RLC_SAP_NOT_CFG)
1302 RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
1303 return (LCM_REASON_RECONFIG_FAIL);
1305 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1307 /* Fill the parameters */
1308 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1310 return (LCM_REASON_NOT_APPL);
1315 * This function configures the UDX sap
1317 * @param[in] gCb RLC Instance Control Block
1318 * @param[in] cfg RLC LM Sap configuration structure
1321 * -# LCM_REASON_NOT_APPL (SUCCESS)
1322 * -# LCM_REASON_INVALID_SAP
1323 * -# LCM_REASON_INVALID_SAP
1324 * -# LCM_REASON_RECONFIG_FAIL
1326 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1328 RlcUdxDlSapCb *udxDlSap;
1329 RlcUdxUlSapCb *udxUlSap;
1331 #if (ERRCLASS & ERRCLS_INT_PAR)
1332 /* Validate the protocol parameters */
1333 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1335 return (LCM_REASON_INVALID_PAR_VAL);
1338 /* Get Sap control block */
1339 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1341 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1342 #if (ERRCLASS & ERRCLS_INT_PAR)
1343 /* Check for reconfiguration */
1344 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1346 RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
1347 return (LCM_REASON_RECONFIG_FAIL);
1349 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1351 /* Fill the parameters */
1352 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1356 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1358 #if (ERRCLASS & ERRCLS_INT_PAR)
1359 /* Check for reconfiguration */
1360 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1362 RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
1363 return (LCM_REASON_RECONFIG_FAIL);
1365 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1367 /* Fill the parameters */
1368 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1370 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1371 udxUlSap->retryCnt = 0;
1372 cmInitTimers(&(udxUlSap->bndTmr), 1);
1375 return (LCM_REASON_NOT_APPL);
1380 * This function configures the RGU sap
1382 * @param[in] gCb RLC Instance Control Block
1383 * @param[in] cfg RLC LM Sap configuration structure
1385 * -# LCM_REASON_NOT_APPL (SUCCESS)
1386 * -# LCM_REASON_INVALID_SAP
1387 * -# LCM_REASON_INVALID_SAP
1388 * -# LCM_REASON_RECONFIG_FAIL
1390 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1392 RlcRguSapCb *rguSap;
1394 #if (ERRCLASS & ERRCLS_INT_PAR)
1395 /* Validate the protocol parameters */
1396 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1399 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1400 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1401 return (LCM_REASON_INVALID_PAR_VAL);
1405 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1406 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1408 #if (ERRCLASS & ERRCLS_INT_PAR)
1409 /* Check for reconfiguration */
1410 if(rguSap->state != RLC_SAP_NOT_CFG)
1412 RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
1413 gCb->genCfg.rlcMode, rguSap->state);
1414 return (LCM_REASON_RECONFIG_FAIL);
1416 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1418 /* Fill the parameters */
1419 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1420 rguSap->suId = cfg->sapId;
1421 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1422 rguSap->retryCnt = 0;
1423 rguSap->state = RLC_SAP_CFG;
1425 cmInitTimers(&(rguSap->bndTmr), 1);
1427 return (LCM_REASON_NOT_APPL);
1432 * Validates the RLC general control parameters
1434 * @param[in] cntrl RLC LM structure
1437 * -# LCM_REASON_NOT_APPL (SUCCESS)
1438 * -# LCM_REASON_INVALID_SUBACTION
1439 * -# LCM_REASON_INVALID_ACTION
1441 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1443 S16 reason; /* reason for failure */
1444 uint8_t sAction; /* subaction field */
1446 reason = LCM_REASON_NOT_APPL;
1447 sAction = cntrl->t.cntrl.subAction;
1449 switch (cntrl->t.cntrl.action)
1453 if ((sAction != SAUSTA) &&
1454 (sAction != SADBG) &&
1457 reason = LCM_REASON_INVALID_SUBACTION;
1463 reason = LCM_REASON_INVALID_ACTION;
1472 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1474 * @param[in] gCb RLC Instance Control Block
1478 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1483 if (gCb->init.cfgDone)
1485 /* Deregister the timers */
1486 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1487 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1488 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1489 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1490 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1492 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1494 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1496 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1499 gCb->u.dlCb->shutdownReceived = TRUE;
1500 rlcUtlFreeDlMemory(gCb);
1501 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1503 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1506 if(gCb->u.dlCb->udxDlSap != NULLP)
1508 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1511 if(gCb->u.dlCb->rguDlSap != NULLP)
1513 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1514 gCb->genCfg.maxRguSaps = 0;
1516 if (gCb->u.dlCb->shutdownReceived)
1518 if (gCb->u.dlCb->selfPstMBuf != NULL)
1520 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1522 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1529 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1532 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1534 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1537 if(gCb->u.ulCb->udxUlSap != NULLP)
1539 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1542 if(gCb->u.ulCb->rguUlSap != NULLP)
1544 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1545 gCb->genCfg.maxRguSaps = 0;
1548 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1552 gCb->init.cfgDone = FALSE;
1553 gCb->init.acnt = FALSE;
1554 gCb->init.trc = FALSE;
1556 gCb->init.usta = FALSE;
1564 * Delete all SAPs and Control Blocks
1567 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1568 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1569 * control blocks and lists.
1571 * @params[in] gCb RLC instance control block
1574 * -# LCM_REASON_NOT_APPL (SUCCESS)
1575 * -# LCM_REASON_HASHING_FAILED
1577 static S16 rlcLmmShutdown(RlcCb *gCb)
1579 RlcRguSapCb *rguSap;
1582 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1584 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1586 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1587 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1589 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1595 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1597 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1598 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1600 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1605 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1607 rlcDbmDlShutdown(gCb);
1611 rlcDbmUlShutdown(gCb);
1614 rlcLmmCleanGblRsrcs(gCb);
1616 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1618 return (LCM_REASON_NOT_APPL);
1623 * Function processes the general control request
1625 * @param[in] gCb RLC instance control block
1626 * @param[in] cntrl RLC LM structure
1629 * -# LCM_REASON_NOT_APPL (SUCCESS)
1630 * -# LCM_REASON_INVALID_SUBACTION
1631 * -# LCM_REASON_INVALID_ACTION
1633 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1635 RlcTrcCntrl *trcCntrl; /* trace */
1637 RlcDbgCntrl *dbgCntrl; /* debug */
1639 S16 reason; /* reason for failure */
1641 /* Validate control parameters */
1642 reason = rlcLmmValidateGenCntrl (cntrl);
1644 if (reason != LCM_REASON_NOT_APPL)
1649 switch(cntrl->t.cntrl.action)
1653 switch(cntrl->t.cntrl.subAction)
1657 RLC_SET_USTA_FLAG(gCb, TRUE);
1663 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1664 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1670 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1671 gCb->init.trc = TRUE;
1672 gCb->trcLen = trcCntrl->trcLen;
1673 (gCb->trcMask) |= trcCntrl->trcMask;
1681 switch(cntrl->t.cntrl.subAction)
1685 gCb->init.usta = FALSE;
1691 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1692 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1698 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1699 gCb->init.trc = FALSE;
1700 gCb->trcMask &= ~(trcCntrl->trcMask);
1708 reason = rlcLmmShutdown(gCb);
1717 * Bind/Unbind RLC UDX sap
1719 * @param[in] gCb RLC Instance Control Block
1720 * @param[in] cntrl RLC LM structure
1723 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1724 * -# LCM_REASON_INVALID_SAP
1725 * -# LCM_REASON_INVALID_STATE
1726 * -# LCM_REASON_INVALID_ACTION
1728 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1731 #if (ERRCLASS & ERRCLS_INT_PAR)
1732 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1734 return (LCM_REASON_INVALID_SAP);
1737 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1738 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1740 return (LCM_REASON_INVALID_SAP);
1742 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1744 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1745 #if (ERRCLASS & ERRCLS_INT_PAR)
1747 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1749 RLOG0(L_ERROR,"udxUlSap not configured yet");
1750 return (LCM_REASON_INVALID_STATE);
1752 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1754 switch(cntrl->t.cntrl.action)
1758 if(UDX_SAP.state != RLC_SAP_BND)
1760 /* start timer to wait for bind confirm */
1761 rlcStartTmr(gCb,(PTR)(&UDX_SAP), RLC_EVT_WAIT_BNDCFM);
1762 UDX_SAP.state = RLC_SAP_BINDING;
1763 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1767 /* control request received for an already bound SAP */
1768 return (LCM_REASON_INVALID_STATE);
1774 /* make the state of UDXSAP configured but not bound */
1775 UDX_SAP.state = RLC_SAP_CFG;
1776 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1780 return (LCM_REASON_INVALID_ACTION);
1782 } /* end of switch */
1784 return (LCM_REASON_NOT_APPL);
1789 * Bind/Unbind RLC lower sap
1791 * @param[in] gCb RLC Instance Control Block
1792 * @param[in] cntrl RLC LM structure
1794 * -# LCM_REASON_NOT_APPL (SUCCESS)
1795 * -# LCM_REASON_INVALID_SAP
1796 * -# LCM_REASON_INVALID_STATE
1797 * -# LCM_REASON_INVALID_ACTION
1799 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1801 RlcRguSapCb *rguSap; /* rgu sap pointer */
1803 #if (ERRCLASS & ERRCLS_INT_PAR)
1805 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1806 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1808 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1809 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1810 return (LCM_REASON_INVALID_SAP);
1812 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1813 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1814 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1815 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1817 #if (ERRCLASS & ERRCLS_INT_PAR)
1819 if(rguSap->state == RLC_SAP_NOT_CFG)
1821 RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1822 return (LCM_REASON_INVALID_STATE);
1824 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1826 switch(cntrl->t.cntrl.action)
1830 if(rguSap->state != RLC_SAP_BND)
1832 /* start timer to wait for bind confirm */
1833 rlcStartTmr(gCb,(PTR)(rguSap), RLC_EVT_WAIT_BNDCFM);
1834 rguSap->state = RLC_SAP_BINDING;
1835 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1836 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1837 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1841 /* control request received for an already bound SAP */
1842 return (LCM_REASON_INVALID_STATE);
1848 /* make the state of RGUSAP is configure but not bound */
1849 rguSap->state = RLC_SAP_CFG;
1850 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1854 return (LCM_REASON_INVALID_ACTION);
1856 } /* end of switch */
1858 return (LCM_REASON_NOT_APPL);
1863 * Function gather the general KWU SAP status
1865 * @param[in] gCb RLC Instance Control Block
1866 * @param[in] sta LM KWU Sap Status structure
1869 * -# LCM_REASON_NOT_APPL (SUCCESS)
1870 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1872 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1874 RlcKwuSapCb *rlcKwSapCb;
1876 #if (ERRCLASS & ERRCLS_INT_PAR)
1877 /* Validate the protocol parameters */
1878 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1881 return (LCM_REASON_INVALID_PAR_VAL);
1885 /* Get Sap control block */
1886 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1887 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1888 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1890 sta->state = rlcKwSapCb->state;
1892 return (LCM_REASON_NOT_APPL);
1897 * Function gather the general RGU SAP status
1899 * @param[in] gCb RLC Instance Control Block
1900 * @param[in] sta LM RGU Sap Status structure
1902 * -# LCM_REASON_NOT_APPL (SUCCESS)
1903 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1905 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1908 #if (ERRCLASS & ERRCLS_INT_PAR)
1909 /* Validate the protocol parameters */
1910 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1912 return (LCM_REASON_INVALID_PAR_VAL);
1916 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1917 gCb->u.dlCb->rguDlSap[sta->suId].state :
1918 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1920 return (LCM_REASON_NOT_APPL);
1925 * Function gather the general CKW SAP status
1927 * @param[in] gCb RLC Instance Control Block
1928 * @param[in] sta LM CKW Sap Status structure
1930 * -# LCM_REASON_NOT_APPL (SUCCESS)
1931 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1933 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1936 #if (ERRCLASS & ERRCLS_INT_PAR)
1937 /* Validate config parameters */
1938 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1940 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1942 return (LCM_REASON_INVALID_PAR_VAL);
1945 sta->state = gCb->u.ulCb->ckwSap.state;
1947 return (LCM_REASON_NOT_APPL);
1953 * Gather the general statistics
1955 * @param[in] gCb RLC Instance Control Block
1956 * @param[in] sts LM general statistics structure
1957 * @param[in] action action
1959 * -# LCM_REASON_NOT_APPL (SUCCESS)
1960 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1962 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1965 #if (ERRCLASS & ERRCLS_INT_PAR)
1966 /* Validate protocol parameters */
1967 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1969 return (LCM_REASON_INVALID_PAR_VAL);
1975 if(action == LKW_ZEROSTS)
1977 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1980 return (LCM_REASON_NOT_APPL);
1985 * Gather the SAP statistics
1987 * @param[in] gCb RLC Instance Control Block
1988 * @param[in] sts LM general statistics structure
1989 * @param[in] elmnt element
1990 * @param[in] action action
1993 * -# LCM_REASON_NOT_APPL (SUCCESS)
1994 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1996 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
1999 /* Validate protocol parameters */
2000 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2002 return (LCM_REASON_INVALID_PAR_VAL);
2008 RlcKwuSapSts *rlckwuSap;
2009 RlcKwuSapCb *rlcKwuSapCb;
2010 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2012 /* Get Sap control block */
2013 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2014 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2015 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2016 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2019 *rlckwuSap = rlcKwuSapCb->sts;
2021 if (action == LKW_ZEROSTS)
2023 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2027 /* kw005.201 removed RGUSAP statistics support */
2030 RlcCkwCntSts *ckwSap;
2031 ckwSap = &sts->t.sts.s.ckwSap;
2032 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2034 return (LCM_REASON_INVALID_PAR_VAL);
2037 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2039 if (action == LKW_ZEROSTS)
2041 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2046 return (LCM_REASON_INVALID_ELMNT);
2049 SGetDateTime(&sts->t.sts.dt);
2051 return (LCM_REASON_NOT_APPL);
2056 * This function sends Unsolicited Status Indication to the Layer Management
2059 * @param[in] gCb RLC Instance Control Block
2060 * @param[in] category Category
2061 * @param[in] event event
2062 * @param[in] cause cause
2063 * @param[in] UeId ueId
2064 * @param[in] Qci qci
2069 Void rlcLmmSendAlarm
2079 #else /* LTE_L2_MEAS */
2080 Void rlcLmmSendAlarm
2089 #endif /* LTE_L2_MEAS */
2091 RlcMngmt usta; /* Rlc Management Structure */
2093 if(gCb->init.usta == FALSE)
2098 usta.hdr.elmId.elmnt = STGEN;
2099 usta.hdr.entId.ent = gCb->init.ent;
2100 usta.hdr.entId.inst = gCb->init.inst;
2102 /* fill in the event and category */
2103 usta.t.usta.alarm.category = category;
2104 usta.t.usta.alarm.event = event;
2105 usta.t.usta.alarm.cause = cause;
2107 /* set the suId and ueId */
2108 usta.t.usta.ueId = ueId;
2109 usta.t.usta.suId = suId;
2110 /* kw005.201 added support for L2 Measurement */
2112 if(event == LKW_EVT_MEAS_HALT)
2114 usta.t.usta.qci = qci;
2116 #endif /* LTE_L2_MEAS */
2117 /* update the date and time */
2118 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2120 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2128 * This function sends trace indication to LM
2130 * @param[in] gCb RLC Instance Control Block
2131 * @param[in] event event
2132 * @param[in] mBuf meessage buffer
2138 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2140 RlcMngmt trc; /* RLC management control block */
2147 RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2151 memset(&trc, 0, sizeof(RlcMngmt));
2153 pst = gCb->init.lmPst;
2155 trc.t.trc.event = event;
2156 SGetDateTime(&trc.t.trc.dt);
2157 trc.cfm.status = LCM_PRIM_OK;
2158 trc.cfm.reason = LCM_REASON_NOT_APPL;
2162 /* Check if the whole buffer is to be sent in Trace indication */
2163 if(gCb->trcLen == LKW_FULL_TRACE)
2165 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2168 /* rg005.201 removed SPutSBuf on error */
2169 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2172 /* Send Trace Indication to Layer manager */
2173 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2175 /* check if only a specified number of bytes are to be sent */
2176 else if(gCb->trcLen > 0)
2178 /* Get the length of the recvd message buffer */
2179 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2181 RLOG0(L_ERROR,"SFndLenMsg Failed");
2184 /* Check if the recvd buffer size is less than request trace len */
2185 if(bufLen < gCb->trcLen)
2187 /* Copy the whole of the recvd buffer in trace indication */
2189 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2192 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2196 /* Send Trace Indication to Layer manager */
2197 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2201 /* if the recvd buffer size is greater than request trace len */
2202 /* Get a temporary buffer to store the msg */
2203 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2205 #if (ERRCLASS & ERRCLS_INT_PAR)
2206 if(tempBuf == NULLP)
2208 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2210 RLOG0(L_FATAL,"Memory Allocation failed");
2211 return (LCM_REASON_MEM_NOAVAIL);
2213 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2215 /* Copy trcLen nos of bytes from the recvd message */
2216 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2218 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2222 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2224 RLOG0(L_FATAL,"Memory Allocation failed");
2227 /* Copy the tempBuf data to dst mBuf */
2228 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2230 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2234 /* Free the memory allocated for tempBuf */
2235 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2236 /* Send Trace Indication to Layer manager */
2237 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2243 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2252 * Activate Task - timer
2255 * Invoked by system services to activate a task with a timer tick.
2257 * @param[in] ent entity
2258 * @param[in] inst instance
2266 S16 rlcActvTmr(Ent ent,Inst inst)
2270 if (inst >= MAX_RLC_INSTANCES)
2274 gCb = RLC_GET_RLCCB(inst);
2275 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2278 } /* end of rlcActvTmr */
2281 /********************************************************************30**
2284 **********************************************************************/