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