Fix SSB pattern in UE

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent 8f90ee847a
commit e3bd92d87c

@ -73,7 +73,7 @@ void to_asn1(asn1::rrc_nr::plmn_id_s* asn1_type, const plmn_id_t& cfg);
bool make_phy_rach_cfg(const asn1::rrc_nr::rach_cfg_common_s& asn1_type, srsran_prach_cfg_t* prach_cfg);
bool make_phy_tdd_cfg(const asn1::rrc_nr::tdd_ul_dl_cfg_common_s& tdd_ul_dl_cfg_common,
srsran_duplex_config_nr_t* srsran_duplex_config_nr);
srsran_duplex_config_nr_t* srsran_duplex_config_nr);
bool make_phy_harq_ack_cfg(const asn1::rrc_nr::phys_cell_group_cfg_s& phys_cell_group_cfg,
srsran_harq_ack_cfg_hl_t* srsran_ue_dl_nr_harq_ack_cfg);
bool make_phy_coreset_cfg(const asn1::rrc_nr::ctrl_res_set_s& ctrl_res_set, srsran_coreset_t* srsran_coreset);
@ -110,7 +110,9 @@ bool make_phy_zp_csi_rs_resource(const asn1::rrc_nr::zp_csi_rs_res_s& zp_csi_rs_
bool make_phy_nzp_csi_rs_resource(const asn1::rrc_nr::nzp_csi_rs_res_s& nzp_csi_rs_res,
srsran_csi_rs_nzp_resource_t* csi_rs_nzp_resource);
bool make_phy_carrier_cfg(const asn1::rrc_nr::freq_info_dl_s& freq_info_dl, srsran_carrier_nr_t* carrier_nr);
bool make_phy_ssb_cfg(const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell_cfg, phy_cfg_nr_t::ssb_cfg_t* ssb);
bool make_phy_ssb_cfg(const srsran_carrier_nr_t& carrier,
const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell_cfg,
phy_cfg_nr_t::ssb_cfg_t* ssb);
/***************************
* MAC Config

@ -15,6 +15,7 @@
#include "srsran/phy/common/phy_common_nr.h"
#include <array>
#include <set>
#include <stdint.h>
#include <vector>

@ -1393,9 +1393,20 @@ static inline void make_ssb_positions_in_burst(const bitstring_t&
}
}
bool make_phy_ssb_cfg(const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell_cfg, phy_cfg_nr_t::ssb_cfg_t* out_ssb)
bool make_phy_ssb_cfg(const srsran_carrier_nr_t& carrier,
const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell_cfg,
phy_cfg_nr_t::ssb_cfg_t* out_ssb)
{
srsran::srsran_band_helper bands;
uint16_t band = bands.get_band_from_dl_freq_Hz(carrier.ssb_center_freq_hz);
if (band == UINT16_MAX) {
asn1::log_error("Invalid band for SSB frequency %.3f MHz", carrier.ssb_center_freq_hz);
return false;
}
phy_cfg_nr_t::ssb_cfg_t ssb = {};
// Parse subcarrier spacing
if (serv_cell_cfg.ssb_subcarrier_spacing_present) {
switch (serv_cell_cfg.ssb_subcarrier_spacing) {
case subcarrier_spacing_e::khz15:
@ -1408,6 +1419,15 @@ bool make_phy_ssb_cfg(const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell_c
asn1::log_error("SSB SCS not supported");
return false;
}
} else {
}
// Get the SSB pattern
ssb.pattern = bands.get_ssb_pattern(band, ssb.scs);
if (ssb.pattern == SRSRAN_SSB_PATTERN_INVALID) {
asn1::log_error(
"Band %d and SS/PBCH block SCS %s results on invalid pattern", band, srsran_subcarrier_spacing_to_str(ssb.scs));
return false;
}
if (serv_cell_cfg.ssb_positions_in_burst_present) {

@ -1163,7 +1163,7 @@ bool rrc_nr::apply_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg)
return false;
}
phy_cfg_nr_t::ssb_cfg_t ssb_cfg = {};
if (make_phy_ssb_cfg(recfg_with_sync.sp_cell_cfg_common, &ssb_cfg) == true) {
if (make_phy_ssb_cfg(phy_cfg.carrier, recfg_with_sync.sp_cell_cfg_common, &ssb_cfg) == true) {
phy_cfg.ssb = ssb_cfg;
} else {
logger.warning("Warning while building SSB config structure");

Loading…
Cancel
Save