diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index c3fe268e1..b8e590516 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -43,7 +43,7 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" -#define SRSLTE_DCI_MAX_BITS 57 +#define SRSLTE_DCI_MAX_BITS 128 #define SRSLTE_RAR_GRANT_LEN 20 diff --git a/srslte/lib/phch/dci.c b/srslte/lib/phch/dci.c index 57dc9862a..b4262f857 100644 --- a/srslte/lib/phch/dci.c +++ b/srslte/lib/phch/dci.c @@ -65,7 +65,7 @@ int srslte_dci_msg_to_dl_grant(srslte_dci_msg_t *msg, uint16_t msg_rnti, srslte_dci_format_t tmp = msg->format; ret = srslte_dci_msg_unpack_pdsch(msg, dl_dci, nof_prb, nof_ports, crc_is_crnti); if (ret) { - fprintf(stderr, "Can't unpack DCI message %s (%d)\n", srslte_dci_format_string(tmp), ret); + fprintf(stderr, "Can't unpack DCI message %s (%d)\n", srslte_dci_format_string(tmp), tmp); return ret; } @@ -386,7 +386,8 @@ uint32_t srslte_dci_format_sizeof(srslte_dci_format_t format, uint32_t nof_prb, return dci_format3A_sizeof(nof_prb); */ default: - return SRSLTE_ERROR; + printf("Error computing DCI bits: Unknown format %d\n", format); + return 0; } } diff --git a/srslte/lib/phch/test/CMakeLists.txt b/srslte/lib/phch/test/CMakeLists.txt index 9789a605d..90c658e66 100644 --- a/srslte/lib/phch/test/CMakeLists.txt +++ b/srslte/lib/phch/test/CMakeLists.txt @@ -81,9 +81,6 @@ target_link_libraries(pdcch_test srslte) add_test(pdcch_test pdcch_test) -add_executable(dci_unpacking dci_unpacking.c) -target_link_libraries(dci_unpacking srslte) - BuildMex(MEXNAME pdcch SOURCES pdcch_test_mex.c LIBRARIES srslte_static srslte_mex) ######################################################################## diff --git a/srslte/lib/phch/test/dci_unpacking.c b/srslte/lib/phch/test/dci_unpacking.c deleted file mode 100644 index 7e65b433f..000000000 --- a/srslte/lib/phch/test/dci_unpacking.c +++ /dev/null @@ -1,102 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2015 Software Radio Systems Limited - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include -#include -#include -#include -#include - -#include "srslte/srslte.h" - -void usage(char *prog) { - printf("Usage: %s nof_prb length_bits Word0 Word1 ...\n", prog); -} - -int main(int argc, char **argv) { - srslte_dci_msg_t msg; - srslte_ra_dl_dci_t ra_dl; - int len, rlen; - int nof_prb; - int nwords; - int i; - uint8_t *y; - - if (argc < 3) { - usage(argv[0]); - exit(-1); - } - - nof_prb = atoi(argv[1]); - len = atoi(argv[2]); - - nwords = (len - 1) / 32 + 1; - - if (argc < 3 + nwords) { - usage(argv[0]); - exit(-1); - } - - y = msg.data; - rlen = 0; - uint32_t x; - for (i = 0; i < nwords; i++) { - x = strtoul(argv[i + 3], NULL, 16); - if (len - rlen < 32) { - srslte_bit_unpack(x, &y, len - rlen); - } else { - srslte_bit_unpack(x, &y, 32); - } - - } - - printf("DCI message len %d:\n", len); - for (i = 0; i < len; i++) { - printf("%d, ", msg.data[i]); - } - printf("\n"); - - srslte_dci_msg_type_t dci_type; - msg.nof_bits = len; - if (srslte_dci_msg_get_type(&msg, &dci_type, nof_prb, SRSLTE_SIRNTI)) { - fprintf(stderr, "Can't obtain DCI message type\n"); - exit(-1); - } - printf("\n"); - printf("Message type:"); - srslte_dci_msg_type_fprint(stdout, dci_type); - switch (dci_type.type) { - case SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED: - bzero(&ra_dl, sizeof(srslte_ra_dl_dci_t)); - srslte_dci_msg_unpack_pdsch(&msg, &ra_dl, nof_prb, 1, false); - srslte_ra_pdsch_fprint(stdout, &ra_dl, nof_prb); - break; - default: - printf("Error expected PDSCH\n"); - exit(-1); - } - printf("\n"); -} diff --git a/srslte/lib/phch/test/pucch_test.c b/srslte/lib/phch/test/pucch_test.c index aeec68a41..77fa75e62 100644 --- a/srslte/lib/phch/test/pucch_test.c +++ b/srslte/lib/phch/test/pucch_test.c @@ -90,11 +90,11 @@ int main(int argc, char **argv) { if (srslte_pucch_init(&pucch, cell)) { fprintf(stderr, "Error creating PDSCH object\n"); - goto quit; + exit(-1); } if (srslte_refsignal_ul_init(&dmrs, cell)) { fprintf(stderr, "Error creating PDSCH object\n"); - goto quit; + exit(-1; } bzero(&pucch_cfg, sizeof(srslte_pucch_cfg_t)); diff --git a/srslte/lib/phch/test/pusch_test.c b/srslte/lib/phch/test/pusch_test.c index 8752cc734..def6b5982 100644 --- a/srslte/lib/phch/test/pusch_test.c +++ b/srslte/lib/phch/test/pusch_test.c @@ -184,13 +184,13 @@ int main(int argc, char **argv) { sf_symbols = srslte_vec_malloc(sizeof(cf_t) * nof_re); if (!sf_symbols) { perror("malloc"); - goto quit; + exit(-1); } data = srslte_vec_malloc(sizeof(uint8_t) * cfg.grant.mcs.tbs); if (!data) { perror("malloc"); - goto quit; + exit(-1); } for (uint32_t i=0;i