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 /************************************************************************
21 Name: NR RLC - Layer Manager file
25 Desc: It contains the following common functions for processing
26 the all the external interfaces.
40 ************************************************************************/
41 /** @file rlc_layer_mgr.c
42 @brief RLC Layer Manager Module
46 /* header (.h) include files */
47 #include "common_def.h"
48 #include "lkw.h" /* LKW defines */
49 #include "ckw.h" /* CKW defines */
50 #include "kwu.h" /* KWU defines */
51 #include "rgu.h" /* RGU defines */
52 #include "rlc_err.h" /* Err defines */
53 #include "rlc_env.h" /* RLC environment options */
56 /* extern (.x) include files */
57 #include "lkw.x" /* LKW */
58 #include "ckw.x" /* CKW */
59 #include "kwu.x" /* KWU */
60 #include "rgu.x" /* RGU */
62 #include "rlc_utils.h" /* RLC defines */
63 #include "rlc_dl_ul_inf.h"
67 #define RLC_MODULE RLC_DBGMASK_LMM
71 /*********************************************************************
72 * Forward Declaration of LKW Porting Functions
73 ********************************************************************/
74 RlcCb *rlcCb[MAX_RLC_INSTANCES];
75 S16 rlcActvTmr ARGS ((Ent ent, Inst inst));
77 static Void rlcLmmSendCfm ARGS ((RlcCb *gCb,Pst *pst,RlcMngmt *cfm,uint8_t type,
79 static S16 rlcLmmGenCfg ARGS ((RlcCb *gCb, RlcGenCfg *cfg));
80 static S16 rlcLmmCfgKwuSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
81 static S16 rlcLmmCfgUdxSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
82 static S16 rlcLmmCfgCkwSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
83 static S16 rlcLmmCfgRguSap ARGS ((RlcCb *gCb,RlcSapCfg *cfg));
84 static S16 rlcLmmGenCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
85 static S16 rlcLmmUdxSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
86 static S16 rlcLmmLSapCntrl ARGS ((RlcCb *gCb,RlcMngmt *cntrl));
87 static S16 rlcLmmGetKwuSapSta ARGS ((RlcCb *gCb,RlcKwuSapSta *sta));
88 static S16 rlcLmmGetRguSapSta ARGS ((RlcCb *gCb,RlcRguSapSta *sta));
89 static S16 rlcLmmGetCkwCntSapSta ARGS ((RlcCb *gCb,RlcCkwCntSapSta *sta));
90 static S16 rlcLmmGetGenSts ARGS ((RlcCb *gCb,RlcGenSts *sts,Action action));
91 static S16 rlcLmmGetSapSts ARGS ((RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt,Action
95 /*********************************************************************
96 * Primitives for RGU interface
97 ********************************************************************/
100 * Stores the general RLC configuration.
102 * It calculates the memory requirement of the Saps
103 * It also initializes the control blocks, the hash lists and registers
104 * the timers. In case of error it rolls back and reports error in the
105 * confirm.If the general configuration is already done it is treated as
106 * reconfiguration, but right now reconfiguration is not supported.
108 * @param[in] gCb RLC Instance Control Block
109 * @param[in] cfm RLC LM general config structure
112 * LCM_REASON_NOT_APPL (SUCCESS)
113 * LCM_REASON_MEM_NOAVAIL
114 * LCM_REASON_REGTMR_FAIL
115 * LCM_REASON_INVALID_PAR_VAL
116 * LCM_REASON_HASHING_FAILED
118 static S16 rlcLmmGenCfg(RlcCb *gCb,RlcGenCfg *cfg)
126 if(cfg->maxUe > RLC_MAX_UE)
128 #if (ERRCLASS & ERRCLS_INT_PAR)
129 DU_LOG("\nERROR --> RLC : Invalid maxUe : Max [%lu] Received [%lu]",
132 #endif /* ERRCLASS & ERRCLS_INT_PAR */
133 return (LCM_REASON_INVALID_PAR_VAL);
136 if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
138 #if (ERRCLASS & ERRCLS_INT_PAR)
139 DU_LOG("\nERROR --> RLC : Invalid maxKwuSaps : Max [%lu] Received [%lu]",
142 #endif /* ERRCLASS & ERRCLS_INT_PAR */
143 return (LCM_REASON_INVALID_PAR_VAL);
146 if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
148 #if (ERRCLASS & ERRCLS_INT_PAR)
149 DU_LOG("\nERROR --> RLC : Invalid maxUduSaps : Max [%lu] Received [%lu]",
152 #endif /* ERRCLASS & ERRCLS_INT_PAR */
153 return (LCM_REASON_INVALID_PAR_VAL);
156 if((cfg->maxRguSaps == 0) || (cfg->maxRguSaps > RLC_MAX_RGUSAPS))
160 return (LCM_REASON_INVALID_PAR_VAL);
162 if(gCb->init.cfgDone == TRUE)
164 /* reconfiguration not supported */
165 return (LCM_REASON_RECONFIG_FAIL);
170 /* Timer Queue Control point initialization */
171 rlcTqCp = &(gCb->rlcTqCp);
172 rlcTqCp->tmrLen = RLC_TMR_LEN;
175 gCb->rlcThpt.inst = gCb->init.inst;
176 gCb->rlcThpt.thptTmr.tmrEvnt = TMR_NONE;
177 gCb->rlcThpt.numActvUe = 0;
178 memset(gCb->rlcThpt.thptPerUe, 0, MAX_NUM_UE * sizeof(RlcThptPerUe));
180 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
182 RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
183 if (gCb->u.dlCb == NULLP)
185 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
186 return (LCM_REASON_MEM_NOAVAIL);
189 /* allocate memory to the KWU sap's */
190 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
191 (Size)sizeof(RlcKwuSapCb));
193 RLC_ALLOC(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
195 #if (ERRCLASS & ERRCLS_INT_PAR)
196 if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
198 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
199 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
200 return (LCM_REASON_MEM_NOAVAIL);
202 #endif /* ERRCLASS & ERRCLS_INT_PAR */
204 gCb->u.dlCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
206 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
207 (Size)sizeof(RlcUdxDlSapCb));
209 RLC_ALLOC(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
210 #if (ERRCLASS & ERRCLS_INT_PAR)
211 if(gCb->u.dlCb->udxDlSap == NULLP)
213 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
214 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
215 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
216 return (LCM_REASON_MEM_NOAVAIL);
218 #endif /* ERRCLASS & ERRCLS_INT_PAR */
220 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
221 (Size)sizeof(RlcRguSapCb));
222 RLC_ALLOC(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
223 #if (ERRCLASS & ERRCLS_INT_PAR)
224 if(gCb->u.dlCb->rguDlSap == NULLP)
226 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
227 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
228 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
230 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
231 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
232 return (LCM_REASON_MEM_NOAVAIL);
234 #endif /* ERRCLASS & ERRCLS_INT_PAR */
237 /* Initialize the Ue and Cell hash list */
238 ret = rlcDbmDlInit(gCb);
241 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
242 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
243 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
244 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
245 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
246 return (LCM_REASON_MEM_NOAVAIL);
249 /* Register the timer */
250 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
253 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
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));
258 return (LCM_REASON_REGTMR_FAIL);
261 /* initializations for background processing of freeing memory */
262 rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
263 rlcUtlInitializeSelfPst(gCb);
265 if(SGetMsg(gCb->init.region,
267 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
269 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
270 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
271 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
272 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
274 return (LCM_REASON_MEM_NOAVAIL);
278 rlcUtlL2MeasDlInit(gCb);
281 else if(gCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
283 RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
284 if (gCb->u.ulCb == NULLP)
286 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
287 return (LCM_REASON_MEM_NOAVAIL);
290 /* allocate memory to the KWU sap's */
291 rlcSapSize = (Size)((Size) gCb->genCfg.maxKwuSaps *
292 (Size)sizeof(RlcKwuSapCb));
294 RLC_ALLOC(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
296 #if (ERRCLASS & ERRCLS_INT_PAR)
297 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
299 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
300 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
301 return (LCM_REASON_MEM_NOAVAIL);
303 #endif /* ERRCLASS & ERRCLS_INT_PAR */
305 gCb->u.ulCb->numKwuSaps = gCb->genCfg.maxKwuSaps;
307 /* allocate memory to the KWU sap's */
308 rlcUdxSapSize = (Size)((Size) gCb->genCfg.maxUdxSaps *
309 (Size)sizeof(RlcUdxUlSapCb));
311 RLC_ALLOC(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
313 #if (ERRCLASS & ERRCLS_INT_PAR)
314 if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
316 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
317 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
318 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
319 return (LCM_REASON_MEM_NOAVAIL);
321 #endif /* ERRCLASS & ERRCLS_INT_PAR */
323 rguSapSize = (Size)((Size) gCb->genCfg.maxRguSaps *
324 (Size)sizeof(RlcRguSapCb));
325 RLC_ALLOC(gCb,gCb->u.ulCb->rguUlSap, rguSapSize);
326 #if (ERRCLASS & ERRCLS_INT_PAR)
327 if(gCb->u.ulCb->rguUlSap == NULLP)
329 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
330 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
331 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
333 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW043, (ErrVal) cfg->maxUe,
334 "rlcLmmGenCfg: SgetSBuf Failed for rguSap...!");
335 return (LCM_REASON_MEM_NOAVAIL);
337 #endif /* ERRCLASS & ERRCLS_INT_PAR */
339 /* Initialize the Ue and Cell hash list */
340 ret = rlcDbmUlInit(gCb);
343 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
344 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
345 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
346 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
347 DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
350 /* Register the timer */
351 if(ODU_REG_TMR_MT(gCb->init.ent, gCb->init.inst, (uint16_t)cfg->timeRes,
354 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
355 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
356 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
357 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
359 return (LCM_REASON_REGTMR_FAIL);
363 rlcUtlL2MeasUlInit(gCb);
368 #if (ERRCLASS & ERRCLS_INT_PAR)
369 DU_LOG("\nERROR --> RLC : Received Invalid RLC Mode");
370 #endif /* ERRCLASS & ERRCLS_INT_PAR */
372 return (LCM_REASON_INVALID_PAR_VAL);
374 /* Timer Initialization */
375 gCb->rlcTqCp.tmrLen = RLC_TMR_LEN;
377 memset(gCb->rlcTq, NULLP, sizeof(CmTqType) * RLC_TMR_LEN);
379 RLC_MEM_CPY(&(gCb->init.lmPst), &cfg->lmPst, sizeof(Pst));
381 gCb->init.lmPst.srcProcId = gCb->init.procId;
382 gCb->init.lmPst.srcEnt = gCb->init.ent;
383 gCb->init.lmPst.srcInst = gCb->init.inst;
384 gCb->init.lmPst.event = EVTNONE;
386 /* kw002.201 For multi core and multi region,no need to reinitiailize the
387 * region again . This would be done with kwActvInit from SSI */
388 #if !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION)
389 gCb->init.region = cfg->lmPst.region;
390 #endif /* !defined(SS_MULTICORE_SUPPORT) && !defined(SS_M_PROTO_REGION) */
391 gCb->init.pool = cfg->lmPst.pool;
393 gCb->init.cfgDone = TRUE;
395 /* TODO : make this generic for DL and UL after support for UL throughput calculation is added */
396 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
398 /* Starting timer to print throughput */
399 if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
401 DU_LOG("\nINFO --> RLC_DL : Starting Throughput timer");
402 rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
406 return (LCM_REASON_NOT_APPL);
411 * Sends confirmation message to LM Called by RlcMiRlcConfigReq function
413 * @param[in] gCb RLC Instance Control Block
414 * @param[in] pst Post structure
415 * @param[in] cfm RLC LM structure
416 * @param[in] type Type of LM message
417 * @param[in] hdr Message header
422 static Void rlcLmmSendCfm
431 Pst rPst; /* Reply post structure */
433 RLC_MEM_SET(&rPst, 0, sizeof(Pst));
435 /* reply post structure for confirmation */
438 rPst.srcEnt = gCb->init.ent;
439 rPst.srcInst = gCb->init.inst;
440 cfm->hdr.entId.ent = gCb->init.ent;
441 cfm->hdr.entId.inst = gCb->init.inst;
445 rPst.srcEnt = pst->dstEnt;
446 rPst.srcInst = pst->dstInst;
447 cfm->hdr.entId.ent = pst->dstEnt;
448 cfm->hdr.entId.inst = pst->dstInst;
450 rPst.srcProcId = SFndProcId();
451 rPst.dstEnt = pst->srcEnt;
452 rPst.dstInst = pst->srcInst;
453 rPst.dstProcId = pst->srcProcId;
454 rPst.selector = hdr->response.selector;
455 rPst.prior = hdr->response.prior;
456 rPst.route = hdr->response.route;
457 rPst.region = hdr->response.mem.region;
458 rPst.pool= hdr->response.mem.pool;
460 /* Fill the reply header */
461 cfm->hdr.elmId.elmnt = hdr->elmId.elmnt;
462 cfm->hdr.transId = hdr->transId;
467 RlcMiRlcConfigCfm(&rPst,cfm);
470 SGetDateTime(&(cfm->t.cntrl.dt));
471 RlcMiLkwCntrlCfm(&rPst,cfm);
474 SGetDateTime(&(cfm->t.sts.dt));
475 RlcMiLkwStsCfm(&rPst,0,cfm);
478 SGetDateTime(&(cfm->t.ssta.dt));
479 RlcMiLkwStaCfm(&rPst,cfm);
482 #if (ERRCLASS & ERRCLS_INT_PAR)
483 DU_LOG("\nERROR --> RLC : Received Invalid Message Type");
488 #endif /* ERRCLASS & ERRCLS_INT_PAR */
498 * This function processes configuration requests received from the layer
502 * The configuration requests can be for general configuration, or
503 * configuration of RGU, KWU, and CKW SAPs. The type of the configuration
504 * request can be determined from the elmId field in the header of the layer
505 * manager message.This function is called by the layer manager to configure
508 * This function implements the following logic:
510 * - if genCfg is not done, send negative Cfm to the layer manager;
512 * - switch (cfg->hdr.elmId.elmnt)
514 * - update the genCfg field in RlCb;
515 * - allocate the maximum static memory required by the RLC product;
516 * - register the timer service by calling SReqTmr;
517 * - set CfgDone for not configuring again;
519 * - if all the parameters are valid, then allocate the KwuSap control
521 * - update the SAP control block with the information provided in the
522 * - configuration request;
523 * - send configuration confirm with the status, success;
525 * - if all the parametes are valid, then allocate the CkwSap control
527 * - update the SAP control block with the information provided in the
528 * configuration request;
529 * - send configuration confirm with the status, success;
531 * - if all the parametes are valid, then allocate the rguSap 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 udxSap control
539 * - update the SAP control block with the information provided in the
540 * configuration request;
541 * - send configuration confirm with the status, success;
544 * @param[in] pst post structure
545 * @param[in] cfg LM management structure
549 * -# Failure : RFAILED
552 uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
554 Reason reason; /* failure reason */
557 #if (ERRCLASS & ERRCLS_INT_PAR)
558 /* Check if the instance is configured */
559 if (pst->dstInst >= MAX_RLC_INSTANCES)
561 cfg->cfm.status = LCM_PRIM_NOK;
562 cfg->cfm.reason = LCM_REASON_INVALID_INSTANCE;
563 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
568 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
572 cfg->cfm.status = LCM_PRIM_NOK;
573 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
574 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
577 /* check configuration is done or not */
578 if ((tRlcCb->init.cfgDone != TRUE) &&
579 (cfg->hdr.elmId.elmnt != STGEN))
582 * if general config is not over then use pst structure
583 * in primitive to communicate to stack manager
586 cfg->cfm.status = LCM_PRIM_NOK;
587 cfg->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
588 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
592 DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
594 switch(cfg->hdr.elmId.elmnt)
598 reason = rlcLmmGenCfg(tRlcCb,&cfg->t.cfg.s.gen);
603 reason = rlcLmmCfgKwuSap(tRlcCb,&cfg->t.cfg.s.sap);
608 reason = rlcLmmCfgCkwSap(tRlcCb,&cfg->t.cfg.s.sap);
613 reason = rlcLmmCfgRguSap(tRlcCb,&cfg->t.cfg.s.sap);
618 reason = rlcLmmCfgUdxSap(tRlcCb,&cfg->t.cfg.s.sap);
623 reason = LCM_REASON_INVALID_ELMNT;
628 if (reason == LCM_REASON_NOT_APPL)
630 cfg->cfm.status = LCM_PRIM_OK;
631 cfg->cfm.reason = LCM_REASON_NOT_APPL;
632 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
637 cfg->cfm.status = LCM_PRIM_NOK;
638 cfg->cfm.reason = reason;
639 rlcLmmSendCfm(tRlcCb,pst, cfg, TCFG, &cfg->hdr);
646 * The layer manager initiates and uses the management-control procedure to
647 * control RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq)
648 * can be called more than once and at any time after the
649 * management-configuration procedure.The control request primitive
650 * is confirmed by a RlcMiLkwCntrlCfm primitive.
653 * This function implements the following logic:
655 * - if(cfgDone = FALSE)
656 * - send negative confirmation to the layer manager;
659 * - switch(cntrl->hdr.elmId.elmnt)
663 * - switch(subAction)
665 * - enable the unsolicited status flag;
666 * - send the control Cfm with success;
668 * - set the debug mask;
669 * - send the control Cfm with success;
671 * - enable the trace flag;
672 * - send the control Cfm with success;
674 * - switch(subAction)
676 * - disable the unsolicited status flag;
677 * - send the control Cfm with success;
679 * - disable the trace flag;
680 * - send the control Cfm with success;
689 * @param[in] pst post structure
690 * @param[in] cntrl LM management structure
696 uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
698 Reason reason; /* failure reason */
701 #if (ERRCLASS & ERRCLS_INT_PAR)
702 /* Check if the instance is configured */
703 if (pst->dstInst >= MAX_RLC_INSTANCES)
705 cntrl->cfm.status = LCM_PRIM_NOK;
706 cntrl->cfm.reason = LCM_REASON_INVALID_INSTANCE;
708 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
713 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
717 cntrl->cfm.status = LCM_PRIM_NOK;
718 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
719 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
723 if (!(tRlcCb->init.cfgDone))
725 cntrl->cfm.status = LCM_PRIM_NOK;
726 cntrl->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
727 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
730 DU_LOG("\nDEBUG --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
732 /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
733 * In all error cases appropriate reason is returned
734 * by the functions below
737 switch (cntrl->hdr.elmId.elmnt)
741 /* general control */
742 reason = rlcLmmGenCntrl(tRlcCb,cntrl);
747 /* Lower SAP control */
748 reason = rlcLmmLSapCntrl(tRlcCb,cntrl);
754 reason = rlcLmmUdxSapCntrl(tRlcCb,cntrl);
759 reason = LCM_REASON_INVALID_ELMNT;
764 if (reason == LCM_REASON_NOT_APPL)
766 cntrl->cfm.status = LCM_PRIM_OK;
767 cntrl->cfm.reason = LCM_REASON_NOT_APPL;
771 cntrl->cfm.status = LCM_PRIM_NOK;
772 cntrl->cfm.reason = reason;
775 rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
782 * This function processes solicited status requests received from the layer
783 * manager. The layer manager can request status information regarding the
784 * system ID, RGUSAP,KWUSAP, or CKWSAP.
786 * @param[in] pst post structure
787 * @param[in] sta LM management structure
792 S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
794 RlcMngmt rSta; /* Status */
795 Reason reason; /* Failure reason */
798 #if (ERRCLASS & ERRCLS_INT_PAR)
799 /* Check if the instance is configured */
800 if (pst->dstInst >= MAX_RLC_INSTANCES)
802 sta->cfm.status = LCM_PRIM_NOK;
803 sta->cfm.reason = LCM_REASON_INVALID_INSTANCE;
805 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
810 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
813 sta->cfm.status = LCM_PRIM_NOK;
814 sta->cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
816 rlcLmmSendCfm(tRlcCb,pst, sta, TSSTA, &sta->hdr);
820 DU_LOG("\nDEBUG --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
822 reason = LCM_REASON_NOT_APPL;
824 RLC_MEM_SET(&rSta, 0, sizeof(RlcMngmt));
825 switch (sta->hdr.elmId.elmnt)
829 reason = LCM_REASON_NOT_APPL;
830 rlcGetSId(&rSta.t.ssta.s.sysId);
835 RLC_MEM_CPY (&rSta.t.ssta.s.rlckwuSap,
836 &sta->t.ssta.s.rlckwuSap,
837 sizeof (RlcKwuSapSta));
839 reason = rlcLmmGetKwuSapSta (tRlcCb,&rSta.t.ssta.s.rlckwuSap);
844 RLC_MEM_CPY (&rSta.t.ssta.s.rguSap,
845 &sta->t.ssta.s.rguSap,
846 sizeof (RlcRguSapSta));
848 reason = rlcLmmGetRguSapSta (tRlcCb,&rSta.t.ssta.s.rguSap);
853 RLC_MEM_CPY (&rSta.t.ssta.s.ckwSap,
854 &sta->t.ssta.s.ckwSap,
855 sizeof (RlcCkwCntSapSta));
857 reason = rlcLmmGetCkwCntSapSta (tRlcCb,&rSta.t.ssta.s.ckwSap);
862 reason = LCM_REASON_INVALID_ELMNT;
865 } /* end of switch */
867 if (reason == LCM_REASON_NOT_APPL)
869 rSta.cfm.status = LCM_PRIM_OK;
870 rSta.cfm.reason = LCM_REASON_NOT_APPL;
874 rSta.cfm.status = LCM_PRIM_NOK;
875 rSta.cfm.reason = reason;
877 rlcLmmSendCfm(tRlcCb,pst, &rSta, TSSTA, &sta->hdr);
884 * This function processes statistics requests received from the layer
888 * After collecting the statistics, ir calls the statistics confirm function
889 * to send the statistics to the layer manager.
891 * - switch(sts->hdr.elmId.elmnt)
893 * - get the general statistics from the KW control block;
894 * - if (action = RESET)
895 * - reset the general statistic field in the RlCb;
896 * - call RlcMiLkwStsCfm to send statistics back to layer manager;
900 * - get the SAP specific statistics from KW control block;
901 * - if (action = RESET)
902 * - reset the general statistic field in the RlCb;
903 * - call RlcMiLkwStsCfm to send statistics to the layer manager;
906 * @param[in] pst post structure
907 * @param[in] action action
908 * @param[in] sts LM management structure
914 S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
916 RlcMngmt rSts; /* Statistics */
917 Reason reason; /* Reason for failure */
920 #if (ERRCLASS & ERRCLS_INT_PAR)
921 /* Check if the instance is configured */
922 if (pst->dstInst >= MAX_RLC_INSTANCES)
924 rSts.cfm.status = LCM_PRIM_NOK;
925 rSts.cfm.reason = LCM_REASON_INVALID_INSTANCE;
927 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
932 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
935 rSts.cfm.status = LCM_PRIM_NOK;
936 rSts.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
938 rlcLmmSendCfm(tRlcCb,pst, &rSts, TCNTRL, &sts->hdr);
942 DU_LOG("\nDEBUG --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))",
944 sts->hdr.elmId.elmnt);
946 RLC_MEM_SET(&rSts, 0, sizeof(RlcMngmt));
948 switch (sts->hdr.elmId.elmnt)
952 reason = rlcLmmGetGenSts(tRlcCb,&rSts.t.sts.s.gen, action);
958 if( sts->hdr.elmId.elmnt == STKWUSAP)
960 /* kw005.201, modified the element of rlckwuSap from suId to spId */
961 rSts.t.sts.s.rlckwuSap.spId = sts->t.sts.s.rlckwuSap.spId;
963 reason = rlcLmmGetSapSts(tRlcCb,&rSts, sts->hdr.elmId.elmnt, action);
968 reason = LCM_REASON_INVALID_ELMNT;
973 if (reason == LCM_REASON_NOT_APPL)
975 rSts.cfm.status = LCM_PRIM_OK;
976 rSts.cfm.reason = LCM_REASON_NOT_APPL;
980 rSts.cfm.status = LCM_PRIM_NOK;
981 rSts.cfm.reason = reason;
983 rlcLmmSendCfm(tRlcCb,pst, &rSts, TSTS, &sts->hdr);
988 /* kw005.201 added support for L2 Measurement */
992 This function processes L2 Measurement requests received from the layer manager.
993 The L2 Measurement is start for a time period and after the timer expiry, the
994 measurement confirm is sent.
996 - Accept only one set of measurements.
997 - Allocate and initialise RlcL2MeasEvtCb.
998 - Validate if the measurement is already in progress.
999 - Loop through the existing measEvtCb with matching measType
1000 - Check if measurement is running for any qci present in the measReq
1001 - If present, move the qCi to list of invalid qCIs.
1002 - Set RlcL2MeasEvtCb.measOn to TRUE for QCIs to be measured.
1003 - For the number of measurements requested.
1004 - For all Ues with RBs matching qCI.
1005 - Add RbCb to the RB linked list.
1006 - Set rlcRbCb.measOn to measurement type.
1007 - If Meas type is DL_DELAY
1008 - Update COUNT to startCount.
1011 * @param[in] pst post structure
1012 * @param[in] action action
1013 * @param[in] cfg LM management structure
1016 * -# Failure : RFAILED
1018 S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
1023 RlcL2MeasCfmEvt measCfmEvt;
1027 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1029 /* Initialize measCfmEvt */
1030 RLC_MEM_ZERO(&measCfmEvt, sizeof(RlcL2MeasCfmEvt));
1031 /* validate the received measReqEvt */
1032 /*LTE_L2_MEAS_PHASE2*/
1033 if(measReqEvt->measPeriod != 0)
1035 /* L2 MEAS AGHOSH */
1036 if((measReqEvt->measReq.measType & LKW_L2MEAS_DL_IP)||
1037 (measReqEvt->measReq.measType & LKW_L2MEAS_UL_IP))
1039 ret = rlcUtlValidateIpThL2Meas(measReqEvt, &measCfmEvt);
1044 #if (ERRCLASS & ERRCLS_ADD_RES)
1045 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1046 rlcUtlSndUlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1047 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1052 measType = measReqEvt->measReq.measType;
1054 if((measType != LKW_L2MEAS_DL_IP) &&
1055 (measType != LKW_L2MEAS_ACT_UE) &&
1056 (measType != LKW_L2MEAS_DL_DISC) &&
1057 (measType != LKW_L2MEAS_DL_DELAY) &&
1058 (measType != LKW_L2MEAS_UU_LOSS) &&
1059 (measType != LKW_L2MEAS_UL_IP))/* || (qci > LKW_MAX_QCI)*/
1061 measCfmEvt.transId = measReqEvt->transId;
1062 measCfmEvt.measType = measType;
1063 measCfmEvt.status.status = LCM_PRIM_NOK;
1064 measCfmEvt.status.reason = LKW_CAUSE_INVALID_MEASTYPE;
1065 rlcUtlSndDlL2MeasNCfm(tRlcCb, measReqEvt, &measCfmEvt);
1066 RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt))
1070 /* for UL IP throughput meas enable for all QCIs */
1071 if(measType & LKW_L2MEAS_UL_IP)
1073 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1075 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_UL_IP;
1080 (LKW_L2MEAS_DL_IP | LKW_L2MEAS_DL_DISC |
1081 LKW_L2MEAS_DL_DELAY | LKW_L2MEAS_UU_LOSS))
1083 RlcL2MeasReqEvt *measEvt;
1086 udxPst = &(RLC_GET_UDX_SAP(tRlcCb)->pst);
1088 RLC_ALLOC_SHRABL_BUF(udxPst->region,
1091 sizeof(RlcL2MeasReqEvt));
1093 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
1094 if(measEvt == NULLP)
1096 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
1100 memcpy(measEvt, measReqEvt, sizeof(RlcL2MeasReqEvt));
1101 /*Redirect the request to DL task */
1102 /* NOTE:As of today, there are no cases where the Req will fail at DL
1103 as long as it reached the DL, so we don't wait for a confirmation from
1104 DL to send the confirmation to LM*/
1105 /* The interface for sending a confirmation back does not exist today;
1106 it needs to be created when the need arises */
1107 rlcUlUdxL2MeasReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measEvt);
1110 /* We need to copy the transId for sending back confirms later */
1111 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1113 RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1114 if(measEvtCb->measCb.measType & measType)
1116 measEvtCb->transId= measReqEvt->transId;
1119 /*RLC_FREE(tRlcCb, measReqEvt, sizeof(RlcL2MeasReqEvt));*/
1122 } /* RlcMiLkwL2MeasReq */
1126 This function processes L2 Measurement stop request received from the layer manager.
1127 After receving this request, RLC stops L2 Measurement
1128 * @param[in] pst post structure
1129 * @param[in] measType meas Type
1132 * -# Failure : RFAILED
1135 S16 RlcMiLkwL2MeasStopReq(Pst *pst,uint8_t measType)
1138 RlcL2MeasEvtCb *measEvtCb = NULLP;
1141 uint8_t status = ROK;
1144 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1146 /* reset the counter values for the measurement that is stopped */
1147 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1149 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1150 if(measEvtCb->measCb.measType & measType)
1152 rlcUtlResetUlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
1157 /* for UL IP throughput meas disable for all QCIs */
1158 if(measType & LKW_L2MEAS_UL_IP)
1160 for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
1162 tRlcCb->u.ulCb->rlcL2Cb.measOn[cntr] &= ~LKW_L2MEAS_UL_IP;
1166 if((measType & LKW_L2MEAS_DL_IP) || (measType & LKW_L2MEAS_DL_DISC)
1167 || (measType & LKW_L2MEAS_DL_DELAY))
1169 /*Redirect the request to DL task */
1170 rlcUlUdxL2MeasStopReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1173 /*memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
1175 status = LCM_PRIM_OK;
1176 RlcMiLkwL2MeasStopCfm(&tRlcCb->genCfg.lmPst, measType,status);
1182 This function processes L2 Measurement Send request received from the layer manager.
1183 After receving this request, RLC sends L2 Measurement
1184 * @param[in] pst post structure
1185 * @param[in] measType meas Type
1188 * -# Failure : RFAILED
1191 S16 RlcMiLkwL2MeasSendReq(Pst *pst,uint8_t measType)
1194 RlcL2MeasEvtCb *measEvtCb = NULLP;
1198 tRlcCb = RLC_GET_RLCCB(pst->dstInst);
1200 /* In case of addition of any new measType here ,appropriate handling
1201 * has to be done in RLC DL (rlcUtlSndDlL2MeasCfm)*/
1203 (LKW_L2MEAS_DL_DISC | LKW_L2MEAS_DL_DELAY
1204 | LKW_L2MEAS_UU_LOSS| LKW_L2MEAS_DL_IP))
1206 /*Redirect the request to DL task */
1207 rlcUlUdxL2MeasSendReq(&(RLC_GET_UDX_SAP(tRlcCb)->pst),measType);
1208 /* L2 MEAS AGHOSH */
1212 for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
1214 measEvtCb = &(tRlcCb->u.ulCb->rlcL2Cb.rlcL2EvtCb[cntr]);
1215 /* L2 MEAS AGHOSH */
1216 if(measEvtCb->measCb.measType & measType)
1218 rlcUtlHdlL2TmrExp(tRlcCb, measEvtCb);
1224 #endif /* LTE_L2_MEAS */
1228 * This function configures the RLC data sap
1230 * @param[in] gCb RLC Instance Control Block
1231 * @param[in] cfg RLC LM Sap configuration structure
1234 * -# LCM_REASON_NOT_APPL (SUCCESS)
1235 * -# LCM_REASON_INVALID_SAP
1236 * -# LCM_REASON_MEM_NOAVAIL
1237 * -# LCM_REASON_RECONFIG_FAIL
1239 static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
1241 RlcKwuSapCb *rlcKwuSapCb;
1243 #if (ERRCLASS & ERRCLS_INT_PAR)
1244 /* Validate the protocol parameters */
1245 if((cfg->sapId >= (S16)gCb->genCfg.maxKwuSaps) || (cfg->sapId < 0))
1247 return (LCM_REASON_INVALID_PAR_VAL);
1249 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1251 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1252 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + cfg->sapId):
1253 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + cfg->sapId);
1255 #if (ERRCLASS & ERRCLS_INT_PAR)
1256 /* Check for reconfiguration */
1257 if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
1259 DU_LOG("\nERROR --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
1260 gCb->genCfg.rlcMode, rlcKwuSapCb->state);
1261 /* reconfiguration not allowed */
1262 return (LCM_REASON_RECONFIG_FAIL);
1264 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1266 /* Fill the parameters */
1267 RLC_FILL_SAP_HELPER(rlcKwuSapCb, cfg, gCb);
1269 return (LCM_REASON_NOT_APPL);
1274 * This function configures the RLC control sap
1276 * @param[in] gCb RLC Instance Control Block
1277 * @param[in] cfg RLC LM Sap configuration structure
1280 * -# LCM_REASON_NOT_APPL (SUCCESS)
1281 * -# LCM_REASON_INVALID_SAP
1282 * -# LCM_REASON_INVALID_SAP
1283 * -# LCM_REASON_RECONFIG_FAIL
1285 static S16 rlcLmmCfgCkwSap(RlcCb *gCb,RlcSapCfg *cfg)
1287 RlcCkwSapCb *ckwSap;
1289 #if (ERRCLASS & ERRCLS_INT_PAR)
1290 /* Validate config parameters */
1291 if ((cfg->sapId >= RLC_MAX_CKWSAPS) || (cfg->sapId < 0) )
1293 return (LCM_REASON_INVALID_PAR_VAL);
1296 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1298 /* Get Sap control block */
1299 return (LCM_REASON_INVALID_PAR_VAL);
1303 ckwSap = &(gCb->u.ulCb->ckwSap);
1305 #if (ERRCLASS & ERRCLS_INT_PAR)
1306 /* Check for reconfiguration */
1307 if(ckwSap->state != RLC_SAP_NOT_CFG)
1309 DU_LOG("\nERROR --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
1310 return (LCM_REASON_RECONFIG_FAIL);
1312 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1314 /* Fill the parameters */
1315 RLC_FILL_SAP_HELPER(ckwSap, cfg, gCb);
1317 return (LCM_REASON_NOT_APPL);
1322 * This function configures the UDX sap
1324 * @param[in] gCb RLC Instance Control Block
1325 * @param[in] cfg RLC LM Sap configuration structure
1328 * -# LCM_REASON_NOT_APPL (SUCCESS)
1329 * -# LCM_REASON_INVALID_SAP
1330 * -# LCM_REASON_INVALID_SAP
1331 * -# LCM_REASON_RECONFIG_FAIL
1333 static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
1335 RlcUdxDlSapCb *udxDlSap;
1336 RlcUdxUlSapCb *udxUlSap;
1338 #if (ERRCLASS & ERRCLS_INT_PAR)
1339 /* Validate the protocol parameters */
1340 if((cfg->sapId >= RLC_MAX_UDXSAPS) || (cfg->sapId < 0))
1342 return (LCM_REASON_INVALID_PAR_VAL);
1345 /* Get Sap control block */
1346 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1348 udxDlSap = (gCb->u.dlCb->udxDlSap + cfg->sapId);
1349 #if (ERRCLASS & ERRCLS_INT_PAR)
1350 /* Check for reconfiguration */
1351 if(udxDlSap->state != RLC_SAP_NOT_CFG)
1353 DU_LOG("\nERROR --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
1354 return (LCM_REASON_RECONFIG_FAIL);
1356 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1358 /* Fill the parameters */
1359 RLC_FILL_SAP_HELPER(udxDlSap, cfg, gCb);
1363 udxUlSap = (gCb->u.ulCb->udxUlSap + cfg->sapId);
1365 #if (ERRCLASS & ERRCLS_INT_PAR)
1366 /* Check for reconfiguration */
1367 if(udxUlSap->state != RLC_SAP_NOT_CFG)
1369 DU_LOG("\nERROR --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
1370 return (LCM_REASON_RECONFIG_FAIL);
1372 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1374 /* Fill the parameters */
1375 RLC_FILL_SAP_HELPER(udxUlSap, cfg, gCb);
1377 udxUlSap->bndTmrInt = cfg->bndTmrIntvl;
1378 udxUlSap->retryCnt = 0;
1379 cmInitTimers(&(udxUlSap->bndTmr), 1);
1382 return (LCM_REASON_NOT_APPL);
1387 * This function configures the RGU sap
1389 * @param[in] gCb RLC Instance Control Block
1390 * @param[in] cfg RLC LM Sap configuration structure
1392 * -# LCM_REASON_NOT_APPL (SUCCESS)
1393 * -# LCM_REASON_INVALID_SAP
1394 * -# LCM_REASON_INVALID_SAP
1395 * -# LCM_REASON_RECONFIG_FAIL
1397 static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
1399 RlcRguSapCb *rguSap;
1401 #if (ERRCLASS & ERRCLS_INT_PAR)
1402 /* Validate the protocol parameters */
1403 if((cfg->sapId >= gCb->genCfg.maxRguSaps) || \
1406 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cfg->sapId,
1407 "rlcLmmCfgRguSap: Invalid RGU sapId\n");
1408 return (LCM_REASON_INVALID_PAR_VAL);
1412 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1413 &(gCb->u.dlCb->rguDlSap[cfg->sapId]): &(gCb->u.ulCb->rguUlSap[cfg->sapId]);
1415 #if (ERRCLASS & ERRCLS_INT_PAR)
1416 /* Check for reconfiguration */
1417 if(rguSap->state != RLC_SAP_NOT_CFG)
1419 DU_LOG("\nERROR --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
1420 gCb->genCfg.rlcMode, rguSap->state);
1421 return (LCM_REASON_RECONFIG_FAIL);
1423 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1425 /* Fill the parameters */
1426 RLC_FILL_SAP_HELPER(rguSap, cfg, gCb);
1427 rguSap->suId = cfg->sapId;
1428 rguSap->bndTmrInt = cfg->bndTmrIntvl;
1429 rguSap->retryCnt = 0;
1430 rguSap->state = RLC_SAP_CFG;
1432 cmInitTimers(&(rguSap->bndTmr), 1);
1434 return (LCM_REASON_NOT_APPL);
1439 * Validates the RLC general control parameters
1441 * @param[in] cntrl RLC LM structure
1444 * -# LCM_REASON_NOT_APPL (SUCCESS)
1445 * -# LCM_REASON_INVALID_SUBACTION
1446 * -# LCM_REASON_INVALID_ACTION
1448 static S16 rlcLmmValidateGenCntrl(RlcMngmt *cntrl)
1450 S16 reason; /* reason for failure */
1451 uint8_t sAction; /* subaction field */
1453 reason = LCM_REASON_NOT_APPL;
1454 sAction = cntrl->t.cntrl.subAction;
1456 switch (cntrl->t.cntrl.action)
1460 if ((sAction != SAUSTA) &&
1461 (sAction != SADBG) &&
1464 reason = LCM_REASON_INVALID_SUBACTION;
1470 reason = LCM_REASON_INVALID_ACTION;
1479 * it deregisters the timers and deregisters the rlckwuSap Control blocks
1481 * @param[in] gCb RLC Instance Control Block
1485 static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
1490 if (gCb->init.cfgDone)
1492 /* Deregister the timers */
1493 /*Pradeep: changing the SDeregTmrMt() to SDeregTmr*/
1494 (Void) SDeregTmrMt(gCb->init.ent, gCb->init.inst,
1495 (S16)gCb->genCfg.timeRes, rlcActvTmr);
1496 /*(Void) SDeregTmr(gCb->init.ent, gCb->init.inst,
1497 (S16)gCb->genCfg.timeRes, rlcActvTmr);*/
1499 rlcSapSize = (Size)(gCb->genCfg.maxKwuSaps * sizeof(RlcKwuSapCb));
1501 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1503 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxDlSapCb));
1506 gCb->u.dlCb->shutdownReceived = TRUE;
1507 rlcUtlFreeDlMemory(gCb);
1508 if (gCb->u.dlCb->rlcKwuDlSap != NULLP)
1510 RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
1513 if(gCb->u.dlCb->udxDlSap != NULLP)
1515 RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcUdxSapSize);
1518 if(gCb->u.dlCb->rguDlSap != NULLP)
1520 RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, gCb->genCfg.maxRguSaps);
1521 gCb->genCfg.maxRguSaps = 0;
1523 if (gCb->u.dlCb->shutdownReceived)
1525 if (gCb->u.dlCb->selfPstMBuf != NULL)
1527 SPutMsg(gCb->u.dlCb->selfPstMBuf);
1529 RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
1536 rlcUdxSapSize = (Size)(gCb->genCfg.maxUdxSaps * sizeof(RlcUdxUlSapCb));
1539 if (gCb->u.ulCb->rlcKwuUlSap != NULLP)
1541 RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
1544 if(gCb->u.ulCb->udxUlSap != NULLP)
1546 RLC_FREE(gCb,gCb->u.ulCb->udxUlSap, rlcUdxSapSize);
1549 if(gCb->u.ulCb->rguUlSap != NULLP)
1551 RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, gCb->genCfg.maxRguSaps);
1552 gCb->genCfg.maxRguSaps = 0;
1555 RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
1559 gCb->init.cfgDone = FALSE;
1560 gCb->init.acnt = FALSE;
1561 gCb->init.trc = FALSE;
1563 gCb->init.usta = FALSE;
1571 * Delete all SAPs and Control Blocks
1574 * Shutdown of RLC happens at modules level, tm, um and am modules will be
1575 * shutdown using utility functin and dbm shutdown will clean up the SAPs,
1576 * control blocks and lists.
1578 * @params[in] gCb RLC instance control block
1581 * -# LCM_REASON_NOT_APPL (SUCCESS)
1582 * -# LCM_REASON_HASHING_FAILED
1584 static S16 rlcLmmShutdown(RlcCb *gCb)
1586 RlcRguSapCb *rguSap;
1589 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1591 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1593 rguSap = &(gCb->u.dlCb->rguDlSap[idx]);
1594 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1596 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1602 for (idx = 0; idx < gCb->genCfg.maxRguSaps; idx++)
1604 rguSap = &(gCb->u.ulCb->rguUlSap[idx]);
1605 if ((rguSap->state == RLC_SAP_BND) || (rguSap->state == RLC_SAP_BINDING))
1607 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1612 if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1614 rlcDbmDlShutdown(gCb);
1618 rlcDbmUlShutdown(gCb);
1621 rlcLmmCleanGblRsrcs(gCb);
1623 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1625 return (LCM_REASON_NOT_APPL);
1630 * Function processes the general control request
1632 * @param[in] gCb RLC instance control block
1633 * @param[in] cntrl RLC LM structure
1636 * -# LCM_REASON_NOT_APPL (SUCCESS)
1637 * -# LCM_REASON_INVALID_SUBACTION
1638 * -# LCM_REASON_INVALID_ACTION
1640 static S16 rlcLmmGenCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1642 RlcTrcCntrl *trcCntrl; /* trace */
1644 RlcDbgCntrl *dbgCntrl; /* debug */
1646 S16 reason; /* reason for failure */
1648 /* Validate control parameters */
1649 reason = rlcLmmValidateGenCntrl (cntrl);
1651 if (reason != LCM_REASON_NOT_APPL)
1656 switch(cntrl->t.cntrl.action)
1660 switch(cntrl->t.cntrl.subAction)
1664 RLC_SET_USTA_FLAG(gCb, TRUE);
1670 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1671 RLC_GET_DBG_MASK(gCb) |= dbgCntrl->dbgMask;
1677 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1678 gCb->init.trc = TRUE;
1679 gCb->trcLen = trcCntrl->trcLen;
1680 (gCb->trcMask) |= trcCntrl->trcMask;
1688 switch(cntrl->t.cntrl.subAction)
1692 gCb->init.usta = FALSE;
1698 dbgCntrl = &cntrl->t.cntrl.s.dbgCntrl;
1699 RLC_GET_DBG_MASK(gCb) &= ~(dbgCntrl->dbgMask);
1705 trcCntrl = &cntrl->t.cntrl.s.trcCntrl;
1706 gCb->init.trc = FALSE;
1707 gCb->trcMask &= ~(trcCntrl->trcMask);
1715 reason = rlcLmmShutdown(gCb);
1724 * Bind/Unbind RLC UDX sap
1726 * @param[in] gCb RLC Instance Control Block
1727 * @param[in] cntrl RLC LM structure
1730 * -# LCM_REASON_NOT_/PPL (SUCCESS)
1731 * -# LCM_REASON_INVALID_SAP
1732 * -# LCM_REASON_INVALID_STATE
1733 * -# LCM_REASON_INVALID_ACTION
1735 static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1738 #if (ERRCLASS & ERRCLS_INT_PAR)
1739 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
1741 return (LCM_REASON_INVALID_SAP);
1744 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1745 (cntrl->t.cntrl.s.sapCntrl.suId >= RLC_MAX_UDXSAPS))
1747 return (LCM_REASON_INVALID_SAP);
1749 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1751 #define UDX_SAP gCb->u.ulCb->udxUlSap[cntrl->t.cntrl.s.sapCntrl.suId]
1752 #if (ERRCLASS & ERRCLS_INT_PAR)
1754 if(UDX_SAP.state == RLC_SAP_NOT_CFG)
1756 DU_LOG("\nERROR --> RLC : udxUlSap not configured yet");
1757 return (LCM_REASON_INVALID_STATE);
1759 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1761 switch(cntrl->t.cntrl.action)
1765 if(UDX_SAP.state != RLC_SAP_BND)
1767 /* start timer to wait for bind confirm */
1768 rlcStartTmr(gCb,(PTR)(&UDX_SAP), EVENT_RLC_WAIT_BNDCFM);
1769 UDX_SAP.state = RLC_SAP_BINDING;
1770 rlcUlUdxBndReq(&(UDX_SAP.pst), UDX_SAP.suId, UDX_SAP.spId);
1774 /* control request received for an already bound SAP */
1775 return (LCM_REASON_INVALID_STATE);
1781 /* make the state of UDXSAP configured but not bound */
1782 UDX_SAP.state = RLC_SAP_CFG;
1783 rlcUlUdxUbndReq(&(UDX_SAP.pst), UDX_SAP.spId, 0);
1787 return (LCM_REASON_INVALID_ACTION);
1789 } /* end of switch */
1791 return (LCM_REASON_NOT_APPL);
1796 * Bind/Unbind RLC lower sap
1798 * @param[in] gCb RLC Instance Control Block
1799 * @param[in] cntrl RLC LM structure
1801 * -# LCM_REASON_NOT_APPL (SUCCESS)
1802 * -# LCM_REASON_INVALID_SAP
1803 * -# LCM_REASON_INVALID_STATE
1804 * -# LCM_REASON_INVALID_ACTION
1806 static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
1808 RlcRguSapCb *rguSap; /* rgu sap pointer */
1810 #if (ERRCLASS & ERRCLS_INT_PAR)
1812 if((cntrl->t.cntrl.s.sapCntrl.suId < 0) ||
1813 (cntrl->t.cntrl.s.sapCntrl.suId >= gCb->genCfg.maxRguSaps))
1815 RLCLOGERROR(gCb,ERRCLS_INT_PAR, EKW047, (ErrVal)cntrl->t.cntrl.s.sapCntrl.suId,
1816 "rlcLmmLSapCntrl: Invalid RGU suId\n");
1817 return (LCM_REASON_INVALID_SAP);
1819 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1820 rguSap = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1821 &(gCb->u.dlCb->rguDlSap[cntrl->t.cntrl.s.sapCntrl.suId]): \
1822 &(gCb->u.ulCb->rguUlSap[cntrl->t.cntrl.s.sapCntrl.suId]);
1824 #if (ERRCLASS & ERRCLS_INT_PAR)
1826 if(rguSap->state == RLC_SAP_NOT_CFG)
1828 DU_LOG("\nERROR --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
1829 return (LCM_REASON_INVALID_STATE);
1831 #endif /* ERRCLASS & ERRCLS_INT_PAR */
1833 switch(cntrl->t.cntrl.action)
1837 if(rguSap->state != RLC_SAP_BND)
1839 /* start timer to wait for bind confirm */
1840 rlcStartTmr(gCb,(PTR)(rguSap), EVENT_RLC_WAIT_BNDCFM);
1841 rguSap->state = RLC_SAP_BINDING;
1842 rguSap->spId = cntrl->t.cntrl.s.sapCntrl.spId;
1843 rguSap->suId = cntrl->t.cntrl.s.sapCntrl.suId;
1844 RlcLiRguBndReq(&(rguSap->pst), rguSap->suId, rguSap->spId);
1848 /* control request received for an already bound SAP */
1849 return (LCM_REASON_INVALID_STATE);
1855 /* make the state of RGUSAP is configure but not bound */
1856 rguSap->state = RLC_SAP_CFG;
1857 RlcLiRguUbndReq(&(rguSap->pst), rguSap->spId, 0);
1861 return (LCM_REASON_INVALID_ACTION);
1863 } /* end of switch */
1865 return (LCM_REASON_NOT_APPL);
1870 * Function gather the general KWU SAP status
1872 * @param[in] gCb RLC Instance Control Block
1873 * @param[in] sta LM KWU Sap Status structure
1876 * -# LCM_REASON_NOT_APPL (SUCCESS)
1877 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1879 static S16 rlcLmmGetKwuSapSta (RlcCb *gCb,RlcKwuSapSta *sta)
1881 RlcKwuSapCb *rlcKwSapCb;
1883 #if (ERRCLASS & ERRCLS_INT_PAR)
1884 /* Validate the protocol parameters */
1885 if ((sta->spId >= (S16)gCb->genCfg.maxKwuSaps)||
1888 return (LCM_REASON_INVALID_PAR_VAL);
1892 /* Get Sap control block */
1893 rlcKwSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
1894 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + sta->spId):
1895 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + sta->spId);
1897 sta->state = rlcKwSapCb->state;
1899 return (LCM_REASON_NOT_APPL);
1904 * Function gather the general RGU SAP status
1906 * @param[in] gCb RLC Instance Control Block
1907 * @param[in] sta LM RGU Sap Status structure
1909 * -# LCM_REASON_NOT_APPL (SUCCESS)
1910 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1912 static S16 rlcLmmGetRguSapSta(RlcCb *gCb,RlcRguSapSta *sta)
1915 #if (ERRCLASS & ERRCLS_INT_PAR)
1916 /* Validate the protocol parameters */
1917 if((sta->suId >= RLC_MAX_RGUSAPS) || (sta->suId < 0))
1919 return (LCM_REASON_INVALID_PAR_VAL);
1923 sta->state = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL) ?
1924 gCb->u.dlCb->rguDlSap[sta->suId].state :
1925 gCb->u.ulCb->rguUlSap[sta->suId].state ;
1927 return (LCM_REASON_NOT_APPL);
1932 * Function gather the general CKW SAP status
1934 * @param[in] gCb RLC Instance Control Block
1935 * @param[in] sta LM CKW Sap Status structure
1937 * -# LCM_REASON_NOT_APPL (SUCCESS)
1938 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1940 static S16 rlcLmmGetCkwCntSapSta(RlcCb *gCb,RlcCkwCntSapSta *sta)
1943 #if (ERRCLASS & ERRCLS_INT_PAR)
1944 /* Validate config parameters */
1945 if ((sta->spId >= RLC_MAX_CKWSAPS ) ||
1947 (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL))
1949 return (LCM_REASON_INVALID_PAR_VAL);
1952 sta->state = gCb->u.ulCb->ckwSap.state;
1954 return (LCM_REASON_NOT_APPL);
1960 * Gather the general statistics
1962 * @param[in] gCb RLC Instance Control Block
1963 * @param[in] sts LM general statistics structure
1964 * @param[in] action action
1966 * -# LCM_REASON_NOT_APPL (SUCCESS)
1967 * -# LCM_REASON_INVALID_PAR_VAL(FAILURE)
1969 static S16 rlcLmmGetGenSts(RlcCb *gCb,RlcGenSts *sts,Action action)
1972 #if (ERRCLASS & ERRCLS_INT_PAR)
1973 /* Validate protocol parameters */
1974 if ((action != LKW_ZEROSTS) && (action != LKW_NOZEROSTS))
1976 return (LCM_REASON_INVALID_PAR_VAL);
1982 if(action == LKW_ZEROSTS)
1984 RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
1987 return (LCM_REASON_NOT_APPL);
1992 * Gather the SAP statistics
1994 * @param[in] gCb RLC Instance Control Block
1995 * @param[in] sts LM general statistics structure
1996 * @param[in] elmnt element
1997 * @param[in] action action
2000 * -# LCM_REASON_NOT_APPL (SUCCESS)
2001 * -# LCM_REASON_INVALID_PAR_VAL (FAIL)
2003 static S16 rlcLmmGetSapSts(RlcCb *gCb,RlcMngmt *sts,Elmnt elmnt, Action action)
2006 /* Validate protocol parameters */
2007 if (action != LKW_ZEROSTS && action != LKW_NOZEROSTS)
2009 return (LCM_REASON_INVALID_PAR_VAL);
2015 RlcKwuSapSts *rlckwuSap;
2016 RlcKwuSapCb *rlcKwuSapCb;
2017 rlckwuSap = &sts->t.sts.s.rlckwuSap;
2019 /* Get Sap control block */
2020 /* kw005.201, modified the element of rlckwuSap from suId to spId */
2021 rlcKwuSapCb = (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)?
2022 (RlcKwuSapCb*)(gCb->u.dlCb->rlcKwuDlSap + rlckwuSap->spId):
2023 (RlcKwuSapCb*)(gCb->u.ulCb->rlcKwuUlSap + rlckwuSap->spId);
2026 *rlckwuSap = rlcKwuSapCb->sts;
2028 if (action == LKW_ZEROSTS)
2030 RLC_MEM_SET (&rlcKwuSapCb->sts, 0, sizeof (RlcKwuSapSts));
2034 /* kw005.201 removed RGUSAP statistics support */
2037 RlcCkwCntSts *ckwSap;
2038 ckwSap = &sts->t.sts.s.ckwSap;
2039 if (gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
2041 return (LCM_REASON_INVALID_PAR_VAL);
2044 ckwSap->statMsgs = gCb->u.ulCb->ckwSap.sts.statMsgs;
2046 if (action == LKW_ZEROSTS)
2048 RLC_MEM_SET (&(gCb->u.ulCb->ckwSap.sts), 0, sizeof (RlcCkwCntSts));
2053 return (LCM_REASON_INVALID_ELMNT);
2056 SGetDateTime(&sts->t.sts.dt);
2058 return (LCM_REASON_NOT_APPL);
2063 * This function sends Unsolicited Status Indication to the Layer Management
2066 * @param[in] gCb RLC Instance Control Block
2067 * @param[in] category Category
2068 * @param[in] event event
2069 * @param[in] cause cause
2070 * @param[in] UeId ueId
2071 * @param[in] Qci qci
2076 Void rlcLmmSendAlarm
2086 #else /* LTE_L2_MEAS */
2087 Void rlcLmmSendAlarm
2096 #endif /* LTE_L2_MEAS */
2098 RlcMngmt usta; /* Rlc Management Structure */
2100 if(gCb->init.usta == FALSE)
2105 usta.hdr.elmId.elmnt = STGEN;
2106 usta.hdr.entId.ent = gCb->init.ent;
2107 usta.hdr.entId.inst = gCb->init.inst;
2109 /* fill in the event and category */
2110 usta.t.usta.alarm.category = category;
2111 usta.t.usta.alarm.event = event;
2112 usta.t.usta.alarm.cause = cause;
2114 /* set the suId and ueId */
2115 usta.t.usta.ueId = ueId;
2116 usta.t.usta.suId = suId;
2117 /* kw005.201 added support for L2 Measurement */
2119 if(event == LKW_EVT_MEAS_HALT)
2121 usta.t.usta.qci = qci;
2123 #endif /* LTE_L2_MEAS */
2124 /* update the date and time */
2125 (Void) SGetDateTime(&usta.t.usta.alarm.dt);
2127 RlcMiLkwStaInd(&(gCb->init.lmPst), &usta);
2135 * This function sends trace indication to LM
2137 * @param[in] gCb RLC Instance Control Block
2138 * @param[in] event event
2139 * @param[in] mBuf meessage buffer
2145 S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
2147 RlcMngmt trc; /* RLC management control block */
2154 DU_LOG("\nDEBUG --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
2158 memset(&trc, 0, sizeof(RlcMngmt));
2160 pst = gCb->init.lmPst;
2162 trc.t.trc.event = event;
2163 SGetDateTime(&trc.t.trc.dt);
2164 trc.cfm.status = LCM_PRIM_OK;
2165 trc.cfm.reason = LCM_REASON_NOT_APPL;
2169 /* Check if the whole buffer is to be sent in Trace indication */
2170 if(gCb->trcLen == LKW_FULL_TRACE)
2172 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2175 /* rg005.201 removed SPutSBuf on error */
2176 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2179 /* Send Trace Indication to Layer manager */
2180 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2182 /* check if only a specified number of bytes are to be sent */
2183 else if(gCb->trcLen > 0)
2185 /* Get the length of the recvd message buffer */
2186 if (SFndLenMsg(mBuf, &bufLen) != ROK)
2188 DU_LOG("\nERROR --> RLC : SFndLenMsg Failed");
2191 /* Check if the recvd buffer size is less than request trace len */
2192 if(bufLen < gCb->trcLen)
2194 /* Copy the whole of the recvd buffer in trace indication */
2196 if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
2199 DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
2203 /* Send Trace Indication to Layer manager */
2204 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2208 /* if the recvd buffer size is greater than request trace len */
2209 /* Get a temporary buffer to store the msg */
2210 RLC_ALLOC(gCb,tempBuf, gCb->trcLen);
2212 #if (ERRCLASS & ERRCLS_INT_PAR)
2213 if(tempBuf == NULLP)
2215 (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
2217 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2218 return (LCM_REASON_MEM_NOAVAIL);
2220 #endif /* ERRCLASS & ERRCLS_INT_PAR */
2222 /* Copy trcLen nos of bytes from the recvd message */
2223 if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
2225 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2229 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
2231 DU_LOG("\nERROR --> RLC : Memory Allocation failed");
2234 /* Copy the tempBuf data to dst mBuf */
2235 if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
2237 DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
2241 /* Free the memory allocated for tempBuf */
2242 RLC_FREE(gCb,tempBuf, gCb->trcLen);
2243 /* Send Trace Indication to Layer manager */
2244 RlcMiLkwTrcInd(&pst, &trc, dstMbuf);
2250 RlcMiLkwTrcInd(&pst, &trc, mBuf);
2259 * Activate Task - timer
2262 * Invoked by system services to activate a task with a timer tick.
2264 * @param[in] ent entity
2265 * @param[in] inst instance
2273 S16 rlcActvTmr(Ent ent,Inst inst)
2277 if (inst >= MAX_RLC_INSTANCES)
2281 gCb = RLC_GET_RLCCB(inst);
2282 cmPrcTmr(&(gCb->rlcTqCp), gCb->rlcTq, (PFV) rlcTmrExpiry);
2285 } /* end of rlcActvTmr */
2288 /********************************************************************30**
2291 **********************************************************************/