diff --git a/srslte/lib/enb/enb_dl.c b/srslte/lib/enb/enb_dl.c index 047a40554..2958b74f6 100644 --- a/srslte/lib/enb/enb_dl.c +++ b/srslte/lib/enb/enb_dl.c @@ -234,12 +234,12 @@ int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t *q, srslte_ra_dl_dci_t *grant, uint16_t rnti = srslte_pdsch_get_rnti_multi(&q->pdsch, rnti_idx); bool rnti_is_user = true; - if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || rnti == SRSLTE_MRNTI) { + if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)) { rnti_is_user = false; } - //srslte_ra_pdsch_fprint(stdout, grant, q->cell.nof_prb); srslte_dci_msg_pack_pdsch(grant, &dci_msg, format, q->cell.nof_prb, rnti_is_user); + //srslte_vec_fprint_hex(stdout, dci_msg.data, dci_msg.nof_bits); if (srslte_pdcch_encode(&q->pdcch, &dci_msg, location, rnti, q->sf_symbols, sf_idx, q->cfi)) { fprintf(stderr, "Error encoding DCI message\n"); return SRSLTE_ERROR; diff --git a/srslte/lib/phch/dci.c b/srslte/lib/phch/dci.c index 043633bb6..0327df2df 100644 --- a/srslte/lib/phch/dci.c +++ b/srslte/lib/phch/dci.c @@ -614,10 +614,14 @@ int dci_format1As_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t srslte_bit_unpack(data->harq_process, &y, 3); - if (!crc_is_crnti && nof_prb >= 50 && data->type2_alloc.mode == SRSLTE_RA_TYPE2_DIST) { - *y++ = data->type2_alloc.n_gap; + if (crc_is_crnti) { + if (nof_prb >= 50 && data->type2_alloc.mode == SRSLTE_RA_TYPE2_DIST) { + *y++ = data->type2_alloc.n_gap; + } else { + y++; // bit reserved + } } else { - y++; // bit reserved + *y++ = data->ndi; } // rv version diff --git a/srslte/lib/utils/vector.c b/srslte/lib/utils/vector.c index 16a01611e..e88d0890f 100644 --- a/srslte/lib/utils/vector.c +++ b/srslte/lib/utils/vector.c @@ -423,7 +423,7 @@ void srslte_vec_fprint_hex(FILE *stream, uint8_t *x, uint32_t len) { fprintf(stream, "%02x ", byte); } if (len%8) { - byte = (uint8_t) srslte_bit_pack(&x, len%8); + byte = (uint8_t) srslte_bit_pack(&x, len%8)<<(8-(len%8)); fprintf(stream, "%02x ", byte); } fprintf(stream, "];\n");