diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index 7aff02f9df..ed340cc5c1 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -1393,7 +1393,7 @@ The reference gNB configuration file for one Benetel RAN550: The reference DU configuration file for two Benetel RAN650: [gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf) -In order to run gNB/DU with M-plane, we need to modify the `fhi_72` section in the configuration file. +In order to run gNB/DU with M-plane, we need to modify Tx gain `att_tx` in RU section, as well as the `fhi_72` section in the configuration file. Example for one RU: ```bash fhi_72 = { diff --git a/radio/fhi_72/mplane/ru-mplane-api.c b/radio/fhi_72/mplane/ru-mplane-api.c index 972a286d9b..e6be2e11b5 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.c +++ b/radio/fhi_72/mplane/ru-mplane-api.c @@ -33,7 +33,7 @@ static void free_match_list(char **match_list, size_t count) free(match_list); } -static void fix_benetel_setting(xran_mplane_t *xran_mplane, const uint32_t interface_mtu, const int16_t first_iq_width, const int max_num_ant) +static void fix_benetel_setting(xran_mplane_t *xran_mplane, const uint32_t interface_mtu, const int16_t first_iq_width, const int max_num_ant, const char *model_name) { if (interface_mtu == 1500) { MP_LOG_I("Interface MTU %d unreliable/not correctly reported by Benetel O-RU, hardcoding to 9600.\n", interface_mtu); @@ -50,6 +50,14 @@ static void fix_benetel_setting(xran_mplane_t *xran_mplane, const uint32_t inter } xran_mplane->prach_offset = max_num_ant; + + if (strcasecmp(model_name, "RAN550") == 0) { + xran_mplane->max_tx_gain = 24.0; + } else if (strcasecmp(model_name, "RAN650") == 0) { + xran_mplane->max_tx_gain = 35.0; + } else { + assert(false && "[MPLANE] Unknown Benetel model name.\n"); + } } bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_t *xran_mplane) @@ -102,8 +110,14 @@ bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_ const char *managed_delay = get_ru_xml_node(buffer, "managed-delay-support"); xran_mplane->managed_delay = (strcasecmp(managed_delay, "NON_MANAGED") == 0) ? false : true; + // Store the max gain + xran_mplane->max_tx_gain = (double)atof(get_ru_xml_node(buffer, "max-gain")); + + // Model name + const char *model_name = get_ru_xml_node(buffer, "model-name"); + 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); + fix_benetel_setting(xran_mplane, interface_mtu, first_iq_width, max_num_ant, model_name); } else { AssertError(false, return false, "[MPLANE] %s RU currently not supported.\n", ru_vendor); } @@ -120,7 +134,8 @@ bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_ DU port ID %d\n\ Band sector ID %d\n\ CC ID %d\n\ - RU port ID %d\n", + RU port ID %d\n\ + max Tx gain %.1f\n", xran_mplane->ru_mac_addr, xran_mplane->mtu, xran_mplane->iq_width, @@ -132,7 +147,8 @@ bool get_config_for_xran(const char *buffer, const int max_num_ant, xran_mplane_ xran_mplane->du_port, xran_mplane->band_sector, xran_mplane->ccid, - xran_mplane->ru_port); + xran_mplane->ru_port, + xran_mplane->max_tx_gain); return true; } diff --git a/radio/fhi_72/mplane/ru-mplane-api.h b/radio/fhi_72/mplane/ru-mplane-api.h index 4888c51608..df6a89042f 100644 --- a/radio/fhi_72/mplane/ru-mplane-api.h +++ b/radio/fhi_72/mplane/ru-mplane-api.h @@ -60,6 +60,8 @@ typedef struct { int16_t frame_str; // might be needed in the future xran releases bool managed_delay; + double max_tx_gain; + } xran_mplane_t; typedef struct { diff --git a/radio/fhi_72/mplane/yang/create-yang-config.c b/radio/fhi_72/mplane/yang/create-yang-config.c index 6742dc452d..2092ed19fa 100644 --- a/radio/fhi_72/mplane/yang/create-yang-config.c +++ b/radio/fhi_72/mplane/yang/create-yang-config.c @@ -292,8 +292,12 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se ret = lyd_new_term(tx_carrier_node, NULL, "channel-bandwidth", tx_bw, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"channel-bandwidth\" node.\n"); - // oai->tx_gain to be tested - ret = lyd_new_term(tx_carrier_node, NULL, "gain", "0", 0, NULL); + // oai->tx_gain takes the value of att_tx from the RU section of gNB config file + // we assume the same gain is applied to all channels; same as above for the frequency + const double tx_gain_value = ((oai->tx_gain[0] * 10000) < ru_session->xran_mplane.max_tx_gain) ? (oai->tx_gain[0] * 10000) : ru_session->xran_mplane.max_tx_gain; + char tx_gain_str[8]; + snprintf(tx_gain_str, sizeof(tx_gain_str), "%.f", tx_gain_value); + ret = lyd_new_term(tx_carrier_node, NULL, "gain", tx_gain_str, 0, NULL); VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"gain\" node.\n"); ret = lyd_new_term(tx_carrier_node, NULL, "downlink-radio-frame-offset", "0", 0, NULL); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf index 72d174cfb3..97459ad55e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf @@ -205,7 +205,7 @@ RUs = ( local_rf = "no"; nb_tx = 8; nb_rx = 8; - att_tx = 0; + att_tx = 35; att_rx = 0; bands = [77]; max_pdschReferenceSignalPower = -27; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf index be35562fd7..9472ee3cdd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf @@ -208,7 +208,7 @@ RUs = ( local_rf = "no"; nb_tx = 4; nb_rx = 4; - att_tx = 0; + att_tx = 24; att_rx = 0; bands = [78]; max_pdschReferenceSignalPower = -27;