From 8bd6e16ad108379e73bfb9b3e8c64be721e94b9c Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 27 Jun 2025 12:41:00 +0200 Subject: [PATCH] Correctly fill the frame structure for Tx/Rx endpoints and fft size for Rx endpoints --- radio/fhi_72/mplane/ru-mplane-api.c | 7 +++++++ radio/fhi_72/mplane/ru-mplane-api.h | 1 + radio/fhi_72/mplane/yang/create-yang-config.c | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/radio/fhi_72/mplane/ru-mplane-api.c b/radio/fhi_72/mplane/ru-mplane-api.c index f70514e66f..508ed2a393 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.c +++ b/radio/fhi_72/mplane/ru-mplane-api.c @@ -91,6 +91,13 @@ bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_ // RU port ID xran_mplane->ru_port = 0; + // Frame structure + match_list = NULL; + count = 0; + get_ru_xml_list(buffer, "supported-frame-structures", &match_list, &count); + xran_mplane->frame_str = (int16_t)atoi((char *)match_list[0]); + free_match_list(match_list, count); + if (strcasecmp(ru_vendor, "BENETEL") == 0 /* || strcmp(ru_vendor, "VVDN-LPRU") == 0 || strcmp(ru_vendor, "Metanoia") == 0 */) { fix_benetel_setting(xran_mplane, interface_mtu, first_iq_width, max_num_ant); } else { diff --git a/radio/fhi_72/mplane/ru-mplane-api.h b/radio/fhi_72/mplane/ru-mplane-api.h index 70857adea6..a51e500c96 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.h +++ b/radio/fhi_72/mplane/ru-mplane-api.h @@ -57,6 +57,7 @@ typedef struct { uint8_t band_sector; uint8_t ccid; uint8_t ru_port; + int16_t frame_str; // might be needed in the future xran releases } xran_mplane_t; diff --git a/radio/fhi_72/mplane/yang/create-yang-config.c b/radio/fhi_72/mplane/yang/create-yang-config.c index 0ab680ee19..e6cf25c626 100644 --- a/radio/fhi_72/mplane/yang/create-yang-config.c +++ b/radio/fhi_72/mplane/yang/create-yang-config.c @@ -23,6 +23,7 @@ #include "common/utils/nr/nr_common.h" #define VERIFY_SUCCESS(var, message, args...) AssertError(var, return false, message, ##args) +const char *scs_name[] = {"KHZ_15", "KHZ_30", "KHZ_60", "KHZ_120", "KHZ_240", NULL}; #ifdef MPLANE_V2 static bool create_cu_interface_v2(struct ly_ctx **ctx, const ru_session_t *ru_session, const size_t idx, const char *int_name, struct lyd_node **root) @@ -110,6 +111,11 @@ static LY_ERR fill_uplane_ch_common_v2(const uplane_dir_t dir, const xran_mplane { LY_ERR ret = LY_SUCCESS; + char frame_str[8]; + snprintf(frame_str, sizeof(frame_str), "%d", (oai->split7.fftSize << 4) + oai->nr_scs_for_raster); // 3GPP TS 38.211 + ret = lyd_new_term(*root, NULL, "frame-structure", frame_str, 0, NULL); + VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"frame-structure\" node.\n"); + ret = lyd_new_term(*root, NULL, "cp-length", "0", 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"cp-length\" node.\n"); @@ -181,6 +187,17 @@ static bool fill_uplane_ch_rx_v2(const xran_mplane_t *xran_mplane, const openair ret = fill_uplane_ch_common_v2(UP_CH_RX, xran_mplane, oai, idx, root); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create common nodes.\n"); + struct lyd_node *fft_offset = NULL; + ret = lyd_new_list(*root, NULL, "ul-fft-sampling-offsets", 0, &fft_offset, scs_name[oai->nr_scs_for_raster]); + VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"ul-fft-sampling-offsets\" node.\n"); + + // Note: set of allowed values is restricted by SCS derived from values in supported-frame-structures. + char ul_fft_offset[8]; + const int frame = (oai->split7.fftSize << 4) + oai->nr_scs_for_raster; + snprintf(ul_fft_offset, sizeof(ul_fft_offset), "%d", frame - xran_mplane->frame_str); + ret = lyd_new_term(fft_offset, NULL, "ul-fft-sampling-offset", ul_fft_offset, 0, NULL); + VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"ul-fft-sampling-offset\" node.\n"); + return true; }