|
|
@ -26,6 +26,14 @@ dl_harq_entity_nr::dl_harq_entity_nr(uint8_t cc_idx_,
|
|
|
|
// Init broadcast HARQ process
|
|
|
|
// Init broadcast HARQ process
|
|
|
|
bcch_proc.init(-1);
|
|
|
|
bcch_proc.init(-1);
|
|
|
|
pthread_rwlock_init(&rwlock, NULL);
|
|
|
|
pthread_rwlock_init(&rwlock, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create default number of processes
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < cfg.nof_procs; i++) {
|
|
|
|
|
|
|
|
harq_procs[i] = std::unique_ptr<dl_harq_process_nr>(new dl_harq_process_nr(this));
|
|
|
|
|
|
|
|
if (!harq_procs.at(i)->init(i)) {
|
|
|
|
|
|
|
|
logger.error("Error while initializing DL-HARQ process %d", i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dl_harq_entity_nr::~dl_harq_entity_nr()
|
|
|
|
dl_harq_entity_nr::~dl_harq_entity_nr()
|
|
|
@ -42,17 +50,19 @@ int32_t dl_harq_entity_nr::set_config(const srsran::dl_harq_cfg_nr_t& cfg_)
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// clear old processees
|
|
|
|
if (cfg_.nof_procs < cfg.nof_procs) {
|
|
|
|
for (auto& proc : harq_procs) {
|
|
|
|
// clear old processes if not needed
|
|
|
|
proc = nullptr;
|
|
|
|
for (uint32_t i = cfg.nof_procs - 1; i < cfg_.nof_procs; i++) {
|
|
|
|
}
|
|
|
|
harq_procs[i] = nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
// Allocate and init configured HARQ processes
|
|
|
|
} else {
|
|
|
|
for (uint32_t i = 0; i < cfg.nof_procs; i++) {
|
|
|
|
// Add new processes
|
|
|
|
harq_procs[i] = std::unique_ptr<dl_harq_process_nr>(new dl_harq_process_nr(this));
|
|
|
|
for (uint32_t i = cfg.nof_procs; i < cfg_.nof_procs; i++) {
|
|
|
|
if (!harq_procs.at(i)->init(i)) {
|
|
|
|
harq_procs[i] = std::unique_ptr<dl_harq_process_nr>(new dl_harq_process_nr(this));
|
|
|
|
logger.error("Error while initializing DL-HARQ process %d", i);
|
|
|
|
if (!harq_procs.at(i)->init(i)) {
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
logger.error("Error while initializing DL-HARQ process %d", i);
|
|
|
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|