nr,gnb,rrc: set consistent rs_power for SIB1 and phy cfg

master
Francisco 3 years ago committed by Francisco Paisana
parent 79a018683f
commit 0c983d0b54

@ -1053,7 +1053,7 @@ void fill_serv_cell_cfg_common_sib(const rrc_cell_cfg_nr_t& cell_cfg, serving_ce
cfg.ssb_periodicity_serving_cell.value = serving_cell_cfg_common_sib_s::ssb_periodicity_serving_cell_opts::ms20; cfg.ssb_periodicity_serving_cell.value = serving_cell_cfg_common_sib_s::ssb_periodicity_serving_cell_opts::ms20;
cfg.ss_pbch_block_pwr = -16; cfg.ss_pbch_block_pwr = cell_cfg.phy_cell.pdsch.rs_power;
} }
int fill_sib1_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1::rrc_nr::sib1_s& sib1) int fill_sib1_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1::rrc_nr::sib1_s& sib1)

@ -30,6 +30,20 @@
namespace srsenb { namespace srsenb {
template <typename T>
T uninit_value()
{
return std::numeric_limits<T>::max();
}
template <typename T>
void set_if_unset(T value, T& out)
{
if (out == std::numeric_limits<T>::max()) {
out = value;
}
}
/// Generate default phy cell configuration /// Generate default phy cell configuration
void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell) void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell)
{ {
@ -45,9 +59,10 @@ void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell)
// PRACH // PRACH
phy_cell.prach.is_nr = true; phy_cell.prach.is_nr = true;
phy_cell.prach.config_idx = 8; phy_cell.prach.config_idx = uninit_value<uint32_t>();
phy_cell.prach.root_seq_idx = 1; phy_cell.prach.root_seq_idx = 1;
phy_cell.prach.freq_offset = 1; phy_cell.prach.freq_offset = 1; // msg1-FrequencyStart (zero not supported with current PRACH implementation)
phy_cell.prach.zero_corr_zone = uninit_value<uint32_t>();
phy_cell.prach.num_ra_preambles = phy_cell.num_ra_preambles; phy_cell.prach.num_ra_preambles = phy_cell.num_ra_preambles;
phy_cell.prach.hs_flag = false; phy_cell.prach.hs_flag = false;
phy_cell.prach.tdd_config.configured = false; phy_cell.prach.tdd_config.configured = false;
@ -317,13 +332,11 @@ int set_derived_nr_cell_params(bool is_sa, rrc_cell_cfg_nr_t& cell)
// Derive remaining PHY cell params // Derive remaining PHY cell params
if (is_sa) { if (is_sa) {
// PRACH // PRACH
cell.phy_cell.prach.config_idx = 16; set_if_unset(16u, cell.phy_cell.prach.config_idx);
cell.phy_cell.prach.freq_offset = 1; // msg1-FrequencyStart (zero not supported with current PRACH implementation) set_if_unset(15u, cell.phy_cell.prach.zero_corr_zone);
cell.phy_cell.prach.zero_corr_zone = 15;
} else { } else {
cell.phy_cell.prach.config_idx = 0; set_if_unset(0u, cell.phy_cell.prach.config_idx);
cell.phy_cell.prach.freq_offset = 1; set_if_unset(0u, cell.phy_cell.prach.zero_corr_zone);
cell.phy_cell.prach.zero_corr_zone = 0;
} }
cell.phy_cell.prach.num_ra_preambles = cell.phy_cell.num_ra_preambles; cell.phy_cell.prach.num_ra_preambles = cell.phy_cell.num_ra_preambles;
cell.phy_cell.prach.tdd_config.configured = (cell.duplex_mode == SRSRAN_DUPLEX_MODE_TDD); cell.phy_cell.prach.tdd_config.configured = (cell.duplex_mode == SRSRAN_DUPLEX_MODE_TDD);

Loading…
Cancel
Save