srsue: refactor SA mode in RRC, don't initilize NSA-5G in NSA mode

master
Andre Puschmann 3 years ago
parent 71f48ee7f2
commit 8464a6ed63

@ -19,7 +19,6 @@
namespace srsue {
struct rrc_nr_args_t {
bool sa_mode;
uint32_t sim_nr_meas_pci;
bool pdcp_short_sn_support;
std::string supported_bands_nr_str;

@ -66,7 +66,7 @@ typedef struct {
gw_args_t gw;
uint32_t sync_queue_size; // Max allowed difference between PHY and Stack clocks (in TTI)
bool have_tti_time_stats;
bool attach_on_nr;
bool sa_mode;
} stack_args_t;
class ue_stack_base

@ -70,10 +70,11 @@ int rrc_nr::init(phy_interface_rrc_nr* phy_,
t310 = task_sched.get_unique_timer();
t311 = task_sched.get_unique_timer();
if (args.sa_mode) {
plmn_is_selected = true; // short-cut SA test
if (rrc_eutra == nullptr) {
// SA mode
plmn_is_selected = true;
// for SA mode setup inital HARQ config and SRB0
// setup inital HARQ config
srsran::dl_harq_cfg_nr_t harq_cfg = {};
harq_cfg.nof_procs = 8;
mac->set_config(harq_cfg);
@ -129,7 +130,7 @@ const char* rrc_nr::get_rb_name(uint32_t lcid)
void rrc_nr::timer_expired(uint32_t timeout_id)
{
logger.debug("Handling Timer Expired");
if (timeout_id == sim_measurement_timer.id()) {
if (timeout_id == sim_measurement_timer.id() && rrc_eutra != nullptr) {
logger.debug("Triggered simulated measurement");
phy_meas_nr_t sim_meas = {};
@ -2072,7 +2073,11 @@ void rrc_nr::ra_completed()
void rrc_nr::ra_problem()
{
if (rrc_eutra) {
rrc_eutra->nr_scg_failure_information(scg_failure_cause_t::random_access_problem);
} else {
// TODO: handle RA problem
}
}
void rrc_nr::release_pucch_srs() {}

@ -142,12 +142,16 @@ void rrc_nr::connection_reconf_no_ho_proc::then(const srsran::proc_state_t& resu
if (result.is_success()) {
Info("Finished %s successfully", name());
srsran::console("RRC NR reconfiguration successful.\n");
if (rrc_handle.rrc_eutra) {
rrc_handle.rrc_eutra->nr_rrc_con_reconfig_complete(true);
}
} else {
// 5.3.5.8.2 Inability to comply with RRCReconfiguration
switch (initiator) {
case reconf_initiator_t::mcg_srb1:
if (rrc_handle.rrc_eutra) {
rrc_handle.rrc_eutra->nr_notify_reconfiguration_failure();
}
break;
default:
Warning("Reconfiguration failure not implemented for initiator %d", initiator);

@ -221,14 +221,16 @@ int ue_stack_lte::init(const stack_args_t& args_)
&pdcp_nr,
gw,
&nas_5g,
&rrc,
args.sa_mode ? nullptr : &rrc,
usim.get(),
task_sched.get_timer_handler(),
this,
args.rrc_nr);
rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc);
if (args.sa_mode) {
nas_5g.init(usim.get(), &rrc_nr, gw, args.nas_5g);
}
running = true;
start(STACK_MAIN_THREAD_PRIO);
@ -276,7 +278,7 @@ bool ue_stack_lte::switch_on()
if (running) {
stack_logger.info("Triggering NAS switch on");
if (!ue_task_queue.try_push([this]() {
if (args.attach_on_nr) {
if (args.sa_mode) {
nas_5g.switch_on();
} else {
nas.switch_on();
@ -329,7 +331,7 @@ bool ue_stack_lte::start_service_request()
{
if (running) {
ue_task_queue.try_push([this]() {
if (args.attach_on_nr) {
if (args.sa_mode) {
nas_5g.start_service_request();
} else {
nas.start_service_request(srsran::establishment_cause_t::mo_data);

@ -110,7 +110,7 @@ int ue::init(const all_args_t& args_)
}
// In SA mode, pass NR PHY pointer to stack
args.stack.attach_on_nr = true;
args.stack.sa_mode = true;
if (lte_stack->init(args.stack, dummy_lte_phy.get(), nr_phy.get(), gw_ptr.get())) {
srsran::console("Error initializing stack.\n");
ret = SRSRAN_ERROR;
@ -272,13 +272,12 @@ int ue::parse_args(const all_args_t& args_)
// Make sure fix sampling rate is set for SA mode
if (args.phy.nof_lte_carriers == 0 and not std::isnormal(args.rf.srate_hz)) {
srsran::console("Error. NR Standalone PHY requires a fix RF sampling rate.\n");
srsran::console("Error. NR Standalone PHY requires a fixed RF sampling rate.\n");
return SRSRAN_ERROR;
}
// SA params
if (args.phy.nof_lte_carriers == 0 && args.phy.nof_nr_carriers == 1) {
args.stack.rrc_nr.sa_mode = true;
// TODO: expose to UE config
args.stack.rrc_nr.dl_nr_arfcn = 368500;
args.stack.rrc_nr.ssb_nr_arfcn = 368410;

Loading…
Cancel
Save