diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index fc99608094..ab5f1fdb08 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -235,8 +235,8 @@ class rlc_am_nr_rx : public rlc_am::rlc_am_base_rx 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(); diff --git a/lib/src/rlc/rlc_am_base.cc b/lib/src/rlc/rlc_am_base.cc index 80b7213e41..5286fc829c 100644 --- a/lib/src/rlc/rlc_am_base.cc +++ b/lib/src/rlc/rlc_am_base.cc @@ -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, diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 06914a5bc9..0d18758672 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -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 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 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() { diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 7cc8af26ab..b46f9c77a8 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -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; +std::map 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 { diff --git a/srsenb/src/enb_cfg_parser.h b/srsenb/src/enb_cfg_parser.h index 7acf640925..f0efc4fd6d 100644 --- a/srsenb/src/enb_cfg_parser.h +++ b/srsenb/src/enb_cfg_parser.h @@ -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 diff --git a/srsenb/src/parser.cc b/srsenb/src/parser.cc index 8b4f49b853..76f90215a3 100644 --- a/srsenb/src/parser.cc +++ b/srsenb/src/parser.cc @@ -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; } } diff --git a/srsgnb/src/stack/ngap/ngap.cc b/srsgnb/src/stack/ngap/ngap.cc index 57de44cd77..d25184dc71 100644 --- a/srsgnb/src/stack/ngap/ngap.cc +++ b/srsgnb/src/stack/ngap/ngap.cc @@ -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; }