From 70e1fb5996d93ef4973ffb654ee6a66228e9031c Mon Sep 17 00:00:00 2001 From: sphoorthi Date: Fri, 23 Apr 2021 20:06:33 +0530 Subject: [PATCH] [JIRA ID:ODUHIGH-331]-Renaming of RLC files Change-Id: I909e86987ca63f64aaa2fb353c28f1d21a564384 Signed-off-by: sphoorthi --- src/5gnrmac/{rg_ex_ms.c => mac_msg_router.c} | 4 +- src/5gnrrlc/kw.h | 1093 ------------- src/5gnrrlc/kw.x | 686 -------- src/5gnrrlc/kw_dl.h | 176 -- src/5gnrrlc/kw_ptli.c | 411 ----- src/5gnrrlc/kw_ptmi.c | 367 ----- src/5gnrrlc/kw_udx.h | 110 -- src/5gnrrlc/kw_ul.h | 60 - src/5gnrrlc/{kw_amm_dl.c => rlc_amm_dl.c} | 21 +- src/5gnrrlc/{kw_amm_ul.c => rlc_amm_ul.c} | 17 +- src/5gnrrlc/{kw_cfg_dl.c => rlc_cfg_dl.c} | 18 +- src/5gnrrlc/{kw_cfg_ul.c => rlc_cfg_ul.c} | 14 +- src/5gnrrlc/{kw_dbm_dl.c => rlc_dbm_dl.c} | 16 +- src/5gnrrlc/{kw_dbm_ul.c => rlc_dbm_ul.c} | 12 +- src/5gnrrlc/{kw_dl.x => rlc_dl.h} | 159 +- src/5gnrrlc/{kw_dl_ex_ms.c => rlc_dl_msg_router.c} | 19 +- src/5gnrrlc/{kw_udx.c => rlc_dl_ul_inf.c} | 20 +- src/5gnrrlc/{kw_udx.x => rlc_dl_ul_inf.h} | 99 +- src/5gnrrlc/{kw_udx_dl.c => rlc_dl_ul_inf_dl.c} | 16 +- .../{kw_udx_ptdl.c => rlc_dl_ul_inf_ptdl.c} | 20 +- .../{kw_udx_ptul.c => rlc_dl_ul_inf_ptul.c} | 19 +- src/5gnrrlc/{kw_udx_ul.c => rlc_dl_ul_inf_ul.c} | 23 +- src/5gnrrlc/{kw_env.h => rlc_env.h} | 10 +- src/5gnrrlc/{kw_err.h => rlc_err.h} | 10 +- src/5gnrrlc/{kw_lmm.c => rlc_layer_mgr.c} | 22 +- src/5gnrrlc/{kw_lim.c => rlc_lwr_inf_mgr.c} | 20 +- src/5gnrrlc/rlc_mgr.c | 7 +- src/5gnrrlc/rlc_msg_hdl.c | 18 +- .../{kw_ptui.c => rlc_portable_functions.c} | 677 +++++++- src/5gnrrlc/{kw_tenb_stats.c => rlc_stats.c} | 13 +- src/5gnrrlc/{kw_id.c => rlc_sys_id.c} | 2 +- src/5gnrrlc/{kw_tmm_dl.c => rlc_tmm_dl.c} | 19 +- src/5gnrrlc/{kw_tmm_ul.c => rlc_tmm_ul.c} | 15 +- src/5gnrrlc/{kw_tmr.c => rlc_tmr.c} | 20 +- src/5gnrrlc/{kw_ul.x => rlc_ul.h} | 48 +- src/5gnrrlc/{kw_ul_ex_ms.c => rlc_ul_msg_router.c} | 19 +- src/5gnrrlc/{kw_umm_dl.c => rlc_umm_dl.c} | 24 +- src/5gnrrlc/{kw_umm_ul.c => rlc_umm_ul.c} | 16 +- src/5gnrrlc/{kw_uim.c => rlc_upr_inf_mgr.c} | 20 +- src/5gnrrlc/rlc_utils.h | 1692 ++++++++++++++++++++ src/5gnrrlc/{kw_utl_dl.c => rlc_utl_dl.c} | 22 +- src/5gnrrlc/{kw_utl_ul.c => rlc_utl_ul.c} | 15 +- src/5gnrsch/{rg_sch_ex_ms.c => sch_msg_router.c} | 6 +- src/du_app/{du_mgr_ex_ms.c => du_mgr_msg_router.c} | 2 +- src/du_app/du_ue_mgr.c | 1 - 45 files changed, 2823 insertions(+), 3255 deletions(-) rename src/5gnrmac/{rg_ex_ms.c => mac_msg_router.c} (99%) delete mode 100755 src/5gnrrlc/kw.h delete mode 100755 src/5gnrrlc/kw.x delete mode 100755 src/5gnrrlc/kw_dl.h delete mode 100755 src/5gnrrlc/kw_ptli.c delete mode 100755 src/5gnrrlc/kw_ptmi.c delete mode 100755 src/5gnrrlc/kw_udx.h delete mode 100755 src/5gnrrlc/kw_ul.h rename src/5gnrrlc/{kw_amm_dl.c => rlc_amm_dl.c} (99%) rename src/5gnrrlc/{kw_amm_ul.c => rlc_amm_ul.c} (99%) rename src/5gnrrlc/{kw_cfg_dl.c => rlc_cfg_dl.c} (99%) rename src/5gnrrlc/{kw_cfg_ul.c => rlc_cfg_ul.c} (99%) rename src/5gnrrlc/{kw_dbm_dl.c => rlc_dbm_dl.c} (98%) rename src/5gnrrlc/{kw_dbm_ul.c => rlc_dbm_ul.c} (98%) rename src/5gnrrlc/{kw_dl.x => rlc_dl.h} (81%) rename src/5gnrrlc/{kw_dl_ex_ms.c => rlc_dl_msg_router.c} (98%) rename src/5gnrrlc/{kw_udx.c => rlc_dl_ul_inf.c} (98%) rename src/5gnrrlc/{kw_udx.x => rlc_dl_ul_inf.h} (79%) rename src/5gnrrlc/{kw_udx_dl.c => rlc_dl_ul_inf_dl.c} (98%) rename src/5gnrrlc/{kw_udx_ptdl.c => rlc_dl_ul_inf_ptdl.c} (97%) rename src/5gnrrlc/{kw_udx_ptul.c => rlc_dl_ul_inf_ptul.c} (98%) rename src/5gnrrlc/{kw_udx_ul.c => rlc_dl_ul_inf_ul.c} (97%) rename src/5gnrrlc/{kw_env.h => rlc_env.h} (97%) rename src/5gnrrlc/{kw_err.h => rlc_err.h} (99%) rename src/5gnrrlc/{kw_lmm.c => rlc_layer_mgr.c} (99%) rename src/5gnrrlc/{kw_lim.c => rlc_lwr_inf_mgr.c} (98%) rename src/5gnrrlc/{kw_ptui.c => rlc_portable_functions.c} (54%) mode change 100755 => 100644 rename src/5gnrrlc/{kw_tenb_stats.c => rlc_stats.c} (96%) rename src/5gnrrlc/{kw_id.c => rlc_sys_id.c} (99%) rename src/5gnrrlc/{kw_tmm_dl.c => rlc_tmm_dl.c} (97%) rename src/5gnrrlc/{kw_tmm_ul.c => rlc_tmm_ul.c} (97%) rename src/5gnrrlc/{kw_tmr.c => rlc_tmr.c} (98%) rename src/5gnrrlc/{kw_ul.x => rlc_ul.h} (96%) rename src/5gnrrlc/{kw_ul_ex_ms.c => rlc_ul_msg_router.c} (98%) rename src/5gnrrlc/{kw_umm_dl.c => rlc_umm_dl.c} (97%) rename src/5gnrrlc/{kw_umm_ul.c => rlc_umm_ul.c} (99%) rename src/5gnrrlc/{kw_uim.c => rlc_upr_inf_mgr.c} (98%) mode change 100644 => 100755 src/5gnrrlc/rlc_utils.h rename src/5gnrrlc/{kw_utl_dl.c => rlc_utl_dl.c} (99%) rename src/5gnrrlc/{kw_utl_ul.c => rlc_utl_ul.c} (98%) rename src/5gnrsch/{rg_sch_ex_ms.c => sch_msg_router.c} (98%) rename src/du_app/{du_mgr_ex_ms.c => du_mgr_msg_router.c} (99%) diff --git a/src/5gnrmac/rg_ex_ms.c b/src/5gnrmac/mac_msg_router.c similarity index 99% rename from src/5gnrmac/rg_ex_ms.c rename to src/5gnrmac/mac_msg_router.c index 8f5f68d71..edb663985 100755 --- a/src/5gnrmac/rg_ex_ms.c +++ b/src/5gnrmac/mac_msg_router.c @@ -24,11 +24,11 @@ Desc: C source code SSI Interface Implementation - File: rg_ex_ms.c + File: mac_msg_router.c **********************************************************************/ -/** @file rg_ex_ms.c +/** @file mac_msg_router.c @brief This file contains the implementation of callback functions registered with SSI during the LTE MAC Task initialization. */ diff --git a/src/5gnrrlc/kw.h b/src/5gnrrlc/kw.h deleted file mode 100755 index 6bf6782f2..000000000 --- a/src/5gnrrlc/kw.h +++ /dev/null @@ -1,1093 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: NR RLC file - - Type: C include file - - Desc: This file contain the hash definations for RLC - - File: kw.h - -*********************************************************************21*/ -/** @file kw.h -@brief RLC Hash definitions -*/ - -#ifndef __KWH__ -#define __KWH__ -#include "du_log.h" - - -#define EKWxxx 1 -#define EMG099 1 -#define EMG102 2 -#define EMG103 3 -#define EMG104 4 - -/* RLC-SPLIT Activity */ -#define RLC_ONE 1 -#define RLC_BIT0 0x01 -#define RLC_BIT1 0x02 -#define RLC_BIT2 0x04 -#define RLC_BIT3 0x08 - -#define RLC_2K_BYTE 2048 - -/* RLC RB flag bits */ -#define RLC_RB_REESTABLISH_DL RLC_BIT0 -#define RLC_RB_REESTABLISH_UL RLC_BIT1 -#define RLC_RB_DELETE_DL RLC_BIT2 -#define RLC_RB_DELETE_UL RLC_BIT3 - - -#define RLC_MOD_1024 0x3FF /* used for MOD 1024 */ - - - -/************************************************************************ - * SAP States - ************************************************************************/ - -#define RLC_SAP_NOT_CFG 0 /*!< SAP Not Configured */ -#define RLC_SAP_CFG 1 /*!< SAP Configured but not not bound */ -#define RLC_SAP_BND 2 /*!< SAP Bound */ -#define RLC_SAP_BINDING 3 /*!< SAP Bind initiated */ -#define RLC_SAP_UBND 4 /*!< SAP Unbind */ - -#define RLC_MAX_SAP_BND_RETRY 3 /*!< Maximum SAP Bin Retries */ - -#define RLC_MAX_UE 0xffffffff /*!< Maximum number of UEs. */ - -/* Maximum number of Saps */ -#define RLC_MAX_UDXSAPS 1 /*!< Maximum number of UDX Saps */ -#define RLC_MAX_KWUSAPS 2 /*!< Maximum number of KWU Saps. */ -#define RLC_MAX_CKWSAPS 1 /*!< Maximum number of CKW Saps. */ -/*MCELL changes*/ -#define RLC_MAX_RGUSAPS 4//5 /*!< Maximum number of RGU Saps. */ - -#define RLC_MAX_RGUSAP_TMR 1 /*!< Maximum number of RGU SAP Timers. */ - -#define RLC_UI_RRC 0 /*!< Upper interface RRC sap Id. */ -#define RLC_UI_PDCP 1 /*!< Upper interface PDCP sap Id. */ - -#ifdef LTE_L2_MEAS -/* TODO. This works for FDD only. For TDD the array dimension - * should be changed according to the number of Harq Procs */ -#define RLC_MAX_TB_PER_UE 64 /*!< Maximum number of tbCb for UE */ -#define RLC_INVALID_TBID RLC_MAX_TB_PER_UE -#endif -/******************************************************************************* - * Memory related Defines - ******************************************************************************/ -#ifdef MCCABE_COV -/* Allocate function */ -#define RLC_ALLOC(_cb,_buf, _size) \ -{ \ - SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, \ - (Size) _size); \ - memset((_buf), 0, _size); \ -} - -#define RLC_RMV_SDU(_cb,_sduQ,_sdu) \ -{ \ - SPutMsg(_sdu->mBuf); \ - cmLListDelFrm(_sduQ,&_sdu->lstEnt); \ - RLC_FREE(_cb,_sdu, sizeof(RlcSdu)); \ -} - -#define RLC_FREE(_cb,_buf, _size) \ -{ \ - (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \ - (Data *) _buf, (Size) _size); \ - _buf = NULLP; \ -} - -#else - -#define RLC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutStaticBuffer(_region, _pool, \ - (Data *) _buf, (Size) _size, 0); \ - _buf = NULLP; \ - } \ -} - -#define RLC_FREE_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ -{ \ - (Void) SPutStaticBuffer(_region, _pool, \ - (Data *) _buf, (Size) _size, 0); \ - _buf = NULLP; \ -} - -#define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ -{ \ - SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ - (Size) _size, 0); \ -} - -#define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size) \ -{ \ - if (SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ - (Size) _size, 0) == ROK) \ - { \ - memset((_buf), 0, _size); \ - } \ - else \ - { \ - (_buf) = NULLP; \ - } \ -} -/* Allocate function */ -#define RLC_ALLOC(_cb,_buf, _size) \ -{ \ - if (SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, \ - (Size) _size) == ROK) \ - { \ - memset((_buf), 0, _size); \ - } \ - else \ - { \ - (_buf) = NULLP; \ - } \ -} - -#define RLC_ALLOC_WC(_cb,_buf, _size) \ - SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size) - -#define RLC_RMV_SDU(_cb,_sduQ,_sdu) \ -{ \ - if(_sdu->mBuf) \ - { \ - SPutMsg(_sdu->mBuf); \ - } \ - cmLListDelFrm(_sduQ,&_sdu->lstEnt); \ - RLC_FREE(_cb,_sdu, sizeof(RlcSdu)); \ -} - -#define RLC_FREE(_cb,_buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \ - (Data *) _buf, (Size) _size); \ - _buf = NULLP; \ - } \ -} - -#endif - -/* kw002.201 Freeing from region of pst */ -#define RLC_PST_FREE(_region, _pool, _buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutSBuf(_region, _pool, \ - (Data *) _buf, (Size) _size); \ - _buf = NULLP; \ - } \ -} - -#ifdef XEON_SPECIFIC_CHANGES -#ifdef SS_LOCKLESS_MEMORY -#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutStaticBuffer(_region, _pool, \ - (Data *) _buf, (Size) _size, 0); \ - _buf = NULLP; \ - } \ -} - -#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ -{ \ - SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ - (Size) _size, 0); \ -} - -#else - -#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutSBuf(_region, _pool, \ - (Data *) _buf, (Size) _size); \ - _buf = NULLP; \ - } \ -} - -#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ -{ \ - SGetSBuf(_region, _pool, (Data **)&_buf, \ - (Size) _size); \ -} -#endif /* SS_LOCKLESS_MEMORY */ - -#else - -#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutStaticBuffer(_region, _pool, \ - (Data *) _buf, (Size) _size, 0); \ - _buf = NULLP; \ - } \ -} - -#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ -{ \ - SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ - (Size) _size, 0); \ -} -#endif - -#define RLC_MEM_CPY(_dst, _src, _size) memcpy(_dst, _src, _size); - -#define RLC_MEM_ZERO(_buf, _size) memset((_buf), 0, _size); - -#define RLC_GET_MEM_REGION(_cb) (_cb->init.region) - -#define RLC_GET_MEM_POOL(_cb) (_cb->init.pool) - -#define RLC_GET_MEM_POOL_ADDRESS(_cb) (&_cb->init.pool) - -/* Memset to value */ -#define RLC_MEM_SET(_arg, _val, _size) memset(_arg, _val, _size); - -/* Alarms */ -/* Send an alarm for sapId events */ -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#define RLC_GETSDUIDX(_sduIdx) \ -{\ - _sduIdx = (((_sduIdx)+1) % RLC_L2MEAS_MAX_OUTSTNGSDU);\ -} -#define RLC_SEND_SAPID_ALARM(_cb,_sapId, _evnt, _cause) \ -{ \ - rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, _sapId, 0, 0); \ -} -#define RLC_SEND_UEID_ALARM(_cb,_ueId, _qci, _evnt, _cause) \ -{ \ - rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, 0, _ueId, _qci); \ -} -#else /* LTE_L2_MEAS */ -#define RLC_SEND_SAPID_ALARM(_cb,_sapId, _evnt, _cause) \ -{ \ - rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, _sapId, 0); \ -} -#define RLC_SEND_UEID_ALARM(_cb,_ueId, _evnt, _cause) \ -{ \ - rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, 0, _ueId); \ -} -#endif /* LTE_L2_MEAS */ - -/******************************************************************************* - * Common Defines - ******************************************************************************/ - -/* RLC Configuration parameters */ -#define RLC_MAX_UL_LI (2 * RLC_MAX_LI) -/*macro RLC_MAX_DL_LI is moved to kw_env.h file */ -#define RLC_MAX_DAT RLC_MAXIMUM_DAT -/*macro RLC_MAX_PDU is moved to kw_env.h file */ -#define RLC_MAX_RB_PER_CELL 10 -#define RLC_MAX_SRB_PER_UE 3 -#define RLC_MAX_DRB_PER_UE 32 -#define RLC_MAX_LCH_PER_UE 12 -#define RLC_MAX_LCH_PER_CELL 6 -#define RLC_MAX_NUM_RB 24 -#define RLC_MAX_UE 0xffffffff -#define RLC_UE_LIST_BUCKET_SIZE 128 -#define RLC_CELL_LIST_BUCKET_SIZE 10 -#define RLC_TRANS_ID_LST_BKT_SIZE 10 -#define RLC_MAX_RB 32 - -/* RLC Mode defines */ -#define RLC_MODE_TM 1 -#define RLC_MODE_UM 2 -#define RLC_MODE_AM 3 - -/* Direction defines */ -#define RLC_DIR_UL 1 /*!< Unlink direction */ -#define RLC_DIR_DL 2 /*!< Downlink direction */ -#define RLC_DIR_BOTH 3 /*!< Both Downlink and Unlink */ - -#define RLC_DEF_SEQ_NUM 0 /**< Sequence number to pick in case of duplicate - entries in hash list searches*/ - -/** - * @def RLC_MIN - * - * Macro to find the miniumum of two numbers - * - * @param[in] x First number - * @param[in] y Second number - * -*/ -#define RLC_MIN(x,y) (x) < (y) ? (x) : (y) - -/** - * @def RLC_GET_RLCCB - * - * Macro to the RLC instance - * - * @param[in] _inst Instance Id - * -*/ -#define RLC_GET_RLCCB(_inst) rlcCb[_inst] - -#define RLC_ADD_SDU 1 /*!< Add SDU. */ -#define RLC_DEL_SDU 2 /*!< Delete SDU. */ - -#define RLC_CFM_NOK 0 /*!< Do not send DatCfm */ -#define RLC_CFM_OK 1 /*!< Send DatCfm */ - -/* Set the unsolictated Status flag */ -#define RLC_SET_USTA_FLAG(_rlcCb, _value) \ -{ \ - _rlcCb->init.usta = _value; \ -} - -/* Macros to get the init parameters */ -#define RLC_GET_DBG_MASK(_rlcCb) (_rlcCb->init.dbgMask) -#define RLC_GET_LMPST_MEM_POOL(_rlcCb) (_rlcCb->init.lmPst.pool) -#define RLC_GET_LMPST_MEM_REGION(_rlcCb) (_rlcCb->init.lmPst.region) - -/* Macros for configuration module */ -#define RLC_CFG_FILL_CFG_CFM(_entCfm, _rbId, _rbType, _status, _reason) \ -{ \ - _entCfm->rbId = _rbId; \ - _entCfm->rbType = _rbType; \ - _entCfm->status.status = _status; \ - _entCfm->status.reason = _reason; \ -} - -/** - * @def RLC_VALIDATE_UE_RBID - * - * This macro validates whether the _rbId passed is valid or not. It checks - * if the _rbId is within the maximum value depending on the _rbType. - * Returns TRUE if valid else FALSE - * - * @param[in] _rbType Type of the Radio Bearer; SRB or DRB - * @param[in] _rbId RB Id of the RB to be validated - * -*/ -#define RLC_VALIDATE_UE_RBID(_rbType, _rbId) \ - ((_rbType == CM_LTE_SRB && _rbId < RLC_MAX_SRB_PER_UE) || \ - (_rbType == CM_LTE_DRB && _rbId < RLC_MAX_DRB_PER_UE)) - -/******************************************************************************* - * UIM Defines - ******************************************************************************/ -#if (ERRCLASS & ERRCLS_INT_PAR) -#define RLC_VALDATE_SAP(_cb,_chkSpId, _sap, _ret) \ -{ \ - if (_chkSpId != _sap->spId) \ - { \ - RLCLOGERROR(_cb,ERRCLS_DEBUG, EKWxxx, (ErrVal) RFAILED, \ - "Sap Id Validation Failed."); \ - _ret = RFAILED; \ - } \ - /* SAP state validation */ \ - if(_sap->state != RLC_SAP_BND) \ - { \ - RLCLOGERROR(_cb,ERRCLS_INT_PAR, EKWXXX, (ErrVal) RFAILED, \ - "Sap State Invalid."); \ - RLC_SEND_SAPID_ALARM(_cb,0, LCM_EVENT_UI_INV_EVT, LCM_CAUSE_INV_STATE); \ - _ret = RFAILED; \ - } \ -} -#else /* ERRCLASS & ERRCLS_INT_PAR */ -#define RLC_VALDATE_SAP(_cb,_chkSpId, _sap, _ret) \ -{ \ - /* SAP state validation */ \ - if(_sap->state != RLC_SAP_BND) \ - { \ - RLCLOGERROR(_cb,ERRCLS_INT_PAR, EKWXXX, (ErrVal) RFAILED, \ - "Sap State Invalid."); \ - RLC_SEND_SAPID_ALARM(_cb,0, LCM_EVENT_UI_INV_EVT, LCM_CAUSE_INV_STATE); \ - _ret = RFAILED; \ - } \ -} -#endif /* ERRCLASS & ERRCLS_INT_PAR */ - -/******************************************************************************* - * Timer Defines - ******************************************************************************/ -#define RLC_TMR_LEN 10 -#define RLC_MAX_UM_TMR 1 -#define RLC_MAX_AM_TMR 3 -#define RLC_MAX_THPT_TMR 1 - -/* Timer events */ -#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1 -#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2 -#define EVENT_RLC_AMUL_STA_PROH_TMR 3 -#define EVENT_RLC_AMDL_POLL_RETX_TMR 4 -#define EVENT_RLC_WAIT_BNDCFM 5 -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#define EVENT_RLC_L2_TMR 6 -#endif /* LTE_L2_MEAS */ -#define EVENT_RLC_THROUGHPUT_TMR 7 - -/******************************************************************************* - * DBM Defines - ******************************************************************************/ -/** - * @def RLC_DBM_GET_RBCB_FROM_UECB - * - * This macro makes _rbCb point to the RB in _ueCb based on the passed - * _rbId and _rbType. _rbCb can point to NULLP - * - * @param[in] _rbId RB Id of the RB to be fetched - * @param[in] _rbType Type of the RB, SRB or DRB - * @param[in] _ueCb Pointer to the UECb for which to get the RB - * @param[out] _rbCb Pointer to the found RbCb - * -*/ -#define RLC_DBM_GET_RBCB_FROM_UECB(_rbId, _rbType, _ueCb, _rbCb) \ - (_rbCb) = ((_rbType) == CM_LTE_SRB) ? (_ueCb)->srbCb[(_rbId)] : \ - (_ueCb)->drbCb[(_rbId)]; -/** - * @def RLC_DBM_GET_CELL_RBCB - * - * This macro makes _rbCb point to the RB in the _rbCbLst. - * _rbCb can point to NULLP - * - * @param[in] _rbId RB Id of the RB to be fetched - * @param[in] _rbCbLst Pointer to array of RBCbs - * @param[out] _rbCb Pointer to the found RbCb - * -*/ -#define RLC_DBM_GET_CELL_RBCB(_rbId, _rbCbLst, _rbCb) \ - (_rbCb) = (_rbCbLst)[(_rbId)]; - -/******************************************************************************* - * UMM Defines - ******************************************************************************/ -#define RLC_UMDL rbCb->m.umDl -#define RLC_UMUL rbCb->m.umUl - -/* Sequence Number length defines */ -#define RLC_UM_CFG_6BIT_SN_LEN 1 /**< UM 6-bit Sequence number length - in bytes*/ -#define RLC_UM_CFG_12BIT_SN_LEN 2 /**< UM 12-bit Sequence number length - in bytes*/ -/* 5GNR */ -/* Sequence Number length defines */ -#define RLC_AM_CFG_12BIT_SN_LEN 1 /**< AM 12-bit Sequence number length - in bytes*/ -#define RLC_AM_CFG_18BIT_SN_LEN 2 /**< AM 18-bit Sequence number length - in bytes*/ - -/** - * @def RLC_RMV_MAC_HDR_SZ - * - * If PDU size is greater than 127, MAC header would be 3 bytes else 2 bytes - * - * @param[in,out] _pduSz Size of the pdu - * -*/ -#define RLC_RMV_MAC_HDR_SZ(_pduSz) (_pduSz) -= ((_pduSz) > 127) ? 3 : 2; - -/** - * @def RLC_UM_GET_VALUE - * - * This macro is used to calculate the value of UM state variables used - * in comparisons. VR(UH) - UM Window Size is taken as the base modulus. - * Returns the modifed value - * - * @param[in] _val Value of the state variable - * @param[in] _kwUmUl Um Uplink control block - * -*/ -#define RLC_UM_GET_VALUE(_val,_kwUmUl) \ - (((_val) - ((_kwUmUl).vrUh - (_kwUmUl).umWinSz)) & ((_kwUmUl).modBitMask)) - -/******************************************************************************* - * AMM Defines - ******************************************************************************/ -#define RLC_AMDL rbCb->m.amDl -#define RLC_AMUL rbCb->m.amUl - -/* PDU Types */ -#define RLC_DATA_PDU 1 -#define RLC_CNTRL_PDU 0 - -#define RLC_FI_FIRST_SEG 0x02 -#define RLC_FI_LAST_SEG 0x01 -#define RLC_SI_FIRST_SEG 0x01 -#define RLC_SI_LAST_SEG 0x02 -#define RLC_SI_MID_SEG 0x03 - -#define RLC_POLL_SET 0x40 /* 01000000 */ -#define RLC_POLL_UNSET 0xbf /* 10111111 */ -#define RLC_MAX_NACK_CNT 100 -/*RLC_MAX_CNTRL_FIELDS (Maximum size of Status Pdu) - * = MAX_NACK_CNT * sizeof(NACK_SN,E1,E2,E3,soStart,soEnd, nackRange) - * for 18 bit SN + Fixed Header*/ -#define RLC_MAX_CNTRL_FIELDS ((RLC_MAX_NACK_CNT * 8) + 3) - -/* Each LI(Length Indicator) holds approx 1+1/2 byte and some other fields thus keeping Header Size equal to twice of MAX LI */ -/* 5GNR_RLC: Need to change value of HDRSZ as per number of PDUs going in one datReq */ -#define RLC_MIN_HDRSZ 1 -#define RLC_MAX_HDRSZ 5 -#define RLC_AM_PDU_FIXED_HDRSZ 2 -#define RLC_AM_PDU_12BIT_SN_HDRSZ 2 -#define RLC_AM_PDU_18BIT_SN_HDRSZ 3 -#define RLC_AM_SEG_12BIT_SN_WITH_SO_HDRSZ 4 -#define RLC_AM_SEG_18BIT_SN_WITH_SO_HDRSZ 5 -#define RLC_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ 2 -#define RLC_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ 3 -#define RLC_EXTN_HDRSZ 2 -#define RLC_CNTRL_PDU_FIXED_HDRSZ 3 -#define RLC_MAC_HDR_SZ2 2 -#define RLC_MAC_HDR_SZ3 3 -#define RLC_BYTE_LEN 8 -#define RLC_2BYTE_LEN 16 -#define RLC_E1_LEN 1 -#define RLC_NACK_E1E2_LEN 12 -#define RLC_SO_LEN 15 -#define RLC_DC_LEN 1 -#define RLC_CPT_LEN 3 -#define RLC_RF_LEN 1 -#define RLC_P_LEN 1 -#define RLC_FI_LEN 2 -#define RLC_SI_LEN 2 -#define RLC_E_LEN 1 -#define RLC_SN_LEN 10 -#define RLC_SN_LEN_12BITS 12 -#define RLC_SN_LEN_18BITS 18 -#define RLC_LSF_LEN 1 -#define RLC_LI_LEN 11 -#define RLC_STA_PDU_R_BITS_ACKSN_12BITS 7 /* 5GNR : Num Reserved bits in STATUS PDU */ -#define RLC_STA_PDU_R_BITS_ACKSN_18BITS 1 -#define RLC_STA_PDU_R_BITS_NACKSN_12BITS 1 -#define RLC_STA_PDU_R_BITS_NACKSN_18BITS 3 -#define RLC_NACK_RANGE_LEN 8 -#define RLC_SO_LEN_5GNR 16 - -#define RLC_DC_POS 0x80 -#define RLC_DC_SHT 7 -#define RLC_POLL_POS 0x40 /* 5GNR */ -#define RLC_POLL_SHT 6 /* 5GNR */ -#define RLC_SI_POS 0x30 /* 5GNR */ -#define RLC_SI_SHT 4 /* 5GNR */ -#define RLC_SN_POS_12BIT 0x0F -#define RLC_SN_POS_18BIT 0x03 -#define RLC_AM_GET_WIN_SZ(_snLen) ((RLC_AM_CFG_12BIT_SN_LEN == (_snLen)) ? (2048) : (131072)) /* 5GNR */ -#define RLC_RCV_BUF_BIN_SIZE 512 /* receive buffer size */ -#define RLC_TX_BUF_BIN_SIZE 512 /* receive buffer size */ - -#define RLC_SDU_LST 1 -#define RLC_SEG_LST 2 -#define RLC_RETX_LST 3 -#define RLC_ALL_BYTES_MISSING 0xffff - -#define RLC_MAX_PDU_MAP 30 /*!< Maximum PDU Map. */ - -#define RLC_LLIST_FIRST_SDU(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP)*/ \ - if((tmpNode=cmLListFirst(&lstCp))) \ - nod = (RlcSdu *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - - -#define RLC_LLIST_FIRST_SEG(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP)*/ \ - if((tmpNode=cmLListFirst(&lstCp))) \ - nod = (RlcSeg *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - -#define RLC_LLIST_FIRST_RETX(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP)*/ \ - if((tmpNode=cmLListFirst(&lstCp))) \ - nod = (RlcRetx *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - -#define RLC_LLIST_NEXT_SDU(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP) */ \ - if((tmpNode = cmLListNext(&lstCp))) \ - nod = (RlcSdu *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - - -#define RLC_LLIST_NEXT_SEG(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - (lstCp).crnt = &((nod)->lstEnt); \ - /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP)*/ \ - if((tmpNode = cmLListNext(&lstCp))) \ - nod = (RlcSeg *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - - -#define RLC_LLIST_NEXT_RETX(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ - /*if (tmpNode != NULLP) */ \ - if ((tmpNode = cmLListNext(&lstCp))) \ - nod = (RlcRetx *)tmpNode->node; \ - else \ - nod = NULLP; \ -} - - -#define RLC_LLIST_LAST_RETX(lstCp, nod) \ -{ \ - CmLList *tempNode = NULLP; \ - cmLListLast(&lstCp); \ - tempNode = cmLListCrnt(&lstCp); \ - if (tempNode != NULLP) \ - nod = (RlcRetx *)tempNode->node; \ - else \ - nod = NULLP; \ -} - -#define RLC_LLIST_LAST_SEG(lstCp, nod) \ -{ \ - CmLList *tempNode = NULLP; \ - cmLListLast(&lstCp); \ - tempNode = cmLListCrnt(&lstCp); \ - if (tempNode != NULLP) \ - nod = (RlcSeg *)tempNode->node; \ - else \ - nod = NULLP; \ -} - -#define RLC_LLIST_LAST_SDU(lstCp, nod) \ -{ \ - CmLList *tempNode = NULLP; \ - cmLListLast(&lstCp); \ - tempNode = cmLListCrnt(&lstCp); \ - if (tempNode != NULLP) \ - nod = (RlcSdu *)tempNode->node; \ - else \ - nod = NULLP; \ -} - -#define CM_LLIST_INS_AFT_CRNT(lstCp, nod) \ -{ \ - CmLList *nodeToIns = &nod->lstEnt;\ - nodeToIns->node = (PTR) nod;\ - cmLListInsAfterCrnt(&lstCp, nodeToIns); \ -} - -#define CM_LLIST_INS_BEF_CRNT(lstCp, nod) \ -{ \ - CmLList *nodeToIns = &nod->lstEnt; \ - nodeToIns->node = (PTR) nod; \ - cmLListInsCrnt(&lstCp, nodeToIns); \ -} - -#define RLC_LLIST_DEL_RECBUF(_recBuf) \ -{ \ - RlcSeg *_seg = NULLP; \ - RLC_LLIST_FIRST_SEG(_recBuf->segLst, _seg); \ - while (_seg) \ - { \ - cmLListDelFrm(&_recBuf->segLst, &_seg->lstEnt); \ - RLC_FREE(_seg, sizeof(RlcSeg)); \ - RLC_LLIST_NEXT_SEG(_recBuf->segLst, _seg); \ - } \ -} - -#define RLC_UMM_LLIST_FIRST_SEG(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - if((tmpNode=cmLListFirst(&lstCp))) \ - nod = (RlcUmSeg *)tmpNode->node; \ - else \ - nod = NULLP; \ -} /*!< um mode first segment of linked list*/ - -#define RLC_UMM_LLIST_NEXT_SEG(lstCp, nod) \ -{ \ - CmLList *tmpNode; \ - (lstCp).crnt = &((nod)->lstEnt); \ - if((tmpNode = cmLListNext(&lstCp))) \ - nod = (RlcUmSeg *)tmpNode->node; \ - else \ - nod = NULLP; \ -}/*!< next segment in um mode linked list*/ - -#define MODAMT(x, y, z,_snModMask) \ -{ \ - y = (x - z) & _snModMask; \ -} - -#define MODAMR(x, y, z , _snModMask) \ -{ \ - y = (x - z) & (_snModMask); \ -} - -/** - * @def RLC_AM_IS_TRANS_WIN_STALLED - * - * This macro is used to check if the AM transmit window is stalled or not. - * The tramist window is stalled when the distance between txNext and txNextAck - * is greater than equal to Window Size. Actually it should never be greater - * than Window Size. - * Returns TRUE if the window is stalled else FALSE - * - * @param[in] _amDl AM Downlink control block - * -*/ -#define RLC_AM_IS_TRANS_WIN_STALLED(_amDl) \ - ((((_amDl)->txNext - (_amDl)->txNextAck) & _amDl->snModMask) >= (RLC_AM_GET_WIN_SZ(_amDl->snLen))) - -#ifdef TENB_STATS -#define RLC_AM_TRANS_WIN_SIZE(_amDl) \ - (((_amDl)->txNext - (_amDl)->txNextAck) & _amDl->snModMask) -#endif - -#define RLC_AM_IS_POLL_BIT_SET(_amDl) \ - (RLC_AMDL.pollSn == ((RLC_AMDL.txNext - 1) & RLC_AMDL.snModMask)) - -#define RLC_FILL_CNTRL_INFO(cntrlInfo, _val, _len, _idx, _eb)\ -{ \ - cntrlInfo.val = _val; \ - cntrlInfo.len = _len; \ - cntrlInfo.idx = _idx; \ - cntrlInfo.emtBits = _eb; \ -} -#define RLC_FILL_PREV_IDX(cntrlInfo, _e1Idx, _e1eb, _idx, _eb) \ -{ \ - _e1Idx = cntrlInfo.e1Idx; \ - _e1eb = cntrlInfo.e1eb; \ - _idx = cntrlInfo.idx; \ - _eb = cntrlInfo.emtBits; \ -} - -#define RLC_FILL_HDR_ARGS(hdrInfo, _val, _len) \ -{ \ - hdrInfo.val = _val; \ - hdrInfo.len = _len; \ -} - -/* kw003.201 - This macro provides the header size other than the */ -/* fixed header of 2 bytes for each AMD PDU or 4 bytes*/ -/* for an AM PDU segment */ -#define RLC_AM_EXTN_HDRSZ(_numLi, _eHdrSz) \ -{ \ - if ((_numLi - 1) % 2) \ - { \ - _eHdrSz = ((3 * (_numLi - 2)) >> 1) + 2; \ - } \ - else \ - { \ - _eHdrSz = (3 * (_numLi - 1)) >> 1; \ - } \ -} - -/* Update poll bit in the buffer */ -#define RLC_UPD_POLL_BIT(_gCb, _retx, _poll) \ -{ \ - uint8_t fHdr; \ - \ - if (_poll != _retx->amHdr.p) \ - { \ - /* Get the first byte of the buffer */ \ - SRemPreMsg((Data *)&fHdr, _retx->seg); \ - if (_poll == TRUE) \ - { \ - fHdr = fHdr | RLC_POLL_SET; \ - } \ - else \ - { \ - fHdr = fHdr & RLC_POLL_UNSET; \ - } \ - /* Concatenated updated hdr to the mBuf */ \ - SAddPreMsg ((Data)fHdr, _retx->seg); \ - } \ - /* Update poll bit in the hdrInfo */ \ - _retx->amHdr.p = _poll; \ -} - -#define RLC_AM_ELIMINATE_EXTN_HDR(_pduSz, _sduSz, _numLi) \ -{ \ - if ( (_pduSz > _sduSz) && (_sduSz < 2048) ) \ - { \ - _pduSz -= (_numLi % 2) ? 1 : 2; \ - } \ -} -/** - * @def RLC_AM_CHK_SN_WITHIN_RECV_WINDOW - * - * This macro is used to check if a Sequence Number falls within the AM - * reception window or not. - * The condition is VR(R) <= SN < VR(MR), which are subtracting the base - * modulus becomes 0 <= (SN - VR(R)) % SNLen < (VR(MR) - VR(R)) % SnLen - * NOTE: Careful with the parantheses - * - * Returns TRUE if within the window; FALSE otherwise - * - * @param[in] _sn The sequence number to be checked - * @param[in] _amUl AM Uplink control block - * -*/ -#define RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(_sn, _amUl) \ - ((((_sn) - (_amUl->rxNext)) & (_amUl->snModMask)) < (((_amUl->vrMr) - (_amUl->rxNext)) & (_amUl->snModMask))) - -#define RLC_POWER(x, y) x << (y-1); - -#ifndef L2_OPTMZ -#define rlcCpyMsg(_cb,x, y) \ - (SAddMsgRef((x), RLC_GET_MEM_REGION(_cb), RLC_GET_MEM_POOL(_cb), (y))) -#else -/* L2 optimization for mUe/Tti: Removing dup buf*/ -#define rlcCpyMsg(_cb,x, y) \ - (SIncMsgRef((x), RLC_GET_MEM_REGION(_cb), RLC_GET_MEM_POOL(_cb), (y))) -#endif - -// printf("Copy Msg %x \n",x); - -/******************************************************************************* - * Debugging Defines - ******************************************************************************/ -#define RLC_DBG_SUB_MASK DBGMASK_MI /**< Use for sub-mask */ -#define RLC_DBGMASK_DETAIL (RLC_DBG_SUB_MASK << 0) /**< Parameters, It will give - in depth info */ -#define RLC_DBGMASK_BRIEF (RLC_DBG_SUB_MASK << 1) /**< Info, It will give info at - entry and exit places along - with certain state changes */ -#define RLC_DBGMASK_ERROR (RLC_DBG_SUB_MASK << 2) /**< Error information */ -#define RLC_DBGMASK_FATAL (RLC_DBG_SUB_MASK << 3) /**< FATAL errors like memory - resource failure etc., */ - -#define RLC_DBG_MDL_MASK (RLC_DBG_SUB_MASK << 4) - -#define RLC_DBGMASK_TM (RLC_DBG_MDL_MASK << 0) /**< TM */ -#define RLC_DBGMASK_UM (RLC_DBG_MDL_MASK << 1) /**< UM */ -#define RLC_DBGMASK_AM (RLC_DBG_MDL_MASK << 2) /**< AM */ -#define RLC_DBGMASK_DL (RLC_DBG_MDL_MASK << 3) /**< DL */ -#define RLC_DBGMASK_UL (RLC_DBG_MDL_MASK << 4) /**< UL */ -#define RLC_DBGMASK_CFG (RLC_DBG_MDL_MASK << 5) /**< CFG */ -#define RLC_DBGMASK_LMM (RLC_DBG_MDL_MASK << 6) /**< LMM */ -#define RLC_DBGMASK_INF (RLC_DBG_MDL_MASK << 7) /**< UI, LI */ -#define RLC_DBGMASK_DUT (RLC_DBG_MDL_MASK << 8) /**< DBM, UTL, TMR */ -#define RLC_DBGMASK_MBUF_PRNT (RLC_DBG_MDL_MASK << 9) /**< MBUF, useful in - integrated - testing */ -#define RLC_DBGMASK_MEM_INFO (RLC_DBG_MDL_MASK << 10) /**< Print SSI memory - information*/ -#define RLC_DBGMASK_UDX (RLC_DBG_MDL_MASK << 11) /**< UDX interface */ - -#ifdef DEBUGP -#define RLC_PRNT_BORDER \ -do \ -{ \ - RLC_PRNT((_kwPBuf, "\n==========================\n")); \ -}while(0) - -#define RLC_PRNT_HLINE(_cb,_pMsg) \ -{ \ - sprintf((_cb)->init.prntBuf, "[RLC_LAYER: %s:%d]::", __FILE__, __LINE__); \ - SPrint((_cb)->init.prntBuf); \ - RLC_PRNT_TSTAMP(_cb); \ - sprintf((_cb)->init.prntBuf, _pMsg); \ - SPrint((_cb)->init.prntBuf); \ -} - -#define RLC_PRNT(_cb,_prntbuf) \ -{ \ - sprintf _prntbuf; \ - SPrint(_cb->init.prntBuf); \ -} - -#define RLC_PRINT_TO_BUFFER(_cb,...) \ -{ \ - snprintf((_cb)->init.prntBuf, PRNTSZE, "[%s]::", __func__); \ - SPrint((_cb)->init.prntBuf); \ - snprintf(_cb->init.prntBuf, PRNTSZE,__VA_ARGS__); \ - SPrint(_cb->init.prntBuf); \ -} - -#define RLC_PRNT_TSTAMP(_cb) \ -{ \ - S8 _buf[60]; \ - DateTime dt; \ - memset((&dt), 0, sizeof(DateTime)); \ - SGetDateTime(&dt); \ - sprintf(_buf, "date: %02d/%02d/%04d time: %02d:%02d:%02d", \ - (int)dt.month,(int)dt.day,(int)dt.year + 1900, \ - (int)dt.hour,(int)dt.min,(int)dt.sec); \ - RLC_PRNT(_cb,(_cb->init.prntBuf,("[%s]", _buf))); \ -} - -#define RLC_PRNT_MBUF(_cb,_mBufPtr) \ -do \ -{ \ - if(_cb->init.dbgMask & (RLC_DBGMASK_MBUF_PRNT)) \ - { \ - RLC_PRNT_HLINE(_cb,("\nMessage Buffer Contents:\n")); \ - SPrntMsg ((Buffer *)_mBufPtr, 0, 0); \ - } \ -}while(0) - -#define RLC_PRNT_MEMINFO(_cb) \ -do \ -{ \ - uint32_t _memInfo; \ - if(_cb->init.dbgMask & (RLC_DBGMASK_MEM_INFO)) \ - { \ - RLC_PRNT_HLINE(_cb,("\nMemory Information:\n")); \ - SRegInfoShow(0, &_memInfo); \ - } \ -}while(0) - -#define RLCDBGP_INTERNAL(_cb,_mask,...) \ -do \ -{ \ - if (!((_cb->init.dbgMask & _mask) ^ _mask)) \ - { \ - RLC_PRINT_TO_BUFFER(_cb, __VA_ARGS__); \ - } \ -}while(0) - -#define RLCDBGP_ERROR(_cb, ...) \ - RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_ERROR | RLC_MODULE),__VA_ARGS__) - -#define RLCDBGP_DETAIL(_cb, ...) \ - RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_DETAIL | RLC_MODULE),__VA_ARGS__) - -#define RLCDBGP_BRIEF(_cb, ...) \ - RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_BRIEF | RLC_MODULE),__VA_ARGS__) - -#else /* DEBUGP */ -#define RLC_PRNT_HLINE(_cb,_pMsg) -#define RLC_PRNT(_cb,_prntbuf) -#define RLC_PRNT_TSTAMP(_cb) -#define RLC_PRNT_MBUF(_cb,_mBufPtr) -#define RLC_PRNT_MEMINFO(_cb) -#define RLCDBGP(_cb,_mask, _arg) -#define RLCDBGP_ERROR(_cb, ...) -#define RLCDBGP_DETAIL(_cb, ...) -#define RLCDBGP_BRIEF(_cb, ...) -#endif /* DEBUGP */ - -/******************************************************************************* - * LMM Defines - ******************************************************************************/ -#define RLC_LMM_RB_STS_INC(_cb) (_cb)->genSts.numOfRb++; - -#define RLC_LMM_RB_STS_DEC(_cb) (_cb)->genSts.numOfRb--; - -#if defined(SS_MULTICORE_SUPPORT) && defined(SS_M_PROTO_REGION) -#define RLC_FILL_SAP_HELPER(_Sap, _cfg, _gCb)\ -{\ - _Sap->pst.selector = _cfg->selector; \ - _Sap->pst.route = _cfg->route; \ - _Sap->pst.prior = _cfg->priority; \ - _Sap->pst.region = _gCb->init.region;\ - _Sap->pst.pool = _gCb->init.pool;\ - _Sap->pst.dstProcId = _cfg->procId; \ - _Sap->pst.dstEnt = _cfg->ent; \ - _Sap->pst.dstInst = _cfg->inst; \ - _Sap->pst.srcProcId = _gCb->init.procId; \ - _Sap->pst.srcEnt = _gCb->init.ent; \ - _Sap->pst.srcInst = _gCb->init.inst; \ - _Sap->pst.event = EVTNONE; \ - _Sap->spId = _cfg->sapId; \ - _Sap->state = RLC_SAP_CFG; \ -} -#else /* defined(SS_MULTICORE_SUPPORT) && defined(SS_M_PROTO_REGION) */ -#define RLC_FILL_SAP_HELPER(_Sap, _cfg, _gCb)\ -{\ - _Sap->pst.selector = _cfg->selector; \ - _Sap->pst.route = _cfg->route; \ - _Sap->pst.prior = _cfg->priority; \ - _Sap->pst.region = _cfg->mem.region;\ - _Sap->pst.pool = _cfg->mem.pool;\ - _Sap->pst.dstProcId = _cfg->procId;\ - _Sap->pst.dstEnt = _cfg->ent;\ - _Sap->pst.dstInst = _cfg->inst;\ - _Sap->pst.srcProcId = _gCb->init.procId;\ - _Sap->pst.srcEnt = _gCb->init.ent;\ - _Sap->pst.srcInst = _gCb->init.inst;\ - _Sap->pst.event = EVTNONE;\ - _Sap->spId = _cfg->sapId;\ - _Sap->state = RLC_SAP_CFG;\ -} -#endif - -/******************************************************************************* - * UDX Defines - ******************************************************************************/ -#define RLC_GET_DL_SAPCB(_cb, _rbCb) (_cb->u.dlCb->udxDlSap + _rbCb->udxSapId) -#define RLC_GET_UDX_SAP(_cb) (_cb->u.ulCb->udxUlSap) - -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#define RLC_L2_MAX_TIMERS 1 -#define RLC_QCI_LIST_BUCKET_SIZE 10 -#define RLC_TB_LIST_BUCKET_SIZE 10 -#define RLC_MAX_L2MEAS_EVT 10 -/* L2 Measurement index to be used in rbCb to store measData */ -#define RLC_L2MEAS_ACT_UE 0 -#define RLC_L2MEAS_DL_DELAY 1 -#define RLC_L2MEAS_DL_DISC 2 -#define RLC_L2MEAS_UU_LOSS 3 -#define RLC_L2MEAS_DL_IP 4 -#define RLC_L2MEAS_UL_IP 5 -#endif /* LTE_L2_MEAS */ - -#define RLC_RDWR_LOCK(_lockPtr) -#define RLC_RDWR_UNLOCK(_lockPtr) -#define RLC_TIME_DIFF(t1,t2) \ - (t1 */ -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS - RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */ -#endif /* LTE_L2_MEAS */ -}RlcUlCb; - -typedef struct rlcThptPerUe -{ - uint16_t ueIdx; - uint64_t dataVol; -}RlcThptPerUe; - -/** - * @brief Structure to hold information about throughput at RLC - * - */ -typedef struct rlcThpt -{ - Inst inst; /* RLC instance */ - CmTimer thptTmr; /* Throughput Timer */ - uint8_t numActvUe; /* Number of Active UEs */ - RlcThptPerUe thptPerUe[MAX_NUM_UE]; /* Throughput calculated per UE */ -}RlcThpt; - -/** - * @brief Structure to hold an information about a RLC instance - * - * @details - * - init : Task Initialization Info - * - genCfg : General Configuration - * - genSts : General Statistics - * - trcLen : Trace Length - * - trcMask : Trace Mask - * - rlcTq : Timer queue - * - rlcTqCp : Timer queue control point - * - u : Union depending on whether the instance is UL or DL - * - ulCb : UL instance Control Block - * - dlCb : DL instance Control Block - */ -typedef struct rlcCb -{ - TskInit init; /*!< Task Initialization Info */ - RlcGenCfg genCfg; /*!< General Configuration Structure */ - RlcGenSts genSts; /*!< General Statistics */ - S16 trcLen; /*!< Trace Length */ - uint8_t trcMask; /*!< Trace Mask */ - CmTqType rlcTq[RLC_TMR_LEN]; /*!< Timer queue */ - CmTqCp rlcTqCp; /*!< Timer queue control point */ - union - { - RlcUlCb *ulCb; /*!< Ul Control Block */ - RlcDlCb *dlCb; /*!< Dl Control Block */ - } u; - uint8_t dlSduId; /*!< Downlink SDU ID */ - RlcThpt rlcThpt; /*!< Throughput at RLC*/ -}RlcCb; - -RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */ - -/**************************************************************************** - * Declarations - ***************************************************************************/ -S16 rlcGetSId ARGS((SystemId *s)); - -Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt)); - -S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf)); - -void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt)); - -void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType)); - -bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt)); - -#ifdef LTE_L2_MEAS -Void rlcLmmSendAlarm ARGS (( RlcCb *gCb, - uint16_t category, - uint16_t event, - uint16_t cause, - SuId suId, - uint32_t ueId, - uint8_t qci)); - -S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt )); -S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType)); -S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType)); -S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt )); -S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType)); -S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType)); -Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData, - RlcL2MeasRbCb *rbL2Cb, - uint8_t measType)); -#else /* LTE_L2_MEAS */ -Void rlcLmmSendAlarm ARGS ((RlcCb *gCb, - uint16_t category, - uint16_t event, - uint16_t cause, - SuId suId, - uint32_t ueId)); -#endif /* LTE_L2_MEAS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __KWX__ */ - - -/********************************************************************30** - - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_dl.h b/src/5gnrrlc/kw_dl.h deleted file mode 100755 index 6fe855078..000000000 --- a/src/5gnrrlc/kw_dl.h +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: NR RLC file for downlink and non real time tasks - - Type: C include file - - Desc: This file contains helper macros for RLC downlink - and non real time task - - File: kw_dl.h - -*********************************************************************21*/ -/** @file kw_dl.h -@brief RLC Downlink helper macros -*/ - -#ifndef __KW_DLH__ -#define __KW_DLH__ -#define RLC_DL_INST 1 -#define RLC_MAX_RNG_DEQ_INDX 8 - -/* Below are the status used within RLC */ -#define RLC_SDU_OPAT_NOUPDATE 0 -#define RLC_SDU_OPAT_UPD_TX 1 -#define RLC_SDU_OPAT_UPD_RETX 2 - -/* Below are the status which needs to be updated to MAC */ -#define RLC_RGU_SDU_OPAT_NOUPDATE 0 -#define RLC_RGU_SDU_OPAT_UPDATE 1 -#define RLC_RGU_SDU_OPAT_BREACH 2 - -/* PDB Values for various QCI bearers : This value is considered - after taking into account a 20ms delay at the network */ -#define RLC_PDB_VALUE_FOR_QCI1 80 -#define RLC_PDB_VALUE_FOR_QCI2 130 -#define RLC_PDB_VALUE_FOR_QCI3 30 -#define RLC_PDB_VALUE_FOR_QCI4 280 -#define RLC_PDB_VALUE_FOR_QCI5 80 -#define RLC_PDB_VALUE_FOR_QCI6 280 -#define RLC_PDB_VALUE_FOR_QCI7 80 -#define RLC_PDB_VALUE_FOR_QCI8 280 -#define RLC_PDB_VALUE_FOR_QCI9 280 - -#define RLC_DATA_BITMASK 0x80 /* Data bitmask is used to fill D/C bit for data*/ -/** - * @def RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB - * - * This macro is used to check if DL IP throughput measurement is ON - * or off for the passed rb - * - * Returns TRUE (non-zero) if measurement is ON else FALSE (zero) - * - * @param[in] _gCb RLC DL Cb - * @param[in] _rbCb RLC downlink control block - * -*/ -#ifdef LTE_L2_MEAS -#define RLC_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(_gCb, _rbCb) \ - ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ - (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci])) - -#define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \ - ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ - (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_IP) && \ - (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_DL_IP)) - -#define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) \ - ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ - (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_DELAY)) - -#define RLC_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(_gCb, _rbCb) \ - ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ - (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UU_LOSS)) -#define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DELAY)) \ - { \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.sduDelay += _delay; \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.numSdus++; \ - } \ -} - -#define RLC_UPD_L2_UU_LOSS_PKTS(_rlcCb, _rlcRbCb, _val) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \ - { \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.dLoss += _val; \ - } \ -} -#define RLC_UPD_L2_UU_LOSS_POS_PKTS(_rlcCb,_rlcRbCb,_val) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \ - { \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.posPkts += _val; \ - } \ -} -/* Discard new changes starts */ -#define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ - { \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.discSdus++; \ - } \ -} - -#define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb,_rlcRbCb) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ - { \ - (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.totSdus++; \ - } \ -} - -#define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb) \ -{ \ - if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ - ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ - { \ - uint32_t idx1; \ - for (idx1 = 0; idx1 < LKW_MAX_L2MEAS; idx1++) \ - { \ - if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.measType & LKW_L2MEAS_DL_DISC) \ - { \ - if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci > 0) \ - { \ - _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci--; \ - if (_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci == 0) \ - { \ - _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.qci[(_rlcRbCb)->qci] = 0; \ - memset(&_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci], 0, \ - sizeof(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci])); \ - } \ - } \ - } \ - } \ - } \ -} -#else -#define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay) -#define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) -#define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) -#define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb) -#define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb, _rlcRbCb) -#define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb) -#endif - - -#endif /* __KW_DLH__ */ - -/********************************************************************30** - - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_ptli.c b/src/5gnrrlc/kw_ptli.c deleted file mode 100755 index 261ac789f..000000000 --- a/src/5gnrrlc/kw_ptli.c +++ /dev/null @@ -1,411 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: NR RLC Layer - Lower Interface - - Type: C file - - Desc: C source code for the lower interface of NR RLC - - File: kw_ptli.c - -*********************************************************************21*/ - -/** @file kw_ptli.c -@brief RLC Lower Interface -*/ - - -/* header (.h) include files */ -#include "common_def.h" -#include "lkw.h" /* LKW defines */ -#include "ckw.h" /* CKW defines */ -#include "kwu.h" /* KWU defines */ -#include "rgu.h" /* RGU defines */ -#ifdef KW_PDCP -#include "cpj.h" /* CPJ defines */ -#include "pju.h" /* PJU defines */ -#include "lpj.h" /* LPJ defines */ -#endif -#include "kw_err.h" -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ - -/* extern (.x) include files */ -#include "lkw.x" /* LKW */ -#include "ckw.x" /* CKW */ -#include "kwu.x" /* KWU */ -#include "rgu.x" /* RGU */ -#ifdef KW_PDCP -#include "cpj.x" /* CPJ defines */ -#include "pju.x" /* PJU defines */ -#include "lpj.x" /* LPJ defines */ -#endif -#include "kw.x" -#include "ss_rbuf.h" -#include "ss_rbuf.x" - -#ifndef LCKWLIRGU -#define PTKWRGU -#endif - -#ifndef RG -#define PTKWRGU -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - -#ifdef RLC_MAC_DAT_REQ_RBUF -S16 rlcLiRguDatReqRbuf(Pst *Post,SpId spId,Void *datReq); -#endif - -#ifdef RLC_MAC_STA_RSP_RBUF -S16 rlcLiRguStaRspRbuf(Pst *Post,SpId spId,Void *staRsp); -#endif -#if defined(MAC_RLC_HARQ_STA_RBUF) && defined(LTE_L2_MEAS) -S16 RlcDlHarqStaBatchProc (Void); -#endif - - -/********************************************************************* - * Primitives for RGU interface - ********************************************************************/ - -/* RGU Bind Request primitive */ - -RguBndReq kwLiRguBndReqMt[] = -{ -#ifdef LCKWLIRGU - cmPkRguBndReq, /* 0 - loosely coupled */ -#endif /* LCRGUIRGU */ -#ifdef RG - RgUiRguBndReq, /* 1 - tightly coupled, MAC */ -#endif /* RG */ -#ifdef LCKWLIRGU - cmPkRguBndReq, /* 0 - loosely coupled */ -#endif /* LCRGUIRGU */ -}; - -/* RGU Unbind Request primitive */ - -RguBndReq kwLiRguUbndReqMt[] = -{ -#ifdef LCKWLIRGU - cmPkRguUbndReq, /* 0 - loosely coupled */ -#endif /* LCRGUIRGU */ -#ifdef RG - RgUiRguUbndReq, /* 1 - tightly coupled, MAC */ -#endif /* RG */ -#ifdef LCKWLIRGU - cmPkRguUbndReq, /* 0 - loosely coupled */ -#endif /* LCRGUIRGU */ -}; - -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#ifdef LTE_RLC_R9 -/* RGU L2 Measurement Ul Ip Throughput Measurement Request primitive */ - -RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] = -{ -#ifdef LCKWLIRGU - cmPkRguL2MUlThrpMeasReq, /* 0 - loosely coupled */ -#endif /* LCRGUIRGU */ -#ifdef RG - RgUiRguL2MUlThrpMeasReq, /* 1 - tightly coupled, MAC */ -#endif /* RG */ -}; -#endif /* LTE_RLC_R9 */ -#endif /* LTE_L2_MEAS */ - -/**************************************************************************** - * RGU Interface Mt functions - ***************************************************************************/ -/** - * - * @brief - * - * Handler for RGU SAP bind Request. - * - * @b Description: - * - * This function is used by RLC to request for binding to - * MAC for accessing MAC services.This function binds MAC's - * SAP (identified by spId) with the service user's SAP - * (identified by suId). - * - * @param[in] pst Post structure - * @param[in] suId Service user SAP ID - * @param[in] spId Service provider ID - * - * @return S16 - * -# ROK - */ - -S16 RlcLiRguBndReq -( -Pst *post, /* post structure */ -SuId suId, /* Service User Id */ -SpId spId /* Service Provider Id */ -) -{ - - /* jump to specific primitive depending on configured selector */ - (*kwLiRguBndReqMt[post->selector])(post, suId, spId); - - return ROK; - -} /* end of RlcLiRguBndReq */ - - -/** - * - * @brief - * - * Handler for bind confirmation from MAC. - * - * @b Description: - * - * This function handles the bind confirmation received - * from MAC. - * - * @param[in] post - Post structure - * @param[in] suId - Service provider SAP ID - * @param[in] reason - Reason of confirmation - * - * @return S16 - * -# ROK - */ - -S16 RlcLiRguUbndReq(Pst *post,SpId spId,Reason reason) -{ - - /* jump to specific primitive depending on configured selector */ - (*kwLiRguUbndReqMt[post->selector])(post, spId, reason); - - return ROK; - -} /* end of RlcLiRguUbndReq */ - -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#ifdef LTE_RLC_R9 - -/** - * - * @brief - * - * Handler for sending ulThrpMeasReqInfo from RLC to MAC for UL ip throughput measurement. - * - * @b Description: - * - * This function sends ulThrpMeasReqInfo from RLC to MAC whenver UL ip throughput - * measurement is ON for a single or multiple qci in a UE. This is an indication for MAC - * to start the T2/T1 time stamps for the coresponding LCHs in the UE. - * - * @param[in] post Post structure - * @param[in] spId Service Provider ID - * @param[in] ulThrpMeasReqInfo Ul ip measurement request info - * - * @return S16 - * -# ROK - * -# RFAILED - * - */ -S16 RlcLiRguL2MUlThrpMeasReq(Pst *post,SpId spId,RguL2MUlThrpMeasReqInfo *l2mUlThrpMeasReq) -{ - - /* jump to specific primitive depending on configured selector */ - (*kwLiRguL2MUlThrpMeasReqMt[post->selector])(post, spId, l2mUlThrpMeasReq); - - return ROK; - -} /* end of RlcLiRguL2MUlThrpMeasReq */ - -#endif /* LTE_RLC_R9 */ -#endif /* LTE_L2_MEAS */ - - -#ifdef MAC_RLC_UL_RBUF -S16 rlcUlBatchProc ARGS ((Void)); -Void rlcUtlFreeUlRBuf ARGS((void)); - -S16 rlcUlBatchProc(Void) -{ -/* Read from Ring Buffer and process PDCP packets */ - RguDDatIndInfo *datInd; - Void *elmIndx = NULLP; - static Pst rlcUlRbfuPst={1,1,ENTRLC,0,ENTMAC,0,PRIOR0,RTESPEC,EVTRLCULDAT,0,0,0,0}; -/* Read from Ring Buffer and process PDCP packets */ - -#ifndef SS_RBUF - RguDedDatInd1 *rguDatInd = NULLP; - uint8_t rngBufDeqIndx = 0; - - elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); - while(NULLP != elmIndx) - { - rguDatInd = (RguDedDatInd1 *)elmIndx; - datInd = (RguDDatIndInfo*) rguDatInd->msg; - SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].nPktProc++;//Number of pkt processed in tti - if(datInd != NULLP) - { - RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd); - } - else - { - DU_LOG("\nERROR --> RLC UL : Received NULL buffer"); - } - rguDatInd->msg=NULLP; - SRngIncrRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); - elmIndx = NULLP; - rguDatInd = NULLP; - - rngBufDeqIndx++; - - //if(rngBufDeqIndx >= SS_RNG_MAX_ULMAC_TO_ULRLC_DQ_CNT) - // break; - - if((elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC)) == NULLP) - break; - } -#else - elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); - while(NULLP != elmIndx) - { - datInd = (RguDDatIndInfo *)elmIndx; - RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd); - - elmIndx = NULLP; - datInd = NULLP; - SRngIncrRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); - - if((elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC)) == NULLP) - break; - } -#endif - return ROK; - -} - -/** - * - * @brief - * Handler to clear Ring buffer from UL RLC - * - * @details - * This function clears all the ring buffer content from UL RLC - * - * @return S16 - * -# ROK - * -# RFAILED - * - */ -Void rlcUtlFreeUlRBuf(void) -{ - RguDDatIndInfo *datInd; - PTR elem; - uint8_t numLch; - uint8_t numPdu; - - /* Free SS_RNG_BUF_ULMAC_TO_ULRLC */ - while((SDeqSRngBuf (SS_RNG_BUF_ULMAC_TO_ULRLC, &elem) == ROK)) - { - datInd = (RguDDatIndInfo *)elem; - for(numLch = 0; numLch< datInd->numLch; numLch++) - { - for(numPdu = 0; numPdu < datInd->lchData[numLch].pdu.numPdu; numPdu++) - { - if(datInd->lchData[numLch].pdu.mBuf[numPdu]) - { - ODU_PUT_MSG_BUF(datInd->lchData[numLch].pdu.mBuf[numPdu]); - } - } - } - RLC_PST_FREE(0, 0, datInd, sizeof(RguDDatIndInfo)); - } -} -#endif -#ifdef RLC_MAC_STA_RSP_RBUF -S16 rlcLiRguStaRspRbuf(Pst *post,SpId spId,Void *staRsp) -{ - S16 ret1 = ROK; - - Void *elem = NULLP; - - RguDStaRspInfo *staRspInfo = NULL; - elem = SRngGetWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); - if (NULLP != elem) - { - staRspInfo = (RguDStaRspInfo *)elem; - memcpy(staRspInfo, staRsp, sizeof(RguDStaRspInfo)); - staRspInfo->post = *post; - SRngIncrWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); - SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktRate++; - } - else - { - DU_LOG("\nERROR --> RLC_DL : RLC DL STA RSP RBUF is FULL!!! "); - SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktDrop++; - ret1 = RFAILED; - } - return (ret1); -} /* cmPkRlcDatReq */ - -#endif -#ifdef RLC_MAC_DAT_REQ_RBUF -S16 rlcLiRguDatReqRbuf(Pst *post,SpId spId,Void *datReq) -{ - S16 ret1 = ROK; - - Void *elem = NULLP; - RguInfoRingElem *datReqRing=NULLP; - elem = SRngGetWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ); - if (NULLP != elem) - { - datReqRing = (RguInfoRingElem *) elem; - datReqRing->spId = spId; - datReqRing->event = post->event; - datReqRing->msg =datReq; - SRngIncrWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ); - SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktRate++; - } - else - { - DU_LOG("\nERROR --> RLC_DL : RLC DL DAT REQ RBUF is FULL!!! \n"); - SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktDrop++; - ret1 = RFAILED; - } - return (ret1); -} /* cmPkRlcDatReq */ - -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/********************************************************************30** - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_ptmi.c b/src/5gnrrlc/kw_ptmi.c deleted file mode 100755 index 269626801..000000000 --- a/src/5gnrrlc/kw_ptmi.c +++ /dev/null @@ -1,367 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: RLC Layer Management interface - - Type: C source file - - Desc: This file contains source code for RLC layer management - interface primitives. It includes the definition of the - following functions and their portable function - definitions. - -- PjMiLpjCfgCfm - -- PjMiLpjCntrlCfm - -- PjMiLpjStaInd - - - File: kw_ptmi.c - -*********************************************************************21*/ - - -/* header (.h) include files */ -#include "common_def.h" -#include "lkw.h" /* LKW defines */ -#include "ckw.h" /* CKW defines */ -#include "kwu.h" /* KWU defines */ -#include "rgu.h" /* RGU defines */ - -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ - -/* extern (.x) include files */ -#include "lkw.x" /* LKW */ -#include "ckw.x" /* CKW */ -#include "kwu.x" /* KWU */ -#include "rgu.x" /* RGU */ - -#include "kw.x" - -/* local defines */ -#define MAXKWMI 2 /* max. layer management interfaces */ - - -/********************************************************************* - * Primitives for LKW interface - ********************************************************************/ -/* Configuration confirmation primitive */ - -static RlcConfigCfm rlcMiRlcConfigCfmMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - packRlcConfigCfm, /* 0 - loosely coupled - fc */ -#endif /* LCRLMILKW */ -#ifdef SM - SmMiRlcConfigCfm, /* 1 - tightly coupled layer management*/ -#endif /* SM */ -}; - -/* control confirmation primitives */ - -static LkwCntrlCfm kwMiLkwCntrlCfmMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - cmPkLkwCntrlCfm, /* 0 - loosely coupled - fc */ -#endif /* LCRLMILKW */ -#ifdef SM - SmMiLkwCntrlCfm, /* 1 - tightly coupled layer management*/ -#endif /* SM */ -}; - -/* Status Indication primitive */ - -static LkwStaInd kwMiLkwStaIndMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - cmPkLkwStaInd, /* 0 - loosely coupled */ -#endif /* LCKWMILKW */ -#ifdef SM - SmMiLkwStaInd, /* 1 - tightly coupled, layer management */ -#endif /* SM */ -}; - -/* Status confirm primitive */ - -static LkwStaCfm kwMiLkwStaCfmMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - cmPkLkwStaCfm, /* 0 - loosely coupled */ -#endif /* LCKWMILKW */ -#ifdef SM - SmMiLkwStaCfm, /* 1 - tightly coupled, layer management */ -#endif /* SM */ -}; - -/* Statistics confirm primitive */ - -static LkwStsCfm kwMiLkwStsCfmMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - cmPkLkwStsCfm, /* 0 - loosely coupled */ -#endif /* LCRLMILKW */ -#ifdef SM - SmMiLkwStsCfm, /* 1 - tightly coupled, layer management */ -#endif /* SM */ -}; - -/* Trace indication primitive */ - -static LkwTrcInd kwMiLkwTrcIndMt[MAXKWMI] = -{ -#ifdef LCKWMILKW - cmPkLkwTrcInd, /* 0 - loosely coupled */ -#endif /* LCKWMILKW */ -#ifdef SM - SmMiLkwTrcInd, /* 1 - tightly coupled, layer management */ -#endif /* SM */ -}; - -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -static const LkwL2MeasCfm rlcMiLkwL2MeasCfmMt[] = -{ -#ifdef LCKWMILKW - cmPkLkwL2MeasCfm, -#endif -#ifdef SM - SmMiLkwL2MeasCfm, -#endif -}; -static const LkwL2MeasStopCfm RlcMiLkwL2MeasStopCfmMt[] = -{ -#ifdef LCKWMILKW - cmPkLkwL2MeasStopCfm, -#endif -#ifdef SM - SmMiLkwL2MeasStopCfm, -#endif -}; -#endif /* LTE_L2_MEAS */ - -/**************************************************************************** - * LKW Interface Mt functions - ***************************************************************************/ -/** - @brief - This function is called by the RlcMiRlcConfigReq function for responding - to configuration requests.The cfm field in the RlcMngmt structure contains - the response value. - - - This function calls the mapping matrix for sending the configuration - confirmation. - - The actual function called depends on the coupling at the LKW interface. - - For a loosely coupled interface, a common packing function is called. - - The packing function packs the parameter in a message buffer and posts - the message to the target task. - - For a tightly coupled interface, the actual function called depends on - the layer manager API provided. - -*/ -S16 RlcMiRlcConfigCfm -( -Pst *pst, /* post structure */ -RlcMngmt *cfm /* Layer Management structure */ -) -{ - - /* jump to specific primitive depending on configured selector */ - (*rlcMiRlcConfigCfmMt[pst->selector])(pst, cfm); - - return ROK; -} - - -/** - @brief - This function is called by the RlcMiLkwCntrlReq function to send a control confirm to the layer management module. - - - This function calls the mapping matrix for sending the control confirmation. - - Actual function called depends on the coupling of the LKW interface. - - For a loosely coupled interface, a common packing function is called. - - The packing function packs the parameter in a message buffer and posts the - message to the target task. - - For a tightly coupled interface, the actual function called depends on the - layer manager API provided. - -*/ -S16 RlcMiLkwCntrlCfm -( -Pst *pst, /* post structure */ -RlcMngmt *cfm /* configure */ -) -{ - - /* jump to specific primitive depending on configured selector */ - (*kwMiLkwCntrlCfmMt[pst->selector])(pst, cfm); - - return ROK; - -} /* end of RlcMiLkwCntrlCfm */ - -/** - @brief - Description: - - This function can be used by RLC to send unsolicited status information - to the layer manager, when the unsolicited status flag is enabled by the - layer manager through a previous control request. - - - This function calls the mapping matrix for sending the unsolicited status - indication.The actual function called depends on the coupling of the - LKW interface. - - - For a loosely coupled interface, a common packing function is called. The - packing function packs the parameter in a message buffer and posts the - message to the target task. - - - For a tightly coupled interface, the actual function called depends on - the layer manager API provided. -*/ -S16 RlcMiLkwStaInd -( -Pst *pst, /* post structure */ -RlcMngmt *usta /* unsolicited status */ -) -{ - /* jump to specific primitive depending on configured selector */ - (*kwMiLkwStaIndMt[pst->selector])(pst, usta); - - return (ROK); -} /* end of RlcMiLkwStaInd */ - - -/** - @brief - - This function is called by the RlcMiLkwStaReq function to send - the requested status information to the layer manager. - - - This function calls the mapping matrix for sending the status - confirmation. The actual function called depends on the coupling - of the LKW interface. - - - For a loosely coupled interface, a common packing function is called. - The packing function packs the parameter in a message buffer and - posts the message to the target task. - - - For a tightly coupled interface, the actual function called depends - on the layer manager API provided. - -*/ -S16 RlcMiLkwStaCfm -( -Pst *pst, /* post structure */ -RlcMngmt *cfm /* solicited status confirmation */ -) -{ - - /* jump to specific primitive depending on configured selector */ - (*kwMiLkwStaCfmMt[pst->selector])(pst, cfm); - - return ROK; - -} /* end of RlcMiLkwStaCfm */ - - -/** - @brief - - This function is called by the RlcMiLkwStsReq function for responding - to statistics requests. - - - This function calls the mapping matrix for sending the statistics - confirmation. The actual function called depends on the coupling - of the LKW interface. - - - For a loosely coupled interface, a common packing function is called. - The packing function packs the parameter in a message buffer and - posts the message to the target task. - - - For a tightly coupled interface, the actual function called depends - on the layer manager API provided. - -*/ -S16 RlcMiLkwStsCfm -( -Pst *pst, /* post structure */ -Action action, /* action */ -RlcMngmt *cfm /* statistics confirmation */ -) -{ - /* jump to specific primitive depending on configured selector */ - (*kwMiLkwStsCfmMt[pst->selector])(pst, action, cfm); - - return ROK; - -} /* end of RlcMiLkwStsCfm */ - -/** - @brief - - This function can be used by RLC module to send unsolicited trace - indications to the layer manager, when tracing is enabled by the - layer manager through a previous control request. - - - This function calls the mapping matrix for sending the trace indication. - The actual function called depends on the coupling of the LKW interface. - - - For a loosely coupled interface, a common packing function is called. - The packing function packs the parameter in a message buffer and posts - the message to the target task. - - - For a tightly coupled interface, the actual function called depends on - the layer manager API provided. - -*/ -S16 RlcMiLkwTrcInd -( -Pst *pst, /* post structure */ -RlcMngmt *trc, /* trace indication */ -Buffer *mBuf /* message buffer */ -) -{ - /* jump to specific primitive depending on configured selector */ - (*kwMiLkwTrcIndMt[pst->selector])(pst, trc, mBuf); - - return ROK; - -} /* end of RlcMiLkwTrcInd */ - - -/* kw005.201 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -S16 RlcMiLkwL2MeasCfm(Pst * pst,RlcL2MeasCfmEvt *measEvt) -{ - - (*rlcMiLkwL2MeasCfmMt[pst->selector])(pst, measEvt); - - return ROK; - -} -S16 RlcMiLkwL2MeasStopCfm(Pst *pst,uint8_t measType,uint8_t status) -{ - - (*RlcMiLkwL2MeasStopCfmMt[pst->selector])(pst, measType,status); - - return ROK; - -} -#endif /* LTE_L2_MEAS */ - -/********************************************************************30** - - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_udx.h b/src/5gnrrlc/kw_udx.h deleted file mode 100755 index 38b117e8e..000000000 --- a/src/5gnrrlc/kw_udx.h +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: UDX Control Interface - - Type: C include file - - Desc: This file Contains the Data structures for and prototypes - UDX Interface - - File: kw_udx.h - -*********************************************************************21*/ - -#ifndef __KW_UDX_H__ -#define __KW_UDX_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** @file kw_udx.h - @brief UDX Interface File (ckw.h) -*/ - -/* UDX Interface Hash Defines */ - -/* Loose Coupling define */ -#define UDX_SEL_LC 0 /*!< Loose Coupling Option */ -#define UDX_SEL_LWLC 1 -#define RLC_MAX_UDX 3 - - -/* CKW Interface defines */ -#define UDX_MAX_ENT_CFG 24 /*!< Maximum number of entities to configure */ - -#define ERRUDX 0 -#define EUDXXXX 0 -/* ckw_h_001.main_3 added support for L2 Measurement */ -#ifdef LTE_L2_MEAS -#define UDX_MAX_QCI 10 -#endif -/* CKW Interface configuration type */ -#define UDX_CFG_ADD 1 /*!< Add RLC Entity */ -#define UDX_CFG_MODIFY 2 /*!< Modify RLC Entity */ -#define UDX_CFG_DELETE 3 /*!< Delete RLC entity */ -#define UDX_CFG_REESTABLISH 4 /*!< Re-establish RLC entity */ -#define UDX_CFG_DELETE_UE 5 /*!< Release RLC entities per UE */ -#define UDX_CFG_DELETE_CELL 6 /*!< Release RLC entities per Cell */ - -/* CKW RLC entity direction configuration */ -#define UDX_CFG_DIR_UL 1 /*!< Unlink direction */ -#define UDX_CFG_DIR_DL 2 /*!< Downlink direction */ -#define UDX_CFG_DIR_BOTH 3 /*!< Both Downlink and Unlink */ - -/* CKW Configuration confirmations */ -#define UDX_CFG_CFM_OK 1 /*!< Configuration confirmation success */ -#define UDX_CFG_CFM_NOK 2 /*!< Configuration confirmation failed */ - -/*********************************************************************** - Defines for CKW Interface Events - ***********************************************************************/ -#define UDX_EVT_BND_REQ 0x01 /*!< Bind Request */ -#define UDX_EVT_BND_CFM 0x02 /*!< Bind Confirm */ -#define UDX_EVT_UBND_REQ 0x03 /*!< Unbind Request */ -#define UDX_EVT_CFG_REQ 0x04 /*!< Config Request */ -#define UDX_EVT_CFG_CFM 0x05 /*!< Config Confirm */ -#define UDX_EVT_UEIDCHG_REQ 0x06 /*!< UE Id Change Request */ -#define UDX_EVT_UEIDCHG_CFM 0x07 /*!< UE Id Change Confirm */ -#define UDX_EVT_STA_UPD_REQ 0x08 -#define UDX_EVT_STA_UPD_CFM 0x09 -#define UDX_EVT_STA_PDU_REQ 0x0A -#define UDX_EVT_STA_PHBT_TMR_START 0x0B -#define UDX_EVT_DL_CLEANUP_MEM 0x10 /*!< To cleanup memory in DL inst */ - -/*********************************************************************** - Defines for Measurements - ***********************************************************************/ -#define UDX_EVT_L2MEAS_REQ 0x11 -#define UDX_EVT_L2MEAS_SEND_REQ 0x12 -#define UDX_EVT_L2MEAS_STOP_REQ 0x13 - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - - -/********************************************************************30** - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_ul.h b/src/5gnrrlc/kw_ul.h deleted file mode 100755 index 00ec5d0bc..000000000 --- a/src/5gnrrlc/kw_ul.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* -################################################################################ -# Copyright (c) [2017-2019] [Radisys] # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -*******************************************************************************/ - -/********************************************************************20** - - Name: NR RLC file for uplink and non real time tasks - - Type: C include file - - Desc: This file contains helper macros for RLC uplink - and non real time tasks - - File: kw_ul.h - -*********************************************************************21*/ -/** - * @file kw_ul.h - * @brief RLC uplink helper macros -*/ - -#ifndef __KW_ULH__ -#define __KW_ULH__ - -/** - * @def RLC_MEAS_IS_UL_IP_MEAS_ON_FOR_RB - * - * This macro is used to check if UL IP throughput measurement is ON - * or off for the passed rb - * - * Returns TRUE(non-zero) if measurement is ON else FALSE (zero) - * - * @param[in] _gCb RLC UL Cb - * @param[in] _rbCb RLC uplink control block - * -*/ -#define RLC_MEAS_IS_UL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \ - ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ - (_gCb->u.ulCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UL_IP) && \ - (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_UL_IP)) -#endif /* __KW_ULH__ */ - -/********************************************************************30** - - End of file -**********************************************************************/ diff --git a/src/5gnrrlc/kw_amm_dl.c b/src/5gnrrlc/rlc_amm_dl.c similarity index 99% rename from src/5gnrrlc/kw_amm_dl.c rename to src/5gnrrlc/rlc_amm_dl.c index 609434df3..a9a1da365 100755 --- a/src/5gnrrlc/kw_amm_dl.c +++ b/src/5gnrrlc/rlc_amm_dl.c @@ -32,7 +32,7 @@ Duplicate detection for byte segments Reassemble SDUs - File: kw_amm_dl.c + File: rlc_amm_dl.c *********************************************************************21*/ /* header include files (.h) */ @@ -41,13 +41,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" - +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -55,9 +50,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" //UDAY #ifdef L2_OPTMZ @@ -88,7 +83,7 @@ Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb *gCb, /* private variable declarations */ -#define RLC_AM_RMV_HDR(_gCb, _rbCb, _retx) do { \ +#define RLC_AM_REMOVE_HDR(_gCb, _rbCb, _retx) do { \ if ((_retx)->yetToConst == FALSE) \ {\ Buffer *_pduInfo; \ @@ -1483,7 +1478,7 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) tNode->lstEnt.prev = 0; /* Segment header and data */ - RLC_AM_RMV_HDR(gCb, rbCb, retx); + RLC_AM_REMOVE_HDR(gCb, rbCb, retx); /* kw003.201 - Split the payload and update other fields */ rlcSplitPdu(gCb,rbCb, retx, tNode, rlcDatReq->pduSz); diff --git a/src/5gnrrlc/kw_amm_ul.c b/src/5gnrrlc/rlc_amm_ul.c similarity index 99% rename from src/5gnrrlc/kw_amm_ul.c rename to src/5gnrrlc/rlc_amm_ul.c index afdd33499..b77a4ca8d 100755 --- a/src/5gnrrlc/kw_amm_ul.c +++ b/src/5gnrrlc/rlc_amm_ul.c @@ -32,7 +32,7 @@ Duplicate detection for byte segments Reassemble SDUs - File: kw_amm_ul.c + File: rlc_amm_ul.c *********************************************************************21*/ @@ -42,12 +42,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_udx.h" -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_ul.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -55,10 +51,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" -#include "kw_udx.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_ul.h" /* Variable for logging, declared in cl */ #ifndef RGL_SPECIFIC_CHANGES #ifndef TENB_ACC diff --git a/src/5gnrrlc/kw_cfg_dl.c b/src/5gnrrlc/rlc_cfg_dl.c similarity index 99% rename from src/5gnrrlc/kw_cfg_dl.c rename to src/5gnrrlc/rlc_cfg_dl.c index e8f6ccca8..9c24eb424 100755 --- a/src/5gnrrlc/kw_cfg_dl.c +++ b/src/5gnrrlc/rlc_cfg_dl.c @@ -33,11 +33,11 @@ -- rlcCfgReEstRb -- rlcCfgDelUe - File: kw_cfg_dl.c + File: rlc_cfg_dl.c *********************************************************************21*/ -/** @file kw_cfg_dl.c +/** @file rlc_cfg_dl.c @brief RLC Downlink Configuration Module **/ @@ -49,11 +49,9 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* RLC error options */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_err.h" /* RLC error options */ +#include "rlc_env.h" /* RLC environment options */ + /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -61,9 +59,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #include "du_app_rlc_inf.h" #define RLC_MODULE RLC_DBGMASK_CFG diff --git a/src/5gnrrlc/kw_cfg_ul.c b/src/5gnrrlc/rlc_cfg_ul.c similarity index 99% rename from src/5gnrrlc/kw_cfg_ul.c rename to src/5gnrrlc/rlc_cfg_ul.c index 7f919cd38..6d64fc090 100755 --- a/src/5gnrrlc/kw_cfg_ul.c +++ b/src/5gnrrlc/rlc_cfg_ul.c @@ -28,10 +28,10 @@ -- rlcCfgFillRbCb -- rlcCfgRbInit - File: kw_cfg_ul.c + File: rlc_cfg_ul.c *********************************************************************21*/ -/** @file kw_cfg_ul.c +/** @file rlc_cfg_ul.c @brief RLC Uplink Configuration Module **/ @@ -42,10 +42,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* RLC error options */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_ul.h" +#include "rlc_err.h" /* RLC error options */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -53,8 +51,8 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_ul.h" #ifdef TENB_STATS #ifdef L2_L3_SPLIT #include "l2_tenb_stats.x" /* Total EnodeB Stats declarations */ diff --git a/src/5gnrrlc/kw_dbm_dl.c b/src/5gnrrlc/rlc_dbm_dl.c similarity index 98% rename from src/5gnrrlc/kw_dbm_dl.c rename to src/5gnrrlc/rlc_dbm_dl.c index b9de67840..68be78715 100755 --- a/src/5gnrrlc/kw_dbm_dl.c +++ b/src/5gnrrlc/rlc_dbm_dl.c @@ -44,7 +44,7 @@ - kwDbmDelAllCell - kwDbmShutdown - File: kw_dbm_dl.c + File: rlc_dbm_dl.c *********************************************************************21*/ @@ -55,21 +55,19 @@ #include "ckw.h" /* CKW defines */ #include "rgu.h" /* RGU defines */ #include "kwu.h" /* KWU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ + /* extern (.x) include files */ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "rgu.x" /* RGU */ #include "kwu.x" /* KWU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #ifdef TENB_STATS TSL2UeStatsCb* TSL2MapUeStatsBlk (uint16_t rnti); diff --git a/src/5gnrrlc/kw_dbm_ul.c b/src/5gnrrlc/rlc_dbm_ul.c similarity index 98% rename from src/5gnrrlc/kw_dbm_ul.c rename to src/5gnrrlc/rlc_dbm_ul.c index 21b588bf5..55ced399a 100755 --- a/src/5gnrrlc/kw_dbm_ul.c +++ b/src/5gnrrlc/rlc_dbm_ul.c @@ -24,7 +24,7 @@ Desc: Source code for Database Module functions such as, - File: kw_dbm_ul.c + File: rlc_dbm_ul.c *********************************************************************21*/ @@ -35,11 +35,9 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_ul.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -47,8 +45,8 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_ul.h" /** * @file gp_dbm_ul.c diff --git a/src/5gnrrlc/kw_dl.x b/src/5gnrrlc/rlc_dl.h similarity index 81% rename from src/5gnrrlc/kw_dl.x rename to src/5gnrrlc/rlc_dl.h index e686fae2b..ef6880e90 100755 --- a/src/5gnrrlc/kw_dl.x +++ b/src/5gnrrlc/rlc_dl.h @@ -18,24 +18,23 @@ /********************************************************************20** - Name: NR RLC file + Name: NR RLC file for downlink and non real time tasks - Type: C include file + Type: C include file - Desc: This file contains all the data structures and - prototypes for RLC. + Desc: This file contains helper macros for RLC downlink + and non real time task - File: kw_dl.x + File: rlc_dl.h *********************************************************************21*/ -/** - * @file kw_dl.x - * @brief RLC downlink structures, prototypes +/** @file rlc_dl.h +@brief RLC Downlink helper macros */ -#ifndef __KW_DLX__ -#define __KW_DLX__ - +#ifndef __RLC_DLH__ +#define __RLC_DLH__ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -46,6 +45,141 @@ extern "C" { #include "l2_tenb_stats.x" #endif #endif + +#define RLC_DL_INST 1 +#define RLC_MAX_RNG_DEQ_INDX 8 + +/* Below are the status used within RLC */ +#define RLC_SDU_OPAT_NOUPDATE 0 +#define RLC_SDU_OPAT_UPD_TX 1 +#define RLC_SDU_OPAT_UPD_RETX 2 + +/* Below are the status which needs to be updated to MAC */ +#define RLC_RGU_SDU_OPAT_NOUPDATE 0 +#define RLC_RGU_SDU_OPAT_UPDATE 1 +#define RLC_RGU_SDU_OPAT_BREACH 2 + +/* PDB Values for various QCI bearers : This value is considered + after taking into account a 20ms delay at the network */ +#define RLC_PDB_VALUE_FOR_QCI1 80 +#define RLC_PDB_VALUE_FOR_QCI2 130 +#define RLC_PDB_VALUE_FOR_QCI3 30 +#define RLC_PDB_VALUE_FOR_QCI4 280 +#define RLC_PDB_VALUE_FOR_QCI5 80 +#define RLC_PDB_VALUE_FOR_QCI6 280 +#define RLC_PDB_VALUE_FOR_QCI7 80 +#define RLC_PDB_VALUE_FOR_QCI8 280 +#define RLC_PDB_VALUE_FOR_QCI9 280 + +#define RLC_DATA_BITMASK 0x80 /* Data bitmask is used to fill D/C bit for data*/ +/** + * @def RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB + * + * This macro is used to check if DL IP throughput measurement is ON + * or off for the passed rb + * + * Returns TRUE (non-zero) if measurement is ON else FALSE (zero) + * + * @param[in] _gCb RLC DL Cb + * @param[in] _rbCb RLC downlink control block + * +*/ +#ifdef LTE_L2_MEAS +#define RLC_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(_gCb, _rbCb) \ + ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ + (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci])) + +#define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \ + ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ + (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_IP) && \ + (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_DL_IP)) + +#define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) \ + ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ + (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_DELAY)) + +#define RLC_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(_gCb, _rbCb) \ + ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ + (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UU_LOSS)) +#define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DELAY)) \ + { \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.sduDelay += _delay; \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.numSdus++; \ + } \ +} + +#define RLC_UPD_L2_UU_LOSS_PKTS(_rlcCb, _rlcRbCb, _val) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \ + { \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.dLoss += _val; \ + } \ +} +#define RLC_UPD_L2_UU_LOSS_POS_PKTS(_rlcCb,_rlcRbCb,_val) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \ + { \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.posPkts += _val; \ + } \ +} +/* Discard new changes starts */ +#define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ + { \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.discSdus++; \ + } \ +} + +#define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb,_rlcRbCb) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ + { \ + (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.totSdus++; \ + } \ +} + +#define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb) \ +{ \ + if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \ + ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \ + { \ + uint32_t idx1; \ + for (idx1 = 0; idx1 < LKW_MAX_L2MEAS; idx1++) \ + { \ + if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.measType & LKW_L2MEAS_DL_DISC) \ + { \ + if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci > 0) \ + { \ + _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci--; \ + if (_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci == 0) \ + { \ + _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.qci[(_rlcRbCb)->qci] = 0; \ + memset(&_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci], 0, \ + sizeof(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci])); \ + } \ + } \ + } \ + } \ + } \ +} +#else +#define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay) +#define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) +#define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) +#define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb) +#define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb, _rlcRbCb) +#define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb) +#endif + + typedef struct rlcDlUeCb RlcDlUeCb; /** @@ -840,8 +974,7 @@ Void rlcUtlFreeDlMem ARGS(( Void)); } #endif /* __cplusplus */ -#endif /* __KW_DLX__ */ - +#endif /* __RLC_DLH__ */ /********************************************************************30** diff --git a/src/5gnrrlc/kw_dl_ex_ms.c b/src/5gnrrlc/rlc_dl_msg_router.c similarity index 98% rename from src/5gnrrlc/kw_dl_ex_ms.c rename to src/5gnrrlc/rlc_dl_msg_router.c index 16492a237..63c958b0c 100755 --- a/src/5gnrrlc/kw_dl_ex_ms.c +++ b/src/5gnrrlc/rlc_dl_msg_router.c @@ -25,11 +25,11 @@ Desc: C source code for the interface to System Services of NR RLC - File: kw_dl_ex_ms.c + File: rlc_dl_msg_router.c *********************************************************************21*/ -/** @filekw_dl_ex_ms.c +/** @filerlc_dl_msg_router.c @brief RLC System Services Interface */ @@ -40,11 +40,9 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ + /* extern (.x) include files */ @@ -52,9 +50,10 @@ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" + +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #include "du_app_rlc_inf.h" #include "rlc_mac_inf.h" diff --git a/src/5gnrrlc/kw_udx.c b/src/5gnrrlc/rlc_dl_ul_inf.c similarity index 98% rename from src/5gnrrlc/kw_udx.c rename to src/5gnrrlc/rlc_dl_ul_inf.c index ccb2f33fc..0538feea1 100755 --- a/src/5gnrrlc/kw_udx.c +++ b/src/5gnrrlc/rlc_dl_ul_inf.c @@ -25,18 +25,22 @@ Desc: This file Contains the packing and unpacking functions for UDX Interface - File: kw_udx.c + File: rlc_dl_ul_inf.c *********************************************************************21*/ #include "common_def.h" -#include "lkw.h" -#include "kw_udx.h" /* UDX defines */ -#include "kw.h" +#include "rgu.h" /* RGU interface includes*/ +#include "lkw.h" /* LKW defines */ +#include "ckw.h" /* CKW defines */ /* extern (.x) include files */ -#include "lkw.x" -#include "kw_udx.x" - +#include "rgu.x" +#include "lkw.x" /* LKW */ +#include "ckw.x" /* CKW */ + +#include "rlc_env.h" +#include "rlc_utils.h" +#include "rlc_dl_ul_inf.h" /* UDX defines */ #ifdef LCUDX @@ -1236,7 +1240,7 @@ S16 cmUnpkUdxStaPduReq(UdxStaPduReq func,Pst *pst,Buffer *mBuf) * * Notes: None * -* File: kw_udx.c +* File: rlc_dl_ul_inf.c * */ S16 cmUnpkUdxStaProhTmrStart(UdxStaProhTmrStart func,Pst *pst,Buffer *mBuf) diff --git a/src/5gnrrlc/kw_udx.x b/src/5gnrrlc/rlc_dl_ul_inf.h similarity index 79% rename from src/5gnrrlc/kw_udx.x rename to src/5gnrrlc/rlc_dl_ul_inf.h index d63c6b113..e66af1bba 100755 --- a/src/5gnrrlc/kw_udx.x +++ b/src/5gnrrlc/rlc_dl_ul_inf.h @@ -17,32 +17,87 @@ *******************************************************************************/ /********************************************************************** + + Name: UDX Control Interface + + Type: C include file + + Desc: This file Contains the Data structures for and prototypes + UDX Interface - Name: NR RLC layer - - Type: C include file - - Desc: Defines required by LTE MAC - - File: kw_udx.x - - + File: rlc_dl_ul_inf.h + **********************************************************************/ -/** @file kw_udx.x -@brief This file contains basic data structures for the Uplink Downlink -interface. -*/ - -#ifndef __UDX_X__ -#define __UDX_X__ -#include "ckw.h" -#include "ckw.x" +#ifndef __RLC_DL_UL_INF_H__ +#define __RLC_DL_UL_INF_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ + +/** @file rlc_dl_ul_inf.h + @brief UDX Interface File (ckw.h) +*/ + +/* UDX Interface Hash Defines */ + +/* Loose Coupling define */ +#define UDX_SEL_LC 0 /*!< Loose Coupling Option */ +#define UDX_SEL_LWLC 1 +#define RLC_MAX_UDX 3 + + +/* CKW Interface defines */ +#define UDX_MAX_ENT_CFG 24 /*!< Maximum number of entities to configure */ + +#define ERRUDX 0 +#define EUDXXXX 0 +/* ckw_h_001.main_3 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#define UDX_MAX_QCI 10 +#endif +/* CKW Interface configuration type */ +#define UDX_CFG_ADD 1 /*!< Add RLC Entity */ +#define UDX_CFG_MODIFY 2 /*!< Modify RLC Entity */ +#define UDX_CFG_DELETE 3 /*!< Delete RLC entity */ +#define UDX_CFG_REESTABLISH 4 /*!< Re-establish RLC entity */ +#define UDX_CFG_DELETE_UE 5 /*!< Release RLC entities per UE */ +#define UDX_CFG_DELETE_CELL 6 /*!< Release RLC entities per Cell */ + +/* CKW RLC entity direction configuration */ +#define UDX_CFG_DIR_UL 1 /*!< Unlink direction */ +#define UDX_CFG_DIR_DL 2 /*!< Downlink direction */ +#define UDX_CFG_DIR_BOTH 3 /*!< Both Downlink and Unlink */ + +/* CKW Configuration confirmations */ +#define UDX_CFG_CFM_OK 1 /*!< Configuration confirmation success */ +#define UDX_CFG_CFM_NOK 2 /*!< Configuration confirmation failed */ + +/*********************************************************************** + Defines for CKW Interface Events + ***********************************************************************/ +#define UDX_EVT_BND_REQ 0x01 /*!< Bind Request */ +#define UDX_EVT_BND_CFM 0x02 /*!< Bind Confirm */ +#define UDX_EVT_UBND_REQ 0x03 /*!< Unbind Request */ +#define UDX_EVT_CFG_REQ 0x04 /*!< Config Request */ +#define UDX_EVT_CFG_CFM 0x05 /*!< Config Confirm */ +#define UDX_EVT_UEIDCHG_REQ 0x06 /*!< UE Id Change Request */ +#define UDX_EVT_UEIDCHG_CFM 0x07 /*!< UE Id Change Confirm */ +#define UDX_EVT_STA_UPD_REQ 0x08 +#define UDX_EVT_STA_UPD_CFM 0x09 +#define UDX_EVT_STA_PDU_REQ 0x0A +#define UDX_EVT_STA_PHBT_TMR_START 0x0B +#define UDX_EVT_DL_CLEANUP_MEM 0x10 /*!< To cleanup memory in DL inst */ + +/*********************************************************************** + Defines for Measurements + ***********************************************************************/ +#define UDX_EVT_L2MEAS_REQ 0x11 +#define UDX_EVT_L2MEAS_SEND_REQ 0x12 +#define UDX_EVT_L2MEAS_STOP_REQ 0x13 + typedef struct rlcNackInfo { uint8_t nackRange; @@ -297,12 +352,16 @@ S16 rlcUlUdxL2MeasStopReq ARGS((Pst* pst, uint8_t measType)); #endif + + + #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* __UDX_X__ */ +#endif -/********************************************************************** + +/********************************************************************30** End of file **********************************************************************/ diff --git a/src/5gnrrlc/kw_udx_dl.c b/src/5gnrrlc/rlc_dl_ul_inf_dl.c similarity index 98% rename from src/5gnrrlc/kw_udx_dl.c rename to src/5gnrrlc/rlc_dl_ul_inf_dl.c index 421ee67c4..77f652d33 100755 --- a/src/5gnrrlc/kw_udx_dl.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_dl.c @@ -24,7 +24,7 @@ Desc: Defines required by LTE MAC - File: kw_udx_dl.c + File: rlc_dl_ul_inf_dl.c **********************************************************************/ @@ -34,12 +34,9 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -47,10 +44,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #define RLC_MODULE RLC_DBGMASK_UDX /* local defines */ diff --git a/src/5gnrrlc/kw_udx_ptdl.c b/src/5gnrrlc/rlc_dl_ul_inf_ptdl.c similarity index 97% rename from src/5gnrrlc/kw_udx_ptdl.c rename to src/5gnrrlc/rlc_dl_ul_inf_ptdl.c index 536a245d2..cd222e008 100755 --- a/src/5gnrrlc/kw_udx_ptdl.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_ptdl.c @@ -24,11 +24,11 @@ Desc: C source code for INF Interface Module - File: kw_udx_ptdl.c + File: rlc_dl_ul_inf_ptdl.c **********************************************************************/ -/** @file kw_udx_ptdl.c +/** @file rlc_dl_ul_inf_ptdl.c */ /* header include files (.h) */ @@ -37,13 +37,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" - +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -51,10 +46,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #define UDX_MAX_SEL 3 diff --git a/src/5gnrrlc/kw_udx_ptul.c b/src/5gnrrlc/rlc_dl_ul_inf_ptul.c similarity index 98% rename from src/5gnrrlc/kw_udx_ptul.c rename to src/5gnrrlc/rlc_dl_ul_inf_ptul.c index 0e1bdd335..feb1e8fc8 100755 --- a/src/5gnrrlc/kw_udx_ptul.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_ptul.c @@ -24,11 +24,11 @@ Desc: C source code for INF Interface Module - File: kw_udx_ptul.c + File: rlc_dl_ul_inf_ptul.c **********************************************************************/ -/** @file kw_udx_ptul.c +/** @file rlc_dl_ul_inf_ptul.c */ /* header include files (.h) */ @@ -37,12 +37,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -50,10 +46,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #ifndef LCKWULUDX static S16 PtUlUdxBndReq ARGS((Pst* pst, SuId suId,SpId spId )); diff --git a/src/5gnrrlc/kw_udx_ul.c b/src/5gnrrlc/rlc_dl_ul_inf_ul.c similarity index 97% rename from src/5gnrrlc/kw_udx_ul.c rename to src/5gnrrlc/rlc_dl_ul_inf_ul.c index 630f42793..0831de8e4 100755 --- a/src/5gnrrlc/kw_udx_ul.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_ul.c @@ -24,11 +24,11 @@ Desc: Defines required by LTE MAC - File: kw_udx_ul.c + File: rlc_dl_ul_inf_ul.c **********************************************************************/ -/** @file kw_udx_ul.c +/** @file rlc_dl_ul_inf_ul.c @brief UDX Uplink Module */ @@ -38,13 +38,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_ul.h" -#include "kw_dl.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -52,14 +47,12 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" #include "du_app_rlc_inf.h" #include "rlc_mgr.h" -#include "rlc_utils.h" #define RLC_MODULE RLC_DBGMASK_UDX /* local defines */ diff --git a/src/5gnrrlc/kw_env.h b/src/5gnrrlc/rlc_env.h similarity index 97% rename from src/5gnrrlc/kw_env.h rename to src/5gnrrlc/rlc_env.h index c14fd1f17..5787d543f 100755 --- a/src/5gnrrlc/kw_env.h +++ b/src/5gnrrlc/rlc_env.h @@ -27,15 +27,15 @@ to reflect the software architecture needed to run under the target system hardware architecture. - File: kw_env.h + File: rlc_env.h *********************************************************************21*/ -/** @file kw_env.h +/** @file rlc_env.h @brief RLC Hash definitions */ -#ifndef __KWENVH__ -#define __KWENVH__ +#ifndef __RLC_ENV_H__ +#define __RLC_ENV_H__ #define MAX_RLC_INSTANCES 2 #define RLC_MAX_LI KWU_MAX_STA_IND_SDU @@ -82,7 +82,7 @@ #endif -#endif /* __KWENVH__ */ +#endif /* __RLC_ENV_H__ */ /********************************************************************30** diff --git a/src/5gnrrlc/kw_err.h b/src/5gnrrlc/rlc_err.h similarity index 99% rename from src/5gnrrlc/kw_err.h rename to src/5gnrrlc/rlc_err.h index 718a3dadf..c0a85d690 100755 --- a/src/5gnrrlc/kw_err.h +++ b/src/5gnrrlc/rlc_err.h @@ -24,15 +24,15 @@ Desc: This file contain the hash definations for RLC - File: kw_err.h + File: rlc_err.h *********************************************************************21*/ -/** @file kw_err.h +/** @file rlc_err.h @brief RLC Hash definitions */ -#ifndef __KW_ERR_H__ -#define __KW_ERR_H__ +#ifndef __RLC_ERR_H__ +#define __RLC_ERR_H__ #if (ERRCLASS & ERRCLS_INT_PAR) #define RLCLOGERROR(cb,errCls, errCode, errVal, errDesc) \ @@ -357,7 +357,7 @@ #define EKW227 (ERRKW + 227) /* gp_pj_tmr.c: 576 */ -#endif /* __KW_ERR_H__ */ +#endif /* __RLC_ERR_H__ */ /********************************************************************30** diff --git a/src/5gnrrlc/kw_lmm.c b/src/5gnrrlc/rlc_layer_mgr.c similarity index 99% rename from src/5gnrrlc/kw_lmm.c rename to src/5gnrrlc/rlc_layer_mgr.c index 7031615d6..f08d4e4fa 100755 --- a/src/5gnrrlc/kw_lmm.c +++ b/src/5gnrrlc/rlc_layer_mgr.c @@ -16,7 +16,7 @@ ################################################################################ *******************************************************************************/ -/********************************************************************20** +/************************************************************************ Name: NR RLC - Layer Manager file @@ -37,8 +37,8 @@ File: kw_lmm.c -*********************************************************************21*/ -/** @file kw_lmm.c +************************************************************************/ +/** @file rlc_layer_mgr.c @brief RLC Layer Manager Module **/ @@ -49,13 +49,9 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_dl.h" -#include "kw_ul.h" -#include "kw_udx.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -63,10 +59,10 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" #define RLC_MODULE RLC_DBGMASK_LMM diff --git a/src/5gnrrlc/kw_lim.c b/src/5gnrrlc/rlc_lwr_inf_mgr.c similarity index 98% rename from src/5gnrrlc/kw_lim.c rename to src/5gnrrlc/rlc_lwr_inf_mgr.c index d5f863cb2..23a140f48 100755 --- a/src/5gnrrlc/kw_lim.c +++ b/src/5gnrrlc/rlc_lwr_inf_mgr.c @@ -37,7 +37,7 @@ **********************************************************************/ /** - * @file kw_lim.c + * @file rlc_lwr_inf_mgr.c * @brief RLC Lower Interface module */ @@ -50,13 +50,10 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" -#include "kw_env.h" /* RLC environment options */ +#include "rlc_err.h" +#include "rlc_env.h" /* RLC environment options */ + -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" -#include "kw_ul.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -64,11 +61,10 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" -#include "rlc_utils.h" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" #include "rlc_mac_inf.h" #ifdef __cplusplus diff --git a/src/5gnrrlc/rlc_mgr.c b/src/5gnrrlc/rlc_mgr.c index 6de300671..3cfb3b77a 100644 --- a/src/5gnrrlc/rlc_mgr.c +++ b/src/5gnrrlc/rlc_mgr.c @@ -21,8 +21,8 @@ #include "lkw.h" /* LKW defines */ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* header/extern include files (.x) */ @@ -30,9 +30,8 @@ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ -#include "kw_err.h" -#include "kw.x" +#include "rlc_utils.h" /* RLC defines */ #include "du_app_rlc_inf.h" #include "rlc_mgr.h" diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 98f95add0..063d9e51f 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -22,26 +22,22 @@ #include "lkw.h" /* LKW defines */ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_ul.h" -#include "kw_dl.h" +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" + /* header/extern include files (.x) */ #include "rgu.x" #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ -#include "kw_err.h" -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" #include "rlc_mac_inf.h" #include "du_app_rlc_inf.h" -#include "rlc_utils.h" #include "rlc_upr_inf_api.h" /******************************************************************* diff --git a/src/5gnrrlc/kw_ptui.c b/src/5gnrrlc/rlc_portable_functions.c old mode 100755 new mode 100644 similarity index 54% rename from src/5gnrrlc/kw_ptui.c rename to src/5gnrrlc/rlc_portable_functions.c index 840d46028..c57cb077a --- a/src/5gnrrlc/kw_ptui.c +++ b/src/5gnrrlc/rlc_portable_functions.c @@ -18,18 +18,18 @@ /********************************************************************20** - Name: NR RLC Layer - Upper Interface + Name: NR RLC Layer - Lower Interface Type: C file - Desc: C source code for the upper interface of NR RLC + Desc: C source code for the lower interface of NR RLC - File: kw_ptui.c + File: kw_ptli.c *********************************************************************21*/ -/** @file kw_ptui.c -@brief RLC Upper Interface +/** @file rlc_portable_functions.c +@brief RLC Lower Interface */ @@ -39,31 +39,214 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ - -#include "kw_err.h" -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ +#ifdef KW_PDCP +#include "cpj.h" /* CPJ defines */ +#include "pju.h" /* PJU defines */ +#include "lpj.h" /* LPJ defines */ +#endif +#include "rlc_err.h" +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ +#ifdef KW_PDCP +#include "cpj.x" /* CPJ defines */ +#include "pju.x" /* PJU defines */ +#include "lpj.x" /* LPJ defines */ +#endif + +#include "rlc_utils.h" /* RLC defines */ +/* #if defined(MAC_RLC_UL_RBUF) || (defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF)) || defined(SS_RBUF) #include "ss_rbuf.h" #include "ss_rbuf.x" #endif -#include "kw.x" +*/ +#include "ss_rbuf.h" +#include "ss_rbuf.x" #if defined(L2_L3_SPLIT) && defined(ICC_RECV_TSK_RBUF) #include "mt_plat_t33.h" #include "mt_plat_t33.x" #endif +#ifndef LCKWLIRGU +#define PTKWRGU +#endif + +#ifndef RG +#define PTKWRGU +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - +/* local defines */ +#define MAXKWMI 2 /* max. layer management interfaces */ + +#ifdef RLC_MAC_DAT_REQ_RBUF +S16 rlcLiRguDatReqRbuf(Pst *Post,SpId spId,Void *datReq); +#endif + +#ifdef RLC_MAC_STA_RSP_RBUF +S16 rlcLiRguStaRspRbuf(Pst *Post,SpId spId,Void *staRsp); +#endif +#if defined(MAC_RLC_HARQ_STA_RBUF) && defined(LTE_L2_MEAS) +S16 RlcDlHarqStaBatchProc (Void); +#endif + + +/********************************************************************* + * Primitives for RGU interface + ********************************************************************/ + +/* RGU Bind Request primitive */ + +RguBndReq kwLiRguBndReqMt[] = +{ +#ifdef LCKWLIRGU + cmPkRguBndReq, /* 0 - loosely coupled */ +#endif /* LCRGUIRGU */ +#ifdef RG + RgUiRguBndReq, /* 1 - tightly coupled, MAC */ +#endif /* RG */ +#ifdef LCKWLIRGU + cmPkRguBndReq, /* 0 - loosely coupled */ +#endif /* LCRGUIRGU */ +}; + +/* RGU Unbind Request primitive */ + +RguBndReq kwLiRguUbndReqMt[] = +{ +#ifdef LCKWLIRGU + cmPkRguUbndReq, /* 0 - loosely coupled */ +#endif /* LCRGUIRGU */ +#ifdef RG + RgUiRguUbndReq, /* 1 - tightly coupled, MAC */ +#endif /* RG */ +#ifdef LCKWLIRGU + cmPkRguUbndReq, /* 0 - loosely coupled */ +#endif /* LCRGUIRGU */ +}; + +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#ifdef LTE_RLC_R9 +/* RGU L2 Measurement Ul Ip Throughput Measurement Request primitive */ + +RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] = +{ +#ifdef LCKWLIRGU + cmPkRguL2MUlThrpMeasReq, /* 0 - loosely coupled */ +#endif /* LCRGUIRGU */ +#ifdef RG + RgUiRguL2MUlThrpMeasReq, /* 1 - tightly coupled, MAC */ +#endif /* RG */ +}; +#endif /* LTE_RLC_R9 */ +#endif /* LTE_L2_MEAS */ + +/********************************************************************* + * Primitives for LKW interface + ********************************************************************/ +/* Configuration confirmation primitive */ + +static RlcConfigCfm rlcMiRlcConfigCfmMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + packRlcConfigCfm, /* 0 - loosely coupled - fc */ +#endif /* LCRLMILKW */ +#ifdef SM + SmMiRlcConfigCfm, /* 1 - tightly coupled layer management*/ +#endif /* SM */ +}; + +/* control confirmation primitives */ + +static LkwCntrlCfm kwMiLkwCntrlCfmMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + cmPkLkwCntrlCfm, /* 0 - loosely coupled - fc */ +#endif /* LCRLMILKW */ +#ifdef SM + SmMiLkwCntrlCfm, /* 1 - tightly coupled layer management*/ +#endif /* SM */ +}; + +/* Status Indication primitive */ + +static LkwStaInd kwMiLkwStaIndMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + cmPkLkwStaInd, /* 0 - loosely coupled */ +#endif /* LCKWMILKW */ +#ifdef SM + SmMiLkwStaInd, /* 1 - tightly coupled, layer management */ +#endif /* SM */ +}; + +/* Status confirm primitive */ + +static LkwStaCfm kwMiLkwStaCfmMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + cmPkLkwStaCfm, /* 0 - loosely coupled */ +#endif /* LCKWMILKW */ +#ifdef SM + SmMiLkwStaCfm, /* 1 - tightly coupled, layer management */ +#endif /* SM */ +}; + +/* Statistics confirm primitive */ + +static LkwStsCfm kwMiLkwStsCfmMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + cmPkLkwStsCfm, /* 0 - loosely coupled */ +#endif /* LCRLMILKW */ +#ifdef SM + SmMiLkwStsCfm, /* 1 - tightly coupled, layer management */ +#endif /* SM */ +}; + +/* Trace indication primitive */ + +static LkwTrcInd kwMiLkwTrcIndMt[MAXKWMI] = +{ +#ifdef LCKWMILKW + cmPkLkwTrcInd, /* 0 - loosely coupled */ +#endif /* LCKWMILKW */ +#ifdef SM + SmMiLkwTrcInd, /* 1 - tightly coupled, layer management */ +#endif /* SM */ +}; + +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +static const LkwL2MeasCfm rlcMiLkwL2MeasCfmMt[] = +{ +#ifdef LCKWMILKW + cmPkLkwL2MeasCfm, +#endif +#ifdef SM + SmMiLkwL2MeasCfm, +#endif +}; +static const LkwL2MeasStopCfm RlcMiLkwL2MeasStopCfmMt[] = +{ +#ifdef LCKWMILKW + cmPkLkwL2MeasStopCfm, +#endif +#ifdef SM + SmMiLkwL2MeasStopCfm, +#endif +}; +#endif /* LTE_L2_MEAS */ + /********************************************************************* * Forward Declartion for KWU Porting Functions ********************************************************************/ @@ -225,8 +408,477 @@ KwuDatAckInd kwUiKwuDatAckIndMt[] = /* KWU AM Data confirm primitive */ #endif /* KW_PDCP */ + +/**************************************************************************** + * LKW Interface Mt functions + ***************************************************************************/ +/** + @brief + This function is called by the RlcMiRlcConfigReq function for responding + to configuration requests.The cfm field in the RlcMngmt structure contains + the response value. + + - This function calls the mapping matrix for sending the configuration + confirmation. + - The actual function called depends on the coupling at the LKW interface. + - For a loosely coupled interface, a common packing function is called. + - The packing function packs the parameter in a message buffer and posts + the message to the target task. + - For a tightly coupled interface, the actual function called depends on + the layer manager API provided. + +*/ +S16 RlcMiRlcConfigCfm +( +Pst *pst, /* post structure */ +RlcMngmt *cfm /* Layer Management structure */ +) +{ + + /* jump to specific primitive depending on configured selector */ + (*rlcMiRlcConfigCfmMt[pst->selector])(pst, cfm); + + return ROK; +} + + +/** + @brief + This function is called by the RlcMiLkwCntrlReq function to send a control confirm to the layer management module. + + - This function calls the mapping matrix for sending the control confirmation. + - Actual function called depends on the coupling of the LKW interface. + - For a loosely coupled interface, a common packing function is called. + - The packing function packs the parameter in a message buffer and posts the + message to the target task. + - For a tightly coupled interface, the actual function called depends on the + layer manager API provided. + +*/ +S16 RlcMiLkwCntrlCfm +( +Pst *pst, /* post structure */ +RlcMngmt *cfm /* configure */ +) +{ + + /* jump to specific primitive depending on configured selector */ + (*kwMiLkwCntrlCfmMt[pst->selector])(pst, cfm); + + return ROK; + +} /* end of RlcMiLkwCntrlCfm */ + +/** + @brief + Description: + - This function can be used by RLC to send unsolicited status information + to the layer manager, when the unsolicited status flag is enabled by the + layer manager through a previous control request. + + - This function calls the mapping matrix for sending the unsolicited status + indication.The actual function called depends on the coupling of the + LKW interface. + + - For a loosely coupled interface, a common packing function is called. The + packing function packs the parameter in a message buffer and posts the + message to the target task. + + - For a tightly coupled interface, the actual function called depends on + the layer manager API provided. +*/ +S16 RlcMiLkwStaInd +( +Pst *pst, /* post structure */ +RlcMngmt *usta /* unsolicited status */ +) +{ + /* jump to specific primitive depending on configured selector */ + (*kwMiLkwStaIndMt[pst->selector])(pst, usta); + + return (ROK); +} /* end of RlcMiLkwStaInd */ + + +/** + @brief + - This function is called by the RlcMiLkwStaReq function to send + the requested status information to the layer manager. + + - This function calls the mapping matrix for sending the status + confirmation. The actual function called depends on the coupling + of the LKW interface. + + - For a loosely coupled interface, a common packing function is called. + The packing function packs the parameter in a message buffer and + posts the message to the target task. + + - For a tightly coupled interface, the actual function called depends + on the layer manager API provided. + +*/ +S16 RlcMiLkwStaCfm +( +Pst *pst, /* post structure */ +RlcMngmt *cfm /* solicited status confirmation */ +) +{ + + /* jump to specific primitive depending on configured selector */ + (*kwMiLkwStaCfmMt[pst->selector])(pst, cfm); + + return ROK; + +} /* end of RlcMiLkwStaCfm */ + + +/** + @brief + - This function is called by the RlcMiLkwStsReq function for responding + to statistics requests. + + - This function calls the mapping matrix for sending the statistics + confirmation. The actual function called depends on the coupling + of the LKW interface. + + - For a loosely coupled interface, a common packing function is called. + The packing function packs the parameter in a message buffer and + posts the message to the target task. + + - For a tightly coupled interface, the actual function called depends + on the layer manager API provided. + +*/ +S16 RlcMiLkwStsCfm +( +Pst *pst, /* post structure */ +Action action, /* action */ +RlcMngmt *cfm /* statistics confirmation */ +) +{ + /* jump to specific primitive depending on configured selector */ + (*kwMiLkwStsCfmMt[pst->selector])(pst, action, cfm); + + return ROK; + +} /* end of RlcMiLkwStsCfm */ + +/** + @brief + - This function can be used by RLC module to send unsolicited trace + indications to the layer manager, when tracing is enabled by the + layer manager through a previous control request. + + - This function calls the mapping matrix for sending the trace indication. + The actual function called depends on the coupling of the LKW interface. + + - For a loosely coupled interface, a common packing function is called. + The packing function packs the parameter in a message buffer and posts + the message to the target task. + + - For a tightly coupled interface, the actual function called depends on + the layer manager API provided. + +*/ +S16 RlcMiLkwTrcInd +( +Pst *pst, /* post structure */ +RlcMngmt *trc, /* trace indication */ +Buffer *mBuf /* message buffer */ +) +{ + /* jump to specific primitive depending on configured selector */ + (*kwMiLkwTrcIndMt[pst->selector])(pst, trc, mBuf); + + return ROK; + +} /* end of RlcMiLkwTrcInd */ + +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +S16 RlcMiLkwL2MeasCfm(Pst * pst,RlcL2MeasCfmEvt *measEvt) +{ + + (*rlcMiLkwL2MeasCfmMt[pst->selector])(pst, measEvt); + + return ROK; + +} +S16 RlcMiLkwL2MeasStopCfm(Pst *pst,uint8_t measType,uint8_t status) +{ + + (*RlcMiLkwL2MeasStopCfmMt[pst->selector])(pst, measType,status); + + return ROK; + +} +#endif /* LTE_L2_MEAS */ + + +/**************************************************************************** + * RGU Interface Mt functions + ***************************************************************************/ +/** + * + * @brief + * + * Handler for RGU SAP bind Request. + * + * @b Description: + * + * This function is used by RLC to request for binding to + * MAC for accessing MAC services.This function binds MAC's + * SAP (identified by spId) with the service user's SAP + * (identified by suId). + * + * @param[in] pst Post structure + * @param[in] suId Service user SAP ID + * @param[in] spId Service provider ID + * + * @return S16 + * -# ROK + */ + +S16 RlcLiRguBndReq +( +Pst *post, /* post structure */ +SuId suId, /* Service User Id */ +SpId spId /* Service Provider Id */ +) +{ + + /* jump to specific primitive depending on configured selector */ + (*kwLiRguBndReqMt[post->selector])(post, suId, spId); + + return ROK; + +} /* end of RlcLiRguBndReq */ + + +/** + * + * @brief + * + * Handler for bind confirmation from MAC. + * + * @b Description: + * + * This function handles the bind confirmation received + * from MAC. + * + * @param[in] post - Post structure + * @param[in] suId - Service provider SAP ID + * @param[in] reason - Reason of confirmation + * + * @return S16 + * -# ROK + */ + +S16 RlcLiRguUbndReq(Pst *post,SpId spId,Reason reason) +{ + + /* jump to specific primitive depending on configured selector */ + (*kwLiRguUbndReqMt[post->selector])(post, spId, reason); + + return ROK; + +} /* end of RlcLiRguUbndReq */ + +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#ifdef LTE_RLC_R9 +/** + * + * @brief + * + * Handler for sending ulThrpMeasReqInfo from RLC to MAC for UL ip throughput measurement. + * + * @b Description: + * + * This function sends ulThrpMeasReqInfo from RLC to MAC whenver UL ip throughput + * measurement is ON for a single or multiple qci in a UE. This is an indication for MAC + * to start the T2/T1 time stamps for the coresponding LCHs in the UE. + * + * @param[in] post Post structure + * @param[in] spId Service Provider ID + * @param[in] ulThrpMeasReqInfo Ul ip measurement request info + * + * @return S16 + * -# ROK + * -# RFAILED + * + */ +S16 RlcLiRguL2MUlThrpMeasReq(Pst *post,SpId spId,RguL2MUlThrpMeasReqInfo *l2mUlThrpMeasReq) +{ + + /* jump to specific primitive depending on configured selector */ + (*kwLiRguL2MUlThrpMeasReqMt[post->selector])(post, spId, l2mUlThrpMeasReq); + + return ROK; + +} /* end of RlcLiRguL2MUlThrpMeasReq */ + +#endif /* LTE_RLC_R9 */ +#endif /* LTE_L2_MEAS */ + + +#ifdef MAC_RLC_UL_RBUF +S16 rlcUlBatchProc ARGS ((Void)); +Void rlcUtlFreeUlRBuf ARGS((void)); + +S16 rlcUlBatchProc(Void) +{ +/* Read from Ring Buffer and process PDCP packets */ + RguDDatIndInfo *datInd; + Void *elmIndx = NULLP; + static Pst rlcUlRbfuPst={1,1,ENTRLC,0,ENTMAC,0,PRIOR0,RTESPEC,EVTRLCULDAT,0,0,0,0}; +/* Read from Ring Buffer and process PDCP packets */ + +#ifndef SS_RBUF + RguDedDatInd1 *rguDatInd = NULLP; + uint8_t rngBufDeqIndx = 0; + + elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); + while(NULLP != elmIndx) + { + rguDatInd = (RguDedDatInd1 *)elmIndx; + datInd = (RguDDatIndInfo*) rguDatInd->msg; + SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].nPktProc++;//Number of pkt processed in tti + if(datInd != NULLP) + { + RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd); + } + else + { + DU_LOG("\nERROR --> RLC UL : Received NULL buffer"); + } + rguDatInd->msg=NULLP; + SRngIncrRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); + elmIndx = NULLP; + rguDatInd = NULLP; + + rngBufDeqIndx++; + + //if(rngBufDeqIndx >= SS_RNG_MAX_ULMAC_TO_ULRLC_DQ_CNT) + // break; + + if((elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC)) == NULLP) + break; + } +#else + elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); + while(NULLP != elmIndx) + { + datInd = (RguDDatIndInfo *)elmIndx; + RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd); + + elmIndx = NULLP; + datInd = NULLP; + SRngIncrRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); + + if((elmIndx = SRngGetRIndx(SS_RNG_BUF_ULMAC_TO_ULRLC)) == NULLP) + break; + } +#endif + return ROK; + +} + +/** + * + * @brief + * Handler to clear Ring buffer from UL RLC + * + * @details + * This function clears all the ring buffer content from UL RLC + * + * @return S16 + * -# ROK + * -# RFAILED + * + */ +Void rlcUtlFreeUlRBuf(void) +{ + RguDDatIndInfo *datInd; + PTR elem; + uint8_t numLch; + uint8_t numPdu; + + /* Free SS_RNG_BUF_ULMAC_TO_ULRLC */ + while((SDeqSRngBuf (SS_RNG_BUF_ULMAC_TO_ULRLC, &elem) == ROK)) + { + datInd = (RguDDatIndInfo *)elem; + for(numLch = 0; numLch< datInd->numLch; numLch++) + { + for(numPdu = 0; numPdu < datInd->lchData[numLch].pdu.numPdu; numPdu++) + { + if(datInd->lchData[numLch].pdu.mBuf[numPdu]) + { + ODU_PUT_MSG_BUF(datInd->lchData[numLch].pdu.mBuf[numPdu]); + } + } + } + RLC_PST_FREE(0, 0, datInd, sizeof(RguDDatIndInfo)); + } +} +#endif +#ifdef RLC_MAC_STA_RSP_RBUF +S16 rlcLiRguStaRspRbuf(Pst *post,SpId spId,Void *staRsp) +{ + S16 ret1 = ROK; + + Void *elem = NULLP; + + RguDStaRspInfo *staRspInfo = NULL; + elem = SRngGetWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); + if (NULLP != elem) + { + staRspInfo = (RguDStaRspInfo *)elem; + memcpy(staRspInfo, staRsp, sizeof(RguDStaRspInfo)); + staRspInfo->post = *post; + SRngIncrWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); + SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktRate++; + } + else + { + DU_LOG("\nERROR --> RLC_DL : RLC DL STA RSP RBUF is FULL!!! "); + SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktDrop++; + ret1 = RFAILED; + } + return (ret1); +} /* cmPkRlcDatReq */ + +#endif +#ifdef RLC_MAC_DAT_REQ_RBUF +S16 rlcLiRguDatReqRbuf(Pst *post,SpId spId,Void *datReq) +{ + S16 ret1 = ROK; + + Void *elem = NULLP; + RguInfoRingElem *datReqRing=NULLP; + elem = SRngGetWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ); + if (NULLP != elem) + { + datReqRing = (RguInfoRingElem *) elem; + datReqRing->spId = spId; + datReqRing->event = post->event; + datReqRing->msg =datReq; + SRngIncrWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ); + SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktRate++; + } + else + { + DU_LOG("\nERROR --> RLC_DL : RLC DL DAT REQ RBUF is FULL!!! \n"); + SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktDrop++; + ret1 = RFAILED; + } + return (ret1); +} /* cmPkRlcDatReq */ + +#endif + /**************************************************************************** * KWU Interface Mt functions ***************************************************************************/ @@ -843,6 +1495,7 @@ S16 rlcUtlDlFreeRlcRBuf(Void) #ifdef __cplusplus } #endif /* __cplusplus */ -/********************************************************************30** + +/************************************************************************ End of file **********************************************************************/ diff --git a/src/5gnrrlc/kw_tenb_stats.c b/src/5gnrrlc/rlc_stats.c similarity index 96% rename from src/5gnrrlc/kw_tenb_stats.c rename to src/5gnrrlc/rlc_stats.c index 68d552714..c01228d84 100755 --- a/src/5gnrrlc/kw_tenb_stats.c +++ b/src/5gnrrlc/rlc_stats.c @@ -24,7 +24,7 @@ Desc: - File: l2_tenb_stats.c + File: rlc_stats.c **********************************************************************/ @@ -34,10 +34,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* RLC error options */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_ul.h" +#include "rlc_err.h" /* RLC error options */ +#include "rlc_env.h" /* RLC environment options */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -45,12 +43,13 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" #ifdef TENB_STATS #include "l2_tenb_stats.x" /* Total EnodeB Stats declarations */ #endif +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_ul.h" + #ifdef TENB_STATS TSL2CellStatsCb* l2CellStats[L2_STATS_MAX_CELLS]; TSL2UeStatsCb* l2UeStats[L2_STATS_MAX_UES]; diff --git a/src/5gnrrlc/kw_id.c b/src/5gnrrlc/rlc_sys_id.c similarity index 99% rename from src/5gnrrlc/kw_id.c rename to src/5gnrrlc/rlc_sys_id.c index bb026340f..5d2971af9 100755 --- a/src/5gnrrlc/kw_id.c +++ b/src/5gnrrlc/rlc_sys_id.c @@ -24,7 +24,7 @@ Desc: - File: kw_id.c + File: rlc_sys_id.c *********************************************************************21*/ diff --git a/src/5gnrrlc/kw_tmm_dl.c b/src/5gnrrlc/rlc_tmm_dl.c similarity index 97% rename from src/5gnrrlc/kw_tmm_dl.c rename to src/5gnrrlc/rlc_tmm_dl.c index 55cc0b802..a11d2e7c4 100755 --- a/src/5gnrrlc/kw_tmm_dl.c +++ b/src/5gnrrlc/rlc_tmm_dl.c @@ -30,11 +30,11 @@ --rlcTmmRcvFrmMac --kwTmmReEstablish - File: kw_tmm_dl.c + File: rlc_tmm_dl.c **********************************************************************/ /** - * @file kw_tmm_dl.c + * @file rlc_tmm_dl.c * @brief RLC Transparent Mode module */ @@ -44,12 +44,10 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* RLC defines */ + -#include "kw.h" /* RLC defines */ -#include "kw_err.h" /* RLC defines */ -#include "kw_udx.h" -#include "kw_dl.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -57,10 +55,9 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "rlc_utils.h" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #include "rlc_mac_inf.h" #include "rlc_lwr_inf_api.h" diff --git a/src/5gnrrlc/kw_tmm_ul.c b/src/5gnrrlc/rlc_tmm_ul.c similarity index 97% rename from src/5gnrrlc/kw_tmm_ul.c rename to src/5gnrrlc/rlc_tmm_ul.c index 20e11f561..648653825 100755 --- a/src/5gnrrlc/kw_tmm_ul.c +++ b/src/5gnrrlc/rlc_tmm_ul.c @@ -30,11 +30,11 @@ --rlcTmmRcvFrmMac --kwTmmReEstablish - File: kw_tmm_ul.c + File: rlc_tmm_ul.c **********************************************************************/ -/** @file kw_tmm_ul.c +/** @file rlc_tmm_ul.c @brief RLC Transparent Mode module */ @@ -44,11 +44,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_err.h" /* RLC defines */ -#include "kw_ul.h" /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -56,10 +53,10 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_err.h" /* RLC defines */ +#include "rlc_ul.h" #include "du_app_rlc_inf.h" -#include "rlc_utils.h" #include "rlc_upr_inf_api.h" #if defined(PRE_DEF_UE_CTX) || defined(PRE_DEF_UE_CTX_HO) diff --git a/src/5gnrrlc/kw_tmr.c b/src/5gnrrlc/rlc_tmr.c similarity index 98% rename from src/5gnrrlc/kw_tmr.c rename to src/5gnrrlc/rlc_tmr.c index ae6333b7d..d7ecd63d6 100755 --- a/src/5gnrrlc/kw_tmr.c +++ b/src/5gnrrlc/rlc_tmr.c @@ -29,7 +29,7 @@ - rlcTmrExpiry - rlcBndTmrExpiry - File: kw_tmr.c + File: rlc_tmr.c *********************************************************************21*/ @@ -39,13 +39,8 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC defines */ -#include "kw_err.h" /* Error defines */ -#include "kw_ul.h" -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Error defines */ /* extern (.x) include files */ #include "lkw.x" /* LKW */ @@ -53,11 +48,10 @@ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" /** * @file gp_tmr.c * @brief RLC Timer Module diff --git a/src/5gnrrlc/kw_ul.x b/src/5gnrrlc/rlc_ul.h similarity index 96% rename from src/5gnrrlc/kw_ul.x rename to src/5gnrrlc/rlc_ul.h index 7367ee833..f00d44547 100755 --- a/src/5gnrrlc/kw_ul.x +++ b/src/5gnrrlc/rlc_ul.h @@ -16,30 +16,47 @@ ################################################################################ *******************************************************************************/ -/********************************************************************20** +/********************************************************************** - Name: NR RLC file for uplink and non real time tasks + Name: NR RLC file for uplink and non real time tasks - Type: C include file + Type: C include file - Desc: This file contains all the data structures and - prototypes for RLC in the uplink. + Desc: This file contains helper macros for RLC uplink + and non real time tasks - File: kw_ul.x - -*********************************************************************21*/ + File: rlc_ul.h + +**********************************************************************/ /** - * @file kw_ul.x - * @brief RLC uplink structures, prototypes + * @file rlc_ul.h + * @brief RLC uplink helper macros */ -#ifndef __KW_ULX__ -#define __KW_ULX__ - +#ifndef __RLC_ULH__ +#define __RLC_ULH__ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/** + * @def RLC_MEAS_IS_UL_IP_MEAS_ON_FOR_RB + * + * This macro is used to check if UL IP throughput measurement is ON + * or off for the passed rb + * + * Returns TRUE(non-zero) if measurement is ON else FALSE (zero) + * + * @param[in] _gCb RLC UL Cb + * @param[in] _rbCb RLC uplink control block + * +*/ +#define RLC_MEAS_IS_UL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \ + ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \ + (_gCb->u.ulCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UL_IP) && \ + (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_UL_IP)) + typedef struct rlcUlUeCb RlcUlUeCb; /** @@ -643,10 +660,9 @@ uint8_t rlcProcDedLcUlData(Pst *pst, SuId suId, RguDDatIndInfo *datInd); } #endif /* __cplusplus */ -#endif /* __KW_ULX__ */ - -/********************************************************************30** +#endif /* __RLC_ULH__ */ +/********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrrlc/kw_ul_ex_ms.c b/src/5gnrrlc/rlc_ul_msg_router.c similarity index 98% rename from src/5gnrrlc/kw_ul_ex_ms.c rename to src/5gnrrlc/rlc_ul_msg_router.c index 7295adf85..f136927a1 100755 --- a/src/5gnrrlc/kw_ul_ex_ms.c +++ b/src/5gnrrlc/rlc_ul_msg_router.c @@ -25,11 +25,11 @@ Desc: C source code for the interface to System Services of NR RLC - File: kw_ul_ex_ms.c + File: rlc_ul_msg_router.c *********************************************************************21*/ -/** @file kw_ul_ex_ms.c +/** @file rlc_ul_msg_router.c @brief RLC System Services Interface */ @@ -40,21 +40,19 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_err.h" /* Err defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_ul.h" -#include "kw_udx.h" +#include "rlc_err.h" /* Err defines */ +#include "rlc_env.h" /* RLC environment options */ + /* extern (.x) include files */ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw.x" -#include "kw_ul.x" -#include "kw_udx.x" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_ul.h" #include "rlc_mac_inf.h" #include "du_app_rlc_inf.h" @@ -62,6 +60,7 @@ #include "l2_tenb_stats.x" #endif + S16 rlcUlInitExt ARGS (( Void )); /** diff --git a/src/5gnrrlc/kw_umm_dl.c b/src/5gnrrlc/rlc_umm_dl.c similarity index 97% rename from src/5gnrrlc/kw_umm_dl.c rename to src/5gnrrlc/rlc_umm_dl.c index 430adca40..2d89241bd 100755 --- a/src/5gnrrlc/kw_umm_dl.c +++ b/src/5gnrrlc/rlc_umm_dl.c @@ -31,11 +31,11 @@ --rlcUmmReAssembleSdus --kwUmmReEstablish - File: kw_umm_dl.c + File: rlc_umm_dl.c **********************************************************************/ /** - * @file kw_umm_dl.c + * @file rlc_umm_dl.c * @brief RLC Unacknowledged Mode downlink module */ @@ -46,12 +46,10 @@ #include "kwu.h" /* RLC service user */ #include "lkw.h" /* LM Interface */ #include "rgu.h" /* MAC layer */ -#include "kw_env.h" /* RLC environment options */ +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" + -#include "kw.h" /* RLC layer */ -#include "kw_err.h" -#include "kw_udx.h" -#include "kw_dl.h" /* header/extern include files (.x) */ @@ -61,9 +59,9 @@ #include "lkw.x" /* LM Interface */ #include "rgu.x" /* MAC later */ -#include "kw.x" /* RLC layer */ -#include "kw_udx.x" -#include "kw_dl.x" +#include "rlc_utils.h" /* RLC layer */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" #define RLC_MODULE (RLC_DBGMASK_UM | RLC_DBGMASK_DL) @@ -241,7 +239,7 @@ void rlcUmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *datReq) RLC_UPD_L2_DL_DISC_SDU_STS(gCb, rbCb); #endif rbCb->m.umDl.bo -= sdu->sduSz; - RLC_RMV_SDU(gCb,&rbCb->m.umDl.sduQ,sdu); + RLC_REMOVE_SDU(gCb,&rbCb->m.umDl.sduQ,sdu); continue; } } @@ -365,7 +363,7 @@ void rlcUmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *datReq) umHdr.so = 0; } rlcUmmCreatePdu(gCb, rbCb, pdu, &umHdr, pduInfo); - RLC_RMV_SDU(gCb,&(rbCb->m.umDl.sduQ),sdu); /* kw003.201 */ + RLC_REMOVE_SDU(gCb,&(rbCb->m.umDl.sduQ),sdu); /* kw003.201 */ rlcUtlIncrementKwuStsSduTx(gCb->u.dlCb->rlcKwuDlSap + rbCb->k1wuSapId); pdu = NULLP; } @@ -600,7 +598,7 @@ Void rlcUmmDiscSdu(RlcCb *gCb,RlcDlRbCb *rbCb,uint32_t sduId) if (sdu->mode.um.sduId == sduId && sdu->mode.um.isSegmented == FALSE) { /* kw005.201 added support for L2 Measurement */ - RLC_RMV_SDU(gCb,&rbCb->m.umDl.sduQ,sdu); + RLC_REMOVE_SDU(gCb,&rbCb->m.umDl.sduQ,sdu); gCb->genSts.numSduDisc++; } } diff --git a/src/5gnrrlc/kw_umm_ul.c b/src/5gnrrlc/rlc_umm_ul.c similarity index 99% rename from src/5gnrrlc/kw_umm_ul.c rename to src/5gnrrlc/rlc_umm_ul.c index a7f4d80fc..72064d174 100755 --- a/src/5gnrrlc/kw_umm_ul.c +++ b/src/5gnrrlc/rlc_umm_ul.c @@ -31,11 +31,11 @@ --rlcUmUlReAssembleSdus --kwUmmReEstablish - File: kw_umm_ul.c + File: rlc_umm_ul.c **********************************************************************/ /** - * @file kw_umm_ul.c + * @file rlc_umm_ul.c * @brief RLC Unacknowledged Mode uplink module */ @@ -46,12 +46,7 @@ #include "kwu.h" /* RLC service user */ #include "lkw.h" /* LM Interface */ #include "rgu.h" /* MAC layer */ -#include "kw_env.h" /* RLC environment options */ - -#include "kw.h" /* RLC layer */ -#include "kw_err.h" -#include "kw_ul.h" - +#include "rlc_env.h" /* RLC environment options */ /* header/extern include files (.x) */ @@ -60,8 +55,9 @@ #include "lkw.x" /* LM Interface */ #include "rgu.x" /* MAC later */ -#include "kw.x" /* RLC layer */ -#include "kw_ul.x" +#include "rlc_utils.h" /* RLC layer */ +#include "rlc_err.h" +#include "rlc_ul.h" #define RLC_MODULE (RLC_DBGMASK_UM | RLC_DBGMASK_UL) diff --git a/src/5gnrrlc/kw_uim.c b/src/5gnrrlc/rlc_upr_inf_mgr.c similarity index 98% rename from src/5gnrrlc/kw_uim.c rename to src/5gnrrlc/rlc_upr_inf_mgr.c index 39eb20995..4cbc070cf 100755 --- a/src/5gnrrlc/kw_uim.c +++ b/src/5gnrrlc/rlc_upr_inf_mgr.c @@ -38,7 +38,7 @@ **********************************************************************/ /** - * @file kw_uim.c + * @file rlc_upr_inf_mgr.c * @brief RLC Upper Interface Module */ @@ -51,24 +51,20 @@ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ #include "rgu.h" /* RGU defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_dl.h" -#include "kw_ul.h" -#include "kw_udx.h" +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" + /* extern (.x) include files */ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ #include "rgu.x" /* RGU */ -#include "kw_err.h" -#include "kw.x" -#include "kw_udx.x" -#include "kw_dl.x" -#include "kw_ul.x" - +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" +#include "rlc_ul.h" /***************************************************************************** * CKW INTERFACE ****************************************************************************/ diff --git a/src/5gnrrlc/rlc_utils.h b/src/5gnrrlc/rlc_utils.h old mode 100644 new mode 100755 index b40c957a4..0eb9b78bd --- a/src/5gnrrlc/rlc_utils.h +++ b/src/5gnrrlc/rlc_utils.h @@ -16,6 +16,1057 @@ ################################################################################ *******************************************************************************/ +/********************************************************************** + + Name: NR RLC file + + Type: C include file + + Desc: This file contain the hash definations for RLC + + File: kw.h + +**********************************************************************/ +/** @file rlc_utils.h +@brief RLC Hash definitions +*/ + +#ifndef __RLC_UTILS_H__ +#define __RLC_UTILS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "du_log.h" + + +#define EKWxxx 1 +#define EMG099 1 +#define EMG102 2 +#define EMG103 3 +#define EMG104 4 + +/* RLC-SPLIT Activity */ +#define RLC_ONE 1 +#define RLC_BIT0 0x01 +#define RLC_BIT1 0x02 +#define RLC_BIT2 0x04 +#define RLC_BIT3 0x08 + +#define RLC_2K_BYTE 2048 + +/* RLC RB flag bits */ +#define RLC_RB_REESTABLISH_DL RLC_BIT0 +#define RLC_RB_REESTABLISH_UL RLC_BIT1 +#define RLC_RB_DELETE_DL RLC_BIT2 +#define RLC_RB_DELETE_UL RLC_BIT3 + + +#define RLC_MOD_1024 0x3FF /* used for MOD 1024 */ + + + +/************************************************************************ + * SAP States + ************************************************************************/ + +#define RLC_SAP_NOT_CFG 0 /*!< SAP Not Configured */ +#define RLC_SAP_CFG 1 /*!< SAP Configured but not not bound */ +#define RLC_SAP_BND 2 /*!< SAP Bound */ +#define RLC_SAP_BINDING 3 /*!< SAP Bind initiated */ +#define RLC_SAP_UBND 4 /*!< SAP Unbind */ + +#define RLC_MAX_SAP_BND_RETRY 3 /*!< Maximum SAP Bin Retries */ + +#define RLC_MAX_UE 0xffffffff /*!< Maximum number of UEs. */ + +/* Maximum number of Saps */ +#define RLC_MAX_UDXSAPS 1 /*!< Maximum number of UDX Saps */ +#define RLC_MAX_KWUSAPS 2 /*!< Maximum number of KWU Saps. */ +#define RLC_MAX_CKWSAPS 1 /*!< Maximum number of CKW Saps. */ +/*MCELL changes*/ +#define RLC_MAX_RGUSAPS 4//5 /*!< Maximum number of RGU Saps. */ + +#define RLC_MAX_RGUSAP_TMR 1 /*!< Maximum number of RGU SAP Timers. */ + +#define RLC_UI_RRC 0 /*!< Upper interface RRC sap Id. */ +#define RLC_UI_PDCP 1 /*!< Upper interface PDCP sap Id. */ + +#ifdef LTE_L2_MEAS +/* TODO. This works for FDD only. For TDD the array dimension + * should be changed according to the number of Harq Procs */ +#define RLC_MAX_TB_PER_UE 64 /*!< Maximum number of tbCb for UE */ +#define RLC_INVALID_TBID RLC_MAX_TB_PER_UE +#endif +/******************************************************************************* + * Memory related Defines + ******************************************************************************/ +/* Allocate function */ + +#define RLC_ALLOC(_cb,_buf, _size) \ +{ \ + if (SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, \ + (Size) _size) == ROK) \ + { \ + memset((_buf), 0, _size); \ + } \ + else \ + { \ + (_buf) = NULLP; \ + } \ +} + +#define RLC_FREE(_cb,_buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \ + (Data *) _buf, (Size) _size); \ + _buf = NULLP; \ + } \ +} + +#define RLC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutStaticBuffer(_region, _pool, \ + (Data *) _buf, (Size) _size, 0); \ + _buf = NULLP; \ + } \ +} + +#define RLC_FREE_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ +{ \ + (Void) SPutStaticBuffer(_region, _pool, \ + (Data *) _buf, (Size) _size, 0); \ + _buf = NULLP; \ +} + +#define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ +{ \ + SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ + (Size) _size, 0); \ +} + +#define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size) \ +{ \ + if (SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ + (Size) _size, 0) == ROK) \ + { \ + memset((_buf), 0, _size); \ + } \ + else \ + { \ + (_buf) = NULLP; \ + } \ +} + +#define RLC_ALLOC_WC(_cb,_buf, _size) \ + SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size) + +#define RLC_REMOVE_SDU(_cb,_sduQ,_sdu) \ +{ \ + if(_sdu->mBuf) \ + { \ + SPutMsg(_sdu->mBuf); \ + } \ + cmLListDelFrm(_sduQ,&_sdu->lstEnt); \ + RLC_FREE(_cb,_sdu, sizeof(RlcSdu)); \ +} + +/* kw002.201 Freeing from region of pst */ +#define RLC_PST_FREE(_region, _pool, _buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutSBuf(_region, _pool, \ + (Data *) _buf, (Size) _size); \ + _buf = NULLP; \ + } \ +} + +#ifdef XEON_SPECIFIC_CHANGES +#ifdef SS_LOCKLESS_MEMORY +#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutStaticBuffer(_region, _pool, \ + (Data *) _buf, (Size) _size, 0); \ + _buf = NULLP; \ + } \ +} + +#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ +{ \ + SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ + (Size) _size, 0); \ +} + +#else + +#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutSBuf(_region, _pool, \ + (Data *) _buf, (Size) _size); \ + _buf = NULLP; \ + } \ +} + +#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ +{ \ + SGetSBuf(_region, _pool, (Data **)&_buf, \ + (Size) _size); \ +} +#endif /* SS_LOCKLESS_MEMORY */ + +#else + +#define RLC_SHRABL_STATIC_BUF_FREE(_region, _pool, _buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutStaticBuffer(_region, _pool, \ + (Data *) _buf, (Size) _size, 0); \ + _buf = NULLP; \ + } \ +} + +#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ +{ \ + SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ + (Size) _size, 0); \ +} +#endif + +#define RLC_MEM_CPY(_dst, _src, _size) memcpy(_dst, _src, _size); + +#define RLC_MEM_ZERO(_buf, _size) memset((_buf), 0, _size); + +#define RLC_GET_MEM_REGION(_cb) (_cb->init.region) + +#define RLC_GET_MEM_POOL(_cb) (_cb->init.pool) + +#define RLC_GET_MEM_POOL_ADDRESS(_cb) (&_cb->init.pool) + +/* Memset to value */ +#define RLC_MEM_SET(_arg, _val, _size) memset(_arg, _val, _size); + +/* Alarms */ +/* Send an alarm for sapId events */ +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#define RLC_GETSDUIDX(_sduIdx) \ +{\ + _sduIdx = (((_sduIdx)+1) % RLC_L2MEAS_MAX_OUTSTNGSDU);\ +} +#define RLC_SEND_SAPID_ALARM(_cb,_sapId, _evnt, _cause) \ +{ \ + rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, _sapId, 0, 0); \ +} +#define RLC_SEND_UEID_ALARM(_cb,_ueId, _qci, _evnt, _cause) \ +{ \ + rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, 0, _ueId, _qci); \ +} +#else /* LTE_L2_MEAS */ +#define RLC_SEND_SAPID_ALARM(_cb,_sapId, _evnt, _cause) \ +{ \ + rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, _sapId, 0); \ +} +#define RLC_SEND_UEID_ALARM(_cb,_ueId, _evnt, _cause) \ +{ \ + rlcLmmSendAlarm(_cb,LCM_CATEGORY_INTERFACE, _evnt, _cause, 0, _ueId); \ +} +#endif /* LTE_L2_MEAS */ + +/******************************************************************************* + * Common Defines + ******************************************************************************/ + +/* RLC Configuration parameters */ +#define RLC_MAX_UL_LI (2 * RLC_MAX_LI) +/*macro RLC_MAX_DL_LI is moved to rlc_env.h file */ +#define RLC_MAX_DAT RLC_MAXIMUM_DAT +/*macro RLC_MAX_PDU is moved to rlc_env.h file */ +#define RLC_MAX_RB_PER_CELL 10 +#define RLC_MAX_SRB_PER_UE 3 +#define RLC_MAX_DRB_PER_UE 32 +#define RLC_MAX_LCH_PER_UE 12 +#define RLC_MAX_LCH_PER_CELL 6 +#define RLC_MAX_NUM_RB 24 +#define RLC_MAX_UE 0xffffffff +#define RLC_UE_LIST_BUCKET_SIZE 128 +#define RLC_CELL_LIST_BUCKET_SIZE 10 +#define RLC_TRANS_ID_LST_BKT_SIZE 10 +#define RLC_MAX_RB 32 + +/* RLC Mode defines */ +#define RLC_MODE_TM 1 +#define RLC_MODE_UM 2 +#define RLC_MODE_AM 3 + +/* Direction defines */ +#define RLC_DIR_UL 1 /*!< Unlink direction */ +#define RLC_DIR_DL 2 /*!< Downlink direction */ +#define RLC_DIR_BOTH 3 /*!< Both Downlink and Unlink */ + +#define RLC_DEF_SEQ_NUM 0 /**< Sequence number to pick in case of duplicate + entries in hash list searches*/ + +/** + * @def RLC_MIN + * + * Macro to find the miniumum of two numbers + * + * @param[in] x First number + * @param[in] y Second number + * +*/ +#define RLC_MIN(x,y) (x) < (y) ? (x) : (y) + +/** + * @def RLC_GET_RLCCB + * + * Macro to the RLC instance + * + * @param[in] _inst Instance Id + * +*/ +#define RLC_GET_RLCCB(_inst) rlcCb[_inst] + +#define RLC_ADD_SDU 1 /*!< Add SDU. */ +#define RLC_DEL_SDU 2 /*!< Delete SDU. */ + +#define RLC_CFM_NOK 0 /*!< Do not send DatCfm */ +#define RLC_CFM_OK 1 /*!< Send DatCfm */ + +/* Set the unsolictated Status flag */ +#define RLC_SET_USTA_FLAG(_rlcCb, _value) \ +{ \ + _rlcCb->init.usta = _value; \ +} + +/* Macros to get the init parameters */ +#define RLC_GET_DBG_MASK(_rlcCb) (_rlcCb->init.dbgMask) +#define RLC_GET_LMPST_MEM_POOL(_rlcCb) (_rlcCb->init.lmPst.pool) +#define RLC_GET_LMPST_MEM_REGION(_rlcCb) (_rlcCb->init.lmPst.region) + +/* Macros for configuration module */ +#define RLC_CFG_FILL_CFG_CFM(_entCfm, _rbId, _rbType, _status, _reason) \ +{ \ + _entCfm->rbId = _rbId; \ + _entCfm->rbType = _rbType; \ + _entCfm->status.status = _status; \ + _entCfm->status.reason = _reason; \ +} + +/** + * @def RLC_VALIDATE_UE_RBID + * + * This macro validates whether the _rbId passed is valid or not. It checks + * if the _rbId is within the maximum value depending on the _rbType. + * Returns TRUE if valid else FALSE + * + * @param[in] _rbType Type of the Radio Bearer; SRB or DRB + * @param[in] _rbId RB Id of the RB to be validated + * +*/ +#define RLC_VALIDATE_UE_RBID(_rbType, _rbId) \ + ((_rbType == CM_LTE_SRB && _rbId < RLC_MAX_SRB_PER_UE) || \ + (_rbType == CM_LTE_DRB && _rbId < RLC_MAX_DRB_PER_UE)) + +/******************************************************************************* + * UIM Defines + ******************************************************************************/ +#if (ERRCLASS & ERRCLS_INT_PAR) +#define RLC_VALDATE_SAP(_cb,_chkSpId, _sap, _ret) \ +{ \ + if (_chkSpId != _sap->spId) \ + { \ + RLCLOGERROR(_cb,ERRCLS_DEBUG, EKWxxx, (ErrVal) RFAILED, \ + "Sap Id Validation Failed."); \ + _ret = RFAILED; \ + } \ + /* SAP state validation */ \ + if(_sap->state != RLC_SAP_BND) \ + { \ + RLCLOGERROR(_cb,ERRCLS_INT_PAR, EKWXXX, (ErrVal) RFAILED, \ + "Sap State Invalid."); \ + RLC_SEND_SAPID_ALARM(_cb,0, LCM_EVENT_UI_INV_EVT, LCM_CAUSE_INV_STATE); \ + _ret = RFAILED; \ + } \ +} +#else /* ERRCLASS & ERRCLS_INT_PAR */ +#define RLC_VALDATE_SAP(_cb,_chkSpId, _sap, _ret) \ +{ \ + /* SAP state validation */ \ + if(_sap->state != RLC_SAP_BND) \ + { \ + RLCLOGERROR(_cb,ERRCLS_INT_PAR, EKWXXX, (ErrVal) RFAILED, \ + "Sap State Invalid."); \ + RLC_SEND_SAPID_ALARM(_cb,0, LCM_EVENT_UI_INV_EVT, LCM_CAUSE_INV_STATE); \ + _ret = RFAILED; \ + } \ +} +#endif /* ERRCLASS & ERRCLS_INT_PAR */ + +/******************************************************************************* + * Timer Defines + ******************************************************************************/ +#define RLC_TMR_LEN 10 +#define RLC_MAX_UM_TMR 1 +#define RLC_MAX_AM_TMR 3 +#define RLC_MAX_THPT_TMR 1 + +/* Timer events */ +#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1 +#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2 +#define EVENT_RLC_AMUL_STA_PROH_TMR 3 +#define EVENT_RLC_AMDL_POLL_RETX_TMR 4 +#define EVENT_RLC_WAIT_BNDCFM 5 +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#define EVENT_RLC_L2_TMR 6 +#endif /* LTE_L2_MEAS */ +#define EVENT_RLC_THROUGHPUT_TMR 7 + +/******************************************************************************* + * DBM Defines + ******************************************************************************/ +/** + * @def RLC_DBM_GET_RBCB_FROM_UECB + * + * This macro makes _rbCb point to the RB in _ueCb based on the passed + * _rbId and _rbType. _rbCb can point to NULLP + * + * @param[in] _rbId RB Id of the RB to be fetched + * @param[in] _rbType Type of the RB, SRB or DRB + * @param[in] _ueCb Pointer to the UECb for which to get the RB + * @param[out] _rbCb Pointer to the found RbCb + * +*/ +#define RLC_DBM_GET_RBCB_FROM_UECB(_rbId, _rbType, _ueCb, _rbCb) \ + (_rbCb) = ((_rbType) == CM_LTE_SRB) ? (_ueCb)->srbCb[(_rbId)] : \ + (_ueCb)->drbCb[(_rbId)]; +/** + * @def RLC_DBM_GET_CELL_RBCB + * + * This macro makes _rbCb point to the RB in the _rbCbLst. + * _rbCb can point to NULLP + * + * @param[in] _rbId RB Id of the RB to be fetched + * @param[in] _rbCbLst Pointer to array of RBCbs + * @param[out] _rbCb Pointer to the found RbCb + * +*/ +#define RLC_DBM_GET_CELL_RBCB(_rbId, _rbCbLst, _rbCb) \ + (_rbCb) = (_rbCbLst)[(_rbId)]; + +/******************************************************************************* + * UMM Defines + ******************************************************************************/ +#define RLC_UMDL rbCb->m.umDl +#define RLC_UMUL rbCb->m.umUl + +/* Sequence Number length defines */ +#define RLC_UM_CFG_6BIT_SN_LEN 1 /**< UM 6-bit Sequence number length + in bytes*/ +#define RLC_UM_CFG_12BIT_SN_LEN 2 /**< UM 12-bit Sequence number length + in bytes*/ +/* 5GNR */ +/* Sequence Number length defines */ +#define RLC_AM_CFG_12BIT_SN_LEN 1 /**< AM 12-bit Sequence number length + in bytes*/ +#define RLC_AM_CFG_18BIT_SN_LEN 2 /**< AM 18-bit Sequence number length + in bytes*/ + +/** + * @def RLC_REMOVE_MAC_HDR_SZ + * + * If PDU size is greater than 127, MAC header would be 3 bytes else 2 bytes + * + * @param[in,out] _pduSz Size of the pdu + * +*/ +#define RLC_REMOVE_MAC_HDR_SZ(_pduSz) (_pduSz) -= ((_pduSz) > 127) ? 3 : 2; + +/** + * @def RLC_UM_GET_VALUE + * + * This macro is used to calculate the value of UM state variables used + * in comparisons. VR(UH) - UM Window Size is taken as the base modulus. + * Returns the modifed value + * + * @param[in] _val Value of the state variable + * @param[in] _kwUmUl Um Uplink control block + * +*/ +#define RLC_UM_GET_VALUE(_val,_kwUmUl) \ + (((_val) - ((_kwUmUl).vrUh - (_kwUmUl).umWinSz)) & ((_kwUmUl).modBitMask)) + +/******************************************************************************* + * AMM Defines + ******************************************************************************/ +#define RLC_AMDL rbCb->m.amDl +#define RLC_AMUL rbCb->m.amUl + +/* PDU Types */ +#define RLC_DATA_PDU 1 +#define RLC_CNTRL_PDU 0 + +#define RLC_FI_FIRST_SEG 0x02 +#define RLC_FI_LAST_SEG 0x01 +#define RLC_SI_FIRST_SEG 0x01 +#define RLC_SI_LAST_SEG 0x02 +#define RLC_SI_MID_SEG 0x03 + +#define RLC_POLL_SET 0x40 /* 01000000 */ +#define RLC_POLL_UNSET 0xbf /* 10111111 */ +#define RLC_MAX_NACK_CNT 100 +/*RLC_MAX_CNTRL_FIELDS (Maximum size of Status Pdu) + * = MAX_NACK_CNT * sizeof(NACK_SN,E1,E2,E3,soStart,soEnd, nackRange) + * for 18 bit SN + Fixed Header*/ +#define RLC_MAX_CNTRL_FIELDS ((RLC_MAX_NACK_CNT * 8) + 3) + +/* Each LI(Length Indicator) holds approx 1+1/2 byte and some other fields thus keeping Header Size equal to twice of MAX LI */ +/* 5GNR_RLC: Need to change value of HDRSZ as per number of PDUs going in one datReq */ +#define RLC_MIN_HDRSZ 1 +#define RLC_MAX_HDRSZ 5 +#define RLC_AM_PDU_FIXED_HDRSZ 2 +#define RLC_AM_PDU_12BIT_SN_HDRSZ 2 +#define RLC_AM_PDU_18BIT_SN_HDRSZ 3 +#define RLC_AM_SEG_12BIT_SN_WITH_SO_HDRSZ 4 +#define RLC_AM_SEG_18BIT_SN_WITH_SO_HDRSZ 5 +#define RLC_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ 2 +#define RLC_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ 3 +#define RLC_EXTN_HDRSZ 2 +#define RLC_CNTRL_PDU_FIXED_HDRSZ 3 +#define RLC_MAC_HDR_SZ2 2 +#define RLC_MAC_HDR_SZ3 3 +#define RLC_BYTE_LEN 8 +#define RLC_2BYTE_LEN 16 +#define RLC_E1_LEN 1 +#define RLC_NACK_E1E2_LEN 12 +#define RLC_SO_LEN 15 +#define RLC_DC_LEN 1 +#define RLC_CPT_LEN 3 +#define RLC_RF_LEN 1 +#define RLC_P_LEN 1 +#define RLC_FI_LEN 2 +#define RLC_SI_LEN 2 +#define RLC_E_LEN 1 +#define RLC_SN_LEN 10 +#define RLC_SN_LEN_12BITS 12 +#define RLC_SN_LEN_18BITS 18 +#define RLC_LSF_LEN 1 +#define RLC_LI_LEN 11 +#define RLC_STA_PDU_R_BITS_ACKSN_12BITS 7 /* 5GNR : Num Reserved bits in STATUS PDU */ +#define RLC_STA_PDU_R_BITS_ACKSN_18BITS 1 +#define RLC_STA_PDU_R_BITS_NACKSN_12BITS 1 +#define RLC_STA_PDU_R_BITS_NACKSN_18BITS 3 +#define RLC_NACK_RANGE_LEN 8 +#define RLC_SO_LEN_5GNR 16 + +#define RLC_DC_POS 0x80 +#define RLC_DC_SHT 7 +#define RLC_POLL_POS 0x40 /* 5GNR */ +#define RLC_POLL_SHT 6 /* 5GNR */ +#define RLC_SI_POS 0x30 /* 5GNR */ +#define RLC_SI_SHT 4 /* 5GNR */ +#define RLC_SN_POS_12BIT 0x0F +#define RLC_SN_POS_18BIT 0x03 +#define RLC_AM_GET_WIN_SZ(_snLen) ((RLC_AM_CFG_12BIT_SN_LEN == (_snLen)) ? (2048) : (131072)) /* 5GNR */ +#define RLC_RCV_BUF_BIN_SIZE 512 /* receive buffer size */ +#define RLC_TX_BUF_BIN_SIZE 512 /* receive buffer size */ + +#define RLC_SDU_LST 1 +#define RLC_SEG_LST 2 +#define RLC_RETX_LST 3 +#define RLC_ALL_BYTES_MISSING 0xffff + +#define RLC_MAX_PDU_MAP 30 /*!< Maximum PDU Map. */ + +#define RLC_LLIST_FIRST_SDU(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP)*/ \ + if((tmpNode=cmLListFirst(&lstCp))) \ + nod = (RlcSdu *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + + +#define RLC_LLIST_FIRST_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP)*/ \ + if((tmpNode=cmLListFirst(&lstCp))) \ + nod = (RlcSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + +#define RLC_LLIST_FIRST_RETX(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + /*CM_LLIST_FIRST_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP)*/ \ + if((tmpNode=cmLListFirst(&lstCp))) \ + nod = (RlcRetx *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + +#define RLC_LLIST_NEXT_SDU(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP) */ \ + if((tmpNode = cmLListNext(&lstCp))) \ + nod = (RlcSdu *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + + +#define RLC_LLIST_NEXT_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + (lstCp).crnt = &((nod)->lstEnt); \ + /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP)*/ \ + if((tmpNode = cmLListNext(&lstCp))) \ + nod = (RlcSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + + +#define RLC_LLIST_NEXT_RETX(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + /*CM_LLIST_NEXT_NODE(&(lstCp), tmpNode);*/ \ + /*if (tmpNode != NULLP) */ \ + if ((tmpNode = cmLListNext(&lstCp))) \ + nod = (RlcRetx *)tmpNode->node; \ + else \ + nod = NULLP; \ +} + + +#define RLC_LLIST_LAST_RETX(lstCp, nod) \ +{ \ + CmLList *tempNode = NULLP; \ + cmLListLast(&lstCp); \ + tempNode = cmLListCrnt(&lstCp); \ + if (tempNode != NULLP) \ + nod = (RlcRetx *)tempNode->node; \ + else \ + nod = NULLP; \ +} + +#define RLC_LLIST_LAST_SEG(lstCp, nod) \ +{ \ + CmLList *tempNode = NULLP; \ + cmLListLast(&lstCp); \ + tempNode = cmLListCrnt(&lstCp); \ + if (tempNode != NULLP) \ + nod = (RlcSeg *)tempNode->node; \ + else \ + nod = NULLP; \ +} + +#define RLC_LLIST_LAST_SDU(lstCp, nod) \ +{ \ + CmLList *tempNode = NULLP; \ + cmLListLast(&lstCp); \ + tempNode = cmLListCrnt(&lstCp); \ + if (tempNode != NULLP) \ + nod = (RlcSdu *)tempNode->node; \ + else \ + nod = NULLP; \ +} + +#define CM_LLIST_INS_AFT_CRNT(lstCp, nod) \ +{ \ + CmLList *nodeToIns = &nod->lstEnt;\ + nodeToIns->node = (PTR) nod;\ + cmLListInsAfterCrnt(&lstCp, nodeToIns); \ +} + +#define CM_LLIST_INS_BEF_CRNT(lstCp, nod) \ +{ \ + CmLList *nodeToIns = &nod->lstEnt; \ + nodeToIns->node = (PTR) nod; \ + cmLListInsCrnt(&lstCp, nodeToIns); \ +} + +#define RLC_LLIST_DEL_RECBUF(_recBuf) \ +{ \ + RlcSeg *_seg = NULLP; \ + RLC_LLIST_FIRST_SEG(_recBuf->segLst, _seg); \ + while (_seg) \ + { \ + cmLListDelFrm(&_recBuf->segLst, &_seg->lstEnt); \ + RLC_FREE(_seg, sizeof(RlcSeg)); \ + RLC_LLIST_NEXT_SEG(_recBuf->segLst, _seg); \ + } \ +} + +#define RLC_UMM_LLIST_FIRST_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + if((tmpNode=cmLListFirst(&lstCp))) \ + nod = (RlcUmSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +} /*!< um mode first segment of linked list*/ + +#define RLC_UMM_LLIST_NEXT_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + (lstCp).crnt = &((nod)->lstEnt); \ + if((tmpNode = cmLListNext(&lstCp))) \ + nod = (RlcUmSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +}/*!< next segment in um mode linked list*/ + +#define MODAMT(x, y, z,_snModMask) \ +{ \ + y = (x - z) & _snModMask; \ +} + +#define MODAMR(x, y, z , _snModMask) \ +{ \ + y = (x - z) & (_snModMask); \ +} + +/** + * @def RLC_AM_IS_TRANS_WIN_STALLED + * + * This macro is used to check if the AM transmit window is stalled or not. + * The tramist window is stalled when the distance between txNext and txNextAck + * is greater than equal to Window Size. Actually it should never be greater + * than Window Size. + * Returns TRUE if the window is stalled else FALSE + * + * @param[in] _amDl AM Downlink control block + * +*/ +#define RLC_AM_IS_TRANS_WIN_STALLED(_amDl) \ + ((((_amDl)->txNext - (_amDl)->txNextAck) & _amDl->snModMask) >= (RLC_AM_GET_WIN_SZ(_amDl->snLen))) + +#ifdef TENB_STATS +#define RLC_AM_TRANS_WIN_SIZE(_amDl) \ + (((_amDl)->txNext - (_amDl)->txNextAck) & _amDl->snModMask) +#endif + +#define RLC_AM_IS_POLL_BIT_SET(_amDl) \ + (RLC_AMDL.pollSn == ((RLC_AMDL.txNext - 1) & RLC_AMDL.snModMask)) + +#define RLC_FILL_CNTRL_INFO(cntrlInfo, _val, _len, _idx, _eb)\ +{ \ + cntrlInfo.val = _val; \ + cntrlInfo.len = _len; \ + cntrlInfo.idx = _idx; \ + cntrlInfo.emtBits = _eb; \ +} +#define RLC_FILL_PREV_IDX(cntrlInfo, _e1Idx, _e1eb, _idx, _eb) \ +{ \ + _e1Idx = cntrlInfo.e1Idx; \ + _e1eb = cntrlInfo.e1eb; \ + _idx = cntrlInfo.idx; \ + _eb = cntrlInfo.emtBits; \ +} + +#define RLC_FILL_HDR_ARGS(hdrInfo, _val, _len) \ +{ \ + hdrInfo.val = _val; \ + hdrInfo.len = _len; \ +} + +/* kw003.201 - This macro provides the header size other than the */ +/* fixed header of 2 bytes for each AMD PDU or 4 bytes*/ +/* for an AM PDU segment */ +#define RLC_AM_EXTN_HDRSZ(_numLi, _eHdrSz) \ +{ \ + if ((_numLi - 1) % 2) \ + { \ + _eHdrSz = ((3 * (_numLi - 2)) >> 1) + 2; \ + } \ + else \ + { \ + _eHdrSz = (3 * (_numLi - 1)) >> 1; \ + } \ +} + +/* Update poll bit in the buffer */ +#define RLC_UPD_POLL_BIT(_gCb, _retx, _poll) \ +{ \ + uint8_t fHdr; \ + \ + if (_poll != _retx->amHdr.p) \ + { \ + /* Get the first byte of the buffer */ \ + SRemPreMsg((Data *)&fHdr, _retx->seg); \ + if (_poll == TRUE) \ + { \ + fHdr = fHdr | RLC_POLL_SET; \ + } \ + else \ + { \ + fHdr = fHdr & RLC_POLL_UNSET; \ + } \ + /* Concatenated updated hdr to the mBuf */ \ + SAddPreMsg ((Data)fHdr, _retx->seg); \ + } \ + /* Update poll bit in the hdrInfo */ \ + _retx->amHdr.p = _poll; \ +} + +#define RLC_AM_ELIMINATE_EXTN_HDR(_pduSz, _sduSz, _numLi) \ +{ \ + if ( (_pduSz > _sduSz) && (_sduSz < 2048) ) \ + { \ + _pduSz -= (_numLi % 2) ? 1 : 2; \ + } \ +} +/** + * @def RLC_AM_CHK_SN_WITHIN_RECV_WINDOW + * + * This macro is used to check if a Sequence Number falls within the AM + * reception window or not. + * The condition is VR(R) <= SN < VR(MR), which are subtracting the base + * modulus becomes 0 <= (SN - VR(R)) % SNLen < (VR(MR) - VR(R)) % SnLen + * NOTE: Careful with the parantheses + * + * Returns TRUE if within the window; FALSE otherwise + * + * @param[in] _sn The sequence number to be checked + * @param[in] _amUl AM Uplink control block + * +*/ +#define RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(_sn, _amUl) \ + ((((_sn) - (_amUl->rxNext)) & (_amUl->snModMask)) < (((_amUl->vrMr) - (_amUl->rxNext)) & (_amUl->snModMask))) + +#define RLC_POWER(x, y) x << (y-1); + +#ifndef L2_OPTMZ +#define rlcCpyMsg(_cb,x, y) \ + (SAddMsgRef((x), RLC_GET_MEM_REGION(_cb), RLC_GET_MEM_POOL(_cb), (y))) +#else +/* L2 optimization for mUe/Tti: Removing dup buf*/ +#define rlcCpyMsg(_cb,x, y) \ + (SIncMsgRef((x), RLC_GET_MEM_REGION(_cb), RLC_GET_MEM_POOL(_cb), (y))) +#endif + +// printf("Copy Msg %x \n",x); + +/******************************************************************************* + * Debugging Defines + ******************************************************************************/ +#define RLC_DBG_SUB_MASK DBGMASK_MI /**< Use for sub-mask */ +#define RLC_DBGMASK_DETAIL (RLC_DBG_SUB_MASK << 0) /**< Parameters, It will give + in depth info */ +#define RLC_DBGMASK_BRIEF (RLC_DBG_SUB_MASK << 1) /**< Info, It will give info at + entry and exit places along + with certain state changes */ +#define RLC_DBGMASK_ERROR (RLC_DBG_SUB_MASK << 2) /**< Error information */ +#define RLC_DBGMASK_FATAL (RLC_DBG_SUB_MASK << 3) /**< FATAL errors like memory + resource failure etc., */ + +#define RLC_DBG_MDL_MASK (RLC_DBG_SUB_MASK << 4) + +#define RLC_DBGMASK_TM (RLC_DBG_MDL_MASK << 0) /**< TM */ +#define RLC_DBGMASK_UM (RLC_DBG_MDL_MASK << 1) /**< UM */ +#define RLC_DBGMASK_AM (RLC_DBG_MDL_MASK << 2) /**< AM */ +#define RLC_DBGMASK_DL (RLC_DBG_MDL_MASK << 3) /**< DL */ +#define RLC_DBGMASK_UL (RLC_DBG_MDL_MASK << 4) /**< UL */ +#define RLC_DBGMASK_CFG (RLC_DBG_MDL_MASK << 5) /**< CFG */ +#define RLC_DBGMASK_LMM (RLC_DBG_MDL_MASK << 6) /**< LMM */ +#define RLC_DBGMASK_INF (RLC_DBG_MDL_MASK << 7) /**< UI, LI */ +#define RLC_DBGMASK_DUT (RLC_DBG_MDL_MASK << 8) /**< DBM, UTL, TMR */ +#define RLC_DBGMASK_MBUF_PRNT (RLC_DBG_MDL_MASK << 9) /**< MBUF, useful in + integrated + testing */ +#define RLC_DBGMASK_MEM_INFO (RLC_DBG_MDL_MASK << 10) /**< Print SSI memory + information*/ +#define RLC_DBGMASK_UDX (RLC_DBG_MDL_MASK << 11) /**< UDX interface */ + +#ifdef DEBUGP +#define RLC_PRNT_BORDER \ +do \ +{ \ + RLC_PRNT((_kwPBuf, "\n==========================\n")); \ +}while(0) + +#define RLC_PRNT_HLINE(_cb,_pMsg) \ +{ \ + sprintf((_cb)->init.prntBuf, "[RLC_LAYER: %s:%d]::", __FILE__, __LINE__); \ + SPrint((_cb)->init.prntBuf); \ + RLC_PRNT_TSTAMP(_cb); \ + sprintf((_cb)->init.prntBuf, _pMsg); \ + SPrint((_cb)->init.prntBuf); \ +} + +#define RLC_PRNT(_cb,_prntbuf) \ +{ \ + sprintf _prntbuf; \ + SPrint(_cb->init.prntBuf); \ +} + +#define RLC_PRINT_TO_BUFFER(_cb,...) \ +{ \ + snprintf((_cb)->init.prntBuf, PRNTSZE, "[%s]::", __func__); \ + SPrint((_cb)->init.prntBuf); \ + snprintf(_cb->init.prntBuf, PRNTSZE,__VA_ARGS__); \ + SPrint(_cb->init.prntBuf); \ +} + +#define RLC_PRNT_TSTAMP(_cb) \ +{ \ + S8 _buf[60]; \ + DateTime dt; \ + memset((&dt), 0, sizeof(DateTime)); \ + SGetDateTime(&dt); \ + sprintf(_buf, "date: %02d/%02d/%04d time: %02d:%02d:%02d", \ + (int)dt.month,(int)dt.day,(int)dt.year + 1900, \ + (int)dt.hour,(int)dt.min,(int)dt.sec); \ + RLC_PRNT(_cb,(_cb->init.prntBuf,("[%s]", _buf))); \ +} + +#define RLC_PRNT_MBUF(_cb,_mBufPtr) \ +do \ +{ \ + if(_cb->init.dbgMask & (RLC_DBGMASK_MBUF_PRNT)) \ + { \ + RLC_PRNT_HLINE(_cb,("\nMessage Buffer Contents:\n")); \ + SPrntMsg ((Buffer *)_mBufPtr, 0, 0); \ + } \ +}while(0) + +#define RLC_PRNT_MEMINFO(_cb) \ +do \ +{ \ + uint32_t _memInfo; \ + if(_cb->init.dbgMask & (RLC_DBGMASK_MEM_INFO)) \ + { \ + RLC_PRNT_HLINE(_cb,("\nMemory Information:\n")); \ + SRegInfoShow(0, &_memInfo); \ + } \ +}while(0) + +#define RLCDBGP_INTERNAL(_cb,_mask,...) \ +do \ +{ \ + if (!((_cb->init.dbgMask & _mask) ^ _mask)) \ + { \ + RLC_PRINT_TO_BUFFER(_cb, __VA_ARGS__); \ + } \ +}while(0) + +#define RLCDBGP_ERROR(_cb, ...) \ + RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_ERROR | RLC_MODULE),__VA_ARGS__) + +#define RLCDBGP_DETAIL(_cb, ...) \ + RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_DETAIL | RLC_MODULE),__VA_ARGS__) + +#define RLCDBGP_BRIEF(_cb, ...) \ + RLCDBGP_INTERNAL(_cb,(RLC_DBGMASK_BRIEF | RLC_MODULE),__VA_ARGS__) + +#else /* DEBUGP */ +#define RLC_PRNT_HLINE(_cb,_pMsg) +#define RLC_PRNT(_cb,_prntbuf) +#define RLC_PRNT_TSTAMP(_cb) +#define RLC_PRNT_MBUF(_cb,_mBufPtr) +#define RLC_PRNT_MEMINFO(_cb) +#define RLCDBGP(_cb,_mask, _arg) +#define RLCDBGP_ERROR(_cb, ...) +#define RLCDBGP_DETAIL(_cb, ...) +#define RLCDBGP_BRIEF(_cb, ...) +#endif /* DEBUGP */ + +/******************************************************************************* + * LMM Defines + ******************************************************************************/ +#define RLC_LMM_RB_STS_INC(_cb) (_cb)->genSts.numOfRb++; + +#define RLC_LMM_RB_STS_DEC(_cb) (_cb)->genSts.numOfRb--; + +#if defined(SS_MULTICORE_SUPPORT) && defined(SS_M_PROTO_REGION) +#define RLC_FILL_SAP_HELPER(_Sap, _cfg, _gCb)\ +{\ + _Sap->pst.selector = _cfg->selector; \ + _Sap->pst.route = _cfg->route; \ + _Sap->pst.prior = _cfg->priority; \ + _Sap->pst.region = _gCb->init.region;\ + _Sap->pst.pool = _gCb->init.pool;\ + _Sap->pst.dstProcId = _cfg->procId; \ + _Sap->pst.dstEnt = _cfg->ent; \ + _Sap->pst.dstInst = _cfg->inst; \ + _Sap->pst.srcProcId = _gCb->init.procId; \ + _Sap->pst.srcEnt = _gCb->init.ent; \ + _Sap->pst.srcInst = _gCb->init.inst; \ + _Sap->pst.event = EVTNONE; \ + _Sap->spId = _cfg->sapId; \ + _Sap->state = RLC_SAP_CFG; \ +} +#else /* defined(SS_MULTICORE_SUPPORT) && defined(SS_M_PROTO_REGION) */ +#define RLC_FILL_SAP_HELPER(_Sap, _cfg, _gCb)\ +{\ + _Sap->pst.selector = _cfg->selector; \ + _Sap->pst.route = _cfg->route; \ + _Sap->pst.prior = _cfg->priority; \ + _Sap->pst.region = _cfg->mem.region;\ + _Sap->pst.pool = _cfg->mem.pool;\ + _Sap->pst.dstProcId = _cfg->procId;\ + _Sap->pst.dstEnt = _cfg->ent;\ + _Sap->pst.dstInst = _cfg->inst;\ + _Sap->pst.srcProcId = _gCb->init.procId;\ + _Sap->pst.srcEnt = _gCb->init.ent;\ + _Sap->pst.srcInst = _gCb->init.inst;\ + _Sap->pst.event = EVTNONE;\ + _Sap->spId = _cfg->sapId;\ + _Sap->state = RLC_SAP_CFG;\ +} +#endif + +/******************************************************************************* + * UDX Defines + ******************************************************************************/ +#define RLC_GET_DL_SAPCB(_cb, _rbCb) (_cb->u.dlCb->udxDlSap + _rbCb->udxSapId) +#define RLC_GET_UDX_SAP(_cb) (_cb->u.ulCb->udxUlSap) + +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS +#define RLC_L2_MAX_TIMERS 1 +#define RLC_QCI_LIST_BUCKET_SIZE 10 +#define RLC_TB_LIST_BUCKET_SIZE 10 +#define RLC_MAX_L2MEAS_EVT 10 +/* L2 Measurement index to be used in rbCb to store measData */ +#define RLC_L2MEAS_ACT_UE 0 +#define RLC_L2MEAS_DL_DELAY 1 +#define RLC_L2MEAS_DL_DISC 2 +#define RLC_L2MEAS_UU_LOSS 3 +#define RLC_L2MEAS_DL_IP 4 +#define RLC_L2MEAS_UL_IP 5 +#endif /* LTE_L2_MEAS */ + +#define RLC_RDWR_LOCK(_lockPtr) +#define RLC_RDWR_UNLOCK(_lockPtr) +#define RLC_TIME_DIFF(t1,t2) \ + (t1 */ +/* kw005.201 added support for L2 Measurement */ +#ifdef LTE_L2_MEAS + RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */ +#endif /* LTE_L2_MEAS */ +}RlcUlCb; + +typedef struct rlcThptPerUe +{ + uint16_t ueIdx; + uint64_t dataVol; +}RlcThptPerUe; + +/** + * @brief Structure to hold information about throughput at RLC + * + */ +typedef struct rlcThpt +{ + Inst inst; /* RLC instance */ + CmTimer thptTmr; /* Throughput Timer */ + uint8_t numActvUe; /* Number of Active UEs */ + RlcThptPerUe thptPerUe[MAX_NUM_UE]; /* Throughput calculated per UE */ +}RlcThpt; + +/** + * @brief Structure to hold an information about a RLC instance + * + * @details + * - init : Task Initialization Info + * - genCfg : General Configuration + * - genSts : General Statistics + * - trcLen : Trace Length + * - trcMask : Trace Mask + * - rlcTq : Timer queue + * - rlcTqCp : Timer queue control point + * - u : Union depending on whether the instance is UL or DL + * - ulCb : UL instance Control Block + * - dlCb : DL instance Control Block + */ +typedef struct rlcCb +{ + TskInit init; /*!< Task Initialization Info */ + RlcGenCfg genCfg; /*!< General Configuration Structure */ + RlcGenSts genSts; /*!< General Statistics */ + S16 trcLen; /*!< Trace Length */ + uint8_t trcMask; /*!< Trace Mask */ + CmTqType rlcTq[RLC_TMR_LEN]; /*!< Timer queue */ + CmTqCp rlcTqCp; /*!< Timer queue control point */ + union + { + RlcUlCb *ulCb; /*!< Ul Control Block */ + RlcDlCb *dlCb; /*!< Dl Control Block */ + } u; + uint8_t dlSduId; /*!< Downlink SDU ID */ + RlcThpt rlcThpt; /*!< Throughput at RLC*/ +}RlcCb; + +RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */ + +/**************************************************************************** + * Declarations + ***************************************************************************/ +S16 rlcGetSId ARGS((SystemId *s)); + +Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt)); + +S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf)); + +void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt)); + +void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType)); + +bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt)); + +#ifdef LTE_L2_MEAS +Void rlcLmmSendAlarm ARGS (( RlcCb *gCb, + uint16_t category, + uint16_t event, + uint16_t cause, + SuId suId, + uint32_t ueId, + uint8_t qci)); + +S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt )); +S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType)); +S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType)); +S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt )); +S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType)); +S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType)); +Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData, + RlcL2MeasRbCb *rbL2Cb, + uint8_t measType)); +#else /* LTE_L2_MEAS */ +Void rlcLmmSendAlarm ARGS ((RlcCb *gCb, + uint16_t category, + uint16_t event, + uint16_t cause, + SuId suId, + uint32_t ueId)); +#endif /* LTE_L2_MEAS */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __RLC_UTILS_H__ */ /********************************************************************** + End of file **********************************************************************/ diff --git a/src/5gnrrlc/kw_utl_dl.c b/src/5gnrrlc/rlc_utl_dl.c similarity index 99% rename from src/5gnrrlc/kw_utl_dl.c rename to src/5gnrrlc/rlc_utl_dl.c index 6375aa959..4050de75c 100755 --- a/src/5gnrrlc/kw_utl_dl.c +++ b/src/5gnrrlc/rlc_utl_dl.c @@ -32,11 +32,11 @@ --rlcUtlSendUlDataToDu --kwUtlShutDown - File: kw_utl_dl.c + File: rlc_utl_dl.c **********************************************************************/ -/** @file kw_utl_dl.c +/** @file rlc_utl_dl.c @brief RLC Utility Module */ @@ -52,11 +52,9 @@ #include "lkw.h" /* LKW defines */ #include "rgu.h" /* RGU defiens */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_err.h" /* Error defines */ -#include "kw_udx.h" -#include "kw_dl.h" +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Error defines */ + /* extern (.x) include files */ #include "ckw.x" /* CKW includes */ @@ -64,11 +62,9 @@ #include "lkw.x" /* LKW inlcudes */ #include "rgu.x" /* RGU includes */ -#include "kw.x" /* RLC includes */ -#include "kw_udx.x" /* UDX interface includes */ -#include "kw_dl.x" /* RLC downlink includes */ - -#include "rlc_utils.h" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_dl_ul_inf.h" +#include "rlc_dl.h" /* RLC downlink includes */ #include "rlc_mac_inf.h" #include "du_app_rlc_inf.h" #include "rlc_lwr_inf_api.h" @@ -1182,7 +1178,7 @@ Void rlcUtlFreeDlMemory(RlcCb *gCb) #endif { RlcSdu* sdu = (RlcSdu *)(lst->first->node); - RLC_RMV_SDU(gCb, lst, sdu); + RLC_REMOVE_SDU(gCb, lst, sdu); toBeFreed--; } diff --git a/src/5gnrrlc/kw_utl_ul.c b/src/5gnrrlc/rlc_utl_ul.c similarity index 98% rename from src/5gnrrlc/kw_utl_ul.c rename to src/5gnrrlc/rlc_utl_ul.c index f3ce80f2e..4604f19f2 100755 --- a/src/5gnrrlc/kw_utl_ul.c +++ b/src/5gnrrlc/rlc_utl_ul.c @@ -31,11 +31,11 @@ --rlcUtlSendUlDataToDu --kwUtlShutDown - File: kw_utl_ul.c + File: rlc_utl_ul.c **********************************************************************/ -/** @file kw_utl_ul.c +/** @file rlc_utl_ul.c @brief RLC Utility Module */ @@ -50,11 +50,9 @@ #include "kwu.h" /* KWU defines */ #include "lkw.h" /* LKW defines */ #include "rgu.h" /* RGU defines */ +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* Error defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ -#include "kw_err.h" /* Error defines */ -#include "kw_ul.h" /* RLC Uplink defines */ /* extern (.x) include files */ #include "ckw.x" /* CKW includes */ @@ -62,9 +60,8 @@ #include "lkw.x" /* LKW includes */ #include "rgu.x" /* RGU includes */ -#include "kw.x" /* RLC inlcudes */ -#include "kw_ul.x" /* RLC uplink includes */ -#include "rlc_utils.h" +#include "rlc_utils.h" /* RLC defines */ +#include "rlc_ul.h" /* RLC Uplink defines */ #include "du_app_rlc_inf.h" #include "rlc_upr_inf_api.h" diff --git a/src/5gnrsch/rg_sch_ex_ms.c b/src/5gnrsch/sch_msg_router.c similarity index 98% rename from src/5gnrsch/rg_sch_ex_ms.c rename to src/5gnrsch/sch_msg_router.c index a3403524d..83d36242f 100755 --- a/src/5gnrsch/rg_sch_ex_ms.c +++ b/src/5gnrsch/sch_msg_router.c @@ -18,17 +18,17 @@ /************************************************************************ - Name: LTE-MAC layer + Name: NR-SCH layer Type: C source file Desc: C source code SSI Interface Implementation - File: rg_sch_ex_ms.c + File: sch_msg_router.c **********************************************************************/ -/** @file rg_ex_ms.c +/** @file sch_msg_router.c @brief This file contains the implementation of callback functions registered with SSI during the LTE MAC Task initialization. */ diff --git a/src/du_app/du_mgr_ex_ms.c b/src/du_app/du_mgr_msg_router.c similarity index 99% rename from src/du_app/du_mgr_ex_ms.c rename to src/du_app/du_mgr_msg_router.c index 25c184291..45ec53232 100644 --- a/src/du_app/du_mgr_ex_ms.c +++ b/src/du_app/du_mgr_msg_router.c @@ -15,7 +15,7 @@ # limitations under the License. # ################################################################################ *******************************************************************************/ - +/* File : du_mgr_msg_router.c */ /* This file contains message handling functionality for DU APP */ #include "common_def.h" #include "lrg.h" diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index e7118587f..920afca36 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -1166,7 +1166,6 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \ } } ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg); - duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability); } -- 2.16.6