Change NSA RRC reconfiguration interface to prepare for SA.

master
Fabian Eckermann 3 years ago committed by Andre Puschmann
parent 1407983c75
commit 6252d94ef4

@ -16,6 +16,7 @@
#include "phy_interface_types.h"
#include "rrc_interface_types.h"
#include "srsran/asn1/asn1_utils.h"
#include "srsran/asn1/rrc_nr.h"
#include "srsran/common/byte_buffer.h"
#include "srsran/common/tti_point.h"
@ -103,13 +104,7 @@ public:
virtual int get_nr_capabilities(srsran::byte_buffer_t* nr_cap) = 0;
virtual void phy_set_cells_to_meas(uint32_t carrier_freq_r15) = 0;
virtual void phy_meas_stop() = 0;
virtual bool rrc_reconfiguration(bool endc_release_and_add_r15,
bool nr_secondary_cell_group_cfg_r15_present,
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
bool sk_counter_r15_present,
uint32_t sk_counter_r15,
bool nr_radio_bearer_cfg1_r15_present,
asn1::dyn_octstring nr_radio_bearer_cfg1_r15) = 0;
virtual bool rrc_reconfiguration(bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf) = 0;
virtual void rrc_release() = 0;
virtual bool is_config_pending() = 0;
};

@ -118,13 +118,7 @@ public:
int get_nr_capabilities(srsran::byte_buffer_t* eutra_nr_caps);
void phy_meas_stop();
void phy_set_cells_to_meas(uint32_t carrier_freq_r15);
bool rrc_reconfiguration(bool endc_release_and_add_r15,
bool nr_secondary_cell_group_cfg_r15_present,
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
bool sk_counter_r15_present,
uint32_t sk_counter_r15,
bool nr_radio_bearer_cfg1_r15_present,
asn1::dyn_octstring nr_radio_bearer_cfg1_r15);
bool rrc_reconfiguration(bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf);
void rrc_release();
bool configure_sk_counter(uint16_t sk_counter);
bool is_config_pending();
@ -137,6 +131,7 @@ private:
// parsers
void decode_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu);
void decode_dl_ccch(srsran::unique_byte_buffer_t pdu);
void decode_dl_dcch(uint32_t lcid, srsran::unique_byte_buffer_t pdu);
// senders
void send_setup_request(srsran::nr_establishment_cause_t cause);
void send_con_setup_complete(srsran::unique_byte_buffer_t nas_msg);

@ -103,12 +103,7 @@ public:
explicit connection_reconf_no_ho_proc(rrc_nr& parent_);
srsran::proc_outcome_t init(const reconf_initiator_t initiator_,
const bool endc_release_and_add_r15,
const bool nr_secondary_cell_group_cfg_r15_present,
const asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
const bool sk_counter_r15_present,
const uint32_t sk_counter_r15,
const bool nr_radio_bearer_cfg1_r15_present,
const asn1::dyn_octstring nr_radio_bearer_cfg1_r15);
const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf);
srsran::proc_outcome_t step() { return srsran::proc_outcome_t::yield; }
static const char* name() { return "NR Connection Reconfiguration"; }
srsran::proc_outcome_t react(const bool& config_complete);

@ -780,12 +780,9 @@ bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg, bool*
}
bool endc_release_and_add_r15 = false;
bool nr_secondary_cell_group_cfg_r15_present = false;
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15;
bool sk_counter_r15_present = false;
uint32_t sk_counter_r15 = 0;
bool nr_radio_bearer_cfg1_r15_present = false;
asn1::dyn_octstring nr_radio_bearer_cfg1_r15;
asn1::rrc_nr::rrc_recfg_s rrc_nr_reconf = {};
rrc_nr_reconf.crit_exts.set_rrc_recfg();
switch (rrc_conn_recfg_v1510_ies->nr_cfg_r15.type()) {
case setup_opts::options::release:
@ -794,8 +791,29 @@ bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg, bool*
case setup_opts::options::setup:
endc_release_and_add_r15 = rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().endc_release_and_add_r15;
if (rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15_present) {
nr_secondary_cell_group_cfg_r15_present = true;
nr_secondary_cell_group_cfg_r15 = rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15;
asn1::cbit_ref bref0(rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15.data(),
rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15.size());
asn1::rrc_nr::rrc_recfg_s secondary_cell_group_r15;
if (secondary_cell_group_r15.unpack(bref0) != SRSASN_SUCCESS) {
logger.error("Could not unpack secondary cell group r15.");
return false;
}
if (secondary_cell_group_r15.crit_exts.rrc_recfg().secondary_cell_group_present) {
asn1::cbit_ref bref1(secondary_cell_group_r15.crit_exts.rrc_recfg().secondary_cell_group.data(),
secondary_cell_group_r15.crit_exts.rrc_recfg().secondary_cell_group.size());
asn1::rrc_nr::cell_group_cfg_s cell_group_cfg;
if (cell_group_cfg.unpack(bref1) != SRSASN_SUCCESS) {
logger.error("Could not unpack secondary cell group config.");
return false;
}
rrc_nr_reconf.crit_exts.rrc_recfg().secondary_cell_group_present = true;
rrc_nr_reconf.crit_exts.rrc_recfg().secondary_cell_group =
secondary_cell_group_r15.crit_exts.rrc_recfg().secondary_cell_group;
}
}
break;
default:
@ -803,22 +821,29 @@ bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg, bool*
break;
}
if (rrc_conn_recfg_v1510_ies->sk_counter_r15_present) {
sk_counter_r15_present = true;
sk_counter_r15 = rrc_conn_recfg_v1510_ies->sk_counter_r15;
rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext_present = true;
rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext_present = true;
rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext.non_crit_ext_present = true;
rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext.non_crit_ext.sk_counter_present = true;
rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext.non_crit_ext.sk_counter =
rrc_conn_recfg_v1510_ies->sk_counter_r15;
}
if (rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15_present) {
nr_radio_bearer_cfg1_r15_present = true;
nr_radio_bearer_cfg1_r15 = rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15;
rrc_nr_reconf.crit_exts.rrc_recfg().radio_bearer_cfg_present = true;
asn1::rrc_nr::radio_bearer_cfg_s radio_bearer_conf = {};
asn1::cbit_ref bref(rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15.data(),
rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15.size());
if (radio_bearer_conf.unpack(bref) != SRSASN_SUCCESS) {
logger.error("Could not unpack radio bearer config.");
return false;
}
rrc_nr_reconf.crit_exts.rrc_recfg().radio_bearer_cfg = radio_bearer_conf;
}
*has_5g_nr_reconfig = true;
return rrc_nr->rrc_reconfiguration(endc_release_and_add_r15,
nr_secondary_cell_group_cfg_r15_present,
nr_secondary_cell_group_cfg_r15,
sk_counter_r15_present,
sk_counter_r15,
nr_radio_bearer_cfg1_r15_present,
nr_radio_bearer_cfg1_r15);
return rrc_nr->rrc_reconfiguration(endc_release_and_add_r15, rrc_nr_reconf);
}
/*******************************************************************************
*

@ -171,13 +171,7 @@ public:
int get_nr_capabilities(srsran::byte_buffer_t* nr_cap) override { return SRSRAN_SUCCESS; };
void phy_set_cells_to_meas(uint32_t carrier_freq_r15) override{};
void phy_meas_stop() override{};
bool rrc_reconfiguration(bool endc_release_and_add_r15,
bool nr_secondary_cell_group_cfg_r15_present,
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
bool sk_counter_r15_present,
uint32_t sk_counter_r15,
bool nr_radio_bearer_cfg1_r15_present,
asn1::dyn_octstring nr_radio_bearer_cfg1_r15) override
bool rrc_reconfiguration(bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf) override
{
return false;
}

@ -215,10 +215,10 @@ void rrc_nr::write_pdu(uint32_t lcid, srsran::unique_byte_buffer_t pdu)
case nr_srb::srb0:
decode_dl_ccch(std::move(pdu));
break;
// case nr_srb::srb1:
// case nr_srb::srb2:
// decode_dl_dcch(lcid, std::move(pdu));
// break;
case nr_srb::srb1:
case nr_srb::srb2:
decode_dl_dcch(lcid, std::move(pdu));
break;
default:
logger.error("RX PDU with invalid bearer id: %d", lcid);
break;
@ -270,6 +270,18 @@ void rrc_nr::decode_dl_ccch(unique_byte_buffer_t pdu)
}
}
void rrc_nr::decode_dl_dcch(uint32_t lcid, unique_byte_buffer_t pdu)
{
asn1::cbit_ref bref(pdu->msg, pdu->N_bytes);
asn1::rrc_nr::dl_dcch_msg_s dl_dcch_msg;
if (dl_dcch_msg.unpack(bref) != asn1::SRSASN_SUCCESS or
dl_dcch_msg.msg.type().value != dl_dcch_msg_type_c::types_opts::c1) {
logger.error(pdu->msg, pdu->N_bytes, "Failed to unpack DL-DCCH message (%d B)", pdu->N_bytes);
return;
}
log_rrc_message(get_rb_name(lcid), Rx, pdu.get(), dl_dcch_msg, dl_dcch_msg.msg.c1().type().to_string());
}
void rrc_nr::write_pdu_bcch_bch(srsran::unique_byte_buffer_t pdu) {}
void rrc_nr::write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu)
{
@ -298,7 +310,7 @@ void rrc_nr::decode_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu)
}
}
void rrc_nr::handle_sib1(const sib1_s sib1)
void rrc_nr::handle_sib1(const sib1_s& sib1)
{
logger.info("SIB1 received, CellID=%d", meas_cells.serving_cell().get_cell_id() & 0xfff);
@ -736,22 +748,9 @@ int rrc_nr::get_eutra_nr_capabilities(srsran::byte_buffer_t* eutra_nr_caps_pdu)
return SRSRAN_SUCCESS;
}
bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15,
bool nr_secondary_cell_group_cfg_r15_present,
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
bool sk_counter_r15_present,
uint32_t sk_counter_r15,
bool nr_radio_bearer_cfg1_r15_present,
asn1::dyn_octstring nr_radio_bearer_cfg1_r15)
bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf)
{
if (not conn_recfg_proc.launch(reconf_initiator_t::mcg_srb1,
endc_release_and_add_r15,
nr_secondary_cell_group_cfg_r15_present,
nr_secondary_cell_group_cfg_r15,
sk_counter_r15_present,
sk_counter_r15,
nr_radio_bearer_cfg1_r15_present,
nr_radio_bearer_cfg1_r15)) {
if (not conn_recfg_proc.launch(reconf_initiator_t::mcg_srb1, endc_release_and_add_r15, rrc_nr_reconf)) {
logger.error("Unable to launch NR RRC reconfiguration procedure");
return false;
} else {

@ -29,59 +29,36 @@ rrc_nr::connection_reconf_no_ho_proc::connection_reconf_no_ho_proc(rrc_nr& paren
proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const reconf_initiator_t initiator_,
const bool endc_release_and_add_r15,
const bool nr_secondary_cell_group_cfg_r15_present,
const asn1::dyn_octstring nr_secondary_cell_group_cfg_r15,
const bool sk_counter_r15_present,
const uint32_t sk_counter_r15,
const bool nr_radio_bearer_cfg1_r15_present,
const asn1::dyn_octstring nr_radio_bearer_cfg1_r15)
const asn1::rrc_nr::rrc_recfg_s& rrc_nr_reconf)
{
Info("Starting...");
initiator = initiator_;
rrc_recfg_s rrc_recfg;
cell_group_cfg_s cell_group_cfg;
radio_bearer_cfg_s radio_bearer_cfg;
asn1::SRSASN_CODE err;
if (nr_secondary_cell_group_cfg_r15_present) {
cbit_ref bref(nr_secondary_cell_group_cfg_r15.data(), nr_secondary_cell_group_cfg_r15.size());
err = rrc_recfg.unpack(bref);
if (err != asn1::SRSASN_SUCCESS) {
Error("Could not unpack NR reconfiguration message.");
return proc_outcome_t::error;
}
#if 0
rrc_ptr->log_rrc_message(
"RRC NR Reconfiguration", Rx, nr_secondary_cell_group_cfg_r15, rrc_recfg, "NR Secondary Cell Group Cfg R15");
asn1::json_writer js;
rrc_nr_reconf.to_json(js);
Debug("RRC NR Reconfiguration: %s", js.to_string().c_str());
#endif
if (rrc_recfg.crit_exts.type() != asn1::rrc_nr::rrc_recfg_s::crit_exts_c_::types::rrc_recfg) {
if (rrc_nr_reconf.crit_exts.rrc_recfg().secondary_cell_group_present) {
if (rrc_nr_reconf.crit_exts.type() != asn1::rrc_nr::rrc_recfg_s::crit_exts_c_::types::rrc_recfg) {
Error("Reconfiguration does not contain Secondary Cell Group Config");
return proc_outcome_t::error;
}
if (not rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group_present) {
Error("Reconfiguration does not contain Secondary Cell Group Config");
return proc_outcome_t::error;
}
cbit_ref bref0(rrc_nr_reconf.crit_exts.rrc_recfg().secondary_cell_group.data(),
rrc_nr_reconf.crit_exts.rrc_recfg().secondary_cell_group.size());
cbit_ref bref0(rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.data(),
rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.size());
err = cell_group_cfg.unpack(bref0);
if (err != asn1::SRSASN_SUCCESS) {
Error("Could not unpack cell group message message.");
cell_group_cfg_s cell_group_cfg;
if (cell_group_cfg.unpack(bref0) != asn1::SRSASN_SUCCESS) {
Error("Could not unpack secondary cell group config.");
return proc_outcome_t::error;
}
#if 0
rrc_ptr->log_rrc_message("RRC NR Reconfiguration",
Rx,
rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group,
cell_group_cfg,
"Secondary Cell Group Config");
asn1::json_writer js1;
cell_group_cfg.to_json(js1);
Debug("Secondary Cell Group: %s", js1.to_string().c_str());
#endif
Info("Applying Cell Group Cfg");
@ -90,29 +67,17 @@ proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const reconf_initiator
}
}
if (sk_counter_r15_present) {
Info("Applying Cell Group Cfg");
if (!rrc_handle.configure_sk_counter((uint16_t)sk_counter_r15)) {
if (rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext.non_crit_ext.sk_counter_present) {
Info("Applying sk counter");
if (!rrc_handle.configure_sk_counter(
(uint16_t)rrc_nr_reconf.crit_exts.rrc_recfg().non_crit_ext.non_crit_ext.non_crit_ext.sk_counter)) {
return proc_outcome_t::error;
}
}
if (nr_radio_bearer_cfg1_r15_present) {
cbit_ref bref1(nr_radio_bearer_cfg1_r15.data(), nr_radio_bearer_cfg1_r15.size());
err = radio_bearer_cfg.unpack(bref1);
if (err != asn1::SRSASN_SUCCESS) {
Error("Could not unpack radio bearer config.");
return proc_outcome_t::error;
}
#if 0
rrc_ptr->log_rrc_message(
"RRC NR Reconfiguration", Rx, nr_radio_bearer_cfg1_r15, radio_bearer_cfg, "Radio Bearer Config R15");
#endif
if (rrc_nr_reconf.crit_exts.rrc_recfg().radio_bearer_cfg_present) {
Info("Applying Radio Bearer Cfg");
if (!rrc_handle.apply_radio_bearer_cfg(radio_bearer_cfg)) {
if (!rrc_handle.apply_radio_bearer_cfg(rrc_nr_reconf.crit_exts.rrc_recfg().radio_bearer_cfg)) {
return proc_outcome_t::error;
}
}

Loading…
Cancel
Save