pdcp: fix issue when setting SN length configuration

master
Andre Puschmann 6 years ago
parent 0bd30343bb
commit c14c3c23f1

@ -146,7 +146,11 @@ void pdcp::add_bearer(uint32_t lcid, srslte_pdcp_config_t cfg)
goto unlock_and_exit; goto unlock_and_exit;
} }
pdcp_array.at(lcid)->init(rlc, rrc, gw, pdcp_log, lcid, cfg); pdcp_array.at(lcid)->init(rlc, rrc, gw, pdcp_log, lcid, cfg);
pdcp_log->info("Added bearer %s\n", rrc->get_rb_name(lcid).c_str()); pdcp_log->info("Add %s (lcid=%d, bearer_id=%d, sn_len=%dbits)\n",
rrc->get_rb_name(lcid).c_str(),
lcid,
cfg.bearer_id,
cfg.sn_len);
} else { } else {
pdcp_log->warning("Bearer %s already configured. Reconfiguration not supported\n", rrc->get_rb_name(lcid).c_str()); pdcp_log->warning("Bearer %s already configured. Reconfiguration not supported\n", rrc->get_rb_name(lcid).c_str());
} }
@ -163,7 +167,11 @@ void pdcp::add_bearer_mrb(uint32_t lcid, srslte_pdcp_config_t cfg)
goto unlock_and_exit; goto unlock_and_exit;
} }
pdcp_array_mrb.at(lcid)->init(rlc, rrc, gw, pdcp_log, lcid, cfg); pdcp_array_mrb.at(lcid)->init(rlc, rrc, gw, pdcp_log, lcid, cfg);
pdcp_log->info("Added bearer %s\n", rrc->get_rb_name(lcid).c_str()); pdcp_log->info("Add %s (lcid=%d, bearer_id=%d, sn_len=%dbits)\n",
rrc->get_rb_name(lcid).c_str(),
lcid,
cfg.bearer_id,
cfg.sn_len);
} else { } else {
pdcp_log->warning("Bearer %s already configured. Reconfiguration not supported\n", rrc->get_rb_name(lcid).c_str()); pdcp_log->warning("Bearer %s already configured. Reconfiguration not supported\n", rrc->get_rb_name(lcid).c_str());
} }

@ -67,23 +67,15 @@ void pdcp_entity::init(srsue::rlc_interface_pdcp *rlc_,
do_integrity = false; do_integrity = false;
do_encryption = false; do_encryption = false;
cfg.sn_len = 0; cfg = cfg_;
sn_len_bytes = 0;
if (cfg.is_control) {
cfg.sn_len = 5;
sn_len_bytes = 1;
}
if (cfg.is_data) {
cfg.sn_len = 12;
sn_len_bytes = 2;
}
log->info("Init %s with bearer ID: %d\n", rrc->get_rb_name(lcid).c_str(), cfg.bearer_id); // set length of SN field in bytes
sn_len_bytes = (cfg.sn_len == 5) ? 1 : 2;
} }
// Reestablishment procedure: 36.323 5.2 // Reestablishment procedure: 36.323 5.2
void pdcp_entity::reestablish() { void pdcp_entity::reestablish()
{
// For SRBs // For SRBs
if (cfg.is_control) { if (cfg.is_control) {
tx_count = 0; tx_count = 0;

@ -2980,7 +2980,6 @@ void rrc::add_srb(srb_to_add_mod_s* srb_cnfg)
void rrc::add_drb(drb_to_add_mod_s* drb_cnfg) void rrc::add_drb(drb_to_add_mod_s* drb_cnfg)
{ {
if (!drb_cnfg->pdcp_cfg_present || !drb_cnfg->rlc_cfg_present || !drb_cnfg->lc_ch_cfg_present) { if (!drb_cnfg->pdcp_cfg_present || !drb_cnfg->rlc_cfg_present || !drb_cnfg->lc_ch_cfg_present) {
rrc_log->error("Cannot add DRB - incomplete configuration\n"); rrc_log->error("Cannot add DRB - incomplete configuration\n");
return; return;
@ -2994,7 +2993,7 @@ void rrc::add_drb(drb_to_add_mod_s* drb_cnfg)
} }
// Setup PDCP // Setup PDCP
srslte_pdcp_config_t pdcp_cfg; srslte_pdcp_config_t pdcp_cfg = {};
pdcp_cfg.is_data = true; pdcp_cfg.is_data = true;
pdcp_cfg.bearer_id = drb_cnfg->drb_id; pdcp_cfg.bearer_id = drb_cnfg->drb_id;
if (drb_cnfg->pdcp_cfg.rlc_um_present) { if (drb_cnfg->pdcp_cfg.rlc_um_present) {

Loading…
Cancel
Save