c6e6cca50d52b9a9ed1c419c525a1faefbdf719e
[o-du/l2.git] / src / 5gnrrlc / kw_udx_ptul.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_ptul.c
28   
29 **********************************************************************/
30
31 /** @file kw_udx_ptul.c
32 */
33
34 /* header include files (.h) */
35 #include "common_def.h"
36 #include "lkw.h"           /* LKW defines */
37 #include "ckw.h"           /* CKW defines */
38 #include "kwu.h"           /* KWU defines */
39 #include "rgu.h"           /* RGU defines */
40 #include "kw_err.h"        /* Err defines */
41 #include "kw_env.h"        /* RLC environment options */
42
43 #include "kw.h"            /* RLC defines */
44 #include "kw_udx.h"
45 #include "kw_dl.h"
46
47 /* extern (.x) include files */
48 #include "lkw.x"           /* LKW */
49 #include "ckw.x"           /* CKW */
50 #include "kwu.x"           /* KWU */
51 #include "rgu.x"           /* RGU */
52
53 #include "kw.x"
54 #include "kw_udx.x"
55 #include "kw_dl.x"
56
57
58 #ifndef LCKWULUDX
59 static S16 PtUlUdxBndReq ARGS((Pst* pst, SuId suId,SpId  spId ));
60 static S16 PtUlUdxUbndReq ARGS((Pst* pst, SuId suId,Reason reason));
61 static S16 PtUlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
62 static S16 PtUlUdxStaUpdReq ARGS((Pst* pst,SpId spId,CmLteRlcId *rlcId,
63                                 RlcUdxStaPdu         *pStaPdu ));
64 static S16 PtUlUdxUeIdChgReq ARGS((Pst *pst, SpId spId, uint32_t transId, 
65                                    CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
66 static S16 PtUlUdxStaPduReq ARGS(( Pst* pst,SpId  spId, CmLteRlcId *rlcId,
67                              RlcUdxDlStaPdu  *pStaPdu ));
68 static S16 PtUlUdxBndReq
69 (
70 Pst *pst,                       /* post structure */
71 SuId suId,                      /* Service User Id */
72 SpId spId                    /* Status */
73 )
74 {
75
76    return ROK;
77
78 } /* end of rlcDlUdxBndReq */
79
80 /**
81  *
82  * @brief 
83  *
84  *        Handler for confirming  the bind request received from KWU
85  *        interface.
86  *
87  * @b Description:
88  *
89  *        This function send the bind confirm primitive to the RLC user,
90  *        when it receives a bind request from its service user.
91  *
92  *  @param[in] pst     Post structure  
93  *  @param[in] suId    Service user SAP ID 
94  *  @param[in] status  Status of Confirmation 
95  *
96  *  @return  S16
97  *      -# ROK 
98  *
99  */
100 static S16 PtUlUdxUbndReq
101 (
102 Pst *pst,                       /* post structure */
103 SpId spId,                      /* Service User Id */
104 Reason   reason                     /* Status */
105 )
106 {
107
108    return ROK;
109
110 } /* end of PtDlUdxBndReq */
111
112 static S16 PtUlUdxCfgReq
113 (
114 Pst *pst,                       /* post structure */
115 SpId spId,                      /* Service User Id */
116 RlcCfgInfo *cfmInfo             /* Config Info */
117 )
118 {
119
120    return ROK;
121
122 } /* end of rlcDlUdxCfgReq */
123
124 static S16 PtUlUdxUeIdChgReq
125 (
126 Pst *pst,                      /* post structure */
127 SpId spId,                     /* Service User Id */
128 uint32_t  transId,              /* transaction Id */
129 CkwUeInfo *ueInfo,             /* Config Info */
130 CkwUeInfo *newUeInfo           /* Config Info */
131 )
132 {
133
134    return ROK;
135
136 } /* end of rlcDlUdxCfgReq */
137
138
139 static S16  PtUlUdxStaPduReq
140 (
141 Pst*                pst,
142 SpId                spId,
143 CmLteRlcId          *rlcId,
144 RlcUdxDlStaPdu       *pStaPdu
145 )
146 {
147
148    return ROK;
149 }
150
151 /**
152 * @brief Request from ULM to DLM for UE Status
153 *
154 * @details
155 *
156 *     Function : KwUdxUdxStatUpd
157 *
158 *  @param[in]   Pst*           pst
159
160 *  @return   S16
161 *      -# ROK
162 **/
163 static S16  PtUlUdxStaUpdReq
164 (
165 Pst*                pst,
166 SpId                spId,
167 CmLteRlcId          *rlcId,
168 RlcUdxStaPdu       *pStaPdu
169 )
170 {
171
172    return ROK;
173 } /* end of RlcUlmDlmStaUpd*/
174
175 #ifdef LTE_L2_MEAS
176 /**
177 * @brief Request from ULM to DLM for Measurement
178 *
179 * @details
180 *
181 *     Function : KwUdxUdxL2MeasReq
182 *
183 *  @param[in]   Pst*           pst
184
185 *  @return   S16
186 *      -# ROK
187 **/
188 static S16  PtUlUdxL2MeasReq(Pst* pst,RlcL2MeasReqEvt  *measReqEvt)
189 {
190
191    return ROK;
192
193
194 /**
195 * @brief Request from ULM to DLM for Measurement
196 *
197 * @details
198 *
199 *     Function : KwUdxUdxL2MeasSendReq
200 *
201 *  @param[in]   Pst*           pst
202
203 *  @return   S16
204 *      -# ROK
205 **/
206 static S16  PtUlUdxL2MeasSendReq(Pst*  pst,uint8_t status)
207 {
208
209    return ROK;
210 }
211
212 /**
213 * @brief Request from ULM to DLM for Measurement
214 *
215 * @details
216 *
217 *     Function : KwUdxUdxL2MeasStopReq
218 *
219 *  @param[in]   Pst*           pst
220
221 *  @return   S16
222 *      -# ROK
223 **/
224 static S16  PtUlUdxL2MeasStopReq(Pst*      pst,uint8_t   status)
225 {
226
227    return ROK;
228 }
229 #endif
230 #endif
231
232 static UdxBndReq rlcUlUdxBndReqMt[] =
233 {
234 #ifdef LCKWULUDX
235    cmPkUdxBndReq,            /* 0 - loosely coupled */
236 #else
237    PtUlUdxBndReq,            /* 0 - loosely coupled, portable  */
238 #endif /* LCKWUIKWU */
239 #ifdef LWLCKWULUDX
240    cmPkUdxBndReq,            /* 1 - loosely coupled */
241 #else
242    PtUlUdxBndReq,            /* 1 - loosely coupled, portable  */
243 #endif /* LCKWUIKWU */
244 #ifdef KW
245    rlcDlUdxBndReq,            /* 2 - tightly coupled, RRC  */
246 #else
247    PtUlUdxBndReq,            /* 2 - tightly coupled, portable */
248 #endif /* KW */
249 };
250
251 static UdxUbndReq rlcUlUdxUbndReqMt[] =
252 {
253 #ifdef LCKWULUDX
254    cmPkUdxUbndReq,            /* 0 - loosely coupled */
255 #else
256    PtUlUdxUbndReq,            /* 0 - loosely coupled, portable  */
257 #endif /* LCKWUIKWU */
258 #ifdef LWLCKWULUDX
259    cmPkUdxUbndReq,            /* 1 - loosely coupled */
260 #else
261    PtUlUdxUbndReq,            /* 1 - loosely coupled, portable  */
262 #endif /* LCKWUIKWU */
263 #ifdef KW
264    rlcDlUdxUbndReq,            /* 2 - tightly coupled, RRC  */
265 #else
266    PtUlUdxUbndReq,            /* 2 - tightly coupled, portable */
267 #endif /* KW */
268 };
269
270
271 static UdxCfgReq rlcUlUdxCfgReqMt[] =
272 {
273 #ifdef LCKWULUDX
274    cmPkUdxCfgReq,            /* 0 - loosely coupled */
275 #else
276    PtUlUdxCfgReq,            /* 0 - loosely coupled, portable  */
277 #endif /* LCKWUIKWU */
278 #ifdef LWLCKWULUDX
279    cmPkUdxCfgReq,            /* 1 - loosely coupled */
280 #else
281    PtUlUdxCfgReq,            /* 1 - loosely coupled, portable  */
282 #endif /* LCKWUIKWU */
283 #ifdef KW
284    rlcDlUdxCfgReq,            /* 2 - tightly coupled, RRC  */
285 #else
286    PtUlUdxCfgReq,            /* 2 - tightly coupled, portable */
287 #endif /* KW */
288 };
289
290 static UdxUeIdChgReq rlcUlUdxUeIdChgReqMt[] =
291 {
292 #ifdef LCKWULUDX
293    cmPkUdxUeIdChgReq,            /* 0 - loosely coupled */
294 #else
295    PtUlUdxUeIdChgReq,            /* 0 - loosely coupled, portable  */
296 #endif /* LCKWUIKWU */
297 #ifdef LWLCKWULUDX
298    cmPkUdxUeIdChgReq,            /* 1 - loosely coupled */
299 #else
300    PtUlUdxUeIdChgReq,            /* 1 - loosely coupled, portable  */
301 #endif /* LCKWUIKWU */
302 #ifdef KW
303    rlcDlUdxUeIdChgReq,            /* 2 - tightly coupled, RRC  */
304 #else
305    PtUlUdxUeIdChgReq,            /* 2 - tightly coupled, portable */
306 #endif /* KW */
307 };
308
309
310 static const UdxStaUpdReq rlcUlUdxStaUpdReqMt[RLC_MAX_UDX] =
311 {
312 #ifdef LCKWULUDX
313    cmPkUdxStaUpdReq,            /* 0 - loosely coupled */
314 #else
315    PtUlUdxStaUpdReq,            /* 0 - loosely coupled, portable  */
316 #endif /* LCKWUIKWU */
317 #ifdef LWLCKWULUDX
318    cmPkUdxStaUpdReq,            /* 1 - loosely coupled */
319 #else
320    PtUlUdxStaUpdReq,            /* 1 - loosely coupled, portable  */
321 #endif /* LCKWUIKWU */
322 #ifdef KW
323    rlcDlUdxStaUpdReq,            /* 2 - tightly coupled, RRC  */
324 #else
325    PtUlUdxStaUpdReq,            /* 2 - tightly coupled, portable */
326 #endif /* KW */
327 };
328
329 static const UdxStaPduReq rlcUlUdxStaPduReqMt[RLC_MAX_UDX] =
330 {
331 #ifdef LCKWULUDX
332    cmPkUdxStaPduReq,            /* 0 - loosely coupled */
333 #else
334    PtUlUdxStaPduReq,            /* 0 - loosely coupled, portable  */
335 #endif /* LCKWUIKWU */
336 #ifdef LWLCKWULUDX
337    cmPkUdxStaPduReq,            /* 1 - loosely coupled */
338 #else
339    PtUlUdxStaPduReq,            /* 1 - loosely coupled, portable  */
340 #endif /* LCKWUIKWU */
341 #ifdef KW
342    rlcDlUdxStaPduReq,            /* 2 - tightly coupled, RRC  */
343 #else
344    PtUlUdxStaPduReq,            /* 2 - tightly coupled, portable */
345 #endif /* KW */
346 };
347 #ifdef LTE_L2_MEAS
348 static const UdxL2MeasReq rlcUlUdxL2MeasReqMt[RLC_MAX_UDX] =
349 {
350 #ifdef LCKWULUDX
351    cmPkUdxL2MeasReq,            /* 0 - loosely coupled */
352 #else
353    PtUlUdxL2MeasReq,            /* 0 - loosely coupled, portable  */
354 #endif /* LCKWUIKWU */
355 #ifdef LWLCKWULUDX
356    cmPkUdxL2MeasReq,            /* 1 - loosely coupled */
357 #else
358    PtUlUdxL2MeasReq,            /* 1 - loosely coupled, portable  */
359 #endif /* LCKWUIKWU */
360 #ifdef KW
361    rlcDlUdxL2MeasReq,            /* 2 - tightly coupled, RRC  */
362 #else
363    PtUlUdxL2MeasReq,            /* 2 - tightly coupled, portable */
364 #endif /* KW */
365 };
366
367 static const UdxL2MeasSendReq rlcUlUdxL2MeasSendReqMt[RLC_MAX_UDX] =
368 {
369 #ifdef LCKWULUDX
370    cmPkUdxL2MeasSendReq,            /* 0 - loosely coupled */
371 #else
372    PtUlUdxL2MeasSendReq,            /* 0 - loosely coupled, portable  */
373 #endif /* LCKWUIKWU */
374 #ifdef LWLCKWULUDX
375    cmPkUdxL2MeasSendReq,            /* 1 - loosely coupled */
376 #else
377    PtUlUdxL2MeasSendReq,            /* 1 - loosely coupled, portable  */
378 #endif /* LCKWUIKWU */
379 #ifdef KW
380    rlcDlUdxL2MeasSendReq,            /* 2 - tightly coupled, RRC  */
381 #else
382    PtUlUdxL2MeasSendReq,            /* 2 - tightly coupled, portable */
383 #endif /* KW */
384 };
385
386 static const UdxL2MeasStopReq rlcUlUdxL2MeasStopReqMt[RLC_MAX_UDX] =
387 {
388 #ifdef LCKWULUDX
389    cmPkUdxL2MeasStopReq,            /* 0 - loosely coupled */
390 #else
391    PtUlUdxL2MeasStopReq,            /* 0 - loosely coupled, portable  */
392 #endif /* LCKWUIKWU */
393 #ifdef LWLCKWULUDX
394    cmPkUdxL2MeasStopReq,            /* 1 - loosely coupled */
395 #else
396    PtUlUdxL2MeasStopReq,            /* 1 - loosely coupled, portable  */
397 #endif /* LCKWUIKWU */
398 #ifdef KW
399    rlcDlUdxL2MeasStopReq,            /* 2 - tightly coupled, RRC  */
400 #else
401    PtUlUdxL2MeasStopReq,            /* 2 - tightly coupled, portable */
402 #endif /* KW */
403 };
404 #endif
405 /**
406  *
407  * @brief 
408  *
409  *        Handler for confirming  the bind request received from KWU
410  *        interface.
411  *
412  * @b Description:
413  *
414  *        This function send the bind confirm primitive to the RLC user,
415  *        when it receives a bind request from its service user.
416  *
417  *  @param[in] pst     Post structure  
418  *  @param[in] suId    Service user SAP ID 
419  *  @param[in] status  Status of Confirmation 
420  *
421  *  @return  S16
422  *      -# ROK 
423  *
424  */
425 S16 rlcUlUdxBndReq
426 (
427 Pst *pst,                       /* post structure */
428 SuId suId,                      /* Service User Id */
429 SpId spId                     /* Status */
430 )
431 {
432    /* jump to specific primitive depending on configured selector */
433    (*rlcUlUdxBndReqMt[pst->selector])(pst, suId, spId);
434
435    return ROK;
436
437 } /* end of rlcDlUdxBndReq */
438
439 /**
440  *
441  * @brief 
442  *
443  *        Handler for confirming  the bind request received from KWU
444  *        interface.
445  *
446  * @b Description:
447  *
448  *        This function send the bind confirm primitive to the RLC user,
449  *        when it receives a bind request from its service user.
450  *
451  *  @param[in] pst     Post structure  
452  *  @param[in] suId    Service user SAP ID 
453  *  @param[in] status  Status of Confirmation 
454  *
455  *  @return  S16
456  *      -# ROK 
457  *
458  */
459 S16 rlcUlUdxUbndReq
460 (
461 Pst *pst,                       /* post structure */
462 SpId spId,                      /* Service User Id */
463 Reason   reason                     /* Status */
464 )
465 {
466    /* jump to specific primitive depending on configured selector */
467    (*rlcUlUdxUbndReqMt[pst->selector])(pst, spId,reason );
468
469    return ROK;
470
471 } /* end of rlcDlUdxBndReq */
472
473 S16 rlcUlUdxCfgReq
474 (
475 Pst *pst,                       /* post structure */
476 SpId spId,                      /* Service User Id */
477 RlcCfgInfo *cfmInfo             /* Config Info */
478 )
479 {
480
481    /* jump to specific primitive depending on configured selector */
482    (*rlcUlUdxCfgReqMt[pst->selector])(pst, spId, cfmInfo);
483
484    return ROK;
485
486 } /* end of rlcDlUdxCfgReq */
487
488 S16 rlcUlUdxUeIdChgReq
489 (
490 Pst *pst,                      /* post structure */
491 SpId spId,                     /* Service User Id */
492 uint32_t  transId,              /* transaction Id */
493 CkwUeInfo *ueInfo,             /* Config Info */
494 CkwUeInfo *newUeInfo           /* Config Info */
495 )
496 {
497
498    /* jump to specific primitive depending on configured selector */
499    (*rlcUlUdxUeIdChgReqMt[pst->selector])(pst, spId,transId,ueInfo,newUeInfo);
500
501    return ROK;
502
503 } /* end of rlcDlUdxCfgReq */
504
505
506
507 uint8_t rlcUlUdxStaPduReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxDlStaPdu *pStaPdu)
508 {
509    return ((*rlcUlUdxStaPduReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
510 }
511
512 /**
513 * @brief Request from ULM to DLM for UE Status
514 *
515 * @details
516 *
517 *     Function : KwUdxUdxStatUpd
518 *
519 *  @param[in]   Pst*           pst
520
521 *  @return   S16
522 *      -# ROK
523 **/
524 uint8_t rlcUlUdxStaUpdReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxStaPdu *pStaPdu)
525 {
526    return ((*rlcUlUdxStaUpdReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
527 } /* end of RlcUlmDlmStaUpd*/
528
529 #ifdef LTE_L2_MEAS
530 /**
531 * @brief Request from ULM to DLM for MeasReq 
532 *
533 * @details
534 *
535 *     Function : rlcUlUdxL2MeasReq
536 *
537 *  @param[in]   Pst*           pst
538
539 *  @return   S16
540 *      -# ROK
541 **/
542 S16  rlcUlUdxL2MeasReq(Pst* pst,RlcL2MeasReqEvt *measReqEvt )
543 {
544
545    return ((*rlcUlUdxL2MeasReqMt[pst->selector])(pst,measReqEvt));
546 } /* end of rlcUlUdxL2MeasReq*/
547
548 /**
549 * @brief Request from ULM to DLM for MeasSendReq 
550 *
551 * @details
552 *
553 *     Function : rlcUlUdxMeasSendReq
554 *
555 *  @param[in]   Pst*           pst
556
557 *  @return   S16
558 *      -# ROK
559 **/
560 S16  rlcUlUdxL2MeasSendReq(Pst* pst,uint8_t measType)
561 {
562
563    return ((*rlcUlUdxL2MeasSendReqMt[pst->selector])(pst,measType));
564 } /* end of rlcUlUdxMesReq*/
565
566 /**
567 * @brief Request from ULM to DLM for MeasStopReq 
568 *
569 * @details
570 *
571 *     Function : rlcUlUdxL2MeasStopReq
572 *
573 *  @param[in]   Pst*           pst
574
575 *  @return   S16
576 *      -# ROK
577 **/
578 S16  rlcUlUdxL2MeasStopReq(Pst*  pst,uint8_t  measType)
579 {
580
581    return ((*rlcUlUdxL2MeasStopReqMt[pst->selector])(pst,measType));
582 } /* end of rlcUlUdxMesReq*/
583 #endif
584 /**********************************************************************
585  
586          End of file
587 **********************************************************************/