|
10 | 10 |
|
11 | 11 | #include "gnb_appconfig_cli11_schema.h" |
12 | 12 | #include "gnb_appconfig.h" |
| 13 | +#include "srsran/ran/duplex_mode.h" |
13 | 14 | #include "srsran/ran/pdsch/pdsch_mcs.h" |
14 | 15 | #include "srsran/support/cli11_utils.h" |
15 | 16 | #include "srsran/support/config_parsers.h" |
@@ -2001,6 +2002,30 @@ static void manage_expert_execution_threads(CLI::App& app, gnb_appconfig& gnb_cf |
2001 | 2002 | } |
2002 | 2003 | } |
2003 | 2004 |
|
| 2005 | +static void manage_processing_delay(CLI::App& app, gnb_appconfig& gnb_cfg) |
| 2006 | +{ |
| 2007 | + // If max proc delay property is present in the config, do nothing. |
| 2008 | + CLI::App* expert_cmd = app.get_subcommand("expert_phy"); |
| 2009 | + if (expert_cmd->count_all() >= 1 && expert_cmd->count("--max_proc_delay") >= 1) { |
| 2010 | + return; |
| 2011 | + } |
| 2012 | + |
| 2013 | + // As processing delay is not cell related, use the first cell to update the value. |
| 2014 | + const auto& cell = gnb_cfg.cells_cfg.front().cell; |
| 2015 | + nr_band band = cell.band ? cell.band.value() : band_helper::get_band_from_dl_arfcn(cell.dl_arfcn); |
| 2016 | + |
| 2017 | + switch (band_helper::get_duplex_mode(band)) { |
| 2018 | + case duplex_mode::TDD: |
| 2019 | + gnb_cfg.expert_phy_cfg.max_processing_delay_slots = 5; |
| 2020 | + break; |
| 2021 | + case duplex_mode::FDD: |
| 2022 | + gnb_cfg.expert_phy_cfg.max_processing_delay_slots = 2; |
| 2023 | + break; |
| 2024 | + default: |
| 2025 | + break; |
| 2026 | + } |
| 2027 | +} |
| 2028 | + |
2004 | 2029 | void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appconfig& gnb_cfg) |
2005 | 2030 | { |
2006 | 2031 | app.add_option("--gnb_id", gnb_cfg.gnb_id, "gNodeB identifier")->capture_default_str(); |
@@ -2141,5 +2166,6 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon |
2141 | 2166 | manage_ru_variant(app, gnb_cfg, sdr_cfg, ofh_cfg); |
2142 | 2167 | manage_hal_optional(app, gnb_cfg); |
2143 | 2168 | manage_expert_execution_threads(app, gnb_cfg); |
| 2169 | + manage_processing_delay(app, gnb_cfg); |
2144 | 2170 | }); |
2145 | 2171 | } |
0 commit comments