From 12603e4da258e180a5dbb98dc906fccf2273e71f Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Wed, 2 Aug 2017 15:47:49 +0100 Subject: [PATCH 1/4] Bugfix for RRC ASN MeasConfig packing --- lib/src/asn1/liblte_rrc.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/asn1/liblte_rrc.cc b/lib/src/asn1/liblte_rrc.cc index 3bfa4a540..e4621994e 100644 --- a/lib/src/asn1/liblte_rrc.cc +++ b/lib/src/asn1/liblte_rrc.cc @@ -2006,6 +2006,7 @@ LIBLTE_ERROR_ENUM liblte_rrc_pack_meas_object_eutra_ie(LIBLTE_RRC_MEAS_OBJECT_EU liblte_value_2_bits(0, ie_ptr, 1); // Optional indicators + liblte_value_2_bits(meas_obj_eutra->offset_freq_not_default, ie_ptr, 1); liblte_value_2_bits(meas_obj_eutra->cells_to_remove_list_present, ie_ptr, 1); if(0 != meas_obj_eutra->N_cells_to_add_mod) { @@ -2035,7 +2036,10 @@ LIBLTE_ERROR_ENUM liblte_rrc_pack_meas_object_eutra_ie(LIBLTE_RRC_MEAS_OBJECT_EU liblte_rrc_pack_neigh_cell_config_ie(meas_obj_eutra->neigh_cell_cnfg, ie_ptr); // Offset Freq - liblte_rrc_pack_q_offset_range_ie(meas_obj_eutra->offset_freq, ie_ptr); + if(meas_obj_eutra->offset_freq_not_default) + { + liblte_rrc_pack_q_offset_range_ie(meas_obj_eutra->offset_freq, ie_ptr); + } // Cells To Remove List if(meas_obj_eutra->cells_to_remove_list_present) @@ -2329,6 +2333,9 @@ LIBLTE_ERROR_ENUM liblte_rrc_pack_meas_object_to_add_mod_list_ie(LIBLTE_RRC_MEAS // Meas Object ID liblte_rrc_pack_meas_object_id_ie(list->meas_obj_list[i].meas_obj_id, ie_ptr); + // Meas Object Choice Extension + liblte_value_2_bits(0, ie_ptr, 1); // Choice from before extension marker + // Meas Object Choice liblte_value_2_bits(list->meas_obj_list[i].meas_obj_type, ie_ptr, 2); From c474b24d3245ed69b66f9fbcc39fc21408f16df4 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 7 Aug 2017 13:17:11 +0200 Subject: [PATCH 2/4] add basic NAS configuration class --- lib/include/srslte/common/interfaces_common.h | 11 +++++++++++ srsue/hdr/upper/nas.h | 4 ++-- srsue/src/upper/nas.cc | 10 +++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/include/srslte/common/interfaces_common.h b/lib/include/srslte/common/interfaces_common.h index 44b1c5338..d919d9fe5 100644 --- a/lib/include/srslte/common/interfaces_common.h +++ b/lib/include/srslte/common/interfaces_common.h @@ -34,6 +34,17 @@ namespace srslte { +class srslte_nas_config_t +{ +public: + srslte_nas_config_t(uint32_t lcid_ = 0) + :lcid(lcid_) + {} + + uint32_t lcid; +}; + + class srslte_pdcp_config_t { public: diff --git a/srsue/hdr/upper/nas.h b/srsue/hdr/upper/nas.h index ae3dfe246..32afd52bb 100644 --- a/srsue/hdr/upper/nas.h +++ b/srsue/hdr/upper/nas.h @@ -66,7 +66,7 @@ public: rrc_interface_nas *rrc_, gw_interface_nas *gw_, srslte::log *nas_log_, - uint32_t lcid_); + srslte::srslte_nas_config_t cfg_); void stop(); emm_state_t get_state(); @@ -84,7 +84,7 @@ private: rrc_interface_nas *rrc; usim_interface_nas *usim; gw_interface_nas *gw; - uint32_t default_lcid; + srslte::srslte_nas_config_t cfg; emm_state_t state; diff --git a/srsue/src/upper/nas.cc b/srsue/src/upper/nas.cc index 440ac77e4..1595a2cec 100644 --- a/srsue/src/upper/nas.cc +++ b/srsue/src/upper/nas.cc @@ -44,14 +44,14 @@ void nas::init(usim_interface_nas *usim_, rrc_interface_nas *rrc_, gw_interface_nas *gw_, srslte::log *nas_log_, - uint32_t lcid_) + srslte::srslte_nas_config_t cfg_) { pool = byte_buffer_pool::get_instance(); usim = usim_; rrc = rrc_; gw = gw_; nas_log = nas_log_; - default_lcid = lcid_; + cfg = cfg_; } void nas::stop() @@ -574,7 +574,7 @@ void nas::send_attach_request() liblte_mme_pack_attach_request_msg(&attach_req, (LIBLTE_BYTE_MSG_STRUCT*)msg); nas_log->info("Sending attach request\n"); - rrc->write_sdu(default_lcid, msg); + rrc->write_sdu(cfg.lcid, msg); } void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg) @@ -616,7 +616,7 @@ void nas::send_service_request() uint8_t mac[4]; integrity_generate(&k_nas_int[16], count_ul, - default_lcid-1, + cfg.lcid-1, SECURITY_DIRECTION_UPLINK, &msg->msg[0], 2, @@ -627,7 +627,7 @@ void nas::send_service_request() msg->msg[3] = mac[3]; msg->N_bytes++; nas_log->info("Sending service request\n"); - rrc->write_sdu(default_lcid, msg); + rrc->write_sdu(cfg.lcid, msg); } void nas::send_esm_information_response(){} From 9c49e27778740234e9fdb3f9751b06f4274f56a3 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 7 Aug 2017 13:18:18 +0200 Subject: [PATCH 3/4] remove unused variable --- lib/src/phy/rf/rf_soapy_imp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/src/phy/rf/rf_soapy_imp.c b/lib/src/phy/rf/rf_soapy_imp.c index 75711f6d8..31649af69 100644 --- a/lib/src/phy/rf/rf_soapy_imp.c +++ b/lib/src/phy/rf/rf_soapy_imp.c @@ -447,7 +447,6 @@ int rf_soapy_send_timed(void *h, rf_soapy_handler_t *handler = (rf_soapy_handler_t*) h; timeNs = secs * 1000000000; timeNs = timeNs + (frac_secs * 1000000000); - int num_channels = 1; int n = 0; if(!handler->tx_stream_active){ From 2bf288ff59b2afefc9f7b03bd7ad6d466f5fa67a Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 16 Aug 2017 17:39:49 +0200 Subject: [PATCH 4/4] Solved infinite loop and/or segmentation fault in the SCH decoder for non-SSE compilation. --- lib/include/srslte/phy/fec/turbodecoder_simd.h | 4 ++-- lib/src/phy/fec/turbodecoder_gen.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/phy/fec/turbodecoder_simd.h b/lib/include/srslte/phy/fec/turbodecoder_simd.h index 7ca3914ca..d7bc284d2 100644 --- a/lib/include/srslte/phy/fec/turbodecoder_simd.h +++ b/lib/include/srslte/phy/fec/turbodecoder_simd.h @@ -48,13 +48,13 @@ // The constant SRSLTE_TDEC_NPAR defines the maximum number of parallel CB supported by all SIMD decoders #ifdef ENABLE_SIMD_INTER #include "srslte/phy/fec/turbodecoder_simd_inter.h" - #if LV_HAVE_AVX2 + #ifdef LV_HAVE_AVX2 #define SRSLTE_TDEC_NPAR_INTRA 2 #else #define SRSLTE_TDEC_NPAR_INTRA 1 #endif #else - #if LV_HAVE_AVX2 + #ifdef LV_HAVE_AVX2 #define SRSLTE_TDEC_NPAR 2 #else #define SRSLTE_TDEC_NPAR 1 diff --git a/lib/src/phy/fec/turbodecoder_gen.c b/lib/src/phy/fec/turbodecoder_gen.c index 396d94caa..649c3363a 100644 --- a/lib/src/phy/fec/turbodecoder_gen.c +++ b/lib/src/phy/fec/turbodecoder_gen.c @@ -328,6 +328,9 @@ void srslte_tdec_gen_iteration(srslte_tdec_gen_t * h, float * input, uint32_t lo } else { fprintf(stderr, "Error CB index not set (call srslte_tdec_gen_reset() first\n"); } + + // Increase number of iterations + h->n_iter++; } int srslte_tdec_gen_reset(srslte_tdec_gen_t * h, uint32_t long_cb) @@ -339,6 +342,7 @@ int srslte_tdec_gen_reset(srslte_tdec_gen_t * h, uint32_t long_cb) } memset(h->w, 0, sizeof(float) * long_cb); h->current_cbidx = srslte_cbsegm_cbindex(long_cb); + h->current_cb_len = long_cb; if (h->current_cbidx < 0) { fprintf(stderr, "Invalid CB length %d\n", long_cb); return -1;