ue, rrc_nr: refactor PHY config statages for NSA/SA operation

split the PHY config states into NSA and SA states.
this should remove unwanted warnings when PHY returns
from the configuration.
This commit is contained in:
Andre Puschmann 2022-02-07 15:55:10 +01:00
parent 21c3a448b7
commit 32885e2404
3 changed files with 20 additions and 13 deletions

View File

@ -197,8 +197,10 @@ private:
// Stores the state of the PHY configuration setting // Stores the state of the PHY configuration setting
enum { enum {
PHY_CFG_STATE_NONE = 0, PHY_CFG_STATE_NONE = 0,
PHY_CFG_STATE_APPLY_SP_CELL, PHY_CFG_STATE_SA_SIB_CFG,
PHY_CFG_STATE_RA_COMPLETED, PHY_CFG_STATE_SA_FULL_CFG,
PHY_CFG_STATE_NSA_APPLY_SP_CELL,
PHY_CFG_STATE_NSA_RA_COMPLETED,
} phy_cfg_state; } phy_cfg_state;
rrc_nr_args_t args = {}; rrc_nr_args_t args = {};

View File

@ -472,6 +472,7 @@ void rrc_nr::handle_sib1(const sib1_s& sib1)
// Apply SSB Config // Apply SSB Config
fill_phy_ssb_cfg(sib1.serving_cell_cfg_common, &phy_cfg.ssb); fill_phy_ssb_cfg(sib1.serving_cell_cfg_common, &phy_cfg.ssb);
phy_cfg_state = PHY_CFG_STATE_SA_SIB_CFG;
if (not phy->set_config(phy_cfg)) { if (not phy->set_config(phy_cfg)) {
logger.warning("Could not set phy config."); logger.warning("Could not set phy config.");
return; return;
@ -582,7 +583,10 @@ void rrc_nr::send_ul_ccch_msg(const asn1::rrc_nr::ul_ccch_msg_s& msg)
} }
asn1::bit_ref bref(pdu->msg, pdu->get_tailroom()); asn1::bit_ref bref(pdu->msg, pdu->get_tailroom());
msg.pack(bref); if (msg.pack(bref) != SRSASN_SUCCESS) {
logger.error("Coulnd't pack UL-CCCH message.");
return;
}
bref.align_bytes_zero(); bref.align_bytes_zero();
pdu->N_bytes = (uint32_t)bref.distance_bytes(pdu->msg); pdu->N_bytes = (uint32_t)bref.distance_bytes(pdu->msg);
pdu->set_timestamp(); pdu->set_timestamp();
@ -1589,8 +1593,6 @@ bool rrc_nr::apply_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg)
{ {
update_sp_cell_cfg(sp_cell_cfg); update_sp_cell_cfg(sp_cell_cfg);
phy_cfg_state = PHY_CFG_STATE_APPLY_SP_CELL;
return true; return true;
} }
@ -1768,9 +1770,11 @@ bool rrc_nr::update_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg)
// defer CSI config until after RA complete // defer CSI config until after RA complete
srsran::phy_cfg_nr_t current_phycfg = phy_cfg; srsran::phy_cfg_nr_t current_phycfg = phy_cfg;
current_phycfg.csi = prev_csi; current_phycfg.csi = prev_csi;
phy_cfg_state = PHY_CFG_STATE_NSA_APPLY_SP_CELL;
phy->set_config(current_phycfg); phy->set_config(current_phycfg);
} else { } else {
// apply full config immediately // apply full config immediately
phy_cfg_state = PHY_CFG_STATE_SA_FULL_CFG;
phy->set_config(phy_cfg); phy->set_config(phy_cfg);
} }
@ -1793,8 +1797,6 @@ bool rrc_nr::apply_cell_group_cfg(const cell_group_cfg_s& cell_group_cfg)
{ {
update_cell_group_cfg(cell_group_cfg); update_cell_group_cfg(cell_group_cfg);
phy_cfg_state = PHY_CFG_STATE_APPLY_SP_CELL;
return true; return true;
} }
@ -2102,8 +2104,8 @@ void rrc_nr::ra_completed()
logger.info("RA completed."); logger.info("RA completed.");
if (rrc_eutra) { if (rrc_eutra) {
logger.debug("Applying remaining CSI configuration."); logger.debug("Applying remaining CSI configuration.");
phy_cfg_state = PHY_CFG_STATE_NSA_RA_COMPLETED;
phy->set_config(phy_cfg); phy->set_config(phy_cfg);
phy_cfg_state = PHY_CFG_STATE_RA_COMPLETED;
} else { } else {
phy_cfg_state = PHY_CFG_STATE_NONE; phy_cfg_state = PHY_CFG_STATE_NONE;
} }
@ -2146,12 +2148,18 @@ void rrc_nr::set_phy_config_complete(bool status)
case PHY_CFG_STATE_NONE: case PHY_CFG_STATE_NONE:
logger.warning("PHY configuration completed without a clear state."); logger.warning("PHY configuration completed without a clear state.");
break; break;
case PHY_CFG_STATE_APPLY_SP_CELL: case PHY_CFG_STATE_SA_SIB_CFG:
logger.info("PHY configuration with SIB parameters completed.");
break;
case PHY_CFG_STATE_SA_FULL_CFG:
logger.info("PHY configuration completed.");
break;
case PHY_CFG_STATE_NSA_APPLY_SP_CELL:
// Start RA procedure // Start RA procedure
logger.info("PHY configuration completed. Starting RA procedure."); logger.info("PHY configuration completed. Starting RA procedure.");
mac->start_ra_procedure(); mac->start_ra_procedure();
break; break;
case PHY_CFG_STATE_RA_COMPLETED: case PHY_CFG_STATE_NSA_RA_COMPLETED:
logger.info("Remaining CSI configuration completed."); logger.info("Remaining CSI configuration completed.");
break; break;
} }

View File

@ -220,9 +220,6 @@ proc_outcome_t rrc_nr::setup_request_proc::step()
if (state == state_t::config_serving_cell) { if (state == state_t::config_serving_cell) {
// TODO: start serving cell config and start T300 // TODO: start serving cell config and start T300
rrc_handle.phy_cfg_state = PHY_CFG_STATE_APPLY_SP_CELL;
rrc_handle.phy->set_config(rrc_handle.phy_cfg);
// start T300 // start T300
rrc_handle.t300.run(); rrc_handle.t300.run();