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