ue,rrc: add simple connection setup procedure

this is an attempt to fix #2850 by defering the transmission of
the connection setup complete until the PHY has applied
the dedicated config in the connection setup.
master
Andre Puschmann 4 years ago
parent c1ad867824
commit b40867ffec

@ -282,6 +282,7 @@ private:
class si_acquire_proc; class si_acquire_proc;
class serving_cell_config_proc; class serving_cell_config_proc;
class cell_selection_proc; class cell_selection_proc;
class connection_setup_proc;
class connection_request_proc; class connection_request_proc;
class connection_reconf_no_ho_proc; class connection_reconf_no_ho_proc;
class plmn_search_proc; class plmn_search_proc;
@ -297,6 +298,7 @@ private:
srsran::proc_t<go_idle_proc> idle_setter; srsran::proc_t<go_idle_proc> idle_setter;
srsran::proc_t<process_pcch_proc> pcch_processor; srsran::proc_t<process_pcch_proc> pcch_processor;
srsran::proc_t<connection_request_proc> conn_req_proc; srsran::proc_t<connection_request_proc> conn_req_proc;
srsran::proc_t<connection_setup_proc> conn_setup_proc;
srsran::proc_t<plmn_search_proc> plmn_searcher; srsran::proc_t<plmn_search_proc> plmn_searcher;
srsran::proc_t<cell_reselection_proc> cell_reselector; srsran::proc_t<cell_reselection_proc> cell_reselector;
srsran::proc_t<connection_reest_proc> connection_reest; srsran::proc_t<connection_reest_proc> connection_reest;

@ -193,6 +193,24 @@ private:
srsran::proc_future_t<void> serv_cfg_fut; srsran::proc_future_t<void> serv_cfg_fut;
}; };
class rrc::connection_setup_proc
{
public:
explicit connection_setup_proc(rrc* parent_);
srsran::proc_outcome_t init(const asn1::rrc::rr_cfg_ded_s* cnfg_, srsran::unique_byte_buffer_t dedicated_info_nas_);
srsran::proc_outcome_t step() { return srsran::proc_outcome_t::yield; }
void then(const srsran::proc_state_t& result);
srsran::proc_outcome_t react(const bool& config_complete);
static const char* name() { return "Connection Setup"; }
private:
// const
rrc* rrc_ptr;
srslog::basic_logger& logger;
// args
srsran::unique_byte_buffer_t dedicated_info_nas;
};
class rrc::connection_reconf_no_ho_proc class rrc::connection_reconf_no_ho_proc
{ {
public: public:

@ -66,6 +66,7 @@ rrc::rrc(stack_interface_rrc* stack_, srsran::task_sched_handle task_sched_) :
plmn_searcher(this), plmn_searcher(this),
cell_reselector(this), cell_reselector(this),
connection_reest(this), connection_reest(this),
conn_setup_proc(this),
ho_handler(this), ho_handler(this),
conn_recfg_proc(this), conn_recfg_proc(this),
meas_cells_nr(task_sched_), meas_cells_nr(task_sched_),
@ -364,6 +365,9 @@ void rrc::set_config_complete(bool status)
{ {
// Signal Reconfiguration Procedure that PHY configuration has completed // Signal Reconfiguration Procedure that PHY configuration has completed
phy_ctrl->set_config_complete(); phy_ctrl->set_config_complete();
if (conn_setup_proc.is_busy()) {
conn_setup_proc.trigger(status);
}
if (conn_recfg_proc.is_busy()) { if (conn_recfg_proc.is_busy()) {
conn_recfg_proc.trigger(status); conn_recfg_proc.trigger(status);
} }
@ -2538,16 +2542,12 @@ void rrc::handle_con_setup(const rrc_conn_setup_s& setup)
t302.stop(); t302.stop();
srsran::console("RRC Connected\n"); srsran::console("RRC Connected\n");
// Apply the Radio Resource configuration // defer transmission of Setup Complete until PHY reconfiguration has been completed
apply_rr_config_dedicated(&setup.crit_exts.c1().rrc_conn_setup_r8().rr_cfg_ded); if (not conn_setup_proc.launch(&setup.crit_exts.c1().rrc_conn_setup_r8().rr_cfg_ded, std::move(dedicated_info_nas))) {
logger.error("Failed to initiate connection setup procedure");
nas->set_barring(srsran::barring_t::none); return;
if (dedicated_info_nas.get()) {
send_con_setup_complete(std::move(dedicated_info_nas));
} else {
logger.error("Pending to transmit a ConnectionSetupComplete but no dedicatedInfoNAS was in queue");
} }
callback_list.add_proc(conn_setup_proc);
} }
/* Reception of RRCConnectionReestablishment by the UE 5.3.7.5 */ /* Reception of RRCConnectionReestablishment by the UE 5.3.7.5 */

@ -934,6 +934,60 @@ srsran::proc_outcome_t rrc::connection_request_proc::react(const cell_selection_
} }
} }
/******************************************
* Connection Setup Procedure
*****************************************/
// Simple procedure mainly do defer the transmission of the SetupComplete until all PHY reconfiguration are done
rrc::connection_setup_proc::connection_setup_proc(srsue::rrc* parent_) :
rrc_ptr(parent_), logger(srslog::fetch_basic_logger("RRC"))
{}
srsran::proc_outcome_t rrc::connection_setup_proc::init(const asn1::rrc::rr_cfg_ded_s* cnfg_,
srsran::unique_byte_buffer_t dedicated_info_nas_)
{
Info("Starting...");
if (dedicated_info_nas_.get() == nullptr) {
rrc_ptr->logger.error("Connection Setup Failed, no dedicatedInfoNAS available");
return proc_outcome_t::error;
}
dedicated_info_nas = std::move(dedicated_info_nas_);
// Apply the Radio Resource configuration
if (!rrc_ptr->apply_rr_config_dedicated(cnfg_)) {
return proc_outcome_t::error;
}
rrc_ptr->nas->set_barring(srsran::barring_t::none);
// No phy config was scheduled, run config completion immediately
if (rrc_ptr->phy_ctrl->is_config_pending()) {
return react(true);
}
return proc_outcome_t::yield;
}
srsran::proc_outcome_t rrc::connection_setup_proc::react(const bool& config_complete)
{
if (not config_complete) {
rrc_ptr->logger.error("Connection Setup Failed");
return proc_outcome_t::error;
}
rrc_ptr->send_con_setup_complete(std::move(dedicated_info_nas));
return proc_outcome_t::success;
}
void rrc::connection_setup_proc::then(const srsran::proc_state_t& result)
{
if (result.is_success()) {
rrc_ptr->logger.info("Finished %s successfully", name());
return;
}
}
/****************************************** /******************************************
* Connection Reconfiguration Procedure * Connection Reconfiguration Procedure
*****************************************/ *****************************************/

Loading…
Cancel
Save