Fix coverty issues (#652)

master
Ismael Gomez 5 years ago committed by GitHub
parent bd1e367263
commit 6bb0790cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -412,6 +412,7 @@ struct phy_cfg_t {
{
ZERO_OBJECT(ul_cfg);
ZERO_OBJECT(dl_cfg);
ZERO_OBJECT(prach_cfg);
set_defaults_common();
set_defaults_dedicated();

@ -581,9 +581,8 @@ void set_phy_cfg_t_scell_config(phy_cfg_t* cfg, const asn1::rrc::scell_to_add_mo
// Parse Transmission mode
if (non_ul_cfg->ant_info_r10_present) {
asn1::rrc::ant_info_ded_r10_s::tx_mode_r10_e_::options tx_mode = non_ul_cfg->ant_info_r10.tx_mode_r10.value;
if ((srslte_tm_t)tx_mode < SRSLTE_TMINV) {
cfg->dl_cfg.tm = (srslte_tm_t)tx_mode;
if (non_ul_cfg->ant_info_r10.tx_mode_r10.to_number() < (uint8_t)SRSLTE_TMINV) {
cfg->dl_cfg.tm = (srslte_tm_t)non_ul_cfg->ant_info_r10.tx_mode_r10.to_number();
} else {
fprintf(stderr,
"Transmission mode (R10) %s is not supported\n",

@ -66,7 +66,7 @@ void print_console(srsasn_logger_level_t log_level, void* ctx, const char* str)
}
struct TestLogger {
TestLogger(const std::string& layer_) : layer(layer_) {}
TestLogger(const std::string& layer_) : layer(layer_), last_level(LOG_LEVEL_INFO) {}
void log(srsasn_logger_level_t log_level, const char* str)
{
last_level = log_level;

@ -402,6 +402,7 @@ bool rrc::modify_ue_ctxt(uint16_t rnti, LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIO
if (err) {
// maybe pass a cause value?
pthread_mutex_unlock(&user_mutex);
return false;
}

@ -444,7 +444,7 @@ void phy::set_config(srslte::phy_cfg_t& config, uint32_t cc_idx, uint32_t earfcn
if (cc_idx == 0) {
prach_cfg = config.prach_cfg;
} else {
} else if (cell_info) {
// If SCell does not share synchronism with PCell ...
if (m->radio_idx > 0) {
scell_sync.at(m->radio_idx - 1)->set_scell_cell(cc_idx, cell_info, earfcn);
@ -465,6 +465,8 @@ void phy::set_config(srslte::phy_cfg_t& config, uint32_t cc_idx, uint32_t earfcn
common.scell_cfg[cc_idx].pci = cell_info->id;
common.scell_cfg[cc_idx].configured = true;
common.scell_cfg[cc_idx].enabled = false;
} else {
Error("Configuring Scell index %d but cell_info not provided\n", cc_idx);
}
} else {

@ -2446,6 +2446,11 @@ void rrc::apply_phy_scell_config(const asn1::rrc::scell_to_add_mod_r10_s* scell_
srslte_cell_t scell = {};
uint32_t earfcn = 0;
if (phy != nullptr) {
rrc_log->info("RRC not initialized. Skipping PHY config.\n");
return;
}
// Initialise default parameters from primary cell
phy->get_current_cell(&scell, &earfcn);
@ -2462,18 +2467,14 @@ void rrc::apply_phy_scell_config(const asn1::rrc::scell_to_add_mod_r10_s* scell_
scell.nof_prb = rr_cfg->non_ul_cfg_r10.dl_bw_r10.to_number();
scell.nof_ports = rr_cfg->non_ul_cfg_r10.ant_info_common_r10.ant_ports_count.to_number();
scell.phich_length = (srslte_phich_length_t)rr_cfg->non_ul_cfg_r10.phich_cfg_r10.phich_dur.value;
scell.phich_resources = (srslte_phich_r_t)rr_cfg->non_ul_cfg_r10.phich_cfg_r10.phich_res.value;
scell.phich_resources = (srslte_phich_r_t)rr_cfg->non_ul_cfg_r10.phich_cfg_r10.phich_res.to_number();
}
// Initialize scell config with pcell cfg
srslte::phy_cfg_t scell_phy_cfg = current_phy_cfg;
set_phy_cfg_t_scell_config(&scell_phy_cfg, scell_config);
if (phy != nullptr) {
phy->set_config(scell_phy_cfg, scell_config->s_cell_idx_r10, earfcn, &scell);
} else {
rrc_log->info("RRC not initialized. Skipping PHY config.\n");
}
}
void rrc::log_mac_config_dedicated()

Loading…
Cancel
Save