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 {