Commit dce7ff6d authored by Gary Wong's avatar Gary Wong

Update to 0.20.03.

parents a23dcab2 fe1dedd5
Ben Wojtowicz, bwojtowi@gmail.com
Andrew Murphy, andrew.murphy@rd.bbc.co.uk (DCI 1C Unpack, SIB13 unpack/print)
Andrew Murphy, andrew.murphy@rd.bbc.co.uk
Ziming He, ziminghe83@gmail.com
Przemek Bereski, przemobe@users.sourceforge.net
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.18.2)
set(openLTE_version 0.20.3)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -92,6 +92,7 @@ set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS FILTER PMT)
find_package(Gnuradio "3.7.0")
find_package(GnuradioOsmosdr)
find_package(Uhd)
find_package(LibbladeRF)
find_package(FFTW3F)
find_package(Polarssl)
......@@ -107,6 +108,10 @@ if(NOT UHD_FOUND)
message(FATAL_ERROR "UHD required to compile openLTE (http://code.ettus.com/redmine/ettus/projects/uhd/wiki)")
endif()
if(NOT LIBBLADERF_FOUND)
message(FATAL_ERROR "LibbladeRF required to compile openLTE")
endif()
if(NOT FFTW3F_FOUND)
message(FATAL_ERROR "FFTW3 required to compile openLTE")
endif()
......
File mode changed from 100644 to 100755
......@@ -162,3 +162,97 @@ v00.18.02 Fixed several bugs in LTE_fdd_enodeb. Specifically, cleaned up th
message, added more time spec information in radio debug, copying
SRB1 PDCP config to SRB2, fixed a UMD reassembly bug, and did a hack
to get around a crash when releasing a C-RNTI in LTE_fdd_enodeb.
v00.18.03 Added more MME encoding and decoding, RLC UMD header extension
support, and higher order modulation scheme support to PHY in the LTE
library, split the error enum into common.h, moved to a new message
queue using semaphores and circular buffers, added IP PCAP support,
split UL/DL QoS TTI frequency, added user reset to RB class, added
RLC UMD multiple data support, added UTC timestamps to the debug
log port, added higher order modulation scheme support in MAC, fixed
C-RNTI assign/release management, changed RTS timing, fixed user
switch in MME/RRC, added clear RB support and fixed copy RB in the
user class for LTE_fdd_enodeb.
v00.18.04 Fixed long BSR CE and added extended power headroom CE support, added
PDCP data PDU with short SN support, and added header extension
handling to RLC AMD to LTE library, added UmTRX support to
LTE_fdd_dl_scan, fixed the start/stop/start issues by closing the TUN
device on stop, fixed the RTS issues, added a mutex to the message
queue circular buffer, fixed uninitialized variables in the configuration
database, added header extension/multiple data support for RLC AMD,
added detach handling, and added a common routine for formatting time to
LTE_fdd_enodeb.
v00.19.00 Removed rb_id from all MME pack routines (thanks to Przemek for finding
this), fixed a bug with the default value of filter_coeff in
LIBLTE_RRC_UL_POWER_CONTROL_DEDICATED_STRUCT (thanks to Paul Sutton for
finding this), added the length indicator for eps_mobile_id (thanks to
Paul Sutton for finding this), added an error return for dci_1a_unpack
(thanks to Joel Carlson for the suggestion), properly initializing
vd_w_metric (thanks for ziminghe for finding this), and limiting PUSCH
allocations to 10 PRBs for performance reasons in the LTE library, added
TX and RX gains to the config file, combined UL and DL schedule messages
into a single PHY schedule message, moved QoS structure from RB class
to the user class, fixed bugs related to the RLC AM TX and RX buffers,
changed the default timer alignment timer to 10240 subframes, removed
boost::lexical_casts from HSS, moved the dedicated bearer QoS to 9, and
moved DRBs to RLC AMD mode in LTE_fdd_enodeb.
v00.19.01 Added support for all ID types for the mobile identity IE in MME, added
support for more PDU types in PDCP, added defines for sizes of fixed
arrays in LIBLTE_PHY_STRUCT, fixed the order of sizes for rate match
and unmatch arrays in LIBLTE_PHY_STRUCT (thanks to Ziming He), added
return values for liblte_phy_get_n_cce (thanks to Damian Jarek) and
liblte_rlc_unpack_status_pdu (thanks to Mikhail Gudkov) in the LTE
library, added a scoped lock RAII class for sem_t and pthread_mutex_t
in the tools library, changed from using boost::mutex to pthread_mutex_t
and_sem_t throughout, added helper functions in MAC, changed user
deletion and C-RNTI release procedures, properly initializing SIB
scheduling info, properly construct MNC (thanks to Mikhail Gudkov),
fixed an issue with RTS response in MAC, properly initialized PHY
allocation structure in MAC (thanks to Markus Grab), fixed the updating
of VT(A) in the RLC retransmission buffer, and changed the QoS parameters
for default data in LTE_fdd_enodeb.
v00.19.02 Pulled in unit tests for the turbo decoder from Ziming He, optimized
the PBCH detection algorithm (thanks to Ziming He), and fixed the setting
of id for IMEISV in Mobile Idenity IE (thanks to Mikhail Gudkov) in the
LTE library, added the ability to print all registered users, removed
extra boost includes, added an RRC connection reestablishment state
machine, added a UE inactivity timer, actually properly constructing
MNC (thanks to Mikhail Gudkov), memcpy-ing IP packet headers instead
of typecasting (thanks to Damian Jarek), initialized present flags
and changed packet filter evaluation precedence in activate dedicated
EPS bearer context (thanks to Pedro Batista), moved the message queue
empty error to a warning, and properly updating the user list iterator
after erasing a user (thanks to Damian Jarek).
v00.19.03 Added support for PUCCH decode in liblte, added support for H-ARQ and
PUCCH in LTE_fdd_enodeb, and fixed a bug related to improper cleanup
of the inactivity timer in LTE_fdd_enodeb
v00.19.04 Fixed the calculation of n_prime_p in generate_dmrs_pucch.
v00.20.00 Increased the maximum messages size, fixed extended power headroom MAC
CE, added classmark3 support, added tracking area update request support,
fixed the fill bits in packing mobile ID IE for IMEISV and the length in
unpacking UE security capabilities IE (thanks to Przemek Bereski for
finding this), allowing NULL to be passed for key_256 in service reject
message packing (thanks to Przemek Bereski and Peter Nguyen for finding
this), added PDCCH size defines, added an error return to DCI 1C unpack,
clearing punctered turbo decode bits before decoding, added AMD PDU
segment support, padded all RRC enums to powers of 2, added support for
several RRC IEs and messages (with the help of Przemek Bereski) in the
LTE library, restructured the radio classes to ease the addition of new
radio types, set the processor affinity to allow the PHY/Radio to run
on a particular core, fixed memcpy lengths in MAC, fixed bugs in
print_all_users (thanks to Sultan Qasim Khan for finding this) and when
receiving a service request message for a non-existent user (thanks to
Peter Nguyen for finding this), fixed a long standing PHY bug that was
including UL PDCCH allocations in a check of DL PRB usage, added error
logging for received AMD PDU segments, increased the DL datarate for
default data QoS, using C-RNTI when no IMSI/IMEI are available for
printing an attached user, Przemek Bereski added UE capability enquiry
and UE capability information support and bladeRF support.
v00.20.01 Reworked the MAC RTS handling logic and limited the number of HARQ
retransmissions in LTE_fdd_enodeb.
v00.20.02 Changed the QoS DL bytes per subframe for default data to ensure QPSK
only for 5MHz other DL modulation schemes seem to not be functioning
correctly.
v00.20.03 Properly discarding sequence type extensions in liblte_rrc, properly
typecasting for bladerf_get_timestamp() in LTE_fdd_enodeb_radio, and
updated enodeb_nat_script.sh to be more generic with ethernet
interfaces.
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 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
......@@ -33,6 +33,8 @@
supporting non-B2X0 USRPs.
12/16/2014 Ben Wojtowicz Pulled in a patch from Ruben Merz to add
USRP X300 support.
03/11/2015 Ben Wojtowicz Added UmTRX support.
12/06/2015 Ben Wojtowicz Changed boost::mutex to pthread_mutex_t.
*******************************************************************************/
......@@ -45,7 +47,6 @@
#include "LTE_fdd_dl_scan_interface.h"
#include "LTE_fdd_dl_scan_state_machine.h"
#include <boost/thread/mutex.hpp>
#include <gnuradio/top_block.h>
#include <gnuradio/filter/rational_resampler_base_ccf.h>
#include <gnuradio/filter/firdes.h>
......@@ -70,6 +71,7 @@ typedef enum{
LTE_FDD_DL_SCAN_HW_TYPE_HACKRF,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_B,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_N,
LTE_FDD_DL_SCAN_HW_TYPE_UMTRX,
LTE_FDD_DL_SCAN_HW_TYPE_USRP_X,
LTE_FDD_DL_SCAN_HW_TYPE_BLADERF,
LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN,
......@@ -108,9 +110,9 @@ private:
osmosdr::source::sptr samp_src;
LTE_fdd_dl_scan_state_machine_sptr state_machine;
pthread_t start_thread;
boost::mutex start_mutex;
bool started;
pthread_t start_thread;
pthread_mutex_t start_mutex;
bool started;
};
#endif /* __LTE_FDD_DL_SCAN_FLOWGRAPH_H__ */
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
Copyright 2014 Andrew Murphy (SIB13 printing)
This program is free software: you can redistribute it and/or modify
......@@ -29,6 +29,7 @@
07/21/2013 Ben Wojtowicz Added support for decoding SIBs.
06/15/2014 Ben Wojtowicz Added PCAP support.
09/19/2014 Andrew Murphy Added SIB13 printing.
12/06/2015 Ben Wojtowicz Changed boost::mutex to pthread_mutex_t.
*******************************************************************************/
......@@ -42,7 +43,6 @@
#include "liblte_interface.h"
#include "liblte_rrc.h"
#include "libtools_socket_wrap.h"
#include <boost/thread/mutex.hpp>
#include <string>
/*******************************************************************************
......@@ -106,7 +106,7 @@ public:
static void handle_ctrl_connect(void);
static void handle_ctrl_disconnect(void);
static void handle_ctrl_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);
boost::mutex ctrl_mutex;
pthread_mutex_t ctrl_mutex;
FILE *pcap_fd;
libtools_socket_wrap *ctrl_socket;
int16 ctrl_port;
......@@ -142,7 +142,7 @@ private:
void write_enable_pcap(std::string enable_pcap_str);
// Variables
boost::mutex dl_earfcn_list_mutex;
pthread_mutex_t dl_earfcn_list_mutex;
LIBLTE_INTERFACE_BAND_ENUM band;
uint16 current_dl_earfcn;
uint16 dl_earfcn_list[65535];
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
This diff is collapsed.
File mode changed from 100644 to 100755
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 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
......@@ -31,6 +31,7 @@
latest LTE library.
03/26/2014 Ben Wojtowicz Using the latest LTE library.
06/15/2014 Ben Wojtowicz Added PCAP support.
03/11/2015 Ben Wojtowicz Added 7.68MHz support.
*******************************************************************************/
......@@ -64,6 +65,17 @@
#define PDSCH_DECODE_SIB1_NUM_SAMPS_1_92MHZ (2 * ONE_FRAME_NUM_SAMPS_1_92MHZ)
#define PDSCH_DECODE_SI_GENERIC_NUM_SAMPS_1_92MHZ (ONE_FRAME_NUM_SAMPS_1_92MHZ)
// Sample rate 7.68MHZ defines
#define ONE_SUBFRAME_NUM_SAMPS_7_68MHZ (LIBLTE_PHY_N_SAMPS_PER_SUBFR_7_68MHZ)
#define ONE_FRAME_NUM_SAMPS_7_68MHZ (10 * ONE_SUBFRAME_NUM_SAMPS_7_68MHZ)
#define FREQ_CHANGE_WAIT_NUM_SAMPS_7_68MHZ (100 * ONE_FRAME_NUM_SAMPS_7_68MHZ)
#define COARSE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ (((COARSE_TIMING_N_SLOTS/2)+2) * ONE_SUBFRAME_NUM_SAMPS_7_68MHZ)
#define PSS_AND_FINE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ (COARSE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ)
#define SSS_SEARCH_NUM_SAMPS_7_68MHZ (COARSE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ)
#define BCH_DECODE_NUM_SAMPS_7_68MHZ (2 * ONE_FRAME_NUM_SAMPS_7_68MHZ)
#define PDSCH_DECODE_SIB1_NUM_SAMPS_7_68MHZ (2 * ONE_FRAME_NUM_SAMPS_7_68MHZ)
#define PDSCH_DECODE_SI_GENERIC_NUM_SAMPS_7_68MHZ (ONE_FRAME_NUM_SAMPS_7_68MHZ)
// Sample rate 15.36MHZ defines
#define ONE_SUBFRAME_NUM_SAMPS_15_36MHZ (LIBLTE_PHY_N_SAMPS_PER_SUBFR_15_36MHZ)
#define ONE_FRAME_NUM_SAMPS_15_36MHZ (10 * ONE_SUBFRAME_NUM_SAMPS_15_36MHZ)
......@@ -125,6 +137,23 @@ LTE_fdd_dl_scan_state_machine::LTE_fdd_dl_scan_state_machine(uint32 samp_rate)
bch_decode_num_samps = BCH_DECODE_NUM_SAMPS_1_92MHZ;
pdsch_decode_sib1_num_samps = PDSCH_DECODE_SIB1_NUM_SAMPS_1_92MHZ;
pdsch_decode_si_generic_num_samps = PDSCH_DECODE_SI_GENERIC_NUM_SAMPS_1_92MHZ;
}else if(samp_rate == 7680000){
liblte_phy_init(&phy_struct,
LIBLTE_PHY_FS_7_68MHZ,
LIBLTE_PHY_INIT_N_ID_CELL_UNKNOWN,
4,
LIBLTE_PHY_N_RB_DL_5MHZ,
LIBLTE_PHY_N_SC_RB_DL_NORMAL_CP,
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1]);
one_subframe_num_samps = ONE_SUBFRAME_NUM_SAMPS_7_68MHZ;
one_frame_num_samps = ONE_FRAME_NUM_SAMPS_7_68MHZ;
freq_change_wait_num_samps = FREQ_CHANGE_WAIT_NUM_SAMPS_7_68MHZ;
coarse_timing_search_num_samps = COARSE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ;
pss_and_fine_timing_search_num_samps = PSS_AND_FINE_TIMING_SEARCH_NUM_SAMPS_7_68MHZ;
sss_search_num_samps = SSS_SEARCH_NUM_SAMPS_7_68MHZ;
bch_decode_num_samps = BCH_DECODE_NUM_SAMPS_7_68MHZ;
pdsch_decode_sib1_num_samps = PDSCH_DECODE_SIB1_NUM_SAMPS_7_68MHZ;
pdsch_decode_si_generic_num_samps = PDSCH_DECODE_SI_GENERIC_NUM_SAMPS_7_68MHZ;
}else{
liblte_phy_init(&phy_struct,
LIBLTE_PHY_FS_15_36MHZ,
......
......@@ -24,7 +24,7 @@ add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_mme.cc
src/LTE_fdd_enb_gw.cc
)
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${POLARSSL_LIBRARIES} ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${POLARSSL_LIBRARIES} ${UHD_LIBRARIES} ${LIBBLADERF_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
install(TARGETS LTE_fdd_enodeb DESTINATION bin)
install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh\")")
install(CODE "execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh\")")
File mode changed from 100644 to 100755
/*******************************************************************************
Copyright 2015-2016 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_common.h
Description: Contains all the common definitions for the LTE FDD eNodeB.
Revision History
---------- ------------- --------------------------------------------
02/15/2015 Ben Wojtowicz Created file
03/12/2016 Ben Wojtowicz Added error for H-ARQ info not found.
*******************************************************************************/
#ifndef __LTE_FDD_ENB_COMMON_H__
#define __LTE_FDD_ENB_COMMON_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
LTE_FDD_ENB_ERROR_NONE = 0,
LTE_FDD_ENB_ERROR_INVALID_COMMAND,
LTE_FDD_ENB_ERROR_INVALID_PARAM,
LTE_FDD_ENB_ERROR_OUT_OF_BOUNDS,
LTE_FDD_ENB_ERROR_EXCEPTION,
LTE_FDD_ENB_ERROR_ALREADY_STARTED,
LTE_FDD_ENB_ERROR_ALREADY_STOPPED,
LTE_FDD_ENB_ERROR_CANT_START,
LTE_FDD_ENB_ERROR_CANT_STOP,
LTE_FDD_ENB_ERROR_BAD_ALLOC,
LTE_FDD_ENB_ERROR_USER_NOT_FOUND,
LTE_FDD_ENB_ERROR_NO_FREE_C_RNTI,
LTE_FDD_ENB_ERROR_C_RNTI_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_SCHEDULE,
LTE_FDD_ENB_ERROR_VARIABLE_NOT_DYNAMIC,
LTE_FDD_ENB_ERROR_MASTER_CLOCK_FAIL,
LTE_FDD_ENB_ERROR_NO_MSG_IN_QUEUE,
LTE_FDD_ENB_ERROR_RB_NOT_SETUP,
LTE_FDD_ENB_ERROR_RB_ALREADY_SETUP,
LTE_FDD_ENB_ERROR_TIMER_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_REASSEMBLE_SDU,
LTE_FDD_ENB_ERROR_DUPLICATE_ENTRY,
LTE_FDD_ENB_ERROR_READ_ONLY,
LTE_FDD_ENB_ERROR_HARQ_INFO_NOT_FOUND,
LTE_FDD_ENB_ERROR_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
"invalid command",
"invalid parameter",
"out of bounds",
"exception",
"already started",
"already stopped",
"cant start",
"cant stop",
"bad alloc",
"user not found",
"no free C-RNTI",
"C-RNTI not found",
"cant schedule",
"variable not dynamic",
"unable to set master clock rate",
"no message in queue",
"RB not setup",
"RB already setup",
"timer not found",
"cant reassemble SDU",
"duplicate entry",
"read only",
"HARQ info not found"};
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
#endif /* __LTE_FDD_ENB_COMMON_H__ */
/*******************************************************************************
Copyright 2014 Ben Wojtowicz
Copyright 2014-2015 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
......@@ -26,6 +26,8 @@
---------- ------------- --------------------------------------------
11/29/2014 Ben Wojtowicz Created file
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
02/15/2015 Ben Wojtowicz Moved to new message queue.
12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t.
*******************************************************************************/
......@@ -67,7 +69,7 @@ public:
// Start/Stop
bool is_started(void);
LTE_FDD_ENB_ERROR_ENUM start(char *err_str);
LTE_FDD_ENB_ERROR_ENUM start(LTE_fdd_enb_msgq *from_pdcp, LTE_fdd_enb_msgq *to_pdcp, char *err_str, LTE_fdd_enb_interface *iface);
void stop(void);
private:
......@@ -77,13 +79,14 @@ private:
~LTE_fdd_enb_gw();
// Start/Stop
boost::mutex start_mutex;
bool started;
LTE_fdd_enb_interface *interface;
sem_t start_sem;
bool started;
// Communication
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *pdcp_comm_msgq;
boost::interprocess::message_queue *gw_pdcp_olmq;
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_pdcp;
LTE_fdd_enb_msgq *msgq_to_pdcp;
// PDCP Message Handlers
void handle_gw_data(LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT *gw_data);
......
/*******************************************************************************
Copyright 2014 Ben Wojtowicz
Copyright 2014-2015 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
......@@ -30,6 +30,7 @@
11/01/2014 Ben Wojtowicz Added user file support.
11/29/2014 Ben Wojtowicz Added support for regenerating eNodeB
security data.
12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t.
*******************************************************************************/
......@@ -120,7 +121,7 @@ private:
~LTE_fdd_enb_hss();
// Allowed users
boost::mutex user_mutex;
sem_t user_sem;
std::list<LTE_FDD_ENB_HSS_USER_STRUCT *> user_list;
// User File
......
This diff is collapsed.
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2016 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
......@@ -31,6 +31,11 @@
to current_tti.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
02/15/2015 Ben Wojtowicz Moved to new message queue.
12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t and added some
helper functions.
02/13/2016 Ben Wojtowicz Removed boost message queue include.
07/31/2016 Ben Wojtowicz Added a define for max HARQ retransmissions.
*******************************************************************************/
......@@ -46,14 +51,13 @@
#include "LTE_fdd_enb_msgq.h"
#include "LTE_fdd_enb_user.h"
#include "liblte_mac.h"
#include <boost/thread/mutex.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <list>
/*******************************************************************************
DEFINES
*******************************************************************************/
#define LTE_FDD_ENB_MAX_HARQ_RETX 5
/*******************************************************************************
FORWARD DECLARATIONS
......@@ -94,7 +98,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(LTE_fdd_enb_interface *iface);
void start(LTE_fdd_enb_msgq *from_phy, LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *to_phy, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_timer, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -108,17 +112,18 @@ private:
~LTE_fdd_enb_mac();
// Start/Stop
boost::mutex start_mutex;
sem_t start_sem;
LTE_fdd_enb_interface *interface;
bool started;
// Communication
void handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *phy_comm_msgq;
LTE_fdd_enb_msgq *rlc_comm_msgq;
boost::interprocess::message_queue *mac_phy_olmq;
boost::interprocess::message_queue *mac_rlc_olmq;
void handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_phy;
LTE_fdd_enb_msgq *msgq_from_rlc;
LTE_fdd_enb_msgq *msgq_to_phy;
LTE_fdd_enb_msgq *msgq_to_rlc;
LTE_fdd_enb_msgq *msgq_to_timer;
// PHY Message Handlers
void handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT *rts);
......@@ -147,9 +152,9 @@ private:
LTE_FDD_ENB_ERROR_ENUM add_to_rar_sched_queue(uint32 current_tti, LIBLTE_PHY_ALLOCATION_STRUCT *dl_alloc, LIBLTE_PHY_ALLOCATION_STRUCT *ul_alloc, LIBLTE_MAC_RAR_STRUCT *rar);
LTE_FDD_ENB_ERROR_ENUM add_to_dl_sched_queue(uint32 current_tti, LIBLTE_MAC_PDU_STRUCT *mac_pdu, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);
LTE_FDD_ENB_ERROR_ENUM add_to_ul_sched_queue(uint32 current_tti, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);
boost::mutex rar_sched_queue_mutex;
boost::mutex dl_sched_queue_mutex;
boost::mutex ul_sched_queue_mutex;
sem_t rar_sched_queue_sem;
sem_t dl_sched_queue_sem;
sem_t ul_sched_queue_sem;
std::list<LTE_FDD_ENB_RAR_SCHED_QUEUE_STRUCT*> rar_sched_queue;
std::list<LTE_FDD_ENB_DL_SCHED_QUEUE_STRUCT*> dl_sched_queue;
std::list<LTE_FDD_ENB_UL_SCHED_QUEUE_STRUCT*> ul_sched_queue;
......@@ -159,11 +164,13 @@ private:
uint8 sched_cur_ul_subfn;
// Parameters
boost::mutex sys_info_mutex;
sem_t sys_info_sem;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
// Helpers
uint32 get_n_reserved_prbs(uint32 current_tti);
uint32 add_to_tti(uint32 tti, uint32 addition);
bool is_tti_in_future(uint32 tti_to_check, uint32 current_tti);
};
#endif /* __LTE_FDD_ENB_MAC_H__ */
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2016 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
......@@ -37,6 +37,10 @@
request support.
12/16/2014 Ben Wojtowicz Added ol extension to message queue and
sending of EMM information message.
02/15/2015 Ben Wojtowicz Moved to new message queue.
03/11/2015 Ben Wojtowicz Added detach handling.
12/06/2015 Ben Wojtowicz Changed boost::mutex to sem_t.
02/13/2016 Ben Wojtowicz Removed boost message queue include.
*******************************************************************************/
......@@ -49,8 +53,6 @@
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/thread/mutex.hpp>
/*******************************************************************************
DEFINES
......@@ -79,7 +81,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(void);
void start(LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -92,13 +94,14 @@ private:
~LTE_fdd_enb_mme();
// Start/Stop
boost::mutex start_mutex;
bool started;
LTE_fdd_enb_interface *interface;
sem_t start_sem;
bool started;
// Communication
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rrc_comm_msgq;
boost::interprocess::message_queue *mme_rrc_olmq;
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_rrc;
LTE_fdd_enb_msgq *msgq_to_rrc;
// RRC Message Handlers
void handle_nas_msg(LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT *nas_msg);
......@@ -109,6 +112,7 @@ private:
void parse_attach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user **user, LTE_fdd_enb_rb **rb);
void parse_authentication_failure(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_authentication_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_detach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_identity_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_security_mode_complete(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_security_mode_reject(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
......@@ -120,12 +124,14 @@ private:
// State Machines
void attach_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void service_req_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void detach_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
void send_attach_accept(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_attach_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_authentication_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_authentication_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_detach_accept(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_emm_information(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_identity_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 id_type);
void send_security_mode_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
......@@ -135,7 +141,7 @@ private:
void send_rrc_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LTE_FDD_ENB_RRC_CMD_ENUM cmd);