mirror of https://github.com/PentHertz/srsLTE.git
nr,gnb,rrc: set consistent rs_power for SIB1 and phy cfg
This commit is contained in:
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.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)
|
||||
|
|
|
@ -30,6 +30,20 @@
|
|||
|
||||
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
|
||||
void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell)
|
||||
{
|
||||
|
@ -44,12 +58,13 @@ void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell)
|
|||
phy_cell.num_ra_preambles = 52;
|
||||
|
||||
// PRACH
|
||||
phy_cell.prach.is_nr = true;
|
||||
phy_cell.prach.config_idx = 8;
|
||||
phy_cell.prach.root_seq_idx = 1;
|
||||
phy_cell.prach.freq_offset = 1;
|
||||
phy_cell.prach.num_ra_preambles = phy_cell.num_ra_preambles;
|
||||
phy_cell.prach.hs_flag = false;
|
||||
phy_cell.prach.is_nr = true;
|
||||
phy_cell.prach.config_idx = uninit_value<uint32_t>();
|
||||
phy_cell.prach.root_seq_idx = 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.hs_flag = false;
|
||||
phy_cell.prach.tdd_config.configured = false;
|
||||
|
||||
// PDCCH
|
||||
|
@ -317,13 +332,11 @@ int set_derived_nr_cell_params(bool is_sa, rrc_cell_cfg_nr_t& cell)
|
|||
// Derive remaining PHY cell params
|
||||
if (is_sa) {
|
||||
// PRACH
|
||||
cell.phy_cell.prach.config_idx = 16;
|
||||
cell.phy_cell.prach.freq_offset = 1; // msg1-FrequencyStart (zero not supported with current PRACH implementation)
|
||||
cell.phy_cell.prach.zero_corr_zone = 15;
|
||||
set_if_unset(16u, cell.phy_cell.prach.config_idx);
|
||||
set_if_unset(15u, cell.phy_cell.prach.zero_corr_zone);
|
||||
} else {
|
||||
cell.phy_cell.prach.config_idx = 0;
|
||||
cell.phy_cell.prach.freq_offset = 1;
|
||||
cell.phy_cell.prach.zero_corr_zone = 0;
|
||||
set_if_unset(0u, cell.phy_cell.prach.config_idx);
|
||||
set_if_unset(0u, cell.phy_cell.prach.zero_corr_zone);
|
||||
}
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue