Fix SSB pattern in UE

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

@ -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