Initial commit
[o-du/l2.git] / src / 5gnrrlc / kw_udx_ptdl.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /************************************************************************
20  
21      Name:     LTE-RLC ULDL Interface
22   
23      Type:     C source file
24   
25      Desc:     C source code for INF Interface Module 
26   
27      File:     kw_udx_ptdl.c
28   
29 **********************************************************************/
30
31 /** @file kw_udx_ptdl.c
32 */
33
34 /* header include files (.h) */
35 #include "envopt.h"        /* environment options */
36 #include "envdep.h"        /* environment dependent */
37 #include "envind.h"        /* environment independent */
38
39 #include "gen.h"           /* general */
40 #include "ssi.h"           /* system services */
41 #include "cm5.h"           /* common timer defines */
42 #include "cm_tkns.h"       /* common tokens defines */
43 #include "cm_mblk.h"       /* common memory allocation library defines */
44 #include "cm_llist.h"      /* common link list  defines  */
45 #include "cm_hash.h"       /* common hash list  defines */
46 #include "cm_lte.h"        /* common LTE defines */
47 #include "lkw.h"           /* LKW defines */
48 #include "ckw.h"           /* CKW defines */
49 #include "kwu.h"           /* KWU defines */
50 #include "rgu.h"           /* RGU defines */
51 #include "kw_err.h"        /* Err defines */
52 #include "kw_env.h"        /* RLC environment options */
53
54 #include "kw.h"            /* RLC defines */
55 #include "kw_udx.h"
56 #include "kw_dl.h"
57
58
59 /* extern (.x) include files */
60 #include "gen.x"           /* general */
61 #include "ssi.x"           /* system services */
62
63 #include "cm5.x"           /* common timer library */
64 #include "cm_tkns.x"       /* common tokens */
65 #include "cm_mblk.x"       /* common memory allocation */
66 #include "cm_llist.x"      /* common link list */
67 #include "cm_hash.x"       /* common hash list */
68 #include "cm_lte.x"        /* common LTE includes */
69 #include "cm_lib.x"        /* common memory allocation library */
70 #include "lkw.x"           /* LKW */
71 #include "ckw.x"           /* CKW */
72 #include "kwu.x"           /* KWU */
73 #include "rgu.x"           /* RGU */
74
75 #include "kw.x"
76 #include "kw_udx.x"
77 #include "kw_dl.x"
78
79
80 #define UDX_MAX_SEL   3
81
82 #ifndef LCKWULUDX
83 PRIVATE S16 PtDlUdxBndCfm ARGS(( Pst *pst,SuId suId,U8 status ));
84 PRIVATE S16 PtDlUdxCfgCfm ARGS((Pst *pst, SuId suId, CkwCfgCfmInfo *cfmInfo));
85 PRIVATE S16 PtDlUdxUeIdChgCfm ARGS(( Pst *pst, SuId suId,U32 transId, 
86                                      CmStatus status));
87 PRIVATE S16  PtDlUdxStaUpdCfm ARGS(( Pst* pst,SuId suId,CmLteRlcId *rlcId,
88                               KwUdxBufLst *pBufLst));
89
90 /* UDX Bind Confirm primitive */
91 /**
92  *
93  * @brief 
94  *
95  *        Handler for confirming  the bind request received from KWU
96  *        interface.
97  *
98  * @b Description:
99  *
100  *        This function send the bind confirm primitive to the RLC user,
101  *        when it receives a bind request from its service user.
102  *
103  *  @param[in] pst     Post structure  
104  *  @param[in] suId    Service user SAP ID 
105  *  @param[in] status  Status of Confirmation 
106  *
107  *  @return  S16
108  *      -# ROK 
109  *
110  */
111 #ifdef ANSI
112 PRIVATE S16 PtDlUdxBndCfm
113 (
114 Pst *pst,                       /* post structure */
115 SuId suId,                      /* Service User Id */
116 U8   status                     /* Status */
117 )
118 #else
119 PRIVATE S16 PtDlUdxBndCfm(pst, suId, status)
120 Pst *pst;                       /* post structure */
121 SuId suId;                      /* Service User Id */
122 U8   status;                    /* Status */
123 #endif
124 {
125    TRC3(PtDlUdxBndCfm)
126
127    RETVALUE(ROK);
128
129 } /* end of KwDlUdxBndCfm */
130
131
132
133 /**
134  *
135  * @brief 
136  *
137  *        Handler for confirming  the bind request received from KWU
138  *        interface.
139  *
140  * @b Description:
141  *
142  *        This function send the bind confirm primitive to the RLC user,
143  *        when it receives a bind request from its service user.
144  *
145  *  @param[in] pst     Post structure  
146  *  @param[in] suId    Service user SAP ID 
147  *  @param[in] status  Status of Confirmation 
148  *
149  *  @return  S16
150  *      -# ROK 
151  *
152  */
153 #ifdef ANSI
154 PRIVATE S16 PtDlUdxCfgCfm
155 (
156 Pst *pst,                       /* post structure */
157 SuId suId,                      /* Service User Id */
158 CkwCfgCfmInfo *cfmInfo                    /* Status */
159 )
160 #else
161 PRIVATE S16 PtDlUdxCfgCfm(pst, suId, status)
162 Pst           *pst;            /* post structure */
163 SuId          suId;            /* Service User Id */
164 CkwCfgCfmInfo *cfmInfo;        /* Status */
165 #endif
166 {
167    TRC3(PtDlUdxCfgCfm)
168
169    RETVALUE(ROK);
170
171 } /* end of KwDlUdxBndCfm */
172
173 /**
174  *
175  * @brief 
176  *
177  *        Handler for confirming  the bind request received from KWU
178  *        interface.
179  *
180  * @b Description:
181  *
182  *        This function send the bind confirm primitive to the RLC user,
183  *        when it receives a bind request from its service user.
184  *
185  *  @param[in] pst     Post structure  
186  *  @param[in] suId    Service user SAP ID 
187  *  @param[in] status  Status of Confirmation 
188  *
189  *  @return  S16
190  *      -# ROK 
191  *
192  */
193 #ifdef ANSI
194 PRIVATE S16 PtDlUdxUeIdChgCfm
195 (
196 Pst *pst,                       /* post structure */
197 SuId suId,                      /* Service User Id */
198 U32       transId,
199 CmStatus      status
200 )
201 #else
202 PRIVATE S16 PtDlUdxUeIdChgCfm(pst, suId, status)
203 Pst           *pst;            /* post structure */
204 SuId          suId;            /* Service User Id */
205 U32           transId;
206 CmStatus      status;
207 #endif
208 {
209    TRC3(PtDlUdxUeIdChgCfm)
210
211    RETVALUE(ROK);
212
213 } /* end of KwDlUdxBndCfm */
214
215
216
217 PRIVATE S16  PtDlUdxStaUpdCfm
218 (
219 Pst*                pst,
220 SuId                suId,
221 CmLteRlcId          *rlcId,
222 KwUdxBufLst         *pBufLst
223 )
224 {
225    TRC3(PtDlUdxStaUpdCfm);
226    RETVALUE(ROK);
227 }
228
229 PRIVATE S16  PtDlUdxStaProhTmrStart
230 (
231 Pst*                pst,
232 SuId                suId,
233 CmLteRlcId          *rlcId
234 )
235 {
236    TRC3(PtDlUdxStaProhTmrStart);
237    RETVALUE(ROK);
238 }
239 #endif
240
241 PRIVATE UdxBndCfm kwDlUdxBndCfmMt[UDX_MAX_SEL] =
242 {
243 #ifdef LCKWULUDX
244    cmPkUdxBndCfm,            /* 0 - loosely coupled */
245 #else
246    PtDlUdxBndCfm,            /* 0 - loosely coupled, portable  */
247 #endif /* LCKWUIKWU */
248 #ifdef LWLCKWULUDX
249    cmPkUdxBndCfm,            /* 1 - loosely coupled */
250 #else
251    PtDlUdxBndCfm,            /* 1 - loosely coupled, portable  */
252 #endif /* LCKWUIKWU */
253 #ifdef KW
254    KwUlUdxBndCfm,            /* 2 - tightly coupled, RRC  */
255 #else
256    PtDlUdxBndCfm,            /* 2 - tightly coupled, portable */
257 #endif /* KW */
258 };
259
260 PUBLIC UdxCfgCfm kwDlUdxCfgCfmMt[UDX_MAX_SEL] =
261 {
262 #ifdef LCKWULUDX
263    cmPkUdxCfgCfm,            /* 0 - loosely coupled */
264 #else
265    PtDlUdxCfgCfm,            /* 0 - loosely coupled, portable  */
266 #endif /* LCKWUIKWU */
267 #ifdef LWLCKWULUDX
268    cmPkUdxCfgCfm,            /* 1 - loosely coupled */
269 #else
270    PtDlUdxCfgCfm,            /* 1 - loosely coupled, portable  */
271 #endif /* LCKWUIKWU */
272 #ifdef KW
273    KwUlUdxCfgCfm,            /* 2 - tightly coupled, RRC  */
274 #else
275    PtDlUdxCfgCfm,            /* 2 - tightly coupled, portable */
276 #endif /* KW */
277 };
278
279 PUBLIC UdxUeIdChgCfm kwDlUdxUeIdChgCfmMt[UDX_MAX_SEL] =
280 {
281 #ifdef LCKWULUDX
282    cmPkUdxUeIdChgCfm,            /* 0 - loosely coupled */
283 #else
284    PtDlUdxUeIdChgCfm,            /* 0 - loosely coupled, portable  */
285 #endif /* LCKWUIKWU */
286 #ifdef LWLCKWULUDX
287    cmPkUdxUeIdChgCfm,            /* 1 - loosely coupled */
288 #else
289    PtDlUdxUeIdChgCfm,            /* 1 - loosely coupled, portable  */
290 #endif /* LCKWUIKWU */
291 #ifdef KW
292    KwUlUdxUeIdChgCfm,            /* 2 - tightly coupled, RRC  */
293 #else
294    PtDlUdxUeIdChgCfm,            /* 2 - tightly coupled, portable */
295 #endif /* KW */
296 };
297
298
299 PRIVATE CONSTANT UdxStaProhTmrStart KwDlUdxStaProhTmrStartMt[UDX_MAX_SEL] =
300 {
301 #ifdef LCKWULUDX
302    cmPkUdxStaProhTmrStart,
303 #else
304    PtDlUdxStaProhTmrStart,
305 #endif
306 #ifdef LWLCKWULUDX
307    cmPkUdxStaProhTmrStart,            /* 1 - loosely coupled */
308 #else
309    PtDlUdxStaProhTmrStart,            /* 1 - loosely coupled, portable  */
310 #endif /* LCKWUIKWU */
311 #ifdef KW
312    KwUlUdxStaProhTmrStart,            /* 2 - tightly coupled, RRC  */
313 #else
314    PtDlUdxStaProhTmrStart,            /* 2 - tightly coupled, portable */
315 #endif /* KW */
316 };
317
318 /**
319  *
320  * @brief 
321  *
322  *        Handler for confirming  the bind request received from KWU
323  *        interface.
324  *
325  * @b Description:
326  *
327  *        This function send the bind confirm primitive to the RLC user,
328  *        when it receives a bind request from its service user.
329  *
330  *  @param[in] pst     Post structure  
331  *  @param[in] suId    Service user SAP ID 
332  *  @param[in] status  Status of Confirmation 
333  *
334  *  @return  S16
335  *      -# ROK 
336  *
337  */
338 #ifdef ANSI
339 PUBLIC S16 KwDlUdxBndCfm
340 (
341 Pst *pst,                       /* post structure */
342 SuId suId,                      /* Service User Id */
343 U8   status                     /* Status */
344 )
345 #else
346 PUBLIC S16 KwDlUdxBndCfm(pst, suId, status)
347 Pst *pst;                       /* post structure */
348 SuId suId;                      /* Service User Id */
349 U8   status;                    /* Status */
350 #endif
351 {
352    TRC3(KwDlUdxBndCfm)
353
354    /* jump to specific primitive depending on configured selector */
355    (*kwDlUdxBndCfmMt[pst->selector])(pst, suId, status);
356
357    RETVALUE(ROK);
358
359 } /* end of KwDlUdxBndCfm */
360
361
362
363 /**
364  *
365  * @brief 
366  *
367  *        Handler for confirming  the bind request received from KWU
368  *        interface.
369  *
370  * @b Description:
371  *
372  *        This function send the bind confirm primitive to the RLC user,
373  *        when it receives a bind request from its service user.
374  *
375  *  @param[in] pst     Post structure  
376  *  @param[in] suId    Service user SAP ID 
377  *  @param[in] status  Status of Confirmation 
378  *
379  *  @return  S16
380  *      -# ROK 
381  *
382  */
383 #ifdef ANSI
384 PUBLIC S16 KwDlUdxCfgCfm
385 (
386 Pst *pst,                       /* post structure */
387 SuId suId,                      /* Service User Id */
388 CkwCfgCfmInfo *cfmInfo                    /* Status */
389 )
390 #else
391 PUBLIC S16 KwDlUdxCfgCfm(pst, suId, status)
392 Pst           *pst;            /* post structure */
393 SuId          suId;            /* Service User Id */
394 CkwCfgCfmInfo *cfmInfo;        /* Status */
395 #endif
396 {
397    TRC3(KwDlUdxCfgCfm)
398
399    /* jump to specific primitive depending on configured selector */
400    (*kwDlUdxCfgCfmMt[pst->selector])(pst, suId, cfmInfo);
401
402    RETVALUE(ROK);
403
404 } /* end of KwDlUdxBndCfm */
405
406 /**
407  *
408  * @brief 
409  *
410  *        Handler for confirming  the bind request received from KWU
411  *        interface.
412  *
413  * @b Description:
414  *
415  *        This function send the bind confirm primitive to the RLC user,
416  *        when it receives a bind request from its service user.
417  *
418  *  @param[in] pst     Post structure  
419  *  @param[in] suId    Service user SAP ID 
420  *  @param[in] status  Status of Confirmation 
421  *
422  *  @return  S16
423  *      -# ROK 
424  *
425  */
426 #ifdef ANSI
427 PUBLIC S16 KwDlUdxUeIdChgCfm
428 (
429 Pst *pst,                       /* post structure */
430 SuId suId,                      /* Service User Id */
431 U32           transId,
432 CmStatus      status
433 )
434 #else
435 PUBLIC S16 KwDlUdxUeIdChgCfm(pst, suId, status)
436 Pst           *pst;            /* post structure */
437 SuId          suId;            /* Service User Id */
438 U32           transId;
439 CmStatus      status;
440 #endif
441 {
442    TRC3(KwDlUdxUeIdChgCfm)
443
444    /* jump to specific primitive depending on configured selector */
445    (*kwDlUdxUeIdChgCfmMt[pst->selector])(pst, suId,transId,status);
446
447    RETVALUE(ROK);
448
449 } /* end of KwDlUdxBndCfm */
450
451
452
453 #ifdef ANSI
454 PUBLIC S16 KwDlUdxStaProhTmrStart
455 (
456 Pst                 *pst,                       /* post structure */
457 SuId                suId,                      /* Service User Id */
458 CmLteRlcId          *rlcId
459 )
460 #else
461 PUBLIC S16 KwDlUdxStaProhTmrStart(pst, suId, rlcId)
462 Pst           *pst;            /* post structure */
463 SuId          suId;            /* Service User Id */
464 CmLteRlcId    *rlcId;
465 #endif
466 {
467    TRC3(KwDlUdxStaProhTmrStart)
468
469    /* jump to specific primitive depending on configured selector */
470    (*KwDlUdxStaProhTmrStartMt[pst->selector])(pst, suId, rlcId);
471
472    RETVALUE(ROK);
473
474 } /* end of KwDlUdxBndCfm */
475
476 /**********************************************************************
477  
478          End of file
479 **********************************************************************/