U8, U16, U32 data type changes
[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 uint8_t   status                     /* Status */
262 )
263 #else
264 S16 RlcUiKwuBndCfm(pst, suId, status)
265 Pst *pst;                       /* post structure */
266 SuId suId;                      /* Service User Id */
267 uint8_t   status;                    /* Status */
268 #endif
269 {
270
271    /* jump to specific primitive depending on configured selector */
272    (*kwUiKwuBndCfmMt[pst->selector])(pst, suId, status);
273
274    return ROK;
275
276 } /* end of RlcUiKwuBndCfm */
277
278 \f
279 /**
280  *
281  * @brief 
282  *
283  *        Handler for sending the data(SDU) from upper layer. 
284  *
285  * @b Description:
286  *
287  *        This function is used to transfer a SDU received from the peer
288  *        RLC entity to the service user(RRC/PDCP).
289  *
290  *  @param[in] pst         Post structure  
291  *  @param[in] suId        Service User SAP ID 
292  *  @param[in] datIndInfo  Data Request Information
293  *  @param[in] mBuf         Data Buffer (SDU) 
294  *
295  *  @return  S16
296  *      -# ROK 
297  *      -# RFAILED
298  */
299 #ifdef ANSI
300 S16 rlcSendUlDataToDu
301 (
302 Pst               *pst,
303 KwuDatIndInfo     *datInd,
304 Buffer            *mBuf
305 )
306 #else
307 S16 rlcSendUlDataToDu(pst, datInd, mBuf)
308 Pst               *pst;
309 KwuDatIndInfo     *datInd;
310 Buffer            *mBuf;
311 #endif
312 {
313
314    /* jump to specific primitive depending on configured selector */
315    (*kwUiKwuDatIndMt[pst->selector])(pst, datInd, mBuf);
316
317    return ROK;
318
319 } /* end of rlcSendUlDataToDu */
320
321    int rlcDatCfmsSent = 0;
322 \f
323 #ifndef KW_PDCP
324 /**
325  *
326  * @brief 
327  *
328  *        Handler for sending the data confirmation to upper layer. 
329  *
330  * @b Description:
331  *
332  *        This function is used to send a confirmation to the service
333  *        user about the data received by the peer RLC entity. 
334  *
335  *  @param[in] pst         Post structure  
336  *  @param[in] suId        Service User SAP ID 
337  *  @param[in] datCfmInfo  Data Confirmation Information
338  *
339  *  @return  S16
340  *      -# ROK 
341  *      -# RFAILED
342  */
343 #ifdef ANSI
344 S16 RlcUiKwuDatCfm
345 (
346 Pst               *pst,
347 SuId              suId,
348 KwuDatCfmInfo     *datCfm
349 )
350 #else
351 S16 RlcUiKwuDatCfm(pst, suId, datCfm)
352 Pst               *pst;
353 SuId              suId;
354 KwuDatCfmInfo     *datCfm;
355 #endif
356 {
357    rlcDatCfmsSent++;
358
359    /* jump to specific primitive depending on configured selector */
360    (*kwUiKwuDatCfmMt[pst->selector])(pst, suId, datCfm);
361
362    return ROK;
363
364 } /* end of RlcUiKwuDatCfm */
365
366 \f
367 /**
368  *
369  * @brief 
370  *
371  *        Handler for sending the Status Indication to the upper layer. 
372  *
373  * @b Description:
374  *
375  *        This function is used only by RLC AM entity.It send status 
376  *        indication to the upper layer about the maximum number of 
377  *        re-transmissions reached for a RLC AM entity. 
378  *
379  *  @param[in] pst         Post structure  
380  *  @param[in] suId        Service User SAP ID 
381  *  @param[in] staInd      RLC Entity Id  
382  *
383  *  @return  S16
384  *      -# ROK 
385  *      -# RFAILED
386  */
387 #ifdef ANSI
388 S16 RlcUiKwuStaInd
389 (
390 Pst               *pst,
391 SuId              suId,
392 KwuStaIndInfo     *staInd
393 )
394 #else
395 S16 RlcUiKwuStaInd(pst, suId, staInd)
396 Pst               *pst;
397 SuId              suId;
398 KwuStaIndInfo     *staInd;
399 #endif
400 {
401
402    /* jump to specific primitive depending on configured selector */
403    (*kwUiKwuStaIndMt[pst->selector])(pst, suId, staInd);
404
405    return ROK;
406
407 } /* end of RlcUiKwuStaInd */
408
409 \f
410 /**
411  *
412  * @brief 
413  *
414  *        Handler for sending the Status Indication to the upper layer. 
415  *
416  * @b Description:
417  *
418  *        This function is used only by RLC AM entity.It send status 
419  *        indication to the upper layer about the maximum number of 
420  *        re-transmissions reached for a RLC AM entity. 
421  *
422  *  @param[in] pst         Post structure  
423  *  @param[in] suId        Service User SAP ID 
424  *  @param[in] staInd      RLC Entity Id  
425  *
426  *  @return  S16
427  *      -# ROK 
428  *      -# RFAILED
429  */
430 #ifdef ANSI
431 S16 RlcUiKwuReEstCmpInd
432 (
433 Pst               *pst,
434 SuId              suId,
435 CmLteRlcId        rlcId
436 )
437 #else
438 S16 RlcUiKwuReEstCmpInd(pst, suId, rlcId)
439 Pst               *pst;
440 SuId              suId;
441 CmLteRlcId        rlcId;
442 #endif
443 {
444    RLOG0(L_DEBUG, "In RlcUiKwuReEstCmpInd");
445
446    /* jump to specific primitive depending on configured selector */
447    (*kwUiKwuReEstCmpIndMt[pst->selector])(pst, suId, rlcId);
448
449    return ROK;
450
451 } /* end of RlcUiKwuReEstCmpInd */
452 /* kw005.201 added support for L2 Measurement */
453 \f
454 /**
455  *
456  * @brief 
457  *
458  *        Handler for sending the Sdu Disc Cfm  to the upper layer. 
459  *
460  * @b Description:
461  *       
462  *       This function confirms the discard of an SDU .
463  *
464  *  @param[in] pst         Post structure  
465  *  @param[in] suId        Service User SAP ID 
466  *  @param[in] discCfm     Disc information.
467  *
468  *  @return  S16
469  *      -# ROK 
470  *      -# RFAILED
471  */
472 #ifdef ANSI
473 S16 RlcUiKwuDiscSduCfm
474 (
475 Pst               *pst,
476 SuId              suId,
477 KwuDiscSduInfo    *discCfm
478 )
479 #else
480 S16 RlcUiKwuDiscSduCfm(pst, suId, discCfm)
481 Pst               *pst;
482 SuId              suId;
483 KwuDiscSduInfo    *discCfm;
484 #endif
485 {
486
487    /* jump to specific primitive depending on configured selector */
488    (*kwUiKwuDiscSduCfmMt[pst->selector])(pst, suId, discCfm);
489
490    return ROK;
491
492 } /* end of RlcUiKwuDiscSduCfm */ 
493
494 /**
495  *
496  * @brief 
497  *
498  *        Handler for sending Flow indication to the upper layer. 
499  *
500  * @b Description:
501  *       
502  *       This function indicates to PDCP if packets need to be stopped or
503  *       started for a particular RB
504  *
505  *  @param[in] pst                Post structure  
506  *  @param[in] suId               Service User SAP ID 
507  *  @param[in] flowCntrlIndInfo   Flow control information.
508  *
509  *  @return  S16
510  *      -# ROK 
511  *      -# RFAILED
512  */
513 #ifdef ANSI
514 S16 RlcUiKwuFlowCntrlInd
515 (
516 Pst                   *pst,
517 SuId                  suId,
518 KwuFlowCntrlIndInfo   *flowCntrlIndInfo
519 )
520 #else
521 S16 RlcUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
522 Pst                   *pst;
523 SuId                  suId;
524 KwuFlowCntrlIndInfo   *flowCntrlIndInfo;
525 #endif
526 {
527
528    /* jump to specific primitive depending on configured selector */
529    (*kwUiKwuFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlIndInfo);
530
531    return ROK;
532
533 } /* end of RlcUiKwuFlowCntrlInd */ 
534 #ifdef LTE_L2_MEAS
535 \f
536 /**
537  *
538  * @brief 
539  *
540  *        Handler for sending the Data ack indication  to the upper layer. 
541  *
542  * @b Description:
543  *       
544  *       This function confirms the succesfull transmission of SDU
545  *
546  *  @param[in] pst         Post structure  
547  *  @param[in] suId        Service User SAP ID 
548  *  @param[in] datAckInd   DatAckInd
549  *
550  *  @return  S16
551  *      -# ROK 
552  *      -# RFAILED
553  */
554 #ifdef ANSI
555 S16 RlcUiKwuDatAckInd
556 (
557 Pst               *pst,
558 SuId              suId,
559 KwuDatAckInfo     *datAckInd
560 )
561 #else
562 S16 RlcUiKwuDatAckInd(pst, suId, datAckInd)
563 Pst               *pst;
564 SuId              suId;
565 KwuDatAckInfo     *datAckInd;
566 #endif
567 {
568
569    /* jump to specific primitive depending on configured selector */
570    (*kwUiKwuDatAckIndMt[pst->selector])(pst, suId, datAckInd);
571
572    return ROK;
573
574 } /* end of RlcUiKwuDatAckInd */ 
575 #endif /* LTE_L2_MEAS */
576 #endif /* KW_PDCP */
577
578
579 \f  
580 /*********************************************************************
581  *             Primitives for CKW interface 
582  ********************************************************************/
583
584 /* CKW Bind Confirm primitive */
585
586 CkwBndCfm kwUiCkwBndCfmMt[] =
587 {
588 #ifdef LCKWUICKW
589    cmPkCkwBndCfm,            /* 0 - loosely coupled */
590 #endif /* LCCKUICKW */
591 #ifdef NH
592    NhLiCkwBndCfm,            /* 1 - tightly coupled, RRC  */
593 #endif /* NH */
594 };
595
596 /* CKW Configuration confirm primitive */
597
598 RlcCfgCfm kwUiRlcCfgCfmMt[] =
599 {
600 #ifdef LCKWUICKW
601    cmPkRlcCfgCfm,            /* 0 - loosely coupled */
602 #endif /* LCKWUICKW */
603 #ifdef NH
604    NhLiRlcCfgCfm,            /* 1 - tightly coupled, RRC  */
605 #endif /* NH */
606 };
607
608 CkwUeIdChgCfm kwUiCkwUeIdChgCfmMt[] =
609 {
610 #ifdef LCKWUICKW
611    cmPkCkwUeIdChgCfm,            /* 0 - loosely coupled */
612 #endif /* LCKWUICKW */
613 #ifdef NH
614    NhLiCkwUeIdChgCfm,            /* 1 - tightly coupled, RRC  */
615 #endif /* NH */
616 };
617
618
619 \f  
620 /****************************************************************************
621  *                         CKW Interface Mt functions
622  ***************************************************************************/
623 /**
624  *
625  * @brief 
626  *
627  *        Handler for confirming  the bind request received from CKW
628  *        interface.
629  *
630  * @b Description:
631  *
632  *        This function send the bind confirm primitive to the RLC user,
633  *        when it receives a bind request from its service user.
634  *
635  *  @param[in] pst      - Post structure  
636  *  @param[in] suId     - Service user SAP ID 
637  *  @param[in] status   - Status
638  *
639  *  @return  S16
640  *      -# ROK 
641  */
642 #ifdef ANSI
643 S16 RlcUiCkwBndCfm
644 (
645 Pst *pst,                       /* post structure */
646 SuId suId,                      /* Service User Id */
647 uint8_t   status                     /* Status */
648 )
649 #else
650 S16 RlcUiCkwBndCfm(pst, suId, status)
651 Pst *pst;                       /* post structure */
652 SuId suId;                      /* Service User Id */
653 uint8_t   status;                    /* Status */
654 #endif
655 {
656
657    /* jump to specific primitive depending on configured selector */
658    (*kwUiCkwBndCfmMt[pst->selector])(pst, suId, status);
659
660    return ROK;
661
662 } /* end of RlcUiCkwBndCfm */
663
664 \f
665 /**
666  *
667  * @brief 
668  *
669  *        Handler for sending a configuration confirm to RRC.
670  *
671  * @b Description:
672  *
673  *        This function is used by RLC user to send a configuration
674  *        confirmation to RRC after configuring(add/delete/modify)
675  *        the RLC entities. 
676  *
677  *  @param[in] pst      Post structure  
678  *  @param[in] transId  Transaction Id 
679  *  @param[in] cfmInfo  Config Confirmation Info 
680  *
681  *  @return  S16
682  *      -# ROK 
683  *
684  */
685 #ifdef ANSI
686 S16 RlcUiRlcCfgCfm
687 (
688 Pst            *pst,                      /* post structure */
689 SuId           suId,                      /* Service User Id */
690 RlcCfgCfmInfo  *cfmInfo                    /* Configuration Confirm */
691 )
692 #else
693 S16 RlcUiRlcCfgCfm(pst, suId, cfmInfo)
694 Pst            *pst;                      /* post structure */
695 SuId           suId;                      /* Service User Id */
696 RlcCfgCfmInfo  *cfmInfo;                   /* Configuration Confirm */
697 #endif
698 {
699
700    /* jump to specific primitive depending on configured selector */
701    (*kwUiRlcCfgCfmMt[pst->selector])(pst, suId, cfmInfo);
702
703    return ROK;
704
705 } /* end of RlcUiRlcCfgCfm */
706
707 \f
708 /**
709  *
710  * @brief 
711  *
712  *        Handler for sending a configuration for UE ID change.
713  *
714  * @b Description:
715  *
716  *        This function is used by RLC to send a configuration
717  *        confirm for UE ID change.
718  *
719  *  @param[in] pst      Post structure  
720  *  @param[in] suId     Service User Id
721  *  @param[in] transId  Transaction Id 
722  *  @param[in] cfmInfo  Config Confirmation Info 
723  *
724  *  @return  S16
725  *      -# ROK 
726  *
727  */
728 #ifdef ANSI
729 S16 RlcUiCkwUeIdChgCfm 
730 (
731 Pst            *pst,                      /* post structure */
732 SuId           suId,                      /* Service User Id */
733 uint32_t       transId,
734 CkwUeInfo      *ueInfo,
735 CmStatus       status
736 )
737 #else
738 S16 RlcUiCkwUeIdChgCfm(pst, suId, transId,ueInfo,status)
739 Pst            *pst;                      /* post structure */
740 SuId           suId;                      /* Service User Id */
741 uint32_t       transId;
742 CkwUeInfo      *ueInfo;
743 CmStatus       status;
744 #endif
745 {
746
747    /* jump to specific primitive depending on configured selector */
748    (*kwUiCkwUeIdChgCfmMt[pst->selector])(pst, suId, transId, ueInfo, status);
749
750    return ROK;
751
752 } /* end of RlcUiRlcCfgCfm */
753
754
755 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
756 /**
757  *
758  * @brief 
759  *
760  *        rlcDlBatchProcSplit- process rbug messages
761  *
762  *  @return  S16
763  *      -# ROK 
764  */
765 #ifdef ANSI
766 S16 rlcDlBatchProcSplit 
767 (
768 Void
769 )
770 #else
771 S16 rlcDlBatchProcSplit()
772 Void;
773 #endif
774 {
775
776 /* Read from Ring Buffer and process PDCP packets */
777    Void *elmIndx = NULLP;
778    RxmBufReq *datReq = NULLP;
779 #ifdef LTE_ADV
780    uint32_t dlPktCount = 0;
781 #endif
782    uint8_t rngBufDeqIndx = 0;
783    uint32_t rngBufDeqMaxCnt;
784    uint32_t rngBufCurrCnt;
785
786    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
787 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
788    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_RX_TO_DLRLC);
789    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
790    {
791       if ( rngBufCurrCnt > (6 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
792       {
793          /* Restablishment scenario */
794          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
795       }
796       else
797       {
798          rngBufDeqMaxCnt = (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT)/2;
799       }
800    }
801 #endif
802    elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC);
803    while(NULLP != elmIndx)
804    {
805       datReq = (RxmBufReq *)elmIndx;
806       if(datReq->mBuf != NULLP)
807       {
808         cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
809       }
810       else
811       {
812          RLOG0(L_ERROR, "mBuf is NULL");
813          if(datReq->mBuf)
814           cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
815
816       }
817       SsRngInfoTbl[SS_RNG_BUF_RX_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
818       datReq->mBuf = NULLP;
819       SRngIncrRIndx(SS_RNG_BUF_RX_TO_DLRLC);
820       rngBufDeqIndx++;
821       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
822       {
823          break;
824       }
825 #ifdef LTE_ADV
826       {
827         dlPktCount++;
828         if(dlPktCount > 75)
829         {
830            break;
831         }
832       }
833 #endif
834       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC)) == NULLP)
835       {
836          break;
837       }
838    }
839
840    return ROK;
841 }
842 #endif
843
844 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
845 #ifdef ANSI
846 S16 rlcDlBatchProc
847 (
848 Void
849 )
850 #else
851 S16 rlcDlBatchProc()
852 Void;
853 #endif
854 {
855 /* Read from Ring Buffer and process PDCP packets */
856
857    uint8_t rngBufDeqIndx = 0;
858    uint32_t rngBufDeqMaxCnt;
859 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
860    uint32_t rngBufCurrCnt;
861 #endif
862    /* Memory regions different for BRCM and Intel */
863    /*dstProcId,srcProcId,dstEnt,dstInst,srcEnt,srcInst,prior,route,event,region,pool,selector*/
864 #ifdef SS_RBUF
865    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTRLC,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,1,1,0,0};
866 #else
867    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTRLC,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,2,1,0,0};
868 #endif
869    Void *elmIndx = NULLP;
870    KwuDatReqDetl *kwuDatReqDetl = NULLP;
871    KwuDatReqInfo datReq;
872
873    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
874 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
875    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_DLPDCP_TO_DLRLC);
876    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
877    {
878       if ( rngBufCurrCnt > (5 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
879       {
880          /* Restablishment scenario */
881          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
882       }
883       else
884       {
885          rngBufDeqMaxCnt = (2 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
886       }
887    }
888 #endif
889    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
890    while(NULLP != elmIndx)
891    {
892       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
893       datReq.rlcId = kwuDatReqDetl->rlcId;
894       datReq.sduId = kwuDatReqDetl->sduId;
895       datReq.lcType = kwuDatReqDetl->lcType;
896       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
897       if(kwuDatReqDetl->mBuf != NULLP)
898       {
899          rlcProcDlData(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
900       }
901       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
902       rngBufDeqIndx++;
903
904       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
905       {
906          break;
907       }
908       elmIndx = (Void *)SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
909    }
910
911    return ROK;
912 }
913
914
915 #ifdef ANSI
916 S16 rlcUtlDlBatchProcPkts
917 (
918 Void
919 )
920 #else
921 S16 rlcUtlDlBatchProcPkts
922 Void;
923 #endif
924 {
925     rlcDlBatchProc();
926 #ifdef SS_RBUF
927 #ifdef LTE_L2_MEAS
928     rlcUtlDlBatchProcHqStaInd();
929 #endif
930     rlcUtlFreeDlMem();
931 #endif
932     return ROK;
933 }   
934
935
936 #ifdef ANSI
937 S16 rlcUtlDlFreeRlcRBuf
938 (
939 Void
940 )
941 #else
942 S16 rlcUtlDlFreeRlcRBuf
943 Void;
944 #endif
945 {
946 /* Read from Ring Buffer and process PDCP packets */
947    Void *elmIndx = NULLP;
948    KwuDatReqDetl *kwuDatReqDetl = NULLP;
949    /* Free SS_RNG_BUF_DLPDCP_TO_DLRLC  */
950    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
951    while(NULLP != elmIndx)
952    {
953       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
954       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
955       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;
956       SPutMsg(kwuDatReqDetl->mBuf);
957       elmIndx = NULLP;
958       kwuDatReqDetl = NULLP;
959       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC)) == NULLP)
960       break;
961    }
962    return ROK;
963 }
964
965
966 #endif 
967 #ifdef __cplusplus
968 }
969 #endif /* __cplusplus */
970 /********************************************************************30**
971          End of file
972 **********************************************************************/