merge branch various-l2-fixes with the develop branch
This commit is contained in:
@@ -37,11 +37,6 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||
|
||||
project (OpenAirInterface)
|
||||
|
||||
#add_definitions("-DEMIT_ASN_DEBUG=1")
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m)
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR)
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C)
|
||||
|
||||
###########################################
|
||||
# macros to define options as there is numerous options in oai
|
||||
################################################
|
||||
@@ -512,7 +507,7 @@ set(HWLIB_BLADERF_SOURCE
|
||||
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
||||
set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
|
||||
|
||||
set(HWLIB_LMSSDR_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
|
||||
)
|
||||
@@ -559,16 +554,14 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
|
||||
include_directories("/usr/local/include/lime")
|
||||
include_directories("/usr/include/lime")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
||||
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
|
||||
set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
|
||||
set(option_HW_lib "-lLimeSuite -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
@@ -1845,14 +1838,6 @@ Message("-- HW_SOURCE=${HW_SOURCE}")
|
||||
Message("-- option_TP_lib=${option_TP_lib}")
|
||||
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
|
||||
|
||||
if (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
add_dependencies(lte-softmodem LMS7002M LMS_SDR Si5351C)
|
||||
add_dependencies(lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C)
|
||||
add_dependencies(rrh_gw LMS7002M LMS_SDR Si5351C)
|
||||
endif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
|
||||
|
||||
|
||||
# USIM process
|
||||
#################
|
||||
#add_executable(usim
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
cd /tmp/oai_test_setup/oai
|
||||
source oaienv
|
||||
echo $EXEC $EXEC_ARGS
|
||||
$EXEC $EXEC_ARGS
|
||||
|
||||
@@ -233,7 +233,7 @@ class ExecutionThread(threading.Thread):
|
||||
for arg in args.splitlines():
|
||||
i = i+1
|
||||
runenv2 = list(runenv)
|
||||
runenv2.append('OPENAIR_TARGET=/tmp/oai_test_setup/oai/targets')
|
||||
runenv2.append('OPENAIR_TARGETS=/tmp/oai_test_setup/oai/targets')
|
||||
runenv2.append('EXEC="'
|
||||
+ test.findtext('main_exec')
|
||||
+ '"')
|
||||
|
||||
@@ -661,9 +661,9 @@ function main() {
|
||||
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||
|
||||
#oai_nw_drv
|
||||
compilations \
|
||||
$oaisim_build_dir oai_nw_drv \
|
||||
CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
||||
#compilations \
|
||||
# $oaisim_build_dir oai_nw_drv \
|
||||
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
||||
fi
|
||||
|
||||
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
#WARNING: this file may not work properly, be sure to know what you
|
||||
#do when using it
|
||||
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.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.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * 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.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
################################################################################
|
||||
# file init_nas_s1
|
||||
# brief loads the ue_ip module and sets up IP for the UE
|
||||
# you may want to edit it to fit your settings (replace oip0 by oipX for
|
||||
# instance)
|
||||
# author Florian Kaltenberger
|
||||
#
|
||||
#######################################
|
||||
|
||||
LTEIF=oip0
|
||||
#OPENAIR_DIR=/home/oai/svn-oai/openair4G
|
||||
|
||||
load_module() {
|
||||
mod_name=${1##*/}
|
||||
mod_name=${mod_name%.*}
|
||||
if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
|
||||
then
|
||||
echo "module $mod_name already loaded: I remove it first"
|
||||
sudo rmmod $mod_name
|
||||
fi
|
||||
echo loading $mod_name
|
||||
sudo insmod $1
|
||||
}
|
||||
|
||||
load_module $OPENAIR_DIR/targets/bin/ue_ip.ko
|
||||
|
||||
if [ "$1" = "UE" ]; then
|
||||
echo "bring up oip0 interface for UE"
|
||||
ifconfig oip0 up
|
||||
fi
|
||||
|
||||
ip route flush cache
|
||||
sleep 1
|
||||
sysctl -w net.ipv4.conf.all.log_martians=1
|
||||
echo "Disabling reverse path filtering"
|
||||
sysctl -w net.ipv4.conf.all.rp_filter=0
|
||||
ip route flush cache
|
||||
|
||||
# Check table 200 lte in /etc/iproute2/rt_tables
|
||||
fgrep lte /etc/iproute2/rt_tables > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "200 lte " >> /etc/iproute2/rt_tables
|
||||
fi
|
||||
ip rule add fwmark 1 table lte
|
||||
ip route add default dev $LTEIF table lte
|
||||
@@ -71,7 +71,5 @@ typedef struct {
|
||||
#define INSTANCE_DEFAULT (UINT16_MAX - 1)
|
||||
#define INSTANCE_ALL (UINT16_MAX)
|
||||
|
||||
typedef uint16_t instance_t;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+117
-75
@@ -29,7 +29,7 @@
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_PHY
|
||||
#define DEBUG_PHY
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -211,7 +211,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
|
||||
fp->MBSFN_config[i].fourFrames_flag = 0;
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
||||
fp->MBSFN_config[i].fourFrames_flag = 1;
|
||||
@@ -220,7 +220,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
|
||||
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
}
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
|
||||
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
|
||||
fp->MBSFN_config[i].fourFrames_flag = 0;
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
||||
fp->MBSFN_config[i].fourFrames_flag = 1;
|
||||
@@ -340,7 +340,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
|
||||
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
}
|
||||
}
|
||||
@@ -357,7 +357,7 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
|
||||
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
|
||||
|
||||
|
||||
LOG_I(PHY,"[UE%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||
LOG_I(PHY,"[UE%d] Applying MBSFN_Area_id %ld for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||
|
||||
if (mbsfn_Area_idx == 0) {
|
||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||
@@ -376,7 +376,7 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
|
||||
|
||||
|
||||
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %ld for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||
|
||||
if (mbsfn_Area_idx == 0) {
|
||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||
@@ -398,7 +398,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
|
||||
LOG_I(PHY,"[eNB %d] Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
|
||||
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
||||
|
||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
||||
@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
int8_t UE_id = find_ue(rnti,eNB);
|
||||
|
||||
if (UE_id == -1) {
|
||||
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n");
|
||||
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -684,6 +684,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
|
||||
eNB->do_precoding = 1;
|
||||
eNB->transmission_mode[UE_id] = 7;
|
||||
break;
|
||||
default:
|
||||
@@ -725,13 +726,13 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
|
||||
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
|
||||
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
} else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
|
||||
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
|
||||
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
} else {
|
||||
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
|
||||
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
|
||||
}
|
||||
|
||||
if (physicalConfigDedicatedSCell_r10) {
|
||||
@@ -1062,7 +1063,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
// create shortcuts
|
||||
LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms;
|
||||
LTE_UE_COMMON* const common_vars = &ue->common_vars;
|
||||
LTE_UE_PDSCH** const pdsch_vars = ue->pdsch_vars;
|
||||
LTE_UE_PDSCH** const pdsch_vars_th0 = ue->pdsch_vars[0];
|
||||
LTE_UE_PDSCH** const pdsch_vars_th1 = ue->pdsch_vars[1];
|
||||
LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI;
|
||||
LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra;
|
||||
LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH;
|
||||
@@ -1115,32 +1117,37 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
// init RX buffers
|
||||
|
||||
common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdataF2 = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->common_vars_rx_data_per_thread[0].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->common_vars_rx_data_per_thread[1].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
|
||||
common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||
common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti*10) );
|
||||
common_vars->common_vars_rx_data_per_thread[0].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||
common_vars->common_vars_rx_data_per_thread[1].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||
}
|
||||
}
|
||||
|
||||
// Channel estimates
|
||||
for (eNB_id=0; eNB_id<7; eNB_id++) {
|
||||
common_vars->dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
common_vars->dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (j=0; j<4; j++) {
|
||||
int idx = (j<<1) + i;
|
||||
common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
||||
common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
||||
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
||||
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
}
|
||||
}
|
||||
|
||||
// DLSCH
|
||||
for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) {
|
||||
pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||
@@ -1149,25 +1156,43 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp );
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp );
|
||||
|
||||
pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars[eNB_id]->llr_shifts_p = pdsch_vars[eNB_id]->llr_shifts;
|
||||
pdsch_vars[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
// thread 0
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
// thread 1
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts_p = pdsch_vars_th1[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (j=0; j<4; j++) {
|
||||
int idx = (j<<1)+i;
|
||||
pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||
{
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||
}
|
||||
}
|
||||
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
|
||||
@@ -1224,14 +1249,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
|
||||
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
||||
|
||||
pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||
pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||
pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
|
||||
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp );
|
||||
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp );
|
||||
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
} else { //abstraction == 1
|
||||
ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
}
|
||||
@@ -1304,49 +1332,54 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
for (i=0; i<14; i++) {
|
||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
if (eNB->node_function != NGFI_RRU_IF5) {
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%lu bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<fp->nb_antennas_tx; i++) {
|
||||
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5)
|
||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear(fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF_BF[%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF_BF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]);
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->txdata[eNB_id][i],
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i=0; i<14; i++) { // 14 is the total number of antenna ports
|
||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||
}
|
||||
else if (i>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||
}
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||
}
|
||||
else if (i>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||
}
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RX vars
|
||||
@@ -1358,17 +1391,25 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
||||
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
|
||||
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) );
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]);
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]);
|
||||
#endif
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
|
||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( 2*fp->samples_per_tti*2*sizeof(int32_t) );
|
||||
}
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata[eNB_id][i],fp->samples_per_tti*10*sizeof(int32_t));
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i],fp->samples_per_tti*2*sizeof(int32_t));
|
||||
#endif
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
}
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
// Channel estimates for SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
@@ -1383,7 +1424,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
||||
}
|
||||
} else { //UPLINK abstraction = 1
|
||||
} // abstraction_flag = 0
|
||||
else { //UPLINK abstraction = 1
|
||||
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
}
|
||||
} //eNB_id
|
||||
@@ -1391,7 +1433,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
generate_ul_ref_sigs_rx();
|
||||
|
||||
// SRS
|
||||
@@ -1405,7 +1447,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
// ULSCH VARS, skip if NFGI_RRU_IF4
|
||||
|
||||
if (eNB->node_function!=NGFI_RRU_IF4p5)
|
||||
if ((eNB->node_function!=NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5))
|
||||
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||
@@ -1418,7 +1460,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
|
||||
"nb_antennas_rx too large");
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
|
||||
@@ -22,6 +22,23 @@
|
||||
#include "defs.h"
|
||||
#include "log.h"
|
||||
|
||||
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
|
||||
uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0};
|
||||
|
||||
void set_S_config(LTE_DL_FRAME_PARMS *fp) {
|
||||
|
||||
int X = fp->srsX;
|
||||
|
||||
fp->ul_symbols_in_S_subframe=(1+X);
|
||||
|
||||
if ((fp->Ncp==EXTENDED) && (fp->tdd_config_S>7))
|
||||
AssertFatal(1==0,"Illegal S subframe configuration for Extended Prefix mode\n");
|
||||
|
||||
fp->dl_symbols_in_S_subframe = (fp->Ncp==NORMAL)?dl_S_table_normal[fp->tdd_config_S] : dl_S_table_extended[fp->tdd_config_S];
|
||||
|
||||
|
||||
}
|
||||
|
||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
{
|
||||
|
||||
@@ -29,7 +46,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
|
||||
|
||||
if (frame_parms->Ncp==1) {
|
||||
if (frame_parms->Ncp==EXTENDED) {
|
||||
frame_parms->nb_prefix_samples0=512;
|
||||
frame_parms->nb_prefix_samples = 512;
|
||||
frame_parms->symbols_per_tti = 12;
|
||||
@@ -37,8 +54,10 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
frame_parms->nb_prefix_samples0 = 160;
|
||||
frame_parms->nb_prefix_samples = 144;
|
||||
frame_parms->symbols_per_tti = 14;
|
||||
|
||||
}
|
||||
|
||||
|
||||
switch(osf) {
|
||||
case 1:
|
||||
log2_osf = 0;
|
||||
@@ -167,6 +186,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
printf("lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size);
|
||||
|
||||
if (frame_parms->frame_type == TDD) set_S_config(frame_parms);
|
||||
|
||||
// frame_parms->tdd_config=3;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
/*!\brief Timing drift hysterisis in samples*/
|
||||
#define SYNCH_HYST 1
|
||||
#define SYNCH_HYST 2
|
||||
|
||||
/*!
|
||||
\brief This function is used for time-frequency scanning prior to complete cell search. It scans
|
||||
@@ -180,6 +180,7 @@ This function computes the time domain channel response, finds the peak and adju
|
||||
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_VARS_UE *phy_vars_ue,
|
||||
module_id_t eNb_id,
|
||||
uint8_t subframe,
|
||||
unsigned char clear,
|
||||
short coef);
|
||||
|
||||
@@ -187,7 +188,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
|
||||
unsigned int subframe_offset,
|
||||
unsigned char N0_symbol,
|
||||
unsigned char abstraction_flag);
|
||||
unsigned char abstraction_flag,
|
||||
uint8_t subframe);
|
||||
|
||||
//! \brief This function performance RSRP/RSCP measurements
|
||||
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_VARS_UE *ue,
|
||||
unsigned char eNB_id,
|
||||
uint8_t subframe,
|
||||
unsigned char clear,
|
||||
short coef)
|
||||
{
|
||||
@@ -48,7 +49,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
ncoef = 32767 - coef;
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset);
|
||||
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx%1024,subframe,ue->rx_offset);
|
||||
#endif //DEBUG_PHY
|
||||
|
||||
|
||||
@@ -57,8 +58,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
temp = 0;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
Re = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
|
||||
Im = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
|
||||
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
|
||||
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
|
||||
temp += (Re*Re/2) + (Im*Im/2);
|
||||
}
|
||||
|
||||
@@ -74,13 +75,15 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
else
|
||||
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
|
||||
|
||||
// do not filter to have proactive timing adjustment
|
||||
max_pos_fil = max_pos;
|
||||
|
||||
diff = max_pos_fil - frame_parms->nb_prefix_samples/8;
|
||||
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
|
||||
|
||||
if ( diff > SYNCH_HYST )
|
||||
ue->rx_offset++;
|
||||
else if (diff < -SYNCH_HYST)
|
||||
ue->rx_offset--;
|
||||
if ( abs(diff) < SYNCH_HYST )
|
||||
ue->rx_offset = 0;
|
||||
else
|
||||
ue->rx_offset = diff;
|
||||
|
||||
if ( ue->rx_offset < 0 )
|
||||
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
|
||||
@@ -91,8 +94,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
|
||||
ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset,max_pos,max_pos_fil,temp);
|
||||
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d) target_pos %d \n",
|
||||
ue->proc.proc_rxtx[0].frame_rx,subframe,ue->rx_offset,max_pos,max_pos_fil,temp,(frame_parms->nb_prefix_samples>>3));
|
||||
#endif //DEBUG_PHY
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -70,9 +70,9 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
else
|
||||
rballoc = dlsch0_harq->rb_alloc_even;
|
||||
|
||||
rxdataF = phy_vars_ue->common_vars.rxdataF;
|
||||
rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF;
|
||||
|
||||
dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates;
|
||||
dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[(Ns>>1)&0x1][eNB_id]->dl_bf_ch_estimates;
|
||||
beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0;
|
||||
|
||||
if (phy_vars_ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
|
||||
|
||||
@@ -44,12 +44,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
int ch_offset,symbol_offset;
|
||||
// unsigned int n;
|
||||
// int i;
|
||||
static int interpolateS11S12 = 1;
|
||||
|
||||
uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift,pilot1,pilot2,pilot3;
|
||||
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[eNB_offset];
|
||||
int **rxdataF=ue->common_vars.rxdataF;
|
||||
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset];
|
||||
int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[((Ns>>1)+1)&0x1].dl_ch_estimates[eNB_offset];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF;
|
||||
|
||||
if (ue->frame_parms.Ncp == 0) { // normal prefix
|
||||
pilot1 = 4;
|
||||
@@ -638,13 +640,19 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
if (symbol == 0) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
|
||||
{
|
||||
//LOG_D(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
@@ -693,6 +701,38 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
|
||||
{
|
||||
//LOG_D(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -734,15 +774,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
|
||||
idft((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx])
|
||||
idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id),
|
||||
T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx),
|
||||
T_INT(0), T_BUFFER(&ue->common_vars.dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
|
||||
T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
|
||||
@@ -44,8 +44,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
||||
// unsigned int n;
|
||||
// int i;
|
||||
|
||||
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[0];
|
||||
int **rxdataF=ue->common_vars.rxdataF;
|
||||
int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF;
|
||||
|
||||
ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
|
||||
symbol_offset = ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l;
|
||||
@@ -734,31 +734,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
||||
|
||||
// do ifft of channel estimate
|
||||
for (aa=0; aa<ue->frame_parms.nb_antennas_rx*ue->frame_parms.nb_antennas_tx; aa++) {
|
||||
if (ue->common_vars.dl_ch_estimates[eNB_offset][aa]) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa]) {
|
||||
switch (ue->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 75:
|
||||
idft1536((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -510,14 +510,15 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
unsigned int n, ar, peak_val, peak_pos, mean_val;
|
||||
unsigned int n, ar, peak_val, peak_pos;
|
||||
uint64_t mean_val;
|
||||
int result;
|
||||
short *primary_synch_time;
|
||||
int eNB_id = frame_parms->Nid_cell%3;
|
||||
|
||||
// msg("[SYNC TIME] Calling sync_time_eNB(%p,%p,%d,%d)\n",rxdata,frame_parms,eNB_id,length);
|
||||
if (sync_corr_eNB == NULL) {
|
||||
msg("[SYNC TIME] sync_corr_eNB not yet allocated! Exiting.\n");
|
||||
LOG_E(PHY,"[SYNC TIME] sync_corr_eNB not yet allocated! Exiting.\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -535,7 +536,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("[SYNC TIME] Illegal eNB_id!\n");
|
||||
LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -567,7 +568,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
peak_val);
|
||||
}
|
||||
*/
|
||||
mean_val += (sync_corr_eNB[n]>>10);
|
||||
mean_val += sync_corr_eNB[n];
|
||||
|
||||
if (sync_corr_eNB[n]>peak_val) {
|
||||
peak_val = sync_corr_eNB[n];
|
||||
@@ -575,17 +576,15 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
}
|
||||
}
|
||||
|
||||
mean_val/=length;
|
||||
|
||||
*peak_val_out = peak_val;
|
||||
|
||||
if (peak_val <= (40*mean_val)) {
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||
#endif
|
||||
if (peak_val <= (40*(uint32_t)mean_val)) {
|
||||
LOG_D(PHY,"[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||
return(-1);
|
||||
} else {
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
|
||||
#endif
|
||||
LOG_D(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
|
||||
return(peak_pos);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,9 +197,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
|
||||
if (ue->frame_parms.Ncp==NORMAL) {
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF_sss = (int16_t *)&ue->common_vars.rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
|
||||
//-ve spectrum from SSS
|
||||
@@ -224,7 +223,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
|
||||
// printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS
|
||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
// printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
@@ -296,10 +295,10 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
if (ue->frame_parms.Ncp==NORMAL) {
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF_sss = (int16_t *)&ue->common_vars.rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
// note this is a dummy pointer, the pss is not really there!
|
||||
// in FDD the pss is in the symbol after the sss, but not in TDD
|
||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
//-ve spectrum from SSS
|
||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
@@ -351,7 +350,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
rxF = (int16_t *)&ue->common_vars.rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)];
|
||||
off = (ue->frame_parms.first_carrier_offset+k)<<1;
|
||||
|
||||
if (l==(4-ue->frame_parms.Ncp)) {
|
||||
@@ -457,7 +456,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
unsigned int subframe_offset,
|
||||
unsigned char N0_symbol,
|
||||
unsigned char abstraction_flag)
|
||||
unsigned char abstraction_flag,
|
||||
uint8_t subframe)
|
||||
{
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] =
|
||||
(signal_energy_nodc(&ue->common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
|
||||
(signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
|
||||
(N_RB_DL*12)));
|
||||
//- ue->measurements.n0_power[aarx];
|
||||
|
||||
@@ -575,8 +575,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
// cqi/pmi information
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
dl_ch0 = &ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1 = &ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
|
||||
for (subband=0; subband<nb_subbands; subband++) {
|
||||
|
||||
@@ -630,13 +630,13 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
|
||||
|
||||
dl_ch0_128 = (__m128i *)&ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1_128 = (__m128i *)&ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
#elif defined(__arm__)
|
||||
int32x4_t pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI0b,mmtmpPMI1b;
|
||||
|
||||
dl_ch0_128 = (int16x8_t *)&ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1_128 = (int16x8_t *)&ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
|
||||
#endif
|
||||
for (subband=0; subband<nb_subbands; subband++) {
|
||||
@@ -694,7 +694,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
else {
|
||||
// cqi information only for mode 1
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
dl_ch0 = &ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||
|
||||
for (subband=0; subband<7; subband++) {
|
||||
|
||||
|
||||
@@ -720,10 +720,11 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
//write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
|
||||
|
||||
mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*) srs_vars->srs,
|
||||
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
(int16_t*) srs_vars->srs,
|
||||
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15,
|
||||
0);
|
||||
|
||||
//msg("SRS channel estimation cmult out\n");
|
||||
#ifdef USER_MODE
|
||||
|
||||
@@ -1705,16 +1705,16 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
||||
|
||||
for (s=0; s<n_pdcch_symbols; s++) {
|
||||
if (is_secondary_ue == 1) {
|
||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
|
||||
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
|
||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
s,
|
||||
high_speed_flag,
|
||||
frame_parms);
|
||||
#ifdef MU_RECEIVER
|
||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB
|
||||
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB
|
||||
pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna
|
||||
pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna
|
||||
s,
|
||||
@@ -1722,16 +1722,16 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
||||
frame_parms);
|
||||
#endif //MU_RECEIVER
|
||||
} else if (frame_parms->nb_antenna_ports_eNB>1) {
|
||||
pdcch_extract_rbs_dual(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
s,
|
||||
high_speed_flag,
|
||||
frame_parms);
|
||||
} else {
|
||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
s,
|
||||
|
||||
@@ -1329,7 +1329,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1380,7 +1380,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1431,7 +1431,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1482,7 +1482,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1687,7 +1687,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1736,7 +1736,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1785,7 +1785,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1834,7 +1834,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
tpmi = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->tpmi;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
|
||||
LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,frame_parms->nb_antennas_tx);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -3115,7 +3115,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
if (frame_parms->nb_antennas_tx == 2) {
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 1.5 MHz), rnti %x (%x): rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 1.5 MHz), rnti %x (%x): rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_1_5MHz_2A_TDD_t *)&dci->dci_pdu[0])->rballoc,
|
||||
@@ -3134,7 +3134,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_5MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3153,7 +3153,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_10MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3172,7 +3172,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_20MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3198,7 +3198,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
} else if (frame_parms->nb_antennas_tx == 4) {
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 1.5 MHz), rnti %x (%x): rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 1.5 MHz), rnti %x (%x): rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_1_5MHz_4A_TDD_t *)&dci->dci_pdu[0])->rballoc,
|
||||
@@ -3217,7 +3217,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_5MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3236,7 +3236,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_10MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3255,7 +3255,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (TDD 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, TPC %d, dai %d, tb_swap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_20MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3300,7 +3300,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_5MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3318,7 +3318,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_10MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3336,7 +3336,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 2 antennas (FDD, 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_20MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3379,7 +3379,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 5 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_5MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3397,7 +3397,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 10 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_10MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3415,7 +3415,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d, harq_pid %d, ndi %d, RV %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2 4 antennas (FDD, 20 MHz), rnti %x (%x): rah %d, rb_alloc %x, mcs %d|%d, harq_pid %d, ndi %d|%d, RV %d|%d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint32_t*)&dci->dci_pdu)[0],
|
||||
((DCI2_20MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3470,7 +3470,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_5MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3488,7 +3488,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 10 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 10 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_10MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3506,7 +3506,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 20 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD 20 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_20MHz_2A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3531,7 +3531,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 1.5 MHz), rnti %x (%llx): rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 1.5 MHz), rnti %x (%"PRIu64"): rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_1_5MHz_4A_TDD_t *)&dci->dci_pdu[0])->rballoc,
|
||||
@@ -3550,7 +3550,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_5MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3569,7 +3569,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 10 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 10 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_10MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3588,7 +3588,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 20 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (TDD 20 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, TPC %d, dai %d, tbswap %d, tpmi %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_20MHz_4A_TDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3632,7 +3632,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_5MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3649,7 +3649,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 10 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 10 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_10MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3666,7 +3666,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 20 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 2 antennas (FDD, 20 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_20MHz_2A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3691,7 +3691,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
|
||||
case 6:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 1.5 MHz), rnti %x (%llx): rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 1.5 MHz), rnti %x (%"PRIu64"): rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_1_5MHz_4A_FDD_t *)&dci->dci_pdu[0])->rballoc,
|
||||
@@ -3708,7 +3708,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 25:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_5MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3726,7 +3726,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 50:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_10MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -3744,7 +3744,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%llx): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
LOG_D(PHY,"DCI format2A 4 antennas (FDD, 5 MHz), rnti %x (%"PRIu64"): rah %d, rb_alloc %x, mcs1 %d, mcs2 %d, harq_pid %d, ndi1 %d, ndi2 %d, RV1 %d, RV2 %d, tb_swap %d, tpmi %d, TPC %d\n",
|
||||
dci->rnti,
|
||||
((uint64_t*)&dci->dci_pdu)[0],
|
||||
((DCI2A_20MHz_4A_FDD_t *)&dci->dci_pdu[0])->rah,
|
||||
@@ -4529,7 +4529,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
|
||||
|
||||
dlsch[0]->harq_ack[subframe].send_harq_status = 1;
|
||||
if (dlsch0_harq->first_tx==1) {
|
||||
LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n");
|
||||
LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n",rnti,harq_pid);
|
||||
dlsch0_harq->first_tx = 0;
|
||||
}
|
||||
}
|
||||
@@ -5288,7 +5288,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
|
||||
dlsch0_harq->DCINdi = ndi1;
|
||||
|
||||
if (dlsch0_harq->first_tx==1) {
|
||||
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX0: Clearing flag\n");
|
||||
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX0: Clearing flag\n",rnti,harq_pid);
|
||||
dlsch0_harq->first_tx = 0;
|
||||
}
|
||||
} else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
|
||||
@@ -7202,8 +7202,8 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
|
||||
// ulsch->n_DMRS2 = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift;
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
printf("Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx,subframe);
|
||||
#ifdef DEBUG_DCI
|
||||
printf("Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe);
|
||||
printf("Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
printf("Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb);
|
||||
printf("Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc);
|
||||
@@ -7211,14 +7211,14 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
printf("Format 0 DCI :ulsch (ue): first_tx %d\n",ulsch->harq_processes[harq_pid]->first_tx);
|
||||
printf("Format 0 DCI :ulsch (ue): DCINdi %d\n",ulsch->harq_processes[harq_pid]->DCINdi);
|
||||
printf("Format 0 DCI :ulsch (ue): round %d\n",ulsch->harq_processes[harq_pid]->round);
|
||||
printf("Format 0 DCI :ulsch (ue): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS);
|
||||
//printf("Format 0 DCI :ulsch (ue): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS);
|
||||
printf("Format 0 DCI :ulsch (ue): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs);
|
||||
printf("Format 0 DCI :ulsch (ue): O %d\n",ulsch->O);
|
||||
printf("Format 0 DCI :ulsch (ue): cqiReq %d\n",cqi_req);
|
||||
if (frame_parms->frame_type == TDD)
|
||||
printf("Format 0 DCI :ulsch (ue): O_ACK/DAI %d/%d\n",ulsch->harq_processes[harq_pid]->O_ACK,dai);
|
||||
else
|
||||
printf("Format 0 DCI :ulsch (ue): O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK);
|
||||
//printf("Format 0 DCI :ulsch (ue): O %d\n",ulsch->O);
|
||||
//printf("Format 0 DCI :ulsch (ue): cqiReq %d\n",cqi_req);
|
||||
//if (frame_parms->frame_type == TDD)
|
||||
// printf("Format 0 DCI :ulsch (ue): O_ACK/DAI %d/%d\n",ulsch->harq_processes[harq_pid]->O_ACK,dai);
|
||||
//else
|
||||
// printf("Format 0 DCI :ulsch (ue): O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK);
|
||||
|
||||
printf("Format 0 DCI :ulsch (ue): Nsymb_pusch %d\n",ulsch->Nsymb_pusch);
|
||||
printf("Format 0 DCI :ulsch (ue): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2);
|
||||
@@ -7873,12 +7873,12 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
|
||||
double sinr_eff_cqi_calc(PHY_VARS_UE *ue, uint8_t eNB_id)
|
||||
double sinr_eff_cqi_calc(PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe)
|
||||
{
|
||||
uint8_t transmission_mode = ue->transmission_mode[eNB_id];
|
||||
PHY_MEASUREMENTS *meas = &ue->measurements;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int32_t **dl_channel_est = ue->common_vars.dl_ch_estimates[eNB_id];
|
||||
int32_t **dl_channel_est = ue->common_vars.common_vars_rx_data_per_thread[subframe &0x1].dl_ch_estimates[eNB_id];
|
||||
double *s_dB;
|
||||
s_dB = ue->sinr_CQI_dB;
|
||||
// LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id];
|
||||
|
||||
@@ -118,7 +118,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
unsigned char exit_flag = 0,i,j,r,aa,layer;
|
||||
int re;
|
||||
unsigned char bw_scaling =1;
|
||||
uint8_t nb_antennas_tx = frame_parms->nb_antennas_tx;
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
|
||||
@@ -113,7 +113,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
break;
|
||||
|
||||
case PDSCH:
|
||||
pdsch_vars = &ue->pdsch_vars[eNB_id];
|
||||
pdsch_vars = &ue->pdsch_vars[subframe&0x1][eNB_id];
|
||||
dlsch = ue->dlsch[eNB_id];
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
|
||||
@@ -121,7 +121,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"[UE %d][FATAL] Frame %d subframe %d: Unknown PDSCH format %d\n",ue->proc.proc_rxtx[0].frame_rx,subframe,type);
|
||||
LOG_E(PHY,"[UE][FATAL] Frame %d subframe %d: Unknown PDSCH format %d\n",ue->proc.proc_rxtx[0].frame_rx,subframe,type);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
@@ -163,8 +163,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
#ifdef DEBUG_DLSCH_MOD
|
||||
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
|
||||
#endif
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -177,8 +177,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
if (dual_stream_flag==1) {
|
||||
if (eNB_id_i<ue->n_connected_eNB)
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id_i],
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
|
||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -189,8 +189,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
ue->high_speed_flag,
|
||||
frame_parms);
|
||||
else
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -202,8 +202,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
frame_parms);
|
||||
}
|
||||
} else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -216,8 +216,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
if (dual_stream_flag==1) {
|
||||
if (eNB_id_i<ue->n_connected_eNB)
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id_i],
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
|
||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -228,8 +228,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
ue->high_speed_flag,
|
||||
frame_parms);
|
||||
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||
dlsch0_harq->pmi_alloc,
|
||||
@@ -241,7 +241,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
frame_parms);
|
||||
}
|
||||
} else if (beamforming_mode==7) { //else if beamforming_mode == 7
|
||||
nb_rb = dlsch_extract_rbs_TM7(common_vars->rxdataF,
|
||||
nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
pdsch_vars[eNB_id]->dl_bf_ch_estimates,
|
||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
|
||||
@@ -5161,7 +5161,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
|
||||
|
||||
#ifdef USER_MODE
|
||||
|
||||
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round)
|
||||
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,uint16_t coded_bits_per_codeword,int round)
|
||||
{
|
||||
|
||||
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
|
||||
@@ -5170,50 +5170,50 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx >1) {
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->transmission_mode[eNB_id]==7){
|
||||
sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
|
||||
//write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1);
|
||||
|
||||
sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
|
||||
|
||||
/*
|
||||
write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
@@ -5222,26 +5222,26 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword
|
||||
*/
|
||||
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
|
||||
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_rho_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
|
||||
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_llr",eNB_id,round);
|
||||
write_output(fname,vname, ue->pdsch_vars[eNB_id]->llr[0],coded_bits_per_codeword,1,0);
|
||||
write_output(fname,vname, ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0],coded_bits_per_codeword,1,0);
|
||||
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
|
||||
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
|
||||
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
|
||||
|
||||
uint32_t tti_offset,aa;
|
||||
uint32_t tti_offset; //,aa;
|
||||
uint8_t re;
|
||||
uint8_t qam64_table_offset_re = 0;
|
||||
uint8_t qam64_table_offset_im = 0;
|
||||
|
||||
Regular → Executable
+154
-68
@@ -32,16 +32,20 @@
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/TOOLS/alaw_lut.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, int k) {
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int32_t **txdataF = eNB->common_vars.txdataF[0];
|
||||
int32_t **rxdataF = eNB->common_vars.rxdataF[0];
|
||||
int16_t **rxsigF = eNB->prach_vars.rxsigF;
|
||||
void *tx_buffer = eNB->ifbuffer.tx;
|
||||
int32_t **txdataF = (eNB->CC_id==0) ? eNB->common_vars.txdataF[0] : PHY_vars_eNB_g[0][0]->common_vars.txdataF[0];
|
||||
int32_t **rxdataF = eNB->common_vars.rxdataF[0];
|
||||
int16_t **rxsigF = eNB->prach_vars.rxsigF;
|
||||
void *tx_buffer = eNB->ifbuffer.tx[subframe&1];
|
||||
void *tx_buffer_prach = eNB->ifbuffer.tx_prach;
|
||||
|
||||
uint16_t symbol_id=0, element_id=0;
|
||||
uint16_t db_fulllength, db_halflength;
|
||||
@@ -49,31 +53,44 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
||||
|
||||
uint16_t *data_block=NULL, *i=NULL;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
|
||||
IF4p5_header_t *packet_header=NULL;
|
||||
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||
int nsym = fp->symbols_per_tti;
|
||||
|
||||
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
|
||||
|
||||
if (packet_type == IF4p5_PDLFFT) {
|
||||
if (subframe_select(fp,subframe)==SF_S)
|
||||
nsym=fp->dl_symbols_in_S_subframe;
|
||||
|
||||
db_fulllength = 12*fp->N_RB_DL;
|
||||
db_halflength = (db_fulllength)>>1;
|
||||
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||
|
||||
IF4p5_header_t *dl_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
|
||||
gen_IF4p5_dl_header(dl_header, frame, subframe);
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
} else {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer);
|
||||
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
|
||||
}
|
||||
gen_IF4p5_dl_header(packet_header, frame, subframe);
|
||||
|
||||
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||
for (symbol_id=0; symbol_id<nsym; symbol_id++) {
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,frame,subframe,symbol_id);
|
||||
|
||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||
i = (uint16_t*) &txdataF[0][blockoffsetF+element_id];
|
||||
i = (uint16_t*) &txdataF[eNB->CC_id][blockoffsetF+element_id];
|
||||
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
|
||||
i = (uint16_t*) &txdataF[0][slotoffsetF+element_id];
|
||||
i = (uint16_t*) &txdataF[eNB->CC_id][slotoffsetF+element_id];
|
||||
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
}
|
||||
|
||||
dl_header->frame_status &= ~(0x000f<<26);
|
||||
dl_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
packet_header->frame_status &= ~(0x000f<<26);
|
||||
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
|
||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||
symbol_id,
|
||||
@@ -87,58 +104,92 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
}
|
||||
} else if (packet_type == IF4p5_PULFFT) {
|
||||
} else if ((packet_type == IF4p5_PULFFT)||
|
||||
(packet_type == IF4p5_PULTICK)){
|
||||
db_fulllength = 12*fp->N_RB_UL;
|
||||
db_halflength = (db_fulllength)>>1;
|
||||
slotoffsetF = 1;
|
||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||
|
||||
IF4p5_header_t *ul_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
if (subframe_select(fp,subframe)==SF_S) {
|
||||
nsym=fp->ul_symbols_in_S_subframe;
|
||||
slotoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
|
||||
blockoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
|
||||
}
|
||||
|
||||
gen_IF4p5_ul_header(ul_header, frame, subframe);
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
} else {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer);
|
||||
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
|
||||
}
|
||||
gen_IF4p5_ul_header(packet_header, packet_type, frame, subframe);
|
||||
|
||||
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||
|
||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
|
||||
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
|
||||
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
|
||||
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
}
|
||||
|
||||
ul_header->frame_status &= ~(0x000f<<26);
|
||||
ul_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
|
||||
if (packet_type == IF4p5_PULFFT) {
|
||||
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||
LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id);
|
||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
|
||||
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
|
||||
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
|
||||
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||
}
|
||||
|
||||
packet_header->frame_status &= ~(0x000f<<26);
|
||||
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
|
||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF4p5_PULFFT)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||
}
|
||||
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF4p5_PULFFT)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||
0,
|
||||
&tx_buffer,
|
||||
0,
|
||||
1,
|
||||
IF4p5_PULTICK)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||
}
|
||||
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
} else if (packet_type == IF4p5_PRACH) {
|
||||
// FIX: hard coded prach samples length
|
||||
db_fulllength = 840*2;
|
||||
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
|
||||
db_fulllength = PRACH_HARD_CODED_NUM_SAMPLES;
|
||||
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
} else {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer_prach);
|
||||
data_block = (uint16_t*)(tx_buffer_prach + sizeof_IF4p5_header_t);
|
||||
}
|
||||
gen_IF4p5_prach_header(packet_header, frame, subframe);
|
||||
|
||||
IF4p5_header_t *prach_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
memcpy((int16_t*)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t),
|
||||
(&rxsigF[0][k]),
|
||||
PRACH_BLOCK_SIZE_BYTES);
|
||||
} else {
|
||||
memcpy((int16_t*)(tx_buffer_prach + sizeof_IF4p5_header_t),
|
||||
(&rxsigF[0][k]),
|
||||
PRACH_BLOCK_SIZE_BYTES);
|
||||
}
|
||||
|
||||
gen_IF4p5_prach_header(prach_header, frame, subframe);
|
||||
|
||||
memcpy((int16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t),
|
||||
(&rxsigF[0][k]),
|
||||
db_fulllength*sizeof(int16_t));
|
||||
|
||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
&tx_buffer_prach,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF4p5_PRACH)) < 0) {
|
||||
@@ -148,7 +199,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
||||
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
|
||||
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,8 +214,9 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
||||
uint16_t element_id;
|
||||
uint16_t db_fulllength, db_halflength;
|
||||
int slotoffsetF=0, blockoffsetF=0;
|
||||
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
|
||||
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
|
||||
|
||||
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||
db_fulllength = (12*fp->N_RB_DL);
|
||||
@@ -183,17 +235,28 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
||||
0) < 0) {
|
||||
perror("ETHERNET read");
|
||||
}
|
||||
|
||||
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t);
|
||||
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t);
|
||||
} else {
|
||||
packet_header = (IF4p5_header_t*) (rx_buffer);
|
||||
data_block = (uint16_t*) (rx_buffer+sizeof_IF4p5_header_t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
*frame = ((packet_header->frame_status)>>6)&0xffff;
|
||||
*subframe = ((packet_header->frame_status)>>22)&0x000f;
|
||||
*subframe = ((packet_header->frame_status)>>22)&0x000f;
|
||||
|
||||
*packet_type = packet_header->sub_type;
|
||||
|
||||
|
||||
if (*packet_type == IF4p5_PDLFFT) {
|
||||
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
||||
|
||||
LOG_D(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number);
|
||||
|
||||
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||
|
||||
@@ -210,6 +273,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
||||
} else if (*packet_type == IF4p5_PULFFT) {
|
||||
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
||||
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"UL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number);
|
||||
|
||||
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + 1;
|
||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||
|
||||
@@ -224,18 +289,27 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
||||
}
|
||||
|
||||
} else if (*packet_type == IF4p5_PRACH) {
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe);
|
||||
|
||||
// FIX: hard coded prach samples length
|
||||
db_fulllength = 840*2;
|
||||
|
||||
memcpy((&rxsigF[0][0]),
|
||||
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t),
|
||||
db_fulllength*sizeof(int16_t));
|
||||
|
||||
db_fulllength = PRACH_HARD_CODED_NUM_SAMPLES;
|
||||
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
memcpy((&rxsigF[0][0]),
|
||||
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t),
|
||||
PRACH_BLOCK_SIZE_BYTES);
|
||||
} else {
|
||||
memcpy((&rxsigF[0][0]),
|
||||
(int16_t*) (rx_buffer+sizeof_IF4p5_header_t),
|
||||
PRACH_BLOCK_SIZE_BYTES);
|
||||
}
|
||||
} else if (*packet_type == IF4p5_PULTICK) {
|
||||
|
||||
} else {
|
||||
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
|
||||
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,10 +327,10 @@ void gen_IF4p5_dl_header(IF4p5_header_t *dl_packet, int frame, int subframe) {
|
||||
}
|
||||
|
||||
|
||||
void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, int frame, int subframe) {
|
||||
void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, uint16_t packet_subtype, int frame, int subframe) {
|
||||
|
||||
ul_packet->type = IF4p5_PACKET_TYPE;
|
||||
ul_packet->sub_type = IF4p5_PULFFT;
|
||||
ul_packet->sub_type = packet_subtype;
|
||||
|
||||
ul_packet->rsvd = 0;
|
||||
|
||||
@@ -282,6 +356,18 @@ void gen_IF4p5_prach_header(IF4p5_header_t *prach_packet, int frame, int subfram
|
||||
|
||||
void malloc_IF4p5_buffer(PHY_VARS_eNB *eNB) {
|
||||
// Keep the size large enough
|
||||
eNB->ifbuffer.tx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||
eNB->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||
int i;
|
||||
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
for (i=0;i<10;i++)
|
||||
eNB->ifbuffer.tx[i] = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||
eNB->ifbuffer.tx_prach = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||
eNB->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||
} else {
|
||||
for (i=0;i<10;i++)
|
||||
eNB->ifbuffer.tx[i] = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||
eNB->ifbuffer.tx_prach = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||
eNB->ifbuffer.rx = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define IF4p5_PULFFT 0x0019
|
||||
#define IF4p5_PDLFFT 0x0020
|
||||
#define IF4p5_PRACH 0x0021
|
||||
#define IF4p5_PULTICK 0x0022
|
||||
|
||||
struct IF4p5_header {
|
||||
/// Type
|
||||
@@ -55,7 +56,7 @@ typedef struct IF4p5_header IF4p5_header_t;
|
||||
|
||||
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
|
||||
|
||||
void gen_IF4p5_ul_header(IF4p5_header_t*, int, int);
|
||||
void gen_IF4p5_ul_header(IF4p5_header_t*, uint16_t, int, int);
|
||||
|
||||
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/if5_tools.c
|
||||
* \brief
|
||||
* \author S. Sandeep Kumar, Raymond Knopp
|
||||
* \author S. Sandeep Kumar, Raymond Knopp, Tien-Thinh Nguyen
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
|
||||
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr, tien-thinh.nguyen@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
@@ -34,13 +34,21 @@
|
||||
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_DL_MOBIPASS
|
||||
//#define DEBUG_UL_MOBIPASS
|
||||
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
|
||||
|
||||
int dummy_cnt = 0;
|
||||
int subframe_skip_extra = 0;
|
||||
int start_flag = 1;
|
||||
int offset_cnt = 1;
|
||||
void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
||||
int32_t *tx_buffer=NULL;
|
||||
|
||||
int8_t dummy_buffer[fp->samples_per_tti*2];
|
||||
uint16_t packet_id=0, i=0;
|
||||
|
||||
uint32_t spp_eth = (uint32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
||||
@@ -89,17 +97,18 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
||||
}
|
||||
|
||||
} else if (packet_type == IF5_MOBIPASS) {
|
||||
uint16_t db_fulllength=640;
|
||||
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||
|
||||
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||
|
||||
__m128i *txp128;
|
||||
__m128i t0, t1;
|
||||
|
||||
tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
// tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 4);
|
||||
|
||||
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||
|
||||
header->flags = 0;
|
||||
header->fifo_status = 0;
|
||||
header->seqno = *seqno;
|
||||
@@ -110,14 +119,14 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
||||
txp128 = (__m128i *) txp[0];
|
||||
|
||||
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
|
||||
header->time_stamp = (uint32_t)(proc_timestamp + packet_id*db_fulllength);
|
||||
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
|
||||
data_block = data_block_head;
|
||||
|
||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||
t0 = _mm_srai_epi16(*txp128++, 4);
|
||||
t1 = _mm_srai_epi16(*txp128++, 4);
|
||||
|
||||
*data_block++ = _mm_packs_epi16(t0, t1);
|
||||
// *data_block++ = _mm_packs_epi16(t0, t1);
|
||||
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
|
||||
}
|
||||
|
||||
// Write the packet to the fronthaul
|
||||
@@ -129,18 +138,38 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
||||
IF5_MOBIPASS)) < 0) {
|
||||
perror("ETHERNET write for IF5_MOBIPASS\n");
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
if ((subframe==0)&&(dummy_cnt == 100)) {
|
||||
memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
|
||||
}
|
||||
#endif
|
||||
header->seqno += 1;
|
||||
}
|
||||
*seqno = header->seqno;
|
||||
|
||||
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
uint8_t txe;
|
||||
txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
|
||||
if (txe > 0){
|
||||
LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
|
||||
}
|
||||
|
||||
free(tx_buffer);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
|
||||
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
if(subframe==0) {
|
||||
if (dummy_cnt==100) {
|
||||
write_output("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
|
||||
exit(-1);
|
||||
} else {
|
||||
dummy_cnt++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,6 +180,8 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
|
||||
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
||||
|
||||
uint16_t packet_id=0, i=0;
|
||||
int8_t dummy_buffer_rx[fp->samples_per_tti*2];
|
||||
uint8_t rxe;
|
||||
|
||||
int32_t spp_eth = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
||||
int32_t spsf = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_frame/10;
|
||||
@@ -202,7 +233,128 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
|
||||
|
||||
} else if (packet_type == IF5_MOBIPASS) {
|
||||
|
||||
|
||||
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||
openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength];
|
||||
int lower_offset = 0;
|
||||
int upper_offset = 70000;
|
||||
int subframe_skip = 0;
|
||||
int reset_flag = 0;
|
||||
int32_t *rx_buffer=NULL;
|
||||
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||
__m128i *rxp128;
|
||||
__m128i r0, r1;
|
||||
|
||||
//rx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
rx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||
|
||||
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti];
|
||||
rxp128 = (__m128i *) (rxp[0]);
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
/*
|
||||
// while(packet_id<fp->samples_per_tti/db_fulllength) {
|
||||
data_block = data_block_head;
|
||||
|
||||
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
|
||||
&ts0,
|
||||
(void**)&rx_buffer,
|
||||
db_fulllength,
|
||||
1
|
||||
);
|
||||
|
||||
if ((header->seqno == 1)&&(first_packet==1)) {
|
||||
first_packet = 0; //ignore the packets before synchnorization
|
||||
packet_id = 0;
|
||||
ts_offset = ntohl(ts0);
|
||||
}
|
||||
if (first_packet==0) {
|
||||
packet_cnt++;
|
||||
ts = ntohl(ts0);
|
||||
packet_id = (ts-ts_offset)/db_fulllength;
|
||||
packet_id = packet_id % (fp->samples_per_tti/db_fulllength);
|
||||
|
||||
printf("[IF5_tools]packet_id:%d\n", packet_id);
|
||||
// if (ts_stored == 0) {
|
||||
// ts_stored = 1;
|
||||
*proc_timestamp = ntohl(ts - (packet_id*db_fulllength));
|
||||
// }
|
||||
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
|
||||
rxp128 = (__m128i *) (rxp[0]);
|
||||
|
||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||
r0 = _mm_loadu_si128(data_block++);
|
||||
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
|
||||
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
|
||||
}
|
||||
}
|
||||
// }//end while
|
||||
*/
|
||||
|
||||
|
||||
packet_id=0;
|
||||
while(packet_id<fp->samples_per_tti/db_fulllength) {
|
||||
data_block = data_block_head;
|
||||
|
||||
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
|
||||
×tamp_mobipass[packet_id],
|
||||
(void**)&rx_buffer,
|
||||
db_fulllength,
|
||||
1
|
||||
);
|
||||
#ifdef DEBUG_UL_MOBIPASS
|
||||
if (((proc->timestamp_tx + lower_offset) > ntohl(timestamp_mobipass[packet_id])) || ((proc->timestamp_tx + upper_offset) < ntohl(timestamp_mobipass[packet_id]))) {
|
||||
//ignore the packet
|
||||
subframe_skip_extra = (subframe_skip_extra + 1)%67;
|
||||
LOG_D("[Mobipass] ignored packet, id:[%d,%d], proc->timestamp_tx:%llu, proc->timestamp_rx:%llu, seqno:%d\n", packet_id,subframe_skip_extra, proc->timestamp_tx, ntohl(timestamp_mobipass[packet_id]), header->seqno);
|
||||
}
|
||||
#endif
|
||||
//skip SUBFRAME_SKIP_NUM_MOBIPASS additional UL packets
|
||||
if ((start_flag == 1) && (subframe_skip < SUBFRAME_SKIP_NUM_MOBIPASS)){
|
||||
subframe_skip++;
|
||||
offset_cnt = header->seqno;
|
||||
} else {
|
||||
if ((offset_cnt != header->seqno) && (start_flag == 0) && (proc->first_rx > 3)){
|
||||
#ifdef DEBUG_UL_MOBIPASS
|
||||
LOG_D(PHY,"[Mobipass] Reset sequence number, offset_cnt:%d, header->seqno:%d, packet_id:%d\n", offset_cnt, header->seqno, packet_id);
|
||||
#endif
|
||||
reset_flag=1;
|
||||
}
|
||||
if ((reset_flag == 1) && (proc->first_rx > 3 ) && (start_flag == 0) && (packet_id == 0)) {
|
||||
packet_id = 1;
|
||||
reset_flag = 0;
|
||||
}
|
||||
start_flag = 0;
|
||||
|
||||
//store rxdata and increase packet_id
|
||||
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
|
||||
rxp128 = (__m128i *) (rxp[0]);
|
||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||
r0 = _mm_loadu_si128(data_block++);
|
||||
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
|
||||
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
|
||||
}
|
||||
packet_id++;
|
||||
offset_cnt = (header->seqno+1)&255;
|
||||
}
|
||||
}//end while
|
||||
|
||||
*proc_timestamp = ntohl(timestamp_mobipass[0]);
|
||||
#ifdef DEBUG_UL_MOBIPASS
|
||||
LOG_I(PHY,"[Mobipass][Recv_MOBIPASS] timestamp: %llu\n ", *proc_timestamp);
|
||||
if (eNB->CC_id>0) {
|
||||
rxe = dB_fixed(signal_energy(rxp[0],fp->samples_per_tti));
|
||||
if (rxe > 0){
|
||||
LOG_I(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (*proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, rxe);
|
||||
// write_output("rxsigmb.m","rxs",(void*)dummy_buffer_rx, fp->samples_per_tti,1, 5);
|
||||
// exit(-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
|
||||
lte_ue_measurements(ue,
|
||||
ue->rx_offset,
|
||||
0,
|
||||
0);
|
||||
0,0);
|
||||
|
||||
|
||||
if (ue->frame_parms.frame_type == TDD) {
|
||||
|
||||
@@ -900,8 +900,8 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
|
||||
#ifdef DEBUG_PBCH
|
||||
msg("[PBCH] starting extract\n");
|
||||
#endif
|
||||
pbch_extract(lte_ue_common_vars->rxdataF,
|
||||
lte_ue_common_vars->dl_ch_estimates[eNB_id],
|
||||
pbch_extract(lte_ue_common_vars->common_vars_rx_data_per_thread[0].rxdataF,
|
||||
lte_ue_common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id],
|
||||
lte_ue_pbch_vars->rxdataF_ext,
|
||||
lte_ue_pbch_vars->dl_ch_estimates_ext,
|
||||
symbol,
|
||||
|
||||
@@ -191,7 +191,7 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
|
||||
// mapping
|
||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
|
||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*((subframe*nsymb));
|
||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(subframe*nsymb);
|
||||
re_offset = frame_parms->first_carrier_offset;
|
||||
|
||||
// loop over 4 quadruplets and lookup REGs
|
||||
|
||||
@@ -1393,13 +1393,13 @@ void rx_phich(PHY_VARS_UE *ue,
|
||||
}
|
||||
} else {
|
||||
//#ifdef DEBUG_PHICH
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d\n",
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d (Mlimit %d)\n",
|
||||
ue->Mod_id,harq_pid,
|
||||
proc->frame_rx,
|
||||
proc->frame_rx%1024,
|
||||
subframe,
|
||||
HI16,
|
||||
nseq_PHICH,
|
||||
ngroup_PHICH,
|
||||
ngroup_PHICH,ulsch->harq_processes[harq_pid]->round+1,
|
||||
ulsch->Mlimit);
|
||||
//#endif
|
||||
|
||||
@@ -1450,7 +1450,7 @@ void rx_phich(PHY_VARS_UE *ue,
|
||||
//#ifdef PHICH_DEBUG
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n",
|
||||
ue->Mod_id,harq_pid,
|
||||
proc->frame_rx,
|
||||
proc->frame_rx%1024,
|
||||
subframe, HI16,
|
||||
nseq_PHICH,ngroup_PHICH);
|
||||
//#endif
|
||||
|
||||
@@ -74,7 +74,7 @@ void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,in
|
||||
write_output(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1);
|
||||
|
||||
write_output("mch00_ch0.m","pmch00_ch0",
|
||||
&(ue->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
&(ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
ue->frame_parms.ofdm_symbol_size*12,1,1);
|
||||
|
||||
write_output("rxsig_mch.m","rxs_mch",
|
||||
@@ -969,8 +969,8 @@ int rx_pmch(PHY_VARS_UE *ue,
|
||||
|
||||
//printf("*********************mch: symbol %d\n",symbol);
|
||||
|
||||
mch_extract_rbs(common_vars->rxdataF,
|
||||
common_vars->dl_ch_estimates[eNB_id],
|
||||
mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
symbol,
|
||||
|
||||
@@ -1185,9 +1185,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
break;
|
||||
}
|
||||
|
||||
if (eNB->frame_parms.threequarter_fs == 1)
|
||||
Ncp=(Ncp*3)>>2;
|
||||
|
||||
// Adjust CP length based on UL bandwidth
|
||||
switch (eNB->frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
Ncp>>=4;
|
||||
@@ -1208,6 +1206,11 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
case 75:
|
||||
Ncp=(Ncp*3)>>2;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if (eNB->frame_parms.threequarter_fs == 1)
|
||||
Ncp=(Ncp*3)>>2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1570,7 +1570,8 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id);
|
||||
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t eNB_id);
|
||||
uint8_t eNB_id,
|
||||
uint8_t subframe);
|
||||
|
||||
uint8_t sinr2cqi(double sinr,uint8_t trans_mode);
|
||||
|
||||
|
||||
@@ -555,6 +555,7 @@ void generate_pucch2x(int32_t **txdataF,
|
||||
N_UL_symb = (fp->Ncp==0) ? 7 : 6;
|
||||
data_ind = 0;
|
||||
zptr = z;
|
||||
nprime = 0;
|
||||
for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) {
|
||||
|
||||
if ((ns&1) == 0)
|
||||
|
||||
@@ -163,7 +163,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
|
||||
int rx_offset = frame_parms->ofdm_symbol_size-3*12;
|
||||
uint8_t pss_symb,sss_symb;
|
||||
|
||||
int32_t **rxdataF = ue->common_vars.rxdataF;
|
||||
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[0].rxdataF;
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
pss_symb = 6-frame_parms->Ncp;
|
||||
|
||||
@@ -190,7 +190,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
return(ulsch);
|
||||
}
|
||||
|
||||
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %d\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
|
||||
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
|
||||
free_ue_ulsch(ulsch);
|
||||
return(NULL);
|
||||
|
||||
@@ -234,7 +234,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
PHY_MEASUREMENTS *meas = &ue->measurements;
|
||||
LTE_UE_ULSCH_t *ulsch=ue->ulsch[eNB_id];
|
||||
LTE_UE_DLSCH_t **dlsch = ue->dlsch[eNB_id];
|
||||
uint16_t rnti;
|
||||
uint16_t rnti = 0xffff;
|
||||
|
||||
if (!ulsch) {
|
||||
LOG_E(PHY,"Null ulsch ptr %p\n",ulsch);
|
||||
|
||||
@@ -63,28 +63,30 @@ int beam_precoding(int32_t **txdataF,
|
||||
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
|
||||
memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
||||
|
||||
for (p=0; p<14; p++) {
|
||||
//if (p==0 || p==1 || p==5 || p>7)
|
||||
// mult_cpx_conj_vector((int16_t*)txdataF[p], (int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15);
|
||||
for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
|
||||
if ((p==0 || p==1 || p==5 || p>=7) && txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
for (p=0; p<NB_ANTENNA_PORTS_ENB; p++) {
|
||||
if (p<frame_parms->nb_antenna_ports_eNB || p==5) {
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size],(int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], 0, frame_parms->ofdm_symbol_size, 15);
|
||||
//mult_cpx_conj_vector((int16_t*)beam_weights[p][aa], (int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15, 1);
|
||||
|
||||
/*
|
||||
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
|
||||
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
|
||||
p,aa,re,
|
||||
((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
|
||||
aa,re,
|
||||
((int16_t*)&txdataF_BF[aa][re])[0],
|
||||
((int16_t*)&txdataF_BF[aa][re])[1]);
|
||||
*/
|
||||
}
|
||||
// if check version
|
||||
/*for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
|
||||
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
|
||||
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
|
||||
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
|
||||
p,aa,re,
|
||||
((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
|
||||
aa,re,
|
||||
((int16_t*)&txdataF_BF[aa][re])[0],
|
||||
((int16_t*)&txdataF_BF[aa][re])[1]);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
|
||||
int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs){
|
||||
|
||||
FILE *calibF_fd;
|
||||
int i,j,l,calibF_e;
|
||||
int i,j,calibF_e;
|
||||
|
||||
calibF_fd = fopen(calibF_fname,"r");
|
||||
|
||||
@@ -14,7 +15,7 @@ int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coef
|
||||
|
||||
for(i=0;i<nb_ant;i++){
|
||||
for(j=0;j<nb_freq*2;j++){
|
||||
fscanf(calibF_fd, "%d", &calibF_e);
|
||||
if (fscanf(calibF_fd, "%d", &calibF_e) != 1) abort();
|
||||
tdd_calib_coeffs[i][j] = (int16_t)calibF_e;
|
||||
}
|
||||
}
|
||||
@@ -22,11 +23,15 @@ int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coef
|
||||
printf("%d\n",(int)tdd_calib_coeffs[1][599]);
|
||||
} else
|
||||
printf("%s not found, running with defaults\n",calibF_fname);
|
||||
/* TODO: what to return? is this code used at all? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int estimate_DLCSI_from_ULCSI(int32_t **calib_dl_ch_estimates, int32_t **ul_ch_estimates, int32_t **tdd_calib_coeffs, int nb_ant, int nb_freq) {
|
||||
|
||||
/* TODO: what to return? is this code used at all? */
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +49,8 @@ int compute_BF_weights(int32_t **beam_weights, int32_t **calib_dl_ch_estimates,
|
||||
default :
|
||||
break;
|
||||
}
|
||||
/* TODO: what to return? is this code used at all? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
// temporal test function
|
||||
|
||||
@@ -82,7 +82,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
|
||||
void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms,int do_precoding);
|
||||
|
||||
void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
#else
|
||||
// on AVX2 need 256-bit alignment
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
(fftsize<=512) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
(int16_t *)temp,
|
||||
1);
|
||||
|
||||
#endif
|
||||
@@ -163,8 +163,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
|
||||
#ifndef __AVX2__
|
||||
if (fftsize==128)
|
||||
#else
|
||||
if (fftsize<=512)
|
||||
#endif
|
||||
{
|
||||
for (j=0; j<fftsize ; j++) {
|
||||
@@ -285,16 +283,16 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
|
||||
}
|
||||
|
||||
// OFDM modulation for each symbol
|
||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms,int do_precoding)
|
||||
{
|
||||
|
||||
int aa, l, slot_offset;
|
||||
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
|
||||
int aa, l, slot_offset, slot_offsetF;
|
||||
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
|
||||
int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
|
||||
int32_t **txdata = eNB_common_vars->txdata[eNB_id];
|
||||
|
||||
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
|
||||
int32_t **txdata = eNB_common_vars->txdata[eNB_id];
|
||||
|
||||
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
|
||||
slot_offsetF = (next_slot)*(frame_parms->ofdm_symbol_size)*((frame_parms->Ncp==EXTENDED) ? 6 : 7);
|
||||
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
|
||||
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
|
||||
|
||||
@@ -302,13 +300,13 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
||||
|
||||
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
|
||||
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
|
||||
if (do_precoding==1) beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
|
||||
|
||||
//PMCH case not implemented...
|
||||
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
if (frame_parms->Ncp == EXTENDED)
|
||||
PHY_ofdm_mod((do_precoding == 1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||
&txdata[aa][slot_offset+l*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
@@ -316,7 +314,7 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
if (l==0) {
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
PHY_ofdm_mod((do_precoding==1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||
&txdata[aa][slot_offset], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
@@ -324,7 +322,7 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
} else {
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
PHY_ofdm_mod((do_precoding==1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||
&txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
|
||||
@@ -109,18 +109,12 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
memset(&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
|
||||
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
|
||||
// Align with 256 bit
|
||||
// rx_offset = rx_offset&0xfffffff8;
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
#endif
|
||||
|
||||
if (l==0) {
|
||||
|
||||
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||
@@ -133,12 +127,12 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
|
||||
}
|
||||
@@ -148,8 +142,8 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
LOG_I(PHY,"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset,frame_length_samples);
|
||||
#endif
|
||||
|
||||
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||
@@ -164,11 +158,11 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
}
|
||||
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
@@ -176,6 +170,10 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx, symbol,rx_offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ue->perfect_ce == 0) {
|
||||
@@ -211,7 +209,7 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
|
||||
if (l==(4-frame_parms->Ncp)) {
|
||||
start_meas(&ue->dlsch_freq_offset_estimation_stats);
|
||||
lte_est_freq_offset(common_vars->dl_ch_estimates[0],
|
||||
lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[0],
|
||||
frame_parms,
|
||||
l,
|
||||
&common_vars->freq_offset,
|
||||
|
||||
@@ -109,14 +109,14 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
memset(&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
memset(&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
if (l==0) {
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
nb_prefix_samples0 +
|
||||
subframe_offset -
|
||||
SOFFSET) % frame_length_samples],
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
} else {
|
||||
if ((sample_offset +
|
||||
@@ -134,7 +134,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
|
||||
subframe_offset-
|
||||
SOFFSET) % frame_length_samples],
|
||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,10 +79,10 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
if (no_prefix) {
|
||||
// subframe_offset = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
|
||||
slot_offset = frame_parms->ofdm_symbol_size * (frame_parms->symbols_per_tti>>1) * (Ns%2);
|
||||
slot_offset = frame_parms->ofdm_symbol_size * (frame_parms->symbols_per_tti>>1) * (Ns&1);
|
||||
} else {
|
||||
// subframe_offset = frame_parms->samples_per_tti * (Ns>>1);
|
||||
slot_offset = (frame_parms->samples_per_tti>>1) * (Ns%2);
|
||||
slot_offset = (frame_parms->samples_per_tti>>1) * (Ns&1);
|
||||
}
|
||||
|
||||
if (l<0 || l>=7-frame_parms->Ncp) {
|
||||
@@ -108,18 +108,22 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
1
|
||||
);
|
||||
} else {
|
||||
|
||||
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;
|
||||
/* should never happen for eNB
|
||||
if(rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||
{
|
||||
memcpy((void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][frame_length_samples],
|
||||
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][0],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
}
|
||||
*/
|
||||
|
||||
if( (rx_offset & 7) != 0){
|
||||
// check for 256-bit alignment of input buffer and do DFT directly, else do via intermediate buffer
|
||||
if( (rx_offset & 15) != 0){
|
||||
memcpy((void *)&tmp_dft_in,
|
||||
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][(rx_offset % frame_length_samples)],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][(rx_offset % frame_length_samples)],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft( (short *) tmp_dft_in,
|
||||
(short*) &eNB_common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
1
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
|
||||
int16_t conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
#define simd_q15_t __m128i
|
||||
#define simdshort_q15_t __m64
|
||||
#elif defined(__arm__)
|
||||
@@ -41,7 +42,8 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
int output_shift,
|
||||
int madd)
|
||||
{
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@@ -55,6 +57,8 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
//
|
||||
// madd - add the output to y
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
@@ -88,7 +92,11 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||
if (madd==0)
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 += _mm_packs_epi32(tmpy0,tmpy1);
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]);
|
||||
@@ -110,7 +118,10 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
tmp_re = vqshlq_s32(tmp_re,shift);
|
||||
tmp_im = vqshlq_s32(tmp_im,shift);
|
||||
tmpy = vzip_s16(vmovn_s32(tmp_re),vmovn_s32(tmp_im));
|
||||
*y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
||||
if (madd==0)
|
||||
*y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
||||
else
|
||||
*y_128 += vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
||||
#endif
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
@@ -124,3 +135,81 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
///
|
||||
// y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// zero_flag - Set output (y) to zero prior to disable accumulation
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t tmp_re,tmp_im;
|
||||
int32x4_t tmp_re1,tmp_im1;
|
||||
int16x4x2_t tmpy;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
#endif
|
||||
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);
|
||||
tmp_re = _mm_madd_epi16(tmp_re,*x2_128);
|
||||
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
|
||||
tmp_re = _mm_srai_epi32(tmp_re,output_shift);
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
//print_ints("unpack lo:",&tmpy0[i]);
|
||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
//print_ints("unpack hi:",&tmpy1[i]);
|
||||
|
||||
if (zero_flag == 1)
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 = _mm_adds_epi16(*y_128,_mm_packs_epi32(tmpy0,tmpy1));
|
||||
//print_shorts("*y_128:",&y_128[i]);
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
msg("mult_cpx_vector not implemented for __arm__");
|
||||
#endif
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -116,13 +116,34 @@ int rotate_cpx_vector(int16_t *x,
|
||||
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
@param output_shift - shift to be applied to generate output
|
||||
@param madd - if not zero result is added to output
|
||||
*/
|
||||
|
||||
int mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
int output_shift,
|
||||
int madd);
|
||||
|
||||
/*!
|
||||
Element-wise multiplication and accumulation of two complex vectors x1 and x2.
|
||||
@param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x1 with a dinamic of 15 bit maximum
|
||||
@param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x2 with a dinamic of 14 bit maximum
|
||||
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@param zero_flag Set output (y) to zero prior to accumulation
|
||||
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
@param output_shift - shift to be applied to generate output
|
||||
*/
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
// lte_dfts.c
|
||||
void init_fft(uint16_t size,
|
||||
|
||||
@@ -559,15 +559,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
|
||||
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata;
|
||||
chest_t = (int16_t**) phy_vars_ue->common_vars.dl_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_ue->common_vars.dl_ch_estimates[eNB_id];
|
||||
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id];
|
||||
pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
||||
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[eNB_id]->llr;
|
||||
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[eNB_id]->llr[0]; // stream 0
|
||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
|
||||
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[eNB_id]->rxdataF_comp0[0];
|
||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
|
||||
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
|
||||
+29
-4
@@ -124,7 +124,6 @@ static inline void* malloc16_clear( size_t size )
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
#include "platform_types.h"
|
||||
|
||||
#define OPENAIR_LTE
|
||||
#ifdef OPENAIR_LTE
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
@@ -242,10 +241,16 @@ typedef struct eNB_proc_t_s {
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// symbol mask for IF4p5 reception per subframe
|
||||
uint32_t symbol_mask[10];
|
||||
/// subframe to act upon for PRACH
|
||||
int subframe_prach;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
|
||||
int frame_offset;
|
||||
/// frame to act upon for PRACH
|
||||
int frame_prach;
|
||||
/// \internal This variable is protected by \ref mutex_fep.
|
||||
@@ -260,6 +265,8 @@ typedef struct eNB_proc_t_s {
|
||||
/// \brief Instance count for rx processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_prach.
|
||||
int instance_cnt_prach;
|
||||
// instance count for over-the-air eNB synchronization
|
||||
int instance_cnt_synch;
|
||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||
int instance_cnt_asynch_rxtx;
|
||||
/// pthread structure for FH processing thread
|
||||
@@ -284,6 +291,8 @@ typedef struct eNB_proc_t_s {
|
||||
pthread_attr_t attr_single;
|
||||
/// pthread attributes for prach processing thread
|
||||
pthread_attr_t attr_prach;
|
||||
/// pthread attributes for over-the-air synch thread
|
||||
pthread_attr_t attr_synch;
|
||||
/// pthread attributes for asynchronous RX thread
|
||||
pthread_attr_t attr_asynch_rxtx;
|
||||
/// scheduling parameters for parallel fep thread
|
||||
@@ -298,6 +307,8 @@ typedef struct eNB_proc_t_s {
|
||||
struct sched_param sched_param_single;
|
||||
/// scheduling parameters for prach thread
|
||||
struct sched_param sched_param_prach;
|
||||
/// scheduling parameters for over-the-air synchronization thread
|
||||
struct sched_param sched_param_synch;
|
||||
/// scheduling parameters for asynch_rxtx thread
|
||||
struct sched_param sched_param_asynch_rxtx;
|
||||
/// pthread structure for parallel fep thread
|
||||
@@ -308,6 +319,8 @@ typedef struct eNB_proc_t_s {
|
||||
pthread_t pthread_te;
|
||||
/// pthread structure for PRACH thread
|
||||
pthread_t pthread_prach;
|
||||
/// pthread structure for eNB synch thread
|
||||
pthread_t pthread_synch;
|
||||
/// condition variable for parallel fep thread
|
||||
pthread_cond_t cond_fep;
|
||||
/// condition variable for parallel turbo-decoder thread
|
||||
@@ -318,6 +331,8 @@ typedef struct eNB_proc_t_s {
|
||||
pthread_cond_t cond_FH;
|
||||
/// condition variable for PRACH processing thread;
|
||||
pthread_cond_t cond_prach;
|
||||
// condition variable for over-the-air eNB synchronization
|
||||
pthread_cond_t cond_synch;
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// mutex for parallel fep thread
|
||||
@@ -330,6 +345,8 @@ typedef struct eNB_proc_t_s {
|
||||
pthread_mutex_t mutex_FH;
|
||||
/// mutex for PRACH thread
|
||||
pthread_mutex_t mutex_prach;
|
||||
// mutex for over-the-air eNB synchronization
|
||||
pthread_mutex_t mutex_synch;
|
||||
/// mutex for asynch RX/TX thread
|
||||
pthread_mutex_t mutex_asynch_rxtx;
|
||||
/// parameters for turbo-decoding worker thread
|
||||
@@ -416,8 +433,15 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int single_thread_flag;
|
||||
openair0_rf_map rf_map;
|
||||
int abstraction_flag;
|
||||
void (*do_prach)(struct PHY_VARS_eNB_s *eNB);
|
||||
void (*fep)(struct PHY_VARS_eNB_s *eNB);
|
||||
openair0_timestamp ts_offset;
|
||||
// indicator for synchronization state of eNB
|
||||
int in_synch;
|
||||
// indicator for master/slave (RRU)
|
||||
int is_slave;
|
||||
// indicator for precoding function (eNB,3GPP_eNB_BBU)
|
||||
int do_precoding;
|
||||
void (*do_prach)(struct PHY_VARS_eNB_s *eNB,int frame,int subframe);
|
||||
void (*fep)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc);
|
||||
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
|
||||
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
|
||||
void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type);
|
||||
@@ -677,7 +701,7 @@ typedef struct {
|
||||
LTE_DL_FRAME_PARMS frame_parms_before_ho;
|
||||
LTE_UE_COMMON common_vars;
|
||||
|
||||
LTE_UE_PDSCH *pdsch_vars[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||
LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||
LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||
@@ -774,6 +798,7 @@ typedef struct {
|
||||
uint8_t prach_PreambleIndex;
|
||||
// uint8_t prach_timer;
|
||||
int rx_offset; /// Timing offset
|
||||
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
|
||||
int timing_advance; ///timing advance signalled from eNB
|
||||
int hw_timing_advance;
|
||||
int N_TA_offset; ///timing offset used in TDD
|
||||
|
||||
@@ -504,6 +504,8 @@ typedef struct {
|
||||
uint8_t tdd_config;
|
||||
/// TDD S-subframe configuration (0-9)
|
||||
uint8_t tdd_config_S;
|
||||
/// srs extra symbol flag for TDD
|
||||
uint8_t srsX;
|
||||
/// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0).
|
||||
uint8_t node_id;
|
||||
/// Frequency index of CBMIMO1 card
|
||||
@@ -542,11 +544,15 @@ typedef struct {
|
||||
uint32_t samples_per_tti;
|
||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||
uint16_t symbols_per_tti;
|
||||
/// Number of OFDM symbols in DL portion of S-subframe
|
||||
uint16_t dl_symbols_in_S_subframe;
|
||||
/// Number of SC-FDMA symbols in UL portion of S-subframe
|
||||
uint16_t ul_symbols_in_S_subframe;
|
||||
/// Number of Physical transmit antennas in node
|
||||
uint8_t nb_antennas_tx;
|
||||
/// Number of Receive antennas in node
|
||||
uint8_t nb_antennas_rx;
|
||||
/// Number of Logical transmit antenna ports in eNodeB
|
||||
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
||||
uint8_t nb_antenna_ports_eNB;
|
||||
/// PRACH_CONFIG
|
||||
PRACH_CONFIG_COMMON prach_config_common;
|
||||
@@ -778,6 +784,26 @@ typedef struct {
|
||||
#endif
|
||||
} LTE_eNB_PUSCH;
|
||||
|
||||
typedef struct {
|
||||
|
||||
/// \brief Holds the received data in the frequency domain.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..28*ofdm_symbol_size[
|
||||
int32_t **rxdataF;
|
||||
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
int32_t **dl_ch_estimates[7];
|
||||
|
||||
/// \brief Hold the channel estimates in time domain (used for tracking).
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..2*ofdm_symbol_size[
|
||||
int32_t **dl_ch_estimates_time[7];
|
||||
}LTE_UE_COMMON_PER_THREAD;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in time domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
||||
@@ -789,29 +815,15 @@ typedef struct {
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
|
||||
int32_t **txdataF;
|
||||
|
||||
/// \brief Holds the received data in time domain.
|
||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
|
||||
int32_t **rxdata;
|
||||
/// \brief Holds the received data in the frequency domain.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..28*ofdm_symbol_size[
|
||||
int32_t **rxdataF;
|
||||
/// \brief ?.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..20*ofdm_symbol_size*symbols_per_tti[
|
||||
int32_t **rxdataF2;
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
int32_t **dl_ch_estimates[7];
|
||||
/// \brief Hold the channel estimates in time domain (used for tracking).
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..2*ofdm_symbol_size[
|
||||
int32_t **dl_ch_estimates_time[7];
|
||||
|
||||
LTE_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[2];
|
||||
|
||||
/// holds output of the sync correlator
|
||||
int32_t *sync_corr;
|
||||
/// estimated frequency offset (in radians) for all subcarriers
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
#define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot
|
||||
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
|
||||
|
||||
#define NB_ANTENNA_PORTS_ENB 14 // total number of eNB antenna ports
|
||||
#define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports
|
||||
|
||||
#ifdef EXMIMO
|
||||
#define TARGET_RX_POWER 55 // Target digital power for the AGC
|
||||
|
||||
@@ -182,7 +182,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *pr
|
||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
*/
|
||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB);
|
||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc);
|
||||
|
||||
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||
@@ -509,7 +509,7 @@ int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame,
|
||||
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
|
||||
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, uint16_t coded_bits_per_codeword,int round);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
@@ -788,7 +788,7 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
||||
|
||||
eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE;
|
||||
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",eNB->Mod_id,frame,subframe,
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
|
||||
dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe]);
|
||||
|
||||
#if defined(SMBV)
|
||||
@@ -900,7 +900,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *d
|
||||
int i;
|
||||
|
||||
LOG_D(PHY,
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
eNB->Mod_id, dlsch->rnti,harq_pid,
|
||||
frame, subframe, input_buffer_length,
|
||||
get_G(fp,
|
||||
@@ -1146,7 +1146,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
DCI_ALLOC_t *dci_alloc=(DCI_ALLOC_t *)NULL;
|
||||
|
||||
int offset = proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
||||
int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
||||
|
||||
#if defined(SMBV)
|
||||
// counts number of allocations in subframe
|
||||
@@ -2032,8 +2032,8 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
||||
T_INT(preamble_max), T_INT(preamble_energy_max), T_INT(preamble_delay_list[preamble_max]));
|
||||
|
||||
if (eNB->mac_enabled==1) {
|
||||
uint8_t update_TA=4;
|
||||
|
||||
uint8_t update_TA = 4;
|
||||
uint8_t update_TA2 = 1;
|
||||
switch (fp->N_RB_DL) {
|
||||
case 6:
|
||||
update_TA = 16;
|
||||
@@ -2047,8 +2047,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
||||
update_TA = 2;
|
||||
break;
|
||||
|
||||
case 75:
|
||||
update_TA = 3;
|
||||
update_TA2 = 2;
|
||||
case 100:
|
||||
update_TA = 1;
|
||||
update_TA = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2056,7 +2059,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
||||
eNB->CC_id,
|
||||
frame,
|
||||
preamble_max,
|
||||
preamble_delay_list[preamble_max]*update_TA,
|
||||
preamble_delay_list[preamble_max]*update_TA/update_TA2,
|
||||
0,subframe,0);
|
||||
}
|
||||
|
||||
@@ -2670,7 +2673,7 @@ void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) {
|
||||
}
|
||||
|
||||
|
||||
void eNB_fep_full_2thread(PHY_VARS_eNB *eNB) {
|
||||
void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
|
||||
@@ -2716,28 +2719,27 @@ void eNB_fep_full_2thread(PHY_VARS_eNB *eNB) {
|
||||
|
||||
|
||||
|
||||
void eNB_fep_full(PHY_VARS_eNB *eNB) {
|
||||
void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
int l;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
|
||||
start_meas(&eNB->ofdm_demod_stats);
|
||||
remove_7_5_kHz(eNB,proc->subframe_rx<<1);
|
||||
remove_7_5_kHz(eNB,1+(proc->subframe_rx<<1));
|
||||
remove_7_5_kHz(eNB,proc_rxtx->subframe_rx<<1);
|
||||
remove_7_5_kHz(eNB,1+(proc_rxtx->subframe_rx<<1));
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(fp,
|
||||
&eNB->common_vars,
|
||||
l,
|
||||
proc->subframe_rx<<1,
|
||||
(proc_rxtx->subframe_rx)<<1,
|
||||
0,
|
||||
0
|
||||
);
|
||||
slot_fep_ul(fp,
|
||||
&eNB->common_vars,
|
||||
l,
|
||||
1+(proc->subframe_rx<<1),
|
||||
1+((proc_rxtx->subframe_rx)<<1),
|
||||
0,
|
||||
0
|
||||
);
|
||||
@@ -2748,11 +2750,11 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) {
|
||||
|
||||
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||
/// **** send_IF4 of rxdataF to RCC (no prach now) **** ///
|
||||
send_IF4p5(eNB, proc->frame_rx, proc->subframe_rx, IF4p5_PULFFT, 0);
|
||||
send_IF4p5(eNB, proc_rxtx->frame_rx, proc_rxtx->subframe_rx, IF4p5_PULFFT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void eNB_fep_rru_if5(PHY_VARS_eNB *eNB) {
|
||||
void eNB_fep_rru_if5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||
|
||||
eNB_proc_t *proc=&eNB->proc;
|
||||
uint8_t seqno=0;
|
||||
@@ -2764,17 +2766,17 @@ void eNB_fep_rru_if5(PHY_VARS_eNB *eNB) {
|
||||
|
||||
}
|
||||
|
||||
void do_prach(PHY_VARS_eNB *eNB) {
|
||||
void do_prach(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
// check if we have to detect PRACH first
|
||||
if (is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0) {
|
||||
if (is_prach_subframe(fp,frame,subframe)>0) {
|
||||
/* accept some delay in processing - up to 5ms */
|
||||
int i;
|
||||
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
|
||||
LOG_W(PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
||||
LOG_W(PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", frame,subframe,proc->instance_cnt_prach);
|
||||
usleep(500);
|
||||
}
|
||||
if (proc->instance_cnt_prach == 0) {
|
||||
@@ -2784,15 +2786,15 @@ void do_prach(PHY_VARS_eNB *eNB) {
|
||||
|
||||
// wake up thread for PRACH RX
|
||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->thread_index, proc->instance_cnt_prach);
|
||||
exit_fun( "error locking mutex_prach" );
|
||||
return;
|
||||
}
|
||||
|
||||
++proc->instance_cnt_prach;
|
||||
// set timing for prach thread
|
||||
proc->frame_prach = proc->frame_rx;
|
||||
proc->subframe_prach = proc->subframe_rx;
|
||||
proc->frame_prach = frame;
|
||||
proc->subframe_prach = subframe;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc->cond_prach) != 0) {
|
||||
@@ -2806,28 +2808,34 @@ void do_prach(PHY_VARS_eNB *eNB) {
|
||||
|
||||
}
|
||||
|
||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB){
|
||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
|
||||
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
// eNB_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
const int subframe = proc->subframe_rx;
|
||||
const int frame = proc->frame_rx;
|
||||
int offset = (eNB->single_thread_flag==1) ? 0 : (subframe&1);
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB+offset, proc->frame_rx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB+offset, proc->subframe_rx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 );
|
||||
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
|
||||
|
||||
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
|
||||
send_IF4p5(eNB, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 );
|
||||
start_meas(&eNB->phy_proc_rx);
|
||||
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe);
|
||||
|
||||
|
||||
if (eNB->fep) eNB->fep(eNB);
|
||||
|
||||
if (eNB->do_prach) eNB->do_prach(eNB);
|
||||
if (eNB->fep) eNB->fep(eNB,proc);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
|
||||
}
|
||||
@@ -2847,7 +2855,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
|
||||
|
||||
const int subframe = proc->subframe_rx;
|
||||
const int frame = proc->frame_rx;
|
||||
int offset = (proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1;
|
||||
int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1;
|
||||
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
|
||||
|
||||
@@ -99,20 +99,20 @@ void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subf
|
||||
subframe,
|
||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]);
|
||||
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe&0x1][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[subframe&0x1][0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
||||
/*
|
||||
write_output("dlsch01_ch0_ext.m","dl01_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[1],300*12,1,1);
|
||||
write_output("dlsch10_ch0_ext.m","dl10_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[2],300*12,1,1);
|
||||
write_output("dlsch11_ch0_ext.m","dl11_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[3],300*12,1,1);
|
||||
write_output("dlsch_rho.m","dl_rho",pdsch_vars[0]->rho[0],300*12,1,1);
|
||||
*/
|
||||
write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[0]->rxdataF_comp0[0],300*12,1,1);
|
||||
write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[0]->llr[0],coded_bits_per_codeword,1,0);
|
||||
write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[subframe&0x1][0]->rxdataF_comp0[0],300*12,1,1);
|
||||
write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[subframe&0x1][0]->llr[0],coded_bits_per_codeword,1,0);
|
||||
|
||||
write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[0]->dl_ch_mag0,300*12,1,1);
|
||||
write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[0]->dl_ch_magb0,300*12,1,1);
|
||||
write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0,300*12,1,1);
|
||||
write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0,300*12,1,1);
|
||||
}
|
||||
|
||||
void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe)
|
||||
@@ -141,7 +141,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
|
||||
|
||||
write_output("rxsig0.m","rxs0", &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti],ue->frame_parms.samples_per_tti,1,1);
|
||||
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_SI[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_SI[0]->dl_ch_estimates_ext[0],ue->frame_parms.N_RB_DL*12*nsymb,1,1);
|
||||
/*
|
||||
@@ -242,7 +242,7 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
|
||||
ue->pdcch_vars[eNB_id]->num_pdcch_symbols,
|
||||
coded_bits_per_codeword);
|
||||
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_ra[0]->rxdataF_ext[0],2*12*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_ra[0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
||||
/*
|
||||
@@ -346,7 +346,9 @@ void process_timing_advance_rar(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint16_t ti
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d, HW timing advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);
|
||||
/* TODO: fix this log, what is 'HW timing advance'? */
|
||||
/*LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d, HW timing advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);*/
|
||||
LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -938,7 +940,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||
} // switch tdd_config
|
||||
}
|
||||
|
||||
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, exit without proper return\n",proc->frame_tx);
|
||||
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, exit without proper return\n", ue->Mod_id, proc->frame_tx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1154,7 +1156,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
frame_tx,
|
||||
eNB_id,
|
||||
subframe_tx);
|
||||
LOG_D(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
|
||||
LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
|
||||
LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]);
|
||||
}
|
||||
}
|
||||
@@ -1370,7 +1372,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
|
||||
{
|
||||
LOG_D(PHY,"PUSCH MAX Retransmission acheived ==> send last pusch (%d) \n");
|
||||
LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
|
||||
}
|
||||
@@ -1813,7 +1815,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
#endif
|
||||
if (SR_payload>0) {
|
||||
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH, amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[eNB_id][0]->rnti,
|
||||
frame_tx % 1024, subframe_tx,
|
||||
@@ -1826,10 +1828,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
Po_PUCCH,
|
||||
tx_amp);
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[eNB_id][0]->rnti,
|
||||
frame_tx, subframe_tx,
|
||||
frame_tx, subframe_tx,ue->rx_offset_diff,
|
||||
(format == pucch_format1a? "1a": (
|
||||
format == pucch_format1b? "1b" : "??")),
|
||||
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
||||
@@ -2056,7 +2058,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
||||
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
int32_t ulsch_start=0;
|
||||
//int32_t ulsch_start=0;
|
||||
int subframe_tx = proc->subframe_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
unsigned int aa;
|
||||
@@ -2241,12 +2243,13 @@ void ue_measurement_procedures(
|
||||
lte_ue_measurements(ue,
|
||||
(subframe_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME),
|
||||
(subframe_rx == 1) ? 1 : 0,
|
||||
0);
|
||||
0,subframe_rx);
|
||||
} else {
|
||||
lte_ue_measurements(ue,
|
||||
0,
|
||||
0,
|
||||
1);
|
||||
1,
|
||||
subframe_rx);
|
||||
}
|
||||
#if T_TRACER
|
||||
if(slot == 0)
|
||||
@@ -2272,11 +2275,11 @@ void ue_measurement_procedures(
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_OUT);
|
||||
|
||||
if (abstraction_flag==1)
|
||||
ue->sinr_eff = sinr_eff_cqi_calc(ue, 0);
|
||||
ue->sinr_eff = sinr_eff_cqi_calc(ue, 0, subframe_rx);
|
||||
|
||||
}
|
||||
|
||||
if ((subframe_rx==0) && (l==(4-frame_parms->Ncp))) {
|
||||
if ((subframe_rx==0) && (slot == 0) && (l==(4-frame_parms->Ncp))) {
|
||||
|
||||
// AGC
|
||||
|
||||
@@ -2299,6 +2302,7 @@ void ue_measurement_procedures(
|
||||
lte_adjust_synch(&ue->frame_parms,
|
||||
ue,
|
||||
eNB_id,
|
||||
subframe_rx,
|
||||
0,
|
||||
16384);
|
||||
}
|
||||
@@ -2571,7 +2575,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
|
||||
|
||||
} else if (((frame_tx & 0x03FF) != (proc->frame_rx & 0x03FF))) {
|
||||
//(pbch_tx_ant != ue->frame_parms.nb_antennas_tx)) {
|
||||
LOG_D(PHY,"[UE %d] frame %d, subframe %d: Re-adjusting frame counter (PBCH ant_tx=%d, frame_rx=%d, frame%1024=%d, phase %d).\n",
|
||||
LOG_D(PHY,"[UE %d] frame %d, subframe %d: Re-adjusting frame counter (PBCH ant_tx=%d, frame_rx=%d, frame%%1024=%d, phase %d).\n",
|
||||
ue->Mod_id,
|
||||
proc->frame_rx,
|
||||
subframe_rx,
|
||||
@@ -2750,9 +2754,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
#endif
|
||||
|
||||
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, Mode %s: DCI found %i\n",ue->Mod_id,frame_rx,subframe_rx,mode_string[ue->UE_mode[eNB_id]],dci_cnt);
|
||||
|
||||
|
||||
LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d, Mode %s: DCI found %i\n",ue->Mod_id,frame_rx%1024,subframe_rx,mode_string[ue->UE_mode[eNB_id]],dci_cnt);
|
||||
|
||||
ue->pdcch_vars[eNB_id]->dci_received += dci_cnt;
|
||||
|
||||
@@ -2805,12 +2807,6 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
{
|
||||
ue->dlsch[eNB_id][0]->g_pucch += ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->delta_PUCCH;
|
||||
}
|
||||
|
||||
/*T(T_UE_PHY_DLSCH_UE_DCI, T_INT(eNB_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(ue->Mod_id),
|
||||
T_INT(dci_alloc_rx[i].rnti), T_INT(dci_alloc_rx[i].format),
|
||||
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid),
|
||||
T_INT(ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->mcs),
|
||||
T_INT(ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->TBS));*/
|
||||
|
||||
ue->dlsch_received[eNB_id]++;
|
||||
|
||||
@@ -3123,7 +3119,8 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
|
||||
ue->dlsch_mtch_errors[sync_area][0]++;
|
||||
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
|
||||
frame_rx,subframe_rx,
|
||||
ue->Mod_id,
|
||||
frame_rx,subframe_rx,
|
||||
ue->dlsch_mcch_errors[sync_area][0],
|
||||
ue->dlsch_mtch_errors[sync_area][0],
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
|
||||
@@ -3185,7 +3182,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
|
||||
|
||||
if (dlsch0 && (!dlsch1)) {
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d (%d), harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
|
||||
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
|
||||
|
||||
if ((pdsch==PDSCH) &&
|
||||
(ue->transmission_mode[eNB_id] == 5) &&
|
||||
@@ -3349,7 +3346,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
||||
pdsch_vars = ue->pdsch_vars_p[eNB_id];
|
||||
break;
|
||||
case PDSCH:
|
||||
pdsch_vars = ue->pdsch_vars[eNB_id];
|
||||
pdsch_vars = ue->pdsch_vars[subframe_rx&0x1][eNB_id];
|
||||
break;
|
||||
case PMCH:
|
||||
case PDSCH1:
|
||||
@@ -3574,7 +3571,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX (%d)\n",
|
||||
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX\n",
|
||||
(r_type == multicast_relay) ? "RN/UE" : "UE",
|
||||
ue->Mod_id,frame_rx, subframe_rx);
|
||||
#endif
|
||||
@@ -3613,7 +3610,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
slot_fep(ue,
|
||||
l,
|
||||
(subframe_rx<<1),
|
||||
ue->rx_offset,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
||||
@@ -3644,7 +3641,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
slot_fep(ue,
|
||||
0,
|
||||
1+(subframe_rx<<1),
|
||||
ue->rx_offset,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
@@ -3717,7 +3714,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
slot_fep(ue,
|
||||
l,
|
||||
1+(subframe_rx<<1),
|
||||
ue->rx_offset,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
||||
@@ -3735,7 +3732,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
slot_fep(ue,
|
||||
0,
|
||||
(next_subframe_rx<<1),
|
||||
ue->rx_offset,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
@@ -1812,6 +1812,11 @@ int main(int argc, char **argv)
|
||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||
}
|
||||
|
||||
if (transmission_mode<7)
|
||||
eNB->do_precoding=0;
|
||||
else
|
||||
eNB->do_precoding=1;
|
||||
|
||||
eNB->mac_enabled=1;
|
||||
if (two_thread_flag == 0) {
|
||||
eNB->te = dlsch_encoding;
|
||||
@@ -2409,12 +2414,14 @@ int main(int argc, char **argv)
|
||||
do_OFDM_mod_symbol(&eNB->common_vars,
|
||||
eNB_id,
|
||||
(subframe*2),
|
||||
&eNB->frame_parms);
|
||||
&eNB->frame_parms,
|
||||
eNB->do_precoding);
|
||||
|
||||
do_OFDM_mod_symbol(&eNB->common_vars,
|
||||
eNB_id,
|
||||
(subframe*2)+1,
|
||||
&eNB->frame_parms);
|
||||
&eNB->frame_parms,
|
||||
eNB->do_precoding);
|
||||
|
||||
|
||||
stop_meas(&eNB->ofdm_mod_stats);
|
||||
@@ -2502,34 +2509,34 @@ int main(int argc, char **argv)
|
||||
|
||||
//common vars
|
||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
write_output("dlsch00_r0.m","dl00_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1)
|
||||
write_output("dlsch01_r0.m","dl01_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("dlsch10_r0.m","dl10_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||
write_output("dlsch11_r0.m","dl11_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
|
||||
@@ -2587,7 +2594,7 @@ int main(int argc, char **argv)
|
||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d",round);
|
||||
write_output(fname,vname, &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"rxsig1_r%d.m",round);
|
||||
@@ -2595,20 +2602,20 @@ int main(int argc, char **argv)
|
||||
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF1_r%d.m",round);
|
||||
sprintf(vname,"rxs1F_r%d.m",round);
|
||||
write_output(fname,vname, UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch00_r%d.m",round);
|
||||
sprintf(vname,"dl00_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"dlsch01_r%d.m",round);
|
||||
sprintf(vname,"dl01_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
@@ -2616,7 +2623,7 @@ int main(int argc, char **argv)
|
||||
sprintf(fname,"dlsch10_r%d.m",round);
|
||||
sprintf(vname,"dl10_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
@@ -2624,12 +2631,12 @@ int main(int argc, char **argv)
|
||||
sprintf(fname,"dlsch11_r%d.m",round);
|
||||
sprintf(vname,"dl11_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
|
||||
//write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
//write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
|
||||
@@ -3104,24 +3104,24 @@ PMI_FEEDBACK:
|
||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
//printf("x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
|
||||
if (transmission_mode == 7){
|
||||
//this should include the BF weights! Will not work for a random channel
|
||||
if (UE->high_speed_flag==0) {
|
||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)(
|
||||
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)(
|
||||
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
//printf("**,x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
||||
} else {
|
||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
|
||||
}
|
||||
@@ -3134,15 +3134,15 @@ PMI_FEEDBACK:
|
||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||
if (transmission_mode == 7) {
|
||||
if (UE->high_speed_flag==0){
|
||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP);
|
||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2;
|
||||
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP);
|
||||
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2;
|
||||
} else {
|
||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP);
|
||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2;
|
||||
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP);
|
||||
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3485,34 +3485,34 @@ PMI_FEEDBACK:
|
||||
//write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][subframe*UE->frame_parms.samples_per_tti],UE->frame_parms.samples_per_tti,1,1);
|
||||
//write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars..common_vars_rx_data_per_thread[subframe&0x1]rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
write_output("dlsch00_r0.m","dl00_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1)
|
||||
write_output("dlsch01_r0.m","dl01_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("dlsch10_r0.m","dl10_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||
write_output("dlsch11_r0.m","dl11_r0",
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
|
||||
@@ -3535,8 +3535,8 @@ PMI_FEEDBACK:
|
||||
if (trials==0 && round==0 && transmission_mode>=5 && transmission_mode<7) {
|
||||
for (iii=0; iii<NB_RB; iii++) {
|
||||
//fprintf(csv_fd, "%d, %d", (UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id_i]->pmi_ext[iii]));
|
||||
fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
printf("%x ",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
printf("%x ",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3560,7 +3560,7 @@ PMI_FEEDBACK:
|
||||
// calculate uncoded BLER
|
||||
uncoded_ber=0;
|
||||
for (i=0;i<coded_bits_per_codeword;i++)
|
||||
if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[0]->llr[0][i]<0)) {
|
||||
if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[0][i]<0)) {
|
||||
uncoded_ber_bit[i] = 1;
|
||||
uncoded_ber++;
|
||||
}
|
||||
@@ -3579,14 +3579,14 @@ PMI_FEEDBACK:
|
||||
0,
|
||||
UE->dlsch[0][cw],
|
||||
coded_bits_per_codeword,
|
||||
UE->pdsch_vars[eNB_id]->llr[cw],
|
||||
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||
0,
|
||||
subframe<<1);
|
||||
stop_meas(&UE->dlsch_unscrambling_stats);
|
||||
|
||||
start_meas(&UE->dlsch_decoding_stats);
|
||||
ret = dlsch_decoding(UE,
|
||||
UE->pdsch_vars[eNB_id]->llr[cw],
|
||||
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||
&UE->frame_parms,
|
||||
UE->dlsch[0][cw],
|
||||
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
|
||||
@@ -3687,7 +3687,7 @@ PMI_FEEDBACK:
|
||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d",round);
|
||||
write_output(fname,vname, &UE->common_vars.rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"rxsig1_r%d.m",round);
|
||||
@@ -3695,20 +3695,20 @@ PMI_FEEDBACK:
|
||||
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsig1F_r%d.m",round);
|
||||
sprintf(vname,"rxs1F_r%d.m",round);
|
||||
write_output(fname,vname, UE->common_vars.rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||
write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch00_r%d.m",round);
|
||||
sprintf(vname,"dl00_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"dlsch01_r%d.m",round);
|
||||
sprintf(vname,"dl01_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
@@ -3716,7 +3716,7 @@ PMI_FEEDBACK:
|
||||
sprintf(fname,"dlsch10_r%d.m",round);
|
||||
sprintf(vname,"dl10_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
@@ -3724,12 +3724,12 @@ PMI_FEEDBACK:
|
||||
sprintf(fname,"dlsch11_r%d.m",round);
|
||||
sprintf(vname,"dl11_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
}
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
/*
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
|
||||
@@ -447,8 +447,8 @@ int main(int argc, char **argv)
|
||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -492,7 +492,7 @@ int main(int argc, char **argv)
|
||||
&UE->frame_parms,
|
||||
UE->dlsch_MCH[0],
|
||||
UE->dlsch_MCH[0]->harq_processes[0],
|
||||
frame,
|
||||
trials,
|
||||
subframe,
|
||||
0,0,0);
|
||||
|
||||
|
||||
@@ -932,6 +932,7 @@ int main(int argc, char **argv)
|
||||
lte_ue_measurements(UE,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0);
|
||||
/*
|
||||
if (trial%100 == 0) {
|
||||
@@ -963,7 +964,7 @@ int main(int argc, char **argv)
|
||||
//sprintf(vname,"dl_ch00_%d",l);
|
||||
//write_output(fname,vname,&(common_vars->dl_ch_estimates[0][frame_parms->ofdm_symbol_size*(l%6)]),frame_parms->ofdm_symbol_size,1,1);
|
||||
|
||||
lte_est_freq_offset(UE->common_vars.dl_ch_estimates[0],
|
||||
lte_est_freq_offset(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0],
|
||||
&UE->frame_parms,
|
||||
l,
|
||||
&freq_offset,
|
||||
@@ -1051,13 +1052,13 @@ int main(int argc, char **argv)
|
||||
|
||||
if (n_frames==1) {
|
||||
|
||||
write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H00.m","h00",&(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
if (n_tx==2)
|
||||
write_output("H10.m","h10",&(UE->common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H10.m","h10",&(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
write_output("PBCH_rxF0_ext.m","pbch0_ext",UE->pbch_vars[0]->rxdataF_ext[0],12*4*6,1,1);
|
||||
write_output("PBCH_rxF0_comp.m","pbch0_comp",UE->pbch_vars[0]->rxdataF_comp[0],12*4*6,1,1);
|
||||
write_output("PBCH_rxF_llr.m","pbch_llr",UE->pbch_vars[0]->llr,(frame_parms->Ncp==0) ? 1920 : 1728,1,4);
|
||||
|
||||
@@ -1060,9 +1060,9 @@ int main(int argc, char **argv)
|
||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
}
|
||||
}
|
||||
@@ -1072,8 +1072,8 @@ int main(int argc, char **argv)
|
||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1091,7 +1091,7 @@ int main(int argc, char **argv)
|
||||
rx_pdcch(&UE->common_vars,
|
||||
UE->pdcch_vars,
|
||||
&UE->frame_parms,
|
||||
frame,
|
||||
trial,
|
||||
subframe,
|
||||
0,
|
||||
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||
@@ -1212,17 +1212,17 @@ int main(int argc, char **argv)
|
||||
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
|
||||
if (n_rx>1) {
|
||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],10*frame_parms->samples_per_tti,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
}
|
||||
|
||||
write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H00.m","h00",&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
if (n_tx==2)
|
||||
write_output("H10.m","h10",&(UE->common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H10.m","h10",&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
|
||||
@@ -1683,9 +1683,9 @@ int main(int argc, char **argv)
|
||||
frame_parms,
|
||||
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates_time,
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0],
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0],
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.rxdata,
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.rxdataF,
|
||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[1]->rxdataF_comp[0],
|
||||
@@ -1699,9 +1699,9 @@ int main(int argc, char **argv)
|
||||
frame_parms,
|
||||
PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.dl_ch_estimates_time,
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.dl_ch_estimates[0],
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0],
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.rxdata,
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.rxdataF,
|
||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[3]->rxdataF_comp[0],
|
||||
@@ -1718,10 +1718,10 @@ int main(int argc, char **argv)
|
||||
|
||||
if (n_frames==1) {
|
||||
|
||||
write_output("H00.m","h00",&(PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H00.m","h00",&(PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
if (n_tx==2)
|
||||
write_output("H10.m","h10",&(PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H10.m","h10",&(PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
write_output("rxsig0.m","rxs0", PHY_vars_UE[0]->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", PHY_vars_UE[0]->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,2,1);
|
||||
@@ -1739,7 +1739,7 @@ int main(int argc, char **argv)
|
||||
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||
0);
|
||||
|
||||
dump_dlsch2(PHY_vars_UE[0],0,coded_bits_per_codeword);
|
||||
dump_dlsch2(PHY_vars_UE[0],0,0,coded_bits_per_codeword);
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1175,7 +1175,7 @@ int main(int argc, char **argv)
|
||||
eNB->td = (parallel_flag == 1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
eNB->do_prach = NULL;
|
||||
|
||||
phy_procedures_eNB_common_RX(eNB);
|
||||
phy_procedures_eNB_common_RX(eNB,proc_rxtx);
|
||||
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx,no_relay);
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,13 @@ Description Contains global common definitions
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* boolean_t is also defined in openair2/COMMON/platform_types.h
|
||||
* let's protect potential redefinition
|
||||
*/
|
||||
|
||||
#ifndef _BOOLEAN_T_DEFINED_
|
||||
#define _BOOLEAN_T_DEFINED_
|
||||
|
||||
typedef signed char boolean_t;
|
||||
|
||||
#if !defined(TRUE)
|
||||
@@ -55,6 +62,8 @@ typedef signed char boolean_t;
|
||||
|
||||
#define BOOL_NOT(b) (b^TRUE)
|
||||
|
||||
#endif /* _BOOLEAN_T_DEFINED_ */
|
||||
|
||||
#define NAS_UE_ID_FMT "0x%06x"
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// GENERIC TYPES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/* boolean_t is also defined in openair2/COMMON/commonDef.h,
|
||||
* let's protect potential redefinition
|
||||
*/
|
||||
#ifndef _BOOLEAN_T_DEFINED_
|
||||
#define _BOOLEAN_T_DEFINED_
|
||||
|
||||
typedef signed char boolean_t;
|
||||
|
||||
#if !defined(TRUE)
|
||||
@@ -52,6 +59,8 @@ typedef signed char boolean_t;
|
||||
|
||||
#define BOOL_NOT(b) (b^TRUE)
|
||||
|
||||
#endif /* _BOOLEAN_T_DEFINED_ */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// GENERIC ACCESS STRATUM TYPES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
|
||||
@@ -60,14 +61,11 @@ int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__F
|
||||
// TODO: Must resolve conflicts among stats requests
|
||||
|
||||
int i;
|
||||
void *buffer;
|
||||
int size;
|
||||
err_code_t err_code;
|
||||
xid_t xid;
|
||||
uint32_t usec_interval, sec_interval;
|
||||
|
||||
//TODO: We do not deal with multiple CCs at the moment and eNB id is 0
|
||||
int cc_id = 0;
|
||||
int enb_id = mod_id;
|
||||
|
||||
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
|
||||
@@ -250,15 +248,15 @@ int flexran_agent_mac_stats_request(mid_t mod_id,
|
||||
Protocol__FlexHeader *header;
|
||||
int i;
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexStatsRequest *stats_request_msg;
|
||||
stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest));
|
||||
if(stats_request_msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flex_stats_request__init(stats_request_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
stats_request_msg->header = header;
|
||||
|
||||
stats_request_msg->type = report_config->report_type;
|
||||
@@ -375,20 +373,19 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexranMessage **msg) {
|
||||
Protocol__FlexHeader *header;
|
||||
int i, j, k;
|
||||
int cc_id = 0;
|
||||
int enb_id = mod_id;
|
||||
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
|
||||
//UE_list_t *eNB_UE_list= &eNB->UE_list;
|
||||
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexStatsReply *stats_reply_msg;
|
||||
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
|
||||
if (stats_reply_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_stats_reply__init(stats_reply_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
stats_reply_msg->header = header;
|
||||
|
||||
stats_reply_msg->n_ue_report = report_config->nr_ue;
|
||||
@@ -419,7 +416,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr);
|
||||
if (elem == NULL)
|
||||
goto error;
|
||||
for (j = 0; j++; j < ue_report[i]->n_bsr) {
|
||||
for (j = 0; j < ue_report[i]->n_bsr; j++) {
|
||||
// NN: we need to know the cc_id here, consider the first one
|
||||
elem[j] = flexran_get_ue_bsr (enb_id, i, j);
|
||||
}
|
||||
@@ -472,7 +469,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
/* Check flag for creation of MAC CE buffer status report */
|
||||
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
|
||||
// TODO: Fill in the actual MAC CE buffer status report
|
||||
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the
|
||||
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the
|
||||
PROTOCOL__FLEX_CE_TYPE__FLPCET_ values
|
||||
found in stats_common.pb-c.h. See
|
||||
flex_ce_type in FlexRAN specification */
|
||||
@@ -802,6 +799,8 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
|
||||
}
|
||||
free(dl_report->csi_report[j]->a31csi->sb_cqi);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
free(dl_report->csi_report[j]);
|
||||
@@ -856,8 +855,6 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
|
||||
Protocol__FlexHeader *header;
|
||||
int i;
|
||||
const int xid = *((int *)params);
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexUlSrInfo *ul_sr_info_msg;
|
||||
ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo));
|
||||
@@ -866,6 +863,9 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
|
||||
}
|
||||
protocol__flex_ul_sr_info__init(ul_sr_info_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
|
||||
goto error;
|
||||
|
||||
ul_sr_info_msg->header = header;
|
||||
ul_sr_info_msg->has_sfn_sf = 1;
|
||||
ul_sr_info_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
|
||||
@@ -923,8 +923,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
Protocol__FlexHeader *header;
|
||||
int i,j;
|
||||
const int xid = *((int *)params);
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexSfTrigger *sf_trigger_msg;
|
||||
sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger));
|
||||
@@ -933,6 +931,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
}
|
||||
protocol__flex_sf_trigger__init(sf_trigger_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
|
||||
goto error;
|
||||
|
||||
frame_t frame;
|
||||
sub_frame_t subframe;
|
||||
|
||||
@@ -975,8 +976,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i);
|
||||
dl_info[i]->has_rnti = 1;
|
||||
/*Fill in the right id of this round's HARQ process for this UE*/
|
||||
int harq_id;
|
||||
int harq_status;
|
||||
unsigned char harq_id;
|
||||
unsigned char harq_status;
|
||||
flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status);
|
||||
dl_info[i]->harq_process_id = harq_id;
|
||||
dl_info[i]->has_harq_process_id = 1;
|
||||
@@ -1060,10 +1061,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
|
||||
free(sf_trigger_msg->dl_info[i]->harq_status);
|
||||
}
|
||||
free(sf_trigger_msg->dl_info);
|
||||
for (i = 0; i < sf_trigger_msg->n_ul_info; i++) {
|
||||
free(sf_trigger_msg->ul_info[i]->reception_status);
|
||||
}
|
||||
free(sf_trigger_msg->dl_info);
|
||||
free(sf_trigger_msg->ul_info);
|
||||
free(sf_trigger_msg);
|
||||
}
|
||||
@@ -1230,9 +1228,9 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro
|
||||
*msg = NULL;
|
||||
return 2;
|
||||
|
||||
error:
|
||||
*msg = NULL;
|
||||
return -1;
|
||||
// error:
|
||||
//*msg = NULL;
|
||||
//return -1;
|
||||
}
|
||||
|
||||
void flexran_agent_init_mac_agent(mid_t mod_id) {
|
||||
@@ -1252,7 +1250,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) {
|
||||
int size;
|
||||
Protocol__FlexranMessage *msg;
|
||||
void *data;
|
||||
int priority;
|
||||
int priority = 0;
|
||||
err_code_t err_code;
|
||||
|
||||
int xid = 0;
|
||||
@@ -1282,7 +1280,7 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
|
||||
int size;
|
||||
Protocol__FlexranMessage *msg;
|
||||
void *data;
|
||||
int priority;
|
||||
int priority = 0;
|
||||
err_code_t err_code;
|
||||
|
||||
int xid = 0;
|
||||
@@ -1310,13 +1308,11 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
|
||||
|
||||
void flexran_agent_send_update_mac_stats(mid_t mod_id) {
|
||||
|
||||
Protocol__FlexranMessage *current_report = NULL, *msg;
|
||||
Protocol__FlexranMessage *current_report = NULL;
|
||||
void *data;
|
||||
int size;
|
||||
err_code_t err_code;
|
||||
int priority;
|
||||
|
||||
mac_stats_updates_context_t stats_context = mac_stats_context[mod_id];
|
||||
int priority = 0;
|
||||
|
||||
if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) {
|
||||
goto error;
|
||||
@@ -1437,7 +1433,7 @@ err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id) {
|
||||
flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply);
|
||||
free(mac_stats_context[mod_id].mutex);
|
||||
|
||||
mac_agent_registered[mod_id] = NULL;
|
||||
mac_agent_registered[mod_id] = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ typedef struct {
|
||||
|
||||
/// Notify the controller for a state change of a particular UE, by sending the proper
|
||||
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
|
||||
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
|
||||
uint32_t state_change);
|
||||
int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
|
||||
uint8_t state_change);
|
||||
|
||||
|
||||
void *dl_scheduler_loaded_lib;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <string.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "flexran_agent_common_internal.h"
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
|
||||
Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
|
||||
@@ -49,11 +50,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
|
||||
old_report = old_message->stats_reply_msg;
|
||||
new_report = new_message->stats_reply_msg;
|
||||
|
||||
/*Flags to designate changes in various levels of the message*/
|
||||
int stats_had_changes = 0;
|
||||
int ue_had_change = 0;
|
||||
int cell_had_change = 0;
|
||||
|
||||
/*See how many and which UE reports should be included in the final stats message*/
|
||||
int n_ue_report = 0;
|
||||
int ue_found = 0;
|
||||
@@ -101,23 +97,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
|
||||
}
|
||||
cell_found = 0;
|
||||
}
|
||||
|
||||
/*TODO: create the reply message based on the findings*/
|
||||
/*Create ue report list*/
|
||||
if (n_ue_report > 0) {
|
||||
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
|
||||
for (i = 0; i<n_ue_report; i++) {
|
||||
ue_report[i] = tmp_ue_report[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*Create cell report list*/
|
||||
if (n_cell_report > 0) {
|
||||
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
|
||||
for (i = 0; i<n_cell_report; i++) {
|
||||
cell_report[i] = tmp_cell_report[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (n_cell_report > 0 || n_ue_report > 0) {
|
||||
/*Create header*/
|
||||
@@ -128,11 +107,30 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
|
||||
}
|
||||
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
|
||||
protocol__flex_stats_reply__init(stats_reply_msg);
|
||||
|
||||
stats_reply_msg->header = header;
|
||||
|
||||
/*TODO: create the reply message based on the findings*/
|
||||
/*Create ue report list*/
|
||||
stats_reply_msg->n_ue_report = n_ue_report;
|
||||
stats_reply_msg->ue_report = ue_report;
|
||||
if (n_ue_report > 0) {
|
||||
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
|
||||
for (i = 0; i<n_ue_report; i++) {
|
||||
ue_report[i] = tmp_ue_report[i];
|
||||
}
|
||||
stats_reply_msg->ue_report = ue_report;
|
||||
}
|
||||
|
||||
/*Create cell report list*/
|
||||
stats_reply_msg->n_cell_report = n_cell_report;
|
||||
stats_reply_msg->cell_report = cell_report;
|
||||
if (n_cell_report > 0) {
|
||||
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
|
||||
for (i = 0; i<n_cell_report; i++) {
|
||||
cell_report[i] = tmp_cell_report[i];
|
||||
}
|
||||
stats_reply_msg->cell_report = cell_report;
|
||||
}
|
||||
|
||||
msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
if(msg == NULL)
|
||||
goto error;
|
||||
@@ -270,7 +268,7 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
|
||||
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
|
||||
if(ul_report == NULL)
|
||||
goto error;
|
||||
for(i = 0; i++; i < full_ul_report->n_cqi_meas) {
|
||||
for(i = 0; i < full_ul_report->n_cqi_meas; i++) {
|
||||
ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi));
|
||||
if(ul_report[i] == NULL)
|
||||
goto error;
|
||||
@@ -597,22 +595,22 @@ int parse_mac_config(mid_t mod_id, yaml_parser_t *parser) {
|
||||
goto error;
|
||||
}
|
||||
// Check the types of subsystems offered and handle their values accordingly
|
||||
if (strcmp(event.data.scalar.value, "dl_scheduler") == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "dl_scheduler") == 0) {
|
||||
LOG_D(ENB_APP, "This is for the dl_scheduler subsystem\n");
|
||||
// Call the proper handler
|
||||
if (parse_dl_scheduler_config(mod_id, parser) == -1) {
|
||||
LOG_D(ENB_APP, "An error occured\n");
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "ul_scheduler") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "ul_scheduler") == 0) {
|
||||
// Call the proper handler
|
||||
LOG_D(ENB_APP, "This is for the ul_scheduler subsystem\n");
|
||||
goto error;
|
||||
// TODO
|
||||
} else if (strcmp(event.data.scalar.value, "ra_scheduler") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "ra_scheduler") == 0) {
|
||||
// Call the proper handler
|
||||
// TODO
|
||||
} else if (strcmp(event.data.scalar.value, "page_scheduler") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "page_scheduler") == 0) {
|
||||
// Call the proper handler
|
||||
// TODO
|
||||
} else {
|
||||
@@ -665,20 +663,20 @@ int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
if (strcmp(event.data.scalar.value, "behavior") == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
|
||||
LOG_I(ENB_APP, "Time to set the behavior attribute\n");
|
||||
yaml_event_delete(&event);
|
||||
if (!yaml_parser_parse(parser, &event)) {
|
||||
goto error;
|
||||
}
|
||||
if (event.type == YAML_SCALAR_EVENT) {
|
||||
if (load_dl_scheduler_function(mod_id, event.data.scalar.value) == -1) {
|
||||
if (load_dl_scheduler_function(mod_id, (char *) event.data.scalar.value) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "parameters") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
|
||||
LOG_D(ENB_APP, "Now it is time to set the parameters for this subsystem\n");
|
||||
if (parse_dl_scheduler_parameters(mod_id, parser) == -1) {
|
||||
goto error;
|
||||
@@ -731,7 +729,7 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
|
||||
if (mac_agent_registered[mod_id]) {
|
||||
LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value);
|
||||
param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib,
|
||||
event.data.scalar.value);
|
||||
(char *) event.data.scalar.value);
|
||||
if (param == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ void *eNB_app_task(void *args_p)
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
|
||||
@@ -344,7 +344,7 @@ void enb_config_display(void)
|
||||
#if defined(FLEXRAN_AGENT_SB_IF)
|
||||
printf( "\nFLEXRAN AGENT CONFIG : \n\n");
|
||||
printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name);
|
||||
printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
|
||||
// printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
|
||||
printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port);
|
||||
printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache);
|
||||
|
||||
@@ -2494,10 +2494,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name);
|
||||
cidr = flexran_agent_ipv4_address;
|
||||
address = strtok(cidr, "/");
|
||||
enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
|
||||
/* if (address) {
|
||||
//enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
|
||||
if (address) {
|
||||
IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" );
|
||||
}*/
|
||||
}
|
||||
|
||||
enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port;
|
||||
enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache);
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "log.h"
|
||||
#include "flexran_agent.h"
|
||||
#include "flexran_agent_mac_defs.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
@@ -38,6 +40,8 @@
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_async.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
//#define TEST_TIMER
|
||||
|
||||
flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
|
||||
@@ -64,11 +68,10 @@ void *flexran_agent_task(void *args){
|
||||
void *data;
|
||||
int size;
|
||||
err_code_t err_code;
|
||||
int priority;
|
||||
int priority = 0;
|
||||
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
instance_t instance;
|
||||
int result;
|
||||
struct flexran_agent_timer_element_s * elem = NULL;
|
||||
|
||||
@@ -79,7 +82,6 @@ void *flexran_agent_task(void *args){
|
||||
itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
|
||||
DevAssert(msg_p != NULL);
|
||||
msg_name = ITTI_MSG_NAME (msg_p);
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -212,9 +214,8 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
|
||||
strcpy(local_cache, DEFAULT_FLEXRAN_AGENT_CACHE);
|
||||
}
|
||||
|
||||
if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != NULL) {
|
||||
strncpy(in_ip, enb_properties->properties[mod_id]->flexran_agent_ipv4_address, sizeof(in_ip) );
|
||||
in_ip[sizeof(in_ip) - 1] = 0; // terminate string
|
||||
if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != 0) {
|
||||
inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
|
||||
} else {
|
||||
strcpy(in_ip, DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS );
|
||||
}
|
||||
@@ -237,7 +238,7 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
|
||||
channel_container_init = 1;
|
||||
}
|
||||
/*Create the async channel info*/
|
||||
flexran_agent_instance_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
|
||||
flexran_agent_async_channel_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
|
||||
|
||||
/*Create a channel using the async channel info*/
|
||||
channel_id = flexran_agent_create_channel((void *) channel_info,
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_common_internal.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -110,14 +111,16 @@ int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessa
|
||||
Protocol__FlexHeader *header;
|
||||
/*TODO: Need to set random xid or xid from received hello message*/
|
||||
xid_t xid = 1;
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_HELLO, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexHello *hello_msg;
|
||||
hello_msg = malloc(sizeof(Protocol__FlexHello));
|
||||
if(hello_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_hello__init(hello_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_HELLO, &header) != 0)
|
||||
goto error;
|
||||
|
||||
hello_msg->header = header;
|
||||
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
@@ -163,14 +166,16 @@ int flexran_agent_echo_request(mid_t mod_id, const void* params, Protocol__Flexr
|
||||
Protocol__FlexHeader *header;
|
||||
/*TODO: Need to set a random xid*/
|
||||
xid_t xid = 1;
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexEchoRequest *echo_request_msg;
|
||||
Protocol__FlexEchoRequest *echo_request_msg = NULL;
|
||||
echo_request_msg = malloc(sizeof(Protocol__FlexEchoRequest));
|
||||
if(echo_request_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_echo_request__init(echo_request_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
echo_request_msg->header = header;
|
||||
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
@@ -217,15 +222,16 @@ int flexran_agent_echo_reply(mid_t mod_id, const void *params, Protocol__Flexran
|
||||
Protocol__FlexEchoRequest *echo_req = input->echo_request_msg;
|
||||
xid = (echo_req->header)->xid;
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexEchoReply *echo_reply_msg;
|
||||
Protocol__FlexEchoReply *echo_reply_msg = NULL;
|
||||
echo_reply_msg = malloc(sizeof(Protocol__FlexEchoReply));
|
||||
if(echo_reply_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_echo_reply__init(echo_reply_msg);
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
echo_reply_msg->header = header;
|
||||
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
@@ -299,7 +305,7 @@ int flexran_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG)
|
||||
goto error;
|
||||
free(msg->ue_config_reply_msg->header);
|
||||
int i, j;
|
||||
int i;
|
||||
Protocol__FlexUeConfigReply *reply = msg->ue_config_reply_msg;
|
||||
|
||||
for(i = 0; i < reply->n_ue_config;i++){
|
||||
@@ -376,7 +382,7 @@ int flexran_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg) {
|
||||
}
|
||||
|
||||
// call this function to start a nanosecond-resolution timer
|
||||
struct timespec timer_start(){
|
||||
struct timespec timer_start(void) {
|
||||
struct timespec start_time;
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start_time);
|
||||
return start_time;
|
||||
@@ -395,11 +401,7 @@ int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol_
|
||||
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
|
||||
Protocol__FlexControlDelegation *control_delegation_msg = input->control_delegation_msg;
|
||||
|
||||
uint32_t delegation_type = control_delegation_msg->delegation_type;
|
||||
|
||||
int i;
|
||||
|
||||
struct timespec vartime = timer_start();
|
||||
// struct timespec vartime = timer_start();
|
||||
|
||||
//Write the payload lib into a file in the cache and load the lib
|
||||
char lib_name[120];
|
||||
@@ -413,16 +415,15 @@ int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol_
|
||||
fwrite(control_delegation_msg->payload.data, control_delegation_msg->payload.len, 1, f);
|
||||
fclose(f);
|
||||
|
||||
long time_elapsed_nanos = timer_end(vartime);
|
||||
// long time_elapsed_nanos = timer_end(vartime);
|
||||
*msg = NULL;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_destroy_control_delegation(Protocol__FlexranMessage *msg) {
|
||||
/*TODO: Dealocate memory for a dynamically allocated control delegation message*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
|
||||
@@ -437,6 +438,7 @@ int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__Fl
|
||||
|
||||
int flexran_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg) {
|
||||
/*TODO: Dealocate memory for a dynamically allocated agent reconfiguration message*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -474,7 +476,7 @@ int flexran_get_current_time_ms (mid_t mod_id, int subframe_flag){
|
||||
|
||||
unsigned int flexran_get_current_frame (mid_t mod_id) {
|
||||
|
||||
#warning "SFN will not be in [0-1023] when oaisim is used"
|
||||
// #warning "SFN will not be in [0-1023] when oaisim is used"
|
||||
return ((eNB_MAC_INST *)enb[mod_id])->frame;
|
||||
|
||||
}
|
||||
@@ -637,7 +639,6 @@ int flexran_get_active_CC(mid_t mod_id, mid_t ue_id) {
|
||||
int flexran_get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id) {
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
|
||||
|
||||
int pCCid = UE_PCCID(mod_id,ue_id);
|
||||
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti);
|
||||
@@ -679,7 +680,8 @@ int flexran_get_tpc(mid_t mod_id, mid_t ue_id) {
|
||||
return tpc;
|
||||
}
|
||||
|
||||
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, int *id, int *round) { //flag_id_status = 0 then id, else status
|
||||
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe,
|
||||
unsigned char *id, unsigned char *round) { //flag_id_status = 0 then id, else status
|
||||
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
|
||||
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
|
||||
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
|
||||
@@ -701,7 +703,7 @@ int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
|
||||
/* } */
|
||||
|
||||
/* return 0; */
|
||||
return round;
|
||||
return *round;
|
||||
}
|
||||
|
||||
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id) {
|
||||
@@ -922,15 +924,11 @@ int flexran_get_special_subframe_assignment(mid_t mod_id, int CC_id) {
|
||||
}
|
||||
|
||||
int flexran_get_ra_ResponseWindowSize(mid_t mod_id, int CC_id) {
|
||||
Enb_properties_array_t *enb_properties;
|
||||
enb_properties = enb_config_get();
|
||||
return enb_properties->properties[mod_id]->rach_raResponseWindowSize[CC_id];
|
||||
return enb_config_get()->properties[mod_id]->rach_raResponseWindowSize[CC_id];
|
||||
}
|
||||
|
||||
int flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id) {
|
||||
Enb_properties_array_t *enb_properties;
|
||||
enb_properties = enb_config_get();
|
||||
return enb_properties->properties[mod_id]->rach_macContentionResolutionTimer[CC_id];
|
||||
return enb_config_get()->properties[mod_id]->rach_macContentionResolutionTimer[CC_id];
|
||||
}
|
||||
|
||||
int flexran_get_duplex_mode(mid_t mod_id, int CC_id) {
|
||||
@@ -969,16 +967,19 @@ int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id) {
|
||||
|
||||
|
||||
int flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.mac_MainConfig != NULL)
|
||||
return ue_context_p->ue_context.mac_MainConfig->timeAlignmentTimerDedicated;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.mac_MainConfig != NULL) {
|
||||
return ue_context_p->ue_context.mac_MainConfig->timeAlignmentTimerDedicated;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id) {
|
||||
@@ -1040,12 +1041,14 @@ int flexran_get_half_duplex(mid_t ue_id) {
|
||||
// halfduplex = 1;
|
||||
//}
|
||||
//return halfduplex;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_get_intra_sf_hopping(mid_t ue_id) {
|
||||
//TODO:Get proper value
|
||||
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
|
||||
//return (0 & ( 1 << (31)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_get_type2_sb_1(mid_t ue_id) {
|
||||
@@ -1053,11 +1056,13 @@ int flexran_get_type2_sb_1(mid_t ue_id) {
|
||||
//uint8_t temp = 0;
|
||||
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
|
||||
//return (temp & ( 1 << (11)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_get_ue_category(mid_t ue_id) {
|
||||
//TODO:Get proper value
|
||||
//return (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->ue_Category);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_get_res_alloc_type1(mid_t ue_id) {
|
||||
@@ -1065,35 +1070,41 @@ int flexran_get_res_alloc_type1(mid_t ue_id) {
|
||||
//uint8_t temp = 0;
|
||||
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
|
||||
//return (temp & ( 1 << (30)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.mac_MainConfig != NULL){
|
||||
return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->ttiBundling;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.mac_MainConfig != NULL){
|
||||
return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->ttiBundling;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) {
|
||||
@@ -1110,45 +1121,52 @@ int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) {
|
||||
}
|
||||
|
||||
int flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id) {
|
||||
@@ -1185,32 +1203,39 @@ int flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id) {
|
||||
}
|
||||
|
||||
int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
// TODO: This needs fixing
|
||||
return -1;
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
/* struct rrc_eNB_ue_context_s* ue_context_p = NULL; */
|
||||
/* uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); */
|
||||
|
||||
/* ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); */
|
||||
|
||||
/* if(ue_context_p != NULL) { */
|
||||
/* if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ */
|
||||
/* return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode; */
|
||||
/* } else { */
|
||||
/* return -1; */
|
||||
/* } */
|
||||
/* } else { */
|
||||
/* return -1; */
|
||||
/* } */
|
||||
}
|
||||
|
||||
int flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.choice.setup.repetitionFactor;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.choice.setup.repetitionFactor;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
|
||||
@@ -1233,23 +1258,26 @@ int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
|
||||
}
|
||||
|
||||
int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id) {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_closedLoop)
|
||||
return 2;
|
||||
else if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_openLoop)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
|
||||
|
||||
if(ue_context_p != NULL) {
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
|
||||
if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_closedLoop) {
|
||||
return 2;
|
||||
} else if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_openLoop) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_get_lcg(mid_t ue_id, mid_t lc_id) {
|
||||
@@ -1265,10 +1293,13 @@ int flexran_get_lcg(mid_t ue_id, mid_t lc_id) {
|
||||
|
||||
int flexran_get_direction(mid_t ue_id, mid_t lc_id) {
|
||||
/*TODO: fill with the value for the rest of LCID*/
|
||||
if(lc_id == DCCH | lc_id == DCCH1)
|
||||
if(lc_id == DCCH || lc_id == DCCH1) {
|
||||
return 2;
|
||||
else if(lc_id == DTCH)
|
||||
} else if(lc_id == DTCH) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) {
|
||||
@@ -1276,8 +1307,7 @@ int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_cha
|
||||
Protocol__FlexranMessage *msg;
|
||||
Protocol__FlexHeader *header;
|
||||
void *data;
|
||||
int priority;
|
||||
err_code_t err_code;
|
||||
int priority = 0;
|
||||
|
||||
int xid = 0;
|
||||
|
||||
@@ -1461,14 +1491,14 @@ int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_cha
|
||||
data = flexran_agent_pack_message(msg, &size);
|
||||
/*Send sr info using the MAC channel of the eNB*/
|
||||
if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
|
||||
return;
|
||||
return 0;
|
||||
error:
|
||||
LOG_D(FLEXRAN_AGENT, "Could not send UE state message\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1481,15 +1511,17 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
|
||||
xid = (lc_config_request_msg->header)->xid;
|
||||
|
||||
int i, j;
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_LC_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexLcConfigReply *lc_config_reply_msg;
|
||||
lc_config_reply_msg = malloc(sizeof(Protocol__FlexLcConfigReply));
|
||||
if(lc_config_reply_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_lc_config_reply__init(lc_config_reply_msg);
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_LC_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
lc_config_reply_msg->header = header;
|
||||
|
||||
lc_config_reply_msg->n_lc_ue_config = flexran_get_num_ues(mod_id);
|
||||
@@ -1606,15 +1638,16 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
|
||||
|
||||
int i;
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_UE_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexUeConfigReply *ue_config_reply_msg;
|
||||
ue_config_reply_msg = malloc(sizeof(Protocol__FlexUeConfigReply));
|
||||
if(ue_config_reply_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_ue_config_reply__init(ue_config_reply_msg);
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_UE_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
ue_config_reply_msg->header = header;
|
||||
|
||||
ue_config_reply_msg->n_ue_config = flexran_get_num_ues(mod_id);
|
||||
@@ -1805,16 +1838,16 @@ int flexran_agent_enb_config_request(mid_t mod_id, const void* params, Protocol_
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
xid_t xid = 1;
|
||||
if(flexran_create_header(xid,PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexEnbConfigRequest *enb_config_request_msg;
|
||||
enb_config_request_msg = malloc(sizeof(Protocol__FlexEnbConfigRequest));
|
||||
|
||||
if(enb_config_request_msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flex_enb_config_request__init(enb_config_request_msg);
|
||||
|
||||
if(flexran_create_header(xid,PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
enb_config_request_msg->header = header;
|
||||
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
@@ -1846,19 +1879,19 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F
|
||||
Protocol__FlexEnbConfigRequest *enb_config_req_msg = input->enb_config_request_msg;
|
||||
xid = (enb_config_req_msg->header)->xid;
|
||||
|
||||
int i, j, k;
|
||||
int cc_id = 0;
|
||||
int i, j;
|
||||
int enb_id = mod_id;
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__FlexEnbConfigReply *enb_config_reply_msg;
|
||||
Protocol__FlexEnbConfigReply *enb_config_reply_msg;
|
||||
enb_config_reply_msg = malloc(sizeof(Protocol__FlexEnbConfigReply));
|
||||
if(enb_config_reply_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_enb_config_reply__init(enb_config_reply_msg);
|
||||
|
||||
Protocol__FlexHeader *header;
|
||||
if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
enb_config_reply_msg->header = header;
|
||||
|
||||
enb_config_reply_msg->enb_id = mod_id;
|
||||
|
||||
@@ -72,7 +72,7 @@ int flexran_agent_deserialize_message(void *data, int size, Protocol__FlexranMes
|
||||
/* Serialize message and then destroy the input flexran msg. Should be called when protocol
|
||||
message is created dynamically */
|
||||
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
uint32_t * size);
|
||||
int * size);
|
||||
|
||||
/* Calls destructor of the given message */
|
||||
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg);
|
||||
@@ -271,7 +271,7 @@ int flexran_get_tpc(mid_t mod_id, mid_t ue_id);
|
||||
a designated frame and subframe. Returns 0 for success. The id and the
|
||||
status of the HARQ process are stored in id and status respectively */
|
||||
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
|
||||
const int frame, const uint8_t subframe, int *id, int *round);
|
||||
const int frame, const uint8_t subframe, unsigned char *id, unsigned char *round);
|
||||
|
||||
/* Uplink power control management*/
|
||||
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id);
|
||||
|
||||
@@ -38,13 +38,12 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
LOG_I(ENB_APP, "Time to apply a new policy \n");
|
||||
|
||||
yaml_parser_initialize(&parser);
|
||||
|
||||
yaml_parser_set_input_string(&parser, policy, strlen(policy));
|
||||
yaml_parser_set_input_string(&parser, (unsigned char *) policy, strlen(policy));
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(&parser, &event))
|
||||
@@ -52,39 +51,40 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
|
||||
|
||||
switch (event.type) {
|
||||
case YAML_STREAM_START_EVENT:
|
||||
break;
|
||||
case YAML_STREAM_END_EVENT:
|
||||
break;
|
||||
case YAML_DOCUMENT_START_EVENT:
|
||||
break;
|
||||
case YAML_DOCUMENT_END_EVENT:
|
||||
break;
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
// Check the system name and call the proper handler
|
||||
if (strcmp(event.data.scalar.value, "mac") == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "mac") == 0) {
|
||||
LOG_D(ENB_APP, "This is intended for the mac system\n");
|
||||
// Call the mac handler
|
||||
if (parse_mac_config(mod_id, &parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "rlc") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "rlc") == 0) {
|
||||
// Call the RLC handler
|
||||
LOG_D(ENB_APP, "This is intended for the rlc system\n");
|
||||
// TODO : Just skip it for now
|
||||
if (skip_system_section(&parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "pdcp") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "pdcp") == 0) {
|
||||
// Call the PDCP handler
|
||||
LOG_D(ENB_APP, "This is intended for the pdcp system\n");
|
||||
// TODO : Just skip it for now
|
||||
if (skip_system_section(&parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "rrc") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "rrc") == 0) {
|
||||
// Call the RRC handler
|
||||
LOG_D(ENB_APP, "This is intended for the rrc system\n");
|
||||
// TODO : Just skip it for now
|
||||
@@ -159,8 +159,9 @@ int skip_system_section(yaml_parser_t *parser) {
|
||||
if (skip_subsystem_section(parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_SEQUENCE_END_EVENT);
|
||||
|
||||
yaml_event_delete(&event);
|
||||
@@ -199,7 +200,7 @@ int skip_subsystem_section(yaml_parser_t *parser) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
if (strcmp(event.data.scalar.value, "behavior") == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
|
||||
LOG_D(ENB_APP, "Skipping the behavior attribute\n");
|
||||
yaml_event_delete(&event);
|
||||
if (!yaml_parser_parse(parser, &event)) {
|
||||
@@ -210,7 +211,7 @@ int skip_subsystem_section(yaml_parser_t *parser) {
|
||||
} else {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp(event.data.scalar.value, "parameters") == 0) {
|
||||
} else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
|
||||
LOG_D(ENB_APP, "Skipping the parameters for this subsystem\n");
|
||||
if (skip_subsystem_parameters_config(parser) == -1) {
|
||||
goto error;
|
||||
@@ -235,8 +236,6 @@ int skip_subsystem_section(yaml_parser_t *parser) {
|
||||
int skip_subsystem_parameters_config(yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
void *param;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
@@ -299,10 +298,10 @@ int skip_parameter_modification(yaml_parser_t *parser) {
|
||||
is_array = 1;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if ((strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) ||
|
||||
(strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) ||
|
||||
(strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) ||
|
||||
(strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0)) {
|
||||
if ((strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0)) {
|
||||
// Do nothing
|
||||
} else {
|
||||
// No other type is supported at the moment, so it should be considered an error
|
||||
@@ -351,14 +350,14 @@ int apply_parameter_modification(void *parameter, yaml_parser_t *parser) {
|
||||
is_array = 1;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) {
|
||||
((int *) parameter)[i] = strtol(event.data.scalar.value, &endptr, 10);
|
||||
} else if (strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) {
|
||||
((float *) parameter)[i] = strtof(event.data.scalar.value, &endptr);
|
||||
} else if (strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) {
|
||||
strncpy(&((char *) parameter)[i], event.data.scalar.value, event.data.scalar.length);
|
||||
} else if (strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0) {
|
||||
if (strcmp(event.data.scalar.value, "true") == 0) {
|
||||
if (strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) {
|
||||
((int *) parameter)[i] = strtol((char *) event.data.scalar.value, &endptr, 10);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) {
|
||||
((float *) parameter)[i] = strtof((char *) event.data.scalar.value, &endptr);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) {
|
||||
strncpy(&((char *) parameter)[i], (char *) event.data.scalar.value, event.data.scalar.length);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "true") == 0) {
|
||||
((int *) parameter)[i] = 1;
|
||||
} else {
|
||||
((int *) parameter)[i] = 0;
|
||||
|
||||
@@ -73,12 +73,12 @@ flexran_agent_message_destruction_callback message_destruction_callback[] = {
|
||||
flexran_agent_destroy_agent_reconfiguration,
|
||||
};
|
||||
|
||||
static const char *flexran_agent_direction2String[] = {
|
||||
"", /* not_set */
|
||||
"originating message", /* originating message */
|
||||
"successfull outcome", /* successfull outcome */
|
||||
"unsuccessfull outcome", /* unsuccessfull outcome */
|
||||
};
|
||||
/* static const char *flexran_agent_direction2String[] = { */
|
||||
/* "", /\* not_set *\/ */
|
||||
/* "originating message", /\* originating message *\/ */
|
||||
/* "successfull outcome", /\* successfull outcome *\/ */
|
||||
/* "unsuccessfull outcome", /\* unsuccessfull outcome *\/ */
|
||||
/* }; */
|
||||
|
||||
|
||||
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
|
||||
@@ -123,7 +123,7 @@ error:
|
||||
|
||||
|
||||
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
uint32_t * size){
|
||||
int * size){
|
||||
|
||||
void * buffer;
|
||||
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR;
|
||||
@@ -181,7 +181,7 @@ Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* tim
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT, "can't get the timer element\n");
|
||||
return TIMER_ELEMENT_NOT_FOUND;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
|
||||
|
||||
@@ -183,22 +183,26 @@ rrc_mac_config_req(
|
||||
logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size
|
||||
if (logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup != NULL) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
|
||||
LOG_D(MAC,"[CONFIG][UE %d] LCID %ld is attached to the LCGID %ld\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
|
||||
}
|
||||
else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity] = MAX_NUM_LCGID;
|
||||
}
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0;
|
||||
} else {
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %ld NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
|
||||
mac_xface->macphy_exit("NULL ul_SpecificParameters");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (logicalChannelConfig)
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
if (UE_id == -1) {
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
} else {
|
||||
if (logicalChannelConfig)
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +300,10 @@ rrc_mac_config_req(
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
if (eNB_flagP==1) {
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
|
||||
} else {
|
||||
mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
|
||||
@@ -308,7 +315,10 @@ rrc_mac_config_req(
|
||||
if (sCellToAddMod_r10 != NULL) {
|
||||
|
||||
if (eNB_flagP==1) {
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
|
||||
} else {
|
||||
|
||||
//#warning "phy_config_dedicated_scell_ue is empty"
|
||||
|
||||
@@ -149,6 +149,9 @@
|
||||
/*!\brief minimum MAC data needed for transmitting 1 min RLC PDU size + 1 byte MAC subHeader */
|
||||
#define MIN_MAC_HDR_RLC_SIZE (1 + MIN_RLC_PDU_SIZE)
|
||||
|
||||
/*!\brief maximum number of slices / groups */
|
||||
#define MAX_NUM_SLICES 4
|
||||
|
||||
/*
|
||||
* eNB part
|
||||
*/
|
||||
|
||||
@@ -99,7 +99,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
int result;
|
||||
#endif
|
||||
DCI_PDU *DCI_pdu[MAX_NUM_CCs];
|
||||
int CC_id,i,next_i;
|
||||
int CC_id,i; //,next_i;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
rnti_t rnti;
|
||||
void *DLSCH_dci=NULL;
|
||||
@@ -123,17 +123,27 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
|
||||
}
|
||||
|
||||
// clear DCI and BCCH contents before scheduling
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
DCI_pdu[CC_id]->Num_common_dci = 0;
|
||||
DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
|
||||
#ifdef Rel10
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
|
||||
#endif
|
||||
eNB_mac_inst[module_idP].frame = frameP;
|
||||
eNB_mac_inst[module_idP].subframe = subframeP;
|
||||
}
|
||||
|
||||
// refresh UE list based on UEs dropped by PHY in previous subframe
|
||||
i = UE_list->head;
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
if (UE_list->active[i] != TRUE) continue;
|
||||
|
||||
while (i>=0) {
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
CC_id = UE_PCCID(module_idP, i);
|
||||
if ((frameP==0)&&(subframeP==0))
|
||||
LOG_I(MAC,"UE rnti %x : %s\n", rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync");
|
||||
|
||||
next_i= UE_list->next[i];
|
||||
LOG_I(MAC,"UE rnti %x : %s, PHR %d dB\n", rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info);
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
|
||||
if (i==UE_list->head)
|
||||
@@ -255,15 +265,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
// check threshold
|
||||
if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) {
|
||||
// inform RRC of failure and clear timer
|
||||
LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti);
|
||||
mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti);
|
||||
UE_list->UE_sched_ctrl[i].ul_failure_timer=0;
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync=1;
|
||||
}
|
||||
}
|
||||
} // ul_failure_timer>0
|
||||
|
||||
i = next_i;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
@@ -320,22 +328,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
|
||||
#endif
|
||||
|
||||
// clear DCI and BCCH contents before scheduling
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
DCI_pdu[CC_id]->Num_common_dci = 0;
|
||||
DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
|
||||
|
||||
|
||||
#ifdef Rel10
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
|
||||
#endif
|
||||
|
||||
eNB_mac_inst[module_idP].frame = frameP;
|
||||
eNB_mac_inst[module_idP].subframe = subframeP;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* #ifndef DISABLE_SF_TRIGGER */
|
||||
/* //Send subframe trigger to the controller */
|
||||
/* if (mac_agent_registered[module_idP]) { */
|
||||
|
||||
@@ -73,7 +73,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
unsigned char i,harq_pid,round;
|
||||
int16_t rrc_sdu_length;
|
||||
unsigned char lcid,offset;
|
||||
module_id_t UE_id= UE_INDEX_INVALID;
|
||||
int UE_id = -1;
|
||||
unsigned short TBsize = -1;
|
||||
unsigned short msg4_padding,msg4_post_padding,msg4_header;
|
||||
uint8_t *vrb_map;
|
||||
@@ -266,6 +266,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
|
||||
// check for Msg4 Message
|
||||
UE_id = find_UE_id(module_idP,RA_template->rnti);
|
||||
if (UE_id == -1) { printf("%s:%d:%s: FATAL ERROR\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
|
||||
|
||||
if (Is_rrc_registered == 1) {
|
||||
|
||||
@@ -709,7 +710,10 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
RA_template->RA_dci_size_bits2,
|
||||
RA_template->RA_dci_fmt2,
|
||||
0);
|
||||
printf("MAC: msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP);
|
||||
}
|
||||
else
|
||||
printf("MAC: msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP);
|
||||
LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n",
|
||||
module_idP,CC_id,frameP,subframeP,RA_template->rnti);
|
||||
} else {
|
||||
@@ -718,6 +722,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
remove UE instance across all the layers: mac_xface->cancel_RA();
|
||||
}
|
||||
*/
|
||||
printf("MAC: msg4 acknowledged for rnti %x fsf %d/%d, let's configure it\n", RA_template->rnti, frameP, subframeP);
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP);
|
||||
RA_template->wait_ack_Msg4=0;
|
||||
RA_template->RA_active=FALSE;
|
||||
@@ -746,14 +751,26 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0);
|
||||
|
||||
for (i=0; i<NB_RA_PROC_MAX; i++) {
|
||||
if (RA_template[i].RA_active==FALSE) {
|
||||
if (RA_template[i].RA_active==FALSE &&
|
||||
RA_template[i].wait_ack_Msg4 == 0) {
|
||||
int loop = 0;
|
||||
RA_template[i].RA_active=TRUE;
|
||||
RA_template[i].generate_rar=1;
|
||||
RA_template[i].generate_Msg4=0;
|
||||
RA_template[i].wait_ack_Msg4=0;
|
||||
RA_template[i].timing_offset=timing_offset;
|
||||
// Put in random rnti (to be replaced with proper procedure!!)
|
||||
RA_template[i].rnti = taus();
|
||||
/* TODO: find better procedure to allocate RNTI */
|
||||
do {
|
||||
RA_template[i].rnti = taus();
|
||||
loop++;
|
||||
} while (loop != 100 &&
|
||||
/* TODO: this is not correct, the rnti may be in use without
|
||||
* being in the MAC yet. To be refined.
|
||||
*/
|
||||
!(find_UE_id(module_idP, RA_template[i].rnti) == -1 &&
|
||||
/* 1024 and 60000 arbirarily chosen, not coming from standard */
|
||||
RA_template[i].rnti >= 1024 && RA_template[i].rnti < 60000));
|
||||
if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
|
||||
RA_template[i].RA_rnti = 1+subframeP+(10*f_id);
|
||||
RA_template[i].preamble_index = preamble_index;
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation for process %d, rnti %x, RA_active %d\n",
|
||||
@@ -763,6 +780,8 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_E(MAC,"[eNB %d][RAPROC] FAILURE: CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
|
||||
}
|
||||
|
||||
void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti)
|
||||
|
||||
@@ -442,7 +442,7 @@ schedule_ue_spec(
|
||||
// unsigned char rballoc_sub_UE[MAX_NUM_CCs][NUMBER_OF_UE_MAX][N_RBG_MAX];
|
||||
// uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
int mcs;
|
||||
uint16_t min_rb_unit[MAX_NUM_CCs];
|
||||
int min_rb_unit[MAX_NUM_CCs];
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
@@ -453,9 +453,11 @@ schedule_ue_spec(
|
||||
UE_sched_ctrl *ue_sched_ctl;
|
||||
int i;
|
||||
|
||||
#if 0
|
||||
if (UE_list->head==-1) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
start_meas(&eNB->schedule_dlsch);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN);
|
||||
@@ -519,9 +521,23 @@ schedule_ue_spec(
|
||||
continue_flag=1;
|
||||
}
|
||||
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format1);
|
||||
switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format1);
|
||||
break;
|
||||
case 3:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format2A);
|
||||
break;
|
||||
default:
|
||||
LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti));
|
||||
aggregation = 2;
|
||||
}
|
||||
|
||||
if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated
|
||||
CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)
|
||||
@@ -1653,7 +1669,10 @@ fill_DLSCH_dci(
|
||||
break;
|
||||
|
||||
case 3:
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS (rb alloc: %x) \n",
|
||||
/* TODO: fix log, what is 'rb alloc'? */
|
||||
/*LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS (rb alloc: %x) \n",
|
||||
module_idP, CC_id, UE_id, nb_rb);*/
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS\n",
|
||||
module_idP, CC_id, UE_id, nb_rb);
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
|
||||
@@ -107,18 +107,17 @@ DCI_PDU *get_dci_sdu(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame
|
||||
int find_UE_id(module_id_t mod_idP, rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
int UE_id;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
|
||||
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (UE_list->active[UE_id] != TRUE) continue;
|
||||
if (UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti==rntiP) {
|
||||
return(UE_id);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -265,21 +264,17 @@ void dump_ue_list(UE_list_t *listP, int ul_flag)
|
||||
int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
|
||||
{
|
||||
int UE_id;
|
||||
int j;
|
||||
int i, j;
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
|
||||
LOG_D(MAC,"[eNB %d, CC_id %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",mod_idP,cc_idP,rntiP,UE_list->avail,UE_list->num_UEs);
|
||||
dump_ue_list(UE_list,0);
|
||||
|
||||
if (UE_list->avail>=0) {
|
||||
UE_id = UE_list->avail;
|
||||
AssertFatal( UE_id < NUMBER_OF_UE_MAX, "BAD UE_id %u > NUMBER_OF_UE_MAX",UE_id );
|
||||
UE_list->avail = UE_list->next[UE_list->avail];
|
||||
UE_list->next[UE_id] = UE_list->head;
|
||||
UE_list->next_ul[UE_id] = UE_list->head_ul;
|
||||
UE_list->head = UE_id;
|
||||
UE_list->head_ul = UE_id;
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
if (UE_list->active[i] == TRUE) continue;
|
||||
printf("MAC: new UE id %d rnti %x\n", i, rntiP);
|
||||
UE_id = i;
|
||||
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
|
||||
UE_list->UE_template[cc_idP][UE_id].configured = FALSE;
|
||||
UE_list->numactiveCCs[UE_id] = 1;
|
||||
@@ -303,6 +298,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
|
||||
return(UE_id);
|
||||
}
|
||||
|
||||
printf("MAC: cannot add new UE for rnti %x\n", rntiP);
|
||||
LOG_E(MAC,"error in add_new_ue(), could not find space in UE_list, Dumping UE list\n");
|
||||
dump_ue_list(UE_list,0);
|
||||
return(-1);
|
||||
@@ -312,23 +308,27 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
|
||||
int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
int prev,i, ret=-1;
|
||||
|
||||
|
||||
int i;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
int UE_id = find_UE_id(mod_idP,rntiP);
|
||||
int pCC_id = UE_PCCID(mod_idP,UE_id);
|
||||
int pCC_id;
|
||||
|
||||
if (UE_id == -1) {
|
||||
printf("MAC: cannot remove UE rnti %x\n", rntiP);
|
||||
LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", rntiP);
|
||||
mac_phy_remove_ue(mod_idP,rntiP);
|
||||
mac_phy_remove_ue(mod_idP, rntiP);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pCC_id = UE_PCCID(mod_idP,UE_id);
|
||||
|
||||
printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
|
||||
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP);
|
||||
dump_ue_list(UE_list,0);
|
||||
|
||||
UE_list->active[UE_id] = FALSE;
|
||||
UE_list->num_UEs--;
|
||||
|
||||
// clear all remaining pending transmissions
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0;
|
||||
@@ -343,58 +343,13 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
|
||||
eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
|
||||
|
||||
prev = UE_list->head;
|
||||
|
||||
for (i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
if (i == UE_id) {
|
||||
// link prev to next in Active list
|
||||
if (i==UE_list->head) {
|
||||
UE_list->head = UE_list->next[i];
|
||||
} else {
|
||||
UE_list->next[prev] = UE_list->next[i];
|
||||
}
|
||||
|
||||
// add UE id (i)to available
|
||||
UE_list->next[i] = UE_list->avail;
|
||||
UE_list->avail = i;
|
||||
UE_list->active[i] = FALSE;
|
||||
UE_list->num_UEs--;
|
||||
ret=0;
|
||||
break;
|
||||
}
|
||||
|
||||
prev=i;
|
||||
}
|
||||
|
||||
// do the same for UL
|
||||
prev = UE_list->head_ul;
|
||||
|
||||
for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
|
||||
if (i == UE_id) {
|
||||
// link prev to next in Active list
|
||||
if (i==UE_list->head_ul) {
|
||||
UE_list->head_ul = UE_list->next_ul[i];
|
||||
} else {
|
||||
UE_list->next_ul[prev] = UE_list->next_ul[i];
|
||||
}
|
||||
|
||||
// add UE id (i)to available
|
||||
UE_list->next_ul[i] = UE_list->avail;
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
prev=i;
|
||||
}
|
||||
|
||||
mac_phy_remove_ue(mod_idP,rntiP);
|
||||
|
||||
// check if this has an RA process active
|
||||
RA_TEMPLATE *RA_template;
|
||||
for (i=0;i<NB_RA_PROC_MAX;i++) {
|
||||
RA_template = (RA_TEMPLATE *)&eNB_mac_inst[mod_idP].common_channels[pCC_id].RA_template[i];
|
||||
if ((RA_template->RA_active == TRUE) &&
|
||||
(RA_template->rnti == rntiP)){
|
||||
if (RA_template->rnti == rntiP){
|
||||
RA_template->RA_active=FALSE;
|
||||
RA_template->generate_rar=0;
|
||||
RA_template->generate_Msg4=0;
|
||||
@@ -402,18 +357,11 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
RA_template->timing_offset=0;
|
||||
RA_template->RRC_timer=20;
|
||||
RA_template->rnti = 0;
|
||||
break;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
if (ret == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id);
|
||||
dump_ue_list(UE_list,0);
|
||||
mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list");
|
||||
return(-1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -853,7 +801,8 @@ int get_min_rb_unit(module_id_t module_id, uint8_t CC_id)
|
||||
|
||||
default:
|
||||
min_rb_unit=2;
|
||||
LOG_W(MAC,"[eNB %d] N_DL_RB %d unknown for CC_id %d, setting min_rb_unit to 2\n", module_id, CC_id);
|
||||
LOG_W(MAC,"[eNB %d] N_DL_RB %d unknown for CC_id %d, setting min_rb_unit to 2\n",
|
||||
module_id, frame_parms->N_RB_DL, CC_id);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1157,8 +1106,7 @@ try_again:
|
||||
1<<DCI_pdu->dci_alloc[j].L,
|
||||
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
|
||||
}
|
||||
dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L);
|
||||
|
||||
//dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L);
|
||||
goto failed;
|
||||
}
|
||||
DCI_pdu->num_pdcch_symbols++;
|
||||
|
||||
@@ -333,7 +333,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
if (UE_id < 0) {
|
||||
memcpy(&eNB->common_channels[CC_idP].RA_template[ii].cont_res_id[0],payload_ptr,6);
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %d\n",
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n",
|
||||
enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP);
|
||||
|
||||
if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) {
|
||||
@@ -343,7 +343,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n",
|
||||
enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id);
|
||||
} else {
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %d\n",
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %ld\n",
|
||||
enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[i],payload_ptr-sduP);
|
||||
// kill RA procedure
|
||||
}
|
||||
@@ -433,7 +433,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
if (UE_id != -1) {
|
||||
// adjust buffer occupancy of the correponding logical channel group
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n",
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %ld, %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
|
||||
@@ -568,7 +568,7 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB] sdu %d lcid %d tb_length %d length %d (offset now %d)\n",
|
||||
LOG_D(MAC,"[eNB] sdu %d lcid %d tb_length %d length %d (offset now %ld)\n",
|
||||
num_sdus,lcid,tb_length, length,mac_header_ptr-mac_header);
|
||||
rx_lcids[num_sdus] = lcid;
|
||||
rx_lengths[num_sdus] = length;
|
||||
@@ -750,6 +750,39 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
continue;
|
||||
}
|
||||
|
||||
/* let's drop the UE if get_eNB_UE_stats returns NULL when calling it with any of the UE's active UL CCs */
|
||||
/* TODO: refine? */
|
||||
drop_ue = 0;
|
||||
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
|
||||
CC_id = UE_list->ordered_ULCCids[n][UE_id];
|
||||
if (mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti) == NULL) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
drop_ue = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (drop_ue == 1) {
|
||||
/* we can't come here, ulsch_scheduler_pre_processor won't put in the list a UE with no PHY context */
|
||||
abort();
|
||||
/* TODO: this is a hack. Sometimes the UE has no PHY context but
|
||||
* is still present in the MAC with 'ul_failure_timer' = 0 and
|
||||
* 'ul_out_of_sync' = 0. It seems wrong and the UE stays there forever. Let's
|
||||
* start an UL out of sync procedure in this case.
|
||||
* The root cause of this problem has to be found and corrected.
|
||||
* In the meantime, this hack...
|
||||
*/
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0 &&
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: UE in weird state, let's put it 'out of sync'\n",
|
||||
module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
// inform RRC of failure and clear timer
|
||||
mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti);
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// loop over all active UL CC_ids for this UE
|
||||
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
|
||||
// This is the actual CC_id in the list
|
||||
@@ -757,28 +790,19 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
frame_parms = mac_xface->get_lte_frame_parms(module_idP,CC_id);
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
|
||||
if (eNB_UE_stats==NULL) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
drop_ue=1;
|
||||
continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
|
||||
}
|
||||
|
||||
if (drop_ue==1)
|
||||
continue;
|
||||
|
||||
aggregation=get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format0);
|
||||
|
||||
if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
continue; // break;
|
||||
} else{
|
||||
LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: aggregation level %d\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id, 1<<aggregation);
|
||||
LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d mode %s: aggregation level %d\n",
|
||||
module_idP,frameP,subframeP,UE_id,rnti,CC_id, mode_string[eNB_UE_stats->mode], 1<<aggregation);
|
||||
}
|
||||
|
||||
|
||||
// printf("UE %d/%x is feasible, mode %s\n",UE_id,rnti,mode_string[eNB_UE_stats->mode]);
|
||||
|
||||
if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel
|
||||
|
||||
DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu;
|
||||
@@ -885,6 +909,12 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]),
|
||||
T_INT(TBS), T_INT(ndi));
|
||||
|
||||
if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
|
||||
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
|
||||
first_rb[CC_id],rb_table[rb_table_index],
|
||||
rb_table_index,TBS,harq_pid);
|
||||
|
||||
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
|
||||
// increment for next UE allocation
|
||||
first_rb[CC_id]+=rb_table[rb_table_index];
|
||||
@@ -894,12 +924,6 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
if (UE_id == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled);
|
||||
|
||||
if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
|
||||
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
|
||||
first_rb[CC_id],rb_table[rb_table_index],
|
||||
rb_table_index,TBS,harq_pid);
|
||||
|
||||
// adjust total UL buffer status by TBS, wait for UL sdus to do final update
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS);
|
||||
if (UE_template->ul_total_buffer > TBS)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/*! \file flexran_agent_mac_proto.h
|
||||
* \brief MAC functions for FlexRAN agent
|
||||
* \author Xenofon Foukas
|
||||
* \author Xenofon Foukas and Navid Nikaein
|
||||
* \date 2016
|
||||
* \email: x.foukas@sms.ed.ac.uk
|
||||
* \version 0.1
|
||||
@@ -36,6 +36,145 @@
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
|
||||
/*
|
||||
* slice specific scheduler
|
||||
*/
|
||||
typedef void (*slice_scheduler)(module_id_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* top level flexran scheduler used by the eNB scheduler
|
||||
*/
|
||||
void flexran_schedule_ue_spec_default(mid_t mod_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
/*
|
||||
* slice specific scheduler for embb
|
||||
*/
|
||||
void
|
||||
flexran_schedule_ue_spec_embb(mid_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
/*
|
||||
* slice specific scheduler for urllc
|
||||
*/
|
||||
void
|
||||
flexran_schedule_ue_spec_urllc(mid_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
|
||||
/*
|
||||
* slice specific scheduler for mmtc
|
||||
*/
|
||||
void
|
||||
flexran_schedule_ue_spec_mmtc(mid_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
/*
|
||||
* slice specific scheduler for best effort traffic
|
||||
*/
|
||||
void
|
||||
flexran_schedule_ue_spec_be(mid_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
|
||||
/*
|
||||
* common flexran scheduler function
|
||||
*/
|
||||
void
|
||||
flexran_schedule_ue_spec_common(mid_t mod_id,
|
||||
int slice_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
Protocol__FlexranMessage **dl_info);
|
||||
|
||||
uint16_t flexran_nb_rbs_allowed_slice(float rb_percentage,
|
||||
int total_rbs);
|
||||
|
||||
int flexran_slice_member(int UE_id,
|
||||
int slice_id);
|
||||
|
||||
int flexran_slice_maxmcs(int slice_id) ;
|
||||
|
||||
void _store_dlsch_buffer (module_id_t Mod_id,
|
||||
int slice_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP);
|
||||
|
||||
|
||||
void _assign_rbs_required (module_id_t Mod_id,
|
||||
int slice_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
uint16_t nb_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES],
|
||||
int min_rb_unit[MAX_NUM_CCs]);
|
||||
|
||||
int _maxround(module_id_t Mod_id,
|
||||
uint16_t rnti,
|
||||
int frame,
|
||||
sub_frame_t subframe,
|
||||
uint8_t ul_flag );
|
||||
|
||||
int _maxcqi(module_id_t Mod_id,
|
||||
int32_t UE_id);
|
||||
|
||||
void _sort_UEs (module_id_t Mod_idP,
|
||||
int frameP,
|
||||
sub_frame_t subframeP);
|
||||
|
||||
void _dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
int slice_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int N_RBG[MAX_NUM_CCs],
|
||||
int *mbsfn_flag);
|
||||
|
||||
void _dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
int frameP,
|
||||
int subframeP,
|
||||
int N_RBG,
|
||||
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
uint16_t nb_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES],
|
||||
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
|
||||
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]);
|
||||
|
||||
void _dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
int N_RBG,
|
||||
int transmission_mode,
|
||||
int min_rb_unit,
|
||||
uint8_t N_RB_DL,
|
||||
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
|
||||
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]);
|
||||
|
||||
/*
|
||||
* Default scheduler used by the eNB agent
|
||||
*/
|
||||
@@ -46,17 +185,17 @@ void flexran_schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t sub
|
||||
* Data plane function for applying the DL decisions of the scheduler
|
||||
*/
|
||||
void flexran_apply_dl_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
|
||||
const Protocol__FlexranMessage *dl_scheduling_info);
|
||||
Protocol__FlexranMessage *dl_scheduling_info);
|
||||
|
||||
/*
|
||||
* Data plane function for applying the UE specific DL decisions of the scheduler
|
||||
*/
|
||||
void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
|
||||
uint32_t n_dl_ue_data, const Protocol__FlexDlData **dl_ue_data);
|
||||
uint32_t n_dl_ue_data, Protocol__FlexDlData **dl_ue_data);
|
||||
|
||||
/*
|
||||
* Data plane function for filling the DCI structure
|
||||
*/
|
||||
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, const Protocol__FlexDlDci *dl_dci);
|
||||
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, Protocol__FlexDlDci *dl_dci);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,12 +56,11 @@
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h" // for taus
|
||||
|
||||
|
||||
void flexran_apply_dl_scheduling_decisions(mid_t mod_id,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
const Protocol__FlexranMessage *dl_scheduling_info) {
|
||||
Protocol__FlexranMessage *dl_scheduling_info) {
|
||||
|
||||
Protocol__FlexDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg;
|
||||
|
||||
@@ -89,33 +88,26 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
|
||||
uint32_t subframe,
|
||||
int *mbsfn_flag,
|
||||
uint32_t n_dl_ue_data,
|
||||
const Protocol__FlexDlData **dl_ue_data) {
|
||||
Protocol__FlexDlData **dl_ue_data) {
|
||||
|
||||
uint8_t CC_id;
|
||||
int UE_id;
|
||||
int N_RBG[MAX_NUM_CCs];
|
||||
unsigned char aggregation;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
unsigned char ta_len=0;
|
||||
unsigned char header_len = 0, header_len_tmp = 0;
|
||||
unsigned char sdu_lcids[11],offset,num_sdus=0;
|
||||
uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
|
||||
uint16_t nb_rb;
|
||||
uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0;
|
||||
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
|
||||
unsigned char round = 0;
|
||||
unsigned char harq_pid = 0;
|
||||
|
||||
// LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
|
||||
uint16_t sdu_length_total = 0;
|
||||
int mcs;
|
||||
uint16_t min_rb_unit[MAX_NUM_CCs];
|
||||
short ta_update = 0;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int32_t normalized_rx_power, target_rx_power;
|
||||
int32_t tpc=1;
|
||||
static int32_t tpc_accumulated=0;
|
||||
// static int32_t tpc_accumulated=0;
|
||||
UE_sched_ctrl *ue_sched_ctl;
|
||||
|
||||
int last_sdu_header_len = 0;
|
||||
@@ -135,7 +127,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
|
||||
dl_dci = dl_data->dl_dci;
|
||||
|
||||
CC_id = dl_data->serv_cell_index;
|
||||
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id);
|
||||
// frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id);
|
||||
|
||||
rnti = dl_data->rnti;
|
||||
UE_id = find_ue(rnti, PHY_vars_eNB_g[mod_id][CC_id]);
|
||||
@@ -357,20 +349,19 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
|
||||
eNB_UE_stats->dlsch_mcs1 = dl_dci->mcs[0];
|
||||
|
||||
//Fill the proper DCI of OAI
|
||||
fill_oai_dci(mod_id, CC_id, rnti, dl_dci);
|
||||
flexran_fill_oai_dci(mod_id, CC_id, rnti, dl_dci);
|
||||
}
|
||||
}
|
||||
|
||||
void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
|
||||
const Protocol__FlexDlDci *dl_dci) {
|
||||
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
|
||||
Protocol__FlexDlDci *dl_dci) {
|
||||
|
||||
void *DLSCH_dci = NULL;
|
||||
DCI_PDU *DCI_pdu;
|
||||
|
||||
unsigned char round = 0;
|
||||
unsigned char harq_pid = 0;
|
||||
// unsigned char round = 0;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int size_bits, size_bytes;
|
||||
int size_bits = 0, size_bytes = 0;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
|
||||
@@ -380,7 +371,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
|
||||
uint32_t format;
|
||||
|
||||
harq_pid = dl_dci->harq_process;
|
||||
round = dl_dci->rv[0];
|
||||
// round = dl_dci->rv[0];
|
||||
|
||||
// Note this code is for a specific DCI format
|
||||
DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -127,11 +127,11 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
UE_mac_inst = (UE_MAC_INST*)malloc16(NB_UE_INST*sizeof(UE_MAC_INST));
|
||||
|
||||
if (UE_mac_inst == NULL) {
|
||||
LOG_C(MAC,"[MAIN] Can't ALLOCATE %d Bytes for %d UE_MAC_INST with size %d \n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,sizeof(UE_MAC_INST));
|
||||
LOG_C(MAC,"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,sizeof(UE_MAC_INST));
|
||||
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for UEs \n");
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d UE_MAC_INST @ %p\n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,UE_mac_inst);
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,UE_mac_inst);
|
||||
|
||||
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
|
||||
|
||||
@@ -148,10 +148,10 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
eNB_mac_inst = (eNB_MAC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST));
|
||||
|
||||
if (eNB_mac_inst == NULL) {
|
||||
LOG_D(MAC,"[MAIN] can't ALLOCATE %d Bytes for %d eNB_MAC_INST with size %d \n",NB_eNB_INST*sizeof(eNB_MAC_INST*),NB_eNB_INST,sizeof(eNB_MAC_INST));
|
||||
LOG_D(MAC,"[MAIN] can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",NB_eNB_INST*sizeof(eNB_MAC_INST*),NB_eNB_INST,sizeof(eNB_MAC_INST));
|
||||
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for eNB \n");
|
||||
} else {
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
|
||||
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
@@ -62,6 +65,17 @@
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* this function checks that get_eNB_UE_stats returns
|
||||
* a non-NULL pointer for all CCs for a given UE
|
||||
*/
|
||||
static int phy_stats_exist(module_id_t Mod_id, int rnti)
|
||||
{
|
||||
int CC_id;
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
|
||||
if (mac_xface->get_eNB_UE_stats(Mod_id, CC_id, rnti) == NULL)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// This function stores the downlink buffer for all the logical channels
|
||||
void store_dlsch_buffer (module_id_t Mod_id,
|
||||
@@ -75,7 +89,8 @@ void store_dlsch_buffer (module_id_t Mod_id,
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
|
||||
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (UE_list->active[UE_id] != TRUE) continue;
|
||||
|
||||
UE_template = &UE_list->UE_template[UE_PCCID(Mod_id,UE_id)][UE_id];
|
||||
|
||||
@@ -155,10 +170,16 @@ void assign_rbs_required (module_id_t Mod_id,
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
|
||||
// clear rb allocations across all CC_ids
|
||||
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (UE_list->active[UE_id] != TRUE) continue;
|
||||
|
||||
pCCid = UE_PCCID(Mod_id,UE_id);
|
||||
rnti = UE_list->UE_template[pCCid][UE_id].rnti;
|
||||
|
||||
/* skip UE not present in PHY (for any of its active CCs) */
|
||||
if (!phy_stats_exist(Mod_id, rnti))
|
||||
continue;
|
||||
|
||||
//update CQI information across component carriers
|
||||
for (n=0; n<UE_list->numactiveCCs[UE_id]; n++) {
|
||||
|
||||
@@ -262,7 +283,7 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin
|
||||
}
|
||||
|
||||
// This function scans all CC_ids for a particular UE to find the maximum DL CQI
|
||||
|
||||
// it returns -1 if the UE is not found in PHY layer (get_eNB_UE_stats gives NULL)
|
||||
int maxcqi(module_id_t Mod_id,int32_t UE_id)
|
||||
{
|
||||
|
||||
@@ -276,8 +297,9 @@ int maxcqi(module_id_t Mod_id,int32_t UE_id)
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,UE_RNTI(Mod_id,UE_id));
|
||||
|
||||
if (eNB_UE_stats==NULL) {
|
||||
mac_xface->macphy_exit("maxcqi: could not get eNB_UE_stats\n");
|
||||
return 0; // not reached
|
||||
/* the UE may have been removed in the PHY layer, don't exit */
|
||||
//mac_xface->macphy_exit("maxcqi: could not get eNB_UE_stats\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (eNB_UE_stats->DL_cqi[0] > CQI) {
|
||||
@@ -288,13 +310,124 @@ int maxcqi(module_id_t Mod_id,int32_t UE_id)
|
||||
return(CQI);
|
||||
}
|
||||
|
||||
struct sort_ue_dl_params {
|
||||
int Mod_idP;
|
||||
int frameP;
|
||||
int subframeP;
|
||||
};
|
||||
|
||||
static int ue_dl_compare(const void *_a, const void *_b, void *_params)
|
||||
{
|
||||
struct sort_ue_dl_params *params = _params;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[params->Mod_idP].UE_list;
|
||||
|
||||
int UE_id1 = *(const int *)_a;
|
||||
int UE_id2 = *(const int *)_b;
|
||||
|
||||
int rnti1 = UE_RNTI(params->Mod_idP, UE_id1);
|
||||
int pCC_id1 = UE_PCCID(params->Mod_idP, UE_id1);
|
||||
int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP, 1);
|
||||
|
||||
int rnti2 = UE_RNTI(params->Mod_idP, UE_id2);
|
||||
int pCC_id2 = UE_PCCID(params->Mod_idP, UE_id2);
|
||||
int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP, 1);
|
||||
|
||||
int cqi1 = maxcqi(params->Mod_idP, UE_id1);
|
||||
int cqi2 = maxcqi(params->Mod_idP, UE_id2);
|
||||
|
||||
if (round1 > round2) return -1;
|
||||
if (round1 < round2) return 1;
|
||||
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2] >
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2])
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2] <
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2])
|
||||
return 1;
|
||||
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max >
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max)
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max <
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max)
|
||||
return 1;
|
||||
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total >
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total)
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total <
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total)
|
||||
return 1;
|
||||
|
||||
if (cqi1 > cqi2) return -1;
|
||||
if (cqi1 < cqi2) return 1;
|
||||
|
||||
return 0;
|
||||
#if 0
|
||||
/* The above order derives from the following. */
|
||||
if(round2 > round1) { // Check first if one of the UEs has an active HARQ process which needs service and swap order
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,0);
|
||||
} else if (round2 == round1) {
|
||||
// RK->NN : I guess this is for fairness in the scheduling. This doesn't make sense unless all UEs have the same configuration of logical channels. This should be done on the sum of all information that has to be sent. And still it wouldn't ensure fairness. It should be based on throughput seen by each UE or maybe using the head_sdu_creation_time, i.e. swap UEs if one is waiting longer for service.
|
||||
// for(j=0;j<MAX_NUM_LCID;j++){
|
||||
// if (eNB_mac_inst[Mod_id][pCC_id1].UE_template[UE_id1].dl_buffer_info[j] <
|
||||
// eNB_mac_inst[Mod_id][pCC_id2].UE_template[UE_id2].dl_buffer_info[j]){
|
||||
|
||||
// first check the buffer status for SRB1 and SRB2
|
||||
|
||||
if ( (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2]) <
|
||||
(UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2]) ) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,0);
|
||||
} else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max <
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max ) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,0);
|
||||
} else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total <
|
||||
UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total ) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,0);
|
||||
} else if (cqi1 < cqi2) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// This fuction sorts the UE in order their dlsch buffer and CQI
|
||||
void sort_UEs (module_id_t Mod_idP,
|
||||
int frameP,
|
||||
sub_frame_t subframeP)
|
||||
{
|
||||
int i;
|
||||
int list[NUMBER_OF_UE_MAX];
|
||||
int list_size = 0;
|
||||
int rnti;
|
||||
struct sort_ue_dl_params params = { Mod_idP, frameP, subframeP };
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_idP].UE_list;
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
rnti = UE_RNTI(Mod_idP, i);
|
||||
if (rnti == NOT_A_RNTI)
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_idP, rnti))
|
||||
continue;
|
||||
list[list_size] = i;
|
||||
list_size++;
|
||||
}
|
||||
|
||||
qsort_r(list, list_size, sizeof(int), ue_dl_compare, ¶ms);
|
||||
|
||||
if (list_size) {
|
||||
for (i = 0; i < list_size-1; i++)
|
||||
UE_list->next[list[i]] = list[i+1];
|
||||
UE_list->next[list[list_size-1]] = -1;
|
||||
UE_list->head = list[0];
|
||||
} else {
|
||||
UE_list->head = -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
int UE_id1,UE_id2;
|
||||
@@ -315,6 +448,8 @@ void sort_UEs (module_id_t Mod_idP,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_idP, rnti1))
|
||||
continue;
|
||||
pCC_id1 = UE_PCCID(Mod_idP,UE_id1);
|
||||
cqi1 = maxcqi(Mod_idP,UE_id1); //
|
||||
round1 = maxround(Mod_idP,rnti1,frameP,subframeP,0);
|
||||
@@ -325,6 +460,8 @@ void sort_UEs (module_id_t Mod_idP,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_idP, rnti2))
|
||||
continue;
|
||||
cqi2 = maxcqi(Mod_idP,UE_id2);
|
||||
round2 = maxround(Mod_idP,rnti2,frameP,subframeP,0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0);
|
||||
pCC_id2 = UE_PCCID(Mod_idP,UE_id2);
|
||||
@@ -354,6 +491,7 @@ void sort_UEs (module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -407,7 +545,9 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
|
||||
min_rb_unit[CC_id]=get_min_rb_unit(Mod_id,CC_id);
|
||||
|
||||
for (i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
if (UE_list->active[i] != TRUE) continue;
|
||||
|
||||
UE_id = i;
|
||||
// Initialize scheduling information for all active UEs
|
||||
|
||||
@@ -453,11 +593,9 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
UE_id = i;
|
||||
|
||||
// if there is no available harq_process, skip the UE
|
||||
if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0)
|
||||
if (!phy_stats_exist(Mod_id, rnti))
|
||||
continue;
|
||||
UE_id = i;
|
||||
|
||||
for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) {
|
||||
CC_id = UE_list->ordered_CCids[ii][UE_id];
|
||||
@@ -465,6 +603,10 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
harq_pid = ue_sched_ctl->harq_pid[CC_id];
|
||||
round = ue_sched_ctl->round[CC_id];
|
||||
|
||||
// if there is no available harq_process, skip the UE
|
||||
if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0)
|
||||
continue;
|
||||
|
||||
average_rbs_per_user[CC_id]=0;
|
||||
|
||||
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id);
|
||||
@@ -506,6 +648,13 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
rnti = UE_RNTI(Mod_id,i);
|
||||
|
||||
if(rnti == NOT_A_RNTI)
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_id, rnti))
|
||||
continue;
|
||||
|
||||
for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) {
|
||||
CC_id = UE_list->ordered_CCids[ii][i];
|
||||
|
||||
@@ -564,6 +713,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_id, rnti))
|
||||
continue;
|
||||
|
||||
transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti);
|
||||
// mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
|
||||
@@ -610,6 +761,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(Mod_idP, rnti2))
|
||||
continue;
|
||||
|
||||
eNB_UE_stats2 = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti2);
|
||||
//mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0);
|
||||
@@ -758,7 +911,13 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
int sf05_upper=-1,sf05_lower=-1;
|
||||
#endif
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
if (eNB_UE_stats == NULL) return;
|
||||
|
||||
// initialize harq_pid and round
|
||||
|
||||
if (eNB_UE_stats == NULL)
|
||||
return;
|
||||
|
||||
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
|
||||
frameP,subframeP,
|
||||
&ue_sched_ctl->harq_pid[CC_id],
|
||||
@@ -791,7 +950,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16;
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.threequarter_fs == 0)
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16;
|
||||
else
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12;
|
||||
break;
|
||||
}
|
||||
// clear the update in case PHY does not have a new measurement after timer expiry
|
||||
@@ -970,6 +1132,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
|
||||
if (!phy_stats_exist(module_idP, rnti))
|
||||
continue;
|
||||
|
||||
UE_id = i;
|
||||
|
||||
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
|
||||
@@ -1020,6 +1185,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti))
|
||||
continue;
|
||||
|
||||
UE_id = i;
|
||||
|
||||
@@ -1050,6 +1217,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti))
|
||||
continue;
|
||||
|
||||
UE_id = i;
|
||||
|
||||
@@ -1107,7 +1276,8 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
|
||||
for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
if (UE_list->active[i] != TRUE) continue;
|
||||
|
||||
rnti = UE_RNTI(module_idP,i);
|
||||
|
||||
@@ -1115,6 +1285,8 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti))
|
||||
continue;
|
||||
|
||||
if (UE_list->UE_sched_ctrl[i].phr_received == 1)
|
||||
mcs = 20; // if we've received the power headroom information the UE, we can go to maximum mcs
|
||||
@@ -1198,10 +1370,103 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
|
||||
}
|
||||
}
|
||||
|
||||
struct sort_ue_ul_params {
|
||||
int module_idP;
|
||||
int frameP;
|
||||
int subframeP;
|
||||
};
|
||||
|
||||
static int ue_ul_compare(const void *_a, const void *_b, void *_params)
|
||||
{
|
||||
struct sort_ue_ul_params *params = _params;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[params->module_idP].UE_list;
|
||||
|
||||
int UE_id1 = *(const int *)_a;
|
||||
int UE_id2 = *(const int *)_b;
|
||||
|
||||
int rnti1 = UE_RNTI(params->module_idP, UE_id1);
|
||||
int pCCid1 = UE_PCCID(params->module_idP, UE_id1);
|
||||
int round1 = maxround(params->module_idP, rnti1, params->frameP, params->subframeP, 1);
|
||||
|
||||
int rnti2 = UE_RNTI(params->module_idP, UE_id2);
|
||||
int pCCid2 = UE_PCCID(params->module_idP, UE_id2);
|
||||
int round2 = maxround(params->module_idP, rnti2, params->frameP, params->subframeP, 1);
|
||||
|
||||
if (round1 > round2) return -1;
|
||||
if (round1 < round2) return 1;
|
||||
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] > UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0])
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0])
|
||||
return 1;
|
||||
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].ul_total_buffer > UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer)
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].ul_total_buffer < UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer)
|
||||
return 1;
|
||||
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul > UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul)
|
||||
return -1;
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul < UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
#if 0
|
||||
/* The above order derives from the following.
|
||||
* The last case is not handled: "if (UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer > 0 )"
|
||||
* I don't think it makes a big difference.
|
||||
*/
|
||||
if(round2 > round1) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,1);
|
||||
} else if (round2 == round1) {
|
||||
if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,1);
|
||||
} else if (UE_list->UE_template[pCCid1][UE_id1].ul_total_buffer < UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,1);
|
||||
} else if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul < UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) {
|
||||
if (UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer > 0 ) {
|
||||
swap_UEs(UE_list,UE_id1,UE_id2,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
{
|
||||
int i;
|
||||
int list[NUMBER_OF_UE_MAX];
|
||||
int list_size = 0;
|
||||
int rnti;
|
||||
struct sort_ue_ul_params params = { module_idP, frameP, subframeP };
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
if (rnti == NOT_A_RNTI)
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti))
|
||||
continue;
|
||||
list[list_size] = i;
|
||||
list_size++;
|
||||
}
|
||||
|
||||
qsort_r(list, list_size, sizeof(int), ue_ul_compare, ¶ms);
|
||||
|
||||
if (list_size) {
|
||||
for (i = 0; i < list_size-1; i++)
|
||||
UE_list->next_ul[list[i]] = list[i+1];
|
||||
UE_list->next_ul[list[list_size-1]] = -1;
|
||||
UE_list->head_ul = list[0];
|
||||
} else {
|
||||
UE_list->head_ul = -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int UE_id1,UE_id2;
|
||||
int pCCid1,pCCid2;
|
||||
int round1,round2;
|
||||
@@ -1223,6 +1488,8 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti1))
|
||||
continue;
|
||||
|
||||
pCCid1 = UE_PCCID(module_idP,UE_id1);
|
||||
round1 = maxround(module_idP,rnti1,frameP,subframeP,1);
|
||||
@@ -1234,6 +1501,8 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
continue;
|
||||
if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
|
||||
continue;
|
||||
if (!phy_stats_exist(module_idP, rnti2))
|
||||
continue;
|
||||
|
||||
pCCid2 = UE_PCCID(module_idP,UE_id2);
|
||||
round2 = maxround(module_idP,rnti2,frameP,subframeP,1);
|
||||
@@ -1253,4 +1522,5 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ unsigned char *parse_header(unsigned char *mac_header,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC,"[UE] sdu %d lcid %d length %d (offset now %d)\n",
|
||||
LOG_D(MAC,"[UE] sdu %d lcid %d length %d (offset now %ld)\n",
|
||||
num_sdus,lcid,length,mac_header_ptr-mac_header);
|
||||
#endif
|
||||
rx_lcids[num_sdus] = lcid;
|
||||
@@ -229,7 +229,7 @@ unsigned char *parse_header(unsigned char *mac_header,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC,"[UE] ce %d lcid %d (offset now %d)\n",num_ces,lcid,mac_header_ptr-mac_header);
|
||||
LOG_D(MAC,"[UE] ce %d lcid %d (offset now %ld)\n",num_ces,lcid,mac_header_ptr-mac_header);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -366,7 +366,7 @@ ue_send_sdu(
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC,"[eNB %d] First 32 bytes of DLSCH : \n");
|
||||
LOG_T(MAC,"[UE %d] First 32 bytes of DLSCH : \n", module_idP);
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
LOG_T(MAC,"%x.",sdu[i]);
|
||||
@@ -386,7 +386,7 @@ ue_send_sdu(
|
||||
module_idP,frameP,payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4],payload_ptr[5]);
|
||||
|
||||
if (UE_mac_inst[module_idP].RA_active == 1) {
|
||||
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing RA_active flag\n");
|
||||
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing RA_active flag\n", module_idP, frameP);
|
||||
UE_mac_inst[module_idP].RA_active=0;
|
||||
// check if RA procedure has finished completely (no contention)
|
||||
tx_sdu = &UE_mac_inst[module_idP].CCCH_pdu.payload[3];
|
||||
@@ -402,7 +402,7 @@ ue_send_sdu(
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing contention resolution timer\n");
|
||||
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing contention resolution timer\n", module_idP, frameP);
|
||||
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
|
||||
mac_xface->ra_succeeded(module_idP,CC_id,eNB_index);
|
||||
}
|
||||
@@ -742,7 +742,7 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_
|
||||
mcch_period = 32<<(UE_mac_inst[module_idP].mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
|
||||
LOG_D(MAC,
|
||||
"[UE %d] Frame %d subframe %d: Checking MBSFN Sync Area %d/%d with SF allocation %d/%d for MCCH and MTCH (mbsfn period %d, mcch period %d,mac sched period (%d,%d))\n",
|
||||
"[UE %d] Frame %d subframe %d: Checking MBSFN Sync Area %d/%d with SF allocation %d/%d for MCCH and MTCH (mbsfn period %d, mcch period %d,mac sched period (%d,%ld))\n",
|
||||
module_idP,frameP, subframe,i,UE_mac_inst[module_idP].num_active_mbsfn_area,
|
||||
j,UE_mac_inst[module_idP].num_sf_allocation_pattern,mbsfn_period,mcch_period,
|
||||
mch_scheduling_period,UE_mac_inst[module_idP].mbsfn_SubframeConfig[j]->radioframeAllocationOffset);
|
||||
@@ -1054,7 +1054,7 @@ unsigned char generate_ulsch_header(uint8_t *mac_header,
|
||||
last_size=1;
|
||||
*((POWER_HEADROOM_CMD *)ce_ptr)=(*power_headroom);
|
||||
ce_ptr+=sizeof(POWER_HEADROOM_CMD);
|
||||
LOG_D(MAC, "phr header size %d\n",sizeof(POWER_HEADROOM_CMD));
|
||||
LOG_D(MAC, "phr header size %zu\n",sizeof(POWER_HEADROOM_CMD));
|
||||
}
|
||||
|
||||
if (crnti) {
|
||||
@@ -1250,7 +1250,7 @@ unsigned char generate_ulsch_header(uint8_t *mac_header,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_T(MAC," [UE %d] header : ", crnti);
|
||||
LOG_T(MAC," [UE] header : ");
|
||||
|
||||
for (i=0; i<((unsigned char*)mac_header_ptr - mac_header); i++) {
|
||||
LOG_T(MAC,"%2x.",mac_header[i]);
|
||||
@@ -1887,8 +1887,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
|
||||
ulsch_buffer[payload_offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
}
|
||||
}
|
||||
LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n",
|
||||
module_idP,payload_offset, sdu_length_total);
|
||||
LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n", module_idP);
|
||||
UE_mac_inst[module_idP].scheduling_info.SR_pending=0;
|
||||
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0;
|
||||
|
||||
@@ -1901,7 +1900,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
|
||||
// Reset ReTx BSR Timer
|
||||
UE_mac_inst[module_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer);
|
||||
|
||||
LOG_D(MAC,"[UE %d] MAC ReTx BSR Timer Reset =%d\n",
|
||||
LOG_D(MAC,"[UE %d] MAC ReTx BSR Timer Reset =%d\n", module_idP,
|
||||
UE_mac_inst[module_idP].scheduling_info.retxBSR_SF);
|
||||
|
||||
// Reset Periodic Timer except when BSR is truncated
|
||||
@@ -1910,7 +1909,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
|
||||
UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer);
|
||||
|
||||
LOG_D(MAC,"[UE %d] MAC Periodic BSR Timer Reset =%d\n",
|
||||
UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF);
|
||||
module_idP, UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF);
|
||||
|
||||
}
|
||||
|
||||
@@ -1923,7 +1922,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
|
||||
|
||||
if (opt_enabled) {
|
||||
trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, 0, 0);
|
||||
LOG_D(OPT,"[UE %d][ULSCH] Frame %d trace pdu for rnti %x with size %d\n",
|
||||
LOG_D(OPT,"[UE %d][ULSCH] Frame %d subframe %d trace pdu for rnti %x with size %d\n",
|
||||
module_idP, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, UE_mac_inst[module_idP].crnti, buflen);
|
||||
}
|
||||
}
|
||||
@@ -2065,7 +2064,7 @@ ue_scheduler(
|
||||
//return(RRC_OK);
|
||||
}
|
||||
|
||||
LOG_I(MAC,"Frame %d: Contention resolution timer %d/%d\n",txFrameP,UE_mac_inst[module_idP].RA_contention_resolution_cnt,
|
||||
LOG_I(MAC,"Frame %d: Contention resolution timer %d/%ld\n",txFrameP,UE_mac_inst[module_idP].RA_contention_resolution_cnt,
|
||||
((1+rach_ConfigCommon->ra_SupervisionInfo.mac_ContentionResolutionTimer)<<3));
|
||||
|
||||
UE_mac_inst[module_idP].RA_contention_resolution_cnt++;
|
||||
|
||||
@@ -257,7 +257,7 @@ boolean_t pdcp_data_req(
|
||||
* Validate incoming sequence number, there might be a problem with PDCP initialization
|
||||
*/
|
||||
if (current_sn > pdcp_calculate_max_seq_num_for_given_size(pdcp_p->seq_num_size)) {
|
||||
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" Generated sequence number (%lu) is greater than a sequence number could ever be!\n"\
|
||||
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" Generated sequence number (%"PRIu16") is greater than a sequence number could ever be!\n"\
|
||||
"There must be a problem with PDCP initialization, ignoring this PDU...\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
|
||||
current_sn);
|
||||
@@ -836,7 +836,7 @@ pdcp_data_ind(
|
||||
|
||||
/* Print octets of incoming data in hexadecimal form */
|
||||
LOG_D(PDCP, "Following content has been received from RLC (%d,%d)(PDCP header has already been removed):\n",
|
||||
sdu_buffer_sizeP - payload_offset + sizeof(pdcp_data_ind_header_t),
|
||||
sdu_buffer_sizeP - payload_offset + (int)sizeof(pdcp_data_ind_header_t),
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//util_print_hex_octets(PDCP, &new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], sdu_buffer_sizeP - payload_offset);
|
||||
//util_flush_hex_octets(PDCP, &new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], sdu_buffer_sizeP - payload_offset);
|
||||
@@ -1214,7 +1214,7 @@ rrc_pdcp_config_asn1_req (
|
||||
}
|
||||
|
||||
if (lc_id == 1 || lc_id == 2) {
|
||||
LOG_E(RLC, PROTOCOL_CTXT_FMT" logicalChannelIdentity = %d is invalid in RRC message when adding DRB!\n", PROTOCOL_CTXT_ARGS(ctxt_pP), lc_id);
|
||||
LOG_E(RLC, PROTOCOL_CTXT_FMT" logicalChannelIdentity = %ld is invalid in RRC message when adding DRB!\n", PROTOCOL_CTXT_ARGS(ctxt_pP), lc_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1312,7 +1312,7 @@ rrc_pdcp_config_asn1_req (
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_W(PDCP,"[MOD_id %u/%u][RB %u] unknown drb_toaddmod->PDCP_Config->headerCompression->present \n",
|
||||
LOG_W(PDCP,PROTOCOL_PDCP_CTXT_FMT"[RB %ld] unknown drb_toaddmod->PDCP_Config->headerCompression->present \n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p), drb_id);
|
||||
break;
|
||||
}
|
||||
@@ -1345,7 +1345,7 @@ rrc_pdcp_config_asn1_req (
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
|
||||
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_E(PDCP, PROTOCOL_CTXT_FMT" PDCP REMOVE FAILED drb_id %u\n",
|
||||
LOG_E(PDCP, PROTOCOL_CTXT_FMT" PDCP REMOVE FAILED drb_id %ld\n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
drb_id);
|
||||
continue;
|
||||
@@ -1749,7 +1749,7 @@ rrc_pdcp_config_req (
|
||||
pdcp_p->cipheringAlgorithm,
|
||||
pdcp_p->integrityProtAlgorithm );
|
||||
} else {
|
||||
LOG_W(PDCP,"[%s %d] bad security mode %d", security_modeP);
|
||||
LOG_W(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d", PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p), security_modeP);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -62,7 +62,7 @@ void util_print_hex_octets(comp_name_t component, unsigned char* data, unsigned
|
||||
*/
|
||||
if (octet_index != 0 && (octet_index + 1) % 16 == 0) {
|
||||
LOG_T(component, " |\n");
|
||||
LOG_T(component, " %03d |", octet_index);
|
||||
LOG_T(component, " %03lu |", octet_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ void config_req_rlc_am_asn1 (
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
|
||||
|
||||
LOG_D(RLC,
|
||||
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d), RLC-AM NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
|
||||
config_am_pP->ul_AM_RLC.maxRetxThreshold,
|
||||
config_am_pP->ul_AM_RLC.pollPDU,
|
||||
@@ -523,7 +523,7 @@ rlc_am_rx (
|
||||
switch (rlc->protocol_state) {
|
||||
|
||||
case RLC_NULL_STATE:
|
||||
LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", arg_pP);
|
||||
LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP, rlc));
|
||||
list_free (&data_indP.data);
|
||||
break;
|
||||
|
||||
@@ -532,7 +532,7 @@ rlc_am_rx (
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE 0x%02X\n", rlc, rlc->protocol_state);
|
||||
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE 0x%02X\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP, rlc), rlc->protocol_state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,6 +557,15 @@ rlc_am_mac_status_indication (
|
||||
status_resp.head_sdu_is_segmented = 0;
|
||||
status_resp.rlc_info.rlc_protocol_state = rlc->protocol_state;
|
||||
|
||||
/* TODO: remove this hack. Problem is: there is a race.
|
||||
* UE comes. SRB2 is configured via message to RRC.
|
||||
* At some point the RLC AM is created but not configured yet.
|
||||
* At this moment (I think) MAC calls mac_rlc_status_ind
|
||||
* which calls this function. But the init was not finished yet
|
||||
* and we have a crash below when testing mem_block != NULL.
|
||||
*/
|
||||
if (rlc->input_sdus == NULL) return status_resp;
|
||||
|
||||
if (rlc->last_frame_status_indication != ctxt_pP->frame) {
|
||||
rlc_am_check_timer_poll_retransmit(ctxt_pP, rlc);
|
||||
rlc_am_check_timer_reordering(ctxt_pP, rlc);
|
||||
|
||||
@@ -54,11 +54,11 @@ rlc_am_init(
|
||||
// rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
|
||||
rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(
|
||||
rlc_am_tx_data_pdu_management_t)));
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] input_sdus[] = %p element size=%d\n",
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] input_sdus[] = %p element size=%zu\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->input_sdus,
|
||||
sizeof(rlc_am_tx_sdu_management_t));
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] pdu_retrans_buffer[] = %p element size=%d\n",
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] pdu_retrans_buffer[] = %p element size=%zu\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->pdu_retrans_buffer,
|
||||
sizeof(rlc_am_tx_data_pdu_management_t));
|
||||
|
||||
@@ -646,7 +646,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
|
||||
// fill the segment pdu_p with Lis and data
|
||||
//---------------------------------------------------------------
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] fill the segment pdu_p with Lis and data, test_num_li %d\n",
|
||||
test_num_li);
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), test_num_li);
|
||||
|
||||
if (test_num_li > 0) {
|
||||
pdu_sub_segment_p->b1 = pdu_sub_segment_p->b1 | 0x04; // set E bit
|
||||
@@ -678,12 +678,12 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
|
||||
*sizeP = *sizeP - 1;
|
||||
}
|
||||
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RB %u][RE-SEGMENT] ADD LI %d\n",
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ADD LI %d\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
test_li_list[fill_num_li]);
|
||||
}
|
||||
} else {
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RB %u][RE-SEGMENT] ADD NO LI\n",
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ADD NO LI\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
fill_payload_p = (uint8_t*)e_li_sub_segment;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ rlc_am_rx_list_insert_pdu(
|
||||
if (pdu_info_previous_cursor_p->sn == pdu_info_p->sn) {
|
||||
if (pdu_info_p->rf != pdu_info_previous_cursor_p->rf) {
|
||||
LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d WRONG RF -> DROPPED (vr(mr) < vr(r) and sn >= vr(r))\n",
|
||||
ctxt_pP->frame,
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
__LINE__,
|
||||
pdu_info_p->sn);
|
||||
|
||||
@@ -150,7 +150,7 @@ void config_req_rlc_um_asn1 (
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID UL sn_FieldLength %d, RLC NOT CONFIGURED\n",
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID UL sn_FieldLength %ld, RLC NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
ul_rlc_pP->sn_FieldLength);
|
||||
@@ -178,7 +178,7 @@ void config_req_rlc_um_asn1 (
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID DL sn_FieldLength %d, RLC NOT CONFIGURED\n",
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID DL sn_FieldLength %ld, RLC NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
dl_rlc_pP->sn_FieldLength);
|
||||
@@ -197,7 +197,7 @@ void config_req_rlc_um_asn1 (
|
||||
if (dl_rlc_pP->t_Reordering<T_Reordering_spare1) {
|
||||
t_Reordering = t_Reordering_tab[dl_rlc_pP->t_Reordering];
|
||||
} else {
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID T_Reordering %d, RLC NOT CONFIGURED\n",
|
||||
LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID T_Reordering %ld, RLC NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
dl_rlc_pP->t_Reordering);
|
||||
|
||||
@@ -579,7 +579,7 @@ rlc_um_try_reassembly(
|
||||
rlc_pP->stat_rx_data_bytes_dropped += tb_ind_p->size;
|
||||
rlc_pP->reassembly_missing_sn_detected = 1;
|
||||
|
||||
LOG_W(RLC, "[SN %d] Bad RLC header! Discard this RLC PDU\n", sn, size);
|
||||
LOG_W(RLC, "[SN %d] Bad RLC header! Discard this RLC PDU (size=%d)\n", sn, size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,7 +664,7 @@ rlc_um_start_timer_reordering(
|
||||
rlc_pP->t_reordering.ms_time_out);
|
||||
#endif
|
||||
} else {
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
|
||||
LOG_T(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ rlc_um_display_rx_window(
|
||||
LOG_T(RLC, "\n");
|
||||
}
|
||||
|
||||
LOG_T(RLC, "%s%s| %04d |", RLC_FG_COLOR_DEFAULT, RLC_NORMAL_VIDEO, sn);
|
||||
LOG_T(RLC, "%s%s| %04lu |", RLC_FG_COLOR_DEFAULT, RLC_NORMAL_VIDEO, sn);
|
||||
}
|
||||
|
||||
strcpy(color, RLC_FG_COLOR_DEFAULT);
|
||||
|
||||
@@ -71,7 +71,7 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, con
|
||||
LOG_T(componentP, " |\n");
|
||||
}
|
||||
|
||||
LOG_T(componentP, " %04d |", octet_index);
|
||||
LOG_T(componentP, " %04lu |", octet_index);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -99,7 +99,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
rb_id = srb2add_listP->list.array[cnt]->srb_Identity;
|
||||
lc_id = rb_id;
|
||||
|
||||
LOG_D(RLC, "Adding SRB %d, rb_id %d\n",srb2add_listP->list.array[cnt]->srb_Identity,rb_id);
|
||||
LOG_D(RLC, "Adding SRB %ld, rb_id %d\n",srb2add_listP->list.array[cnt]->srb_Identity,rb_id);
|
||||
srb_toaddmod_p = srb2add_listP->list.array[cnt];
|
||||
|
||||
if (srb_toaddmod_p->rlc_Config) {
|
||||
@@ -259,7 +259,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_D(RLC, "Adding DRB %d, lc_id %d\n",drb_id,lc_id);
|
||||
LOG_D(RLC, "Adding DRB %ld, lc_id %d\n",drb_id,lc_id);
|
||||
|
||||
|
||||
if (drb_toaddmod_p->rlc_Config) {
|
||||
@@ -325,7 +325,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_W(RLC, PROTOCOL_CTXT_FMT"[RB %u] unknown drb_toaddmod_p->rlc_Config->present \n",
|
||||
LOG_W(RLC, PROTOCOL_CTXT_FMT"[RB %ld] unknown drb_toaddmod_p->rlc_Config->present \n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
drb_id);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ int errno;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define XER_PRINT
|
||||
//#define XER_PRINT
|
||||
|
||||
extern Enb_properties_array_t enb_properties;
|
||||
typedef struct xer_sprint_string_s {
|
||||
|
||||
@@ -102,6 +102,14 @@
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
/* TODO: be sure this include is correct.
|
||||
* It solves a problem of compilation of the RRH GW,
|
||||
* issue #186.
|
||||
*/
|
||||
#if !defined(ENABLE_ITTI)
|
||||
# include "as_message.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# include "commonDef.h"
|
||||
#endif
|
||||
|
||||
+59
-45
@@ -545,7 +545,7 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* co
|
||||
#endif
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
|
||||
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%d bytes)\n",ctxt_pP->module_id,dec_rval.consumed);
|
||||
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH, VCD_FUNCTION_OUT);
|
||||
return -1;
|
||||
}
|
||||
@@ -799,15 +799,15 @@ rrc_ue_process_measConfig(
|
||||
ind = measConfig->measObjectToAddModList->list.array[i]->measObjectId;
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index][ind-1]) {
|
||||
LOG_D(RRC,"Modifying measurement object %d\n",ind);
|
||||
LOG_D(RRC,"Modifying measurement object %ld\n",ind);
|
||||
memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index][ind-1],
|
||||
(char*)measObj,
|
||||
sizeof(MeasObjectToAddMod_t));
|
||||
} else {
|
||||
LOG_I(RRC,"Adding measurement object %d\n",ind);
|
||||
LOG_I(RRC,"Adding measurement object %ld\n",ind);
|
||||
|
||||
if (measObj->measObject.present == MeasObjectToAddMod__measObject_PR_measObjectEUTRA) {
|
||||
LOG_I(RRC,"EUTRA Measurement : carrierFreq %d, allowedMeasBandwidth %d,presenceAntennaPort1 %d, neighCellConfig %d\n",
|
||||
LOG_I(RRC,"EUTRA Measurement : carrierFreq %ld, allowedMeasBandwidth %ld,presenceAntennaPort1 %d, neighCellConfig %d\n",
|
||||
measObj->measObject.choice.measObjectEUTRA.carrierFreq,
|
||||
measObj->measObject.choice.measObjectEUTRA.allowedMeasBandwidth,
|
||||
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
|
||||
@@ -866,12 +866,12 @@ rrc_ue_process_measConfig(
|
||||
ind = measConfig->reportConfigToAddModList->list.array[i]->reportConfigId;
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[eNB_index][ind-1]) {
|
||||
LOG_I(RRC,"Modifying Report Configuration %d\n",ind-1);
|
||||
LOG_I(RRC,"Modifying Report Configuration %ld\n",ind-1);
|
||||
memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].ReportConfig[eNB_index][ind-1],
|
||||
(char*)measConfig->reportConfigToAddModList->list.array[i],
|
||||
sizeof(ReportConfigToAddMod_t));
|
||||
} else {
|
||||
LOG_D(RRC,"Adding Report Configuration %d %p \n",ind-1,measConfig->reportConfigToAddModList->list.array[i]);
|
||||
LOG_D(RRC,"Adding Report Configuration %ld %p \n",ind-1,measConfig->reportConfigToAddModList->list.array[i]);
|
||||
UE_rrc_inst[ctxt_pP->module_id].ReportConfig[eNB_index][ind-1] = measConfig->reportConfigToAddModList->list.array[i];
|
||||
}
|
||||
}
|
||||
@@ -901,12 +901,12 @@ rrc_ue_process_measConfig(
|
||||
ind = measConfig->measIdToAddModList->list.array[i]->measId;
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].MeasId[eNB_index][ind-1]) {
|
||||
LOG_D(RRC,"Modifying Measurement ID %d\n",ind-1);
|
||||
LOG_D(RRC,"Modifying Measurement ID %ld\n",ind-1);
|
||||
memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].MeasId[eNB_index][ind-1],
|
||||
(char*)measConfig->measIdToAddModList->list.array[i],
|
||||
sizeof(MeasIdToAddMod_t));
|
||||
} else {
|
||||
LOG_D(RRC,"Adding Measurement ID %d %p\n",ind-1,measConfig->measIdToAddModList->list.array[i]);
|
||||
LOG_D(RRC,"Adding Measurement ID %ld %p\n",ind-1,measConfig->measIdToAddModList->list.array[i]);
|
||||
UE_rrc_inst[ctxt_pP->module_id].MeasId[eNB_index][ind-1] = measConfig->measIdToAddModList->list.array[i];
|
||||
}
|
||||
}
|
||||
@@ -938,13 +938,11 @@ rrc_ue_process_measConfig(
|
||||
UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq = 1./pow(2,
|
||||
(*UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRQ)/4);
|
||||
|
||||
LOG_I(RRC,"[UE %d] set rsrp-coeff for eNB %d: %d rsrq-coeff: %d rsrp_factor: %f rsrq_factor: %f \n",
|
||||
LOG_I(RRC,"[UE %d] set rsrp-coeff for eNB %d: %ld rsrq-coeff: %ld rsrp_factor: %f rsrq_factor: %f \n",
|
||||
ctxt_pP->module_id, eNB_index, // UE_rrc_inst[ue_mod_idP].Info[eNB_index].UE_index,
|
||||
*UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRP,
|
||||
*UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRQ,
|
||||
UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp,
|
||||
UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp,
|
||||
UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp,
|
||||
UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq);
|
||||
}
|
||||
|
||||
@@ -1467,7 +1465,7 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id] = radioResourceConfigDedicated->drb_ToAddModList->list.array[i];
|
||||
rrc_ue_establish_drb(ctxt_pP->module_id,ctxt_pP->frame,eNB_index,radioResourceConfigDedicated->drb_ToAddModList->list.array[i]);
|
||||
// MAC/PHY Configuration
|
||||
LOG_I(RRC, "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (DRB %d eNB %d) --->][MAC_UE][MOD %02d][]\n",
|
||||
LOG_I(RRC, "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (DRB %ld eNB %d) --->][MAC_UE][MOD %02d][]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id,
|
||||
radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity,
|
||||
eNB_index,
|
||||
@@ -1619,7 +1617,7 @@ rrc_ue_process_securityModeCommand(
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**) &pdcp_p);
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
LOG_D(RRC, "PDCP_COLL_KEY_VALUE() returns valid key = %d\n", key);
|
||||
LOG_D(RRC, "PDCP_COLL_KEY_VALUE() returns valid key = %ld\n", key);
|
||||
|
||||
LOG_D(RRC, "driving kRRCenc, kRRCint and kUPenc from KeNB="
|
||||
"%02x%02x%02x%02x"
|
||||
@@ -1656,7 +1654,7 @@ rrc_ue_process_securityModeCommand(
|
||||
securityMode);
|
||||
}
|
||||
} else {
|
||||
LOG_W(RRC, "Could not get PDCP instance where key=0x%\n", key);
|
||||
LOG_W(RRC, "Could not get PDCP instance where key=0x%ld\n", key);
|
||||
}
|
||||
|
||||
#endif //#if defined(ENABLE_SECURITY)
|
||||
@@ -1702,7 +1700,7 @@ rrc_ue_process_securityModeCommand(
|
||||
#endif
|
||||
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC, "securityModeComplete Encoded %d bits (%d bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||
LOG_D(RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
@@ -1807,7 +1805,7 @@ rrc_ue_process_ueCapabilityEnquiry(
|
||||
#endif
|
||||
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC,"UECapabilityInformation Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
LOG_D(RRC,"UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
@@ -2218,7 +2216,7 @@ rrc_ue_decode_dcch(
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId
|
||||
!= dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId) {
|
||||
LOG_W(RRC,
|
||||
"[UE %d] Frame %d: Handover target (%d) is different from RSRP measured target (%d)..\n",
|
||||
"[UE %d] Frame %d: Handover target (%ld) is different from RSRP measured target (%ld)..\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId,
|
||||
@@ -3134,7 +3132,8 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 )
|
||||
LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission : %d\n",
|
||||
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission );
|
||||
LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts : %ld\n",
|
||||
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts );
|
||||
/* TODO: check that it's okay to access [0] */
|
||||
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts[0] );
|
||||
}
|
||||
|
||||
// uplinkPowerControlCommon
|
||||
@@ -3378,7 +3377,7 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
else if (arfcn <45590) // Band 43
|
||||
return((uint64_t)3600000000 + ((arfcn-43950)*100000));
|
||||
else {
|
||||
LOG_E(RRC,"Unknown EARFCN %d\n",arfcn);
|
||||
LOG_E(RRC,"Unknown EARFCN %ld\n",arfcn);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -3393,19 +3392,20 @@ static void dump_sib5( SystemInformationBlockType5_t *sib5 )
|
||||
for (i=0;i<interFreqCarrierFreqList.list.count;i++) {
|
||||
LOG_I(RRC, "SIB5 InterFreqCarrierFreq element %d/%d\n",i,interFreqCarrierFreqList.list.count);
|
||||
ifcfInfo = interFreqCarrierFreqList.list.array[i];
|
||||
LOG_I(RRC, " DL Carrier Frequency/ARFCN : %ld/%d\n",
|
||||
LOG_I(RRC, " DL Carrier Frequency/ARFCN : %ld/%ld\n",
|
||||
arfcn_to_freq(ifcfInfo->dl_CarrierFreq),
|
||||
ifcfInfo->dl_CarrierFreq);
|
||||
LOG_I(RRC," Q_RXLevMin : %d\n", ifcfInfo->q_RxLevMin);
|
||||
LOG_I(RRC," P_max : %d\n",ifcfInfo->p_Max);
|
||||
LOG_I(RRC," T_ReselectionEUTRA : %d\n",ifcfInfo->t_ReselectionEUTRA);
|
||||
LOG_I(RRC," Q_RXLevMin : %ld\n", ifcfInfo->q_RxLevMin);
|
||||
if (ifcfInfo->p_Max != NULL)
|
||||
LOG_I(RRC," P_max : %ld\n", *ifcfInfo->p_Max);
|
||||
LOG_I(RRC," T_ReselectionEUTRA : %ld\n",ifcfInfo->t_ReselectionEUTRA);
|
||||
if (ifcfInfo->t_ReselectionEUTRA_SF) {
|
||||
LOG_I(RRC," t_ReselectionEUTRA_SF.sf_Medium %d, t_ReselectionEUTRA_SF.sf_High %d",
|
||||
LOG_I(RRC," t_ReselectionEUTRA_SF.sf_Medium %ld, t_ReselectionEUTRA_SF.sf_High %ld",
|
||||
ifcfInfo->t_ReselectionEUTRA_SF->sf_Medium,
|
||||
ifcfInfo->t_ReselectionEUTRA_SF->sf_High);
|
||||
}
|
||||
LOG_I(RRC," threshX_High : %d\n",ifcfInfo->threshX_High);
|
||||
LOG_I(RRC," threshX_Low : %d\n",ifcfInfo->threshX_Low);
|
||||
LOG_I(RRC," threshX_High : %ld\n",ifcfInfo->threshX_High);
|
||||
LOG_I(RRC," threshX_Low : %ld\n",ifcfInfo->threshX_Low);
|
||||
switch(ifcfInfo->allowedMeasBandwidth) {
|
||||
case AllowedMeasBandwidth_mbw6:
|
||||
LOG_I(RRC," AllowedMeasBandwidth : 6\n");
|
||||
@@ -3431,7 +3431,7 @@ static void dump_sib5( SystemInformationBlockType5_t *sib5 )
|
||||
else
|
||||
LOG_I(RRC," PresenceAntennaPort1 : False\n");
|
||||
if (ifcfInfo->cellReselectionPriority) {
|
||||
LOG_I(RRC," CellReselectionPriority : %d\n",
|
||||
LOG_I(RRC," CellReselectionPriority : %ld\n",
|
||||
*ifcfInfo->cellReselectionPriority);
|
||||
}
|
||||
LOG_I(RRC," NeighCellConfig : ");
|
||||
@@ -3444,29 +3444,29 @@ static void dump_sib5( SystemInformationBlockType5_t *sib5 )
|
||||
if (ifcfInfo->interFreqNeighCellList) {
|
||||
|
||||
for (j=0;j<ifcfInfo->interFreqNeighCellList->list.count;j++) {
|
||||
LOG_I(RRC," Cell %d\n");
|
||||
LOG_I(RRC," PhysCellId : %d\n",ifcfInfo->interFreqNeighCellList->list.array[j]->physCellId);
|
||||
LOG_I(RRC," Q_OffsetRange : %d\n",ifcfInfo->interFreqNeighCellList->list.array[j]->q_OffsetCell);
|
||||
LOG_I(RRC," Cell %d\n", j);
|
||||
LOG_I(RRC," PhysCellId : %ld\n",ifcfInfo->interFreqNeighCellList->list.array[j]->physCellId);
|
||||
LOG_I(RRC," Q_OffsetRange : %ld\n",ifcfInfo->interFreqNeighCellList->list.array[j]->q_OffsetCell);
|
||||
|
||||
}
|
||||
}
|
||||
if (ifcfInfo->interFreqBlackCellList) {
|
||||
|
||||
for (j=0;j<ifcfInfo->interFreqBlackCellList->list.count;j++) {
|
||||
LOG_I(RRC," Cell %d\n");
|
||||
LOG_I(RRC," PhysCellId start: %d\n",ifcfInfo->interFreqBlackCellList->list.array[j]->start);
|
||||
LOG_I(RRC," Cell %d\n", j);
|
||||
LOG_I(RRC," PhysCellId start: %ld\n",ifcfInfo->interFreqBlackCellList->list.array[j]->start);
|
||||
if (ifcfInfo->interFreqBlackCellList->list.array[i]->range) {
|
||||
LOG_I(RRC," PhysCellId Range : %d\n",ifcfInfo->interFreqBlackCellList->list.array[j]->range);
|
||||
LOG_I(RRC," PhysCellId Range : %ld\n",*ifcfInfo->interFreqBlackCellList->list.array[j]->range);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef Rel10
|
||||
if (ifcfInfo->ext1 && ifcfInfo->ext1->q_QualMin_r9)
|
||||
LOG_I(RRC," Q_QualMin_r9 : %d\n",*ifcfInfo->ext1->q_QualMin_r9);
|
||||
LOG_I(RRC," Q_QualMin_r9 : %ld\n",*ifcfInfo->ext1->q_QualMin_r9);
|
||||
|
||||
if (ifcfInfo->ext1 && ifcfInfo->ext1->threshX_Q_r9) {
|
||||
LOG_I(RRC," threshX_HighQ_r9 : %d\n",ifcfInfo->ext1->threshX_Q_r9->threshX_HighQ_r9);
|
||||
LOG_I(RRC," threshX_LowQ_r9: %d\n",ifcfInfo->ext1->threshX_Q_r9->threshX_LowQ_r9);
|
||||
LOG_I(RRC," threshX_HighQ_r9 : %ld\n",ifcfInfo->ext1->threshX_Q_r9->threshX_HighQ_r9);
|
||||
LOG_I(RRC," threshX_LowQ_r9: %ld\n",ifcfInfo->ext1->threshX_Q_r9->threshX_LowQ_r9);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3786,7 +3786,7 @@ void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
|
||||
ctxt_pP->frame,
|
||||
10*log10(mac_xface->get_RSSI(ctxt_pP->module_id,0))-mac_xface->get_rx_total_gain_dB(ctxt_pP->module_id,0),
|
||||
10*log10(mac_xface->get_RSSI(ctxt_pP->module_id,0)));
|
||||
LOG_D(RRC,"[UE %d] Frame %d: Meas RSRP: eNB_offset: %d rsrp_coef: %3.1f filter_coef: %d before L3 filtering: rsrp: %3.1f after L3 filtering: rsrp: %3.1f \n ",
|
||||
LOG_D(RRC,"[UE %d] Frame %d: Meas RSRP: eNB_offset: %d rsrp_coef: %3.1f filter_coef: %ld before L3 filtering: rsrp: %3.1f after L3 filtering: rsrp: %3.1f \n ",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame, eNB_offset,a,
|
||||
*UE_rrc_inst->QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP,
|
||||
@@ -3886,7 +3886,7 @@ static void rrc_ue_generate_MeasurementReport(protocol_ctxt_t* const ctxt_pP, ui
|
||||
|
||||
if (pframe!=ctxt_pP->frame) {
|
||||
pframe=ctxt_pP->frame;
|
||||
LOG_D(RRC, "[UE %d] Frame %d: doing MeasReport: servingCell(%d) targetCell(%d) rsrp_s(%ld) rsrq_s(%ld) rsrp_t(%ld) rsrq_t(%ld) \n",
|
||||
LOG_D(RRC, "[UE %d] Frame %d: doing MeasReport: servingCell(%ld) targetCell(%ld) rsrp_s(%ld) rsrq_s(%ld) rsrp_t(%ld) rsrq_t(%ld) \n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
cellId,
|
||||
@@ -4041,7 +4041,7 @@ static uint8_t check_trigger_meas_event(
|
||||
uint8_t currentCellIndex = mac_xface->frame_parms->Nid_cell;
|
||||
uint8_t tmp_offset;
|
||||
|
||||
LOG_I(RRC,"[UE %d] ofn(%d) ocn(%d) hys(%d) ofs(%d) ocs(%d) a3_offset(%d) ttt(%d) rssi %3.1f\n",
|
||||
LOG_I(RRC,"[UE %d] ofn(%ld) ocn(%ld) hys(%ld) ofs(%ld) ocs(%ld) a3_offset(%ld) ttt(%ld) rssi %3.1f\n",
|
||||
ue_mod_idP,
|
||||
ofn,ocn,hys,ofs,ocs,a3_offset,ttt,
|
||||
10*log10(mac_xface->get_RSSI(ue_mod_idP,0))-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0));
|
||||
@@ -4068,7 +4068,7 @@ static uint8_t check_trigger_meas_event(
|
||||
|
||||
if (UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] >= ttt) {
|
||||
UE_rrc_inst->HandoverInfoUe.targetCellId = get_adjacent_cell_id(ue_mod_idP,tmp_offset); //WARNING!!!...check this!
|
||||
LOG_D(RRC,"[UE %d] Frame %d eNB %d: Handover triggered: targetCellId: %d currentCellId: %d eNB_offset: %d rsrp source: %3.1f rsrp target: %3.1f\n", \
|
||||
LOG_D(RRC,"[UE %d] Frame %d eNB %d: Handover triggered: targetCellId: %ld currentCellId: %d eNB_offset: %d rsrp source: %3.1f rsrp target: %3.1f\n", \
|
||||
ue_mod_idP, frameP, eNB_index,
|
||||
UE_rrc_inst->HandoverInfoUe.targetCellId,ue_cnx_index,eNB_offset,
|
||||
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[0])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->frame_parms->N_RB_DL*12),
|
||||
@@ -4112,7 +4112,7 @@ int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB
|
||||
Sdu_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
|
||||
LOG_E(RRC,"[UE %d] Failed to decode MCCH__MESSAGE (%d bits)\n",
|
||||
LOG_E(RRC,"[UE %d] Failed to decode MCCH__MESSAGE (%lu bits)\n",
|
||||
ctxt_pP->module_id,
|
||||
dec_rval.consumed);
|
||||
//free the memory
|
||||
@@ -4393,8 +4393,14 @@ void *rrc_ue_task( void *args_p )
|
||||
case NAS_CELL_SELECTION_REQ:
|
||||
ue_mod_id = 0; /* TODO force ue_mod_id to first UE, NAS UE not virtualized yet */
|
||||
|
||||
LOG_D(RRC, "[UE %d] Received %s: state %d, plmnID %d, rat %x\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id),
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID, NAS_CELL_SELECTION_REQ (msg_p).rat);
|
||||
LOG_D(RRC, "[UE %d] Received %s: state %d, plmnID (%d%d%d.%d%d%d), rat %x\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id),
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MCCdigit1,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MCCdigit2,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MCCdigit3,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MNCdigit1,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MNCdigit2,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).plmnID.MNCdigit3,
|
||||
NAS_CELL_SELECTION_REQ (msg_p).rat);
|
||||
|
||||
if (rrc_get_state(ue_mod_id) == RRC_STATE_INACTIVE) {
|
||||
// have a look at MAC/main.c void dl_phy_sync_success(...)
|
||||
@@ -4457,8 +4463,16 @@ void *rrc_ue_task( void *args_p )
|
||||
break;
|
||||
|
||||
case NAS_CONN_ESTABLI_REQ:
|
||||
LOG_D(RRC, "[UE %d] Received %s: cause %d, type %d, s_tmsi %d, plmnID %d\n", ue_mod_id, msg_name, NAS_CONN_ESTABLI_REQ (msg_p).cause,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).type, NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi, NAS_CONN_ESTABLI_REQ (msg_p).plmnID);
|
||||
LOG_D(RRC, "[UE %d] Received %s: cause %d, type %d, s_tmsi (mme code %"PRIu8", m-tmsi %"PRIu32"), plmnID (%d%d%d.%d%d%d)\n", ue_mod_id, msg_name, NAS_CONN_ESTABLI_REQ (msg_p).cause,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).type,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.MMEcode,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.m_tmsi,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit1,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit2,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit3,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit1,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit2,
|
||||
NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit3);
|
||||
|
||||
//PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, 0, 0);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, NOT_A_RNTI, 0, 0, 0);
|
||||
|
||||
@@ -484,7 +484,8 @@ rrc_rx_tx(
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt == 0) {
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active = 0;
|
||||
UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.measFlag = 1;
|
||||
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n");
|
||||
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n",
|
||||
ctxt_pP->module_id);
|
||||
//Implement 36.331, section 5.3.5.6 here
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
|
||||
return(RRC_Handover_failed);
|
||||
|
||||
+34
-31
@@ -96,7 +96,7 @@
|
||||
#if defined(FLEXRAN_AGENT_SB_IF)
|
||||
#include "flexran_agent_extern.h"
|
||||
#endif
|
||||
#define XER_PRINT
|
||||
//#define XER_PRINT
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
extern EMULATION_VARS *Emul_vars;
|
||||
@@ -304,14 +304,14 @@ init_SI(
|
||||
|
||||
// SIB13
|
||||
for (i = 0; i < eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.count; i++) {
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" SIB13 contents for MBSFN sync area %d/2 (partial)\n",
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" SIB13 contents for MBSFN sync area %d/%d (partial)\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
|
||||
i,
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.count);
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Repetition Period: %d (just index number, not real value)\n",
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Repetition Period: %ld (just index number, not real value)\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Offset: %d\n",
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Offset: %ld\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_Offset_r9);
|
||||
}
|
||||
@@ -394,7 +394,7 @@ init_MCCH(
|
||||
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].MCCH_MESSAGE[sync_area],
|
||||
sync_area);
|
||||
LOG_D(RRC, "[eNB %d] MCCH_MESSAGE contents for Sync Area %d (partial)\n", enb_mod_idP, sync_area);
|
||||
LOG_D(RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %d\n", enb_mod_idP,
|
||||
LOG_D(RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %ld\n", enb_mod_idP,
|
||||
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].mcch_message->commonSF_AllocPeriod_r9);
|
||||
LOG_D(RRC,
|
||||
"[eNB %d] CommonSF_Alloc_r9.list.count (number of MBSFN Subframe Pattern) %d\n",
|
||||
@@ -598,7 +598,7 @@ rrc_eNB_get_next_free_ue_context(
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
|
||||
if (ue_context_p->ue_context.random_ue_identity == ue_identityP) {
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, already exist rand UE id 0x%x, uid %u\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, already exist rand UE id 0x%"PRIx64", uid %u\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_identityP,
|
||||
ue_context_p->local_uid);
|
||||
@@ -690,7 +690,7 @@ rrc_eNB_free_mem_UE_context(
|
||||
{
|
||||
int i;
|
||||
LOG_T(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%x (free internal structs)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%p (free internal structs)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_pP);
|
||||
#ifdef Rel10
|
||||
@@ -1310,7 +1310,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
|
||||
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
|
||||
//ue_context_pP->ue_context.DRB_configList2[drb_identity_index] = &(*DRB_configList);
|
||||
|
||||
LOG_I(RRC,"EPS ID %d, DRB ID %d (index %d), QCI %d, priority %d, LCID %d LCGID %d \n",
|
||||
LOG_I(RRC,"EPS ID %ld, DRB ID %ld (index %d), QCI %d, priority %ld, LCID %ld LCGID %ld \n",
|
||||
*DRB_config->eps_BearerIdentity,
|
||||
DRB_config->drb_Identity, i,
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.qci,
|
||||
@@ -1703,7 +1703,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
|
||||
if (*physicalConfigDedicated) {
|
||||
if ((*physicalConfigDedicated)->antennaInfo) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = rrc_inst->configuration.ue_TransmissionMode[0];
|
||||
LOG_D(RRC,"Setting transmission mode to %d+1\n",rrc_inst->configuration.ue_TransmissionMode[0]);
|
||||
LOG_D(RRC,"Setting transmission mode to %ld+1\n",rrc_inst->configuration.ue_TransmissionMode[0]);
|
||||
if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm3) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
|
||||
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
|
||||
@@ -2265,8 +2265,8 @@ rrc_eNB_process_MeasurementReport(
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultPCell.rsrpResult);
|
||||
LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultPCell.rsrqResult);
|
||||
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
|
||||
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
|
||||
#else
|
||||
LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultServCell.rsrpResult);
|
||||
LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultServCell.rsrqResult);
|
||||
@@ -2368,7 +2368,7 @@ rrc_eNB_generate_HandoverPreparationInformation(
|
||||
ue_context_target_p->ue_id_rnti = ue_context_pP->ue_context.rnti; // LG: should not be the same
|
||||
ue_context_target_p->ue_context.rnti = ue_context_target_p->ue_id_rnti; // idem
|
||||
LOG_N(RRC,
|
||||
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %d: source UE_id %x target UE_id %x source_modId: %d target_modId: %d\n",
|
||||
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %ld: source UE_id %x target UE_id %x source_modId: %d target_modId: %d\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[0] /* CROUX TBC */.physCellId,
|
||||
@@ -2395,7 +2395,7 @@ rrc_eNB_generate_HandoverPreparationInformation(
|
||||
ue_context_target_p->ue_context.handover_info->ueid_t = ue_context_target_p->ue_context.rnti;
|
||||
|
||||
} else {
|
||||
LOG_E(RRC, "\nError in obtaining free UE id in target eNB %l for handover \n", targetPhyId);
|
||||
LOG_E(RRC, "\nError in obtaining free UE id in target eNB %ld for handover \n", targetPhyId);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -3160,7 +3160,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
memset((void *)mobilityInfo, 0, sizeof(*mobilityInfo));
|
||||
mobilityInfo->targetPhysCellId =
|
||||
(PhysCellId_t) two_tier_hexagonal_cellIds[ue_context_pP->ue_context.handover_info->modid_t];
|
||||
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: targetPhysCellId: %d mod_id: %d ue: %x \n",
|
||||
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: targetPhysCellId: %ld mod_id: %d ue: %x \n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
mobilityInfo->targetPhysCellId,
|
||||
@@ -3254,7 +3254,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
(void *)rrc_inst->sps_Config[ue_mod_idP],
|
||||
sizeof(SPS_Config_t));
|
||||
*/
|
||||
LOG_I(RRC, "[eNB %d] Frame %d: adding new UE\n");
|
||||
LOG_I(RRC, "[eNB %d] Frame %d: adding new UE\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame);
|
||||
//Idx = (ue_mod_idP * NB_RB_MAX) + DCCH;
|
||||
Idx = DCCH;
|
||||
// SRB1
|
||||
@@ -3549,9 +3550,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
ctxt_pP->frame,
|
||||
ue_context_pP->ue_context.primaryCC_id);
|
||||
} else {
|
||||
LOG_W(RRC,"[eNB %d] Frame %d CC %d : invalide SRB identity %d\n",
|
||||
LOG_W(RRC,"[eNB %d] Frame %d CC %d : invalide SRB identity %ld\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
ue_context_pP->ue_context.primaryCC_id,
|
||||
SRB_configList->list.array[i]->srb_Identity);
|
||||
}
|
||||
}
|
||||
@@ -4189,9 +4191,11 @@ rrc_eNB_decode_ccch(
|
||||
* the current one must be removed from MAC/PHY (zombie UE)
|
||||
*/
|
||||
if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) {
|
||||
//#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
|
||||
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
|
||||
LOG_W(RRC, "new UE rnti %x (coming with random value) is already there as UE %x, removing %x from MAC/PHY\n",
|
||||
ctxt_pP->rnti, ue_context_p->ue_context.rnti, ctxt_pP->rnti);
|
||||
rrc_mac_remove_ue(ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
ue_context_p = NULL;
|
||||
return 0;
|
||||
} else {
|
||||
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value);
|
||||
}
|
||||
@@ -4202,9 +4206,8 @@ rrc_eNB_decode_ccch(
|
||||
m_tmsi_t m_tmsi = BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
|
||||
random_value = (((uint64_t)mme_code) << 32) | m_tmsi;
|
||||
if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
|
||||
|
||||
//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
|
||||
LOG_I(RRC," S-TMSI exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p,ue_context_p->ue_context.rnti,ctxt_pP->rnti);
|
||||
rrc_mac_remove_ue(ctxt_pP->module_id, ue_context_p->ue_context.rnti);
|
||||
stmsi_received=1;
|
||||
/* replace rnti in the context */
|
||||
/* for that, remove the context from the RB tree */
|
||||
@@ -4216,10 +4219,8 @@ rrc_eNB_decode_ccch(
|
||||
/* reset timers */
|
||||
ue_context_p->ue_context.ul_failure_timer = 0;
|
||||
ue_context_p->ue_context.ue_release_timer = 0;
|
||||
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
|
||||
// ue_context_p = NULL;
|
||||
} else {
|
||||
LOG_I(RRC," S-TMSI doesn't exist, setting Initialue_identity_s_TMSI.m_tmsi to %x => %x\n",ue_context_p,m_tmsi);
|
||||
LOG_I(RRC," S-TMSI doesn't exist, setting Initialue_identity_s_TMSI.m_tmsi to %p => %x\n",ue_context_p,m_tmsi);
|
||||
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
|
||||
if (ue_context_p == NULL)
|
||||
LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
@@ -4228,7 +4229,8 @@ rrc_eNB_decode_ccch(
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
|
||||
} else {
|
||||
break;
|
||||
/* TODO: do we have to break here? */
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4256,7 +4258,7 @@ rrc_eNB_decode_ccch(
|
||||
|
||||
}
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE context: %p\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_p);
|
||||
|
||||
@@ -4266,14 +4268,14 @@ rrc_eNB_decode_ccch(
|
||||
#if defined(ENABLE_ITTI)
|
||||
ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause;
|
||||
if (stmsi_received==0)
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n",
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %ld\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.random_ue_identity,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
|
||||
ue_context_p->ue_context.establishment_cause);
|
||||
else
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %u\n",
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %ld\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
|
||||
@@ -4463,7 +4465,7 @@ rrc_eNB_decode_dcch(
|
||||
}
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UL-DCCH (%d bytes)\n",
|
||||
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UL-DCCH (%zu bytes)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
dec_rval.consumed);
|
||||
return -1;
|
||||
@@ -4530,13 +4532,13 @@ rrc_eNB_decode_dcch(
|
||||
if (ue_context_p->ue_context.Status == RRC_RECONFIGURED){
|
||||
dedicated_DRB = 1;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}else {
|
||||
dedicated_DRB = 0;
|
||||
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
@@ -4784,6 +4786,7 @@ rrc_eNB_decode_dcch(
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void *)ul_dcch_msg);
|
||||
#endif
|
||||
LOG_I(RRC, "got UE capabilities for UE %x\n", ctxt_pP->rnti);
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_UE_EUTRA_Capability,
|
||||
(void **)&UE_EUTRA_Capability,
|
||||
@@ -4794,7 +4797,7 @@ rrc_eNB_decode_dcch(
|
||||
choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.
|
||||
array[0]->ueCapabilityRAT_Container.size, 0, 0);
|
||||
//#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_UE_EUTRA_Capability, (void *)UE_EUTRA_Capability);
|
||||
//xer_fprint(stdout, &asn_DEF_UE_EUTRA_Capability, (void *)UE_EUTRA_Capability);
|
||||
//#endif
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
|
||||
@@ -115,7 +115,7 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
(hash_key_t)eNB_ue_s1ap_id,
|
||||
result2);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_E(S1AP, "[eNB %u] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %u\n",
|
||||
LOG_E(S1AP, "[eNB %ld] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32"\n",
|
||||
rrc_instance_pP - eNB_rrc_inst, eNB_ue_s1ap_id);
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,7 @@ rrc_eNB_process_security(
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%x): %x, %x, %s\n",
|
||||
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %x, %x, %s\n",
|
||||
ctxt_pP->module_id,
|
||||
ue_context_pP->ue_context.rnti,
|
||||
security_capabilities_pP,
|
||||
@@ -1008,7 +1008,7 @@ int rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
MessageDef *msg_fail_p;
|
||||
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_UE_CTXT_MODIFICATION_REQ: unknown UE from eNB_ue_s1ap_id (%d) for eNB %d\n", instance, eNB_ue_s1ap_id);
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_UE_CTXT_MODIFICATION_REQ: unknown UE from eNB_ue_s1ap_id (%d)\n", instance, eNB_ue_s1ap_id);
|
||||
|
||||
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CTXT_MODIFICATION_FAIL);
|
||||
S1AP_UE_CTXT_MODIFICATION_FAIL (msg_fail_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
|
||||
@@ -61,9 +61,9 @@ static void *link_manager_sender_thread(void *_manager)
|
||||
|
||||
return NULL;
|
||||
|
||||
error:
|
||||
LOG_E(MAC, "%s: error\n", __FUNCTION__);
|
||||
return NULL;
|
||||
//error:
|
||||
//LOG_E(MAC, "%s: error\n", __FUNCTION__);
|
||||
//return NULL;
|
||||
}
|
||||
|
||||
/* that thread receives messages from the link and puts them in the queue */
|
||||
@@ -118,7 +118,6 @@ link_manager_t *create_link_manager(
|
||||
// Make the async interface threads real-time
|
||||
//#ifndef LOWLATENCY
|
||||
struct sched_param sched_param_recv_thread;
|
||||
struct sched_param sched_param_send_thread;
|
||||
|
||||
sched_param_recv_thread.sched_priority = sched_get_priority_max(SCHED_RR) - 1;
|
||||
pthread_attr_setschedparam(&attr, &sched_param_recv_thread);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user