diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index c9a5dea1a..26dc0b908 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -379,7 +379,11 @@ int srslte_ue_dl_decode_rnti_multi(srslte_ue_dl_t *q, cf_t *input[SRSLTE_MAX_POR switch(dci_msg.format) { case SRSLTE_DCI_FORMAT1: case SRSLTE_DCI_FORMAT1A: - mimo_type = SRSLTE_MIMO_TYPE_SINGLE_ANTENNA; + if (q->cell.nof_ports == 1) { + mimo_type = SRSLTE_MIMO_TYPE_SINGLE_ANTENNA; + } else { + mimo_type = SRSLTE_MIMO_TYPE_TX_DIVERSITY; + } break; case SRSLTE_DCI_FORMAT2: if (grant.nof_tb == 1 && dci_unpacked.pinfo == 0) { @@ -456,7 +460,10 @@ int srslte_ue_dl_ri_pmi_select(srslte_ue_dl_t *q, uint32_t *ri, uint32_t *pmi, f float best_sinr = -INFINITY; uint32_t best_pmi = 0, best_ri = 0; - if (q->cell.nof_ports == 2 && q->nof_rx_antennas == 2) { + if (q->cell.nof_ports < 2 || q->nof_rx_antennas < 2) { + /* Do nothing */ + return SRSLTE_SUCCESS; + } else if (q->cell.nof_ports == 2 && q->nof_rx_antennas == 2) { if (srslte_pdsch_pmi_select(&q->pdsch, &q->pdsch_cfg, q->ce_m, noise_estimate, SRSLTE_SF_LEN_RE(q->cell.nof_prb, q->cell.cp), q->pmi, q->sinr)) { ERROR("SINR calculation error"); @@ -489,7 +496,7 @@ int srslte_ue_dl_ri_pmi_select(srslte_ue_dl_t *q, uint32_t *ri, uint32_t *pmi, f } else if (q->pdsch_cfg.nof_layers == 2) { *current_sinr = q->sinr[1][q->pdsch_cfg.codebook_idx - 1]; } else { - ERROR("Not implemented number of layers"); + ERROR("Not implemented number of layers (%d)", q->pdsch_cfg.nof_layers); return SRSLTE_ERROR; } }