Skip to content

Commit

Permalink
Merge branch 'next' into agpl_next
Browse files Browse the repository at this point in the history
  • Loading branch information
srs-codebot committed May 4, 2022
2 parents 4d2b5b8 + 31665aa commit f2dff0b
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/include/srsran/rlc/rlc_am_nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/rlc/rlc_am_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
43 changes: 41 additions & 2 deletions lib/src/rlc/rlc_am_nr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()
{
Expand Down
37 changes: 35 additions & 2 deletions srsenb/src/enb_cfg_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions srsenb/src/enb_cfg_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion srsenb/src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions srsgnb/src/stack/ngap/ngap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down

0 comments on commit f2dff0b

Please sign in to comment.