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 *******************************************************************************/
18 /* This file defines API towards RLC interface */
19 #include "common_def.h"
20 #include "rgu.h" /* RGU interface includes*/
21 #include "lkw.h" /* LKW defines */
22 #include "ckw.h" /* CKW defines */
23 #include "kwu.h" /* KWU defines */
24 #include "rlc_env.h" /* RLC environment options */
28 /* header/extern include files (.x) */
30 #include "lkw.x" /* LKW */
31 #include "ckw.x" /* CKW */
32 #include "kwu.x" /* KWU */
34 #include "rlc_utils.h" /* RLC defines */
35 #include "du_app_rlc_inf.h"
38 RlcDuUeCreateRsp rlcUeCreateRspOpts[] =
40 packRlcDuUeCreateRsp, /* 0 - loosely coupled */
41 DuProcRlcUeCreateRsp, /* 1 - tightly coupled */
42 packRlcDuUeCreateRsp /* 2 - LWLC loosely coupled */
45 RlcDuUeReconfigRsp rlcUeReconfigRspOpts[] =
47 packRlcDuUeReconfigRsp, /* 0 - loosely coupled */
48 DuProcRlcUeReconfigRsp, /* 1 - tightly coupled */
49 packRlcDuUeReconfigRsp /* 2 - LWLC loosely coupled */
52 /***********************************************************
56 * Handler for the ue create response to DUAPP
60 * This function reports ue create response to DUAPP
62 * @param[in] post Post structure
63 * @param[in] cfgRsp ue create Config Response
69 *************************************************************/
70 uint8_t SendRlcUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
72 /* jump to specific primitive depending on configured selector */
75 RlcUeCreateRsp *ueRsp = NULLP;
77 gCb = RLC_GET_RLCCB(pst->srcInst);
78 RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
81 DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()");
86 /* Mapping Old api to New Api */
87 ret = fillRlcUeCreateRsp(ueRsp, cfgRsp);
90 ret = (*rlcUeCreateRspOpts[pst->selector])(pst, ueRsp);
93 DU_LOG("\nERROR --> RLC: Failed at SendRlcUeCreateRspToDu()");
94 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
99 DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event);
100 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
103 RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
105 } /* end of SendRlcUeCreateRspToDu */
107 /***********************************************************
111 * Handler for the ue Reconfig response to DUAPP
115 * This function reports ue Reconfig response to DUAPP
117 * @param[in] post Post structure
118 * @param[in] cfgRsp ue reconfig Config Response
124 *************************************************************/
125 uint8_t SendRlcUeReconfigRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
127 /* jump to specific primitive depending on configured selector */
130 RlcUeReconfigRsp *ueRsp = NULLP;
132 gCb = RLC_GET_RLCCB(pst->srcInst);
133 RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
136 DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeReconfigRspToDu()");
141 /* Mapping Old api to New Api */
142 ret = fillRlcUeCreateRsp(ueRsp, cfgRsp);
145 ret = (*rlcUeReconfigRspOpts[pst->selector])(pst, ueRsp);
148 DU_LOG("\nERROR --> RLC: Failed at SendRlcUeReconfigRspToDu()");
149 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
154 DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event);
155 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
158 RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
160 } /* end of SendRlcUeReconfigRspToDu */
162 /**********************************************************************
164 **********************************************************************/