1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /************************************************************************
21 Name: LTE-RLC ULDL Interface
25 Desc: C source code for INF Interface Module
29 **********************************************************************/
31 /** @file kw_udx_ptul.c
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 */
43 #include "kw.h" /* RLC defines */
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 */
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 ));
69 static S16 PtUlUdxBndReq
71 Pst *pst, /* post structure */
72 SuId suId, /* Service User Id */
73 SpId spId /* Status */
76 static S16 PtUlUdxBndReq(pst, suId,spId)
77 Pst *pst; /* post structure */
78 SuId suId; /* Service User Id */
79 SpId spId; /* Status */
85 } /* end of rlcDlUdxBndReq */
91 * Handler for confirming the bind request received from KWU
96 * This function send the bind confirm primitive to the RLC user,
97 * when it receives a bind request from its service user.
99 * @param[in] pst Post structure
100 * @param[in] suId Service user SAP ID
101 * @param[in] status Status of Confirmation
108 static S16 PtUlUdxUbndReq
110 Pst *pst, /* post structure */
111 SpId spId, /* Service User Id */
112 Reason reason /* Status */
115 static S16 PtUlUdxUbndReq(pst, suId, status)
116 Pst *pst; /* post structure */
117 SpId spId; /* Service User Id */
118 Reason Reason; /* Status */
124 } /* end of PtDlUdxBndReq */
127 static S16 PtUlUdxCfgReq
129 Pst *pst, /* post structure */
130 SpId spId, /* Service User Id */
131 RlcCfgInfo *cfmInfo /* Config Info */
134 static S16 PtUlUdxCfgReq(pst, spId, status)
135 Pst *pst; /* post structure */
136 SpId spId; /* Service User Id */
137 RlcCfgInfo *cfmInfo; /* Config Info */
143 } /* end of rlcDlUdxCfgReq */
146 static S16 PtUlUdxUeIdChgReq
148 Pst *pst, /* post structure */
149 SpId spId, /* Service User Id */
150 uint32_t transId, /* transaction Id */
151 CkwUeInfo *ueInfo, /* Config Info */
152 CkwUeInfo *newUeInfo /* Config Info */
155 static S16 PtUlUdxUeIdChgReq(pst, spId,transId, ueInfo, newUeInfo)
156 Pst *pst; /* post structure */
157 SpId spId; /* Service User Id */
158 uint32_t transId; /* transaction Id */
159 CkwUeInfo *ueInfo; /* Config Info */
160 CkwUeInfo *newUeInfo; /* Config Info */
166 } /* end of rlcDlUdxCfgReq */
169 static S16 PtUlUdxStaPduReq
174 RlcUdxDlStaPdu *pStaPdu
182 * @brief Request from ULM to DLM for UE Status
186 * Function : KwUdxUdxStatUpd
188 * @param[in] Pst* pst
194 static S16 PtUlUdxStaUpdReq
199 RlcUdxStaPdu *pStaPdu
202 static S16 PtUlUdxStaUpdReq(pst, rlcId, pStaPdu)
206 RlcUdxDlStaPdu *pStaPdu;
211 } /* end of RlcUlmDlmStaUpd*/
215 * @brief Request from ULM to DLM for Measurement
219 * Function : KwUdxUdxL2MeasReq
221 * @param[in] Pst* pst
227 static S16 PtUlUdxL2MeasReq
230 RlcL2MeasReqEvt *measReqEvt
233 static S16 PtUlUdxL2MeasReq(pst, measReqEvt )
235 RlcL2MeasReqEvt *measReqEvt;
243 * @brief Request from ULM to DLM for Measurement
247 * Function : KwUdxUdxL2MeasSendReq
249 * @param[in] Pst* pst
255 static S16 PtUlUdxL2MeasSendReq
261 static S16 PtUlUdxL2MeasSendReq(pst, status )
271 * @brief Request from ULM to DLM for Measurement
275 * Function : KwUdxUdxL2MeasStopReq
277 * @param[in] Pst* pst
283 static S16 PtUlUdxL2MeasStopReq
289 static S16 PtUlUdxL2MeasStopReq(pst, status )
300 static UdxBndReq rlcUlUdxBndReqMt[] =
303 cmPkUdxBndReq, /* 0 - loosely coupled */
305 PtUlUdxBndReq, /* 0 - loosely coupled, portable */
306 #endif /* LCKWUIKWU */
308 cmPkUdxBndReq, /* 1 - loosely coupled */
310 PtUlUdxBndReq, /* 1 - loosely coupled, portable */
311 #endif /* LCKWUIKWU */
313 rlcDlUdxBndReq, /* 2 - tightly coupled, RRC */
315 PtUlUdxBndReq, /* 2 - tightly coupled, portable */
319 static UdxUbndReq rlcUlUdxUbndReqMt[] =
322 cmPkUdxUbndReq, /* 0 - loosely coupled */
324 PtUlUdxUbndReq, /* 0 - loosely coupled, portable */
325 #endif /* LCKWUIKWU */
327 cmPkUdxUbndReq, /* 1 - loosely coupled */
329 PtUlUdxUbndReq, /* 1 - loosely coupled, portable */
330 #endif /* LCKWUIKWU */
332 rlcDlUdxUbndReq, /* 2 - tightly coupled, RRC */
334 PtUlUdxUbndReq, /* 2 - tightly coupled, portable */
339 static UdxCfgReq rlcUlUdxCfgReqMt[] =
342 cmPkUdxCfgReq, /* 0 - loosely coupled */
344 PtUlUdxCfgReq, /* 0 - loosely coupled, portable */
345 #endif /* LCKWUIKWU */
347 cmPkUdxCfgReq, /* 1 - loosely coupled */
349 PtUlUdxCfgReq, /* 1 - loosely coupled, portable */
350 #endif /* LCKWUIKWU */
352 rlcDlUdxCfgReq, /* 2 - tightly coupled, RRC */
354 PtUlUdxCfgReq, /* 2 - tightly coupled, portable */
358 static UdxUeIdChgReq rlcUlUdxUeIdChgReqMt[] =
361 cmPkUdxUeIdChgReq, /* 0 - loosely coupled */
363 PtUlUdxUeIdChgReq, /* 0 - loosely coupled, portable */
364 #endif /* LCKWUIKWU */
366 cmPkUdxUeIdChgReq, /* 1 - loosely coupled */
368 PtUlUdxUeIdChgReq, /* 1 - loosely coupled, portable */
369 #endif /* LCKWUIKWU */
371 rlcDlUdxUeIdChgReq, /* 2 - tightly coupled, RRC */
373 PtUlUdxUeIdChgReq, /* 2 - tightly coupled, portable */
378 static const UdxStaUpdReq rlcUlUdxStaUpdReqMt[RLC_MAX_UDX] =
381 cmPkUdxStaUpdReq, /* 0 - loosely coupled */
383 PtUlUdxStaUpdReq, /* 0 - loosely coupled, portable */
384 #endif /* LCKWUIKWU */
386 cmPkUdxStaUpdReq, /* 1 - loosely coupled */
388 PtUlUdxStaUpdReq, /* 1 - loosely coupled, portable */
389 #endif /* LCKWUIKWU */
391 rlcDlUdxStaUpdReq, /* 2 - tightly coupled, RRC */
393 PtUlUdxStaUpdReq, /* 2 - tightly coupled, portable */
397 static const UdxStaPduReq rlcUlUdxStaPduReqMt[RLC_MAX_UDX] =
400 cmPkUdxStaPduReq, /* 0 - loosely coupled */
402 PtUlUdxStaPduReq, /* 0 - loosely coupled, portable */
403 #endif /* LCKWUIKWU */
405 cmPkUdxStaPduReq, /* 1 - loosely coupled */
407 PtUlUdxStaPduReq, /* 1 - loosely coupled, portable */
408 #endif /* LCKWUIKWU */
410 rlcDlUdxStaPduReq, /* 2 - tightly coupled, RRC */
412 PtUlUdxStaPduReq, /* 2 - tightly coupled, portable */
416 static const UdxL2MeasReq rlcUlUdxL2MeasReqMt[RLC_MAX_UDX] =
419 cmPkUdxL2MeasReq, /* 0 - loosely coupled */
421 PtUlUdxL2MeasReq, /* 0 - loosely coupled, portable */
422 #endif /* LCKWUIKWU */
424 cmPkUdxL2MeasReq, /* 1 - loosely coupled */
426 PtUlUdxL2MeasReq, /* 1 - loosely coupled, portable */
427 #endif /* LCKWUIKWU */
429 rlcDlUdxL2MeasReq, /* 2 - tightly coupled, RRC */
431 PtUlUdxL2MeasReq, /* 2 - tightly coupled, portable */
435 static const UdxL2MeasSendReq rlcUlUdxL2MeasSendReqMt[RLC_MAX_UDX] =
438 cmPkUdxL2MeasSendReq, /* 0 - loosely coupled */
440 PtUlUdxL2MeasSendReq, /* 0 - loosely coupled, portable */
441 #endif /* LCKWUIKWU */
443 cmPkUdxL2MeasSendReq, /* 1 - loosely coupled */
445 PtUlUdxL2MeasSendReq, /* 1 - loosely coupled, portable */
446 #endif /* LCKWUIKWU */
448 rlcDlUdxL2MeasSendReq, /* 2 - tightly coupled, RRC */
450 PtUlUdxL2MeasSendReq, /* 2 - tightly coupled, portable */
454 static const UdxL2MeasStopReq rlcUlUdxL2MeasStopReqMt[RLC_MAX_UDX] =
457 cmPkUdxL2MeasStopReq, /* 0 - loosely coupled */
459 PtUlUdxL2MeasStopReq, /* 0 - loosely coupled, portable */
460 #endif /* LCKWUIKWU */
462 cmPkUdxL2MeasStopReq, /* 1 - loosely coupled */
464 PtUlUdxL2MeasStopReq, /* 1 - loosely coupled, portable */
465 #endif /* LCKWUIKWU */
467 rlcDlUdxL2MeasStopReq, /* 2 - tightly coupled, RRC */
469 PtUlUdxL2MeasStopReq, /* 2 - tightly coupled, portable */
477 * Handler for confirming the bind request received from KWU
482 * This function send the bind confirm primitive to the RLC user,
483 * when it receives a bind request from its service user.
485 * @param[in] pst Post structure
486 * @param[in] suId Service user SAP ID
487 * @param[in] status Status of Confirmation
496 Pst *pst, /* post structure */
497 SuId suId, /* Service User Id */
498 SpId spId /* Status */
501 S16 rlcUlUdxBndReq(pst, suId, status)
502 Pst *pst; /* post structure */
503 SuId suId; /* Service User Id */
504 SpId spId; /* Status */
507 /* jump to specific primitive depending on configured selector */
508 (*rlcUlUdxBndReqMt[pst->selector])(pst, suId, spId);
512 } /* end of rlcDlUdxBndReq */
518 * Handler for confirming the bind request received from KWU
523 * This function send the bind confirm primitive to the RLC user,
524 * when it receives a bind request from its service user.
526 * @param[in] pst Post structure
527 * @param[in] suId Service user SAP ID
528 * @param[in] status Status of Confirmation
537 Pst *pst, /* post structure */
538 SpId spId, /* Service User Id */
539 Reason reason /* Status */
542 S16 rlcUlUdxUbndReq(pst, suId, status)
543 Pst *pst; /* post structure */
544 SpId spId; /* Service User Id */
545 Reason Reason; /* Status */
548 /* jump to specific primitive depending on configured selector */
549 (*rlcUlUdxUbndReqMt[pst->selector])(pst, spId,reason );
553 } /* end of rlcDlUdxBndReq */
558 Pst *pst, /* post structure */
559 SpId spId, /* Service User Id */
560 RlcCfgInfo *cfmInfo /* Config Info */
563 S16 rlcUlUdxCfgReq(pst, suId, status)
564 Pst *pst; /* post structure */
565 SuId spId; /* Service User Id */
566 RlcCfgInfo *cfmInfo; /* Config Info */
570 /* jump to specific primitive depending on configured selector */
571 (*rlcUlUdxCfgReqMt[pst->selector])(pst, spId, cfmInfo);
575 } /* end of rlcDlUdxCfgReq */
578 S16 rlcUlUdxUeIdChgReq
580 Pst *pst, /* post structure */
581 SpId spId, /* Service User Id */
582 uint32_t transId, /* transaction Id */
583 CkwUeInfo *ueInfo, /* Config Info */
584 CkwUeInfo *newUeInfo /* Config Info */
587 S16 rlcUlUdxUeIdChgReq(pst, spId,transId, ueInfo, newUeInfo)
588 Pst *pst; /* post structure */
589 SpId spId; /* Service User Id */
590 uint32_t transId; /* transaction Id */
591 CkwUeInfo *ueInfo; /* Config Info */
592 CkwUeInfo *newUeInfo; /* Config Info */
596 /* jump to specific primitive depending on configured selector */
597 (*rlcUlUdxUeIdChgReqMt[pst->selector])(pst, spId,transId,ueInfo,newUeInfo);
601 } /* end of rlcDlUdxCfgReq */
605 uint8_t rlcUlUdxStaPduReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxDlStaPdu *pStaPdu)
607 return ((*rlcUlUdxStaPduReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
611 * @brief Request from ULM to DLM for UE Status
615 * Function : KwUdxUdxStatUpd
617 * @param[in] Pst* pst
622 uint8_t rlcUlUdxStaUpdReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxStaPdu *pStaPdu)
624 return ((*rlcUlUdxStaUpdReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
625 } /* end of RlcUlmDlmStaUpd*/
629 * @brief Request from ULM to DLM for MeasReq
633 * Function : rlcUlUdxL2MeasReq
635 * @param[in] Pst* pst
641 S16 rlcUlUdxL2MeasReq
644 RlcL2MeasReqEvt *measReqEvt
647 S16 rlcUlUdxL2MeasReq(pst,measReqEvt)
649 RlcL2MeasReqEvt *measReqEvt;
653 return ((*rlcUlUdxL2MeasReqMt[pst->selector])(pst,measReqEvt));
654 } /* end of rlcUlUdxL2MeasReq*/
657 * @brief Request from ULM to DLM for MeasSendReq
661 * Function : rlcUlUdxMeasSendReq
663 * @param[in] Pst* pst
669 S16 rlcUlUdxL2MeasSendReq
675 S16 rlcUlUdxL2MeasSendReq(pst,measReqEvt)
681 return ((*rlcUlUdxL2MeasSendReqMt[pst->selector])(pst,measType));
682 } /* end of rlcUlUdxMesReq*/
685 * @brief Request from ULM to DLM for MeasStopReq
689 * Function : rlcUlUdxL2MeasStopReq
691 * @param[in] Pst* pst
697 S16 rlcUlUdxL2MeasStopReq
703 S16 rlcUlUdxL2MeasStopReq(pst,measReqEvt)
709 return ((*rlcUlUdxL2MeasStopReqMt[pst->selector])(pst,measType));
710 } /* end of rlcUlUdxMesReq*/
712 /**********************************************************************
715 **********************************************************************/