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