remove obsolete RLC_MODE struct and move existing one to rlc_interface.h

master
Andre Puschmann 7 years ago
parent 5444b2a0b7
commit 3950629a75

@ -38,15 +38,7 @@ namespace srslte {
#define RLC_AM_WINDOW_SIZE 512
typedef enum{
RLC_MODE_TM = 0,
RLC_MODE_UM,
RLC_MODE_AM,
RLC_MODE_N_ITEMS,
}rlc_mode_t;
static const char rlc_mode_text[RLC_MODE_N_ITEMS][20] = {"Transparent Mode",
"Unacknowledged Mode",
"Acknowledged Mode"};
typedef enum{
RLC_FI_FIELD_START_AND_END_ALIGNED = 0,

@ -32,14 +32,15 @@
namespace srslte {
typedef enum{
SRSLTE_RLC_MODE_TM = 0,
SRSLTE_RLC_MODE_UM,
SRSLTE_RLC_MODE_AM,
SRSLTE_RLC_MODE_N_ITEMS
} srslte_rlc_mode_t;
static const char srslte_rlc_mode_text[SRSLTE_RLC_MODE_N_ITEMS][20] = { "TM", "UM", "AM"};
RLC_MODE_TM = 0,
RLC_MODE_UM,
RLC_MODE_AM,
RLC_MODE_N_ITEMS,
}rlc_mode_t;
static const char rlc_mode_text[RLC_MODE_N_ITEMS][20] = {"Transparent Mode",
"Unacknowledged Mode",
"Acknowledged Mode"};
typedef enum{
RLC_UMD_SN_SIZE_5_BITS = 0,
@ -88,22 +89,22 @@ typedef struct {
class srslte_rlc_config_t
{
public:
srslte_rlc_mode_t rlc_mode;
rlc_mode_t rlc_mode;
srslte_rlc_am_config_t am;
srslte_rlc_um_config_t um;
// Default ctor
srslte_rlc_config_t(): rlc_mode(SRSLTE_RLC_MODE_TM), am(), um() {};
srslte_rlc_config_t(): rlc_mode(RLC_MODE_TM), am(), um() {};
// Constructor based on liblte's RLC config
srslte_rlc_config_t(LIBLTE_RRC_RLC_CONFIG_STRUCT *cnfg) : rlc_mode(SRSLTE_RLC_MODE_AM), am(), um()
srslte_rlc_config_t(LIBLTE_RRC_RLC_CONFIG_STRUCT *cnfg) : rlc_mode(RLC_MODE_AM), am(), um()
{
// update RLC mode to internal mode struct
rlc_mode = (cnfg->rlc_mode == LIBLTE_RRC_RLC_MODE_AM) ? SRSLTE_RLC_MODE_AM : SRSLTE_RLC_MODE_UM;
rlc_mode = (cnfg->rlc_mode == LIBLTE_RRC_RLC_MODE_AM) ? RLC_MODE_AM : RLC_MODE_UM;
switch(rlc_mode)
{
case SRSLTE_RLC_MODE_AM:
case RLC_MODE_AM:
am.t_poll_retx = liblte_rrc_t_poll_retransmit_num[cnfg->ul_am_rlc.t_poll_retx];
am.poll_pdu = liblte_rrc_poll_pdu_num[cnfg->ul_am_rlc.poll_pdu];
am.poll_byte = liblte_rrc_poll_byte_num[cnfg->ul_am_rlc.poll_byte]*1000; // KB
@ -111,7 +112,7 @@ public:
am.t_reordering = liblte_rrc_t_reordering_num[cnfg->dl_am_rlc.t_reordering];
am.t_status_prohibit = liblte_rrc_t_status_prohibit_num[cnfg->dl_am_rlc.t_status_prohibit];
break;
case SRSLTE_RLC_MODE_UM:
case RLC_MODE_UM:
um.t_reordering = liblte_rrc_t_reordering_num[cnfg->dl_um_bi_rlc.t_reordering];
um.rx_sn_field_length = (rlc_umd_sn_size_t)cnfg->dl_um_bi_rlc.sn_field_len;
um.rx_window_size = (RLC_UMD_SN_SIZE_5_BITS == um.rx_sn_field_length) ? 16 : 512;
@ -129,7 +130,7 @@ public:
static srslte_rlc_config_t mch_config()
{
srslte_rlc_config_t cfg;
cfg.rlc_mode = SRSLTE_RLC_MODE_UM;
cfg.rlc_mode = RLC_MODE_UM;
cfg.um.t_reordering = 0;
cfg.um.rx_sn_field_length = RLC_UMD_SN_SIZE_5_BITS;
cfg.um.rx_window_size = 0;

@ -411,13 +411,13 @@ void rlc::add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg)
if (not valid_lcid(lcid)) {
switch(cnfg.rlc_mode)
{
case SRSLTE_RLC_MODE_TM:
case RLC_MODE_TM:
rlc_entity = new rlc_tm();
break;
case SRSLTE_RLC_MODE_AM:
case RLC_MODE_AM:
rlc_entity = new rlc_am();
break;
case SRSLTE_RLC_MODE_UM:
case RLC_MODE_UM:
rlc_entity = new rlc_um();
break;
default:
@ -429,7 +429,7 @@ void rlc::add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg)
// configure and add to array
rlc_entity->init(rlc_log, lcid, pdcp, rrc, mac_timers);
if (cnfg.rlc_mode != SRSLTE_RLC_MODE_TM) {
if (cnfg.rlc_mode != RLC_MODE_TM) {
if (rlc_entity->configure(cnfg) == false) {
rlc_log->error("Error configuring RLC entity\n.");
goto delete_and_exit;

@ -76,7 +76,7 @@ bool rlc_um::configure(srslte_rlc_config_t cnfg_)
}
log->warning("%s configured in %s mode: t_reordering=%d ms, rx_sn_field_length=%u bits, tx_sn_field_length=%u bits\n",
rb_name.c_str(), srslte_rlc_mode_text[cnfg_.rlc_mode],
rb_name.c_str(), rlc_mode_text[cnfg_.rlc_mode],
cfg.t_reordering, rlc_umd_sn_size_num[cfg.rx_sn_field_length], rlc_umd_sn_size_num[cfg.rx_sn_field_length]);
// store config

@ -325,7 +325,7 @@ void stress_test(stress_test_args_t args)
srslte_rlc_config_t cnfg_;
if (args.mode == "AM") {
// config RLC AM bearer
cnfg_.rlc_mode = SRSLTE_RLC_MODE_AM;
cnfg_.rlc_mode = RLC_MODE_AM;
cnfg_.am.max_retx_thresh = 4;
cnfg_.am.poll_byte = 25*1000;
cnfg_.am.poll_pdu = 4;
@ -334,7 +334,7 @@ void stress_test(stress_test_args_t args)
cnfg_.am.t_status_prohibit = 5;
} else if (args.mode == "UM") {
// config UM bearer
cnfg_.rlc_mode = SRSLTE_RLC_MODE_UM;
cnfg_.rlc_mode = RLC_MODE_UM;
cnfg_.um.t_reordering = 5;
cnfg_.um.rx_mod = 32;
cnfg_.um.rx_sn_field_length = RLC_UMD_SN_SIZE_5_BITS;

Loading…
Cancel
Save