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 */
354 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
357 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
358 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
359 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
360 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
362 return (LCM_REASON_REGTMR_FAIL);
366 rlcUtlL2MeasUlInit(gCb);
371 #if (ERRCLASS & ERRCLS_INT_PAR)
372 RLOG0(L_ERROR, "Received Invalid RLC Mode");
373 #endif /* ERRCLASS & ERRCLS_INT_PAR */
375 return (LCM_REASON_INVALID_PAR_VAL);
377 /* Timer Initialization */
378 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
380 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
382 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
384 gCb->init.lmPst.srcProcId = gCb->init.procId;
385 gCb->init.lmPst.srcEnt = gCb->init.ent;
386 gCb->init.lmPst.srcInst = gCb->init.inst;
387 gCb->init.lmPst.event = EVTNONE;
389 /* kw002.201 For multi core and multi region,no need to reinitiailize the
390 * region again . This would be done with kwActvInit from SSI */
391 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
392 gCb->init.region = cfg->lmPst.region;
393 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
394 gCb->init.pool = cfg->lmPst.pool;
396 gCb->init.cfgDone = TRUE;
398 return (LCM_REASON_NOT_APPL);
403 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
405 * @param[in] gCb RLC Instance Control Block
406 * @param[in] pst Post structure
407 * @param[in] cfm RLC LM structure
408 * @param[in] type Type of LM message
409 * @param[in] hdr Message header
414 static Void rlcLmmSendCfm
423 Pst rPst; /* Reply post structure */
425 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
427 /* reply post structure for confirmation */
430 rPst.srcEnt = gCb->init.ent;
431 rPst.srcInst = gCb->init.inst;
432 cfm->hdr.entId.ent = gCb->init.ent;
433 cfm->hdr.entId.inst = gCb->init.inst;
437 rPst.srcEnt = pst->dstEnt;
438 rPst.srcInst = pst->dstInst;
439 cfm->hdr.entId.ent = pst->dstEnt;
440 cfm->hdr.entId.inst = pst->dstInst;
442 rPst.srcProcId = SFndProcId();
443 rPst.dstEnt = pst->srcEnt;
444 rPst.dstInst = pst->srcInst;
445 rPst.dstProcId = pst->srcProcId;
446 rPst.selector = hdr->response.selector;
447 rPst.prior = hdr->response.prior;
448 rPst.route = hdr->response.route;
449 rPst.region = hdr->response.mem.region;
450 rPst.pool= hdr->response.mem.pool;
452 /* Fill the reply header */
453 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
454 cfm->hdr.transId = hdr->transId;
459 RlcMiRlcConfigCfm(&rPst,cfm);
462 SGetDateTime(&(cfm->t.cntrl.dt));
463 RlcMiLkwCntrlCfm(&rPst,cfm);
466 SGetDateTime(&(cfm->t.sts.dt));
467 RlcMiLkwStsCfm(&rPst,0,cfm);
470 SGetDateTime(&(cfm->t.ssta.dt));
471 RlcMiLkwStaCfm(&rPst,cfm);
474 #if (ERRCLASS & ERRCLS_INT_PAR)
475 RLOG0(L_ERROR, "Received Invalid Message Type");
480 #endif /* ERRCLASS & ERRCLS_INT_PAR */
490 * This function processes configuration requests received from the layer
494 * The configuration requests can be for general configuration, or
495 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
496 * request can be determined from the elmId field in the header of the layer
497 * manager message.This function is called by the layer manager to configure
500 * This function implements the following logic:
502 * - if genCfg is not done, send negative Cfm to the layer manager;
504 * - switch (cfg->hdr.elmId.elmnt)
506 * - update the genCfg field in RlCb;
507 * - allocate the maximum static memory required by the RLC product;
508 * - register the timer service by calling SReqTmr;
509 * - set CfgDone for not configuring again;
511 * - if all the parameters are valid, then allocate the KwuSap control
513 * - update the SAP control block with the information provided in the
514 * - configuration request;
515 * - send configuration confirm with the status, success;
517 * - if all the parametes are valid, then allocate the CkwSap control
519 * - update the SAP control block with the information provided in the
520 * configuration request;
521 * - send configuration confirm with the status, success;
523 * - if all the parametes are valid, then allocate the rguSap control
525 * - update the SAP control block with the information provided in the
526 * configuration request;
527 * - send configuration confirm with the status, success;
529 * - if all the parametes are valid, then allocate the udxSap control
531 * - update the SAP control block with the information provided in the
532 * configuration request;
533 * - send configuration confirm with the status, success;
536 * @param[in] pst post structure
537 * @param[in] cfg LM management structure
541 * -# Failure : RFAILED
544 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
546 Reason reason; /* failure reason */
549 #if (ERRCLASS & ERRCLS_INT_PAR)
550 /* Check if the instance is configured */
551 if (pst->dstInst >= MAX_RLC_INSTANCES)
553 cfg->cfm.status = LCM_PRIM_NOK;
554 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
555 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
560 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
564 cfg->cfm.status = LCM_PRIM_NOK;
565 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
566 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
569 /* check configuration is done or not */
570 if ((tRlcCb->init.cfgDone != TRUE) &&
571 (cfg->hdr.elmId.elmnt != STGEN))
574 * if general config is not over then use pst structure
575 * in primitive to communicate to stack manager
578 cfg->cfm.status = LCM_PRIM_NOK;
579 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
580 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
584 RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
586 switch(cfg->hdr.elmId.elmnt)
590 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
595 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
600 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
605 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
610 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
615 reason = LCM_REASON_INVALID_ELMNT;
620 if (reason == LCM_REASON_NOT_APPL)
622 cfg->cfm.status = LCM_PRIM_OK;
623 cfg->cfm.reason = LCM_REASON_NOT_APPL;
624 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
629 cfg->cfm.status = LCM_PRIM_NOK;
630 cfg->cfm.reason = reason;
631 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
638 * The layer manager initiates and uses the management-control procedure to
639 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
640 * can be called more than once and at any time after the
641 * management-configuration procedure.The control request primitive
642 * is confirmed by a RlcMiLkwCntrlCfm primitive.
645 * This function implements the following logic:
647 * - if(cfgDone = FALSE)
648 * - send negative confirmation to the layer manager;
651 * - switch(cntrl->hdr.elmId.elmnt)
655 * - switch(subAction)
657 * - enable the unsolicited status flag;
658 * - send the control Cfm with success;
660 * - set the debug mask;
661 * - send the control Cfm with success;
663 * - enable the trace flag;
664 * - send the control Cfm with success;
666 * - switch(subAction)
668 * - disable the unsolicited status flag;
669 * - send the control Cfm with success;
671 * - disable the trace flag;
672 * - send the control Cfm with success;
681 * @param[in] pst post structure
682 * @param[in] cntrl LM management structure
688 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
690 Reason reason; /* failure reason */
693 #if (ERRCLASS & ERRCLS_INT_PAR)
694 /* Check if the instance is configured */
695 if (pst->dstInst >= MAX_RLC_INSTANCES)
697 cntrl->cfm.status = LCM_PRIM_NOK;
698 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
700 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
705 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
709 cntrl->cfm.status = LCM_PRIM_NOK;
710 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
711 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
715 if (!(tRlcCb->init.cfgDone))
717 cntrl->cfm.status = LCM_PRIM_NOK;
718 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
719 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
722 RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
724 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
725 * In all error cases appropriate reason is returned
726 * by the functions below
729 switch (cntrl->hdr.elmId.elmnt)
733 /* general control */
734 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
739 /* Lower SAP control */
740 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
746 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
751 reason = LCM_REASON_INVALID_ELMNT;
756 if (reason == LCM_REASON_NOT_APPL)
758 cntrl->cfm.status = LCM_PRIM_OK;
759 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
763 cntrl->cfm.status = LCM_PRIM_NOK;
764 cntrl->cfm.reason = reason;
767 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
774 * This function processes solicited status requests received from the layer
775 * manager. The layer manager can request status information regarding the
776 * system ID, RGUSAP,KWUSAP, or CKWSAP.
778 * @param[in] pst post structure
779 * @param[in] sta LM management structure
784 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
786 RlcMngmt rSta; /* Status */
787 Reason reason; /* Failure reason */
790 #if (ERRCLASS & ERRCLS_INT_PAR)
791 /* Check if the instance is configured */
792 if (pst->dstInst >= MAX_RLC_INSTANCES)
794 sta->cfm.status = LCM_PRIM_NOK;
795 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
797 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
802 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
805 sta->cfm.status = LCM_PRIM_NOK;
806 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
808 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
812 RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
814 reason = LCM_REASON_NOT_APPL;
816 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
817 switch (sta->hdr.elmId.elmnt)
821 reason = LCM_REASON_NOT_APPL;
822 rlcGetSId(&rSta.t.ssta.s.sysId);
827 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
828 &sta->t.ssta.s.rlckwuSap,
829 sizeof (RlcKwuSapSta));
831 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
836 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
837 &sta->t.ssta.s.rguSap,
838 sizeof (RlcRguSapSta));
840 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
845 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
846 &sta->t.ssta.s.ckwSap,
847 sizeof (RlcCkwCntSapSta));
849 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
854 reason = LCM_REASON_INVALID_ELMNT;
857 } /* end of switch */
859 if (reason == LCM_REASON_NOT_APPL)
861 rSta.cfm.status = LCM_PRIM_OK;
862 rSta.cfm.reason = LCM_REASON_NOT_APPL;
866 rSta.cfm.status = LCM_PRIM_NOK;
867 rSta.cfm.reason = reason;
869 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
876 * This function processes statistics requests received from the layer
880 * After collecting the statistics, ir calls the statistics confirm function
881 * to send the statistics to the layer manager.
883 * - switch(sts->hdr.elmId.elmnt)
885 * - get the general statistics from the KW control block;
886 * - if (action = RESET)
887 * - reset the general statistic field in the RlCb;
888 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
892 * - get the SAP specific statistics from KW control block;
893 * - if (action = RESET)
894 * - reset the general statistic field in the RlCb;
895 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
898 * @param[in] pst post structure
899 * @param[in] action action
900 * @param[in] sts LM management structure
906 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
908 RlcMngmt rSts; /* Statistics */
909 Reason reason; /* Reason for failure */
912 #if (ERRCLASS & ERRCLS_INT_PAR)
913 /* Check if the instance is configured */
914 if (pst->dstInst >= MAX_RLC_INSTANCES)
916 rSts.cfm.status = LCM_PRIM_NOK;
917 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
919 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
924 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
927 rSts.cfm.status = LCM_PRIM_NOK;
928 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
930 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
934 RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
936 sts->hdr.elmId.elmnt);
938 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
940 switch (sts->hdr.elmId.elmnt)
944 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
950 if( sts->hdr.elmId.elmnt == STKWUSAP)
952 /* kw005.201, modified the element of rlckwuSap from suId to spId */
953 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
955 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
960 reason = LCM_REASON_INVALID_ELMNT;
965 if (reason == LCM_REASON_NOT_APPL)
967 rSts.cfm.status = LCM_PRIM_OK;
968 rSts.cfm.reason = LCM_REASON_NOT_APPL;
972 rSts.cfm.status = LCM_PRIM_NOK;
973 rSts.cfm.reason = reason;
975 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
980 /* kw005.201 added support for L2 Measurement */
984 This function processes L2 Measurement requests received from the layer manager.
985 The L2 Measurement is start for a time period and after the timer expiry, the
986 measurement confirm is sent.
988 - Accept only one set of measurements.
989 - Allocate and initialise RlcL2MeasEvtCb.
990 - Validate if the measurement is already in progress.
991 - Loop through the existing measEvtCb with matching measType
992 - Check if measurement is running for any qci present in the measReq
993 - If present, move the qCi to list of invalid qCIs.
994 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
995 - For the number of measurements requested.
996 - For all Ues with RBs matching qCI.
997 - Add RbCb to the RB linked list.
998 - Set rlcRbCb.measOn to measurement type.
999 - If Meas type is DL_DELAY
1000 - Update COUNT to startCount.
1003 * @param[in] pst post structure
1004 * @param[in] action action
1005 * @param[in] cfg LM management structure
1008 * -# Failure : RFAILED
1010 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1015 RlcL2MeasCfmEvt measCfmEvt;
1019 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1021 /* Initialize measCfmEvt */
1022 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1023 /* validate the received measReqEvt */
1024 /*LTE_L2_MEAS_PHASE2*/
1025 if(measReqEvt->measPeriod != 0)
1027 /* L2 MEAS AGHOSH */
1028 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1029 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1031 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1036 #if (ERRCLASS & ERRCLS_ADD_RES)
1037 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1038 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1039 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1044 measType = measReqEvt->measReq.measType;
1046 if((measType != LKW_L2MEAS_DL_IP) &&
1047 (measType != LKW_L2MEAS_ACT_UE) &&
1048 (measType != LKW_L2MEAS_DL_DISC) &&
1049 (measType != LKW_L2MEAS_DL_DELAY) &&
1050 (measType != LKW_L2MEAS_UU_LOSS) &&
1051 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1053 measCfmEvt.transId = measReqEvt->transId;
1054 measCfmEvt.measType = measType;
1055 measCfmEvt.status.status = LCM_PRIM_NOK;
1056 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1057 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1058 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1062 /* for UL IP throughput meas enable for all QCIs */
1063 if(measType & LKW_L2MEAS_UL_IP)
1065 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1067 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1072 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1073 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1075 RlcL2MeasReqEvt *measEvt;
1078 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1080 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1083 sizeof(RlcL2MeasReqEvt));
1085 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1086 if(measEvt == NULLP)
1088 RLOG0(L_FATAL,"Memory Allocation failed");
1092 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1093 /*Redirect the request to DL task */
1094 /* NOTE:As of today, there are no cases where the Req will fail at DL
1095 as long as it reached the DL, so we don't wait for a confirmation from
1096 DL to send the confirmation to LM*/
1097 /* The interface for sending a confirmation back does not exist today;
1098 it needs to be created when the need arises */
1099 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1102 /* We need to copy the transId for sending back confirms later */
1103 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1105 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1106 if(measEvtCb->measCb.measType & measType)
1108 measEvtCb->transId= measReqEvt->transId;
1111 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1114 } /* RlcMiLkwL2MeasReq */
1118 This function processes L2 Measurement stop request received from the layer manager.
1119 After receving this request, RLC stops L2 Measurement
1120 * @param[in] pst post structure
1121 * @param[in] measType meas Type
1124 * -# Failure : RFAILED
1127 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1130 RlcL2MeasEvtCb *measEvtCb = NULLP;
1133 uint8_t status = ROK;
1136 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1138 /* reset the counter values for the measurement that is stopped */
1139 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1141 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1142 if(measEvtCb->measCb.measType & measType)
1144 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1149 /* for UL IP throughput meas disable for all QCIs */
1150 if(measType & LKW_L2MEAS_UL_IP)
1152 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1154 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1158 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1159 || (measType & LKW_L2MEAS_DL_DELAY))
1161 /*Redirect the request to DL task */
1162 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1165 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1167 status = LCM_PRIM_OK;
1168 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1174 This function processes L2 Measurement Send request received from the layer manager.
1175 After receving this request, RLC sends L2 Measurement
1176 * @param[in] pst post structure
1177 * @param[in] measType meas Type
1180 * -# Failure : RFAILED
1183 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1186 RlcL2MeasEvtCb *measEvtCb = NULLP;
1190 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1192 /* In case of addition of any new measType here ,appropriate handling
1193 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1195 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1196 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1198 /*Redirect the request to DL task */
1199 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1200 /* L2 MEAS AGHOSH */
1204 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1206 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1207 /* L2 MEAS AGHOSH */
1208 if(measEvtCb->measCb.measType & measType)
1210 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1216 #endif /* LTE_L2_MEAS */
1220 * This function configures the RLC data sap
1222 * @param[in] gCb RLC Instance Control Block
1223 * @param[in] cfg RLC LM Sap configuration structure
1226 * -# LCM_REASON_NOT_APPL (SUCCESS)
1227 * -# LCM_REASON_INVALID_SAP
1228 * -# LCM_REASON_MEM_NOAVAIL
1229 * -# LCM_REASON_RECONFIG_FAIL
1231 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1233 RlcKwuSapCb *rlcKwuSapCb;
1235 #if (ERRCLASS & ERRCLS_INT_PAR)
1236 /* Validate the protocol parameters */
1237 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1239 return (LCM_REASON_INVALID_PAR_VAL);
1241 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1243 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1244 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1245 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1247 #if (ERRCLASS & ERRCLS_INT_PAR)
1248 /* Check for reconfiguration */
1249 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1251 RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1252 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1253 /* reconfiguration not allowed */
1254 return (LCM_REASON_RECONFIG_FAIL);
1256 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1258 /* Fill the parameters */
1259 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1261 return (LCM_REASON_NOT_APPL);
1266 * This function configures the RLC control sap
1268 * @param[in] gCb RLC Instance Control Block
1269 * @param[in] cfg RLC LM Sap configuration structure
1272 * -# LCM_REASON_NOT_APPL (SUCCESS)
1273 * -# LCM_REASON_INVALID_SAP
1274 * -# LCM_REASON_INVALID_SAP
1275 * -# LCM_REASON_RECONFIG_FAIL
1277 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1279 RlcCkwSapCb *ckwSap;
1281 #if (ERRCLASS & ERRCLS_INT_PAR)
1282 /* Validate config parameters */
1283 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1285 return (LCM_REASON_INVALID_PAR_VAL);
1288 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1290 /* Get Sap control block */
1291 return (LCM_REASON_INVALID_PAR_VAL);
1295 ckwSap = &(gCb->u.ulCb->ckwSap);
1297 #if (ERRCLASS & ERRCLS_INT_PAR)
1298 /* Check for reconfiguration */
1299 if(ckwSap->state != RLC_SAP_NOT_CFG)
1301 RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
1302 return (LCM_REASON_RECONFIG_FAIL);
1304 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1306 /* Fill the parameters */
1307 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1309 return (LCM_REASON_NOT_APPL);
1314 * This function configures the UDX sap
1316 * @param[in] gCb RLC Instance Control Block
1317 * @param[in] cfg RLC LM Sap configuration structure
1320 * -# LCM_REASON_NOT_APPL (SUCCESS)
1321 * -# LCM_REASON_INVALID_SAP
1322 * -# LCM_REASON_INVALID_SAP
1323 * -# LCM_REASON_RECONFIG_FAIL
1325 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1327 RlcUdxDlSapCb *udxDlSap;
1328 RlcUdxUlSapCb *udxUlSap;
1330 #if (ERRCLASS & ERRCLS_INT_PAR)
1331 /* Validate the protocol parameters */
1332 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1334 return (LCM_REASON_INVALID_PAR_VAL);
1337 /* Get Sap control block */
1338 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1340 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1341 #if (ERRCLASS & ERRCLS_INT_PAR)
1342 /* Check for reconfiguration */
1343 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1345 RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
1346 return (LCM_REASON_RECONFIG_FAIL);
1348 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1350 /* Fill the parameters */
1351 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1355 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1357 #if (ERRCLASS & ERRCLS_INT_PAR)
1358 /* Check for reconfiguration */
1359 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1361 RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
1362 return (LCM_REASON_RECONFIG_FAIL);
1364 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1366 /* Fill the parameters */
1367 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1369 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1370 udxUlSap->retryCnt = 0;
1371 cmInitTimers(&(udxUlSap->bndTmr), 1);
1374 return (LCM_REASON_NOT_APPL);
1379 * This function configures the RGU sap
1381 * @param[in] gCb RLC Instance Control Block
1382 * @param[in] cfg RLC LM Sap configuration structure
1384 * -# LCM_REASON_NOT_APPL (SUCCESS)
1385 * -# LCM_REASON_INVALID_SAP
1386 * -# LCM_REASON_INVALID_SAP
1387 * -# LCM_REASON_RECONFIG_FAIL
1389 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1391 RlcRguSapCb *rguSap;
1393 #if (ERRCLASS & ERRCLS_INT_PAR)
1394 /* Validate the protocol parameters */
1395 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1398 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1399 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1400 return (LCM_REASON_INVALID_PAR_VAL);
1404 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1405 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1407 #if (ERRCLASS & ERRCLS_INT_PAR)
1408 /* Check for reconfiguration */
1409 if(rguSap->state != RLC_SAP_NOT_CFG)
1411 RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
1412 gCb->genCfg.rlcMode, rguSap->state);
1413 return (LCM_REASON_RECONFIG_FAIL);
1415 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1417 /* Fill the parameters */
1418 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1419 rguSap->suId = cfg->sapId;
1420 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1421 rguSap->retryCnt = 0;
1422 rguSap->state = RLC_SAP_CFG;
1424 cmInitTimers(&(rguSap->bndTmr), 1);
1426 return (LCM_REASON_NOT_APPL);
1431 * Validates the RLC general control parameters
1433 * @param[in] cntrl RLC LM structure
1436 * -# LCM_REASON_NOT_APPL (SUCCESS)
1437 * -# LCM_REASON_INVALID_SUBACTION
1438 * -# LCM_REASON_INVALID_ACTION
1440 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1442 S16 reason; /* reason for failure */
1443 uint8_t sAction; /* subaction field */
1445 reason = LCM_REASON_NOT_APPL;
1446 sAction = cntrl->t.cntrl.subAction;
1448 switch (cntrl->t.cntrl.action)
1452 if ((sAction != SAUSTA) &&
1453 (sAction != SADBG) &&
1456 reason = LCM_REASON_INVALID_SUBACTION;
1462 reason = LCM_REASON_INVALID_ACTION;
1471 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1473 * @param[in] gCb RLC Instance Control Block
1477 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1482 if (gCb->init.cfgDone)
1484 /* Deregister the timers */
1485 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1486 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1487 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1488 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1489 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1491 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1493 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1495 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1498 gCb->u.dlCb->shutdownReceived = TRUE;
1499 rlcUtlFreeDlMemory(gCb);
1500 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1502 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1505 if(gCb->u.dlCb->udxDlSap != NULLP)
1507 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1510 if(gCb->u.dlCb->rguDlSap != NULLP)
1512 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1513 gCb->genCfg.maxRguSaps = 0;
1515 if (gCb->u.dlCb->shutdownReceived)
1517 if (gCb->u.dlCb->selfPstMBuf != NULL)
1519 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1521 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1528 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1531 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1533 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1536 if(gCb->u.ulCb->udxUlSap != NULLP)
1538 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1541 if(gCb->u.ulCb->rguUlSap != NULLP)
1543 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1544 gCb->genCfg.maxRguSaps = 0;
1547 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1551 gCb->init.cfgDone = FALSE;
1552 gCb->init.acnt = FALSE;
1553 gCb->init.trc = FALSE;
1555 gCb->init.usta = FALSE;
1563 * Delete all SAPs and Control Blocks
1566 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1567 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1568 * control blocks and lists.
1570 * @params[in] gCb RLC instance control block
1573 * -# LCM_REASON_NOT_APPL (SUCCESS)
1574 * -# LCM_REASON_HASHING_FAILED
1576 static S16 rlcLmmShutdown(RlcCb *gCb)
1578 RlcRguSapCb *rguSap;
1581 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1583 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1585 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1586 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1588 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1594 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1596 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1597 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1599 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1604 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1606 rlcDbmDlShutdown(gCb);
1610 rlcDbmUlShutdown(gCb);
1613 rlcLmmCleanGblRsrcs(gCb);
1615 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1617 return (LCM_REASON_NOT_APPL);
1622 * Function processes the general control request
1624 * @param[in] gCb RLC instance control block
1625 * @param[in] cntrl RLC LM structure
1628 * -# LCM_REASON_NOT_APPL (SUCCESS)
1629 * -# LCM_REASON_INVALID_SUBACTION
1630 * -# LCM_REASON_INVALID_ACTION
1632 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1634 RlcTrcCntrl *trcCntrl; /* trace */
1636 RlcDbgCntrl *dbgCntrl; /* debug */
1638 S16 reason; /* reason for failure */
1640 /* Validate control parameters */
1641 reason = rlcLmmValidateGenCntrl (cntrl);
1643 if (reason != LCM_REASON_NOT_APPL)
1648 switch(cntrl->t.cntrl.action)
1652 switch(cntrl->t.cntrl.subAction)
1656 RLC_SET_USTA_FLAG(gCb, TRUE);
1662 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1663 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1669 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1670 gCb->init.trc = TRUE;
1671 gCb->trcLen = trcCntrl->trcLen;
1672 (gCb->trcMask) |= trcCntrl->trcMask;
1680 switch(cntrl->t.cntrl.subAction)
1684 gCb->init.usta = FALSE;
1690 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1691 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1697 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1698 gCb->init.trc = FALSE;
1699 gCb->trcMask &= ~(trcCntrl->trcMask);
1707 reason = rlcLmmShutdown(gCb);
1716 * Bind/Unbind RLC UDX sap
1718 * @param[in] gCb RLC Instance Control Block
1719 * @param[in] cntrl RLC LM structure
1722 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1723 * -# LCM_REASON_INVALID_SAP
1724 * -# LCM_REASON_INVALID_STATE
1725 * -# LCM_REASON_INVALID_ACTION
1727 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1730 #if (ERRCLASS & ERRCLS_INT_PAR)
1731 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1733 return (LCM_REASON_INVALID_SAP);
1736 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1737 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1739 return (LCM_REASON_INVALID_SAP);
1741 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1743 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1744 #if (ERRCLASS & ERRCLS_INT_PAR)
1746 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1748 RLOG0(L_ERROR,"udxUlSap not configured yet");
1749 return (LCM_REASON_INVALID_STATE);
1751 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1753 switch(cntrl->t.cntrl.action)
1757 if(UDX_SAP.state != RLC_SAP_BND)
1759 /* start timer to wait for bind confirm */
1760 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1761 UDX_SAP.state = RLC_SAP_BINDING;
1762 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1766 /* control request received for an already bound SAP */
1767 return (LCM_REASON_INVALID_STATE);
1773 /* make the state of UDXSAP configured but not bound */
1774 UDX_SAP.state = RLC_SAP_CFG;
1775 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1779 return (LCM_REASON_INVALID_ACTION);
1781 } /* end of switch */
1783 return (LCM_REASON_NOT_APPL);
1788 * Bind/Unbind RLC lower sap
1790 * @param[in] gCb RLC Instance Control Block
1791 * @param[in] cntrl RLC LM structure
1793 * -# LCM_REASON_NOT_APPL (SUCCESS)
1794 * -# LCM_REASON_INVALID_SAP
1795 * -# LCM_REASON_INVALID_STATE
1796 * -# LCM_REASON_INVALID_ACTION
1798 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1800 RlcRguSapCb *rguSap; /* rgu sap pointer */
1802 #if (ERRCLASS & ERRCLS_INT_PAR)
1804 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1805 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1807 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1808 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1809 return (LCM_REASON_INVALID_SAP);
1811 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1812 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1813 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1814 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1816 #if (ERRCLASS & ERRCLS_INT_PAR)
1818 if(rguSap->state == RLC_SAP_NOT_CFG)
1820 RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1821 return (LCM_REASON_INVALID_STATE);
1823 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1825 switch(cntrl->t.cntrl.action)
1829 if(rguSap->state != RLC_SAP_BND)
1831 /* start timer to wait for bind confirm */
1832 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1833 rguSap->state = RLC_SAP_BINDING;
1834 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1835 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1836 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1840 /* control request received for an already bound SAP */
1841 return (LCM_REASON_INVALID_STATE);
1847 /* make the state of RGUSAP is configure but not bound */
1848 rguSap->state = RLC_SAP_CFG;
1849 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1853 return (LCM_REASON_INVALID_ACTION);
1855 } /* end of switch */
1857 return (LCM_REASON_NOT_APPL);
1862 * Function gather the general KWU SAP status
1864 * @param[in] gCb RLC Instance Control Block
1865 * @param[in] sta LM KWU Sap Status structure
1868 * -# LCM_REASON_NOT_APPL (SUCCESS)
1869 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1871 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1873 RlcKwuSapCb *rlcKwSapCb;
1875 #if (ERRCLASS & ERRCLS_INT_PAR)
1876 /* Validate the protocol parameters */
1877 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1880 return (LCM_REASON_INVALID_PAR_VAL);
1884 /* Get Sap control block */
1885 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1886 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1887 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1889 sta->state = rlcKwSapCb->state;
1891 return (LCM_REASON_NOT_APPL);
1896 * Function gather the general RGU SAP status
1898 * @param[in] gCb RLC Instance Control Block
1899 * @param[in] sta LM RGU Sap Status structure
1901 * -# LCM_REASON_NOT_APPL (SUCCESS)
1902 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1904 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1907 #if (ERRCLASS & ERRCLS_INT_PAR)
1908 /* Validate the protocol parameters */
1909 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1911 return (LCM_REASON_INVALID_PAR_VAL);
1915 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1916 gCb->u.dlCb->rguDlSap[sta->suId].state :
1917 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1919 return (LCM_REASON_NOT_APPL);
1924 * Function gather the general CKW SAP status
1926 * @param[in] gCb RLC Instance Control Block
1927 * @param[in] sta LM CKW Sap Status structure
1929 * -# LCM_REASON_NOT_APPL (SUCCESS)
1930 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1932 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1935 #if (ERRCLASS & ERRCLS_INT_PAR)
1936 /* Validate config parameters */
1937 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1939 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1941 return (LCM_REASON_INVALID_PAR_VAL);
1944 sta->state = gCb->u.ulCb->ckwSap.state;
1946 return (LCM_REASON_NOT_APPL);
1952 * Gather the general statistics
1954 * @param[in] gCb RLC Instance Control Block
1955 * @param[in] sts LM general statistics structure
1956 * @param[in] action action
1958 * -# LCM_REASON_NOT_APPL (SUCCESS)
1959 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1961 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1964 #if (ERRCLASS & ERRCLS_INT_PAR)
1965 /* Validate protocol parameters */
1966 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1968 return (LCM_REASON_INVALID_PAR_VAL);
1974 if(action == LKW_ZEROSTS)
1976 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1979 return (LCM_REASON_NOT_APPL);
1984 * Gather the SAP statistics
1986 * @param[in] gCb RLC Instance Control Block
1987 * @param[in] sts LM general statistics structure
1988 * @param[in] elmnt element
1989 * @param[in] action action
1992 * -# LCM_REASON_NOT_APPL (SUCCESS)
1993 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1995 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
1998 /* Validate protocol parameters */
1999 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2001 return (LCM_REASON_INVALID_PAR_VAL);
2007 RlcKwuSapSts *rlckwuSap;
2008 RlcKwuSapCb *rlcKwuSapCb;
2009 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2011 /* Get Sap control block */
2012 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2013 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2014 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2015 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2018 *rlckwuSap = rlcKwuSapCb->sts;
2020 if (action == LKW_ZEROSTS)
2022 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2026 /* kw005.201 removed RGUSAP statistics support */
2029 RlcCkwCntSts *ckwSap;
2030 ckwSap = &sts->t.sts.s.ckwSap;
2031 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2033 return (LCM_REASON_INVALID_PAR_VAL);
2036 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2038 if (action == LKW_ZEROSTS)
2040 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2045 return (LCM_REASON_INVALID_ELMNT);
2048 SGetDateTime(&sts->t.sts.dt);
2050 return (LCM_REASON_NOT_APPL);
2055 * This function sends Unsolicited Status Indication to the Layer Management
2058 * @param[in] gCb RLC Instance Control Block
2059 * @param[in] category Category
2060 * @param[in] event event
2061 * @param[in] cause cause
2062 * @param[in] UeId ueId
2063 * @param[in] Qci qci
2068 Void rlcLmmSendAlarm
2078 #else /* LTE_L2_MEAS */
2079 Void rlcLmmSendAlarm
2088 #endif /* LTE_L2_MEAS */
2090 RlcMngmt usta; /* Rlc Management Structure */
2092 if(gCb->init.usta == FALSE)
2097 usta.hdr.elmId.elmnt = STGEN;
2098 usta.hdr.entId.ent = gCb->init.ent;
2099 usta.hdr.entId.inst = gCb->init.inst;
2101 /* fill in the event and category */
2102 usta.t.usta.alarm.category = category;
2103 usta.t.usta.alarm.event = event;
2104 usta.t.usta.alarm.cause = cause;
2106 /* set the suId and ueId */
2107 usta.t.usta.ueId = ueId;
2108 usta.t.usta.suId = suId;
2109 /* kw005.201 added support for L2 Measurement */
2111 if(event == LKW_EVT_MEAS_HALT)
2113 usta.t.usta.qci = qci;
2115 #endif /* LTE_L2_MEAS */
2116 /* update the date and time */
2117 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2119 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2127 * This function sends trace indication to LM
2129 * @param[in] gCb RLC Instance Control Block
2130 * @param[in] event event
2131 * @param[in] mBuf meessage buffer
2137 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2139 RlcMngmt trc; /* RLC management control block */
2146 RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2150 memset(&trc, 0, sizeof(RlcMngmt));
2152 pst = gCb->init.lmPst;
2154 trc.t.trc.event = event;
2155 SGetDateTime(&trc.t.trc.dt);
2156 trc.cfm.status = LCM_PRIM_OK;
2157 trc.cfm.reason = LCM_REASON_NOT_APPL;
2161 /* Check if the whole buffer is to be sent in Trace indication */
2162 if(gCb->trcLen == LKW_FULL_TRACE)
2164 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2167 /* rg005.201 removed SPutSBuf on error */
2168 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2171 /* Send Trace Indication to Layer manager */
2172 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2174 /* check if only a specified number of bytes are to be sent */
2175 else if(gCb->trcLen > 0)
2177 /* Get the length of the recvd message buffer */
2178 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2180 RLOG0(L_ERROR,"SFndLenMsg Failed");
2183 /* Check if the recvd buffer size is less than request trace len */
2184 if(bufLen < gCb->trcLen)
2186 /* Copy the whole of the recvd buffer in trace indication */
2188 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2191 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2195 /* Send Trace Indication to Layer manager */
2196 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2200 /* if the recvd buffer size is greater than request trace len */
2201 /* Get a temporary buffer to store the msg */
2202 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2204 #if (ERRCLASS & ERRCLS_INT_PAR)
2205 if(tempBuf == NULLP)
2207 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2209 RLOG0(L_FATAL,"Memory Allocation failed");
2210 return (LCM_REASON_MEM_NOAVAIL);
2212 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2214 /* Copy trcLen nos of bytes from the recvd message */
2215 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2217 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2221 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2223 RLOG0(L_FATAL,"Memory Allocation failed");
2226 /* Copy the tempBuf data to dst mBuf */
2227 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2229 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2233 /* Free the memory allocated for tempBuf */
2234 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2235 /* Send Trace Indication to Layer manager */
2236 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2242 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2251 * Activate Task - timer
2254 * Invoked by system services to activate a task with a timer tick.
2256 * @param[in] ent entity
2257 * @param[in] inst instance
2265 S16 rlcActvTmr(Ent ent,Inst inst)
2269 if (inst >= MAX_RLC_INSTANCES)
2273 gCb = RLC_GET_RLCCB(inst);
2274 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2277 } /* end of rlcActvTmr */
2280 /********************************************************************30**
2283 **********************************************************************/