diff --git a/lib/include/srslte/phy/phch/dci.h b/lib/include/srslte/phy/phch/dci.h index ea20f3f0d..6d263ffbd 100644 --- a/lib/include/srslte/phy/phch/dci.h +++ b/lib/include/srslte/phy/phch/dci.h @@ -224,7 +224,7 @@ SRSLTE_API uint32_t srslte_dci_format_sizeof(const srslte_cell_t* cell, SRSLTE_API void srslte_dci_dl_fprint(FILE* f, srslte_dci_dl_t* dci, uint32_t nof_prb); -SRSLTE_API uint32_t srslte_dci_dl_info(srslte_dci_dl_t* dci_dl, char* str, uint32_t str_len); +SRSLTE_API uint32_t srslte_dci_dl_info(const srslte_dci_dl_t* dci_dl, char* str, uint32_t str_len); SRSLTE_API uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, char* info_str, uint32_t len); diff --git a/lib/src/phy/phch/dci.c b/lib/src/phy/phch/dci.c index a2b425b82..01ccedcb2 100644 --- a/lib/src/phy/phch/dci.c +++ b/lib/src/phy/phch/dci.c @@ -1551,7 +1551,7 @@ void srslte_dci_dl_fprint(FILE* f, srslte_dci_dl_t* dci, uint32_t nof_prb) } } -static uint32_t print_multi(char* info_str, uint32_t n, uint32_t len, srslte_dci_dl_t* dci_dl, uint32_t value_id) +static uint32_t print_multi(char* info_str, uint32_t n, uint32_t len, const srslte_dci_dl_t* dci_dl, uint32_t value_id) { uint32_t nof_tb = 1; if (dci_dl->format >= SRSLTE_DCI_FORMAT2) { @@ -1576,7 +1576,7 @@ static uint32_t print_multi(char* info_str, uint32_t n, uint32_t len, srslte_dci return n; } -uint32_t srslte_dci_dl_info(srslte_dci_dl_t* dci_dl, char* info_str, uint32_t len) +uint32_t srslte_dci_dl_info(const srslte_dci_dl_t* dci_dl, char* info_str, uint32_t len) { uint32_t n = 0; n = srslte_print_check(info_str, diff --git a/lib/src/phy/phch/ra_dl.c b/lib/src/phy/phch/ra_dl.c index d10b87db2..e88072323 100644 --- a/lib/src/phy/phch/ra_dl.c +++ b/lib/src/phy/phch/ra_dl.c @@ -432,7 +432,9 @@ static int dl_dci_compute_tb(bool pdsch_use_tbs_index_alt, const srslte_dci_dl_t if (grant->tb[i].enabled) { grant->tb[i].tbs = srslte_dl_fill_ra_mcs(&grant->tb[i], grant->last_tbs[i], n_prb, pdsch_use_tbs_index_alt); if (grant->tb[i].tbs < 0) { - ERROR("Computing TBS from MCS=%d, n_prb=%d\n", grant->tb[i].mcs_idx, n_prb); + char str[128]; + srslte_dci_dl_info(dci, str, sizeof(str)); + ERROR("Computing TBS from %s\n", str); return SRSLTE_ERROR; } } else { diff --git a/lib/src/phy/phch/ra_ul.c b/lib/src/phy/phch/ra_ul.c index 4385f9d97..fb41d7b6b 100644 --- a/lib/src/phy/phch/ra_ul.c +++ b/lib/src/phy/phch/ra_ul.c @@ -331,4 +331,4 @@ uint32_t srslte_ra_ul_info(const srslte_pusch_grant_t* grant, char* info_str, ui grant->tb.tbs / 8, srslte_mod_bits_x_symbol(grant->tb.mod), grant->tb.rv); -} \ No newline at end of file +} diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index 4f3e0dc71..98c5697fd 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -240,7 +240,7 @@ int srslte_ue_dl_set_cell(srslte_ue_dl_t* q, srslte_cell_t cell) } ret = SRSLTE_SUCCESS; } else { - ERROR("Invalid cell properties ue_dl: Id=%d, Ports=%d, PRBs=%d\n", q->cell.id, q->cell.nof_ports, q->cell.nof_prb); + ERROR("Invalid cell properties ue_dl: Id=%d, Ports=%d, PRBs=%d\n", cell.id, cell.nof_ports, cell.nof_prb); } return ret; } diff --git a/lib/src/phy/ue/ue_ul.c b/lib/src/phy/ue/ue_ul.c index 6364b173a..079d292ad 100644 --- a/lib/src/phy/ue/ue_ul.c +++ b/lib/src/phy/ue/ue_ul.c @@ -208,7 +208,9 @@ int srslte_ue_ul_dci_to_pusch_grant(srslte_ue_ul_t* q, srslte_pusch_grant_t* grant) { if (srslte_ra_ul_dci_to_grant(&q->cell, sf, &cfg->ul_cfg.hopping, dci, grant)) { - ERROR("Converting DCI to UL grant\n"); + char str[128]; + srslte_dci_ul_info(dci, str, sizeof(str)); + ERROR("Converting DCI to UL grant from %s\n", str); return SRSLTE_ERROR; } diff --git a/srsue/src/phy/cc_worker.cc b/srsue/src/phy/cc_worker.cc index 227ec4a12..89b53c1a4 100644 --- a/srsue/src/phy/cc_worker.cc +++ b/srsue/src/phy/cc_worker.cc @@ -662,6 +662,9 @@ bool cc_worker::work_ul(srslte_uci_data_t* uci_data) if (srslte_ue_ul_dci_to_pusch_grant(&ue_ul, &sf_cfg_ul, &ue_ul_cfg, &dci_ul, &ue_ul_cfg.ul_cfg.pusch.grant)) { Error("Converting DCI message to UL dci\n"); ul_grant_available = false; + } else if (ue_ul_cfg.ul_cfg.pusch.grant.tb.mod == SRSLTE_MOD_BPSK) { + Error("UL retransmission without valid stored grant.\n"); + ul_grant_available = false; } else { // Save TBS info for next retx phy->last_ul_tb[pid][cc_idx] = ue_ul_cfg.ul_cfg.pusch.grant.tb;