macCellCfg
[o-du/l2.git] / src / 5gnrmac / rg_uim.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /************************************************************************
20  
21      Name:     LTE-MAC layer
22   
23      Type:     C source file
24   
25      Desc:     C source code for Entry point fucntions
26   
27      File:     rg_uim.c 
28   
29 **********************************************************************/
30
31 /** @file rg_uim.c.
32 @brief This module acts as an interface handler for upper interface and 
33 manages Pst and Sap related information for upper interface APIs.
34 */
35
36 static const char* RLOG_MODULE_NAME="MAC";
37 static int RLOG_MODULE_ID=4096;
38 static int RLOG_FILE_ID=178;
39
40 /* header include files -- defines (.h) */
41
42 /* header/extern include files (.x) */
43 /* header include files (.h) */
44 #include "envopt.h"        /* environment options */
45 #include "envdep.h"        /* environment dependent */
46 #include "envind.h"        /* environment independent */
47 #include "gen.h"           /* general layer */
48 #include "ssi.h"           /* system services */
49 #include "cm5.h"           /* common timers defines */
50 #include "cm_hash.h"       /* common hash list defines */
51 #include "cm_llist.h"      /* common linked list defines */
52 #include "cm_mblk.h"       /* memory management */
53 #include "cm_tkns.h"       /* common tokens */
54 #include "cm_lte.h"
55 #include "crg.h"           /* CRG defines */
56 #include "lrg.h"           /* layer management defines for LTE-MAC */
57 #include "tfu.h"
58 #include "rgu.h"
59 #include "rg_sch_inf.h"
60 #include "rg_env.h"        /* customizable defines and macros for MAC */
61 #include "rg.h"            /* defines and macros for MAC */
62 #include "rg_err.h"        /* RG error defines */
63
64 /* header/extern include files (.x) */
65
66 #include "gen.x"           /* general layer typedefs */
67 #include "ssi.x"           /* system services typedefs */
68 #include "cm5.x"           /* common timers */
69 #include "cm_hash.x"       /* common hash list */
70 #include "cm_lib.x"        /* common library */
71 #include "cm_llist.x"      /* common linked list */
72 #include "cm_mblk.x"       /* memory management */
73 #include "cm_tkns.x"       /* common tokens */
74 #include "cm_lte.x"
75 #include "crg.x"           /* CRG types */
76 #include "lrg.x"           /* layer management typedefs for MAC */
77 #include "tfu.x"
78 #include "rgu.x"
79 #include "rg_sch_inf.x"
80 #include "rg_prg.x"        /* PRG interface typedefs*/
81 #include "du_app_mac_inf.h"
82 #include "rg.x"            /* typedefs for MAC */
83
84 #include "ss_rbuf.h"
85 #include "ss_rbuf.x"
86
87 /* local defines */
88
89 /* local typedefs */
90  
91 /* local externs */
92  
93 /* forward references */
94
95 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
96 PUBLIC S16 rgBatchProc(Void);
97 #endif
98 PUBLIC U8 rgRguDlSap;
99 PUBLIC U8 rgRguUlSap;
100 /**
101  * @brief Handler for Bind request.
102  *
103  * @details
104  *
105  *     Function : RgUiRguBndReq
106  *     
107  *     This function handles the bind request from MAC Service User.
108  *     
109  *           
110  *  @param[in]  Pst  *pst
111  *  @param[in]  SuId suId
112  *  @param[in]  SpId spId
113  *  @return  S16
114  *      -# ROK 
115  *      -# RFAILED 
116  **/
117 #ifdef ANSI
118 PUBLIC S16 RgUiRguBndReq
119 (
120 Pst  *pst,
121 SuId suId,
122 SpId spId
123 )
124 #else
125 PUBLIC S16 RgUiRguBndReq(pst, suId, spId)
126 Pst  *pst;
127 SuId suId;
128 SpId spId;
129 #endif
130 {
131    Inst      inst; 
132    S16       ret = ROK;
133    Pst       tmpPst;   /* Temporary Post Structure */
134    RgUstaDgn dgn;      /* Alarm diagnostics structure */
135
136    TRC3(RgUiRguBndReq)
137
138
139    RG_IS_INST_VALID(pst->dstInst);
140    inst = pst->dstInst - RG_INST_START;
141
142    tmpPst.prior       = pst->prior;
143    tmpPst.route       = pst->route;
144    tmpPst.selector    = pst->selector;
145    tmpPst.region      = rgCb[inst].rgInit.region;
146    tmpPst.pool        = rgCb[inst].rgInit.pool;
147    tmpPst.srcProcId   = rgCb[inst].rgInit.procId;
148    tmpPst.srcEnt      = rgCb[inst].rgInit.ent;
149    tmpPst.srcInst     = rgCb[inst].rgInit.inst;
150    tmpPst.event       = EVTNONE;
151    tmpPst.dstProcId   = pst->srcProcId;
152    tmpPst.dstEnt      = pst->srcEnt;
153    tmpPst.dstInst     = pst->srcInst;
154
155    if(spId == rgCb[inst].rguSap[spId].sapCfg.spId)
156    {
157       /* Check the state of the SAP */
158       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
159       {
160          case LRG_NOT_CFG: /* SAP Not configured */
161             RGDBGINFO(inst,(rgPBuf(inst), "SAP Not Configured\n"));
162             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
163             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_NOT_CFG,
164                   LCM_CAUSE_INV_SAP, &dgn);
165             RLOG0(L_DEBUG,"SAP Not Configured");
166             ret = RgUiRguBndCfm(&tmpPst, suId, CM_BND_NOK);
167             break;
168          case LRG_UNBND: /* SAP is not bound */
169             RLOG0(L_DEBUG,"SAP Not yet bound");
170             rgCb[inst].rguSap[spId].sapSta.sapState = LRG_BND;
171             rgCb[inst].rguSap[spId].sapCfg.suId = suId;
172             /* Send Bind Confirm with status as SUCCESS */
173             /*T2K - Passing spId as it is required to access the SAP CB*/
174             ret = rgUIMRguBndCfm(inst,spId, CM_BND_OK);
175             /* Indicate to Layer manager */ 
176             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
177             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_EVENT_RGUSAP_ENB,
178                   LCM_CAUSE_UNKNOWN, &dgn);
179             break;
180          case LRG_BND: /* SAP is already bound*/
181             RLOG0(L_DEBUG,"SAP already bound");
182             /*T2K - Passing spId as it is required to access the SAP CB*/
183             ret = rgUIMRguBndCfm(inst,spId, CM_BND_OK);
184             break;
185          default: /* Should Never Enter here */
186 #if (ERRCLASS & ERRCLS_ADD_RES)      
187             RGLOGERROR(inst,ERRCLS_INT_PAR, ERG008, (ErrVal)rgCb[inst].rguSap[spId].sapSta.sapState,
188                   "Invalid SAP State:RgUiRguBndReq failed\n");
189 #endif
190             /*T2K - Passing spId as it is required to access the SAP CB*/
191             ret = rgUIMRguBndCfm(inst,spId, CM_BND_NOK);
192             break;
193       }
194    }
195    else
196    {
197 #if (ERRCLASS & ERRCLS_ADD_RES)      
198       RGLOGERROR(inst,ERRCLS_INT_PAR, ERG009, (ErrVal)rgCb[inst].rguSap[spId].sapCfg.spId,
199             "Invalid SAP Id:RgUiRguBndReq failed\n");
200 #endif
201       /*T2K - Passing spId as it is required to access the SAP CB*/
202       ret = rgUIMRguBndCfm(inst,spId, CM_BND_NOK);
203    }
204    RETVALUE(ret);
205 }  /* RgUiRguBndReq */
206
207
208 /**
209  * @brief Handler for Unbind request.
210  *
211  * @details
212  *
213  *     Function : RgUiRguUbndReq
214  *     
215  *     This function handles the unbind request from MAC Service User.
216  *     
217  *           
218  *  @param[in]  Pst    *pst
219  *  @param[in]  SpId   spId
220  *  @param[in]  Reason reason
221  *  @return  S16
222  *      -# ROK 
223  *      -# RFAILED 
224  **/
225 #ifdef ANSI
226 PUBLIC S16 RgUiRguUbndReq
227 (
228 Pst    *pst,
229 SpId   spId,
230 Reason reason
231 )
232 #else
233 PUBLIC S16 RgUiRguUbndReq(pst, spId, reason)
234 Pst    *pst;
235 SpId   spId;
236 Reason reason;
237 #endif
238 {
239    Inst      inst;
240    TRC3(RgUiRguUbndReq)
241    
242
243    RG_IS_INST_VALID(pst->dstInst);
244    inst = pst->dstInst - RG_INST_START;
245    /* SAP Id validation */
246    if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
247    {
248       switch(rgCb[inst].rguSap[spId].sapSta.sapState)
249       {
250          case LRG_BND: /* SAP is already bound*/
251             RLOG0(L_DEBUG,"SAP already bound");
252             /* setting SAP state to UN BOUND */
253             rgCb[inst].rguSap[spId].sapSta.sapState = LRG_UNBND;
254             break;
255          default:
256 #if (ERRCLASS & ERRCLS_ADD_RES)      
257      RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguUbndReq failed",
258                   rgCb[inst].rguSap[spId].sapSta.sapState);
259        
260 #endif
261             break;
262       }
263    }
264    else
265    {
266 #if (ERRCLASS & ERRCLS_ADD_RES)      
267       RGLOGERROR(inst,ERRCLS_INT_PAR, ERG011, (ErrVal)rgCb[inst].rguSap[spId].sapCfg.spId,
268             "Invalid SAP Id:RgUiRguUbndReq failed\n");
269 #endif
270       RETVALUE(RFAILED);
271    }
272    RETVALUE(ROK);
273 }  /* RgUiRguUbndReq */
274 /**
275  * @brief API for sending bind confirm from MAC to RLC
276  *
277  * @details
278  *
279  *     Function: rgUIMRguBndCfm
280  *     
281  *     This API is invoked to send bind confirm from MAC to RLC.
282  *     This API fills in Pst structure and SAP Ids and invokes 
283  *     bind confirm API towards RLC.
284  *           
285  *  @param[in] Inst        inst
286  *  @param[in]  SuId          suId
287  *  @param[in]  U8            status
288  *  @return  S16
289  *      -# ROK 
290  *      -# RFAILED 
291  **/
292 #ifdef ANSI
293 PUBLIC S16 rgUIMRguBndCfm
294 (
295 Inst inst,
296 SpId spId,
297 U8 status
298 )
299 #else
300 PUBLIC S16 rgUIMRguBndCfm(inst,spId, status)
301 Inst          inst;
302 SpId          spId;
303 U8            status;
304 #endif
305 {
306    S16  ret = ROK;
307    
308    TRC2(rgUIMRguBndCfm)
309    
310
311    ret = RgUiRguBndCfm(&rgCb[inst].rguSap[spId].sapCfg.sapPst, 
312                       rgCb[inst].rguSap[spId].sapCfg.suId, status);
313    if (ret != ROK)
314    {
315       
316       RLOG0(L_ERROR,"RgUiRguBndCfm Failed ");
317       RETVALUE(ret);
318    }
319    RETVALUE(ret);
320 }  /* rgUIMRguBndCfm*/
321
322
323 /**
324  * @brief Handler for dedicated DatReq from RGU
325  *
326  * @details
327  *
328  *     Function : RgUiRguDDatReq
329  *     
330  *     This function validates SAP and invokes ROM for further processing
331  *     
332  *  @param[in]  Pst             *pst 
333  *  @param[in]  SpId            spId 
334  *  @param[in]  RguDDatReqInfo  *datReq
335  *  @return  S16
336  *      -# ROK 
337  *      -# RFAILED 
338  **/
339 #ifdef ANSI
340 PUBLIC S16 RgUiRguDDatReq
341 (
342 Pst             *pst,
343 SpId            spId,
344 RguDDatReqInfo  *datReq
345 )
346 #else
347 PUBLIC S16 RgUiRguDDatReq(pst, spId, datReq)
348 Pst             *pst;
349 SpId            spId;
350 RguDDatReqInfo  *datReq;
351 #endif
352 {
353    S16   ret = ROK;
354    Inst  inst;
355 #ifndef NO_ERRCLS 
356    U32   id;
357    U32   id1;
358    U32   id2;
359    U32   id3;
360 #endif
361    
362    TRC3(RgUiRguDDatReq)
363
364
365    RG_IS_INST_VALID(pst->dstInst);
366    inst = pst->dstInst - RG_INST_START;
367 #ifndef NO_ERRCLS
368    if (datReq == NULLP)
369    {
370       RLOG0(L_ERROR,"Input Message Buffer is NULL");
371       RETVALUE(RFAILED);
372    }
373    
374    if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
375    {
376       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
377       {
378          case LRG_BND: /* SAP is bound */
379             RLOG0(L_DEBUG,"SAP is already bound");
380             break;
381          default: /* Should never reach here */
382 #if (ERRCLASS & ERRCLS_ADD_RES)      
383             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguDDatReq failed",
384                   rgCb[inst].rguSap[spId].sapSta.sapState);
385 #endif
386 #ifndef L2_OPTMZ
387             for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
388             {
389                RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[id3]);
390             }
391 #endif
392             RETVALUE(RFAILED);
393       }
394    }
395    else
396    {
397 #if (ERRCLASS & ERRCLS_ADD_RES)      
398       RGLOGERROR(inst,ERRCLS_INT_PAR, ERG013, (ErrVal)spId,
399             "Invalid SAP Id:RgUiRguDDatReq failed\n");
400 #endif
401 #ifndef L2_OPTMZ
402       for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
403       {
404          RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[id3]);
405       }
406 #endif
407       RETVALUE(RFAILED);
408    }
409
410    /* Update RGU SAP statistics for received sdu count */
411    /*ccpu00118201 - ADD - Send trace only when its enabled*/
412    if(rgCb[inst].rgInit.trc)
413    {
414       for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
415       {
416          RguDDatReqPerUe *datReqPerUe = &datReq->datReq[id3];
417          for (id = 0; id < datReqPerUe->nmbOfTbs; id++)
418          {
419             for (id1 = 0; id1 < datReqPerUe->datReqTb[id].nmbLch; id1++)
420             {
421                /* rgCb.rguSap.sapSts.numPduRcvd is updated by 
422                 * rgROMDedDatReq -> rgUpdtRguDedSts function
423                 * So numPduRcvd updation is commented here */
424                /* rgCb.rguSap.sapSts.numPduRcvd +=
425                   datReq->datReqTb[id].lchData[id1].pdu.numPdu; */
426                for (id2 = 0; id2 < datReqPerUe->datReqTb[id].lchData[id1].pdu.numPdu; id2++)
427                {
428                   RG_SEND_TRC_IND(inst,datReqPerUe->datReqTb[id].
429                         lchData[id1].pdu.mBuf[id2], EVTRGUDDATREQ);
430                }
431             }
432          }
433       }
434    }
435 #endif
436
437    /* Call Ownership module for further processing */
438    ret = rgROMDedDatReq(inst,datReq);
439     SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,sizeof(RguDDatReqInfo), SS_SHARABLE_MEMORY);
440    datReq = NULLP;
441    RETVALUE(ret);
442 }  /* RgUiRguDDatReq */
443
444
445 /**
446  * @brief Handler for common DatReq from RGU
447  *
448  * @details
449  *
450  *     Function : RgUiRguCDatReq
451  *     
452  *     This function validates SAP invokes ROM for further processing
453  *     
454  *  @param[in]  Pst             *pst 
455  *  @param[in]  SpId            spId 
456  *  @param[in]  RguCDatReqInfo  *datReq
457  *  @return  S16
458  *      -# ROK 
459  *      -# RFAILED 
460  **/
461 #ifdef ANSI
462 PUBLIC S16 RgUiRguCDatReq
463 (
464 Pst             *pst,
465 SpId            spId,
466 RguCDatReqInfo  *datReq
467 )
468 #else
469 PUBLIC S16 RgUiRguCDatReq(pst, spId, datReq)
470 Pst             *pst;
471 SpId            spId;
472 RguCDatReqInfo  *datReq;
473 #endif
474 {
475    Inst  inst;
476    S16   ret = ROK;
477    
478    TRC3(RgUiRguCDatReq)
479
480
481    RG_IS_INST_VALID(pst->dstInst);
482    inst = pst->dstInst - RG_INST_START;
483 #ifndef NO_ERRCLS
484    if (datReq == NULLP)
485    {
486       RLOG0(L_ERROR,"Input Message Buffer is NULL");
487       RETVALUE(RFAILED);
488    }
489    
490    if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
491    {
492       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
493       {
494          case LRG_BND: /* SAP is bound */
495             RLOG0(L_DEBUG,"SAP is already bound");
496             break;
497          default: /* Should never reach here */
498 #if (ERRCLASS & ERRCLS_ADD_RES)      
499             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguCDatReq failed",
500                   rgCb[inst].rguSap[spId].sapSta.sapState);
501 #endif
502             RETVALUE(RFAILED);
503       }
504    }
505    else
506    {
507 #if (ERRCLASS & ERRCLS_ADD_RES)      
508       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiRguCDatReq failed ",spId);
509 #endif
510       RETVALUE(RFAILED);
511    }
512 #endif
513
514    /* Update RGU SAP statistics for received sdu count */
515    /* rgCb.rguSap.sapSts.numPduRcvd is updated by 
516     * rgROMCmnDatReq ->rgUpdtRguCmnSts function
517     * So numPduRcvd updation is commented here */
518    /* rgCb.rguSap.sapSts.numPduRcvd++; */
519
520    ret = rgROMCmnDatReq(inst,datReq);
521    /*ccpu00118201 - ADD - Send trace only when its enabled*/
522    if(rgCb[inst].rgInit.trc)
523    {
524       RG_SEND_TRC_IND(inst,datReq->pdu, EVTRGUCDATREQ);
525    }
526    if (ret == RFAILED)
527    {
528       RG_DROP_RGUCDATREQ_MBUF(datReq);
529    }
530    ret = SPutStaticBuffer(pst->region, pst->pool,(Data *)datReq,sizeof(RguCDatReqInfo) , SS_SHARABLE_MEMORY);
531    datReq = NULLP;
532    RETVALUE(ret);
533 }  /* RgUiRguCDatReq */
534
535
536 /**
537  * @brief Handler for dedicated StaRsp from RGU
538  *
539  * @details
540  *
541  *     Function : RgUiRguDStaRsp
542  *     
543  *     This function validates SAP and invokes ROM for further processing
544  *           
545  *  @param[in]  Pst             *pst 
546  *  @param[in]  SpId            spId 
547  *  @param[in]  RguDStaRspInfo  *staRsp
548  *  @return  S16
549  *      -# ROK 
550  *      -# RFAILED 
551  **/
552 #ifdef ANSI
553 PUBLIC S16 RgUiRguDStaRsp
554 (
555 Pst             *pst,
556 SpId            spId,
557 RguDStaRspInfo  *staRsp
558 )
559 #else
560 PUBLIC S16 RgUiRguDStaRsp(pst, spId, staRsp)
561 Pst             *pst;
562 SpId            spId;
563 RguDStaRspInfo  *staRsp;
564 #endif
565 {
566    Inst  inst;
567
568    S16              ret       = ROK;
569    VOLATILE U32     startTime = 0;
570
571    TRC3(RgUiRguDStaRsp)
572
573    RG_IS_INST_VALID(pst->dstInst);
574    inst = pst->dstInst - RG_INST_START;
575    /*starting Task*/
576    SStartTask(&startTime, PID_MAC_STA_RSP);
577
578    ret = rgROMDedStaRsp(inst,staRsp);
579    if (ret != ROK)
580    {
581       RLOG_ARG0(L_ERROR,DBG_CELLID,staRsp->cellId,
582                 "Processing Of Status Response Failed");
583    }
584
585
586    /*stoping Task*/
587    SStopTask(startTime, PID_MAC_STA_RSP);
588    RETVALUE(ret);
589 }  /* RgUiRguDStaRsp */
590
591
592 /**
593  * @brief Handler for common StaRsp from RGU
594  *
595  * @details
596  *
597  *     Function : RgUiRguCStaRsp
598  *     
599  *     This function validates SAP and invokes ROM 
600  *     for further processing
601  *     
602  *           
603  *  @param[in]  Pst             *pst 
604  *  @param[in]  SpId            spId 
605  *  @param[in]  RguCStaRspInfo  *staRsp
606  *  @return  S16
607  *      -# ROK 
608  *      -# RFAILED 
609  **/
610 #ifdef ANSI
611 PUBLIC S16 RgUiRguCStaRsp
612 (
613 Pst             *pst,
614 SpId            spId,
615 RguCStaRspInfo  *staRsp
616 )
617 #else
618 PUBLIC S16 RgUiRguCStaRsp(pst, spId, staRsp)
619 Pst             *pst;
620 SpId            spId;
621 RguCStaRspInfo  *staRsp;
622 #endif
623 {
624    Inst  inst;
625    S16   ret = ROK;
626
627    TRC3(RgUiRguCStaRsp)
628    
629
630    RG_IS_INST_VALID(pst->dstInst);
631    inst = pst->dstInst - RG_INST_START;
632 #ifndef NO_ERRCLS
633    if (staRsp == NULLP)
634    {
635       RLOG0(L_ERROR,"Input Response Buffer is NULL");
636       RETVALUE(RFAILED);
637    }
638
639    if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
640    {
641       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
642       {
643          case LRG_BND: /* SAP is bound */
644             RLOG0(L_DEBUG,"SAP is already bound");
645             break;
646          default: /* Should never reach here */
647 #if (ERRCLASS & ERRCLS_ADD_RES)      
648             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguCStaRsp failed",
649                   rgCb[inst].rguSap[spId].sapSta.sapState);
650 #endif
651             RETVALUE(RFAILED);
652       }
653    }
654    else
655    {
656 #if (ERRCLASS & ERRCLS_ADD_RES)      
657       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiRguCStaRsp failed",spId);
658 #endif
659       RETVALUE(RFAILED);
660    }
661 #endif
662
663    ret = rgROMCmnStaRsp(inst,staRsp);
664    if (ret != ROK)
665    {
666       RLOG_ARG0(L_ERROR,DBG_CELLID,staRsp->cellId,"Processing Of Status Response Failed");
667       RETVALUE(ret);
668    }
669
670    ret = SPutStaticBuffer(pst->region, pst->pool, (Data *)staRsp,sizeof(RguCStaRspInfo) , SS_SHARABLE_MEMORY);
671    staRsp = NULLP;
672    RETVALUE(ret);
673 }  /* RgUiRguCStaRsp */
674
675 #ifdef LTE_L2_MEAS
676
677 /**
678  * @brief Handler for L2M MeasReq from RGU
679  *
680  * @details
681  *
682  *     Function :RgUiRguL2MUlThrpMeasReq 
683  *     
684  *     This function validates SAP and invokes ROM for further processing
685  *           
686  *  @param[in]  Pst             *pst 
687  *  @param[in]  SpId            spId 
688  *  @param[in]  RguL2MUlThrpMeasReqInfo  *measReq
689  *  @return  S16
690  *      -# ROK 
691  *      -# RFAILED 
692  **/
693 #ifdef ANSI
694 PUBLIC S16 RgUiRguL2MUlThrpMeasReq 
695 (
696 Pst             *pst,
697 SpId            spId,
698 RguL2MUlThrpMeasReqInfo  *measReq
699 )
700 #else
701 PUBLIC S16 RgUiRguL2MUlThrpMeasReq(pst, spId, measReq)
702 Pst             *pst;
703 SpId            spId;
704 RguL2MUlThrpMeasReqInfo  *measReq;
705 #endif
706 {
707    Inst  inst;
708
709    S16   ret = ROK;
710
711    TRC3(RgUiRguL2MUlThrpMeasReq)
712    
713
714    RG_IS_INST_VALID(pst->dstInst);
715    inst = pst->dstInst - RG_INST_START;
716 #ifndef NO_ERRCLS
717    if (measReq == NULLP)
718    {
719       RLOG0(L_ERROR,"Input Response Buffer is NULL");
720       RETVALUE(RFAILED);
721    }
722
723    if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
724    {
725       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
726       {
727          case LRG_BND: /* SAP is bound */
728             RLOG0(L_DEBUG,"SAP is already bound");
729             break;
730          default: /* Should never reach here */
731 #if (ERRCLASS & ERRCLS_ADD_RES)      
732             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguL2MUlThrpMeasReq failed",
733                   rgCb[inst].rguSap[spId].sapSta.sapState);
734 #endif
735             RETVALUE(RFAILED);
736       }
737    }
738    else
739    {
740 #if (ERRCLASS & ERRCLS_ADD_RES)      
741       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiRguL2MUlThrpMeasReq failed",spId);
742 #endif
743       RETVALUE(RFAILED);
744    }
745 #endif
746
747    ret = rgROML2MUlThrpMeasReq(inst,measReq);
748    if (ret != ROK)
749    {
750       RLOG_ARG0(L_ERROR,DBG_CELLID,measReq->cellId,"Processing Of Meas Request Failed");
751    }
752
753   SPutStaticBuffer(pst->region, pst->pool, (Data *)measReq,sizeof(RguL2MUlThrpMeasReqInfo) , SS_SHARABLE_MEMORY);
754    measReq= NULLP;
755    RETVALUE(ret);
756 }  /* RgUiRguL2MUlThrpMeasReq */
757 #endif
758
759 /**
760  * @brief Handler for sending staInd to dedicated logical channels of a UE 
761  *
762  * @details
763  *
764  *     Function : rgUIMSndDedStaInd
765  *     
766  *     This function fills SAP and Pst information to send the staInd to
767  *     a UE.
768  *     
769  *           
770  *  @param[in] Inst        inst
771  *  @param[in] RgUpSapCb  *rguSap 
772  *  @param[in]  RgRguDedStaInd  *staInd
773  *  @return  S16
774  *      -# ROK 
775  *      -# RFAILED 
776  **/
777 #ifdef ANSI
778 PUBLIC S16 rgUIMSndDedStaInd
779 (
780 Inst         inst,
781 RgUpSapCb    *rguSap,
782 RgRguDedStaInd  *staInd
783 )
784 #else
785 PUBLIC S16 rgUIMSndDedStaInd(inst,rguSap,staInd)
786 Inst         inst;
787 RgUpSapCb    *rguSap;
788 RgRguDedStaInd  *staInd;
789 #endif
790 {
791    S16  ret = ROK;
792    
793    TRC2(rgUIMSndDedStaInd)
794    
795    RGDBGPRM(inst,(rgPBuf(inst),"rgUIMSndDedStaInd(): staInd = %p;\n", (void *)staInd));
796    
797    ret = RgUiRguDStaInd(&(rguSap->sapCfg.sapPst), rguSap->sapCfg.suId, 
798          staInd);
799    if (ret != ROK)
800    {
801       RLOG_ARG0(L_ERROR,DBG_CELLID,staInd->cellId,"RgUiRguDStaInd Failed");
802       RETVALUE(ret);
803    }
804    RETVALUE(ret);
805 }  /* rgUIMSndDedStaInd */
806
807
808 /**
809  * @brief Handler for sending staInd to a common logical channel.
810  *
811  * @details
812  *
813  *     Function : rgUIMSndCmnStaInd
814  *     
815  *     This function fills SAP and Pst information to send the staInd to
816  *     a common logical channel.
817  *     
818  *           
819  *  @param[in] Inst        inst
820  *  @param[in] RgUpSapCb  *rguSap 
821  *  @param[in]  RgRguCmnStaInd  *staInd
822  *  @return  S16
823  *      -# ROK 
824  *      -# RFAILED 
825  **/
826 #ifdef ANSI
827 PUBLIC S16 rgUIMSndCmnStaInd
828 (
829 Inst            inst,
830 RgUpSapCb    *rguDlSap,
831 RgRguCmnStaInd  *staInd
832 )
833 #else
834 PUBLIC S16 rgUIMSndCmnStaInd(inst,rguDlSap,staInd)
835 Inst          inst,
836 RgUpSapCb    *rguDlSap,
837 RgRguCmnStaInd  *staInd;
838 #endif
839 {
840    S16  ret = ROK;
841
842
843    TRC2(rgUIMSndCmnStaInd)
844    
845
846    ret = RgUiRguCStaInd(&(rguDlSap->sapCfg.sapPst), rguDlSap->sapCfg.suId, 
847          staInd);
848    if (ret != ROK)
849    {
850       RLOG_ARG0(L_ERROR,DBG_CELLID,staInd->cellId,"RgUiRguCStaInd Failed");
851       RETVALUE(ret);
852    }
853    RETVALUE(ret);
854 }  /* rgUIMSndCmnStaInd */
855
856
857 /**
858  * @brief Handler for sending datInd to dedicated logical channels of a UE 
859  *
860  * @details
861  *
862  *     Function : rgUIMSndDedDatInd
863  *     
864  *     This function fills SAP and Pst information to send the datInd to
865  *     a UE.
866  *     
867  *           
868  *  @param[in] Inst        inst
869  *  @param[in] RgUpSapCb  *rguUlSap 
870  *  @param[in]  RgRguDedDatInd  *datInd
871  *  @return  S16
872  *      -# ROK 
873  *      -# RFAILED 
874  **/
875 #ifdef ANSI
876 PUBLIC S16 rgUIMSndDedDatInd
877 (
878 Inst         inst,
879 RgUpSapCb    *rguUlSap,
880 RgRguDedDatInd  *datInd
881 )
882 #else
883 PUBLIC S16 rgUIMSndDedDatInd(datInd)
884 Inst         inst;
885 RgUpSapCb    *rguUlSap;
886 RgRguDedDatInd  *datInd;
887 #endif
888 {
889    S16  ret = ROK;
890
891
892    TRC2(rgUIMSndDedDatInd)
893    
894
895    rguUlSap->sapSts.numPduTxmit += datInd->numLch;
896 #ifndef SS_RBUF
897    ret = RgUiRguDDatInd(&(rguUlSap->sapCfg.sapPst), rguUlSap->sapCfg.suId, 
898          datInd);
899    if (ret != ROK)
900    {
901       RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"RgUiRguDdatInd Failed");
902       RETVALUE(ret);
903    }
904 #else
905    SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
906    SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
907 #endif
908    RETVALUE(ret);
909 }  /* rgUIMSndDedDatInd */
910
911
912 /**
913  * @brief Handler for sending datInd to a common logical channel.
914  *
915  * @details
916  *
917  *     Function : rgUIMSndCmnDatInd
918  *     
919  *     This function fills SAP and Pst information to send the datInd to
920  *     a common logical channel.
921  *     
922  *           
923  *  @param[in] Inst        inst
924  *  @param[in] RgUpSapCb  *rguSap 
925  *  @param[in]  RgRguCmnDatInd  *datInd
926  *  @return  S16
927  *      -# ROK 
928  *      -# RFAILED 
929  **/
930 #ifdef ANSI
931 PUBLIC S16 rgUIMSndCmnDatInd
932 (
933 Inst         inst,
934 RgUpSapCb    *rguUlSap,
935 RgRguCmnDatInd  *datInd
936 )
937 #else
938 PUBLIC S16 rgUIMSndCmnDatInd(datInd)
939 Inst         inst;
940 RgUpSapCb    *rguUlSap;
941 RgRguCmnDatInd  *datInd;
942 #endif
943 {
944    S16  ret = ROK;
945
946    TRC2(rgUIMSndCmnDatInd)
947
948
949    RGDBGPRM(inst,(rgPBuf(inst),"rgUIMSndCmnDatInd(): staInd = %p;\n", (void *)datInd));
950
951    rguUlSap->sapSts.numPduTxmit++;
952
953    RGDBGPRM(inst,(rgPBuf(inst),"rgUIMSndCmnDatInd suId = %d\n", rguUlSap->sapCfg.suId));   
954    ret = RgUiRguCDatInd(&(rguUlSap->sapCfg.sapPst), rguUlSap->sapCfg.suId, 
955          datInd);
956    if (ret != ROK)
957    {
958       RGDBGERRNEW(inst,(rgPBuf(inst),"RgUiRguCDatInd Failed\n"));
959       RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"RgUiRguCDatInd Failed");
960       RETVALUE(ret);
961    }
962    RETVALUE(ret);
963 }  /* rgUIMSndCmnDatInd */
964
965 /**
966
967  * @brief API for bind request from RRC towards MAC. 
968  *
969  * @details
970  *
971  *     Function: RgUiCrgBndReq
972  *     
973  *     This API is invoked by RRC towards MAC to bind CRG SAP. 
974  *     These API validates the Pst, spId, suId and sends the bind confirm to RRC.
975  *
976  *           
977  *  @param[in]  Pst   *pst
978  *  @param[in]  SuId  suId
979  *  @param[in]  SpId  spId
980  *  @return  S16
981  *      -# ROK 
982  *      -# RFAILED 
983  **/
984 #ifdef ANSI
985 PUBLIC S16 RgUiCrgBndReq
986 (
987 Pst   *pst, 
988 SuId  suId,
989 SpId  spId
990 )
991 #else
992 PUBLIC S16 RgUiCrgBndReq(pst, suId, spId)
993 Pst   *pst; 
994 SuId  suId;
995 SpId  spId;
996 #endif
997 {
998    S16       ret = ROK;
999    Pst       tmpPst;   /* Temporary Post Structure */
1000    RgUstaDgn dgn;      /* Alarm diagnostics structure */
1001    Inst      inst;
1002
1003    TRC3(RgUiCrgBndReq)
1004
1005
1006    RG_IS_INST_VALID(pst->dstInst);
1007    inst = pst->dstInst - RG_INST_START;
1008
1009    tmpPst.prior       = pst->prior;
1010    tmpPst.route       = pst->route;
1011    tmpPst.selector    = pst->selector;
1012    tmpPst.region      = rgCb[inst].rgInit.region;
1013    tmpPst.pool        = rgCb[inst].rgInit.pool;
1014    tmpPst.srcProcId   = rgCb[inst].rgInit.procId;
1015    tmpPst.srcEnt      = rgCb[inst].rgInit.ent;
1016    tmpPst.srcInst     = rgCb[inst].rgInit.inst;
1017    tmpPst.event       = EVTNONE;
1018    tmpPst.dstProcId   = pst->srcProcId;
1019    tmpPst.dstEnt      = pst->srcEnt;
1020    tmpPst.dstInst     = pst->srcInst;
1021
1022
1023    if(spId == rgCb[inst].crgSap.sapCfg.spId)
1024    {
1025       /* Check the state of the SAP */
1026       switch (rgCb[inst].crgSap.sapSta.sapState)
1027       {
1028          case LRG_NOT_CFG: /* SAP Not configured */
1029             
1030             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
1031             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_NOT_CFG,
1032                   LCM_CAUSE_INV_SAP, &dgn);
1033             RLOG0(L_DEBUG,"SAP Not Configured");
1034             ret = RgUiCrgBndCfm(&tmpPst, suId, CM_BND_NOK);
1035             break;
1036          case LRG_UNBND: /* SAP is not bound */
1037             RLOG0(L_DEBUG,"SAP Not yet bound");
1038             
1039             rgCb[inst].crgSap.sapSta.sapState = LRG_BND;
1040             rgCb[inst].crgSap.sapCfg.suId = suId;
1041             /* Send Bind Confirm with status as SUCCESS */
1042             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_OK);
1043             /* Indicate to Layer manager */
1044             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
1045             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_EVENT_CRGSAP_ENB,
1046                   LCM_CAUSE_UNKNOWN, &dgn);
1047             break;
1048          case LRG_BND: /* SAP is already bound*/
1049             RLOG0(L_DEBUG,"SAP is already bound");
1050             
1051             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_OK);
1052             break;
1053          default: /* Should Never Enter here */
1054 #if (ERRCLASS & ERRCLS_ADD_RES)      
1055             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiCrgBndReq failed",
1056                   rgCb[inst].crgSap.sapSta.sapState);
1057 #endif
1058             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_NOK);
1059             break;
1060       }
1061    }
1062    else
1063    {
1064 #if (ERRCLASS & ERRCLS_ADD_RES)      
1065       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiCrgBndReq failed",
1066            rgCb[inst].crgSap.sapCfg.spId);
1067 #endif
1068       ret = rgUIMCrgBndCfm(inst,suId, CM_BND_NOK);
1069    }
1070    RETVALUE(ret);
1071 }  /* RgUiCrgBndReq */
1072
1073
1074 /**
1075  * @brief API for unbind request from RRC towards MAC. 
1076  *
1077  * @details
1078  *
1079  *     Function: RgUiCrgUbndReq
1080  *     
1081  *     This API is invoked by RRC towards MAC to unbind CRG SAP. 
1082  *     These API validates the Pst, spId, suId and sends the bind confirm to RRC.
1083  *
1084  *           
1085  *  @param[in]  Pst    *pst
1086  *  @param[in]  SuId   suId
1087  *  @param[in]  Reason reason
1088  *  @return  S16
1089  *      -# ROK 
1090  *      -# RFAILED 
1091  **/
1092 #ifdef ANSI
1093 PUBLIC S16 RgUiCrgUbndReq
1094 (
1095 Pst    *pst,
1096 SpId   spId,
1097 Reason reason
1098 )
1099 #else
1100 PUBLIC S16 RgUiCrgUbndReq(pst, spId, reason)
1101 Pst    *pst; 
1102 SpId   spId;
1103 Reason reason;
1104 #endif
1105 {
1106    Inst      inst;
1107    TRC3(RgUiCrgUbndReq)
1108
1109
1110    RG_IS_INST_VALID(pst->dstInst);
1111    inst = pst->dstInst - RG_INST_START;
1112    /* SAP Id validation */
1113    if (spId == rgCb[inst].crgSap.sapCfg.spId)
1114    {
1115       switch(rgCb[inst].crgSap.sapSta.sapState)
1116       {
1117          case LRG_BND: /* SAP is already bound*/
1118             /* setting SAP state to UN BOUND */
1119             RLOG0(L_DEBUG, "SAP is already bound");
1120             
1121             rgCb[inst].crgSap.sapSta.sapState = LRG_UNBND;
1122             break;
1123          default:
1124 #if (ERRCLASS & ERRCLS_ADD_RES)
1125             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiCrgUbndReq failed",
1126                   rgCb[inst].crgSap.sapSta.sapState);
1127 #endif
1128             RETVALUE(RFAILED);
1129       }
1130    }
1131    else
1132    {
1133 #if (ERRCLASS & ERRCLS_ADD_RES)      
1134       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiCrgUbndReq failed",
1135             rgCb[inst].crgSap.sapCfg.spId);
1136 #endif
1137       RETVALUE(RFAILED);
1138    }
1139    RETVALUE(ROK);
1140 }  /* RgUiCrgUbndReq */
1141
1142 /**
1143  * @brief API for sending bind confirm from MAC to RRC
1144  *
1145  * @details
1146  *
1147  *     Function: rgUIMRgrBndCfm
1148  *     
1149  *     This API is invoked to send bind confirm from MAC to RRC.
1150  *     This API fills in Pst structure and SAP Ids and invokes 
1151  *     bind confirm API towards RRC.
1152  *           
1153  *  @param[in] Inst        inst
1154  *  @param[in]  SuId          suId
1155  *  @param[in]  U8            status
1156  *  @return  S16
1157  *      -# ROK 
1158  *      -# RFAILED 
1159  **/
1160 #ifdef ANSI
1161 PUBLIC S16 rgUIMCrgBndCfm
1162 (
1163 Inst  inst,
1164 SuId suId,
1165 U8 status
1166 )
1167 #else
1168 PUBLIC S16 rgUIMCrgBndCfm(inst,suId, status)
1169 Inst          inst;
1170 SuId          suId;
1171 U8            status;
1172 #endif
1173 {
1174    TRC2(rgUIMCrgBndCfm)
1175    
1176
1177    if(RgUiCrgBndCfm(&(rgCb[inst].crgSap.sapCfg.sapPst), rgCb[inst].crgSap.sapCfg.suId, status) != ROK)
1178    {
1179       RLOG0(L_ERROR,"RgUiCrgBndCfm Failed ");
1180       RETVALUE(RFAILED);
1181    }
1182
1183    RETVALUE(ROK);
1184 }  /* rgUIMCrgBndCfm*/
1185
1186 /**
1187  * @brief API for configuration request from RRC towards MAC. 
1188  *
1189  * @details
1190  *
1191  *     Function: RgUiCrgCfgReq
1192  *     
1193  *     This API is invoked by RRC towards MAC to configure MAC. 
1194  *     These API validates the Pst, spId, suId and transfers the config request 
1195  *     specific information to corresponding ownership module (COM) API.
1196  *
1197  *           
1198  *  @param[in]  Pst           *pst
1199  *  @param[in]  SpId          spId
1200  *  @param[in]  CrgCfgTransId transId
1201  *  @param[in]  CrgCfgReqInfo *cfgReqInfo
1202  *  @return  S16
1203  *      -# ROK 
1204  *      -# RFAILED 
1205  **/
1206 #ifdef ANSI
1207 PUBLIC S16 RgUiCrgCfgReq
1208 (
1209 Pst           *pst, 
1210 SpId          spId,
1211 CrgCfgTransId transId,
1212 CrgCfgReqInfo *cfgReqInfo
1213 )
1214 #else
1215 PUBLIC S16 RgUiCrgCfgReq(pst, spId, transId, cfgReqInfo)
1216 Pst           *pst; 
1217 SpId          spId;
1218 CrgCfgTransId transId;
1219 CrgCfgReqInfo *cfgReqInfo;
1220 #endif
1221 {
1222    Inst      inst;
1223    S16       ret       = ROK;
1224    U8        cfmStatus = 0x00ff;
1225    U8        prntTrans[CRG_CFG_TRANSID_SIZE+1];
1226
1227    TRC3(RgUiCrgCfgReq);
1228
1229    RG_IS_INST_VALID(pst->dstInst);
1230    inst = pst->dstInst - RG_INST_START;
1231    /* Ensuring transId is always Null terminated. */
1232    cmMemcpy((U8 *)prntTrans, (U8 *)transId.trans, CRG_CFG_TRANSID_SIZE);
1233    prntTrans[CRG_CFG_TRANSID_SIZE] = '\0';
1234
1235
1236    /* CrgCfgReqInfo Validation for NULLP */
1237    if (cfgReqInfo == NULLP)
1238    {
1239       RLOG0(L_ERROR,"Input Param crgReqInfo is NULL ");
1240       rgUIMCrgCfgCfm(inst,transId, cfmStatus); 
1241       RETVALUE(RFAILED);
1242    }
1243
1244    /* Upper SAP Id and State validation */
1245    if (spId == rgCb[inst].crgSap.sapCfg.spId)
1246    {
1247       switch(rgCb[inst].crgSap.sapSta.sapState)
1248       {
1249          case LRG_BND: /* SAP is already bound */
1250             RLOG0(L_DEBUG,"SAP is already bound");
1251             break;
1252          default: /* Should never reach here */
1253 #if (ERRCLASS & ERRCLS_ADD_RES)      
1254             RLOG1(L_ERROR,"Invalid SAP State:%d RgUiCrgCfgReq failed",
1255                   rgCb[inst].crgSap.sapSta.sapState);
1256 #endif
1257          SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
1258                sizeof(CrgCfgReqInfo));
1259          cfgReqInfo = NULLP;
1260
1261             rgUIMCrgCfgCfm(inst,transId, cfmStatus);
1262             RETVALUE(RFAILED);
1263       }
1264    }
1265    else
1266    {
1267 #if (ERRCLASS & ERRCLS_ADD_RES)      
1268       RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiCrgCfgReq failed",
1269             rgCb[inst].crgSap.sapCfg.spId);
1270 #endif
1271       SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
1272             sizeof(CrgCfgReqInfo));
1273       cfgReqInfo = NULLP;
1274       rgUIMCrgCfgCfm(inst,transId, cfmStatus); 
1275       RETVALUE(RFAILED);
1276    }
1277    ret = rgCOMCfgReq(inst,transId, cfgReqInfo);
1278    SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
1279          sizeof(CrgCfgReqInfo));
1280    cfgReqInfo = NULLP;
1281    if (ret != ROK)
1282    {
1283       RLOG0(L_ERROR,"Configuration Request Handling Failed ");
1284       RETVALUE(RFAILED);
1285    }
1286
1287    RETVALUE(ROK);
1288 }  /* RgUiCrgCfgReq */
1289
1290 /**
1291  * @brief API for sending configuration confirm from MAC to RRC
1292  *
1293  * @details
1294  *
1295  *     Function: rgUIMCrgCfgCfm
1296  *     
1297  *     This API is invoked to send configuration confirm from MAC to RRC.
1298  *     This API fills in Pst structure and SAP Ids and invokes 
1299  *     config confirm API towards RRC.
1300  *           
1301  *  @param[in] Inst        inst
1302  *  @param[in]  CrgCfgTransId transId
1303  *  @param[in]  U8            status
1304  *  @return  S16
1305  *      -# ROK 
1306  *      -# RFAILED 
1307  **/
1308 #ifdef ANSI
1309 PUBLIC S16 rgUIMCrgCfgCfm
1310 (
1311 Inst      inst,
1312 CrgCfgTransId transId,
1313 U8            status
1314 )
1315 #else
1316 PUBLIC S16 rgUIMCrgCfgCfm(inst,transId, status)
1317 Inst      inst;
1318 CrgCfgTransId transId;
1319 U8            status;
1320 #endif
1321 {
1322    S16  ret = ROK;
1323    U8   prntTrans[CRG_CFG_TRANSID_SIZE+1];
1324
1325    TRC2(rgUIMCrgCfgCfm)
1326    
1327    cmMemcpy((U8 *)prntTrans, (U8 *)transId.trans, CRG_CFG_TRANSID_SIZE);
1328    prntTrans[CRG_CFG_TRANSID_SIZE] = '\0';
1329
1330
1331    ret = RgUiCrgCfgCfm(&(rgCb[inst].crgSap.sapCfg.sapPst), rgCb[inst].crgSap.sapCfg.suId, transId, status);
1332    if (ret != ROK)
1333    {
1334       RLOG0(L_ERROR,"RgUiCrgCfgCfm Failed ");
1335       RETVALUE(ret);
1336    }
1337
1338    RETVALUE(ret);
1339 }  /* rgUIMCrgCfgCfm */
1340 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
1341
1342 #ifdef ANSI
1343 PUBLIC S16 rgBatchProc
1344 (
1345 Void
1346 )
1347 #else
1348 PUBLIC S16 rgBatchProc()
1349 Void;
1350 #endif
1351 {
1352 /* Read from Ring Buffer and process RLC BO Update */
1353    Pst pst = {0};
1354    SpId spId = 0;
1355    RguDStaRspInfo  *staRsp;
1356    U32 elmIndx = 0;
1357 #ifndef LTE_ADV
1358 /* Fill pst */
1359    pst.srcProcId = 1;
1360    pst.dstProcId = 1;
1361    pst.dstEnt = ENTRG;
1362    pst.dstInst = 0;
1363    pst.srcEnt = ENTKW;
1364    pst.srcInst = 1;
1365    pst.prior = PRIOR0;
1366    pst.route = RTESPEC;
1367    pst.event = EVTRGUDSTARSP;
1368    pst.region = 0;
1369    pst.pool = 0;
1370    pst.selector = 2; /*SM_SELECTOR_LC */
1371 #else
1372 #endif
1373   
1374    elmIndx = (U32)SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1375    while(NULLP != elmIndx)
1376    {
1377       staRsp = (RguDStaRspInfo *)elmIndx;
1378 #ifdef LTE_ADV
1379       pst = staRsp->post;
1380 #endif
1381       RgUiRguDStaRsp(&pst, spId, staRsp);
1382
1383       elmIndx = NULLP;
1384       staRsp = NULLP;
1385       SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
1386
1387       if((elmIndx = (U32)SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP)
1388       break;
1389    }
1390    RETVALUE(ROK);
1391 }
1392 #endif
1393
1394 /**********************************************************************
1395  
1396          End of file
1397 **********************************************************************/