From 10d60f71ce014f371f9a3c938159148212fac297 Mon Sep 17 00:00:00 2001 From: Teodora Date: Tue, 19 Aug 2025 17:09:26 +0200 Subject: [PATCH] Separate Tx/Rx endpoint creation As per o-ran-uplane-conf model, some nodes exist in Rx but not in Tx (e.g. "ul-fft-sampling-offsets"), and vice versa. --- radio/fhi_72/mplane/yang/create-yang-config.c | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/radio/fhi_72/mplane/yang/create-yang-config.c b/radio/fhi_72/mplane/yang/create-yang-config.c index 7276b9fae0..a4e315c3a5 100644 --- a/radio/fhi_72/mplane/yang/create-yang-config.c +++ b/radio/fhi_72/mplane/yang/create-yang-config.c @@ -104,20 +104,20 @@ static bool create_proc_elem_v2(struct ly_ctx **ctx, const ru_session_t *ru_sess return true; } -static bool fill_uplane_ch_v2(const xran_mplane_t *xran_mplane, const size_t idx, struct lyd_node **root) +static LY_ERR fill_uplane_ch_common_v2(const xran_mplane_t *xran_mplane, const size_t idx, struct lyd_node **root) { LY_ERR ret = LY_SUCCESS; ret = lyd_new_term(*root, NULL, "cp-length", "0", 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"cp-length\" node.\n"); - + ret = lyd_new_term(*root, NULL, "cp-length-other", "0", 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"cp-length-other\" node.\n"); - + // to we actually store this from DU config file? ret = lyd_new_term(*root, NULL, "offset-to-absolute-frequency-center", "0", 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"offset-to-absolute-frequency-center\" node.\n"); - + struct lyd_node *compression_node = NULL; ret = lyd_new_inner(*root, NULL, "compression", 0, &compression_node); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"compression\" node.\n"); @@ -126,15 +126,15 @@ static bool fill_uplane_ch_v2(const xran_mplane_t *xran_mplane, const size_t idx snprintf(iq_width_str, sizeof(iq_width_str), "%d", xran_mplane->iq_width); ret = lyd_new_term(compression_node, NULL, "iq-bitwidth", iq_width_str, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"iq-bitwidth\" node.\n"); - + if (xran_mplane->iq_width < 16) { ret = lyd_new_term(compression_node, NULL, "compression-type", "STATIC", 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"compression-type\" node.\n"); - + // ret = lyd_new_term(compression_node, NULL, "compression-method", "BLOCK_FLOATING_POINT", 0, NULL); // VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"compression-method\" node.\n"); } - + struct lyd_node *eaxc_conf = NULL; ret = lyd_new_inner(*root, NULL, "e-axcid", 0, &eaxc_conf); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"e-axcid\" node.\n"); @@ -143,12 +143,12 @@ static bool fill_uplane_ch_v2(const xran_mplane_t *xran_mplane, const size_t idx snprintf(eaxc_id, sizeof(eaxc_id), "%ld", idx); ret = lyd_new_term(eaxc_conf, NULL, "eaxc-id", eaxc_id, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"eaxc-id\" node.\n"); - + char du_port_bitmask[16]; snprintf(du_port_bitmask, sizeof(du_port_bitmask), "%d", xran_mplane->du_port_bitmask); ret = lyd_new_term(eaxc_conf, NULL, "o-du-port-bitmask", du_port_bitmask, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"o-du-port-bitmask\" node.\n"); - + char band_sector_bitmask[8]; snprintf(band_sector_bitmask, sizeof(band_sector_bitmask), "%d", xran_mplane->band_sector_bitmask); ret = lyd_new_term(eaxc_conf, NULL, "band-sector-bitmask", band_sector_bitmask, 0, NULL); @@ -164,6 +164,26 @@ static bool fill_uplane_ch_v2(const xran_mplane_t *xran_mplane, const size_t idx ret = lyd_new_term(eaxc_conf, NULL, "ru-port-bitmask", ru_port_bitmask, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"ru-port-bitmask\" node.\n"); + return LY_SUCCESS; +} + +static bool fill_uplane_ch_rx_v2(const xran_mplane_t *xran_mplane, const openair0_config_t *oai, const size_t idx, struct lyd_node **root) +{ + LY_ERR ret = LY_SUCCESS; + + ret = fill_uplane_ch_common_v2(xran_mplane, idx, root); + VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create common nodes.\n"); + + return true; +} + +static bool fill_uplane_ch_tx_v2(const xran_mplane_t *xran_mplane, const openair0_config_t *oai, const size_t idx, struct lyd_node **root) +{ + LY_ERR ret = LY_SUCCESS; + + ret = fill_uplane_ch_common_v2(xran_mplane, idx, root); + VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create common nodes.\n"); + return true; } @@ -254,7 +274,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se ret = lyd_new_list(*root, NULL, "low-level-rx-endpoints", 0, &pusch_node, ru_session->ru_mplane_config.rx_endpoints.name[i]); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-rx-endpoints\" node.\n"); - success = fill_uplane_ch_v2(&ru_session->xran_mplane, i, &pusch_node); + success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, i, &pusch_node); VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-rx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.rx_endpoints.name[i]); const size_t prach_endpoint_name_offset = i + (ru_session->ru_mplane_config.rx_endpoints.num / 2); @@ -262,7 +282,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se ret = lyd_new_list(*root, NULL, "low-level-rx-endpoints", 0, &prach_node, ru_session->ru_mplane_config.rx_endpoints.name[prach_endpoint_name_offset]); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-rx-endpoints\" node.\n"); - success = fill_uplane_ch_v2(&ru_session->xran_mplane, i + ru_session->xran_mplane.prach_offset, &prach_node); + success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, i + ru_session->xran_mplane.prach_offset, &prach_node); VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-rx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.rx_endpoints.name[prach_endpoint_name_offset]); } @@ -273,7 +293,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se ret = lyd_new_list(*root, NULL, "low-level-tx-endpoints", 0, &pdsch_node, ru_session->ru_mplane_config.tx_endpoints.name[i]); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-tx-endpoints\" node.\n"); - success = fill_uplane_ch_v2(&ru_session->xran_mplane, i, &pdsch_node); + success = fill_uplane_ch_tx_v2(&ru_session->xran_mplane, i, &pdsch_node); VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-tx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.tx_endpoints.name[i]); }