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 ));
68 static S16 PtUlUdxBndReq
70 Pst *pst, /* post structure */
71 SuId suId, /* Service User Id */
72 SpId spId /* Status */
78 } /* end of rlcDlUdxBndReq */
84 * Handler for confirming the bind request received from KWU
89 * This function send the bind confirm primitive to the RLC user,
90 * when it receives a bind request from its service user.
92 * @param[in] pst Post structure
93 * @param[in] suId Service user SAP ID
94 * @param[in] status Status of Confirmation
100 static S16 PtUlUdxUbndReq
102 Pst *pst, /* post structure */
103 SpId spId, /* Service User Id */
104 Reason reason /* Status */
110 } /* end of PtDlUdxBndReq */
112 static S16 PtUlUdxCfgReq
114 Pst *pst, /* post structure */
115 SpId spId, /* Service User Id */
116 RlcCfgInfo *cfmInfo /* Config Info */
122 } /* end of rlcDlUdxCfgReq */
124 static S16 PtUlUdxUeIdChgReq
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 */
136 } /* end of rlcDlUdxCfgReq */
139 static S16 PtUlUdxStaPduReq
144 RlcUdxDlStaPdu *pStaPdu
152 * @brief Request from ULM to DLM for UE Status
156 * Function : KwUdxUdxStatUpd
158 * @param[in] Pst* pst
163 static S16 PtUlUdxStaUpdReq
168 RlcUdxStaPdu *pStaPdu
173 } /* end of RlcUlmDlmStaUpd*/
177 * @brief Request from ULM to DLM for Measurement
181 * Function : KwUdxUdxL2MeasReq
183 * @param[in] Pst* pst
188 static S16 PtUlUdxL2MeasReq(Pst* pst,RlcL2MeasReqEvt *measReqEvt)
195 * @brief Request from ULM to DLM for Measurement
199 * Function : KwUdxUdxL2MeasSendReq
201 * @param[in] Pst* pst
206 static S16 PtUlUdxL2MeasSendReq(Pst* pst,uint8_t status)
213 * @brief Request from ULM to DLM for Measurement
217 * Function : KwUdxUdxL2MeasStopReq
219 * @param[in] Pst* pst
224 static S16 PtUlUdxL2MeasStopReq(Pst* pst,uint8_t status)
232 static UdxBndReq rlcUlUdxBndReqMt[] =
235 cmPkUdxBndReq, /* 0 - loosely coupled */
237 PtUlUdxBndReq, /* 0 - loosely coupled, portable */
238 #endif /* LCKWUIKWU */
240 cmPkUdxBndReq, /* 1 - loosely coupled */
242 PtUlUdxBndReq, /* 1 - loosely coupled, portable */
243 #endif /* LCKWUIKWU */
245 rlcDlUdxBndReq, /* 2 - tightly coupled, RRC */
247 PtUlUdxBndReq, /* 2 - tightly coupled, portable */
251 static UdxUbndReq rlcUlUdxUbndReqMt[] =
254 cmPkUdxUbndReq, /* 0 - loosely coupled */
256 PtUlUdxUbndReq, /* 0 - loosely coupled, portable */
257 #endif /* LCKWUIKWU */
259 cmPkUdxUbndReq, /* 1 - loosely coupled */
261 PtUlUdxUbndReq, /* 1 - loosely coupled, portable */
262 #endif /* LCKWUIKWU */
264 rlcDlUdxUbndReq, /* 2 - tightly coupled, RRC */
266 PtUlUdxUbndReq, /* 2 - tightly coupled, portable */
271 static UdxCfgReq rlcUlUdxCfgReqMt[] =
274 cmPkUdxCfgReq, /* 0 - loosely coupled */
276 PtUlUdxCfgReq, /* 0 - loosely coupled, portable */
277 #endif /* LCKWUIKWU */
279 cmPkUdxCfgReq, /* 1 - loosely coupled */
281 PtUlUdxCfgReq, /* 1 - loosely coupled, portable */
282 #endif /* LCKWUIKWU */
284 rlcDlUdxCfgReq, /* 2 - tightly coupled, RRC */
286 PtUlUdxCfgReq, /* 2 - tightly coupled, portable */
290 static UdxUeIdChgReq rlcUlUdxUeIdChgReqMt[] =
293 cmPkUdxUeIdChgReq, /* 0 - loosely coupled */
295 PtUlUdxUeIdChgReq, /* 0 - loosely coupled, portable */
296 #endif /* LCKWUIKWU */
298 cmPkUdxUeIdChgReq, /* 1 - loosely coupled */
300 PtUlUdxUeIdChgReq, /* 1 - loosely coupled, portable */
301 #endif /* LCKWUIKWU */
303 rlcDlUdxUeIdChgReq, /* 2 - tightly coupled, RRC */
305 PtUlUdxUeIdChgReq, /* 2 - tightly coupled, portable */
310 static const UdxStaUpdReq rlcUlUdxStaUpdReqMt[RLC_MAX_UDX] =
313 cmPkUdxStaUpdReq, /* 0 - loosely coupled */
315 PtUlUdxStaUpdReq, /* 0 - loosely coupled, portable */
316 #endif /* LCKWUIKWU */
318 cmPkUdxStaUpdReq, /* 1 - loosely coupled */
320 PtUlUdxStaUpdReq, /* 1 - loosely coupled, portable */
321 #endif /* LCKWUIKWU */
323 rlcDlUdxStaUpdReq, /* 2 - tightly coupled, RRC */
325 PtUlUdxStaUpdReq, /* 2 - tightly coupled, portable */
329 static const UdxStaPduReq rlcUlUdxStaPduReqMt[RLC_MAX_UDX] =
332 cmPkUdxStaPduReq, /* 0 - loosely coupled */
334 PtUlUdxStaPduReq, /* 0 - loosely coupled, portable */
335 #endif /* LCKWUIKWU */
337 cmPkUdxStaPduReq, /* 1 - loosely coupled */
339 PtUlUdxStaPduReq, /* 1 - loosely coupled, portable */
340 #endif /* LCKWUIKWU */
342 rlcDlUdxStaPduReq, /* 2 - tightly coupled, RRC */
344 PtUlUdxStaPduReq, /* 2 - tightly coupled, portable */
348 static const UdxL2MeasReq rlcUlUdxL2MeasReqMt[RLC_MAX_UDX] =
351 cmPkUdxL2MeasReq, /* 0 - loosely coupled */
353 PtUlUdxL2MeasReq, /* 0 - loosely coupled, portable */
354 #endif /* LCKWUIKWU */
356 cmPkUdxL2MeasReq, /* 1 - loosely coupled */
358 PtUlUdxL2MeasReq, /* 1 - loosely coupled, portable */
359 #endif /* LCKWUIKWU */
361 rlcDlUdxL2MeasReq, /* 2 - tightly coupled, RRC */
363 PtUlUdxL2MeasReq, /* 2 - tightly coupled, portable */
367 static const UdxL2MeasSendReq rlcUlUdxL2MeasSendReqMt[RLC_MAX_UDX] =
370 cmPkUdxL2MeasSendReq, /* 0 - loosely coupled */
372 PtUlUdxL2MeasSendReq, /* 0 - loosely coupled, portable */
373 #endif /* LCKWUIKWU */
375 cmPkUdxL2MeasSendReq, /* 1 - loosely coupled */
377 PtUlUdxL2MeasSendReq, /* 1 - loosely coupled, portable */
378 #endif /* LCKWUIKWU */
380 rlcDlUdxL2MeasSendReq, /* 2 - tightly coupled, RRC */
382 PtUlUdxL2MeasSendReq, /* 2 - tightly coupled, portable */
386 static const UdxL2MeasStopReq rlcUlUdxL2MeasStopReqMt[RLC_MAX_UDX] =
389 cmPkUdxL2MeasStopReq, /* 0 - loosely coupled */
391 PtUlUdxL2MeasStopReq, /* 0 - loosely coupled, portable */
392 #endif /* LCKWUIKWU */
394 cmPkUdxL2MeasStopReq, /* 1 - loosely coupled */
396 PtUlUdxL2MeasStopReq, /* 1 - loosely coupled, portable */
397 #endif /* LCKWUIKWU */
399 rlcDlUdxL2MeasStopReq, /* 2 - tightly coupled, RRC */
401 PtUlUdxL2MeasStopReq, /* 2 - tightly coupled, portable */
409 * Handler for confirming the bind request received from KWU
414 * This function send the bind confirm primitive to the RLC user,
415 * when it receives a bind request from its service user.
417 * @param[in] pst Post structure
418 * @param[in] suId Service user SAP ID
419 * @param[in] status Status of Confirmation
427 Pst *pst, /* post structure */
428 SuId suId, /* Service User Id */
429 SpId spId /* Status */
432 /* jump to specific primitive depending on configured selector */
433 (*rlcUlUdxBndReqMt[pst->selector])(pst, suId, spId);
437 } /* end of rlcDlUdxBndReq */
443 * Handler for confirming the bind request received from KWU
448 * This function send the bind confirm primitive to the RLC user,
449 * when it receives a bind request from its service user.
451 * @param[in] pst Post structure
452 * @param[in] suId Service user SAP ID
453 * @param[in] status Status of Confirmation
461 Pst *pst, /* post structure */
462 SpId spId, /* Service User Id */
463 Reason reason /* Status */
466 /* jump to specific primitive depending on configured selector */
467 (*rlcUlUdxUbndReqMt[pst->selector])(pst, spId,reason );
471 } /* end of rlcDlUdxBndReq */
475 Pst *pst, /* post structure */
476 SpId spId, /* Service User Id */
477 RlcCfgInfo *cfmInfo /* Config Info */
481 /* jump to specific primitive depending on configured selector */
482 (*rlcUlUdxCfgReqMt[pst->selector])(pst, spId, cfmInfo);
486 } /* end of rlcDlUdxCfgReq */
488 S16 rlcUlUdxUeIdChgReq
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 */
498 /* jump to specific primitive depending on configured selector */
499 (*rlcUlUdxUeIdChgReqMt[pst->selector])(pst, spId,transId,ueInfo,newUeInfo);
503 } /* end of rlcDlUdxCfgReq */
507 uint8_t rlcUlUdxStaPduReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxDlStaPdu *pStaPdu)
509 return ((*rlcUlUdxStaPduReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
513 * @brief Request from ULM to DLM for UE Status
517 * Function : KwUdxUdxStatUpd
519 * @param[in] Pst* pst
524 uint8_t rlcUlUdxStaUpdReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxStaPdu *pStaPdu)
526 return ((*rlcUlUdxStaUpdReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
527 } /* end of RlcUlmDlmStaUpd*/
531 * @brief Request from ULM to DLM for MeasReq
535 * Function : rlcUlUdxL2MeasReq
537 * @param[in] Pst* pst
542 S16 rlcUlUdxL2MeasReq(Pst* pst,RlcL2MeasReqEvt *measReqEvt )
545 return ((*rlcUlUdxL2MeasReqMt[pst->selector])(pst,measReqEvt));
546 } /* end of rlcUlUdxL2MeasReq*/
549 * @brief Request from ULM to DLM for MeasSendReq
553 * Function : rlcUlUdxMeasSendReq
555 * @param[in] Pst* pst
560 S16 rlcUlUdxL2MeasSendReq(Pst* pst,uint8_t measType)
563 return ((*rlcUlUdxL2MeasSendReqMt[pst->selector])(pst,measType));
564 } /* end of rlcUlUdxMesReq*/
567 * @brief Request from ULM to DLM for MeasStopReq
571 * Function : rlcUlUdxL2MeasStopReq
573 * @param[in] Pst* pst
578 S16 rlcUlUdxL2MeasStopReq(Pst* pst,uint8_t measType)
581 return ((*rlcUlUdxL2MeasStopReqMt[pst->selector])(pst,measType));
582 } /* end of rlcUlUdxMesReq*/
584 /**********************************************************************
587 **********************************************************************/