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 gCb->rlcThpt.inst = gCb->init.inst;
183 gCb->rlcThpt.thptTmr.tmrEvnt = TMR_NONE;
184 gCb->rlcThpt.numActvUe = 0;
185 memset(gCb->rlcThpt.thptPerUe, 0, MAX_NUM_UE * sizeof(RlcThptPerUe));
187 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
189 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
190 if (gCb->u.dlCb == NULLP)
192 RLOG0(L_FATAL,"Memory Allocation failed");
193 return (LCM_REASON_MEM_NOAVAIL);
196 /* allocate memory to the KWU sap's */
197 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
198 (Size)sizeof(RlcKwuSapCb));
200 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
202 #if (ERRCLASS & ERRCLS_INT_PAR)
203 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
205 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
206 RLOG0(L_FATAL,"Memory Allocation failed");
207 return (LCM_REASON_MEM_NOAVAIL);
209 #endif /* ERRCLASS & ERRCLS_INT_PAR */
211 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
213 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
214 (Size)sizeof(RlcUdxDlSapCb));
216 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
217 #if (ERRCLASS & ERRCLS_INT_PAR)
218 if(gCb->u.dlCb->udxDlSap == NULLP)
220 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
221 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
222 RLOG0(L_FATAL,"Memory Allocation failed");
223 return (LCM_REASON_MEM_NOAVAIL);
225 #endif /* ERRCLASS & ERRCLS_INT_PAR */
227 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
228 (Size)sizeof(RlcRguSapCb));
229 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
230 #if (ERRCLASS & ERRCLS_INT_PAR)
231 if(gCb->u.dlCb->rguDlSap == NULLP)
233 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
234 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
235 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
237 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
238 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
239 return (LCM_REASON_MEM_NOAVAIL);
241 #endif /* ERRCLASS & ERRCLS_INT_PAR */
244 /* Initialize the Ue and Cell hash list */
245 ret = rlcDbmDlInit(gCb);
248 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
249 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
250 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
251 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
252 RLOG0(L_FATAL,"RLC DL Initialization failed");
253 return (LCM_REASON_MEM_NOAVAIL);
256 /* Register the timer */
257 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
260 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
261 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
262 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
263 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
265 return (LCM_REASON_REGTMR_FAIL);
268 /* initializations for background processing of freeing memory */
269 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
270 rlcUtlInitializeSelfPst(gCb);
272 if(SGetMsg(gCb->init.region,
274 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
276 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
277 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
278 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
279 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
281 return (LCM_REASON_MEM_NOAVAIL);
285 rlcUtlL2MeasDlInit(gCb);
288 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
290 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
291 if (gCb->u.ulCb == NULLP)
293 RLOG0(L_FATAL,"Memory Allocation failed");
294 return (LCM_REASON_MEM_NOAVAIL);
297 /* allocate memory to the KWU sap's */
298 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
299 (Size)sizeof(RlcKwuSapCb));
301 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
303 #if (ERRCLASS & ERRCLS_INT_PAR)
304 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
306 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
307 RLOG0(L_FATAL,"Memory Allocation failed");
308 return (LCM_REASON_MEM_NOAVAIL);
310 #endif /* ERRCLASS & ERRCLS_INT_PAR */
312 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
314 /* allocate memory to the KWU sap's */
315 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
316 (Size)sizeof(RlcUdxUlSapCb));
318 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
320 #if (ERRCLASS & ERRCLS_INT_PAR)
321 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
323 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
324 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
325 RLOG0(L_FATAL,"Memory Allocation failed");
326 return (LCM_REASON_MEM_NOAVAIL);
328 #endif /* ERRCLASS & ERRCLS_INT_PAR */
330 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
331 (Size)sizeof(RlcRguSapCb));
332 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
333 #if (ERRCLASS & ERRCLS_INT_PAR)
334 if(gCb->u.ulCb->rguUlSap == NULLP)
336 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
337 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
338 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
340 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
341 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
342 return (LCM_REASON_MEM_NOAVAIL);
344 #endif /* ERRCLASS & ERRCLS_INT_PAR */
346 /* Initialize the Ue and Cell hash list */
347 ret = rlcDbmUlInit(gCb);
350 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
351 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
352 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
353 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
354 RLOG0(L_FATAL,"RLC DL Initialization failed");
357 /* Register the timer */
358 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
361 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
362 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
363 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
364 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
366 return (LCM_REASON_REGTMR_FAIL);
370 rlcUtlL2MeasUlInit(gCb);
375 #if (ERRCLASS & ERRCLS_INT_PAR)
376 RLOG0(L_ERROR, "Received Invalid RLC Mode");
377 #endif /* ERRCLASS & ERRCLS_INT_PAR */
379 return (LCM_REASON_INVALID_PAR_VAL);
381 /* Timer Initialization */
382 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
384 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
386 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
388 gCb->init.lmPst.srcProcId = gCb->init.procId;
389 gCb->init.lmPst.srcEnt = gCb->init.ent;
390 gCb->init.lmPst.srcInst = gCb->init.inst;
391 gCb->init.lmPst.event = EVTNONE;
393 /* kw002.201 For multi core and multi region,no need to reinitiailize the
394 * region again . This would be done with kwActvInit from SSI */
395 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
396 gCb->init.region = cfg->lmPst.region;
397 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
398 gCb->init.pool = cfg->lmPst.pool;
400 gCb->init.cfgDone = TRUE;
402 return (LCM_REASON_NOT_APPL);
407 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
409 * @param[in] gCb RLC Instance Control Block
410 * @param[in] pst Post structure
411 * @param[in] cfm RLC LM structure
412 * @param[in] type Type of LM message
413 * @param[in] hdr Message header
418 static Void rlcLmmSendCfm
427 Pst rPst; /* Reply post structure */
429 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
431 /* reply post structure for confirmation */
434 rPst.srcEnt = gCb->init.ent;
435 rPst.srcInst = gCb->init.inst;
436 cfm->hdr.entId.ent = gCb->init.ent;
437 cfm->hdr.entId.inst = gCb->init.inst;
441 rPst.srcEnt = pst->dstEnt;
442 rPst.srcInst = pst->dstInst;
443 cfm->hdr.entId.ent = pst->dstEnt;
444 cfm->hdr.entId.inst = pst->dstInst;
446 rPst.srcProcId = SFndProcId();
447 rPst.dstEnt = pst->srcEnt;
448 rPst.dstInst = pst->srcInst;
449 rPst.dstProcId = pst->srcProcId;
450 rPst.selector = hdr->response.selector;
451 rPst.prior = hdr->response.prior;
452 rPst.route = hdr->response.route;
453 rPst.region = hdr->response.mem.region;
454 rPst.pool= hdr->response.mem.pool;
456 /* Fill the reply header */
457 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
458 cfm->hdr.transId = hdr->transId;
463 RlcMiRlcConfigCfm(&rPst,cfm);
466 SGetDateTime(&(cfm->t.cntrl.dt));
467 RlcMiLkwCntrlCfm(&rPst,cfm);
470 SGetDateTime(&(cfm->t.sts.dt));
471 RlcMiLkwStsCfm(&rPst,0,cfm);
474 SGetDateTime(&(cfm->t.ssta.dt));
475 RlcMiLkwStaCfm(&rPst,cfm);
478 #if (ERRCLASS & ERRCLS_INT_PAR)
479 RLOG0(L_ERROR, "Received Invalid Message Type");
484 #endif /* ERRCLASS & ERRCLS_INT_PAR */
494 * This function processes configuration requests received from the layer
498 * The configuration requests can be for general configuration, or
499 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
500 * request can be determined from the elmId field in the header of the layer
501 * manager message.This function is called by the layer manager to configure
504 * This function implements the following logic:
506 * - if genCfg is not done, send negative Cfm to the layer manager;
508 * - switch (cfg->hdr.elmId.elmnt)
510 * - update the genCfg field in RlCb;
511 * - allocate the maximum static memory required by the RLC product;
512 * - register the timer service by calling SReqTmr;
513 * - set CfgDone for not configuring again;
515 * - if all the parameters are valid, then allocate the KwuSap control
517 * - update the SAP control block with the information provided in the
518 * - configuration request;
519 * - send configuration confirm with the status, success;
521 * - if all the parametes are valid, then allocate the CkwSap control
523 * - update the SAP control block with the information provided in the
524 * configuration request;
525 * - send configuration confirm with the status, success;
527 * - if all the parametes are valid, then allocate the rguSap control
529 * - update the SAP control block with the information provided in the
530 * configuration request;
531 * - send configuration confirm with the status, success;
533 * - if all the parametes are valid, then allocate the udxSap control
535 * - update the SAP control block with the information provided in the
536 * configuration request;
537 * - send configuration confirm with the status, success;
540 * @param[in] pst post structure
541 * @param[in] cfg LM management structure
545 * -# Failure : RFAILED
548 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
550 Reason reason; /* failure reason */
553 #if (ERRCLASS & ERRCLS_INT_PAR)
554 /* Check if the instance is configured */
555 if (pst->dstInst >= MAX_RLC_INSTANCES)
557 cfg->cfm.status = LCM_PRIM_NOK;
558 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
559 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
564 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
568 cfg->cfm.status = LCM_PRIM_NOK;
569 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
570 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
573 /* check configuration is done or not */
574 if ((tRlcCb->init.cfgDone != TRUE) &&
575 (cfg->hdr.elmId.elmnt != STGEN))
578 * if general config is not over then use pst structure
579 * in primitive to communicate to stack manager
582 cfg->cfm.status = LCM_PRIM_NOK;
583 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
584 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
588 RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
590 switch(cfg->hdr.elmId.elmnt)
594 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
599 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
604 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
609 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
614 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
619 reason = LCM_REASON_INVALID_ELMNT;
624 if (reason == LCM_REASON_NOT_APPL)
626 cfg->cfm.status = LCM_PRIM_OK;
627 cfg->cfm.reason = LCM_REASON_NOT_APPL;
628 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
633 cfg->cfm.status = LCM_PRIM_NOK;
634 cfg->cfm.reason = reason;
635 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
642 * The layer manager initiates and uses the management-control procedure to
643 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
644 * can be called more than once and at any time after the
645 * management-configuration procedure.The control request primitive
646 * is confirmed by a RlcMiLkwCntrlCfm primitive.
649 * This function implements the following logic:
651 * - if(cfgDone = FALSE)
652 * - send negative confirmation to the layer manager;
655 * - switch(cntrl->hdr.elmId.elmnt)
659 * - switch(subAction)
661 * - enable the unsolicited status flag;
662 * - send the control Cfm with success;
664 * - set the debug mask;
665 * - send the control Cfm with success;
667 * - enable the trace flag;
668 * - send the control Cfm with success;
670 * - switch(subAction)
672 * - disable the unsolicited status flag;
673 * - send the control Cfm with success;
675 * - disable the trace flag;
676 * - send the control Cfm with success;
685 * @param[in] pst post structure
686 * @param[in] cntrl LM management structure
692 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
694 Reason reason; /* failure reason */
697 #if (ERRCLASS & ERRCLS_INT_PAR)
698 /* Check if the instance is configured */
699 if (pst->dstInst >= MAX_RLC_INSTANCES)
701 cntrl->cfm.status = LCM_PRIM_NOK;
702 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
704 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
709 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
713 cntrl->cfm.status = LCM_PRIM_NOK;
714 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
715 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
719 if (!(tRlcCb->init.cfgDone))
721 cntrl->cfm.status = LCM_PRIM_NOK;
722 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
723 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
726 RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
728 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
729 * In all error cases appropriate reason is returned
730 * by the functions below
733 switch (cntrl->hdr.elmId.elmnt)
737 /* general control */
738 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
743 /* Lower SAP control */
744 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
750 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
755 reason = LCM_REASON_INVALID_ELMNT;
760 if (reason == LCM_REASON_NOT_APPL)
762 cntrl->cfm.status = LCM_PRIM_OK;
763 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
767 cntrl->cfm.status = LCM_PRIM_NOK;
768 cntrl->cfm.reason = reason;
771 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
778 * This function processes solicited status requests received from the layer
779 * manager. The layer manager can request status information regarding the
780 * system ID, RGUSAP,KWUSAP, or CKWSAP.
782 * @param[in] pst post structure
783 * @param[in] sta LM management structure
788 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
790 RlcMngmt rSta; /* Status */
791 Reason reason; /* Failure reason */
794 #if (ERRCLASS & ERRCLS_INT_PAR)
795 /* Check if the instance is configured */
796 if (pst->dstInst >= MAX_RLC_INSTANCES)
798 sta->cfm.status = LCM_PRIM_NOK;
799 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
801 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
806 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
809 sta->cfm.status = LCM_PRIM_NOK;
810 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
812 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
816 RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
818 reason = LCM_REASON_NOT_APPL;
820 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
821 switch (sta->hdr.elmId.elmnt)
825 reason = LCM_REASON_NOT_APPL;
826 rlcGetSId(&rSta.t.ssta.s.sysId);
831 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
832 &sta->t.ssta.s.rlckwuSap,
833 sizeof (RlcKwuSapSta));
835 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
840 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
841 &sta->t.ssta.s.rguSap,
842 sizeof (RlcRguSapSta));
844 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
849 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
850 &sta->t.ssta.s.ckwSap,
851 sizeof (RlcCkwCntSapSta));
853 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
858 reason = LCM_REASON_INVALID_ELMNT;
861 } /* end of switch */
863 if (reason == LCM_REASON_NOT_APPL)
865 rSta.cfm.status = LCM_PRIM_OK;
866 rSta.cfm.reason = LCM_REASON_NOT_APPL;
870 rSta.cfm.status = LCM_PRIM_NOK;
871 rSta.cfm.reason = reason;
873 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
880 * This function processes statistics requests received from the layer
884 * After collecting the statistics, ir calls the statistics confirm function
885 * to send the statistics to the layer manager.
887 * - switch(sts->hdr.elmId.elmnt)
889 * - get the general statistics from the KW control block;
890 * - if (action = RESET)
891 * - reset the general statistic field in the RlCb;
892 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
896 * - get the SAP specific statistics from KW control block;
897 * - if (action = RESET)
898 * - reset the general statistic field in the RlCb;
899 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
902 * @param[in] pst post structure
903 * @param[in] action action
904 * @param[in] sts LM management structure
910 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
912 RlcMngmt rSts; /* Statistics */
913 Reason reason; /* Reason for failure */
916 #if (ERRCLASS & ERRCLS_INT_PAR)
917 /* Check if the instance is configured */
918 if (pst->dstInst >= MAX_RLC_INSTANCES)
920 rSts.cfm.status = LCM_PRIM_NOK;
921 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
923 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
928 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
931 rSts.cfm.status = LCM_PRIM_NOK;
932 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
934 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
938 RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
940 sts->hdr.elmId.elmnt);
942 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
944 switch (sts->hdr.elmId.elmnt)
948 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
954 if( sts->hdr.elmId.elmnt == STKWUSAP)
956 /* kw005.201, modified the element of rlckwuSap from suId to spId */
957 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
959 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
964 reason = LCM_REASON_INVALID_ELMNT;
969 if (reason == LCM_REASON_NOT_APPL)
971 rSts.cfm.status = LCM_PRIM_OK;
972 rSts.cfm.reason = LCM_REASON_NOT_APPL;
976 rSts.cfm.status = LCM_PRIM_NOK;
977 rSts.cfm.reason = reason;
979 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
984 /* kw005.201 added support for L2 Measurement */
988 This function processes L2 Measurement requests received from the layer manager.
989 The L2 Measurement is start for a time period and after the timer expiry, the
990 measurement confirm is sent.
992 - Accept only one set of measurements.
993 - Allocate and initialise RlcL2MeasEvtCb.
994 - Validate if the measurement is already in progress.
995 - Loop through the existing measEvtCb with matching measType
996 - Check if measurement is running for any qci present in the measReq
997 - If present, move the qCi to list of invalid qCIs.
998 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
999 - For the number of measurements requested.
1000 - For all Ues with RBs matching qCI.
1001 - Add RbCb to the RB linked list.
1002 - Set rlcRbCb.measOn to measurement type.
1003 - If Meas type is DL_DELAY
1004 - Update COUNT to startCount.
1007 * @param[in] pst post structure
1008 * @param[in] action action
1009 * @param[in] cfg LM management structure
1012 * -# Failure : RFAILED
1014 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1019 RlcL2MeasCfmEvt measCfmEvt;
1023 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1025 /* Initialize measCfmEvt */
1026 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1027 /* validate the received measReqEvt */
1028 /*LTE_L2_MEAS_PHASE2*/
1029 if(measReqEvt->measPeriod != 0)
1031 /* L2 MEAS AGHOSH */
1032 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1033 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1035 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1040 #if (ERRCLASS & ERRCLS_ADD_RES)
1041 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1042 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1043 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1048 measType = measReqEvt->measReq.measType;
1050 if((measType != LKW_L2MEAS_DL_IP) &&
1051 (measType != LKW_L2MEAS_ACT_UE) &&
1052 (measType != LKW_L2MEAS_DL_DISC) &&
1053 (measType != LKW_L2MEAS_DL_DELAY) &&
1054 (measType != LKW_L2MEAS_UU_LOSS) &&
1055 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1057 measCfmEvt.transId = measReqEvt->transId;
1058 measCfmEvt.measType = measType;
1059 measCfmEvt.status.status = LCM_PRIM_NOK;
1060 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1061 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1062 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1066 /* for UL IP throughput meas enable for all QCIs */
1067 if(measType & LKW_L2MEAS_UL_IP)
1069 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1071 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1076 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1077 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1079 RlcL2MeasReqEvt *measEvt;
1082 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1084 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1087 sizeof(RlcL2MeasReqEvt));
1089 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1090 if(measEvt == NULLP)
1092 RLOG0(L_FATAL,"Memory Allocation failed");
1096 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1097 /*Redirect the request to DL task */
1098 /* NOTE:As of today, there are no cases where the Req will fail at DL
1099 as long as it reached the DL, so we don't wait for a confirmation from
1100 DL to send the confirmation to LM*/
1101 /* The interface for sending a confirmation back does not exist today;
1102 it needs to be created when the need arises */
1103 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1106 /* We need to copy the transId for sending back confirms later */
1107 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1109 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1110 if(measEvtCb->measCb.measType & measType)
1112 measEvtCb->transId= measReqEvt->transId;
1115 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1118 } /* RlcMiLkwL2MeasReq */
1122 This function processes L2 Measurement stop request received from the layer manager.
1123 After receving this request, RLC stops L2 Measurement
1124 * @param[in] pst post structure
1125 * @param[in] measType meas Type
1128 * -# Failure : RFAILED
1131 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1134 RlcL2MeasEvtCb *measEvtCb = NULLP;
1137 uint8_t status = ROK;
1140 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1142 /* reset the counter values for the measurement that is stopped */
1143 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1145 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1146 if(measEvtCb->measCb.measType & measType)
1148 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1153 /* for UL IP throughput meas disable for all QCIs */
1154 if(measType & LKW_L2MEAS_UL_IP)
1156 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1158 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1162 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1163 || (measType & LKW_L2MEAS_DL_DELAY))
1165 /*Redirect the request to DL task */
1166 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1169 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1171 status = LCM_PRIM_OK;
1172 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1178 This function processes L2 Measurement Send request received from the layer manager.
1179 After receving this request, RLC sends L2 Measurement
1180 * @param[in] pst post structure
1181 * @param[in] measType meas Type
1184 * -# Failure : RFAILED
1187 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1190 RlcL2MeasEvtCb *measEvtCb = NULLP;
1194 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1196 /* In case of addition of any new measType here ,appropriate handling
1197 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1199 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1200 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1202 /*Redirect the request to DL task */
1203 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1204 /* L2 MEAS AGHOSH */
1208 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1210 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1211 /* L2 MEAS AGHOSH */
1212 if(measEvtCb->measCb.measType & measType)
1214 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1220 #endif /* LTE_L2_MEAS */
1224 * This function configures the RLC data sap
1226 * @param[in] gCb RLC Instance Control Block
1227 * @param[in] cfg RLC LM Sap configuration structure
1230 * -# LCM_REASON_NOT_APPL (SUCCESS)
1231 * -# LCM_REASON_INVALID_SAP
1232 * -# LCM_REASON_MEM_NOAVAIL
1233 * -# LCM_REASON_RECONFIG_FAIL
1235 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1237 RlcKwuSapCb *rlcKwuSapCb;
1239 #if (ERRCLASS & ERRCLS_INT_PAR)
1240 /* Validate the protocol parameters */
1241 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1243 return (LCM_REASON_INVALID_PAR_VAL);
1245 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1247 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1248 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1249 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1251 #if (ERRCLASS & ERRCLS_INT_PAR)
1252 /* Check for reconfiguration */
1253 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1255 RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1256 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1257 /* reconfiguration not allowed */
1258 return (LCM_REASON_RECONFIG_FAIL);
1260 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1262 /* Fill the parameters */
1263 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1265 return (LCM_REASON_NOT_APPL);
1270 * This function configures the RLC control sap
1272 * @param[in] gCb RLC Instance Control Block
1273 * @param[in] cfg RLC LM Sap configuration structure
1276 * -# LCM_REASON_NOT_APPL (SUCCESS)
1277 * -# LCM_REASON_INVALID_SAP
1278 * -# LCM_REASON_INVALID_SAP
1279 * -# LCM_REASON_RECONFIG_FAIL
1281 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1283 RlcCkwSapCb *ckwSap;
1285 #if (ERRCLASS & ERRCLS_INT_PAR)
1286 /* Validate config parameters */
1287 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1289 return (LCM_REASON_INVALID_PAR_VAL);
1292 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1294 /* Get Sap control block */
1295 return (LCM_REASON_INVALID_PAR_VAL);
1299 ckwSap = &(gCb->u.ulCb->ckwSap);
1301 #if (ERRCLASS & ERRCLS_INT_PAR)
1302 /* Check for reconfiguration */
1303 if(ckwSap->state != RLC_SAP_NOT_CFG)
1305 RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
1306 return (LCM_REASON_RECONFIG_FAIL);
1308 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1310 /* Fill the parameters */
1311 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1313 return (LCM_REASON_NOT_APPL);
1318 * This function configures the UDX sap
1320 * @param[in] gCb RLC Instance Control Block
1321 * @param[in] cfg RLC LM Sap configuration structure
1324 * -# LCM_REASON_NOT_APPL (SUCCESS)
1325 * -# LCM_REASON_INVALID_SAP
1326 * -# LCM_REASON_INVALID_SAP
1327 * -# LCM_REASON_RECONFIG_FAIL
1329 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1331 RlcUdxDlSapCb *udxDlSap;
1332 RlcUdxUlSapCb *udxUlSap;
1334 #if (ERRCLASS & ERRCLS_INT_PAR)
1335 /* Validate the protocol parameters */
1336 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1338 return (LCM_REASON_INVALID_PAR_VAL);
1341 /* Get Sap control block */
1342 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1344 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1345 #if (ERRCLASS & ERRCLS_INT_PAR)
1346 /* Check for reconfiguration */
1347 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1349 RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
1350 return (LCM_REASON_RECONFIG_FAIL);
1352 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1354 /* Fill the parameters */
1355 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1359 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1361 #if (ERRCLASS & ERRCLS_INT_PAR)
1362 /* Check for reconfiguration */
1363 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1365 RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
1366 return (LCM_REASON_RECONFIG_FAIL);
1368 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1370 /* Fill the parameters */
1371 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1373 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1374 udxUlSap->retryCnt = 0;
1375 cmInitTimers(&(udxUlSap->bndTmr), 1);
1378 return (LCM_REASON_NOT_APPL);
1383 * This function configures the RGU sap
1385 * @param[in] gCb RLC Instance Control Block
1386 * @param[in] cfg RLC LM Sap configuration structure
1388 * -# LCM_REASON_NOT_APPL (SUCCESS)
1389 * -# LCM_REASON_INVALID_SAP
1390 * -# LCM_REASON_INVALID_SAP
1391 * -# LCM_REASON_RECONFIG_FAIL
1393 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1395 RlcRguSapCb *rguSap;
1397 #if (ERRCLASS & ERRCLS_INT_PAR)
1398 /* Validate the protocol parameters */
1399 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1402 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1403 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1404 return (LCM_REASON_INVALID_PAR_VAL);
1408 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1409 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1411 #if (ERRCLASS & ERRCLS_INT_PAR)
1412 /* Check for reconfiguration */
1413 if(rguSap->state != RLC_SAP_NOT_CFG)
1415 RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
1416 gCb->genCfg.rlcMode, rguSap->state);
1417 return (LCM_REASON_RECONFIG_FAIL);
1419 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1421 /* Fill the parameters */
1422 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1423 rguSap->suId = cfg->sapId;
1424 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1425 rguSap->retryCnt = 0;
1426 rguSap->state = RLC_SAP_CFG;
1428 cmInitTimers(&(rguSap->bndTmr), 1);
1430 return (LCM_REASON_NOT_APPL);
1435 * Validates the RLC general control parameters
1437 * @param[in] cntrl RLC LM structure
1440 * -# LCM_REASON_NOT_APPL (SUCCESS)
1441 * -# LCM_REASON_INVALID_SUBACTION
1442 * -# LCM_REASON_INVALID_ACTION
1444 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1446 S16 reason; /* reason for failure */
1447 uint8_t sAction; /* subaction field */
1449 reason = LCM_REASON_NOT_APPL;
1450 sAction = cntrl->t.cntrl.subAction;
1452 switch (cntrl->t.cntrl.action)
1456 if ((sAction != SAUSTA) &&
1457 (sAction != SADBG) &&
1460 reason = LCM_REASON_INVALID_SUBACTION;
1466 reason = LCM_REASON_INVALID_ACTION;
1475 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1477 * @param[in] gCb RLC Instance Control Block
1481 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1486 if (gCb->init.cfgDone)
1488 /* Deregister the timers */
1489 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1490 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1491 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1492 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1493 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1495 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1497 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1499 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1502 gCb->u.dlCb->shutdownReceived = TRUE;
1503 rlcUtlFreeDlMemory(gCb);
1504 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1506 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1509 if(gCb->u.dlCb->udxDlSap != NULLP)
1511 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1514 if(gCb->u.dlCb->rguDlSap != NULLP)
1516 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1517 gCb->genCfg.maxRguSaps = 0;
1519 if (gCb->u.dlCb->shutdownReceived)
1521 if (gCb->u.dlCb->selfPstMBuf != NULL)
1523 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1525 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1532 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1535 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1537 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1540 if(gCb->u.ulCb->udxUlSap != NULLP)
1542 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1545 if(gCb->u.ulCb->rguUlSap != NULLP)
1547 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1548 gCb->genCfg.maxRguSaps = 0;
1551 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1555 gCb->init.cfgDone = FALSE;
1556 gCb->init.acnt = FALSE;
1557 gCb->init.trc = FALSE;
1559 gCb->init.usta = FALSE;
1567 * Delete all SAPs and Control Blocks
1570 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1571 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1572 * control blocks and lists.
1574 * @params[in] gCb RLC instance control block
1577 * -# LCM_REASON_NOT_APPL (SUCCESS)
1578 * -# LCM_REASON_HASHING_FAILED
1580 static S16 rlcLmmShutdown(RlcCb *gCb)
1582 RlcRguSapCb *rguSap;
1585 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1587 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1589 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1590 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1592 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1598 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1600 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1601 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1603 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1608 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1610 rlcDbmDlShutdown(gCb);
1614 rlcDbmUlShutdown(gCb);
1617 rlcLmmCleanGblRsrcs(gCb);
1619 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1621 return (LCM_REASON_NOT_APPL);
1626 * Function processes the general control request
1628 * @param[in] gCb RLC instance control block
1629 * @param[in] cntrl RLC LM structure
1632 * -# LCM_REASON_NOT_APPL (SUCCESS)
1633 * -# LCM_REASON_INVALID_SUBACTION
1634 * -# LCM_REASON_INVALID_ACTION
1636 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1638 RlcTrcCntrl *trcCntrl; /* trace */
1640 RlcDbgCntrl *dbgCntrl; /* debug */
1642 S16 reason; /* reason for failure */
1644 /* Validate control parameters */
1645 reason = rlcLmmValidateGenCntrl (cntrl);
1647 if (reason != LCM_REASON_NOT_APPL)
1652 switch(cntrl->t.cntrl.action)
1656 switch(cntrl->t.cntrl.subAction)
1660 RLC_SET_USTA_FLAG(gCb, TRUE);
1666 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1667 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1673 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1674 gCb->init.trc = TRUE;
1675 gCb->trcLen = trcCntrl->trcLen;
1676 (gCb->trcMask) |= trcCntrl->trcMask;
1684 switch(cntrl->t.cntrl.subAction)
1688 gCb->init.usta = FALSE;
1694 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1695 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1701 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1702 gCb->init.trc = FALSE;
1703 gCb->trcMask &= ~(trcCntrl->trcMask);
1711 reason = rlcLmmShutdown(gCb);
1720 * Bind/Unbind RLC UDX sap
1722 * @param[in] gCb RLC Instance Control Block
1723 * @param[in] cntrl RLC LM structure
1726 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1727 * -# LCM_REASON_INVALID_SAP
1728 * -# LCM_REASON_INVALID_STATE
1729 * -# LCM_REASON_INVALID_ACTION
1731 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1734 #if (ERRCLASS & ERRCLS_INT_PAR)
1735 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1737 return (LCM_REASON_INVALID_SAP);
1740 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1741 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1743 return (LCM_REASON_INVALID_SAP);
1745 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1747 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1748 #if (ERRCLASS & ERRCLS_INT_PAR)
1750 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1752 RLOG0(L_ERROR,"udxUlSap not configured yet");
1753 return (LCM_REASON_INVALID_STATE);
1755 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1757 switch(cntrl->t.cntrl.action)
1761 if(UDX_SAP.state != RLC_SAP_BND)
1763 /* start timer to wait for bind confirm */
1764 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1765 UDX_SAP.state = RLC_SAP_BINDING;
1766 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1770 /* control request received for an already bound SAP */
1771 return (LCM_REASON_INVALID_STATE);
1777 /* make the state of UDXSAP configured but not bound */
1778 UDX_SAP.state = RLC_SAP_CFG;
1779 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1783 return (LCM_REASON_INVALID_ACTION);
1785 } /* end of switch */
1787 return (LCM_REASON_NOT_APPL);
1792 * Bind/Unbind RLC lower sap
1794 * @param[in] gCb RLC Instance Control Block
1795 * @param[in] cntrl RLC LM structure
1797 * -# LCM_REASON_NOT_APPL (SUCCESS)
1798 * -# LCM_REASON_INVALID_SAP
1799 * -# LCM_REASON_INVALID_STATE
1800 * -# LCM_REASON_INVALID_ACTION
1802 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1804 RlcRguSapCb *rguSap; /* rgu sap pointer */
1806 #if (ERRCLASS & ERRCLS_INT_PAR)
1808 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1809 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1811 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1812 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1813 return (LCM_REASON_INVALID_SAP);
1815 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1816 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1817 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1818 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1820 #if (ERRCLASS & ERRCLS_INT_PAR)
1822 if(rguSap->state == RLC_SAP_NOT_CFG)
1824 RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1825 return (LCM_REASON_INVALID_STATE);
1827 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1829 switch(cntrl->t.cntrl.action)
1833 if(rguSap->state != RLC_SAP_BND)
1835 /* start timer to wait for bind confirm */
1836 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1837 rguSap->state = RLC_SAP_BINDING;
1838 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1839 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1840 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1844 /* control request received for an already bound SAP */
1845 return (LCM_REASON_INVALID_STATE);
1851 /* make the state of RGUSAP is configure but not bound */
1852 rguSap->state = RLC_SAP_CFG;
1853 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1857 return (LCM_REASON_INVALID_ACTION);
1859 } /* end of switch */
1861 return (LCM_REASON_NOT_APPL);
1866 * Function gather the general KWU SAP status
1868 * @param[in] gCb RLC Instance Control Block
1869 * @param[in] sta LM KWU Sap Status structure
1872 * -# LCM_REASON_NOT_APPL (SUCCESS)
1873 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1875 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1877 RlcKwuSapCb *rlcKwSapCb;
1879 #if (ERRCLASS & ERRCLS_INT_PAR)
1880 /* Validate the protocol parameters */
1881 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1884 return (LCM_REASON_INVALID_PAR_VAL);
1888 /* Get Sap control block */
1889 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1890 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1891 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1893 sta->state = rlcKwSapCb->state;
1895 return (LCM_REASON_NOT_APPL);
1900 * Function gather the general RGU SAP status
1902 * @param[in] gCb RLC Instance Control Block
1903 * @param[in] sta LM RGU Sap Status structure
1905 * -# LCM_REASON_NOT_APPL (SUCCESS)
1906 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1908 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1911 #if (ERRCLASS & ERRCLS_INT_PAR)
1912 /* Validate the protocol parameters */
1913 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1915 return (LCM_REASON_INVALID_PAR_VAL);
1919 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1920 gCb->u.dlCb->rguDlSap[sta->suId].state :
1921 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1923 return (LCM_REASON_NOT_APPL);
1928 * Function gather the general CKW SAP status
1930 * @param[in] gCb RLC Instance Control Block
1931 * @param[in] sta LM CKW Sap Status structure
1933 * -# LCM_REASON_NOT_APPL (SUCCESS)
1934 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1936 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1939 #if (ERRCLASS & ERRCLS_INT_PAR)
1940 /* Validate config parameters */
1941 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1943 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1945 return (LCM_REASON_INVALID_PAR_VAL);
1948 sta->state = gCb->u.ulCb->ckwSap.state;
1950 return (LCM_REASON_NOT_APPL);
1956 * Gather the general statistics
1958 * @param[in] gCb RLC Instance Control Block
1959 * @param[in] sts LM general statistics structure
1960 * @param[in] action action
1962 * -# LCM_REASON_NOT_APPL (SUCCESS)
1963 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1965 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1968 #if (ERRCLASS & ERRCLS_INT_PAR)
1969 /* Validate protocol parameters */
1970 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1972 return (LCM_REASON_INVALID_PAR_VAL);
1978 if(action == LKW_ZEROSTS)
1980 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1983 return (LCM_REASON_NOT_APPL);
1988 * Gather the SAP statistics
1990 * @param[in] gCb RLC Instance Control Block
1991 * @param[in] sts LM general statistics structure
1992 * @param[in] elmnt element
1993 * @param[in] action action
1996 * -# LCM_REASON_NOT_APPL (SUCCESS)
1997 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1999 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
2002 /* Validate protocol parameters */
2003 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2005 return (LCM_REASON_INVALID_PAR_VAL);
2011 RlcKwuSapSts *rlckwuSap;
2012 RlcKwuSapCb *rlcKwuSapCb;
2013 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2015 /* Get Sap control block */
2016 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2017 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2018 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2019 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2022 *rlckwuSap = rlcKwuSapCb->sts;
2024 if (action == LKW_ZEROSTS)
2026 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2030 /* kw005.201 removed RGUSAP statistics support */
2033 RlcCkwCntSts *ckwSap;
2034 ckwSap = &sts->t.sts.s.ckwSap;
2035 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2037 return (LCM_REASON_INVALID_PAR_VAL);
2040 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2042 if (action == LKW_ZEROSTS)
2044 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2049 return (LCM_REASON_INVALID_ELMNT);
2052 SGetDateTime(&sts->t.sts.dt);
2054 return (LCM_REASON_NOT_APPL);
2059 * This function sends Unsolicited Status Indication to the Layer Management
2062 * @param[in] gCb RLC Instance Control Block
2063 * @param[in] category Category
2064 * @param[in] event event
2065 * @param[in] cause cause
2066 * @param[in] UeId ueId
2067 * @param[in] Qci qci
2072 Void rlcLmmSendAlarm
2082 #else /* LTE_L2_MEAS */
2083 Void rlcLmmSendAlarm
2092 #endif /* LTE_L2_MEAS */
2094 RlcMngmt usta; /* Rlc Management Structure */
2096 if(gCb->init.usta == FALSE)
2101 usta.hdr.elmId.elmnt = STGEN;
2102 usta.hdr.entId.ent = gCb->init.ent;
2103 usta.hdr.entId.inst = gCb->init.inst;
2105 /* fill in the event and category */
2106 usta.t.usta.alarm.category = category;
2107 usta.t.usta.alarm.event = event;
2108 usta.t.usta.alarm.cause = cause;
2110 /* set the suId and ueId */
2111 usta.t.usta.ueId = ueId;
2112 usta.t.usta.suId = suId;
2113 /* kw005.201 added support for L2 Measurement */
2115 if(event == LKW_EVT_MEAS_HALT)
2117 usta.t.usta.qci = qci;
2119 #endif /* LTE_L2_MEAS */
2120 /* update the date and time */
2121 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2123 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2131 * This function sends trace indication to LM
2133 * @param[in] gCb RLC Instance Control Block
2134 * @param[in] event event
2135 * @param[in] mBuf meessage buffer
2141 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2143 RlcMngmt trc; /* RLC management control block */
2150 RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2154 memset(&trc, 0, sizeof(RlcMngmt));
2156 pst = gCb->init.lmPst;
2158 trc.t.trc.event = event;
2159 SGetDateTime(&trc.t.trc.dt);
2160 trc.cfm.status = LCM_PRIM_OK;
2161 trc.cfm.reason = LCM_REASON_NOT_APPL;
2165 /* Check if the whole buffer is to be sent in Trace indication */
2166 if(gCb->trcLen == LKW_FULL_TRACE)
2168 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2171 /* rg005.201 removed SPutSBuf on error */
2172 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2175 /* Send Trace Indication to Layer manager */
2176 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2178 /* check if only a specified number of bytes are to be sent */
2179 else if(gCb->trcLen > 0)
2181 /* Get the length of the recvd message buffer */
2182 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2184 RLOG0(L_ERROR,"SFndLenMsg Failed");
2187 /* Check if the recvd buffer size is less than request trace len */
2188 if(bufLen < gCb->trcLen)
2190 /* Copy the whole of the recvd buffer in trace indication */
2192 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2195 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2199 /* Send Trace Indication to Layer manager */
2200 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2204 /* if the recvd buffer size is greater than request trace len */
2205 /* Get a temporary buffer to store the msg */
2206 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2208 #if (ERRCLASS & ERRCLS_INT_PAR)
2209 if(tempBuf == NULLP)
2211 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2213 RLOG0(L_FATAL,"Memory Allocation failed");
2214 return (LCM_REASON_MEM_NOAVAIL);
2216 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2218 /* Copy trcLen nos of bytes from the recvd message */
2219 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2221 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2225 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2227 RLOG0(L_FATAL,"Memory Allocation failed");
2230 /* Copy the tempBuf data to dst mBuf */
2231 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2233 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2237 /* Free the memory allocated for tempBuf */
2238 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2239 /* Send Trace Indication to Layer manager */
2240 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2246 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2255 * Activate Task - timer
2258 * Invoked by system services to activate a task with a timer tick.
2260 * @param[in] ent entity
2261 * @param[in] inst instance
2269 S16 rlcActvTmr(Ent ent,Inst inst)
2273 if (inst >= MAX_RLC_INSTANCES)
2277 gCb = RLC_GET_RLCCB(inst);
2278 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2281 } /* end of rlcActvTmr */
2284 /********************************************************************30**
2287 **********************************************************************/