Commit 7032f8cc authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.19.0: Removed rb_id from all MME pack routines (thanks to Przemek...

Version 0.19.0: 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.
parent 9d609057
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.18.4)
set(openLTE_version 0.19.0)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -181,4 +181,17 @@ v00.18.04 Fixed long BSR CE and added extended power headroom CE support, ad
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.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -43,6 +43,8 @@
02/15/2015 Ben Wojtowicz Moved to new message queue, added IP pcap
support, and put error enum into common hdr.
03/11/2015 Ben Wojtowicz Made a common routine for formatting time.
07/25/2015 Ben Wojtowicz Made tx_gain and rx_gain into config file
tracked parameters.
*******************************************************************************/
......@@ -177,13 +179,13 @@ typedef enum{
LTE_FDD_ENB_PARAM_DNS_ADDR,
LTE_FDD_ENB_PARAM_USE_CNFG_FILE,
LTE_FDD_ENB_PARAM_USE_USER_FILE,
LTE_FDD_ENB_PARAM_TX_GAIN,
LTE_FDD_ENB_PARAM_RX_GAIN,
// Radio parameters managed by LTE_fdd_enb_radio
LTE_FDD_ENB_PARAM_AVAILABLE_RADIOS,
LTE_FDD_ENB_PARAM_SELECTED_RADIO_NAME,
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,
......@@ -230,11 +232,11 @@ static const char LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_N_ITEMS][100] = {"ban
"dns_addr",
"use_cnfg_file",
"use_user_file",
"tx_gain",
"rx_gain",
"available_radios",
"selected_radio_name",
"selected_radio_idx",
"tx_gain",
"rx_gain",
"clock_source"};
typedef struct{
......
......@@ -38,6 +38,8 @@
and circular buffers and added a timer tick
message.
03/15/2015 Ben Wojtowicz Added a mutex to the circular buffer.
07/25/2015 Ben Wojtowicz Combined the DL and UL schedule messages into
a single PHY schedule message.
*******************************************************************************/
......@@ -75,8 +77,7 @@ typedef enum{
LTE_FDD_ENB_MESSAGE_TYPE_KILL = 0,
// MAC -> PHY Messages
LTE_FDD_ENB_MESSAGE_TYPE_DL_SCHEDULE,
LTE_FDD_ENB_MESSAGE_TYPE_UL_SCHEDULE,
LTE_FDD_ENB_MESSAGE_TYPE_PHY_SCHEDULE,
// PHY -> MAC Messages
LTE_FDD_ENB_MESSAGE_TYPE_READY_TO_SEND,
......@@ -122,8 +123,7 @@ typedef enum{
LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS,
}LTE_FDD_ENB_MESSAGE_TYPE_ENUM;
static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS][100] = {"Kill",
"DL schedule",
"UL schedule",
"PHY schedule",
"Ready to send",
"PRACH decode",
"PUCCH decode",
......@@ -181,6 +181,10 @@ typedef struct{
uint32 current_tti;
uint8 next_prb;
}LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT;
typedef struct{
LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT dl_sched;
LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT ul_sched;
}LTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT;
// PHY -> MAC Messages
typedef struct{
......@@ -298,8 +302,7 @@ typedef union{
// Generic Messages
// MAC -> PHY Messages
LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT dl_schedule;
LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT ul_schedule;
LTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT phy_schedule;
// PHY -> MAC Messages
LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT ready_to_send;
......@@ -386,6 +389,9 @@ public:
LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer,
LTE_FDD_ENB_MESSAGE_UNION *msg_content,
uint32 msg_content_size);
void send(LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,
LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT *dl_sched,
LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT *ul_sched);
void send(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
private:
......
......@@ -31,6 +31,8 @@
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
02/15/2015 Ben Wojtowicz Moved to new message queue.
07/25/2015 Ben Wojtowicz Combined the DL and UL schedule messages into
a single PHY schedule message.
*******************************************************************************/
......@@ -106,8 +108,7 @@ private:
LIBLTE_PHY_STRUCT *phy_struct;
// Downlink
void handle_dl_schedule(LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT *dl_sched);
void handle_ul_schedule(LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT *ul_sched);
void handle_phy_schedule(LTE_FDD_ENB_PHY_SCHEDULE_MSG_STRUCT *phy_sched);
void process_dl(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *tx_buf);
boost::mutex sys_info_mutex;
boost::mutex dl_sched_mutex;
......
/*******************************************************************************
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
......@@ -30,6 +30,8 @@
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
07/25/2015 Ben Wojtowicz Added parameters to abstract PHY sample rate
from radio sample rate.
*******************************************************************************/
......@@ -72,7 +74,9 @@ typedef struct{
typedef struct{
float i_buf[4][LIBLTE_PHY_N_SAMPS_PER_SUBFR_30_72MHZ];
float q_buf[4][LIBLTE_PHY_N_SAMPS_PER_SUBFR_30_72MHZ];
uint32 N_samps_per_ant;
uint16 current_tti;
uint8 N_ant;
}LTE_FDD_ENB_RADIO_TX_BUF_STRUCT;
typedef struct{
......@@ -108,7 +112,8 @@ public:
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);
uint32 get_phy_sample_rate(void);
uint32 get_radio_sample_rate(void);
void set_earfcns(int64 dl_earfcn, int64 ul_earfcn);
void send(LTE_FDD_ENB_RADIO_TX_BUF_STRUCT *buf);
......
......@@ -43,6 +43,8 @@
user support, and added multiple UMD RLC data
support.
03/11/2015 Ben Wojtowicz Added detach handling.
07/25/2015 Ben Wojtowicz Moved QoS structure to the user class and
fixed RLC AM TX and RX buffers.
*******************************************************************************/
......@@ -178,24 +180,6 @@ typedef enum{
}LTE_FDD_ENB_MAC_CONFIG_ENUM;
static const char LTE_fdd_enb_mac_config_text[LTE_FDD_ENB_MAC_CONFIG_N_ITEMS][20] = {"TM"};
typedef enum{
LTE_FDD_ENB_QOS_NONE = 0,
LTE_FDD_ENB_QOS_SIGNALLING,
LTE_FDD_ENB_QOS_DEFAULT_DATA,
LTE_FDD_ENB_QOS_N_ITEMS,
}LTE_FDD_ENB_QOS_ENUM;
static const char LTE_fdd_enb_qos_text[LTE_FDD_ENB_QOS_N_ITEMS][20] = {"None",
"Signalling",
"Default Data"};
typedef struct{
LTE_FDD_ENB_QOS_ENUM qos;
uint32 ul_tti_frequency;
uint32 dl_tti_frequency;
uint32 ul_bytes_per_subfn;
uint32 dl_bytes_per_subfn;
}LTE_FDD_ENB_QOS_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
......@@ -284,7 +268,7 @@ public:
uint16 get_rlc_vts(void);
void set_rlc_vts(uint16 vts);
void rlc_add_to_transmission_buffer(LIBLTE_RLC_AMD_PDU_STRUCT *amd_pdu);
void rlc_update_transmission_buffer(uint32 ack_sn);
void rlc_update_transmission_buffer(LIBLTE_RLC_STATUS_PDU_STRUCT *status);
void rlc_start_t_poll_retransmit(void);
void rlc_stop_t_poll_retransmit(void);
void handle_t_poll_retransmit_timer_expiry(uint32 timer_id);
......@@ -303,9 +287,6 @@ public:
LTE_FDD_ENB_ERROR_ENUM get_next_mac_sdu(LIBLTE_BYTE_MSG_STRUCT **sdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_mac_sdu(void);
LTE_FDD_ENB_MAC_CONFIG_ENUM get_mac_config(void);
void start_ul_sched_timer(uint32 m_seconds);
void stop_ul_sched_timer(void);
void handle_ul_sched_timer_expiry(uint32 timer_id);
void set_last_tti(uint32 last_tti);
uint32 get_last_tti(void);
void set_con_res_id(uint64 con_res_id);
......@@ -323,14 +304,6 @@ public:
void set_log_chan_group(uint8 lcg);
uint8 get_log_chan_group(void);
// Generic
void set_qos(LTE_FDD_ENB_QOS_ENUM _qos);
LTE_FDD_ENB_QOS_ENUM get_qos(void);
uint32 get_qos_ul_tti_freq(void);
uint32 get_qos_dl_tti_freq(void);
uint32 get_qos_ul_bytes_per_subfn(void);
uint32 get_qos_dl_bytes_per_subfn(void);
private:
// Identity
LTE_FDD_ENB_RB_ENUM rb;
......@@ -371,15 +344,13 @@ private:
boost::mutex rlc_sdu_queue_mutex;
std::list<LIBLTE_BYTE_MSG_STRUCT *> rlc_pdu_queue;
std::list<LIBLTE_BYTE_MSG_STRUCT *> rlc_sdu_queue;
std::map<uint16, LIBLTE_BYTE_MSG_STRUCT *> rlc_am_reception_buffer;
std::map<uint16, LIBLTE_RLC_AMD_PDU_STRUCT *> rlc_am_reception_buffer;
std::map<uint16, LIBLTE_RLC_AMD_PDU_STRUCT *> rlc_am_transmission_buffer;
std::map<uint16, LIBLTE_BYTE_MSG_STRUCT *> rlc_um_reception_buffer;
LTE_FDD_ENB_RLC_CONFIG_ENUM rlc_config;
uint16 rlc_vrr;
uint16 rlc_vrmr;
uint16 rlc_vrh;
uint16 rlc_first_am_segment_sn;
uint16 rlc_last_am_segment_sn;
uint16 rlc_vta;
uint16 rlc_vtms;
uint16 rlc_vts;
......@@ -395,8 +366,6 @@ private:
std::list<LIBLTE_BYTE_MSG_STRUCT *> mac_sdu_queue;
LTE_FDD_ENB_MAC_CONFIG_ENUM mac_config;
uint64 mac_con_res_id;
uint32 ul_sched_timer_m_seconds;
uint32 ul_sched_timer_id;
uint32 mac_last_tti;
uint32 t_poll_retransmit_timer_id;
bool mac_send_con_res_id;
......@@ -414,8 +383,6 @@ private:
LTE_FDD_ENB_ERROR_ENUM get_next_msg(boost::mutex *mutex, std::list<LIBLTE_BYTE_MSG_STRUCT *> *queue, LIBLTE_BYTE_MSG_STRUCT **msg);
LTE_FDD_ENB_ERROR_ENUM delete_next_msg(boost::mutex *mutex, std::list<LIBLTE_BIT_MSG_STRUCT *> *queue);
LTE_FDD_ENB_ERROR_ENUM delete_next_msg(boost::mutex *mutex, std::list<LIBLTE_BYTE_MSG_STRUCT *> *queue);
LTE_FDD_ENB_QOS_STRUCT avail_qos[LTE_FDD_ENB_QOS_N_ITEMS];
LTE_FDD_ENB_QOS_ENUM qos;
};
#endif /* __LTE_FDD_ENB_RB_H__ */
......@@ -35,6 +35,9 @@
timer support.
12/16/2014 Ben Wojtowicz Changed the delayed delete functionality.
02/15/2015 Ben Wojtowicz Added clear_rbs and fixed copy_rbs.
07/25/2015 Ben Wojtowicz Moved the QoS structure from the RB class to
the user class and got rid of the cached
copy of pusch_mac_pdu;
*******************************************************************************/
......@@ -84,6 +87,24 @@ typedef struct{
uint8 k_rrc_int[32];
}LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT;
typedef enum{
LTE_FDD_ENB_QOS_NONE = 0,
LTE_FDD_ENB_QOS_SIGNALLING,
LTE_FDD_ENB_QOS_DEFAULT_DATA,
LTE_FDD_ENB_QOS_N_ITEMS,
}LTE_FDD_ENB_QOS_ENUM;
static const char LTE_fdd_enb_qos_text[LTE_FDD_ENB_QOS_N_ITEMS][20] = {"None",
"Signalling",
"Default Data"};
typedef struct{
LTE_FDD_ENB_QOS_ENUM qos;
uint32 ul_tti_frequency;
uint32 dl_tti_frequency;
uint32 ul_bytes_per_subfn;
uint32 dl_bytes_per_subfn;
}LTE_FDD_ENB_QOS_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
......@@ -176,11 +197,18 @@ public:
void flip_dl_ndi(void);
bool get_ul_ndi(void);
void flip_ul_ndi(void);
LIBLTE_MAC_PDU_STRUCT pusch_mac_pdu;
void start_ul_sched_timer(uint32 m_seconds);
void stop_ul_sched_timer(void);
// Generic
void set_N_del_ticks(uint32 N_ticks);
uint32 get_N_del_ticks(void);
void set_qos(LTE_FDD_ENB_QOS_ENUM _qos);
LTE_FDD_ENB_QOS_ENUM get_qos(void);
uint32 get_qos_ul_tti_freq(void);
uint32 get_qos_dl_tti_freq(void);
uint32 get_qos_ul_bytes_per_subfn(void);
uint32 get_qos_dl_bytes_per_subfn(void);
private:
// Identity
......@@ -225,12 +253,16 @@ private:
bool eit_flag;
// MAC
bool dl_ndi;
bool ul_ndi;
uint32 ul_sched_timer_m_seconds;
uint32 ul_sched_timer_id;
bool dl_ndi;
bool ul_ndi;
// Generic
void handle_timer_expiry(uint32 timer_id);
uint32 N_del_ticks;
LTE_FDD_ENB_QOS_STRUCT avail_qos[LTE_FDD_ENB_QOS_N_ITEMS];
LTE_FDD_ENB_QOS_ENUM qos;
uint32 N_del_ticks;
};
#endif /* __LTE_FDD_ENB_USER_H__ */
......@@ -37,6 +37,9 @@
and DL and UL center frequencies.
11/01/2014 Ben Wojtowicz Added config file support.
03/15/2015 Ben Wojtowicz Fixed uninitialized variables.
07/25/2015 Ben Wojtowicz Added config file support for TX/RX gains
and changed the default time alignment timer
to 10240 subframes.
*******************************************************************************/
......@@ -152,6 +155,8 @@ LTE_fdd_enb_cnfg_db::LTE_fdd_enb_cnfg_db()
var_map_uint32[LTE_FDD_ENB_PARAM_DNS_ADDR] = 0xC0A80101;
var_map_int64[LTE_FDD_ENB_PARAM_USE_CNFG_FILE] = 0;
var_map_int64[LTE_FDD_ENB_PARAM_USE_USER_FILE] = 0;
var_map_int64[LTE_FDD_ENB_PARAM_TX_GAIN] = 0;
var_map_int64[LTE_FDD_ENB_PARAM_RX_GAIN] = 0;
use_cnfg_file = false;
}
LTE_fdd_enb_cnfg_db::~LTE_fdd_enb_cnfg_db()
......@@ -199,6 +204,10 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_cnfg_db::set_param(LTE_FDD_ENB_PARAM_ENUM par
}else{
hss->set_use_user_file(false);
}
}else if(LTE_FDD_ENB_PARAM_TX_GAIN == param){
radio->set_tx_gain(value);
}else if(LTE_FDD_ENB_PARAM_RX_GAIN == param){
radio->set_rx_gain(value);
}
if(use_cnfg_file)
......@@ -652,7 +661,7 @@ void LTE_fdd_enb_cnfg_db::construct_sys_info(void)
sys_info.sib2.ul_bw.present = false;
sys_info.sib2.additional_spectrum_emission = 1;
sys_info.sib2.mbsfn_subfr_cnfg_list_size = 0;
sys_info.sib2.time_alignment_timer = LIBLTE_RRC_TIME_ALIGNMENT_TIMER_SF500;
sys_info.sib2.time_alignment_timer = LIBLTE_RRC_TIME_ALIGNMENT_TIMER_SF10240;
// SIB3
sys_info.sib3_present = false;
......@@ -1043,6 +1052,10 @@ void LTE_fdd_enb_cnfg_db::write_cnfg_file(void)
fprintf(cnfg_file, "%s %08X\n", LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_DNS_ADDR], (*iter_u32).second);
iter_i64 = var_map_int64.find(LTE_FDD_ENB_PARAM_USE_USER_FILE);
fprintf(cnfg_file, "%s %lld\n", LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_USE_USER_FILE], (*iter_i64).second);
iter_i64 = var_map_int64.find(LTE_FDD_ENB_PARAM_TX_GAIN);
fprintf(cnfg_file, "%s %lld\n", LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_TX_GAIN], (*iter_i64).second);
iter_i64 = var_map_int64.find(LTE_FDD_ENB_PARAM_RX_GAIN);
fprintf(cnfg_file, "%s %lld\n", LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_RX_GAIN], (*iter_i64).second);
fclose(cnfg_file);
}
......
#line 2 "LTE_fdd_enb_hss.cc" // Make __FILE__ omit the path
/*******************************************************************************
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
......@@ -32,6 +32,8 @@
11/01/2014 Ben Wojtowicz Added user file support.
11/29/2014 Ben Wojtowicz Added support for regenerating eNodeB
security data.
07/25/2015 Ben Wojtowicz Moved away from using boost::lexical_cast
in del_user.
*******************************************************************************/
......@@ -43,6 +45,7 @@
#include "LTE_fdd_enb_cnfg_db.h"
#include "liblte_security.h"
#include <boost/lexical_cast.hpp>
#include <iomanip>
/*******************************************************************************
DEFINES
......@@ -191,12 +194,22 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_hss::del_user(std::string imsi)
{
boost::mutex::scoped_lock lock(user_mutex);
std::list<LTE_FDD_ENB_HSS_USER_STRUCT *>::iterator iter;
LTE_FDD_ENB_HSS_USER_STRUCT *user = NULL;
LTE_FDD_ENB_ERROR_ENUM err = LTE_FDD_ENB_ERROR_USER_NOT_FOUND;
LTE_FDD_ENB_HSS_USER_STRUCT *user = NULL;
LTE_FDD_ENB_ERROR_ENUM err = LTE_FDD_ENB_ERROR_USER_NOT_FOUND;
const char *imsi_str = imsi.c_str();
uint64 imsi_num;
uint32 i;
imsi_num = 0;
for(i=0; i<15; i++)
{
imsi_num *= 10;
imsi_num += imsi_str[i] - '0';
}
for(iter=user_list.begin(); iter!=user_list.end(); iter++)
{
if(imsi == boost::lexical_cast<std::string>((*iter)->id.imsi))
if(imsi_num == (*iter)->id.imsi)
{
user = (*iter);
user_list.erase(iter);
......@@ -219,6 +232,7 @@ std::string LTE_fdd_enb_hss::print_all_users(void)
boost::mutex::scoped_lock lock(user_mutex);
std::list<LTE_FDD_ENB_HSS_USER_STRUCT *>::iterator iter;
std::string output;
std::stringstream tmp_ss;
uint32 i;
uint32 hex_val;
......@@ -226,8 +240,11 @@ std::string LTE_fdd_enb_hss::print_all_users(void)
for(iter=user_list.begin(); iter!=user_list.end(); iter++)
{
output += "\n";
output += "imsi=" + boost::lexical_cast<std::string>((*iter)->id.imsi);
output += " imei=" + boost::lexical_cast<std::string>((*iter)->id.imei);
tmp_ss << std::setw(15) << std::setfill('0') << (*iter)->id.imsi;
output += "imsi=" + tmp_ss.str();
tmp_ss.seekp(0);
tmp_ss << std::setw(15) << std::setfill('0') << (*iter)->id.imei;
output += " imei=" + tmp_ss.str();
output += " k=";
for(i=0; i<16; i++)
{
......
......@@ -45,6 +45,7 @@
02/15/2015 Ben Wojtowicz Moved to new message queue, added IP pcap
support, and added UTC time to the log port.
03/11/2015 Ben Wojtowicz Made a common routine for formatting time.
07/25/2015 Ben Wojtowicz Added config file support for TX/RX gains.
*******************************************************************************/
......@@ -166,6 +167,8 @@ LTE_fdd_enb_interface::LTE_fdd_enb_interface()
var_map[LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_DNS_ADDR]] = (LTE_FDD_ENB_VAR_STRUCT){LTE_FDD_ENB_VAR_TYPE_HEX, LTE_FDD_ENB_PARAM_DNS_ADDR, 0, 0, 0, 0, true, false, false};
var_map[LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_USE_CNFG_FILE]] = (LTE_FDD_ENB_VAR_STRUCT){LTE_FDD_ENB_VAR_TYPE_INT64, LTE_FDD_ENB_PARAM_USE_CNFG_FILE, 0, 0, 0, 1, false, true, false};
var_map[LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_USE_USER_FILE]] = (LTE_FDD_ENB_VAR_STRUCT){LTE_FDD_ENB_VAR_TYPE_INT64, LTE_FDD_ENB_PARAM_USE_USER_FILE, 0, 0, 0, 1, false, true, false};
var_map[LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_TX_GAIN]] = (LTE_FDD_ENB_VAR_STRUCT){LTE_FDD_ENB_VAR_TYPE_INT64, LTE_FDD_ENB_PARAM_TX_GAIN, 0, 0, 0, 100, false, true, false};
var_map[LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_RX_GAIN]] = (LTE_FDD_ENB_VAR_STRUCT){LTE_FDD_ENB_VAR_TYPE_INT64, LTE_FDD_ENB_PARAM_RX_GAIN, 0, 0, 0, 100, false, true, false};
debug_type_mask = 0;
for(i=0; i<LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS; i++)
......@@ -868,10 +871,6 @@ void LTE_fdd_enb_interface::handle_read(std::string msg)
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, selected_radio.name);
}else if(std::string::npos != msg.find(LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_SELECTED_RADIO_IDX])){
send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, boost::lexical_cast<std::string>(radio->get_selected_radio_idx()));
}else if(std::string::npos != msg.find(LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_TX_GAIN])){
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{
......@@ -954,12 +953,6 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_interface::handle_write(std::string msg)
{
u_value = boost::lexical_cast<uint32>(msg.substr(msg.find(" ")+1, std::string::npos));
err = radio->set_selected_radio_idx(u_value);
}else if(std::string::npos != msg.find(LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_TX_GAIN])){
u_value = boost::lexical_cast<uint32>(msg.substr(msg.find(" ")+1, std::string::npos));
err = radio->set_tx_gain(u_value);
}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));
err = radio->set_rx_gain(u_value);
}else if(std::string::npos != msg.find(LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_CLOCK_SOURCE])){
err = radio->set_clock_source(msg.substr(msg.find(" ")+1, std::string::npos));
}else{
......@@ -1225,26 +1218,6 @@ void LTE_fdd_enb_interface::handle_help(void)
}
send_ctrl_msg(tmp_str);
tmp_str = "\t\t";
tmp_str += LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_TX_GAIN];
tmp_str += " = ";
try
{
tmp_str += boost::lexical_cast<std::string>(radio->get_tx_gain());
}catch(...){
// Intentionally do nothing
}
send_ctrl_msg(tmp_str);
tmp_str = "\t\t";
tmp_str += LTE_fdd_enb_param_text[LTE_FDD_ENB_PARAM_RX_GAIN];
tmp_str += " = ";
try
{
tmp_str += boost::lexical_cast<std::string>(radio->get_rx_gain());
}catch(...){
// 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();
......
......@@ -49,6 +49,9 @@
C-RNTI release, changed RTS timing, and
added DL QoS TTI frequency.
03/15/2015 Ben Wojtowicz Fixed RTS issues.
07/25/2015 Ben Wojtowicz Combined the DL and UL schedule messages into
a single PHY schedule message and using a
local copy of LIBLTE_MAC_PDU_STRUCT.
*******************************************************************************/
......@@ -324,14 +327,9 @@ void LTE_fdd_enb_mac::handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT
if(rts->late)
{
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_DL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_dl_subfr[sched_cur_dl_subfn],
sizeof(LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT));
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_UL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_ul_subfr[sched_cur_ul_subfn],
sizeof(LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT));
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_PHY_SCHEDULE,
&sched_dl_subfr[sched_cur_dl_subfn],
&sched_ul_subfr[sched_cur_ul_subfn]);
for(i=0; i<2; i++)
{
......@@ -356,14 +354,9 @@ void LTE_fdd_enb_mac::handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT
}
}else if(rts->dl_current_tti == sched_dl_subfr[sched_cur_dl_subfn].current_tti &&
rts->ul_current_tti == sched_ul_subfr[sched_cur_ul_subfn].current_tti){
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_DL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_dl_subfr[sched_cur_dl_subfn],
sizeof(LTE_FDD_ENB_DL_SCHEDULE_MSG_STRUCT));
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_UL_SCHEDULE,
LTE_FDD_ENB_DEST_LAYER_PHY,
(LTE_FDD_ENB_MESSAGE_UNION *)&sched_ul_subfr[sched_cur_ul_subfn],
sizeof(LTE_FDD_ENB_UL_SCHEDULE_MSG_STRUCT));
msgq_to_phy->send(LTE_FDD_ENB_MESSAGE_TYPE_PHY_SCHEDULE,
&sched_dl_subfr[sched_cur_dl_subfn],
&sched_ul_subfr[sched_cur_ul_subfn]);
// Advance the frame number combination
sched_dl_subfr[sched_cur_dl_subfn].current_tti = (sched_dl_subfr[sched_cur_dl_subfn].current_tti + 10) % (LTE_FDD_ENB_CURRENT_TTI_MAX + 1);
......@@ -409,9 +402,10 @@ void LTE_fdd_enb_mac::handle_pucch_decode(LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT *p
}
void LTE_fdd_enb_mac::handle_pusch_decode(LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT *pusch_decode)
{
LTE_fdd_enb_user_mgr *user_mgr = LTE_fdd_enb_user_mgr::get_instance();
LTE_fdd_enb_user *user = NULL;
uint32 i;
LTE_fdd_enb_user_mgr *user_mgr = LTE_fdd_enb_user_mgr::get_instance();
LTE_fdd_enb_user *user = NULL;
LIBLTE_MAC_PDU_STRUCT mac_pdu;
uint32 i;
// Find the user
if(LTE_FDD_ENB_ERROR_NONE == user_mgr->find_user(pusch_decode->rnti, &user))
......@@ -434,32 +428,32 @@ void LTE_fdd_enb_mac::handle_pusch_decode(LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT *p
pusch_decode->msg.N_bits);
// Set the correct channel type
user->pusch_mac_pdu.chan_type = LIBLTE_MAC_CHAN_TYPE_ULSCH;
mac_pdu.chan_type = LIBLTE_MAC_CHAN_TYPE_ULSCH;
// Unpack MAC PDU
liblte_mac_unpack_mac_pdu(&pusch_decode->msg,
&user->pusch_mac_pdu);
&mac_pdu);
for(i=0; i<user->pusch_mac_pdu.N_subheaders; i++)
for(i=0; i<mac_pdu.N_subheaders; i++)
{
if(LIBLTE_MAC_ULSCH_CCCH_LCID == user->pusch_mac_pdu.subheader[i].lcid)
if(LIBLTE_MAC_ULSCH_CCCH_LCID == mac_pdu.subheader[i].lcid)
{
handle_ulsch_ccch_sdu(user, user->pusch_mac_pdu.subheader[i].lcid, &user->pusch_mac_pdu.subheader[i].payload.sdu);
}else if(LIBLTE_MAC_ULSCH_DCCH_LCID_BEGIN <= user->pusch_mac_pdu.subheader[i].lcid &&
LIBLTE_MAC_ULSCH_DCCH_LCID_END >= user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_dcch_sdu(user, user->pusch_mac_pdu.subheader[i].lcid, &user->pusch_mac_pdu.subheader[i].payload.sdu);
}else if(LIBLTE_MAC_ULSCH_EXT_POWER_HEADROOM_REPORT_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_ext_power_headroom_report(user, &user->pusch_mac_pdu.subheader[i].payload.ext_power_headroom);
}else if(LIBLTE_MAC_ULSCH_POWER_HEADROOM_REPORT_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_power_headroom_report(user, &user->pusch_mac_pdu.subheader[i].payload.power_headroom);
}else if(LIBLTE_MAC_ULSCH_C_RNTI_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_c_rnti(&user, &user->pusch_mac_pdu.subheader[i].payload.c_rnti);
}else if(LIBLTE_MAC_ULSCH_TRUNCATED_BSR_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_truncated_bsr(user, &user->pusch_mac_pdu.subheader[i].payload.truncated_bsr);
}else if(LIBLTE_MAC_ULSCH_SHORT_BSR_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_short_bsr(user, &user->pusch_mac_pdu.subheader[i].payload.short_bsr);
}else if(LIBLTE_MAC_ULSCH_LONG_BSR_LCID == user->pusch_mac_pdu.subheader[i].lcid){
handle_ulsch_long_bsr(user, &user->pusch_mac_pdu.subheader[i].payload.long_bsr);
handle_ulsch_ccch_sdu(user, mac_pdu.subheader[i].lcid, &mac_pdu.subheader[i].payload.sdu);
}else if(LIBLTE_MAC_ULSCH_DCCH_LCID_BEGIN <= mac_pdu.subheader[i].lcid &&
LIBLTE_MAC_ULSCH_DCCH_LCID_END >= mac_pdu.subheader[i].lcid){
handle_ulsch_dcch_sdu(user, mac_pdu.subheader[i].lcid, &mac_pdu.subheader[i].payload.sdu);
}else if(LIBLTE_MAC_ULSCH_EXT_POWER_HEADROOM_REPORT_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_ext_power_headroom_report(user, &mac_pdu.subheader[i].payload.ext_power_headroom);
}else if(LIBLTE_MAC_ULSCH_POWER_HEADROOM_REPORT_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_power_headroom_report(user, &mac_pdu.subheader[i].payload.power_headroom);
}else if(LIBLTE_MAC_ULSCH_C_RNTI_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_c_rnti(&user, &mac_pdu.subheader[i].payload.c_rnti);
}else if(LIBLTE_MAC_ULSCH_TRUNCATED_BSR_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_truncated_bsr(user, &mac_pdu.subheader[i].payload.truncated_bsr);
}else if(LIBLTE_MAC_ULSCH_SHORT_BSR_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_short_bsr(user, &mac_pdu.subheader[i].payload.short_bsr);
}else if(LIBLTE_MAC_ULSCH_LONG_BSR_LCID == mac_pdu.subheader[i].lcid){
handle_ulsch_long_bsr(user, &mac_pdu.subheader[i].payload.long_bsr);
}
}
}else{
......@@ -484,7 +478,7 @@ void LTE_fdd_enb_mac::handle_sdu_ready(LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT *sdu
LIBLTE_BYTE_MSG_STRUCT *sdu;
uint32 current_tti;
uint32 last_tti = sdu_ready->rb->get_last_tti();
uint32 tti_freq = sdu_ready->rb->get_qos_dl_tti_freq();
uint32 tti_freq = sdu_ready->user->get_qos_dl_tti_freq();
if(LTE_FDD_ENB_ERROR_NONE == sdu_ready->rb->get_next_mac_sdu(&sdu))
{
......
......@@ -42,6 +42,8 @@
02/15/2015 Ben Wojtowicz Moved to new message queue, added more debug
log points, and using the fixed user switch.
03/11/2015 Ben Wojtowicz Added detach handling.
07/25/2015 Ben Wojtowicz Using the latest liblte and changed the
dedicated bearer QoS to 9.
*******************************************************************************/
......@@ -1376,7 +1378,6 @@ void LTE_fdd_enb_mme::send_attach_accept(LTE_fdd_enb_user *user,
user->get_auth_vec()->k_nas_int,
user->get_auth_vec()->nas_count_dl,
LIBLTE_SECURITY_DIRECTION_DOWNLINK,
rb->get_rb_id()-1,
&msg);
user->increment_nas_count_dl();
interface->send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_INFO,
......@@ -1531,7 +1532,6 @@ void LTE_fdd_enb_mme::send_detach_accept(LTE_fdd_enb_user *user,
user->get_auth_vec()->k_nas_int,
user->get_auth_vec()->nas_count_dl,
LIBLTE_SECURITY_DIRECTION_DOWNLINK,
rb->get_rb_id()-1,
&msg);
user->increment_nas_count_dl();
}else{
......@@ -1540,7 +1540,6 @@ void LTE_fdd_enb_mme::send_detach_accept(LTE_fdd_enb_user *user,
NULL,
0,
0,
0,
&msg);
}
interface->send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_INFO,
......@@ -1596,7 +1595,6 @@ void LTE_fdd_enb_mme::send_emm_information(LTE_fdd_enb_user *user,
user->get_auth_vec()->k_nas_int,
user->get_auth_vec()->nas_count_dl,
LIBLTE_SECURITY_DIRECTION_DOWNLINK,
rb->get_rb_id()-1,
&msg);
user->increment_nas_count_dl();
interface->send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_INFO,
......@@ -1696,7 +1694,6 @@ void LTE_fdd_enb_mme::send_security_mode_command(LTE_fdd_enb_user *user,
user->get_auth_vec()->k_nas_int,
user->get_a