diff --git a/srslte/include/srslte/ue/ue_dl.h b/srslte/include/srslte/ue/ue_dl.h index 07bcd9470..f31056ee4 100644 --- a/srslte/include/srslte/ue/ue_dl.h +++ b/srslte/include/srslte/ue/ue_dl.h @@ -117,23 +117,23 @@ SRSLTE_API int srslte_ue_dl_cfg_grant(srslte_ue_dl_t *q, uint32_t rvidx); SRSLTE_API int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, - srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, - uint16_t rnti); + uint16_t rnti, + srslte_dci_msg_t *dci_msg); SRSLTE_API int srslte_ue_dl_find_dl_dci(srslte_ue_dl_t *q, - srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, - uint16_t rnti); + uint16_t rnti, + srslte_dci_msg_t *dci_msg); SRSLTE_API int srslte_ue_dl_find_dl_dci_type(srslte_ue_dl_t *q, - srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, uint16_t rnti, - srslte_rnti_type_t rnti_type); + srslte_rnti_type_t rnti_type, + srslte_dci_msg_t *dci_msg); SRSLTE_API uint32_t srslte_ue_dl_get_ncce(srslte_ue_dl_t *q); diff --git a/srslte/lib/ue/ue_dl.c b/srslte/lib/ue/ue_dl.c index 7e1b97bef..87b2e56e2 100644 --- a/srslte/lib/ue/ue_dl.c +++ b/srslte/lib/ue/ue_dl.c @@ -296,7 +296,7 @@ typedef struct { uint32_t nof_locations; } dci_blind_search_t; -static int dci_blind_search(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, dci_blind_search_t *search_space, uint16_t rnti) +static int dci_blind_search(srslte_ue_dl_t *q, dci_blind_search_t *search_space, uint16_t rnti, srslte_dci_msg_t *dci_msg) { int ret = SRSLTE_ERROR; uint16_t crc_rem = 0; @@ -329,7 +329,7 @@ static int dci_blind_search(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, dci_bl return ret; } -int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, uint16_t rnti) +int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_idx, uint16_t rnti, srslte_dci_msg_t *dci_msg) { if (rnti) { /* Do not search if an UL DCI is already pending */ @@ -343,14 +343,14 @@ int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3 dci_blind_search_t search_space; search_space.format = SRSLTE_DCI_FORMAT0; search_space.nof_locations = srslte_pdcch_ue_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, cfi, rnti); - return dci_blind_search(q, dci_msg, &search_space, rnti); + return dci_blind_search(q, &search_space, rnti, dci_msg); } else { return 0; } } -int srslte_ue_dl_find_dl_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, uint16_t rnti) +int srslte_ue_dl_find_dl_dci(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_idx, uint16_t rnti, srslte_dci_msg_t *dci_msg) { srslte_rnti_type_t rnti_type; if (rnti == SRSLTE_SIRNTI) { @@ -362,11 +362,11 @@ int srslte_ue_dl_find_dl_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3 } else { rnti_type = SRSLTE_RNTI_USER; } - return srslte_ue_dl_find_dl_dci_type(q, dci_msg, cfi, sf_idx, rnti, rnti_type); + return srslte_ue_dl_find_dl_dci_type(q, cfi, sf_idx, rnti, rnti_type, dci_msg); } // Blind search for SI/P/RA-RNTI -static int find_dl_dci_type_siprarnti(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint32_t cfi, uint16_t rnti) +static int find_dl_dci_type_siprarnti(srslte_ue_dl_t *q, uint32_t cfi, uint16_t rnti, srslte_dci_msg_t *dci_msg) { int ret = 0; // Configure and run DCI blind search @@ -374,7 +374,7 @@ static int find_dl_dci_type_siprarnti(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_m search_space.nof_locations = srslte_pdcch_common_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi); for (int f=0;fpdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, q->cfi, rnti); for (int f=0;fpdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi); - return dci_blind_search(q, dci_msg, &search_space, rnti); + return dci_blind_search(q, &search_space, rnti, dci_msg); } -int srslte_ue_dl_find_dl_dci_type(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint32_t cfi, uint32_t sf_idx, - uint16_t rnti, srslte_rnti_type_t rnti_type) +int srslte_ue_dl_find_dl_dci_type(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_idx, + uint16_t rnti, srslte_rnti_type_t rnti_type, srslte_dci_msg_t *dci_msg) { if (rnti_type == SRSLTE_RNTI_SI || rnti_type == SRSLTE_RNTI_PCH || rnti_type == SRSLTE_RNTI_RAR) { - return find_dl_dci_type_siprarnti(q, dci_msg, cfi, rnti); + return find_dl_dci_type_siprarnti(q, cfi, rnti, dci_msg); } else { - return find_dl_dci_type_crnti(q, dci_msg, cfi, sf_idx, rnti); + return find_dl_dci_type_crnti(q, cfi, sf_idx, rnti, dci_msg); } } @@ -427,7 +427,7 @@ int srslte_ue_dl_decode_rnti_rv(srslte_ue_dl_t *q, cf_t *input, uint8_t *data, u return SRSLTE_ERROR; } - int found_dci = srslte_ue_dl_find_dl_dci(q, &dci_msg, q->cfi, sf_idx, rnti); + int found_dci = srslte_ue_dl_find_dl_dci(q, q->cfi, sf_idx, rnti, &dci_msg); if (found_dci == 1) { if (srslte_dci_msg_to_dl_grant(&dci_msg, rnti, q->cell.nof_prb, q->cell.nof_ports, &dci_unpacked, &grant)) {