in the rrc reconf procedure, handle the scenario where the rrc reconfiguration message does not config the phy

master
Francisco Paisana 4 years ago
parent edd5c50f9a
commit 1f2cca8909

@ -62,10 +62,13 @@ public:
void cell_selection_completed(bool outcome); void cell_selection_completed(bool outcome);
void in_sync(); void in_sync();
void out_sync() { trigger(out_sync_ev{}); } void out_sync() { trigger(out_sync_ev{}); }
bool set_config(const srslte::phy_cfg_t& config, uint32_t cc_idx = 0);
void set_config_complete();
// state getters // state getters
bool cell_is_camping() { return phy->cell_is_camping(); } bool cell_is_camping() { return phy->cell_is_camping(); }
bool is_in_sync() const { return is_in_state<in_sync_st>(); } bool is_in_sync() const { return is_in_state<in_sync_st>(); }
bool is_config_pending() const { return nof_pending_configs == 0; }
// FSM states // FSM states
struct unknown_st {}; struct unknown_st {};
@ -120,6 +123,7 @@ private:
srslte::event_observer<bool> cell_selection_once_observer; srslte::event_observer<bool> cell_selection_once_observer;
std::function<void(uint32_t, uint32_t, bool)> cell_selection_always_observer; std::function<void(uint32_t, uint32_t, bool)> cell_selection_always_observer;
srslte::event_dispatcher<cell_srch_res> cell_search_observers; srslte::event_dispatcher<cell_srch_res> cell_search_observers;
uint32_t nof_pending_configs = 0;
protected: protected:
state_list<unknown_st, in_sync_st, out_sync_st, searching_cell, selecting_cell> states{this, state_list<unknown_st, in_sync_st, out_sync_st, searching_cell, selecting_cell> states{this,

@ -212,7 +212,6 @@ private:
rrc* rrc_ptr; rrc* rrc_ptr;
// args // args
asn1::rrc::rrc_conn_recfg_r8_ies_s rx_recfg; asn1::rrc::rrc_conn_recfg_r8_ies_s rx_recfg;
enum state_t { wait_scell_config, wait_phy_config } state;
}; };
class rrc::process_pcch_proc class rrc::process_pcch_proc

@ -44,6 +44,24 @@ void phy_controller::in_sync()
trigger(in_sync_ev{}); trigger(in_sync_ev{});
} }
bool phy_controller::set_config(const srslte::phy_cfg_t& config, uint32_t cc_idx)
{
if (phy->set_config(config, cc_idx)) {
nof_pending_configs++;
return true;
}
return false;
}
void phy_controller::set_config_complete()
{
if (nof_pending_configs == 0) {
log_h->warning("Received more phy config complete signals than the ones scheduled\n");
return;
}
nof_pending_configs--;
}
/************************************** /**************************************
* PHY Cell Select Procedure * PHY Cell Select Procedure
*************************************/ *************************************/

@ -364,6 +364,7 @@ void rrc::cell_select_complete(bool cs_ret)
void rrc::set_config_complete(bool status) 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();
if (conn_recfg_proc.is_busy()) { if (conn_recfg_proc.is_busy()) {
conn_recfg_proc.trigger(status); conn_recfg_proc.trigger(status);
} }
@ -924,7 +925,7 @@ void rrc::ho_failed()
void rrc::con_reconfig_failed() void rrc::con_reconfig_failed()
{ {
// Set previous PHY/MAC configuration // Set previous PHY/MAC configuration
phy->set_config(previous_phy_cfg); phy_ctrl->set_config(previous_phy_cfg);
mac->set_config(previous_mac_cfg); mac->set_config(previous_mac_cfg);
// And restore current configs // And restore current configs
@ -1227,7 +1228,7 @@ void rrc::handle_sib2()
set_phy_cfg_t_enable_64qam(&current_phy_cfg, false); set_phy_cfg_t_enable_64qam(&current_phy_cfg, false);
} }
phy->set_config(current_phy_cfg); phy_ctrl->set_config(current_phy_cfg);
log_rr_config_common(); log_rr_config_common();
@ -1938,7 +1939,7 @@ void rrc::apply_rr_config_common(rr_cfg_common_s* config, bool send_lower_layers
if (send_lower_layers) { if (send_lower_layers) {
mac->set_config(current_mac_cfg); mac->set_config(current_mac_cfg);
phy->set_config(current_phy_cfg); phy_ctrl->set_config(current_phy_cfg);
} }
} }
@ -1982,10 +1983,10 @@ void rrc::set_phy_default()
current_phy_cfg.set_defaults(); current_phy_cfg.set_defaults();
if (phy != nullptr) { if (phy_ctrl != nullptr) {
for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) { for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) {
if (i == 0 or current_scell_configured[i]) { if (i == 0 or current_scell_configured[i]) {
phy->set_config(current_phy_cfg, i); phy_ctrl->set_config(current_phy_cfg, i);
current_scell_configured[i] = false; current_scell_configured[i] = false;
} }
} }
@ -2001,10 +2002,10 @@ void rrc::set_phy_config_dedicated_default()
current_phy_cfg.set_defaults_dedicated(); current_phy_cfg.set_defaults_dedicated();
if (phy != nullptr) { if (phy_ctrl != nullptr) {
for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) { for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) {
if (i == 0 or current_scell_configured[i]) { if (i == 0 or current_scell_configured[i]) {
phy->set_config(current_phy_cfg, i); phy_ctrl->set_config(current_phy_cfg, i);
current_scell_configured[i] = false; current_scell_configured[i] = false;
} }
} }
@ -2027,8 +2028,8 @@ void rrc::apply_phy_config_dedicated(const phys_cfg_ded_s& phy_cnfg, bool is_han
log_phy_config_dedicated(); log_phy_config_dedicated();
if (phy != nullptr) { if (phy_ctrl != nullptr) {
phy->set_config(current_phy_cfg); phy_ctrl->set_config(current_phy_cfg);
} else { } else {
rrc_log->info("RRC not initialized. Skipping PHY config.\n"); rrc_log->info("RRC not initialized. Skipping PHY config.\n");
} }
@ -2095,7 +2096,7 @@ void rrc::apply_phy_scell_config(const scell_to_add_mod_r10_s& scell_config, boo
if (!phy->set_scell(scell, scell_config.scell_idx_r10, earfcn)) { if (!phy->set_scell(scell, scell_config.scell_idx_r10, earfcn)) {
rrc_log->error("Adding SCell cc_idx=%d\n", scell_config.scell_idx_r10); rrc_log->error("Adding SCell cc_idx=%d\n", scell_config.scell_idx_r10);
} else if (!phy->set_config(scell_cfg, scell_config.scell_idx_r10)) { } else if (!phy_ctrl->set_config(scell_cfg, scell_config.scell_idx_r10)) {
rrc_log->error("Setting SCell configuration for cc_idx=%d\n", scell_config.scell_idx_r10); rrc_log->error("Setting SCell configuration for cc_idx=%d\n", scell_config.scell_idx_r10);
} }

@ -368,7 +368,8 @@ proc_outcome_t rrc::si_acquire_proc::react(si_acq_timer_expired ev)
*************************************/ *************************************/
rrc::serving_cell_config_proc::serving_cell_config_proc(rrc* parent_) : rrc::serving_cell_config_proc::serving_cell_config_proc(rrc* parent_) :
rrc_ptr(parent_), log_h(srslte::logmap::get("RRC")) rrc_ptr(parent_),
log_h(srslte::logmap::get("RRC"))
{} {}
/* /*
@ -781,7 +782,8 @@ void rrc::plmn_search_proc::then(const srslte::proc_state_t& result) const
*************************************/ *************************************/
rrc::connection_request_proc::connection_request_proc(rrc* parent_) : rrc::connection_request_proc::connection_request_proc(rrc* parent_) :
rrc_ptr(parent_), log_h(srslte::logmap::get("RRC")) rrc_ptr(parent_),
log_h(srslte::logmap::get("RRC"))
{} {}
proc_outcome_t rrc::connection_request_proc::init(srslte::establishment_cause_t cause_, proc_outcome_t rrc::connection_request_proc::init(srslte::establishment_cause_t cause_,
@ -990,14 +992,10 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::init(const asn1::rrc::
return proc_outcome_t::error; return proc_outcome_t::error;
} }
// Wait for PHY configurations to be complete // No phy config was scheduled, run config completion immediately
if (std::count(&rrc_ptr->current_scell_configured[0], &rrc_ptr->current_scell_configured[SRSLTE_MAX_CARRIERS], true) > if (rrc_ptr->phy_ctrl->is_config_pending()) {
0) { return react(true);
state = wait_scell_config;
} else {
state = wait_phy_config;
} }
return proc_outcome_t::yield; return proc_outcome_t::yield;
} }
@ -1009,8 +1007,7 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::react(const bool& conf
} }
// in case there are scell to configure, wait for second phy configuration // in case there are scell to configure, wait for second phy configuration
if (state == wait_scell_config) { if (not rrc_ptr->phy_ctrl->is_config_pending()) {
state = wait_phy_config;
return proc_outcome_t::yield; return proc_outcome_t::yield;
} }
@ -1537,8 +1534,8 @@ srslte::proc_outcome_t rrc::ho_proc::init(const asn1::rrc::rrc_conn_recfg_s& rrc
Info("Received HO command to target PCell=%d\n", mob_ctrl_info->target_pci); Info("Received HO command to target PCell=%d\n", mob_ctrl_info->target_pci);
srslte::console("Received HO command to target PCell=%d, NCC=%d\n", srslte::console("Received HO command to target PCell=%d, NCC=%d\n",
mob_ctrl_info->target_pci, mob_ctrl_info->target_pci,
recfg_r8.security_cfg_ho.handov_type.intra_lte().next_hop_chaining_count); recfg_r8.security_cfg_ho.handov_type.intra_lte().next_hop_chaining_count);
uint32_t target_earfcn = (mob_ctrl_info->carrier_freq_present) ? mob_ctrl_info->carrier_freq.dl_carrier_freq uint32_t target_earfcn = (mob_ctrl_info->carrier_freq_present) ? mob_ctrl_info->carrier_freq.dl_carrier_freq
: rrc_ptr->meas_cells.serving_cell().get_earfcn(); : rrc_ptr->meas_cells.serving_cell().get_earfcn();

Loading…
Cancel
Save