break down rrc_interface_types.h into multiple files. moved pdcp_config.h to same folder

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 2950d26daa
commit a2ade9edd1

@ -22,7 +22,9 @@
#ifndef SRSLTE_RRC_ASN1_UTILS_H #ifndef SRSLTE_RRC_ASN1_UTILS_H
#define SRSLTE_RRC_ASN1_UTILS_H #define SRSLTE_RRC_ASN1_UTILS_H
#include "srslte/upper/pdcp_config.h" #include "srslte/interfaces/mac_interface_types.h"
#include "srslte/interfaces/pdcp_interface_types.h"
#include "srslte/interfaces/rlc_interface_types.h"
#include "srslte/interfaces/rrc_interface_types.h" #include "srslte/interfaces/rrc_interface_types.h"
#include "srslte/interfaces/sched_interface.h" #include "srslte/interfaces/sched_interface.h"

@ -21,15 +21,16 @@
#include "srslte/srslte.h" #include "srslte/srslte.h"
#include "pdcp_interface_types.h"
#include "rlc_interface_types.h"
#include "rrc_interface_types.h"
#include "srslte/asn1/rrc_asn1.h" #include "srslte/asn1/rrc_asn1.h"
#include "srslte/asn1/s1ap_asn1.h" #include "srslte/asn1/s1ap_asn1.h"
#include "srslte/common/common.h" #include "srslte/common/common.h"
#include "srslte/common/interfaces_common.h" #include "srslte/common/interfaces_common.h"
#include "srslte/common/multiqueue.h" #include "srslte/common/multiqueue.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/interfaces/rrc_interface_types.h"
#include "srslte/interfaces/sched_interface.h" #include "srslte/interfaces/sched_interface.h"
#include "srslte/upper/pdcp_config.h"
#include <vector> #include <vector>
#ifndef SRSLTE_ENB_INTERFACES_H #ifndef SRSLTE_ENB_INTERFACES_H

@ -0,0 +1,140 @@
/*
* Copyright 2013-2020 Software Radio Systems Limited
*
* This file is part of srsLTE.
*
* srsLTE 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.
*
* srsLTE 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.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
#ifndef SRSLTE_MAC_INTERFACE_TYPES_H
#define SRSLTE_MAC_INTERFACE_TYPES_H
#include "rrc_interface_types.h"
namespace srslte {
/***************************
* MAC Config
**************************/
struct bsr_cfg_t {
int periodic_timer;
int retx_timer;
bsr_cfg_t() { reset(); }
void reset()
{
periodic_timer = -1;
retx_timer = 2560;
}
};
struct phr_cfg_t {
bool enabled;
int periodic_timer;
int prohibit_timer;
int db_pathloss_change;
bool extended;
phr_cfg_t() { reset(); }
void reset()
{
enabled = false;
periodic_timer = -1;
prohibit_timer = -1;
db_pathloss_change = -1;
extended = false;
}
};
struct sr_cfg_t {
bool enabled;
int dsr_transmax;
sr_cfg_t() { reset(); }
void reset()
{
enabled = false;
dsr_transmax = 0;
}
};
struct ul_harq_cfg_t {
uint32_t max_harq_msg3_tx;
uint32_t max_harq_tx;
ul_harq_cfg_t() { reset(); }
void reset()
{
max_harq_msg3_tx = 5;
max_harq_tx = 5;
}
};
struct rach_cfg_t {
bool enabled;
uint32_t nof_preambles;
uint32_t nof_groupA_preambles;
int32_t messagePowerOffsetGroupB;
uint32_t messageSizeGroupA;
uint32_t responseWindowSize;
uint32_t powerRampingStep;
uint32_t preambleTransMax;
int32_t iniReceivedTargetPower;
uint32_t contentionResolutionTimer;
uint32_t new_ra_msg_len;
rach_cfg_t() { reset(); }
void reset()
{
enabled = false;
nof_preambles = 0;
nof_groupA_preambles = 0;
messagePowerOffsetGroupB = 0;
messageSizeGroupA = 0;
responseWindowSize = 0;
powerRampingStep = 0;
preambleTransMax = 0;
iniReceivedTargetPower = 0;
contentionResolutionTimer = 0;
new_ra_msg_len = 0;
}
};
struct mac_cfg_t {
// Default constructor with default values as in 36.331 9.2.2
mac_cfg_t() { set_defaults(); }
void set_defaults()
{
rach_cfg.reset();
sr_cfg.reset();
set_mac_main_cfg_default();
}
void set_mac_main_cfg_default()
{
bsr_cfg.reset();
phr_cfg.reset();
harq_cfg.reset();
time_alignment_timer = -1;
}
bsr_cfg_t bsr_cfg;
phr_cfg_t phr_cfg;
sr_cfg_t sr_cfg;
rach_cfg_t rach_cfg;
ul_harq_cfg_t harq_cfg;
int time_alignment_timer = -1;
};
} // namespace srslte
#endif // SRSLTE_MAC_INTERFACE_TYPES_H

@ -24,8 +24,8 @@
* Description: Structures used for configuration of the PDCP entities * Description: Structures used for configuration of the PDCP entities
*****************************************************************************/ *****************************************************************************/
#ifndef SRSLTE_PDCP_CONFIG_H #ifndef SRSLTE_PDCP_INTERFACE_TYPES_H
#define SRSLTE_PDCP_CONFIG_H #define SRSLTE_PDCP_INTERFACE_TYPES_H
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include <stdint.h> #include <stdint.h>
@ -140,4 +140,4 @@ public:
} // namespace srslte } // namespace srslte
#endif // SRSLTE_PDCP_CONFIG_H #endif // SRSLTE_PDCP_INTERFACE_TYPES_H

@ -0,0 +1,246 @@
/*
* Copyright 2013-2020 Software Radio Systems Limited
*
* This file is part of srsLTE.
*
* srsLTE 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.
*
* srsLTE 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.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
#ifndef SRSLTE_RLC_INTERFACE_TYPES_H
#define SRSLTE_RLC_INTERFACE_TYPES_H
#include "srslte/interfaces/rrc_interface_types.h"
/***************************
* RLC Config
**************************/
namespace srslte {
enum class rlc_mode_t { tm, um, am, nulltype };
inline std::string to_string(const rlc_mode_t& mode, bool long_txt = true)
{
constexpr static const char* long_options[] = {"Transparent Mode", "Unacknowledged Mode", "Acknowledged Mode"};
constexpr static const char* short_options[] = {"TM", "UM", "AM"};
if (long_txt) {
return enum_to_text(long_options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)mode);
}
return enum_to_text(short_options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)mode);
}
enum class rlc_umd_sn_size_t { size5bits, size10bits, nulltype };
inline std::string to_string(const rlc_umd_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"5 bits", "10 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_umd_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {5, 10};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
///< RLC UM NR sequence number field
enum class rlc_um_nr_sn_size_t { size6bits, size12bits, nulltype };
inline std::string to_string(const rlc_um_nr_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"6 bits", "12 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_um_nr_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {6, 12};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
///< RLC AM NR sequence number field
enum class rlc_am_nr_sn_size_t { size12bits, size18bits, nulltype };
inline std::string to_string(const rlc_am_nr_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"12 bits", "18 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_am_nr_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {12, 18};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
struct rlc_am_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
***************************************************************************/
// TX configs
int32_t t_poll_retx; // Poll retx timeout (ms)
int32_t poll_pdu; // Insert poll bit after this many PDUs
int32_t poll_byte; // Insert poll bit after this much data (KB)
uint32_t max_retx_thresh; // Max number of retx
// RX configs
int32_t t_reordering; // Timer used by rx to detect PDU loss (ms)
int32_t t_status_prohibit; // Timer used by rx to prohibit tx of status PDU (ms)
};
struct rlc_um_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
***************************************************************************/
int32_t t_reordering; // Timer used by rx to detect PDU loss (ms)
rlc_umd_sn_size_t tx_sn_field_length; // Number of bits used for tx (UL) sequence number
rlc_umd_sn_size_t rx_sn_field_length; // Number of bits used for rx (DL) sequence number
uint32_t rx_window_size;
uint32_t rx_mod; // Rx counter modulus
uint32_t tx_mod; // Tx counter modulus
bool is_mrb; // Whether this is a multicast bearer
};
struct rlc_um_nr_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 38.322 v15.3.0 Section 7
***************************************************************************/
rlc_um_nr_sn_size_t sn_field_length; // Number of bits used for sequence number
uint32_t UM_Window_Size;
uint32_t mod; // Rx/Tx counter modulus
int32_t t_reassembly_ms; // Timer used by rx to detect PDU loss (ms)
};
#define RLC_TX_QUEUE_LEN (128)
enum class srslte_rat_t { lte, nr, nulltype };
inline std::string to_string(const srslte_rat_t& type)
{
constexpr static const char* options[] = {"LTE", "NR"};
return enum_to_text(options, (uint32_t)srslte_rat_t::nulltype, (uint32_t)type);
}
class rlc_config_t
{
public:
srslte_rat_t rat;
rlc_mode_t rlc_mode;
rlc_am_config_t am;
rlc_um_config_t um;
rlc_um_nr_config_t um_nr;
uint32_t tx_queue_length;
rlc_config_t() :
rat(srslte_rat_t::lte),
rlc_mode(rlc_mode_t::tm),
am(),
um(),
um_nr(),
tx_queue_length(RLC_TX_QUEUE_LEN){};
// Factory for MCH
static rlc_config_t mch_config()
{
rlc_config_t cfg = {};
cfg.rat = srslte_rat_t::lte;
cfg.rlc_mode = rlc_mode_t::um;
cfg.um.t_reordering = 45;
cfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cfg.um.rx_window_size = 16;
cfg.um.rx_mod = 32;
cfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cfg.um.tx_mod = 32;
cfg.um.is_mrb = true;
cfg.tx_queue_length = 1024;
return cfg;
}
static rlc_config_t srb_config(uint32_t idx)
{
if (idx == 0 or idx > 2) {
return {};
}
// SRB1 and SRB2 are AM
rlc_config_t rlc_cfg = {};
rlc_cfg.rat = srslte_rat_t::lte;
rlc_cfg.rlc_mode = rlc_mode_t::am;
rlc_cfg.am.t_poll_retx = 45;
rlc_cfg.am.poll_pdu = -1;
rlc_cfg.am.poll_byte = -1;
rlc_cfg.am.max_retx_thresh = 4;
rlc_cfg.am.t_reordering = 35;
rlc_cfg.am.t_status_prohibit = 0;
return rlc_cfg;
}
static rlc_config_t default_rlc_um_config(uint32_t sn_size = 10)
{
rlc_config_t cnfg = {};
cnfg.rat = srslte_rat_t::lte;
cnfg.rlc_mode = rlc_mode_t::um;
cnfg.um.t_reordering = 5;
if (sn_size == 10) {
cnfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size10bits;
cnfg.um.rx_window_size = 512;
cnfg.um.rx_mod = 1024;
cnfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size10bits;
cnfg.um.tx_mod = 1024;
} else if (sn_size == 5) {
cnfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cnfg.um.rx_window_size = 16;
cnfg.um.rx_mod = 32;
cnfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cnfg.um.tx_mod = 32;
} else {
return {};
}
return cnfg;
}
static rlc_config_t default_rlc_am_config()
{
rlc_config_t rlc_cnfg = {};
rlc_cnfg.rat = srslte_rat_t::lte;
rlc_cnfg.rlc_mode = rlc_mode_t::am;
rlc_cnfg.am.t_reordering = 5;
rlc_cnfg.am.t_status_prohibit = 5;
rlc_cnfg.am.max_retx_thresh = 4;
rlc_cnfg.am.poll_byte = 25;
rlc_cnfg.am.poll_pdu = 4;
rlc_cnfg.am.t_poll_retx = 5;
return rlc_cnfg;
}
static rlc_config_t default_rlc_um_nr_config(uint32_t sn_size = 6)
{
rlc_config_t cnfg = {};
cnfg.rat = srslte_rat_t::nr;
cnfg.rlc_mode = rlc_mode_t::um;
if (sn_size == 6) {
cnfg.um_nr.sn_field_length = rlc_um_nr_sn_size_t::size6bits;
cnfg.um_nr.UM_Window_Size = 32;
cnfg.um_nr.mod = 64;
} else if (sn_size == 12) {
cnfg.um_nr.sn_field_length = rlc_um_nr_sn_size_t::size12bits;
cnfg.um_nr.UM_Window_Size = 2048;
cnfg.um_nr.mod = 64;
} else {
return {};
}
cnfg.um_nr.t_reassembly_ms = 5; // lowest non-zero value
return cnfg;
}
};
} // namespace srslte
#endif // SRSLTE_RLC_INTERFACE_TYPES_H

@ -27,9 +27,6 @@
#include "srslte/srslte.h" #include "srslte/srslte.h"
#include <string> #include <string>
/************************
* Interface types
***********************/
namespace srslte { namespace srslte {
// helper functions // helper functions
@ -163,329 +160,6 @@ inline std::string to_string(const establishment_cause_t& cause)
return enum_to_text(options, (uint32_t)establishment_cause_t::nulltype, (uint32_t)cause); return enum_to_text(options, (uint32_t)establishment_cause_t::nulltype, (uint32_t)cause);
} }
/***************************
* RLC Config
**************************/
enum class rlc_mode_t { tm, um, am, nulltype };
inline std::string to_string(const rlc_mode_t& mode, bool long_txt = true)
{
constexpr static const char* long_options[] = {"Transparent Mode", "Unacknowledged Mode", "Acknowledged Mode"};
constexpr static const char* short_options[] = {"TM", "UM", "AM"};
if (long_txt) {
return enum_to_text(long_options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)mode);
}
return enum_to_text(short_options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)mode);
}
enum class rlc_umd_sn_size_t { size5bits, size10bits, nulltype };
inline std::string to_string(const rlc_umd_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"5 bits", "10 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_umd_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {5, 10};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
///< RLC UM NR sequence number field
enum class rlc_um_nr_sn_size_t { size6bits, size12bits, nulltype };
inline std::string to_string(const rlc_um_nr_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"6 bits", "12 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_um_nr_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {6, 12};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
///< RLC AM NR sequence number field
enum class rlc_am_nr_sn_size_t { size12bits, size18bits, nulltype };
inline std::string to_string(const rlc_am_nr_sn_size_t& sn_size)
{
constexpr static const char* options[] = {"12 bits", "18 bits"};
return enum_to_text(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
inline uint16_t to_number(const rlc_am_nr_sn_size_t& sn_size)
{
constexpr static uint16_t options[] = {12, 18};
return enum_to_number(options, (uint32_t)rlc_mode_t::nulltype, (uint32_t)sn_size);
}
struct rlc_am_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
***************************************************************************/
// TX configs
int32_t t_poll_retx; // Poll retx timeout (ms)
int32_t poll_pdu; // Insert poll bit after this many PDUs
int32_t poll_byte; // Insert poll bit after this much data (KB)
uint32_t max_retx_thresh; // Max number of retx
// RX configs
int32_t t_reordering; // Timer used by rx to detect PDU loss (ms)
int32_t t_status_prohibit; // Timer used by rx to prohibit tx of status PDU (ms)
};
struct rlc_um_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
***************************************************************************/
int32_t t_reordering; // Timer used by rx to detect PDU loss (ms)
rlc_umd_sn_size_t tx_sn_field_length; // Number of bits used for tx (UL) sequence number
rlc_umd_sn_size_t rx_sn_field_length; // Number of bits used for rx (DL) sequence number
uint32_t rx_window_size;
uint32_t rx_mod; // Rx counter modulus
uint32_t tx_mod; // Tx counter modulus
bool is_mrb; // Whether this is a multicast bearer
};
struct rlc_um_nr_config_t {
/****************************************************************************
* Configurable parameters
* Ref: 3GPP TS 38.322 v15.3.0 Section 7
***************************************************************************/
rlc_um_nr_sn_size_t sn_field_length; // Number of bits used for sequence number
uint32_t UM_Window_Size;
uint32_t mod; // Rx/Tx counter modulus
int32_t t_reassembly_ms; // Timer used by rx to detect PDU loss (ms)
};
#define RLC_TX_QUEUE_LEN (128)
enum class srslte_rat_t { lte, nr, nulltype };
inline std::string to_string(const srslte_rat_t& type)
{
constexpr static const char* options[] = {"LTE", "NR"};
return enum_to_text(options, (uint32_t)srslte_rat_t::nulltype, (uint32_t)type);
}
class rlc_config_t
{
public:
srslte_rat_t rat;
rlc_mode_t rlc_mode;
rlc_am_config_t am;
rlc_um_config_t um;
rlc_um_nr_config_t um_nr;
uint32_t tx_queue_length;
rlc_config_t() :
rat(srslte_rat_t::lte),
rlc_mode(rlc_mode_t::tm),
am(),
um(),
um_nr(),
tx_queue_length(RLC_TX_QUEUE_LEN){};
// Factory for MCH
static rlc_config_t mch_config()
{
rlc_config_t cfg = {};
cfg.rat = srslte_rat_t::lte;
cfg.rlc_mode = rlc_mode_t::um;
cfg.um.t_reordering = 45;
cfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cfg.um.rx_window_size = 16;
cfg.um.rx_mod = 32;
cfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cfg.um.tx_mod = 32;
cfg.um.is_mrb = true;
cfg.tx_queue_length = 1024;
return cfg;
}
static rlc_config_t srb_config(uint32_t idx)
{
if (idx == 0 or idx > 2) {
return {};
}
// SRB1 and SRB2 are AM
rlc_config_t rlc_cfg = {};
rlc_cfg.rat = srslte_rat_t::lte;
rlc_cfg.rlc_mode = rlc_mode_t::am;
rlc_cfg.am.t_poll_retx = 45;
rlc_cfg.am.poll_pdu = -1;
rlc_cfg.am.poll_byte = -1;
rlc_cfg.am.max_retx_thresh = 4;
rlc_cfg.am.t_reordering = 35;
rlc_cfg.am.t_status_prohibit = 0;
return rlc_cfg;
}
static rlc_config_t default_rlc_um_config(uint32_t sn_size = 10)
{
rlc_config_t cnfg = {};
cnfg.rat = srslte_rat_t::lte;
cnfg.rlc_mode = rlc_mode_t::um;
cnfg.um.t_reordering = 5;
if (sn_size == 10) {
cnfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size10bits;
cnfg.um.rx_window_size = 512;
cnfg.um.rx_mod = 1024;
cnfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size10bits;
cnfg.um.tx_mod = 1024;
} else if (sn_size == 5) {
cnfg.um.rx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cnfg.um.rx_window_size = 16;
cnfg.um.rx_mod = 32;
cnfg.um.tx_sn_field_length = rlc_umd_sn_size_t::size5bits;
cnfg.um.tx_mod = 32;
} else {
return {};
}
return cnfg;
}
static rlc_config_t default_rlc_am_config()
{
rlc_config_t rlc_cnfg = {};
rlc_cnfg.rat = srslte_rat_t::lte;
rlc_cnfg.rlc_mode = rlc_mode_t::am;
rlc_cnfg.am.t_reordering = 5;
rlc_cnfg.am.t_status_prohibit = 5;
rlc_cnfg.am.max_retx_thresh = 4;
rlc_cnfg.am.poll_byte = 25;
rlc_cnfg.am.poll_pdu = 4;
rlc_cnfg.am.t_poll_retx = 5;
return rlc_cnfg;
}
static rlc_config_t default_rlc_um_nr_config(uint32_t sn_size = 6)
{
rlc_config_t cnfg = {};
cnfg.rat = srslte_rat_t::nr;
cnfg.rlc_mode = rlc_mode_t::um;
if (sn_size == 6) {
cnfg.um_nr.sn_field_length = rlc_um_nr_sn_size_t::size6bits;
cnfg.um_nr.UM_Window_Size = 32;
cnfg.um_nr.mod = 64;
} else if (sn_size == 12) {
cnfg.um_nr.sn_field_length = rlc_um_nr_sn_size_t::size12bits;
cnfg.um_nr.UM_Window_Size = 2048;
cnfg.um_nr.mod = 64;
} else {
return {};
}
cnfg.um_nr.t_reassembly_ms = 5; // lowest non-zero value
return cnfg;
}
};
/***************************
* MAC Config
**************************/
struct bsr_cfg_t {
int periodic_timer;
int retx_timer;
bsr_cfg_t() { reset(); }
void reset()
{
periodic_timer = -1;
retx_timer = 2560;
}
};
struct phr_cfg_t {
bool enabled;
int periodic_timer;
int prohibit_timer;
int db_pathloss_change;
bool extended;
phr_cfg_t() { reset(); }
void reset()
{
enabled = false;
periodic_timer = -1;
prohibit_timer = -1;
db_pathloss_change = -1;
extended = false;
}
};
struct sr_cfg_t {
bool enabled;
int dsr_transmax;
sr_cfg_t() { reset(); }
void reset()
{
enabled = false;
dsr_transmax = 0;
}
};
struct ul_harq_cfg_t {
uint32_t max_harq_msg3_tx;
uint32_t max_harq_tx;
ul_harq_cfg_t() { reset(); }
void reset()
{
max_harq_msg3_tx = 5;
max_harq_tx = 5;
}
};
struct rach_cfg_t {
bool enabled;
uint32_t nof_preambles;
uint32_t nof_groupA_preambles;
int32_t messagePowerOffsetGroupB;
uint32_t messageSizeGroupA;
uint32_t responseWindowSize;
uint32_t powerRampingStep;
uint32_t preambleTransMax;
int32_t iniReceivedTargetPower;
uint32_t contentionResolutionTimer;
uint32_t new_ra_msg_len;
rach_cfg_t() { reset(); }
void reset()
{
enabled = false;
nof_preambles = 0;
nof_groupA_preambles = 0;
messagePowerOffsetGroupB = 0;
messageSizeGroupA = 0;
responseWindowSize = 0;
powerRampingStep = 0;
preambleTransMax = 0;
iniReceivedTargetPower = 0;
contentionResolutionTimer = 0;
new_ra_msg_len = 0;
}
};
struct mac_cfg_t {
// Default constructor with default values as in 36.331 9.2.2
mac_cfg_t() { set_defaults(); }
void set_defaults()
{
rach_cfg.reset();
sr_cfg.reset();
set_mac_main_cfg_default();
}
void set_mac_main_cfg_default()
{
bsr_cfg.reset();
phr_cfg.reset();
harq_cfg.reset();
time_alignment_timer = -1;
}
bsr_cfg_t bsr_cfg;
phr_cfg_t phr_cfg;
sr_cfg_t sr_cfg;
rach_cfg_t rach_cfg;
ul_harq_cfg_t harq_cfg;
int time_alignment_timer = -1;
};
/*************************** /***************************
* PHY Config * PHY Config
**************************/ **************************/
@ -658,6 +332,13 @@ struct sib13_t {
mbms_notif_cfg_t notif_cfg; mbms_notif_cfg_t notif_cfg;
}; };
enum class barring_t { none = 0, mo_data, mo_signalling, mt, all };
inline std::string to_string(const barring_t& b)
{
constexpr static const char* options[] = {"none", "mo-data", "mo-signalling", "mt", "all"};
return enum_to_text(options, 5u, (uint32_t)b);
}
} // namespace srslte } // namespace srslte
#endif // SRSLTE_RRC_INTERFACE_TYPES_H #endif // SRSLTE_RRC_INTERFACE_TYPES_H

@ -31,6 +31,9 @@
#include <set> #include <set>
#include <string> #include <string>
#include "mac_interface_types.h"
#include "pdcp_interface_types.h"
#include "rlc_interface_types.h"
#include "rrc_interface_types.h" #include "rrc_interface_types.h"
#include "srslte/asn1/liblte_mme.h" #include "srslte/asn1/liblte_mme.h"
#include "srslte/common/common.h" #include "srslte/common/common.h"
@ -39,10 +42,8 @@
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/common/stack_procedure.h" #include "srslte/common/stack_procedure.h"
#include "srslte/common/tti_point.h" #include "srslte/common/tti_point.h"
#include "srslte/interfaces/rrc_interface_types.h"
#include "srslte/phy/channel/channel.h" #include "srslte/phy/channel/channel.h"
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "srslte/upper/pdcp_config.h"
#include "srslte/upper/pdcp_entity_base.h" #include "srslte/upper/pdcp_entity_base.h"
namespace srsue { namespace srsue {
@ -188,9 +189,8 @@ public:
class nas_interface_rrc class nas_interface_rrc
{ {
public: public:
typedef enum { BARRING_NONE = 0, BARRING_MO_DATA, BARRING_MO_SIGNALLING, BARRING_MT, BARRING_ALL } barring_t;
virtual void left_rrc_connected() = 0; virtual void left_rrc_connected() = 0;
virtual void set_barring(barring_t barring) = 0; virtual void set_barring(srslte::barring_t barring) = 0;
virtual bool paging(srslte::s_tmsi_t* ue_identity) = 0; virtual bool paging(srslte::s_tmsi_t* ue_identity) = 0;
virtual bool is_attached() = 0; virtual bool is_attached() = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;

@ -29,7 +29,7 @@
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/common/threads.h" #include "srslte/common/threads.h"
#include "srslte/common/timers.h" #include "srslte/common/timers.h"
#include "srslte/upper/pdcp_config.h" #include "srslte/interfaces/pdcp_interface_types.h"
namespace srslte { namespace srslte {

@ -26,8 +26,8 @@
#include "srslte/common/log_filter.h" #include "srslte/common/log_filter.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/common/test_common.h" #include "srslte/common/test_common.h"
#include "srslte/interfaces/pdcp_interface_types.h"
#include "srslte/interfaces/ue_interfaces.h" #include "srslte/interfaces/ue_interfaces.h"
#include "srslte/upper/pdcp_config.h"
#include <iostream> #include <iostream>
int compare_two_packets(const srslte::unique_byte_buffer_t& msg1, const srslte::unique_byte_buffer_t& msg2) int compare_two_packets(const srslte::unique_byte_buffer_t& msg1, const srslte::unique_byte_buffer_t& msg2)

@ -49,15 +49,15 @@ public:
emm_state_t get_state(); emm_state_t get_state();
// RRC interface // RRC interface
void left_rrc_connected(); void left_rrc_connected() override;
bool paging(srslte::s_tmsi_t* ue_identity); bool paging(srslte::s_tmsi_t* ue_identity) override;
void set_barring(barring_t barring); void set_barring(srslte::barring_t barring) override;
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) override;
uint32_t get_k_enb_count(); uint32_t get_k_enb_count() override;
bool is_attached(); bool is_attached() override;
bool get_k_asme(uint8_t* k_asme_, uint32_t n); bool get_k_asme(uint8_t* k_asme_, uint32_t n) override;
uint32_t get_ipv4_addr(); uint32_t get_ipv4_addr() override;
bool get_ipv6_addr(uint8_t* ipv6_addr); bool get_ipv6_addr(uint8_t* ipv6_addr) override;
// UE interface // UE interface
void start_attach_proc(srslte::proc_state_t* result, srslte::establishment_cause_t cause_) final; void start_attach_proc(srslte::proc_state_t* result, srslte::establishment_cause_t cause_) final;
@ -68,7 +68,7 @@ public:
bool connection_request_completed(bool outcome) final; bool connection_request_completed(bool outcome) final;
// timer callback // timer callback
void timer_expired(uint32_t timeout_id); void timer_expired(uint32_t timeout_id) override;
// PCAP // PCAP
void start_pcap(srslte::nas_pcap* pcap_); void start_pcap(srslte::nas_pcap* pcap_);
@ -84,7 +84,7 @@ private:
emm_state_t state = EMM_STATE_DEREGISTERED; emm_state_t state = EMM_STATE_DEREGISTERED;
nas_interface_rrc::barring_t current_barring = BARRING_NONE; srslte::barring_t current_barring = srslte::barring_t::none;
bool plmn_is_selected = false; bool plmn_is_selected = false;
srslte::plmn_id_t current_plmn; srslte::plmn_id_t current_plmn;

@ -838,7 +838,7 @@ void rrc::timer_expired(uint32_t timeout_id)
} }
} else if (timeout_id == t302.id()) { } else if (timeout_id == t302.id()) {
rrc_log->info("Timer T302 expired. Informing NAS about barrier alleviation\n"); rrc_log->info("Timer T302 expired. Informing NAS about barrier alleviation\n");
nas->set_barring(nas_interface_rrc::BARRING_NONE); nas->set_barring(srslte::barring_t::none);
} else if (timeout_id == t300.id()) { } else if (timeout_id == t300.id()) {
// Do nothing, handled in connection_request() // Do nothing, handled in connection_request()
} else if (timeout_id == t304.id()) { } else if (timeout_id == t304.id()) {
@ -1852,12 +1852,12 @@ void rrc::parse_dl_ccch(unique_byte_buffer_t pdu)
t300.stop(); t300.stop();
if (reject_r8->wait_time) { if (reject_r8->wait_time) {
nas->set_barring(nas_interface_rrc::BARRING_ALL); nas->set_barring(srslte::barring_t::all);
t302.set(reject_r8->wait_time * 1000, [this](uint32_t tid) { timer_expired(tid); }); t302.set(reject_r8->wait_time * 1000, [this](uint32_t tid) { timer_expired(tid); });
t302.run(); t302.run();
} else { } else {
// Perform the actions upon expiry of T302 if wait time is zero // Perform the actions upon expiry of T302 if wait time is zero
nas->set_barring(nas_interface_rrc::BARRING_NONE); nas->set_barring(srslte::barring_t::none);
start_go_idle(); start_go_idle();
} }
} break; } break;
@ -2590,7 +2590,7 @@ void rrc::handle_con_setup(rrc_conn_setup_s* setup)
// Apply the Radio Resource configuration // Apply the Radio Resource configuration
apply_rr_config_dedicated(&setup->crit_exts.c1().rrc_conn_setup_r8().rr_cfg_ded); apply_rr_config_dedicated(&setup->crit_exts.c1().rrc_conn_setup_r8().rr_cfg_ded);
nas->set_barring(nas_interface_rrc::BARRING_NONE); nas->set_barring(srslte::barring_t::none);
if (dedicated_info_nas.get()) { if (dedicated_info_nas.get()) {
send_con_setup_complete(std::move(dedicated_info_nas)); send_con_setup_complete(std::move(dedicated_info_nas));

@ -756,7 +756,7 @@ proc_outcome_t rrc::connection_request_proc::init(srslte::establishment_cause_t
if (rrc_ptr->t302.is_running()) { if (rrc_ptr->t302.is_running()) {
Info("Requested RRC connection establishment while T302 is running\n"); Info("Requested RRC connection establishment while T302 is running\n");
rrc_ptr->nas->set_barring(nas_interface_rrc::BARRING_MO_DATA); rrc_ptr->nas->set_barring(srslte::barring_t::mo_data);
return proc_outcome_t::error; return proc_outcome_t::error;
} }

Loading…
Cancel
Save