From bc10943a2bcacf5306f6a16d23da75ac0250c0d4 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 11 Feb 2020 10:02:55 +0100 Subject: [PATCH] Added get max TB from DCI format --- lib/include/srslte/phy/phch/dci.h | 2 ++ lib/src/phy/phch/dci.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/include/srslte/phy/phch/dci.h b/lib/include/srslte/phy/phch/dci.h index 270036bd6..20831d57c 100644 --- a/lib/include/srslte/phy/phch/dci.h +++ b/lib/include/srslte/phy/phch/dci.h @@ -236,4 +236,6 @@ SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t* c, uint32_t L, uin SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t* c); +SRSLTE_API uint32_t srslte_dci_format_max_tb(srslte_dci_format_t format); + #endif // DCI_ diff --git a/lib/src/phy/phch/dci.c b/lib/src/phy/phch/dci.c index 129d83c53..e7f1c6e3d 100644 --- a/lib/src/phy/phch/dci.c +++ b/lib/src/phy/phch/dci.c @@ -1678,3 +1678,32 @@ uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, char* info_str, uint32_t le return n; } + +uint32_t srslte_dci_format_max_tb(srslte_dci_format_t format) +{ + uint32_t ret = 0; + switch (format) { + case SRSLTE_DCI_FORMAT0: + case SRSLTE_DCI_FORMAT1: + case SRSLTE_DCI_FORMAT1A: + case SRSLTE_DCI_FORMAT1C: + case SRSLTE_DCI_FORMAT1B: + case SRSLTE_DCI_FORMAT1D: + case SRSLTE_DCI_FORMATN0: + case SRSLTE_DCI_FORMATN1: + case SRSLTE_DCI_FORMATN2: + case SRSLTE_DCI_FORMAT_RAR: + ret = 1; + break; + case SRSLTE_DCI_FORMAT2: + case SRSLTE_DCI_FORMAT2A: + case SRSLTE_DCI_FORMAT2B: + ret = 2; + break; + case SRSLTE_DCI_NOF_FORMATS: + default: + ret = 0; + break; + } + return ret; +}