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 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
255 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
256 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
257 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
258 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
260 return (LCM_REASON_REGTMR_FAIL);
263 /* initializations for background processing of freeing memory */
264 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
265 rlcUtlInitializeSelfPst(gCb);
267 if(SGetMsg(gCb->init.region,
269 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
271 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
272 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
273 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
274 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
276 return (LCM_REASON_MEM_NOAVAIL);
280 rlcUtlL2MeasDlInit(gCb);
283 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
285 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
286 if (gCb->u.ulCb == NULLP)
288 RLOG0(L_FATAL,"Memory Allocation failed");
289 return (LCM_REASON_MEM_NOAVAIL);
292 /* allocate memory to the KWU sap's */
293 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
294 (Size)sizeof(RlcKwuSapCb));
296 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
298 #if (ERRCLASS & ERRCLS_INT_PAR)
299 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
301 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
302 RLOG0(L_FATAL,"Memory Allocation failed");
303 return (LCM_REASON_MEM_NOAVAIL);
305 #endif /* ERRCLASS & ERRCLS_INT_PAR */
307 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
309 /* allocate memory to the KWU sap's */
310 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
311 (Size)sizeof(RlcUdxUlSapCb));
313 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
315 #if (ERRCLASS & ERRCLS_INT_PAR)
316 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
318 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
319 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
320 RLOG0(L_FATAL,"Memory Allocation failed");
321 return (LCM_REASON_MEM_NOAVAIL);
323 #endif /* ERRCLASS & ERRCLS_INT_PAR */
325 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
326 (Size)sizeof(RlcRguSapCb));
327 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
328 #if (ERRCLASS & ERRCLS_INT_PAR)
329 if(gCb->u.ulCb->rguUlSap == NULLP)
331 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
332 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
333 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
335 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
336 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
337 return (LCM_REASON_MEM_NOAVAIL);
339 #endif /* ERRCLASS & ERRCLS_INT_PAR */
341 /* Initialize the Ue and Cell hash list */
342 ret = rlcDbmUlInit(gCb);
345 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
346 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
347 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
348 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
349 RLOG0(L_FATAL,"RLC DL Initialization failed");
352 /* Register the timer */
353 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
356 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
357 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
358 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
359 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
361 return (LCM_REASON_REGTMR_FAIL);
365 rlcUtlL2MeasUlInit(gCb);
370 #if (ERRCLASS & ERRCLS_INT_PAR)
371 RLOG0(L_ERROR, "Received Invalid RLC Mode");
372 #endif /* ERRCLASS & ERRCLS_INT_PAR */
374 return (LCM_REASON_INVALID_PAR_VAL);
376 /* Timer Initialization */
377 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
379 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
381 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
383 gCb->init.lmPst.srcProcId = gCb->init.procId;
384 gCb->init.lmPst.srcEnt = gCb->init.ent;
385 gCb->init.lmPst.srcInst = gCb->init.inst;
386 gCb->init.lmPst.event = EVTNONE;
388 /* kw002.201 For multi core and multi region,no need to reinitiailize the
389 * region again . This would be done with kwActvInit from SSI */
390 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
391 gCb->init.region = cfg->lmPst.region;
392 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
393 gCb->init.pool = cfg->lmPst.pool;
395 gCb->init.cfgDone = TRUE;
397 return (LCM_REASON_NOT_APPL);
402 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
404 * @param[in] gCb RLC Instance Control Block
405 * @param[in] pst Post structure
406 * @param[in] cfm RLC LM structure
407 * @param[in] type Type of LM message
408 * @param[in] hdr Message header
413 static Void rlcLmmSendCfm
422 Pst rPst; /* Reply post structure */
424 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
426 /* reply post structure for confirmation */
429 rPst.srcEnt = gCb->init.ent;
430 rPst.srcInst = gCb->init.inst;
431 cfm->hdr.entId.ent = gCb->init.ent;
432 cfm->hdr.entId.inst = gCb->init.inst;
436 rPst.srcEnt = pst->dstEnt;
437 rPst.srcInst = pst->dstInst;
438 cfm->hdr.entId.ent = pst->dstEnt;
439 cfm->hdr.entId.inst = pst->dstInst;
441 rPst.srcProcId = SFndProcId();
442 rPst.dstEnt = pst->srcEnt;
443 rPst.dstInst = pst->srcInst;
444 rPst.dstProcId = pst->srcProcId;
445 rPst.selector = hdr->response.selector;
446 rPst.prior = hdr->response.prior;
447 rPst.route = hdr->response.route;
448 rPst.region = hdr->response.mem.region;
449 rPst.pool= hdr->response.mem.pool;
451 /* Fill the reply header */
452 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
453 cfm->hdr.transId = hdr->transId;
458 RlcMiRlcConfigCfm(&rPst,cfm);
461 SGetDateTime(&(cfm->t.cntrl.dt));
462 RlcMiLkwCntrlCfm(&rPst,cfm);
465 SGetDateTime(&(cfm->t.sts.dt));
466 RlcMiLkwStsCfm(&rPst,0,cfm);
469 SGetDateTime(&(cfm->t.ssta.dt));
470 RlcMiLkwStaCfm(&rPst,cfm);
473 #if (ERRCLASS & ERRCLS_INT_PAR)
474 RLOG0(L_ERROR, "Received Invalid Message Type");
479 #endif /* ERRCLASS & ERRCLS_INT_PAR */
489 * This function processes configuration requests received from the layer
493 * The configuration requests can be for general configuration, or
494 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
495 * request can be determined from the elmId field in the header of the layer
496 * manager message.This function is called by the layer manager to configure
499 * This function implements the following logic:
501 * - if genCfg is not done, send negative Cfm to the layer manager;
503 * - switch (cfg->hdr.elmId.elmnt)
505 * - update the genCfg field in RlCb;
506 * - allocate the maximum static memory required by the RLC product;
507 * - register the timer service by calling SReqTmr;
508 * - set CfgDone for not configuring again;
510 * - if all the parameters are valid, then allocate the KwuSap control
512 * - update the SAP control block with the information provided in the
513 * - configuration request;
514 * - send configuration confirm with the status, success;
516 * - if all the parametes are valid, then allocate the CkwSap control
518 * - update the SAP control block with the information provided in the
519 * configuration request;
520 * - send configuration confirm with the status, success;
522 * - if all the parametes are valid, then allocate the rguSap control
524 * - update the SAP control block with the information provided in the
525 * configuration request;
526 * - send configuration confirm with the status, success;
528 * - if all the parametes are valid, then allocate the udxSap control
530 * - update the SAP control block with the information provided in the
531 * configuration request;
532 * - send configuration confirm with the status, success;
535 * @param[in] pst post structure
536 * @param[in] cfg LM management structure
540 * -# Failure : RFAILED
543 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
545 Reason reason; /* failure reason */
548 #if (ERRCLASS & ERRCLS_INT_PAR)
549 /* Check if the instance is configured */
550 if (pst->dstInst >= MAX_RLC_INSTANCES)
552 cfg->cfm.status = LCM_PRIM_NOK;
553 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
554 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
559 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
563 cfg->cfm.status = LCM_PRIM_NOK;
564 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
565 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
568 /* check configuration is done or not */
569 if ((tRlcCb->init.cfgDone != TRUE) &&
570 (cfg->hdr.elmId.elmnt != STGEN))
573 * if general config is not over then use pst structure
574 * in primitive to communicate to stack manager
577 cfg->cfm.status = LCM_PRIM_NOK;
578 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
579 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
583 RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
585 switch(cfg->hdr.elmId.elmnt)
589 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
594 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
599 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
604 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
609 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
614 reason = LCM_REASON_INVALID_ELMNT;
619 if (reason == LCM_REASON_NOT_APPL)
621 cfg->cfm.status = LCM_PRIM_OK;
622 cfg->cfm.reason = LCM_REASON_NOT_APPL;
623 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
628 cfg->cfm.status = LCM_PRIM_NOK;
629 cfg->cfm.reason = reason;
630 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
637 * The layer manager initiates and uses the management-control procedure to
638 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
639 * can be called more than once and at any time after the
640 * management-configuration procedure.The control request primitive
641 * is confirmed by a RlcMiLkwCntrlCfm primitive.
644 * This function implements the following logic:
646 * - if(cfgDone = FALSE)
647 * - send negative confirmation to the layer manager;
650 * - switch(cntrl->hdr.elmId.elmnt)
654 * - switch(subAction)
656 * - enable the unsolicited status flag;
657 * - send the control Cfm with success;
659 * - set the debug mask;
660 * - send the control Cfm with success;
662 * - enable the trace flag;
663 * - send the control Cfm with success;
665 * - switch(subAction)
667 * - disable the unsolicited status flag;
668 * - send the control Cfm with success;
670 * - disable the trace flag;
671 * - send the control Cfm with success;
680 * @param[in] pst post structure
681 * @param[in] cntrl LM management structure
687 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
689 Reason reason; /* failure reason */
692 #if (ERRCLASS & ERRCLS_INT_PAR)
693 /* Check if the instance is configured */
694 if (pst->dstInst >= MAX_RLC_INSTANCES)
696 cntrl->cfm.status = LCM_PRIM_NOK;
697 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
699 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
704 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
708 cntrl->cfm.status = LCM_PRIM_NOK;
709 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
710 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
714 if (!(tRlcCb->init.cfgDone))
716 cntrl->cfm.status = LCM_PRIM_NOK;
717 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
718 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
721 RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
723 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
724 * In all error cases appropriate reason is returned
725 * by the functions below
728 switch (cntrl->hdr.elmId.elmnt)
732 /* general control */
733 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
738 /* Lower SAP control */
739 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
745 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
750 reason = LCM_REASON_INVALID_ELMNT;
755 if (reason == LCM_REASON_NOT_APPL)
757 cntrl->cfm.status = LCM_PRIM_OK;
758 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
762 cntrl->cfm.status = LCM_PRIM_NOK;
763 cntrl->cfm.reason = reason;
766 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
773 * This function processes solicited status requests received from the layer
774 * manager. The layer manager can request status information regarding the
775 * system ID, RGUSAP,KWUSAP, or CKWSAP.
777 * @param[in] pst post structure
778 * @param[in] sta LM management structure
783 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
785 RlcMngmt rSta; /* Status */
786 Reason reason; /* Failure reason */
789 #if (ERRCLASS & ERRCLS_INT_PAR)
790 /* Check if the instance is configured */
791 if (pst->dstInst >= MAX_RLC_INSTANCES)
793 sta->cfm.status = LCM_PRIM_NOK;
794 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
796 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
801 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
804 sta->cfm.status = LCM_PRIM_NOK;
805 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
807 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
811 RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
813 reason = LCM_REASON_NOT_APPL;
815 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
816 switch (sta->hdr.elmId.elmnt)
820 reason = LCM_REASON_NOT_APPL;
821 rlcGetSId(&rSta.t.ssta.s.sysId);
826 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
827 &sta->t.ssta.s.rlckwuSap,
828 sizeof (RlcKwuSapSta));
830 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
835 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
836 &sta->t.ssta.s.rguSap,
837 sizeof (RlcRguSapSta));
839 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
844 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
845 &sta->t.ssta.s.ckwSap,
846 sizeof (RlcCkwCntSapSta));
848 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
853 reason = LCM_REASON_INVALID_ELMNT;
856 } /* end of switch */
858 if (reason == LCM_REASON_NOT_APPL)
860 rSta.cfm.status = LCM_PRIM_OK;
861 rSta.cfm.reason = LCM_REASON_NOT_APPL;
865 rSta.cfm.status = LCM_PRIM_NOK;
866 rSta.cfm.reason = reason;
868 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
875 * This function processes statistics requests received from the layer
879 * After collecting the statistics, ir calls the statistics confirm function
880 * to send the statistics to the layer manager.
882 * - switch(sts->hdr.elmId.elmnt)
884 * - get the general statistics from the KW control block;
885 * - if (action = RESET)
886 * - reset the general statistic field in the RlCb;
887 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
891 * - get the SAP specific statistics from KW control block;
892 * - if (action = RESET)
893 * - reset the general statistic field in the RlCb;
894 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
897 * @param[in] pst post structure
898 * @param[in] action action
899 * @param[in] sts LM management structure
905 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
907 RlcMngmt rSts; /* Statistics */
908 Reason reason; /* Reason for failure */
911 #if (ERRCLASS & ERRCLS_INT_PAR)
912 /* Check if the instance is configured */
913 if (pst->dstInst >= MAX_RLC_INSTANCES)
915 rSts.cfm.status = LCM_PRIM_NOK;
916 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
918 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
923 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
926 rSts.cfm.status = LCM_PRIM_NOK;
927 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
929 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
933 RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
935 sts->hdr.elmId.elmnt);
937 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
939 switch (sts->hdr.elmId.elmnt)
943 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
949 if( sts->hdr.elmId.elmnt == STKWUSAP)
951 /* kw005.201, modified the element of rlckwuSap from suId to spId */
952 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
954 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
959 reason = LCM_REASON_INVALID_ELMNT;
964 if (reason == LCM_REASON_NOT_APPL)
966 rSts.cfm.status = LCM_PRIM_OK;
967 rSts.cfm.reason = LCM_REASON_NOT_APPL;
971 rSts.cfm.status = LCM_PRIM_NOK;
972 rSts.cfm.reason = reason;
974 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
979 /* kw005.201 added support for L2 Measurement */
983 This function processes L2 Measurement requests received from the layer manager.
984 The L2 Measurement is start for a time period and after the timer expiry, the
985 measurement confirm is sent.
987 - Accept only one set of measurements.
988 - Allocate and initialise RlcL2MeasEvtCb.
989 - Validate if the measurement is already in progress.
990 - Loop through the existing measEvtCb with matching measType
991 - Check if measurement is running for any qci present in the measReq
992 - If present, move the qCi to list of invalid qCIs.
993 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
994 - For the number of measurements requested.
995 - For all Ues with RBs matching qCI.
996 - Add RbCb to the RB linked list.
997 - Set rlcRbCb.measOn to measurement type.
998 - If Meas type is DL_DELAY
999 - Update COUNT to startCount.
1002 * @param[in] pst post structure
1003 * @param[in] action action
1004 * @param[in] cfg LM management structure
1007 * -# Failure : RFAILED
1009 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1014 RlcL2MeasCfmEvt measCfmEvt;
1018 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1020 /* Initialize measCfmEvt */
1021 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1022 /* validate the received measReqEvt */
1023 /*LTE_L2_MEAS_PHASE2*/
1024 if(measReqEvt->measPeriod != 0)
1026 /* L2 MEAS AGHOSH */
1027 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1028 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1030 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1035 #if (ERRCLASS & ERRCLS_ADD_RES)
1036 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1037 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1038 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1043 measType = measReqEvt->measReq.measType;
1045 if((measType != LKW_L2MEAS_DL_IP) &&
1046 (measType != LKW_L2MEAS_ACT_UE) &&
1047 (measType != LKW_L2MEAS_DL_DISC) &&
1048 (measType != LKW_L2MEAS_DL_DELAY) &&
1049 (measType != LKW_L2MEAS_UU_LOSS) &&
1050 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1052 measCfmEvt.transId = measReqEvt->transId;
1053 measCfmEvt.measType = measType;
1054 measCfmEvt.status.status = LCM_PRIM_NOK;
1055 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1056 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1057 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1061 /* for UL IP throughput meas enable for all QCIs */
1062 if(measType & LKW_L2MEAS_UL_IP)
1064 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1066 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1071 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1072 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1074 RlcL2MeasReqEvt *measEvt;
1077 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1079 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1082 sizeof(RlcL2MeasReqEvt));
1084 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1085 if(measEvt == NULLP)
1087 RLOG0(L_FATAL,"Memory Allocation failed");
1091 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1092 /*Redirect the request to DL task */
1093 /* NOTE:As of today, there are no cases where the Req will fail at DL
1094 as long as it reached the DL, so we don't wait for a confirmation from
1095 DL to send the confirmation to LM*/
1096 /* The interface for sending a confirmation back does not exist today;
1097 it needs to be created when the need arises */
1098 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1101 /* We need to copy the transId for sending back confirms later */
1102 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1104 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1105 if(measEvtCb->measCb.measType & measType)
1107 measEvtCb->transId= measReqEvt->transId;
1110 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1113 } /* RlcMiLkwL2MeasReq */
1117 This function processes L2 Measurement stop request received from the layer manager.
1118 After receving this request, RLC stops L2 Measurement
1119 * @param[in] pst post structure
1120 * @param[in] measType meas Type
1123 * -# Failure : RFAILED
1126 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1129 RlcL2MeasEvtCb *measEvtCb = NULLP;
1132 uint8_t status = ROK;
1135 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1137 /* reset the counter values for the measurement that is stopped */
1138 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1140 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1141 if(measEvtCb->measCb.measType & measType)
1143 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1148 /* for UL IP throughput meas disable for all QCIs */
1149 if(measType & LKW_L2MEAS_UL_IP)
1151 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1153 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1157 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1158 || (measType & LKW_L2MEAS_DL_DELAY))
1160 /*Redirect the request to DL task */
1161 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1164 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1166 status = LCM_PRIM_OK;
1167 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1173 This function processes L2 Measurement Send request received from the layer manager.
1174 After receving this request, RLC sends L2 Measurement
1175 * @param[in] pst post structure
1176 * @param[in] measType meas Type
1179 * -# Failure : RFAILED
1182 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1185 RlcL2MeasEvtCb *measEvtCb = NULLP;
1189 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1191 /* In case of addition of any new measType here ,appropriate handling
1192 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1194 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1195 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1197 /*Redirect the request to DL task */
1198 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1199 /* L2 MEAS AGHOSH */
1203 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1205 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1206 /* L2 MEAS AGHOSH */
1207 if(measEvtCb->measCb.measType & measType)
1209 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1215 #endif /* LTE_L2_MEAS */
1219 * This function configures the RLC data sap
1221 * @param[in] gCb RLC Instance Control Block
1222 * @param[in] cfg RLC LM Sap configuration structure
1225 * -# LCM_REASON_NOT_APPL (SUCCESS)
1226 * -# LCM_REASON_INVALID_SAP
1227 * -# LCM_REASON_MEM_NOAVAIL
1228 * -# LCM_REASON_RECONFIG_FAIL
1230 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1232 RlcKwuSapCb *rlcKwuSapCb;
1234 #if (ERRCLASS & ERRCLS_INT_PAR)
1235 /* Validate the protocol parameters */
1236 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1238 return (LCM_REASON_INVALID_PAR_VAL);
1240 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1242 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1243 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1244 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1246 #if (ERRCLASS & ERRCLS_INT_PAR)
1247 /* Check for reconfiguration */
1248 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1250 RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1251 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1252 /* reconfiguration not allowed */
1253 return (LCM_REASON_RECONFIG_FAIL);
1255 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1257 /* Fill the parameters */
1258 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1260 return (LCM_REASON_NOT_APPL);
1265 * This function configures the RLC control sap
1267 * @param[in] gCb RLC Instance Control Block
1268 * @param[in] cfg RLC LM Sap configuration structure
1271 * -# LCM_REASON_NOT_APPL (SUCCESS)
1272 * -# LCM_REASON_INVALID_SAP
1273 * -# LCM_REASON_INVALID_SAP
1274 * -# LCM_REASON_RECONFIG_FAIL
1276 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1278 RlcCkwSapCb *ckwSap;
1280 #if (ERRCLASS & ERRCLS_INT_PAR)
1281 /* Validate config parameters */
1282 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1284 return (LCM_REASON_INVALID_PAR_VAL);
1287 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1289 /* Get Sap control block */
1290 return (LCM_REASON_INVALID_PAR_VAL);
1294 ckwSap = &(gCb->u.ulCb->ckwSap);
1296 #if (ERRCLASS & ERRCLS_INT_PAR)
1297 /* Check for reconfiguration */
1298 if(ckwSap->state != RLC_SAP_NOT_CFG)
1300 RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
1301 return (LCM_REASON_RECONFIG_FAIL);
1303 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1305 /* Fill the parameters */
1306 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1308 return (LCM_REASON_NOT_APPL);
1313 * This function configures the UDX sap
1315 * @param[in] gCb RLC Instance Control Block
1316 * @param[in] cfg RLC LM Sap configuration structure
1319 * -# LCM_REASON_NOT_APPL (SUCCESS)
1320 * -# LCM_REASON_INVALID_SAP
1321 * -# LCM_REASON_INVALID_SAP
1322 * -# LCM_REASON_RECONFIG_FAIL
1324 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1326 RlcUdxDlSapCb *udxDlSap;
1327 RlcUdxUlSapCb *udxUlSap;
1329 #if (ERRCLASS & ERRCLS_INT_PAR)
1330 /* Validate the protocol parameters */
1331 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1333 return (LCM_REASON_INVALID_PAR_VAL);
1336 /* Get Sap control block */
1337 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1339 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1340 #if (ERRCLASS & ERRCLS_INT_PAR)
1341 /* Check for reconfiguration */
1342 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1344 RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
1345 return (LCM_REASON_RECONFIG_FAIL);
1347 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1349 /* Fill the parameters */
1350 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1354 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1356 #if (ERRCLASS & ERRCLS_INT_PAR)
1357 /* Check for reconfiguration */
1358 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1360 RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
1361 return (LCM_REASON_RECONFIG_FAIL);
1363 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1365 /* Fill the parameters */
1366 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1368 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1369 udxUlSap->retryCnt = 0;
1370 cmInitTimers(&(udxUlSap->bndTmr), 1);
1373 return (LCM_REASON_NOT_APPL);
1378 * This function configures the RGU sap
1380 * @param[in] gCb RLC Instance Control Block
1381 * @param[in] cfg RLC LM Sap configuration structure
1383 * -# LCM_REASON_NOT_APPL (SUCCESS)
1384 * -# LCM_REASON_INVALID_SAP
1385 * -# LCM_REASON_INVALID_SAP
1386 * -# LCM_REASON_RECONFIG_FAIL
1388 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1390 RlcRguSapCb *rguSap;
1392 #if (ERRCLASS & ERRCLS_INT_PAR)
1393 /* Validate the protocol parameters */
1394 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1397 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1398 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1399 return (LCM_REASON_INVALID_PAR_VAL);
1403 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1404 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1406 #if (ERRCLASS & ERRCLS_INT_PAR)
1407 /* Check for reconfiguration */
1408 if(rguSap->state != RLC_SAP_NOT_CFG)
1410 RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
1411 gCb->genCfg.rlcMode, rguSap->state);
1412 return (LCM_REASON_RECONFIG_FAIL);
1414 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1416 /* Fill the parameters */
1417 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1418 rguSap->suId = cfg->sapId;
1419 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1420 rguSap->retryCnt = 0;
1421 rguSap->state = RLC_SAP_CFG;
1423 cmInitTimers(&(rguSap->bndTmr), 1);
1425 return (LCM_REASON_NOT_APPL);
1430 * Validates the RLC general control parameters
1432 * @param[in] cntrl RLC LM structure
1435 * -# LCM_REASON_NOT_APPL (SUCCESS)
1436 * -# LCM_REASON_INVALID_SUBACTION
1437 * -# LCM_REASON_INVALID_ACTION
1439 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1441 S16 reason; /* reason for failure */
1442 uint8_t sAction; /* subaction field */
1444 reason = LCM_REASON_NOT_APPL;
1445 sAction = cntrl->t.cntrl.subAction;
1447 switch (cntrl->t.cntrl.action)
1451 if ((sAction != SAUSTA) &&
1452 (sAction != SADBG) &&
1455 reason = LCM_REASON_INVALID_SUBACTION;
1461 reason = LCM_REASON_INVALID_ACTION;
1470 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1472 * @param[in] gCb RLC Instance Control Block
1476 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1481 if (gCb->init.cfgDone)
1483 /* Deregister the timers */
1484 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1485 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1486 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1487 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1488 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1490 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1492 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1494 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1497 gCb->u.dlCb->shutdownReceived = TRUE;
1498 rlcUtlFreeDlMemory(gCb);
1499 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1501 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1504 if(gCb->u.dlCb->udxDlSap != NULLP)
1506 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1509 if(gCb->u.dlCb->rguDlSap != NULLP)
1511 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1512 gCb->genCfg.maxRguSaps = 0;
1514 if (gCb->u.dlCb->shutdownReceived)
1516 if (gCb->u.dlCb->selfPstMBuf != NULL)
1518 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1520 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1527 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1530 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1532 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1535 if(gCb->u.ulCb->udxUlSap != NULLP)
1537 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1540 if(gCb->u.ulCb->rguUlSap != NULLP)
1542 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1543 gCb->genCfg.maxRguSaps = 0;
1546 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1550 gCb->init.cfgDone = FALSE;
1551 gCb->init.acnt = FALSE;
1552 gCb->init.trc = FALSE;
1554 gCb->init.usta = FALSE;
1562 * Delete all SAPs and Control Blocks
1565 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1566 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1567 * control blocks and lists.
1569 * @params[in] gCb RLC instance control block
1572 * -# LCM_REASON_NOT_APPL (SUCCESS)
1573 * -# LCM_REASON_HASHING_FAILED
1575 static S16 rlcLmmShutdown(RlcCb *gCb)
1577 RlcRguSapCb *rguSap;
1580 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1582 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1584 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1585 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1587 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1593 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1595 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1596 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1598 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1603 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1605 rlcDbmDlShutdown(gCb);
1609 rlcDbmUlShutdown(gCb);
1612 rlcLmmCleanGblRsrcs(gCb);
1614 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1616 return (LCM_REASON_NOT_APPL);
1621 * Function processes the general control request
1623 * @param[in] gCb RLC instance control block
1624 * @param[in] cntrl RLC LM structure
1627 * -# LCM_REASON_NOT_APPL (SUCCESS)
1628 * -# LCM_REASON_INVALID_SUBACTION
1629 * -# LCM_REASON_INVALID_ACTION
1631 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1633 RlcTrcCntrl *trcCntrl; /* trace */
1635 RlcDbgCntrl *dbgCntrl; /* debug */
1637 S16 reason; /* reason for failure */
1639 /* Validate control parameters */
1640 reason = rlcLmmValidateGenCntrl (cntrl);
1642 if (reason != LCM_REASON_NOT_APPL)
1647 switch(cntrl->t.cntrl.action)
1651 switch(cntrl->t.cntrl.subAction)
1655 RLC_SET_USTA_FLAG(gCb, TRUE);
1661 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1662 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1668 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1669 gCb->init.trc = TRUE;
1670 gCb->trcLen = trcCntrl->trcLen;
1671 (gCb->trcMask) |= trcCntrl->trcMask;
1679 switch(cntrl->t.cntrl.subAction)
1683 gCb->init.usta = FALSE;
1689 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1690 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1696 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1697 gCb->init.trc = FALSE;
1698 gCb->trcMask &= ~(trcCntrl->trcMask);
1706 reason = rlcLmmShutdown(gCb);
1715 * Bind/Unbind RLC UDX sap
1717 * @param[in] gCb RLC Instance Control Block
1718 * @param[in] cntrl RLC LM structure
1721 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1722 * -# LCM_REASON_INVALID_SAP
1723 * -# LCM_REASON_INVALID_STATE
1724 * -# LCM_REASON_INVALID_ACTION
1726 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1729 #if (ERRCLASS & ERRCLS_INT_PAR)
1730 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1732 return (LCM_REASON_INVALID_SAP);
1735 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1736 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1738 return (LCM_REASON_INVALID_SAP);
1740 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1742 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1743 #if (ERRCLASS & ERRCLS_INT_PAR)
1745 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1747 RLOG0(L_ERROR,"udxUlSap not configured yet");
1748 return (LCM_REASON_INVALID_STATE);
1750 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1752 switch(cntrl->t.cntrl.action)
1756 if(UDX_SAP.state != RLC_SAP_BND)
1758 /* start timer to wait for bind confirm */
1759 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1760 UDX_SAP.state = RLC_SAP_BINDING;
1761 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1765 /* control request received for an already bound SAP */
1766 return (LCM_REASON_INVALID_STATE);
1772 /* make the state of UDXSAP configured but not bound */
1773 UDX_SAP.state = RLC_SAP_CFG;
1774 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1778 return (LCM_REASON_INVALID_ACTION);
1780 } /* end of switch */
1782 return (LCM_REASON_NOT_APPL);
1787 * Bind/Unbind RLC lower sap
1789 * @param[in] gCb RLC Instance Control Block
1790 * @param[in] cntrl RLC LM structure
1792 * -# LCM_REASON_NOT_APPL (SUCCESS)
1793 * -# LCM_REASON_INVALID_SAP
1794 * -# LCM_REASON_INVALID_STATE
1795 * -# LCM_REASON_INVALID_ACTION
1797 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1799 RlcRguSapCb *rguSap; /* rgu sap pointer */
1801 #if (ERRCLASS & ERRCLS_INT_PAR)
1803 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1804 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1806 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1807 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1808 return (LCM_REASON_INVALID_SAP);
1810 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1811 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1812 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1813 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1815 #if (ERRCLASS & ERRCLS_INT_PAR)
1817 if(rguSap->state == RLC_SAP_NOT_CFG)
1819 RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1820 return (LCM_REASON_INVALID_STATE);
1822 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1824 switch(cntrl->t.cntrl.action)
1828 if(rguSap->state != RLC_SAP_BND)
1830 /* start timer to wait for bind confirm */
1831 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1832 rguSap->state = RLC_SAP_BINDING;
1833 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1834 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1835 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1839 /* control request received for an already bound SAP */
1840 return (LCM_REASON_INVALID_STATE);
1846 /* make the state of RGUSAP is configure but not bound */
1847 rguSap->state = RLC_SAP_CFG;
1848 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1852 return (LCM_REASON_INVALID_ACTION);
1854 } /* end of switch */
1856 return (LCM_REASON_NOT_APPL);
1861 * Function gather the general KWU SAP status
1863 * @param[in] gCb RLC Instance Control Block
1864 * @param[in] sta LM KWU Sap Status structure
1867 * -# LCM_REASON_NOT_APPL (SUCCESS)
1868 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1870 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1872 RlcKwuSapCb *rlcKwSapCb;
1874 #if (ERRCLASS & ERRCLS_INT_PAR)
1875 /* Validate the protocol parameters */
1876 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1879 return (LCM_REASON_INVALID_PAR_VAL);
1883 /* Get Sap control block */
1884 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1885 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1886 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1888 sta->state = rlcKwSapCb->state;
1890 return (LCM_REASON_NOT_APPL);
1895 * Function gather the general RGU SAP status
1897 * @param[in] gCb RLC Instance Control Block
1898 * @param[in] sta LM RGU Sap Status structure
1900 * -# LCM_REASON_NOT_APPL (SUCCESS)
1901 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1903 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1906 #if (ERRCLASS & ERRCLS_INT_PAR)
1907 /* Validate the protocol parameters */
1908 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1910 return (LCM_REASON_INVALID_PAR_VAL);
1914 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1915 gCb->u.dlCb->rguDlSap[sta->suId].state :
1916 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1918 return (LCM_REASON_NOT_APPL);
1923 * Function gather the general CKW SAP status
1925 * @param[in] gCb RLC Instance Control Block
1926 * @param[in] sta LM CKW Sap Status structure
1928 * -# LCM_REASON_NOT_APPL (SUCCESS)
1929 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1931 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1934 #if (ERRCLASS & ERRCLS_INT_PAR)
1935 /* Validate config parameters */
1936 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1938 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1940 return (LCM_REASON_INVALID_PAR_VAL);
1943 sta->state = gCb->u.ulCb->ckwSap.state;
1945 return (LCM_REASON_NOT_APPL);
1951 * Gather the general statistics
1953 * @param[in] gCb RLC Instance Control Block
1954 * @param[in] sts LM general statistics structure
1955 * @param[in] action action
1957 * -# LCM_REASON_NOT_APPL (SUCCESS)
1958 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1960 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1963 #if (ERRCLASS & ERRCLS_INT_PAR)
1964 /* Validate protocol parameters */
1965 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1967 return (LCM_REASON_INVALID_PAR_VAL);
1973 if(action == LKW_ZEROSTS)
1975 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1978 return (LCM_REASON_NOT_APPL);
1983 * Gather the SAP statistics
1985 * @param[in] gCb RLC Instance Control Block
1986 * @param[in] sts LM general statistics structure
1987 * @param[in] elmnt element
1988 * @param[in] action action
1991 * -# LCM_REASON_NOT_APPL (SUCCESS)
1992 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
1994 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
1997 /* Validate protocol parameters */
1998 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2000 return (LCM_REASON_INVALID_PAR_VAL);
2006 RlcKwuSapSts *rlckwuSap;
2007 RlcKwuSapCb *rlcKwuSapCb;
2008 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2010 /* Get Sap control block */
2011 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2012 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2013 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2014 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2017 *rlckwuSap = rlcKwuSapCb->sts;
2019 if (action == LKW_ZEROSTS)
2021 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2025 /* kw005.201 removed RGUSAP statistics support */
2028 RlcCkwCntSts *ckwSap;
2029 ckwSap = &sts->t.sts.s.ckwSap;
2030 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2032 return (LCM_REASON_INVALID_PAR_VAL);
2035 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2037 if (action == LKW_ZEROSTS)
2039 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2044 return (LCM_REASON_INVALID_ELMNT);
2047 SGetDateTime(&sts->t.sts.dt);
2049 return (LCM_REASON_NOT_APPL);
2054 * This function sends Unsolicited Status Indication to the Layer Management
2057 * @param[in] gCb RLC Instance Control Block
2058 * @param[in] category Category
2059 * @param[in] event event
2060 * @param[in] cause cause
2061 * @param[in] UeId ueId
2062 * @param[in] Qci qci
2067 Void rlcLmmSendAlarm
2077 #else /* LTE_L2_MEAS */
2078 Void rlcLmmSendAlarm
2087 #endif /* LTE_L2_MEAS */
2089 RlcMngmt usta; /* Rlc Management Structure */
2091 if(gCb->init.usta == FALSE)
2096 usta.hdr.elmId.elmnt = STGEN;
2097 usta.hdr.entId.ent = gCb->init.ent;
2098 usta.hdr.entId.inst = gCb->init.inst;
2100 /* fill in the event and category */
2101 usta.t.usta.alarm.category = category;
2102 usta.t.usta.alarm.event = event;
2103 usta.t.usta.alarm.cause = cause;
2105 /* set the suId and ueId */
2106 usta.t.usta.ueId = ueId;
2107 usta.t.usta.suId = suId;
2108 /* kw005.201 added support for L2 Measurement */
2110 if(event == LKW_EVT_MEAS_HALT)
2112 usta.t.usta.qci = qci;
2114 #endif /* LTE_L2_MEAS */
2115 /* update the date and time */
2116 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2118 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2126 * This function sends trace indication to LM
2128 * @param[in] gCb RLC Instance Control Block
2129 * @param[in] event event
2130 * @param[in] mBuf meessage buffer
2136 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2138 RlcMngmt trc; /* RLC management control block */
2145 RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2149 memset(&trc, 0, sizeof(RlcMngmt));
2151 pst = gCb->init.lmPst;
2153 trc.t.trc.event = event;
2154 SGetDateTime(&trc.t.trc.dt);
2155 trc.cfm.status = LCM_PRIM_OK;
2156 trc.cfm.reason = LCM_REASON_NOT_APPL;
2160 /* Check if the whole buffer is to be sent in Trace indication */
2161 if(gCb->trcLen == LKW_FULL_TRACE)
2163 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2166 /* rg005.201 removed SPutSBuf on error */
2167 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2170 /* Send Trace Indication to Layer manager */
2171 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2173 /* check if only a specified number of bytes are to be sent */
2174 else if(gCb->trcLen > 0)
2176 /* Get the length of the recvd message buffer */
2177 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2179 RLOG0(L_ERROR,"SFndLenMsg Failed");
2182 /* Check if the recvd buffer size is less than request trace len */
2183 if(bufLen < gCb->trcLen)
2185 /* Copy the whole of the recvd buffer in trace indication */
2187 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2190 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2194 /* Send Trace Indication to Layer manager */
2195 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2199 /* if the recvd buffer size is greater than request trace len */
2200 /* Get a temporary buffer to store the msg */
2201 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2203 #if (ERRCLASS & ERRCLS_INT_PAR)
2204 if(tempBuf == NULLP)
2206 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2208 RLOG0(L_FATAL,"Memory Allocation failed");
2209 return (LCM_REASON_MEM_NOAVAIL);
2211 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2213 /* Copy trcLen nos of bytes from the recvd message */
2214 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2216 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2220 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2222 RLOG0(L_FATAL,"Memory Allocation failed");
2225 /* Copy the tempBuf data to dst mBuf */
2226 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2228 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2232 /* Free the memory allocated for tempBuf */
2233 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2234 /* Send Trace Indication to Layer manager */
2235 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2241 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2250 * Activate Task - timer
2253 * Invoked by system services to activate a task with a timer tick.
2255 * @param[in] ent entity
2256 * @param[in] inst instance
2264 S16 rlcActvTmr(Ent ent,Inst inst)
2268 if (inst >= MAX_RLC_INSTANCES)
2272 gCb = RLC_GET_RLCCB(inst);
2273 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2276 } /* end of rlcActvTmr */
2279 /********************************************************************30**
2282 **********************************************************************/