fix wraparound in si proc and error in scell parsing

master
Francisco Paisana 5 years ago committed by Andre Puschmann
parent 0dd93c793c
commit b8b8740258

@ -373,11 +373,11 @@ int parse_default_field(T& obj,
template <typename T>
int parse_bounded_number(T& number, Setting& fieldroot, T num_min, T num_max)
{
T num = (T)fieldroot;
if (num < num_min or num > num_max) {
number = (T)fieldroot;
if (number < num_min or number > num_max) {
std::cout << "Parser Warning: Value of " << fieldroot.getName() << " must be within bound [" << num_min << ", "
<< num_max << "]\n";
num = (num > num_max) ? num_max : num_min;
number = (number > num_max) ? num_max : num_min;
}
return 0;
}

@ -799,7 +799,7 @@ void rrc::config_mac()
item.cell = cfg.cell;
// copy secondary cell list info
sched_cfg[ccidx].scell_list.resize(cfg.cell_list[ccidx].scell_list.size());
sched_cfg[ccidx].scell_list.reserve(cfg.cell_list[ccidx].scell_list.size());
for (uint32_t scidx = 0; scidx < cfg.cell_list[ccidx].scell_list.size(); ++scidx) {
const auto& scellitem = cfg.cell_list[ccidx].scell_list[scidx];
// search enb_cc_idx specific to cell_id
@ -808,11 +808,13 @@ void rrc::config_mac()
});
if (it == cfg.cell_list.end()) {
rrc_log->warning("Secondary cell 0x%x not configured\n", scellitem.cell_id);
continue;
}
uint32_t scell_enb_idx = it - cfg.cell_list.begin();
sched_cfg[ccidx].scell_list[scidx].enb_cc_idx = scell_enb_idx;
sched_cfg[ccidx].scell_list[scidx].ul_allowed = scellitem.ul_allowed;
sched_cfg[ccidx].scell_list[scidx].cross_carrier_scheduling = scellitem.cross_carrier_sched;
sched_interface::cell_cfg_t::scell_cfg_t scellcfg;
scellcfg.enb_cc_idx = it - cfg.cell_list.begin();
scellcfg.ul_allowed = scellitem.ul_allowed;
scellcfg.cross_carrier_scheduling = scellitem.cross_carrier_sched;
sched_cfg[ccidx].scell_list.push_back(std::move(scellcfg));
}
}

@ -309,8 +309,13 @@ void rrc::si_acquire_proc::start_si_acquire()
rrc_ptr->mac->bcch_start_rx(si_win_start, si_win_len);
// start window retry timer
uint32_t retry_period = (sib_index == 0) ? sib1_periodicity : period * nof_sib_harq_retxs;
si_acq_retry_timer.set(retry_period + (si_win_start - tti));
uint32_t retry_period = (sib_index == 0) ? sib1_periodicity : period * nof_sib_harq_retxs;
uint32_t tics_until_si_win_start = srslte_tti_interval(si_win_start, tti);
if (tics_until_si_win_start > 10240 / 2) {
Error("The SI Window start was incorrectly calculated. si_win_start=%d, tti=%d\n", si_win_start, tti);
}
uint32_t tics_until_si_retry = retry_period + tics_until_si_win_start;
si_acq_retry_timer.set(tics_until_si_retry);
si_acq_retry_timer.run();
Info("Instructed MAC to search for SIB%d, win_start=%d, win_len=%d, period=%d, sched_index=%d\n",

Loading…
Cancel
Save