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