From a9da755338b8c263fabd78987dcfff96dc09e750 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 29 Jul 2024 17:54:32 +0200 Subject: [PATCH] nfapi pack/unpack: OAI only supports 14 symbols All packing was wrong and used 12 instead of 14 symbols. However, as of now and my knowledge, OAI only supports 14 symbols. --- nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c | 6 ++---- nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c index 295cca7a48..6aaedeb854 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c @@ -1141,9 +1141,8 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; // Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04 uint8_t cyclicprefix = 1; - bool normal_CP = cyclicprefix ? false : true; // 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2 - uint8_t number_of_symbols_per_slot = normal_CP ? 14 : 12; + uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12; for (int i = 0; i < slotsperframe[pNfapiMsg->ssb_config.scs_common.value]; i++) { // TODO check right number of slots for (int k = 0; k < number_of_symbols_per_slot; k++) { // TODO can change? retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SLOT_CONFIG_TAG, @@ -1362,9 +1361,8 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void * const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; // Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04 uint8_t cyclicprefix = 1; - bool normal_CP = cyclicprefix ? false : true; // 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2 - uint8_t number_of_symbols_per_slot = normal_CP ? 14 : 12; + uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12; pNfapiMsg->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *)malloc( slotsperframe[pNfapiMsg->ssb_config.scs_common.value] * sizeof(nfapi_nr_max_tdd_periodicity_t)); diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c index abcbc3e971..0cc2a56808 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c @@ -276,9 +276,8 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; // Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04 uint8_t cyclicprefix = 1; - bool normal_CP = cyclicprefix ? false : true; // 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2 - uint8_t number_of_symbols_per_slot = normal_CP ? 14 : 12; + uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12; for (int i = 0; i < slotsperframe[unpacked_req->ssb_config.scs_common.value]; i++) { for (int k = 0; k < number_of_symbols_per_slot; k++) { @@ -805,9 +804,8 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; // Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04 uint8_t cyclicprefix = 1; - bool normal_CP = cyclicprefix ? false : true; // 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2 - uint8_t number_of_symbols_per_slot = normal_CP ? 14 : 12; + uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12; dst->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *)malloc(slotsperframe[dst->ssb_config.scs_common.value] * sizeof(nfapi_nr_max_tdd_periodicity_t));