From ad646f436c446227f58c5c428e112969eb0ff9ac Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 20 Sep 2021 19:18:32 +0200 Subject: [PATCH] Ignore PDSCH during cell selection --- srsue/hdr/phy/phy_common.h | 2 ++ srsue/src/phy/lte/cc_worker.cc | 7 ++++++- srsue/src/phy/phy.cc | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/phy/phy_common.h b/srsue/hdr/phy/phy_common.h index 18cc46b7c..ede7de462 100644 --- a/srsue/hdr/phy/phy_common.h +++ b/srsue/hdr/phy/phy_common.h @@ -56,6 +56,8 @@ public: srsran::phy_cfg_mbsfn_t mbsfn_config = {}; + std::atomic cell_is_selecting = {false}; + // Secondary serving cell states scell::state cell_state; diff --git a/srsue/src/phy/lte/cc_worker.cc b/srsue/src/phy/lte/cc_worker.cc index 9fa2e921e..bf2352d34 100644 --- a/srsue/src/phy/lte/cc_worker.cc +++ b/srsue/src/phy/lte/cc_worker.cc @@ -280,7 +280,12 @@ bool cc_worker::work_dl_regular() // Decode PDSCH decode_pdsch(ack_resource, &dl_action, dl_ack); - // Informs Stack about the decoding status + // Informs Stack about the decoding status, send NACK if cell is in process of re-selection + if (phy->cell_is_selecting) { + for (uint32_t i = 0; i < SRSRAN_MAX_CODEWORDS; i++) { + dl_ack[i] = false; + } + } phy->stack->tb_decoded(cc_idx, mac_grant, dl_ack); } diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index c6fb51f3a..94672b253 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -306,6 +306,10 @@ bool phy::cell_select(phy_cell_t cell) if (sfsync.cell_select_init(cell)) { // Update PCI before starting the background command to make sure PRACH gets the updated value selected_cell.id = cell.pci; + + // Indicate workers that cell selection is in progress + common.cell_is_selecting = true; + cmd_worker_cell.add_cmd([this, cell]() { // Wait SYNC transitions to IDLE sfsync.wait_idle(); @@ -320,6 +324,10 @@ bool phy::cell_select(phy_cell_t cell) selected_cell = sync_cell; } stack->cell_select_complete(ret); + + // Indicate workers that cell selection has finished + common.cell_is_selecting = false; + }); return true; } else {