[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[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
37 /* header include files -- defines (.h) */
38
39 /* header/extern include files (.x) */
40 /* header include files (.h) */
41 #include "common_def.h"
42 #include "crg.h"           /* CRG defines */
43 #include "lrg.h"           /* layer management defines for LTE-MAC */
44 #include "tfu.h"
45 #include "rgu.h"
46 #include "rg_sch_inf.h"
47 #include "rg_env.h"        /* customizable defines and macros for MAC */
48 #include "rg.h"            /* defines and macros for MAC */
49 #include "rg_err.h"        /* RG error defines */
50 #include "mac_utils.h"
51
52 /* header/extern include files (.x) */
53
54 #include "crg.x"           /* CRG types */
55 #include "lrg.x"           /* layer management typedefs for MAC */
56 #include "tfu.x"
57 #include "rgu.x"
58 #include "rg_sch_inf.x"
59 #include "rg_prg.x"        /* PRG interface typedefs*/
60 #include "du_app_mac_inf.h"
61 #include "rg.x"            /* typedefs for MAC */
62
63 #include "ss_rbuf.h"
64 #include "ss_rbuf.x"
65
66 /* local defines */
67
68 /* local typedefs */
69  
70 /* local externs */
71  
72 /* forward references */
73
74 uint8_t rgRguDlSap;
75 uint8_t rgRguUlSap;
76 /**
77  * @brief Handler for Bind request.
78  *
79  * @details
80  *
81  *     Function : RgUiRguBndReq
82  *     
83  *     This function handles the bind request from MAC Service User.
84  *     
85  *           
86  *  @param[in]  Pst  *pst
87  *  @param[in]  SuId suId
88  *  @param[in]  SpId spId
89  *  @return  S16
90  *      -# ROK 
91  *      -# RFAILED 
92  **/
93 S16 RgUiRguBndReq
94 (
95 Pst  *pst,
96 SuId suId,
97 SpId spId
98 )
99 {
100    Inst      inst; 
101    S16       ret = ROK;
102    Pst       tmpPst;   /* Temporary Post Structure */
103    RgUstaDgn dgn;      /* Alarm diagnostics structure */
104
105    RG_IS_INST_VALID(pst->dstInst);
106    inst = pst->dstInst - RG_INST_START;
107
108    tmpPst.prior       = pst->prior;
109    tmpPst.route       = pst->route;
110    tmpPst.selector    = pst->selector;
111    tmpPst.region      = rgCb[inst].rgInit.region;
112    tmpPst.pool        = rgCb[inst].rgInit.pool;
113    tmpPst.srcProcId   = rgCb[inst].rgInit.procId;
114    tmpPst.srcEnt      = rgCb[inst].rgInit.ent;
115    tmpPst.srcInst     = rgCb[inst].rgInit.inst;
116    tmpPst.event       = EVTNONE;
117    tmpPst.dstProcId   = pst->srcProcId;
118    tmpPst.dstEnt      = pst->srcEnt;
119    tmpPst.dstInst     = pst->srcInst;
120
121    if(spId == rgCb[inst].rguSap[spId].sapCfg.spId)
122    {
123       /* Check the state of the SAP */
124       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
125       {
126          case LRG_NOT_CFG: /* SAP Not configured */
127             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
128             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_NOT_CFG,
129                   LCM_CAUSE_INV_SAP, &dgn);
130             DU_LOG("\nDEBUG  -->  MAC : SAP Not Configured");
131             ret = RgUiRguBndCfm(&tmpPst, suId, CM_BND_NOK);
132             break;
133          case LRG_UNBND: /* SAP is not bound */
134             DU_LOG("\nDEBUG  -->  MAC : SAP Not yet bound");
135             rgCb[inst].rguSap[spId].sapSta.sapState = LRG_BND;
136             rgCb[inst].rguSap[spId].sapCfg.suId = suId;
137             /* Send Bind Confirm with status as SUCCESS */
138             /*T2K - Passing spId as it is required to access the SAP CB*/
139             ret = rgUIMRguBndCfm(inst,spId, CM_BND_OK);
140             /* Indicate to Layer manager */ 
141             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
142             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_EVENT_RGUSAP_ENB,
143                   LCM_CAUSE_UNKNOWN, &dgn);
144             break;
145          case LRG_BND: /* SAP is already bound*/
146             DU_LOG("\nDEBUG  -->  MAC : SAP already bound");
147             /*T2K - Passing spId as it is required to access the SAP CB*/
148             ret = rgUIMRguBndCfm(inst,spId, CM_BND_OK);
149             break;
150          default: /* Should Never Enter here */
151 #if (ERRCLASS & ERRCLS_ADD_RES)      
152             DU_LOG("\nERROR  -->  MAC : Invalid SAP State:RgUiRguBndReq failed\n");
153 #endif
154             /*T2K - Passing spId as it is required to access the SAP CB*/
155             ret = rgUIMRguBndCfm(inst,spId, CM_BND_NOK);
156             break;
157       }
158    }
159    else
160    {
161 #if (ERRCLASS & ERRCLS_ADD_RES)      
162       DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:RgUiRguBndReq failed\n");
163 #endif
164       /*T2K - Passing spId as it is required to access the SAP CB*/
165       ret = rgUIMRguBndCfm(inst,spId, CM_BND_NOK);
166    }
167    return (ret);
168 }  /* RgUiRguBndReq */
169
170
171 /**
172  * @brief Handler for Unbind request.
173  *
174  * @details
175  *
176  *     Function : RgUiRguUbndReq
177  *     
178  *     This function handles the unbind request from MAC Service User.
179  *     
180  *           
181  *  @param[in]  Pst    *pst
182  *  @param[in]  SpId   spId
183  *  @param[in]  Reason reason
184  *  @return  S16
185  *      -# ROK 
186  *      -# RFAILED 
187  **/
188 S16 RgUiRguUbndReq
189 (
190 Pst    *pst,
191 SpId   spId,
192 Reason reason
193 )
194 {
195    Inst      inst;
196
197    RG_IS_INST_VALID(pst->dstInst);
198    inst = pst->dstInst - RG_INST_START;
199    /* SAP Id validation */
200    if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
201    {
202       switch(rgCb[inst].rguSap[spId].sapSta.sapState)
203       {
204          case LRG_BND: /* SAP is already bound*/
205             DU_LOG("\nDEBUG  -->  MAC : SAP already bound");
206             /* setting SAP state to UN BOUND */
207             rgCb[inst].rguSap[spId].sapSta.sapState = LRG_UNBND;
208             break;
209          default:
210 #if (ERRCLASS & ERRCLS_ADD_RES)      
211      DU_LOG("\nERROR  -->  MAC : Invalid SAP State:%d RgUiRguUbndReq failed",
212                   rgCb[inst].rguSap[spId].sapSta.sapState);
213        
214 #endif
215             break;
216       }
217    }
218    else
219    {
220 #if (ERRCLASS & ERRCLS_ADD_RES)      
221      DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:RgUiRguUbndReq failed\n");
222 #endif
223       return RFAILED;
224    }
225    return ROK;
226 }  /* RgUiRguUbndReq */
227 /**
228  * @brief API for sending bind confirm from MAC to RLC
229  *
230  * @details
231  *
232  *     Function: rgUIMRguBndCfm
233  *     
234  *     This API is invoked to send bind confirm from MAC to RLC.
235  *     This API fills in Pst structure and SAP Ids and invokes 
236  *     bind confirm API towards RLC.
237  *           
238  *  @param[in] Inst        inst
239  *  @param[in]  SuId          suId
240  *  @param[in]  uint8_t            status
241  *  @return  S16
242  *      -# ROK 
243  *      -# RFAILED 
244  **/
245 S16 rgUIMRguBndCfm(Inst inst,SpId spId,uint8_t status)
246 {
247    S16  ret = ROK;
248    
249    ret = RgUiRguBndCfm(&rgCb[inst].rguSap[spId].sapCfg.sapPst, 
250                       rgCb[inst].rguSap[spId].sapCfg.suId, status);
251    if (ret != ROK)
252    {
253       
254       DU_LOG("\nERROR  -->  MAC : RgUiRguBndCfm Failed ");
255       return (ret);
256    }
257    return (ret);
258 }  /* rgUIMRguBndCfm*/
259
260 #ifdef LTE_L2_MEAS
261
262 /**
263  * @brief Handler for L2M MeasReq from RGU
264  *
265  * @details
266  *
267  *     Function :RgUiRguL2MUlThrpMeasReq 
268  *     
269  *     This function validates SAP and invokes ROM for further processing
270  *           
271  *  @param[in]  Pst             *pst 
272  *  @param[in]  SpId            spId 
273  *  @param[in]  RguL2MUlThrpMeasReqInfo  *measReq
274  *  @return  S16
275  *      -# ROK 
276  *      -# RFAILED 
277  **/
278 S16 RgUiRguL2MUlThrpMeasReq 
279 (
280 Pst             *pst,
281 SpId            spId,
282 RguL2MUlThrpMeasReqInfo  *measReq
283 )
284 {
285    Inst  inst;
286
287    S16   ret = ROK;
288
289    RG_IS_INST_VALID(pst->dstInst);
290    inst = pst->dstInst - RG_INST_START;
291 #ifndef NO_ERRCLS
292    if (measReq == NULLP)
293    {
294       DU_LOG("\nERROR  -->  MAC : Input Response Buffer is NULL");
295       return RFAILED;
296    }
297
298    if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
299    {
300       switch (rgCb[inst].rguSap[spId].sapSta.sapState)
301       {
302          case LRG_BND: /* SAP is bound */
303             DU_LOG("\nERROR  -->  MAC : SAP is already bound");
304             break;
305          default: /* Should never reach here */
306 #if (ERRCLASS & ERRCLS_ADD_RES)      
307             DU_LOG("\nERROR  -->  MAC : Invalid SAP State:%d RgUiRguL2MUlThrpMeasReq failed",
308                   rgCb[inst].rguSap[spId].sapSta.sapState);
309 #endif
310             return RFAILED;
311       }
312    }
313    else
314    {
315 #if (ERRCLASS & ERRCLS_ADD_RES)      
316       DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:%d RgUiRguL2MUlThrpMeasReq failed",spId);
317 #endif
318       return RFAILED;
319    }
320 #endif
321
322    ret = rgROML2MUlThrpMeasReq(inst,measReq);
323    if (ret != ROK)
324    {
325       DU_LOG("\nERROR  -->  MAC : Processing Of Meas Request Failed");
326    }
327
328    MAC_FREE_SHRABL_BUF(pst->region, pst->pool, (Data *)measReq,sizeof(RguL2MUlThrpMeasReqInfo));
329    return (ret);
330 }  /* RgUiRguL2MUlThrpMeasReq */
331 #endif
332
333 /**
334  * @brief Handler for sending staInd to dedicated logical channels of a UE 
335  *
336  * @details
337  *
338  *     Function : rgUIMSndDedStaInd
339  *     
340  *     This function fills SAP and Pst information to send the staInd to
341  *     a UE.
342  *     
343  *           
344  *  @param[in] Inst        inst
345  *  @param[in] RgUpSapCb  *rguSap 
346  *  @param[in]  RgRguDedStaInd  *staInd
347  *  @return  S16
348  *      -# ROK 
349  *      -# RFAILED 
350  **/
351 S16 rgUIMSndDedStaInd
352 (
353 Inst         inst,
354 RgUpSapCb    *rguSap,
355 RgRguDedStaInd  *staInd
356 )
357 {
358    S16  ret = ROK;
359    
360    DU_LOG("\nINFO  -->  MAC : rgUIMSndDedStaInd(): staInd = %p;\n", (void *)staInd);
361    
362    ret = RgUiRguDStaInd(&(rguSap->sapCfg.sapPst), rguSap->sapCfg.suId, 
363          staInd);
364    if (ret != ROK)
365    {
366       DU_LOG("\nERROR  -->  MAC : RgUiRguDStaInd Failed");
367       return (ret);
368    }
369    return (ret);
370 }  /* rgUIMSndDedStaInd */
371
372
373 /**
374  * @brief Handler for sending staInd to a common logical channel.
375  *
376  * @details
377  *
378  *     Function : rgUIMSndCmnStaInd
379  *     
380  *     This function fills SAP and Pst information to send the staInd to
381  *     a common logical channel.
382  *     
383  *           
384  *  @param[in] Inst        inst
385  *  @param[in] RgUpSapCb  *rguSap 
386  *  @param[in]  RgRguCmnStaInd  *staInd
387  *  @return  S16
388  *      -# ROK 
389  *      -# RFAILED 
390  **/
391 S16 rgUIMSndCmnStaInd
392 (
393 Inst            inst,
394 RgUpSapCb    *rguDlSap,
395 RgRguCmnStaInd  *staInd
396 )
397 {
398    S16  ret = ROK;
399
400    ret = RgUiRguCStaInd(&(rguDlSap->sapCfg.sapPst), rguDlSap->sapCfg.suId, 
401          staInd);
402    if (ret != ROK)
403    {
404       DU_LOG("\nERROR  -->  MAC : RgUiRguCStaInd Failed");
405       return (ret);
406    }
407    return (ret);
408 }  /* rgUIMSndCmnStaInd */
409
410
411 /**
412  * @brief Handler for sending datInd to dedicated logical channels of a UE 
413  *
414  * @details
415  *
416  *     Function : rgUIMSndDedDatInd
417  *     
418  *     This function fills SAP and Pst information to send the datInd to
419  *     a UE.
420  *     
421  *           
422  *  @param[in] Inst        inst
423  *  @param[in] RgUpSapCb  *rguUlSap 
424  *  @param[in]  RgRguDedDatInd  *datInd
425  *  @return  S16
426  *      -# ROK 
427  *      -# RFAILED 
428  **/
429 S16 rgUIMSndDedDatInd
430 (
431 Inst         inst,
432 RgUpSapCb    *rguUlSap,
433 RgRguDedDatInd  *datInd
434 )
435 {
436    S16  ret = ROK;
437
438    rguUlSap->sapSts.numPduTxmit += datInd->numLch;
439 #ifndef SS_RBUF
440    ret = RgUiRguDDatInd(&(rguUlSap->sapCfg.sapPst), rguUlSap->sapCfg.suId, 
441          datInd);
442    if (ret != ROK)
443    {
444       DU_LOG("\nERROR  -->  MAC : RgUiRguDdatInd Failed");
445       return (ret);
446    }
447 #else
448    SRngIncrWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC);
449    SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].pktRate++;
450 #endif
451    return (ret);
452 }  /* rgUIMSndDedDatInd */
453
454
455 /**
456  * @brief Handler for sending datInd to a common logical channel.
457  *
458  * @details
459  *
460  *     Function : rgUIMSndCmnDatInd
461  *     
462  *     This function fills SAP and Pst information to send the datInd to
463  *     a common logical channel.
464  *     
465  *           
466  *  @param[in] Inst        inst
467  *  @param[in] RgUpSapCb  *rguSap 
468  *  @param[in]  RgRguCmnDatInd  *datInd
469  *  @return  S16
470  *      -# ROK 
471  *      -# RFAILED 
472  **/
473 S16 rgUIMSndCmnDatInd(Inst inst,RgUpSapCb *rguUlSap,RgRguCmnDatInd  *datInd)
474 {
475    S16  ret = ROK;
476
477    DU_LOG("\nDEBUG  -->  MAC : rgUIMSndCmnDatInd(): staInd = %p;\n", (void *)datInd);
478
479    rguUlSap->sapSts.numPduTxmit++;
480
481    DU_LOG("\nDEBUG  -->  MAC : rgUIMSndCmnDatInd suId = %d\n", rguUlSap->sapCfg.suId);   
482    ret = RgUiRguCDatInd(&(rguUlSap->sapCfg.sapPst), rguUlSap->sapCfg.suId, 
483          datInd);
484    if (ret != ROK)
485    {
486       DU_LOG("\nERROR  -->  MAC : RgUiRguCDatInd Failed");
487       return (ret);
488    }
489    return (ret);
490 }  /* rgUIMSndCmnDatInd */
491
492 /**
493
494  * @brief API for bind request from RRC towards MAC. 
495  *
496  * @details
497  *
498  *     Function: RgUiCrgBndReq
499  *     
500  *     This API is invoked by RRC towards MAC to bind CRG SAP. 
501  *     These API validates the Pst, spId, suId and sends the bind confirm to RRC.
502  *
503  *           
504  *  @param[in]  Pst   *pst
505  *  @param[in]  SuId  suId
506  *  @param[in]  SpId  spId
507  *  @return  S16
508  *      -# ROK 
509  *      -# RFAILED 
510  **/
511 S16 RgUiCrgBndReq(Pst   *pst, SuId  suId,SpId  spId)
512 {
513    S16       ret = ROK;
514    Pst       tmpPst;   /* Temporary Post Structure */
515    RgUstaDgn dgn;      /* Alarm diagnostics structure */
516    Inst      inst;
517
518    RG_IS_INST_VALID(pst->dstInst);
519    inst = pst->dstInst - RG_INST_START;
520
521    tmpPst.prior       = pst->prior;
522    tmpPst.route       = pst->route;
523    tmpPst.selector    = pst->selector;
524    tmpPst.region      = rgCb[inst].rgInit.region;
525    tmpPst.pool        = rgCb[inst].rgInit.pool;
526    tmpPst.srcProcId   = rgCb[inst].rgInit.procId;
527    tmpPst.srcEnt      = rgCb[inst].rgInit.ent;
528    tmpPst.srcInst     = rgCb[inst].rgInit.inst;
529    tmpPst.event       = EVTNONE;
530    tmpPst.dstProcId   = pst->srcProcId;
531    tmpPst.dstEnt      = pst->srcEnt;
532    tmpPst.dstInst     = pst->srcInst;
533
534
535    if(spId == rgCb[inst].crgSap.sapCfg.spId)
536    {
537       /* Check the state of the SAP */
538       switch (rgCb[inst].crgSap.sapSta.sapState)
539       {
540          case LRG_NOT_CFG: /* SAP Not configured */
541             
542             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
543             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_NOT_CFG,
544                   LCM_CAUSE_INV_SAP, &dgn);
545             DU_LOG("\nDEBUG  -->  MAC : SAP Not Configured");
546             ret = RgUiCrgBndCfm(&tmpPst, suId, CM_BND_NOK);
547             break;
548          case LRG_UNBND: /* SAP is not bound */
549             DU_LOG("\nERROR  -->  MAC : SAP Not yet bound");
550             
551             rgCb[inst].crgSap.sapSta.sapState = LRG_BND;
552             rgCb[inst].crgSap.sapCfg.suId = suId;
553             /* Send Bind Confirm with status as SUCCESS */
554             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_OK);
555             /* Indicate to Layer manager */
556             rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); 
557             ret = rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE,LRG_EVENT_CRGSAP_ENB,
558                   LCM_CAUSE_UNKNOWN, &dgn);
559             break;
560          case LRG_BND: /* SAP is already bound*/
561             DU_LOG("\nDEBUG  -->  MAC : SAP is already bound");
562             
563             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_OK);
564             break;
565          default: /* Should Never Enter here */
566 #if (ERRCLASS & ERRCLS_ADD_RES)      
567             DU_LOG("\nERROR  -->  MAC : Invalid SAP State:%d RgUiCrgBndReq failed",
568                   rgCb[inst].crgSap.sapSta.sapState);
569 #endif
570             ret = rgUIMCrgBndCfm(inst,suId, CM_BND_NOK);
571             break;
572       }
573    }
574    else
575    {
576 #if (ERRCLASS & ERRCLS_ADD_RES)      
577       DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:%d RgUiCrgBndReq failed",
578            rgCb[inst].crgSap.sapCfg.spId);
579 #endif
580       ret = rgUIMCrgBndCfm(inst,suId, CM_BND_NOK);
581    }
582    return (ret);
583 }  /* RgUiCrgBndReq */
584
585
586 /**
587  * @brief API for unbind request from RRC towards MAC. 
588  *
589  * @details
590  *
591  *     Function: RgUiCrgUbndReq
592  *     
593  *     This API is invoked by RRC towards MAC to unbind CRG SAP. 
594  *     These API validates the Pst, spId, suId and sends the bind confirm to RRC.
595  *
596  *           
597  *  @param[in]  Pst    *pst
598  *  @param[in]  SuId   suId
599  *  @param[in]  Reason reason
600  *  @return  S16
601  *      -# ROK 
602  *      -# RFAILED 
603  **/
604 S16 RgUiCrgUbndReq(Pst *pst,SpId spId,Reason reason)
605 {
606    Inst      inst;
607
608    RG_IS_INST_VALID(pst->dstInst);
609    inst = pst->dstInst - RG_INST_START;
610    /* SAP Id validation */
611    if (spId == rgCb[inst].crgSap.sapCfg.spId)
612    {
613       switch(rgCb[inst].crgSap.sapSta.sapState)
614       {
615          case LRG_BND: /* SAP is already bound*/
616             /* setting SAP state to UN BOUND */
617             DU_LOG("\nDEBUG  -->  MAC : SAP is already bound");
618             
619             rgCb[inst].crgSap.sapSta.sapState = LRG_UNBND;
620             break;
621          default:
622 #if (ERRCLASS & ERRCLS_ADD_RES)
623             DU_LOG("\nERROR  -->  MAC : Invalid SAP State:%d RgUiCrgUbndReq failed",
624                   rgCb[inst].crgSap.sapSta.sapState);
625 #endif
626             return RFAILED;
627       }
628    }
629    else
630    {
631 #if (ERRCLASS & ERRCLS_ADD_RES)      
632       DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:%d RgUiCrgUbndReq failed",
633             rgCb[inst].crgSap.sapCfg.spId);
634 #endif
635       return RFAILED;
636    }
637    return ROK;
638 }  /* RgUiCrgUbndReq */
639
640 /**
641  * @brief API for sending bind confirm from MAC to RRC
642  *
643  * @details
644  *
645  *     Function: rgUIMRgrBndCfm
646  *     
647  *     This API is invoked to send bind confirm from MAC to RRC.
648  *     This API fills in Pst structure and SAP Ids and invokes 
649  *     bind confirm API towards RRC.
650  *           
651  *  @param[in] Inst        inst
652  *  @param[in]  SuId          suId
653  *  @param[in]  uint8_t            status
654  *  @return  S16
655  *      -# ROK 
656  *      -# RFAILED 
657  **/
658 S16 rgUIMCrgBndCfm(Inst  inst,SuId suId,uint8_t status)
659 {
660
661    if(RgUiCrgBndCfm(&(rgCb[inst].crgSap.sapCfg.sapPst), rgCb[inst].crgSap.sapCfg.suId, status) != ROK)
662    {
663       DU_LOG("\nERROR  -->  MAC : RgUiCrgBndCfm Failed ");
664       return RFAILED;
665    }
666
667    return ROK;
668 }  /* rgUIMCrgBndCfm*/
669
670 /**
671  * @brief API for sending configuration confirm from MAC to RRC
672  *
673  * @details
674  *
675  *     Function: rgUIMCrgCfgCfm
676  *     
677  *     This API is invoked to send configuration confirm from MAC to RRC.
678  *     This API fills in Pst structure and SAP Ids and invokes 
679  *     config confirm API towards RRC.
680  *           
681  *  @param[in] Inst        inst
682  *  @param[in]  CrgCfgTransId transId
683  *  @param[in]  uint8_t            status
684  *  @return  S16
685  *      -# ROK 
686  *      -# RFAILED 
687  **/
688 S16 rgUIMCrgCfgCfm
689 (
690 Inst      inst,
691 CrgCfgTransId transId,
692 uint8_t       status
693 )
694 {
695    S16  ret = ROK;
696    uint8_t   prntTrans[CRG_CFG_TRANSID_SIZE+1];
697
698    memcpy(prntTrans, transId.trans, CRG_CFG_TRANSID_SIZE);
699    prntTrans[CRG_CFG_TRANSID_SIZE] = '\0';
700
701
702    ret = RgUiCrgCfgCfm(&(rgCb[inst].crgSap.sapCfg.sapPst), rgCb[inst].crgSap.sapCfg.suId, transId, status);
703    if (ret != ROK)
704    {
705       DU_LOG("\nERROR  -->  MAC : RgUiCrgCfgCfm Failed ");
706       return (ret);
707    }
708
709    return (ret);
710 }  /* rgUIMCrgCfgCfm */
711
712 /**********************************************************************
713  
714          End of file
715 **********************************************************************/