Initial commit
[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 "envopt.h"        /* environment options */
41 #include "envdep.h"        /* environment dependent */
42 #include "envind.h"        /* environment independent */
43
44 #include "gen.h"           /* general */
45 #include "ssi.h"           /* system services */
46 #include "cm5.h"           /* common timer defines */
47 #include "cm_tkns.h"       /* common tokens defines */
48 #include "cm_mblk.h"       /* common memory allocation library defines */
49 #include "cm_llist.h"      /* common link list  defines  */
50 #include "cm_hash.h"       /* common hash list  defines */
51 #include "cm_lte.h"        /* common LTE defines */
52 #include "lkw.h"           /* LKW defines */
53 #include "ckw.h"           /* CKW defines */
54 #include "kwu.h"           /* KWU defines */
55 #include "rgu.h"           /* RGU defines */
56
57 #include "kw_err.h"
58 #include "kw_env.h"        /* RLC environment options */
59 #include "kw.h"            /* RLC defines */
60
61 /* extern (.x) include files */
62 #include "gen.x"           /* general */
63 #include "ssi.x"           /* system services */
64
65 #include "cm5.x"           /* common timer library */
66 #include "cm_tkns.x"       /* common tokens */
67 #include "cm_mblk.x"       /* common memory allocation */
68 #include "cm_llist.x"      /* common link list */
69 #include "cm_hash.x"       /* common hash list */
70 #include "cm_lte.x"        /* common LTE includes */
71 #include "cm_lib.x"        /* common memory allocation library */
72 #include "lkw.x"           /* LKW */
73 #include "ckw.x"           /* CKW */
74 #include "kwu.x"           /* KWU */
75 #include "rgu.x"           /* RGU */
76 #if defined(MAC_RLC_UL_RBUF) || (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)) || defined(SS_RBUF)
77 #include "ss_rbuf.h"
78 #include "ss_rbuf.x"
79 #endif
80 #include "kw.x"
81 #if defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)
82 #include "mt_plat_t33.h"
83 #include "mt_plat_t33.x"
84 #endif
85
86 #ifndef LCKWUIKWU
87 #define PTKWKWU
88 #endif
89
90 #ifndef LCKWUICKW
91 #define PTKWCKW
92 #endif
93
94 #ifndef NH
95 #define PTKWKWU
96 #define PTKWCKW
97 #endif
98
99 #ifndef PJ 
100 #define PTKWKWU
101 #define PTKWCKW
102 #endif
103
104
105 #ifdef __cplusplus
106 EXTERN "C" {
107 #endif /* __cplusplus */
108
109 \f  
110 /*********************************************************************
111  *             Forward Declartion for KWU Porting Functions
112  ********************************************************************/
113 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
114 PUBLIC S16 kwDlBatchProc ARGS ((Void));
115 PUBLIC S16 kwUtlDlFreeRlcRBuf ARGS((Void));
116 EXTERN void kwUtlDlBatchProcHqStaInd ARGS ((Void));
117 EXTERN Void kwUtlFreeDlMem ARGS((Void));
118 EXTERN SsRngBufCnt rngCb;
119 EXTERN S16 kwUtlDlBatchProcPkts ARGS((Void));
120 #endif
121
122 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
123 PUBLIC S16 kwDlBatchProcSplit  ARGS((Void));
124 #endif
125
126 #ifdef PTKWKWU
127 PRIVATE S16 PtUiKwuBndCfm  ARGS ((
128 Pst *pst,                       /* post structure */
129 SuId suId,                      /* Service User Id */
130 U8 status                       /* status */
131 ));
132
133 #endif /* PTKWKWU */
134
135 PUBLIC S16 PtUiKwuDatCfm ARGS ((
136 Pst               *pst,
137 SuId              suId,
138 KwuDatCfmInfo         *datCfm
139 ));
140
141 PUBLIC S16 PtUiKwuStaInd ARGS ((
142 Pst               *pst,
143 SuId              suId,
144 KwuStaIndInfo     *staInd
145 ));
146
147 PUBLIC S16 PtUiKwuReEstCmpInd ARGS ((
148 Pst               *pst,
149 SuId              suId,
150 CmLteRlcId        rlcId
151 ));
152 /* kw005.201 added support for L2 Measurement */
153 PUBLIC S16 PtUiKwuDiscSduCfm ARGS((
154 Pst               *pst,
155 SuId              suId,
156 KwuDiscSduInfo    *discCfm
157 ));
158 PUBLIC S16 PtUiKwuFlowCntrlInd ARGS((
159 Pst                    *pst,
160 SuId                   suId,
161 KwuFlowCntrlIndInfo    *flowCntrlIndInfo
162 ));
163 #ifdef LTE_L2_MEAS
164 PUBLIC S16 PtUiKwuDatAckInd ARGS((
165 Pst               *pst,
166 SuId              suId,
167 KwuDatAckInfo     *datAckInd
168 ));
169 #endif
170 #if (defined(PTKWKWU) || defined(KW_PDCP))
171 PUBLIC S16 PtUiKwuDatInd ARGS ((
172 Pst               *pst,
173 SuId              suId,
174 KwuDatIndInfo     *datInd,
175 Buffer            *mBuf
176 ));
177 #endif /* PTKWKWU || KW_PDCP */
178
179
180 \f  
181 /*********************************************************************
182  *             Forward Declartion for CKW Porting Functions
183  ********************************************************************/
184 #ifdef PTKWCKW
185 PRIVATE S16 PtUiCkwBndCfm  ARGS ((
186 Pst *pst,                       /* post structure */
187 SuId suId,                      /* Service User Id */
188 U8 status                       /* status */
189 ));
190
191 PUBLIC S16 PtUiCkwCfgCfm ARGS ((
192 Pst            *pst,                      /* post structure */
193 SuId           suId,                      /* Service User Id */
194 CkwCfgCfmInfo  *cfmInfo                    /* Configuration Confirm */
195 ));
196
197 PUBLIC S16 PtUiCkwUeIdChgCfm ARGS((
198 Pst            *pst,                      /* post structure */
199 SuId           suId,                      /* Service User Id */
200 U32            transId,
201 CkwUeInfo      *ueInfo,
202 CmStatus       status
203 ));
204
205 #endif /* PTKWCKW */
206
207
208 \f  
209 /*********************************************************************
210  *             Primitives for KWU interface 
211  ********************************************************************/
212
213 /* KWU Bind Confirm primitive */
214
215 PUBLIC KwuBndCfm kwUiKwuBndCfmMt[] =
216 {
217 #ifdef LCKWUIKWU
218    cmPkKwuBndCfm,            /* 0 - loosely coupled */
219 #else
220    PtUiKwuBndCfm,            /* 0 - loosely coupled, portable  */
221 #endif /* LCKWUIKWU */
222 #ifdef NH
223    NhLiKwuBndCfm,            /* 1 - tightly coupled, RRC  */
224 #else
225    PtUiKwuBndCfm,            /* 1 - tightly coupled, portable */
226 #endif /* NH */
227 #ifndef KW_PDCP
228 #ifdef PJ
229    PjLiKwuBndCfm,            /* 2 - tightly coupled, PDCP */
230 #else
231    PtUiKwuBndCfm,      /* 2 - tightly coupled, portable */ 
232 #endif /* NH */
233 #endif /* KW_PDCP */
234 #ifndef TENB_ACC
235 #ifdef LWLCKWUIKWU
236    cmPkKwuBndCfm,      /* 3 - light weight loosely coupled */ 
237 #else
238    PtUiKwuBndCfm,      /* 3 - light weight loosely coupled, portable */
239 #endif /* LCKWUIKWU */
240 #endif /*TENB_ACC*/
241 };
242
243 /* KWU Data Indication primitive */
244
245 PUBLIC KwuDatInd kwUiKwuDatIndMt[] =
246 {
247 #ifdef LCKWUIKWU
248    cmPkKwuDatInd,            /* 0 - loosely coupled */
249 #else
250    PtUiKwuDatInd,            /* 0 - loosely coupled, portable  */
251 #endif /* LCKWUIKWU */
252 #ifdef NH
253    NhLiKwuDatInd,            /* 1 - tightly coupled, RRC  */
254 #else
255    PtUiKwuDatInd,            /* 1 - tightly coupled, portable */
256 #endif /* NH */
257 #ifdef KW_PDCP
258 #else
259 #ifdef PJ
260    PjLiKwuDatInd,            /* 2 - tightly coupled, PDCP */
261 #else
262    PtUiKwuDatInd,         /* 2 - tightly coupled, portable */ 
263 #endif /* NH */
264 #ifndef TENB_ACC
265 #ifdef LWLCKWUIKWU
266    cmPkKwuDatInd,         /* 3 - light weight loosely coupled */ 
267 #else
268    PtUiKwuDatInd,         /* 3 - light weight loosely coupled, portable */
269 #endif /* LCKWUIKWU */
270 #endif /*TENB_ACC*/
271 #endif /* KW_PDCP */
272 };
273
274 #ifndef KW_PDCP
275 PUBLIC KwuDatCfm kwUiKwuDatCfmMt[] =
276 {
277 #ifdef LCKWUIKWU
278    cmPkKwuDatCfm,            /* 0 - loosely coupled */
279 #else
280    PtUiKwuDatCfm,            /* 0 - loosely coupled, portable  */
281 #endif /* LCKWUIKWU */
282    PtUiKwuDatCfm,            /* 1 - tightly coupled, portable */
283 #ifdef PJ
284    PjLiKwuDatCfm,            /* 2 - tightly coupled, PDCP */
285 #else
286    PtUiKwuDatCfm,            /* 2 - tightly coupled, portable */
287 #endif /* PJ */
288 #ifndef TENB_ACC
289 #ifdef LWLCKWUIKWU
290    cmPkKwuDatCfm,         /* 3 - light weight loosely coupled */ 
291 #else
292    PtUiKwuDatCfm,         /* 3 - light weight loosely coupled, portable */
293 #endif /* LCKWUIKWU */
294 #endif /*TENB_ACC*/
295 };
296
297 /* KWU AM Status Indication primitive */
298
299 PUBLIC KwuStaInd kwUiKwuStaIndMt[] =
300 {
301 #ifdef LCKWUIKWU
302    cmPkKwuStaInd,            /* 0 - loosely coupled */
303 #else
304    PtUiKwuStaInd,            /* 0 - loosely coupled, portable  */
305 #endif /* LCKWUIKWU */
306    PtUiKwuStaInd,            /* 2 - tightly coupled, portable */
307 #ifdef PJ
308    PjLiKwuStaInd,            /* 2 - tightly coupled, PDCP */
309 #else
310    PtUiKwuStaInd,            /* 2 - tightly coupled, portable */
311 #endif /* PJ */
312 #ifndef TENB_ACC
313 #ifdef LWLCKWUIKWU
314    cmPkKwuStaInd,         /* 3 - light weight loosely coupled */ 
315 #else
316    PtUiKwuStaInd,         /* 3 - light weight loosely coupled, portable */
317 #endif /* LCKWUIKWU */
318 #endif /*TENB_ACC*/
319 };
320
321 PUBLIC KwuReEstCmpInd kwUiKwuReEstCmpIndMt[] =
322 {
323 #ifdef LCKWUIKWU
324    cmPkKwuReEstCmpInd,            /* 0 - loosely coupled */
325 #else
326    PtUiKwuReEstCmpInd,            /* 0 - loosely coupled, portable  */
327 #endif /* LCKWUIKWU */
328    PtUiKwuReEstCmpInd,            /* 1 - loosely coupled, portable  */
329 #ifdef PJ
330    PjLiKwuReEstCmpInd,            /* 2 - tightly coupled, PDCP */
331 #else
332    PtUiKwuReEstCmpInd,            /* 2 - tightly coupled, portable */
333 #endif /* PJ */
334 #ifndef TENB_ACC
335 #ifdef LWLCKWUIKWU
336    cmPkKwuReEstCmpInd,    /* 3 - light weight loosely coupled */ 
337 #else
338    PtUiKwuReEstCmpInd,    /* 3 - light weight loosely coupled, portable */
339 #endif /* LCKWUIKWU */
340 #endif /*TENB_ACC*/
341 };
342
343 /* kw005.201 added support for L2 measurement */
344 PUBLIC KwuDiscSduCfm kwUiKwuDiscSduCfmMt[] =
345 {
346 #ifdef LCKWUIKWU
347    cmPkKwuDiscSduCfm,            /* 0 - loosely coupled */
348 #else
349    PtUiKwuDiscSduCfm,            /* 0 - loosely coupled, portable  */
350 #endif /* LCKWUIKWU */
351    PtUiKwuDiscSduCfm,            /* 1 - loosely coupled portable */
352 #ifdef PJ
353    PjLiKwuDiscSduCfm,            /* 2 - tightly coupled, PDCP */
354 #else
355    PtUiKwuDiscSduCfm,    /* 2 - tightly coupled, PDCP */     
356 #endif
357 #ifndef TENB_ACC
358 #ifdef LWLCKWUIKWU
359    cmPkKwuDiscSduCfm,    /* 3 - light weight loosely coupled */    
360 #else
361    PtUiKwuDiscSduCfm,    /* 3 - light weight loosely coupled, portable */  
362 #endif /* PJ */
363 #endif /*TENB_ACC*/
364 };
365 PUBLIC KwuFlowCntrlInd kwUiKwuFlowCntrlIndMt[] =
366 {
367 #ifdef LCKWUIKWU
368    cmPkKwuFlowCntrlInd,            /* 0 - loosely coupled */
369 #else
370    PtUiKwuFlowCntrlInd,            /* 0 - loosely coupled, portable  */
371 #endif /* LCKWUIKWU */
372    PtUiKwuFlowCntrlInd,            /* 1 - loosely coupled portable */
373 #ifdef PJ
374    PjLiKwuFlowCntrlInd,            /* 2 - tightly coupled, PDCP */
375 #else
376    PtUiKwuFlowCntrlInd,            /* 2 - tightly coupled, portable */
377 #endif /* PJ */
378 #ifdef LCKWUIKWU
379    cmPkKwuFlowCntrlInd,            /* 3 - light weight loosely coupled */
380 #else
381    PtUiKwuFlowCntrlInd,            /* 3 - light weight loosely coupled, portable  */
382 #endif /* LCKWUIKWU */
383 };
384 #ifdef LTE_L2_MEAS
385 PUBLIC KwuDatAckInd kwUiKwuDatAckIndMt[] =
386 {
387 #ifdef LCKWUIKWU
388    cmPkKwuDatAckInd,            /* 0 - loosely coupled */
389 #else
390    PtUiKwuDatAckInd,            /* 0 - loosely coupled, portable  */
391 #endif /* LCKWUIKWU */
392    PtUiKwuDatAckInd,            /* 1 - loosely coupled, portable  */
393 #ifdef PJ
394    PjLiKwuDatAckInd,            /* 2 - tightly coupled, PDCP */
395 #else
396    PtUiKwuDatAckInd,     /* 1 - tightly coupled, portable */  
397 #endif /* PJ */
398 #ifndef TENB_ACC
399 #ifdef LWLCKWUIKWU
400    cmPkKwuDatAckInd,     /* 3 - light weight loosely coupled, portable */          
401 #else
402    PtUiKwuDatAckInd,     /* 3 - light weight loosely coupled */        
403 #endif /* PJ */
404 #endif /*TENB_ACC*/
405 };
406 #endif /* LTE_L2_MEAS */
407 /* KWU AM Data confirm primitive */
408
409 #endif /* KW_PDCP */
410
411 \f  
412 /****************************************************************************
413  *                         KWU Interface Mt functions
414  ***************************************************************************/\f
415 /**
416  *
417  * @brief 
418  *
419  *        Handler for confirming  the bind request received from KWU
420  *        interface.
421  *
422  * @b Description:
423  *
424  *        This function send the bind confirm primitive to the RLC user,
425  *        when it receives a bind request from its service user.
426  *
427  *  @param[in] pst     Post structure  
428  *  @param[in] suId    Service user SAP ID 
429  *  @param[in] status  Status of Confirmation 
430  *
431  *  @return  S16
432  *      -# ROK 
433  *
434  */
435 #ifdef ANSI
436 PUBLIC S16 KwUiKwuBndCfm
437 (
438 Pst *pst,                       /* post structure */
439 SuId suId,                      /* Service User Id */
440 U8   status                     /* Status */
441 )
442 #else
443 PUBLIC S16 KwUiKwuBndCfm(pst, suId, status)
444 Pst *pst;                       /* post structure */
445 SuId suId;                      /* Service User Id */
446 U8   status;                    /* Status */
447 #endif
448 {
449    TRC3(KwUiKwuBndCfm)
450
451    /* jump to specific primitive depending on configured selector */
452    (*kwUiKwuBndCfmMt[pst->selector])(pst, suId, status);
453
454    RETVALUE(ROK);
455
456 } /* end of KwUiKwuBndCfm */
457
458 \f
459 /**
460  *
461  * @brief 
462  *
463  *        Handler for sending the data(SDU) from upper layer. 
464  *
465  * @b Description:
466  *
467  *        This function is used to transfer a SDU received from the peer
468  *        RLC entity to the service user(RRC/PDCP).
469  *
470  *  @param[in] pst         Post structure  
471  *  @param[in] suId        Service User SAP ID 
472  *  @param[in] datIndInfo  Data Request Information
473  *  @param[in] mBuf         Data Buffer (SDU) 
474  *
475  *  @return  S16
476  *      -# ROK 
477  *      -# RFAILED
478  */
479 #ifdef ANSI
480 PUBLIC S16 KwUiKwuDatInd
481 (
482 Pst               *pst,
483 SuId              suId,
484 KwuDatIndInfo     *datInd,
485 Buffer            *mBuf
486 )
487 #else
488 PUBLIC S16 KwUiKwuDatInd(pst, suId, datInd, mBuf)
489 Pst               *pst;
490 SuId              suId;
491 KwuDatIndInfo     *datInd;
492 Buffer            *mBuf;
493 #endif
494 {
495    TRC3(KwUiKwuDatInd)
496
497    /* jump to specific primitive depending on configured selector */
498    (*kwUiKwuDatIndMt[pst->selector])(pst, suId, datInd, mBuf);
499
500    RETVALUE(ROK);
501
502 } /* end of KwUiKwuDatInd */
503
504    PUBLIC int rlcDatCfmsSent = 0;
505 \f
506 #ifndef KW_PDCP
507 /**
508  *
509  * @brief 
510  *
511  *        Handler for sending the data confirmation to upper layer. 
512  *
513  * @b Description:
514  *
515  *        This function is used to send a confirmation to the service
516  *        user about the data received by the peer RLC entity. 
517  *
518  *  @param[in] pst         Post structure  
519  *  @param[in] suId        Service User SAP ID 
520  *  @param[in] datCfmInfo  Data Confirmation Information
521  *
522  *  @return  S16
523  *      -# ROK 
524  *      -# RFAILED
525  */
526 #ifdef ANSI
527 PUBLIC S16 KwUiKwuDatCfm
528 (
529 Pst               *pst,
530 SuId              suId,
531 KwuDatCfmInfo     *datCfm
532 )
533 #else
534 PUBLIC S16 KwUiKwuDatCfm(pst, suId, datCfm)
535 Pst               *pst;
536 SuId              suId;
537 KwuDatCfmInfo     *datCfm;
538 #endif
539 {
540    rlcDatCfmsSent++;
541    TRC3(KwUiKwuDatCfm)
542
543    /* jump to specific primitive depending on configured selector */
544    (*kwUiKwuDatCfmMt[pst->selector])(pst, suId, datCfm);
545
546    RETVALUE(ROK);
547
548 } /* end of KwUiKwuDatCfm */
549
550 \f
551 /**
552  *
553  * @brief 
554  *
555  *        Handler for sending the Status Indication to the upper layer. 
556  *
557  * @b Description:
558  *
559  *        This function is used only by RLC AM entity.It send status 
560  *        indication to the upper layer about the maximum number of 
561  *        re-transmissions reached for a RLC AM entity. 
562  *
563  *  @param[in] pst         Post structure  
564  *  @param[in] suId        Service User SAP ID 
565  *  @param[in] staInd      RLC Entity Id  
566  *
567  *  @return  S16
568  *      -# ROK 
569  *      -# RFAILED
570  */
571 #ifdef ANSI
572 PUBLIC S16 KwUiKwuStaInd
573 (
574 Pst               *pst,
575 SuId              suId,
576 KwuStaIndInfo     *staInd
577 )
578 #else
579 PUBLIC S16 KwUiKwuStaInd(pst, suId, staInd)
580 Pst               *pst;
581 SuId              suId;
582 KwuStaIndInfo     *staInd;
583 #endif
584 {
585    TRC3(KwUiKwuStaInd)
586
587    /* jump to specific primitive depending on configured selector */
588    (*kwUiKwuStaIndMt[pst->selector])(pst, suId, staInd);
589
590    RETVALUE(ROK);
591
592 } /* end of KwUiKwuStaInd */
593
594 \f
595 /**
596  *
597  * @brief 
598  *
599  *        Handler for sending the Status Indication to the upper layer. 
600  *
601  * @b Description:
602  *
603  *        This function is used only by RLC AM entity.It send status 
604  *        indication to the upper layer about the maximum number of 
605  *        re-transmissions reached for a RLC AM entity. 
606  *
607  *  @param[in] pst         Post structure  
608  *  @param[in] suId        Service User SAP ID 
609  *  @param[in] staInd      RLC Entity Id  
610  *
611  *  @return  S16
612  *      -# ROK 
613  *      -# RFAILED
614  */
615 #ifdef ANSI
616 PUBLIC S16 KwUiKwuReEstCmpInd
617 (
618 Pst               *pst,
619 SuId              suId,
620 CmLteRlcId        rlcId
621 )
622 #else
623 PUBLIC S16 KwUiKwuReEstCmpInd(pst, suId, rlcId)
624 Pst               *pst;
625 SuId              suId;
626 CmLteRlcId        rlcId;
627 #endif
628 {
629    TRC3(KwUiKwuReEstCmpInd)
630    RLOG0(L_DEBUG, "In KwUiKwuReEstCmpInd");
631
632    /* jump to specific primitive depending on configured selector */
633    (*kwUiKwuReEstCmpIndMt[pst->selector])(pst, suId, rlcId);
634
635    RETVALUE(ROK);
636
637 } /* end of KwUiKwuReEstCmpInd */
638 /* kw005.201 added support for L2 Measurement */
639 \f
640 /**
641  *
642  * @brief 
643  *
644  *        Handler for sending the Sdu Disc Cfm  to the upper layer. 
645  *
646  * @b Description:
647  *       
648  *       This function confirms the discard of an SDU .
649  *
650  *  @param[in] pst         Post structure  
651  *  @param[in] suId        Service User SAP ID 
652  *  @param[in] discCfm     Disc information.
653  *
654  *  @return  S16
655  *      -# ROK 
656  *      -# RFAILED
657  */
658 #ifdef ANSI
659 PUBLIC S16 KwUiKwuDiscSduCfm
660 (
661 Pst               *pst,
662 SuId              suId,
663 KwuDiscSduInfo    *discCfm
664 )
665 #else
666 PUBLIC S16 KwUiKwuDiscSduCfm(pst, suId, discCfm)
667 Pst               *pst;
668 SuId              suId;
669 KwuDiscSduInfo    *discCfm;
670 #endif
671 {
672    TRC3(KwUiKwuDiscSduCfm)
673
674    /* jump to specific primitive depending on configured selector */
675    (*kwUiKwuDiscSduCfmMt[pst->selector])(pst, suId, discCfm);
676
677    RETVALUE(ROK);
678
679 } /* end of KwUiKwuDiscSduCfm */ 
680
681 /**
682  *
683  * @brief 
684  *
685  *        Handler for sending Flow indication to the upper layer. 
686  *
687  * @b Description:
688  *       
689  *       This function indicates to PDCP if packets need to be stopped or
690  *       started for a particular RB
691  *
692  *  @param[in] pst                Post structure  
693  *  @param[in] suId               Service User SAP ID 
694  *  @param[in] flowCntrlIndInfo   Flow control information.
695  *
696  *  @return  S16
697  *      -# ROK 
698  *      -# RFAILED
699  */
700 #ifdef ANSI
701 PUBLIC S16 KwUiKwuFlowCntrlInd
702 (
703 Pst                   *pst,
704 SuId                  suId,
705 KwuFlowCntrlIndInfo   *flowCntrlIndInfo
706 )
707 #else
708 PUBLIC S16 KwUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
709 Pst                   *pst;
710 SuId                  suId;
711 KwuFlowCntrlIndInfo   *flowCntrlIndInfo;
712 #endif
713 {
714    TRC3(KwUiKwuFlowCntrlInd)
715
716    /* jump to specific primitive depending on configured selector */
717    (*kwUiKwuFlowCntrlIndMt[pst->selector])(pst, suId, flowCntrlIndInfo);
718
719    RETVALUE(ROK);
720
721 } /* end of KwUiKwuFlowCntrlInd */ 
722 #ifdef LTE_L2_MEAS
723 \f
724 /**
725  *
726  * @brief 
727  *
728  *        Handler for sending the Data ack indication  to the upper layer. 
729  *
730  * @b Description:
731  *       
732  *       This function confirms the succesfull transmission of SDU
733  *
734  *  @param[in] pst         Post structure  
735  *  @param[in] suId        Service User SAP ID 
736  *  @param[in] datAckInd   DatAckInd
737  *
738  *  @return  S16
739  *      -# ROK 
740  *      -# RFAILED
741  */
742 #ifdef ANSI
743 PUBLIC S16 KwUiKwuDatAckInd
744 (
745 Pst               *pst,
746 SuId              suId,
747 KwuDatAckInfo     *datAckInd
748 )
749 #else
750 PUBLIC S16 KwUiKwuDatAckInd(pst, suId, datAckInd)
751 Pst               *pst;
752 SuId              suId;
753 KwuDatAckInfo     *datAckInd;
754 #endif
755 {
756    TRC3(KwUiKwuDatAckInd)
757
758    /* jump to specific primitive depending on configured selector */
759    (*kwUiKwuDatAckIndMt[pst->selector])(pst, suId, datAckInd);
760
761    RETVALUE(ROK);
762
763 } /* end of KwUiKwuDatAckInd */ 
764 #endif /* LTE_L2_MEAS */
765 #endif /* KW_PDCP */
766
767 \f
768 #ifdef PTKWKWU
769 /*************************************************************************
770  *                         KWU Porting Functions
771  ************************************************************************/
772 /**
773  *
774  * @brief 
775  *
776  *        PtUiKwuBndCfm - Portable SAP bind confirm
777  *
778  *  @param[in] pst      - Post structure  
779  *  @param[in] suId     - Service user SAP ID 
780  *  @param[in] status   - Status
781  *
782  *  @return  S16
783  *      -# ROK 
784  */
785 #ifdef ANSI
786 PRIVATE S16 PtUiKwuBndCfm 
787 (
788 Pst *pst,                       /* post structure */
789 SuId suId,                      /* Service User Id */
790 U8 status                       /* status */
791 )
792 #else
793 PRIVATE S16 PtUiKwuBndCfm(pst, suId, status)
794 Pst *pst;                       /* post structure */
795 SuId suId;                      /* Service User Id */
796 U8 status;                      /* status */
797 #endif
798 {
799 #if (ERRCLASS & ERRCLS_DEBUG)
800    KwCb   *tKwCb;
801 #endif
802    TRC3(PtUiKwuBndCfm);
803
804    UNUSED(suId);
805    UNUSED(status);
806 #if (ERRCLASS & ERRCLS_DEBUG)
807    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
808    {
809       RETVALUE(RFAILED);
810    }
811    
812    tKwCb = KW_GET_KWCB(pst->srcInst);
813    RLOG0(L_ERROR, "Improper selector value");
814 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
815
816    RETVALUE(ROK);
817 } /* end of PtUiKwuBndCfm */
818 #endif /* PTKWKWU */
819
820 \f
821 /**
822  *
823  * @brief 
824  *
825  *        PtUiKwuDatCfm - Portable common channel data request
826  *
827  *  @param[in] pst    -  Post structure  
828  *  @param[in] suId   -  Service user SAP ID 
829  *  @param[in] datCfm -  Data Request
830  *
831  *  @return  S16
832  *      -# ROK 
833  */
834 #ifdef ANSI
835 PUBLIC S16 PtUiKwuDatCfm
836 (
837 Pst               *pst,
838 SuId              suId,
839 KwuDatCfmInfo    *datCfm
840 )
841 #else
842 PUBLIC S16 PtUiKwuDatCfm(pst, suId, datCfm)
843 Pst               *pst;
844 SuId              suId;
845 KwuDatCfmInfo     *datCfm;
846 #endif
847 {
848 #if (ERRCLASS & ERRCLS_DEBUG)
849    KwCb   *tKwCb;
850 #endif
851    TRC3(PtUiKwuDatCfm)
852
853    UNUSED(pst);
854    UNUSED(suId);
855    UNUSED(datCfm);
856 #if (ERRCLASS & ERRCLS_DEBUG)
857    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
858    {
859       RETVALUE(RFAILED);
860    }
861    tKwCb = KW_GET_KWCB(pst->srcInst);
862  
863    RLOG0(L_ERROR, "Improper selector value");
864 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
865
866    RETVALUE(ROK);
867
868 } /* end of PtUiKwuDatCfm */
869
870 \f
871 /**
872  *
873  * @brief 
874  *
875  *        PtUiKwuStaInd - Portable common channel data request
876  *
877  *  @param[in] pst    -  Post structure  
878  *  @param[in] suId   -  Service user SAP ID 
879  *  @param[in] staInd -  Data Request
880  *
881  *  @return  S16
882  *      -# ROK 
883  */
884 #ifdef ANSI
885 PUBLIC S16 PtUiKwuStaInd
886 (
887 Pst               *pst,
888 SuId              suId,
889 KwuStaIndInfo     *staInd
890 )
891 #else
892 PUBLIC S16 PtUiKwuStaInd(pst, suId, staInd)
893 Pst               *pst;
894 SuId              suId;
895 KwuStaIndInfo     *staInd;
896 #endif
897 {
898 #if (ERRCLASS & ERRCLS_DEBUG)
899    KwCb   *tKwCb;
900 #endif
901    TRC3(PtUiKwuStaInd)
902
903    UNUSED(pst);
904    UNUSED(suId);
905    UNUSED(staInd);
906
907 #if (ERRCLASS & ERRCLS_DEBUG)
908    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
909    {
910       RETVALUE(RFAILED);
911    }
912    tKwCb = KW_GET_KWCB(pst->srcInst);
913    RLOG0(L_ERROR, "Improper selector value");
914 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
915
916    RETVALUE(ROK);
917
918 } /* end of PtUiKwuStaInd */
919
920 \f
921 /**
922  *
923  * @brief 
924  *
925  *        PtUiKwuReEstCmpInd - Portable common channel data request
926  *
927  *  @param[in] pst    -  Post structure  
928  *  @param[in] suId   -  Service user SAP ID 
929  *  @param[in] staInd -  Data Request
930  *
931  *  @return  S16
932  *      -# ROK 
933  */
934 #ifdef ANSI
935 PUBLIC S16 PtUiKwuReEstCmpInd
936 (
937 Pst               *pst,
938 SuId              suId,
939 CmLteRlcId        rlcId
940 )
941 #else
942 PUBLIC S16 PtUiKwuReEstCmpInd(pst, suId, rlcId)
943 Pst               *pst;
944 SuId              suId;
945 CmLteRlcId        rlcId;
946 #endif
947 {
948 #if (ERRCLASS & ERRCLS_DEBUG)
949    KwCb   *tKwCb;
950 #endif
951    TRC3(PtUiKwuReEstCmpInd)
952
953    UNUSED(pst);
954    UNUSED(suId);
955    UNUSED(rlcId);
956
957 #if (ERRCLASS & ERRCLS_DEBUG)
958    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
959    {
960       RETVALUE(RFAILED);
961    }
962    tKwCb = KW_GET_KWCB(pst->srcInst);
963    RLOG0(L_ERROR, "Improper selector value");
964 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
965
966    RETVALUE(ROK);
967
968 } /* end of PtUiKwuReEstCmpInd */
969
970 /* kw005.201 added support for L2 Measurement */
971 /*
972  * @brief 
973  *
974  *        PtUiKwuDiscSduCfm - Portable common channel data request
975  *
976  *  @param[in] pst    -  Post structure  
977  *  @param[in] suId   -  Service user SAP ID 
978  *  @param[in] staInd -  Data Request
979  *
980  *  @return  S16
981  *      -# ROK 
982  */
983 #ifdef ANSI
984 PUBLIC S16 PtUiKwuDiscSduCfm
985 (
986 Pst               *pst,
987 SuId              suId,
988 KwuDiscSduInfo    *discCfm
989 )
990 #else
991 PUBLIC S16 PtUiKwuDiscSduCfm(pst, suId, discCfm)
992 Pst               *pst;
993 SuId              suId;
994 KwuDiscSduInfo    *discCfm;
995 #endif
996 {
997 #if (ERRCLASS & ERRCLS_DEBUG)
998    KwCb   *tKwCb;
999 #endif
1000    TRC3(PtUiKwuDiscSduCfm)
1001
1002    UNUSED(pst);
1003    UNUSED(suId);
1004    UNUSED(discCfm);
1005
1006 #if (ERRCLASS & ERRCLS_DEBUG)
1007    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1008    {
1009       RETVALUE(RFAILED);
1010    }
1011    tKwCb = KW_GET_KWCB(pst->srcInst);
1012    RLOG0(L_ERROR, "Improper selector value");
1013 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1014
1015    RETVALUE(ROK);
1016
1017 } /* end of PtUiKwuDiscSduCfm */
1018
1019 /*
1020  * @brief 
1021  *
1022  *        PtUiKwuFlowCntrlInd - Portable Flow control idication
1023  *
1024  *  @param[in] pst          -  Post structure  
1025  *  @param[in] suId         -  Service user SAP ID 
1026  *  @param[in] flowCntrlInd -  Flow control information
1027  *
1028  *  @return  S16
1029  *      -# ROK 
1030  */
1031 #ifdef ANSI
1032 PUBLIC S16 PtUiKwuFlowCntrlInd
1033 (
1034 Pst                    *pst,
1035 SuId                   suId,
1036 KwuFlowCntrlIndInfo    *flowCntrlIndInfo
1037 )
1038 #else
1039 PUBLIC S16 PtUiKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
1040 Pst                    *pst;
1041 SuId                   suId;
1042 KwuFlowCntrlIndInfo    *flowCntrlIndInfo;
1043 #endif
1044 {
1045 #if (ERRCLASS & ERRCLS_DEBUG)
1046    KwCb   *tKwCb;
1047 #endif
1048    TRC3(PtUiKwuFlowCntrlInd)
1049
1050    UNUSED(pst);
1051    UNUSED(suId);
1052    UNUSED(flowCntrlIndInfo);
1053
1054 #if (ERRCLASS & ERRCLS_DEBUG)
1055    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1056    {
1057       RETVALUE(RFAILED);
1058    }
1059    tKwCb = KW_GET_KWCB(pst->srcInst);
1060    RLOG0(L_ERROR, "Improper selector value");
1061 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1062
1063    RETVALUE(ROK);
1064
1065 } /* end of PtUiKwuFlowCntrlInd */
1066 #ifdef LTE_L2_MEAS
1067 \f
1068 /**
1069  *
1070  * @brief 
1071  *
1072  *        Handler for sending the Data ack indication  to the upper layer. 
1073  *
1074  * @b Description:
1075  *       
1076  *       This function confirms the succesfull transmission of SDU
1077  *
1078  *  @param[in] pst         Post structure  
1079  *  @param[in] suId        Service User SAP ID 
1080  *  @param[in] datAckInd   DatAckInd
1081  *
1082  *  @return  S16
1083  *      -# ROK 
1084  *      -# RFAILED
1085  */
1086 #ifdef ANSI
1087 PUBLIC S16 PtUiKwuDatAckInd
1088 (
1089 Pst               *pst,
1090 SuId              suId,
1091 KwuDatAckInfo     *datAckInd
1092 )
1093 #else
1094 PUBLIC S16 PtUiKwuDatAckInd(pst, suId, datAckInd)
1095 Pst               *pst;
1096 SuId              suId;
1097 KwuDatAckInfo     *datAckInd;
1098 #endif
1099 {
1100 #if (ERRCLASS & ERRCLS_DEBUG)
1101    KwCb   *tKwCb;
1102 #endif
1103    TRC3(PtUiKwuDatAckInd)
1104    
1105    UNUSED(pst);
1106    UNUSED(suId);
1107    UNUSED(datAckInd);
1108 #if (ERRCLASS & ERRCLS_DEBUG)
1109    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1110    {
1111       RETVALUE(RFAILED);
1112    }
1113    tKwCb = KW_GET_KWCB(pst->srcInst);
1114
1115    RLOG0(L_ERROR, "Improper selector value");
1116 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1117    RETVALUE(ROK);
1118 }/* end of PtUiKwuDatAckInd */
1119 #endif /* LTE_L2_MEAS */
1120 #if (defined(PTKWKWU) || defined(KW_PDCP))
1121 \f
1122 /**
1123  *
1124  * @brief 
1125  *
1126  *        PtUiKwuDatInd - Portable common channel data request
1127  *
1128  *  @param[in] pst    -  Post structure  
1129  *  @param[in] suId   -  Service user SAP ID 
1130  *  @param[in] datInd -  Data Request
1131  *
1132  *  @return  S16
1133  *      -# ROK 
1134  */
1135 #ifdef ANSI
1136 PUBLIC S16 PtUiKwuDatInd
1137 (
1138 Pst               *pst,
1139 SuId              suId,
1140 KwuDatIndInfo     *datInd,
1141 Buffer            *mBuf
1142 )
1143 #else
1144 PUBLIC S16 PtUiKwuDatInd(pst, suId, datInd, mBuf)
1145 Pst               *pst;
1146 SuId              suId;
1147 KwuDatIndInfo     *datInd;
1148 Buffer            *mBuf;
1149 #endif
1150 {
1151 #if (ERRCLASS & ERRCLS_DEBUG)
1152    KwCb   *tKwCb;
1153 #endif
1154    TRC3(PtUiKwuDatInd)
1155
1156    UNUSED(pst);
1157    UNUSED(suId);
1158    UNUSED(datInd);
1159    UNUSED(mBuf);
1160
1161 #if (ERRCLASS & ERRCLS_DEBUG)
1162    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1163    {
1164       RETVALUE(RFAILED);
1165    }
1166    tKwCb = KW_GET_KWCB(pst->srcInst);
1167    RLOG0(L_ERROR, "Improper selector value");
1168 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1169
1170    RETVALUE(ROK);
1171
1172 } /* end of PtUiKwuDatInd */
1173 #endif /* PTKWKWU || KW_PDCP */
1174
1175
1176 \f  
1177 /*********************************************************************
1178  *             Primitives for CKW interface 
1179  ********************************************************************/
1180
1181 /* CKW Bind Confirm primitive */
1182
1183 PUBLIC CkwBndCfm kwUiCkwBndCfmMt[] =
1184 {
1185 #ifdef LCKWUICKW
1186    cmPkCkwBndCfm,            /* 0 - loosely coupled */
1187 #else
1188    PtUiCkwBndCfm,            /* 0 - loosely coupled, portable  */
1189 #endif /* LCCKUICKW */
1190 #ifdef NH
1191    NhLiCkwBndCfm,            /* 1 - tightly coupled, RRC  */
1192 #else
1193    PtUiCkwBndCfm,            /* 1 - tightly coupled, portable */
1194 #endif /* NH */
1195 };
1196
1197 /* CKW Configuration confirm primitive */
1198
1199 PUBLIC CkwCfgCfm kwUiCkwCfgCfmMt[] =
1200 {
1201 #ifdef LCKWUICKW
1202    cmPkCkwCfgCfm,            /* 0 - loosely coupled */
1203 #else
1204    PtUiCkwCfgCfm,            /* 0 - loosely coupled, portable  */
1205 #endif /* LCKWUICKW */
1206 #ifdef NH
1207    NhLiCkwCfgCfm,            /* 1 - tightly coupled, RRC  */
1208 #else
1209    PtUiCkwCfgCfm,            /* 1 - tightly coupled, portable */
1210 #endif /* NH */
1211 };
1212
1213 PUBLIC CkwUeIdChgCfm kwUiCkwUeIdChgCfmMt[] =
1214 {
1215 #ifdef LCKWUICKW
1216    cmPkCkwUeIdChgCfm,            /* 0 - loosely coupled */
1217 #else
1218    PtUiCkwUeIdChgCfm,            /* 0 - loosely coupled, portable  */
1219 #endif /* LCKWUICKW */
1220 #ifdef NH
1221    NhLiCkwUeIdChgCfm,            /* 1 - tightly coupled, RRC  */
1222 #else
1223    PtUiCkwUeIdChgCfm,            /* 1 - tightly coupled, portable */
1224 #endif /* NH */
1225 };
1226
1227
1228 \f  
1229 /****************************************************************************
1230  *                         CKW Interface Mt functions
1231  ***************************************************************************/
1232 /**
1233  *
1234  * @brief 
1235  *
1236  *        Handler for confirming  the bind request received from CKW
1237  *        interface.
1238  *
1239  * @b Description:
1240  *
1241  *        This function send the bind confirm primitive to the RLC user,
1242  *        when it receives a bind request from its service user.
1243  *
1244  *  @param[in] pst      - Post structure  
1245  *  @param[in] suId     - Service user SAP ID 
1246  *  @param[in] status   - Status
1247  *
1248  *  @return  S16
1249  *      -# ROK 
1250  */
1251 #ifdef ANSI
1252 PUBLIC S16 KwUiCkwBndCfm
1253 (
1254 Pst *pst,                       /* post structure */
1255 SuId suId,                      /* Service User Id */
1256 U8   status                     /* Status */
1257 )
1258 #else
1259 PUBLIC S16 KwUiCkwBndCfm(pst, suId, status)
1260 Pst *pst;                       /* post structure */
1261 SuId suId;                      /* Service User Id */
1262 U8   status;                    /* Status */
1263 #endif
1264 {
1265    TRC3(KwUiCkwBndCfm)
1266
1267    /* jump to specific primitive depending on configured selector */
1268    (*kwUiCkwBndCfmMt[pst->selector])(pst, suId, status);
1269
1270    RETVALUE(ROK);
1271
1272 } /* end of KwUiCkwBndCfm */
1273
1274 \f
1275 /**
1276  *
1277  * @brief 
1278  *
1279  *        Handler for sending a configuration confirm to RRC.
1280  *
1281  * @b Description:
1282  *
1283  *        This function is used by RLC user to send a configuration
1284  *        confirmation to RRC after configuring(add/delete/modify)
1285  *        the RLC entities. 
1286  *
1287  *  @param[in] pst      Post structure  
1288  *  @param[in] transId  Transaction Id 
1289  *  @param[in] cfmInfo  Config Confirmation Info 
1290  *
1291  *  @return  S16
1292  *      -# ROK 
1293  *
1294  */
1295 #ifdef ANSI
1296 PUBLIC S16 KwUiCkwCfgCfm
1297 (
1298 Pst            *pst,                      /* post structure */
1299 SuId           suId,                      /* Service User Id */
1300 CkwCfgCfmInfo  *cfmInfo                    /* Configuration Confirm */
1301 )
1302 #else
1303 PUBLIC S16 KwUiCkwCfgCfm(pst, suId, cfmInfo)
1304 Pst            *pst;                      /* post structure */
1305 SuId           suId;                      /* Service User Id */
1306 CkwCfgCfmInfo  *cfmInfo;                   /* Configuration Confirm */
1307 #endif
1308 {
1309    TRC3(KwUiCkwCfgCfm)
1310
1311    /* jump to specific primitive depending on configured selector */
1312    (*kwUiCkwCfgCfmMt[pst->selector])(pst, suId, cfmInfo);
1313
1314    RETVALUE(ROK);
1315
1316 } /* end of KwUiCkwCfgCfm */
1317
1318 \f
1319 /**
1320  *
1321  * @brief 
1322  *
1323  *        Handler for sending a configuration for UE ID change.
1324  *
1325  * @b Description:
1326  *
1327  *        This function is used by RLC to send a configuration
1328  *        confirm for UE ID change.
1329  *
1330  *  @param[in] pst      Post structure  
1331  *  @param[in] suId     Service User Id
1332  *  @param[in] transId  Transaction Id 
1333  *  @param[in] cfmInfo  Config Confirmation Info 
1334  *
1335  *  @return  S16
1336  *      -# ROK 
1337  *
1338  */
1339 #ifdef ANSI
1340 PUBLIC S16 KwUiCkwUeIdChgCfm 
1341 (
1342 Pst            *pst,                      /* post structure */
1343 SuId           suId,                      /* Service User Id */
1344 U32            transId,
1345 CkwUeInfo      *ueInfo,
1346 CmStatus       status
1347 )
1348 #else
1349 PUBLIC S16 KwUiCkwUeIdChgCfm(pst, suId, transId,ueInfo,status)
1350 Pst            *pst;                      /* post structure */
1351 SuId           suId;                      /* Service User Id */
1352 U32            transId;
1353 CkwUeInfo      *ueInfo;
1354 CmStatus       status;
1355 #endif
1356 {
1357    TRC3(KwUiCkwUeIdChgCfm)
1358
1359    /* jump to specific primitive depending on configured selector */
1360    (*kwUiCkwUeIdChgCfmMt[pst->selector])(pst, suId, transId, ueInfo, status);
1361
1362    RETVALUE(ROK);
1363
1364 } /* end of KwUiCkwCfgCfm */
1365
1366 \f
1367 #ifdef PTKWCKW
1368 /*************************************************************************
1369  *                         CKW Porting Functions
1370  ************************************************************************/
1371 /**
1372  *
1373  * @brief 
1374  *
1375  *        KwUiCkwBndCfm - CKW SAP bind confirm
1376  *
1377  *  @param[in] pst      - Post structure  
1378  *  @param[in] suId     - Service user SAP ID 
1379  *  @param[in] status   - Status
1380  *
1381  *  @return  S16
1382  *      -# ROK 
1383  */
1384 #ifdef ANSI
1385 PRIVATE S16 PtUiCkwBndCfm 
1386 (
1387 Pst *pst,                       /* post structure */
1388 SuId suId,                      /* Service User Id */
1389 U8 status                       /* status */
1390 )
1391 #else
1392 PRIVATE S16 PtUiCkwBndCfm(pst, suId, status)
1393 Pst *pst;                       /* post structure */
1394 SuId suId;                      /* Service User Id */
1395 U8 status;                      /* status */
1396 #endif
1397 {
1398 #if (ERRCLASS & ERRCLS_DEBUG)
1399    KwCb   *tKwCb;
1400 #endif
1401    TRC3(PtUiCkwBndCfm);
1402
1403    UNUSED(pst);
1404    UNUSED(suId);
1405    UNUSED(status);
1406
1407 #if (ERRCLASS & ERRCLS_DEBUG)
1408    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1409    {
1410       RETVALUE(RFAILED);
1411    }
1412    tKwCb = KW_GET_KWCB(pst->srcInst);
1413    RLOG0(L_ERROR, "Improper selector value");
1414 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1415
1416    RETVALUE(ROK);
1417 } /* end of PtUiCkwBndCfm */
1418
1419 \f
1420 /**
1421  *
1422  * @brief 
1423  *
1424  *        PtUiCkwCfgCfm - KWU SAP bind confirm
1425  *
1426  *  @param[in] pst      - Post structure  
1427  *  @param[in] suId     - Service user SAP ID 
1428  *  @param[in] cfmInfo  - Configuration confirm
1429  *
1430  *  @return  S16
1431  *      -# ROK 
1432  */
1433 #ifdef ANSI
1434 PUBLIC S16 PtUiCkwCfgCfm
1435 (
1436 Pst            *pst,                      /* post structure */
1437 SuId           suId,                      /* Service User Id */
1438 CkwCfgCfmInfo  *cfmInfo                    /* Configuration Confirm */
1439 )
1440 #else
1441 PUBLIC S16 PtUiCkwCfgCfm(pst, suId, cfmInfo)
1442 Pst            *pst;                      /* post structure */
1443 SuId           suId;                      /* Service User Id */
1444 CkwCfgCfmInfo  *cfmInfo;                   /* Configuration Confirm */
1445 #endif
1446 {
1447 #if (ERRCLASS & ERRCLS_DEBUG)
1448    KwCb   *tKwCb;
1449 #endif
1450    TRC3(PtUiCkwCfgCfm);
1451
1452    UNUSED(pst);
1453    UNUSED(suId);
1454    UNUSED(cfmInfo);
1455
1456 #if (ERRCLASS & ERRCLS_DEBUG)
1457    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1458    {
1459       RETVALUE(RFAILED);
1460    }
1461    tKwCb = KW_GET_KWCB(pst->srcInst);
1462    RLOG0(L_ERROR, "Improper selector value");
1463 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1464
1465    RETVALUE(ROK);
1466
1467 } /* end of PtUiCkwCfgCfm */
1468
1469 #ifdef ANSI
1470 PUBLIC S16 PtUiCkwUeIdChgCfm 
1471 (
1472 Pst            *pst,                      /* post structure */
1473 SuId           suId,                      /* Service User Id */
1474 U32            transId,
1475 CkwUeInfo      *ueInfo,
1476 CmStatus       status
1477 )
1478 #else
1479 PUBLIC S16 PtUiCkwUeIdChgCfm(pst, suId,transId,ueInfo,status)
1480 Pst            *pst;                      /* post structure */
1481 SuId           suId;                      /* Service User Id */
1482 U32            transId;
1483 CkwUeInfo      *ueInfo;
1484 CmStatus       status;
1485 #endif
1486 {
1487 #if (ERRCLASS & ERRCLS_DEBUG)
1488    KwCb   *tKwCb;
1489 #endif
1490    TRC3(PtUiCkwUeIdChgCfm);
1491
1492    UNUSED(pst);
1493    UNUSED(suId);
1494    UNUSED(transId);
1495    UNUSED(ueInfo);
1496    UNUSED(status);
1497
1498 #if (ERRCLASS & ERRCLS_DEBUG)
1499    if (pst->srcInst >= KW_MAX_RLC_INSTANCES)
1500    {
1501       RETVALUE(RFAILED);
1502    }
1503    tKwCb = KW_GET_KWCB(pst->srcInst);
1504    RLOG0(L_ERROR, "Improper selector value");
1505 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
1506
1507    RETVALUE(ROK);
1508
1509 } /* end of PtUiCkwUeIdChgCfm */
1510 #endif /* PTKWCKW */
1511
1512 #if (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF))
1513 /**
1514  *
1515  * @brief 
1516  *
1517  *        kwDlBatchProcSplit- process rbug messages
1518  *
1519  *  @return  S16
1520  *      -# ROK 
1521  */
1522 #ifdef ANSI
1523 PUBLIC S16 kwDlBatchProcSplit 
1524 (
1525 Void
1526 )
1527 #else
1528 PUBLIC S16 kwDlBatchProcSplit()
1529 Void;
1530 #endif
1531 {
1532
1533 /* Read from Ring Buffer and process PDCP packets */
1534    Void *elmIndx = NULLP;
1535    RxmBufReq *datReq = NULLP;
1536 #ifdef LTE_ADV
1537    U32 dlPktCount = 0;
1538 #endif
1539    U8 rngBufDeqIndx = 0;
1540    U32 rngBufDeqMaxCnt;
1541    U32 rngBufCurrCnt;
1542
1543    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
1544 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1545    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_RX_TO_DLRLC);
1546    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1547    {
1548       if ( rngBufCurrCnt > (6 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1549       {
1550          /* Restablishment scenario */
1551          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1552       }
1553       else
1554       {
1555          rngBufDeqMaxCnt = (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT)/2;
1556       }
1557    }
1558 #endif
1559    elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC);
1560    while(NULLP != elmIndx)
1561    {
1562       datReq = (RxmBufReq *)elmIndx;
1563       if(datReq->mBuf != NULLP)
1564       {
1565         cmUnpkKwuDatReq(KwUiKwuDatReq, &datReq->pst, datReq->mBuf);
1566       }
1567       else
1568       {
1569          RLOG0(L_ERROR, "mBuf is NULL");
1570          if(datReq->mBuf)
1571           cmUnpkKwuDatReq(KwUiKwuDatReq, &datReq->pst, datReq->mBuf);
1572
1573       }
1574       SsRngInfoTbl[SS_RNG_BUF_RX_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
1575       datReq->mBuf = NULLP;
1576       SRngIncrRIndx(SS_RNG_BUF_RX_TO_DLRLC);
1577       rngBufDeqIndx++;
1578       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
1579       {
1580          break;
1581       }
1582 #ifdef LTE_ADV
1583       {
1584         dlPktCount++;
1585         if(dlPktCount > 75)
1586         {
1587            break;
1588         }
1589       }
1590 #endif
1591       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_RX_TO_DLRLC)) == NULLP)
1592       {
1593          break;
1594       }
1595    }
1596
1597    RETVALUE(ROK);
1598 }
1599 #endif
1600
1601 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
1602 #ifdef ANSI
1603 PUBLIC S16 kwDlBatchProc
1604 (
1605 Void
1606 )
1607 #else
1608 PUBLIC S16 kwDlBatchProc()
1609 Void;
1610 #endif
1611 {
1612 /* Read from Ring Buffer and process PDCP packets */
1613
1614    U8 rngBufDeqIndx = 0;
1615    U32 rngBufDeqMaxCnt;
1616 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1617    U32 rngBufCurrCnt;
1618 #endif
1619    /* Memory regions different for BRCM and Intel */
1620    /*dstProcId,srcProcId,dstEnt,dstInst,srcEnt,srcInst,prior,route,event,region,pool,selector*/
1621 #ifdef SS_RBUF
1622    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTKW,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,1,1,0,0};
1623 #else
1624    PRIVATE Pst rlcDlRbfuPst ={1,1,ENTKW,1,ENTPJ,1,PRIOR0,RTESPEC,KWU_EVT_DAT_REQ,2,1,0,0};
1625 #endif
1626    Void *elmIndx = NULLP;
1627    KwuDatReqDetl *kwuDatReqDetl = NULLP;
1628    KwuDatReqInfo datReq;
1629
1630    rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT;
1631 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1632    rngBufCurrCnt = SGetNumElemInRng(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1633    if ( rngBufCurrCnt > (3 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1634    {
1635       if ( rngBufCurrCnt > (5 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT))
1636       {
1637          /* Restablishment scenario */
1638          rngBufDeqMaxCnt = (4 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1639       }
1640       else
1641       {
1642          rngBufDeqMaxCnt = (2 * SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT);
1643       }
1644    }
1645 #endif
1646    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1647    while(NULLP != elmIndx)
1648    {
1649       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
1650       datReq.rlcId = kwuDatReqDetl->rlcId;
1651       datReq.sduId = kwuDatReqDetl->sduId;
1652       datReq.lcType = kwuDatReqDetl->lcType;
1653       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;;//Number of pkt processed in tti
1654       if(kwuDatReqDetl->mBuf != NULLP)
1655       {
1656          KwUiKwuDatReq(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
1657       }
1658       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1659       rngBufDeqIndx++;
1660
1661       if(rngBufDeqIndx >= rngBufDeqMaxCnt)
1662       {
1663          break;
1664       }
1665       elmIndx = (Void *)SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1666    }
1667
1668    RETVALUE(ROK);
1669 }
1670
1671
1672 #ifdef ANSI
1673 PUBLIC S16 kwUtlDlBatchProcPkts
1674 (
1675 Void
1676 )
1677 #else
1678 PUBLIC S16 kwUtlDlBatchProcPkts
1679 Void;
1680 #endif
1681 {
1682     kwDlBatchProc();
1683 #ifdef SS_RBUF
1684 #ifdef LTE_L2_MEAS
1685     kwUtlDlBatchProcHqStaInd();
1686 #endif
1687     kwUtlFreeDlMem();
1688 #endif
1689     RETVALUE(ROK);
1690 }   
1691
1692
1693 #ifdef ANSI
1694 PUBLIC S16 kwUtlDlFreeRlcRBuf
1695 (
1696 Void
1697 )
1698 #else
1699 PUBLIC S16 kwUtlDlFreeRlcRBuf
1700 Void;
1701 #endif
1702 {
1703 /* Read from Ring Buffer and process PDCP packets */
1704    Void *elmIndx = NULLP;
1705    KwuDatReqDetl *kwuDatReqDetl = NULLP;
1706    /* Free SS_RNG_BUF_DLPDCP_TO_DLRLC  */
1707    elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1708    while(NULLP != elmIndx)
1709    {
1710       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
1711       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
1712       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;
1713       SPutMsg(kwuDatReqDetl->mBuf);
1714       elmIndx = NULLP;
1715       kwuDatReqDetl = NULLP;
1716       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC)) == NULLP)
1717       break;
1718    }
1719    RETVALUE(ROK);
1720 }
1721
1722
1723 #endif 
1724 #ifdef __cplusplus
1725 }
1726 #endif /* __cplusplus */
1727 /********************************************************************30**
1728          End of file
1729 **********************************************************************/