Correctly fill the frame structure for Tx/Rx endpoints and fft size for Rx endpoints

This commit is contained in:
Teodora
2025-08-26 15:17:38 +02:00
parent 0b0e804f73
commit 8bd6e16ad1
3 changed files with 25 additions and 0 deletions
+7
View File
@@ -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 {
+1
View File
@@ -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;
@@ -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;
}