RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181]
[o-du/l2.git] / src / 5gnrrlc / kw_ptui.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**
20   
21         Name:    LTE-RLC Layer - Upper Interface
22     
23         Type:    C file
24   
25         Desc:    C source code for the upper interface of LTE-RLC
26  
27         File:    kw_ptui.c
28   
29 *********************************************************************21*/
30 static const char* RLOG_MODULE_NAME="UIM";
31 static int RLOG_MODULE_ID=2048;
32 static int RLOG_FILE_ID=199;
33
34 /** @file kw_ptui.c
35 @brief RLC Upper Interface
36 */
37
38 \f
39 /* header (.h) include files */
40 #include "common_def.h"
41 #include "lkw.h"           /* LKW defines */
42 #include "ckw.h"           /* CKW defines */
43 #include "kwu.h"           /* KWU defines */
44 #include "rgu.h"           /* RGU defines */
45
46 #include "kw_err.h"
47 #include "kw_env.h"        /* RLC environment options */
48 #include "kw.h"            /* RLC defines */
49
50 /* extern (.x) include files */
51 #include "lkw.x"           /* LKW */
52 #include "ckw.x"           /* CKW */
53 #include "kwu.x"           /* KWU */
54 #include "rgu.x"           /* RGU */
55 #if defined(MAC_RLC_UL_RBUF) || (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)) || defined(SS_RBUF)
56 #include "ss_rbuf.h"
57 #include "ss_rbuf.x"
58 #endif
59 #include "kw.x"
60 #if defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)
61 #include "mt_plat_t33.h"
62 #include "mt_plat_t33.x"
63 #endif
64
65 #ifdef __cplusplus
66 EXTERN "C" {
67 #endif /* __cplusplus */
68
69 \f  
70 /*********************************************************************
71  *             Forward Declartion for KWU Porting Functions
72  ********************************************************************/
73 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
74 S16 rlcDlBatchProc ARGS ((Void));
75 S16 rlcUtlDlFreeRlcRBuf ARGS((Void));
76 EXTERN void rlcUtlDlBatchProcHqStaInd ARGS ((Void));
77 EXTERN Void rlcUtlFreeDlMem ARGS((Void));
78 EXTERN SsRngBufCnt rngCb;
79 EXTERN S16 rlcUtlDlBatchProcPkts ARGS((Void));
80 #endif
81
82 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
83 S16 rlcDlBatchProcSplit  ARGS((Void));
84 #endif
85
86 \f  
87 /*********************************************************************
88  *             Primitives for KWU interface 
89  ********************************************************************/
90
91 /* KWU Bind Confirm primitive */
92
93 KwuBndCfm kwUiKwuBndCfmMt[] =
94 {
95 #ifdef LCKWUIKWU
96    cmPkKwuBndCfm,            /* 0 - loosely coupled */
97 #endif /* LCKWUIKWU */
98 #ifdef NH
99    NhLiKwuBndCfm,            /* 1 - tightly coupled, RRC  */
100 #endif /* NH */
101 #ifndef KW_PDCP
102 #ifdef PJ
103    PjLiKwuBndCfm,            /* 2 - tightly coupled, PDCP */
104 #endif /* NH */
105 #endif /* KW_PDCP */
106 #ifndef TENB_ACC
107 #ifdef LWLCKWUIKWU
108    cmPkKwuBndCfm,      /* 3 - light weight loosely coupled */ 
109 #endif /* LCKWUIKWU */
110 #endif /*TENB_ACC*/
111 };
112
113 /* KWU Data Indication primitive */
114
115 KwuDatInd kwUiKwuDatIndMt[] =
116 {
117 #ifdef LCKWUIKWU
118    cmPkKwuDatInd,            /* 0 - loosely coupled */
119 #endif /* LCKWUIKWU */
120 #ifdef NH
121    NhLiKwuDatInd,            /* 1 - tightly coupled, RRC  */
122 #endif /* NH */
123 #ifdef KW_PDCP
124 #else
125 #ifdef PJ
126    PjLiKwuDatInd,            /* 2 - tightly coupled, PDCP */
127 #endif /* NH */
128 #ifndef TENB_ACC
129 #ifdef LWLCKWUIKWU
130    cmPkKwuDatInd,         /* 3 - light weight loosely coupled */ 
131 #endif /* LCKWUIKWU */
132 #endif /*TENB_ACC*/
133 #endif /* KW_PDCP */
134 };
135
136 #ifndef KW_PDCP
137 KwuDatCfm kwUiKwuDatCfmMt[] =
138 {
139 #ifdef LCKWUIKWU
140    cmPkKwuDatCfm,            /* 0 - loosely coupled */
141 #endif /* LCKWUIKWU */
142 #ifdef PJ
143    PjLiKwuDatCfm,            /* 2 - tightly coupled, PDCP */
144 #endif /* PJ */
145 #ifndef TENB_ACC
146 #ifdef LWLCKWUIKWU
147    cmPkKwuDatCfm,         /* 3 - light weight loosely coupled */ 
148 #endif /* LCKWUIKWU */
149 #endif /*TENB_ACC*/
150 };
151
152 /* KWU AM Status Indication primitive */
153
154 KwuStaInd kwUiKwuStaIndMt[] =
155 {
156 #ifdef LCKWUIKWU
157    cmPkKwuStaInd,            /* 0 - loosely coupled */
158 #endif /* LCKWUIKWU */
159 #ifdef PJ
160    PjLiKwuStaInd,            /* 2 - tightly coupled, PDCP */
161 #endif /* PJ */
162 #ifndef TENB_ACC
163 #ifdef LWLCKWUIKWU
164    cmPkKwuStaInd,         /* 3 - light weight loosely coupled */ 
165 #endif /* LCKWUIKWU */
166 #endif /*TENB_ACC*/
167 };
168
169 KwuReEstCmpInd kwUiKwuReEstCmpIndMt[] =
170 {
171 #ifdef LCKWUIKWU
172    cmPkKwuReEstCmpInd,            /* 0 - loosely coupled */
173 #endif /* LCKWUIKWU */
174 #ifdef PJ
175    PjLiKwuReEstCmpInd,            /* 2 - tightly coupled, PDCP */
176 #else
177 #endif /* PJ */
178 #ifndef TENB_ACC
179 #ifdef LWLCKWUIKWU
180    cmPkKwuReEstCmpInd,    /* 3 - light weight loosely coupled */ 
181 #endif /* LCKWUIKWU */
182 #endif /*TENB_ACC*/
183 };
184
185 /* kw005.201 added support for L2 measurement */
186 KwuDiscSduCfm kwUiKwuDiscSduCfmMt[] =
187 {
188 #ifdef LCKWUIKWU
189    cmPkKwuDiscSduCfm,            /* 0 - loosely coupled */
190 #endif /* LCKWUIKWU */
191 #ifdef PJ
192    PjLiKwuDiscSduCfm,            /* 2 - tightly coupled, PDCP */
193 #endif
194 #ifndef TENB_ACC
195 #ifdef LWLCKWUIKWU
196    cmPkKwuDiscSduCfm,    /* 3 - light weight loosely coupled */    
197 #endif /* PJ */
198 #endif /*TENB_ACC*/
199 };
200 KwuFlowCntrlInd kwUiKwuFlowCntrlIndMt[] =
201 {
202 #ifdef LCKWUIKWU
203    cmPkKwuFlowCntrlInd,            /* 0 - loosely coupled */
204 #endif /* LCKWUIKWU */
205 #ifdef PJ
206    PjLiKwuFlowCntrlInd,            /* 2 - tightly coupled, PDCP */
207 #endif /* PJ */
208 #ifdef LCKWUIKWU
209    cmPkKwuFlowCntrlInd,            /* 3 - light weight loosely coupled */
210 #endif /* LCKWUIKWU */
211 };
212 #ifdef LTE_L2_MEAS
213 KwuDatAckInd kwUiKwuDatAckIndMt[] =
214 {
215 #ifdef LCKWUIKWU
216    cmPkKwuDatAckInd,            /* 0 - loosely coupled */
217 #endif /* LCKWUIKWU */
218 #ifdef PJ
219    PjLiKwuDatAckInd,            /* 2 - tightly coupled, PDCP */
220 #endif /* PJ */
221 #ifndef TENB_ACC
222 #ifdef LWLCKWUIKWU
223    cmPkKwuDatAckInd,     /* 3 - light weight loosely coupled, portable */          
224 #endif /* PJ */
225 #endif /*TENB_ACC*/
226 };
227 #endif /* LTE_L2_MEAS */
228 /* KWU AM Data confirm primitive */
229
230 #endif /* KW_PDCP */
231
232 \f  
233 /****************************************************************************
234  *                         KWU Interface Mt functions
235  ***************************************************************************/\f
236 /**
237  *
238  * @brief 
239  *
240  *        Handler for confirming  the bind request received from KWU
241  *        interface.
242  *
243  * @b Description:
244  *
245  *        This function send the bind confirm primitive to the RLC user,
246  *        when it receives a bind request from its service user.
247  *
248  *  @param[in] pst     Post structure  
249  *  @param[in] suId    Service user SAP ID 
250  *  @param[in] status  Status of Confirmation 
251  *
252  *  @return  S16
253  *      -# ROK 
254  *
255  */
256 #ifdef ANSI
257 S16 RlcUiKwuBndCfm
258 (
259 Pst *pst,                       /* post structure */
260 SuId suId,                      /* Service User Id */
261 U8   status                     /* Status */
262 )
263 #else
264 S16 RlcUiKwuBndCfm(pst, suId, status)
265 Pst *pst;                       /* post structure */
266 SuId suId;                      /* Service User Id */
267 U8   status;                    /* Status */
268 #endif
269 {
270    TRC3(RlcUiKwuBndCfm)
271
272    /* jump to specific primitive depending on configured selector */
273    (*kwUiKwuBndCfmMt[pst->selector])(pst, suId, status);
274
275    return ROK;
276
277 } /* end of RlcUiKwuBndCfm */
278
279 \f
280 /**
281  *
282  * @brief 
283  *
284  *        Handler for sending the data(SDU) from upper layer. 
285  *
286  * @b Description:
287  *
288  *        This function is used to transfer a SDU received from the peer
289  *        RLC entity to the service user(RRC/PDCP).
290  *
291  *  @param[in] pst         Post structure  
292  *  @param[in] suId        Service User SAP ID 
293  *  @param[in] datIndInfo  Data Request Information
294  *  @param[in] mBuf         Data Buffer (SDU) 
295  *
296  *  @return  S16
297  *      -# ROK 
298  *      -# RFAILED
299  */
300 #ifdef ANSI
301 S16 rlcSendUlDataToDu
302 (
303 Pst               *pst,
304 KwuDatIndInfo     *datInd,
305 Buffer            *mBuf
306 )
307 #else
308 S16 rlcSendUlDataToDu(pst, datInd, mBuf)
309 Pst               *pst;
310 KwuDatIndInfo     *datInd;
311 Buffer            *mBuf;
312 #endif
313 {
314    TRC3(rlcSendUlDataToDu)
315
316    /* jump to specific primitive depending on configured selector */
317    (*kwUiKwuDatIndMt[pst->selector])(pst, datInd, mBuf);
318
319    return ROK;
320
321 } /* end of rlcSendUlDataToDu */
322
323    int rlcDatCfmsSent = 0;
324 \f
325 #ifndef KW_PDCP
326 /**
327  *
328  * @brief 
329  *
330  *        Handler for sending the data confirmation to upper layer. 
331  *
332  * @b Description:
333  *
334  *        This function is used to send a confirmation to the service
335  *        user about the data received by the peer RLC entity. 
336  *
337  *  @param[in] pst         Post structure  
338  *  @param[in] suId        Service User SAP ID 
339  *  @param[in] datCfmInfo  Data Confirmation Information
340  *
341  *  @return  S16
342  *      -# ROK 
343  *      -# RFAILED
344  */
345 #ifdef ANSI
346 S16 RlcUiKwuDatCfm
347 (
348 Pst               *pst,
349 SuId              suId,
350 KwuDatCfmInfo     *datCfm
351 )
352 #else
353 S16 RlcUiKwuDatCfm(pst, suId, datCfm)
354 Pst               *pst;
355 SuId              suId;
356 KwuDatCfmInfo     *datCfm;
357 #endif
358 {
359    rlcDatCfmsSent++;
360    TRC3(RlcUiKwuDatCfm)
361
362    /* jump to specific primitive depending on configured selector */
363    (*kwUiKwuDatCfmMt[pst->selector])(pst, suId, datCfm);
364
365    return ROK;
366
367 } /* end of RlcUiKwuDatCfm */
368
369 \f
370 /**
371  *
372  * @brief 
373  *
374  *        Handler for sending the Status Indication to the upper layer. 
375  *
376  * @b Description:
377  *
378  *        This function is used only by RLC AM entity.It send status 
379  *        indication to the upper layer about the maximum number of 
380  *        re-transmissions reached for a RLC AM entity. 
381  *
382  *  @param[in] pst         Post structure  
383  *  @param[in] suId        Service User SAP ID 
384  *  @param[in] staInd      RLC Entity Id  
385  *
386  *  @return  S16
387  *      -# ROK 
388  *      -# RFAILED
389  */
390 #ifdef ANSI
391 S16 RlcUiKwuStaInd
392 (
393 Pst               *pst,
394 SuId              suId,
395 KwuStaIndInfo     *staInd
396 )
397 #else
398 S16 RlcUiKwuStaInd(pst, suId, staInd)
399 Pst               *pst;
400 SuId              suId;
401 KwuStaIndInfo     *staInd;
402 #endif
403 {
404    TRC3(RlcUiKwuStaInd)
405
406    /* jump to specific primitive depending on configured selector */
407    (*kwUiKwuStaIndMt[pst->selector])(pst, suId, staInd);
408
409    return ROK;
410
411 } /* end of RlcUiKwuStaInd */
412
413 \f
414 /**
415  *
416  * @brief 
417  *
418  *        Handler for sending the Status Indication to the upper layer. 
419  *
420  * @b Description:
421  *
422  *        This function is used only by RLC AM entity.It send status 
423  *        indication to the upper layer about the maximum number of 
424  *        re-transmissions reached for a RLC AM entity. 
425  *
426  *  @param[in] pst         Post structure  
427  *  @param[in] suId        Service User SAP ID 
428  *  @param[in] staInd      RLC Entity Id  
429  *
430  *  @return  S16
431  *      -# ROK 
432  *      -# RFAILED
433  */
434 #ifdef ANSI
435 S16 RlcUiKwuReEstCmpInd
436 (
437 Pst               *pst,
438 SuId              suId,
439 CmLteRlcId        rlcId
440 )
441 #else
442 S16 RlcUiKwuReEstCmpInd(pst, suId, rlcId)
443 Pst               *pst;
444 SuId              suId;
445 CmLteRlcId        rlcId;
446 #endif
447 {
448    TRC3(RlcUiKwuReEstCmpInd)
449    RLOG0(L_DEBUG, "In RlcUiKwuReEstCmpInd");
450
451    /* jump to specific primitive depending on configured selector */
452    (*kwUiKwuReEstCmpIndMt[pst->selector])(pst, suId, rlcId);
453
454    return ROK;
455
456 } /* end of RlcUiKwuReEstCmpInd */
457 /* kw005.201 added support for L2 Measurement */
458 \f
459 /**
460  *
461  * @brief 
462  *
463  *        Handler for sending the Sdu Disc Cfm  to the upper layer. 
464  *
465  * @b Description:
466  *       
467  *       This function confirms the discard of an SDU .
468  *
469  *  @param[in] pst         Post structure  
470  *  @param[in] suId        Service User SAP ID 
471  *  @param[in] discCfm     Disc information.
472  *
473  *  @return  S16
474  *      -# ROK 
475  *      -# RFAILED
476  */
477 #ifdef ANSI
478 S16 RlcUiKwuDiscSduCfm
479 (
480 Pst               *pst,
481 SuId              suId,
482 KwuDiscSduInfo    *discCfm
483 )
484 #else
485 S16 RlcUiKwuDiscSduCfm(pst, suId, discCfm)
486 Pst               *pst;
487 SuId              suId;
488 KwuDiscSduInfo    *discCfm;
489 #endif
490 {
491    TRC3(RlcUiKwuDiscSduCfm)
492
493    /* jump to specific primitive depending on configured selector */
494    (*kwUiKwuDiscSduCfmMt[pst->selector])(pst, suId, discCfm);
495
496    return ROK;
497
498 } /* end of RlcUiKwuDiscSduCfm */ 
499
500 /**
501  *
502  * @brief 
503  *
504  *        Handler for sending Flow indication to the upper layer. 
505  *
506  * @b Description:
507  *       
508  *       This function indicates to PDCP if packets need to be stopped or
509  *       started for a particular RB
510  *
511  *  @param[in] pst                Post structure  
512  *  @param[in] suId               Service User SAP ID 
513  *  @param[in] flowCntrlIndInfo   Flow control information.
514  *
515  *  @return  S16
516  *      -# ROK 
517  *      -# RFAILED
518  */
519 #ifdef ANSI
520 S16 RlcUiKwuFlowCntrlInd
521 (
522 Pst                   *pst,
523 SuId                  suId,
524 KwuFlowCntrlIndInfo   *flowCntrlIndInfo
525 )
526 #else
527 S16 RlcUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
528 Pst                   *pst;
529 SuId                  suId;
530 KwuFlowCntrlIndInfo   *flowCntrlIndInfo;
531 #endif
532 {
533    TRC3(RlcUiKwuFlowCntrlInd)
534
535    /* jump to specific primitive depending on configured selector */
536    (*kwUiKwuFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlIndInfo);
537
538    return ROK;
539
540 } /* end of RlcUiKwuFlowCntrlInd */ 
541 #ifdef LTE_L2_MEAS
542 \f
543 /**
544  *
545  * @brief 
546  *
547  *        Handler for sending the Data ack indication  to the upper layer. 
548  *
549  * @b Description:
550  *       
551  *       This function confirms the succesfull transmission of SDU
552  *
553  *  @param[in] pst         Post structure  
554  *  @param[in] suId        Service User SAP ID 
555  *  @param[in] datAckInd   DatAckInd
556  *
557  *  @return  S16
558  *      -# ROK 
559  *      -# RFAILED
560  */
561 #ifdef ANSI
562 S16 RlcUiKwuDatAckInd
563 (
564 Pst               *pst,
565 SuId              suId,
566 KwuDatAckInfo     *datAckInd
567 )
568 #else
569 S16 RlcUiKwuDatAckInd(pst, suId, datAckInd)
570 Pst               *pst;
571 SuId              suId;
572 KwuDatAckInfo     *datAckInd;
573 #endif
574 {
575    TRC3(RlcUiKwuDatAckInd)
576
577    /* jump to specific primitive depending on configured selector */
578    (*kwUiKwuDatAckIndMt[pst->selector])(pst, suId, datAckInd);
579
580    return ROK;
581
582 } /* end of RlcUiKwuDatAckInd */ 
583 #endif /* LTE_L2_MEAS */
584 #endif /* KW_PDCP */
585
586
587 \f  
588 /*********************************************************************
589  *             Primitives for CKW interface 
590  ********************************************************************/
591
592 /* CKW Bind Confirm primitive */
593
594 CkwBndCfm kwUiCkwBndCfmMt[] =
595 {
596 #ifdef LCKWUICKW
597    cmPkCkwBndCfm,            /* 0 - loosely coupled */
598 #endif /* LCCKUICKW */
599 #ifdef NH
600    NhLiCkwBndCfm,            /* 1 - tightly coupled, RRC  */
601 #endif /* NH */
602 };
603
604 /* CKW Configuration confirm primitive */
605
606 RlcCfgCfm kwUiRlcCfgCfmMt[] =
607 {
608 #ifdef LCKWUICKW
609    cmPkRlcCfgCfm,            /* 0 - loosely coupled */
610 #endif /* LCKWUICKW */
611 #ifdef NH
612    NhLiRlcCfgCfm,            /* 1 - tightly coupled, RRC  */
613 #endif /* NH */
614 };
615
616 CkwUeIdChgCfm kwUiCkwUeIdChgCfmMt[] =
617 {
618 #ifdef LCKWUICKW
619    cmPkCkwUeIdChgCfm,            /* 0 - loosely coupled */
620 #endif /* LCKWUICKW */
621 #ifdef NH
622    NhLiCkwUeIdChgCfm,            /* 1 - tightly coupled, RRC  */
623 #endif /* NH */
624 };
625
626
627 \f  
628 /****************************************************************************
629  *                         CKW Interface Mt functions
630  ***************************************************************************/
631 /**
632  *
633  * @brief 
634  *
635  *        Handler for confirming  the bind request received from CKW
636  *        interface.
637  *
638  * @b Description:
639  *
640  *        This function send the bind confirm primitive to the RLC user,
641  *        when it receives a bind request from its service user.
642  *
643  *  @param[in] pst      - Post structure  
644  *  @param[in] suId     - Service user SAP ID 
645  *  @param[in] status   - Status
646  *
647  *  @return  S16
648  *      -# ROK 
649  */
650 #ifdef ANSI
651 S16 RlcUiCkwBndCfm
652 (
653 Pst *pst,                       /* post structure */
654 SuId suId,                      /* Service User Id */
655 U8   status                     /* Status */
656 )
657 #else
658 S16 RlcUiCkwBndCfm(pst, suId, status)
659 Pst *pst;                       /* post structure */
660 SuId suId;                      /* Service User Id */
661 U8   status;                    /* Status */
662 #endif
663 {
664    TRC3(RlcUiCkwBndCfm)
665
666    /* jump to specific primitive depending on configured selector */
667    (*kwUiCkwBndCfmMt[pst->selector])(pst, suId, status);
668
669    return ROK;
670
671 } /* end of RlcUiCkwBndCfm */
672
673 \f
674 /**
675  *
676  * @brief 
677  *
678  *        Handler for sending a configuration confirm to RRC.
679  *
680  * @b Description:
681  *
682  *        This function is used by RLC user to send a configuration
683  *        confirmation to RRC after configuring(add/delete/modify)
684  *        the RLC entities. 
685  *
686  *  @param[in] pst      Post structure  
687  *  @param[in] transId  Transaction Id 
688  *  @param[in] cfmInfo  Config Confirmation Info 
689  *
690  *  @return  S16
691  *      -# ROK 
692  *
693  */
694 #ifdef ANSI
695 S16 RlcUiRlcCfgCfm
696 (
697 Pst            *pst,                      /* post structure */
698 SuId           suId,                      /* Service User Id */
699 RlcCfgCfmInfo  *cfmInfo                    /* Configuration Confirm */
700 )
701 #else
702 S16 RlcUiRlcCfgCfm(pst, suId, cfmInfo)
703 Pst            *pst;                      /* post structure */
704 SuId           suId;                      /* Service User Id */
705 RlcCfgCfmInfo  *cfmInfo;                   /* Configuration Confirm */
706 #endif
707 {
708    TRC3(RlcUiRlcCfgCfm)
709
710    /* jump to specific primitive depending on configured selector */
711    (*kwUiRlcCfgCfmMt[pst->selector])(pst, suId, cfmInfo);
712
713    return ROK;
714
715 } /* end of RlcUiRlcCfgCfm */
716
717 \f
718 /**
719  *
720  * @brief 
721  *
722  *        Handler for sending a configuration for UE ID change.
723  *
724  * @b Description:
725  *
726  *        This function is used by RLC to send a configuration
727  *        confirm for UE ID change.
728  *
729  *  @param[in] pst      Post structure  
730  *  @param[in] suId     Service User Id
731  *  @param[in] transId  Transaction Id 
732  *  @param[in] cfmInfo  Config Confirmation Info 
733  *
734  *  @return  S16
735  *      -# ROK 
736  *
737  */
738 #ifdef ANSI
739 S16 RlcUiCkwUeIdChgCfm 
740 (
741 Pst            *pst,                      /* post structure */
742 SuId           suId,                      /* Service User Id */
743 U32            transId,
744 CkwUeInfo      *ueInfo,
745 CmStatus       status
746 )
747 #else
748 S16 RlcUiCkwUeIdChgCfm(pst, suId, transId,ueInfo,status)
749 Pst            *pst;                      /* post structure */
750 SuId           suId;                      /* Service User Id */
751 U32            transId;
752 CkwUeInfo      *ueInfo;
753 CmStatus       status;
754 #endif
755 {
756    TRC3(RlcUiCkwUeIdChgCfm)
757
758    /* jump to specific primitive depending on configured selector */
759    (*kwUiCkwUeIdChgCfmMt[pst->selector])(pst, suId, transId, ueInfo, status);
760
761    return ROK;
762
763 } /* end of RlcUiRlcCfgCfm */
764
765
766 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
767 /**
768  *
769  * @brief 
770  *
771  *        rlcDlBatchProcSplit- process rbug messages
772  *
773  *  @return  S16
774  *      -# ROK 
775  */
776 #ifdef ANSI
777 S16 rlcDlBatchProcSplit 
778 (
779 Void
780 )
781 #else
782 S16 rlcDlBatchProcSplit()
783 Void;
784 #endif
785 {
786
787 /* Read from Ring Buffer and process PDCP packets */
788    Void *elmIndx = NULLP;
789    RxmBufReq *datReq = NULLP;
790 #ifdef LTE_ADV
791    U32 dlPktCount = 0;
792 #endif
793    U8 rngBufDeqIndx = 0;
794    U32 rngBufDeqMaxCnt;
795    U32 rngBufCurrCnt;
796
797    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
798 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
799    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_RX_TO_DLRLC);
800    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
801    {
802       if ( rngBufCurrCnt > (6 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
803       {
804          /* Restablishment scenario */
805          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
806       }
807       else
808       {
809          rngBufDeqMaxCnt = (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT)/2;
810       }
811    }
812 #endif
813    elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC);
814    while(NULLP != elmIndx)
815    {
816       datReq = (RxmBufReq *)elmIndx;
817       if(datReq->mBuf != NULLP)
818       {
819         cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
820       }
821       else
822       {
823          RLOG0(L_ERROR, "mBuf is NULL");
824          if(datReq->mBuf)
825           cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
826
827       }
828       SsRngInfoTbl[SS_RNG_BUF_RX_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
829       datReq->mBuf = NULLP;
830       SRngIncrRIndx(SS_RNG_BUF_RX_TO_DLRLC);
831       rngBufDeqIndx++;
832       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
833       {
834          break;
835       }
836 #ifdef LTE_ADV
837       {
838         dlPktCount++;
839         if(dlPktCount > 75)
840         {
841            break;
842         }
843       }
844 #endif
845       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC)) == NULLP)
846       {
847          break;
848       }
849    }
850
851    return ROK;
852 }
853 #endif
854
855 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
856 #ifdef ANSI
857 S16 rlcDlBatchProc
858 (
859 Void
860 )
861 #else
862 S16 rlcDlBatchProc()
863 Void;
864 #endif
865 {
866 /* Read from Ring Buffer and process PDCP packets */
867
868    U8 rngBufDeqIndx = 0;
869    U32 rngBufDeqMaxCnt;
870 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
871    U32 rngBufCurrCnt;
872 #endif
873    /* Memory regions different for BRCM and Intel */
874    /*dstProcId,srcProcId,dstEnt,dstInst,srcEnt,srcInst,prior,route,event,region,pool,selector*/
875 #ifdef SS_RBUF
876    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTRLC,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,1,1,0,0};
877 #else
878    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTRLC,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,2,1,0,0};
879 #endif
880    Void *elmIndx = NULLP;
881    KwuDatReqDetl *kwuDatReqDetl = NULLP;
882    KwuDatReqInfo datReq;
883
884    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
885 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
886    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_DLPDCP_TO_DLRLC);
887    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
888    {
889       if ( rngBufCurrCnt > (5 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
890       {
891          /* Restablishment scenario */
892          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
893       }
894       else
895       {
896          rngBufDeqMaxCnt = (2 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
897       }
898    }
899 #endif
900    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
901    while(NULLP != elmIndx)
902    {
903       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
904       datReq.rlcId = kwuDatReqDetl->rlcId;
905       datReq.sduId = kwuDatReqDetl->sduId;
906       datReq.lcType = kwuDatReqDetl->lcType;
907       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;;//Number of pkt processed in tti
908       if(kwuDatReqDetl->mBuf != NULLP)
909       {
910          rlcProcDlData(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
911       }
912       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
913       rngBufDeqIndx++;
914
915       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
916       {
917          break;
918       }
919       elmIndx = (Void *)SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
920    }
921
922    return ROK;
923 }
924
925
926 #ifdef ANSI
927 S16 rlcUtlDlBatchProcPkts
928 (
929 Void
930 )
931 #else
932 S16 rlcUtlDlBatchProcPkts
933 Void;
934 #endif
935 {
936     rlcDlBatchProc();
937 #ifdef SS_RBUF
938 #ifdef LTE_L2_MEAS
939     rlcUtlDlBatchProcHqStaInd();
940 #endif
941     rlcUtlFreeDlMem();
942 #endif
943     return ROK;
944 }   
945
946
947 #ifdef ANSI
948 S16 rlcUtlDlFreeRlcRBuf
949 (
950 Void
951 )
952 #else
953 S16 rlcUtlDlFreeRlcRBuf
954 Void;
955 #endif
956 {
957 /* Read from Ring Buffer and process PDCP packets */
958    Void *elmIndx = NULLP;
959    KwuDatReqDetl *kwuDatReqDetl = NULLP;
960    /* Free SS_RNG_BUF_DLPDCP_TO_DLRLC  */
961    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
962    while(NULLP != elmIndx)
963    {
964       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
965       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
966       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;
967       SPutMsg(kwuDatReqDetl->mBuf);
968       elmIndx = NULLP;
969       kwuDatReqDetl = NULLP;
970       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC)) == NULLP)
971       break;
972    }
973    return ROK;
974 }
975
976
977 #endif 
978 #ifdef __cplusplus
979 }
980 #endif /* __cplusplus */
981 /********************************************************************30**
982          End of file
983 **********************************************************************/