From e0ffba49ae4593ea959b993c7949b6683f7d3b44 Mon Sep 17 00:00:00 2001 From: Teodora Date: Mon, 3 Feb 2025 15:51:52 +0100 Subject: [PATCH] Store U-plane related info from xml - interface name, - TX/RX carrier names, and - TX/RX endpoint names --- radio/fhi_72/mplane/init-mplane.c | 4 ++++ radio/fhi_72/mplane/ru-mplane-api.c | 30 +++++++++++++++++++++++++++++ radio/fhi_72/mplane/ru-mplane-api.h | 2 ++ 3 files changed, 36 insertions(+) diff --git a/radio/fhi_72/mplane/init-mplane.c b/radio/fhi_72/mplane/init-mplane.c index 34d68a30d0..add3916f4d 100644 --- a/radio/fhi_72/mplane/init-mplane.c +++ b/radio/fhi_72/mplane/init-mplane.c @@ -170,6 +170,10 @@ bool manage_ru(ru_session_t *ru_session, const openair0_config_t *oai, const siz success = get_config_for_xran(operational_ds, max_num_ant, &ru_session->xran_mplane); AssertError(success, return false, "[MPLANE] Unable to retrieve required info for xran from RU \"%s\".\n", ru_session->ru_ip_add); + // save the U-plane info + success = get_uplane_info(operational_ds, &ru_session->ru_mplane_config); + AssertError(success, return false, "[MPLANE] Unable to get U-plane info from RU operational datastore.\n"); + free(operational_ds); free(watchdog_answer); diff --git a/radio/fhi_72/mplane/ru-mplane-api.c b/radio/fhi_72/mplane/ru-mplane-api.c index ada42fd841..d387a40864 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.c +++ b/radio/fhi_72/mplane/ru-mplane-api.c @@ -125,3 +125,33 @@ bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_ return true; } + +bool get_uplane_info(const char *buffer, ru_mplane_config_t *ru_mplane_config) +{ + // Interface name + ru_mplane_config->interface_name = get_ru_xml_node(buffer, "interface"); + + // PDSCH + uplane_info_t *tx_end = &ru_mplane_config->tx_endpoints; + get_ru_xml_list(buffer, "static-low-level-tx-endpoints", &tx_end->name, &tx_end->num); + AssertError(tx_end->name != NULL, return false, "[MPLANE] Cannot get TX endpoint names.\n"); + + // TX carriers + uplane_info_t *tx_carriers = &ru_mplane_config->tx_carriers; + get_ru_xml_list(buffer, "tx-arrays", &tx_carriers->name, &tx_carriers->num); + AssertError(tx_carriers->name != NULL, return false, "[MPLANE] Cannot get TX carrier names.\n"); + + // PUSCH and PRACH + uplane_info_t *rx_end = &ru_mplane_config->rx_endpoints; + get_ru_xml_list(buffer, "static-low-level-rx-endpoints", &rx_end->name, &rx_end->num); + AssertError(rx_end->name != NULL, return false, "[MPLANE] Cannot get RX endpoint names.\n"); + + // RX carriers + uplane_info_t *rx_carriers = &ru_mplane_config->rx_carriers; + get_ru_xml_list(buffer, "rx-arrays", &rx_carriers->name, &rx_carriers->num); + AssertError(rx_carriers->name != NULL, return false, "[MPLANE] Cannot get RX carrier names.\n"); + + MP_LOG_I("Successfully retrieved all the U-plane info - interface name, TX/RX carrier names, and TX/RX endpoint names.\n"); + + return true; +} diff --git a/radio/fhi_72/mplane/ru-mplane-api.h b/radio/fhi_72/mplane/ru-mplane-api.h index 5b49814efa..1afabd4d23 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.h +++ b/radio/fhi_72/mplane/ru-mplane-api.h @@ -94,4 +94,6 @@ typedef struct { bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_t *xran_mplane); +bool get_uplane_info(const char *buffer, ru_mplane_config_t *ru_mplane_config); + #endif /* RU_MPLANE_API_H */