rrc-nr: trigger RRCReconfifguration from ...

establish_EPS_bearer

Signed-off-by: Carlo Galiotto <carlo@srs.io>
This commit is contained in:
Carlo Galiotto 2021-11-23 15:48:41 +01:00 committed by Andre Puschmann
parent 39d6eecf01
commit 18a85adc49
5 changed files with 11 additions and 18 deletions

View File

@ -103,7 +103,6 @@ public:
void write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu) final;
int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) final;
int allocate_lcid(uint16_t rnti) final;
int start_rrc_reconfiguration(uint16_t rnti);
// logging
typedef enum { Rx = 0, Tx } direction_t;

View File

@ -102,7 +102,7 @@ private:
int update_rlc_bearers(const asn1::rrc_nr::cell_group_cfg_s& cell_group_diff);
/// Update MAC based on ASN1 message
int update_mac(const asn1::rrc_nr::cell_group_cfg_s& cell_group_diff, bool is_config_complete);
int update_mac(const asn1::rrc_nr::cell_group_cfg_s& cell_group_config, bool is_config_complete);
int pack_rrc_reconfiguration(asn1::dyn_octstring& packed_rrc_reconfig);
int pack_secondary_cell_group_cfg(asn1::dyn_octstring& packed_secondary_cell_config);

View File

@ -609,6 +609,9 @@ int rrc_nr::establish_rrc_bearer(uint16_t rnti, uint16_t pdu_session_id, srsran:
}
users[rnti]->establish_eps_bearer(pdu_session_id, nas_pdu, lcid);
// TODO: verify whether this is the best place where to call the RRCReconfig
users[rnti]->send_rrc_reconfiguration();
return SRSRAN_SUCCESS;
}
@ -634,16 +637,7 @@ void rrc_nr::write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu)
}
users[rnti]->send_dl_information_transfer(std::move(sdu));
}
int rrc_nr::start_rrc_reconfiguration(uint16_t rnti)
{
auto user_it = users.find(rnti);
if (user_it == users.end()){
logger.error("Starting RRCRecofiguration failed - rnti=0x%x not found", rnti);
return SRSRAN_ERROR;
}
user_it->second->send_rrc_reconfiguration();
return SRSRAN_SUCCESS;
}
/*******************************************************************************
Interface for EUTRA RRC
*******************************************************************************/

View File

@ -1245,15 +1245,15 @@ int rrc_nr::ue::update_rlc_bearers(const asn1::rrc_nr::cell_group_cfg_s& cell_gr
return SRSRAN_SUCCESS;
}
int rrc_nr::ue::update_mac(const cell_group_cfg_s& cell_group_diff, bool is_config_complete)
int rrc_nr::ue::update_mac(const cell_group_cfg_s& cell_group_config, bool is_config_complete)
{
if (not is_config_complete) {
// Release bearers
for (uint8_t lcid : cell_group_diff.rlc_bearer_to_release_list) {
for (uint8_t lcid : cell_group_config.rlc_bearer_to_release_list) {
uecfg.ue_bearers[lcid].direction = mac_lc_ch_cfg_t::IDLE;
}
for (const rlc_bearer_cfg_s& bearer : cell_group_diff.rlc_bearer_to_add_mod_list) {
for (const rlc_bearer_cfg_s& bearer : cell_group_config.rlc_bearer_to_add_mod_list) {
uecfg.ue_bearers[bearer.lc_ch_id].direction = mac_lc_ch_cfg_t::BOTH;
if (bearer.mac_lc_ch_cfg.ul_specific_params_present) {
uecfg.ue_bearers[bearer.lc_ch_id].priority = bearer.mac_lc_ch_cfg.ul_specific_params.prio;
@ -1265,7 +1265,7 @@ int rrc_nr::ue::update_mac(const cell_group_cfg_s& cell_group_diff, bool is_conf
}
}
} else {
auto& pdcch = cell_group_diff.sp_cell_cfg.sp_cell_cfg_ded.init_dl_bwp.pdcch_cfg.setup();
auto& pdcch = cell_group_config.sp_cell_cfg.sp_cell_cfg_ded.init_dl_bwp.pdcch_cfg.setup();
for (auto& ss : pdcch.search_spaces_to_add_mod_list) {
uecfg.phy_cfg.pdcch.search_space_present[ss.search_space_id] = true;
uecfg.phy_cfg.pdcch.search_space[ss.search_space_id] =

View File

@ -256,10 +256,10 @@ void test_rrc_nr_reconfiguration(srsran::task_scheduler& task_sched,
// create an unbounded_octstring object that contains a random NAS message (we simulate a NAS message)
asn1::unbounded_octstring<false> NAS_msg;
NAS_msg.from_string("c574defc80ba722bffb8eacb6f8a163e3222cf1542ac529f6980bb15e0bf12d9f2b29f11fb458ec9");
rrc_obj.establish_rrc_bearer(rnti, 1, NAS_msg, srsran::srb_to_lcid(srsran::nr_srb::srb1));
// STEP 2 - Trigger and send RRCReconfiguration command (gNB -> UE)
rrc_obj.start_rrc_reconfiguration(rnti);
rrc_obj.establish_rrc_bearer(rnti, 1, NAS_msg, srsran::srb_to_lcid(srsran::nr_srb::srb1));
//rrc_obj.start_rrc_reconfiguration(rnti);
// Test whether there exists the SRB1 initiated in the Connection Establishment
// We test this as the SRB1 was set up in a different function