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 "envopt.h" /* environment options */
36 #include "envdep.h" /* environment dependent */
37 #include "envind.h" /* environment independent */
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 */
54 #include "kw.h" /* RLC defines */
58 /* extern (.x) include files */
59 #include "gen.x" /* general */
60 #include "ssi.x" /* system services */
62 #include "cm5.x" /* common timer library */
63 #include "cm_tkns.x" /* common tokens */
64 #include "cm_mblk.x" /* common memory allocation */
65 #include "cm_llist.x" /* common link list */
66 #include "cm_hash.x" /* common hash list */
67 #include "cm_lte.x" /* common LTE includes */
68 #include "cm_lib.x" /* common memory allocation library */
69 #include "lkw.x" /* LKW */
70 #include "ckw.x" /* CKW */
71 #include "kwu.x" /* KWU */
72 #include "rgu.x" /* RGU */
80 PRIVATE S16 PtUlUdxBndReq ARGS((Pst* pst, SuId suId,SpId spId ));
81 PRIVATE S16 PtUlUdxUbndReq ARGS((Pst* pst, SuId suId,Reason reason));
82 PRIVATE S16 PtUlUdxCfgReq ARGS((Pst *pst, SpId spId, CkwCfgInfo *cfgInfo));
83 PRIVATE S16 PtUlUdxStaUpdReq ARGS((Pst* pst,SpId spId,CmLteRlcId *rlcId,
84 KwUdxStaPdu *pStaPdu ));
85 PRIVATE S16 PtUlUdxUeIdChgReq ARGS((Pst *pst, SpId spId, U32 transId,
86 CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
87 PRIVATE S16 PtUlUdxStaPduReq ARGS(( Pst* pst,SpId spId, CmLteRlcId *rlcId,
88 KwUdxDlStaPdu *pStaPdu ));
90 PRIVATE S16 PtUlUdxBndReq
92 Pst *pst, /* post structure */
93 SuId suId, /* Service User Id */
94 SpId spId /* Status */
97 PRIVATE S16 PtUlUdxBndReq(pst, suId,spId)
98 Pst *pst; /* post structure */
99 SuId suId; /* Service User Id */
100 SpId spId; /* Status */
107 } /* end of KwDlUdxBndReq */
113 * Handler for confirming the bind request received from KWU
118 * This function send the bind confirm primitive to the RLC user,
119 * when it receives a bind request from its service user.
121 * @param[in] pst Post structure
122 * @param[in] suId Service user SAP ID
123 * @param[in] status Status of Confirmation
130 PRIVATE S16 PtUlUdxUbndReq
132 Pst *pst, /* post structure */
133 SpId spId, /* Service User Id */
134 Reason reason /* Status */
137 PRIVATE S16 PtUlUdxUbndReq(pst, suId, status)
138 Pst *pst; /* post structure */
139 SpId spId; /* Service User Id */
140 Reason Reason; /* Status */
147 } /* end of PtDlUdxBndReq */
150 PRIVATE S16 PtUlUdxCfgReq
152 Pst *pst, /* post structure */
153 SpId spId, /* Service User Id */
154 CkwCfgInfo *cfmInfo /* Config Info */
157 PRIVATE S16 PtUlUdxCfgReq(pst, spId, status)
158 Pst *pst; /* post structure */
159 SpId spId; /* Service User Id */
160 CkwCfgInfo *cfmInfo; /* Config Info */
167 } /* end of KwDlUdxCfgReq */
170 PRIVATE S16 PtUlUdxUeIdChgReq
172 Pst *pst, /* post structure */
173 SpId spId, /* Service User Id */
174 U32 transId, /* transaction Id */
175 CkwUeInfo *ueInfo, /* Config Info */
176 CkwUeInfo *newUeInfo /* Config Info */
179 PRIVATE S16 PtUlUdxUeIdChgReq(pst, spId,transId, ueInfo, newUeInfo)
180 Pst *pst; /* post structure */
181 SpId spId; /* Service User Id */
182 U32 transId; /* transaction Id */
183 CkwUeInfo *ueInfo; /* Config Info */
184 CkwUeInfo *newUeInfo; /* Config Info */
187 TRC3(PtUlUdxUeIdChgReq)
192 } /* end of KwDlUdxCfgReq */
195 PRIVATE S16 PtUlUdxStaPduReq
200 KwUdxDlStaPdu *pStaPdu
203 TRC3(PtUlUdxStaPduReq);
209 * @brief Request from ULM to DLM for UE Status
213 * Function : KwUdxUdxStatUpd
215 * @param[in] Pst* pst
221 PRIVATE S16 PtUlUdxStaUpdReq
229 PRIVATE S16 PtUlUdxStaUpdReq(pst, rlcId, pStaPdu)
233 KwUdxDlStaPdu *pStaPdu;
237 TRC3(PtUlUdxStaUpdReq);
240 } /* end of KwUlmDlmStaUpd*/
244 * @brief Request from ULM to DLM for Measurement
248 * Function : KwUdxUdxL2MeasReq
250 * @param[in] Pst* pst
256 PRIVATE S16 PtUlUdxL2MeasReq
259 KwL2MeasReqEvt *measReqEvt
262 PRIVATE S16 PtUlUdxL2MeasReq(pst, measReqEvt )
264 KwL2MeasReqEvt *measReqEvt;
268 TRC3(PtUlUdxL2MeasReq);
274 * @brief Request from ULM to DLM for Measurement
278 * Function : KwUdxUdxL2MeasSendReq
280 * @param[in] Pst* pst
286 PRIVATE S16 PtUlUdxL2MeasSendReq
292 PRIVATE S16 PtUlUdxL2MeasSendReq(pst, status )
298 TRC3(PtUlUdxL2MeasSendReq);
304 * @brief Request from ULM to DLM for Measurement
308 * Function : KwUdxUdxL2MeasStopReq
310 * @param[in] Pst* pst
316 PRIVATE S16 PtUlUdxL2MeasStopReq
322 PRIVATE S16 PtUlUdxL2MeasStopReq(pst, status )
328 TRC3(PtUlUdxL2MeasStopReq);
335 PRIVATE UdxBndReq kwUlUdxBndReqMt[] =
338 cmPkUdxBndReq, /* 0 - loosely coupled */
340 PtUlUdxBndReq, /* 0 - loosely coupled, portable */
341 #endif /* LCKWUIKWU */
343 cmPkUdxBndReq, /* 1 - loosely coupled */
345 PtUlUdxBndReq, /* 1 - loosely coupled, portable */
346 #endif /* LCKWUIKWU */
348 KwDlUdxBndReq, /* 2 - tightly coupled, RRC */
350 PtUlUdxBndReq, /* 2 - tightly coupled, portable */
354 PRIVATE UdxUbndReq kwUlUdxUbndReqMt[] =
357 cmPkUdxUbndReq, /* 0 - loosely coupled */
359 PtUlUdxUbndReq, /* 0 - loosely coupled, portable */
360 #endif /* LCKWUIKWU */
362 cmPkUdxUbndReq, /* 1 - loosely coupled */
364 PtUlUdxUbndReq, /* 1 - loosely coupled, portable */
365 #endif /* LCKWUIKWU */
367 KwDlUdxUbndReq, /* 2 - tightly coupled, RRC */
369 PtUlUdxUbndReq, /* 2 - tightly coupled, portable */
374 PRIVATE UdxCfgReq kwUlUdxCfgReqMt[] =
377 cmPkUdxCfgReq, /* 0 - loosely coupled */
379 PtUlUdxCfgReq, /* 0 - loosely coupled, portable */
380 #endif /* LCKWUIKWU */
382 cmPkUdxCfgReq, /* 1 - loosely coupled */
384 PtUlUdxCfgReq, /* 1 - loosely coupled, portable */
385 #endif /* LCKWUIKWU */
387 KwDlUdxCfgReq, /* 2 - tightly coupled, RRC */
389 PtUlUdxCfgReq, /* 2 - tightly coupled, portable */
393 PRIVATE UdxUeIdChgReq kwUlUdxUeIdChgReqMt[] =
396 cmPkUdxUeIdChgReq, /* 0 - loosely coupled */
398 PtUlUdxUeIdChgReq, /* 0 - loosely coupled, portable */
399 #endif /* LCKWUIKWU */
401 cmPkUdxUeIdChgReq, /* 1 - loosely coupled */
403 PtUlUdxUeIdChgReq, /* 1 - loosely coupled, portable */
404 #endif /* LCKWUIKWU */
406 KwDlUdxUeIdChgReq, /* 2 - tightly coupled, RRC */
408 PtUlUdxUeIdChgReq, /* 2 - tightly coupled, portable */
413 PRIVATE CONSTANT UdxStaUpdReq kwUlUdxStaUpdReqMt[KW_MAX_UDX] =
416 cmPkUdxStaUpdReq, /* 0 - loosely coupled */
418 PtUlUdxStaUpdReq, /* 0 - loosely coupled, portable */
419 #endif /* LCKWUIKWU */
421 cmPkUdxStaUpdReq, /* 1 - loosely coupled */
423 PtUlUdxStaUpdReq, /* 1 - loosely coupled, portable */
424 #endif /* LCKWUIKWU */
426 KwDlUdxStaUpdReq, /* 2 - tightly coupled, RRC */
428 PtUlUdxStaUpdReq, /* 2 - tightly coupled, portable */
432 PRIVATE CONSTANT UdxStaPduReq kwUlUdxStaPduReqMt[KW_MAX_UDX] =
435 cmPkUdxStaPduReq, /* 0 - loosely coupled */
437 PtUlUdxStaPduReq, /* 0 - loosely coupled, portable */
438 #endif /* LCKWUIKWU */
440 cmPkUdxStaPduReq, /* 1 - loosely coupled */
442 PtUlUdxStaPduReq, /* 1 - loosely coupled, portable */
443 #endif /* LCKWUIKWU */
445 KwDlUdxStaPduReq, /* 2 - tightly coupled, RRC */
447 PtUlUdxStaPduReq, /* 2 - tightly coupled, portable */
451 PRIVATE CONSTANT UdxL2MeasReq kwUlUdxL2MeasReqMt[KW_MAX_UDX] =
454 cmPkUdxL2MeasReq, /* 0 - loosely coupled */
456 PtUlUdxL2MeasReq, /* 0 - loosely coupled, portable */
457 #endif /* LCKWUIKWU */
459 cmPkUdxL2MeasReq, /* 1 - loosely coupled */
461 PtUlUdxL2MeasReq, /* 1 - loosely coupled, portable */
462 #endif /* LCKWUIKWU */
464 KwDlUdxL2MeasReq, /* 2 - tightly coupled, RRC */
466 PtUlUdxL2MeasReq, /* 2 - tightly coupled, portable */
470 PRIVATE CONSTANT UdxL2MeasSendReq kwUlUdxL2MeasSendReqMt[KW_MAX_UDX] =
473 cmPkUdxL2MeasSendReq, /* 0 - loosely coupled */
475 PtUlUdxL2MeasSendReq, /* 0 - loosely coupled, portable */
476 #endif /* LCKWUIKWU */
478 cmPkUdxL2MeasSendReq, /* 1 - loosely coupled */
480 PtUlUdxL2MeasSendReq, /* 1 - loosely coupled, portable */
481 #endif /* LCKWUIKWU */
483 KwDlUdxL2MeasSendReq, /* 2 - tightly coupled, RRC */
485 PtUlUdxL2MeasSendReq, /* 2 - tightly coupled, portable */
489 PRIVATE CONSTANT UdxL2MeasStopReq kwUlUdxL2MeasStopReqMt[KW_MAX_UDX] =
492 cmPkUdxL2MeasStopReq, /* 0 - loosely coupled */
494 PtUlUdxL2MeasStopReq, /* 0 - loosely coupled, portable */
495 #endif /* LCKWUIKWU */
497 cmPkUdxL2MeasStopReq, /* 1 - loosely coupled */
499 PtUlUdxL2MeasStopReq, /* 1 - loosely coupled, portable */
500 #endif /* LCKWUIKWU */
502 KwDlUdxL2MeasStopReq, /* 2 - tightly coupled, RRC */
504 PtUlUdxL2MeasStopReq, /* 2 - tightly coupled, portable */
512 * Handler for confirming the bind request received from KWU
517 * This function send the bind confirm primitive to the RLC user,
518 * when it receives a bind request from its service user.
520 * @param[in] pst Post structure
521 * @param[in] suId Service user SAP ID
522 * @param[in] status Status of Confirmation
529 PUBLIC S16 KwUlUdxBndReq
531 Pst *pst, /* post structure */
532 SuId suId, /* Service User Id */
533 SpId spId /* Status */
536 PUBLIC S16 KwUlUdxBndReq(pst, suId, status)
537 Pst *pst; /* post structure */
538 SuId suId; /* Service User Id */
539 SpId spId; /* Status */
544 /* jump to specific primitive depending on configured selector */
545 (*kwUlUdxBndReqMt[pst->selector])(pst, suId, spId);
549 } /* end of KwDlUdxBndReq */
555 * Handler for confirming the bind request received from KWU
560 * This function send the bind confirm primitive to the RLC user,
561 * when it receives a bind request from its service user.
563 * @param[in] pst Post structure
564 * @param[in] suId Service user SAP ID
565 * @param[in] status Status of Confirmation
572 PUBLIC S16 KwUlUdxUbndReq
574 Pst *pst, /* post structure */
575 SpId spId, /* Service User Id */
576 Reason reason /* Status */
579 PUBLIC S16 KwUlUdxUbndReq(pst, suId, status)
580 Pst *pst; /* post structure */
581 SpId spId; /* Service User Id */
582 Reason Reason; /* Status */
587 /* jump to specific primitive depending on configured selector */
588 (*kwUlUdxUbndReqMt[pst->selector])(pst, spId,reason );
592 } /* end of KwDlUdxBndReq */
595 PUBLIC S16 KwUlUdxCfgReq
597 Pst *pst, /* post structure */
598 SpId spId, /* Service User Id */
599 CkwCfgInfo *cfmInfo /* Config Info */
602 PUBLIC S16 KwUlUdxCfgReq(pst, suId, status)
603 Pst *pst; /* post structure */
604 SuId spId; /* Service User Id */
605 CkwCfgInfo *cfmInfo; /* Config Info */
610 /* jump to specific primitive depending on configured selector */
611 (*kwUlUdxCfgReqMt[pst->selector])(pst, spId, cfmInfo);
615 } /* end of KwDlUdxCfgReq */
618 PUBLIC S16 KwUlUdxUeIdChgReq
620 Pst *pst, /* post structure */
621 SpId spId, /* Service User Id */
622 U32 transId, /* transaction Id */
623 CkwUeInfo *ueInfo, /* Config Info */
624 CkwUeInfo *newUeInfo /* Config Info */
627 PUBLIC S16 KwUlUdxUeIdChgReq(pst, spId,transId, ueInfo, newUeInfo)
628 Pst *pst; /* post structure */
629 SpId spId; /* Service User Id */
630 U32 transId; /* transaction Id */
631 CkwUeInfo *ueInfo; /* Config Info */
632 CkwUeInfo *newUeInfo; /* Config Info */
635 TRC3(KwUlUdxUeIdChgReq)
637 /* jump to specific primitive depending on configured selector */
638 (*kwUlUdxUeIdChgReqMt[pst->selector])(pst, spId,transId,ueInfo,newUeInfo);
642 } /* end of KwDlUdxCfgReq */
646 PUBLIC S16 KwUlUdxStaPduReq
651 KwUdxDlStaPdu *pStaPdu
654 TRC3(KwUlUdxStaPduReq);
656 RETVALUE((*kwUlUdxStaPduReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
660 * @brief Request from ULM to DLM for UE Status
664 * Function : KwUdxUdxStatUpd
666 * @param[in] Pst* pst
672 PUBLIC S16 KwUlUdxStaUpdReq
680 PUBLIC S16 KwUlUdxStaUpdReq(pst, rlcId, pStaPdu)
684 KwUdxStaPdu *pStaPdu;
688 TRC3(KwUlUdxStaUpdReq);
690 RETVALUE((*kwUlUdxStaUpdReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
691 } /* end of KwUlmDlmStaUpd*/
695 * @brief Request from ULM to DLM for MeasReq
699 * Function : KwUlUdxL2MeasReq
701 * @param[in] Pst* pst
707 PUBLIC S16 KwUlUdxL2MeasReq
710 KwL2MeasReqEvt *measReqEvt
713 PUBLIC S16 KwUlUdxL2MeasReq(pst,measReqEvt)
715 KwL2MeasReqEvt *measReqEvt;
719 TRC3(KwUlUdxStaUpdReq);
721 RETVALUE((*kwUlUdxL2MeasReqMt[pst->selector])(pst,measReqEvt));
722 } /* end of KwUlUdxL2MeasReq*/
725 * @brief Request from ULM to DLM for MeasSendReq
729 * Function : KwUlUdxMeasSendReq
731 * @param[in] Pst* pst
737 PUBLIC S16 KwUlUdxL2MeasSendReq
743 PUBLIC S16 KwUlUdxL2MeasSendReq(pst,measReqEvt)
749 TRC3(KwUlUdxStaUpdReq);
751 RETVALUE((*kwUlUdxL2MeasSendReqMt[pst->selector])(pst,measType));
752 } /* end of KwUlUdxMesReq*/
755 * @brief Request from ULM to DLM for MeasStopReq
759 * Function : KwUlUdxL2MeasStopReq
761 * @param[in] Pst* pst
767 PUBLIC S16 KwUlUdxL2MeasStopReq
773 PUBLIC S16 KwUlUdxL2MeasStopReq(pst,measReqEvt)
779 TRC3(KwUlUdxStaUpdReq);
781 RETVALUE((*kwUlUdxL2MeasStopReqMt[pst->selector])(pst,measType));
782 } /* end of KwUlUdxMesReq*/
784 /**********************************************************************
787 **********************************************************************/