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