Merge branch 'next' into agpl_next

This commit is contained in:
Codebot 2022-05-04 16:21:18 +00:00 committed by SRS codebot
commit f2dff0b7a0
7 changed files with 84 additions and 10 deletions

View File

@ -235,8 +235,8 @@ public:
void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final;
void stop();
void reestablish();
void reestablish() final;
void stop() final;
// Status PDU
bool get_do_status();

View File

@ -99,7 +99,7 @@ bool rlc_am::configure(const rlc_config_t& cfg_)
} else if (cfg.rat == srsran_rat_t::nr) {
RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, "
"t_poll_retx=%d, poll_pdu=%d, poll_byte=%d, "
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%di, tx_queue_length=%d",
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%d, tx_queue_length=%d",
to_number(cfg.am_nr.tx_sn_field_length),
to_number(cfg.am_nr.rx_sn_field_length),
cfg.am_nr.t_poll_retx,

View File

@ -1176,7 +1176,28 @@ void rlc_am_nr_tx::empty_queue_no_lock()
unique_byte_buffer_t buf = tx_sdu_queue.read();
}
}
void rlc_am_nr_tx::stop() {}
void rlc_am_nr_tx::stop()
{
std::lock_guard<std::mutex> lock(mutex);
empty_queue_no_lock();
if (parent->timers != nullptr && poll_retransmit_timer.is_valid()) {
poll_retransmit_timer.stop();
}
st = {};
sdu_under_segmentation_sn = INVALID_RLC_SN;
// Drop all messages in TX window
tx_window->clear();
// Drop all messages in RETX queue
retx_queue->clear();
tx_enabled = false;
}
void rlc_am_nr_tx::timer_expired(uint32_t timeout_id)
{
@ -1336,7 +1357,25 @@ bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_)
return true;
}
void rlc_am_nr_rx::stop() {}
void rlc_am_nr_rx::stop()
{
std::lock_guard<std::mutex> lock(mutex);
if (parent->timers != nullptr && reassembly_timer.is_valid()) {
reassembly_timer.stop();
}
if (parent->timers != nullptr && status_prohibit_timer.is_valid()) {
status_prohibit_timer.stop();
}
st = {};
do_status = false;
// Drop all messages in RX window
rx_window->clear();
}
void rlc_am_nr_rx::reestablish()
{

View File

@ -1814,8 +1814,9 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t*
return SRSRAN_ERROR;
}
if (rrc_nr_cfg_->is_standalone) {
if (cfg.phy_cell.carrier.dl_center_frequency_hz != 1842.5e6) {
ERROR("Only DL-ARFCN 368500 supported.");
if (is_valid_arfcn(cfg.band, cfg.dl_arfcn) == false) {
ERROR("DL-ARFCN %d in band n%d not supported with coreset0 config.", cfg.dl_arfcn, cfg.band);
ERROR("Valid ARFCNs for band n%d are: %s", cfg.band, valid_arfcns_to_string(cfg.band).c_str());
return SRSRAN_ERROR;
}
if (cfg.duplex_mode == SRSRAN_DUPLEX_MODE_TDD) {
@ -1828,6 +1829,38 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t*
return SRSRAN_SUCCESS;
}
// List of selected ARFCNs in band n3, n7 and n20 that match the coreset0 config
using arfcn_list_t = std::list<uint32_t>;
std::map<uint32_t, arfcn_list_t> valid_arfcn = {{3, {363500, 368500, 369500, 374500, 375000}},
{7, {525000, 526200, 531000}},
{20, {159000, 160200}}};
std::string valid_arfcns_to_string(uint32_t band)
{
std::string band_string;
if (valid_arfcn.find(band) != valid_arfcn.end()) {
for (const auto& arfcn : valid_arfcn.at(band)) {
band_string += std::to_string(arfcn);
band_string += ", ";
}
}
return band_string;
}
bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn)
{
if (valid_arfcn.find(band) == valid_arfcn.end()) {
return false;
}
const auto& arfcn_list = valid_arfcn.at(band);
for (const auto& arfcn : arfcn_list) {
if (arfcn == dl_arfcn) {
return true;
}
}
return false;
}
} // namespace enb_conf_sections
namespace sib_sections {

View File

@ -51,6 +51,8 @@ int parse_cell_cfg(all_args_t* args_, srsran_cell_t* cell);
int parse_cfg_files(all_args_t* args_, rrc_cfg_t* rrc_cfg_, rrc_nr_cfg_t* rrc_cfg_nr_, phy_cfg_t* phy_cfg_);
int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_, const srsran_cell_t& cell_cfg_);
int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t* phy_cfg_);
bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn);
std::string valid_arfcns_to_string(uint32_t band);
} // namespace enb_conf_sections

View File

@ -118,7 +118,7 @@ int parser::section::parse(Setting& root)
*enabled_value = false;
return 0;
} else {
std::cerr << "Error in section " << name.c_str() << ". " << ex.getPath() << " not found." << std::endl;
std::cerr << "Error section " << name.c_str() << " not found." << std::endl;
return -1;
}
}

View File

@ -426,7 +426,7 @@ bool ngap::handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu)
case ngap_pdu_c::types_opts::unsuccessful_outcome:
return handle_unsuccessful_outcome(rx_pdu.unsuccessful_outcome());
default:
logger.error("Unhandled PDU type %d", rx_pdu.type().value);
logger.warning("Unhandled PDU type %d", rx_pdu.type().value);
return false;
}
@ -447,7 +447,7 @@ bool ngap::handle_initiating_message(const asn1::ngap::init_msg_s& msg)
case ngap_elem_procs_o::init_msg_c::types_opts::paging:
return handle_paging(msg.value.paging());
default:
logger.error("Unhandled initiating message: %s", msg.value.type().to_string());
logger.warning("Unhandled initiating message: %s", msg.value.type().to_string());
}
return true;
}