Skip to content

Commit f2dff0b

Browse files
committed
Merge branch 'next' into agpl_next
2 parents 4d2b5b8 + 31665aa commit f2dff0b

File tree

7 files changed

+84
-10
lines changed

7 files changed

+84
-10
lines changed

lib/include/srsran/rlc/rlc_am_nr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ class rlc_am_nr_rx : public rlc_am::rlc_am_base_rx
235235

236236
void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final;
237237

238-
void stop();
239-
void reestablish();
238+
void reestablish() final;
239+
void stop() final;
240240

241241
// Status PDU
242242
bool get_do_status();

lib/src/rlc/rlc_am_base.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ bool rlc_am::configure(const rlc_config_t& cfg_)
9999
} else if (cfg.rat == srsran_rat_t::nr) {
100100
RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, "
101101
"t_poll_retx=%d, poll_pdu=%d, poll_byte=%d, "
102-
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%di, tx_queue_length=%d",
102+
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%d, tx_queue_length=%d",
103103
to_number(cfg.am_nr.tx_sn_field_length),
104104
to_number(cfg.am_nr.rx_sn_field_length),
105105
cfg.am_nr.t_poll_retx,

lib/src/rlc/rlc_am_nr.cc

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,28 @@ void rlc_am_nr_tx::empty_queue_no_lock()
11761176
unique_byte_buffer_t buf = tx_sdu_queue.read();
11771177
}
11781178
}
1179-
void rlc_am_nr_tx::stop() {}
1179+
1180+
void rlc_am_nr_tx::stop()
1181+
{
1182+
std::lock_guard<std::mutex> lock(mutex);
1183+
empty_queue_no_lock();
1184+
1185+
if (parent->timers != nullptr && poll_retransmit_timer.is_valid()) {
1186+
poll_retransmit_timer.stop();
1187+
}
1188+
1189+
st = {};
1190+
1191+
sdu_under_segmentation_sn = INVALID_RLC_SN;
1192+
1193+
// Drop all messages in TX window
1194+
tx_window->clear();
1195+
1196+
// Drop all messages in RETX queue
1197+
retx_queue->clear();
1198+
1199+
tx_enabled = false;
1200+
}
11801201

11811202
void rlc_am_nr_tx::timer_expired(uint32_t timeout_id)
11821203
{
@@ -1336,7 +1357,25 @@ bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_)
13361357
return true;
13371358
}
13381359

1339-
void rlc_am_nr_rx::stop() {}
1360+
void rlc_am_nr_rx::stop()
1361+
{
1362+
std::lock_guard<std::mutex> lock(mutex);
1363+
1364+
if (parent->timers != nullptr && reassembly_timer.is_valid()) {
1365+
reassembly_timer.stop();
1366+
}
1367+
1368+
if (parent->timers != nullptr && status_prohibit_timer.is_valid()) {
1369+
status_prohibit_timer.stop();
1370+
}
1371+
1372+
st = {};
1373+
1374+
do_status = false;
1375+
1376+
// Drop all messages in RX window
1377+
rx_window->clear();
1378+
}
13401379

13411380
void rlc_am_nr_rx::reestablish()
13421381
{

srsenb/src/enb_cfg_parser.cc

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,8 +1814,9 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t*
18141814
return SRSRAN_ERROR;
18151815
}
18161816
if (rrc_nr_cfg_->is_standalone) {
1817-
if (cfg.phy_cell.carrier.dl_center_frequency_hz != 1842.5e6) {
1818-
ERROR("Only DL-ARFCN 368500 supported.");
1817+
if (is_valid_arfcn(cfg.band, cfg.dl_arfcn) == false) {
1818+
ERROR("DL-ARFCN %d in band n%d not supported with coreset0 config.", cfg.dl_arfcn, cfg.band);
1819+
ERROR("Valid ARFCNs for band n%d are: %s", cfg.band, valid_arfcns_to_string(cfg.band).c_str());
18191820
return SRSRAN_ERROR;
18201821
}
18211822
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*
18281829
return SRSRAN_SUCCESS;
18291830
}
18301831

1832+
// List of selected ARFCNs in band n3, n7 and n20 that match the coreset0 config
1833+
using arfcn_list_t = std::list<uint32_t>;
1834+
std::map<uint32_t, arfcn_list_t> valid_arfcn = {{3, {363500, 368500, 369500, 374500, 375000}},
1835+
{7, {525000, 526200, 531000}},
1836+
{20, {159000, 160200}}};
1837+
1838+
std::string valid_arfcns_to_string(uint32_t band)
1839+
{
1840+
std::string band_string;
1841+
if (valid_arfcn.find(band) != valid_arfcn.end()) {
1842+
for (const auto& arfcn : valid_arfcn.at(band)) {
1843+
band_string += std::to_string(arfcn);
1844+
band_string += ", ";
1845+
}
1846+
}
1847+
return band_string;
1848+
}
1849+
1850+
bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn)
1851+
{
1852+
if (valid_arfcn.find(band) == valid_arfcn.end()) {
1853+
return false;
1854+
}
1855+
const auto& arfcn_list = valid_arfcn.at(band);
1856+
for (const auto& arfcn : arfcn_list) {
1857+
if (arfcn == dl_arfcn) {
1858+
return true;
1859+
}
1860+
}
1861+
return false;
1862+
}
1863+
18311864
} // namespace enb_conf_sections
18321865

18331866
namespace sib_sections {

srsenb/src/enb_cfg_parser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ int parse_cell_cfg(all_args_t* args_, srsran_cell_t* cell);
5151
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_);
5252
int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_, const srsran_cell_t& cell_cfg_);
5353
int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t* phy_cfg_);
54+
bool is_valid_arfcn(uint32_t band, uint32_t dl_arfcn);
55+
std::string valid_arfcns_to_string(uint32_t band);
5456

5557
} // namespace enb_conf_sections
5658

srsenb/src/parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int parser::section::parse(Setting& root)
118118
*enabled_value = false;
119119
return 0;
120120
} else {
121-
std::cerr << "Error in section " << name.c_str() << ". " << ex.getPath() << " not found." << std::endl;
121+
std::cerr << "Error section " << name.c_str() << " not found." << std::endl;
122122
return -1;
123123
}
124124
}

srsgnb/src/stack/ngap/ngap.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ bool ngap::handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu)
426426
case ngap_pdu_c::types_opts::unsuccessful_outcome:
427427
return handle_unsuccessful_outcome(rx_pdu.unsuccessful_outcome());
428428
default:
429-
logger.error("Unhandled PDU type %d", rx_pdu.type().value);
429+
logger.warning("Unhandled PDU type %d", rx_pdu.type().value);
430430
return false;
431431
}
432432

@@ -447,7 +447,7 @@ bool ngap::handle_initiating_message(const asn1::ngap::init_msg_s& msg)
447447
case ngap_elem_procs_o::init_msg_c::types_opts::paging:
448448
return handle_paging(msg.value.paging());
449449
default:
450-
logger.error("Unhandled initiating message: %s", msg.value.type().to_string());
450+
logger.warning("Unhandled initiating message: %s", msg.value.type().to_string());
451451
}
452452
return true;
453453
}

0 commit comments

Comments
 (0)