From 327aa97cfdfc28f687047aa1f6ea5d4ccb8206e8 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 12 Feb 2020 17:40:47 +0100 Subject: [PATCH] add macro for invalid RNTI 0x0 --- lib/include/srslte/phy/common/phy_common.h | 1 + srsue/src/phy/cc_worker.cc | 5 ++--- srsue/src/stack/mac/mac.cc | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index cb76fe219..fafc9b8c9 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -71,6 +71,7 @@ typedef enum { SRSLTE_CP_NORM = 0, SRSLTE_CP_EXT } srslte_cp_t; typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t; +#define SRSLTE_INVALID_RNTI 0x0 // TS 36.321 - Table 7.1-1 RNTI 0x0 isn't a valid DL RNTI #define SRSLTE_CRNTI_START 0x000B #define SRSLTE_CRNTI_END 0xFFF3 #define SRSLTE_RARNTI_START 0x0001 diff --git a/srsue/src/phy/cc_worker.cc b/srsue/src/phy/cc_worker.cc index fd2d49873..618ee8df4 100644 --- a/srsue/src/phy/cc_worker.cc +++ b/srsue/src/phy/cc_worker.cc @@ -370,10 +370,9 @@ int cc_worker::decode_pdcch_dl() { int nof_grants = 0; - srslte_dci_dl_t dci[SRSLTE_MAX_CARRIERS] = {}; - uint16_t dl_rnti = phy->stack->get_dl_sched_rnti(CURRENT_TTI); - if (dl_rnti) { + if (dl_rnti != SRSLTE_INVALID_RNTI) { + srslte_dci_dl_t dci[SRSLTE_MAX_CARRIERS] = {}; /* Blind search first without cross scheduling then with it if enabled */ for (int i = 0; i < (ue_dl_cfg.cfg.dci.cif_present ? 2 : 1) && !nof_grants; i++) { diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index 3ba84d59e..a9ada3f7c 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -291,7 +291,8 @@ uint16_t mac::get_ul_sched_rnti(uint32_t tti) if (uernti.crnti) { return uernti.crnti; } - return 0; + Error("Couldn't configure RNTI for UL transmission.\n"); + return SRSLTE_INVALID_RNTI; } bool mac::is_in_window(uint32_t tti, int* start, int* len) @@ -329,7 +330,7 @@ uint16_t mac::get_dl_sched_rnti(uint32_t tti) // TODO: This scheduling decision belongs to RRC if (si_window_length > 1) { // This is not a SIB1 if ((tti / 10) % 2 == 0 && (tti % 10) == 5) { // Skip subframe #5 for which SFN mod 2 = 0 - return 0; + return SRSLTE_INVALID_RNTI; } } Debug("SCHED: Searching SI-RNTI, tti=%d, window start=%d, length=%d\n", tti, si_window_start, si_window_length); @@ -352,7 +353,9 @@ uint16_t mac::get_dl_sched_rnti(uint32_t tti) Debug("SCHED: Searching P-RNTI\n"); return SRSLTE_PRNTI; } - return 0; + + // turn off DCI search for this TTI + return SRSLTE_INVALID_RNTI; } void mac::bch_decoded_ok(uint8_t* payload, uint32_t len)