Commit 99eccc54 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.18.2: Fixed several bugs in LTE_fdd_enodeb. Specifically, cleaned...

Version 0.18.2: Fixed several bugs in LTE_fdd_enodeb.  Specifically, cleaned up the Time Zone and Time IE and added C-RNTI support to get_tbs_mcs_and_N_prb_for_dl in liblte, added asymmetric QoS support, dynamically determining MCS for downlink data, sending EMM information 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.
parent 76945c80
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.18.1)
set(openLTE_version 0.18.2)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -155,3 +155,10 @@ v00.18.01 Added more MME encoding and decoding to the LTE library, pulled in
user deletion, ol extension to all message queues, ability to send
EMM information message, and QoS for default data services to
LTE_fdd_enodeb.
v00.18.02 Fixed several bugs in LTE_fdd_enodeb. Specifically, cleaned up the
Time Zone and Time IE and added C-RNTI support to
get_tbs_mcs_and_N_prb_for_dl in liblte, added asymmetric QoS support,
dynamically determining MCS for downlink data, sending EMM information
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.
......@@ -38,6 +38,7 @@
everything to byte messages structs, added
IP gateway and RLC UMD support.
12/16/2014 Ben Wojtowicz Added QoS for default data services.
12/24/2014 Ben Wojtowicz Added asymmetric QoS support.
*******************************************************************************/
......@@ -181,7 +182,8 @@ static const char LTE_fdd_enb_qos_text[LTE_FDD_ENB_QOS_N_ITEMS][20] = {"None",
typedef struct{
LTE_FDD_ENB_QOS_ENUM qos;
uint32 tti_frequency;
uint32 bytes_per_subfn;
uint32 ul_bytes_per_subfn;
uint32 dl_bytes_per_subfn;
}LTE_FDD_ENB_QOS_STRUCT;
/*******************************************************************************
......@@ -311,7 +313,8 @@ public:
void set_qos(LTE_FDD_ENB_QOS_ENUM _qos);
LTE_FDD_ENB_QOS_ENUM get_qos(void);
uint32 get_qos_tti_freq(void);
uint32 get_qos_bytes_per_subfn(void);
uint32 get_qos_ul_bytes_per_subfn(void);
uint32 get_qos_dl_bytes_per_subfn(void);
private:
// Identity
......
......@@ -42,6 +42,8 @@
11/01/2014 Ben Wojtowicz Added NDI toggling.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
12/24/2014 Ben Wojtowicz Dynamically determining MCS for downlink
data.
*******************************************************************************/
......@@ -514,7 +516,6 @@ void LTE_fdd_enb_mac::handle_sdu_ready(LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT *sdu
}
sys_info_mutex.unlock();
alloc.rnti = user->get_c_rnti();
alloc.mcs = 0;
alloc.tpc = LIBLTE_PHY_TPC_COMMAND_DCI_1_1A_1B_1D_2_3_DB_ZERO;
alloc.ndi = user->get_dl_ndi();
user->flip_dl_ndi();
......@@ -1009,11 +1010,13 @@ void LTE_fdd_enb_mac::scheduler(void)
// Pack the message and determine TBS
liblte_mac_pack_mac_pdu(&dl_sched->mac_pdu,
&dl_sched->alloc.msg);
liblte_phy_get_tbs_and_n_prb_for_dl(dl_sched->alloc.msg.N_bits,
sys_info.N_rb_dl,
dl_sched->alloc.mcs,
&dl_sched->alloc.tbs,
&dl_sched->alloc.N_prb);
liblte_phy_get_tbs_mcs_and_n_prb_for_dl(dl_sched->alloc.msg.N_bits,
dl_sched->current_tti % 10,
sys_info.N_rb_dl,
dl_sched->alloc.rnti,
&dl_sched->alloc.tbs,
&dl_sched->alloc.mcs,
&dl_sched->alloc.N_prb);
// Pad and repack if needed
if(dl_sched->alloc.tbs > dl_sched->alloc.msg.N_bits)
......@@ -1064,7 +1067,10 @@ void LTE_fdd_enb_mac::scheduler(void)
__FILE__,
__LINE__,
&dl_sched->alloc.msg,
"DL allocation sent for RNTI=%u CURRENT_TTI=%u",
"DL allocation (mcs=%u, tbs=%u, N_prb=%u) sent for RNTI=%u CURRENT_TTI=%u",
dl_sched->alloc.mcs,
dl_sched->alloc.tbs,
dl_sched->alloc.N_prb,
dl_sched->alloc.rnti,
sched_dl_subfr[sched_cur_dl_subfn].current_tti);
......
......@@ -38,6 +38,7 @@
request support.
12/16/2014 Ben Wojtowicz Added ol extension to message queue and
sending of EMM information message.
12/24/2014 Ben Wojtowicz Actually sending EMM information message.
*******************************************************************************/
......@@ -1081,6 +1082,7 @@ void LTE_fdd_enb_mme::attach_sm(LTE_fdd_enb_user *user,
send_attach_accept(user, rb);
break;
case LTE_FDD_ENB_MME_STATE_ATTACHED:
send_emm_information(user, rb);
send_rrc_command(user, rb, LTE_FDD_ENB_RRC_CMD_RELEASE);
break;
default:
......@@ -1382,16 +1384,20 @@ void LTE_fdd_enb_mme::send_emm_information(LTE_fdd_enb_user *user,
tmp_time = time(NULL);
broken_down_time = localtime(&tmp_time);
emm_info.full_net_name_present = false;
emm_info.short_net_name_present = false;
emm_info.full_net_name_present = true;
emm_info.full_net_name.name = "openLTE";
emm_info.full_net_name.add_ci = LIBLTE_MME_ADD_CI_DONT_ADD;
emm_info.short_net_name_present = true;
emm_info.short_net_name.name = "oLTE";
emm_info.short_net_name.add_ci = LIBLTE_MME_ADD_CI_DONT_ADD;
emm_info.local_time_zone_present = false;
emm_info.utc_and_local_time_zone_present = true;
emm_info.utc_and_local_time_zone.year = (((broken_down_time->tm_year % 100)/10) << 4) | (broken_down_time->tm_year % 10);
emm_info.utc_and_local_time_zone.month = ((broken_down_time->tm_mon/10) << 4) | (broken_down_time->tm_mon % 10);
emm_info.utc_and_local_time_zone.day = ((broken_down_time->tm_mday/10) << 4) | (broken_down_time->tm_mday % 10);
emm_info.utc_and_local_time_zone.hour = ((broken_down_time->tm_hour/10) << 4) | (broken_down_time->tm_hour % 10);
emm_info.utc_and_local_time_zone.minute = ((broken_down_time->tm_min/10) << 4) | (broken_down_time->tm_min % 10);
emm_info.utc_and_local_time_zone.second = ((broken_down_time->tm_sec/10) << 4) | (broken_down_time->tm_sec % 10);
emm_info.utc_and_local_time_zone.year = broken_down_time->tm_year;
emm_info.utc_and_local_time_zone.month = broken_down_time->tm_mon + 1;
emm_info.utc_and_local_time_zone.day = broken_down_time->tm_mday;
emm_info.utc_and_local_time_zone.hour = broken_down_time->tm_hour;
emm_info.utc_and_local_time_zone.minute = broken_down_time->tm_min;
emm_info.utc_and_local_time_zone.second = broken_down_time->tm_sec;
emm_info.utc_and_local_time_zone.tz = 0; // FIXME
emm_info.net_dst_present = false;
liblte_mme_pack_emm_information_msg(&emm_info,
......
......@@ -41,6 +41,7 @@
09/03/2014 Ben Wojtowicz Fixed stop issue.
12/16/2014 Ben Wojtowicz Pulled in a patch from Ruben Merz to add
USRP X300 support.
12/24/2014 Ben Wojtowicz Added more time spec information in debug.
*******************************************************************************/
......@@ -678,18 +679,20 @@ void* LTE_fdd_enb_radio::radio_thread_func(void *inputs)
num_samps = radio->rx_stream->recv(radio->rx_buf, radio->N_rx_samps, metadata);
if(0 != num_samps)
{
next_rx_ts_ticks = next_rx_ts.to_ticks(samp_rate);
metadata_ts_ticks = metadata.time_spec.to_ticks(samp_rate);
if(num_samps != radio->N_rx_samps)
{
interface->send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ERROR,
LTE_FDD_ENB_DEBUG_LEVEL_RADIO,
__FILE__,
__LINE__,
"RX packet size issue %u %u",
"RX packet size issue %u %u %lld %lld",
num_samps,
radio->N_rx_samps);
radio->N_rx_samps,
metadata_ts_ticks,
next_rx_ts_ticks);
}
next_rx_ts_ticks = next_rx_ts.to_ticks(samp_rate);
metadata_ts_ticks = metadata.time_spec.to_ticks(samp_rate);
if((next_rx_ts_ticks - metadata_ts_ticks) > 1)
{
// FIXME: Not sure this will ever happen
......
......@@ -39,6 +39,8 @@
everything to byte messages structs, added
IP gateway and RLC UMD support.
12/16/2014 Ben Wojtowicz Added QoS for default data services.
12/24/2014 Ben Wojtowicz Added asymmetric QoS support and fixed a
UMD reassembly bug.
*******************************************************************************/
......@@ -148,9 +150,9 @@ LTE_fdd_enb_rb::LTE_fdd_enb_rb(LTE_FDD_ENB_RB_ENUM _rb,
mac_con_res_id = 0;
// Setup the QoS
avail_qos[0] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_NONE, 0, 0};
avail_qos[1] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_SIGNALLING, 20, 22};
avail_qos[2] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_DEFAULT_DATA, 20, 150};
avail_qos[0] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_NONE, 0, 0, 0};
avail_qos[1] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_SIGNALLING, 20, 22, 22};
avail_qos[2] = (LTE_FDD_ENB_QOS_STRUCT){LTE_FDD_ENB_QOS_DEFAULT_DATA, 20, 22, 250};
qos = LTE_FDD_ENB_QOS_NONE;
}
LTE_fdd_enb_rb::~LTE_fdd_enb_rb()
......@@ -692,6 +694,10 @@ void LTE_fdd_enb_rb::rlc_add_to_um_reception_buffer(LIBLTE_RLC_UMD_PDU_STRUCT *u
}else if(LIBLTE_RLC_FI_FIELD_LAST_SDU_SEGMENT == umd_pdu->hdr.fi){
rlc_last_um_segment_sn = umd_pdu->hdr.sn;
}
if(rlc_last_um_segment_sn < rlc_first_um_segment_sn)
{
rlc_last_um_segment_sn = 0xFFFF;
}
}else{
delete new_pdu;
}
......@@ -786,7 +792,7 @@ void LTE_fdd_enb_rb::handle_ul_sched_timer_expiry(uint32 timer_id)
{
LTE_fdd_enb_mac *mac = LTE_fdd_enb_mac::get_instance();
mac->sched_ul(user, avail_qos[qos].bytes_per_subfn*8);
mac->sched_ul(user, avail_qos[qos].ul_bytes_per_subfn*8);
if(LTE_FDD_ENB_RRC_PROC_IDLE != rrc_procedure &&
LTE_FDD_ENB_RRC_STATE_IDLE != rrc_state)
{
......@@ -955,7 +961,11 @@ uint32 LTE_fdd_enb_rb::get_qos_tti_freq(void)
{
return(avail_qos[qos].tti_frequency);
}
uint32 LTE_fdd_enb_rb::get_qos_bytes_per_subfn(void)
uint32 LTE_fdd_enb_rb::get_qos_ul_bytes_per_subfn(void)
{
return(avail_qos[qos].ul_bytes_per_subfn);
}
uint32 LTE_fdd_enb_rb::get_qos_dl_bytes_per_subfn(void)
{
return(avail_qos[qos].bytes_per_subfn);
return(avail_qos[qos].dl_bytes_per_subfn);
}
......@@ -35,6 +35,7 @@
11/29/2014 Ben Wojtowicz Using the byte message structure and added
UMD support.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
12/24/2014 Ben Wojtowicz Using asymmetric QoS.
*******************************************************************************/
......@@ -595,7 +596,7 @@ void LTE_fdd_enb_rlc::handle_um_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu,
LIBLTE_RLC_UMD_PDU_STRUCT umd;
LIBLTE_BYTE_MSG_STRUCT pdu;
uint32 byte_idx = 0;
uint32 bytes_per_subfn = rb->get_qos_bytes_per_subfn();
uint32 bytes_per_subfn = rb->get_qos_dl_bytes_per_subfn();
uint16 vtus = rb->get_rlc_vtus();
if(sdu->N_bytes <= bytes_per_subfn)
......@@ -689,7 +690,7 @@ void LTE_fdd_enb_rlc::handle_am_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu,
{
LIBLTE_RLC_AMD_PDU_STRUCT amd;
uint32 byte_idx = 0;
uint32 bytes_per_subfn = rb->get_qos_bytes_per_subfn();
uint32 bytes_per_subfn = rb->get_qos_dl_bytes_per_subfn();
uint16 vts = rb->get_rlc_vts();
if(sdu->N_bytes <= bytes_per_subfn)
......
......@@ -38,6 +38,8 @@
11/29/2014 Ben Wojtowicz Added DRB1 and DRB2 support and user
recovery on RRC connection request.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
12/24/2014 Ben Wojtowicz Using default data QoS and copying SRB1
PDCP config to SRB2.
*******************************************************************************/
......@@ -336,6 +338,7 @@ void LTE_fdd_enb_rrc::handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd)
srb2->set_rrc_state(cmd->rb->get_rrc_state());
srb2->set_mme_procedure(cmd->rb->get_mme_procedure());
srb2->set_mme_state(cmd->rb->get_mme_state());
srb2->set_pdcp_config(cmd->rb->get_pdcp_config());
srb2->set_qos(cmd->rb->get_qos());
// Configure DRB1
......@@ -343,7 +346,7 @@ void LTE_fdd_enb_rrc::handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd)
drb1->set_drb_id(1);
drb1->set_lc_id(3);
drb1->set_log_chan_group(2);
drb1->set_qos(cmd->rb->get_qos());
drb1->set_qos(LTE_FDD_ENB_QOS_DEFAULT_DATA);
if(LTE_FDD_ENB_ERROR_NONE == cmd->rb->get_next_rrc_nas_msg(&msg))
{
......@@ -370,6 +373,7 @@ void LTE_fdd_enb_rrc::handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd)
srb2->set_rrc_state(cmd->rb->get_rrc_state());
srb2->set_mme_procedure(cmd->rb->get_mme_procedure());
srb2->set_mme_state(cmd->rb->get_mme_state());
srb2->set_pdcp_config(cmd->rb->get_pdcp_config());
srb2->set_qos(cmd->rb->get_qos());
// Configure DRB1
......@@ -377,14 +381,14 @@ void LTE_fdd_enb_rrc::handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd)
drb1->set_drb_id(1);
drb1->set_lc_id(3);
drb1->set_log_chan_group(2);
drb1->set_qos(cmd->rb->get_qos());
drb1->set_qos(LTE_FDD_ENB_QOS_DEFAULT_DATA);
// Configure DRB2
drb2->set_eps_bearer_id(cmd->user->get_eps_bearer_id()+1);
drb2->set_drb_id(2);
drb2->set_lc_id(4);
drb2->set_log_chan_group(3);
drb2->set_qos(cmd->rb->get_qos());
drb2->set_qos(LTE_FDD_ENB_QOS_DEFAULT_DATA);
if(LTE_FDD_ENB_ERROR_NONE == cmd->rb->get_next_rrc_nas_msg(&msg))
{
......
......@@ -35,6 +35,8 @@
C-RNTI transfer, added more ways to add,
delete, and find users.
12/16/2014 Ben Wojtowicz Added delayed user delete functionality.
12/24/2014 Ben Wojtowicz Hack to get around a crash when releasing a
C-RNTI.
*******************************************************************************/
......@@ -634,6 +636,7 @@ void LTE_fdd_enb_user_mgr::handle_c_rnti_timer_expiry(uint32 timer_id)
timer_id_map_forward.erase(forward_iter);
timer_id_mutex.unlock();
release_c_rnti(c_rnti);
// FIXME: TIMER_ID_MAP IS NOT UPDATED WHEN C-RNTI IS TRANSFERRED
// release_c_rnti(c_rnti);
}
}
......@@ -30,6 +30,7 @@
11/01/2014 Ben Wojtowicz Added more decoding/encoding.
11/29/2014 Ben Wojtowicz Added more decoding/encoding.
12/16/2014 Ben Wojtowicz Added more decoding/encoding.
12/24/2014 Ben Wojtowicz Cleaned up the Time Zone and Time IE.
*******************************************************************************/
......@@ -1340,13 +1341,13 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8 **ie_ptr,
// Enums
// Structs
typedef struct{
uint8 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 tz;
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 tz;
}LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT;
// Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT *ttz,
......
......@@ -31,6 +31,7 @@
11/01/2014 Ben Wojtowicz Added more decoding/encoding.
11/29/2014 Ben Wojtowicz Added more decoding/encoding.
12/16/2014 Ben Wojtowicz Added more decoding/encoding.
12/24/2014 Ben Wojtowicz Cleaned up the Time Zone and Time IE.
*******************************************************************************/
......@@ -2642,12 +2643,12 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND
if(ttz != NULL &&
ie_ptr != NULL)
{
(*ie_ptr)[0] = ttz->year;
(*ie_ptr)[1] = ttz->month;
(*ie_ptr)[2] = ttz->day;
(*ie_ptr)[3] = ttz->hour;
(*ie_ptr)[4] = ttz->minute;
(*ie_ptr)[5] = ttz->second;
(*ie_ptr)[0] = ((ttz->year % 10) << 4) | ((ttz->year % 100) / 10);
(*ie_ptr)[1] = ((ttz->month % 10) << 4) | (ttz->month / 10);
(*ie_ptr)[2] = ((ttz->day % 10) << 4) | (ttz->day / 10);
(*ie_ptr)[3] = ((ttz->hour % 10) << 4) | (ttz->hour / 10);
(*ie_ptr)[4] = ((ttz->minute % 10) << 4) | (ttz->minute / 10);
(*ie_ptr)[5] = ((ttz->second % 10) << 4) | (ttz->second / 10);
(*ie_ptr)[6] = ttz->tz;
*ie_ptr += 7;
......@@ -2664,12 +2665,12 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8
if(ie_ptr != NULL &&
ttz != NULL)
{
ttz->year = (*ie_ptr)[0];
ttz->month = (*ie_ptr)[1];
ttz->day = (*ie_ptr)[2];
ttz->hour = (*ie_ptr)[3];
ttz->minute = (*ie_ptr)[4];
ttz->second = (*ie_ptr)[5];
ttz->year = 2000 + (((*ie_ptr)[0] & 0x0F) * 10) + (((*ie_ptr)[0] >> 4) & 0x0F);
ttz->month = (((*ie_ptr)[1] & 0x0F) * 10) + (((*ie_ptr)[1] >> 4) & 0x0F);
ttz->day = (((*ie_ptr)[2] & 0x0F) * 10) + (((*ie_ptr)[2] >> 4) & 0x0F);
ttz->hour = (((*ie_ptr)[3] & 0x0F) * 10) + (((*ie_ptr)[3] >> 4) & 0x0F);
ttz->minute = (((*ie_ptr)[4] & 0x0F) * 10) + (((*ie_ptr)[4] >> 4) & 0x0F);
ttz->second = (((*ie_ptr)[5] & 0x0F) * 10) + (((*ie_ptr)[5] >> 4) & 0x0F);
ttz->tz = (*ie_ptr)[6];
*ie_ptr += 7;
......
......@@ -101,6 +101,8 @@
bits_2_value functions.
11/29/2014 Ben Wojtowicz Using the common liblte_value_2_bits and
liblte_bits_2_value functions.
12/24/2014 Ben Wojtowicz Added C-RNTI support to
get_tbs_mcs_and_N_prb_for_dl.
*******************************************************************************/
......@@ -5923,6 +5925,7 @@ LIBLTE_ERROR_ENUM liblte_phy_get_tbs_mcs_and_n_prb_for_dl(uint32 N_bits,
{
LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS;
uint32 i;
uint32 j;
uint32 code_rate;
uint32 N_prb_tmp;
uint32 N_bits_per_prb;
......@@ -5971,7 +5974,28 @@ LIBLTE_ERROR_ENUM liblte_phy_get_tbs_mcs_and_n_prb_for_dl(uint32 N_bits,
err = LIBLTE_SUCCESS;
}
}else{
// FIXME: Add support for other RNTIs
*N_prb = 0;
for(i=0; i<27; i++)
{
for(j=0; j<N_rb_dl; j++)
{
if(N_bits <= TBS_71721[i][j])
{
*tbs = TBS_71721[i][j];
*mcs = i;
*N_prb = j + 1;
break;
}
}
if(*N_prb != 0)
{
break;
}
}
if(*N_prb != 0)
{
err = LIBLTE_SUCCESS;
}
}
}
......
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