Merge "DL throughput calculation for UM [Issue-ID: ODUHIGH-319]"
authorHarshita Lal <harshita.lal@radisys.com>
Tue, 4 May 2021 12:14:14 +0000 (12:14 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Tue, 4 May 2021 12:14:14 +0000 (12:14 +0000)
114 files changed:
build/common/compile.mak
build/common/rl.mak [deleted file]
build/odu/makefile
docs/README
docs/user-guide.rst
src/5gnrmac/lwr_mac.h
src/5gnrmac/lwr_mac_ex_ms.c
src/5gnrmac/lwr_mac_fsm.c
src/5gnrmac/lwr_mac_fsm.h
src/5gnrmac/lwr_mac_handle_phy.c
src/5gnrmac/lwr_mac_phy.c
src/5gnrmac/lwr_mac_phy.h
src/5gnrmac/mac.h
src/5gnrmac/mac_cfg_hdl.c
src/5gnrmac/mac_rach.c
src/5gnrmac/mac_slot_ind.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrmac/rg.h
src/5gnrmac/rg_ex_ms.c
src/5gnrmac/rg_lmm.c
src/5gnrrlc/kw.h
src/5gnrrlc/kw.x
src/5gnrrlc/kw_cfg_dl.c
src/5gnrrlc/kw_cfg_ul.c
src/5gnrrlc/kw_dl.h
src/5gnrrlc/kw_dl.x
src/5gnrrlc/kw_dl_ex_ms.c
src/5gnrrlc/kw_env.h
src/5gnrrlc/kw_err.h
src/5gnrrlc/kw_id.c
src/5gnrrlc/kw_lim.c
src/5gnrrlc/kw_lmm.c
src/5gnrrlc/kw_ptli.c
src/5gnrrlc/kw_ptui.c
src/5gnrrlc/kw_tmm_dl.c
src/5gnrrlc/kw_tmm_ul.c
src/5gnrrlc/kw_udx.x
src/5gnrrlc/kw_udx_dl.c
src/5gnrrlc/kw_udx_ptdl.c
src/5gnrrlc/kw_udx_ptul.c
src/5gnrrlc/kw_udx_ul.c
src/5gnrrlc/kw_uim.c
src/5gnrrlc/kw_ul.h
src/5gnrrlc/kw_ul.x
src/5gnrrlc/kw_ul_ex_ms.c
src/5gnrrlc/kw_umm_dl.c
src/5gnrrlc/kw_umm_ul.c
src/5gnrrlc/kw_utl_dl.c
src/5gnrrlc/kw_utl_ul.c
src/5gnrrlc/rlc_mgr.c
src/5gnrrlc/rlc_mgr.h
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_upr_inf_api.c
src/5gnrrlc/rlc_upr_inf_api.h
src/5gnrsch/rg_sch.c
src/5gnrsch/rg_sch_cfg.c
src/5gnrsch/rg_sch_cmn.c
src/5gnrsch/rg_sch_dbm.c
src/5gnrsch/rg_sch_dhm.c
src/5gnrsch/rg_sch_drx.c
src/5gnrsch/rg_sch_gom.c
src/5gnrsch/rg_sch_hdfdd.c
src/5gnrsch/rg_sch_l2m.c
src/5gnrsch/rg_sch_lmm.c
src/5gnrsch/rg_sch_mga.c
src/5gnrsch/rg_sch_pwr.c
src/5gnrsch/rg_sch_ram.c
src/5gnrsch/rg_sch_sc1.c
src/5gnrsch/rg_sch_tmr.c
src/5gnrsch/rg_sch_tom.c
src/5gnrsch/rg_sch_uhm.c
src/5gnrsch/rg_sch_utl.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_rach.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_ue_mgr.c
src/5gnrsch/sch_utils.c
src/5gnrsch/sch_utils.h
src/cm/common_def.h
src/cm/du_app_mac_inf.c
src/cm/du_app_mac_inf.h
src/cm/du_app_rlc_inf.c
src/cm/du_app_rlc_inf.h
src/cm/envopt.h
src/cm/gen.h
src/cm/lkw.c
src/cm/lkw.x
src/cm/mac_sch_interface.c
src/cm/mac_sch_interface.h
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_f1ap_msg_hdl.h
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_egtp.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_f1ap_msg_hdl.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_mgr_main.c
src/du_app/du_ue_mgr.c
src/du_app/du_ue_mgr.h
src/o1/InitConfig.hpp
src/phy_stub/phy_stub_msg_hdl.c
src/rlog/rl_common.c [deleted file]
src/rlog/rl_common.h [deleted file]
src/rlog/rl_interface.h [deleted file]
src/rlog/rl_platform.c [deleted file]
src/rlog/rl_platform.h [deleted file]
src/rlog/rl_postproc.cpp [deleted file]
src/rlog/rl_rlog.c [deleted file]
src/rlog/rl_rlog.h [deleted file]
src/rlog/rl_soc.c [deleted file]
src/rlog/rl_soc.h [deleted file]

index 9ff5c93..1e94aa0 100644 (file)
@@ -75,7 +75,7 @@ xCPP_OPTS+=-g -pipe -pedantic -Wall -Werror -Wno-comment -Wshadow \
     -Wcast-qual -fno-strict-aliasing -fsigned-char -lstdc++ 
 
 # Include path settings
-I_OPTS+=-I$(SRC_DIR) -I$(ROOT_DIR)/src/cm -I$(ROOT_DIR)/src/mt -I$(ROOT_DIR)/src/rlog -I$(ROOT_DIR)/src/wls_lib
+I_OPTS+=-I$(SRC_DIR) -I$(ROOT_DIR)/src/cm -I$(ROOT_DIR)/src/mt -I$(ROOT_DIR)/src/wls_lib
 I_OPTS+=$(PLTFRM_INCLUDES)
 .SUFFIXES:.c .o
 
diff --git a/build/common/rl.mak b/build/common/rl.mak
deleted file mode 100755 (executable)
index b2285e0..0000000
+++ /dev/null
@@ -1,67 +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.                                             #
-################################################################################
-#
-include ../common/rsys_fancy.mak
-COLOR=$(COLOR_GREEN)
-
-#-------------------------------------------------------------#
-#Makefile for RL
-#-------------------------------------------------------------#
-MOD_FLAGS=-UUSE_RLOG_DATA_TYPES 
-
-SRC_DIR=$(ROOT_DIR)/src/rlog
-CM_DIR =$(ROOT_DIR)/src/cm
-
-# Product sources-------------------------------------------------------
-C_SRCS=$(SRC_DIR)/rl_rlog.c $(SRC_DIR)/rl_common.c $(SRC_DIR)/rl_platform.c $(SRC_DIR)/rl_soc.c
-rlPOSTPROCSRCS=$(SRC_DIR)/rl_common.c $(SRC_DIR)/rl_postproc.cpp
-
-# Product includes -------------------------------------------------------
-HDR_FILES=$(SRC_DIR)/rl_common.h  $(SRC_DIR)/rl_rlog.h  $(SRC_DIR)/rl_interface.h \
-                 $(SRC_DIR)/rl_platform.h
-HDR_FILES+=$(wildcard $(CM_DIR)/*.)
-
-# Object files ------------------------------------
-C_OBJS_WO_LOG=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(C_SRCS))
-
-#-------------------------------------------------------------#
-#Makefile for RL
-#-------------------------------------------------------------#
-rlPOSTPROCOPTS=-DSS_LINUX -DUSE_RLOG_DATA_TYPES
-
-lib:$(LIB_DIR)/librl.a
-
-include $(COM_BUILD_DIR)/compile.mak
-
-#-------------------------------------------------------------#
-#Linker macros             
-#-------------------------------------------------------------#
-$(LIB_DIR)/librl.a:$(C_OBJS_WO_LOG)
-       @echo -e "Creating Archive $(COLOR) $@ $(REVERT_COLOR)"
-       $(Q)$(AR) -cr $(OBJ_DIR)/librl.a $(C_OBJS)      
-       @echo -e "$(COLOR)Building the binary logging post processor$(REVERT_COLOR)"
-       $(Q)g++ $(rlPOSTPROCOPTS) $(rlPOSTPROCSRCS) -o  $(OBJ_DIR)/rlogapp
-
-#-------------------------------------------------------------#
-#Clean macros             
-#-------------------------------------------------------------#
-clean:
-       @echo -e "$(COLOR_RED)Clearing binary logging$(REVERT_COLOR)"
-       $(Q)rm -f $(LIB_DIR)/librl.a $(C_OBJS_WO_LOG)
-
-#**********************************************************************
-#         End of file
-#**********************************************************************
index c165fbc..8670797 100644 (file)
@@ -202,7 +202,6 @@ du:
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mac.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/sch.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mt.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
-               $(Q)$(MAKE) -f $(COM_BUILD_DIR)/rl.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/phy_stub.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
 ifeq ($(O1_ENABLE),YES)
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/o1_client.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
@@ -223,7 +222,6 @@ clean_odu:
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mac.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/sch.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mt.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
-               $(Q)$(MAKE) -f $(COM_BUILD_DIR)/rl.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/phy_stub.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
 ifeq ($(O1_ENABLE),YES)
                $(Q)$(MAKE) -f $(COM_BUILD_DIR)/o1_client.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
index ccceee8..d527a5e 100644 (file)
@@ -54,6 +54,7 @@ Install the yang module
 -----------------------
 1. cd l2/build/o1/yang
    sysrepoctl -i o-ran-sc-odu-alarm-v1.yang
+   sysrepoctl -i o-ran-sc-odu-interface-v1.yang
 
 
 D. How to Clean and Build:
index 8a1f7b6..04f463d 100644 (file)
@@ -43,6 +43,7 @@ I. Execution - On locally compiling O-DU High Source Code
       |    cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys
 
       sysrepoctl -i ./yang/o-ran-sc-odu-alarm-v1.yang
+      sysrepoctl -i ./yang/o-ran-sc-odu-interface-v1.yang
 
    c. Navigate to O1 execution folder
 
index 0d4e04d..fff6043 100644 (file)
@@ -66,6 +66,7 @@ typedef struct lwrMacGlobalCb
    Region          region;
    Pool            pool;
    bool            clCfgDone;   /* CL configuration done */
+   uint8_t         phySlotIndCntr;
    LwrMacCellCb    cellCb[MAX_NUM_CELL];   /* List of Cells configured */
    uint8_t         numCell;  /* Number of Cells configured */
    PhyState        phyState;    /* State of PHY */
@@ -273,7 +274,6 @@ LwrMacCellCb * lwrMacGetCellCb ARGS((uint16_t cellId));
 uint32_t reverseBits(uint32_t num, uint8_t numBits);
 void fillDlDciPayload(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos,\
       uint32_t val, uint8_t valSize);
-void lwrMacLayerInit();
 
 #endif
 
index f446545..052e450 100644 (file)
@@ -19,6 +19,7 @@
 /* This file is the entry point for Lower MAC */\r
 \r
 #include "common_def.h"\r
+#include "lwr_mac_fsm.h"\r
 #include "lwr_mac_phy.h"\r
 \r
 /**************************************************************************\r
@@ -79,7 +80,12 @@ uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf)
 #ifdef INTEL_WLS_MEM\r
               case EVT_START_WLS_RCVR:\r
                  {\r
-                    SPutMsg(mBuf);\r
+                    ODU_PUT_MSG_BUF(mBuf);\r
+\r
+                    /* Allocate memory for intial UL transmission */\r
+                    LwrMacEnqueueWlsBlock();\r
+\r
+                    /* Start thread to receive from L1 */\r
                     DU_LOG("\nINFO  -->  LWR MAC: Starting WLS receiver thread");\r
                     LwrMacRecvPhyMsg();\r
                     break;\r
index 5790ca0..164f038 100644 (file)
@@ -25,7 +25,6 @@
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
 #include "mac.h"
-#include "lwr_mac_phy.h"
 #include "lwr_mac.h"
 #ifdef INTEL_FAPI
 #include "fapi.h"
@@ -35,6 +34,7 @@
 #include "wls_lib.h"
 #endif
 #include "lwr_mac_fsm.h"
+#include "lwr_mac_phy.h"
 #include "mac_utils.h"
 
 #define MIB_SFN_BITMASK 0xFC
 #define PDU_PRESENT 1
 #define SET_MSG_LEN(x, size) x += size
 
-void fapiMacConfigRsp(uint16_t cellId);
-uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX];
-
 /* Global variables */
-uint8_t slotIndIdx;
-uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo);
+LwrMacCb lwrMacCb;
+
+uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX];
+void fapiMacConfigRsp(uint16_t cellId);
+uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo, p_fapi_api_queue_elem_t headerElem);
+uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo, p_fapi_api_queue_elem_t headerElem);
 
-void lwrMacLayerInit()
+void lwrMacLayerInit(Region region, Pool pool)
 {
 #ifdef INTEL_WLS_MEM
-   uint8_t  idx;
+   uint8_t idx;
+#endif
+
+   memset(&lwrMacCb, 0, sizeof(LwrMacCb));
+   lwrMacCb.region = region;
+   lwrMacCb.pool = pool;
+   lwrMacCb.clCfgDone = TRUE;
+   lwrMacCb.numCell = 0;
+   lwrMacCb.phyState = PHY_STATE_IDLE;
 
+#ifdef INTEL_WLS_MEM
    /* Initializing WLS free mem list */
-   slotIndIdx = 1;
+   lwrMacCb.phySlotIndCntr = 1;
    for(idx = 0; idx < WLS_MEM_FREE_PRD; idx++)
    {
       cmLListInit(&wlsBlockToFreeList[idx]);
@@ -1288,7 +1298,7 @@ uint32_t getParamValue(fapi_uint16_tlv_t *tlv, uint16_t type)
  ******************************************************************/
 void setMibPdu(uint8_t *mibPdu, uint32_t *val, uint16_t sfn)
 {
-   *mibPdu |= (((uint8_t)(sfn >> 2)) & MIB_SFN_BITMASK);
+   *mibPdu |= (((uint8_t)(sfn << 2)) & MIB_SFN_BITMASK);
    *val = (mibPdu[0] << 24 | mibPdu[1] << 16 | mibPdu[2] << 8);
    DU_LOG("\nDEBUG  -->  LWR_MAC: MIB PDU %x", *val);
 }
@@ -2019,7 +2029,13 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
    vendorMsg->config_req_vendor.carrier_aggregation_level = 0;
    vendorMsg->config_req_vendor.group_hop_flag = 0;
    vendorMsg->config_req_vendor.sequence_hop_flag = 0;
-
+   vendorMsg->start_req_vendor.sfn = 0;
+   vendorMsg->start_req_vendor.slot = 0;
+   vendorMsg->start_req_vendor.mode = 4;
+#ifdef DEBUG_MODE
+   vendorMsg->start_req_vendor.count = 0;
+   vendorMsg->start_req_vendor.period = 1;
+#endif
    /* Fill FAPI config req */
    LWR_MAC_ALLOC(cfgReqQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_config_req_t)));
    if(!cfgReqQElem)
@@ -2280,7 +2296,7 @@ uint8_t lwr_mac_procStartReqEvt(void *msg)
    fillMsgHeader(&vendorMsg->header, FAPI_VENDOR_MESSAGE, sizeof(fapi_vendor_msg_t));
    vendorMsg->start_req_vendor.sfn = 0;
    vendorMsg->start_req_vendor.slot = 0;
-   vendorMsg->start_req_vendor.mode = 1; /* for FDD */
+   vendorMsg->start_req_vendor.mode = 4; /* for Radio mode */
 #ifdef DEBUG_MODE
    vendorMsg->start_req_vendor.count = 0;
    vendorMsg->start_req_vendor.period = 1;
@@ -2959,7 +2975,7 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \
       dlTtiReqPdu->pdu.pdcch_pdu.precoderGranularity = pdcchInfo->coresetCfg.precoderGranularity;
       dlTtiReqPdu->pdu.pdcch_pdu.numDlDci = pdcchInfo->numDlDci;
       dlTtiReqPdu->pdu.pdcch_pdu.coreSetType = coreSetType;
-
+                    
       /* Calculating PDU length. Considering only one dl dci pdu for now */
       dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t);
    }
@@ -3157,7 +3173,7 @@ uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc,MacCellCfg *macCellCfg,
 
    /* fill the TLV */
    /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
-   pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+   pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
    pduDesc[pduIndex].tlvs[0].tl.length = macCellCfg->sib1Cfg.sib1PduLen;
    LWR_MAC_ALLOC(sib1TxdataValue,macCellCfg->sib1Cfg.sib1PduLen);
    if(sib1TxdataValue == NULLP)
@@ -3174,7 +3190,7 @@ uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc,MacCellCfg *macCellCfg,
    pduDesc[pduIndex].pdu_length = pduLen; 
 
 #ifdef INTEL_WLS_MEM   
-   addWlsBlockToFree(sib1TxdataValue, macCellCfg->sib1Cfg.sib1PduLen, (slotIndIdx-1));
+   addWlsBlockToFree(sib1TxdataValue, macCellCfg->sib1Cfg.sib1PduLen, (lwrMacCb.phySlotIndCntr-1));
 #else
    LWR_MAC_FREE(sib1TxdataValue, macCellCfg->sib1Cfg.sib1PduLen);
 #endif
@@ -3211,7 +3227,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
 
    /* fill the TLV */
    /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
-   pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+   pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
    pduDesc[pduIndex].tlvs[0].tl.length = rarInfo->rarPduLen;
    LWR_MAC_ALLOC(rarTxdataValue,rarInfo->rarPduLen);
    if(rarTxdataValue == NULLP)
@@ -3230,7 +3246,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
     * But since we did not implement WLS, this has to be done here
     */
 #ifdef INTEL_WLS_MEM   
-   addWlsBlockToFree(rarTxdataValue, rarInfo->rarPduLen, (slotIndIdx-1));
+   addWlsBlockToFree(rarTxdataValue, rarInfo->rarPduLen, (lwrMacCb.phySlotIndCntr-1));
 #else
    LWR_MAC_FREE(rarTxdataValue, rarInfo->rarPduLen);
 #endif
@@ -3267,7 +3283,7 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, DlMsgInfo *dlMsgInfo,
 
    /* fill the TLV */
    /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
-   pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+   pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
    pduDesc[pduIndex].tlvs[0].tl.length = dlMsgInfo->dlMsgPduLen;
    LWR_MAC_ALLOC(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
    if(dedMsgTxDataValue == NULLP)
@@ -3286,7 +3302,7 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, DlMsgInfo *dlMsgInfo,
     * But since we did not implement WLS, this has to be done here
     */
 #ifdef INTEL_WLS_MEM   
-   addWlsBlockToFree(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen, (slotIndIdx-1));
+   addWlsBlockToFree(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen, (lwrMacCb.phySlotIndCntr-1));
 #else
    LWR_MAC_FREE(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
 #endif
@@ -3334,7 +3350,8 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
    {
       GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
       /* consider phy delay */
-      ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA);
+      ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA_DL);
+      dlTtiReqTimingInfo.cellId = currTimingInfo.cellId;
 
       macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
 
@@ -3469,16 +3486,20 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
 #ifdef ODU_SLOT_IND_DEBUG_LOG      
            DU_LOG("\nDEBUG  -->  LWR_MAC: Sending DL TTI Request");
 #endif     
-            LwrMacSendToL1(headerElem);
-
+           /* Intel L1 expects UL_TTI.request following DL_TTI.request */
+            fillUlTtiReq(currTimingInfo, headerElem);
            /* send Tx-DATA req message */
-           sendTxDataReq(currTimingInfo, &currDlSlot->dlInfo);
+           sendTxDataReq(dlTtiReqTimingInfo, &currDlSlot->dlInfo, headerElem);
+            LwrMacSendToL1(headerElem);
         }
         else
         {
 #ifdef ODU_SLOT_IND_DEBUG_LOG      
            DU_LOG("\nDEBUG  -->  LWR_MAC: Sending DL TTI Request");
 #endif     
+
+           /* Intel L1 expects UL_TTI.request following DL_TTI.request */
+           fillUlTtiReq(currTimingInfo, headerElem);
             LwrMacSendToL1(headerElem);
         }
         memset(currDlSlot, 0, sizeof(MacDlSlot));
@@ -3516,7 +3537,7 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
+uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo, p_fapi_api_queue_elem_t headerElem)
 {
 #ifdef INTEL_FAPI
    uint8_t nPdu = 0;
@@ -3525,7 +3546,6 @@ uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
    fapi_tx_data_req_t       *txDataReq =NULLP;
    fapi_msg_header_t        *msgHeader =NULLP;
    p_fapi_api_queue_elem_t  txDataElem = 0;
-   p_fapi_api_queue_elem_t  headerElem =0;
 
    GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
 
@@ -3579,21 +3599,10 @@ uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
       }
 
       /* Fill message header */
-      LWR_MAC_ALLOC(headerElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_msg_header_t)));
-      if(!headerElem)
-      {
-        DU_LOG("\nERROR  -->  LWR_MAC: Memory allocation failed for TxDataReq header");
-        LWR_MAC_FREE(txDataElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_tx_data_req_t)));
-        return RFAILED;
-      }
-      FILL_FAPI_LIST_ELEM(headerElem, txDataElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \
-           sizeof(fapi_msg_header_t));
-      msgHeader = (fapi_msg_header_t *)(headerElem + 1);
-      msgHeader->num_msg = 1;
-      msgHeader->handle = 0;
-
       DU_LOG("\nDEBUG  -->  LWR_MAC: Sending TX DATA Request");
-      LwrMacSendToL1(headerElem);
+      msgHeader = (fapi_msg_header_t *)(headerElem + 1);
+      msgHeader->num_msg++;
+      headerElem->p_next->p_next->p_next = txDataElem;
    }
 #endif
    return ROK;
@@ -3879,7 +3888,7 @@ void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\
  *         RFAILED - failure
  *
  ******************************************************************/
-uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
+uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo, p_fapi_api_queue_elem_t headerElem)
 {
 #ifdef INTEL_FAPI
    uint16_t   cellIdx =0;
@@ -3890,7 +3899,6 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
    fapi_ul_tti_req_t *ulTtiReq = NULLP;
    fapi_msg_header_t *msgHeader = NULLP;
    p_fapi_api_queue_elem_t ulTtiElem;
-   p_fapi_api_queue_elem_t headerElem;
 
    if(lwrMacCb.phyState == PHY_STATE_RUNNING)
    {
@@ -3898,8 +3906,8 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
       macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
 
       /* add PHY delta */
-      ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA);
-      currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+      ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA_UL);
+      currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOTS];
 
       LWR_MAC_ALLOC(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t)));
       if(ulTtiElem)
@@ -3936,23 +3944,14 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
            }
         } 
 
-        /* Fill message header */
-        LWR_MAC_ALLOC(headerElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_msg_header_t)));
-        if(!headerElem)
-        {
-           DU_LOG("\nERROR  -->  LWR_MAC: Memory allocation failed for UL TTI req header");
-           LWR_MAC_FREE(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t)));
-           return RFAILED;
-        }
-        FILL_FAPI_LIST_ELEM(headerElem, ulTtiElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \
-              sizeof(fapi_msg_header_t));
-        msgHeader = (fapi_msg_header_t *)(headerElem + 1);
-        msgHeader->num_msg = 1;
-        msgHeader->handle = 0;
 #ifdef ODU_SLOT_IND_DEBUG_LOG
          DU_LOG("\nDEBUG  -->  LWR_MAC: Sending UL TTI Request");
 #endif
-        LwrMacSendToL1(headerElem);
+
+        /* Fill message header */
+         msgHeader = (fapi_msg_header_t *)(headerElem + 1); 
+         msgHeader->num_msg++;
+        headerElem->p_next->p_next = ulTtiElem;
 
         memset(currUlSlot, 0, sizeof(MacUlSlot));
         return ROK;
@@ -4201,7 +4200,7 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo)
    {
       GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
       memcpy(&ulDciReqTimingInfo, &currTimingInfo, sizeof(SlotIndInfo));
-      currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+      currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOTS];
 
       if(currDlSlot->dlInfo.ulGrant != NULLP)
       {
index 606e65d..96cff05 100644 (file)
 #define CORESET_TYPE2 2
 #define CORESET_TYPE3 3
 
+#ifdef INTEL_WLS_MEM
+#define WLS_MEM_FREE_PRD       10        /* Free memory after 10 slot ind */
+#endif
+
 #define FILL_FAPI_LIST_ELEM(_currElem, _nextElem, _msgType, _numMsgInBlock, _alignOffset)\
 {\
    _currElem->msg_type             = (uint8_t) _msgType;\
@@ -56,11 +60,11 @@ uint8_t lwr_mac_procStartReqEvt(void *msg);
 uint8_t lwr_mac_procStopReqEvt(void *msg);
 void sendToLowerMac(uint16_t, uint32_t, void *);
 void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
-uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo);
 uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo);
 uint16_t fillUlDciReq(SlotIndInfo currTimingInfo);
-
 typedef uint8_t (*lwrMacFsmHdlr)(void *);
+void lwrMacLayerInit(Region region, Pool pool);
+
 #endif
 
 /**********************************************************************
index b07ac40..54a6643 100644 (file)
@@ -123,15 +123,6 @@ uint8_t procSlotInd(fapi_slot_ind_t *fapiSlotInd)
       DU_LOG("\nERROR  -->  LWR_MAC: Memory allocation failed in procSlotInd");
       ret = RFAILED;
    }
-
-#ifdef INTEL_WLS_MEM
-   slotIndIdx++;
-   if(slotIndIdx > WLS_MEM_FREE_PRD)
-   {
-      slotIndIdx = 1;
-   }
-   freeWlsBlockList(slotIndIdx - 1);
-#endif
    return ret;
 }
 
index 519de20..46d68d5 100644 (file)
@@ -25,8 +25,8 @@
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
 #include "mac.h"
-#include "lwr_mac_phy.h"
 #include "lwr_mac_fsm.h"
+#include "lwr_mac_phy.h"
 #include "mac_utils.h"
 #include "lwr_mac_utils.h"
 #include "lwr_mac.h"
@@ -283,7 +283,7 @@ uint8_t LwrMacSendToL1(void *msg)
    {
       currMsg = (p_fapi_api_queue_elem_t)msg;
       msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
-      addWlsBlockToFree(currMsg, msgLen, (slotIndIdx-1));
+      addWlsBlockToFree(currMsg, msgLen, (lwrMacCb.phySlotIndCntr-1));
       if(currMsg->p_next == NULLP)
       {
         DU_LOG("\nERROR  -->  LWR MAC : There cannot be only one block to send");
@@ -303,7 +303,7 @@ uint8_t LwrMacSendToL1(void *msg)
       {
         /* Sending the next msg */
         msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
-        addWlsBlockToFree(currMsg, msgLen, (slotIndIdx-1));
+        addWlsBlockToFree(currMsg, msgLen, (lwrMacCb.phySlotIndCntr-1));
         if(currMsg->p_next != NULLP)
         {
            ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_NEXT);
index ee1d65f..456d8c5 100644 (file)
@@ -33,7 +33,6 @@ typedef enum
 }ErrorCode;
 
 #ifdef INTEL_WLS_MEM
-#define WLS_MEM_FREE_PRD       10        /* Free memory after 10 slot ind */
 #define LWR_MAC_WLS_BUF_SIZE   32000      /* Size of WLS memory block */
 #define EVT_START_WLS_RCVR     1
 
@@ -51,7 +50,10 @@ typedef enum
 /* free a static buffer from WLS memory*/
 #define WLS_MEM_FREE(_datPtr, _size)                         \
    if(_datPtr)                                               \
-      SPutSBufWls(0, 0, (Data *)_datPtr, _size);
+   {                                                         \
+      SPutSBufWls(0, 0, (Data *)_datPtr, _size);             \
+      _datPtr = NULLP;                                       \
+   }
 
 typedef struct wlsBlockToFree
 {
@@ -60,7 +62,6 @@ typedef struct wlsBlockToFree
 }WlsBlockToFree;
 
 CmLListCp wlsBlockToFreeList[WLS_MEM_FREE_PRD];
-uint8_t slotIndIdx;
 
 void freeWlsBlockList(uint8_t idx);
 void LwrMacEnqueueWlsBlock();
index e04e13a..e64cba2 100644 (file)
@@ -23,7 +23,6 @@
 #define MAX_CRI_SIZE 6
 #define MAX_MAC_DL_PDU 16
 #define MAX_NUM_HARQ_PROC  16
-#define MAX_SLOT_SUPPORTED    10 /* numerology 0 15Khz */
 #define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
 #define MAC_TQ_SIZE    10        /* Timing Queue Size */
 #define MAX_NUM_TIMER  1         /* MAX number of MAC timers */
@@ -182,8 +181,8 @@ struct macCellCb
    uint16_t    cellId;
    uint8_t     crntiMap;
    MacRaCbInfo macRaCb[MAX_NUM_UE];
-   MacDlSlot   dlSlot[MAX_SLOT_SUPPORTED];
-   MacUlSlot   ulSlot[MAX_SLOT_SUPPORTED];
+   MacDlSlot   dlSlot[MAX_SLOTS];
+   MacUlSlot   ulSlot[MAX_SLOTS];
    uint16_t    numActvUe;
    MacUeCfg    *ueCfgTmpData[MAX_NUM_UE];
    MacUeCb     ueCb[MAX_NUM_UE];
index 352f2b8..f0a50e5 100644 (file)
@@ -218,7 +218,6 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
 
    /* fill SIB1 scheduler parameters */
    schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen;
-   schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod;
    schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod;
    schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex;
    schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex;
index 18a6200..9680559 100644 (file)
@@ -131,7 +131,7 @@ uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
    if(ulSchedInfo != NULLP)
    {
       MacUlSlot *currUlSlot = 
-        &macCb.macCell[cellIdx]->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED];
+        &macCb.macCell[cellIdx]->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOTS];
       memcpy(&currUlSlot->ulInfo, ulSchedInfo, sizeof(UlSchedInfo)); 
    }
    return ROK;
index 2ea5be9..37cb687 100644 (file)
@@ -25,6 +25,7 @@
 #include "rlc_mac_inf.h"
 #include "mac.h"
 #include "mac_upr_inf_api.h"
+#include "lwr_mac.h"
 #include "lwr_mac_fsm.h"
 #include "mac_utils.h"
 
@@ -61,48 +62,48 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
       GET_CELL_IDX(dlSchedInfo->cellId, cellIdx);
       if(dlSchedInfo->isBroadcastPres)
       {
-        currDlSlot = &macCb.macCell[cellIdx]->\
-           dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
-        currDlSlot->dlInfo.isBroadcastPres = true;
-        memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
+         currDlSlot = &macCb.macCell[cellIdx]->\
+                      dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
+         currDlSlot->dlInfo.isBroadcastPres = true;
+         memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
          currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg = \
-           &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg;
+                                            &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg;
       }
 
       if(dlSchedInfo->rarAlloc != NULLP)
       {
-        currDlSlot = &macCb.macCell[cellIdx]->\
-           dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
-        currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
+         currDlSlot = &macCb.macCell[cellIdx]->\
+                      dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
+         currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
 
-        /* MUXing of RAR */
-        fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
+         /* MUXing of RAR */
+         fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
       }
 
       if(dlSchedInfo->dlMsgAlloc != NULLP)
       {
-        currDlSlot = &macCb.macCell[cellIdx]->\
-           dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
-        currDlSlot->dlInfo.dlMsgAlloc = dlSchedInfo->dlMsgAlloc; /* copy msg4 alloc pointer in MAC slot info */
+         currDlSlot = &macCb.macCell[cellIdx]->\
+                      dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
+         currDlSlot->dlInfo.dlMsgAlloc = dlSchedInfo->dlMsgAlloc; /* copy msg4 alloc pointer in MAC slot info */
          currDlSlot->dlInfo.cellId = dlSchedInfo->cellId;
 
          /* Check if the downlink pdu is msg4 */
-        if(dlSchedInfo->dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
-        {
-           macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = dlSchedInfo->dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
-        }
-        else
-        {
-           memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
-           /* Send LC schedule result to RLC */
-           sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime);
-        }
+         if(dlSchedInfo->dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+         {
+            macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = dlSchedInfo->dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+         }
+         else
+         {
+            memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+            /* Send LC schedule result to RLC */
+            sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime);
+         }
       }
 
       if(dlSchedInfo->ulGrant != NULLP)
       {
-        currDlSlot = &macCb.macCell[cellIdx]->\
-           dlSlot[dlSchedInfo->schSlotValue.ulDciTime.slot];
+         currDlSlot = &macCb.macCell[cellIdx]->\
+                      dlSlot[dlSchedInfo->schSlotValue.ulDciTime.slot];
          currDlSlot->dlInfo.ulGrant = dlSchedInfo->ulGrant;
       }
    }
@@ -203,7 +204,7 @@ void buildAndSendMuxPdu(SlotIndInfo currTimingInfo)
 
    GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
 
-   ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA);
+   ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA_DL);
    currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot];
    if(currDlSlot->dlInfo.dlMsgAlloc)
    {
@@ -314,9 +315,8 @@ uint8_t macProcSlotInd(SlotIndInfo slotInd)
    /* Trigger for DL TTI REQ */
    fillDlTtiReq(slotInd);
 
-   /* Trigger for UL TTI REQ */
-   fillUlTtiReq(slotInd);
-   
+   /* TODO : check if this too needs to be sent in sequence with Dl and Ul TTI req.
+    * If so , move trigger for fillUlDciReq to lower mac */
    /* Trigger for UL DCI REQ */
    fillUlDciReq(slotInd);
 
@@ -345,7 +345,7 @@ uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd)
    volatile uint32_t     startTime=0;
 
 #ifdef ODU_SLOT_IND_DEBUG_LOG
-   DU_LOG("\nDEBUG  -->  MAC : Slot Indication received");
+   DU_LOG("\nDEBUG  -->  MAC : Slot Indication received. [%d : %d]", slotInd->sfn, slotInd->slot);
 #endif
    /*starting Task*/
    ODU_START_TASK(&startTime, PID_MAC_TTI_IND);
@@ -387,6 +387,16 @@ uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd)
    /*stoping Task*/
    ODU_STOP_TASK(startTime, PID_MAC_TTI_IND);
    MAC_FREE_SHRABL_BUF(pst->region, pst->pool, slotInd, sizeof(SlotIndInfo));
+
+#ifdef INTEL_WLS_MEM
+   lwrMacCb.phySlotIndCntr++;
+   if(lwrMacCb.phySlotIndCntr > WLS_MEM_FREE_PRD)
+   {
+      lwrMacCb.phySlotIndCntr = 1;
+   }
+   freeWlsBlockList(lwrMacCb.phySlotIndCntr - 1);
+#endif
+
    return ret;
 }  /* fapiMacSlotInd */
 
index 7ede4a5..8262eee 100644 (file)
@@ -50,6 +50,34 @@ MacSchModUeConfigReqFunc macSchModUeConfigReqOpts[] =
    packMacSchModUeConfigReq     /* packing for light weight loosely coupled */
 };
 
+MacSchUeDeleteReqFunc macSchUeDeleteReqOpts[] =
+{
+   packMacSchUeDeleteReq,    /* packing for loosely coupled */
+   MacSchUeDeleteReq,        /* packing for tightly coupled */
+   packMacSchUeDeleteReq     /* packing for light weight loosely coupled */
+};
+
+MacDuUeDeleteRspFunc macDuUeDeleteRspOpts[] =
+{
+   packDuMacUeDeleteRsp,   /* packing for loosely coupled */
+   DuProcMacUeDeleteRsp,   /* packing for tightly coupled */
+   packDuMacUeDeleteRsp   /* packing for light weight loosly coupled */
+};
+
+MacSchCellDeleteReqFunc macSchCellDeleteReqOpts[]=
+{
+   packMacSchCellDeleteReq,    /* packing for loosely coupled */
+   MacSchCellDeleteReq,        /* packing for tightly coupled */
+   packMacSchCellDeleteReq     /* packing for light weight loosely coupled */
+};
+
+MacDuCellDeleteRspFunc macDuCellDeleteRspOpts[] =
+{
+   packDuMacCellDeleteRsp,   /* packing for loosely coupled */
+   DuProcMacCellDeleteRsp,   /* packing for tightly coupled */
+   packDuMacCellDeleteRsp   /* packing for light weight loosly coupled */
+};
+
 /*******************************************************************
  *
  * @brief Fills mac cell group config to be sent to scheduler
@@ -2403,6 +2431,611 @@ uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg)
    return ROK;
 }
 
+/*******************************************************************
+*
+* @brief Fill and Send UE Delete response from MAC to DU APP
+*
+* @details
+*
+*    Function : MacSendUeDeleteRsp 
+*
+*    Functionality: Fill and Send UE Delete response from MAC to DUAPP
+*
+* @params[in] MAC UE delete result
+*             SCH UE delete response
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, UeDeleteStatus result)
+{
+   MacUeDeleteRsp *deleteRsp;
+   Pst            rspPst;
+
+   MAC_ALLOC_SHRABL_BUF(deleteRsp, sizeof(MacUeDeleteRsp));
+   if(!deleteRsp)
+   {
+      DU_LOG("\nERROR  -->  MAC : Memory allocation for UE delete response failed");
+      return RFAILED;
+   }
+
+   /* Filling UE delete response */
+   deleteRsp->cellId = cellId;
+   GET_UE_IDX(crnti,deleteRsp->ueIdx);
+   deleteRsp->result = result;
+
+   /* Fill Post structure and send UE delete response*/
+   memset(&rspPst, 0, sizeof(Pst));
+   FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_DELETE_RSP);
+   return (*macDuUeDeleteRspOpts[rspPst.selector])(&rspPst, deleteRsp);
+}
+
+/*******************************************************************
+*
+* @brief freeing the Pucch Resrc Cfg 
+*
+* @details
+*
+*    Function : deletePucchResourcesCfg 
+*
+*    Functionality: freeing the Pucch Resrc Cfg
+*
+* @params[in] PucchResrcCfg *resrcCfg
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+void deletePucchResourcesCfg(PucchResrcCfg *resrcCfg)
+{
+   uint8_t resrcIdx;
+   for(resrcIdx =0; resrcIdx< resrcCfg->resrcToAddModListCount;resrcIdx++)
+   {
+      switch(resrcCfg->resrcToAddModList[resrcIdx].pucchFormat)
+      {
+         case PUCCH_FORMAT_0:
+         {
+            MAC_FREE(resrcCfg->resrcToAddModList[resrcIdx].PucchFormat.format0, sizeof(PucchFormat0));
+            break;
+         }
+         case PUCCH_FORMAT_1:
+         {
+            MAC_FREE(resrcCfg->resrcToAddModList[resrcIdx].PucchFormat.format1, sizeof(PucchFormat1));
+            break;
+         }
+         case PUCCH_FORMAT_2:
+         {
+            MAC_FREE(resrcCfg->resrcToAddModList[resrcIdx].PucchFormat.format2, sizeof(PucchFormat2_3));
+            break;
+         }
+         case PUCCH_FORMAT_3:
+         {
+            MAC_FREE(resrcCfg->resrcToAddModList[resrcIdx].PucchFormat.format3, sizeof(PucchFormat2_3));
+            break;
+         }
+         case PUCCH_FORMAT_4:
+         {
+            MAC_FREE(resrcCfg->resrcToAddModList[resrcIdx].PucchFormat.format4, sizeof(PucchFormat4));
+            break;
+         }
+      }
+   }
+
+}
+
+/*******************************************************************
+*
+* @brief Function to delete MAC Pdsch ServCellCfg
+*
+* @details
+*
+*    Function : deleteMacPdschServCellCfg
+*
+*    Functionality: Function to delete MAC Pdsch ServCellCfg
+*
+* @params[in] PdschServCellCfg *pdschServCellCfg
+* @return void
+*
+* ****************************************************************/
+
+void deleteMacPdschServCellCfg(PdschServCellCfg *pdschServCellCfg)
+{
+   MAC_FREE(pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
+   MAC_FREE(pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
+   MAC_FREE(pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
+   MAC_FREE(pdschServCellCfg->xOverhead, sizeof(PdschXOverhead));
+}
+
+/*******************************************************************
+*
+* @brief Handles UE Delete requst from DU APP
+*
+* @details
+*
+*    Function : deleteMacUeCb 
+*
+*    Functionality: Handles UE Delete requst from DU APP
+*
+* @params[in] MacCellCb *cellCb,uint16_t ueIdx
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+void deleteMacUeCb(MacUeCb  *ueCb)
+{
+   MacUeCfg *ueCfg = NULLP;
+   ServCellCfgInfo *servCellCfg;
+   
+   if(ueCb->cellCb)
+   {
+      MAC_FREE(ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4Pdu,  ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4PduLen);
+      MAC_FREE(ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4TxPdu, ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4TbSize);
+      
+      if(ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1])
+      {
+         ueCfg =ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1]; 
+         MAC_FREE(ueCfg->ambrCfg, sizeof(AmbrCfg));
+         if(ueCfg->spCellCfgPres)
+         {
+            servCellCfg = &ueCfg->spCellCfg.servCellCfg;
+            MAC_FREE(servCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+            
+            if(servCellCfg->initUlBwp.pucchPresent)
+            {
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.resrcSet, sizeof(PucchResrcSetCfg));
+               
+               if(servCellCfg->initUlBwp.pucchCfg.resrc)
+               {
+                  deletePucchResourcesCfg(servCellCfg->initUlBwp.pucchCfg.resrc);
+                  MAC_FREE(servCellCfg->initUlBwp.pucchCfg.resrc, sizeof(PucchResrcCfg));
+               }
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format1, sizeof(PucchFormatCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format2, sizeof(PucchFormatCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format3, sizeof(PucchFormatCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format4, sizeof(PucchFormatCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.schedReq, sizeof(PucchSchedReqCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.multiCsiCfg, sizeof(PucchMultiCsiCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.spatialInfo, sizeof(PucchSpatialCfg));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.dlDataToUlAck , sizeof(PucchDlDataToUlAck));
+               MAC_FREE(servCellCfg->initUlBwp.pucchCfg.powerControl, sizeof(PucchPowerControl));
+               deleteMacPdschServCellCfg(&servCellCfg->pdschServCellCfg);
+            }
+         }
+         for(uint8_t idx=0 ;idx < ueCfg->numLcs; idx++)
+         {
+            MAC_FREE(ueCfg->lcCfgList[idx].drbQos, sizeof(DrbQosInfo));
+            MAC_FREE(ueCfg->lcCfgList[idx].snssai, sizeof(Snssai));
+         }
+         MAC_FREE(ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1],sizeof(MacUeCfg));
+      }
+   }
+   memset(ueCb, 0, sizeof(MacUeCb));
+}
+
+/*******************************************************************
+*
+* @brief  Processes UE delete response from scheduler
+*
+* @details
+*
+*    Function : MacProcSchUeCfgRsp
+*
+*    Functionality:
+*      Processes UE create delete from scheduler
+*
+* @params[in] Pst : Post structure
+*             schUeDelRsp : Scheduler UE delete respons
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp)
+{
+   uint8_t ueIdx =0;
+   uint16_t cellIdx=0;
+   uint8_t ret = RFAILED;
+   UeDeleteStatus result;
+   
+   if(schUeDelRsp)
+   {
+      if(schUeDelRsp->rsp == RSP_OK)
+      {
+         DU_LOG("\nINFO   -->  MAC : SCH UE Delete response for CRNTI[%d] is successful", schUeDelRsp->crnti);
+         GET_CELL_IDX(schUeDelRsp->cellId, cellIdx);
+         if(macCb.macCell[cellIdx])
+         {
+            GET_UE_IDX(schUeDelRsp->crnti, ueIdx);
+            if(macCb.macCell[cellIdx]->ueCb[ueIdx -1].crnti == schUeDelRsp->crnti)
+            {
+               deleteMacUeCb(&macCb.macCell[cellIdx]->ueCb[ueIdx -1]);
+               macCb.macCell[cellIdx]->numActvUe--;
+               result = SUCCESS;
+               ret = ROK;
+            }
+            else
+            {
+               DU_LOG("\nERROR  -->  MAC : MacProcSchUeDeleteRsp(): crnti[%d] does not exist ",schUeDelRsp->crnti);
+               result = UEIDX_INVALID;
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  MAC : MacProcSchUeDeleteRsp(): cellId[%d] does not exist ",schUeDelRsp->cellId);
+            result = CELLID_INVALID;
+         }
+      }
+      else
+      {
+         result = (schUeDelRsp->cause == INVALID_CELLID) ? CELLID_INVALID : UEIDX_INVALID;
+      }
+      if(MacSendUeDeleteRsp(schUeDelRsp->cellId, schUeDelRsp->crnti, result) != ROK)
+      {
+         DU_LOG("\nERROR  -->  MAC: MacProcSchUeDeleteRsp(): Failed to send UE delete response");
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: MacProcSchUeDeleteRsp(): Failed to receive UE delete response by SCH");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+*
+* @brief Sends UE delete req to Scheduler
+*
+* @details
+*
+*    Function : sendUeDelReqToSch
+*
+*    Functionality: sends UE delete req to Scheduler
+*
+* @params[in] Pst *pst,  MacUeDelete *ueDelete
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t sendUeDelReqToSch(Pst *pst, MacUeDelete *ueDelete)
+{
+   if(ueDelete != NULLP)
+   {
+      Pst schPst;
+      SchUeDelete schUeDel;
+
+      memset(&schUeDel, 0, sizeof(SchUeDelete));
+      schUeDel.cellId = ueDelete->cellId;
+      schUeDel.crnti  = ueDelete->crnti;
+      MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(MacUeDelete));
+      FILL_PST_MAC_TO_SCH(schPst, EVENT_UE_DELETE_REQ_TO_SCH);
+      return(*macSchUeDeleteReqOpts[schPst.selector])(&schPst, &schUeDel);
+   }
+   else
+   {
+      DU_LOG("\nERROR  --> SCH: sendUeDelReqToSch():MAC Ue Delete is NULL");
+      return RFAILED;
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles UE Delete requst from DU APP
+ *
+ * @details
+ *
+ *    Function : MacProcUeDeleteReq
+ *
+ *    Functionality: Handles UE Delete requst from DU APP
+ *
+ * @params[in] Pst *pst, MacUeDelete *ueDelete
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete)
+{
+   uint8_t ret = ROK;
+   uint8_t cellIdx=0;
+   UeDeleteStatus result=SUCCESS;
+   MacUeCb  *ueCb = NULLP;
+   MacCellCb *cellCb = NULLP;
+
+   DU_LOG("\nINFO   -->  MAC : UE Delete Request received for ueIdx[%d]", ueDelete->ueIdx);
+
+   if(ueDelete)
+   {
+      GET_CELL_IDX(ueDelete->cellId, cellIdx);     
+      cellCb = macCb.macCell[cellIdx];
+      if(cellCb)
+      {
+         ueCb = &cellCb->ueCb[ueDelete->ueIdx-1];
+         if(ueCb->crnti == ueDelete->crnti)
+         {
+            ret = sendUeDelReqToSch(pst, ueDelete);
+            if(ret != ROK)
+            {
+               DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): Failed to send UE Delete Request to SCH");
+               ret = RFAILED;
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): CRNTI is not matched");
+            result = UEIDX_INVALID;
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeIdx = %d",ueDelete->ueIdx);
+         result = CELLID_INVALID;
+      }
+
+      if(result != SUCCESS)
+      {
+         MacSendUeDeleteRsp(ueDelete->cellId, ueDelete->crnti, result);
+         MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(MacUeDelete));
+         ret = RFAILED;
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): MAC UE delete request processing failed");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill and Send Cell Delete response from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : MacSendCellDeleteRsp
+ *
+ *    Functionality: Fill and Send Cell Delete response from MAC to DUAPP
+ *
+ * @params[in] MAC Cell delete result
+ *             SCH Cell delete response
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
+{
+   MacCellDeleteRsp *deleteRsp=NULLP;
+   Pst            rspPst;
+
+   MAC_ALLOC_SHRABL_BUF(deleteRsp, sizeof(MacCellDeleteRsp));
+   if(!deleteRsp)
+   {
+      DU_LOG("\nERROR  -->  MAC : MacSendCellDeleteRsp(): Memory allocation for Cell delete response failed");
+      return RFAILED;
+   }
+
+   /* Filling CELL delete response */
+   deleteRsp->cellId = cellId;
+   deleteRsp->result = result;
+
+   /* Fill Post structure and send CELL delete response*/
+   memset(&rspPst, 0, sizeof(Pst));
+   FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_CELL_DELETE_RSP);
+   return (*macDuCellDeleteRspOpts[rspPst.selector])(&rspPst, deleteRsp);
+}
+
+/*******************************************************************
+ *
+ * @brief  delete MAC CellCb information
+ *
+ * @details
+ *
+ *    Function : deleteMacCellCb 
+ *
+ *    Functionality:
+ *      delete MAC CellCb information
+ *
+ * @params[in] MacCellCb * cellCb 
+ *             
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void deleteMacCellCb(MacCellCb * cellCb)
+{
+   uint8_t idx;
+   for(idx=0; idx<MAX_SLOTS; idx++)  
+   {
+      MAC_FREE(cellCb->dlSlot[idx].dlInfo.rarAlloc, sizeof(RarAlloc));
+      if(cellCb->dlSlot[idx].dlInfo.ulGrant)
+      {
+         MAC_FREE(cellCb->dlSlot[idx].dlInfo.ulGrant->dciInfo.pdschCfg, sizeof(PdschCfg));
+         MAC_FREE(cellCb->dlSlot[idx].dlInfo.ulGrant, sizeof(DciInfo));
+      }
+      if(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc)
+      {
+         MAC_FREE(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu,\
+               cellCb->dlSlot[idx].dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen);
+         MAC_FREE(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc, sizeof(DlMsgAlloc));
+      }
+   }
+
+   memset(cellCb, 0, sizeof(MacCellCb));
+}
+
+/*******************************************************************
+ *
+ * @brief  Processes CELL delete response from scheduler
+ *
+ * @details
+ *
+ *    Function : MacProcSchCellDeleteRsp 
+ *
+ *    Functionality:
+ *      Processes CELL delete from scheduler
+ *
+ * @params[in] Pst : Post structure
+ *             schCellDelRsp : Scheduler CELL delete respons
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * * ****************************************************************/
+uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
+{
+   uint8_t  ret = ROK;
+   uint16_t cellIdx=0;
+   CellDeleteStatus status;
+   
+   if(schCellDelRsp)
+   {
+      if(schCellDelRsp->rsp == RSP_OK)
+      {
+         DU_LOG("\nINFO   -->  MAC : SCH CELL Delete response for cellId[%d] is successful ", \
+         schCellDelRsp->cellId);
+         GET_CELL_IDX(schCellDelRsp->cellId, cellIdx);
+         if(macCb.macCell[cellIdx]) 
+         {
+            if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
+            {
+               deleteMacCellCb(macCb.macCell[cellIdx]);
+               status  = SUCCESSFUL_RSP;
+               MAC_FREE(macCb.macCell[cellIdx], sizeof(MacCellCb));
+            }
+            else
+            {
+                DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+                status = CELL_ID_INVALID;
+                ret = RFAILED;
+            }
+         }
+         else
+         {
+            DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+            status = CELL_ID_INVALID;
+            ret = RFAILED;
+         }
+      }
+      else
+      {
+         DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+         status = CELL_ID_INVALID;
+         ret = RFAILED;
+      }
+      if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
+      {
+         DU_LOG("\nERROR  -->  MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
+         ret = RFAILED;
+      }
+
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: MacProcSchCellDeleteRsp(): schCellDelRsp is NULL");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sends Cell delete req to Scheduler
+ *
+ * @details
+ *
+ *    Function : sendCellDelReqToSch
+ *
+ *    Functionality: sends Cell delete req to Scheduler
+ *
+ * @params[in]  SchCellDelete *schCellDel
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t sendCellDelReqToSch(SchCellDelete *schCellDel)
+{
+   Pst schPst;
+   FILL_PST_MAC_TO_SCH(schPst, EVENT_CELL_DELETE_REQ_TO_SCH);
+   return(*macSchCellDeleteReqOpts[schPst.selector])(&schPst, schCellDel);
+}
+
+/*******************************************************************
+ *
+ * @brief Handles CELL Delete requst from DU APP
+ *
+ * @details
+ *
+ *    Function : MacProcCellDeleteReq
+ *
+ *    Functionality: Handles CELL Delete requst from DU APP
+ *
+ * @params[in] Pst *pst, MacCellDelete *cellDelete
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *
+ * ****************************************************************/
+uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete)
+{
+   uint8_t ret = ROK, cellIdx=0;
+   SchCellDelete schCellDelete;
+
+   DU_LOG("\nINFO   -->  MAC : Cell Delete Request received for cellId[%d]", cellDelete->cellId);
+
+   if(cellDelete)
+   {
+      GET_CELL_IDX(cellDelete->cellId, cellIdx);
+      if(macCb.macCell[cellIdx])
+      {
+         if(macCb.macCell[cellIdx]->cellId == cellDelete->cellId)
+         {
+            memset(&schCellDelete, 0, sizeof(SchCellDelete));
+            schCellDelete.cellId =  cellDelete->cellId;
+            ret = sendCellDelReqToSch(&schCellDelete);
+            if(ret != ROK)
+            {
+               DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to send UE Delete Request to SCH");
+               ret = RFAILED;
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
+            cellDelete->cellId);
+            ret = RFAILED;
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
+               cellDelete->cellId);
+         ret = RFAILED;
+      }
+
+      if(ret == RFAILED)
+      {
+          DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Sending failure response to DU");
+          if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
+          {
+             DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
+             cellDelete->cellId);
+          }
+
+      }
+      MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellDelete, sizeof(MacCellDelete));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Received MacCellDelete is NULL");
+      ret = RFAILED;
+   }
+   return ret;
+}
 
 /**********************************************************************
   End of file
index bf58326..16355d3 100755 (executable)
@@ -36,8 +36,6 @@
 #ifndef __RGH__
 #define __RGH__
 
-#include "rl_interface.h"
-#include "rl_common.h"
 
 
 #ifdef L2_OPTMZ
index ec2c85b..8f5f68d 100755 (executable)
@@ -127,7 +127,17 @@ Buffer  *mBuf                       /* message buffer       */
         /* Process Ue Reconfig Request */
         unpackMacUeReconfigReq(MacProcUeReconfigReq, pst, mBuf);
         break;
-      default:
+    case EVENT_MAC_UE_DELETE_REQ:
+    {
+       unpackMacUeDeleteReq(MacProcUeDeleteReq, pst, mBuf);
+       break;
+    }
+    case EVENT_MAC_CELL_DELETE_REQ:
+    {
+       unpackMacCellDeleteReq(MacProcCellDeleteReq, pst, mBuf);
+       break;
+    }
+    default:
          RG_FREE_MSG(mBuf);
          break;
    }
index 1f22ac3..fc59447 100755 (executable)
 #endif
 #include "ss_rbuf.h"
 #include "ss_rbuf.x"
-#include "lwr_mac.h"         /* MAC CL defines */
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
 #include "mac.h"
-#include "lwr_mac_phy.h"
 #include "lwr_mac_fsm.h"
+#include "lwr_mac_phy.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -77,7 +76,6 @@ Void rgGetSId ARGS((SystemId *s));
 #endif /* __cplusplus */
 
 /* Public variable declaration */
-LwrMacCb   lwrMacCb;
 MacCb  macCb;
 
 /* forward references */
@@ -186,19 +184,11 @@ Reason reason          /* reason */
    SAttachSRngBuf(SS_RNG_BUF_ULMAC_TO_ULRLC, SS_RBUF_ENT_ULRLC,SS_RNG_RX);
 #endif
 
-   /* Initializing CL control block */
-   memset(&lwrMacCb, 0, sizeof(LwrMacCb));
-   lwrMacCb.region = region;
-   lwrMacCb.pool = 0;
-   lwrMacCb.clCfgDone = TRUE;
-   lwrMacCb.numCell = 0;
-   lwrMacCb.phyState = PHY_STATE_IDLE; 
-
    /* Initialize Scheduler as well */
    schActvInit(ENTMAC, (DEFAULT_CELLS + SCH_INST_START), DFLT_REGION, PWR_UP);
 
    /* Initialize lower mac */
-   lwrMacLayerInit();
+   lwrMacLayerInit(region, 0);
 
    return ROK;
 
@@ -258,8 +248,6 @@ RgMngmt  *cfg     /* config structure  */
 #ifdef INTEL_WLS_MEM
          /* Start WLS message receiver thread */
          LwrMacStartWlsRcvr();
-         /* Allocate memory for UL transmissions */
-         LwrMacEnqueueWlsBlock();
 #endif
         reason = rgLMMGenCfg(inst,&cfg->t.cfg); 
         break;
index 52d4237..6bf6782 100755 (executable)
@@ -18,8 +18,8 @@
 
 /********************************************************************20**
   
-        Name:     LTE RLC file 
-    
+        Name:     NR RLC file
+
         Type:     C include file
   
         Desc:     This file contain the hash definations for RLC 
 
 #ifndef __KWH__
 #define __KWH__
-#include "rl_interface.h"
-#include "rl_common.h"
 #include "du_log.h"
 \f 
-#define RLCLAYERNAME   "LTE RLC"     /* Layer Name */
 
 #define EKWxxx 1
 #define EMG099 1
index 1c7feae..7e378b4 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE RLC file 
+        Name:    NR RLC file       
     
         Type:    C include file
   
         Desc:    This file contains all the data structures and 
-                 prototypes for LTE RLC.
+                 prototypes for RLC.
  
         File:    kw.x
 
index 22a6a21..e8f6ccc 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
 
-        Name:    LTE RLC - Configuration Manager file
+        Name:    NR RLC - Configuration Manager file
 
         Type:    C source file
 
@@ -36,9 +36,6 @@
         File:    kw_cfg_dl.c
 
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="CFG";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=191;
 
 /** @file kw_cfg_dl.c
 @brief RLC Downlink Configuration Module
@@ -321,8 +318,7 @@ static S16 rlcAddToDlL2Meas(RlcCb *gCb, RlcDlRbCb *rlcRbCb,uint8_t cellId,uint8_
 static S16 rlcCfgFillDlRbCb(RlcCb *gCb,RlcDlRbCb *rbCb,RlcDlUeCb *ueCb,RlcEntCfgInfo *entCfg)
 {
 
-   RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
-         "rlcCfgFillRbCb(ueId(%d),cellId(%d) rbType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgFillRbCb(ueId(%d),cellId(%d) rbType(%d))",
                 rbCb->rlcId.ueId,
                 rbCb->rlcId.cellId, 
                 entCfg->rbType);
@@ -401,8 +397,7 @@ static S16 rlcCfgFillDlRbCb(RlcCb *gCb,RlcDlRbCb *rbCb,RlcDlUeCb *ueCb,RlcEntCfg
       }
       default:
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,entCfg->rbId, 
-                  "Invalid RB Mode ueId(%d),cellId(%d)",
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RB Mode ueId(%d),cellId(%d)",
                   rbCb->rlcId.ueId,
                   rbCb->rlcId.cellId);
          return RFAILED;
@@ -438,8 +433,7 @@ RlcEntCfgInfo   *entCfg
    
    if (rbCb->mode != entCfg->entMode)
    {
-      RLOG_ARG4(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-            "RB Mode Mismatch : exp [%d] rcv [%d] UEID:%d CELLID:%d", 
+      DU_LOG("\nERROR  -->  RLC_DL : RB Mode Mismatch : exp [%d] rcv [%d] UEID:%d CELLID:%d", 
             rbCb->mode, 
             entCfg->entMode,
             rbCb->rlcId.ueId,
@@ -548,8 +542,7 @@ RlcEntCfgCfmInfo   *entCfm
    RlcDlRbCb     *rlcRbCb;         /* KW RB Control Block */
    uint8_t       reason;          /* Rb Identifier */
 
-   RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId, 
-         "rlcCfgAddRb(cellId(%d),UEID:%d cfgType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgAddRb(cellId(%d),UEID:%d cfgType(%d))",
                 cellId, 
                 ueId,
                 entCfg->cfgType);
@@ -559,8 +552,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                           CKW_CFG_REAS_CELL_UNKWN);
-      RLOG_ARG1(L_ERROR,DBG_RBID,entCfg->rbId,
-               "Add DLRb,CellId is 0 for UEID:%d",
+      DU_LOG("\nERROR  -->  RLC_DL : Add DLRb,CellId is 0 for UEID:%d",
                ueId);
       return RFAILED;
    }
@@ -581,8 +573,7 @@ RlcEntCfgCfmInfo   *entCfm
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK,
                              CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId,
-                  "Invalid RbId ,Max is [%d] CELLID:%d UEID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RbId ,Max is [%d] CELLID:%d UEID:%d",
                   RLC_MAX_RB_PER_CELL,
                   cellId,
                   ueId);
@@ -605,8 +596,7 @@ RlcEntCfgCfmInfo   *entCfm
                RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                                    CKW_CFG_CFM_NOK,
                                    CKW_CFG_REAS_RB_PRSNT);
-               RLOG_ARG2(L_WARNING, DBG_CELLID,cellId, 
-                        "RbId [%d] already exists UEID:%d",
+               DU_LOG("\nERROR  -->  RLC_DL : RbId [%d] already exists UEID:%d",
                         entCfg->rbId,
                         ueId);
                return RFAILED;
@@ -621,8 +611,7 @@ RlcEntCfgCfmInfo   *entCfm
                RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                                    CKW_CFG_CFM_NOK,
                                    CKW_CFG_REAS_CELL_CREAT_FAIL);
-               RLOG_ARG2(L_ERROR,DBG_CELLID,cellId,
-                        "cellCb Creation failed RBID:%d UEID:%d",
+               DU_LOG("\nERROR  -->  RLC_DL : cellCb Creation failed RBID:%d UEID:%d",
                         entCfg->rbId,
                         ueId);
                return RFAILED;
@@ -632,8 +621,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Validate LChId */
          if(entCfg->lCh[0].lChId <= 0)
          {
-            RLOG_ARG3(L_ERROR,DBG_LCID,entCfg->lCh[0].lChId ,
-                     "Invalid LcId CELLID:%d UEID:%d RBID:%d",
+            DU_LOG("\nERROR  -->  RLC_DL : Invalid LcId CELLID:%d UEID:%d RBID:%d",
                      cellId,
                      ueId,
                      entCfg->rbId);
@@ -647,8 +635,7 @@ RlcEntCfgCfmInfo   *entCfm
          RLC_ALLOC(gCb,rlcRbCb, sizeof (RlcDlRbCb));
          if (!rlcRbCb)
          {
-            RLOG_ARG2(L_FATAL,DBG_UEID,ueId,
-                     "Memory allocation failed for rbId:%d CELLID:%d",
+            DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed for rbId:%d CELLID:%d",
                      entCfg->rbId,
                      ueId);
             /* Fill entCfm structure */                           
@@ -678,8 +665,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR,DBG_RBID, entCfg->rbId,
-                  "Invalid RbId for RbType[%d] UEID:%d", 
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RbId for RbType[%d] UEID:%d", 
                   entCfg->rbType,
                   ueId);
          return RFAILED;
@@ -702,8 +688,7 @@ RlcEntCfgCfmInfo   *entCfm
                /* Fill entCfm structure */
                RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                      CKW_CFG_REAS_RB_PRSNT);
-               RLOG_ARG2(L_WARNING, DBG_UEID, ueId,
-                        "CellId[%u]:rbId [%d] already exists",
+               DU_LOG("\nERROR  -->  RLC_DL : CellId[%u]:rbId [%d] already exists",
                         cellId,
                         entCfg->rbId);
                return RFAILED;
@@ -717,8 +702,7 @@ RlcEntCfgCfmInfo   *entCfm
                /* Fill entCfm structure */
                RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                      CKW_CFG_REAS_UE_CREAT_FAIL);
-               RLOG_ARG2(L_WARNING, DBG_CELLID,cellId,
-                        "UeId [%u]:ueCb Creation Failed RBID:%d",
+               DU_LOG("\nERROR  -->  RLC_DL : UeId [%u]:ueCb Creation Failed RBID:%d",
                         ueId,
                         entCfg->rbId);
                return RFAILED;
@@ -753,8 +737,7 @@ RlcEntCfgCfmInfo   *entCfm
             /* Fill entCfm structure */                           
             RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,CKW_CFG_CFM_NOK,
                                     CKW_CFG_REAS_RB_CREAT_FAIL); 
-            RLOG_ARG2(L_FATAL,DBG_UEID,ueId,
-                     "Memory allocation failed RBID:%d CELLID:%d",
+            DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed RBID:%d CELLID:%d",
                      entCfg->rbId,
                      cellId);
             return RFAILED; 
@@ -806,8 +789,7 @@ RlcEntCfgCfmInfo   *entCfm
 
       /* Delete RB CB created */
       RLC_FREE(gCb,rlcRbCb, sizeof(RlcDlRbCb));
-      RLOG_ARG2(L_ERROR,DBG_RBID, entCfg->rbId,
-               "Filling of RbCb failed UEID:%d CELLID:%d",
+      DU_LOG("\nERROR  -->  RLC_DL : Filling of RbCb failed UEID:%d CELLID:%d",
                ueId,
                cellId);
       return RFAILED;
@@ -875,8 +857,7 @@ RlcEntCfgCfmInfo   *entCfm
    RlcDlUeCb     *ueCb;     /* Ue Control Block */
    uint8_t       ret;
 
-   RLOG_ARG3(L_DEBUG,DBG_UEID,ueId,
-             "rlcCfgReCfgRb(cellId(%d), cfgType(%d)) RBID:%d",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgReCfgRb(cellId(%d), cfgType(%d)) RBID:%d",
             cellId, entCfg->cfgType,entCfg->rbId);
 
 
@@ -888,8 +869,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                              CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId,
-                  "Invalid RbId , Max is [%d] UEID:%d CELLID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RbId , Max is [%d] UEID:%d CELLID:%d",
                   RLC_MAX_RB_PER_CELL,
                   ueId,
                   cellId);
@@ -902,8 +882,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                              CKW_CFG_REAS_CELL_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_CELLID,cellId,
-                  "CellCb not found ueId:%d RBID:%d CELLID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : CellCb not found ueId:%d RBID:%d CELLID:%d",
                   ueId,
                   entCfg->rbId,
                   cellId);
@@ -918,8 +897,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
-                  "CELLID:%d RBID:%d not found",
+         DU_LOG("\nERROR  -->  RLC_DL : CELLID:%d RBID:%d not found",
                   cellId,
                   entCfg->rbId);
          return RFAILED;
@@ -941,8 +919,7 @@ RlcEntCfgCfmInfo   *entCfm
                              CKW_CFG_CFM_NOK,
                              ret);
 
-         RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
-                  "CELLID:%u RBID:%d updation failed",
+         DU_LOG("\nERROR  -->  RLC_DL : CELLID:%u RBID:%d updation failed",
                   cellId,
                   entCfg->rbId);
          memcpy(rbCb, &tRbCb, sizeof(RlcDlRbCb));
@@ -957,8 +934,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_UEID,ueId,
-                  "CELLID:%d Invalid RBID:%d for RbType[%d]",
+         DU_LOG("\nERROR  -->  RLC_DL : CELLID:%d Invalid RBID:%d for RbType[%d]",
                   cellId,
                   entCfg->rbId,
                   entCfg->rbType);
@@ -971,8 +947,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
-         RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
-                  "UEID:%d UeCb not found RBID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : UEID:%d UeCb not found RBID:%d",
                   ueId,
                   entCfg->rbId);
          return (ret);
@@ -986,8 +961,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR, DBG_UEID,ueId, 
-                  "CELLID:%d RBID:%d not found",
+         DU_LOG("\nERROR  -->  RLC_DL : CELLID:%d RBID:%d not found",
                   cellId,
                   entCfg->rbId);
          return (ret);
@@ -1005,8 +979,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                ret);
-         RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
-                  "CELLID:%d RBID:%d updation failed",
+        DU_LOG("\nERROR  -->  RLC_DL : CELLID:%d RBID:%d updation failed",
                   cellId,
                   entCfg->rbId);
          memcpy(rbCb, &tRbCb, sizeof(RlcDlRbCb));
@@ -1066,8 +1039,7 @@ RlcEntCfgCfmInfo   *entCfm
    RlcDlCellCb   *cellCb;   /* UE Control Block */
    RlcDlRbCb     *rlcRbCb;   /* KW RB Control Block */
 
-   RLOG_ARG3(L_DEBUG,DBG_UEID,ueId, 
-            "rlcCfgDelRb(RBID(%d), cellId(%d), cfgType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgDelRb(RBID(%d), cellId(%d), cfgType(%d))",
             entCfg->rbId, 
             cellId, 
             entCfg->cfgType);
@@ -1082,8 +1054,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId ,
-                  "Invalid RbId, Max is [%d] UEID:%d CELLID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RbId, Max is [%d] UEID:%d CELLID:%d",
                   RLC_MAX_RB_PER_CELL,
                   ueId,
                   cellId);
@@ -1096,8 +1067,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR,DBG_CELLID,cellId,
-                  "CellCb not found UEID:%d RBID:%d",
+         DU_LOG("\nERROR  -->  RLC_DL : CellCb not found UEID:%d RBID:%d",
                   ueId,
                   entCfg->rbId);
          return (ret);
@@ -1111,8 +1081,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
-                  "CellId[%u]:RbId[%d] not found",
+         DU_LOG("\nERROR  -->  RLC_DL : CellId[%u]:RbId[%d] not found",
                   cellId,
                   entCfg->rbId);
          return (ret);
@@ -1134,8 +1103,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG3(L_ERROR,DBG_RBID, entCfg->rbId,
-                  "Invalid RbId for RbType[%d] UEID:%d CELLID:%d", 
+         DU_LOG("\nERROR  -->  RLC_DL : Invalid RbId for RbType[%d] UEID:%d CELLID:%d", 
                   entCfg->rbType,
                   ueId,
                   cellId);
@@ -1149,8 +1117,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, 
                              CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
-         RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
-                  "UeId [%d]: UeCb not found RBID:%d",
+          DU_LOG("\nERROR  -->  RLC_DL : UeId [%d]: UeCb not found RBID:%d",
                   ueId,
                   entCfg->rbId);
          return (ret);
@@ -1164,8 +1131,7 @@ RlcEntCfgCfmInfo   *entCfm
          /* Fill entCfm structure */
          RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
                CKW_CFG_REAS_RB_UNKWN);
-         RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
-                  "CellId[%u]:RbId[%d] not found",
+         DU_LOG("\nERROR  -->  RLC_DL : CellId[%u]:RbId[%d] not found",
                   cellId,
                   entCfg->rbId);
          return (ret);
@@ -1250,8 +1216,7 @@ RlcEntCfgCfmInfo   *entCfm
    RlcDlRbCb     *rbCb;   /* RB Control Block */
    CmLteRlcId   rlcId;   /* RLC Identifier */
 
-   RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
-            "rlcCfgReEstDlRb(ueId(%d), cellId(%d), cfgType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgReEstDlRb(ueId(%d), cellId(%d), cfgType(%d))",
             ueId, 
             cellId, 
             entCfg->cfgType);
@@ -1268,8 +1233,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, rlcId.rbType, CKW_CFG_CFM_NOK,
             CKW_CFG_REAS_RB_UNKWN);
-      RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
-               "CellId[%u]:RbId[%d] not found",
+      DU_LOG("\nERROR  -->  RLC_DL : CellId[%u]:RbId[%d] not found",
                cellId,
                entCfg->rbId);
       return RFAILED;
@@ -1340,8 +1304,7 @@ RlcEntCfgCfmInfo   *entCfm
    S16        ret;     /* Return Value */
    RlcDlUeCb   *ueCb;   /* UE Control Block */
 
-   RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
-             "rlcCfgDelUe(ueId(%d), cellId(%d), cfgType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgDelUe(ueId(%d), cellId(%d), cfgType(%d))",
             ueId, 
             cellId, 
             entCfg->cfgType);
@@ -1354,8 +1317,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
           CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
-      RLOG_ARG2(L_ERROR,DBG_RBID,entCfg->rbId,
-               "ueId(%d), cellId(%d)",
+      DU_LOG("\nERROR  -->  RLC_DL : ueId(%d), cellId(%d)",
                ueId, 
                cellId);
       return RFAILED;
@@ -1368,8 +1330,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
          CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
-      RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
-               "UEID:%d UeCb not found RBID:%d",
+      DU_LOG("\nERROR  -->  RLC_DL : UEID:%d UeCb not found RBID:%d",
                ueId,
                entCfg->rbId);
       return RFAILED;
@@ -1421,8 +1382,7 @@ RlcEntCfgCfmInfo   *entCfm
    RlcDlCellCb   *cellCb;   /* UE Control Block */
    uint8_t       rbId;      /* RB Identifier */
 
-   RLOG_ARG2(L_DEBUG,DBG_RBID,entCfg->rbId,
-         "rlcCfgDelCell( cellId(%d), cfgType(%d)",
+   DU_LOG("\nDEBUG  -->  RLC_DL : rlcCfgDelCell( cellId(%d), cfgType(%d)",
          cellId, 
          entCfg->cfgType);
 
@@ -1435,8 +1395,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
             CKW_CFG_REAS_CELL_UNKWN);
-      RLOG_ARG1(L_DEBUG,DBG_RBID,entCfg->rbId,
-               "cellId is 0 (%d) ",
+      DU_LOG("\nERROR  -->  RLC_DL : cellId is 0 (%d) ",
                cellId);
       return RFAILED;
    }
@@ -1448,8 +1407,7 @@ RlcEntCfgCfmInfo   *entCfm
       /* Fill entCfm structure */
       RLC_CFG_FILL_CFG_CFM(entCfm, rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
             CKW_CFG_REAS_CELL_UNKWN);
-      RLOG_ARG1(L_ERROR, DBG_CELLID,cellId,
-               "CellCb not found for RBID:%d",
+      DU_LOG("\nERROR  -->  RLC_DL : CellCb not found for RBID:%d",
                entCfg->rbId);
       return RFAILED;
    }
@@ -1495,15 +1453,14 @@ CmStatus    *status
 )
 {
    RlcDlUeCb *ueCb;
-/*kw004.201 Adding of Missing Trace in LTE RLC PDCP*/
+/*kw004.201 Adding of Missing Trace in RLC PDCP*/
 
    if ( (ueInfo->ueId == newUeInfo->ueId) && 
         (ueInfo->cellId == newUeInfo->cellId))
    {
       status->reason = CKW_CFG_REAS_SAME_UEID;
       status->status = CKW_CFG_CFM_NOK; 
-      RLOG_ARG2(L_ERROR,DBG_CELLID,ueInfo->cellId,
-            "Old UeId[%d] same as new UeId[%d]",
+      DU_LOG("\nERROR  -->  RLC_DL : Old UeId[%d] same as new UeId[%d]",
             ueInfo->ueId,
             newUeInfo->ueId);
       return RFAILED;
@@ -1511,8 +1468,7 @@ CmStatus    *status
    
    if(ROK == rlcDbmFetchDlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
    {
-      RLOG_ARG1(L_ERROR, DBG_CELLID, newUeInfo->cellId, 
-            "NewUeId[%d]:ueCb already exists",
+      DU_LOG("\nERROR  -->  RLC_DL : NewUeId[%d]:ueCb already exists",
             newUeInfo->ueId);
       status->reason = CKW_CFG_REAS_UE_EXISTS;
       status->status = CKW_CFG_CFM_NOK;
@@ -1522,8 +1478,7 @@ CmStatus    *status
    if(ROK != rlcDbmFetchDlUeCb(gCb,ueInfo->ueId, ueInfo->cellId, &ueCb))
    {
 
-      RLOG_ARG1(L_ERROR,DBG_CELLID,ueInfo->cellId,
-            "UeId [%d]: UeCb not found",
+      DU_LOG("\nERROR  -->  RLC_DL : UeId [%d]: UeCb not found",
             ueInfo->ueId);
       status->reason = CKW_CFG_REAS_UE_UNKWN;
       status->status = CKW_CFG_CFM_NOK;
@@ -1535,8 +1490,7 @@ CmStatus    *status
 #endif   
    if(ROK != cmHashListDelete(&(gCb->u.dlCb->ueLstCp), (PTR) ueCb))
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,ueInfo->cellId,
-            "UeId[%u] HashList Deletion Failed",
+      DU_LOG("\nERROR  -->  RLC_DL : UeId[%u] HashList Deletion Failed",
             ueInfo->ueId);
       status->reason = CKW_CFG_REAS_UE_CREAT_FAIL;
       status->status = CKW_CFG_CFM_NOK;
@@ -1552,8 +1506,7 @@ CmStatus    *status
                               (uint16_t) sizeof(CmLteRnti)))
 
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,newUeInfo->cellId,
-            "UeId[%u] HashList Insertion Failed",
+      DU_LOG("\nERROR  -->  RLC_DL : UeId[%u] HashList Insertion Failed",
             newUeInfo->ueId);
       status->reason = CKW_CFG_REAS_UE_CREAT_FAIL;
       status->status = CKW_CFG_CFM_NOK;
index f7a0f2e..7f919cd 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
 
-        Name:    LTE RLC - Configuration Manager file
+        Name:    NR RLC - Configuration Manager file
 
         Type:    C source file
 
@@ -31,9 +31,6 @@
         File:     kw_cfg_ul.c
 
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="CFG";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=192;
 /** @file kw_cfg_ul.c
 @brief RLC Uplink Configuration Module
 **/
@@ -309,8 +306,7 @@ static S16 rlcAddToUlL2Meas(RlcCb *gCb, RlcUlRbCb *rlcRbCb,uint8_t cellId,uint8_
 static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfgInfo *entCfg)
 {
 
-   RLOG_ARG3(L_DEBUG,DBG_UEID,rbCb->rlcId.ueId, 
-                "rlcCfgFillRbCb(cellId(%d), rbId(%d), rbType(%d))",
+   DU_LOG("\nDEBUG  -->  RLC_UL : rlcCfgFillRbCb(cellId(%d), rbId(%d), rbType(%d))",
                 rbCb->rlcId.cellId, 
                 entCfg->rbId, 
                 entCfg->rbType);
@@ -376,8 +372,7 @@ static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfg
       }
       default:
       {
-         RLOG_ARG2(L_ERROR,DBG_UEID,rbCb->rlcId.ueId, 
-                "INVALID RB Mode cellId(%d), rbId(%d)",
+         DU_LOG("\nERROR  -->  RLC_UL : INVALID RB Mode cellId(%d), rbId(%d)",
                 rbCb->rlcId.cellId, 
                 entCfg->rbId); 
          return RFAILED;
@@ -486,8 +481,7 @@ S16 rlcValidateRbCfgParams(RlcCb *gCb,CmLteRnti ueId,CmLteCellId cellId,RlcEntCf
          (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_6BIT_SN_LEN) &&
          (cfgToValidate->m.umInfo.ul.snLen != RLC_UM_CFG_12BIT_SN_LEN))
       {   
-         RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
-               "CellId[%u]:UM Mode RB[%d],Invalid SN Len[%d]",
+         DU_LOG("\nERROR  -->  RLC_UL : UM Mode RB[%d],Invalid SN Len[%d]",
                cfgToValidate->rbId,
                cfgToValidate->m.umInfo.ul.snLen);
          status->reason = CKW_CFG_REAS_INVALID_SNLEN;
@@ -579,8 +573,7 @@ RlcUlCfgTmpData   *cfgTmpData
 )
 {
 
-   RLOG_ARG2(L_DEBUG,DBG_UEID,cfgTmpData->ueId,
-               "cellId(%d), cfgType(%d)",
+   DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d), cfgType(%d)",
                 cfgTmpData->cellId,
                 cfgToValidate->cfgType);
 
@@ -609,8 +602,7 @@ RlcUlCfgTmpData   *cfgTmpData
                RLC_ALLOC(gCb,cfgTmpData->cellCb, sizeof(RlcUlCellCb));
                if(!cfgTmpData->cellCb)
                {
-                  RLOG_ARG1(L_FATAL,DBG_UEID,cfgTmpData->ueId,
-                        "Memory allocation failure CELLID:%d",
+                  DU_LOG("\nERROR  -->  RLC_UL : Memory allocation failure CELLID:%d",
                         cfgTmpData->cellId);
                   cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_CREAT_FAIL;
                   return RFAILED;
@@ -643,8 +635,7 @@ RlcUlCfgTmpData   *cfgTmpData
                RLC_ALLOC(gCb,cfgTmpData->ueCb, sizeof(RlcUlUeCb));
                if(!cfgTmpData->ueCb)
                {
-                  RLOG_ARG1(L_FATAL,DBG_UEID,cfgTmpData->ueId,
-                        "Memory allocation failure CELLID:%d",
+                  DU_LOG("\nERROR  -->  RLC_UL : Memory allocation failure CELLID:%d",
                         cfgTmpData->cellId);
                   cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_CREAT_FAIL;
                   return RFAILED;
@@ -712,8 +703,7 @@ RlcUlCfgTmpData   *cfgTmpData
             rlcDbmFetchUlCellCb(gCb,cfgTmpData->cellId, &cfgTmpData->cellCb);
             if(!cfgTmpData->cellCb)
             {
-                RLOG_ARG1(L_ERROR, DBG_CELLID,cfgTmpData->cellId, 
-                      "CellCb not found UEID:%d",
+               DU_LOG("\nERROR  -->  RLC_UL : CellCb not found UEID:%d",
                       cfgTmpData->ueId);
                /*how can a modify request come for a cell which does not exist*/
                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_CELL_UNKWN;
@@ -734,8 +724,7 @@ RlcUlCfgTmpData   *cfgTmpData
             rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb);
             if(!cfgTmpData->ueCb)
             {   
-               RLOG_ARG1(L_ERROR,DBG_CELLID, cfgTmpData->cellId,
-                     "UeId [%d]: UeCb not found",
+               DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
                      cfgTmpData->ueId);
                cfgEntData->entUlCfgCfm.status.reason = CKW_CFG_REAS_UE_UNKWN;
                return RFAILED;
@@ -971,16 +960,14 @@ RlcUlCfgTmpData   *cfgTmpData
 )
 {
 
-   RLOG_ARG2(L_DEBUG,DBG_UEID,cfgTmpData->ueId, 
-             "cellId(%d), cfgType(%d)",
+    DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d), cfgType(%d)",
               cfgTmpData->cellId,cfgToValidate->cfgType);
    
    /* Check for ueId is present or not */
    if ( cfgTmpData->ueId == 0 )
    {
       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_UE_UNKWN;
-      RLOG_ARG1(L_ERROR,DBG_UEID,cfgTmpData->ueId, 
-            "UeId is 0 for CELLID;%d",
+      DU_LOG("\nERROR  -->  RLC_UL : UeId is 0 for CELLID;%d",
             cfgTmpData->cellId);
       return RFAILED;
    }
@@ -988,8 +975,7 @@ RlcUlCfgTmpData   *cfgTmpData
    /* Fetch Ue Cb */
    if(ROK != rlcDbmFetchUlUeCb(gCb,cfgTmpData->ueId, cfgTmpData->cellId, &cfgTmpData->ueCb))
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID, cfgTmpData->cellId,
-            "UeId [%d]: UeCb not found",
+      DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
             cfgTmpData->ueId);
       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_UE_UNKWN;
       return RFAILED;
@@ -1048,7 +1034,7 @@ RlcUlCfgTmpData   *cfgTmpData
 )
 {
 
-   RLOG_ARG1(L_DEBUG,DBG_CELLID,cellId ,"cfgType(%d)",
+   DU_LOG("\nDEBUG  -->  RLC_UL : cfgType(%d)",
               cfgToValidate->cfgType);
    
    cfgTmpData->cellCb = NULLP;
@@ -1057,7 +1043,7 @@ RlcUlCfgTmpData   *cfgTmpData
    if ( cellId == 0 )
    {
       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_CELL_UNKWN;
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellId , "CellId is 0");
+      DU_LOG("\nERROR  -->  RLC_UL : CellId is 0");
       return RFAILED;
    }
 
@@ -1066,7 +1052,7 @@ RlcUlCfgTmpData   *cfgTmpData
    if (!cfgTmpData->cellCb)
    {
       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_CELL_UNKWN;
-      RLOG_ARG0(L_ERROR, DBG_CELLID,cellId, "CellCb not found");
+      DU_LOG("\nERROR  -->  RLC_UL : CellCb not found");
       return RFAILED;
    }
    return ROK;
@@ -1115,8 +1101,7 @@ RlcUlEntTmpData   *cfgEntData
 {
    CmLteRlcId   rlcId;   /* RLC Identifier */
 
-   RLOG_ARG2(L_DEBUG, DBG_UEID,ueId,
-         "cellId(%d) RBID:%d",
+    DU_LOG("\nDEBUG  -->  RLC_UL : cellId(%d) RBID:%d",
          cellId,
          cfgToValidate->rbId); 
 
@@ -1129,8 +1114,7 @@ RlcUlEntTmpData   *cfgEntData
    rlcDbmFetchUlRbCbByRbId(gCb,&rlcId, &cfgEntData->rbCb);
    if (cfgEntData->rbCb == NULLP)
    {
-      RLOG_ARG2(L_WARNING, DBG_UEID,ueId, 
-            "CellId [%u]: rbId [%d] not found",
+      DU_LOG("\nERROR  -->  RLC_UL : CellId [%u]: rbId [%d] not found",
              cellId,
              cfgToValidate->rbId);
       cfgEntData->entUlCfgCfm.status.reason =  CKW_CFG_REAS_RB_UNKWN;
@@ -1228,8 +1212,7 @@ RlcUlCfgTmpData  *cfgTmpData
    
    if(ROK == rlcDbmFetchUlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
    {
-      RLOG_ARG1(L_ERROR, DBG_CELLID, newUeInfo->cellId, 
-            "NewUeId[%d]:ueCb already exists",
+      DU_LOG("\nERROR  -->  RLC_UL : NewUeId[%d]:ueCb already exists",
              newUeInfo->ueId);
       CFM_STATUS.reason = CKW_CFG_REAS_UE_EXISTS;
       CFM_STATUS.status = CKW_CFG_CFM_NOK;
@@ -1239,8 +1222,7 @@ RlcUlCfgTmpData  *cfgTmpData
    if(ROK != rlcDbmFetchUlUeCb(gCb,ueInfo->ueId, ueInfo->cellId, 
                               &cfgTmpData->ueCb))
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID, ueInfo->cellId,
-            "UeId [%d]: UeCb not found",
+      DU_LOG("\nERROR  -->  RLC_UL : UeId [%d]: UeCb not found",
             ueInfo->ueId);
       CFM_STATUS.reason = CKW_CFG_REAS_UE_UNKWN;
       CFM_STATUS.status = CKW_CFG_CFM_NOK;
@@ -1286,8 +1268,7 @@ RlcUlCfgTmpData  *cfgTmpData
                               (uint16_t) sizeof(CmLteRnti)))
 
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,newUeInfo->cellId,
-            "UeId[%u] HashList Insertion Failed",
+       DU_LOG("\nERROR  -->  RLC_UL : UeId[%u] HashList Insertion Failed",
             newUeInfo->ueId);
    }
 
index 45fcc2f..6fe8550 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-        Name:     LTE RLC file for downlink and non real time tasks 
+        Name:     NR RLC file for downlink and non real time tasks 
     
         Type:     C include file
   
index 239f768..e686fae 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE RLC file 
+        Name:    NR RLC file      
     
         Type:    C include file
   
         Desc:    This file contains all the data structures and 
-                 prototypes for LTE RLC.
+                 prototypes for RLC.
  
         File:    kw_dl.x
   
index dadd9de..16492a2 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE-RLC Layer - System Services Interface Functions
+        Name:    NR RLC Layer - System Services Interface Functions
     
         Type:    C file
   
         Desc:    C source code for the interface to System Services
-                  of LTE-RLC
+                  of NR RLC
  
         File:    kw_dl_ex_ms.c
   
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="RLC_DL";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=195;
 
 /** @filekw_dl_ex_ms.c 
 @brief RLC System Services Interface
@@ -110,16 +107,16 @@ S16 rlcDlInitExt()
  *    <b> Activates Initialization </b>
  *
  *    @b Description:
- *    This function is invoked by system services to initialize the LTE-RLC
+ *    This function is invoked by system services to initialize the NR RLC
  *    layer. This is an entry point used by LTE_RLC layer to initialize its
  *    global variables, before becoming operational.
  *
  *    Allowable values for parameters are specified in ssi.h.
  *
- *    @param[in] ent    - Specify the entity id of the LTE-RLC task.
- *    @param[in] inst   - Specify the entity id of the LTE-RLC task.
+ *    @param[in] ent    - Specify the entity id of the NR RLC task.
+ *    @param[in] inst   - Specify the entity id of the NR RLC task.
  *    @param[in] region - Specifies the memory region from which
- *                         LTE-RLC should allocate structures and buffers.
+ *                         NR RLC should allocate structures and buffers.
  *    @param[in] reason - Specifies the reason for calling this
  *                         initialization function.
  *
@@ -200,7 +197,7 @@ Reason reason               /* reason */
  *  <b> Activation Task </b>
  *
  *  @b Description:
- *  Processes events received for MLTE-RLC layer via System Services from
+ *  Processes events received for NR RLC layer via System Services from
  *  other layers.
  *
  *  @param[in] pst   - Pst Structure
@@ -280,7 +277,7 @@ Buffer *mBuf            /* message buffer */
                   ODU_PUT_MSG_BUF(mBuf);
                   if (pst->dstInst < MAX_RLC_INSTANCES)
                   {
-                      RLOG1(L_ERROR,"Received Invalid Event[%d] from SM",
+                      DU_LOG("\nERROR  --> RLC_DL : Received Invalid Event[%d] from SM",
                             pst->event);
                   }
                   ret = RFAILED;
@@ -362,7 +359,7 @@ Buffer *mBuf            /* message buffer */
                   ODU_PUT_MSG_BUF(mBuf);
                   if (pst->dstInst < MAX_RLC_INSTANCES)
                   {
-                      RLOG1(L_ERROR,"Received Invalid Event[%d] from RLC UL",
+                      DU_LOG("\nERROR  --> RLC_DL : Received Invalid Event[%d] from RLC UL",
                             pst->event);
                   }
                   ret = RFAILED;
@@ -412,7 +409,7 @@ Buffer *mBuf            /* message buffer */
                   ODU_PUT_MSG_BUF(mBuf);
                   if (pst->dstInst < MAX_RLC_INSTANCES)
                   {
-                      RLOG1(L_ERROR,"Received Invalid Event[%d] from RRC",
+                     DU_LOG("\nERROR  --> RLC_DL : Received Invalid Event[%d] from RRC",
                             pst->event);
                   }
                   ret = RFAILED;
@@ -462,7 +459,7 @@ Buffer *mBuf            /* message buffer */
                   ODU_PUT_MSG_BUF(mBuf);
                   if (pst->dstInst < MAX_RLC_INSTANCES)
                   {
-                      RLOG1(L_ERROR,"Received Invalid Event[%d] from PDCP",
+                     DU_LOG("\nERROR  --> RLC_DL : Received Invalid Event[%d] from PDCP",
                             pst->event);
                   }
                   ret = RFAILED;
@@ -513,7 +510,7 @@ Buffer *mBuf            /* message buffer */
                   ODU_PUT_MSG_BUF(mBuf);
                   if (pst->dstInst < MAX_RLC_INSTANCES)
                   {
-                      RLOG1(L_ERROR,"Received Invalid Event[%d] from MAC",
+                      DU_LOG("\nERROR  --> RLC_DL : Received Invalid Event[%d] from MAC",
                             pst->event);
                   }
                   ret = RFAILED;
@@ -573,7 +570,7 @@ Buffer *mBuf            /* message buffer */
             if (pst->dstInst < MAX_RLC_INSTANCES)
             {
                /*RlcCb *tRlcCb = RLC_GET_RLCCB(pst->dstInst);*/
-               RLOG1(L_ERROR, "Received Invalid Source Entity[%d]",
+               DU_LOG("\nERROR  --> RLC_DL : Received Invalid Source Entity[%d]",
                      pst->event);
             }
             ODU_PUT_MSG_BUF(mBuf);
index e2295a4..c14fd1f 100755 (executable)
 
 /********************************************************************20**
   
-        Name:     LTE RLC file 
+        Name:     NR RLC file        
     
         Type:     C include file
   
-        Desc:     This file contains the constants required for LTE-RLC.
+        Desc:     This file contains the constants required for NR RLC.
                   The defines in this file need to be changed by the customer 
                   to reflect the software architecture needed to run under the 
                   target system hardware architecture.
index cbfb06d..718a3da 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-        Name:     LTE RLC file 
+        Name:     NR RLC file         
     
         Type:     C include file
   
index a27196d..bb02634 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-        Name:    LTE-RLC Layer 
+        Name:    NR RLC Layer 
     
         Type:     C source file
   
index 595ae9c..d5f863c 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-     Name:    LTE-RLC Layer - Lower Interface Functions
+     Name:    NR RLC Layer - Lower Interface Functions
     
      Type:    C file
   
index efae6b2..7031615 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
 
-        Name:    LTE - RLC - Layer Manager file
+        Name:    NR RLC - Layer Manager file
 
         Type:    C source file
 
@@ -38,9 +38,6 @@
         File:     kw_lmm.c
 
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="LMM";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=197;
 /** @file kw_lmm.c
 @brief RLC Layer Manager Module
 **/
@@ -133,7 +130,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
    if(cfg->maxUe > RLC_MAX_UE) 
    {
 #if (ERRCLASS & ERRCLS_INT_PAR)
-      RLOG2(L_ERROR, "Invalid maxUe : Max [%lu] Received [%lu]", 
+      DU_LOG("\nERROR  --> RLC : Invalid maxUe : Max [%lu] Received [%lu]", 
             RLC_MAX_UE, 
             cfg->maxUe);
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -143,7 +140,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
    if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
    {
 #if (ERRCLASS & ERRCLS_INT_PAR)
-      RLOG2(L_ERROR, "Invalid maxKwuSaps : Max [%lu] Received [%lu]", 
+      DU_LOG("\nERROR  --> RLC : Invalid maxKwuSaps : Max [%lu] Received [%lu]", 
             RLC_MAX_KWUSAPS, 
             cfg->maxKwuSaps);
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -153,7 +150,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
    if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
    {
 #if (ERRCLASS & ERRCLS_INT_PAR)
-      RLOG2(L_ERROR, "Invalid maxUduSaps : Max [%lu] Received [%lu]", 
+      DU_LOG("\nERROR  --> RLC : Invalid maxUduSaps : Max [%lu] Received [%lu]", 
             RLC_MAX_UDXSAPS, 
             cfg->maxUdxSaps);
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -189,7 +186,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
       if (gCb->u.dlCb == NULLP)
       {  
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       
       }
@@ -203,7 +200,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
       {
          RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -219,7 +216,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       {
          RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -249,7 +246,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
          RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
          RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
-         RLOG0(L_FATAL,"RLC DL Initialization failed");   
+         DU_LOG("\nERROR  --> RLC_DL : RLC DL Initialization failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       }
 
@@ -290,7 +287,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
       if (gCb->u.ulCb == NULLP)
       {     
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       
       }
@@ -304,7 +301,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
       {
          RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -322,7 +319,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       {
          RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return (LCM_REASON_MEM_NOAVAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -351,7 +348,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
          RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
-         RLOG0(L_FATAL,"RLC DL Initialization failed");   
+         DU_LOG("\nERROR  --> RLC_DL : RLC DL Initialization failed");   
       }
 
       /* Register the timer */
@@ -373,7 +370,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
    else
    {
 #if (ERRCLASS & ERRCLS_INT_PAR)
-      RLOG0(L_ERROR, "Received Invalid RLC Mode");
+      DU_LOG("\nERROR  --> RLC : Received Invalid RLC Mode");
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
       return (LCM_REASON_INVALID_PAR_VAL);
@@ -476,7 +473,7 @@ Header     *hdr
          break;
       default:
 #if (ERRCLASS & ERRCLS_INT_PAR)
-         RLOG0(L_ERROR, "Received Invalid Message Type");
+         DU_LOG("\nERROR  --> RLC : Received Invalid Message Type");
          if(!gCb)
          {
             fflush(stdout);
@@ -585,7 +582,7 @@ uint8_t RlcMiRlcConfigReq (Pst *pst,RlcMngmt *cfg)
       return (RFAILED);
    }
 
-   RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
+   DU_LOG("\nDEBUG  --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
 
    switch(cfg->hdr.elmId.elmnt)
    {
@@ -723,7 +720,7 @@ uint8_t RlcMiLkwCntrlReq(Pst *pst, RlcMngmt *cntrl)
       rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
       return (RFAILED);
    }
-   RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
+   DU_LOG("\nDEBUG  --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
 
    /* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
     * In all error cases appropriate reason is returned
@@ -813,7 +810,7 @@ S16 RlcMiLkwStaReq(Pst *pst,RlcMngmt *sta)
       return (RFAILED);
    }
 
-   RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
+   DU_LOG("\nDEBUG  --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
 
    reason = LCM_REASON_NOT_APPL;
 
@@ -935,7 +932,7 @@ S16 RlcMiLkwStsReq (Pst *pst, Action action,RlcMngmt *sts)
       return (RFAILED);
    }
 
-   RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))", 
+   DU_LOG("\nDEBUG  --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))", 
                        action, 
                        sts->hdr.elmId.elmnt);
 
@@ -1089,7 +1086,7 @@ S16 RlcMiLkwL2MeasReq(Pst *pst, RlcL2MeasReqEvt *measReqEvt)
 #if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */ 
       if(measEvt == NULLP)
       {
-         RLOG0(L_FATAL,"Memory Allocation failed");   
+         DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
          return RFAILED;
       }   
 #endif      
@@ -1252,7 +1249,7 @@ static S16 rlcLmmCfgKwuSap(RlcCb *gCb,RlcSapCfg *cfg)
    /* Check for reconfiguration */
    if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
    {
-      RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
+      DU_LOG("\nERROR  --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
             gCb->genCfg.rlcMode, rlcKwuSapCb->state);
       /* reconfiguration not allowed */
       return (LCM_REASON_RECONFIG_FAIL);
@@ -1302,7 +1299,7 @@ static S16 rlcLmmCfgCkwSap(RlcCb  *gCb,RlcSapCfg *cfg)
    /* Check for reconfiguration */
    if(ckwSap->state  != RLC_SAP_NOT_CFG)
    {
-      RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
+      DU_LOG("\nERROR  --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
       return (LCM_REASON_RECONFIG_FAIL);
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -1346,7 +1343,7 @@ static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
       /* Check for reconfiguration */
       if(udxDlSap->state != RLC_SAP_NOT_CFG)
       {
-         RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
+         DU_LOG("\nERROR  --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
          return (LCM_REASON_RECONFIG_FAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -1362,7 +1359,7 @@ static S16 rlcLmmCfgUdxSap(RlcCb *gCb,RlcSapCfg *cfg)
    /* Check for reconfiguration */
       if(udxUlSap->state != RLC_SAP_NOT_CFG)
       {
-         RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
+         DU_LOG("\nERROR  --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
          return (LCM_REASON_RECONFIG_FAIL);
       }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -1412,7 +1409,7 @@ static S16 rlcLmmCfgRguSap(RlcCb *gCb,RlcSapCfg *cfg)
    /* Check for reconfiguration */
    if(rguSap->state != RLC_SAP_NOT_CFG)
    {
-      RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
+      DU_LOG("\nERROR  --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
             gCb->genCfg.rlcMode, rguSap->state);
       return (LCM_REASON_RECONFIG_FAIL);
    }
@@ -1749,7 +1746,7 @@ static S16 rlcLmmUdxSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
    /* validate SAP */
    if(UDX_SAP.state == RLC_SAP_NOT_CFG)
    {
-      RLOG0(L_ERROR,"udxUlSap not configured yet");
+      DU_LOG("\nERROR  --> RLC : udxUlSap not configured yet");
       return (LCM_REASON_INVALID_STATE);
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -1821,7 +1818,7 @@ static S16 rlcLmmLSapCntrl(RlcCb *gCb,RlcMngmt *cntrl)
    /* validate SAP */
    if(rguSap->state == RLC_SAP_NOT_CFG)
    {
-      RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
+      DU_LOG("\nERROR  --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
       return (LCM_REASON_INVALID_STATE);
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -2147,7 +2144,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
    MsgLen    tempCnt;
    Pst       pst;
 
-   RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
+   DU_LOG("\nDEBUG  --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
                      event,
                      gCb->trcLen);
 
@@ -2169,7 +2166,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
             != ROK)
         {
            /* rg005.201 removed SPutSBuf on error */
-           RLOG0(L_ERROR,"SCpyMsgMsg Failed");   
+           DU_LOG("\nERROR  --> RLC : SCpyMsgMsg Failed");   
            return RFAILED;
         }
         /* Send Trace Indication to Layer manager */
@@ -2181,7 +2178,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
         /* Get the length of the recvd message buffer */
         if (SFndLenMsg(mBuf, &bufLen) != ROK)
         {
-           RLOG0(L_ERROR,"SFndLenMsg Failed");   
+           DU_LOG("\nERROR  --> RLC : SFndLenMsg Failed");   
            return RFAILED;
         }
         /* Check if the recvd buffer size is less than request trace len */
@@ -2192,7 +2189,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
            if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
               != ROK)
            {
-              RLOG0(L_ERROR,"SCpyMsgMsg Failed");   
+              DU_LOG("\nERROR  --> RLC : SCpyMsgMsg Failed");   
               return RFAILED;
            }
          
@@ -2210,7 +2207,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
            {
               (Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
       
-               RLOG0(L_FATAL,"Memory Allocation failed");   
+               DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
                return (LCM_REASON_MEM_NOAVAIL);
            }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
@@ -2218,19 +2215,19 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
            /* Copy trcLen nos of bytes from the recvd message */
            if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)   
            {
-              RLOG0(L_ERROR,"SCpyMsgFix Failed");   
+              DU_LOG("\nERROR  --> RLC : SCpyMsgFix Failed");   
               return RFAILED;
            }
 
            if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
            {
-              RLOG0(L_FATAL,"Memory Allocation failed");   
+              DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
               return RFAILED;
            }
            /* Copy the tempBuf data to dst mBuf */
            if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
            {
-              RLOG0(L_ERROR,"SCpyMsgFix Failed");   
+              DU_LOG("\nERROR  --> RLC : SCpyMsgFix Failed");   
               return RFAILED;
            }
   
index 6ef1197..261ac78 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE-RLC Layer - Lower Interface
+        Name:    NR RLC Layer - Lower Interface
     
         Type:    C file
   
-        Desc:    C source code for the lower interface of LTE-RLC
+        Desc:    C source code for the lower interface of NR RLC
  
         File:    kw_ptli.c
   
index 2ddd202..840d460 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE-RLC Layer - Upper Interface
+        Name:    NR RLC Layer - Upper Interface
     
         Type:    C file
   
-        Desc:    C source code for the upper interface of LTE-RLC
+        Desc:    C source code for the upper interface of NR RLC
  
         File:    kw_ptui.c
   
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="UIM";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=199;
 
 /** @file kw_ptui.c
 @brief RLC Upper Interface
@@ -406,7 +403,7 @@ SuId              suId,
 CmLteRlcId        rlcId
 )
 {
-   RLOG0(L_DEBUG, "In RlcUiKwuReEstCmpInd");
+   DU_LOG("\nINFO   --> RLC : In RlcUiKwuReEstCmpInd");
 
    /* jump to specific primitive depending on configured selector */
    (*kwUiKwuReEstCmpIndMt[pst->selector])(pst, suId, rlcId);
@@ -712,7 +709,7 @@ S16 rlcDlBatchProcSplit(Void)
       }
       else
       {
-         RLOG0(L_ERROR, "mBuf is NULL");
+         DU_LOG("\nERROR  --> RLC : mBuf is NULL");
          if(datReq->mBuf)
           cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
 
index 1b7aae7..55cc0b8 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index 754849b..20e11f5 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index 5d0b870..d63c6b1 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
  
-    Name:   LTE RLC layer
+    Name:   NR RLC layer
  
     Type:   C include file
  
index fb2a464..421ee67 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
  
-    Name:   LTE RLC layer
+    Name:   NR RLC layer
  
     Type:   C include file
  
@@ -27,9 +27,6 @@
     File:   kw_udx_dl.c
 
 **********************************************************************/
-static const char* RLOG_MODULE_NAME="UDX";
-static int RLOG_MODULE_ID=262144;
-static int RLOG_FILE_ID=203;
 
 /* header include files (.h) */
 #include "common_def.h"
@@ -121,7 +118,7 @@ SpId   spId
          /* Update the State */
          udxSap->state = RLC_SAP_BND;
 
-         RLOG1(L_INFO, "UDX SAP state [%d]", udxSap->state);
+         DU_LOG("\nINFO   --> RLC_DL : UDX SAP state [%d]", udxSap->state);
          break;
       }
       /* SAP is already bound */
@@ -139,7 +136,7 @@ SpId   spId
             RLC_SEND_SAPID_ALARM(tRlcCb, spId, 
                                 LKW_EVENT_UDX_BND_REQ, LCM_CAUSE_INV_PAR_VAL);
 
-            RLOG0(L_ERROR, "UDX SAP already Bound");
+            DU_LOG("\nERROR  --> RLC_DL : UDX SAP already Bound");
             rlcDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_NOK);
          }
          break;
@@ -151,7 +148,7 @@ SpId   spId
          RLC_SEND_SAPID_ALARM(tRlcCb,spId, 
                              LKW_EVENT_CKW_BND_REQ, LCM_CAUSE_INV_STATE);
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
-         RLOG0(L_ERROR, "Invalid UDX SAP State in Bind Req");
+         DU_LOG("\nERROR  --> RLC_DL : Invalid UDX SAP State in Bind Req");
          rlcDlUdxBndCfm(&(udxSap->pst), udxSap->suId, CM_BND_NOK);
          break;
       }
@@ -191,7 +188,7 @@ Reason   reason
 
    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
 
-   RLOG2(L_DEBUG,"Unbind Req for spId[%d], reason[%d]", 
+   DU_LOG("\nDEBUG  --> RLC_DL : Unbind Req for spId[%d], reason[%d]", 
                 spId, reason);
    UNUSED(reason);
    /* disable upper sap (CKW) */
@@ -258,7 +255,7 @@ RlcCfgInfo   *cfg
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if (cfgCfm == NULLP)
    {
-      RLOG0(L_FATAL,"Memory Allocation Failed.");
+      DU_LOG("\nERROR  --> RLC_DL : Memory Allocation Failed.");
       /* kw002.201 Freeing from proper region */
       /* RLC_PST_FREE(pst->region, pst->pool, cfg, sizeof(RlcCfgInfo)); */
       return RFAILED;
@@ -284,7 +281,7 @@ RlcCfgInfo   *cfg
                   if (rlcCfgAddDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
                               entCfg, entCfgCfm) != ROK)
                   {
-                     RLOG_ARG1(L_ERROR,DBG_RBID,cfg->entCfg[idx].rbId,"Addition Failed due to[%d]",
+                     DU_LOG("\nERROR  --> RLC_DL : Addition Failed due to[%d]",
                            entCfgCfm->status.reason);
                   }
                }
@@ -298,7 +295,7 @@ RlcCfgInfo   *cfg
                   if (rlcCfgReCfgDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
                            entCfg, entCfgCfm) != ROK)
                   {
-                     RLOG_ARG1(L_ERROR,DBG_RBID,cfg->entCfg[idx].rbId,"ReCfg Failed due to[%d]",
+                     DU_LOG("\nERROR  --> RLC_DL : ReCfg Failed due to[%d]",
                            entCfgCfm->status.reason);
                   }
                }
@@ -313,7 +310,7 @@ RlcCfgInfo   *cfg
                   if (rlcCfgDelDlRb(tRlcCb,cfg->ueId, cfg->cellId,\
                         entCfg, entCfgCfm) != ROK)
                   {
-                     RLOG_ARG1(L_ERROR,DBG_RBID,cfg->entCfg[idx].rbId,"Deletion Failed due to[%d]",
+                     DU_LOG("\nERROR  --> RLC_DL : Deletion Failed due to[%d]",
                            entCfgCfm->status.reason);
                   } 
                }
@@ -336,7 +333,7 @@ RlcCfgInfo   *cfg
                   if (rlcCfgReEstDlRb(tRlcCb,cfg->ueId, cfg->cellId,
                                      sndReEst,entCfg, entCfgCfm) != ROK)
                   {
-                     RLOG_ARG1(L_ERROR,DBG_RBID,cfg->entCfg[idx].rbId,"Reest Failed due to[%d]",
+                     DU_LOG("\nERROR  --> RLC_DL : Reest Failed due to[%d]",
                            entCfgCfm->status.reason);
                   }
                }
@@ -349,9 +346,14 @@ RlcCfgInfo   *cfg
                if (rlcCfgDelDlUe(tRlcCb,cfg->ueId, cfg->cellId,
                                 entCfg, entCfgCfm) != ROK)
                {
-                  RLOG_ARG1(L_ERROR,DBG_UEID,cfg->ueId,"deletion Failed due to[%d]",
+                  DU_LOG("\nERROR  --> RLC_DL : deletion Failed due to[%d]",
                            entCfgCfm->status.reason);
                }
+               else
+               {
+                  DU_LOG("\nDEBUG  -->  RLC_DL: UE information is deleted for UEIdx[%d] and CellId[%d]",\
+                  cfg->ueId, cfg->cellId);
+               }
                break;
             }
          case CKW_CFG_DELETE_CELL:
@@ -359,7 +361,7 @@ RlcCfgInfo   *cfg
                if (rlcCfgDelDlCell(tRlcCb,cfg->cellId,entCfg,entCfgCfm) 
                                                                 != ROK )
                {
-                  RLOG_ARG1(L_ERROR,DBG_CELLID,cfg->cellId,"deletion Failed due to[%d]",
+                  DU_LOG("\nERROR  --> RLC_DL : deletion Failed due to[%d]",
                            entCfgCfm->status.reason);
                } 
                break;
@@ -369,7 +371,7 @@ RlcCfgInfo   *cfg
             {
                RLC_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType,\
                                    CKW_CFG_CFM_NOK, CKW_CFG_REAS_INVALID_CFG);
-               RLOG0(L_ERROR, "Invalid CfgType");
+               DU_LOG("\nERROR  --> RLC_DL : Invalid CfgType");
             }
       }
    }
@@ -439,7 +441,7 @@ CkwUeInfo   *newUeInfo
    
    if (rlcCfgDlUeIdChng(tRlcCb, ueInfo, newUeInfo, &status) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,newUeInfo->cellId,"Failure due to[%d]",
+      DU_LOG("\nERROR  --> RLC_DL : Failure due to[%d]",
              status.reason);
    }
    rlcDlUdxUeIdChgCfm(&(tRlcCb->u.dlCb->udxDlSap[spId].pst),
@@ -479,7 +481,7 @@ RlcUdxDlStaPdu   *pStaPdu
    rlcDbmFetchDlRbCbByRbId(tRlcCb, rlcId, &rbCb); /* Fetch DBM RbCb */
    if (!rbCb)
    {
-      RLOG_ARG2(L_ERROR, DBG_UEID,rlcId->ueId, "CellId [%u]:RbId[%d] not found",
+      DU_LOG("\nERROR  --> RLC_DL : CellId [%u]:RbId[%d] not found",
             rlcId->cellId,rlcId->rbId);
       RLC_FREE_SHRABL_BUF(pst->region, 
                         pst->pool, 
@@ -534,7 +536,7 @@ RlcUdxStaPdu   *pStaPdu
    rlcDbmFetchDlRbCbByRbId(tRlcCb, rlcId, &rbCb);
    if (!rbCb)
    {
-      RLOG_ARG2(L_ERROR, DBG_UEID,rlcId->ueId, "CellId [%u]:RbId[%d] not found",
+      DU_LOG("\nERROR  --> RLC_DL : CellId [%u]:RbId[%d] not found",
             rlcId->cellId,rlcId->rbId);
       return RFAILED;
    }
index f1011ae..536a245 100755 (executable)
@@ -18,7 +18,7 @@
 
 /************************************************************************
  
-     Name:     LTE-RLC ULDL Interface
+     Name:     NR RLC ULDL Interface
   
      Type:     C source file
   
index c6e6cca..0e1bdd3 100755 (executable)
@@ -18,7 +18,7 @@
 
 /************************************************************************
  
-     Name:     LTE-RLC ULDL Interface
+     Name:     NR RLC ULDL Interface
   
      Type:     C source file
   
index 8e210d9..630f427 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
  
-    Name:   LTE RLC layer
+    Name:   NR RLC layer
  
     Type:   C include file
  
@@ -27,9 +27,6 @@
     File:   kw_udx_ul.c
  
 **********************************************************************/
-static const char* RLOG_MODULE_NAME="UDX";
-static int RLOG_MODULE_ID=262144;
-static int RLOG_FILE_ID=204;
 
 /** @file kw_udx_ul.c
 @brief  UDX Uplink Module 
@@ -122,7 +119,7 @@ uint8_t status
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (tRlcCb->init.cfgDone != TRUE)
    {
-      RLOG0(L_FATAL, "General configuration not done");
+      DU_LOG("\nERROR  -->  RLC_UL : General configuration not done");
       RLC_SEND_SAPID_ALARM(tRlcCb,suId, 
                           LKW_EVENT_LI_BND_CFM, LCM_CAUSE_INV_STATE);
 
@@ -131,7 +128,7 @@ uint8_t status
 
    if (suId < 0)
    {
-      RLOG0(L_ERROR, "Invalid suId");
+      DU_LOG("\nERROR  -->  RLC_UL : Invalid suId");
       RLC_SEND_SAPID_ALARM(tRlcCb,suId, 
                            LKW_EVENT_LI_BND_CFM, LCM_CAUSE_INV_SUID);
 
@@ -225,7 +222,7 @@ RlcCfgCfmInfo   *cfmInfo
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (suId < 0)
    {
-      RLOG0(L_ERROR, "Invalid suId");
+      DU_LOG("\nERROR  -->  RLC_UL : Invalid suId");
       RLC_SEND_SAPID_ALARM(tRlcCb,suId, 
                            LKW_EVENT_LI_BND_CFM, LCM_CAUSE_INV_SUID);
       RLC_FREE_SHRABL_BUF(pst->region,
@@ -238,7 +235,7 @@ RlcCfgCfmInfo   *cfmInfo
 
    if(ROK != rlcDbmFindUlTransaction(tRlcCb,cfmInfo->transId, &cfgTmpData))
    {
-      RLOG0(L_ERROR, "Invalid transId");
+      DU_LOG("\nERROR  -->  RLC_UL : Invalid transId");
       RLC_FREE_SHRABL_BUF(pst->region,
                          pst->pool,
                         cfmInfo,
@@ -259,7 +256,7 @@ RlcCfgCfmInfo   *cfmInfo
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if (cfgCfm == NULLP)
    {
-      RLOG0(L_FATAL, "Memory Allocation failed.");
+      DU_LOG("\nERROR  -->  RLC_UL : Memory Allocation failed.");
       RLC_FREE_SHRABL_BUF(pst->region,
                          pst->pool,
                         cfmInfo,
@@ -271,12 +268,22 @@ RlcCfgCfmInfo   *cfmInfo
    if(tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_CREATE_REQ)
    {
       FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_CREATE_RSP);
+      SendRlcUeCfgRspToDu(&rspPst, cfgCfm);
    }
    else if(tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_RECONFIG_REQ)
    {
       FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_RECONFIG_RSP);
+      SendRlcUeCfgRspToDu(&rspPst, cfgCfm);
+   }
+   else if (tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_DELETE_REQ)
+   {
+      FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
+      if(sendRlcUeDeleteRspToDu(cfgCfm->ueId, cfgCfm->cellId, SUCCESSFUL) != ROK)
+      {
+         DU_LOG("ERROR  --> RLC_UL: rlcUlUdxCfgCfm(): Failed to send UE delete response ");
+         return RFAILED;
+      }
    }
-   SendRlcUeRspToDu(&rspPst, cfgCfm);
 
    /* free the memory from DL */
    RLC_FREE_SHRABL_BUF(pst->region,
@@ -331,14 +338,14 @@ CmStatus   status
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (suId < 0)
    {
-      RLOG0(L_ERROR, "Invalid suId");
+      DU_LOG("\nERROR  -->  RLC_UL : Invalid suId");
       return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
    if(ROK != rlcDbmFindUlTransaction(tRlcCb, transId, &cfgTmpData))
    {
-      RLOG0(L_ERROR, "Invalid transId");
+      DU_LOG("\nERROR  -->  RLC_UL : Invalid transId");
       return  (RFAILED);
    }
 
@@ -396,7 +403,7 @@ CmLteRlcId   *rlcId
    rlcDbmFetchUlRbCbByRbId(tRlcCb, rlcId, &rbCb);
    if (rbCb == NULLP)
    {    
-      RLOG_ARG2(L_ERROR, DBG_UEID,rlcId->ueId, "CellId [%u]:RbId[%d] not found",
+      DU_LOG("\nERROR  -->  RLC_UL : CellId [%u]:RbId[%d] not found",
             rlcId->cellId,rlcId->rbId);
       return RFAILED;
    }
@@ -482,7 +489,7 @@ RlcCfgCfmInfo    *cfgCfm
                {
                            RLC_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType,
                                           CKW_CFG_CFM_NOK, CKW_CFG_REAS_INVALID_DIR);
-                  RLOG_ARG2(L_ERROR,DBG_UEID,cfg->ueId,"RBID[%d] direction[%d] is invalid",
+                  DU_LOG("\nDEBUG  -->  RLC_UL : RBID[%d] direction[%d] is invalid",
                          entCfg->rbId,entCfg->dir);
                }
                break;
@@ -523,7 +530,7 @@ RlcCfgCfmInfo    *cfgCfm
                   rlcCfgApplyDelUlUe(gCb, cfgTmpData);
                   RLC_MEM_CPY(entCfgCfm, 
                              &cfgTmpData->cfgEntData[idx].entUlCfgCfm, 
-                             sizeof(RlcEntCfgCfmInfo)); 
+                             sizeof(RlcEntCfgCfmInfo));
                }
                else
                {
@@ -553,7 +560,7 @@ RlcCfgCfmInfo    *cfgCfm
                RLC_CFG_FILL_CFG_CFM(entCfgCfm, entCfg->rbId, entCfg->rbType,
                                    CKW_CFG_CFM_NOK, CKW_CFG_REAS_INVALID_CFG);
 
-               RLOG0(L_ERROR,"Invalid configuration type");
+               DU_LOG("\nERROR  -->  RLC_UL : Invalid configuration type");
             }
       }
    }
index 5eb9e2b..39eb209 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-     Name:    LTE-RLC Layer - Upper Interface Functions
+     Name:    NR RLC Layer - Upper Interface Functions
     
      Type:    C file
   
index 832103c..00ec5d0 100755 (executable)
@@ -18,7 +18,7 @@
 
 /********************************************************************20**
   
-        Name:     LTE RLC file for uplink and non real time tasks 
+        Name:     NR RLC file for uplink and non real time tasks 
     
         Type:     C include file
   
index f2e4e73..7367ee8 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE RLC file for uplink and non real time tasks
+        Name:    NR RLC file for uplink and non real time tasks
     
         Type:    C include file
   
         Desc:    This file contains all the data structures and 
-                 prototypes for LTE RLC in the uplink.
+                 prototypes for RLC in the uplink.
  
         File:    kw_ul.x
   
index 003ff98..7295adf 100755 (executable)
 
 /********************************************************************20**
   
-        Name:    LTE-RLC Layer - System Services Interface Functions
+        Name:    NR RLC Layer - System Services Interface Functions
     
         Type:    C file
   
         Desc:    C source code for the interface to System Services
-                  of LTE-RLC
+                  of NR RLC
  
         File:    kw_ul_ex_ms.c
   
@@ -96,16 +96,16 @@ S16 rlcUlInitExt()
  *    <b> Activates Initialization </b>
  *
  *    @b Description:
- *    This function is invoked by system services to initialize the LTE-RLC
+ *    This function is invoked by system services to initialize the NR RLC
  *    layer. This is an entry point used by LTE_RLC layer to initialize its
  *    global variables, before becoming operational.
  *
  *    Allowable values for parameters are specified in ssi.h.
  *
- *    @param[in] ent    - Specify the entity id of the LTE-RLC task.
- *    @param[in] inst   - Specify the entity id of the LTE-RLC task.
+ *    @param[in] ent    - Specify the entity id of the NR RLC task.
+ *    @param[in] inst   - Specify the entity id of the NR RLC task.
  *    @param[in] region - Specifies the memory region from which
- *                         LTE-RLC should allocate structures and buffers.
+ *                         NR RLC should allocate structures and buffers.
  *    @param[in] reason - Specifies the reason for calling this
  *                         initialization function.
  *
@@ -176,7 +176,7 @@ Reason reason               /* reason */
  *  <b> Activation Task </b>
  *
  *  @b Description:
- *  Processes events received for MLTE-RLC layer via System Services from
+ *  Processes events received for NR RLC layer via System Services from
  *  other layers.
  *
  *  @param[in] pst   - Pst Structure
@@ -224,6 +224,11 @@ Buffer *mBuf            /* message buffer */
                      ret = unpackRlcUeReconfigReq(RlcProcUeReconfigReq, pst, mBuf);
                      break;
                   }
+               case EVENT_RLC_UE_DELETE_REQ:
+                  {
+                     ret = unpackRlcUeDeleteReq(RlcProcUeDeleteReq, pst, mBuf);
+                     break;
+                  }
 
                case LKW_EVT_STS_REQ:
                   {
index 557b0ba..430adca 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index a1c88a3..a7f4d80 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index e47af06..6375aa9 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index 6e86951..f3ce80f 100755 (executable)
@@ -18,7 +18,7 @@
 
 /**********************************************************************
 
-     Name:     LTE-RLC Layer 
+     Name:     NR RLC Layer 
   
      Type:     C file
   
index 76d85f3..6de3006 100644 (file)
@@ -62,7 +62,7 @@ RlcDuUeCfgRsp rlcUeCfgRspOpts[] =
  *      -# RFAILED
  *
  *************************************************************/
-uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
+uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
 {
    /* jump to specific primitive depending on configured selector */
    uint8_t ret = ROK;
@@ -83,7 +83,7 @@ uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
          ret = (*rlcUeCfgRspOpts[pst->selector])(pst, ueRsp);
          if(ret)
          {
-            DU_LOG("\nERROR  -->  RLC: Failed at SendRlcUeRspToDu()");
+            DU_LOG("\nERROR  -->  RLC: Failed at SendRlcUeCfgRspToDu()");
             RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
          }
       }
@@ -94,7 +94,7 @@ uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
       }
    }
    return ret;
-} /* end of SendRlcUeRspToDu */
+} /* end of SendRlcUeCfgRspToDu */
 
 /**********************************************************************
          End of file
index fa6bd5a..d89b95a 100644 (file)
@@ -18,7 +18,8 @@
 
 /* This file stores defines used at RLC interface */
 uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp);
-uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp);
+uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp);
+uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result);
 
 /**********************************************************************
          End of file
index e77e9f4..98f95ad 100644 (file)
@@ -43,6 +43,7 @@
 #include "du_app_rlc_inf.h"
 #include "rlc_utils.h"
 #include "rlc_upr_inf_api.h"
+
 /*******************************************************************
  *
  * @brief Fills RLC UL UE Cfg Rsp from RlcCRsp 
@@ -721,6 +722,173 @@ uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo)
    RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
    return ROK;
 }
+
+/*******************************************************************
+ *
+ * @brief sending UE delete response to DU 
+ *
+ * @details
+ *
+ *    Function : sendRlcUeDeleteRspToDu 
+ *
+ *    Functionality:
+ *      sending UE delete response to DU 
+ *
+ * @params[in] uint8_t ueIdx, uint8_t cellId, UeDeleteResult result 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result)
+{
+   Pst pst;  
+   RlcUeDeleteRsp *ueDeleteRsp = NULLP;
+   
+   FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
+
+   RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+   if(!ueDeleteRsp)
+   {
+      DU_LOG("\nERROR  -->  RLC: sendRlcUeDeleteRspToDu(): Memory allocation failed ");
+      return RFAILED;
+   }
+   else
+   {
+      ueDeleteRsp->cellId = cellId;
+      ueDeleteRsp->ueIdx = ueIdx;
+      ueDeleteRsp->result = result;
+  
+      if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
+      {
+         DU_LOG("\nDEBUG  -->  RLC: UE Delete response send successfully");
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  RLC: SendRlcUeDeleteRspToDu():Failed to send UE Delete response to DU");
+         RLC_FREE_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+         return RFAILED;
+      }
+   }
+   return ROK;
+}
+
+/* ****************************************************************
+*
+* @brief filling RLC UE delete configuration  
+*
+* @details
+*
+*    Function : fillRlcCfgInfo 
+*
+*    Functionality: filling RLC UE delete configuration
+*
+* @params[in] RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg
+*
+* @return void
+*
+* ****************************************************************/
+
+void fillRlcUeDelInfo(RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg)
+{
+   uint8_t lcIdx;
+   
+   rlcUeCfg->ueId    = ueCb->ueId;
+   rlcUeCfg->cellId  = ueCb->cellId;
+   rlcUeCfg->numEnt = 0;
+   for(lcIdx=0; lcIdx<RLC_MAX_LCH_PER_UE && rlcUeCfg->numEnt < 1; lcIdx++)
+   {
+      if(ueCb->lCh[lcIdx].ulRbCb != NULLP)
+      {
+         rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbId    = 0;
+         rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbType  = 0;
+         rlcUeCfg->entCfg[rlcUeCfg->numEnt].cfgType = CKW_CFG_DELETE_UE;
+         rlcUeCfg->numEnt++;
+      }
+   }
+}
+
+/*******************************************************************
+*
+* @brief Handles Ue delete Request from DU APP
+*
+* @details
+*
+*    Function : RlcProcUeDeleteReq
+*
+*    Functionality:
+*      Handles Ue delete Request from DU APP
+*
+* @params[in] Post structure pointer
+*             RlcUeDelete pointer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
+{
+   uint8_t ret = ROK;
+   RlcCb *gRlcCb = NULLP;
+   RlcCfgInfo *rlcUeCfg = NULLP;
+   RlcUlUeCb *ueCb = NULLP;
+   UeDeleteResult result=SUCCESSFUL;
+
+   DU_LOG("\nDEBUG  -->  RLC: UE Delete request received. CellID[%d] UEIDX[%d]",ueDelete->cellId, ueDelete->ueIdx);
+
+   if(ueDelete != NULLP)
+   {
+      gRlcCb = RLC_GET_RLCCB(pst->dstInst);
+      rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueIdx, ueDelete->cellId, &ueCb);
+      if(ueCb != NULLP)
+      {
+         if(ueDelete->cellId == ueCb->cellId)
+         {
+            RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
+            if(rlcUeCfg == NULLP)
+            {
+               DU_LOG("\nERROR  -->  RLC: deleteRlcUeCb(): Failed to allocate memory");
+               ret = RFAILED;
+            }
+            else
+            {
+               memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
+               fillRlcUeDelInfo(ueCb, rlcUeCfg);
+               if(RlcProcCfgReq(pst, rlcUeCfg) != ROK)
+               {
+                  DU_LOG("\nERROR  -->  RLC: deleteRlcUeCb(): Failed to delete UE information");
+                  result = INVALID_UEID;
+               }
+            }
+         }
+         else
+         {
+            result = INVALID_CELLID;
+         }
+      }
+      else
+      {
+         result = INVALID_UEID;
+      }
+
+      if(result != SUCCESSFUL)
+      {
+         ret = sendRlcUeDeleteRspToDu(ueDelete->ueIdx, ueDelete->cellId, result);
+         if(ret != ROK)
+         {
+            DU_LOG("\nERROR  -->  RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
+         }
+      }
+      RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(RlcUeDelete));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC: RlcProcUeDeleteReq(): Recieved NULL pointer UE Delete ");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
 /**********************************************************************
          End of file
 **********************************************************************/
index 8ae041e..32ddf36 100644 (file)
@@ -49,6 +49,13 @@ RlcUlUserDataToDuFunc rlcSendUlUserDataToDuOpts[] =
    packRlcUlUserDataToDu        /* 2 - Light weight loosely coupled */
 };
 
+RlcDuUeDeleteRsp rlcUeDeleteRspOpts[] =
+{
+   packRlcDuUeDeleteRsp,     /* 0 - loosely coupled */
+   DuProcRlcUeDeleteRsp,     /* 1 - tightly coupled */
+   packRlcDuUeDeleteRsp     /* 2 - LWLC loosely coupled */
+};
+
 /*******************************************************************
  *
  * @brief Sends UL RRC Message Info to DU APP
@@ -90,7 +97,6 @@ uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery)
 {
    return (*rlcSendRrcDeliveryReportToDuOpts[pst->selector])(pst, rrcDelivery);
 }
-
 /*******************************************************************
  *
  * @brief Sends DL RRC Message Status to DU APP
@@ -133,6 +139,27 @@ uint8_t rlcSendUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData)
    return (*rlcSendUlUserDataToDuOpts[pst->selector])(pst, ulUserData);
 }
 
+/*******************************************************************
+ *
+ * @brief Sends Ue Delete Rsp to DU APP
+ *
+ * @details
+ *
+ *    Function : rlcSendUeDeleteRspToDu 
+ *
+ *    Functionality:  Sends Ue Delete Rsp to DU APP
+ *
+ * @params[in] Pst *pst, RlcUeDeleteRsp *ueDeleteRsp 
+ *             
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t rlcSendUeDeleteRspToDu(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp)
+{
+    return (*rlcUeDeleteRspOpts[pst->selector])(pst, ueDeleteRsp);
+}
+
 /**********************************************************************
          End of file
 **********************************************************************/
index 9131f2a..1f9ee1b 100644 (file)
@@ -20,7 +20,7 @@ uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
 uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery);
 uint8_t rlcSendDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
 uint8_t rlcSendUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
-
+uint8_t rlcSendUeDeleteRspToDu(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
 /**********************************************************************
          End of file
 **********************************************************************/
index a6cf334..f042025 100755 (executable)
@@ -44,8 +44,6 @@
 #include "rg_sch.h"
 #include "rg_sch_err.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
index 2bbecc2..cab0b4c 100755 (executable)
@@ -32,9 +32,6 @@
 @brief This module handles the configuration of SCH by RRC and RRM.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=186;
-static int RLOG_MODULE_ID=4096;
 
 /* header include files -- defines (.h) */
 #include "common_def.h"
@@ -47,8 +44,6 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_sch.h"
 #include "rg_sch_err.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
@@ -1027,7 +1022,7 @@ RgSchErrInfo *errInfo
    if (((*cell) == NULLP) || 
        ((*cell)->cellId != ueCfg->cellId))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Cell does not exist %d", 
+      DU_LOG("\nERROR  --> SCH : Cell does not exist %d", 
            ueCfg->cellId);
       return RFAILED;
    }
@@ -1037,14 +1032,14 @@ RgSchErrInfo *errInfo
     * in configuration is not amongst the C-RNTI'smanaged by scheduler */
    if ((rgSCHRamVldtUeCfg(*cell, ueCfg)) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Preamble Id configuration"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Preamble Id configuration"
                "failed ",ueCfg->cellId);
       return RFAILED;
    }
    /* Check if Ue already configured */
    if (rgSCHDbmGetUeCb(*cell, ueCfg->crnti) != NULLP)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d UEID already exists",
+      DU_LOG("\nERROR  --> SCH : CELLID:%d UEID already exists",
              ueCfg->cellId);
       return RFAILED;
    }
@@ -1052,7 +1047,7 @@ RgSchErrInfo *errInfo
    if ((ueCfg->txMode.pres == TRUE) && ((ueCfg->txMode.txModeEnum < RGR_UE_TM_1)
             || (ueCfg->txMode.txModeEnum > RGR_UE_TM_7)))
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid transmission mode for"
                " UE is %d", ueCfg->cellId,(uint8_t)ueCfg->txMode.txModeEnum);
       return RFAILED;
    }
@@ -1060,7 +1055,7 @@ RgSchErrInfo *errInfo
    /* Validate UE Category */
    if (ueCfg->ueCatEnum > CM_LTE_UE_CAT_8)
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid category for UE %d",
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid category for UE %d",
                ueCfg->cellId,(uint8_t)ueCfg->ueCatEnum);
       return RFAILED;
    }
@@ -1080,7 +1075,7 @@ RgSchErrInfo *errInfo
       if ((ueCfg->txMode.pres == TRUE) && 
             (ueCfg->txMode.txModeEnum > RGR_UE_TM_1))
       {
-         RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid transmission mode for"
+         DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid transmission mode for"
                   " UE (%d) for the configured Cell Antenna Ports",ueCfg->cellId,
                   (uint8_t)ueCfg->txMode.txModeEnum);
          return RFAILED;
@@ -1089,7 +1084,7 @@ RgSchErrInfo *errInfo
    
    if ((rgSCHCfgVldtUeCqiModeCfg(*cell, &ueCfg->ueDlCqiCfg)) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti, "CELLID:%d Invalid CQI Mode configuration",
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid CQI Mode configuration",
                 ueCfg->cellId);
       return RFAILED;
    }
@@ -1097,21 +1092,21 @@ RgSchErrInfo *errInfo
    /* Validate Max Uplink HARQ transmission value */
    if (ueCfg->ueUlHqCfg.maxUlHqTx < RGSCH_MIN_HQ_TX)
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Uplink HARQ config for "
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid Uplink HARQ config for "
             "UE %d",ueCfg->cellId,ueCfg->ueUlHqCfg.maxUlHqTx);
       return RFAILED;
    }
 
    if (rgSCHCfgVldtUePwrCfg(*cell, &ueCfg->ueUlPwrCfg) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid PUSCH Group power"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid PUSCH Group power"
            " configuration",ueCfg->cellId);
       return RFAILED;
    }
  
    if (rgSCHCfgVldtUeMeasGapAckNakRepCfg(*cell, ueCfg) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid MeasGap/AckNackRep"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid MeasGap/AckNackRep"
             " configuration",ueCfg->cellId);
       return RFAILED;
    }
@@ -1123,7 +1118,7 @@ RgSchErrInfo *errInfo
        ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_SI_RNTI) 
        ||(ueCfg->ueSpsCfg.spsRnti == RGSCH_P_RNTI))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid SPS RNTI "
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid SPS RNTI "
                " in DL SPS Config",ueCfg->cellId);
       return RFAILED;
    }
@@ -1132,7 +1127,7 @@ RgSchErrInfo *errInfo
    {
       if (rgSCHCfgVldtUeDlSpsCfg(*cell, &ueCfg->ueSpsCfg.dlSpsCfg) != ROK)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DL SPS configuration"
+         DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid DL SPS configuration"
                   " for the UE",ueCfg->cellId);
          return RFAILED;
       }
@@ -1142,7 +1137,7 @@ RgSchErrInfo *errInfo
    /* Validated Periodic CQI/PMI, RI , SRS and SR related UeCfg */
    if ( ROK != rgSCHCfgVldtCqiSrSrsUeCfg(*cell, ueCfg, errInfo))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid Periodic CQI/SR/SRS"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid Periodic CQI/SR/SRS"
                "configuration",ueCfg->cellId);
       return RFAILED;
    }
@@ -1151,7 +1146,7 @@ RgSchErrInfo *errInfo
    /* Validate DRX specific parameters */
    if ( ROK != rgSCHCfgVldtDrxUeCfg(*cell, &(ueCfg->ueDrxCfg)))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid DRX configuration",
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid DRX configuration",
                 ueCfg->cellId);
       return RFAILED;
    }
@@ -1161,7 +1156,7 @@ RgSchErrInfo *errInfo
 #ifdef RGR_CQI_REPT
    if (ueCfg->ueCqiReptCfg.numColltdCqiRept > RGR_CQIRPTS_MAXN)
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid numColltdCqiRept,"
+      DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid numColltdCqiRept,"
                "MAX supported %d",RGR_CQIRPTS_MAXN,ueCfg->cellId);
       return RFAILED;
    }
@@ -1173,7 +1168,7 @@ RgSchErrInfo *errInfo
           {
             if ( ROK != rgSCHCfgVldtEmtcUeCfg(*cell, &(ueCfg->emtcUeCfg)))
             {
-                        RLOG_ARG2(L_ERROR,DBG_CRNTI,ueCfg->crnti,"CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
+                        DU_LOG("\nERROR  --> SCH : CELLID:%d Invalid EMTC UE configurationfor crnti:%d",
                                  ueCfg->cellId, ueCfg->crnti);
                         return RFAILED;
             }
@@ -1225,7 +1220,7 @@ RgSchErrInfo  *errInfo
    if (((*cell) == NULLP) ||
        ((*cell)->cellId != cellRecfg->cellId)) 
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Cell control block does not exist");
+      DU_LOG("\nERROR  --> SCH : Cell control block does not exist");
       return RFAILED;
    }
 
@@ -1234,7 +1229,7 @@ RgSchErrInfo  *errInfo
          ((cellRecfg->dlHqRecfg.maxDlHqTx < RGSCH_MIN_HQ_TX) ||
           (cellRecfg->dlHqRecfg.maxMsg4HqTx < RGSCH_MIN_HQ_TX)))
    {
-      RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Downlink HARQ configuration:"
+      DU_LOG("\nERROR  --> SCH : Invalid Downlink HARQ configuration:"
            " maxDlHqTx %d maxMsg4HqTx %d", cellRecfg->dlHqRecfg.maxDlHqTx,
             cellRecfg->dlHqRecfg.maxMsg4HqTx);
       return RFAILED;
@@ -1243,7 +1238,7 @@ RgSchErrInfo  *errInfo
          ((cellRecfg->cfiRecfg.cfi < RGSCH_MIN_CFI_VAL) ||
           (cellRecfg->cfiRecfg.cfi > RGSCH_MAX_CFI_VAL)))
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid CFI configuration %d",
+      DU_LOG("\nERROR  --> SCH : Invalid CFI configuration %d",
                cellRecfg->cfiRecfg.cfi);
       return RFAILED;
    }
@@ -1257,7 +1252,7 @@ RgSchErrInfo  *errInfo
            (cellRecfg->pucchRecfg.deltaShift > RGSCH_PUCCH_MAXVAL_DS)) ||
           (cellRecfg->pucchRecfg.cyclicShift > RGSCH_PUCCH_MAXVAL_CS))
       {
-         RLOG_ARG4(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid PUCCH configuration: "
+         DU_LOG("\nERROR  --> SCH : Invalid PUCCH configuration: "
                "N2_RB %d N1_PUCCH %d deltaShift %d cyclicShift %d",
                cellRecfg->pucchRecfg.resourceSize,
                cellRecfg->pucchRecfg.n1PucchAn,
@@ -1270,7 +1265,7 @@ RgSchErrInfo  *errInfo
    {
       if (cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsBwEnum > RGR_SRS_BWCFG_7)
       {
-         RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid SRS configuration: "
+         DU_LOG("\nERROR  --> SCH : Invalid SRS configuration: "
                "srsBw %d", (uint8_t)cellRecfg->srsRecfg.srsBwEnum);
          return RFAILED;
       }
@@ -1283,7 +1278,7 @@ RgSchErrInfo  *errInfo
          if(cellRecfg->srsRecfg.isSrsCfgSetup && cellRecfg->srsRecfg.srsSubFrameCfg > 14)
 #endif
          {
-            RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Subframe configuration ");
+            DU_LOG("\nERROR  --> SCH : Invalid Subframe configuration ");
             return RFAILED;
          }
 #endif
@@ -1302,12 +1297,12 @@ RgSchErrInfo  *errInfo
             (cellRecfg->rachRecfg.prachResource >
                (*cell)->bwCfg.ulTotalBw - RGSCH_NUM_RA_RB))
       {
-         RLOG_ARG3(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
+         DU_LOG("\nERROR  --> SCH : Invalid RACH configuration:"
                " preamble Fmt %d raWinSize %d maxMsg3Tx %d",
                cellRecfg->rachRecfg.preambleFormat,
                cellRecfg->rachRecfg.raWinSize,
                cellRecfg->rachRecfg.maxMsg3Tx);
-         RLOG_ARG2(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid RACH configuration:"
+         DU_LOG("\nERROR  --> SCH : Invalid RACH configuration:"
                "numRaPreamble %d sizeRaPreambleGrpA %d",
                cellRecfg->rachRecfg.numRaPreamble,
                cellRecfg->rachRecfg.sizeRaPreambleGrpA);
@@ -1320,7 +1315,7 @@ RgSchErrInfo  *errInfo
    {
       if ((rgSCHCfgVldtRgrCellSiCfg(inst, &(cellRecfg->siReCfg))) != ROK)
       {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for SI"
+         DU_LOG("\nERROR  --> SCH : Validation for SI"
                           "Re-configuration failed");
          return RFAILED;
       }
@@ -1340,7 +1335,7 @@ RgSchErrInfo  *errInfo
                (RGR_ENABLE == cellRecfg->rgrLteAdvCfg.sfrCfg.status)) || 
                ((*cell)->lteAdvCb.sfrCfg.status == RGR_ENABLE)))
          {
-            RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"DSFR is enbaled"
+            DU_LOG("\nERROR  --> SCH : DSFR is enbaled"
                      "Without enabling SFR");
             return RFAILED;
          }
@@ -1348,7 +1343,7 @@ RgSchErrInfo  *errInfo
       if ((rgSCHCfgVldtRgrCellLteAdvCfg(inst, &(cellRecfg->rgrLteAdvCfg),
                                        (*cell)->bwCfg.dlTotalBw)) != ROK)
       {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Validation for Lte Adv"
+         DU_LOG("\nERROR  --> SCH : Validation for Lte Adv"
                   "Re-configuration failed");
          return RFAILED;
       }
@@ -1360,13 +1355,13 @@ RgSchErrInfo  *errInfo
    {
      if (cellRecfg->csgParamCfg.minDlResNonCsg > 100)
      {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
+         DU_LOG("\nERROR  --> SCH : Invalid Configuration "
                "of minimum DL resources for NON-CSG");
          return RFAILED;
      }
      if (cellRecfg->csgParamCfg.minUlResNonCsg > 100)
      {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Invalid Configuration "
+         DU_LOG("\nERROR  --> SCH : Invalid Configuration "
                "of minimum UL resources for NON-CSG");
          return RFAILED;
      }
@@ -1414,7 +1409,7 @@ RgSchErrInfo *err
    RgrUePrdDlCqiCfg    *pCqiCfg;  
 #endif
 
-   RLOG0(L_INFO, "SCELL recfg received from APP \n");  
+   DU_LOG("\nINFO   --> SCH : SCELL recfg received from APP \n");  
 
    RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), 
      "--------------------------------------------------------------------\n"
index 2a6cf68..a4f1406 100755 (executable)
@@ -44,8 +44,6 @@
 #include "rg_sch_inf.h"
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
index 801c192..cd1534f 100755 (executable)
@@ -50,8 +50,6 @@
 #include "rg_sch_inf.x"
 #include "rg_sch.x"
 #include "rg_sch_cmn.x"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 
 /* local defines */
index a2ef173..bf93a4f 100755 (executable)
@@ -44,8 +44,6 @@
 #include "rg_sch_inf.h"         /* typedefs for Scheduler */
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "lrg.x"
index 267c0d1..0cdfccf 100755 (executable)
@@ -47,8 +47,6 @@
 #include "rg_sch.h"
 #include "rg_sch_err.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
index 40c4b1a..5dee41a 100755 (executable)
@@ -43,8 +43,6 @@ invoked by RRM towards MAC.
 #include "rg_sch_inf.h"
 #include "rg_sch.h"
 #include "rg_sch_err.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "lrg.x"
index 93948f1..09d1c48 100755 (executable)
@@ -45,8 +45,6 @@
 #include  "rgm.h"
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* RGU types */
index 4e2be55..d69e388 100755 (executable)
@@ -43,8 +43,6 @@
 #include "rg_sch_cmn.h"
 #include "rg_sch_inf.h"         /* typedefs for Scheduler */
 #include "rg_sch_err.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
@@ -58,9 +56,6 @@
 uint32_t dlPrbCnt;
 #ifdef LTE_L2_MEAS
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_MODULE_ID=4096;
-static int RLOG_FILE_ID=166;
 
 static S16 rgSchL2mInsertMeasCb ARGS((
          RgSchCellCb       *cell,
index 783459b..6e1a089 100755 (executable)
@@ -48,8 +48,6 @@
 #ifdef LTE_L2_MEAS
 #include "rg_sch_cmn.h"    /* typedefs for Scheduler */
 #endif
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "rgr.x"           /* RGR Interface includes */
index cfd0ce7..d57979c 100755 (executable)
@@ -42,8 +42,6 @@
 #include "rg_sch_err.h"
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* RGU types */
index fd58f6a..b4f3c21 100755 (executable)
@@ -52,8 +52,6 @@
 #include "rg_sch_inf.x"    /* typedefs for Scheduler */
 #include "rg_sch.x"        /* typedefs for Scheduler */
 #include "rg_sch_cmn.x"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 
 /* Current specs have 23 dBm as max tx power capability for UEs */
index d1c2cfb..ed7e002 100755 (executable)
@@ -46,8 +46,6 @@
 #include "rg_sch_err.h"    /* Scheduler error defines */
 #include "rg_sch.h"        /* Scheduler defines */
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 
index e34e61b..e8442bd 100755 (executable)
@@ -45,8 +45,6 @@
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
 #include "rg_sch_sc1.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* RGU types */
index 50d59bf..34f5c39 100755 (executable)
@@ -41,8 +41,6 @@
 #include "rg_sch_err.h"            /* defines and macros for MAC */
 #include "rg_sch_inf.h"            /* defines and macros for MAC */
 #include "rg_sch.h"            /* defines and macros for MAC */
-#include "rl_interface.h"
-#include "rl_common.h"
 
 
 /* header/extern include files (.x) */
index 1824267..68d065d 100755 (executable)
@@ -44,8 +44,6 @@ invoked by PHY towards scheduler.
 #include "rg_sch_inf.h"    /* defines and macros for MAC */
 #include "rg_sch.h"        /* defines and macros for MAC */
 #include "rg_sch_cmn.h"    /* typedefs for MAC */
-#include "rl_interface.h"
-#include "rl_common.h"
 
 
 /* header/extern include files (.x) */
index 895d550..770b4ad 100755 (executable)
@@ -774,8 +774,7 @@ S16 rgSCHUhmGetAvlHqProc(RgSchCellCb *cell,RgSchUeCb  *ue,RgSchUlHqProcCb  **hqP
 
    if (NULLP == tmp)
    {
-      //RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
-       //                "rgSCHUhmGetAvlHqProc free %ld inUse %ld ue %d"
+       //DU_LOG("rgSCHUhmGetAvlHqProc free %ld inUse %ld ue %d"
         //                                   , hqE->free.count, hqE->inUse.count, ue->ueId);
       //DU_LOG("5GTF_ERROR rgSCHUhmGetAvlHqProc cellId %d  %ld inUse %ld ue %d"
                               //, cell->cellId, hqE->free.count, hqE->inUse.count, ue->ueId);
index cdeee40..e9a8923 100755 (executable)
@@ -44,8 +44,6 @@
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
 #include "rgm.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
index 9c10ceb..5de50fd 100644 (file)
@@ -704,7 +704,7 @@ uint8_t schInitCellCb(Inst inst, SchCellCfg *schCellCfg)
  *              uint8_t offsetPointA : offset
  *  @return  void
  **/
-void fillSchSib1Cfg(uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg *sib1SchCfg, uint16_t pci, uint8_t offsetPointA)
+void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg *sib1SchCfg, uint16_t pci, uint8_t offsetPointA)
 {
    uint8_t coreset0Idx = 0;
    uint8_t searchSpace0Idx = 0;
@@ -720,6 +720,7 @@ void fillSchSib1Cfg(uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg *sib1SchCfg,
    uint8_t FreqDomainResource[6] = {0};
    uint16_t tbSize = 0;
    uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
+   uint8_t ssbIdx = 0;
 
    PdcchCfg *pdcch = &(sib1SchCfg->sib1PdcchCfg);
    PdschCfg *pdsch = &(sib1SchCfg->sib1PdschCfg);
@@ -745,7 +746,7 @@ void fillSchSib1Cfg(uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg *sib1SchCfg,
     * [(O . 2^u + i . M )  ] mod numSlotsPerSubframe 
     * assuming u = 0, i = 0, numSlotsPerSubframe = 10
     * Also, from this configuration, coreset0 is only on even subframe */
-   slotIndex = ((oValue * 1) + (0 * mValue)) % numSlots; 
+   slotIndex = (int)((oValue*pow(2, mu)) + floor(ssbIdx*mValue))%numSlots;
    sib1SchCfg->n0 = slotIndex;
 
    /* calculate the PRBs */
@@ -831,7 +832,7 @@ void fillSchSib1Cfg(uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg *sib1SchCfg,
    pdsch->dmrs.dmrsAddPos                    = DMRS_ADDITIONAL_POS;
 
    pdsch->pdschFreqAlloc.resourceAllocType   = 1; /* RAT type-1 RIV format */
-   pdsch->pdschFreqAlloc.freqAlloc.startPrb  = offset + SCH_SSB_NUM_PRB; /* the RB numbering starts from coreset0,
+   pdsch->pdschFreqAlloc.freqAlloc.startPrb  = offsetPointA + SCH_SSB_NUM_PRB + 1; /* the RB numbering starts from coreset0,
                                                                            and PDSCH is always above SSB */
    pdsch->pdschFreqAlloc.freqAlloc.numPrb    = schCalcNumPrb(tbSize,sib1SchCfg->sib1Mcs,numPdschSymbols);
    pdsch->pdschFreqAlloc.vrbPrbMapping       = 0; /* non-interleaved */
@@ -876,7 +877,7 @@ uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg)
    cellCb->macInst = pst->srcInst;
 
    /* derive the SIB1 config parameters */
-   fillSchSib1Cfg(schCellCfg->bandwidth, cellCb->numSlots,
+   fillSchSib1Cfg(schCellCfg->numerology, schCellCfg->bandwidth, cellCb->numSlots,
         &(schCellCfg->sib1SchCfg), schCellCfg->phyCellId,
         schCellCfg->ssbSchCfg.ssbOffsetPointA);
    memcpy(&cellCb->cellCfg, schCellCfg, sizeof(SchCellCfg));
@@ -944,7 +945,7 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
       return RFAILED;
    }
 
-   slot = (cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + BO_DELTA) % cell->numSlots;
+   slot = (cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA_DL + BO_DELTA) % cell->numSlots;
    schDlSlotInfo = cell->schDlSlotInfo[slot];
 
    SCH_ALLOC(schDlSlotInfo->dlMsgInfo, sizeof(DlMsgInfo));
index f6f5822..4ca3bc6 100644 (file)
 #define SCH_MU3_NUM_SLOTS 40 
 #define SCH_MU4_NUM_SLOTS 50 
 #define SCH_MAX_SFN 1024
-#define MAX_NUM_RB 106 /* value for numerology 0 15Khz */
-#define SCH_MIB_TRANS 80 
+#ifdef NR_TDD
+#define MAX_NUM_RB 275 /* value for numerology 1, 100 MHz */
+#else
+#define MAX_NUM_RB 106 /* value for numerology 0, 20 MHz */
+#endif
+#define SCH_MIB_TRANS 8  /* MIB transmission as per 38.331 is every 80 ms */
+#define SCH_SIB1_TRANS 16 /* SIB1 transmission as per 38.331 is every 160 ms */
 #define SCH_NUM_SC_PRB 12 /* number of SCs in a PRB */
 #define SCH_MAX_SSB_BEAM 8 /* since we are supporting only SCS=15KHz and 30KHz */
 #define SCH_SYMBOL_PER_SLOT 14
@@ -100,6 +105,7 @@ typedef struct schDlSlotInfo
 {
    uint16_t  totalPrb;                          /*!< Number of RBs in the cell */
    uint16_t  assignedPrb[SCH_SYMBOL_PER_SLOT];  /*!< Num RBs and corresponding symbols allocated */
+   uint16_t  resAllocBitMap;                    /*!< Resource allocation bitmap */
    bool      ssbPres;                           /*!< Flag to determine if SSB is present in this slot */
    uint8_t   ssbIdxSupported;                   /*!< Max SSB index */
    SsbInfo   ssbInfo[MAX_SSB_IDX];              /*!< SSB info */
@@ -121,6 +127,7 @@ typedef struct schUlSlotInfo
 {
    uint16_t     totalPrb;  /*!< Number of RBs in the cell */
    uint16_t     assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */
+   uint16_t     resAllocBitMap;                    /*!< Resource allocation bitmap */
    uint8_t      puschCurrentPrb; /* Current PRB for PUSCH allocation */
    bool         puschPres; /*!< PUSCH presence field */
    SchPuschInfo *schPuschInfo; /*!< PUSCH info */
index 83d3141..d92d513 100644 (file)
@@ -77,29 +77,30 @@ uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,
    SsbInfo ssbInfo;
 
    schDlSlotInfo = cell->schDlSlotInfo[slot];
+
    if(dlBrdcstAlloc->ssbTrans)
    {
       ssbStartPrb = cell->cellCfg.ssbSchCfg.ssbOffsetPointA; //+Kssb
       ssbStartSymb = cell->ssbStartSymbArr[dlBrdcstAlloc->ssbIdxSupported-1]; /*since we are
-                                                                               supporting only 1 ssb beam */
+                                                                                supporting only 1 ssb beam */
 
       /* Assign interface structure */
       for(idx=0; idx<dlBrdcstAlloc->ssbIdxSupported; idx++)
       {
-        ssbInfo.ssbIdx              = idx;
-        ssbInfo.fdAlloc.startPrb    = ssbStartPrb;
-        ssbInfo.fdAlloc.numPrb      = SCH_SSB_NUM_PRB;
-        ssbInfo.tdAlloc.startSymb   = ssbStartSymb;
-        ssbInfo.tdAlloc.numSymb     = SCH_SSB_NUM_SYMB;
-        dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
-        schDlSlotInfo->ssbInfo[idx] = ssbInfo;
+         ssbInfo.ssbIdx              = idx;
+         ssbInfo.fdAlloc.startPrb    = ssbStartPrb;
+         ssbInfo.fdAlloc.numPrb      = SCH_SSB_NUM_PRB;
+         ssbInfo.tdAlloc.startSymb   = ssbStartSymb;
+         ssbInfo.tdAlloc.numSymb     = SCH_SSB_NUM_SYMB;
+         dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
+         schDlSlotInfo->ssbInfo[idx] = ssbInfo;
       }
 
       schDlSlotInfo->ssbPres = true;
       schDlSlotInfo->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported;
       for(idx=ssbStartSymb; idx<ssbStartSymb+SCH_SSB_NUM_SYMB; idx++)
       {
-        schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */
+         schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */
       }
    }
 
@@ -116,7 +117,7 @@ uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,
       numSib1Prb = schCalcNumPrb(tbSize,mcs,numPdschSymbols);
       for(idx=0; idx<SCH_SYMBOL_PER_SLOT; idx++)
       {
-        schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + numSib1Prb; /* 10 PRBs for sib1 */
+         schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + numSib1Prb; /* 10 PRBs for sib1 */
       }
       memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->cellCfg.sib1SchCfg.bwp, sizeof(BwpCfg)); 
       memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg)); 
@@ -482,7 +483,7 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
    memset(&ulSchedInfo, 0, sizeof(UlSchedInfo));
 
    /* add PHY delta */
-   ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,PHY_DELTA+SCHED_DELTA);
+   ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,PHY_DELTA_UL+SCHED_DELTA);
 
    ulSchedInfo.cellId = cell->cellId;
    ulSchedInfo.slotIndInfo.cellId = ulSchedInfo.cellId;
@@ -490,7 +491,8 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
    ulSchedInfo.slotIndInfo.slot = ulTimingInfo.slot;
 
    /* Schedule resources for PRACH */
-   schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
+   if(cell->firstSib1Transmitted)
+    schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
 
    schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot]; 
    if(schUlSlotInfo->schPuschInfo)
index 079d01a..2681a0d 100644 (file)
@@ -206,7 +206,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
    uint8_t  ret = ROK;
 
    /* RAR will sent with a delay of RAR_DELAY */
-   rarSlot = (rachInd->timingInfo.slot+RAR_DELAY+PHY_DELTA)%cell->numSlots;
+   rarSlot = (rachInd->timingInfo.slot+RAR_DELAY+PHY_DELTA_DL)%cell->numSlots;
 
    SchDlSlotInfo *schDlSlotInfo = cell->schDlSlotInfo[rarSlot]; /* RAR will sent in the next slot */
 
index 3a23293..281cd21 100644 (file)
@@ -113,10 +113,10 @@ void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue)
     *        on PHY_DELTA + SCHED_DELTA + BO_DELTA                 *
     ****************************************************************/
 
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA + SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA + SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA_DL);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA_DL + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA_DL + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA_DL + SCHED_DELTA);
 }
 
 /*******************************************************************
@@ -155,8 +155,8 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
       SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgAlloc));
       if(!dlMsgAlloc)
       {
-        DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for ded DL msg alloc");
-        return RFAILED;
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for ded DL msg alloc");
+         return RFAILED;
       }
       memset(dlMsgAlloc, 0, sizeof(DlMsgAlloc));
       dlSchedInfo->dlMsgAlloc = dlMsgAlloc;
@@ -170,17 +170,17 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
       dlMsgAlloc->numLc = 0;
       for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++)
       {
-        if(ueCb->dlInfo.dlLcCtxt[lcIdx].bo)
-        {
-           dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].lcId = lcIdx;
-
-           /* calculation for BO includse RLC and MAC header size */
-           dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes = \
-              ueCb->dlInfo.dlLcCtxt[lcIdx].bo + MAC_HDR_SIZE;
-           accumalatedSize += dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes;
-           dlMsgAlloc->numLc++;
-        }
-        ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
+         if(ueCb->dlInfo.dlLcCtxt[lcIdx].bo)
+         {
+            dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].lcId = lcIdx;
+
+            /* calculation for BO includse RLC and MAC header size */
+            dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes = \
+                                                                ueCb->dlInfo.dlLcCtxt[lcIdx].bo + MAC_HDR_SIZE;
+            accumalatedSize += dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes;
+            dlMsgAlloc->numLc++;
+         }
+         ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
       }
 
       /* pdcch and pdsch data is filled */
@@ -225,9 +225,8 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
  * ****************************************************************/
 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
 {
-   uint8_t  ret = ROK;
-   uint8_t  ssb_rep, ueIdx, lcgIdx;
-   uint16_t slot, sfnSlot = 0;
+   uint8_t  ssb_rep, ueIdx, lcgIdx, ret = ROK;
+   uint16_t slot;
    DlSchedInfo dlSchedInfo;
    DlBrdcstAlloc *dlBrdcstAlloc = NULLP;
    RarAlloc   *rarAlloc = NULLP;
@@ -235,7 +234,9 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
    DlMsgAlloc *dlMsgAlloc = NULLP;
    SchCellCb  *cell = NULLP;
 
+
    memset(&dlSchedInfo,0,sizeof(DlSchedInfo));
+   dlSchedInfo.dlMsgAlloc = NULLP;
    schCalcSlotValues(*slotInd, &dlSchedInfo.schSlotValue);
    dlBrdcstAlloc = &dlSchedInfo.brdcstAlloc;
    dlBrdcstAlloc->ssbTrans = NO_SSB;
@@ -246,23 +247,23 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
    memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
    dlBrdcstAlloc->ssbIdxSupported = 1;
 
-   sfnSlot = dlSchedInfo.schSlotValue.broadcastTime.sfn * cell->numSlots +
-      dlSchedInfo.schSlotValue.broadcastTime.slot;
-
    slot = dlSchedInfo.schSlotValue.currentTime.slot;
 
    dlSchedInfo.cellId = cell->cellId;
 
    /* Identify SSB ocassion*/
-   if (sfnSlot % SCH_MIB_TRANS == 0)
+   if ((dlSchedInfo.schSlotValue.broadcastTime.sfn % SCH_MIB_TRANS == 0) && (dlSchedInfo.schSlotValue.broadcastTime.slot ==0))
    {
       dlBrdcstAlloc->ssbTrans = SSB_TRANSMISSION;
       if(!cell->firstSsbTransmitted)
          cell->firstSsbTransmitted = true;
    }
-   else if (cell->firstSsbTransmitted && (sfnSlot % ssb_rep == 0))
+   else if (cell->firstSsbTransmitted
    {
-      dlBrdcstAlloc->ssbTrans = SSB_REPEAT;
+      if((ssb_rep == 5) && ((dlSchedInfo.schSlotValue.broadcastTime.slot == 0 || dlSchedInfo.schSlotValue.broadcastTime.slot == 10)))
+         dlBrdcstAlloc->ssbTrans = SSB_REPEAT;
+      else if((dlSchedInfo.schSlotValue.broadcastTime.sfn % (ssb_rep/10) == 0) && dlSchedInfo.schSlotValue.broadcastTime.slot == 0)
+         dlBrdcstAlloc->ssbTrans = SSB_REPEAT;
    }
    else
    {
@@ -270,21 +271,26 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
    }
 
    /* Identify SIB1 occasions */
-   if(sfnSlot % cell->cellCfg.sib1SchCfg.sib1NewTxPeriod == 0)
+   if((dlSchedInfo.schSlotValue.broadcastTime.sfn % SCH_SIB1_TRANS == 0) && (dlSchedInfo.schSlotValue.broadcastTime.slot ==0))
    {
       dlBrdcstAlloc->sib1Trans = SIB1_TRANSMISSION;
       if(!cell->firstSib1Transmitted)
          cell->firstSib1Transmitted = true;
    }
-   else if (cell->firstSib1Transmitted && (sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0))
+   else if (cell->firstSib1Transmitted
    {
-      dlBrdcstAlloc->sib1Trans = SIB1_REPITITION;
+      if((dlSchedInfo.schSlotValue.broadcastTime.sfn % (cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod/10) == 0) &&
+            (dlSchedInfo.schSlotValue.broadcastTime.slot == 0))
+      {
+         dlBrdcstAlloc->sib1Trans = SIB1_REPITITION;
+      }
    }
    else
    {
       /* not SIB1 occassion */
    }
 
+
    if(dlBrdcstAlloc->ssbTrans || dlBrdcstAlloc->sib1Trans)
    {
       dlSchedInfo.isBroadcastPres = true;
@@ -292,8 +298,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       ret = schBroadcastAlloc(cell,dlBrdcstAlloc,slot);
       if(ret != ROK)
       {
-        DU_LOG("\nERROR  -->  SCH : schBroadcastAlloc failed");
-        return (ret);
+         DU_LOG("\nERROR  -->  SCH : schBroadcastAlloc failed");
+         return ret;
       }
    }
 
@@ -304,8 +310,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       SCH_ALLOC(rarAlloc, sizeof(RarAlloc));
       if(!rarAlloc)
       {
-        DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for RAR alloc");
-        return RFAILED;
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for RAR alloc");
+         return RFAILED;
       }
 
       dlSchedInfo.rarAlloc = rarAlloc;
@@ -332,8 +338,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       SCH_ALLOC(msg4Alloc, sizeof(DlMsgAlloc));
       if(!msg4Alloc)
       {
-        DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for msg4 alloc");
-        return RFAILED;
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for msg4 alloc");
+         return RFAILED;
       }
 
       dlSchedInfo.dlMsgAlloc = msg4Alloc;
@@ -369,28 +375,28 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       for(lcgIdx=0; lcgIdx<MAX_NUM_LOGICAL_CHANNEL_GROUPS; lcgIdx++)
       {
         totDataReq+= ueCb->bsrInfo[lcgIdx].dataVol;
-       ueCb->bsrInfo[lcgIdx].dataVol = 0;
+        ueCb->bsrInfo[lcgIdx].dataVol = 0;
       }
       if(totDataReq > 0) /* UL grant must be provided for this UE in this slot */
       {
          SchPuschInfo schPuschInfo;
          memset(&schPuschInfo, 0, sizeof(SchPuschInfo));
 
-        SCH_ALLOC(dciInfo, sizeof(DciInfo));
-        if(!dciInfo)
-        {
-           DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciInfo alloc");
-           return RFAILED;
-        }
-        memset(dciInfo,0,sizeof(DciInfo));
-        /* update the SFN and SLOT */
-        memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo));
-        slot = dlSchedInfo.schSlotValue.ulDciTime.slot;
-        /* Update PUSCH allocation */
-        schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo);
-        /* Fill DCI for UL grant */
-        schFillUlDci(ueCb, schPuschInfo, dciInfo);
-        memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo));
+         SCH_ALLOC(dciInfo, sizeof(DciInfo));
+         if(!dciInfo)
+         {
+            DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciInfo alloc");
+            return RFAILED;
+         }
+         memset(dciInfo,0,sizeof(DciInfo));
+         /* update the SFN and SLOT */
+         memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo));
+         slot = dlSchedInfo.schSlotValue.ulDciTime.slot;
+         /* Update PUSCH allocation */
+         schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo);
+         /* Fill DCI for UL grant */
+         schFillUlDci(ueCb, schPuschInfo, dciInfo);
+         memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo));
          dlSchedInfo.ulGrant = dciInfo;
       }
    }
index 097e080..a3a0c55 100644 (file)
@@ -37,7 +37,19 @@ SchUeCfgRspFunc SchUeCfgRspOpts[] =
    packSchUeCfgRsp       /* LWLC */
 };
 
+SchUeDeleteRspFunc SchUeDeleteRspOpts[] =
+{
+   packSchUeDeleteRsp,      /* LC */
+   MacProcSchUeDeleteRsp,   /* TC */
+   packSchUeDeleteRsp       /* LWLC */
+};
 
+SchCellDeleteRspFunc SchCellDeleteRspOpts[]=
+{
+   packSchCellDeleteRsp,      /* LC */
+   MacProcSchCellDeleteRsp,   /* TC */
+   packSchCellDeleteRsp       /* LWLC */
+};
 /*******************************************************************
  *
  * @brief Fill and send UE cfg response to MAC
@@ -616,6 +628,385 @@ uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
    return ret;
 }
 
+/*******************************************************************
+*
+* @brief Fill and send UE delete response to MAC
+*
+* @details
+*
+*    Function :  SchSendUeDeleteRspToMac
+*
+*    Functionality: Fill and send UE delete response to MAC
+*
+* @params[in] Inst inst, SchUeDelete  *ueDelete, SchMacRsp result, 
+*              ErrorCause cause
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete  *ueDelete, SchMacRsp result, ErrorCause cause)
+{
+    Pst rspPst;
+    SchUeDeleteRsp  delRsp;
+    
+    memset(&delRsp, 0, sizeof(SchUeDeleteRsp));
+    delRsp.cellId = ueDelete->cellId;
+    delRsp.crnti = ueDelete->crnti;
+    delRsp.rsp = result; 
+    delRsp.cause = cause; 
+
+    /* Filling response post */
+    memset(&rspPst, 0, sizeof(Pst));
+    FILL_PST_SCH_TO_MAC(rspPst, inst);
+    rspPst.event = EVENT_UE_DELETE_RSP_TO_MAC;
+    SchUeDeleteRspOpts[rspPst.selector](&rspPst, &delRsp);
+}
+
+/*******************************************************************
+*
+* @brief Function to delete Sch Pucch ResrcCfg
+*
+* @details
+*
+*    Function : deleteSchPucchResrcCfg 
+*
+*    Functionality: Function to delete Sch Pucch ResrcCfg
+*
+* @params[in] SchPucchResrcCfg *resrc
+* @return void 
+*
+* ****************************************************************/
+
+void deleteSchPucchResrcCfg(SchPucchResrcCfg *resrc)
+{
+   uint8_t rsrcIdx=0;
+   for(rsrcIdx=0; rsrcIdx < resrc->resrcToAddModListCount; rsrcIdx++)
+   {
+      switch(resrc->resrcToAddModList[rsrcIdx].pucchFormat)
+      {
+         case PUCCH_FORMAT_0:
+         {
+            SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format0,\
+            sizeof(SchPucchFormat0));
+            break;
+         }
+         case PUCCH_FORMAT_1:
+         {
+            SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format1,\
+            sizeof(SchPucchFormat1));
+            break;
+         }
+         case PUCCH_FORMAT_2:
+         {
+            SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format2,\
+            sizeof(SchPucchFormat2_3));
+            break;
+         }
+         case PUCCH_FORMAT_3:
+         {
+            SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format3,\
+            sizeof(SchPucchFormat2_3));
+            break;
+         }
+         case PUCCH_FORMAT_4:
+         {
+            SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format4,\
+            sizeof(SchPucchFormat4));
+            break;
+         }
+      }
+   }
+}
+
+/*******************************************************************
+*
+* @brief Function to delete SCH Pdsch ServCellCfg
+*
+* @details
+*
+*    Function : deleteSchPdschServCellCfg
+*
+*    Functionality: Function to delete SCH Pdsch ServCellCfg
+*
+* @params[in] SchPdschServCellCfg *pdschServCellCfg
+* @return void 
+*
+* ****************************************************************/
+
+void deleteSchPdschServCellCfg(SchPdschServCellCfg *pdschServCellCfg)
+{
+   SCH_FREE(pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
+   SCH_FREE(pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(SchMaxCodeBlkGrpPerTB));
+   SCH_FREE(pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
+   SCH_FREE(pdschServCellCfg->xOverhead, sizeof(SchPdschXOverhead));
+}
+
+/*******************************************************************
+*
+* @brief Function to  delete SCH UeCb
+*
+* @details
+*
+*    Function : deleteSchUeCb 
+*
+*    Functionality: Function to delete SCH UeCb
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+void deleteSchUeCb(SchUeCb *ueCb) 
+{
+   SchPucchCfg *pucchCfg = NULLP;
+   if(ueCb)
+   {
+      SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
+      if(ueCb->ueCfg.spCellCfgPres)
+      {
+         if(ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.pucchCfgPres == true)
+         {
+            pucchCfg = &ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.pucchCfg;
+            SCH_FREE(pucchCfg->resrcSet,sizeof(SchPucchResrcSetCfg));
+            if(pucchCfg->resrc)
+            {
+               deleteSchPucchResrcCfg(pucchCfg->resrc);
+               SCH_FREE(pucchCfg->resrc, sizeof(SchPucchResrcCfg));
+            }
+            SCH_FREE(pucchCfg->format1, sizeof(SchPucchFormatCfg));
+            SCH_FREE(pucchCfg->format2, sizeof(SchPucchFormatCfg));
+            SCH_FREE(pucchCfg->format3, sizeof(SchPucchFormatCfg));
+            SCH_FREE(pucchCfg->format4, sizeof(SchPucchFormatCfg));
+            SCH_FREE(pucchCfg->schedReq, sizeof(SchPucchSchedReqCfg));
+            SCH_FREE(pucchCfg->multiCsiCfg, sizeof(SchPucchMultiCsiCfg));
+            SCH_FREE(pucchCfg->spatialInfo, sizeof(SchPucchSpatialCfg));  
+            SCH_FREE(pucchCfg->dlDataToUlAck, sizeof(SchPucchDlDataToUlAck));
+            SCH_FREE(pucchCfg->powerControl,sizeof(SchPucchPowerControl));
+         }
+         SCH_FREE(ueCb->ueCfg.spCellCfg.servCellCfg.bwpInactivityTmr, sizeof(uint8_t));
+         deleteSchPdschServCellCfg(&ueCb->ueCfg.spCellCfg.servCellCfg.pdschServCellCfg);
+      }
+      memset(ueCb, 0, sizeof(SchUeCb));
+   }
+}
+
+/*******************************************************************
+*
+* @brief Function for Ue Delete request from MAC to SCH
+*
+* @details
+*
+*    Function : MacSchUeDeleteReq 
+*
+*    Functionality: Function for Ue Delete request from MAC to SCH
+*
+* @params[in] Pst *pst, SchUeDelete  *ueDelete
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete)
+{
+    uint8_t idx=0, ueIdx=0, ret=ROK;
+    ErrorCause result;
+    SchCellCb    *cellCb = NULLP;
+    Inst         inst = pst->dstInst - 1;
+    
+    if(!ueDelete)
+    {
+       DU_LOG("\nERROR  -->  SCH : MacSchUeDeleteReq(): Ue Delete request failed");
+       ret = RFAILED;
+    }
+    DU_LOG("\nDEBUG  -->  SCH : Ue Delete request received for crnti[%d]", ueDelete->crnti);
+    
+    cellCb = schCb[inst].cells[idx];
+
+    if(cellCb->cellId != ueDelete->cellId)
+    {
+       DU_LOG("\nERROR  -->  SCH : MacSchUeDeleteReq(): cell Id is not available");
+       result =  INVALID_CELLID;
+    }
+    else
+    {
+       GET_UE_IDX(ueDelete->crnti, ueIdx);
+       if(( cellCb->ueCb[ueIdx-1].crnti == ueDelete->crnti) && ( cellCb->ueCb[ueIdx-1].state == SCH_UE_STATE_ACTIVE))
+       {
+          deleteSchUeCb(&cellCb->ueCb[ueIdx-1]);
+          cellCb->numActvUe--;
+          result = NOT_APPLICABLE;
+       }
+       else
+       {
+          DU_LOG("\nERROR  -->  SCH : MacSchUeDeleteReq(): SchUeCb not found");
+          result =  INVALID_UEIDX;
+       }
+    }
+    
+    if(result == NOT_APPLICABLE)
+    {
+       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, result);
+    }
+    else
+    {
+       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, result);
+       ret = RFAILED;
+    }
+    return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill and send Cell delete response to MAC
+ *
+ * @details
+ *
+ *    Function :  SchSendCellDeleteRspToMac
+ *
+ *    Functionality: Fill and send Cell delete response to MAC
+ *
+ * @params[in] SchCellDelete  *ueDelete, Inst inst, SchMacRsp result
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchSendCellDeleteRspToMac(SchCellDelete  *ueDelete, Inst inst, SchMacRsp result)
+{
+   Pst rspPst;
+   uint8_t ret=0;
+   
+   SchCellDeleteRsp  delRsp;
+
+   DU_LOG("\nINFO   --> SCH : Filling Cell Delete response");
+   memset(&delRsp, 0, sizeof(SchCellDeleteRsp));
+   delRsp.cellId = ueDelete->cellId;
+   delRsp.rsp = result;
+
+   /* Filling response post */
+   memset(&rspPst, 0, sizeof(Pst));
+   FILL_PST_SCH_TO_MAC(rspPst, inst);
+   rspPst.event = EVENT_CELL_DELETE_RSP_TO_MAC;
+   ret =  SchCellDeleteRspOpts[rspPst.selector](&rspPst, &delRsp);
+   if(ret == RFAILED)
+   {
+      DU_LOG("\nERROR  -->  SCH : SchSendCellDeleteRspToMac(): failed to send the Cell Delete response");
+      return ret;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Function for cellCb Deletion 
+ *
+ * @details
+ *
+ *    Function : deleteSchCellCb 
+ *
+ *    Functionality: Function for cellCb Deletion 
+ *
+ * @params[in] SchCellDelete  *cellDelete
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void deleteSchCellCb(SchCellCb *cellCb)
+{
+   uint8_t idx=0;
+   if(cellCb->schDlSlotInfo)
+   {
+      for(idx=0; idx<cellCb->numSlots; idx++)
+      {
+         if(cellCb->schDlSlotInfo[idx])
+         {
+            SCH_FREE(cellCb->schDlSlotInfo[idx]->rarInfo, sizeof(RarInfo));
+            if(cellCb->schDlSlotInfo[idx]->dlMsgInfo)
+            {
+               SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPdu,\
+                     cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPduLen);
+               SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo, sizeof(DlMsgInfo));
+            }
+            SCH_FREE(cellCb->schDlSlotInfo[idx], sizeof(SchDlSlotInfo));
+         }
+      }
+      SCH_FREE(cellCb->schDlSlotInfo, sizeof(SchDlSlotInfo));
+   }
+   if(cellCb->schUlSlotInfo)
+   {
+      for(idx=0; idx<cellCb->numSlots; idx++)
+      {
+         if(cellCb->schUlSlotInfo[idx])
+         {
+            SCH_FREE(cellCb->schUlSlotInfo[idx]->schPuschInfo,sizeof(SchPuschInfo));
+            SCH_FREE(cellCb->schUlSlotInfo[idx], sizeof(SchUlSlotInfo));  
+         }
+      }
+      SCH_FREE(cellCb->schUlSlotInfo, sizeof(SchUlSlotInfo));
+   }
+   SCH_FREE(cellCb->cellCfg.sib1SchCfg.sib1PdcchCfg.dci.pdschCfg, sizeof(PdschCfg));
+   memset(cellCb, 0, sizeof(SchCellCb));
+}
+
+/*******************************************************************
+ *
+ * @brief Function for cell Delete request from MAC to SCH
+ *
+ * @details
+ *
+ *    Function : MacSchCellDeleteReq
+ *
+ *    Functionality: Function for cell Delete request from MAC to SCH
+ *
+ * @params[in] Pst *pst, SchCellDelete  *cellDelete
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete  *cellDelete)
+{
+   uint8_t   cellIdx=0, ret = RFAILED;
+   Inst      inst = pst->dstInst - 1;
+   SchMacRsp result= RSP_OK;
+
+   if(!cellDelete)
+   {
+      DU_LOG("\nERROR  -->  SCH : MacSchCellDeleteReq(): Ue Delete request failed");
+   }
+   else
+   {
+      GET_CELL_IDX(cellDelete->cellId, cellIdx);
+      if(schCb[inst].cells[cellIdx] == NULLP)
+      { 
+         DU_LOG("\nERROR  -->  SCH : MacSchCellDeleteReq(): cell Id[%d] is not available", cellDelete->cellId);
+         result = RSP_NOK;
+      }
+      else
+      {
+         if(schCb[inst].cells[cellIdx]->cellId == cellDelete->cellId)
+         {
+            deleteSchCellCb(schCb[inst].cells[cellIdx]);
+            result = RSP_OK;
+            ret = ROK;
+            SCH_FREE(schCb[inst].cells[cellIdx], sizeof(SchCellCb));
+            DU_LOG("\nINFO   -->  SCH : Sending Cell Delete response to MAC");
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  SCH : MacSchCellDeleteReq(): cell Id[%d] is not available",cellDelete->cellId);
+            result = RSP_NOK;
+         }
+      }
+
+      if(SchSendCellDeleteRspToMac(cellDelete, inst, result)!=ROK)
+      {
+         DU_LOG("\nERROR  -->  SCH : MacSchCellDeleteReq(): failed to send Cell Delete response");
+         ret =  RFAILED;
+      }
+
+   }
+   return ret;   
+}
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 97c6aa3..4cb93c6 100644 (file)
 #include "sch_utils.h"
 #include "math.h"
 
-/* spec-38.213 Table 13-1 */
+#ifdef NR_TDD
+/* spec-38.213 Table 13-4 for SCS=30KHz */
+/* Note: Picking Table 13-4 and not 13-6 since band supported is n78 and
+ * corresponding minimum B/W is 10 MHz */
+int8_t coresetIdxTable[MAX_CORESET_INDEX][4] = {
+{   1,   24,   2,   0}, /* index 0  */
+{   1,   24,   2,   1}, /* index 1  */
+{   1,   24,   2,   2}, /* index 2  */
+{   1,   24,   2,   3}, /* index 3  */
+{   1,   24,   2,   4}, /* index 4  */
+{   1,   24,   3,   0}, /* index 5  */
+{   1,   24,   3,   1}, /* index 6  */
+{   1,   24,   3,   2}, /* index 7  */
+{   1,   24,   3,   3}, /* index 8  */
+{   1,   24,   3,   4}, /* index 9  */
+{   1,   48,   1,  12}, /* index 10 */
+{   1,   48,   1,  14}, /* index 11 */
+{   1,   48,   1,  16}, /* index 12 */
+{   1,   48,   2,  12}, /* index 13 */
+{   1,   48,   2,  14}, /* index 14 */
+{   1,   48,   2,  16}, /* index 15 */
+};
+#else
+/* spec-38.213 Table 13-1 for SCS=15KHz */
 int8_t coresetIdxTable[MAX_CORESET_INDEX][4] = {
 {   1,   24,   2,   0}, /* index 0  */
 {   1,   24,   2,   2}, /* index 1  */
@@ -63,6 +86,7 @@ int8_t coresetIdxTable[MAX_CORESET_INDEX][4] = {
 {   1,   96,   3,  38}, /* index 14 */
 {   0,    0,   0,   0}, /* index 15 */
 };
+#endif
 
 /* spec-38.213 Table 13-11 */
 /* m value is scaled to 2, when using it in formula, divide by 2 */
@@ -514,8 +538,8 @@ uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols)
 
    tbSize = tbSize * 8; //Calculate tbSize in bits
 
-   /* formula used for calculation of rbSize, 38.213 section 5.1.3.2 *
-    * Ninfo = Nre . R . Qm . v                                       *
+   /* formula used for calculation of rbSize, 38.214 section 5.1.3.2 *
+    * Ninfo = S . Nre . R . Qm . v                                       *
     * Nre' = Nsc . NsymPdsch - NdmrsSymb - Noh                       *
     * Nre = min(156,Nre') . nPrb                                     */
 
@@ -616,6 +640,7 @@ void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo)
    {
       schUlSlotInfo->assignedPrb[itr] = 0;
    }
+   schUlSlotInfo->resAllocBitMap = 0;
    schUlSlotInfo->puschCurrentPrb = PUSCH_START_RB;
    schUlSlotInfo->schPuschInfo = NULLP;
 
@@ -641,11 +666,19 @@ void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo)
    {
       schDlSlotInfo->assignedPrb[itr] = 0;
    }
-  
+   schDlSlotInfo->resAllocBitMap = 0; 
    for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
    {
       memset(&schDlSlotInfo->ssbInfo[itr], 0, sizeof(SsbInfo));
    }
+#if 0
+   //make allocation for SSB
+   if(cell->firstSsbTransmitted)
+   {
+      //TODO check if this slot and sfn are for ssb
+
+   }
+#endif
 }
 
 #ifdef NR_TDD
@@ -655,18 +688,18 @@ void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo)
  *
  * @details
  *
- *     Function : schGetSlotFrmt 
+ *     Function : schGetSlotSymbFrmt 
  *      
  *      This API is invoked to determine if current slot is DL or UL
  *           
  *  @param[in]  uint16_t slot
- *  @param[in]  uint32_t slotBitMap from cellCb
+ *  @param[in]  uint32_t bitMap from cellCb
  *  @return  SlotConfig
  *      -# DL    - 0 
  *      -# UL    - 1
  *      -# FLEXI - 2
  **/
-SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap)
+SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap)
 {
    SlotConfig slotFrmt;
    int mask1 = 0, mask2 = 0;
@@ -674,7 +707,7 @@ SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap)
    slot = (slot%10)*2;
    mask1 = 1<<(slot);
    mask2 = 1<<(slot+1);
-   slotFrmt = ((mask1 & slotBitMap)>>slot) + (2*((mask2 & slotBitMap)>>(slot+1)));
+   slotFrmt = ((mask1 & bitMap)>>slot) + (2*((mask2 & bitMap)>>(slot+1)));
 
    //printf("\n\n\n\n*****FormatType:%d Slot:%d****\n\n\n\n", slotFrmt, slot/2);
 
index 09ac4c9..1953784 100644 (file)
@@ -95,7 +95,7 @@ SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti);
 void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo);
 void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo);
 #ifdef NR_TDD
-SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap);
+SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap);
 #endif
 
 /**********************************************************************
index 5a52ed3..a130832 100644 (file)
@@ -54,6 +54,7 @@
 #include "cm_lib.x"
 #include "du_log.h"
 
+#define RADIO_FRAME_DURATION 10 /* Time duration of a radio frame in ms */
 /* MAX values */
 #define MAX_NUM_CELL 1
 #define MAX_NUM_UE   1
@@ -62,7 +63,8 @@
 #define MAX_NUM_DRB  29   /* spec 38.331, maxDRB */
 
 /* 5G ORAN phy delay */
-#define PHY_DELTA 2
+#define PHY_DELTA_DL 1
+#define PHY_DELTA_UL 0
 
  /* SELECTORS */ 
 #define ODU_SELECTOR_LC 0
 typedef enum
 {
    UE_CFG_INACTIVE,
+   UE_CFG_INPROGRESS,
    UE_CREATE_COMPLETE,
+   UE_DELETE_COMPLETE,
    UE_RECFG_COMPLETE
 }UeCfgState;
 
index 385ca18..131b7fb 100644 (file)
@@ -792,14 +792,13 @@ uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
 
    return ODU_POST_TASK(pst,mBuf);
 }
-
 /*******************************************************************
  *
  * @brief Unpack UE Config Response from MAC to DU APP
  *
  * @details
  *
- *    Function : unpackDuMacUeCfgRsp
+ *    Function :unpackDuMacUeCfgRsp 
  *
  *    Functionality: Unpack UE Config Response from MAC to DU APP
  *
@@ -902,6 +901,308 @@ uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf)
 
    return RFAILED;
 }
+/*******************************************************************
+*
+* @brief Packs and Sends UE Delete Request from DUAPP to MAC
+*
+* @details
+*
+*    Function : packDuMacUeDeleteReq
+*
+*    Functionality:
+*       Packs and Sends UE Delete Request from DUAPP to MAC
+*
+*
+* @params[in] Post structure pointer
+*             MacUeDelete pointer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDel)
+{
+    Buffer *mBuf = NULLP;
+
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+       {
+          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeDeleteReq");
+          return RFAILED;
+       }
+       /* pack the address of the structure */
+       CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
+    }
+    else
+    {
+       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteReq");
+       return RFAILED;
+    }
+
+    return ODU_POST_TASK(pst,mBuf);
+}
+/*******************************************************************
+*
+* @brief Unpacks UE Delete Request received from DU APP
+*
+* @details
+*
+*    Function : unpackMacUeDeleteReq 
+*
+*    Functionality:
+*         Unpacks UE Delete Request received from DU APP
+*
+* @params[in] Pointer to Handler
+*             Post structure pointer
+*             Message Buffer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       MacUeDelete *ueDelete;
+
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueDelete);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Delete Request ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+
+    return RFAILED;
+}
+/*******************************************************************
+ *
+ * @brief Pack and send UE delete response from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : packDuMacUeDeleteRsp
+ *
+ *    Functionality:
+ *       Pack and send UE  delete response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
+{
+   Buffer *mBuf = NULLP;
+   
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeDeleteRsp");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)deleteRsp, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteRsp");
+      return RFAILED;
+   }
+   
+   return ODU_POST_TASK(pst,mBuf);
+   
+}
+
+/*******************************************************************
+*
+* @brief Unpack UE Config Response from MAC to DU APP
+*
+* @details
+*
+*    Function :unpackDuMacUeDeleteRsp 
+*
+*    Functionality: Unpack UE Config Response from MAC to DU APP
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       MacUeDeleteRsp *ueDeleteRsp = NULLP;
+
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueDeleteRsp);
+    }
+
+    ODU_PUT_MSG_BUF(mBuf);
+    return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks Cell Delete Request received from DU APP
+ *
+ * @details
+ *
+ *    Function : unpackMacCellDeleteReq
+ *
+ *    Functionality:
+ *         Unpacks Cell Delete Request received from DU APP
+ *
+ * @params[in] Pointer to Handler
+ *             Post structure pointer
+ *             Message Buffer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf)
+{
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      MacCellDelete *cellDelete=NULLP;
+
+      /* unpack the address of the structure */
+      CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDelete, mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
+      return (*func)(pst, cellDelete);
+   }
+   else
+   {
+      /* Nothing to do for other
+       * selectors */
+      DU_LOG("\nERROR  -->  DU APP : unpackMacCellDeleteReq(): Only LWLC supported for CELL Delete Request ");
+      ODU_PUT_MSG_BUF(mBuf);
+   }
+
+   return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send Cell delete request to MAC
+ *
+ * @details
+ *
+ *    Function : packDuMacCellDeleteReq
+ *
+ *    Functionality:
+ *       Pack and send Cell delete request to MAC
+ *
+ * @params[in] Post structure
+ *             MacCellDelete *cellDelete;
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDelete *cellDelete)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteReq(): Memory allocation failed ");
+         return RFAILED;
+      }
+      CMCHKPK(oduPackPointer,(PTR)cellDelete, mBuf);
+      return ODU_POST_TASK(pst,mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteReq(): Only LWLC supported ");
+   }
+   return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send CELL delete response from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : packDuMacCellDeleteRsp
+ *
+ *    Functionality:
+ *       Pack and send CELL  delete response from MAC to DU APP
+ *
+ * @params[in] Pst *pst, MacCellDeleteRsp *deleteRsp
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteRsp(): Memory allocation failed ");
+         return RFAILED;
+      }
+      CMCHKPK(oduPackPointer,(PTR)cellDeleteRsp, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteRsp(): Only LWLC supported ");
+      return RFAILED;
+   }
+
+   return ODU_POST_TASK(pst,mBuf);
+
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack cell delete response from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : unpackDuMacCellDeleteRsp
+ *
+ *    Functionality: Unpack cell delete response from MAC to DU APP
+ *
+ * @params[in] MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf)
+{
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      MacCellDeleteRsp *cellDeleteRsp = NULLP;
+
+      CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDeleteRsp, mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
+      return (*func)(pst, cellDeleteRsp);
+   }
+   else
+   {  
+      DU_LOG("\nERROR  -->  DU APP : unpackDuMacCellDeleteRsp(): Only LWLC supported ");
+      ODU_PUT_MSG_BUF(mBuf);
+   }
+   return RFAILED;
+}
 
 /**********************************************************************
   End of file
index 92eab3c..5b770d1 100644 (file)
@@ -24,7 +24,6 @@
 
 #define NUM_SSB                1       /* max value is 64 */
 #define SSB_MASK_SIZE  1       /* SSB mask size is 32bit for sub6 */
-#define SIB1_NEW_TX_PERIOD      160
 #define SIB1_REPETITION_PERIOD   20
 #define CORESET_0_INDEX      0
 #define CORESET_1_INDEX      1
 #define EVENT_MAC_UE_CREATE_RSP      209
 #define EVENT_MAC_UE_RECONFIG_REQ    210
 #define EVENT_MAC_UE_RECONFIG_RSP    211
+#define EVENT_MAC_UE_DELETE_REQ      212
+#define EVENT_MAC_UE_DELETE_RSP      213
+#define EVENT_MAC_CELL_DELETE_REQ    214
+#define EVENT_MAC_CELL_DELETE_RSP    215
 
 #define BSR_PERIODIC_TIMER_SF_10 10
 #define BSR_RETX_TIMER_SF_320 320
@@ -86,6 +89,19 @@ typedef enum
    MAC_DU_APP_RSP_OK
 }MacRsp;
 
+typedef enum
+{
+   SUCCESS,
+   CELLID_INVALID,
+   UEIDX_INVALID
+}UeDeleteStatus;
+
+typedef enum
+{
+   SUCCESSFUL_RSP,
+   CELL_ID_INVALID
+}CellDeleteStatus;
+
 typedef enum
 {
    DUP_MODE_FDD,
@@ -544,7 +560,6 @@ typedef struct sib1CellCfg
 {
    uint8_t  *sib1Pdu;
    uint16_t sib1PduLen;
-   uint16_t sib1NewTxPeriod;
    uint16_t sib1RepetitionPeriod;
    uint8_t coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
    uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
@@ -1234,6 +1249,32 @@ typedef struct ueCfgRsp
    SCellFailInfo  *failedSCellList;
 }MacUeCfgRsp;
 
+typedef struct ueDelete
+{
+    uint16_t cellId;
+    uint8_t  ueIdx;
+    uint16_t crnti;
+}MacUeDelete;
+
+typedef struct ueDeleteRsp
+{
+   uint16_t cellId;
+   uint8_t  ueIdx;
+   UeDeleteStatus result;
+}MacUeDeleteRsp;
+
+typedef struct macCellDelete
+{
+   uint16_t cellId;
+}MacCellDelete;
+
+typedef struct macCellDeleteRsp
+{
+   uint16_t cellId;
+   CellDeleteStatus result;
+}
+MacCellDeleteRsp;
+
 /* Functions for slot Ind from MAC to DU APP*/
 typedef uint8_t (*DuMacCellUpInd) ARGS((
         Pst       *pst,
@@ -1296,6 +1337,26 @@ typedef uint8_t (*DuMacUeReconfigReq) ARGS((
         Pst           *pst,
         MacUeCfg      *ueCfg ));
 
+/* UE Delete Request from DU APP to MAC*/
+typedef uint8_t (*DuMacUeDeleteReq) ARGS((
+     Pst           *pst,
+     MacUeDelete   *ueDel ));
+
+/* UE Delete Response from MAC to DU APP*/
+typedef uint8_t (*MacDuUeDeleteRspFunc) ARGS((
+     Pst            *pst,
+     MacUeDeleteRsp *deleteRsp));
+
+/* Cell Delete Request from DU APP to MAC*/
+typedef uint8_t (*DuMacCellDeleteReq) ARGS((
+     Pst           *pst,
+     MacCellDelete *cellDelete ));
+
+/* Cell Delete Response from MAC to DU APP*/
+typedef uint8_t (*MacDuCellDeleteRspFunc) ARGS((
+     Pst            *pst,
+     MacCellDeleteRsp *cellDeleteRsp));
+
 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
@@ -1330,9 +1391,22 @@ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
+uint8_t MacProcUeDeleteReq(Pst *pst,  MacUeDelete *ueDelete);
+uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
+uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
+uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
+uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
+uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
+uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
+uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
 
 #endif
 
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 5878def..9d98a31 100644 (file)
@@ -705,6 +705,168 @@ uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer
 
    return RFAILED;
 }
+
+/*******************************************************************
+*
+* @brief Packs and Sends UE Delete Request from DUAPP to RLC
+*
+* @details
+*
+*    Function : packDuRlcUeDeleteReq 
+*
+*    Functionality:
+*       Packs and Sends UE Delete Request from DUAPP to RLC
+*
+*
+* @params[in] Post structure pointer
+*             RlcUeDelete pointer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> RLC : Memory allocation failed at packDuRlcUeDeleteReq");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packDuRlcUeDeleteReq");
+      return RFAILED;
+   }
+
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+* @brief Unpacks UE Delete Request received from DU APP
+*
+* @details
+*
+*    Function : unpackRlcUeDeleteReq 
+*
+*    Functionality:
+*         Unpacks UE Delete Request received from DU APP
+*
+* @params[in] Pointer to Handler
+*             Post structure pointer
+*             Message Buffer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       RlcUeDelete *ueDelete;
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueDelete);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Delete Request ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+    return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief Packs and Sends UE Del Response from RLC to DUAPP
+*
+* @details
+*
+*    Function : packRlcDuUeDeleteRsp
+*
+*    Functionality:
+*       Packs and Sends UE Del Response from RLC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+*             RlcUeDeleteRsp *ueDelRsp
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDelRsp)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDuUeDeleteRsp");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)ueDelRsp, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcDuUeDeleteRsp");
+      return RFAILED;
+   }
+
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks UE Del Response received from DU APP
+*
+* @details
+*
+*    Function : unpackRlcUeDeleteRsp
+*
+*    Functionality:
+*         Unpacks UE Del Response received from DU APP
+*
+* @params[in] Pointer to Handler
+*             Post structure pointer
+*             Message Buffer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       RlcUeDeleteRsp *ueDeleteRsp = NULLP;
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueDeleteRsp);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Del Response ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+
+    return RFAILED;
+}
+
 /**********************************************************************
          End of file
 ***********************************************************************/
index 837afc3..7c6b973 100644 (file)
@@ -31,7 +31,8 @@
 #define EVENT_DL_RRC_MSG_RSP_TO_DU 217
 #define EVENT_DL_USER_DATA_TRANS_TO_RLC 218
 #define EVENT_UL_USER_DATA_TRANS_TO_DU 219
-
+#define EVENT_RLC_UE_DELETE_REQ 220
+#define EVENT_RLC_UE_DELETE_RSP 221
 
 #define RB_ID_SRB 0
 #define RB_ID_DRB 1
@@ -87,6 +88,13 @@ typedef enum
    RLC_CFG_REAS_INVALID_RGUSAP     /*!< Invalid RGU SAP ID */
 }FailureReason;
 
+typedef enum
+{
+   SUCCESSFUL            ,  /*!< No Failure */
+   INVALID_CELLID      ,  /*!< CellId not present */
+   INVALID_UEID        ,  /*!< UEId not present */
+}UeDeleteResult;
+
 typedef enum
 {
    RLC_AM,                    //Acknowledged Mode
@@ -128,7 +136,7 @@ typedef struct dlAmCfg
    int16_t      pollPdu;             /* Used to trigger a poll for every pollPdu.*/
    int32_t      pollByte;            /* Poll_Byte in bytes. */
    uint8_t      maxRetxTh;           /* Max_Retx_Threshold */
+
 }DlAmCfg;
 
 typedef struct dlUmCfg
@@ -201,6 +209,19 @@ typedef struct rlcUeCfgRsp
    FailureReason  reason;
 }RlcUeCfgRsp;
 
+typedef struct rlcUeDelete
+{
+   uint16_t      cellId;
+   uint8_t       ueIdx;
+}RlcUeDelete;
+
+typedef struct rlcUeDeleteRsp
+{
+   uint16_t       cellId;
+   uint8_t        ueIdx;
+   UeDeleteResult result;
+}RlcUeDeleteRsp;
+
 /* UL RRC Message from RLC to DU APP */
 typedef struct ulRrcMsgInfo
 {
@@ -280,6 +301,11 @@ typedef uint8_t (*RlcDuUeCfgRsp) ARGS((
    Pst          *pst,
    RlcUeCfgRsp  *ueCfgRsp));
 
+/* UE Delete Response from RLC to DU APP*/
+typedef uint8_t (*RlcDuUeDeleteRsp) ARGS((
+   Pst          *pst,
+   RlcUeDeleteRsp  *ueDelRsp));
+
 /* UL RRC Message from RLC to DU APP */
 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
    Pst           *pst,
@@ -295,10 +321,16 @@ typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
    Pst           *pst,
    RrcDeliveryReport *rrcDeliveryReport));
 
+/* UE Reconfig Request from DU APP to RLC */
 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
    Pst           *pst,
    RlcUeCfg      *ueCfg ));
 
+/* UE Delete Request from DU APP to RLC */
+typedef uint8_t (*DuRlcUeDeleteReq) ARGS((
+   Pst           *pst,
+   RlcUeDelete   *ueDelete));
+
 /* DL RRC Message from RLC to DU APP */
 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
    Pst           *pst,
@@ -333,6 +365,10 @@ uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf);
 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg);
 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
+uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
+uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
+uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
 
 /* Event Handler function declarations */
 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
@@ -344,7 +380,8 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg);
 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData);
 uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
-
+uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
+uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
 #endif /* RLC_INF_H */
 
 /**********************************************************************
index 4299573..bb79c46 100755 (executable)
 #endif /* RG */
 
 /****************************************************************************
-                     LTE-RLC Section
+                     NR RLC Section
 ****************************************************************************/
 #ifdef KW
 
index 14572e5..c03b263 100755 (executable)
 /* defines */
 
 #define  RTLIN_DUMP_DEBUG printf
-/* bndCfg.bufOwnshp for xxBndReq */
-
-#define SUOWN         0     /* service user (upper layer) owns buffers */
-#define SPOWN         1     /* service provider (lower layer) owns buffers */
-
-/* bndCfg.flcTyp for xxBndReq */
-
-#define FLCNOTALLOW   0     /* flow control not allowed */
-#define FLCALLOW      1     /* flow control allowed */
-
-/* bndCfg.wdw for xxBndReq */
-
-#define WDWNOTALLOW   0     /* window not allowed */
-
-/* state values (e.g., for an interface) */
-
-#define STATE_DISCONNECTED   0x00     /* disconnected state */
-#define STATE_CONNECTING     0x01     /* connecting state */
-#define STATE_CONNECTED      0x02     /* connected state */
-#define STATE_DISCONNECTING  0x03     /* disconnecting state */
 
 /* Protocol Address Structure related defines ..*/
 #define MAX_PROTADDR_LEN     16       /* Right now defined for IP, IPX 
 #define MF_SIZE_TKNSTR  132 /* token string size - regular */
 #define MF_SIZE_TKNSTRE 255 /* token string size - extra large */
 #define MF_SIZE_TKNBITS 7   /* token bits size */
-#define TP_SIZE_TKNSTR  8   /* token string size */
-
-/* gen_h_001.main_133 --- size for extension container, MA_LIMIT_EXTCONT */
-#define MA_MF_EXTCONT_SIZE 20
-/* defines for type of service class */
-
-#define FRMRLY         1     /* frame relay */
-#define MACINT         2     /* mac interface */
-
-/* defines for ISUP and B-ISUP  */
-
-
-/* subsystem field */
-
-#define SSF_INTER         0      /* international subsystem field */
-#define SSF_NAT           2      /* national subsystem field */
-
-#define PRI_ZERO          0      /* priority 0 - lowest */
-#define PRI_ONE           1      /* priority 1 */
-#define PRI_TWO           2      /* priority 2 */
-
-/* direction of suspend */
-
-#define FROM_LWR          1      /* direction from lower */
-#define FROM_UPR          2      /* direction from upper */
 
-#define MOD15             0x0f   /* modulo 15 mask */
 #define NOTUSED           0      /* not used */
 
-#define DIR_OUT           1
-#define DIR_INC           2
-
-#define PRESALLOW         0
-#define PRESREST          1
-#define MFROK             0
-#define MFRFAILED         1
-#define MFREOM            2
-
 /* defines for ATM */
 
 #ifndef CMFILE_REORG_1
 
-/* special vcc's */
-
-#define ATMVPI_SIG     0     /* Q.93B signalling */
-#define ATMVCI_SIG     5     /* Q.93B signalling */
-
-#define ATMVPI_ILMI    0     /* ILMI address registration */
-#define ATMVCI_ILMI    16    /* ILMI address registration */
-
-/* loss priority */
-
-#define ATMLP_HIGH     0     /* high priority */
-#define ATMLP_LOW      1     /* low priority */
-
-/* congestion indication */
-
-#define ATMCI_NOCONG   0     /* not congested */
-#define ATMCI_CONG     1     /* congested */
-
-/* reception status */
-
-#define ATMRS_NOERROR  0     /* no error */
-#define ATMRS_ERROR    1     /* error */
-
-/* establishement */
-
-#define AM_E_DEMAND       0x00  /* demand */
-
-/* quality of service classes */
-
-#define ATMQOS_CLASS0  0     /* QoS class 0 -unspecified QoS class*/
-#define ATMQOS_CLASS1  1     /* QoS class 1 */
-#define ATMQOS_CLASS2  2     /* QoS class 2 */
-#define ATMQOS_CLASS3  3     /* QoS class 3 */
-#define ATMQOS_CLASS4  4     /* QoS class 4 */
-
-/* ATM traffic descriptor octet group identifiers */
-
-#define AM_ATD_FPCR_ID0     0x82  /* forward  peak  cell rate id, CLP = 0   */
-#define AM_ATD_BPCR_ID0     0x83  /* backward peak  cell rate id, CLP = 0   */
-#define AM_ATD_FPCR_ID1     0x84  /* forward  peak  cell rate id, CLP = 0+1 */
-#define AM_ATD_BPCR_ID1     0x85  /* backward peak  cell rate id, CLP = 0+1 */
-#define AM_ATD_FSCR_ID0     0x88  /* forward  sust. cell rate id, CLP = 0   */
-#define AM_ATD_BSCR_ID0     0x89  /* backward sust. cell rate id, CLP = 0   */
-#define AM_ATD_FSCR_ID1     0x90  /* forward  sust. cell rate id, CLP = 0+1 */
-#define AM_ATD_BSCR_ID1     0x91  /* backward sust. cell rate id, CLP = 0+1 */
-#define AM_ATD_FMBS_ID0     0xa0  /* forward  mean burst size id, CLP = 0   */
-#define AM_ATD_BMBS_ID0     0xa1  /* backward mean burst size id, CLP = 0   */
-#define AM_ATD_FMBS_ID1     0xb0  /* forward  mean burst size id, CLP = 0+1 */
-#define AM_ATD_BMBS_ID1     0xb1  /* backward mean burst size id, CLP = 0+1 */
-#define AM_ATD_BSTEFFRTIND  0xbe  /* best effort indicator */
-#define AM_ATD_TFCMGMTOPTID 0xbf  /* traffic management options id */
-
-/* number of stop bits */
-
-#define AM_NSB_UNUSED     0x00  /* none specified */
-#define AM_NSB_1          0x01  /* 1 stop bit */
-#define AM_NSB_15         0x02  /* 1.5 stop bits */
-#define AM_NSB_2          0x03  /* 2 stop bits */
-
-/* crankback blocked transit type */
-
-#define AM_CBTT_BLKSUCCEND   0x02    /* call or party has been blocked at the
-                                      * succeeding end of this interface */
-#define AM_CBTT_BLKNODE      0x03    /* blocked node */
-#define AM_CBTT_BLKLINK      0x04    /* blocked link */
-#define AM_CBTT_BLKBYDSUCC   0xff    /* call or party has been blocked at or
-                                      * beyond the succeeding node, AINI */
-
-/* Specific Crankback level for AINI */
-#define AM_AINI_CBLVL        0xff     /* Crankback level for AINI */
-
-/* crankback cause indicator */
-
-#define AM_CBCAUSE_IND       0x85    /* crankback cause indicator */
-
-/* Cranckback and general cause values */
-
-#define AM_CV_INVCAUSEVAL      0     /* invalid cause value - proprietary */
-#define AM_CV_UNALLOCNMB       1     /* unallocated (unassigned) number */
-#define AM_CV_NOROUTTRANSNET   2     /* no route to transit network */
-#define AM_CV_NOROUTDST        3     /* no route to destination */
-#define AM_CV_VCCUNACPT        10    /* UNI 3.0: VPCI/VCI unacceptable */
-#define AM_CV_NORMCALLCLR      16    /* UNI 3.1: normal call clearing */
-#define AM_CV_USRBUSY          17    /* user busy */
-#define AM_CV_NOUSRRSP         18    /* no user response */
-#define AM_CV_NOANSUSR         19    /* no answer from user */
-#define AM_CV_CALLREJ          21    /* call rejected */
-#define AM_CV_NMBCHNG          22    /* number changed */
-#define AM_CV_CALLREJCLIR      23    /* user rejects all calls with CLIR */
-#define AM_CV_DSTOUTORD        27    /* destination out of order */
-#define AM_CV_INVNMBFORM       28    /* invalid number format */
-#define AM_CV_RSPSTATENQ       30    /* response to STATUS ENQUIRY */
-#define AM_CV_NORMUNSPEC       31    /* normal unspecified */
-#define AM_CV_PNDADDPTYREQ     32    /* PNNI: too many pending add party requests */
-#define AM_CV_CHNGINPGL        34    /* PNNI: Call cleared due to change in PGL */
-#define AM_CV_REQVCCUNAVAIL    35    /* requested VPCI/VCI unavailable */
-#define AM_CV_VCCFAIL          36    /* UNI 3.1: VPCI/VCI assignment failure */
-#define AM_CV_RATEUNAVAIL1     37    /* UNI 3.1: user cell rate unavailable */
-#define AM_CV_NETOUTORD        38    /* network out of order */
-#define AM_CV_TMPFAIL          41    /* Temporary failure */
-#define AM_CV_ACCINFODISC      43    /* access info discarded */
-#define AM_CV_NOVCCAVAIL       45    /* no VPCI/VCI unavailable */
-#define AM_CV_RESAIL           47    /* resources unavailable, unspecified */
-#define AM_CV_QOSUNAVAIL       49    /* Quality of Service unavailable */
-#define AM_CV_RATEUNAVAIL      51    /* UNI 3.0: user cell rate unavailable */
-#define AM_CV_REQPVPCVCCUNAV   53    /* PNNI: Requested Called party soft PVPC/PVCC not available */
-#define AM_CV_BCAPNOTAUTH      57    /* bearer capability not authorized */
-#define AM_CV_BCAPUNAVAIL      58    /* bearer capability not available */
-#define AM_CV_SRVUNAVAIL       63    /* Service or option unavailable */
-#define AM_CV_BCAPNOTIMPL      65    /* bearer capability not implemented */
-#define AM_CV_COMBUNSUPP       73    /* unsupported comb. of traffic parameters */
-#define AM_CV_AALPARMUNSUPP1   78    /* UNI 3.1: AAL paramteres cannot be supported */
-#define AM_CV_INVCALLREF       81    /* invalid call reference */
-#define AM_CV_CHANNOTEXST      82    /* identified channel does not exist */
-#define AM_CV_DSTNOTCOMP       88    /* incompatible destination */
-#define AM_CV_INVENDPTREF      89    /* invalid endpoint reference */
-#define AM_CV_INVTRANSNET      91    /* invalid transit network selection */
-#define AM_CV_MANYADDPTYREQ    92    /* too many add party requests */
-#define AM_CV_AALPARMUNSUPP    93    /* UNI 3.0:AAL paramteres cannot be supported */
-#define AM_CV_INFOELMSSG       96    /* mandatory info element is missing */
-#define AM_CV_MSGTYPNOTIMPL    97    /* message type not implemented */
-#define AM_CV_INFOELNOTIMPL    99    /* info element not implemented */
-#define AM_CV_INVINFOEL        100   /* invalid info element */
-#define AM_CV_MSGNOTCOMP       101   /* msg type not compatible with call st */
-#define AM_CV_TMRRCVRY         102   /* recovery on timer expiry */
-#define AM_CV_INVMSGLEN        104   /* incorrect message length */
-#define AM_CV_PROTERR          111   /* protocol error, unspecified */
-#define AM_CV_OPTELMERR        127   /* opt info el content error (non-std) */
-#define AM_CV_NOROUTNEXTNODE   128   /* next node unreachable */
-#define AM_CV_DTLNOTMYNODE     160   /* DTL Transit not my node ID */
-
-/* AAL type */
-
-#define AM_AALTYP_0          0x00    /* AAL for voice */
-#define AM_AALTYP_1          0x01    /* AAL type 1 */
-#define AM_AALTYP_2          0x02    /* AAL type 2 */
-#define AM_AALTYP_34         0x03    /* AAL type 3/4 */
-#define AM_AALTYP_5          0x05    /* AAL type 5 */
-#define AM_AALTYP_USR        0x10    /* user defined AAL */
-
-/* AAL type 1 - identifiers */
-#define AM_AAL1_ID_STYPE     0x85    /* AAL Subtype ID */
-#define AM_AAL1_ID_CBR       0x86    /* CBR Rate ID */
-#define AM_AAL1_ID_MULT      0x87    /* Multiplier Identifier */
-#define AM_AAL1_ID_SCFRM     0x88    /* Source Clock Freq. Recovery Method Id */
-#define AM_AAL1_ID_ECM       0x89    /* Error correction Method Id */
-#define AM_AAL1_ID_SDTB      0x8A    /* Structured Data Transfer Blocksize Id */
-#define AM_AAL1_ID_PFC       0x8B    /* Partially filled cells Id */
-
-/* AAL type 1 subtypes */
-#define AM_AAL1_STYPE_NULL   0x00    /* Null/Empty */
-#define AM_AAL1_STYPE_VOICE  0x01    /* Voice-band based on 64 kbit/s */
-#define AM_AAL1_STYPE_SCKT   0x02    /* Synchronous circuit Emulation */
-#define AM_AAL1_STYPE_ACKT   0x03    /* Asynchronous circuit Emulation */
-#define AM_AAL1_STYPE_HQAUD  0x04    /* High Quality Audio */
-#define AM_AAL1_STYPE_VIDEO  0x05    /* Video */
-
-/* AAL type 1 CBR rates */
-#define AM_AAL1_CBR_64       0x01    /* 64 kbit/s */
-#define AM_AAL1_CBR_1544     0x04    /* 1544 kbit/s (DS1) */
-#define AM_AAL1_CBR_6312     0x05    /* 6312 kbit/s (DS2) */
-#define AM_AAL1_CBR_32064    0x06    /* 32064 kbit/s */
-#define AM_AAL1_CBR_44736    0x07    /* 44736 kbit/s (DS3) */
-#define AM_AAL1_CBR_97728    0x08    /* 97728 kbit/s */
-#define AM_AAL1_CBR_2048     0x10    /* 2048 kbit/s (E1) */
-#define AM_AAL1_CBR_8448     0x11    /* 8448 kbit/s (E2) */
-#define AM_AAL1_CBR_34368    0x12    /* 34368 kbit/s (E3) */
-#define AM_AAL1_CBR_139264   0x13    /* 139264 kbit/s */
-#define AM_AAL1_CBR_nx64     0x40    /* n x 64 kbit/s */
-#define AM_AAL1_CBR_nx8      0x41    /* n x 8  kbit/s */
-
-/* AAL type 1 Clock recovery types */
-#define AM_AAL1_SCFRM_NULL   0x00    /* Null */
-#define AM_AAL1_SCFRM_SRTS   0x01    /* Synchronous Residual Time Stamp */
-#define AM_AAL1_SCFRM_ACR    0x02    /* Adaptive clock Recovery  */
-
-/* AAL type 1 Error Correction types */
-#define AM_AAL1_ECM_NULL     0x00    /* NULL */
-#define AM_AAL1_ECM_FEC      0x01    /* Interleaved FEC */
-#define AM_AAL1_ECM_DSST     0x02    /* For delay sensitive signal transport */
-
-/* AAL type 1 Structured Data Transfer */
-#define AM_AAL1_SDTB_NULL    0x00    /* NULL */
-#define AM_AAL1_SDTB_SDT     0x01    /* Structured Data Transfer */
-
-/* AAL type 5 & 3/4 - identifiers */
-#define AM_AAL5_ID_FMSDU     0x8c    /* forward  maximum CPCS SDU size id */
-#define AM_AAL5_ID_BMSDU     0x81    /* backward maximum CPCS SDU size id */
-#define AM_AAL5_ID_MIDRNG    0x82    /* Mid Range Id */
-#define AM_AAL5_ID_MODE      0x83    /* mode identifier */
-#define AM_AAL5_ID_SSCS      0x84    /* SSCS type identifier */
-
-/* AAL type 5 & 3/4 - mode of operation */
-
-#define AM_AAL5_MODE_MSG     0x01    /* message mode */
-#define AM_AAL5_MODE_STREAM  0x02    /* streaming mode */
-
-/* AAL type 5 - SSCS type */
-
-#define AM_AAL5_SSCS_NULL    0x00    /* null SSCS */
-#define AM_AAL5_SSCS_SSCOP_A 0x01    /* SSCOP assured mode SSCS */
-#define AM_AAL5_SSCS_SSCOP_N 0x02    /* SSCOP non-assured mode SSCS */
-#define AM_AAL5_SSCS_FR      0x04    /* frame relay SSCS */
-
-/* bearer class */
-
-#define AM_BCOB_A            0x01    /* bearer class A */
-#define AM_BCOB_C            0x03    /* bearer class C */
-#define AM_BCOB_X            0x10    /* bearer class X */
-
-/* timing requirement */
-
-#define AM_TMGREQ_NOIND      0       /* no indication */
-#define AM_TMGREQ_ETOEREQ    1       /* end-to-end timing required */
-#define AM_TMGREQ_ETOENOTREQ 2       /* end-to-end timing not required */
-
-/* traffic type */
-
-#define AM_TFCTYP_NOIND      0       /* no indication */
-#define AM_TFCTYP_CBR        1       /* constant bit rate */
-#define AM_TFCTYP_VBR        2       /* variable bit rate */
-
-/* user plane connection configuration */
-
-#define AM_CONCFG_PTPT       0       /* point to point */
-#define AM_CONCFG_PTMPT      1       /* point to multipoint */
-
-/* susceptability to clipping */
-
-#define AM_SUSCLP_NO         0       /* not susceptible to clipping */
-#define AM_SUSCLP_YES        1       /* susceptible to clipping */
-
-/* layer 1 identity */
-
-#define AM_L1_IDENT       0x01  /* layer 1 identity */
-
-/* layer 2 identity */
-
-#define AM_L2_IDENT       0x02  /* layer 2 identity */
-
-/* layer 3 identity */
-
-#define AM_L3_IDENT       0x03  /* layer 3 identity */
-
-/* user information layer 1 */
-
-#define AM_UIL1_CCITTV110 0x01  /* CCITT Standardized Rate Adaptation V.110/X.30. */
-#define AM_UIL1_G711ULAW  0x02  /* Reccomendation G.711 u-Law */
-#define AM_UIL1_G711ALAW  0x03  /* Recommendation G.711 A-Law */
-#define AM_UIL1_G721ADCPM 0x04  /* Recommendation G.721 32 kbit/s ADCPM and */
-                             /* Recommendation I.460 */
-#define AM_UIL1_G722G725  0x05  /* Recommendation G.722 and G.725 - 7kHz Audio */
-#define AM_UIL1_H261      0x06  /* Recommendation H.261 - 384 kbit/s Video */
-#define AM_UIL1_NONCCITT  0x07  /* Non-CCITT  standardized Rate adaptation */
-#define AM_UIL1_CCITTV120 0x08  /* CCITT Standardized Rate Adaptation V.120 */
-#define AM_UIL1_CCITTX31  0x09  /* CCITT Standardized Rate Adaptation X.31 HDLC */
-
-/* user information layer 2 protocol */
-
-#define AM_UIL2_BASIC     0x01  /* basic mode - ISO 1745 */
-#define AM_UIL2_Q921      0x02  /* CCITT Recommendation Q.921 */
-#define AM_UIL2_X25SLP    0x06  /* CCITT Recommendation X.25, single link */
-#define AM_UIL2_X25MLP    0x07  /* CCITT Recommendation X.25, multi link */
-#define AM_UIL2_T71       0x08  /* extended LAPB for half duplex, */
-                             /* CCITT Recommendation T.71 */
-#define AM_UIL2_HDLCARM   0x09  /* HDLC ARM - ISO 4335 */
-#define AM_UIL2_HDLCNRM   0x0a  /* HDLC NRM - ISO 4335 */
-#define AM_UIL2_HDLCABM   0x0b  /* HDLC ABM - ISO 4335 */
-#define AM_UIL2_LANLLC    0x0c  /* LAN LLC - ISO 8802/2 */
-#define AM_UIL2_X75SLP    0x0d  /* CCITT Recommendation X.75, single link */
-#define AM_UIL2_Q922      0x0e  /* CCITT Recommendation Q.922 */
-#define AM_UIL2_USRSPEC   0x10  /* CCITT User specified */
-#define AM_UIL2_T90       0x11  /* CCITT T.90 */
-
-/* Layer 2/3 Operation Mode */
-#define AM_LOLYR_OPR_NORM 0x01  /* Normal mode of operation */
-#define AM_LOLYR_OPR_EXT  0x02  /* Extended mode of operation */
-
-/* user information layer 3 protocol */
-
-#define AM_UIL3_Q931      0x02  /* CCITT Recommendation Q.931 */
-#define AM_UIL3_T90       0x05  /* CCITT T.90 */
-#define AM_UIL3_X25PLP    0x06  /* CCITT Recommendation X.25, packet layer */
-#define AM_UIL3_ISO8208   0x07  /* ISO 8208 */
-#define AM_UIL3_ISO8348   0x08  /* ISO 8348 */
-#define AM_UIL3_ISO8473   0x09  /* ISO 8473 */
-#define AM_UIL3_T70       0x0a  /* CCITT Recommendation T.70 */
-#define AM_UIL3_ISO9577   0x0b  /* ISO/IEC TR 9577 */
-#define AM_UIL3_USRSPEC   0x10  /* CCITT User specified */
-
-/* presentation method of protocol profile */
-
-#define AM_PM_VAL1        0x01  /* value 1 */
-
-/* information transfer mode */
-
-#define AM_TM_CIRCUIT     0x00  /* circuit mode */
-#define AM_TM_PACKET      0x02  /* packet mode */
-
-/* information transfer capability */
-
-#define AM_ITC_SPEECH     0x00  /* speech */
-#define AM_ITC_UNRDIG     0x08  /* unrestricted digital information */
-#define AM_ITC_RESDIG     0x09  /* restricted digital information */
-#define AM_ITC_A31KHZ     0x10  /* 3.1kHz audio */
-#define AM_ITC_A7KHZ      0x11  /* 7 kHz audio */
-#define AM_ITC_A15KHZ     0x12  /* 15 kHz audio */
-#define AM_ITC_VIDEO      0x18  /* video */
-
-/* information transfer rate */
-
-#define AM_ITR_PKT        0x00  /* packet mode */
-#define AM_ITR_64KBIT     0x10  /* circuit mode - 64 kbits */
-#define AM_ITR_2X64KBIT   0x11  /* circuit mode - 2 X 64 kbits */
-#define AM_ITR_384KBIT    0x13  /* circuit mode - 384 kbits */
-#define AM_ITR_1472KBIT   0x14  /* circuit mode - 1472 kbits */
-#define AM_ITR_1536KBIT   0x15  /* circuit mode - 1536 kbits */
-#define AM_ITR_1920KBIT   0x17  /* circuit mode - 1920 kbits */
-#define AM_ITR_MULIRATE   0x18  /* circuit mode - multi rate */
-
-/* symmetry */
-
-#define AM_S_BISYM        0x00  /* bidirectional symmetry */
-
-/* structure */
-
-#define AM_S_DEF          0x00  /* default */
-#define AM_S_8KHZINTEG    0x01  /* 8 khz integrity */
-#define AM_S_SDUINTEG     0x04  /* service data unit integrity */
-#define AM_S_UNSTRUCT     0x07  /* unstructured */
-
-/* intermediate rate */
-
-#define AM_IR_NONE        0x00  /* none specified */
-#define AM_IR_8KBIT       0x01  /* 8 kbits */
-#define AM_IR_16KBIT      0x02  /* 16 kbits */
-#define AM_IR_32KBIT      0x03  /* 32 kbits */
-
-/* negotiation */
-
-#define AM_N_IBNOTPOSS    0x00  /* inband not possible */
-#define AM_N_IBPOSS       0x01  /* inband possible */
-
- /* negotiation indicator */
-
-#define AM_N_OBNOTPOSS    0x00  /* outband not possible */
-#define AM_N_OBPOSS       0x01  /* outband possible */
-
-/* synchronous/asynchronous */
-
-#define AM_SA_SYNC        0x00  /* synchronous */
-#define AM_SA_ASYNC       0x01  /* asynchronous */
-
-/* assignor/assignee */
-
-#define AM_AA_ORGASGNEE   0x00  /* originator is assignee */
-#define AM_AA_ORGASGNOR   0x01  /* originator is assignor */
-
-/* duplex mode */
-
-#define AM_DUPMODE_HALF   0x00  /* half duplex */
-#define AM_DUPMODE_FULL   0x01  /* full duplex */
-
-/* mode of operation */
-
-#define AM_MOO_BITTRANS   0x00  /* bit transparent */
-#define AM_MOO_PROTSEN    0x01  /* protocol sensitive */
-
-/* multiple frame establishment */
-
-#define AM_MFE_NOTSUP     0x00  /* not supported */
-#define AM_MFE_SUP        0x01  /* supported */
-
-/* logical link identifier */
-
-#define AM_LLI_DEF        0x00  /* default */
-#define AM_LLI_FULLNEG    0x01  /* full protocol negotiation */
-
-/* inband/outband negotiation */
-
-#define AM_ION_USRINFO    0x00  /* negotiation with user info messages */
-#define AM_ION_LL0        0x01  /* negotiation in band using logical link 0 */
-
-/* narrow band coding standards */
-
-#define AM_CSTD_CCITT     0x00  /* CCITT standards */
-#define AM_CSTD_INT       0x01  /* Other International Standards */
-#define AM_CSTD_NAT       0x02  /* National Standard */
-#define AM_CSTD_NET       0x03  /* Network Standard */
-
-/* coding standard */
-
-#define AM_CODESTD_CCITT     0       /* ITU-TS (CCITT) standardized */
-#define AM_CODESTD_NET       3       /* ATM Forum specific */
-
-/* location */
-
-#define AM_LOCN_USER         0x00    /* user */
-#define AM_LOCN_PRVNETLOC    0x01    /* private network serving local user */
-#define AM_LOCN_PUBNETLOC    0x02    /* public network serving local user */
-#define AM_LOCN_TRNSNET      0x03    /* transit network */
-#define AM_LOCN_PUBNETRMT    0x04    /* public network serving remote user */
-#define AM_LOCN_PRVNETRMT    0x05    /* private network serving remote user */
-#define AM_LOCN_INTNET       0x07    /* international network */
-#define AM_LOCN_NETINTWRK    0x0a    /* network beyond interworking point */
-
-/* extended high layer characteristics */
-
-#define AM_XHLCI_TEL      0x01  /* Telephony - Recommendation G.711 */
-#define AM_XHLCI_FAXG4    0x04  /* Facsimile Group 4 - Recommendation T.62 */
-#define AM_XHLCI_DAPFAXG4 0x21  /* Doc App Profile for Facsimile Group 4 */
-                             /* Recommendation T.503 */
-#define AM_XHLCI_DAPMIXED 0x24  /* Doc App Profile for Facsimile Group 4 */
-                             /* Recommendation T.501 */
-#define AM_XHLCI_DAPPROC  0x28  /* Doc App Profile for Facsimile Group 4 */
-                             /* Recommendation T.502 */
-#define AM_XHLCI_TELETEX  0x31  /* Teletex - Recommendation T.62/T.70 */
-#define AM_XHLCI_DAPVIDEO 0x32  /* Doc App Profile for Facsimile Group 4 */
-                             /* Recommendation T.503 */
-#define AM_XHLCI_TELEX    0x35  /* Telex */
-#define AM_XHLCI_MHS      0x38  /* Message Handling System */
-                             /* Recommendation X.400 */
-#define AM_XHLCI_OSIAPP   0x41  /* OSI Application - Recommendation X.200 */
-#define AM_XHLCI_MAINT    0x5e  /* Maintenance */
-#define AM_XHLCI_MNGMT    0x5f  /* Management */
-#define AM_XHLCI_VIDTEL   0x60  /* Videotelephony (F.xyz and AV.242) */
-#define AM_XHLCI_RESERVE  0xff  /* Reserved */
-
-
-/* ATM Traffic Descriptor tagging */
-
-#define AM_ATD_TAGNOTREQ    0       /* tagging not requested */
-#define AM_ATD_TAGREQ       1       /* tagging requested */
-
-/* ATM Traffic Descriptor Frame discard */
-
-#define AM_ATD_NOFRMDISC    0       /* frame discard not allowed */
-#define AM_ATD_FRMDISC      1       /* frame discard allowed */
-
-/* ATM Traffic Descriptor ABR specific token identifier */
-
-#define AM_ATD_ABR_FMCR_ID  0x92    /* Forward ABR minimum cell rate identifier */
-#define AM_ATD_ABR_BMCR_ID  0x93    /* Forward ABR minimum cell rate identifier */
-
-/* crankback level indicator */
-
-#define AM_CBLEVEL_IND       0x81    /* crankback level indicator */
-
-/* succeeding end block indicator */
-
-#define AM_ENDBLK_IND        0x82    /* succeeding end block indicator */
-
-/* blocked node indicator */
-
-#define AM_BLKNODE_IND       0x83    /* blocked node indicator */
-
-/* blocked link indicator */
-
-#define AM_BLKLINK_IND       0x84    /* blocked link indicator */
-
-/* connection level id */
-
-#define AM_CONLEVEL_ID       0x81    /* connection level id */
-
-/* connection level */
-
-#define AM_CONLEVEL_VCC      0x01    /* virtual channel connection */
-#define AM_CONLEVEL_VPC      0x02    /* virtual path connection */
-
-/* VPI/VCI selection type */
-
-#define AM_VPCSEL_ANY        0x00    /* any VPI/VCI */
-#define AM_VPCSEL_REQ        0x02    /* required VPI/VCI */
-#define AM_VPCSEL_ASSGN      0x04    /* assigned VPI/VCI */
-
-/* VPI id */
-
-#define AM_VPI_ID            0x81    /* VPI id */
-
-/* VCI id */
-
-#define AM_VCI_ID            0x82    /* VCI id */
-
-/* shaping indicator */
-
-#define AM_SHAPIND_NOREQ     0x00    /* no user requirement */
-#define AM_SHAPIND_NOAGG     0x01    /* no aggregation of user and OAM cells */
-
-/* payload types */
-
-#define ATMPT_USR   0     /* user cells */
-#define ATMPT_RM    1     /* RM cells */
-#define ATMPT_OAM   2     /* OAM cells */
-
-/* values for lnkNmb parameter */
-
-#define AMT_CON_LNK_UNUSED  0xffff  /* link number field not significant */
-
-\f
-/* defines for LAN emulation */
-
 /* MAC address length */
 
 #define MACADDRLEN                    6  /* 48 bit MAC address length */
 
-/* LANE and MAC header length */
-
-#define LANE_HDR_LEN             2  /* 2 octet LANE header length */
-#define LANE_MACHDR_LEN         14  /* 802.3 (DA/SA/Len), 802.5 (AC/FC/DA/SA) */
-
-/* Additional broadband repeat indicators */
-
-#define AM_REPIND_Q2763_1       0x00  /* reserved for use by Rec. Q.2763 */
-#define AM_REPIND_Q2763_2i      0x01  /* reserved for use by Rec. Q.2763 */
-
-/* values for AC/FC fields - to be ignored */
-
-#define LANE_HDR_8025_AC           0x00  /* no significance */
-#define LANE_HDR_8025_FC           0x40  /* LLC frame, priority 0 */
-
-/* value for pad octets */
-
-#define LANE_PAD                   0x00  /* pad octets */
-
-/* source routed frame types */
-
-#define LANE_FRAMETYPE_NSR         0x00  /* not source routed */
-#define LANE_FRAMETYPE_SRF         0x01  /* specifically routed frame */
-#define LANE_FRAMETYPE_ARE         0x02  /* all routes explorer frame */
-#define LANE_FRAMETYPE_STE         0x03  /* spanning tree explorer frame */
-#define LANE_FRAMETYPE_ERR         0x04  /* illegal frame type */
-
-/* next hop types for SRF frames */
-
-#define LANE_NEXTHOP_NONE          0x00  /* no hop */
-#define LANE_NEXTHOP_LAST          0x01  /* last hop */
-#define LANE_NEXTHOP_MORE          0x02  /* more hops */
-
 /* maximum sizes for typedef arrays */
 
 #define MAX_LANNAME                  32  /* size of LAN name string */
 #define MAX_TLV_LEN                   4  /* max length of value in TLV entry */
 #define MAX_TLV_TBL                  16  /* size of TLV table */
 
-/* marker (special LEC id) */
-
-#define LANE_MARKER_CTRL         0xff00  /* control frame marker */
-/* LAN emulation protocol */
-
-#define LANE_PROTOCOL              0x01  /* LAN Emulation protocol */
-/* LAN emulation protocol version */
-
-#define LANE_VERSION               0x01  /* LAN Emulation protocol version */
-
-/* op code type */
-
-#define LANE_OPCODE_TYPE_REQ       0x00  /* request frame */
-#define LANE_OPCODE_TYPE_RSP       0x01  /* response frame */
-
-/* op code name */
-
-#define LANE_OPCODE_CFGREQ       0x0001  /* configuration request  frame */
-#define LANE_OPCODE_CFGRSP       0x0101  /* configuration response frame */
-#define LANE_OPCODE_JOINREQ      0x0002  /* join request  frame */
-#define LANE_OPCODE_JOINRSP      0x0102  /* join response frame */
-#define LANE_OPCODE_READYQUERY   0x0003  /* ready query  frame */
-#define LANE_OPCODE_READYIND     0x0103  /* ready indication frame */
-#define LANE_OPCODE_REGREQ       0x0004  /* register request  frame */
-#define LANE_OPCODE_REGRSP       0x0104  /* register response frame */
-#define LANE_OPCODE_UNREGREQ     0x0005  /* unregister request  frame */
-#define LANE_OPCODE_UNREGRSP     0x0105  /* unregister response frame */
-#define LANE_OPCODE_ARPREQ       0x0006  /* configuration request  frame */
-#define LANE_OPCODE_ARPRSP       0x0106  /* configuration response frame */
-#define LANE_OPCODE_FLUSHREQ     0x0007  /* flush request  frame */
-#define LANE_OPCODE_FLUSHRSP     0x0107  /* flush response frame */
-#define LANE_OPCODE_NARPREQ      0x0008  /* negative ARP request frame */
-#define LANE_OPCODE_TOPCHREQ     0x0009  /* topology change request  frame */
-
-/* status */
-
-#define LANE_STA_SUCCESS              0  /* success */
-#define LANE_STA_UNSUPPVER            1  /* version not supported */
-#define LANE_STA_INVPARAM             2  /* invalid request parameters */
-#define LANE_STA_DUPLANDST            4  /* duplicate LAN destination */
-#define LANE_STA_DUPATMADDR           5  /* duplicate ATM address */
-#define LANE_STA_RESAIL           6  /* insufficient resources to grant request */
-#define LANE_STA_NOACCESS             7  /* access denied */
-#define LANE_STA_INVLECID             8  /* invalid requestor-LECID */
-#define LANE_STA_INVLANDST            9  /* invalid LAN destination */
-#define LANE_STA_INVATMADDR          10  /* invalid ATM address */
-#define LANE_STA_NOCFG               20  /* no configuration */
-#define LANE_STA_LECSERR             21  /* LECS error */
-#define LANE_STA_INFOUNAVAIL         22  /* insufficient information */
-
-/* non-standard status values, for internal use */
-
-#define LANE_STA_INVCTRL         0x0f00  /* invalid control frame - unspecified */
-
-/* flag values */
-
-#define LANE_FLAG_RMTADDR        0x0001  /* remote address (unreg LAN dst) */
-#define LANE_FLAG_PROXY          0x0080  /* LEC acts as proxy */
-#define LANE_FLAG_TOPCH          0x0100  /* topology change */
-
-/* tag values for LAN destination type */
-
-#define LANE_TAG_NOTPRSNT        0x0000  /* not present */
-#define LANE_TAG_MACADDR         0x0001  /* MAC address */
-#define LANE_TAG_RD              0x0002  /* route designator */
-
-/* LAN type */
-
-#define LANE_LANTYPE_UNSPECIFIED   0x00  /* unspecified */
-#define LANE_LANTYPE_8023          0x01  /* IEEE 802.3/Ethernet */
-#define LANE_LANTYPE_8025          0x02  /* IEEE 802.5/Token Ring */
-
-/* min frame size - values */
-
-#define LANE_MIN_DATA_8023           62  /* minimum AAL SDU size for IEEE 802.3 data */
-#define LANE_MIN_DATA_8025           16  /* minimum AAL SDU size for IEEE 802.5 data */
-#define LANE_MIN_CTRL               108  /* minimum AAL SDU size for control frame */
-
-/* max frame size - index */
-
-#define LANE_MTU_IDX_UNSPECIFIED   0x00  /* unspecified */
-#define LANE_MTU_IDX_ENET          0x01  /* 1516 octets IEEE 802.3 */
-#define LANE_MTU_IDX_TR_4          0x02  /* 4544 octets IEEE 802.5 4Mbps */
-#define LANE_MTU_IDX_RFC1626       0x03  /* 9234 octets RFC  1626 */
-#define LANE_MTU_IDX_TR_16         0x04  /* 18190 octets IEEE 802.5 16Mbps */
-
-/* max frame size - values */
-
-#define LANE_MTU_VAL_UNSPECIFIED      0  /* unspecified */
-#define LANE_MTU_VAL_ENET          1516  /* 1516 octets IEEE 802.3 */
-#define LANE_MTU_VAL_TR_4          4544  /* 4544 octets IEEE 802.5 4Mbps */
-#define LANE_MTU_VAL_RFC1626       9234  /* 9234 octets RFC  1626 */
-#define LANE_MTU_VAL_TR_16        18190  /* 18190 octets IEEE 802.5 16Mbps */
-
-/* VCC nature */
-
-#define VCC_NATURE_PVC                0  /* permanent virtual circuit */
-#define VCC_NATURE_SVC                1  /* switched virtual circuit */
-#define  VCC_NATURE_PVC_SVC           2  /* mixed PVC/SVC */
-
-/* VCC type (values from LEC MIB) */
-
-#define LANE_VCC_TYPE_CTRL_DIR        0  /* control direct VCC */
-#define LANE_VCC_TYPE_CTRL_DIST       1  /* control distribute VCC */
-#define LANE_VCC_TYPE_MCAST_SND_8023  2  /* multicast send VCC for 802.3 */
-#define LANE_VCC_TYPE_MCAST_FWD_8023  3  /* multicast forward VCC for 802.3 */
-#define LANE_VCC_TYPE_MCAST_SND_8025  4  /* multicast send VCC for 802.5 */
-#define LANE_VCC_TYPE_MCAST_FWD_8025  5  /* multicast forward VCC for 802.5 */
-#define LANE_VCC_TYPE_DATA_DIR_8023   6  /* data direct VCC for 802.3 */
-#define LANE_VCC_TYPE_DATA_DIR_8025   7  /* data direct VCC for 802.5 */
-#define LANE_VCC_TYPE_UNKNOWN         8  /* unclassified VCC */
-#define LANE_VCC_TYPE_CFG_DIR         9  /* cfg direct VCC */
-
-/* LAN destination proxy class */
-
-#define LANE_CLASS_LOCAL              0  /* local LAN destination */
-#define LANE_CLASS_PROXY              1  /* proxy LAN destination */
-
-/* LAN destination mode (type) */
-
-#define LANE_LDMODE_UCAST_MACADDR     0  /* unicast MAC address */
-#define LANE_LDMODE_MCAST_MACADDR     1  /* multicast MAC address */
-#define LANE_LDMODE_MCAST_ALLGRP      2  /* all group addresses */
-#define LANE_LDMODE_MACADDR           3  /* MAC address */
-#define LANE_LDMODE_RD                4  /* route descriptor */
-#define LANE_LDMODE_UCAST_ALLUNI      5  /* all unicast addresses */
-
-/* configuration mode */
-
-#define LANE_CFGMODE_AUTO             0  /* auto cfg (use LECS ATM addr) */
-#define LANE_CFGMODE_MANUAL           1  /* manual cfg (use LES ATM addr) */
-
-/* ATM Forum OUI - 3 octets */
-
-#define OUI_ATMF               0x00a03e  /* ATM Forum OUI */
-
-/* LAN Emulation Protocol Ids - 2 octets */
-
-#define LANE_PID_CTRL            0x0001  /* control VCCs */
-#define LANE_PID_DATA_DIR_8023   0x0002  /* data direct VCCs for IEEE 802.3 */
-#define LANE_PID_DATA_DIR_8025   0x0003  /* data direct VCCs for IEEE 802.5 */
-#define LANE_PID_MCAST_8023      0x0004  /* multicast   VCCs for IEEE 802.3 */
-#define LANE_PID_MCAST_8025      0x0005  /* multicast   VCCs for IEEE 802.5 */
-
-/* LAN Emulation standard TLV types - 4 octets */
-
-#define LANE_TLV_C7              0x00a03e01  /* control timer */
-#define LANE_TLV_C10             0x00a03e02  /* max unknown frame count */
-#define LANE_TLV_C11             0x00a03e03  /* max unknown frame timer */
-#define LANE_TLV_C12             0x00a03e04  /* VCC aging timer */
-#define LANE_TLV_C13             0x00a03e05  /* max retry count */
-#define LANE_TLV_C17             0x00a03e06  /* ARP long (cache) timer */
-#define LANE_TLV_C18             0x00a03e07  /* ARP short (fwd delay) timer */
-#define LANE_TLV_C20             0x00a03e08  /* ARP Request timer */
-#define LANE_TLV_C21             0x00a03e09  /* Flush Request timer */
-#define LANE_TLV_C22             0x00a03e0a  /* path switching delay */
-#define LANE_TLV_C23             0x00a03e0b  /* local segment id */
-#define LANE_TLV_C24             0x00a03e0c  /* mcast snd VCC type */
-#define LANE_TLV_C25             0x00a03e0d  /* mcast snd VCC SCR */
-#define LANE_TLV_C26             0x00a03e0e  /* mcast snd VCC PCR */
-#define LANE_TLV_C28             0x00a03e0f  /* Ready Ind timer */
 
 #endif /* CMFILE_REORG_1 */
 
 
-\f
-
-/* structure */
-
-#define S_DEF          0x00  /* default */
-#define S_8KHZINTEG    0x01  /* 8 khz integrity */
-#define S_SDUINTEG     0x04  /* service data unit integrity */
-#define S_UNSTRUCT     0x07  /* unstructured */
-
-/* define for TCAP string size */
-/* gen_h_001.main_128 - redefined value of MAX_ST_STRING to 256 */
-#define MAX_ST_STRING 256    /* longest string */
-
-\f    
 /* defines for SPstTsk */
 
 #define SEL_LC_NEW     0     /* loosely coupled interface - new */
 #define SEL_LC_OLD     1     /* loosely coupled interface - old */
 
-/* defines for system service entity processor, region and pool id's */
-
-#define OWNPROCID      0     /* own processor id */
-#define SP_POOL     0x00     /* service provider pool id */
-#define SU_POOL     0x00     /* service user pool id */
-
-/* defines for stack manager region and pool id's */
-
-#define SMREGION       1     /* stack manager region id */
-#define SMPOOL         0     /* stack manager pool id */
 
 /* defines */
   
 #define TCNTRL           2           /* control */
 #define TSTS             3           /* statistics */
 #define TSSTA            4           /* solicited status */
+#if 0
 #define TUSTA            5           /* unsolicited status */
 #define TTRC             6           /* trace */
 #define TACNT            7           /* billing */
 #define TMIB             15          /* mib req */
 /* gen_h_001.main_124 RRC 2.0 Release*/
 #define TAUDT            16          /* Audit req */
+#endif 
+
 /* Mngmt.hdr.elmId.elmnt */
   
 #define STGEN            1           /* general */
+#define STSID            8           /* system id */
+#if 0
 #define STTSAP           2           /* transport SAP */
 #define STNSAP           3           /* network SAP */
 #define STLLSAP          4           /* logical link SAP */
 #define STDLSAP          5           /* data link SAP */
 #define STMSAP           6           /* MAC SAP */
 #define STPSAP           7           /* physical SAP */
-#define STSID            8           /* system id */
 #define STHG             9           /* hunt Group */
 #define STROUT          10           /* route */
 #define STDLC           11           /* data link connection */
 #define STPNPG          63           /* PNNI PEER GROUP */
 #define STLINK          64           /* ATM Physical Link */
 #define STINFOGRP       65           /* information group */
-
 #define STNISAP         66           /* FR-ATM network interworking sap */
 #define STSISAP         67           /* FR-ATM service interworking sap */
 #define STPROF          68           /* FR-ATM aal connection's profile */
 #define STADDR          71           /* address */
 #define STSRVC          72           /* service registry */
 #define STCIPSAP        73           /* PLOA's CIPSAP */
-
 /* define for Envelope Function EFadr mapping */
 #define STEVEFADR       74           /* EV EFadr to SAP mapping */
 
 
 /* used by PQ for TDM Configuration */
 #define STTDM           78           /* TDM Configuration */
-  
 
 /* Used by LES */
 #define STLECSMPOATLV   79           /* LECS MPOA TLV entry */
 #define STGRDLSAP       87           /* data link  sap group */
 #define STALLSAP        88           /* all upper/lower SAPs */
 #define STPEERSAP       89           /* configure peer sap */
-
 /* Used by V5 */
 #define STVINTERFACE    83           /* V5 Interface */
 #define STVPORT         84           /* V5 port */
                                         more PVC on the fly */
 #define STCIPARP        87           /* PLOA Cfg. request to configure some 
                                         extra IP-ATM binding on the fly */
-
-
 /* used by Q.93B for AalConParam of signaling channels */
 #define STSIGCONPARAM   90           /* config Signaling connection parameters */
 #define STDELSIGPARAM   91           /* Delete Signaling connection parameters */
 #define STVPROC         92           /* Configure virtual node */
 #define STPPROC         93           /* Configure physical node */
 #define STASSOC         94           /* Configire association between vnodes */
-                                     /* and layers */
 
 /* used by TCAP over TCP/IP */
 #define STSERVER        95           /* configure TCP/UDP server */
 #define STSMS           101          /* PLOA LANE Selective M-cast Server */
 #define STSMSGRP        102          /* PLOA SMS Multicast Group */
 #define STSMSLEC        103          /* PLOA LEC Associated with SMS */
-
 /* used by PLOA - PPPoA */
 #define STMASAP         104          /* POOA MASAP - PPPoA upper SAP */
 
 #define STNHSEXTNS      114          /* PLOA NHS */
 #define STNHSEGRCACHE   115          /* PLOA NHS */
 #define STNHSVENDATA    116          /* PLOA NHS */
-
 /* used by H.323 Control */
 #define STSSAP          117          /* H.323 Session SAP element */
 #define ST323ENT        118          /* H323 entity element */
 #define STSRVCTYPE      129           /* service type */
 #define STSRVCCONNINFO  130           /* service connection info */
 #define STAALPROFILE    131           /* AAL[x] profiles; x = 1, 2, 34, 5 */
-
 /* used by MPLS-LDP (+CR) */
 #define STPEER          132          /* LDP Peer */
 #define STFEC           133          /* MPLS FEC  */
 #define STGRSNTSAP      144          /* SNT Group */
 #define STPATH          145          /* AAL2 path  */
 #define STDPC           146          /* DPC - MTP3B */
-
 /* used by Annex G */
 #define STBE                       147
 #define STGRBESAP                  148
 #define STDELNW         163          /* delete network */
 #define STDELTSAP       164          /* delete transport sap */
 #define STDELNSAP       165          /* delete network sap */
-
 /* new elements for 3GPP-RLC */
 #define STCRSAP         166          /* RLC Control SAP */
 #define STRLSAP         167          /* RLC Data SAP */
 /* new elements for LAPDm */
 #define STLSAP          178
 #define STRRSAP         179
+
 /*gen_h_001.main_127 - incremented values*/
 /* gen_h_001.main_123 - Add  new elements for 3GPP-PDCP */
 #define STCTSAP         180          /* PDCP Control SAP */
 #define STPDCPENT       182          /* PDCP Entity */
 /*-- gen_h_001.main_130 --*/
 #define STINST          183          /* IuUP Instance */
-
+#endif
 /* gen_h_001.main_134 - lte rlc 2.1 */
-/* elements for LTE-RLC SAPs */
+/* elements for NR RLC SAPs */
 #define STCKWSAP        184          /*!< RLC Control SAP element. */
 #define STKWUSAP        185          /*!< RLC Data SAP element. */
 #define STRGUSAP        186          /*!< RLC MAC SAP element. */
 /* elements for LTE-PDCP SAPs */
-#define STCPJSAP        187          /*!< PDCP control SAP element. */
-#define STPJUSAP        188          /*!< PDCP control SAP element. */
 #ifdef RM_INTF
 #define STRMUSAP        189          /*!< LTE RRM control SAP element. */
 #define STRGMSAP        190
 #endif
 
-#define STNLUSAP        191          /*!< eNB APP and SON module SAP */
-
 /* Mngmt.t.cntrl.action, Mngmt.hdr.elmId.elmntInst1 */
 
 #define AENA             1           /* enable */
 #define ADISIMM          2           /* disable - immediately */
 #define ADISGRC          3           /* disable - gracefully */
 #define ARST             4           /* reset */
-#define ADGN             5           /* diagnose */
-#define AADD             6           /* add */
 #define ADEL             7           /* delete */
-#define AINH             8           /* inhibit */
-#define AUNINH           9           /* uninhibit */
-#define ASPRST           10          /* signalling point restart */
-#define AACTLNKSET       11          /* activate link set */
-#define ADEACTLNKSET     12          /* deactivate link set */
-#define AVAL             13          /* validate circuit */
-#define AFLCON           14          /* flow control on */
-#define AFLCOFF          15          /* flow control off */
-#define ACLEAR           16          /* clear */
-#define ASTRTLL          17          /* start local loop */
-#define AENDLL           18          /* end local loop */
-#define ACTION_DROP      19          /* action - drop */
-#define ACTION_NO_DROP   20          /* action - no drop */
-#define ABND_ENA         21          /* bind and enable */
-#define ARSTVCC          22          /* restart a virtual channel connection */
-#define ARSTVPC          23          /* restart a virtual path connection */
-
-/* actions for LsaCntrlReq (q.2140) */
-
-#define AFORCE_PRV       24          /* Force Proving */
-#define AFORCE_EM        25          /* Force Emergency */
-#define ACLR_FORCE_MD    26          /* Clear Force Mode */
-#define ACTION_LPO       27          /* Local Processor Outage */
-#define ACTION_LPR       28          /* Local Processor Recovered */
-#define APRV_UNS         29          /* Proving Unsuccessful Response */
-
 #define ABND             30          /* bind */
 #define AUBND            31          /* disable + unbind */
 #define AUBND_DIS        AUBND       /* unbound disable */
 
-
 /* actions for mtp3 */
-
+#if 0
 #define ADELROUT         32          /* delete rout control block */
 #define ADELLNKSET       33          /* delete all linkset control blocks, link control blocks 
                                         for a given linkset id */
 #define ADELCMBLNKSET    34          /* delete linkset control block for a given combined linkset id */
 #define ADELLNK          35          /* delete link control block */
+#endif
 #define ASHUTDOWN        36          /* shutdown the layer */
+#if 0
 #define ATRAP            37          /* trap */
 #define AGEN_STA         38          /* generate status indications -MSOC */
-
 /* actions for fault tolerance */
 #define AGO_ACT                  38   /* go active */
 #define AGO_SBY                  39   /* go standby */
 #define ADEACTLNKSET_L2          51   /* deactivate link set: all links should be deactivated
                                          only at L2 level */
 #define AGEN_MSG                 52   /* message generation control action */
-
 /* For PLOA */
 #define ASNDTRIGG                53   /* Generate Flow detection trigger  */
 
 #define ASRVMSG_ON               59   /* Turn on service message capability */ 
 #define ASRVMSG_OFF              60   /* Turn off service message capability */
 #define ARESTART                 61   /* Restart Interface/Channel */
-
 /* For TCR 0004.01 */
 #define AMODIFY                  62   /* Modify trace length */
 
 /* For SIP */
 #define AADD_ASSOC_TPTSRV        70   /* Add transport server association */
 #define ADEL_ASSOC_TPTSRV        71   /* Delete transport server association */
-
 /* for SCCP congestion control (sccp3.2) */
 #define ACONG                    72   /* congestion cntrl - start sending SSC */
 /* For OAM */
 #define ASTRTPMLL                78   /* OAM Start PM Loopback of FMC's */
 #define AENDPMLL                 79   /* OAM End Performance Generation */
 #define ARSTPM                   80   /* OAM Reset counters of PM block */
-
 #define AMODABORT                81 /* Abort Modification Request */
 #define AADD_ASSOC_ENDP          82
 #define ADEL_ASSOC_ENDP          83
 #define ASTOP_LNK_AUDIT          95
 #define ASTOP_LNKSET_AUDIT       96
 #define ASTOP_RTE_AUDIT          97
-
 /* gen_h_001.main_125 - Addition - SUA support*/
 #ifdef LSPV2_8 
 #define AADD_ASP                 86
 #define ADEL_ASPSSN              88
 #define ADEL_ASPCPC              89
 #endif
-
 /* Added for NBAP to support SCT(SCTP) as lower interface */
 #define AEOPENR 100
 #define AECLOSER 101
 #define AHBEAT_DIS_ASSOC 105
 #define AHBEAT_ENB_DSTADDR 106
 #define AHBEAT_DIS_DSTADDR 107
-
+#endif
 /* Mngmt.t.cntrl.subAction */
   
 #define SAELMNT          1           /* specified element */
 #define SAUSTA           3           /* unsolicited status generation */
 #define SATRC            4           /* trace generation */
 #define SADBG            5           /* debugging */
-#ifdef SS_DIAG
-/* gen_h_001.main_142:Added subaction SALOG */
-#define SALOG            6           /* logging  */
-#endif
-
-/* grouping criteria's will be filled in subaction fields */
-
-#define SAGR_DSTPROCID   6           /* group on dstProcId */    
-#define SAGR_ROUTE       7           /* group on routes */    
-#define SAGR_PRIORITY    8           /* group on priority */    
-#define SAENA_PEER_SAP   9           /* enable peer sap */
-#define SADIS_PEER_SAP   10          /* disable peer sap */
-#define SAAUD            11          /* Audit */
-/* For GCP 1.2 */
-#define SADNS            12          /* Enable /Disable DNS Access*/   
-
-/* for SCCP traffic limitation mechanism and error report (sccp3.2) */
-#define SATRFLIM         13          /* traffic limitation mechanism */
-#define SAREPORT         14          /* sccp error perfroamce report */
-
-#define SAGR_GENERIC_MAX  20         /* max on subactions to be defined in gen.h */
-
-/* Subactions required for H.323 user layer (HU) */
-#define HU_RUNREQ        12          /* run a test case */
-#define HU_PROCEEDREQ    13          /* resume operation with a test case */
-
-/* Mngmt.t.mib.opCode */
-#define MIBOPCODEBASE         1000 /* Base for non standard opCode values */ 
-#define MIB_REQUEST_GET       0    /* GET request for reading mib variable*/
-#define MIB_REQUEST_GET_NEXT  1    /* GET-NEXT request to read
-                                      lexicographically next mib variable*/
-#define MIB_REQUEST_SET       3    /* Assign mib variable a value */
-/* Mngmt.t.mib.status */
-#define MIBSTATUSBASE         1000 /* Base for non standard status values */ 
-#define MIB_SUCCESS           0    /* Mib request successfully completed */
-#define MIB_NOSUCHNAME        2    /* no such name */
-#define MIB_INVALID_IDX       (MIBSTATUSBASE + 1) /* Index to the row-column 
-                                                   * of mib  table invalid */
-#define MIB_INVALID_OPCODE    (MIBSTATUSBASE + 3) /* OpCode is not one of the 
-                                                   * above defined*/
-#define MIB_END_ALL_TABLES    (MIBSTATUSBASE + 4) /* End of the table reached 
-                                                   * in get next */
-#define MIB_SUCCESS_NEXT_AVL_OBJ (MIBSTATUSBASE + 6) /* returning object from
-                                                    * a different table than
-                                                    * before */
-
-/* Mngmt.t.trc.evnt */
-  
-#define TL1FRMRX         0           /* layer 1 - frame received */
-#define TL1FRMTX         1           /* layer 1 - frame transmitted */
-#define TL2FRMRX         2           /* layer 2 - frame received */
-#define TL2FRMTX         3           /* layer 2 - frame transmitted */
-#define TL2TMR           4           /* layer 2 - timer expired */
-#define TL3PKTRX         5           /* layer 3 - frame received */
-#define TL3PKTTX         6           /* layer 3 - frame transmitted */
-#define TL3TMR           7           /* layer 3 - timer expired */
-#define TL7FRMRX         8           /* layer 7 - frame received */
-#define TL7FRMTX         9           /* layer 7 - frame transmitted */
-#define TL7TMR           10          /* layer 7 - timer expired */
-#define TL5MSGTX         11          /* layer 5 - message transmitted */
-#define TL5MSGRX         12          /* layer 5 - message received */
-
 /* defines for MxxStsReq */
   
 #define ZEROSTS          0           /* zero statistics counters */
 #define NOZEROSTS        1           /* dont zero statistics counters */
-
+#if 0
 /* defines for MxxCfgReq */
 
 #define THRSHA           0           /* 00% resources available */
                                      /* to call packets */
 #define LSAP             1           /* Link Level SAP Type */
 #define XTSAP            2           /* Transport SAP Type */
+#endif
 
 #ifdef IGNORE
 #undef IGNORE
 #define IGNORE           0           /* Ignore SAP Type */
 #endif /* IGNORE */
 
-#define X25LINK          0           /* X25 Link */
-#define X75LINK          1           /* X75 Link */
-#define USER             0           /* acts as user */
-#define NETWORK          1           /* acts as network */
-#define SYM_USER         2           /* acts as symmetrical user */
-
-/* defines for MxxStaInd */
-
-#define ENTR_CONG        1           /* event - entering congst */
-#define EXIT_CONG        2           /* event - exiting congest */
-#define PROT_ST_UP       3           /* event - link up */
-#define PROT_ST_DN       4           /* event - link down */
-#define PROT_ERR         5           /* event - protocol error */
-#define INV_REM          6           /* event - invalid remove */
-#define LINK_ALIGNED     7           /* event - mtp 2 - link alignment */
-#define ALIGN_LOST       8           /* event - mtp 2 - alignment lost */
-#define ELEC_DOWN        9           /* event - scc - electrical interface down */
-#define ELEC_UP          10          /* event - scc - electrical interface up */
-#define REG_DOWN         11          /* event - mos - memory region down */
-#define REG_UP           12          /* event - mos - memory region up */
-#define INH_DEN          13          /* event - link inhibit denied */
-#define INH_ACK          14          /* event - link inhibited */
-#define UNINHED          15          /* event - link uninhibited */
-#define UNINH_DEN        16          /* event - link uninhibit denied */
-#define CONG_LVL_1       17          /* event - congestion level 1 */
-#define CONG_LVL_2       18          /* event - congestion level 2 */
-#define CIR_OUT_ORD      19          /* event - cirquit out of order */
-#define CIRMGT_NORESP    20          /* event - no response to cirquit management message */
-#define CIR_INVAL        21          /* event - invalid circuit */
-#define CIR_VAL_FAIL     22          /* event - circuit validation failure */
-#define CIR_VAL_SUCC     23          /* event - circuit validation success */
-#define CIC_INVAL        24          /* event - invalid cic code */
-#define CONT_FAIL        25          /* event - continuity failed */
-#define CIR_UNEQUIP      49          /* event - circuit unequipped */
-#define RMT_BLKD         50          /* event - link remotely blocked */
-#define RMT_UNBLKD       51          /* event - link remotely unblocked */
-#define CIR_IN_SERV      52          /* event - circuit back in service */
-#define TERM_INIT_FAIL   53          /* event - terminal initialization failed */
-#define ERROR_LOG        54          /* event - software error logged */
-#define INV_EVENT        (ERROR_LOG + 1)   /* event - invalid */
-
-/* ss7 switch defines */
-
-/* #define SW_TST        0            switch - test */
-#define SW_CCITT         1           /* switch - ccitt */
-#define SW_ITU           1           /* switch - itu-t */
-#define SW_CCITT88       1           /* switch - ccitt 88 */
-#define SW_ANSI          2           /* switch - ansi */
-#define SW_ANSI88        2           /* switch - ansi 88 */
-#define SW_ANSI92        3           /* switch - ansi 92*/
-#define SW_CCITT92       4           /* switch - ccitt 92 */
-#define SW_SINGTEL       4           /* switch - singapore telecom */
-#define SW_Q767          5           /* switch - int'l isup q.767 */
-#define SW_CHINA         6           /* switch - china */
 
-/* for sccp3.2 */
-#define SW_JAPAN         7           /* switch - japan */
 
-\f
 #ifndef CMFILE_REORG_1
 
 /* defines for Q.93B */
  
 /* parameter values that are at management and at upper interface */
-/* switch defines */
-
-#define SW_ATMF_UNI30        0    /* switch - ATM Forum UNI v3.0 */
-#define SW_ATMF_UNI31        1    /* switch - ATM Forum UNI v3.1 */
-#define SW_IISP_UNI30        2    /* switch - Interim Inter-Switch Signalling Protocol */
-#define SW_IISP_UNI31        3    /* switch - Interim Inter-Switch Signalling Protocol */
-#define SW_Q2931             4    /* switch - ITU - 2931 */
-#define SW_ATMF_SIG_PNNI     5    /* switch - ATM Forum PNNI Signalling */
-#define SW_ATMF_UNI40        6    /* switch - ATM Forum UNI v4.0 */
-#define SW_ATMF_SIG_AINI     7    /* switch - ATM Forum AINI Signalling */
-#define SW_INVALID         0xff   /* switch - invalid value */
-/* information element id's */
-
-#define AM_ME_ETOETRANSDLY    0x42   /* End-to-End Transit Delay */
-#define AM_ME_CONNNMB         0x4c   /* Connected number */
-#define AM_ME_CONNSAD         0x4d   /* Connected Subaddress */
-#define AM_ME_TFCDESC         0x59   /* ATM Traffic Descriptor */
-#define AM_ME_BHILYRINFO      0x5d   /* Broadband High Layer Info */
-#define AM_ME_BLOLYRINFO      0x5f   /* Broadband Low Layer Info */
-#define AM_ME_CDPTYNMB        0x70   /* Called Party Number */
-#define AM_ME_CDPTYSAD        0x71   /* Called Party Sub Address */
-#define AM_ME_CDPTYSOFTPVC    0xe0   /* Called party soft PVPC/PVCC */
-#define AM_ME_CRANKBACK       0xe1   /* Crankback */
-#define AM_ME_DSGTRANLST      0xe2   /* Designated Transit list */
-#define AM_ME_CGPTYSOFTPVC    0xe3   /* Calling party soft PVPC/PVCC */
-#define AM_ME_MINACCTFCDESC   0x81   /* Minimum Acceptable Tfc. Desc. */
-#define AM_ME_ALTTFCDESC      0x82   /* Alternative ATM Tfc. Desc. */
-#define AM_ME_ABRSETUPPARAM   0x84   /* ABR Setup Parameters */
-#define AM_ME_ABRADDPARAM     0xe4   /* ABR Additional Parameters */
-#define AM_ME_EXTQOSPARAM     0xec   /* Extended Qos Parameter */
-
-/* information element idx's */
-
-#define AM_MEI_TFCDESC        0x06   /* ATM Traffic Descriptor */
-#define AM_MEI_BHILYRINFO     0x09   /* Broadband High Layer Info */
-#define AM_MEI_BLOLYRINFO     0x0b   /* Broadband Low Layer Info */
-#define AM_MEI_CDPTYNMB       0x12   /* Called Party Number */
-#define AM_MEI_CDPTYSAD       0x13   /* Called Party Sub Address */
-#define AM_MEI_CRANKBACK      0x1f   /* Crankback */
-#define AM_MEI_CDPTYSOFTPVC   0x20   /* Called Party Soft PVPC/PVCC */
-#define AM_MEI_CONNNMB        0x21   /* Connected number */
-#define AM_MEI_CONNSAD        0x22   /* Connected sub address */
-#define AM_MEI_DSGTRANLST     0x23   /* Designated Transit List */
-#define AM_MEI_CGPTYSOFTPVC   0x34   /* Calling Party Soft PVPC/PVCC */
-#define AM_UNKNOWN            0xfe   /* message type unknown */
-
 /* addressing related defines */
 
-/* numbering plan identification */
-#define AM_NMBPLN_UNK        0x00    /* unknown */
-#define AM_NMBPLN_ISDN       0x01    /* ISDN/telephony numbering plan (E.164) */
-#define AM_NMBPLN_NSAP       0x02    /* ISO NSAP */
-#define AM_NMBPLN_PVT        0x09    /* private */
-\f
-/* ATM address types */
-
-#define ATMADDR_TYPE_E164   AM_NMBPLN_ISDN   /* E.164 format */
-#define ATMADDR_TYPE_AESA   AM_NMBPLN_NSAP   /* ATM forum AESA format */
-
 /* maximum size of VCC table */
 #define MAX_ATMVCCTBL_SZ      16
 
 /* maximum number of ATM addresses in the ATM address table */
 #define  MAX_ATMADDRTBL_SZ    4
-
-/* type of number */
-#define AM_TYPNMB_UNK        0x00    /* unknown */
-#define AM_TYPNMB_INT        0x01    /* international */
-#define AM_TYPNMB_NAT        0x02    /* national */
-#define AM_TYPNMB_NSP        0x03    /* network specific */
-#define AM_TYPNMB_SUB        0x04    /* subscriber number */
-#define AM_TYPNMB_ABR        0x06    /* abbreviated   */
-/* screening indicator */
-#define AM_SCRIND_USRNOTSCR  0x00    /* user provided, not screened */
-#define AM_SCRIND_USRVERPASS 0x01    /* user provided, verified and passed */
-#define AM_SCRIND_USRVERFAIL 0x02    /* user provided, verified and failed */
-#define AM_SCRIND_NET        0x03    /* network provided */
-/* presentation indicator */
-#define AM_PRSIND_ALLOW      0x00    /* presentation allowed */
-#define AM_PRSIND_RESTRICT   0x01    /* presentation restricted */
-#define AM_PRSIND_NOTAVAIL   0x02    /* number not available */
-/* odd/even indicator */
-#define AM_OEIND_EVEN        0x00    /* even */
-#define AM_OEIND_ODD         0x01    /* odd */
-/* type of subaddress */
-#define AM_TYPSAD_NSAP       0x00    /* NSAP */
-#define AM_TYPSAD_USER       0x01    /* user specified - ATM Endsystem addr */
-#define AM_TYPSAD_USERSPEC   0x02    /* user specified */
  
 /* authority and format identifiers for OSI NSAP addresses */
-/* AFI for individual address */
-#define AFI_DCC        0x39  /* BCD format for ISO DCC */
-#define AFI_ICD        0x47  /* BCD format for ISO ICD */
-#define AFI_E164       0x45  /* BCD format for E.164 */
-
-/* AFI for group addresses */
-#define AFI_GRP_DCC    0xBD  /* BCD format for ISO DCC */
-#define AFI_GRP_ICD    0xC5  /* BCD format for ISO ICD */
-#define AFI_GRP_E164   0xC3  /* BCD format for E.164 */
-
+#if 0 
 /* low layer information - layer 2 id */
 
 #define AM_LLI_L2ID             2       /* layer 2 id */
 
 #define AM_EQP_ORG_USR    0x00  /* originating user */
 #define AM_EQP_ORG_INTNET 0x01  /* intermediate network */
-
 /* ABR Setup parameter identifiers */
 
 #define AM_ASP_FAICR_ID   0xC2  /* forward  ABR initial cell rate identifier */
 #define AM_ATC_ABR            0x0C   /* ABR */
 #define AM_ATC_RTVBRCLR       0x13   /* Real time VBR with CLR commitment on CLP=0+1 */
 
+#endif
 \f
 /* defines for UME */
 
 #define UM_MAXLEN_OBJ_ID     34      /* max length of an object-id */
-
+#if 0
 /* PNNI qos class definitions
  */
 #define PN_QOS_CLASS_UBR          0    /* unspecified */
 /* maximum number of ports per neighbor -- change if you expect more
  */
 #define PN_MAX_PORTS_NBR           5
+#endif
 
 /* Peer group and node identifier length */
 #define PN_PGID_LEN   14
 #define PN_NODEID_LEN 22
 
+#if 0
 /* maximum number of qos classes */
 #define PN_NUM_QOS_CLASSES        5
 
 #define AM_OTD_ETOEF5_0         0X00      /* 0% of FPCR/BPCR (CLP=0+1) */
 #define AM_OTD_ETOEF5_01        0x01      /* 0.1% of FPCR/BPCR (CLP=0+1) */
 #define AM_OTD_ETOEF5_1         0x04      /* 1% of FPCR/BPCR (CLP=0+1) */
+#endif
 #endif /* CMFILE_REORG_1 */
 
 /* degines for management confirms */
 #define LCM_REASON_INVALID_PAR_VAL      13   /* invalid parameter value */
 #define LCM_REASON_QINIT_FAIL           15   /* queue initialization failed */
 #define LCM_REASON_NEG_CFM              16   /* negative confirmation */
+#define LCM_REASON_HASHING_FAILED       20    /* Hashing failed */
+#if 0
 #define LCM_REASON_UPDTMR_EXPIRED       17   /* update timer expired */
 #define LCM_REASON_MISC_FAILURE         18    /* miscellaneous failures */
 #define LCM_REASON_EXCEED_CONF_VAL      19   /* Exceeds configured value */
-#define LCM_REASON_HASHING_FAILED       20    /* Hashing failed */
 #define LCM_REASON_PEERCFG_NOT_DONE     21   /* swft -peer sap not configured */
 #define LCM_REASON_PRTLYRCFG_NOT_DONE   22   /* swft -portable lyr not configured */
 /* common Distributed FT/HA related failure reasons */      
 #define LCM_REASON_INV_DIST_QUAL        29   /* Inv. qual. of dist type*/
 #define LCM_REASON_NAK_RCVD             30   /* Got a nak failure */
 #define LCM_REASON_TIMEOUT              31   /* Got a timeout failure  */
-#define LCM_REASON_PURE_FTHA            32   /* A req for Dist FTHA is recv 
-                                              * by a Pure FTHA mod */
+#define LCM_REASON_PURE_FTHA            32   /* A req for Dist FTHA is recv by a Pure FTHA mod */
 #define LCM_REASON_DIST_FTHA            33   /* A req for Pure FTHA is recv 
                                               * by a Dist FTHA mod */
 #define LCM_REASON_INV_KEY              34   /* Invalid key */
 #define LCM_REASON_DFL_SPC_DEL_NOT_ALLOWED    44  /* control request has got default spcs that configured in the network */
 #define LCM_REASON_NOTHING_TO_DELETE    45   /* control request has got zero spcs to delete */
 #define LCM_REASON_SPC_ALREADY_DELETED  46   /* spc's are already deleted */
-
 #define LCM_REASON_LYR_SPECIFIC         256   /* protocol specific reasons */
 
 /* gen_h_001.main_125- Addition - SUA support*/
 #define LCM_REASON_ASP_CONFIG          47   /* ASP Configuration Error */
 /* gen_h_001.main_142:Added new error type*/
 #define LCM_REASON_ULLOCK_INIT_FAILED  48   /* UL Lock creation Error */
+#endif
 
 /* category */
 #define LCM_CATEGORY_PROTOCOL           1     /* protocol related */
 
 /* events */
 #define LCM_EVENT_UI_INV_EVT            1   /* upper interface invalid event */
+#define LCM_EVENT_BND_FAIL              8   /* Bind failure */
+#define LCM_EVENT_BND_OK                11  /* bind ok  */
+#define LCM_EVENT_SMEM_ALLOC_FAIL       12  /* static memory alloc fail */
+#define LCM_EVENT_DMEM_ALLOC_FAIL       13  /* Dynamic mmemory alloc fail */
+
+#if 0
 #define LCM_EVENT_LI_INV_EVT            2   /* lower interface invalid event */
 #define LCM_EVENT_PI_INV_EVT            3   /* peer interface invalid event */
 #define LCM_EVENT_INV_EVT               4   /* general invalid event */
 #define LCM_EVENT_INV_STATE             5   /* invalid internal state */
 #define LCM_EVENT_INV_TMR_EVT           6   /* invalid timer event */
 #define LCM_EVENT_MI_INV_EVT            7   /* mngmnt interface invalid event */
-#define LCM_EVENT_BND_FAIL              8   /* Bind failure */
 #define LCM_EVENT_NAK                   9   /* destination naked a request */
 #define LCM_EVENT_TIMEOUT               10  /* timeout when waiting for reply */
-#define LCM_EVENT_BND_OK                11  /* bind ok  */
-#define LCM_EVENT_SMEM_ALLOC_FAIL       12  /* static memory alloc fail */
-#define LCM_EVENT_DMEM_ALLOC_FAIL       13  /* Dynamic mmemory alloc fail */
 /*Alarms for distributed FTHA environment*/
 #define LCM_EVENT_SEQERR                14  /* seq error (standby) */
 #define LCM_EVENT_OOM                   15  /* board mem threshold exceeded */
 #define LCM_EVENT_UPDMSG_ERR            16  /* update message decode error */
 #define LCM_EVENT_HTBT_EXP              17  /* Heartbeat timer expiry */
 #define LCM_EVENT_TRANSLATION_FAILURE   18  /* primitive translation failure */
+#endif
 /*gen_h_001.main_137:Moved Events for alarm indication at various Dns Events to lso.h*/
 
 #define LCM_EVENT_LYR_SPECIFIC          256   /* protocol specific events */
 #define LCM_CAUSE_MGMT_INITIATED        8     /* mgmt initiated */
 #define LCM_CAUSE_INV_STATE             9     /* Invalid state */
 #define LCM_CAUSE_TMR_EXPIRED           10    /* Invalid state */
-#define LCM_CAUSE_INV_MSG_LENGTH        11    /* Invalid state */
 #define LCM_CAUSE_PROT_NOT_ACTIVE       12    /* protocol layer not active */
 #define LCM_CAUSE_INV_PAR_VAL           13    /* invalid parameter value */
 #define LCM_CAUSE_NEG_CFM               14    /* negative confirmation */
 #define LCM_CAUSE_MEM_ALLOC_FAIL        15    /* memory allocation failure */
+#if 0
+#define LCM_CAUSE_INV_MSG_LENGTH        11    /* Invalid state */
 #define LCM_CAUSE_HASH_FAIL             16    /* hashing failure */
 #define LCM_CAUSE_VERSION_MISMATCH      17    /* interface version mismatch */
 #define LCM_CAUSE_SWVER_NAVAIL          18    /* intf ver not found */
 #define LCM_CAUSE_INV_ACTION            20    /* Invalid Control Action */
 /* gen_h_001.main_129  - defined new cause */
 #define LCM_CAUSE_NETWK_INITIATED       21    /* user initiated */
+#endif
 #define LCM_CAUSE_LYR_SPECIFIC          256   /* protocol specific causes */
 
+#if 0
 /* Interface identifier names for rolling upgrade. Each of the product *
  * interface is given a unique number */
 /* Layer management interface identifiers */
 #define HWPIF   272     /* eGTP-C PSF peer interface ID     */
 /* gen_h_001.main_141: Added the interface version for PSF DIAMETER */
 #define JCPIF   273     /* PSF DIAMETER peer interface ID       */
+#endif
 
-/* Maximum no.of interfaces a product a support on the upper/lower interface */
-#define MAX_INTF                 2       /* Max intf to a usr/prov */
-
-/* defines for SCCP ISNI and INS routing */
-#define MAX_ISNI_NID     0x07      /* Maximum no. of NIDs is ISNI */
-#define MAX_INS_NID      0x02      /* Maximum no. of NIDs in INS */
-
-\f
-/* defines for mode */
-
-#define LOOPBACK_MODE        0       /* loopback mode */
-#define TESTING_MODE         1       /* testing mode */
-#define HARDWARE_MODE        2       /* hardware mode */
 
 /* bind status */
 #define CM_BND_OK            1       /* bind request OK */
index 5ea39ab..25ebfd0 100755 (executable)
@@ -18,7 +18,7 @@
 \f
 /********************************************************************20**
   
-        Name:     LTE-RLC Layer 
+        Name:     NR RLC Layer 
     
         Type:     C source file
   
index bc519f9..b6b4aeb 100755 (executable)
@@ -359,7 +359,7 @@ typedef struct rlcL2MeasCfmEvt
 
 #endif /* LTE_L2_MEAS */
 
-/* Control primitives towards LTE RLC */
+/* Control primitives towards NR RLC */
 /* Pointer functions to pack/unpack primitives */
 typedef uint8_t (*RlcConfigReq)   ARGS((Pst *pst, RlcMngmt *cfg));
 typedef uint8_t (*RlcConfigCfm)   ARGS((Pst *pst, RlcMngmt *cfgCfm));
index a021724..430e23a 100644 (file)
@@ -268,7 +268,6 @@ uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp)
 {
    return ROK;
 }
-
 /*******************************************************************
  *
  * @brief Pack and Send BSR from MAC to SCH
@@ -356,6 +355,109 @@ uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg  *ueCfg)
    return ROK;
 }
 
+/*******************************************************************
+*
+* @brief Pack and Send UE Delete Request from MAC to SCH
+*
+* @details
+*
+*    Function : packMacSchUeDeleteReq 
+*
+*    Functionality:
+*       Pack and Send  UE Delete Request from MAC to SCH
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packMacSchUeDeleteReq(Pst *pst,  SchUeDelete *schUeDel)
+{
+    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
+    {
+       /* TODO */
+    }
+    else
+    {
+       return RFAILED;
+    }
+    return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Packs and send UE delete response
+*
+* @details
+*
+*    Function : packSchUeDeleteRsp
+*
+*    Functionality:
+*      Packs and send UE delete response
+*
+* @params[in] Post structure
+*             UE delete response
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp  *delRsp)
+{
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and Send Cell Delete Request from MAC to SCH
+ *
+ * @details
+ *
+ *    Function : packMacSchCellDeleteReq
+ *
+ *    Functionality:
+ *       Pack and Send  Cell Delete Request from MAC to SCH
+ *
+ * @params[in] Pst *pst,  SchCellDelete *schCellDelete
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacSchCellDeleteReq(Pst *pst,  SchCellDelete *schCellDelete)
+{
+   if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
+   {
+      /* TODO */
+   }
+   else
+   {
+      return RFAILED;
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and send CELL delete response
+ *
+ * @details
+ *
+ *    Function : packSchCellDeleteRsp
+ *
+ *    Functionality:
+ * * @params[in] Post structure, SchCellDeleteRsp schCellDeleteRsp
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *
+ * ****************************************************************/
+
+uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp  *schCellDeleteRsp)
+{
+   return ROK;
+}
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 80ef9bf..285d200 100644 (file)
 #define EVENT_UCI_IND_TO_SCH         12
 #define EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH 13
 #define EVENT_UE_RECONFIG_RSP_TO_MAC 14
+#define EVENT_UE_DELETE_REQ_TO_SCH   15
+#define EVENT_UE_DELETE_RSP_TO_MAC   16
+#define EVENT_CELL_DELETE_REQ_TO_SCH   17
+#define EVENT_CELL_DELETE_RSP_TO_MAC   18
 
 
 /*macros*/
 #define MAX_SR_BITS_IN_BYTES       1
 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
 /* can we have a common numslot numscs between mac sch */
+#ifdef NR_TDD
+#define MAX_SLOTS 20
+#else
 #define MAX_SLOTS 10
+#endif
 #define MAX_SFN   1024
 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
 #define MAX_NUM_TAGS 4                  /* Max number of timing advance groups */
@@ -121,6 +129,13 @@ typedef enum
    SR_PROHIBIT_MS128
 }SchSrProhibitTimer;
 
+typedef enum
+{
+   NOT_APPLICABLE,
+   INVALID_CELLID,
+   INVALID_UEIDX
+}ErrorCause;
+
 typedef enum
 {
    SR_TRANS_MAX_N4,
@@ -444,7 +459,7 @@ typedef struct dmrsInfo
 typedef struct pdschFreqAlloc
 {
    uint8_t  resourceAllocType;
-   /* since we are using type-1, hence rbBitmap excluded */
+   /* since we are using type-1, rbBitmap excluded */
    FreqDomainAlloc freqAlloc;
    uint8_t  vrbPrbMapping;
 } PdschFreqAlloc;
@@ -530,7 +545,6 @@ typedef struct
 {
    /* parameters recieved from DU-APP */
    uint16_t sib1PduLen;
-   uint16_t sib1NewTxPeriod;
    uint16_t sib1RepetitionPeriod;
    uint8_t  coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
    uint8_t  searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
@@ -1452,6 +1466,32 @@ typedef struct schUeCfgRsp
    SchFailureCause cause;
 }SchUeCfgRsp;
 
+typedef struct schUeDelete
+{
+   uint16_t   cellId;
+   uint16_t   crnti;
+}SchUeDelete;
+
+typedef struct schUeDeleteRsp
+{
+   uint16_t   cellId;
+   uint16_t   crnti;
+   SchMacRsp  rsp;
+   ErrorCause cause;
+}SchUeDeleteRsp;
+
+typedef struct schCellDelete 
+{
+   uint16_t   cellId;
+}SchCellDelete;
+
+
+typedef struct schCellDeleteRsp
+{
+   uint16_t   cellId;
+   SchMacRsp  rsp;
+}SchCellDeleteRsp;
+
 typedef struct dataVolInfo
 {
    uint8_t  lcgId;
@@ -1539,6 +1579,22 @@ typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
         Pst         *pst,           /* Post structure */
         SchUeCfgRsp *cfgRsp));       /* Scheduler UE Cfg response */
 
+typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
+   Pst         *pst,           /* Post structure */
+   SchUeDelete *schUeDel)); /*Scheduler UE Del*/
+
+typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
+   Pst          *pst,           /* Post structure */
+   SchUeDeleteRsp *delRsp));       /* Scheduler UE delete response */
+
+typedef uint8_t (*MacSchCellDeleteReqFunc) ARGS((
+   Pst         *pst,           /* Post structure */
+   SchCellDelete *schCellDelete)); /*Scheduler UE Del*/
+
+typedef uint8_t (*SchCellDeleteRspFunc) ARGS((
+   Pst          *pst,           /* Post structure */
+   SchCellDeleteRsp *schCellDeleteRsp));       /* Scheduler UE delete response */
+
 /* function declarations */
 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo  *dlSchedInfo);
@@ -1573,6 +1629,14 @@ uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
+uint8_t packMacSchUeDeleteReq(Pst *pst,  SchUeDelete *schUeDel);
+uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete);
+uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp  *delRsp);
+uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
+uint8_t packMacSchCellDeleteReq(Pst *pst,  SchCellDelete *schCellDelete);
+uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete  *schCellDelete);
+uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp  *schCellDeleteRsp);
+uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
 
 /**********************************************************************
   End of file
index 8ede3ef..ed7194f 100644 (file)
 #define DMRS_ADDITIONAL_POS  0          /* DMRS Additional poistion */
 #define RES_ALLOC_TYPE       1          /* Resource allocation type */
 #define FIVE_QI_VALUE 9  /*spec 23.501, Table 5.7.4-1*/
-
 /*******************************************************************
 *
 * @brief Sends F1 msg over SCTP
@@ -7356,6 +7355,247 @@ uint8_t BuildAndSendUeContextModificationReq()
 
    }
    FreeUeContextModicationRequest(f1apMsg);
+   return ret;
+}
+/*****************************************************************i
+*
+* @brief Free memory allocated for UE Context Release Command  
+*
+* @details
+*
+*    Function : FreeUeContextReleaseCommand
+*
+*    Functionality:
+*         - Free memory allocated for UE Context Release Command 
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* *************************************************************/
+void FreeUeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextReleaseCommand_t *ueReleaseCommand = NULLP;
+
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.initiatingMessage)
+      {
+         ueReleaseCommand =&f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+         if(ueReleaseCommand->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueReleaseCommand->protocolIEs.list.count; ieIdx++)
+            {
+               CU_FREE(ueReleaseCommand->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseCommand_t));
+            }
+            CU_FREE(ueReleaseCommand->protocolIEs.list.array, ueReleaseCommand->protocolIEs.list.size);
+         }
+         CU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      }
+      CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+}
+/*******************************************************************
+ *
+ * @brief Builds the Ue Context Release Command 
+ *
+ * @details
+*
+*    Function : BuildAndSendUeContextReleaseCommand
+*
+*    Functionality: Constructs the Ue Context Release Command 
+*
+* @params[in]
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendUeContextReleaseCommand(uint8_t cuUeF1apId, uint8_t duUeF1apId)
+{
+   bool       memAllocFailed = false;
+   uint8_t    ieIdx = 0,elementCnt = 0, ret = RFAILED, bufLen=0;
+   F1AP_PDU_t *f1apMsg = NULLP;
+   UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+   asn_enc_rval_t         encRetVal;
+   DU_LOG("\nINFO  -->  F1AP : Building Ue context release command\n");
+
+   while(true)
+   {
+      CU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseCommand(): Memory allocation for F1AP-PDU");
+         break;
+      }
+
+      f1apMsg->present =  F1AP_PDU_PR_initiatingMessage;
+
+      CU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      if(f1apMsg->choice.initiatingMessage == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseCommand(): Memory allocation for F1AP-PDU failed ");
+         break;
+      }
+      f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_UEContextRelease;
+      f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
+      f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_UEContextReleaseCommand;
+
+      ueContextReleaseCommand =&f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+
+      elementCnt = 4;
+      ueContextReleaseCommand->protocolIEs.list.count = elementCnt;
+      ueContextReleaseCommand->protocolIEs.list.size = elementCnt*sizeof(UEContextReleaseCommand_t*);
+
+      /* Initialize the UE context modification members */
+      CU_ALLOC(ueContextReleaseCommand->protocolIEs.list.array, ueContextReleaseCommand->protocolIEs.list.size);
+      if(ueContextReleaseCommand->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseCommand():Memory allocation failed");
+         break;
+      }
+
+      for(ieIdx=0 ; ieIdx<elementCnt; ieIdx++)
+      {
+         CU_ALLOC(ueContextReleaseCommand->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseCommand_t));
+         if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseCommand(): Memory allocation failed ");
+            memAllocFailed = true;  
+            break;
+         }
+      }
+      
+      if(memAllocFailed == true)
+      {
+         break;
+      }
+      ieIdx=0;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID =cuUeF1apId;
+
+      ieIdx++;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present=\
+      UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =duUeF1apId;
+
+      ieIdx++;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_Cause;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present=\
+      UEContextReleaseCommandIEs__value_PR_Cause;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.Cause.present = Cause_PR_radioNetwork;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.Cause.choice.radioNetwork=\
+      CauseRadioNetwork_normal_release;
+     
+      /* RRC Container for RRC release */
+      ieIdx++;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_RRCContainer;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseCommandIEs__value_PR_RRCContainer;
+      char secModeBuf[7]={ 0x00, 0x05, 0x13, 0x00, 0x00, 0x00, 0x00};
+      bufLen =7;
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size = bufLen;
+      CU_ALLOC(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf,
+      ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
+      if(!ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
+      {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation for BuildAndSendUeContextSetupReq failed");
+      break;
+      }
+      memset(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, 0, bufLen);
+      memcpy(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, secModeBuf, bufLen);
+      
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the UE Context Release Command type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
+            encBuf);
+
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Could not encode Release Command structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG  -->  F1AP : Created APER encoded buffer for Ue Context Release Command\n");
+         for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+         {
+            DU_LOG("%x",encBuf[ieIdx]);
+         }
+      }
+
+      if(SendF1APMsg(CU_APP_MEM_REG, CU_POOL) != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending Ue context Release Command failed");
+         break;
+      }
+
+      ret = ROK;
+      break;
+
+   }
+   FreeUeContextReleaseCommand(f1apMsg);
+   return ret;
+}
+/*******************************************************************
+*
+* @brief process Ue context release request 
+*
+* @details
+*
+*    Function : procUeContextReleaseReq 
+*
+*    Functionality:
+*         - process Ue context release request 
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t procUeContextReleaseReq(F1AP_PDU_t *f1apMsg) 
+{
+   uint8_t ieIdx=0, duUeF1apId=0,cuUeF1apId=0;
+
+   UEContextReleaseRequest_t *ueReleaseReq = NULLP;
+   ueReleaseReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
+   
+   for(ieIdx=0; ieIdx < ueReleaseReq->protocolIEs.list.count; ieIdx++)
+   {
+      switch(ueReleaseReq->protocolIEs.list.array[ieIdx]->id)
+      {
+         case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+            {
+               cuUeF1apId = ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
+               break;
+            }
+         case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+            {
+               duUeF1apId = ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+               break;
+            }
+         default:
+              break;
+      }
+   }
+   if(BuildAndSendUeContextReleaseCommand(cuUeF1apId, duUeF1apId) != ROK)
+   {
+      DU_LOG("\nERROR  -->  F1AP : procUeContextReleaseReq(): Failed to build Ue Context Release Command ");
+      return RFAILED;
+   }
    return ROK;
 }
 /*******************************************************************
@@ -7427,93 +7667,104 @@ void F1APMsgHdlr(Buffer *mBuf)
    switch(f1apMsg->present)
    {
       case F1AP_PDU_PR_initiatingMessage:
-        {
-           switch(f1apMsg->choice.initiatingMessage->value.present)
-           {
-              case InitiatingMessage__value_PR_Reset:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : F1 reset request received ");
-                    BuildAndSendF1ResetAck();
-                    break;
-                 }
-
-              case InitiatingMessage__value_PR_F1SetupRequest:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : F1 setup request received");
-                    BuildAndSendF1SetupRsp();
-                    break;
-                 }
-
-              case InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : GNB-DU config update received");
-                    BuildAndSendDUUpdateAck();
-                    DU_LOG("\nINFO  -->  F1AP : Sending F1 reset request");
-                    BuildAndSendF1ResetReq();
-                    break;
-                 }
-              case InitiatingMessage__value_PR_InitialULRRCMessageTransfer:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : Received InitialULRRCMessageTransfer");
-                    procInitULRRCMsg(f1apMsg);
-                    break;
-                 }
-              case InitiatingMessage__value_PR_ULRRCMessageTransfer:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : Received ULRRCMessageTransfer");
-                    procUlRrcMsg(f1apMsg);
-                    break;
-                 }
-
-              case InitiatingMessage__value_PR_RRCDeliveryReport:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : Received RRC delivery report");
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  F1AP : Invalid type of intiating message [%d]",\
-                    f1apMsg->choice.initiatingMessage->value.present);
-                    return;
-                 }
-           }/* End of switch(initiatingMessage) */
-           break;
-        }
+         {
+            switch(f1apMsg->choice.initiatingMessage->value.present)
+            {
+               case InitiatingMessage__value_PR_Reset:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : F1 reset request received ");
+                     BuildAndSendF1ResetAck();
+                     break;
+                  }
+
+               case InitiatingMessage__value_PR_F1SetupRequest:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : F1 setup request received");
+                     BuildAndSendF1SetupRsp();
+                     break;
+                  }
+
+               case InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : GNB-DU config update received");
+                     BuildAndSendDUUpdateAck();
+                     DU_LOG("\nINFO  -->  F1AP : Sending F1 reset request");
+                     BuildAndSendF1ResetReq();
+                     break;
+                  }
+               case InitiatingMessage__value_PR_InitialULRRCMessageTransfer:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : Received InitialULRRCMessageTransfer");
+                     procInitULRRCMsg(f1apMsg);
+                     break;
+                  }
+               case InitiatingMessage__value_PR_ULRRCMessageTransfer:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : Received ULRRCMessageTransfer");
+                     procUlRrcMsg(f1apMsg);
+                     break;
+                  }
+
+               case InitiatingMessage__value_PR_RRCDeliveryReport:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : Received RRC delivery report");
+                     break;
+                  }
+               case InitiatingMessage__value_PR_UEContextReleaseRequest:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : Received UE Context Release Request");
+                     procUeContextReleaseReq(f1apMsg);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  F1AP : Invalid type of intiating message [%d]",\
+                           f1apMsg->choice.initiatingMessage->value.present);
+                     return;
+                  }
+            }/* End of switch(initiatingMessage) */
+            break;
+         }
 
       case F1AP_PDU_PR_successfulOutcome:
-        {
-           switch(f1apMsg->choice.successfulOutcome->value.present)
-           {
-              case SuccessfulOutcome__value_PR_ResetAcknowledge:
-                 {
-                    DU_LOG("\nINFO  -->  F1Reset Acknowledgement is received successfully ");
-                    break;
-                 }
-              case SuccessfulOutcome__value_PR_UEContextSetupResponse:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : UE ContextSetupResponse received");
-                    f1apMsgDb.dlRrcMsgCount++; /* keeping DL RRC Msg Count */
-                    break;
-                 }
-              case SuccessfulOutcome__value_PR_UEContextModificationResponse:
-                 {
-                    DU_LOG("\nINFO  -->  F1AP : UE Context Modification Response received");
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  F1AP : Invalid type of successful outcome message [%d]",\
-                          f1apMsg->choice.successfulOutcome->value.present);
-                    return;
-                 }
-           }/* End of switch(successfulOutcome) */
-           break;
-        } 
+         {
+            switch(f1apMsg->choice.successfulOutcome->value.present)
+            {
+               case SuccessfulOutcome__value_PR_ResetAcknowledge:
+                  {
+                     DU_LOG("\nINFO  -->  F1Reset Acknowledgement is received successfully ");
+                     break;
+                  }
+               case SuccessfulOutcome__value_PR_UEContextSetupResponse:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : UE ContextSetupResponse received");
+                     f1apMsgDb.dlRrcMsgCount++; /* keeping DL RRC Msg Count */
+                     break;
+                  }
+               case SuccessfulOutcome__value_PR_UEContextModificationResponse:
+                  {
+                     DU_LOG("\nINFO  -->  F1AP : UE Context Modification Response received");
+                     break;
+                  }
+               case SuccessfulOutcome__value_PR_UEContextReleaseComplete:
+                  {
+                      DU_LOG("\nINFO  -->  F1AP : UE Context release complete received");
+                      break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  F1AP : Invalid type of successful outcome message [%d]",\
+                           f1apMsg->choice.successfulOutcome->value.present);
+                     return;
+                  }
+            }/* End of switch(successfulOutcome) */
+            break;
+         } 
       default:
-        {
-           DU_LOG("\nERROR  -->  F1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
-           return;
-        }
+         {
+            DU_LOG("\nERROR  -->  F1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
+            return;
+         }
    }/* End of switch(f1apMsg->present) */
 
 } /* End of F1APMsgHdlr */
index 776a02b..002113e 100644 (file)
@@ -76,6 +76,7 @@ typedef struct f1apDb
 F1apMsgDb f1apMsgDb;
 void F1APMsgHdlr(Buffer *mBuf);
 uint8_t BuildAndSendUeContextModificationReq();
+uint8_t BuildAndSendUeContextReleaseCommand(uint8_t cuUeF1apId, uint8_t duUeF1apId);
 /**********************************************************************
          End of file
 **********************************************************************/
index c61f548..f4da32f 100644 (file)
@@ -269,7 +269,6 @@ uint8_t readMacCfg()
    DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
    memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
         duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
-   duCfgParam.macCellCfg.sib1Cfg.sib1NewTxPeriod = SIB1_NEW_TX_PERIOD;
    duCfgParam.macCellCfg.sib1Cfg.sib1RepetitionPeriod = SIB1_REPETITION_PERIOD;
    duCfgParam.macCellCfg.sib1Cfg.coresetZeroIndex = CORESET_0_INDEX;
    duCfgParam.macCellCfg.sib1Cfg.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
@@ -620,8 +619,12 @@ uint8_t readCfg()
 
    /* Mib Params */
    mib.sysFrmNum = SYS_FRAME_NUM;
+#ifdef NR_TDD
+   mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120;
+#else
    mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
-   mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; 
+#endif
+   mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; //Kssb
    mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
    mib.controlResourceSetZero = CORESET_0_INDEX;
    mib.searchSpaceZero = SEARCHSPACE_0_INDEX;
index 056c804..2a2b1ab 100644 (file)
@@ -65,7 +65,7 @@
 #define PLMN_MNC2 0
 #define PLMN_SIZE 3
 
-/* Spec 30.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */
+/* Spec 38.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */
 #define SUL_ARFCN 100
 #define SUL_BAND 2
 
index 03befe8..3b77996 100644 (file)
@@ -908,6 +908,8 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    ODU_REM_PRE_MSG(&tmpByte[1], mBuf);
    ODU_REM_PRE_MSG(&tmpByte[2], mBuf);
    msgLen = (tmpByte[1] << 8) | tmpByte[2];
+   UNUSED(msgLen);
+   UNUSED(version);
    //DU_LOG("\nDEBUG   -->  EGTP : msgLen %d", msgLen);
 
 
index 0357523..4975304 100644 (file)
 #include "UPTransportLayerInformation.h"
 #include "GTPTunnel.h"
 
-DuCfgParams duCfgParam;
+#ifdef O1_ENABLE
+
+#include "Config.h"
+extern StartupConfig g_cfg;
 
+#endif
+
+DuCfgParams duCfgParam;
 /************************************************************************
  *
  * @brief Converts enum values into actual value of Poll retransmit timer
@@ -1196,7 +1202,7 @@ uint8_t BuildRrcVer(RRC_Version_t *rrcVer)
  *
  * @details
  *
- *    Function : SendF1APMsg
+ *    Function : sendF1APMsg
  *
  *    Functionality: Sends F1 msg over SCTP
  *
@@ -1206,11 +1212,11 @@ uint8_t BuildRrcVer(RRC_Version_t *rrcVer)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t SendF1APMsg(Region region, Pool pool)
+uint8_t sendF1APMsg()
 {
    Buffer *mBuf = NULLP;
   
-   if(ODU_GET_MSG_BUF(region, pool, &mBuf) == ROK)
+   if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
    {
       if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK)
       {
@@ -1237,7 +1243,7 @@ uint8_t SendF1APMsg(Region region, Pool pool)
       return RFAILED;
    }
    return ROK; 
-} /* SendF1APMsg */
+} /* sendF1APMsg */
 
 /*******************************************************************
  *
@@ -1689,7 +1695,7 @@ uint8_t BuildAndSendF1SetupReq()
       }
 
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Setup request failed");
         break;
@@ -2492,7 +2498,7 @@ uint8_t BuildAndSendDUConfigUpdate()
         }
       }
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending GNB-DU Config Update failed");
         break;
@@ -2696,7 +2702,7 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId, \
       }
 
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL)        !=      ROK)
+      if(sendF1APMsg() !=      ROK)
       {
         DU_LOG("\nERROR  -->   F1AP : Sending  UL RRC Message Transfer Failed");
         break;
@@ -5893,7 +5899,7 @@ uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti
         }
       }
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending Initial UL RRC Message Transfer Failed");
         ret = RFAILED;
@@ -7166,7 +7172,11 @@ uint8_t extractUpTnlInfo(uint8_t drbId, uint8_t configType,\
 
    upTnlInfo->drbId = drbId; 
    upTnlInfo->configType = configType;
+#ifdef O1_ENABLE
+   cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du);
+#else
    cmInetAddr((char *)DU_IP_V4_ADDR, &ipv4_du);
+#endif
 
    for(tnlIdx=0; tnlIdx < tnlInfo->list.count; tnlIdx++)
    {
@@ -9281,7 +9291,7 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
  * ****************************************************************/
 void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap)
 {
-   UE_NR_Capability_t *ueNrCap;
+   UE_NR_Capability_t *ueNrCap=NULLP;
 
    if(ueCap)
       ueNrCap = (UE_NR_Capability_t *)ueCap;
@@ -10580,7 +10590,7 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
       }
 
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL)        != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Setup Response failed");
         ret = RFAILED;
@@ -10782,7 +10792,7 @@ uint8_t BuildAndSendF1ResetReq()
         }
       }
 
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Reset request failed");
         break;
@@ -10935,7 +10945,7 @@ uint8_t BuildAndSendF1ResetAck()
         }
       }
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Reset Acknowledgement failed");
         break;
@@ -11202,7 +11212,7 @@ uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
       }
 
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending RRC delivery  msg request failed");
         break;
@@ -11930,7 +11940,7 @@ uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId)
       }
 
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
          DU_LOG("\nERROR  -->  F1AP : Sending UE Context Setup Res Failed");
          ret = RFAILED;
@@ -11940,7 +11950,6 @@ uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId)
    }
    FreeUeContextModResp(f1apMsg);
    return ret;
-
 }
 /*******************************************************************
  *
@@ -12276,6 +12285,436 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
    return ret; 
 }
 /*****************************************************************i
+*
+* @brief Free memory allocated for UE Context Release Request
+*
+* @details
+*
+*    Function : FreeUeContextReleaseReq
+*
+*    Functionality:
+*         - Free memory allocated for UE Context Release Request
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void 
+*
+* *************************************************************/
+void FreeUeContextReleaseReq(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextReleaseRequest_t *ueReleaseReq = NULLP;
+   
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.initiatingMessage)
+      {
+         ueReleaseReq =&f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
+         if(ueReleaseReq->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueReleaseReq->protocolIEs.list.count; ieIdx++)
+            {
+               DU_FREE(ueReleaseReq->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseRequest_t));
+            }
+            DU_FREE(ueReleaseReq->protocolIEs.list.array, ueReleaseReq->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      }
+      DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+
+}
+/*****************************************************************i
+*
+* @brief Build and Send UE Context Release Request  
+*
+* @details
+*
+*    Function : BuildAndSendUeContextReleaseReq
+*
+*    Functionality:
+*         - Build and Send UE Context Release Request 
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* *************************************************************/
+uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx)
+{
+   bool memAllocFail = false;
+   uint8_t ieIdx =0;
+   uint8_t ret = RFAILED;
+   uint16_t cellIdx =0;
+   uint16_t crnti = 0;
+   uint8_t  elementCnt = 0;
+   uint32_t  gnbCuUeF1apId =0;   /* gNB-CU UE F1AP Id */
+   uint32_t  gnbDuUeF1apId =0;   /* gNB-DU UE F1AP Id */
+   asn_enc_rval_t encRetVal; 
+   F1AP_PDU_t *f1apMsg = NULLP;
+   UEContextReleaseRequest_t *ueReleaseReq = NULLP;
+
+   DU_LOG("\nINFO  --> Building the UE Context Release Request");
+   do
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for f1apMsg");
+         break;
+      }
+
+      f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+      DU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      if(f1apMsg->choice.initiatingMessage == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for\
+         initiatingMessage");   
+         break;
+      }
+      f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_UEContextReleaseRequest;
+      f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
+      f1apMsg->choice.initiatingMessage->value.present = \
+      InitiatingMessage__value_PR_UEContextReleaseRequest;
+
+      ueReleaseReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
+
+      elementCnt = 2;
+
+      ueReleaseReq->protocolIEs.list.count = elementCnt;
+      ueReleaseReq->protocolIEs.list.size = elementCnt * sizeof(UEContextReleaseRequest_t *);
+
+      /* Initialize the F1Setup members */
+      DU_ALLOC(ueReleaseReq->protocolIEs.list.array,ueReleaseReq->protocolIEs.list.size);
+      if(ueReleaseReq->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for IE array");
+         break;
+      }
+      for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+      {
+         DU_ALLOC(ueReleaseReq->protocolIEs.list.array[ieIdx],\
+               sizeof(UEContextReleaseRequest_t));
+         if(ueReleaseReq->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for IE elements");
+            memAllocFail = true;  
+            break;
+         }
+      }
+      if(memAllocFail == true)
+         break;
+
+      /* Fetching Ue Cb Info*/
+      GET_CELL_IDX(cellId, cellIdx);
+      if(duCb.actvCellLst[cellIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): CellId[%d] does not exist", cellId);
+         break;
+      }
+      else
+      {
+         GET_CRNTI(crnti, ueIdx);
+         if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].crnti != crnti)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): crnti[%d] does not exist", crnti);
+            break;
+         }
+         gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+         gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+      }
+
+      ieIdx=0; 
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; 
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID =gnbCuUeF1apId;
+      
+      ieIdx++;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =gnbDuUeF1apId;
+      
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the F1SetupRequest type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Could not encode UEContextReleaseRequest structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseRequest\n");
+         for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
+      }
+
+      /* Sending msg */
+      if(sendF1APMsg() != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Release Request failed");
+         break;
+      }
+      ret = ROK;
+      break;
+   }while(true);
+
+   FreeUeContextReleaseReq(f1apMsg);
+   return ret;
+}
+/*****************************************************************i
+ *
+ * @brief Free memory allocated for UE Context Release Complete
+ *
+ * @details
+ *
+ *    Function : FreeUeContextReleaseComplete
+ *
+ *    Functionality:
+ *         - Free memory allocated for UE Context Release Complete
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ * @return void
+ *
+ * *************************************************************/
+void FreeUeContextReleaseComplete(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextReleaseComplete_t *ueReleaseComplete = NULLP;
+
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.successfulOutcome)
+      {
+         ueReleaseComplete =&f1apMsg->choice.successfulOutcome->value.choice.UEContextReleaseComplete;
+         if(ueReleaseComplete->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueReleaseComplete->protocolIEs.list.count; ieIdx++)
+            {
+               DU_FREE(ueReleaseComplete->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseComplete_t));
+            }
+            DU_FREE(ueReleaseComplete->protocolIEs.list.array, ueReleaseComplete->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      }
+      DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+
+}
+/*****************************************************************i
+ *
+ * @brief Build and Send UE Context Release Complete
+ *
+ * @details
+ *
+ *    Function : BuildAndSendUeContextReleaseComplete
+ *
+ *    Functionality:
+ *         - Build and Send UE Context Release Complete
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * *************************************************************/
+uint8_t BuildAndSendUeContextReleaseComplete(uint32_t  gnbCuUeF1apId, uint32_t  gnbDuUeF1apId)
+{
+   bool memAllocFail = false;
+   uint8_t ieIdx =0, ret = RFAILED, elementCnt = 0;
+   asn_enc_rval_t encRetVal;
+   F1AP_PDU_t *f1apMsg = NULLP;
+   UEContextReleaseComplete_t *ueReleaseComplete = NULLP;
+
+   DU_LOG("\nINFO  --> Building the UE Context Release Complete");
+   do
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for f1apMsg");
+         break;
+      }
+
+      f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
+      DU_ALLOC(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      if(f1apMsg->choice.successfulOutcome == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for\
+               successfulOutcome");
+         break;
+      }
+      f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_UEContextRelease;
+      f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+      f1apMsg->choice.successfulOutcome->value.present = \
+      SuccessfulOutcome__value_PR_UEContextReleaseComplete;
+
+      ueReleaseComplete = &f1apMsg->choice.successfulOutcome->value.choice.UEContextReleaseComplete;
+
+      elementCnt = 2;
+      ueReleaseComplete->protocolIEs.list.count = elementCnt;
+      ueReleaseComplete->protocolIEs.list.size = elementCnt * sizeof(UEContextReleaseComplete_t *);
+
+      /* Initialize the UE Release Complete members */
+      DU_ALLOC(ueReleaseComplete->protocolIEs.list.array,ueReleaseComplete->protocolIEs.list.size);
+      if(ueReleaseComplete->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for IE array");
+         break;
+      }
+      for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+      {
+         DU_ALLOC(ueReleaseComplete->protocolIEs.list.array[ieIdx],\
+               sizeof(UEContextReleaseComplete_t));
+         if(ueReleaseComplete->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for IE\
+            elements");
+            memAllocFail = true;
+            break;
+         }
+      }
+      if(memAllocFail == true)
+         break;
+
+
+      ieIdx=0;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID =gnbCuUeF1apId;
+
+      ieIdx++;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =gnbDuUeF1apId;
+
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the F1SetupComplete type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Could not encode UEContextReleaseComplete structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseComplete\n");
+         for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
+      }
+
+      /* Sending msg */
+      if(sendF1APMsg() != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Release Complete failed");
+         break;
+      }
+      ret = ROK;
+      break;
+   }while(true);
+
+   FreeUeContextReleaseComplete(f1apMsg);
+   return ret;
+
+   /*TODO: To add trigger for UE context release complete, once the operations of UE context
+    * release command are done*/
+}
+/*******************************************************************
+*
+* @brief added free part for the memory allocated by aper_decoder 
+*
+* @details
+*
+*    Function : freeAperDecodeUeContextReleaseCommand 
+*
+*    Functionality: added free part for the memory allocated by aper_decoder
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+void freeAperDecodeUeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx=0;
+   UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+   ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+   
+   if(ueContextReleaseCommand->protocolIEs.list.array)
+   {
+      for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++)
+      {
+         if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx])
+         {
+            switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id)
+            {
+               case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_Cause:
+                  break;
+               case ProtocolIE_ID_id_RRCContainer:
+               {
+                  if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
+                  {
+                     free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
+                  }
+                  break;
+               }
+               default :
+                  DU_LOG("\nERROR  -->  F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\
+                       ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id);
+                  break;
+            }
+         }
+         free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]);
+      }
+      free(ueContextReleaseCommand->protocolIEs.list.array);
+   }
+}
+/*******************************************************************
+*
+* @brief processing of UE Context Release Command
+*
+* @details
+*
+*    Function : procF1UeContextReleaseCommand 
+*
+*    Functionality: processing of UE Context Release Command
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
+{
+   /*TODO: processing of DL RRC Msg Transfer to RLC->SCH->MAC-LOWER-MAC->PHY, if RRC container is received */
+   
+   freeAperDecodeUeContextReleaseCommand(f1apMsg);
+   return ROK;
+}
+/**************************************************************
  *
  * @brief Handles received F1AP message and sends back response  
  *
@@ -12399,6 +12838,11 @@ void F1APMsgHdlr(Buffer *mBuf)
                      procF1UeContextModificationReq(f1apMsg);
                      break;
                   }
+               case InitiatingMessage__value_PR_UEContextReleaseCommand:
+                  {
+                      procF1UeContextReleaseCommand(f1apMsg);
+                      break;
+                  }
                default:
                   {
                      DU_LOG("\nERROR  -->  F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",
index 65d42e1..c52a835 100644 (file)
@@ -50,6 +50,8 @@ int16_t getStatProhTmr(uint8_t statProhTmrCfg);
 uint8_t duProcUeContextModReq(DuUeCb *ueCb);
 uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId);
 uint8_t duBuildAndSendUeContextModReq(uint16_t cellId, uint16_t crnti, DuUeCfg *duUeCfg);
+uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx);
+uint8_t BuildAndSendUeContextReleaseComplete(uint32_t  gnbCuUeF1apId, uint32_t  gnbDuUeF1apId);
 /**********************************************************************
          End of file
 **********************************************************************/
index 8dcf644..25c1842 100644 (file)
@@ -130,211 +130,226 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
    switch(pst->srcEnt)
    {
       case ENTDUAPP:
-        {
-           switch(pst->event)
-           {
-              case EVTCFG:
-                 {
-                    DU_LOG("\n****** Received initial configs at DU APP ******\n");
-                    duProcCfgComplete();
-                    ODU_PUT_MSG_BUF(mBuf);
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTDUAPP");
-                    ODU_PUT_MSG_BUF(mBuf);
-                    ret = RFAILED;
-                 }
-           }
+         {
+            switch(pst->event)
+            {
+               case EVTCFG:
+                  {
+                     DU_LOG("\n****** Received initial configs at DU APP ******\n");
+                     duProcCfgComplete();
+                     ODU_PUT_MSG_BUF(mBuf);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTDUAPP");
+                     ODU_PUT_MSG_BUF(mBuf);
+                     ret = RFAILED;
+                  }
+            }
 
-           break;
-        }
+            break;
+         }
       case ENTRLC:
-        {
-           switch(pst->event)
-           {
-              case LKW_EVT_CFG_CFM:
-                 {
-                    ret = unpackRlcConfigCfm(DuHdlRlcCfgComplete, pst, mBuf);
-                    break;
-                 }
-              case LKW_EVT_CNTRL_CFM:
-                 {
-                    ret = cmUnpkLkwCntrlCfm(duHdlRlcCntrlCfgComplete, pst, mBuf);
-                    break;
-                 }
-              case LKW_EVT_STA_IND:
-                 {
-                    break;
-                 }
-              case EVENT_RLC_UE_CREATE_RSP:
-                 {
-                    ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
-                    break;
-                 }
-              case EVENT_RLC_UE_RECONFIG_RSP:
-                 {
-                    ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
-                    break;
-                 }
-              case EVENT_UL_RRC_MSG_TRANS_TO_DU:
-                 {
-                    ret = unpackRlcUlRrcMsgToDu(DuProcRlcUlRrcMsgTrans, pst, mBuf);
-                    break;
-                  }
-              case EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU:
-                 {
-                    ret = unpackRrcDeliveryReportToDu(DuProcRlcRrcDeliveryReport, pst, mBuf);
-                    break;
-                 }
-              case EVENT_DL_RRC_MSG_RSP_TO_DU:
-                  {
-                    ret = unpackRlcDlRrcMsgRspToDu(DuProcRlcDlRrcMsgRsp, pst, mBuf);
-                    break;
-                  }
-              case EVENT_UL_USER_DATA_TRANS_TO_DU:
-                 {
-                    ret = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf);
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  DU_APP : Invalid event %d received at duActvTsk from ENTRLC", \
-                          pst->event);
-                    ODU_PUT_MSG_BUF(mBuf);
-                    ret = RFAILED;
-                 }
-           }
-           break;
-        }
+         {
+            switch(pst->event)
+            {
+               case LKW_EVT_CFG_CFM:
+                  {
+                     ret = unpackRlcConfigCfm(DuHdlRlcCfgComplete, pst, mBuf);
+                     break;
+                  }
+               case LKW_EVT_CNTRL_CFM:
+                  {
+                     ret = cmUnpkLkwCntrlCfm(duHdlRlcCntrlCfgComplete, pst, mBuf);
+                     break;
+                  }
+               case LKW_EVT_STA_IND:
+                  {
+                     break;
+                  }
+               case EVENT_RLC_UE_CREATE_RSP:
+                  {
+                     ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
+                     break;
+                  }
+               case EVENT_RLC_UE_RECONFIG_RSP:
+                  {
+                     ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf);
+                     break;
+                  }
+               case EVENT_RLC_UE_DELETE_RSP:
+                  {
+                     ret = unpackRlcUeDeleteRsp(DuProcRlcUeDeleteRsp, pst, mBuf);
+                     break;
+                  }
+               case EVENT_UL_RRC_MSG_TRANS_TO_DU:
+                  {
+                     ret = unpackRlcUlRrcMsgToDu(DuProcRlcUlRrcMsgTrans, pst, mBuf);
+                     break;
+                  }
+               case EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU:
+                  {
+                     ret = unpackRrcDeliveryReportToDu(DuProcRlcRrcDeliveryReport, pst, mBuf);
+                     break;
+                  }
+               case EVENT_DL_RRC_MSG_RSP_TO_DU:
+                  {
+                     ret = unpackRlcDlRrcMsgRspToDu(DuProcRlcDlRrcMsgRsp, pst, mBuf);
+                     break;
+                  }
+               case EVENT_UL_USER_DATA_TRANS_TO_DU:
+                  {
+                     ret = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  DU_APP : Invalid event %d received at duActvTsk from ENTRLC", \
+                           pst->event);
+                     ODU_PUT_MSG_BUF(mBuf);
+                     ret = RFAILED;
+                  }
+            }
+            break;
+         }
       case ENTMAC:
-        {
-           switch(pst->event)
-           {
-              //Config complete
-              case EVTCFG:
-                 {
-                    ODU_PUT_MSG_BUF(mBuf);
-                    break;
-                 }
-              case EVTLRGCFGCFM:
-                 {
-                    ret = cmUnpkLrgCfgCfm(duHdlMacCfgComplete, pst, mBuf);
-                    break;
-                 }
-              case EVTLRGCNTRLCFM:
-                 {
-                    break;
-                 }
-              case EVTMACSCHGENCFGCFM:
-                 {
-                    ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
-                    break;
-                 }
-              case EVENT_MAC_CELL_CONFIG_CFM:
-                 {
-                    ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
-                    break;
-                 }
-              case EVENT_MAC_CELL_UP_IND:
-                 {
-                    ret = unpackMacCellUpInd(duHandleCellUpInd, pst, mBuf);
-                    break;
-                 }
-              case EVENT_MAC_STOP_IND:
-                 {
-                    ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
-                    break;
-                 }
-              case EVENT_MAC_UL_CCCH_IND:
-                 {
-                    ret = unpackMacUlCcchInd(duHandleUlCcchInd, pst, mBuf);
-                    break;
-                 }
-              case EVENT_MAC_UE_CREATE_RSP:
-                 {
-                    ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf); 
-                    break;
-                 }
+         {
+            switch(pst->event)
+            {
+               //Config complete
+               case EVTCFG:
+                  {
+                     ODU_PUT_MSG_BUF(mBuf);
+                     break;
+                  }
+               case EVTLRGCFGCFM:
+                  {
+                     ret = cmUnpkLrgCfgCfm(duHdlMacCfgComplete, pst, mBuf);
+                     break;
+                  }
+               case EVTLRGCNTRLCFM:
+                  {
+                     break;
+                  }
+               case EVTMACSCHGENCFGCFM:
+                  {
+                     ret = cmUnpkLrgSchCfgCfm(duHdlSchCfgComplete, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_CELL_CONFIG_CFM:
+                  {
+                     ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_CELL_UP_IND:
+                  {
+                     ret = unpackMacCellUpInd(duHandleCellUpInd, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_STOP_IND:
+                  {
+                     ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_UL_CCCH_IND:
+                  {
+                     ret = unpackMacUlCcchInd(duHandleUlCcchInd, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_UE_CREATE_RSP:
+                  {
+                     ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf); 
+                     break;
+                  }
                case EVENT_MAC_UE_RECONFIG_RSP:
-                 {
-                    ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf); 
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTMAC");
-                    ODU_PUT_MSG_BUF(mBuf);
-                    ret = RFAILED;
-                 }
-           }
+                  {
+                     ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf); 
+                     break;
+                  }
+               case EVENT_MAC_UE_DELETE_RSP:
+                  {
+                     ret = unpackDuMacUeDeleteRsp(DuProcMacUeDeleteRsp, pst, mBuf);
+                     break;
+                  }
+               case EVENT_MAC_CELL_DELETE_RSP:
+                  {
+                     ret = unpackDuMacCellDeleteRsp(DuProcMacCellDeleteRsp, pst, mBuf);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTMAC");
+                     ODU_PUT_MSG_BUF(mBuf);
+                     ret = RFAILED;
+                  }
+            }
 
-           break;
-        }
+            break;
+         }
       case ENTSCTP:
-        {
-           switch(pst->event)
-           {
-              case EVENT_CU_DATA:
-                 {
-                    F1APMsgHdlr(mBuf);
-                    break;
-                 }
-              case EVENT_SCTP_NTFY:
-                 {
-                    ret = cmUnpkSctpNtfy(duSctpNtfyHdl, pst, mBuf);
-                    break;
-                 }
-              case EVENT_RIC_DATA:
-                 {
-                    E2APMsgHdlr(mBuf);
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTSCTP");
-                    ret = RFAILED;
-                 }
+         {
+            switch(pst->event)
+            {
+               case EVENT_CU_DATA:
+                  {
+                     F1APMsgHdlr(mBuf);
+                     break;
+                  }
+               case EVENT_SCTP_NTFY:
+                  {
+                     ret = cmUnpkSctpNtfy(duSctpNtfyHdl, pst, mBuf);
+                     break;
+                  }
+               case EVENT_RIC_DATA:
+                  {
+                     E2APMsgHdlr(mBuf);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTSCTP");
+                     ret = RFAILED;
+                  }
 
-           }
-           ODU_PUT_MSG_BUF(mBuf);
-           break;
-        }
+            }
+            ODU_PUT_MSG_BUF(mBuf);
+            break;
+         }
       case ENTEGTP:
-        {
-           switch(pst->event)
-           {
-              case EVTCFGCFM:
-                 {
-                    unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
-                    break;
-                 }
-              case EVTSRVOPENCFM:
-                 {
-                    unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
-                    break;
-                 }
-              case EVTTNLMGMTCFM:
-                 {
-                    unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  DU_APP : Invalid event[%d] received at duActvTsk from ENTEGTP", pst->event);
-                    ret = RFAILED;
-                 }
-           }
-           ODU_PUT_MSG_BUF(mBuf);
-           break;
-        }
+         {
+            switch(pst->event)
+            {
+               case EVTCFGCFM:
+                  {
+                     unpackEgtpCfgCfm(duHdlEgtpCfgComplete, mBuf);
+                     break;
+                  }
+               case EVTSRVOPENCFM:
+                  {
+                     unpackEgtpSrvOpenCfm(duHdlEgtpSrvOpenComplete, mBuf);
+                     break;
+                  }
+               case EVTTNLMGMTCFM:
+                  {
+                     unpackEgtpTnlMgmtCfm(duHdlEgtpTnlMgmtCfm, mBuf);
+                     break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  DU_APP : Invalid event[%d] received at duActvTsk from ENTEGTP", pst->event);
+                     ret = RFAILED;
+                  }
+            }
+            ODU_PUT_MSG_BUF(mBuf);
+            break;
+         }
       default:
-        {
-           DU_LOG("\nERROR  -->  DU_APP : DU APP can not process message from Entity %d", pst->srcEnt);
-           ODU_PUT_MSG_BUF(mBuf);
-           ret = RFAILED;
-        }
+         {
+            DU_LOG("\nERROR  -->  DU_APP : DU APP can not process message from Entity %d", pst->srcEnt);
+            ODU_PUT_MSG_BUF(mBuf);
+            ret = RFAILED;
+         }
 
    }
    ODU_EXIT_TASK();
index 13ef272..9846736 100644 (file)
@@ -290,13 +290,14 @@ uint8_t commonInit()
 
    ODU_SET_PROC_ID(DU_PROC);
 
+   /* Intel L1 using core 0-15. ODU-High using 16-21 */
    /* system task for DU APP */
    if(ODU_CREATE_TASK(PRIOR0, &du_app_stsk) != ROK)
    {
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for DU APP failed");
       return RFAILED;
    }
-   ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 15, 0);
+   ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
 
    /* system task for EGTP */
    if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
@@ -304,7 +305,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for EGTP failed");
       return RFAILED;
    }
-   ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
+   ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
 
    /* system task for RLC_DL and MAC */
    if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
@@ -314,7 +315,7 @@ uint8_t commonInit()
    }
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-   ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
+   ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
 
    /* system task for RLC UL */
    if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
@@ -322,7 +323,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for RLC UL failed");
       return RFAILED;
    }
-   ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
+   ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
 
    /* system task for SCTP receiver thread */
    if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
@@ -330,7 +331,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for SCTP failed");
       return RFAILED;
    }
-   ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
+   ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
 
    /* system task for lower-mac receiver thread */
    if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
@@ -338,7 +339,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for Lower MAC failed");
       return RFAILED;
    }
-   ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
+   ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
 
    /* Create TAPA tasks */
    if(duAppInit(du_app_stsk) != ROK)
index 4986c68..73ceca3 100644 (file)
@@ -83,6 +83,27 @@ DuRlcDlUserDataToRlcFunc duSendRlcDlUserDataToRlcOpts[] =
    packRlcDlUserDataToRlc         /* Light weight-loose coupling */
 };
 
+DuMacUeDeleteReq packMacUeDeleteReqOpts[] =
+{
+   packDuMacUeDeleteReq,       /* Loose coupling */
+   MacProcUeDeleteReq,         /* TIght coupling */
+   packDuMacUeDeleteReq        /* Light weight-loose coupling */
+};
+
+DuRlcUeDeleteReq packRlcUeDeleteReqOpts[] =
+{
+   packDuRlcUeDeleteReq,       /* Loose coupling */
+   RlcProcUeDeleteReq,         /* TIght coupling */
+   packDuRlcUeDeleteReq        /* Light weight-loose coupling */
+};
+
+DuMacCellDeleteReq packMacCellDeleteReqOpts[] =
+{
+   packDuMacCellDeleteReq,       /* Loose coupling */
+   MacProcCellDeleteReq,         /* TIght coupling */
+   packDuMacCellDeleteReq        /* Light weight-loose coupling */
+};
+
 /*******************************************************************
  *
  * @brief Function to fillDlUserDataInfo
@@ -1123,6 +1144,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
       /* Fetching MacDb from DuUeCb */
       GET_CELL_IDX(cellId, cellIdx);
       duMacDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg;
+      duMacDb->macUeCfgState = UE_CFG_INPROGRESS;
       /* Fetching MaUeCfg List for ADD/MOD/DEL */
       macUeCfg->cellId       = cellId;
       macUeCfg->ueIdx        = ueIdx;
@@ -1144,8 +1166,10 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
             }
          }
          ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
-
-         duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
+         if(ueCfgDb->ueNrCapability != NULLP)
+         {
+            duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
+         }
       }
 
       /* Filling LC Context */
@@ -1487,41 +1511,42 @@ uint8_t fillRlcUeCfg(uint16_t cellId, uint8_t ueIdx,\
       /* Fetch RlcDb from DuUeCb */ 
       GET_CELL_IDX(cellId, cellIdx);
       duRlcDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg;
+      duRlcDb->rlcUeCfgState = UE_CFG_INPROGRESS;
       /*Filling RlcUeCfg */
       rlcUeCfg->cellId       = cellId;
       rlcUeCfg->ueIdx        = ueIdx;
       for(dbIdx = 0; (dbIdx < ueCfgDb->numRlcLcs && ret == ROK); dbIdx++)
       {
-        ret = fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
-        if(ret == RFAILED)
-        {
-           DU_LOG("\n ERROR  -->  DU APP : Failed to fill Rlc Mode at fillRlcUeCfg()");
-           memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
-           return ret;
-        }
-        /* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
-        for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
-        { 
-           if(ueCfgDb->rlcLcCfg[dbIdx].lcId == duRlcDb->rlcLcCfg[lcIdx].lcId)
-           {
-              lcIdFound = true;
-              if((ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_UNKNOWN)||
-                    (ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_MOD))
-              {
-                 /* MOD */ 
-                 ueCfgDb->rlcLcCfg[dbIdx].configType = CONFIG_MOD; /* update Db for MOD type */
-                 memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
-              }
-           }
-           else
-              lcIdFound = false;
-        }
-        if(!lcIdFound)
-        {
-           /* ADD/ DEL Config Type */
-           memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
-        }
-        rlcUeCfg->numLcs++;
+         ret = fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
+         if(ret == RFAILED)
+         {
+            DU_LOG("\n ERROR  -->  DU APP : Failed to fill Rlc Mode at fillRlcUeCfg()");
+            memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
+            return ret;
+         }
+         /* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
+         for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
+         
+            if(ueCfgDb->rlcLcCfg[dbIdx].lcId == duRlcDb->rlcLcCfg[lcIdx].lcId)
+            {
+               lcIdFound = true;
+               if((ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_UNKNOWN)||
+                     (ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_MOD))
+               {
+                  /* MOD */ 
+                  ueCfgDb->rlcLcCfg[dbIdx].configType = CONFIG_MOD; /* update Db for MOD type */
+                  memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
+               }
+            }
+            else
+               lcIdFound = false;
+         }
+         if(!lcIdFound)
+         {
+            /* ADD/ DEL Config Type */
+            memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
+         }
+         rlcUeCfg->numLcs++;
       }
    }
    return ret;
@@ -1624,7 +1649,7 @@ uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t ueIdx,\
    if(macUeCfg)
    {
       memset(macUeCfg, 0, sizeof(MacUeCfg));
-      memcpy(macUeCfg, &duCb.actvCellLst[cellId - 1]->ueCb[ueIdx -1].macUeCfg, sizeof(MacUeCfg));
+      memcpy(macUeCfg, duMacUeCfg, sizeof(MacUeCfg));
       DU_LOG("\nDEBUG   -->  DU_APP: Sending UE create request to MAC");
 
       /* Processing one Ue at a time to MAC */
@@ -2165,8 +2190,6 @@ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
             if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
             {
                BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
-               duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
-                  macUeCfg.macUeCfgState = 0;
             }
          }
       }
@@ -2288,8 +2311,6 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp)
             if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
             {
                BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
-               duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
-                  rlcUeCfg.rlcUeCfgState = 0;
             }   
          }
       }
@@ -2490,7 +2511,7 @@ uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg)
  *
  * @details
  *
- *    Function : duProcUeContextSetupRequest
+ *    Function : duProcUeContextSetupRequest 
  *
  *    Functionality: Process UE context setup request from CU
  *
@@ -2634,6 +2655,693 @@ uint8_t duProcUeContextModReq(DuUeCb *ueCb)
    }
    return ROK;
 }
+
+/*******************************************************************
+*
+* @brief Function to delete Pdsch ServCellCfg
+*
+* @details
+*
+*    Function : deletePdschServCellCfg
+*
+*    Functionality: Function to delete Pdsch ServCellCfg
+*
+* @params[in] PdschServCellCfg *pdschServCellCfg
+* @return void
+*
+* ****************************************************************/
+
+void deletePdschServCellCfg(PdschServCellCfg *pdschServCellCfg)
+{
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->xOverhead, sizeof(PdschXOverhead));
+}
+
+/*******************************************************************
+ *
+* @brief delete MacUeCfg from duCb
+*
+* @details
+*
+*    Function : deleteMacUeCfg 
+*
+*    Functionality: delete MacUeCfg from duCb
+*
+* @params[in] Pointer to MacUeCfg 
+* @return ROK     - success
+*         RFAILED - failure
+*
+*******************************************************************/
+
+void deleteMacUeCfg(MacUeCfg *ueCfg)
+{
+   uint8_t lcCfgIdx;
+   uint8_t resrcIdx;
+   ServCellCfgInfo *servCellCfg;
+   PucchResrcInfo *resrcToAddModList;
+
+   if(ueCfg)
+   {
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->ambrCfg, sizeof(AmbrCfg));
+      if(ueCfg->spCellCfgPres)
+      {
+         servCellCfg = &ueCfg->spCellCfg.servCellCfg;
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrcSet,\
+         sizeof(PucchResrcSetCfg));
+         if(servCellCfg->initUlBwp.pucchCfg.resrc)
+         {
+            /*freeing the PucchResrcCfg*/
+            for(resrcIdx= 0; resrcIdx< servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModListCount; resrcIdx++)
+            {
+               resrcToAddModList=&servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModList[resrcIdx];
+               switch(resrcToAddModList->pucchFormat)
+               {
+                  case PUCCH_FORMAT_0:
+                     {
+                        DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format0 ,\
+                        sizeof(PucchFormat0));
+                        break;
+                     }
+                  case PUCCH_FORMAT_1:
+                     {
+                        DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format1 ,\
+                        sizeof(PucchFormat1));
+                        break;
+                     }
+                  case PUCCH_FORMAT_2:
+                     {
+                        DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format2 ,\
+                        sizeof(PucchFormat2_3));
+                        break;
+                     }
+                  case PUCCH_FORMAT_3:
+                     {
+                        DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format3 ,\
+                        sizeof(PucchFormat2_3));
+                        break;
+                     }
+                  case PUCCH_FORMAT_4:
+                     {
+                        DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format4 ,\
+                        sizeof(PucchFormat4));
+                        break;
+                     }
+               }
+            }
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrc,\
+            sizeof(PucchResrcCfg));
+         }
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format1,\
+         sizeof(PucchFormatCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format2,\
+         sizeof(PucchFormatCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format3,\
+         sizeof(PucchFormatCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format4,\
+         sizeof(PucchFormatCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.schedReq,\
+         sizeof(PucchSchedReqCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.multiCsiCfg,\
+         sizeof(PucchMultiCsiCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.spatialInfo,\
+         sizeof(PucchSpatialCfg));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.dlDataToUlAck ,\
+         sizeof(PucchDlDataToUlAck));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.powerControl,\
+         sizeof(PucchPowerControl));
+         deletePdschServCellCfg(&servCellCfg->pdschServCellCfg);
+      }
+      for(lcCfgIdx=0; lcCfgIdx< ueCfg->numLcs; lcCfgIdx++)
+      {
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].drbQos, sizeof(DrbQosInfo));
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].snssai, sizeof(Snssai));
+      }
+   }
+   memset(ueCfg, 0, sizeof(MacUeCfg));
+}
+
+/*******************************************************************
+*
+* @brief delete UE Configuration of a particular UE
+*
+* @details
+*
+*    Function : deleteUeCfg 
+*
+*    Functionality: delete UE Configuration of a particular UE 
+*
+* @params[in] uint16_t cellIdx, uint8_t ueIdx
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t  deleteUeCfg(uint16_t cellIdx, uint8_t ueIdx)
+{
+   DuUeCb *ueCb = NULLP;
+   if(duCb.actvCellLst[cellIdx] != NULLP)
+   {
+      if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg.macUeCfgState == UE_DELETE_COMPLETE)\
+            &&(duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg.rlcUeCfgState == UE_DELETE_COMPLETE))
+      {
+         ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
+         deleteMacUeCfg(&ueCb->macUeCfg);
+         deleteRlcUeCfg(&ueCb->rlcUeCfg);
+         if(ueCb->f1UeDb !=NULLP)
+         {
+            freeF1UeDb(ueCb->f1UeDb);
+         }
+         duCb.actvCellLst[cellIdx]->numActvUes--;
+         memset(ueCb, 0, sizeof(DuUeCb));
+      }
+      else
+      {
+         DU_LOG("INFO  --> DU APP : deleteUeCfg(): MAC or RLC UE configuration state not UE_DELETE_COMPLETE");
+         return RFAILED;
+      }
+   }
+   else
+   {
+      DU_LOG("ERROR  --> DU APP : deleteUeCfg(): CellIdx[%d] is not found", cellIdx);
+      return RFAILED;
+   }
+   return ROK;
+}
+
+
+/*******************************************************************
+*
+* @brief Handle UE delete response from MAC
+*
+* @details
+*
+*    Function : DuProcMacUeDeleteRsp
+*
+*    Functionality: Handle UE delete response from MAC
+*
+* @params[in] Pointer to MacUeDeleteRsp and Pst
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
+{
+   uint8_t  ueIdx = 0,ret =ROK;
+   uint16_t cellIdx=0;
+   uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
+
+   if(deleteRsp)
+   {
+      if(deleteRsp->result == SUCCESS)
+      {
+         DU_LOG("\nINFO   -->  DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueIdx);
+         GET_CELL_IDX(deleteRsp->cellId, cellIdx);
+         ueIdx = deleteRsp->ueIdx;
+         if(duCb.actvCellLst[cellIdx])
+         {
+            duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueIdx -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
+            gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+            gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+            if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+            {
+                 ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
+                 if(ret !=ROK)
+                 {   
+                    DU_LOG("\nERROR  -->  DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+                 }
+            }
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response : FAILURE [UE IDX : %d]",\
+         deleteRsp->ueIdx);
+         ret =  RFAILED;
+      }
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response is null");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes UE Delete Rsp received from RLC 
+ *
+ * @details
+ *
+ *    Function : DuProcRlcUeDeleteRsp
+ *
+ *    Functionality:
+ *     Processes UE Delete Rsp received from RLC 
+ *
+ *  @params[in]  Post structure
+ *               Pointer to RlcUeDeleteRsp
+ *  @return ROK     - success
+ *          RFAILED - failure
+ *
+ * *****************************************************************/
+
+uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
+{
+   uint8_t  ueIdx = 0, ret = ROK;
+   uint16_t cellIdx = 0;
+   uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;   
+
+   if(delRsp)
+   {
+      ueIdx = delRsp->ueIdx;
+      GET_CELL_IDX(delRsp->cellId, cellIdx);
+
+      if(delRsp->result == SUCCESSFUL)
+      {
+         DU_LOG("\nINFO   -->  DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueIdx);
+         if(duCb.actvCellLst[cellIdx]!=NULLP)
+         {
+            duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
+            gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+            gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+            if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+            {
+                ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
+                if(ret != ROK)
+                {
+                   DU_LOG("\nERROR  -->  DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+                }
+            }
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR   -->  DU_APP: RLC UE Delete Response : FAILED [UE IDX:%d]", ueIdx);
+         ret = RFAILED;
+      }
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, delRsp, sizeof(RlcUeDeleteRsp));
+
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending UE Delete Req To Mac
+*
+* @details
+*
+*    Function : sendUeDeleteReqToMac
+*
+*    Functionality:
+*     sending UE Delete Req To Mac
+*
+*  @params[in]    cellId, ueIdx, crnti 
+*  @return ROK     - success
+*          RFAILED - failure
+*
+*****************************************************************/
+
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueIdx, uint16_t crnti)
+{
+   Pst pst;
+   uint8_t ret=ROK;
+   MacUeDelete *ueDelete = NULLP;
+
+   DU_ALLOC_SHRABL_BUF(ueDelete, sizeof(MacUeDelete));
+   if(ueDelete)
+   {
+      ueDelete->cellId = cellId;
+      ueDelete->ueIdx  = ueIdx;
+      ueDelete->crnti  = crnti;
+      FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_DELETE_REQ);
+
+      /* Processing one Ue at a time to MAC */
+      DU_LOG("\nDEBUG  -->  DU_APP: Sending UE delete Request to MAC ");
+      ret = (*packMacUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
+      if(ret == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU_APP: sendUeDeleteReqToMac(): Failed to send UE delete Req to MAC");
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueDelete, sizeof(MacUeDelete));
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->   DU_APP: sendUeDeleteReqToMac(): Failed to allocate memory"); 
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending UE Delete Req To Rlc
+ *
+ * @details
+ *
+ *    Function : sendUeDeleteReqToRlc
+ *
+ *    Functionality:
+ *     Sending UE Delete Req To Rlc
+ *
+ *  @params[in]  cellId, ueIdx 
+ *  @return ROK     - success
+ *          RFAILED - failure
+ *
+ *****************************************************************/
+
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueIdx)
+{
+   uint8_t ret;
+   Pst pst;
+   RlcUeDelete *ueDelete;
+
+   DU_ALLOC_SHRABL_BUF(ueDelete, sizeof(RlcUeDelete));
+   if(ueDelete !=NULLP)
+   {
+      ueDelete->cellId = cellId;
+      ueDelete->ueIdx = ueIdx;
+      FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_REQ);
+
+      ret = (*packRlcUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
+      if(ret == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU_APP : sendUeDeleteReqToRlc():Failed to send UE Delete  Req to RLC"); 
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueDelete, sizeof(RlcUeDelete));
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->   DU_APP: sendUeDeleteReqToRlc():Memory allocation failed");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU processes UE delete req from CU and sends to MAC and RLC 
+ *
+ * @details
+ *
+ *    Function : duProcUeDeleteReq
+ *
+ *    Functionality: DU processes UE delete req from CU and sends to MAC 
+ *                   and RLC 
+ *
+ * @params[in] cellId, crnti 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duProcUeDeleteReq(uint16_t cellId)
+{
+   uint8_t  ueIdx = 0, ueId =0;
+   uint16_t cellIdx = 0, crnti   = 0;
+
+   DU_LOG("\nDEBUG   -->  DU_APP: Processing UE Delete Request ");
+   GET_CELL_IDX(cellId, cellIdx);
+   GET_CRNTI(crnti,ueIdx);
+
+   if(duCb.actvCellLst[cellIdx] != NULLP)
+   {
+      for(ueIdx =0;ueIdx< duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+      {
+         ueId = ueIdx+1;
+         if(sendUeDeleteReqToRlc(cellId, ueId) == RFAILED)
+         {
+            DU_LOG("\nERROR  -->  DU APP : duProcUeDeleteReq():Failed to build UE  delete req for RLC ");
+            return RFAILED;
+         }
+
+         GET_CRNTI(crnti,ueId);
+         if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
+         {
+            DU_LOG("\nERROR  -->  DU APP : duProcUeDeleteReq(): Failed to build UE  delete req for MAC ");
+            return RFAILED;
+         }
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : duProcUeDeleteReq(): Cell Id is not found");
+      return RFAILED;
+   }
+
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief delete RlcUeCfg from duCb
+ *
+ * @details
+ *
+ *    Function : deleteRlcUeCfg
+ *
+ *    Functionality:
+ *       delete  RlcUeCfg from duCb
+ *
+ *  @params[in] RlcUeCfg *ueCfg 
+ *               
+ *  @return ROK     - success
+ *          RFAILED - failure
+ *
+ *****************************************************************/
+
+void deleteRlcUeCfg(RlcUeCfg *ueCfg)
+{
+   uint8_t lcIdx = 0;
+   RlcBearerCfg *lcCfg= NULLP;
+   if(ueCfg)
+   {
+      for(lcIdx =0 ; lcIdx < ueCfg->numLcs ; lcIdx++)
+      {
+         lcCfg = &ueCfg->rlcLcCfg[lcIdx];
+         switch(lcCfg->rlcMode)
+         {
+            case RLC_AM :
+               {
+                  DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
+                  break;
+               }
+            case RLC_UM_BI_DIRECTIONAL :
+               {
+                  DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
+                  break;
+               }
+            case RLC_UM_UNI_DIRECTIONAL_UL :
+               {
+                  DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
+                  break;
+               }
+            case RLC_UM_UNI_DIRECTIONAL_DL :
+               {
+                  DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
+                  break;
+               }
+         }
+      }
+      memset(ueCfg, 0, sizeof(RlcUeCfg));
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief Delete DU CellCb information 
+ *
+ * @details
+ *
+ *    Function : deleteDuCellCb
+ *
+ *    Functionality: Delete DU CellCb information
+ *
+ * @params[in] DuCellCb *cellCb
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+void deleteDuCellCb(DuCellCb *cellCb)
+{
+
+   if(cellCb->duMacCellCfg)
+   {
+      if(cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq)
+      {
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq,\
+               cellCb->duMacCellCfg->prachCfg.fdm[0].numUnusedRootSeq);
+      }
+      if(cellCb->duMacCellCfg->sib1Cfg.sib1Pdu)
+      {
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,cellCb->duMacCellCfg->sib1Cfg.sib1Pdu,\
+               cellCb->duMacCellCfg->sib1Cfg.sib1PduLen);
+      }
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg, sizeof(MacCellCfg));
+   }
+   memset(cellCb, 0, sizeof(DuCellCb));
+
+}
+
+/*******************************************************************
+ *
+ * @brief Handle Cell delete response from MAC
+ *
+ * @details
+ *
+ *    Function : DuProcMacCellDeleteRsp
+ *
+ *    Functionality: Handle Cell delete response from MAC
+ *
+ * @params[in] Pointer to MacCellDeleteRsp and Pst
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
+{
+   uint8_t ret = ROK;
+   uint16_t cellIdx=0;
+   if(deleteRsp)
+   {
+      if(deleteRsp->result == SUCCESSFUL_RSP)
+      {
+         GET_CELL_IDX(deleteRsp->cellId, cellIdx);
+         DU_LOG("\nINFO   -->  DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
+         if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
+         {
+            deleteDuCellCb(duCb.actvCellLst[cellIdx]);
+            duCb.numActvCells--;
+            DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  DU APP : DuProcMacCellDeleteRsp(): CellId [%d] doesnot exist", deleteRsp->cellId);
+            ret = RFAILED;
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DU APP : DuProcMacCellDeleteRsp(): MAC CELL Delete Response : FAILED\
+         [CELL IDX : %d]", deleteRsp->cellId);
+         ret = RFAILED;
+      }
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : DuProcMacCellDeleteRsp(): Received MAC cell delete response is NULL");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending Cell Delete Req To Mac
+ *
+ * @details
+ *
+ *    Function : sendCellDeleteReqToMac
+ *
+ *    Functionality:
+ *     sending Cell Delete Req To Mac
+ *
+ *  @params[in]    uint16_t cellId
+ *  @return ROK     - success
+ *          RFAILED - failure
+ *
+ *
+ *****************************************************************/
+
+uint8_t sendCellDeleteReqToMac(uint16_t cellId)
+{
+   Pst pst;
+   uint8_t ret=ROK;
+   MacCellDelete *cellDelete = NULLP;
+   
+   DU_ALLOC(cellDelete, sizeof(MacCellDelete));
+   if(cellDelete)
+   {
+      cellDelete->cellId = cellId;
+      FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_DELETE_REQ);
+
+      DU_LOG("\nINFO   -->  DU APP : Sending Cell Delete Request to MAC");  
+      /* Processing one Cell at a time to MAC */
+      ret = (*packMacCellDeleteReqOpts[pst.selector])(&pst, cellDelete);
+      if(ret == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU APP : sendCellDeleteReqToMac(): Failed to send Cell delete Req to MAC");
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDelete));
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->   DU APP : sendCellDeleteReqToMac(): Failed to allocate memory"); 
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU preocess Cell Delete Req to MAC 
+ *
+ * @details
+ *
+ *    Function : duProcCellDeleteReq 
+ *
+ *    Functionality: DU process Cell Delete Req to MAC 
+ *
+ * @params[in] uint16_t cellId
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duProcCellDeleteReq(uint16_t cellId)
+{
+   uint16_t cellIdx = 0;
+   
+   DU_LOG("\nINFO   -->  DU APP : Processing Cell Delete Request ");
+   GET_CELL_IDX(cellId, cellIdx);
+
+   if(duCb.actvCellLst[cellIdx] != NULLP)
+   {
+      if(duBuildAndSendMacCellStop() == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU APP : duProcCellDeleteReq(): Failed to process Cell delete req for cellId[%d]",cellId);
+         return RFAILED;
+      }
+      
+      if(duCb.actvCellLst[cellIdx]->numActvUes)
+      {
+         DU_LOG("\nERROR  -->  DU APP : duProcCellDeleteReq(): Active UEs present Failed to process cell Delete\
+         Req for cellID[%d]", cellId);
+         return RFAILED;
+      }
+      if(sendCellDeleteReqToMac(cellId) == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU APP : duProcCellDeleteReq(): Failed to build and send Cell delete req for MAC for\
+         cellId[%d]",cellId);
+         return RFAILED;
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : duProcCellDeleteReq(): CellId[%d] is not found", cellId);
+      return RFAILED;
+   }
+
+   return ROK;
+}
+
 /**********************************************************************
   End of file
- ***********************************************************************/
+***********************************************************************/
index 7406ce2..0fa49eb 100644 (file)
@@ -28,6 +28,9 @@ uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t ueIdx,\
 uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);
 uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId);
 uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo);
+uint8_t duProcUeDeleteReq(uint16_t cellId);
+void deleteRlcUeCfg(RlcUeCfg *ueCfg);
+void freeF1UeDb(F1UeContextSetupDb *f1UeDb);
 #endif
 
 /**********************************************************************
index e8c2584..99d61f3 100644 (file)
@@ -43,7 +43,7 @@
 #define DEFAULT_CU_PORT 38472
 
 #define DEFAULT_RIC_IPV4_ADDR "192.168.130.80"
-#define DEFAULT_RIC_PORT 36422
+#define DEFAULT_RIC_PORT 36421
 
 enum class Interface 
 { ODU,
index 98fa2a6..8ee5d1b 100644 (file)
@@ -24,6 +24,7 @@
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
 #include "lwr_mac.h"
+#include "lwr_mac_fsm.h"
 #include "lwr_mac_phy.h"
 #ifdef INTEL_FAPI
 #include "fapi.h"
diff --git a/src/rlog/rl_common.c b/src/rlog/rl_common.c
deleted file mode 100644 (file)
index 3c12c24..0000000
+++ /dev/null
@@ -1,70 +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:     Radisys Logging Framework
-     Type:     C source file
-     Desc:     This file contains logging framework implementation.
-     File:     rl_common.c
-
-*********************************************************************21*/
-/****************************************************************************
-@ description: This is common source file for postprocessor and log library.
-*****************************************************************************/
-
-#include <stdio.h>
-#include "stdint.h"
-#include "rl_common.h"
-/* String representation of Log Levels */
-const char* g_logStr[L_MAX_LOG_LEVEL] =
-{
-   "ALWAYS",
-   "FATAL",
-   "ERROR",
-   "WARNING",
-   "EVENT",
-   "INFO",
-   "DEBUG"
-};
-
-const char* g_splStr[DBG_MAX_IDs] =
-{
-   "CELLID",
-   "PEERID",
-   "ENBID",
-   "MME",
-   "CRNTI", 
-   "UEIDX",
-   "UEID", 
-   "RBID", 
-   "LCID", 
-   "LCGID", 
-       "TRNSID"
-};
-
-void hextostr(char* p, PSTR h, int hexlen)
-{
-   int i;
-   for(i=0; i<hexlen; i++, p+=3, h++)
-      sprintf(p, "%02x ", *h);
-}
-
-/**********************************************************************
-         End of file
-**********************************************************************/
diff --git a/src/rlog/rl_common.h b/src/rlog/rl_common.h
deleted file mode 100755 (executable)
index 13c956c..0000000
+++ /dev/null
@@ -1,116 +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:     Radisys Logging Framework
-     Type:     C include file
-     Desc:     This file contains logging framework include file for library.
-     File:     rl_common.h
-
-*********************************************************************21*/
-/*************************************************************************
-@ description: This is header file is used by logging framework module. This
-file should not be cirectly included by any other application although it is
-common file to logging framework and LOG MACROs used by any applicatoin.
-***************************************************************************/
-#ifndef __RL_COMMON_H__
-#define __RL_COMMON_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-       L_ALWAYS=0,
-       L_FATAL,
-       L_ERROR,
-       L_WARNING,
-       L_EVENT,
-       L_INFO,
-       L_DEBUG,
-       L_UNUSED,
-       L_MAX_LOG_LEVEL
-} R_LOG_LEVEL;
-
-typedef enum {
-       DBG_CELLID,
-   DBG_PEERID,
-   DBG_ENBID,
-       DBG_MMEID,
-       DBG_CRNTI,
-   DBG_UEIDX,
-       DBG_UEID,
-       DBG_RBID,
-       DBG_LCID,
-       DBG_LCGID,
-       DBG_TRNSID,
-   DBG_INSTID,
-       DBG_MAX_IDs
-} R_SPL_ARG;
-
-#ifdef USE_RLOG_DATA_TYPES
-typedef const char* PSTR;
-typedef int S32;
-typedef signed short S16;
-#else
-#include "envdep.h"
-typedef const char* PSTR;
-#endif
-
-typedef uint32_t LOGID;
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING
-#include <stdio.h>
-extern FILE* g_fp;
-void logLev0(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, ...);
-void logLev1(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, ...);
-void logLev2(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, uint32_t arg2, ...);
-void logLev3(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t, uint32_t, uint32_t, ...);
-void logLev4(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t, uint32_t, uint32_t, uint32_t, ...);
-void logLevN(int logLevel, const char* modName, const char* file, int lineno, const char* fmtStr, ...);
-void logLevE(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, R_SPL_ARG splType,
-   uint32_t splVal, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
-void logLevH(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR hexdump, int hexlen, ...);
-void logLevS(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR str, ...);
-#else
-void logLevH( LOGID logId, R_LOG_LEVEL logLevel, PSTR hex, int hexlen, ...);
-void logLev0( LOGID logId, R_LOG_LEVEL logLevel, ...);
-void logLev1( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, ...);
-void logLev2( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, ...);
-void logLev3( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, ...);
-void logLev4( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
-void logLevE(LOGID logId, R_LOG_LEVEL logLevel, R_SPL_ARG splType, uint32_t splVal,
-uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
-void logLevS( LOGID logId, R_LOG_LEVEL logLevel, const char* str, ...);
-#endif
-
-void hextostr(char* p, PSTR h, int hexlen);
-
-extern int g_logLevel;
-extern uint32_t g_modMask;
-extern const char* g_logStr[L_MAX_LOG_LEVEL]; 
-extern const char* g_splStr[DBG_MAX_IDs];
-
-#define RLOG_SEGFAULT_STR "Segmentation Fault Occurred\n%s"
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __RLOG_COMMON_H__ */
diff --git a/src/rlog/rl_interface.h b/src/rlog/rl_interface.h
deleted file mode 100755 (executable)
index 51e0ab6..0000000
+++ /dev/null
@@ -1,217 +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:     Radisys Logging Framework
-     Type:     C include file
-     Desc:     This file contains logging framework include file.
-     File:     rl_interface.h
-*********************************************************************21*/
-///////////////////////////////////////////////////////////////////////////////
-// @ description: This is header file is used by applications who want to 
-// define LOG Macros. This file can be refered for integrating log library
-// into any application. API's defined in the file should be used by the 
-// program to modify data at runtime.
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef __RL_INTERFACE_H__
-
-#include "rl_common.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// This API is used to set logging directory path. If set after the log 
-// initialization API, next file creation will happen in this directory
-void rlSetLogPath(const char* logDir);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API needs to be called after configuring all the required parameters 
-// by using below APIs. This API initializes logging framework.  
-// Log MACRO's should be used  only after calling this API.
-void rlInitLog(uint8_t type); 
-
-///////////////////////////////////////////////////////////////////////////////
-// This initializes log file name.  Log file name should be exclusive of 
-// extension. As framework appends ".bin" in case of binary file and ".txt" in 
-// case of plain text logging. If file name is "stdout" and TEXT logging is 
-// enabled, logs will be printed in console. Run time file name can be changed 
-// and will be applicable when next file is created.
-void rlSetLogFile(const char* fileName);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API is used to set remote logging port, where post-processor application 
-// (rlogapp) is used to connect on this port in order to receive live binary logs. 
-// This API can be used only during initialization time.
-void rlSetLogPort(uint32_t port);
-
-///////////////////////////////////////////////////////////////////////////////
-// Use this API to set log level. This API supports run time modification of
-// log level.
-void rlSetLogLevel(R_LOG_LEVEL logLevel);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API toggles the module mask. If logging for this module is already 
-// enabled, it will be disabled. If it's not enabled, it will enable. Zero 
-// input will disable logging mask for all modules.
-void rlSetModuleMask(uint32_t modMask);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API is used to set log file size limit for single file.
-void rlSetLogFileSizeLimit(uint32_t maxFileSize);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API sets the limit of number of log files  that can be created by 
-// logging framework.
-void rlSetNumOfLogFiles(uint8_t nMaxFiles);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API is used to set circular buffer size for each thread. Based on the 
-// number of threads in the system this size needs to be chosen. Recommended 
-// minimum 100Kb buffer size.
-void rlSetCircularBufferSize(uint32_t bufSize);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API enables or disables remote logging application connection to see 
-// live binary logs.
-void rlSetRemoteLoggingFlag(S32 flag);
-
-///////////////////////////////////////////////////////////////////////////////
-// To change or modify logging level using console, console input needs to be 
-// passed to this function.
-int rlHandleConInput(char ch);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API enables or disables core file generation based on the input flag 
-// value. 1 Enables core dump and 0 disables generating core dump.
-void rlEnableDisableCore(S32 enable_core);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API enables Bufferd IO, to disable frequent file operation
-void rlEnaBleBufferedIO(void);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API updates the RLOG Tti count baed on this time stamp will be updated 
-void rlUpdateRlogTti(void);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API reset the RLOG rate control count and enable logging every 10 ms 
-void rlResetLogRateLmt(void);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API reset the RLOG rate control count and enable logging every 10 ms
-void rlResetLogRateLmt(void);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API Start the limit the number of logs loggd into circular buffer every
-// 10ms
-void rlStartLogCountLimit(void);
-
-///////////////////////////////////////////////////////////////////////////////
-// This API stops restriciton of limiting number of logs every 10 ms
-void rlStopLogCountLimit(void);
-
-
-#ifdef WR_DBG_CIRLOG
-
-#include "rl_redirect.h"
-
-#else
-
-#if defined(RLOG_ENABLE_TEXT_LOGGING) 
-
-#define FMTSTR "[%d-%d-%d %d:%d:%d.%03d][%s]%s:%d\n%s:"
-#define FMTSTR_S "[%d-%d-%d %d:%d:%d.%03d][%s]%s:%d\n%s:%s:%ld:"
-
-#define LOG_ARG0(_level, _fmtStr) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLev0(g_logStr[_level],RLOG_MODULE_NAME, __FILE__,__LINE__, FMTSTR _fmtStr "\n\n", RLOG_FILE_ID); \
-}
-
-#define LOG_ARGN(_N, _level, _fmtStr, ...) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLev##_N(g_logStr[_level],RLOG_MODULE_NAME, __FILE__,__LINE__, FMTSTR _fmtStr "\n\n", ##__VA_ARGS__ , RLOG_FILE_ID); \
-}
-
-#define LOG_SPL(_level, _splenum, _splArg, _fmtStr, ...) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLevE(g_logStr[_level],RLOG_MODULE_NAME, __FILE__,__LINE__, FMTSTR_S _fmtStr "\n\n", _splenum,_splArg, ##__VA_ARGS__, RLOG_FILE_ID); \
-}
-
-#define LOG_ARGX(_level, _fmtStr, ...) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLevN(_level,RLOG_MODULE_NAME, __FILE__,__LINE__, _fmtStr "\n\n", __VA_ARGS__, RLOG_FILE_ID); \
-} 
-
-#define RLOG0(_level, _lstr)                           LOG_ARG0(_level, _lstr)
-#define RLOG1(_level, _lstr, _arg1)                    LOG_ARGN(1, _level, _lstr, _arg1)
-#define RLOG2(_level, _lstr, _arg1, _arg2)             LOG_ARGN(2, _level, _lstr, _arg1, _arg2)
-#define RLOG3(_level, _lstr, _arg1, _arg2, _arg3)      LOG_ARGN(3, _level, _lstr, _arg1, _arg2, _arg3)
-#define RLOG4(_level, _lstr, _arg1, _arg2, _arg3, _arg4)LOG_ARGN(4, _level, _lstr, _arg1, _arg2, _arg3, _arg4)
-
-#else /* BINARY LOGGING */
-
-#define LOG_ARG0(_level, _fmtStr) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLev0(_LOGID, _level, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
-}
-
-#define LOG_ARGN(_N, _level, _fmtStr, ...) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLev##_N(_LOGID, _level, ##__VA_ARGS__, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
-}
-
-#define LOG_SPL(_level, _splenum, _splArg, _fmtStr, ...) \
-if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
-{ \
-       logLevE(_LOGID,_level,_splenum, _splArg, ##__VA_ARGS__, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
-}
-
-#define RLOG0(_level, _lstr)                           LOG_ARG0(_level, _lstr)
-#define RLOG1(_level, _lstr, _arg1)                    LOG_ARGN(1, _level, _lstr, _arg1)
-#define RLOG2(_level, _lstr, _arg1, _arg2)             LOG_ARGN(2, _level, _lstr, _arg1, _arg2)
-#define RLOG3(_level, _lstr, _arg1, _arg2, _arg3)      LOG_ARGN(3, _level, _lstr, _arg1, _arg2, _arg3)
-#define RLOG4(_level, _lstr, _arg1, _arg2, _arg3, _arg4)LOG_ARGN(4, _level, _lstr, _arg1, _arg2, _arg3, _arg4)
-
-#endif /* if defined(RLOG_ENABLE_TEXT_LOGGING) */
-
-#define RLOG_STR(_level, _lstr, _strarg)                                       LOG_ARGN(S, _level, _lstr, _strarg)
-#define RLOG_HEX(_level, _lstr, _hexdata, _hexlen)             LOG_ARGN(H, _level, _lstr, _hexdata, _hexlen)
-
-#define RLOG_ARG0(_level, _splenum, _splArg, _lstr) \
-               LOG_SPL(_level, _splenum, _splArg, _lstr, 0, 0, 0, 0)
-
-#define RLOG_ARG1(_level, _splenum, _splArg, _lstr, _arg1) \
-               LOG_SPL(_level, _splenum, _splArg, _lstr, _arg1, 0, 0, 0)
-
-#define RLOG_ARG2(_level, _splenum, _splArg, _lstr, _arg1, _arg2) \
-               LOG_SPL(_level, _splenum, _splArg, _lstr, _arg1, _arg2, 0, 0)
-
-#define RLOG_ARG3(_level, _splenum, _splArg, _lstr, _arg1, _arg2, _arg3) \
-               LOG_SPL(_level, _splenum, _splArg, _lstr, _arg1, _arg2, _arg3, 0)
-
-#define RLOG_ARG4(_level, _splenum, _splArg, _lstr, _arg1, _arg2, _arg3, _arg4) \
-               LOG_SPL(_level, _splenum, _splArg, _lstr, _arg1, _arg2, _arg3, _arg4)
-
-#endif /* WR_DBG_CIRLOG */
-#endif /* __RLOG_INTERFACE_H__*/
diff --git a/src/rlog/rl_platform.c b/src/rlog/rl_platform.c
deleted file mode 100644 (file)
index 6aa39c7..0000000
+++ /dev/null
@@ -1,126 +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:     Radisys Logging Framework
-     Type:     C source file
-     Desc:     This file contains logging framework implementation.
-     File:     rl_rlog.c
-
-*********************************************************************21*/
-/**************************************************************************
-@ description: This is source file which has implementaion of logging 
-framework.
-****************************************************************************/
-
-#include"stdint.h"
-#include "rl_interface.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <time.h>
-#include <stdarg.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <pthread.h>
-
-#include "rl_rlog.h"
-#include "rl_platform.h"
-
-/*     VARIABLE DECLARATION SECTION */
-
-/* Thread-specific data key visible to all threads */
-static pthread_key_t   g_threadkey;
-
-pthread_mutex_t g_logmutex;
-THREAD_DATA* g_pCirList[RLOG_MAX_THREADS];
-void* rlAlloc(size_t mem_size)
-{
-       return malloc(mem_size);
-}
-
-void rlFree(void* pMem)
-{
-       free(pMem);
-}
-
-void* rlCalloc(size_t mem_size)
-{
-       return calloc(mem_size, 1);
-}
-
-void rlSetThreadSpecificData(const void *pThrData)
-{
-       int retVal = pthread_setspecific(g_threadkey, pThrData);
-       
-       if( retVal!=0 ) {
-      fprintf(stderr, "Failed to associate the value with the key or invalid key");
-      _exit(0);
-   }
-}
-
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-/*******************************************************************************************
-@param[in] pThreadData - Thread specific data
-@brief This function is called whenever thread is being destroyed. This function will delete 
-thread specific data allocated during thread registration.
-********************************************************************************************/
-void deInitThread(void* pThreadData)
-{
-
-       THREAD_DATA* pThrData = (THREAD_DATA*)(pThreadData);
-
-       if( pThreadData == NULL )
-               return;
-
-       /* lock the mutex, to make sure no one is accessing this buffer */
-       pthread_mutex_lock(&g_logmutex);
-
-       g_pCirList[pThrData->listIndex]  = NULL;
-
-       if( pThrData->logBuff != NULL )
-               rlFree(pThrData->logBuff);
-
-       rlFree(pThreadData);
-
-       /* unlock the mutex */
-       pthread_mutex_unlock(&g_logmutex);
-}
-#endif
-
-void* rlGetThreadSpecData(void)
-{
-       return (void*) pthread_getspecific(g_threadkey);
-}
-
-void rlInitPlatformSpecific(void)
-{
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-       pthread_key_create(&g_threadkey, &deInitThread);
-#endif
-}
-
-/**********************************************************************
-         End of file
- **********************************************************************/
diff --git a/src/rlog/rl_platform.h b/src/rlog/rl_platform.h
deleted file mode 100755 (executable)
index f90f4c5..0000000
+++ /dev/null
@@ -1,46 +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:     Radisys Logging Framework
-     Type:     C include file
-     Desc:     This file contains logging framework include file.
-     File:     rl_interface.h
-
-*********************************************************************21*/
-/***************************************************************************
-@ description: This is header file is used for platform specific 
-implementaion.
-****************************************************************************/
-
-#ifndef __RL_PLATFORME_H__
-
-void* rlAlloc(size_t memSize);
-void rlFree(void* pMem);
-void* rlCalloc(size_t memSize);
-void deInitThread(void* pThreadData);
-void* rlGetThreadSpecData(void);
-void rlSetThreadSpecificData(const void *pThrData);
-void rlInitPlatformSpecific(void);
-
-#endif /* __RL_PLATFORME_H__ */
-
-/**********************************************************************
-         End of file
-**********************************************************************/
diff --git a/src/rlog/rl_postproc.cpp b/src/rlog/rl_postproc.cpp
deleted file mode 100644 (file)
index fa17d28..0000000
+++ /dev/null
@@ -1,747 +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:     Radisys Logging Framework
-     Type:     C++ source file
-     Desc:     This file contains logging framework implementation.
-     File:     postproc.cpp
-
-*********************************************************************21*/
-///////////////////////////////////////////////////////////////////////////////
-// @ description: This is source file  contains the implementaion of binary log
-// postprocessor and has ability to connect to remote node and print live logs. 
-///////////////////////////////////////////////////////////////////////////////
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <sstream>
-#include <map>
-#include <list>
-#include <algorithm>
-#include <unistd.h>
-#include <pthread.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <getopt.h>
-#include <stdarg.h>
-#include <arpa/inet.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <arpa/inet.h>
-#include "rl_interface.h"
-#include "rl_rlog.h"
-
-#define TEST_MODE
-
-namespace cmdlinearg {
-int g_port = 0;
-std::string g_sFileDb;  /* File DB */
-std::string g_sLogDb;   /* Log DB */
-std::string g_sOutFile; /* Output file */
-std::string g_sBinLogFile; /* Input binary log file */
-std::string g_ipAddr;
-}
-
-typedef struct
-{
-  int lineno;
-  std::string modName;
-  std::string file;
-  std::string logStr;
-
-} LOG_INFO;
-
-static struct option long_options[] =
-{
-   {"port",   required_argument,   0, 'p'},
-   {"logdb",   required_argument,   0, 'l'},
-   {"ofile",  required_argument,   0, 'o'},
-   {"blog",   required_argument,   0, 'b'},
-   {"ipaddr",   required_argument,   0, 'i'},
-   {0, 0, 0, 0}
-};
-
-std::map<unsigned short, std::string> g_mFileInfo;
-std::map<LOGID, LOG_INFO> g_mLogInfo;
-FILE* g_fp=stderr;
-uint32_t g_ttiCount = 0;
-time_t g_basetimeSec;
-
-void readCmdLineArgs(int argc,char **argv);
-void printLogTime(LOGTIME & ltime);
-void loadLogDb();
-void printUsage();
-void logHexDump(ARGDATA & log);
-bool invalidLogId(LOGID logId);
-void openLogFile(const char* file);
-void logLevN(LOGDATA & log, LOG_INFO & logInfo, const char* fmtStr, ...);
-void logLevS(LOGDATA & log, LOG_INFO & logInfo, const char* fmtStr, const char *logStr);
-void logString(ARGDATA & log);
-void logIntArg(ARG4DATA* log);
-void logArgSpl(SPL_ARGDATA* log);
-void processLogs(int fd, bool (*fpReadLog)(int, ARGDATA &));
-
-bool readRemoteLogs(int sockfd, ARGDATA & log);
-bool readFileLogs(int fd, ARGDATA & log);
-int openBinLogFile();
-int connectToLogServer();
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @arg[in] argc  - Number of arguments
-// @arg[in] argv - Command line arguments
-// This is main functions, which calls a function to parse command line arguments. Then it loads
-// log metadata into memory. And then based on if its remote logging or binary log file parsing
-// passes apropriate function pointer to read and convert logs.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-int main(int argc, char* argv[])
-{
-  readCmdLineArgs(argc, argv);
-  loadLogDb();
-
-  if( !cmdlinearg::g_sBinLogFile.empty() ) 
-  {
-    if( !cmdlinearg::g_sOutFile.empty() )
-    {
-      openLogFile(cmdlinearg::g_sOutFile.c_str());
-
-      processLogs(openBinLogFile(), readFileLogs);
-      fclose(g_fp);
-    }
-  }
-
-  if( cmdlinearg::g_port != 0 ) {
-
-    if( !cmdlinearg::g_sOutFile.empty() ) {
-      openLogFile(cmdlinearg::g_sOutFile.c_str());
-    }
-      
-
-    processLogs(connectToLogServer(), readRemoteLogs);
-
-    fclose(g_fp);
-  }
-   return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] file - Input log file name
-// This function opens the log file in write mode.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void openLogFile(const char* file)
-{
-   g_fp = fopen(file, "w+");
-   
-  if( g_fp == NULL ) 
-  {
-      fprintf(stderr, "Failed to open log file %s\n", file);
-      _exit(0);
-   }
-
-   fprintf(stderr, "Log Output will be written in %s\n", file);
-}
-
-uint32_t swap_uint32( uint32_t val )
-{
-    val = ((val << 8) & 0xFF00FF00 ) | ((val >> 8) & 0xFF00FF ); 
-    return (val << 16) | (val >> 16);
-}
-
-
-unsigned long EndianSwap32(unsigned long x)
-{
-    unsigned long y=0;
-    y += (x & 0x000000FF)<<24;
-    y += (x & 0xFF000000)>>24;
-    y += (x & 0x0000FF00)<<8;
-    y += (x & 0x00FF0000)>>8;
-    return y;
-}
-
-void print_hex(const char* str, const uint8_t *p, int len)
-{
-  fprintf(stderr, "%s HEX \n", str);
-  for(int i=0; i<len; i++ ) fprintf(stderr, "%d ", p[i]);
-  fprintf(stderr, "\n");
-
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// This function open the log file in binary mode and checks if file header is correct or not.
-// It also sets the environment variable for given time zone in log file, so that time information
-// is converted to correct time zone times.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-int openBinLogFile()
-{
-  int fd = open(cmdlinearg::g_sBinLogFile.c_str(), O_RDONLY );
-
-  if( fd == -1) {
-      fprintf(stderr, "Failed to open log file %s\n", cmdlinearg::g_sBinLogFile.c_str());
-    _exit(0);
-  }
-
-  FILE_HEADER fileHdr;
-
-  int len = read(fd, (void*)&fileHdr, sizeof(FILE_HEADER));
-
-  if( fileHdr.END_MARKER != 0xFFFF ) {
-    fprintf(stderr, "Invalid file header\n");
-    _exit(0);
-  }
-
-  fprintf(stderr, "FILE ENDIAN: %s\n", fileHdr.endianType == big_endian ? "BIG ENDIAN" : "LITTLE ENDIAN");
-  fprintf(stderr, "TIME ZONE: %s\n", fileHdr.szTimeZone);
-
-  setenv("TZ", fileHdr.szTimeZone, 1);
-  tzset();
-
-  if( fileHdr.endianType == big_endian ) {
-  }
-  g_basetimeSec = fileHdr.time_sec;
-  return fd;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// This function connects to remote application which is using binary logging framework. If 
-// connection is failed log application exits.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-int connectToLogServer()
-{
-  int sockfd;
-  struct addrinfo hints;
-  struct addrinfo *res = NULL;
-  struct addrinfo *result = NULL;
-  int errcode;
-  char addrstr[100];
-  void *ptr = NULL;
-  struct sockaddr_in serv_addr;
-  struct sockaddr_in6 serv_addr6;
-  void *sockServAddr = NULL;
-  int ai_family = AF_UNSPEC;
-  int size = 0;
-
-  /* ccpu00147898 fixes */
-  memset(&hints, 0, sizeof(hints));
-  memset(&serv_addr, 0, sizeof(serv_addr));
-  memset(&serv_addr6, 0, sizeof(serv_addr6));
-  hints.ai_family = PF_UNSPEC;
-  hints.ai_socktype = SOCK_STREAM;
-  hints.ai_flags |= AI_CANONNAME;
-
-  errcode = getaddrinfo(cmdlinearg::g_ipAddr.c_str(), NULL, &hints, &res);
-  if(errcode != 0)
-  {
-    perror ("getaddrinfo");
-    return -1;
-  }
-
-  result = res;
-  while(res)
-  {
-    inet_ntop(res->ai_family, res->ai_addr->sa_data, addrstr, 100);
-
-    switch(res->ai_family)
-    {
-      case AF_INET:
-        ptr = &((struct sockaddr_in *) res->ai_addr)->sin_addr;
-        serv_addr.sin_addr = ((struct sockaddr_in *) res->ai_addr)->sin_addr;
-        sockServAddr = &serv_addr;
-        ai_family = res->ai_family; 
-        serv_addr.sin_family = res->ai_family;
-        serv_addr.sin_port = htons(cmdlinearg::g_port);
-        size =  sizeof(serv_addr);
-        break;
-      case AF_INET6:
-        ptr = &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr;
-        sockServAddr = &serv_addr6; 
-        /* Copy IPv6 address(16bytes) into the destination */ 
-        memcpy((unsigned char*)serv_addr6.sin6_addr.s6_addr, (unsigned char *)
-         &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr, 16);
-        ai_family = res->ai_family;
-        serv_addr6.sin6_family = res->ai_family;
-        serv_addr6.sin6_port = htons(cmdlinearg::g_port);
-        size =  sizeof(serv_addr6);
-        break;
-      default:
-        sockServAddr = NULL;
-        break;
-    }
-
-    if(ptr != NULL)
-    {
-       inet_ntop(res->ai_family, ptr, addrstr, 100);
-       printf ("IPv%d address: %s (%s)\n", res->ai_family == PF_INET6 ? 6 : 4,
-             addrstr, res->ai_canonname);
-    }
-    res = res->ai_next;
-  }
-  if(sockServAddr == NULL || size == 0)
-  {
-     fprintf(stderr, "Not able to parse server address\n");
-     _exit(0);
-  }
-
-  if( (sockfd = socket(ai_family, SOCK_STREAM,0)) < 0 ) {
-    fprintf(stderr, "Failed to create socket\n");
-    _exit(0);
-  }
-  
-  if( connect(sockfd, (const sockaddr*)sockServAddr, size) < 0 ) {
-    perror("ERROR Connecting");
-    _exit(0);
-  }
-
-  if(result != NULL)
-  {
-    freeaddrinfo(result);
-  }
-  return sockfd;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] sockfd - Socket file descriptor
-// @paramp[in] log  - Log data buffer
-// This function reads the log header and remaining log from socket descriptor. Will return false
-// if socket operation fails.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-bool readRemoteLogs(int sockfd, ARGDATA & log)
-{
-  int len;
-
-  while( (len = recv(sockfd, (void*)&log.logData, RLOG_FIXED_LENGTH_BUFFER_SIZE, MSG_WAITALL)) == 0 );
-  if( len < 0 ) {
-    return false;
-  }
-
-
-  return true;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] fd - input file descriptor
-// @param[out] log - Log header 
-// This function will read the log header and returns success if able to read.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-bool readFileLogs(int fd, ARGDATA & log)
-{
-  int len = read(fd, (void*)&log.logData, sizeof(LOGDATA));
-
-  if( len <= 0 ) {
-    return false;
-  }
-
-#ifdef RLOG_MULTI_CIRCULAR_BUFFER
-  if( log.logData.len && read(fd, (void*)log.buf, log.logData.len) <= 0 ) {
-    return false;
-  }
-#else
-   uint16_t size = RLOG_FIXED_LENGTH_BUFFER_SIZE - sizeof(LOGDATA);
-//  if( log.logData.len && read(fd, (void*)log.buf, size) <= 0 ) {
-  if( read(fd, (void*)log.buf, size) <= 0 ) {
-    return false;
-  }
-#endif
-
-  return true;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log1 - LOG 
-// @param[in] log2 - Second Log
-// This function compares the TTI of two consecutive logs.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-bool cmp_tti(ARGDATA & log1, ARGDATA & log2)
-{
-  return log2.logData.logTime.ms_tti > log1.logData.logTime.ms_tti ? true : false;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - Log data
-// This function calculates the time based on TTI & time reference associated with it. And thne 
-// calls the function to print logs in aprpriate text format.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void printLog(ARGDATA & log)
-{
-
-  if( invalidLogId(log.logData.logId) )
-    return;
-  
-  switch( log.logData.argType )
-  {
-    case LOG_ARG_INT:
-      logIntArg((ARG4DATA*)&log);
-      break;
-
-    case  LOG_ARG_STR:
-      logString(log);
-      break;
-
-    case LOG_ARG_HEX:
-      logHexDump(log);
-      break;
-
-    case LOG_ARG_SPL:
-      logArgSpl((SPL_ARGDATA*)&log);
-      break;
-  }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] fd - File or socket descriptor
-// @param[in] fpReadLog - Function pointer which reads either file or socket based log
-// This function reads the binary log file and does sorting of logs based on TTI and then calls the
-// function to print it
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void processLogs(int fd, bool (*fpReadLog)(int, ARGDATA &))
-{
-  ARGDATA log;
-  bool bSortingRequired = false, bStartBuffering = false;
-  std::list<ARGDATA> logList;
-
-  while((*fpReadLog)(fd, log)) 
-  {
-    if( log.logData.logId == L_TIME_DELIMITER ) 
-    {
-      bStartBuffering = (bStartBuffering == false) ? true : false;
-      if( bStartBuffering == true ) {
-        bSortingRequired = true;
-        continue;
-      }
-    }
-
-    if( bStartBuffering ) {
-      logList.push_back(log);
-      continue;
-    }
-  
-    if( bSortingRequired ) {
-      logList.sort(cmp_tti);  
-      std::for_each(logList.begin(), logList.end(), printLog);
-      logList.clear();
-      bSortingRequired = false;
-      bStartBuffering = false;
-      continue;
-    }
-
-    printLog(log);
-  }
-
-  /* connection was closed due to some error, but we still have some logs */
-  if( bStartBuffering && !logList.empty() ) 
-  {
-    logList.sort(cmp_tti);  
-    std::for_each(logList.begin(), logList.end(), printLog);
-  }
-
-  close(fd);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// This function convert binary log with integer data type into text format.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logIntArg(ARG4DATA* log)
-{
-#ifdef TEST_MODE
-//  printf("LOG ARG: INT, LEVEL: %s\n", g_logStr[log->logData.logLevel]);
-#endif
-  
-  LOG_INFO & logInfo = g_mLogInfo[log->logData.logId];
-  logLevN(log->logData,logInfo,logInfo.logStr.c_str(),log->arg1,log->arg2,log->arg3,log->arg4); 
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// This function converts binary log containg string into text format.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logString(ARGDATA & log)
-{
-#ifdef TEST_MODE
-//  printf("LOG ID %ld LOG ARG STRING, LEVEL: %s\n", log.logData.logId, g_logStr[log.logData.logLevel]);
-#endif
-  
-  LOG_INFO & logInfo = g_mLogInfo[log.logData.logId];
-  logLevS(log.logData, logInfo, logInfo.logStr.c_str(), log.buf); 
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// This function converts binary log containg hex dump into readable text format.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logHexDump(ARGDATA & log)
-{
-#ifdef TEST_MODE
-//  printf("LOG ARG HEX, LEVEL: %s\n", g_logStr[log.logData.logLevel]);
-#endif
-  
-  LOG_INFO & logInfo = g_mLogInfo[log.logData.logId];
-
-  char szHex[MAX_LOG_BUF_SIZE*3];
-   hextostr(szHex, log.buf, log.logData.len);
-
-  logLevN(log.logData, logInfo, logInfo.logStr.c_str(), szHex); 
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// @param[in] logInfo - Log information structure reference
-// @param[in] fmtStr - Formatted string
-// This function prints log into console or log file.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevN(LOGDATA & log, LOG_INFO & logInfo, const char* fmtStr, ...)
-{
-   va_list argList;
-  const char* file = logInfo.file.c_str();
-
-  printLogTime(log.logTime);
-   fprintf(g_fp, "[%s]%s:%d\n%s:", logInfo.modName.c_str(), file, logInfo.lineno, g_logStr[log.logLevel]);
-
-   va_start(argList,fmtStr);
-   vfprintf(g_fp, fmtStr, argList);
-   va_end(argList);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// @param[in] logInfo - Log information structure reference
-// @param[in] fmtStr - Formatted string
-// This function prints string log into console or log file.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevS(LOGDATA & log, LOG_INFO & logInfo, const char* fmtStr, const char* logStr)
-{
-   const char* file = logInfo.file.c_str();
-   std::string argStr(logStr, log.len);
-   printLogTime(log.logTime);
-   fprintf(g_fp, "[%s]%s:%d\n%s:", logInfo.modName.c_str(), file, logInfo.lineno, g_logStr[log.logLevel]);
-   fprintf(g_fp, fmtStr, argStr.c_str());
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// @param[in] logInfo - Log information structure reference
-// @param[in] fmtStr - Formatted string
-// This function prints log into console or log file.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevSpl(SPL_ARGDATA* log, LOG_INFO & logInfo, const char* fmtStr, ...)
-{
-   va_list argList;
-  const char* file = logInfo.file.c_str();
-
-  printLogTime(log->logData.logTime);
-   fprintf(g_fp, "[%s]%s:%d\n%s:%s:%d:", logInfo.modName.c_str(), file, logInfo.lineno, g_logStr[log->logData.logLevel], g_splStr[log->splEnum], log->splArg);
-
-   va_start(argList,fmtStr);
-   vfprintf(g_fp, fmtStr, argList);
-   va_end(argList);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] log - LOG Data
-// This function converts binary log with special arguments into text format.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logArgSpl(SPL_ARGDATA* log)
-{
-#ifdef TEST_MODE
-//  printf("LOG ARG SPL, LEVEL: %s\n", g_logStr[log->logData.logLevel]);
-#endif
-  LOG_INFO & logInfo = g_mLogInfo[log->logData.logId];
-  const char* file = logInfo.file.c_str();
-
-  logLevSpl(log, logInfo, logInfo.logStr.c_str(),log->arg1, log->arg2, log->arg3, log->arg4);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] ltime - Log time
-// This function prints log time using standard c formating function fprintf
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void printLogTime(LOGTIME & ltime)
-{
-  struct tm* tm;
-  time_t curTimeSec;
-  uint32_t secElapsedFromBeg;
-  uint32_t ttiNum; 
-  uint32_t miliseconds;
-
-  ttiNum = ltime.ms_tti;
-  secElapsedFromBeg = ttiNum/1000;
-  miliseconds = ttiNum%1000;
-  curTimeSec   = g_basetimeSec + secElapsedFromBeg;
-
-  /* Obtain the time of day, and convert it to a tm struct. --*/
-  tm = localtime (&curTimeSec);
-
-  if(NULL != tm) 
-   {
-      fprintf(g_fp,"[%d-%d-%d %d:%d:%d.%03d]", tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900,
-            tm->tm_hour, tm->tm_min,tm->tm_sec,miliseconds);
-   }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] logId - Log id which is unique to each log
-// This function checks if the given log id is valid based on the logdb information loaded into 
-// memory.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-bool invalidLogId(LOGID logId)
-{
-   /* if this is a time reference this is valid log */
-   if( g_mLogInfo.find(logId) == g_mLogInfo.end() )
-   {
-      if(logId != L_TIME_REFERENCE)
-      {
-         fprintf(stderr, "Invalid log id %d\n",logId);
-      }
-      return true;
-   }
-   return false;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// This function parse and reads the logdb file. Extracts the information and stores into map data
-// structure.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void loadLogDb()
-{
-  std::ifstream logdb(cmdlinearg::g_sLogDb.c_str());
-
-  if(logdb.is_open() == false) {
-    fprintf(stderr, "Failed to open file %s\n", cmdlinearg::g_sLogDb.c_str());
-    _exit(0);
-  }
-
-  LOGID logId; LOG_INFO logInfo;
-  std::string line;
-   std::string & lstr = logInfo.logStr;
-  
-  while( getline(logdb, line) )
-  {
-    std::istringstream iss(line);
-    int pos = 0, newpos=0;
-
-    logId = atol( line.substr(pos, newpos=line.find(';', pos)).c_str() );
-
-    pos = newpos+1;
-    logInfo.lineno = atol( line.substr(pos, (newpos=line.find(';', pos)) - pos).c_str() );
-
-    pos = newpos+1;
-    logInfo.modName = line.substr(pos, (newpos=line.find(';', pos)) - pos);
-
-    pos = newpos+3;
-    logInfo.file = line.substr(pos, (newpos=line.find('\"', pos)) - pos);
-
-      pos=line.find('\"',newpos+1) + 1;
-    logInfo.logStr = line.substr(pos, (newpos=line.find_last_of("\"", pos)) - pos);
-      lstr.erase(std::remove(lstr.begin(),lstr.end(),'\"')++,lstr.end());
-
-
-#ifdef TEST_MODE_0
-    std::cout << "LOG Id:" << logId << " FILE:" << logInfo.file << " lineno:" << logInfo.lineno;
-    std::cout << " MOD Name: " << logInfo.modName << std::endl;
-    std::cout << "LOG STR:[" << logInfo.logStr << "]" <<  std::endl;
-#endif
-
-    logInfo.logStr+= "\n\n";
-
-    g_mLogInfo[logId] = logInfo;
-  }
-
-  logdb.close();
-
-  logInfo.file = "NULL";
-  logInfo.lineno = 0;
-  logInfo.modName = "RLOG";
-  logInfo.logStr =  RLOG_SEGFAULT_STR; 
-  g_mLogInfo[L_SIGSEGV] = logInfo;
-  
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @arg[in] argc  - Number of arguments
-// @arg[in] argv - Command line arguments
-// This function parses the command line input parameters.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void readCmdLineArgs(int argc,char **argv)
-{
-  using namespace cmdlinearg;
-   /* getopt_long stores the option index here */
-   int c, option_index = 0;
-
-   while(  (c = getopt_long(argc, argv, "p:f:l:o:b:i:", long_options,&option_index)) != -1 )
-   {
-      switch(c)
-       {
-           case 'p':
-                std::cout<<"option -p with value = " << optarg << std::endl;
-                cmdlinearg::g_port = atoi(optarg);
-                break;
-           case 'f':
-                std::cout<<"option -f with value = "<< optarg << std::endl;
-                cmdlinearg::g_sFileDb = optarg;
-                break;
-           case 'l':
-                std::cout<<"option -l with value = "<< optarg << std::endl;
-                cmdlinearg::g_sLogDb = optarg;
-                break;
-           case 'o': 
-                std::cout<<"option -o with value = " << optarg << std::endl;
-                cmdlinearg::g_sOutFile = optarg;
-                break;
-           case 'b': 
-                std::cout<<"option -b with value = " << optarg << std::endl;
-                cmdlinearg::g_sBinLogFile = optarg;
-                break;
-           case 'i': 
-                std::cout<<"option -i with value = " << optarg << std::endl;
-                cmdlinearg::g_ipAddr = optarg;
-                break;
-        defult:
-          std::cout << "Invalid arguments" << std::endl;
-          exit(0);
-    }
-  }
-
-//  if( g_port == 0 && g_sBinLogFile.empty() )
-//    printUsage();
-
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// This functin prints the binary log application usage.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void printUsage()
-{
-  printf("Usage: postproc [-f <filedb> ] [-l <logdb>] [-b <binlog> | -p <port> ] [-o <outfile>] \n");
-  printf("\t[--filedb | -p <input file db > ]\n");
-  printf("\t[--logdb  | -l <input log db > ]\n");
-  printf("\t[--binlog | -b <input binary log file> ]\n");
-  printf("\t[--ofile  | -o <output text log file> ]\n");
-  printf("\t[--port   | -p <port number> ]\n");
-  _exit(0);
-}
-
-/**********************************************************************
-         End of file
-**********************************************************************/
diff --git a/src/rlog/rl_rlog.c b/src/rlog/rl_rlog.c
deleted file mode 100644 (file)
index d43526b..0000000
+++ /dev/null
@@ -1,1926 +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:     Radisys Logging Framework
-     Type:     C source file
-     Desc:     This file contains logging framework implementation.
-     File:     rl_rlog.c
-
-*********************************************************************21*/
-/**********************************************************************
- @ description: This is source file which has implementaion of logging 
- framework.
-************************************************************************/
-
-#include "envopt.h"
-#include "envdep.h"
-#include "stdint.h"
-#include "rl_interface.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <time.h>
-#include <stdarg.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <execinfo.h> 
-#include <dlfcn.h>
-#include <dirent.h>
-#include <pthread.h>
-#include "rl_rlog.h"
-#include "rl_platform.h"
-#include "gen.h"
-#include "ssi.h"
-#include "ss_msg.h"
-#include "ss_task.h"
-
-#include "gen.x"
-#include "ssi.x"
-
-#include "ss_queue.h"
-#include "ss_queue.x"
-#include "ss_task.x"
-#include "ss_msg.x"
-#include "cm_inet.h"
-#include "cm_inet.x"
-
-#include "rl_interface.h"
-#include "rl_soc.h"
-char g_fileName[MAX_FILENAME_LEN];
-char g_logDir[MAX_FILENAME_LEN];
-char g_fileList[RLOG_MAX_FILES][MAX_FILENAME_LEN];
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-static THREAD_DATA *g_pSingCirBuff = NULL;
-static uint16_t g_prevLogOffset=0;
-#endif
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-static volatile uint32_t g_rlogPositionIndex=0;
-uint32_t gIpType = CM_IPV4ADDR_TYPE; 
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//                             Default variable initilization
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-/* global file pointer */
-FILE* g_fp = NULL; 
-
-/* L2 Logging */
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-
-Data  *g_l2rlogBuf = NULLP;
-Data  *g_l2LogBufStartPtr = NULLP;
-Data  *g_l2LogBufBasePtr = NULLP;
-Data  *g_logBufRcvdFromL2 = NULLP;
-Data  *g_l2LogBaseBuff = NULLP;
-uint32_t    g_logBufLenRcvdFromL2 = 0;
-uint32_t    g_l2LogBufLen = 0;
-uint32_t    startL2Logging = 0;
-uint32_t    g_l2logBuffPos = 0;
-/* end */
-#endif /* Binary Logging */
-
-/* number of times log function is called */
-int  g_nWrites = 0;    
-
-/* Socke descriptor if remote client is connected */
-int g_nCliSocket = 0;
-
-/* Default log level Error */
-#ifdef DISABLE_RLOG
-int g_logLevel = 1;
-#else
-int g_logLevel = L_MAX_LOG_LEVEL;
-#endif
-/* MAX Log Files 1 */
-uint8_t g_nMaxLogFiles = 1; 
-
-/* Max File Size limit for each log file */
-uint32_t g_uiMaxFileSizeLimit = MAX_FILE_SIZE; 
-
-/* Default circular buffer size 100Kb*/
-uint32_t g_cirMaxBufferSize = RLOG_MAX_CIRBUF_SIZE; 
-
-/* Default mask for each module is disabled */
-uint32_t g_modMask = 0;
-/* Remote Logging port */
-static uint32_t g_nLogPort = RLOG_REMOTE_LOGGING_PORT;
-
-/* Current File Number index */
-int  g_nCurrFileIdx = 0; 
-
-/* Remote logging flag */
-static uint8_t g_bRemoteLoggingDisabled=1;
-
-/* Global file descriptor for L2 & L3 */
-static int g_fd;
-
-/* L2 Buffer */
-char g_l2Buf[RLOG_MAX_CIRBUF_SIZE];
-
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-/* List of thread data pointers */
-THREAD_DATA* g_pCirList[RLOG_MAX_THREADS];
-
-/* Number of threads registered */
-static int g_nThreadsRegistered;
-
-/* Mutex to protect circular buffers */
-pthread_mutex_t g_logmutex, g_condmutex;
-pthread_cond_t g_cond;
-
-uint8_t g_writeCirBuf = 0;
-
-static int thread_signalled;
-#endif
-
-/* TTI Count */
-static uint32_t numTtiTicks;
-/* Console input handling parameters */
-static int g_kIdx, g_action, g_storeKeys;
-static char g_keyBuf[32];
-
-/* Standard C library, timezone */
-char *tzname[2];
-///////////////////////////////////////////////////////////////////////////////
-//                  FUNCTION DECLARATIONS                                         //
-///////////////////////////////////////////////////////////////////////////////
-#if defined(RLOG_ENABLE_TEXT_LOGGING) 
-static struct tm* getTime(int* microseconds);
-static void getLogTimeStr(char* ts);
-#else
-#endif
-void initGlbDataAtL2(void);
-void createNewLogFile(void);
-void createL2LogFile(void);
-void* rLogServer(void* arg);
-void closeConnection(int sockfd);
-void storeTimeDelimeter(FILE* fp);
-void rlCatchSegViolation(int sig);
-void flushData(int sig);
-void* cirBufReaderThread(void* arg);
-void readCircularBuffers(void);
-void userAction(void);
-void handleSigIO(int sig);
-void rlPrintConfiguration(void);
-THREAD_DATA* rlRegisterThread(const char* taskName);
-void (*rlSigHandler)(int);
-/* L2 Logging */
-void rlInitL2Log(void);
-uint32_t g_rlogWriteCount = 0;
-uint32_t g_maxRlogCount   = 50;
-uint32_t g_logsDropCnt    = 0;
-RLLogCntLmt g_rlLogCntLimit = RL_LOG_COUNT_LIMIT_STOP;
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-void readL2LogBuff(void);
-S16 rlValidateL2LogBuf(void);
-void  rlSetL2LogBuf(uint8_t *l2LogBuf,uint32_t l2logLen);
-void rlResetL2LogBuf(void);
-#endif
-
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-EndianType getCPU_Endian(Void);
-void storeFileHeader(FILE* fp);
-void saveLogDataFromCpul(const void* buf, uint16_t len);
-void saveLogData(const void* buf, uint16_t len, uint32_t g_rlogWritePosIndex);
-void sendToPostProcessor(const void* buf, uint16_t len);
-void getLogTimeStr(char* ts);
-#endif
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] modMask - bit mask for any particular module.
-// Sets or clears bit for the particular module. If mask value is zero all bits are cleared.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetModuleMask(uint32_t modMask)
-{
-       g_modMask =  (modMask == 0 ) ? 0 : (g_modMask ^ modMask);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] - maxFileSize - Maximum file size in MB.
-// @brief This function sets the limit to log file size.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetLogFileSizeLimit(uint32_t maxFileSize)
-{
-       g_uiMaxFileSizeLimit = (maxFileSize == 0) ? MAX_FILE_SIZE : maxFileSize*1048576;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetNumOfLogFiles(uint8_t nMaxFiles)
-{
-       if( nMaxFiles > RLOG_MAX_FILES || nMaxFiles == 0 ) {
-               g_nMaxLogFiles = RLOG_MAX_FILES;
-               return;
-       }
-
-       g_nMaxLogFiles = nMaxFiles;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @brief 1-> enable remote logging, 0-> disable remote logging
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetRemoteLoggingFlag(S32 flag)
-{
-       g_bRemoteLoggingDisabled = !flag;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] port - Server port
-// @brief Use this API to configure port for remote logging application.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetLogPort(uint32_t port)
-{
-       g_nLogPort = port;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] enable_core - 1 Enables core file generation 0 - disable
-// This enables or disables core file generation
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlEnableDisableCore(S32 enable_core)
-{
-       struct rlimit core_limits;
-       core_limits.rlim_cur = core_limits.rlim_max = enable_core ? RLIM_INFINITY : 0;
-       setrlimit(RLIMIT_CORE, &core_limits);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetLogPath(const char* logDir)
-{
-       strncpy(g_logDir, logDir, MAX_FILENAME_LEN);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetLogFile(const char* fileName)
-{
-       strncpy(g_fileName, fileName, MAX_FILENAME_LEN);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetLogLevel(R_LOG_LEVEL logLevel)
-{
-       g_logLevel = logLevel + 1;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] bufSize - Circulaer buffer size in multiples of 1Kb or 1024 bytes.
-// This function is called to set circular buffer size for each thread.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlSetCircularBufferSize(uint32_t bufSize)
-{
-       g_cirMaxBufferSize = bufSize*1024;
-   g_cirMaxBufferSize = (g_cirMaxBufferSize/50) * 50;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlPrintConfiguration(void)
-{
-       fprintf(stderr, "Log File:\t\t[%s]\n", g_fileName);
-       fprintf(stderr, "Log level:\t\t[%s]\n", g_logStr[g_logLevel-1]);
-#ifndef ALIGN_64BIT 
-       fprintf(stderr, "Module Mask:\t\t[%ld]\n", g_modMask);
-       fprintf(stderr, "File Size Limit:\t[%ld]\n", g_uiMaxFileSizeLimit);
-#else
-       fprintf(stderr, "Module Mask:\t\t[%d]\n", g_modMask);
-       fprintf(stderr, "File Size Limit:\t[%d]\n", g_uiMaxFileSizeLimit);
-#endif
-       fprintf(stderr, "Maximum Log Files:\t[%d]\n", g_nMaxLogFiles);
-       fprintf(stderr, "Time Zone:\t\t[%s]\n", tzname[0]);
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING
-       fprintf(stderr, "Binary Logging:\t\t[Disabled]\n");
-       fprintf(stderr, "Remote Logging:\t\t[Disabled]\n");
-       fprintf(stderr, "Console Logging:\t[%s]\n", (g_fp==stderr) ? "Enabled" : "Disabled" );
-#else
-       fprintf(stderr, "Console Logging:\t[Disabled]\n");
-       fprintf(stderr, "Binary Logging:\t\t[Enabled]\n");
-       fprintf(stderr, "Remote Logging:\t\t[%s]\n", g_bRemoteLoggingDisabled ? "Disabled" : "Enabled");
-#ifndef ALIGN_64BIT 
-       fprintf(stderr, "Remote Logging Port:\t[%ld]\n", g_nLogPort);
-#else
-       fprintf(stderr, "Remote Logging Port:\t[%d]\n", g_nLogPort);
-#endif
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-       fprintf(stderr, "Circular Buffer:\t[Enabled]\n");
-#ifndef ALIGN_64BIT 
-       fprintf(stderr, "Circular BufferSize:\t[Actual:%ld][Derived:%ld]\n", 
-                       g_cirMaxBufferSize/1024, g_cirMaxBufferSize);
-#else
-       fprintf(stderr, "Circular BufferSize:\t[Actual:%d][Derived:%d]\n", 
-                       g_cirMaxBufferSize/1024, g_cirMaxBufferSize);
-#endif
-#else
-       fprintf(stderr, "Circular Buffer:\t[Disabled]\n");
-#endif  /* RLOG_USE_CIRCULAR_BUFFER */
-#endif /* RLOG_ENABLE_TEXT_LOGGING */
-
-}
-
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-
-#ifdef RLOG_USE_TTI_LOGGING
-#define CHECK_FILE_SIZE if( ++g_nWrites == 200 ) \
-{ \
-       g_nWrites = 0; \
-       logLev1(L_TIME_REFERENCE, L_ALWAYS, (uint32_t)time(NULL));\
-} 
-#else
-#define CHECK_FILE_SIZE
-#endif /* RLOG_USE_TTI_LOGGING */
-
-#else /* RLOG_USE_CIRCULAR_BUFFER */
-
-#ifdef RLOG_USE_TTI_LOGGING
-#define CHECK_FILE_SIZE if( ++g_nWrites == 200 ) \
-{ \
-       if( g_fp && ftell(g_fp) > g_uiMaxFileSizeLimit ) { \
-               createNewLogFile(); \
-       }\
-       g_nWrites = 0; \
-       logLev1(L_TIME_REFERENCE, L_ALWAYS, (uint32_t)time(NULL));\
-} 
-#else
-#define CHECK_FILE_SIZE if( ++g_nWrites == 200 ) \
-{ \
-       if( g_fp && ( (uint32_t)(ftell(g_fp)) > g_uiMaxFileSizeLimit) ) { \
-               createNewLogFile(); \
-       }\
-       g_nWrites = 0; \
-} 
-#endif /* RLOG_USE_TTI_LOGGING */
-#endif /*  RLOG_USE_CIRCULAR_BUFFER */
-
-
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-
-#define CHECK_CIRFILE_SIZE if( g_fp && ftell(g_fp) > g_uiMaxFileSizeLimit ) \
-       createNewLogFile(); 
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] tasName - Name of registering thread / task
-// This function registers the thread for writing logs. It creates thread specific buffers.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-THREAD_DATA* rlRegisterThread(const char* taskName)
-{
-       THREAD_DATA* pThrData = (THREAD_DATA*) rlCalloc(sizeof(THREAD_DATA));
-
-       if( pThrData == NULL ) {
-               fprintf(stderr, "Failed to allocate memory for thread %s\n", taskName);
-               _exit(0);
-       }
-
-       pthread_mutex_lock(&g_logmutex);
-
-       /* Allocate circular buffer */
-       pThrData->logBuff = (uint8_t*) rlAlloc(g_cirMaxBufferSize);
-
-       if( pThrData->logBuff == NULL ) {
-#ifndef ALIGN_64BIT
-               fprintf(stderr, "Failed to allocate memory [%ld] for thread %s\n",g_cirMaxBufferSize, taskName);
-#else
-               fprintf(stderr, "Failed to allocate memory [%d] for thread %s\n",g_cirMaxBufferSize, taskName);
-#endif
-               _exit(0);
-       }
-
-       /* store task name */
-       strcpy(pThrData->szTaskName, taskName);
-
-       //rlSetThreadSpecificData(pThrData);
-
-       pThrData->listIndex = g_nThreadsRegistered++;
-
-       /* Store this pointerin global list, to access it later */
-       g_pCirList[pThrData->listIndex]  = pThrData;
-
-       pthread_mutex_unlock(&g_logmutex);
-
-#ifdef RLOG_DEBUG_MODE
-#ifndef ALIGN_64BIT
-       fprintf(stderr, "rlRegisterThread: allocated CIRCULAR BUFFER of size [%ld]\n", g_cirMaxBufferSize);
-#else
-       fprintf(stderr, "rlRegisterThread: allocated CIRCULAR BUFFER of size [%d]\n", g_cirMaxBufferSize);
-#endif
-       fprintf(stderr, "rlRegisterThread: Total registered threads [%d]\n", g_nThreadsRegistered);
-#endif
-
-       return pThrData;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] arg - Thread argument
-//     This thread wakes up periodically and transfer logs from thread specific buffer into file system.
-// If buffer is going to be full, this thread is signalled asynchrounously to read buffered logs.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void* cirBufReaderThread(void* arg)
-{
-       struct timespec timeout;
-       int retCode;
-
-#ifdef RLOG_DEBUG_MODE
-       fprintf(stderr, "Circular Buffer Reader thread started\n");
-#endif
-
-       while(1)
-       {
-               /*this thread is not active and waiting to timeout */
-               thread_signalled = 0;
-
-               /* set the thread timeout */
-               timeout.tv_sec = time(NULL) + RLOG_CIRBUF_READ_INTERVAL;
-               timeout.tv_nsec = 0;
-
-               /* wait for 120 seconds time interval to read buffer */
-               retCode = pthread_cond_timedwait(&g_cond, &g_condmutex, &timeout);
-
-               /* this means, this thread is already active, no need to give any other signal to wake up */
-               thread_signalled = 1;
-
-#ifdef RLOG_DEBUG_MODE
-               //if(retCode == 0) fprintf(stderr, "cirBufReaderThread: I am signalled to read data\n");
-#endif
-
-               /* If someone has given signal or there is timeout */
-               if( retCode == 0 || retCode  == ETIMEDOUT ){
-                       readCircularBuffers();
-                       continue;
-               }
-
-               readCircularBuffers();
-
-#ifdef RLOG_DEBUG_MODE
-               fprintf(stderr, "System is exiting ??");
-               perror("cirBufReaderThread");
-#endif
-               break;
-       }
-
-       return NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void readCircularBuffers()
-{
-   uint32_t i, writerPos;
-
-   /* Check if process is L2. If L2 then return from here */
-   if (SFndProcId() == TENB_L2_PROC_ID) 
-   {
-      return;
-   }
-
-   g_writeCirBuf = 1;
-   /* Before reading circular buffers, store delimiter */
-   //storeTimeDelimeter(g_fp);
-
-   /* lock the mutex */
-   pthread_mutex_lock(&g_logmutex);
-
-   for(i=0; i < g_nThreadsRegistered; i++) 
-   {
-      THREAD_DATA* pThrData = g_pCirList[i];
-
-      if( pThrData == NULL )
-         continue;
-
-      writerPos = pThrData->logBufLen;
-
-#ifdef RLOG_DEBUG_MODE
-      //fprintf(stderr, "Thread [%ld] WritePos:[%ld] ReadPos:[%ld]\n", i+1, writerPos, pThrData->logReadPos);
-#endif
-
-      if( pThrData->logReadPos < writerPos  )
-      {
-         /* Calculate the delta data to be read from buffer */
-         int dataLen = writerPos - pThrData->logReadPos;
-
-         /* Write the data into file */
-         if( fwrite(pThrData->logBuff+pThrData->logReadPos,1, dataLen, g_fp) == -1 ) 
-         {
-#ifdef RLOG_DEBUG_MODE
-            fprintf(stderr, "Failed to write data len %d\n", dataLen);
-#endif
-            createNewLogFile();
-            continue;
-         }
-         /* reset log read position to last known position */
-         pThrData->logReadPos = writerPos;
-      }
-      else if ( pThrData->logReadPos > writerPos ) 
-      {
-         /* Calculate the remaining data left in the buffer */
-         int dataLen = g_cirMaxBufferSize -  pThrData->logReadPos;                     
-
-         /* Write from last know position till end */
-         if( fwrite(pThrData->logBuff+pThrData->logReadPos, 1, dataLen, g_fp) == -1 )
-         {
-#ifdef RLOG_DEBUG_MODE
-            fprintf(stderr, "Failed to write data len %d\n", dataLen);
-#endif
-            createNewLogFile();
-            continue;
-         }
-
-         /* Write from 0 to len position */
-         if( fwrite(pThrData->logBuff, 1, writerPos, g_fp) == -1 )
-         {
-#ifdef RLOG_DEBUG_MODE
-            fprintf(stderr, "Failed to write data len %d\n", dataLen);
-#endif
-            createNewLogFile();
-            continue;
-         }
-
-         /* reset log read position to last known position */
-         pThrData->logReadPos = writerPos;
-      }
-   }
-
-   /* unlock the mutex */
-   pthread_mutex_unlock(&g_logmutex);
-
-   /* after reading circular buffers also store delimiter */
-   //storeTimeDelimeter(g_fp);
-
-   CHECK_CIRFILE_SIZE
-
-      g_writeCirBuf = 0;
-}
-
-#endif
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-EndianType getCPU_Endian(Void)
-{
-    unsigned short x;
-    unsigned char c;
-    x = 0x0001;
-    c = *(unsigned char *)(&x);
-
-       return ( c == 0x01 ) ? little_endian : big_endian;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void storeFileHeader(FILE* fp)
-{
-       FILE_HEADER fileHdr;
-
-       memset(&fileHdr, 0, sizeof(FILE_HEADER));
-
-       fileHdr.endianType = getCPU_Endian();
-       fileHdr.dummy32 = 2818049;
-       fileHdr.END_MARKER = 0xFFFF;
-       strncpy(fileHdr.szTimeZone, tzname[0], RLOG_TIME_ZONE_LEN);
-   
-   fileHdr.time_sec = time(NULL);
-       if( fwrite((const void*)&fileHdr, 1, sizeof(FILE_HEADER), fp) ==  -1 )
-       {
-#ifdef RLOG_DEBUG_MODE
-               fprintf(stderr, "Failed to write file header\n");
-#endif
-               createNewLogFile();
-       }
-}
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] fileName - Log File Name
-// @brief This function creates a log file. If log file name is stdout & text  logging is enabled,
-// file  pointer is  initialized to  standard output. This  function also  creates thread on which 
-// remote application can connect & receive binary logs. If circular buffer is enabled, it creates 
-// thread key, which is used to store & retrieve thread specific buffers and data.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlInitLog(uint8_t type)
-{
-#ifdef SS_RBUF    
-        /* Initilize the signal handler */
-        rlSigHandler = &rlCatchSegViolation;
-#else
-       signal(SIGSEGV, rlCatchSegViolation);
-       signal(SIGBUS, rlCatchSegViolation);
-       signal(SIGINT, flushData);
-#endif
-/* set rate limit count for L3 Logs */
-   g_maxRlogCount = RLOG_LIMIT_L3_COUNT;
-
-#ifdef RLOG_DEBUG_MODE
-       rlPrintConfiguration();
-#endif /* RLOG_DEBUG_MODE */
-
-#if RLOG_ALLOW_CONSOLE_LOGS
-       if( !strcmp(g_fileName, "stdout")) {
-               g_fp = stderr;
-               return;
-       }
-#endif
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-       {
-      printf("\n IP Type before reader thread spawn [%d]\n",type);
-       /* Allocate circular buffer */
-      gIpType = type;
-               pthread_t tid;
-               if( pthread_create(&tid, NULL, &rLogServer, NULL) != 0 ) {
-                       fprintf(stderr, "Failed to initialize log server thread\n");
-                       _exit(0);
-               }
-       }
-
-       rlInitPlatformSpecific();
-
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-       {
-               pthread_t tid;
-               pthread_mutex_init(&g_logmutex, NULL);
-               if( pthread_create(&tid, NULL, &cirBufReaderThread, NULL) != 0 ) {
-                       fprintf(stderr, "Failed to initialize log server thread\n");
-                       _exit(0);
-               }
-/* Initialize single circular buffer for all threads */
-   g_pSingCirBuff = rlRegisterThread("DUMMY");
-}
-
-#endif
-#endif
-
-       createNewLogFile();
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlInitL2Log 
-//  @Discription : This will be trigigered from cl init function to
-//                 allocate buffer from shared memory and to intialize
-//                 the buffer
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-void rlInitL2Log(void)
-{
-
-/* set rate limit count for L3 Logs */
-   g_maxRlogCount = RLOG_LIMIT_L2_COUNT;
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-/* Initialise memory to write logs in L2. This is soc specific 
-   function present in soc file. */ 
-   rlInitL2SocSpecific();
-
-#else
-
-/* This is used to initialize global variable at L2 */
-   initGlbDataAtL2();
-   createL2LogFile();
-
-#endif /* Binary Logging */
-}
-
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// @param[in] arg - Input thread argument - IP Address type.
-// @brief This is log server thread which listens on configred port. This allows user to connect to
-// log server and view log data live.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void*  rLogServer(void* arg)
-{
-  CmInetCmnSockAddr serv_addr;
-  CmInetCmnSockAddr cli_addr;
-  int sockfd;
-  int newsockfd;
-  int clilen = 0;
-  int domain = AF_INET;
-  memset(&serv_addr, 0, sizeof(serv_addr));
-
-
-  if(gIpType == CM_IPV4ADDR_TYPE)
-  {
-#ifndef ALIGN_64BIT
-     printf("Initializing RLOG for IPV4- %ld\n",gIpType);
-#else
-     printf("Initializing RLOG for IPV4- %d\n",gIpType);
-#endif
-     clilen = serv_addr.len = sizeof(struct sockaddr_in);
-     domain = AF_INET;
-     serv_addr.type = CM_IPV4ADDR_TYPE;
-     serv_addr.u.addr.sin_family = AF_INET;
-     serv_addr.u.addr.sin_addr.s_addr = INADDR_ANY;
-     serv_addr.u.addr.sin_port = htons(g_nLogPort);
-  }
-  else
-  {
-#ifndef ALIGN_64BIT
-     printf("Initializing RLOG for IPV6 - %ld\n",gIpType);
-#else
-     printf("Initializing RLOG for IPV6 - %d\n",gIpType);
-#endif
-#ifdef IPV6_SUPPORTED   
-     if(gIpType == CM_IPV6ADDR_TYPE)
-     {
-        clilen =  serv_addr.len = sizeof(struct sockaddr_in6);
-        domain = AF_INET6;
-        serv_addr.type = CM_IPV6ADDR_TYPE;
-        serv_addr.u.addr6.sin6_family = AF_INET6;
-        serv_addr.u.addr6.sin6_addr = in6addr_any;
-        serv_addr.u.addr6.sin6_port = htons(g_nLogPort);
-     }
-#endif
-  }
-       if( (sockfd = socket(domain, SOCK_STREAM, 0)) < 0 ) {
-               fprintf(stderr, "RLOG: Failed to create socket\n");
-               _exit(0);
-       }
-
-       if( bind(sockfd, (struct sockaddr*)&(serv_addr.u),serv_addr.len) < 0 ) {
-               fprintf(stderr, "RLOG: Error in Binding\n");
-               perror("RLOG");
-               _exit(0);
-       }
-
-       listen(sockfd, 5);
-
-       while(1)
-       {
-               newsockfd = accept(sockfd, (struct sockaddr*)&(cli_addr.u), (socklen_t *) &clilen);     
-               if( newsockfd < 0 ) {
-                       fprintf(stderr, "RLOG: Error on accept\n");
-                       perror("RLOG");
-                       return 0;
-               }
-
-               /* If remote logging is disabled or there is already 1 client connected */
-               if( g_bRemoteLoggingDisabled || g_nCliSocket ) {
-                       /* close the new connection and proceed */
-                       closeConnection(newsockfd);
-                       continue;
-               } 
-
-               g_nCliSocket = newsockfd;
-       }
-
-       return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void closeConnection(int sockfd)
-{
-       shutdown(sockfd, SHUT_RDWR);
-       close(sockfd);
-}
-
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void  handleSigIO(int sig)
-{
-       char ch;
-
-       if( read(0, &ch, 1) <= 0 )
-               return;
-
-       rlHandleConInput(ch);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-int rlHandleConInput(char ch)
-{
-       if( ch == RLOG_CTRL_L ) {
-               g_storeKeys = 1;
-               g_action = RLOG_SET_LOGLEVEL;
-               fprintf(stderr, "\nEnter new log level:");
-               return 1;
-       }
-
-       if( ch == RLOG_CTRL_Y ) {
-               g_storeKeys = 1;
-               g_action = RLOG_SET_MODMASK;
-               fprintf(stderr, "\nEnter module number:");
-               return 1;
-       }
-
-       if( ch == RLOG_ENTER_KEY && g_action ) {
-               g_keyBuf[g_kIdx] = '\0';  
-               userAction();
-               return 1;
-       }
-
-       if( g_storeKeys ) { 
-               g_keyBuf[g_kIdx] = ch;
-               g_kIdx +=1;
-       }
-
-       return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void userAction()
-{
-       unsigned int val = atol(g_keyBuf);
-
-       switch( g_action )
-       {
-               case RLOG_SET_LOGLEVEL:
-                       {
-                               if( val >= L_MAX_LOG_LEVEL )
-                                       fprintf(stderr, "Invalid log level\n");
-                               else 
-                               {
-                                       if( val > L_FATAL ) 
-                                       {
-                                               rlSetLogLevel((R_LOG_LEVEL)val);
-                                               fprintf(stderr, "New Log level is %s\n", g_logStr[val]);
-                                       }
-                                       else
-                                               fprintf(stderr, "Log level below L_ERROR is not allowed\n");
-                               }
-                       }       
-                       break;
-
-               case RLOG_SET_MODMASK:
-                       {
-                               rlSetModuleMask(val);
-                               fprintf(stderr, "Toggled log mask %d\n", val);
-                       }
-                       break;
-       }
-
-       g_action = 0;
-       g_kIdx= 0; 
-       g_storeKeys = 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void rlCatchSegViolation(int sig)
-{
-       int i, nStrLen, nDepth;
-
-       void    *stackTraceBuf[RLOG_MAX_STACK_DEPTH];
-       const char* sFileNames[RLOG_MAX_STACK_DEPTH];
-       const char* sFunctions[RLOG_MAX_STACK_DEPTH];
-
-       char **strings; char buf[RLOG_MAX_STACK_DEPTH*128]={0};
-#ifdef T2K_MEM_LEAK_DBG
-   DumpT2kMemLeakInfoToFile();
-#endif
-#ifdef SSI_STATIC_MEM_LEAK_DETECTION
-   DumpStaticMemLeakFiles();
-#endif
-
-       nDepth = backtrace(stackTraceBuf, RLOG_MAX_STACK_DEPTH);
-
-
-       strings = (char**) backtrace_symbols(stackTraceBuf, nDepth);
-
-       for(i = 0, nStrLen=0; i < nDepth; i++)
-       {
-               sFunctions[i] = (strings[i]);
-               sFileNames[i] = "unknown file";
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-          logLevS(L_SIGSEGV, L_FATAL, strings[i]);
-#endif
-      printf("BT[%d] : len [%ld]: %s\n",i, (PTR)strlen(sFunctions[i]),strings[i]);
-               sprintf(buf+nStrLen, "   in Function %s (from %s)\n", sFunctions[i], sFileNames[i]);
-               nStrLen += strlen(sFunctions[i]) + strlen(sFileNames[i]) + 15;
-       }
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING
-       logLevS(g_logStr[L_FATAL], "RLOG", "NULL", 0, FMTSTR RLOG_SEGFAULT_STR, buf);
-       fflush(g_fp);
-#else
-       logLevS(L_SIGSEGV, L_FATAL, buf);
-#endif
-
-       flushData(SIGSEGV);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void flushData(int sig)
-{
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-       readCircularBuffers();
-#endif
-   g_rlogWriteCount = 0;
-
-       fclose(g_fp);
-
-        if(SIGSEGV == sig)
-        {
-           signal(sig, SIG_DFL);
-           kill(getpid(), sig);
-        }
-        else
-        {
-           exit(0);
-        }
-
-        return;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING 
-
-#define TIME_PARAMS tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900,tm->tm_hour, tm->tm_min,tm->tm_sec,microseconds
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevS(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR str, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-   if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, str);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevH(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR hexdump, int hexlen, ...)
-{
-       int microseconds=0;
-       char szHex[MAX_LOG_BUF_SIZE*3];
-
-       struct tm* tm = getTime(&microseconds);
-       hextostr(szHex, hexdump, hexlen);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, szHex);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevE(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, R_SPL_ARG splType,
-               uint32_t splVal, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, g_splStr[splType], splVal, 
-                       arg1, arg2, arg3, arg4);
-
-       CHECK_FILE_SIZE
-}
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLev0(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLev1(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, arg1);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLev2(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, uint32_t arg2, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, arg1, arg2);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLev3(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, 
-               uint32_t arg1, uint32_t arg2, uint32_t arg3, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, arg1, arg2, arg3);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLev4(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, 
-               uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...)
-{
-       int microseconds=0;
-
-       struct tm* tm = getTime(&microseconds);
-       if (tm) fprintf(g_fp, fmtStr, TIME_PARAMS, modName, file, lineno, strLogLevel, arg1, arg2, arg3, arg4);
-
-       CHECK_FILE_SIZE
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void logLevN(int logLevel, const char* modName, const char* file, int lineno, const char* fmtStr, ...)
-{
-       va_list argList;
-       char szTime[RLOG_MAX_TIME_STAMP];
-       char szLog1[MAX_LOG_LEN], szLog2[MAX_LOG_LEN];
-
-       getLogTimeStr(szTime);
-       snprintf(szLog1, MAX_LOG_LEN, "[%s][%s]%s:%d\n%s:", szTime, modName, file, lineno, g_logStr[logLevel]);
-
-       va_start(argList,fmtStr);
-       vsnprintf(szLog2, MAX_LOG_LEN, fmtStr, argList);
-       va_end(argList);
-
-       fprintf(g_fp, "%s%s",szLog1, szLog2);
-
-       CHECK_FILE_SIZE
-}
-#else /* BINARY LOGGING */ 
-
-#define RLOG_SAVE_TIME(_logTime) _logTime.ms_tti=numTtiTicks;
-
-void saveLogDataFromCpul(const void* buf, uint16_t len)
-{
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-   THREAD_DATA* p = (THREAD_DATA*) g_pSingCirBuff;
-
-   if( (p->logBufLen+len) > g_cirMaxBufferSize )
-   {
-      S32 tempLen = g_cirMaxBufferSize - p->logBufLen;
-      S32 remlen = len-tempLen;
-      if ((tempLen < 0) || (remlen < 0))
-      {
-         return;
-      }
-               if(remlen == 0)
-               {
-                       g_rlogPositionIndex = 0;
-         g_prevLogOffset = 0; 
-               }
-               else
-               {
-                       g_rlogPositionIndex = remlen/50;
-               }
-
-      /* we are unlikely to hit this condition, but to prevent corruption of binary logs */
-      /* we cannot write the data, if we write, data will be corrected forever */
-      if( remlen > p->logReadPos ) 
-      {
-         fprintf(stderr, "cannot write data.retune buffer parameters\n");
-         return;
-      }
-               if( (p->logReadPos -  remlen) < RLOG_READ_POS_THRESHOLD && !thread_signalled ) 
-      {
-                       pthread_cond_signal(&g_cond); /* this will wakeup thread */
-               }
-
-
-      /* Copy data till end of the buffer */
-      memcpy(p->logBuff+p->logBufLen, buf, tempLen);
-      /* Copy remaining data from the start of buffer */
-      memcpy(p->logBuff, ((const uint8_t *)buf)+tempLen, remlen);
-      /* Store buffer length position */
-      p->logBufLen = len-tempLen;
-   }
-   else
-   {
-      /* if reader is far behind and writer is reaching reader position, diff < 5Kb */
-      /* its time to wakeup thread if reader has not read much of data */
-      if( p->logReadPos > p->logBufLen && (p->logReadPos - p->logBufLen) < RLOG_READ_POS_THRESHOLD && !thread_signalled ) 
-         pthread_cond_signal(&g_cond); /* this will wakeup thread */
-
-               g_rlogPositionIndex += (len/50);
-      memcpy(p->logBuff+p->logBufLen, buf, len);
-      p->logBufLen += len;
-   }
-#else 
-   /* Directly write received buffer in cpuh log file */
-   if( fwrite((const void*)buf, 1, len, g_fp) == -1 ) 
-   {
-#ifdef RLOG_DEBUG_MODE
-      fprintf(stderr, "Failed to write log data in file\n");
-      perror("LOG");
-#endif
-      createNewLogFile();
-   }
-#endif
-
-}
-
-void saveLogData(const void* buf, uint16_t len, uint32_t g_rlogWritePosIndex)
-{
-
-   ++g_rlogWriteCount ;
-
-   if((1 == g_writeCirBuf) || 
-         ((g_rlLogCntLimit == RL_LOG_COUNT_LIMIT_START) && 
-          (g_rlogWriteCount > g_maxRlogCount)) || 
-         (len > RLOG_FIXED_LENGTH_BUFFER_SIZE))
-   {
-      g_rlogPositionIndex --;
-      g_logsDropCnt++;
-      return;
-   }
-
-   /* check for if L2 is going to store logs */
-   if (SFndProcId() == TENB_L2_PROC_ID) 
-   {
-      if((g_l2LogBufLen + RLOG_FIXED_LENGTH_BUFFER_SIZE) < L2LOG_BUFF_BLOCK_SIZE - sizeof(g_l2LogBufLen) )
-      {
-         /* copying logs in shared buffer */
-         memcpy(g_l2LogBufStartPtr, buf, len);
-
-         g_l2LogBufStartPtr += RLOG_FIXED_LENGTH_BUFFER_SIZE;
-         /* increasing total log length with L2 log length */
-         g_l2LogBufLen += RLOG_FIXED_LENGTH_BUFFER_SIZE;
-      }
-      return;
-   }
-#ifdef RLOG_USE_CIRCULAR_BUFFER
-   uint32_t logWritePointerPosition;
-   THREAD_DATA* p = (THREAD_DATA*) g_pSingCirBuff;
-
-   /* if buffer is about to full, write till end and continue writing from begining */
-   if( ((g_rlogWritePosIndex+1) * RLOG_FIXED_LENGTH_BUFFER_SIZE) > g_cirMaxBufferSize ) 
-   {
-      /* setting this flag to 1 to avoid other threads
-         to write in same circular buffer */
-      g_writeCirBuf = 1;
-      /* Start globalPositionIndex again */
-      g_rlogPositionIndex = 0;
-
-      /* if reader has not read initial data, minmum buffer size should be 100Kb */
-      if( p->logReadPos < RLOG_READ_POS_THRESHOLD && !thread_signalled ) {
-         pthread_cond_signal(&g_cond); /* this will wakeup thread */
-      }
-
-      /* we are unlikely to hit this condition, but to prevent corruption of binary logs */
-      /* we cannot write the data, if we write, data will be corrected forever */
-      if( RLOG_FIXED_LENGTH_BUFFER_SIZE > p->logReadPos ) {
-         fprintf(stderr, "cannot write data.retune buffer parameters\n");
-         return;
-      }
-
-      /* Copy data from the start of buffer */
-      memcpy(p->logBuff, buf, len);
-      /* Store buffer length position */
-      p->logBufLen = RLOG_FIXED_LENGTH_BUFFER_SIZE;
-      g_prevLogOffset = 0;
-      /* setting this flag to 0 so that other threads
-         will start writing in circular buffer */
-      g_writeCirBuf = 0;
-   }
-   else 
-   {
-      /* if reader is far behind and writer is reaching reader position, diff < 5Kb */
-      /* its time to wakeup thread if reader has not read much of data */
-      if( p->logReadPos > p->logBufLen && (p->logReadPos - p->logBufLen) < RLOG_READ_POS_THRESHOLD ) 
-         pthread_cond_signal(&g_cond); /* this will wakeup thread */
-
-      logWritePointerPosition = (g_rlogWritePosIndex * RLOG_FIXED_LENGTH_BUFFER_SIZE) + g_prevLogOffset;
-
-      memcpy(p->logBuff+logWritePointerPosition, buf, len);
-      p->logBufLen += RLOG_FIXED_LENGTH_BUFFER_SIZE;
-   }
-#else /* !RLOG_USE_CIRCULAR_BUFFER */
-   if( fwrite((const void*)buf, 1, RLOG_FIXED_LENGTH_BUFFER_SIZE, g_fp) == -1 ) 
-   {
-#ifdef RLOG_DEBUG_MODE
-      fprintf(stderr, "Failed to write log data in file\n");
-      perror("LOG");
-#endif
-      createNewLogFile();
-   }
-#endif /* RLOG_USE_CIRCULAR_BUFFER */
-
-   CHECK_FILE_SIZE
-
-      /* If post processor connected send logs */
-      if( g_nCliSocket &&  send(g_nCliSocket, buf, RLOG_FIXED_LENGTH_BUFFER_SIZE, 0 ) == -1 ) {
-         closeConnection(g_nCliSocket);
-         g_nCliSocket = 0;
-      }
-
-#ifdef RLOG_DEBUG_MODE_2
-   {
-      static int maxlen = 0;
-      if(len > maxlen) {
-         maxlen = len;
-         fprintf(stderr, "MAX BUFFER SIZE is binary mode is [%d]\n", maxlen);
-      }
-   }
-#endif
-
-}
-
-void sendToPostProcessor(const void* buf, uint16_t len)
-{
-   if( send(g_nCliSocket, buf, len, 0 ) == -1 ) {
-      perror("ERROR Sending");
-      closeConnection(g_nCliSocket);
-      g_nCliSocket = 0;
-   }
-}
-void logLevS( LOGID logId, R_LOG_LEVEL logLevel, const char* str, ...)
-{
-   ARGDATA arg; uint16_t bufsize;
-
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_STR;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 1;
-   arg.logData.len = strlen(str);
-
-   memcpy(arg.buf, (const void*)str, arg.logData.len);
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-
-void logLevH( LOGID logId, R_LOG_LEVEL logLevel, PSTR hex, int hexlen, ...)
-{
-   ARGDATA arg;
-   int bufsize;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_HEX;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 1;
-   arg.logData.len = hexlen;
-
-   memcpy(arg.buf, (const void*)hex, hexlen);
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-void logLevE(LOGID logId, R_LOG_LEVEL logLevel, R_SPL_ARG splType, uint32_t splVal, uint32_t arg1, uint32_t arg2,
-      uint32_t arg3, uint32_t arg4, ...)
-{
-   SPL_ARGDATA arg;
-   int bufsize;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_SPL;
-   arg.logData.logLevel = logLevel;
-   if( arg1 ) {
-      arg.logData.numOfArgs = (arg2 == 0 ) ? 1 : (arg3==0 ? 2 : (arg4==0 ? 3 : 4));
-   } else {
-      arg.logData.numOfArgs = 0;
-   }
-
-   arg.logData.len  = sizeof(u_int8_t) + sizeof(uint32_t) + (sizeof(uint32_t)*arg.logData.numOfArgs);
-
-   arg.splEnum = splType;
-   arg.splArg = splVal;
-   arg.arg1 = arg1;
-   arg.arg2 = arg2;
-   arg.arg3 = arg3;
-   arg.arg4 = arg4;
-
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-
-void logLev0( LOGID logId, R_LOG_LEVEL logLevel, ...)
-{
-   //LOGDATA logData;
-   ARG4DATA arg;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_STR;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 0;
-   arg.logData.len = 0;
-
-   saveLogData((const void*)&arg, sizeof(LOGDATA),g_rlogPositionIndex++);      
-}
-
-void logLev1( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, ...)
-{
-   ARG4DATA arg;
-   int bufsize;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_INT;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 1;
-   arg.logData.len = sizeof(uint32_t);
-
-   arg.arg1 = arg1;
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-void logLev2( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, ...)
-{
-   ARG4DATA arg;
-   int bufsize;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_INT;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 2;
-   arg.logData.len =  2 * sizeof(uint32_t);
-
-   arg.arg1 = arg1;
-   arg.arg2 = arg2;
-
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-void logLev3( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, ...)
-{
-   ARG4DATA arg;
-   int bufsize;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_INT;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 3;
-   arg.logData.len = 3 * sizeof(uint32_t);
-
-   arg.arg1 = arg1;
-   arg.arg2 = arg2;
-   arg.arg3 = arg3;
-
-   bufsize = sizeof(LOGDATA)+arg.logData.len;
-
-   saveLogData((const void*)&arg, bufsize,g_rlogPositionIndex++);      
-}
-void logLev4( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...)
-{
-   ARG4DATA arg;
-
-   RLOG_SAVE_TIME(arg.logData.logTime);
-
-   arg.logData.logId = logId;
-   arg.logData.argType = LOG_ARG_INT;
-   arg.logData.logLevel = logLevel;
-   arg.logData.numOfArgs = 4;
-   arg.logData.len = 4 * sizeof(uint32_t);
-
-   arg.arg1 = arg1;
-   arg.arg2 = arg2;
-   arg.arg3 = arg3;
-   arg.arg4 = arg4;
-
-   saveLogData((const void*)&arg, sizeof(ARG4DATA),g_rlogPositionIndex++);     
-}
-
-#endif /* BINARY LOGGING */
-
-#if defined(RLOG_ENABLE_TEXT_LOGGING) 
-struct tm* getTime(int* microseconds)
-{
-#ifndef SS_LINUX
-   struct timespec ptime;
-#else
-   struct timeval ptime;
-#endif
-
-#ifndef SS_LINUX
-   clock_gettime(CLOCK_REALTIME, &ptime);
-   *microseconds = ptime.tv_nsec / 1000;
-#else
-   gettimeofday(&ptime, NULL);
-   *microseconds = ptime.tv_usec;
-#endif
-
-   /* Obtain the time of day, and convert it to a tm struct. --*/
-   return localtime (&ptime.tv_sec);
-}
-#elif !defined(RLOG_USE_TTI_LOGGING)
-static void getLogTime(LOGTIME* logTime)
-{
-#ifndef SS_LINUX
-   struct timespec ptime;
-#else
-   struct timeval ptime;
-#endif
-
-#ifndef SS_LINUX
-   clock_gettime(CLOCK_REALTIME, &ptime);
-   logTime->ms_tti = ptime.tv_nsec / 1000;
-#else
-   gettimeofday(&ptime, NULL);
-   logTime->ms_tti = ptime.tv_usec/1000;
-#endif
-
-   logTime->tv_sec = ptime.tv_sec;
-}
-
-#endif
-
-void getLogTimeStr(char* ts)
-{
-#ifndef SS_LINUX
-   struct timespec ptime;
-#else
-   struct timeval ptime;
-#endif
-   struct tm* tm;
-   int microseconds;
-
-#ifndef SS_LINUX
-   clock_gettime(CLOCK_REALTIME, &ptime);
-   microseconds = ptime.tv_nsec / 1000;
-#else
-   gettimeofday(&ptime, NULL);
-   microseconds = ptime.tv_usec/1000;
-#endif
-
-   /* Obtain the time of day, and convert it to a tm struct. --*/
-   tm = localtime (&ptime.tv_sec);
-
-   if (tm) sprintf(ts,"%d_%d_%d_%d_%d_%d.%03d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, 
-         tm->tm_hour, tm->tm_min,tm->tm_sec,microseconds);
-}
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-void rlEnaBleBufferedIO(void)
-{
-   setvbuf (g_fp, NULL, _IOFBF, 1024 );
-}
-
-void createNewLogFile()
-{
-   FILE *fp, *prev_fp = g_fp;
-   char curTime[RLOG_MAX_TIME_STAMP]; int fd;
-   char *temptr;
-   /* Fix for CR ccpu00143040 */
-   DIR *dir = NULLP;
-
-   /* get current time, when file is created */
-   getLogTimeStr(curTime); 
-   temptr = strchr(curTime, '.');
-   if (temptr != NULLP)
-   {
-      *temptr = 0;
-   }
-   /* Fix for CR ccpu00143040 */
-   dir  = opendir(g_logDir);
-   if ( dir == NULLP )
-   { 
-      mkdir(g_logDir, O_RDWR);
-   }
-   else
-   {
-      closedir(dir);
-   }
-   /* remove old file from system */
-   if( g_fileList[g_nCurrFileIdx][0] != '\0' )
-      unlink(g_fileList[g_nCurrFileIdx]);
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING
-   /* create file name, Example-> dbglog_2013_08_11_15_30_00 */
-   snprintf(g_fileList[g_nCurrFileIdx],MAX_FILENAME_LEN, "%s/%s_%s.txt",g_logDir, g_fileName, curTime );
-   fp = fopen(g_fileList[g_nCurrFileIdx], "w+");
-#else
-   snprintf(g_fileList[g_nCurrFileIdx],MAX_FILENAME_LEN, "%s/%s_%s.bin",g_logDir, g_fileName, curTime );
-   fp = fopen(g_fileList[g_nCurrFileIdx], "ab+");
-#endif
-
-   if( fp == NULL ) {
-      fprintf(stderr, "Failed to open log file %s\n", g_fileList[g_nCurrFileIdx]);
-      return;
-   }
-
-   fd = fileno(fp);
-
-   g_fp = fp;
-   g_fd = fd;
-
-   if( fcntl(g_fd, F_SETFL, fcntl(g_fd, F_GETFL, 0) | O_NONBLOCK | O_ASYNC ) == -1 ) {
-      fprintf(stderr, "RLOG: Cannot enable Buffer IO or make file non-blocking\n");
-   }
-
-#ifdef RLOG_ENABLE_TEXT_LOGGING
-   setvbuf ( fp , NULL, _IOLBF, 1024 );
-#else
-   setvbuf ( fp , NULL, _IONBF, 1024 );
-#endif
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-   storeFileHeader(fp);
-#endif
-
-   if( prev_fp != NULL )
-      fclose(prev_fp);
-
-   if( ++g_nCurrFileIdx == g_nMaxLogFiles )
-      g_nCurrFileIdx = 0;
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-#ifdef RLOG_USE_TTI_LOGGING
-   logLev1(L_TIME_REFERENCE, L_ALWAYS, (uint32_t)time(NULL));
-#endif
-#endif
-}
-
-void createL2LogFile()
-{
-   FILE *fp, *prev_fp = g_fp;
-   int fd;
-   char file[MAX_FILENAME_LEN];
-
-   strncpy(g_logDir, "/root/", MAX_FILENAME_LEN);
-   strncpy(g_fileName, "dbglog_l2", MAX_FILENAME_LEN);
-   snprintf(file, sizeof(file), "%s/%s.txt", g_logDir, g_fileName);
-
-   fp = fopen(file, "w+");
-   if( fp == NULL) {
-      printf("Failed to open file %s", file);
-      _exit(0);
-   }
-
-   printf("Created L2 bin file FD=%s\n", g_fileName);
-
-   setvbuf (fp , NULL, _IONBF, 1024 );
-
-   fd = fileno(fp);
-
-   g_fp = fp;
-   g_fd = fd;
-
-   if( fcntl(g_fd, F_SETFL, fcntl(g_fd, F_GETFL, 0) | O_NONBLOCK | O_ASYNC ) == -1 ) {
-      fprintf(stderr, "RLOG: Cannot enable Buffer IO or make file non-blocking\n");
-   }
-
-   setvbuf ( fp , NULL, _IOLBF, 1024 );
-
-   if( prev_fp != NULL )
-      fclose(prev_fp);
-
-   if( ++g_nCurrFileIdx == g_nMaxLogFiles )
-      g_nCurrFileIdx = 0;
-
-
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlUdateRlogTti
-//  @Discription : This function will be called every 10 ms whenever 
-//                 application layer update the tti count
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-void rlUpdateRlogTti(Void)
-{
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-#ifdef RLOG_USE_TTI_LOGGING
-   logLev1(L_TIME_TTI_UPDT, L_ALWAYS, (uint32_t)time(NULL));
-#endif
-#endif
-}
-
-/* This function processes log buffer received from L2
-   mBuf is Received from L2 through SPstTsk. This function
-   extracts buffer pointer and logLen and then these logs 
-   written to L3 log buffer/file. 
-   This function is called in application layer when EVTL2LOGBUF
-   event is recieved from ssi
-*/
-
-#ifdef ANSI
-Void rlProcessLogBufFromL2
-(
- void *mBuf
- )
-#else
-Void rlProcessLogBufFromL2(mBuf)
-   void *mBuf;
-#endif
-{
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-   uint32_t logLength;
-   Data* logPtr;
-   startL2Logging = 1;
-   if(mBuf == NULL)
-   {
-      printf("NULL MBUF received \n");
-      return;
-   }
-   /* Get Buffer pointer and length. This is SOC specific function which
-      will extract Log-Buffer pointer and length from mBuf */
-   rlGetL2LogBufPtr(mBuf, &logLength,&logPtr);
-   rlSetL2LogBuf(logPtr,logLength);
-   readL2LogBuff();
-#endif
-   return;
-}
-
-/* This function will get tick from RLC/CL and will process logs
-   according to tick threshold. Tick threshold is SOC specific */
-Void rlProcessTicks(void)
-{
-   static uint32_t rlogTickCount;
-   numTtiTicks++;
-   if(++rlogTickCount >= RLOGTICKSCNTTOPRCL2LOGS)
-   {
-      rlogTickCount = 0;
-      rlResetLogRateLmt(); /* Resetting rlog write count to 0 */ 
-
-      /* Tick count reached configured ticks to send L2 logs,
-         Send existing log buffer to Application and create 
-         new log buffer to write logs */
-      if (SFndProcId() == TENB_L2_PROC_ID) 
-      {
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-         processL2LogBuff(); /* This processing of log buffer is done on L2 only 
-                                This is SOC specific function and use to send
-                                log buffers to L3 and reset buffer pointer to 
-                                write logs */
-#else
-     /* Write functions specific to Text logging in cpul */
-#endif                                
-      }
-      else
-      {
-         /* L3 specific functions */
-      }
-   }
-   return;
-}
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING 
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : readL2LogBuff 
-//  @Description : This function first validates received Log Buffer and
-//                 length from L2 and then writes L2 log buffer into L3 
-//                 circular buffer. After reading it invalidates cache and
-//                 also resets global Log buffer pointer and lenth variable.
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-Void readL2LogBuff(void)
-{
-   /* Validate global buffer pointer and length */
-   uint8_t ret;
-   ret = rlValidateL2LogBuf();
-   if(ret != ROK)
-   {
-      printf(" Validation failed for log buffer/len \n");
-      return;
-   }
-   g_writeCirBuf = 1;
-   saveLogDataFromCpul(g_logBufRcvdFromL2 , g_logBufLenRcvdFromL2 );
-   /* TODO: Write SOC Specific function to invalidate cache */
-   rlInvalidateL2LogsInCache(g_logBufRcvdFromL2 - sizeof(g_logBufLenRcvdFromL2) , (g_logBufLenRcvdFromL2 + sizeof(g_logBufLenRcvdFromL2)));
-   rlResetL2LogBuf();
-   g_writeCirBuf = 0;
-   return; 
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlStopLogCountLimit
-//  @Description : This function validates L2 Log buffer,length, and start
-//                 L2 logging flag.
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-#ifdef ANSI
-S16 rlValidateL2LogBuf(void)
-#else
-S16 rlValidateL2LogBuf(void)
-#endif
-{
-   S16 ret = ROK;
-   if(g_logBufRcvdFromL2 == NULL)
-   {
-      printf("Log-Buffer received from L2 is NULL \n");
-      ret = RFAILED;
-   }
-   if(g_logBufLenRcvdFromL2 == 0)
-   {
-      printf("Log-Buffer Length received from L2 is 0 \n");
-      ret = RFAILED;
-   }
-   if(startL2Logging == 0)
-   {
-      printf("startL2Logging flag is still inactive \n");
-      ret = RFAILED;
-   }
-
-   return(ret);
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlStopLogCountLimit
-//  @Description : This function set global log Buffer pointer & length  
-//  @in          : l2LogBuf  -  Log Buffer to be set in global pointer
-//                 l2LogLen  -  Log length to be set in global lenth
-//  @out         : void 
-//////////////////////////////////////////////////////////////////////////
-
-#ifdef ANSI
-void rlSetL2LogBuf
-(
-uint8_t *l2LogBuf,
-uint32_t l2logLen
-)
-#else
-void rlSetL2LogBuf(l2LogBuf,l2logLen)
-uint8_t *l2LogBuf;
-uint32_t l2logLen;
-#endif
-{
-   g_logBufRcvdFromL2      = l2LogBuf;
-   g_logBufLenRcvdFromL2   = l2logLen;
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlStopLogCountLimit
-//  @Description : This function flushes global log Buffer pointer & length  
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-#ifdef ANSI
-void rlResetL2LogBuf
-(
-void
-)
-#else
-void rlResetL2LogBuf(void)
-#endif
-{
-   g_logBufRcvdFromL2      = NULL;
-   g_logBufLenRcvdFromL2   = 0;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlStartLogCountLimit
-//  @Discription : This function will be called by EnbApp after Cell is UP.
-//                 This function start the log cnt limit. i.e Number of logs
-//                 getting logged into curcular will be restricted to 100 logs.
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void rlStartLogCountLimit(Void)
-{
-   g_rlogWriteCount = 0;
-   g_rlLogCntLimit = RL_LOG_COUNT_LIMIT_START;
-   printf("Start Log Restriction\n");
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlStopLogCountLimit
-//  @Discription : This function will be called by EnbApp after Cell Shutdown
-//                 is triggered. This will enable to get all logs of shutdown.
-//                 This function stops the log cnt limit. i.e Restricition on
-//                 Number of logs getting logged into curcular will be removed
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void rlStopLogCountLimit(Void)
-{
-   printf("Stop Log Restriction\n");
-   g_rlLogCntLimit = RL_LOG_COUNT_LIMIT_STOP;
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlResetLogRateLmt
-//  @Discription : This function will be called every 10 ms whenever 
-//                 application layer update the tti count. To reset the 
-//                 log rate control. And Enable logging for next 10 ms
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void rlResetLogRateLmt(void)
-{
-    g_rlogWriteCount = 0;
-    g_logsDropCnt = 0;
-}
-
-void initGlbDataAtL2(void)
-{
-   strncpy(g_logDir, "/root/", MAX_FILENAME_LEN);
-}
-
-/**********************************************************************
-         End of file
-**********************************************************************/
diff --git a/src/rlog/rl_rlog.h b/src/rlog/rl_rlog.h
deleted file mode 100755 (executable)
index a9c53ba..0000000
+++ /dev/null
@@ -1,189 +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:     Radisys Logging Framework
-     Type:     C include file
-     Desc:     This file contains logging framework include file for library.
-     File:     rl.h
-
-*********************************************************************21*/
-/****************************************************************************
-@ description: This is header file is used by logging framework module. This
-file should not be included by any other application. This is internal
-header file logging framework.
-*****************************************************************************/
-
-#ifndef __RL_H__
-#define __RL_H__
-
-#include <stdio.h>
-#include <time.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <errno.h>
-#include "rl_common.h"
-
-#define MAX_FILE_SIZE                          3145728 /* 3MB */
-#define MAX_LOG_LEN                            256
-#define MAX_FILENAME_LEN               300
-#define LOG_TIME_LEN                   64
-#define MAX_LOG_BUF_SIZE               5000
-#define RLOG_MAX_CIRBUF_SIZE                   (1024*100)
-#define RLOG_REMOTE_LOGGING_PORT               9099
-#define RLOG_MAX_FILES                                 5
-#define RLOG_MAX_TIME_STAMP                    80
-#define RLOG_MAX_TAX_NAME                              16
-#define RLOG_FIFO_FILE                                 "/tmp/l2logs"
-#define RLOG_CIRBUF_READ_INTERVAL      1       /* 60 seconds read interval */
-#define RLOG_MAX_THREADS                               16
-#define RLOG_TIME_ZONE_LEN                             8
-#define RLOG_MAX_STACK_DEPTH           24
-#define RLOG_MAX_BACKTRACE_BUFSZ       2048
-#define RLOG_READ_POS_THRESHOLD 300
-#define RLOG_FIXED_LENGTH_BUFFER_SIZE 50
-#define RLOGTICKSCNTTOPRCL2LOGS 10
-
-/* Console handling */
-#define RLOG_CTRL_L    12
-#define RLOG_CTRL_Y    25
-#define RLOG_ENTER_KEY 10
-#define RLOG_SET_LOGLEVEL  1
-#define RLOG_SET_MODMASK   2
-
-/*L2 Logging */
-#define PROCESS_L2LOG_TTI 10
-
-typedef enum {
-LOG_ARG_INT,
-LOG_ARG_STR,
-LOG_ARG_HEX,
-LOG_ARG_SPL
-} LOG_ARG_TYPE;
-
-typedef enum rlLogCntLmt
-{
-   RL_LOG_COUNT_LIMIT_START = 1,
-   RL_LOG_COUNT_LIMIT_STOP
-}RLLogCntLmt;
-
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-
-typedef enum
-{
-       L_TIME_REFERENCE=0,
-       L_TIME_DELIMITER,
-       L_SIGSEGV,
-    L_TIME_TTI_UPDT
-} LOGID_TYPE;
-
-typedef struct
-{
-       time_t tv_sec;
-       uint32_t        ms_tti;
-} __attribute__ ((__packed__)) LOGTIME;
-
-typedef struct
-{
-       LOGID                   logId;          /* 4 bytes | 32 bits */
-       LOGTIME         logTime;                /* 8 bytes */
-       unsigned int argType    :2;
-       unsigned int logLevel   :3;
-       unsigned int numOfArgs  :3;
-       uint16_t                        len;
-} __attribute__ ((__packed__)) LOGDATA;
-
-typedef struct
-{
-       LOGDATA         logData;
-       char            buf[MAX_LOG_BUF_SIZE];
-}  __attribute__ ((__packed__)) ARGDATA;
-
-typedef struct
-{
-       LOGDATA logData;
-       uint32_t arg1;
-       uint32_t arg2;
-       uint32_t arg3;
-       uint32_t arg4;
-   char unusedByte[19]; /* To make it as 50 byte */
-}  __attribute__ ((__packed__)) ARG4DATA;
-
-typedef struct
-{
-       LOGDATA logData;
-       uint8_t           splEnum;
-       uint32_t splArg;
-       uint32_t arg1;
-       uint32_t arg2;
-       uint32_t arg3;
-       uint32_t arg4;
-   char unusedByte[14]; /* To make it as 50 byte */
-}  __attribute__ ((__packed__)) SPL_ARGDATA;
-
-typedef enum _endian {little_endian, big_endian} EndianType;
-
-typedef struct
-{
-       uint16_t                        version;
-       uint32_t                        dummy32;
-       uint8_t                         endianType;
-       char                    szTimeZone[RLOG_TIME_ZONE_LEN+1];
-       uint16_t                        END_MARKER;
-   time_t      time_sec;
-} __attribute__ ((__packed__)) FILE_HEADER;
-
-#endif /* RLOG_ENABLE_TEXT_LOGGING */
-
-typedef struct {
-       
-       char    szTaskName[RLOG_MAX_TAX_NAME];
-       uint8_t*        logBuff;                /* LOG Buffer */
-       uint32_t        logBufLen;  /* Data Written till now */
-       uint32_t        logReadPos; /* Reader thread position */
-       uint8_t         listIndex;      /* Index to global list */
-
-} THREAD_DATA;
-
-void readL2LogBuff(void);
-void processL2LogBuff(void);
-S16  sendL2LogBuftoL3(void);
-void rlInitL2Log(void);
-/* Extern for soc specific file */
-void rlProcessLogBufFromL2(void *mBuf);
-void rlInitL2SocSpecific(void);
-//void processL2LogBuff(void);
-void rlProcessTicks(void);
-void rlGetL2LogBufPtr (void *mBuf, uint32_t *logLen,uint8_t **logPtr);
-void rlInvalidateL2LogsInCache(uint8_t *ptr,uint32_t len);
-
-uint8_t     *g_l2rlogBuf;        /* buffer pointer for shared memory allocation */
-uint8_t     *g_l2LogBufStartPtr; /* buffer pointer where logs has to be written */
-uint8_t     *g_l2LogBufBasePtr;  /* Base pointer for log buffer */
-uint8_t     *g_logBufRcvdFromL2; /* Buffer pointer received from L2 at L3*/
-uint8_t     *g_l2LogBaseBuff;    /* Base log buffer received at L3 */
-uint32_t     g_l2LogBufLen;      /* Log Buffer length written at L2 */
-uint32_t     startL2Logging;     /* flag to start processing of L2 logs */
-uint32_t     g_l2logBuffPos;     /* Log Buffer block which is in use for L2 logging */
-uint8_t      g_writeCirBuf;      /* Flag to indicate whether to write logs or not */
-//Pst    g_rlog_pst;
-
-#endif /* __RL_H__*/
diff --git a/src/rlog/rl_soc.c b/src/rlog/rl_soc.c
deleted file mode 100644 (file)
index 5f27522..0000000
+++ /dev/null
@@ -1,168 +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:     Radisys Logging Framework
-     Type:     C source file
-     Desc:     This file contains logging framework implementation.
-     File:     rl_soc.c
-
-*********************************************************************21*/
-/**********************************************************************
- @ description: This source file has SOC specific functions required for 
- logging framework
-************************************************************************/
-#include "envopt.h"
-#include "envdep.h"
-#include"stdint.h"
-#include "rl_interface.h"
-#include "rl_rlog.h"
-#include "rl_platform.h"
-
-#include "gen.h"
-#include "ssi.h"
-#include "ss_msg.h"
-#include "ss_task.h"
-#include "gen.x"
-#include "ssi.x"
-#include "ss_queue.h"
-#include "ss_queue.x"
-#include "ss_task.x"
-#include "ss_msg.x"
-#include "cm_inet.h"
-#include "cm_inet.x"
-
-#include "rl_soc.h"
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlInitL2Log 
-//  @Description : This will be trigigered from cl init function to
-//                 allocate buffer from shared memory and to intialize
-//                 the buffer
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void rlInitL2SocSpecific(void)
-{
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-
-   if (SGetStaticBuffer(0,  /* region - value does not matter in this case  */
-                        0,  /* pool   - value does not matter in this case  */  
-                        &g_l2rlogBuf, 
-                        L2LOG_BUFF_BLOCK_SIZE, /* Buffer size to be allocated */
-                        0) != ROK)      /* Memory type is SS_SHARABLE_MEMORY  */
-   {
-      printf("Memory allocation failed for g_l2rlogBuf!!!\n");
-      /* kill binary */
-   }
-   memset(g_l2rlogBuf, 0, L2LOG_BUFF_SIZE); 
-
-   g_l2LogBufBasePtr = g_l2rlogBuf;
-   g_l2LogBufStartPtr     = g_l2rlogBuf + sizeof(g_l2LogBufLen);
-
-#endif
-   return;
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : processL2LogBuff 
-//  @Description : This function will get triggered after every 10 tti 
-//                 and this will reset log buffers for L2 and also  sends log
-//                 buffer to L3 which was collected
-//  @in          : void
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void processL2LogBuff(void)
-{
-#ifndef RLOG_ENABLE_TEXT_LOGGING
-   if(g_l2LogBufLen > 0)
-   {
-      Data *l2rlogBuf_post;
-
-      /* Log buffer position in flat buffer. If position is last wrap to first buffer */
-      if (g_l2logBuffPos++ >=4)
-      {
-         g_l2logBuffPos = 0;
-      }
-
-      g_writeCirBuf = 1; /* This will avoid contention while switching log buffers */
-
-      l2rlogBuf_post = g_l2LogBufBasePtr;   /* copy logBufferPointer for later use */
-      /* Set L2 Log Buffer length in first 4 bytes of flat buffer */
-      *((uint32_t*) g_l2LogBufBasePtr) = g_l2LogBufLen; /* Set L2 Log Buffer length in 
-                                               first 4 bytes of flat buffer */
-
-      /* Re-setting pointer so that L2 will use this to write logs */
-      g_l2LogBufBasePtr = g_l2rlogBuf + (g_l2logBuffPos * L2LOG_BUFF_BLOCK_SIZE) ; 
-      g_l2LogBufStartPtr     = g_l2LogBufBasePtr + sizeof(g_l2LogBufLen); 
-
-      g_l2LogBufLen = 0;
-
-      g_writeCirBuf = 0; /* This will avoid contention while switching log buffers */
-
-   }
-#endif   
-   return; 
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlGetL2LogBufPtr 
-//  @Description : This function reads LogBufPointer and Length of log Buffer 
-//                 and stores pointer and length variable so that these 
-//                 values can be used while reading L2 Log Buffer 
-//  @in          : mBuf     - Log Buffer
-//  @out         : logLen   - Length of log Buffer
-//                 logPtr   - Address of log Buffer
-//////////////////////////////////////////////////////////////////////////
-
-void rlGetL2LogBufPtr
-(
-   void *mBuf,
-   uint32_t *logLen,
-   Data **logPtr
-)
-{
-   /* Get Buffer pointer and length */
-   *logPtr = ((Data *)mBuf) + sizeof(logLen);
-   *logLen = *((uint32_t *) mBuf);
-}
-
-//////////////////////////////////////////////////////////////////////////
-//  @Function    : rlInvalidateL2LogsInCache 
-//  @Description : Dummy function which is not used for this SOC. 
-//                 
-//  @in          : ptr     - starting address to be invalidated.
-//                 len     - Length to be invalidated.
-//  @out         : void
-//////////////////////////////////////////////////////////////////////////
-
-void rlInvalidateL2LogsInCache
-(
-   Data *ptr,
-   uint32_t   len
-)
-{
-   return;
-}
-
-/**********************************************************************
-         End of file
-***********************************************************************/
diff --git a/src/rlog/rl_soc.h b/src/rlog/rl_soc.h
deleted file mode 100755 (executable)
index dae83ca..0000000
+++ /dev/null
@@ -1,50 +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:     Radisys Logging Framework
-     Type:     C source file
-     Desc:     This file contains logging framework implementation.
-     File:     rl_soc.c
-
-*********************************************************************21*/
-/**********************************************************************
- @ description: This source file has SOC specific functions required for 
- logging framework
-************************************************************************/
-
-#define L2LOG_BUFF_SIZE 10000
-#define L2LOG_BUFF_BLOCK_SIZE L2LOG_BUFF_SIZE/4
-#define RLOGTICKSCNTTOPRCL2LOGS 10
-#define TENB_L2_PROC_ID 1
-#define RLOG_LIMIT_L2_COUNT 100
-#define RLOG_LIMIT_L3_COUNT 500
-
-void rlInitL2SocSpecific(void);
-void processL2LogBuff(void);
-void rlGetL2LogBufPtr(void *mBuf,uint32_t *logLen,Data **logPtr);
-void rlInvalidateL2LogsInCache(Data *ptr,uint32_t   len);
-
-void rlInitL2SocSpecific(void);
-void processL2LogBuff(void);
-void rlGetL2LogBufPtr(void *mBuf,uint32_t *logLen,Data **logPtr);
-
-/**********************************************************************
-         End of file
-**********************************************************************/