77f652d333b8ab69e529f80c0b86ff887fae0b09
[o-du/l2.git] / src / 5gnrrlc / rlc_dl_ul_inf_dl.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:   NR RLC layer
22  
23     Type:   C include file
24  
25     Desc:   Defines required by LTE MAC
26  
27     File:   rlc_dl_ul_inf_dl.c
28
29 **********************************************************************/
30
31 /* header include files (.h) */
32 #include "common_def.h"
33 #include "lkw.h"           /* LKW defines */
34 #include "ckw.h"           /* CKW defines */
35 #include "kwu.h"           /* KWU defines */
36 #include "rgu.h"           /* RGU defines */
37 #include "rlc_err.h"        /* Err defines */
38 #include "rlc_env.h"        /* RLC environment options */
39
40
41 /* extern (.x) include files */
42 #include "lkw.x"           /* LKW */
43 #include "ckw.x"           /* CKW */
44 #include "kwu.x"           /* KWU */
45 #include "rgu.x"           /* RGU */
46
47 #include "rlc_utils.h"            /* RLC defines */
48 #include "rlc_dl_ul_inf.h"
49 #include "rlc_dl.h"
50
51 #define RLC_MODULE RLC_DBGMASK_UDX
52 /* local defines */
53
54 S16 rlcDlmHndlStaRsp ARGS (( RlcCb  *gCb,RlcDlRbCb  *rbCb,
55                 RlcUdxStaPdu *pStaPdu, RlcUdxBufLst  *rlsPduLst));
56
57
58
59
60 /**
61   * @brief
62   * UDX APIs
63   */
64
65 /**
66  *
67  * @brief 
68  *    Handler to bind the DL with UL. 
69  *
70  * @param[in] pst   Post structure  
71  * @param[in] suId  Service user SAP ID 
72  * @param[in] spId  Service provider ID
73  *
74  * @return  S16
75  *    -# ROK 
76  *    -# RFAILED
77  */
78 S16 rlcDlUdxBndReq 
79 (
80 Pst    *pst,  
81 SuId   suId, 
82 SpId   spId 
83 )
84 {
85    RlcUdxDlSapCb   *udxSap;            /* pointer to session SAP */
86    RlcCb           *tRlcCb;
87
88 #if (ERRCLASS & ERRCLS_INT_PAR)
89    if (pst->dstInst >= MAX_RLC_INSTANCES)
90    {
91       return RFAILED;
92    }
93 #endif
94    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
95
96    RLCDBGP_BRIEF(tRlcCb, "rlcDlUdxBndReq(spId(%d), suId(%d))\n", 
97                 spId, suId);
98
99    udxSap = (tRlcCb->u.dlCb->udxDlSap + spId);
100
101    /* Verify CKW SAP State */
102    switch(udxSap->state)
103    {
104       /* SAP is configured but not bound */
105       case RLC_SAP_CFG:
106       case RLC_SAP_UBND:
107       {
108          /* copy bind configuration parameters in SSAP sap */
109          udxSap->suId = suId;
110          udxSap->pst.dstProcId = pst->srcProcId;
111          udxSap->pst.dstEnt = pst->srcEnt;
112          udxSap->pst.dstInst = pst->srcInst;
113
114          /* Update the State */
115          udxSap->state = RLC_SAP_BND;
116
117          DU_LOG("\nINFO   --> RLC_DL : UDX SAP state [%d]", udxSap->state);
118          break;
119       }
120       /* SAP is already bound */
121       case RLC_SAP_BND:
122       {
123          /* 
124           * Sap is already bound check source, destination Entity and 
125           * Proc Id
126           */
127          if (udxSap->pst.dstProcId != pst->srcProcId 
128                || udxSap->pst.dstEnt != pst->srcEnt
129                || udxSap->pst.dstInst != pst->srcInst
130                || udxSap->suId != suId)
131          {
132             RLC_SEND_SAPID_ALARM(tRlcCb, spId, 
133                                 LKW_EVENT_UDX_BND_REQ, LCM_CAUSE_INV_PAR_VAL);
134
135             DU_LOG("\nERROR  --> RLC_DL : UDX SAP already Bound");
136             rlcDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_NOK);
137          }
138          break;
139       }
140
141      default:
142       {
143 #if (ERRCLASS & ERRCLS_INT_PAR)
144          RLC_SEND_SAPID_ALARM(tRlcCb,spId, 
145                              LKW_EVENT_CKW_BND_REQ, LCM_CAUSE_INV_STATE);
146 #endif /* ERRCLASS & ERRCLS_INT_PAR */
147          DU_LOG("\nERROR  --> RLC_DL : Invalid UDX SAP State in Bind Req");
148          rlcDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_NOK);
149          break;
150       }
151    }
152    rlcDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_OK);
153    return ROK;
154
155
156 \f
157 /**
158  * @brief 
159  *    Handler for unbinding the DL from UL. 
160  *
161  *  @param[in] pst     Post structure  
162  *  @param[in] spId    Service provider SAP ID 
163  *  @param[in] reason  Reason for Unbinding 
164  *
165  *  @return  S16
166  *      -# ROK 
167  */
168 S16 rlcDlUdxUbndReq
169 (
170 Pst      *pst,    
171 SpId     spId,   
172 Reason   reason 
173 )
174 {
175    RlcUdxDlSapCb   *udxSap; 
176    RlcCb           *tRlcCb;
177
178 #if (ERRCLASS & ERRCLS_INT_PAR)
179    if (pst->dstInst >= MAX_RLC_INSTANCES)
180    {
181       return RFAILED;
182    }
183 #endif
184
185    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
186
187    DU_LOG("\nDEBUG  --> RLC_DL : Unbind Req for spId[%d], reason[%d]", 
188                 spId, reason);
189    UNUSED(reason);
190    /* disable upper sap (CKW) */
191    udxSap = (tRlcCb->u.dlCb->udxDlSap + spId);
192
193 #if (ERRCLASS & ERRCLS_INT_PAR)
194    RLC_GET_AND_VALIDATE_UDXSAP(tRlcCb,udxSap, EKW208, "KwUiDlUdxndReq");
195 #endif /* ERRCLASS & ERRCLS_INT_PAR */
196    udxSap->state = RLC_SAP_CFG;
197    return ROK;
198 }
199
200 \f
201 /**
202  * @brief 
203  *    Handler for configuring RLC entities.
204  *
205  * @details
206  *    This function is used by RRC to configure(add/delete/modify)
207  *    one or more RLC entities. 
208  *        - CKW_CFG_ADD          => rlcCfgAddRb
209  *        - CKW_CFG_MODIFY       => rlcCfgReCfgRb
210  *        - CKW_CFG_DELETE       => rlcCfgDelRb
211  *        - CKW_CFG_REESTABLISH  => rlcCfgReEstRb
212  *        - CKW_CFG_DELETE_UE    => rlcCfgDelUe
213  *
214  * @param[in] pst   -  Post structure  
215  * @param[in] spId  -  Serive Provider ID 
216  * @param[in] cfg   -  Configuration information for one or more RLC entities. 
217  *
218  * @return  S16
219  *    -# ROK 
220  *    -# RFAILED
221  */
222 S16 rlcDlUdxCfgReq
223 (
224 Pst          *pst,
225 SpId         spId,
226 RlcCfgInfo   *cfg
227 )
228 {
229    RlcCfgCfmInfo   *cfgCfm; 
230    uint8_t         idx;    
231    RlcCb           *tRlcCb;
232    Pst             *pstUdxCfm;
233
234 #if (ERRCLASS & ERRCLS_INT_PAR)
235    if (pst->dstInst >= MAX_RLC_INSTANCES)
236    {
237       return RFAILED;
238    }
239 #endif
240
241    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
242
243    pstUdxCfm = &(tRlcCb->u.dlCb->udxDlSap[spId].pst);
244    RLCDBGP_BRIEF(tRlcCb,"spId(%d)\n", spId);
245    /* Allocate memory and memset to 0 for cfmInfo */
246    RLC_ALLOC_SHRABL_BUF_WC(pstUdxCfm->region,
247                           pstUdxCfm->pool,
248                           cfgCfm,
249                           sizeof(RlcCfgCfmInfo));
250
251 #if (ERRCLASS & ERRCLS_ADD_RES)
252    if (cfgCfm == NULLP)
253    {
254       DU_LOG("\nERROR  --> RLC_DL : Memory Allocation Failed.");
255       /* kw002.201 Freeing from proper region */
256       /* RLC_PST_FREE(pst->region, pst->pool, cfg, sizeof(RlcCfgInfo)); */
257       return RFAILED;
258    }
259 #endif /* ERRCLASS & ERRCLS_ADD_RES */
260
261    /* For every entity configuration process by cfgType */
262    for (idx = 0; idx < cfg->numEnt; idx++)
263    {
264       RlcEntCfgCfmInfo   *entCfgCfm;
265       RlcEntCfgInfo      *entCfg;
266
267       entCfg  = (RlcEntCfgInfo *)&(cfg->entCfg[idx]);
268       entCfgCfm   = (RlcEntCfgCfmInfo *)&(cfgCfm->entCfgCfm[idx]);
269
270       switch (entCfg->cfgType)
271       {
272          case CKW_CFG_ADD:
273             {
274                if (entCfg->dir & RLC_DIR_DL)
275                { 
276                   /* Add a new RB entity configuration */
277                   if (rlcCfgAddDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
278                               entCfg, entCfgCfm) != ROK)
279                   {
280                      DU_LOG("\nERROR  --> RLC_DL : Addition Failed due to[%d]",
281                            entCfgCfm->status.reason);
282                   }
283                }
284                break;
285             }
286          case CKW_CFG_MODIFY:
287             {
288                if (entCfg->dir & RLC_DIR_DL)
289                {
290                   /* Re-configure the existing RB entity configuration */
291                   if (rlcCfgReCfgDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
292                            entCfg, entCfgCfm) != ROK)
293                   {
294                      DU_LOG("\nERROR  --> RLC_DL : ReCfg Failed due to[%d]",
295                            entCfgCfm->status.reason);
296                   }
297                }
298                break;
299             }
300
301          case CKW_CFG_DELETE:
302             {
303                if (entCfg->dir & RLC_DIR_DL)
304                {
305                   /* Delete the existing RB entity configuration */
306                   if (rlcCfgDelDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
307                         entCfg, entCfgCfm) != ROK)
308                   {
309                      DU_LOG("\nERROR  --> RLC_DL : Deletion Failed due to[%d]",
310                            entCfgCfm->status.reason);
311                   } 
312                }
313                break;
314             }
315
316          case CKW_CFG_REESTABLISH:
317             {
318                if (entCfg->dir & RLC_DIR_DL)
319                {
320                   /*if direction is both then, re-establishment end indication
321                    * should be sent only from the UL instance, only if DIR is
322                    * DL only then DL instance will send indication.*/
323                   Bool sndReEst = TRUE;
324                   if (entCfg->dir & RLC_DIR_UL)
325                   {
326                      sndReEst = FALSE;
327                   }
328                   /* Re-establish the existing RB entity configuration */
329                   if (rlcCfgReEstDlRb(tRlcCb,cfg->ueId, cfg->cellId,
330                                      sndReEst,entCfg, entCfgCfm) != ROK)
331                   {
332                      DU_LOG("\nERROR  --> RLC_DL : Reest Failed due to[%d]",
333                            entCfgCfm->status.reason);
334                   }
335                }
336                break;
337             }
338
339          case CKW_CFG_DELETE_UE:
340             {
341                /* Delete all RB entity configuration under UE */
342                if (rlcCfgDelDlUe(tRlcCb,cfg->ueId, cfg->cellId,
343                                 entCfg, entCfgCfm) != ROK)
344                {
345                   DU_LOG("\nERROR  --> RLC_DL : deletion Failed due to[%d]",
346                            entCfgCfm->status.reason);
347                }
348                else
349                {
350                   DU_LOG("\nDEBUG  -->  RLC_DL: UE information is deleted for UEIdx[%d] and CellId[%d]",\
351                   cfg->ueId, cfg->cellId);
352                }
353                break;
354             }
355          case CKW_CFG_DELETE_CELL:
356             {
357                if (rlcCfgDelDlCell(tRlcCb,cfg->cellId,entCfg,entCfgCfm) 
358                                                                 != ROK )
359                {
360                   DU_LOG("\nERROR  --> RLC_DL : deletion Failed due to[%d]",
361                            entCfgCfm->status.reason);
362                } 
363                break;
364             }
365
366          default:
367             {
368                RLC_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType,\
369                                    CKW_CFG_CFM_NOK, CKW_CFG_REAS_INVALID_CFG);
370                DU_LOG("\nERROR  --> RLC_DL : Invalid CfgType");
371             }
372       }
373    }
374
375    /* Assign number of entity configuraitons and suId */
376    cfgCfm->transId = cfg->transId;
377    cfgCfm->ueId = cfg->ueId;
378    cfgCfm->cellId = cfg->cellId;
379    cfgCfm->numEnt = cfg->numEnt;
380
381    /* kw002.201 Freeing from proper region */
382    /* RLC_PST_FREE(pst->region, pst->pool, cfg, sizeof(RlcCfgInfo)); */
383    /* Send Configuration confirm primitive */
384    rlcDlUdxCfgCfm(&(tRlcCb->u.dlCb->udxDlSap[spId].pst),
385                  tRlcCb->u.dlCb->udxDlSap[spId].suId, 
386                  cfgCfm);
387
388    return ROK;
389
390
391 /**
392  *@brief 
393  *   This primitive is used by RRC to change the UeId for the existing UE
394  *   context.
395  *
396  * @param pst     -  Pointer to the pst structure
397  * @param spId    -  The ID of the service provider SAP in the RLC layer 
398  * @param transId -  Transaction ID. This field uniquily identifies
399  *                   transaction between RRC and RLC
400  * @param ueInfo    -  Old UE Id Info for which the change request has come 
401  * @param newUeInfo -  New UE Id Info for existing UE context 
402  * 
403  * @return 
404  *    -# ROK
405  *    -# RFAILED
406  */
407 S16 rlcDlUdxUeIdChgReq
408 (
409 Pst         *pst, 
410 SpId        spId, 
411 uint32_t    transId, 
412 CkwUeInfo   *ueInfo,
413 CkwUeInfo   *newUeInfo
414 )
415 {
416    CmStatus       status;
417    RlcCb           *tRlcCb;
418
419 #if (ERRCLASS & ERRCLS_INT_PAR)
420    if (pst->dstInst >= MAX_RLC_INSTANCES)
421    {
422       return RFAILED;
423    }
424 #endif
425
426    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
427 #ifndef ALIGN_64BIT
428    RLCDBGP_BRIEF(tRlcCb, "(spId(%d), transId(%ld))\n", 
429                 spId, transId);
430 #else
431    RLCDBGP_BRIEF(tRlcCb, "(spId(%d), transId(%d))\n", 
432                 spId, transId);
433 #endif
434
435    status.reason = CKW_CFG_REAS_NONE;
436    status.status = CKW_CFG_CFM_OK;
437    
438    if (rlcCfgDlUeIdChng(tRlcCb, ueInfo, newUeInfo, &status) != ROK)
439    {
440       DU_LOG("\nERROR  --> RLC_DL : Failure due to[%d]",
441              status.reason);
442    }
443    rlcDlUdxUeIdChgCfm(&(tRlcCb->u.dlCb->udxDlSap[spId].pst),
444                      tRlcCb->u.dlCb->udxDlSap[spId].suId, 
445                      transId, 
446                      status);
447
448    return ROK;
449
450
451 /**
452 * @brief 
453 *    Request for status PDU from  ULM to DLM.
454 *
455 * @param[in]   pst   -  Post Structure
456 * @param[in]   spId  -  Service Provider Id
457 * @param[in]   rlcId -  Rlc Information Id
458 * @param[in]   pStaPdu - Status PDU 
459 *  
460 * @return   S16
461 *    -# ROK
462 *    -# RFAILED
463 **/
464 S16  rlcDlUdxStaPduReq
465 (
466 Pst             *pst,
467 SpId            spId,
468 CmLteRlcId      *rlcId,
469 RlcUdxDlStaPdu   *pStaPdu
470 )
471 {
472    RlcDlRbCb   *rbCb;
473    RlcCb       *tRlcCb;
474
475    tRlcCb =  RLC_GET_RLCCB (pst->dstInst);
476
477    rlcDbmFetchDlRbCbByRbId(tRlcCb, rlcId, &rbCb); /* Fetch DBM RbCb */
478    if (!rbCb)
479    {
480       DU_LOG("\nERROR  --> RLC_DL : CellId [%u]:RbId[%d] not found",
481             rlcId->cellId,rlcId->rbId);
482       RLC_FREE_SHRABL_BUF(pst->region, 
483                          pst->pool, 
484                          pStaPdu, 
485                          sizeof(RlcUdxDlStaPdu));
486       return RFAILED;
487    }
488
489    RLC_AMDL.cntrlBo = pStaPdu->controlBo;
490    /* If there already exists a STAUS PDU, free it and take the new one
491       into account */
492    if(RLC_AMDL.pStaPdu)
493    {
494       RLC_FREE_SHRABL_BUF(pst->region, 
495                          pst->pool, 
496                          RLC_AMDL.pStaPdu, 
497                          sizeof(RlcUdxDlStaPdu));
498    }
499    
500    RLC_AMDL.pStaPdu = pStaPdu;
501    rlcAmmSendDedLcBoStatus(tRlcCb, rbCb, &RLC_AMDL);             
502
503    return  (ROK);
504 }
505
506 /**
507 * @brief 
508 *    It handles the status update recieved from ULM.
509 *
510 * @param[in]   pst   -  Post Structure
511 * @param[in]   spId  -  Service Provider Id
512 * @param[in]   rlcId -  Rlc Information Id
513 * @param[in]   pStaPdu - Status PDU 
514 *  
515 * @return   S16
516 *    -# ROK
517 *    -# RFAILED
518 **/
519 S16  rlcDlUdxStaUpdReq
520 (
521 Pst*          pst,
522 SpId          spId,
523 CmLteRlcId    *rlcId,
524 RlcUdxStaPdu   *pStaPdu
525 )
526 {
527    RlcCb          *tRlcCb;
528    RlcDlRbCb      *rbCb;
529
530    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
531
532    rlcDbmFetchDlRbCbByRbId(tRlcCb, rlcId, &rbCb);
533    if (!rbCb)
534    {
535       DU_LOG("\nERROR  --> RLC_DL : CellId [%u]:RbId[%d] not found",
536             rlcId->cellId,rlcId->rbId);
537       return RFAILED;
538    }
539
540    rlcAmmDlHndlStatusPdu(tRlcCb, rbCb, pStaPdu);
541
542    RLC_FREE_SHRABL_BUF(pst->region,
543                       pst->pool, 
544                       pStaPdu, 
545                       sizeof(RlcUdxStaPdu));
546
547    return ROK;
548 }
549
550 #ifdef LTE_L2_MEAS
551 /**
552 */
553 S16 rlcDlUdxL2MeasReq 
554 (
555 Pst            *pst, 
556 RlcL2MeasReqEvt *measReqEvt 
557 )
558 {
559    uint32_t  cntr;
560    uint8_t   measType;
561    volatile uint32_t     startTime = 0;
562    RlcCb     *tRlcCb;
563
564    /*starting Task*/
565    SStartTask(&startTime, PID_RLC_MEAS_START);
566
567    tRlcCb =  RLC_GET_RLCCB(pst->dstInst);
568
569    /* Initialize measCfmEvt */
570
571   /* validate the received measReqEvt */
572  /*LTE_L2_MEAS_PHASE2*/
573
574    measType = measReqEvt->measReq.measType;
575
576    if(measType & LKW_L2MEAS_DL_IP) 
577    {
578       /* if measurement is for DL IP enable for all QCI */
579       for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
580       {
581          tRlcCb->u.dlCb->rlcL2Cb.measOn[cntr] |= LKW_L2MEAS_DL_IP;
582       }
583    }
584    else
585    {
586       /* for nonIpThroughput meas, enable only for the sent QCIs */
587       uint32_t i;
588       for(i = 0; i < LKW_MAX_QCI; i++)
589       {
590          tRlcCb->u.dlCb->rlcL2Cb.measOn[i] |= measType;
591       }
592    }
593
594    /* We need to copy the transId for sending back confirms later */
595    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
596    {
597       RlcL2MeasEvtCb* measEvtCb = &(tRlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[cntr]);
598       if(measEvtCb->measCb.measType & measType)
599       {
600          measEvtCb->transId= measReqEvt->transId;
601       }
602    }
603
604    /*stopping Task*/
605    SStopTask(startTime, PID_RLC_MEAS_START);
606    return ROK;
607 } /* rlcDlUdxMeasReq */
608
609 /**
610 @brief 
611 This function processes L2 Measurement stop request received from the layer manager.
612 After receving this request, RLC stops L2 Measurement
613  *  @param[in] pst      post structure
614  *  @param[in] measType meas Type 
615  *  @return S16
616  *      -# Success : ROK
617  *      -# Failure : RFAILED
618 */
619
620 S16 rlcDlUdxL2MeasStopReq
621 (
622 Pst            *pst,
623 uint8_t         measType
624 )
625 {
626   /* S16 ret = ROK;*/
627    RlcL2MeasEvtCb *measEvtCb = NULLP;
628    uint16_t        cntr;
629    uint8_t         status = ROK;
630 /*   RlcL2MeasCfmEvt          measCfmEvt;  */
631    volatile uint32_t     startTime = 0;
632    RlcCb     *tRlcCb=NULLP;
633    
634    /*starting Task*/
635    SStartTask(&startTime, PID_RLC_MEAS_STOP);
636
637    tRlcCb =  RLC_GET_RLCCB(pst->dstInst);
638 /*   memset(&measCfmEvt, 0, sizeof(RlcL2MeasCfmEvt)); */
639    /* reset the counters for the measurement type passed */
640    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
641    {
642       measEvtCb = &(tRlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[cntr]);
643       if(measEvtCb->measCb.measType & measType)
644       {
645          rlcUtlResetDlL2MeasInRlcRb(tRlcCb, &measEvtCb->measCb, measType);
646
647       }
648    }
649
650    /* switch off the measurements for the type passed */
651    for(cntr = 0; cntr < LKW_MAX_QCI; cntr++)
652    {
653       tRlcCb->u.dlCb->rlcL2Cb.measOn[cntr] &= ~measType;
654    }
655    
656    status = LCM_PRIM_OK;
657    /* Stop confirm is removed as UL thread is already sending it */
658    
659    /*stopping Task*/
660    SStopTask(startTime, PID_RLC_MEAS_STOP);
661
662    return ROK;
663 }
664 /**
665 @brief 
666 This function processes L2 Measurement Send request received from the layer manager.
667 After receving this request, RLC sends L2 Measurement
668  *  @param[in] pst      post structure
669  *  @param[in] measType meas Type 
670  *  @return S16
671  *      -# Success : ROK
672  *      -# Failure : RFAILED
673 */
674
675 S16 rlcDlUdxL2MeasSendReq
676 (
677 Pst            *pst,
678 uint8_t         measType
679 )
680 {
681    RlcL2MeasEvtCb *measEvtCb;
682    uint16_t            cntr;
683    volatile uint32_t     startTime = 0;
684    RlcCb     *tRlcCb;
685
686    tRlcCb =  RLC_GET_RLCCB(pst->dstInst);
687    for(cntr = 0; cntr < LKW_MAX_L2MEAS; cntr++)
688    {
689       measEvtCb = &(tRlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[cntr]);
690       if(measEvtCb->measCb.measType & measType)
691       {
692          /*starting Task*/
693          SStartTask(&startTime, PID_RLC_MEAS_REPORT);
694
695          rlcUtlSndDlL2MeasCfm(tRlcCb, measEvtCb);
696
697          /*stopping Task*/
698          SStopTask(startTime, PID_RLC_MEAS_REPORT);
699       }
700    }
701
702    return ROK;
703 }
704 #endif /* LTE_L2_MEAS */
705
706 #ifdef __cplusplus
707 }
708 #endif /* __cplusplus */
709
710 \f
711 /**********************************************************************
712          End of file
713 **********************************************************************/