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"
37 CmLListCp *arrTputPerSnssai[DIR_BOTH]; /*Stores the address of Througput LL*/
39 RlcDuUeCreateRsp rlcUeCreateRspOpts[] =
41 packRlcDuUeCreateRsp, /* 0 - loosely coupled */
42 DuProcRlcUeCreateRsp, /* 1 - tightly coupled */
43 packRlcDuUeCreateRsp /* 2 - LWLC loosely coupled */
46 RlcDuUeReconfigRsp rlcUeReconfigRspOpts[] =
48 packRlcDuUeReconfigRsp, /* 0 - loosely coupled */
49 DuProcRlcUeReconfigRsp, /* 1 - tightly coupled */
50 packRlcDuUeReconfigRsp /* 2 - LWLC loosely coupled */
53 /***********************************************************
57 * Handler for the ue create response to DUAPP
61 * This function reports ue create response to DUAPP
63 * @param[in] post Post structure
64 * @param[in] cfgRsp ue create Config Response
70 *************************************************************/
71 uint8_t SendRlcUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
73 /* jump to specific primitive depending on configured selector */
76 RlcUeCreateRsp *ueRsp = NULLP;
78 gCb = RLC_GET_RLCCB(pst->srcInst);
79 RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
82 DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()");
87 /* Mapping Old api to New Api */
88 ret = fillRlcUeCreateRsp(ueRsp, cfgRsp);
91 ret = (*rlcUeCreateRspOpts[pst->selector])(pst, ueRsp);
94 DU_LOG("\nERROR --> RLC: Failed at SendRlcUeCreateRspToDu()");
95 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
100 DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event);
101 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp));
104 RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
106 } /* end of SendRlcUeCreateRspToDu */
108 /***********************************************************
112 * Handler for the ue Reconfig response to DUAPP
116 * This function reports ue Reconfig response to DUAPP
118 * @param[in] post Post structure
119 * @param[in] cfgRsp ue reconfig Config Response
125 *************************************************************/
126 uint8_t SendRlcUeReconfigRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
128 /* jump to specific primitive depending on configured selector */
131 RlcUeReconfigRsp *ueRsp = NULLP;
133 gCb = RLC_GET_RLCCB(pst->srcInst);
134 RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
137 DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeReconfigRspToDu()");
142 /* Mapping Old api to New Api */
143 ret = fillRlcUeCreateRsp(ueRsp, cfgRsp);
146 ret = (*rlcUeReconfigRspOpts[pst->selector])(pst, ueRsp);
149 DU_LOG("\nERROR --> RLC: Failed at SendRlcUeReconfigRspToDu()");
150 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
155 DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event);
156 RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp));
159 RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
161 } /* end of SendRlcUeReconfigRspToDu */
163 /**********************************************************************
165 **********************************************************************/