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
126 static S16 rlcLmmGenCfg
132 static S16 rlcLmmGenCfg(gCB,cfg)
143 if(cfg->maxUe > RLC_MAX_UE)
145 #if (ERRCLASS & ERRCLS_INT_PAR)
146 RLOG2(L_ERROR, "Invalid maxUe : Max [%lu] Received [%lu]",
149 #endif /* ERRCLASS & ERRCLS_INT_PAR */
150 return (LCM_REASON_INVALID_PAR_VAL);
153 if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
155 #if (ERRCLASS & ERRCLS_INT_PAR)
156 RLOG2(L_ERROR, "Invalid maxKwuSaps : Max [%lu] Received [%lu]",
159 #endif /* ERRCLASS & ERRCLS_INT_PAR */
160 return (LCM_REASON_INVALID_PAR_VAL);
163 if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
165 #if (ERRCLASS & ERRCLS_INT_PAR)
166 RLOG2(L_ERROR, "Invalid maxUduSaps : Max [%lu] Received [%lu]",
169 #endif /* ERRCLASS & ERRCLS_INT_PAR */
170 return (LCM_REASON_INVALID_PAR_VAL);
173 if((cfg->maxRguSaps == 0) || (cfg->maxRguSaps > RLC_MAX_RGUSAPS))
177 return (LCM_REASON_INVALID_PAR_VAL);
179 if(gCb->init.cfgDone == TRUE)
181 /* reconfiguration not supported */
182 return (LCM_REASON_RECONFIG_FAIL);
187 /* Timer Queue Control point initialization */
188 rlcTqCp = &(gCb->rlcTqCp);
189 rlcTqCp->tmrLen = RLC_TMR_LEN;
192 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
194 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
195 if (gCb->u.dlCb == NULLP)
197 RLOG0(L_FATAL,"Memory Allocation failed");
198 return (LCM_REASON_MEM_NOAVAIL);
201 /* allocate memory to the KWU sap's */
202 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
203 (Size)sizeof(RlcKwuSapCb));
205 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
207 #if (ERRCLASS & ERRCLS_INT_PAR)
208 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
210 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
211 RLOG0(L_FATAL,"Memory Allocation failed");
212 return (LCM_REASON_MEM_NOAVAIL);
214 #endif /* ERRCLASS & ERRCLS_INT_PAR */
216 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
218 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
219 (Size)sizeof(RlcUdxDlSapCb));
221 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
222 #if (ERRCLASS & ERRCLS_INT_PAR)
223 if(gCb->u.dlCb->udxDlSap == NULLP)
225 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
226 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
227 RLOG0(L_FATAL,"Memory Allocation failed");
228 return (LCM_REASON_MEM_NOAVAIL);
230 #endif /* ERRCLASS & ERRCLS_INT_PAR */
232 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
233 (Size)sizeof(RlcRguSapCb));
234 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
235 #if (ERRCLASS & ERRCLS_INT_PAR)
236 if(gCb->u.dlCb->rguDlSap == NULLP)
238 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
239 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
240 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
242 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
243 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
244 return (LCM_REASON_MEM_NOAVAIL);
246 #endif /* ERRCLASS & ERRCLS_INT_PAR */
249 /* Initialize the Ue and Cell hash list */
250 ret = rlcDbmDlInit(gCb);
253 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
254 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
255 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
256 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
257 RLOG0(L_FATAL,"RLC DL Initialization failed");
258 return (LCM_REASON_MEM_NOAVAIL);
261 /* Register the timer */
262 /*Pradeep: changing the SRegTmrMt() to SRegTmr()*/
263 if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
266 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
267 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
268 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
269 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
271 return (LCM_REASON_REGTMR_FAIL);
274 /* initializations for background processing of freeing memory */
275 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
276 rlcUtlInitializeSelfPst(gCb);
278 if(SGetMsg(gCb->init.region,
280 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
282 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
283 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
284 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
285 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
287 return (LCM_REASON_MEM_NOAVAIL);
291 rlcUtlL2MeasDlInit(gCb);
294 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
296 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
297 if (gCb->u.ulCb == NULLP)
299 RLOG0(L_FATAL,"Memory Allocation failed");
300 return (LCM_REASON_MEM_NOAVAIL);
303 /* allocate memory to the KWU sap's */
304 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
305 (Size)sizeof(RlcKwuSapCb));
307 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
309 #if (ERRCLASS & ERRCLS_INT_PAR)
310 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
312 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
313 RLOG0(L_FATAL,"Memory Allocation failed");
314 return (LCM_REASON_MEM_NOAVAIL);
316 #endif /* ERRCLASS & ERRCLS_INT_PAR */
318 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
320 /* allocate memory to the KWU sap's */
321 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
322 (Size)sizeof(RlcUdxUlSapCb));
324 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
326 #if (ERRCLASS & ERRCLS_INT_PAR)
327 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
329 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
330 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
331 RLOG0(L_FATAL,"Memory Allocation failed");
332 return (LCM_REASON_MEM_NOAVAIL);
334 #endif /* ERRCLASS & ERRCLS_INT_PAR */
336 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
337 (Size)sizeof(RlcRguSapCb));
338 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
339 #if (ERRCLASS & ERRCLS_INT_PAR)
340 if(gCb->u.ulCb->rguUlSap == NULLP)
342 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
343 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
344 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
346 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
347 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
348 return (LCM_REASON_MEM_NOAVAIL);
350 #endif /* ERRCLASS & ERRCLS_INT_PAR */
352 /* Initialize the Ue and Cell hash list */
353 ret = rlcDbmUlInit(gCb);
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));
360 RLOG0(L_FATAL,"RLC DL Initialization failed");
363 /* Register the timer */
365 if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
368 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
369 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
370 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
371 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
373 return (LCM_REASON_REGTMR_FAIL);
377 rlcUtlL2MeasUlInit(gCb);
382 #if (ERRCLASS & ERRCLS_INT_PAR)
383 RLOG0(L_ERROR, "Received Invalid RLC Mode");
384 #endif /* ERRCLASS & ERRCLS_INT_PAR */
386 return (LCM_REASON_INVALID_PAR_VAL);
388 /* Timer Initialization */
389 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
391 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
393 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
395 gCb->init.lmPst.srcProcId = gCb->init.procId;
396 gCb->init.lmPst.srcEnt = gCb->init.ent;
397 gCb->init.lmPst.srcInst = gCb->init.inst;
398 gCb->init.lmPst.event = EVTNONE;
400 /* kw002.201 For multi core and multi region,no need to reinitiailize the
401 * region again . This would be done with kwActvInit from SSI */
402 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
403 gCb->init.region = cfg->lmPst.region;
404 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
405 gCb->init.pool = cfg->lmPst.pool;
407 gCb->init.cfgDone = TRUE;
409 return (LCM_REASON_NOT_APPL);
414 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
416 * @param[in] gCb RLC Instance Control Block
417 * @param[in] pst Post structure
418 * @param[in] cfm RLC LM structure
419 * @param[in] type Type of LM message
420 * @param[in] hdr Message header
426 static Void rlcLmmSendCfm
435 static Void rlcLmmSendCfm(gCb,pst, cfm, type, hdr)
443 Pst rPst; /* Reply post structure */
445 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
447 /* reply post structure for confirmation */
450 rPst.srcEnt = gCb->init.ent;
451 rPst.srcInst = gCb->init.inst;
452 cfm->hdr.entId.ent = gCb->init.ent;
453 cfm->hdr.entId.inst = gCb->init.inst;
457 rPst.srcEnt = pst->dstEnt;
458 rPst.srcInst = pst->dstInst;
459 cfm->hdr.entId.ent = pst->dstEnt;
460 cfm->hdr.entId.inst = pst->dstInst;
462 rPst.srcProcId = SFndProcId();
463 rPst.dstEnt = pst->srcEnt;
464 rPst.dstInst = pst->srcInst;
465 rPst.dstProcId = pst->srcProcId;
466 rPst.selector = hdr->response.selector;
467 rPst.prior = hdr->response.prior;
468 rPst.route = hdr->response.route;
469 rPst.region = hdr->response.mem.region;
470 rPst.pool= hdr->response.mem.pool;
472 /* Fill the reply header */
473 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
474 cfm->hdr.transId = hdr->transId;
479 RlcMiRlcConfigCfm(&rPst,cfm);
482 SGetDateTime(&(cfm->t.cntrl.dt));
483 RlcMiLkwCntrlCfm(&rPst,cfm);
486 SGetDateTime(&(cfm->t.sts.dt));
487 RlcMiLkwStsCfm(&rPst,0,cfm);
490 SGetDateTime(&(cfm->t.ssta.dt));
491 RlcMiLkwStaCfm(&rPst,cfm);
494 #if (ERRCLASS & ERRCLS_INT_PAR)
495 RLOG0(L_ERROR, "Received Invalid Message Type");
500 #endif /* ERRCLASS & ERRCLS_INT_PAR */
510 * This function processes configuration requests received from the layer
514 * The configuration requests can be for general configuration, or
515 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
516 * request can be determined from the elmId field in the header of the layer
517 * manager message.This function is called by the layer manager to configure
520 * This function implements the following logic:
522 * - if genCfg is not done, send negative Cfm to the layer manager;
524 * - switch (cfg->hdr.elmId.elmnt)
526 * - update the genCfg field in RlCb;
527 * - allocate the maximum static memory required by the RLC product;
528 * - register the timer service by calling SReqTmr;
529 * - set CfgDone for not configuring again;
531 * - if all the parameters are valid, then allocate the KwuSap control
533 * - update the SAP control block with the information provided in the
534 * - configuration request;
535 * - send configuration confirm with the status, success;
537 * - if all the parametes are valid, then allocate the CkwSap control
539 * - update the SAP control block with the information provided in the
540 * configuration request;
541 * - send configuration confirm with the status, success;
543 * - if all the parametes are valid, then allocate the rguSap control
545 * - update the SAP control block with the information provided in the
546 * configuration request;
547 * - send configuration confirm with the status, success;
549 * - if all the parametes are valid, then allocate the udxSap control
551 * - update the SAP control block with the information provided in the
552 * configuration request;
553 * - send configuration confirm with the status, success;
556 * @param[in] pst post structure
557 * @param[in] cfg LM management structure
561 * -# Failure : RFAILED
565 uint8_t RlcMiRlcConfigReq
571 uint8_t RlcMiRlcConfigReq (pst, cfg)
576 Reason reason; /* failure reason */
579 #if (ERRCLASS & ERRCLS_INT_PAR)
580 /* Check if the instance is configured */
581 if (pst->dstInst >= MAX_RLC_INSTANCES)
583 cfg->cfm.status = LCM_PRIM_NOK;
584 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
585 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
590 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
594 cfg->cfm.status = LCM_PRIM_NOK;
595 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
596 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
599 /* check configuration is done or not */
600 if ((tRlcCb->init.cfgDone != TRUE) &&
601 (cfg->hdr.elmId.elmnt != STGEN))
604 * if general config is not over then use pst structure
605 * in primitive to communicate to stack manager
608 cfg->cfm.status = LCM_PRIM_NOK;
609 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
610 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
614 RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
616 switch(cfg->hdr.elmId.elmnt)
620 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
625 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
630 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
635 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
640 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
645 reason = LCM_REASON_INVALID_ELMNT;
650 if (reason == LCM_REASON_NOT_APPL)
652 cfg->cfm.status = LCM_PRIM_OK;
653 cfg->cfm.reason = LCM_REASON_NOT_APPL;
654 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
659 cfg->cfm.status = LCM_PRIM_NOK;
660 cfg->cfm.reason = reason;
661 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
668 * The layer manager initiates and uses the management-control procedure to
669 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
670 * can be called more than once and at any time after the
671 * management-configuration procedure.The control request primitive
672 * is confirmed by a RlcMiLkwCntrlCfm primitive.
675 * This function implements the following logic:
677 * - if(cfgDone = FALSE)
678 * - send negative confirmation to the layer manager;
681 * - switch(cntrl->hdr.elmId.elmnt)
685 * - switch(subAction)
687 * - enable the unsolicited status flag;
688 * - send the control Cfm with success;
690 * - set the debug mask;
691 * - send the control Cfm with success;
693 * - enable the trace flag;
694 * - send the control Cfm with success;
696 * - switch(subAction)
698 * - disable the unsolicited status flag;
699 * - send the control Cfm with success;
701 * - disable the trace flag;
702 * - send the control Cfm with success;
711 * @param[in] pst post structure
712 * @param[in] cntrl LM management structure
719 uint8_t RlcMiLkwCntrlReq
725 uint8_t RlcMiLkwCntrlReq(pst, cntrl)
730 Reason reason; /* failure reason */
733 #if (ERRCLASS & ERRCLS_INT_PAR)
734 /* Check if the instance is configured */
735 if (pst->dstInst >= MAX_RLC_INSTANCES)
737 cntrl->cfm.status = LCM_PRIM_NOK;
738 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
740 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
745 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
749 cntrl->cfm.status = LCM_PRIM_NOK;
750 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
751 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
755 if (!(tRlcCb->init.cfgDone))
757 cntrl->cfm.status = LCM_PRIM_NOK;
758 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
759 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
762 RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
764 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
765 * In all error cases appropriate reason is returned
766 * by the functions below
769 switch (cntrl->hdr.elmId.elmnt)
773 /* general control */
774 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
779 /* Lower SAP control */
780 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
786 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
791 reason = LCM_REASON_INVALID_ELMNT;
796 if (reason == LCM_REASON_NOT_APPL)
798 cntrl->cfm.status = LCM_PRIM_OK;
799 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
803 cntrl->cfm.status = LCM_PRIM_NOK;
804 cntrl->cfm.reason = reason;
807 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
814 * This function processes solicited status requests received from the layer
815 * manager. The layer manager can request status information regarding the
816 * system ID, RGUSAP,KWUSAP, or CKWSAP.
818 * @param[in] pst post structure
819 * @param[in] sta LM management structure
831 S16 RlcMiLkwStaReq(pst, sta)
836 RlcMngmt rSta; /* Status */
837 Reason reason; /* Failure reason */
840 #if (ERRCLASS & ERRCLS_INT_PAR)
841 /* Check if the instance is configured */
842 if (pst->dstInst >= MAX_RLC_INSTANCES)
844 sta->cfm.status = LCM_PRIM_NOK;
845 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
847 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
852 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
855 sta->cfm.status = LCM_PRIM_NOK;
856 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
858 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
862 RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
864 reason = LCM_REASON_NOT_APPL;
866 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
867 switch (sta->hdr.elmId.elmnt)
871 reason = LCM_REASON_NOT_APPL;
872 rlcGetSId(&rSta.t.ssta.s.sysId);
877 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
878 &sta->t.ssta.s.rlckwuSap,
879 sizeof (RlcKwuSapSta));
881 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
886 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
887 &sta->t.ssta.s.rguSap,
888 sizeof (RlcRguSapSta));
890 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
895 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
896 &sta->t.ssta.s.ckwSap,
897 sizeof (RlcCkwCntSapSta));
899 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
904 reason = LCM_REASON_INVALID_ELMNT;
907 } /* end of switch */
909 if (reason == LCM_REASON_NOT_APPL)
911 rSta.cfm.status = LCM_PRIM_OK;
912 rSta.cfm.reason = LCM_REASON_NOT_APPL;
916 rSta.cfm.status = LCM_PRIM_NOK;
917 rSta.cfm.reason = reason;
919 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
926 * This function processes statistics requests received from the layer
930 * After collecting the statistics, ir calls the statistics confirm function
931 * to send the statistics to the layer manager.
933 * - switch(sts->hdr.elmId.elmnt)
935 * - get the general statistics from the KW control block;
936 * - if (action = RESET)
937 * - reset the general statistic field in the RlCb;
938 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
942 * - get the SAP specific statistics from KW control block;
943 * - if (action = RESET)
944 * - reset the general statistic field in the RlCb;
945 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
948 * @param[in] pst post structure
949 * @param[in] action action
950 * @param[in] sts LM management structure
964 S16 RlcMiLkwStsReq (pst, action, sts)
970 RlcMngmt rSts; /* Statistics */
971 Reason reason; /* Reason for failure */
974 #if (ERRCLASS & ERRCLS_INT_PAR)
975 /* Check if the instance is configured */
976 if (pst->dstInst >= MAX_RLC_INSTANCES)
978 rSts.cfm.status = LCM_PRIM_NOK;
979 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
981 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
986 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
989 rSts.cfm.status = LCM_PRIM_NOK;
990 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
992 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
996 RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
998 sts->hdr.elmId.elmnt);
1000 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
1002 switch (sts->hdr.elmId.elmnt)
1006 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
1012 if( sts->hdr.elmId.elmnt == STKWUSAP)
1014 /* kw005.201, modified the element of rlckwuSap from suId to spId */
1015 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
1017 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
1022 reason = LCM_REASON_INVALID_ELMNT;
1027 if (reason == LCM_REASON_NOT_APPL)
1029 rSts.cfm.status = LCM_PRIM_OK;
1030 rSts.cfm.reason = LCM_REASON_NOT_APPL;
1034 rSts.cfm.status = LCM_PRIM_NOK;
1035 rSts.cfm.reason = reason;
1037 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
1042 /* kw005.201 added support for L2 Measurement */
1046 This function processes L2 Measurement requests received from the layer manager.
1047 The L2 Measurement is start for a time period and after the timer expiry, the
1048 measurement confirm is sent.
1050 - Accept only one set of measurements.
1051 - Allocate and initialise RlcL2MeasEvtCb.
1052 - Validate if the measurement is already in progress.
1053 - Loop through the existing measEvtCb with matching measType
1054 - Check if measurement is running for any qci present in the measReq
1055 - If present, move the qCi to list of invalid qCIs.
1056 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
1057 - For the number of measurements requested.
1058 - For all Ues with RBs matching qCI.
1059 - Add RbCb to the RB linked list.
1060 - Set rlcRbCb.measOn to measurement type.
1061 - If Meas type is DL_DELAY
1062 - Update COUNT to startCount.
1065 * @param[in] pst post structure
1066 * @param[in] action action
1067 * @param[in] cfg LM management structure
1070 * -# Failure : RFAILED
1073 S16 RlcMiLkwL2MeasReq
1076 RlcL2MeasReqEvt *measReqEvt
1079 S16 RlcMiLkwL2MeasReq (pst, measReqEvt)
1081 RlcL2MeasReqEvt *measReqEvt;
1087 RlcL2MeasCfmEvt measCfmEvt;
1091 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1093 /* Initialize measCfmEvt */
1094 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1095 /* validate the received measReqEvt */
1096 /*LTE_L2_MEAS_PHASE2*/
1097 if(measReqEvt->measPeriod != 0)
1099 /* L2 MEAS AGHOSH */
1100 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1101 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1103 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1108 #if (ERRCLASS & ERRCLS_ADD_RES)
1109 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1110 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1111 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1116 measType = measReqEvt->measReq.measType;
1118 if((measType != LKW_L2MEAS_DL_IP) &&
1119 (measType != LKW_L2MEAS_ACT_UE) &&
1120 (measType != LKW_L2MEAS_DL_DISC) &&
1121 (measType != LKW_L2MEAS_DL_DELAY) &&
1122 (measType != LKW_L2MEAS_UU_LOSS) &&
1123 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1125 measCfmEvt.transId = measReqEvt->transId;
1126 measCfmEvt.measType = measType;
1127 measCfmEvt.status.status = LCM_PRIM_NOK;
1128 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1129 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1130 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1134 /* for UL IP throughput meas enable for all QCIs */
1135 if(measType & LKW_L2MEAS_UL_IP)
1137 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1139 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1144 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1145 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1147 RlcL2MeasReqEvt *measEvt;
1150 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1152 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1155 sizeof(RlcL2MeasReqEvt));
1157 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1158 if(measEvt == NULLP)
1160 RLOG0(L_FATAL,"Memory Allocation failed");
1164 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1165 /*Redirect the request to DL task */
1166 /* NOTE:As of today, there are no cases where the Req will fail at DL
1167 as long as it reached the DL, so we don't wait for a confirmation from
1168 DL to send the confirmation to LM*/
1169 /* The interface for sending a confirmation back does not exist today;
1170 it needs to be created when the need arises */
1171 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1174 /* We need to copy the transId for sending back confirms later */
1175 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1177 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1178 if(measEvtCb->measCb.measType & measType)
1180 measEvtCb->transId= measReqEvt->transId;
1183 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1186 } /* RlcMiLkwL2MeasReq */
1190 This function processes L2 Measurement stop request received from the layer manager.
1191 After receving this request, RLC stops L2 Measurement
1192 * @param[in] pst post structure
1193 * @param[in] measType meas Type
1196 * -# Failure : RFAILED
1200 S16 RlcMiLkwL2MeasStopReq
1206 S16 RlcMiLkwL2MeasStopReq (pst, measType)
1212 RlcL2MeasEvtCb *measEvtCb = NULLP;
1215 uint8_t status = ROK;
1218 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1220 /* reset the counter values for the measurement that is stopped */
1221 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1223 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1224 if(measEvtCb->measCb.measType & measType)
1226 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1231 /* for UL IP throughput meas disable for all QCIs */
1232 if(measType & LKW_L2MEAS_UL_IP)
1234 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1236 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1240 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1241 || (measType & LKW_L2MEAS_DL_DELAY))
1243 /*Redirect the request to DL task */
1244 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1247 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1249 status = LCM_PRIM_OK;
1250 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1256 This function processes L2 Measurement Send request received from the layer manager.
1257 After receving this request, RLC sends L2 Measurement
1258 * @param[in] pst post structure
1259 * @param[in] measType meas Type
1262 * -# Failure : RFAILED
1266 S16 RlcMiLkwL2MeasSendReq
1272 S16 RlcMiLkwL2MeasSendReq (pst, measType)
1278 RlcL2MeasEvtCb *measEvtCb = NULLP;
1282 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1284 /* In case of addition of any new measType here ,appropriate handling
1285 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1287 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1288 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1290 /*Redirect the request to DL task */
1291 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1292 /* L2 MEAS AGHOSH */
1296 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1298 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1299 /* L2 MEAS AGHOSH */
1300 if(measEvtCb->measCb.measType & measType)
1302 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1308 #endif /* LTE_L2_MEAS */
1312 * This function configures the RLC data sap
1314 * @param[in] gCb RLC Instance Control Block
1315 * @param[in] cfg RLC LM Sap configuration structure
1318 * -# LCM_REASON_NOT_APPL (SUCCESS)
1319 * -# LCM_REASON_INVALID_SAP
1320 * -# LCM_REASON_MEM_NOAVAIL
1321 * -# LCM_REASON_RECONFIG_FAIL
1324 static S16 rlcLmmCfgKwuSap
1330 static S16 rlcLmmCfgKwuSap(gCb,cfg)
1335 RlcKwuSapCb *rlcKwuSapCb;
1337 #if (ERRCLASS & ERRCLS_INT_PAR)
1338 /* Validate the protocol parameters */
1339 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1341 return (LCM_REASON_INVALID_PAR_VAL);
1343 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1345 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1346 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1347 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1349 #if (ERRCLASS & ERRCLS_INT_PAR)
1350 /* Check for reconfiguration */
1351 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1353 RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1354 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1355 /* reconfiguration not allowed */
1356 return (LCM_REASON_RECONFIG_FAIL);
1358 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1360 /* Fill the parameters */
1361 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1363 return (LCM_REASON_NOT_APPL);
1368 * This function configures the RLC control sap
1370 * @param[in] gCb RLC Instance Control Block
1371 * @param[in] cfg RLC LM Sap configuration structure
1374 * -# LCM_REASON_NOT_APPL (SUCCESS)
1375 * -# LCM_REASON_INVALID_SAP
1376 * -# LCM_REASON_INVALID_SAP
1377 * -# LCM_REASON_RECONFIG_FAIL
1380 static S16 rlcLmmCfgCkwSap
1386 static S16 rlcLmmCfgCkwSap(gCb,cfg)
1391 RlcCkwSapCb *ckwSap;
1393 #if (ERRCLASS & ERRCLS_INT_PAR)
1394 /* Validate config parameters */
1395 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1397 return (LCM_REASON_INVALID_PAR_VAL);
1400 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1402 /* Get Sap control block */
1403 return (LCM_REASON_INVALID_PAR_VAL);
1407 ckwSap = &(gCb->u.ulCb->ckwSap);
1409 #if (ERRCLASS & ERRCLS_INT_PAR)
1410 /* Check for reconfiguration */
1411 if(ckwSap->state != RLC_SAP_NOT_CFG)
1413 RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
1414 return (LCM_REASON_RECONFIG_FAIL);
1416 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1418 /* Fill the parameters */
1419 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1421 return (LCM_REASON_NOT_APPL);
1426 * This function configures the UDX sap
1428 * @param[in] gCb RLC Instance Control Block
1429 * @param[in] cfg RLC LM Sap configuration structure
1432 * -# LCM_REASON_NOT_APPL (SUCCESS)
1433 * -# LCM_REASON_INVALID_SAP
1434 * -# LCM_REASON_INVALID_SAP
1435 * -# LCM_REASON_RECONFIG_FAIL
1438 static S16 rlcLmmCfgUdxSap
1444 static S16 rlcLmmCfgUdxSap(gCb,cfg)
1449 RlcUdxDlSapCb *udxDlSap;
1450 RlcUdxUlSapCb *udxUlSap;
1452 #if (ERRCLASS & ERRCLS_INT_PAR)
1453 /* Validate the protocol parameters */
1454 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1456 return (LCM_REASON_INVALID_PAR_VAL);
1459 /* Get Sap control block */
1460 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1462 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1463 #if (ERRCLASS & ERRCLS_INT_PAR)
1464 /* Check for reconfiguration */
1465 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1467 RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
1468 return (LCM_REASON_RECONFIG_FAIL);
1470 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1472 /* Fill the parameters */
1473 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1477 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1479 #if (ERRCLASS & ERRCLS_INT_PAR)
1480 /* Check for reconfiguration */
1481 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1483 RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
1484 return (LCM_REASON_RECONFIG_FAIL);
1486 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1488 /* Fill the parameters */
1489 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1491 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1492 udxUlSap->retryCnt = 0;
1493 cmInitTimers(&(udxUlSap->bndTmr), 1);
1496 return (LCM_REASON_NOT_APPL);
1501 * This function configures the RGU sap
1503 * @param[in] gCb RLC Instance Control Block
1504 * @param[in] cfg RLC LM Sap configuration structure
1506 * -# LCM_REASON_NOT_APPL (SUCCESS)
1507 * -# LCM_REASON_INVALID_SAP
1508 * -# LCM_REASON_INVALID_SAP
1509 * -# LCM_REASON_RECONFIG_FAIL
1512 static S16 rlcLmmCfgRguSap
1518 static S16 rlcLmmCfgRguSap(gCb,cfg)
1523 RlcRguSapCb *rguSap;
1525 #if (ERRCLASS & ERRCLS_INT_PAR)
1526 /* Validate the protocol parameters */
1527 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1530 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1531 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1532 return (LCM_REASON_INVALID_PAR_VAL);
1536 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1537 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1539 #if (ERRCLASS & ERRCLS_INT_PAR)
1540 /* Check for reconfiguration */
1541 if(rguSap->state != RLC_SAP_NOT_CFG)
1543 RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
1544 gCb->genCfg.rlcMode, rguSap->state);
1545 return (LCM_REASON_RECONFIG_FAIL);
1547 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1549 /* Fill the parameters */
1550 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1551 rguSap->suId = cfg->sapId;
1552 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1553 rguSap->retryCnt = 0;
1554 rguSap->state = RLC_SAP_CFG;
1556 cmInitTimers(&(rguSap->bndTmr), 1);
1558 return (LCM_REASON_NOT_APPL);
1563 * Validates the RLC general control parameters
1565 * @param[in] cntrl RLC LM structure
1568 * -# LCM_REASON_NOT_APPL (SUCCESS)
1569 * -# LCM_REASON_INVALID_SUBACTION
1570 * -# LCM_REASON_INVALID_ACTION
1573 static S16 rlcLmmValidateGenCntrl
1578 static S16 rlcLmmValidateGenCntrl(cntrl)
1582 S16 reason; /* reason for failure */
1583 uint8_t sAction; /* subaction field */
1585 reason = LCM_REASON_NOT_APPL;
1586 sAction = cntrl->t.cntrl.subAction;
1588 switch (cntrl->t.cntrl.action)
1592 if ((sAction != SAUSTA) &&
1593 (sAction != SADBG) &&
1596 reason = LCM_REASON_INVALID_SUBACTION;
1602 reason = LCM_REASON_INVALID_ACTION;
1611 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1613 * @param[in] gCb RLC Instance Control Block
1618 static Void rlcLmmCleanGblRsrcs
1623 static Void rlcLmmCleanGblRsrcs(gCb)
1630 if (gCb->init.cfgDone)
1632 /* Deregister the timers */
1633 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1634 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1635 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1636 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1637 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1639 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1641 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1643 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1646 gCb->u.dlCb->shutdownReceived = TRUE;
1647 rlcUtlFreeDlMemory(gCb);
1648 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1650 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1653 if(gCb->u.dlCb->udxDlSap != NULLP)
1655 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1658 if(gCb->u.dlCb->rguDlSap != NULLP)
1660 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1661 gCb->genCfg.maxRguSaps = 0;
1663 if (gCb->u.dlCb->shutdownReceived)
1665 if (gCb->u.dlCb->selfPstMBuf != NULL)
1667 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1669 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1676 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1679 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1681 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1684 if(gCb->u.ulCb->udxUlSap != NULLP)
1686 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1689 if(gCb->u.ulCb->rguUlSap != NULLP)
1691 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1692 gCb->genCfg.maxRguSaps = 0;
1695 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1699 gCb->init.cfgDone = FALSE;
1700 gCb->init.acnt = FALSE;
1701 gCb->init.trc = FALSE;
1703 gCb->init.usta = FALSE;
1711 * Delete all SAPs and Control Blocks
1714 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1715 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1716 * control blocks and lists.
1718 * @params[in] gCb RLC instance control block
1721 * -# LCM_REASON_NOT_APPL (SUCCESS)
1722 * -# LCM_REASON_HASHING_FAILED
1725 static S16 rlcLmmShutdown
1730 static S16 rlcLmmShutdown(gCb)
1734 RlcRguSapCb *rguSap;
1737 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1739 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1741 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1742 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1744 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1750 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1752 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1753 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1755 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1760 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1762 rlcDbmDlShutdown(gCb);
1766 rlcDbmUlShutdown(gCb);
1769 rlcLmmCleanGblRsrcs(gCb);
1771 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1773 return (LCM_REASON_NOT_APPL);
1778 * Function processes the general control request
1780 * @param[in] gCb RLC instance control block
1781 * @param[in] cntrl RLC LM structure
1784 * -# LCM_REASON_NOT_APPL (SUCCESS)
1785 * -# LCM_REASON_INVALID_SUBACTION
1786 * -# LCM_REASON_INVALID_ACTION
1789 static S16 rlcLmmGenCntrl
1795 static S16 rlcLmmGenCntrl(gCb,cntrl)
1800 RlcTrcCntrl *trcCntrl; /* trace */
1802 RlcDbgCntrl *dbgCntrl; /* debug */
1804 S16 reason; /* reason for failure */
1806 /* Validate control parameters */
1807 reason = rlcLmmValidateGenCntrl (cntrl);
1809 if (reason != LCM_REASON_NOT_APPL)
1814 switch(cntrl->t.cntrl.action)
1818 switch(cntrl->t.cntrl.subAction)
1822 RLC_SET_USTA_FLAG(gCb, TRUE);
1828 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1829 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1835 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1836 gCb->init.trc = TRUE;
1837 gCb->trcLen = trcCntrl->trcLen;
1838 (gCb->trcMask) |= trcCntrl->trcMask;
1846 switch(cntrl->t.cntrl.subAction)
1850 gCb->init.usta = FALSE;
1856 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1857 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1863 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1864 gCb->init.trc = FALSE;
1865 gCb->trcMask &= ~(trcCntrl->trcMask);
1873 reason = rlcLmmShutdown(gCb);
1882 * Bind/Unbind RLC UDX sap
1884 * @param[in] gCb RLC Instance Control Block
1885 * @param[in] cntrl RLC LM structure
1888 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1889 * -# LCM_REASON_INVALID_SAP
1890 * -# LCM_REASON_INVALID_STATE
1891 * -# LCM_REASON_INVALID_ACTION
1894 static S16 rlcLmmUdxSapCntrl
1900 static S16 rlcLmmUdxSapCntrl(gCb,cntrl)
1906 #if (ERRCLASS & ERRCLS_INT_PAR)
1907 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1909 return (LCM_REASON_INVALID_SAP);
1912 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1913 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1915 return (LCM_REASON_INVALID_SAP);
1917 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1919 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1920 #if (ERRCLASS & ERRCLS_INT_PAR)
1922 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1924 RLOG0(L_ERROR,"udxUlSap not configured yet");
1925 return (LCM_REASON_INVALID_STATE);
1927 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1929 switch(cntrl->t.cntrl.action)
1933 if(UDX_SAP.state != RLC_SAP_BND)
1935 /* start timer to wait for bind confirm */
1936 rlcStartTmr(gCb,(PTR)(&UDX_SAP), RLC_EVT_WAIT_BNDCFM);
1937 UDX_SAP.state = RLC_SAP_BINDING;
1938 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1942 /* control request received for an already bound SAP */
1943 return (LCM_REASON_INVALID_STATE);
1949 /* make the state of UDXSAP configured but not bound */
1950 UDX_SAP.state = RLC_SAP_CFG;
1951 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1955 return (LCM_REASON_INVALID_ACTION);
1957 } /* end of switch */
1959 return (LCM_REASON_NOT_APPL);
1964 * Bind/Unbind RLC lower sap
1966 * @param[in] gCb RLC Instance Control Block
1967 * @param[in] cntrl RLC LM structure
1969 * -# LCM_REASON_NOT_APPL (SUCCESS)
1970 * -# LCM_REASON_INVALID_SAP
1971 * -# LCM_REASON_INVALID_STATE
1972 * -# LCM_REASON_INVALID_ACTION
1975 static S16 rlcLmmLSapCntrl
1981 static S16 rlcLmmLSapCntrl(gCb,cntrl)
1986 RlcRguSapCb *rguSap; /* rgu sap pointer */
1988 #if (ERRCLASS & ERRCLS_INT_PAR)
1990 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1991 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1993 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1994 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1995 return (LCM_REASON_INVALID_SAP);
1997 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1998 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1999 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
2000 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
2002 #if (ERRCLASS & ERRCLS_INT_PAR)
2004 if(rguSap->state == RLC_SAP_NOT_CFG)
2006 RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
2007 return (LCM_REASON_INVALID_STATE);
2009 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2011 switch(cntrl->t.cntrl.action)
2015 if(rguSap->state != RLC_SAP_BND)
2017 /* start timer to wait for bind confirm */
2018 rlcStartTmr(gCb,(PTR)(rguSap), RLC_EVT_WAIT_BNDCFM);
2019 rguSap->state = RLC_SAP_BINDING;
2020 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
2021 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
2022 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
2026 /* control request received for an already bound SAP */
2027 return (LCM_REASON_INVALID_STATE);
2033 /* make the state of RGUSAP is configure but not bound */
2034 rguSap->state = RLC_SAP_CFG;
2035 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
2039 return (LCM_REASON_INVALID_ACTION);
2041 } /* end of switch */
2043 return (LCM_REASON_NOT_APPL);
2048 * Function gather the general KWU SAP status
2050 * @param[in] gCb RLC Instance Control Block
2051 * @param[in] sta LM KWU Sap Status structure
2054 * -# LCM_REASON_NOT_APPL (SUCCESS)
2055 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
2058 static S16 rlcLmmGetKwuSapSta
2064 static S16 rlcLmmGetKwuSapSta(gCb,sta)
2069 RlcKwuSapCb *rlcKwSapCb;
2071 #if (ERRCLASS & ERRCLS_INT_PAR)
2072 /* Validate the protocol parameters */
2073 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
2076 return (LCM_REASON_INVALID_PAR_VAL);
2080 /* Get Sap control block */
2081 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2082 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
2083 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
2085 sta->state = rlcKwSapCb->state;
2087 return (LCM_REASON_NOT_APPL);
2092 * Function gather the general RGU SAP status
2094 * @param[in] gCb RLC Instance Control Block
2095 * @param[in] sta LM RGU Sap Status structure
2097 * -# LCM_REASON_NOT_APPL (SUCCESS)
2098 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
2101 static S16 rlcLmmGetRguSapSta
2107 static S16 rlcLmmGetRguSapSta(gCb,sta)
2113 #if (ERRCLASS & ERRCLS_INT_PAR)
2114 /* Validate the protocol parameters */
2115 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
2117 return (LCM_REASON_INVALID_PAR_VAL);
2121 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
2122 gCb->u.dlCb->rguDlSap[sta->suId].state :
2123 gCb->u.ulCb->rguUlSap[sta->suId].state ;
2125 return (LCM_REASON_NOT_APPL);
2130 * Function gather the general CKW SAP status
2132 * @param[in] gCb RLC Instance Control Block
2133 * @param[in] sta LM CKW Sap Status structure
2135 * -# LCM_REASON_NOT_APPL (SUCCESS)
2136 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
2139 static S16 rlcLmmGetCkwCntSapSta
2142 RlcCkwCntSapSta *sta
2145 static S16 rlcLmmGetCkwCntSapSta(gCb,sta)
2147 RlcCkwCntSapSta *sta;
2151 #if (ERRCLASS & ERRCLS_INT_PAR)
2152 /* Validate config parameters */
2153 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
2155 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
2157 return (LCM_REASON_INVALID_PAR_VAL);
2160 sta->state = gCb->u.ulCb->ckwSap.state;
2162 return (LCM_REASON_NOT_APPL);
2168 * Gather the general statistics
2170 * @param[in] gCb RLC Instance Control Block
2171 * @param[in] sts LM general statistics structure
2172 * @param[in] action action
2174 * -# LCM_REASON_NOT_APPL (SUCCESS)
2175 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
2178 static S16 rlcLmmGetGenSts
2185 static S16 rlcLmmGetGenSts(gCb,sts, action)
2192 #if (ERRCLASS & ERRCLS_INT_PAR)
2193 /* Validate protocol parameters */
2194 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
2196 return (LCM_REASON_INVALID_PAR_VAL);
2202 if(action == LKW_ZEROSTS)
2204 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
2207 return (LCM_REASON_NOT_APPL);
2212 * Gather the SAP statistics
2214 * @param[in] gCb RLC Instance Control Block
2215 * @param[in] sts LM general statistics structure
2216 * @param[in] elmnt element
2217 * @param[in] action action
2220 * -# LCM_REASON_NOT_APPL (SUCCESS)
2221 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
2224 static S16 rlcLmmGetSapSts
2232 static S16 rlcLmmGetSapSts(sts, elmnt, action)
2240 /* Validate protocol parameters */
2241 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2243 return (LCM_REASON_INVALID_PAR_VAL);
2249 RlcKwuSapSts *rlckwuSap;
2250 RlcKwuSapCb *rlcKwuSapCb;
2251 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2253 /* Get Sap control block */
2254 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2255 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2256 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2257 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2260 *rlckwuSap = rlcKwuSapCb->sts;
2262 if (action == LKW_ZEROSTS)
2264 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2268 /* kw005.201 removed RGUSAP statistics support */
2271 RlcCkwCntSts *ckwSap;
2272 ckwSap = &sts->t.sts.s.ckwSap;
2273 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2275 return (LCM_REASON_INVALID_PAR_VAL);
2278 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2280 if (action == LKW_ZEROSTS)
2282 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2287 return (LCM_REASON_INVALID_ELMNT);
2290 SGetDateTime(&sts->t.sts.dt);
2292 return (LCM_REASON_NOT_APPL);
2297 * This function sends Unsolicited Status Indication to the Layer Management
2300 * @param[in] gCb RLC Instance Control Block
2301 * @param[in] category Category
2302 * @param[in] event event
2303 * @param[in] cause cause
2304 * @param[in] UeId ueId
2305 * @param[in] Qci qci
2311 Void rlcLmmSendAlarm
2322 Void rlcLmmSendAlarm(category, event, cause, suId, ueId, qci)
2331 #else /* LTE_L2_MEAS */
2333 Void rlcLmmSendAlarm
2343 Void rlcLmmSendAlarm(category, event, cause, suId, ueId)
2351 #endif /* LTE_L2_MEAS */
2353 RlcMngmt usta; /* Rlc Management Structure */
2355 if(gCb->init.usta == FALSE)
2360 usta.hdr.elmId.elmnt = STGEN;
2361 usta.hdr.entId.ent = gCb->init.ent;
2362 usta.hdr.entId.inst = gCb->init.inst;
2364 /* fill in the event and category */
2365 usta.t.usta.alarm.category = category;
2366 usta.t.usta.alarm.event = event;
2367 usta.t.usta.alarm.cause = cause;
2369 /* set the suId and ueId */
2370 usta.t.usta.ueId = ueId;
2371 usta.t.usta.suId = suId;
2372 /* kw005.201 added support for L2 Measurement */
2374 if(event == LKW_EVT_MEAS_HALT)
2376 usta.t.usta.qci = qci;
2378 #endif /* LTE_L2_MEAS */
2379 /* update the date and time */
2380 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2382 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2390 * This function sends trace indication to LM
2392 * @param[in] gCb RLC Instance Control Block
2393 * @param[in] event event
2394 * @param[in] mBuf meessage buffer
2408 S16 rlcLmmSendTrc(gCb,event, mBuf)
2414 RlcMngmt trc; /* RLC management control block */
2421 RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2425 memset(&trc, 0, sizeof(RlcMngmt));
2427 pst = gCb->init.lmPst;
2429 trc.t.trc.event = event;
2430 SGetDateTime(&trc.t.trc.dt);
2431 trc.cfm.status = LCM_PRIM_OK;
2432 trc.cfm.reason = LCM_REASON_NOT_APPL;
2436 /* Check if the whole buffer is to be sent in Trace indication */
2437 if(gCb->trcLen == LKW_FULL_TRACE)
2439 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2442 /* rg005.201 removed SPutSBuf on error */
2443 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2446 /* Send Trace Indication to Layer manager */
2447 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2449 /* check if only a specified number of bytes are to be sent */
2450 else if(gCb->trcLen > 0)
2452 /* Get the length of the recvd message buffer */
2453 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2455 RLOG0(L_ERROR,"SFndLenMsg Failed");
2458 /* Check if the recvd buffer size is less than request trace len */
2459 if(bufLen < gCb->trcLen)
2461 /* Copy the whole of the recvd buffer in trace indication */
2463 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2466 RLOG0(L_ERROR,"SCpyMsgMsg Failed");
2470 /* Send Trace Indication to Layer manager */
2471 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2475 /* if the recvd buffer size is greater than request trace len */
2476 /* Get a temporary buffer to store the msg */
2477 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2479 #if (ERRCLASS & ERRCLS_INT_PAR)
2480 if(tempBuf == NULLP)
2482 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2484 RLOG0(L_FATAL,"Memory Allocation failed");
2485 return (LCM_REASON_MEM_NOAVAIL);
2487 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2489 /* Copy trcLen nos of bytes from the recvd message */
2490 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2492 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2496 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2498 RLOG0(L_FATAL,"Memory Allocation failed");
2501 /* Copy the tempBuf data to dst mBuf */
2502 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2504 RLOG0(L_ERROR,"SCpyMsgFix Failed");
2508 /* Free the memory allocated for tempBuf */
2509 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2510 /* Send Trace Indication to Layer manager */
2511 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2517 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2526 * Activate Task - timer
2529 * Invoked by system services to activate a task with a timer tick.
2531 * @param[in] ent entity
2532 * @param[in] inst instance
2547 S16 rlcActvTmr(ent,inst)
2554 if (inst >= MAX_RLC_INSTANCES)
2558 gCb = RLC_GET_RLCCB(inst);
2559 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2562 } /* end of rlcActvTmr */
2565 /********************************************************************30**
2568 **********************************************************************/