Commit a2836d1d authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.14.1: Pulled in patches from Mike Peters to fix an uninitialized...

Version 0.14.1: Pulled in patches from Mike Peters to fix an uninitialized N_bits value in liblte, Tim O'Shea to properly reference UHD libraries and include directories for cmake, Jeff Long to fix a mutex double unlock bug, Jeff Long to optimally set the master clock rate for USRP B2X0 in the LTE_fdd_dl_scan application, and added clock source as a configurable parameter in the LTE_fdd_enodeb application.
parent 13df10c3
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.14.0)
set(openLTE_version 0.14.1)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -110,3 +110,9 @@ v00.14.00 Split LIBLTE_MSG_STRUCT into bit and byte messages, fixed a bug wh
QoS, uplink scheduling, RRC and MME NAS message handling, and RLC AM
processing support, omitting the path from __FILE__, and deleteing
users on C-RNTI expiration in LTE_fdd_enodeb.
v00.14.01 Pulled in patches from Mike Peters to fix an uninitialized N_bits
value in liblte, Tim O'Shea to properly reference UHD libraries and
include directories for cmake, Jeff Long to fix a mutex double
unlock bug, Jeff Long to optimally set the master clock rate for
USRP B2X0 in the LTE_fdd_dl_scan application, and added clock source
as a configurable parameter in the LTE_fdd_enodeb application.
......@@ -10,6 +10,6 @@ add_executable(LTE_fdd_dl_scan
src/LTE_fdd_dl_scan_flowgraph.cc
src/LTE_fdd_dl_scan_state_machine.cc
)
target_link_libraries(LTE_fdd_dl_scan lte fftw3f uhd tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_fdd_dl_scan lte fftw3f tools pthread ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
set_target_properties(LTE_fdd_dl_scan PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_scan_state_machine_EXPORTS")
install(TARGETS LTE_fdd_dl_scan DESTINATION bin)
......@@ -32,6 +32,8 @@
11/30/2013 Ben Wojtowicz Added support for bladeRF.
04/12/2014 Ben Wojtowicz Pulled in a patch from Jevgenij for
supporting non-B2X0 USRPs.
07/22/2014 Ben Wojtowicz Pulled in a patch from Jeff Long to optimally
set the master clock rate for USRP B2X0.
*******************************************************************************/
......@@ -129,11 +131,11 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
osmosdr::source::sptr tmp_src0 = osmosdr::source::make("uhd");
BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
uhd::usrp::multi_usrp::make(dev)->set_master_clock_rate(30720000);
uhd::usrp::multi_usrp::make(dev)->set_master_clock_rate(15360000);
mcr = uhd::usrp::multi_usrp::make(dev)->get_master_clock_rate();
}
if(0 != tmp_src0->get_sample_rates().size() &&
1 >= fabs(mcr - 30720000))
1 >= fabs(mcr - 15360000))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP_B;
samp_src = tmp_src0;
......
......@@ -23,5 +23,5 @@ add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_rrc.cc
src/LTE_fdd_enb_mme.cc
)
target_link_libraries(LTE_fdd_enodeb lte fftw3f uhd tools pthread rt ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
install(TARGETS LTE_fdd_enodeb DESTINATION bin)
......@@ -32,6 +32,8 @@
05/04/2014 Ben Wojtowicz Added PCAP support and more error types.
06/15/2014 Ben Wojtowicz Added new error causes, ... support for info
messages, and using the latest LTE library.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
*******************************************************************************/
......@@ -207,6 +209,7 @@ typedef enum{
LTE_FDD_ENB_PARAM_SELECTED_RADIO_IDX,
LTE_FDD_ENB_PARAM_TX_GAIN,
LTE_FDD_ENB_PARAM_RX_GAIN,
LTE_FDD_ENB_PARAM_CLOCK_SOURCE,
LTE_FDD_ENB_PARAM_N_ITEMS,
}LTE_FDD_ENB_PARAM_ENUM;
......@@ -250,7 +253,8 @@ static const char lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_N_ITEMS][100] = {"ban
"selected_radio_name",
"selected_radio_idx",
"tx_gain",
"rx_gain"};
"rx_gain",
"clock_source"};
typedef struct{
LTE_FDD_ENB_VAR_TYPE_ENUM var_type;
......
......@@ -28,6 +28,8 @@
01/18/2014 Ben Wojtowicz Handling EARFCN updates and multiple
antennas.
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
*******************************************************************************/
......@@ -104,6 +106,8 @@ public:
LTE_FDD_ENB_ERROR_ENUM set_tx_gain(uint32 gain);
uint32 get_rx_gain(void);
LTE_FDD_ENB_ERROR_ENUM set_rx_gain(uint32 gain);
std::string get_clock_source(void);
LTE_FDD_ENB_ERROR_ENUM set_clock_source(std::string source);
uint32 get_sample_rate(void);
void set_earfcns(int64 dl_earfcn, int64 ul_earfcn);
void send(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *buf);
......@@ -131,6 +135,7 @@ private:
gr_complex tx_buf[LIBLTE_PHY_N_SAMPS_PER_SUBFR_30_72MHZ];
gr_complex rx_buf[LIBLTE_PHY_N_SAMPS_PER_SUBFR_30_72MHZ];
uhd::time_spec_t next_tx_ts;
std::string clock_source;
int64 N_ant;
uint32 N_tx_samps;
uint32 N_rx_samps;
......
......@@ -33,6 +33,8 @@
05/04/2014 Ben Wojtowicz Added PCAP support.
06/15/2014 Ben Wojtowicz Added ... support for info messages and
using the latest LTE library.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
*******************************************************************************/
......@@ -789,6 +791,8 @@ void LTE_fdd_enb_interface::handle_read(std::string msg)
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, boost::lexical_cast<std::string>(radio->get_tx_gain()));
}else if(std::string::npos != msg.find(lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_RX_GAIN])){
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, boost::lexical_cast<std::string>(radio->get_rx_gain()));
}else if(std::string::npos != msg.find(lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_CLOCK_SOURCE])){
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, radio->get_clock_source());
}else{
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_INVALID_PARAM, "");
}
......@@ -877,6 +881,8 @@ void LTE_fdd_enb_interface::handle_write(std::string msg)
}else if(std::string::npos != msg.find(lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_RX_GAIN])){
u_value = boost::lexical_cast<uint32>(msg.substr(msg.find(" ")+1, std::string::npos));
send_ctrl_error_msg(radio->set_rx_gain(u_value), "");
}else if(std::string::npos != msg.find(lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_CLOCK_SOURCE])){
send_ctrl_error_msg(radio->set_clock_source(msg.substr(msg.find(" ")+1, std::string::npos)), "");
}else{
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_INVALID_PARAM, "");
}
......@@ -1175,6 +1181,11 @@ void LTE_fdd_enb_interface::handle_help(void)
// Intentionally do nothing
}
send_ctrl_msg(tmp_str);
tmp_str = "\t\t";
tmp_str += lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_CLOCK_SOURCE];
tmp_str += " = ";
tmp_str += radio->get_clock_source();
send_ctrl_msg(tmp_str);
// System Parameters
send_ctrl_msg("\tSystem Parameters:");
......
......@@ -35,6 +35,8 @@
04/12/2014 Ben Wojtowicz Pulled in a patch from Max Suraev for more
descriptive start failures.
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
*******************************************************************************/
......@@ -109,10 +111,11 @@ LTE_fdd_enb_radio::LTE_fdd_enb_radio()
// Setup radio thread
get_sample_rate();
N_tx_samps = 0;
N_rx_samps = 0;
tx_gain = 0;
rx_gain = 0;
N_tx_samps = 0;
N_rx_samps = 0;
tx_gain = 0;
rx_gain = 0;
clock_source = "internal";
// Start/Stop
started = false;
......@@ -159,6 +162,8 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio::start(void)
// Setup the USRP
usrp = uhd::usrp::multi_usrp::make(devs[selected_radio_idx-1]);
usrp->set_clock_source(clock_source);
usrp->set_time_source(clock_source);
usrp->set_master_clock_rate(30720000);
if(2.0 >= fabs(usrp->get_master_clock_rate() - 30720000.0))
{
......@@ -368,6 +373,42 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio::set_rx_gain(uint32 gain)
return(LTE_FDD_ENB_ERROR_NONE);
}
std::string LTE_fdd_enb_radio::get_clock_source(void)
{
boost::mutex::scoped_lock lock(start_mutex);
std::string source;
if(!started)
{
source = clock_source;
}else{
if(0 == selected_radio_idx)
{
source = clock_source;
}else{
source = usrp->get_clock_source(0);
}
}
return(source);
}
LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio::set_clock_source(std::string source)
{
boost::mutex::scoped_lock lock(start_mutex);
LTE_FDD_ENB_ERROR_ENUM err = LTE_FDD_ENB_ERROR_OUT_OF_BOUNDS;
if("internal" == source ||
"external" == source)
{
if(!started)
{
clock_source = source;
err = LTE_FDD_ENB_ERROR_NONE;
}
}
return(err);
}
uint32 LTE_fdd_enb_radio::get_sample_rate(void)
{
boost::mutex::scoped_lock lock(start_mutex);
......
......@@ -9,5 +9,5 @@ add_executable(LTE_file_recorder
src/LTE_file_recorder_interface.cc
src/LTE_file_recorder_flowgraph.cc
)
target_link_libraries(LTE_file_recorder lte fftw3f uhd tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_file_recorder lte fftw3f tools pthread ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
install(TARGETS LTE_file_recorder DESTINATION bin)
......@@ -6,6 +6,7 @@ FIND_PATH(
NAMES uhd/version.hpp
HINTS $ENV{UHD_DIR}/include
${PC_UHD_INCLUDEDIR}
${CMAKE_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
)
......@@ -15,12 +16,17 @@ FIND_LIBRARY(
NAMES uhd
HINTS $ENV{UHD_DIR}/lib
${PC_UHD_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS /usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
)
message(STATUS "UHD LIBRARIES " ${UHD_LIBRARIES})
message(STATUS "UHD INCLUDE DIRS " ${UHD_INCLUDE_DIRS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)
......@@ -95,6 +95,8 @@
PDCCH encode/decode.
06/15/2014 Ben Wojtowicz Added DCI 0 packing and proper support for
transmission of more than one CCE in PDCCH.
07/22/2014 Ben Wojtowicz Pulled in a patch from Mike Peters to fix
an uninitialized N_bits value.
*******************************************************************************/
......@@ -1044,7 +1046,8 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT *phy_struct,
LIBLTE_PHY_SUBFRAME_STRUCT *subframe,
uint32 N_id_cell,
uint8 N_ant,
LIBLTE_PHY_PCFICH_STRUCT *pcfich);
LIBLTE_PHY_PCFICH_STRUCT *pcfich,
uint32 *N_bits);
/*********************************************************************
Name: pdcch_permute_pre_calc
......@@ -4257,7 +4260,7 @@ LIBLTE_ERROR_ENUM liblte_phy_pdcch_channel_decode(LIBLTE_PHY_STRUCT
pdcch != NULL)
{
// PCFICH
pcfich_channel_demap(phy_struct, subframe, N_id_cell, N_ant, pcfich);
pcfich_channel_demap(phy_struct, subframe, N_id_cell, N_ant, pcfich, &N_bits);
if(LIBLTE_SUCCESS != cfi_channel_decode(phy_struct,
phy_struct->pdcch_descramb_bits,
N_bits,
......@@ -7390,11 +7393,11 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT *phy_struct,
LIBLTE_PHY_SUBFRAME_STRUCT *subframe,
uint32 N_id_cell,
uint8 N_ant,
LIBLTE_PHY_PCFICH_STRUCT *pcfich)
LIBLTE_PHY_PCFICH_STRUCT *pcfich,
uint32 *N_bits)
{
uint32 M_layer_symb;
uint32 M_symb;
uint32 N_bits;
uint32 c_init;
uint32 k_hat;
uint32 i;
......@@ -7455,8 +7458,8 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT *phy_struct,
M_symb,
LIBLTE_PHY_MODULATION_TYPE_QPSK,
phy_struct->pdcch_soft_bits,
&N_bits);
for(i=0; i<N_bits; i++)
N_bits);
for(i=0; i<*N_bits; i++)
{
phy_struct->pdcch_descramb_bits[i] = (float)phy_struct->pdcch_soft_bits[i]*(1-2*(float)phy_struct->pdcch_c[i]);
}
......
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -27,6 +27,8 @@
02/26/2013 Ben Wojtowicz Created file
08/26/2013 Ben Wojtowicz Moved to using select with a timeout for
socket management.
07/22/2014 Ben Wojtowicz Pulled in a patch from Jeff Long to fix
double unlocking of mutex.
*******************************************************************************/
......@@ -237,6 +239,7 @@ void* libtools_socket_wrap::server_thread(void *inputs)
if(0 > sock_fd)
{
act_inputs->handle_error(LIBTOOLS_SOCKET_WRAP_ERROR_SOCKET);
act_inputs->socket_wrap->socket_mutex.unlock();
return(NULL);
}
......@@ -252,8 +255,9 @@ void* libtools_socket_wrap::server_thread(void *inputs)
{
fd_max = sock_fd;
}
}else{
act_inputs->socket_wrap->socket_mutex.unlock();
}
act_inputs->socket_wrap->socket_mutex.unlock();
}else{
memset(read_buf, '\0', LINE_MAX);
nbytes = read(sock_fd, read_buf, LINE_MAX);
......@@ -266,8 +270,9 @@ void* libtools_socket_wrap::server_thread(void *inputs)
{
act_inputs->socket_wrap->socket_mutex.unlock();
act_inputs->handle_disconnect();
}else{
act_inputs->socket_wrap->socket_mutex.unlock();
}
act_inputs->socket_wrap->socket_mutex.unlock();
act_inputs->socket_wrap->socket_mutex.lock();
act_inputs->socket_wrap->socket_state = LIBTOOLS_SOCKET_WRAP_STATE_CLOSED;
act_inputs->socket_wrap->socket_mutex.unlock();
......@@ -278,8 +283,9 @@ void* libtools_socket_wrap::server_thread(void *inputs)
{
act_inputs->socket_wrap->socket_mutex.unlock();
act_inputs->handle_disconnect();
}else{
act_inputs->socket_wrap->socket_mutex.unlock();
}
act_inputs->socket_wrap->socket_mutex.unlock();
act_inputs->socket_wrap->socket_mutex.lock();
act_inputs->socket_wrap->socket_state = LIBTOOLS_SOCKET_WRAP_STATE_THREADED;
act_inputs->socket_wrap->socket_mutex.unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment