From 86adbfceaed2dd2f16232ed431a67e2be95abfcf Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 19 Jun 2020 12:27:17 +0100 Subject: [PATCH] fix nr stack activation --- srsenb/hdr/phy/txrx.h | 4 +--- srsenb/src/phy/phy.cc | 2 +- srsenb/src/phy/phy_common.cc | 3 +++ srsenb/src/phy/txrx.cc | 8 +------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/srsenb/hdr/phy/txrx.h b/srsenb/hdr/phy/txrx.h index 09b5e256d..01ce9764e 100644 --- a/srsenb/hdr/phy/txrx.h +++ b/srsenb/hdr/phy/txrx.h @@ -37,8 +37,7 @@ class txrx final : public srslte::thread { public: txrx(); - bool init(stack_interface_phy_lte* stack_, - srslte::radio_interface_phy* radio_handler, + bool init(srslte::radio_interface_phy* radio_handler, srslte::thread_pool* _workers_pool, phy_common* worker_com, prach_worker_pool* prach_, @@ -49,7 +48,6 @@ public: private: void run_thread() override; - stack_interface_phy_lte* stack = nullptr; srslte::radio_interface_phy* radio_h = nullptr; srslte::log* log_h = nullptr; srslte::thread_pool* workers_pool = nullptr; diff --git a/srsenb/src/phy/phy.cc b/srsenb/src/phy/phy.cc index 3c41077fb..56c5aa4e2 100644 --- a/srsenb/src/phy/phy.cc +++ b/srsenb/src/phy/phy.cc @@ -130,7 +130,7 @@ int phy::init(const phy_args_t& args, prach.set_max_prach_offset_us(args.max_prach_offset_us); // Warning this must be initialized after all workers have been added to the pool - tx_rx.init(stack_, radio, &workers_pool, &workers_common, &prach, log_vec.at(0).get(), SF_RECV_THREAD_PRIO); + tx_rx.init(radio, &workers_pool, &workers_common, &prach, log_vec.at(0).get(), SF_RECV_THREAD_PRIO); initialized = true; diff --git a/srsenb/src/phy/phy_common.cc b/srsenb/src/phy/phy_common.cc index 1c134e0ab..9c2a5d939 100644 --- a/srsenb/src/phy/phy_common.cc +++ b/srsenb/src/phy/phy_common.cc @@ -139,6 +139,9 @@ void phy_common::worker_end(void* tx_sem_id, // Always transmit on single radio radio->tx(buffer, tx_time); + // Trigger MAC clock + stack->tti_clock(); + // Allow next TTI to transmit semaphore.release(); } diff --git a/srsenb/src/phy/txrx.cc b/srsenb/src/phy/txrx.cc index c8d492752..dc111e343 100644 --- a/srsenb/src/phy/txrx.cc +++ b/srsenb/src/phy/txrx.cc @@ -50,15 +50,13 @@ txrx::txrx() : thread("TXRX") /* Do nothing */ } -bool txrx::init(stack_interface_phy_lte* stack_, - srslte::radio_interface_phy* radio_h_, +bool txrx::init(srslte::radio_interface_phy* radio_h_, srslte::thread_pool* workers_pool_, phy_common* worker_com_, prach_worker_pool* prach_, srslte::log* log_h_, uint32_t prio_) { - stack = stack_; radio_h = radio_h_; log_h = log_h_; workers_pool = workers_pool_; @@ -163,10 +161,6 @@ void txrx::run_thread() for (uint32_t cc = 0; cc < worker_com->get_nof_carriers(); cc++) { prach->new_tti(cc, tti, buffer.get(worker_com->get_rf_port(cc), 0, worker_com->get_nof_ports(0))); } - - // Advance stack in time - stack->tti_clock(); - } else { // wait_worker() only returns NULL if it's being closed. Quit now to avoid unnecessary loops here running = false;