@@ -195,10 +195,9 @@ static bool validate_srb_unit_config(const std::map<srb_id_t, du_high_unit_srb_c
195195 return true ;
196196}
197197
198- static bool validate_pdcch_unit_config (const du_high_unit_base_cell_config base_cell)
198+ static bool validate_pdcch_unit_config (const du_high_unit_base_cell_config& base_cell)
199199{
200- const auto band =
201- base_cell.band .has_value () ? *base_cell.band : band_helper::get_band_from_dl_arfcn (base_cell.dl_f_ref_arfcn );
200+ const auto band = base_cell.band .value_or (band_helper::get_band_from_dl_arfcn (base_cell.dl_f_ref_arfcn ));
202201 const unsigned nof_crbs =
203202 band_helper::get_n_rbs_from_bw (base_cell.channel_bw_mhz , base_cell.common_scs , band_helper::get_freq_range (band));
204203 if (base_cell.pdcch_cfg .common .coreset0_index .has_value ()) {
@@ -603,8 +602,7 @@ static bool validate_tdd_ul_dl_unit_config(const du_high_unit_tdd_ul_dl_config&
603602
604603static bool validate_dl_ul_arfcn_and_band (const du_high_unit_base_cell_config& config)
605604{
606- nr_band band =
607- config.band .has_value () ? config.band .value () : band_helper::get_band_from_dl_arfcn (config.dl_f_ref_arfcn );
605+ const nr_band band = config.band .value_or (band_helper::get_band_from_dl_arfcn (config.dl_f_ref_arfcn ));
608606
609607 // Check if the band is supported with given SCS or band.
610608 // NOTE: Band n46 would be compatible with the 10MHz BW, but there is no sync raster that falls within the band
@@ -643,7 +641,7 @@ static bool validate_dl_ul_arfcn_and_band(const du_high_unit_base_cell_config& c
643641 return false ;
644642 }
645643
646- // Check whether the DL-ARFCN ( and optionally the UL-ARFCN) is within the band and follows the Raster step.
644+ // Check whether the DL-ARFCN and the UL-ARFCN are within the band and follow the Raster step.
647645 if (config.band .has_value ()) {
648646 error_type<std::string> ret = band_helper::is_dl_arfcn_valid_given_band (
649647 *config.band , config.dl_f_ref_arfcn , config.common_scs , config.channel_bw_mhz );
@@ -655,6 +653,7 @@ static bool validate_dl_ul_arfcn_and_band(const du_high_unit_base_cell_config& c
655653 const uint32_t ul_arfcn = band_helper::get_ul_arfcn_from_dl_arfcn (config.dl_f_ref_arfcn , config.band .value ());
656654 ret = band_helper::is_ul_arfcn_valid_given_band (*config.band , ul_arfcn, config.channel_bw_mhz );
657655 if (not ret.has_value ()) {
656+ // NOTE: The message must say that it's the DL ARFCN that is invalid, as that is the parameters set by the user.
658657 fmt::print (" Invalid DL ARFCN={} for band {}. Cause: {}.\n " , config.dl_f_ref_arfcn , band, ret.error ());
659658 return false ;
660659 }
@@ -768,9 +767,8 @@ static bool validate_base_cell_unit_config(const du_high_unit_base_cell_config&
768767 return false ;
769768 }
770769
771- const nr_band band =
772- config.band .has_value () ? config.band .value () : band_helper::get_band_from_dl_arfcn (config.dl_f_ref_arfcn );
773- const auto ssb_scs = band_helper::get_most_suitable_ssb_scs (band, config.common_scs );
770+ const nr_band band = config.band .value_or (band_helper::get_band_from_dl_arfcn (config.dl_f_ref_arfcn ));
771+ const auto ssb_scs = band_helper::get_most_suitable_ssb_scs (band, config.common_scs );
774772 if (ssb_scs != config.common_scs ) {
775773 fmt::print (" Common SCS {}kHz is not equal to SSB SCS {}kHz. Different SCS for common and SSB is not supported.\n " ,
776774 scs_to_khz (config.common_scs ),
@@ -840,8 +838,9 @@ static bool validate_cells_unit_config(span<const du_high_unit_cell_config> conf
840838 fmt::print (" Invalid Sector ID {}, for a gNB Id of {} bits\n " , cell.cell .sector_id .value (), gnb_id.bit_length );
841839 return false ;
842840 }
843- const auto band = cell.cell .band .value_or (band_helper::get_band_from_dl_arfcn (cell.cell .dl_f_ref_arfcn ));
844- bool is_unlicensed = band_helper::is_unlicensed_band (band);
841+ const auto band = cell.cell .band .value_or (band_helper::get_band_from_dl_arfcn (cell.cell .dl_f_ref_arfcn ));
842+ bool is_unlicensed = band_helper::is_unlicensed_band (band);
843+ // Check if the RA Response Window (in ms) is within the limits for licensed and unlicensed bands.
845844 unsigned int max_ra_resp_window = is_unlicensed ? 40 : 10 ;
846845 unsigned int ra_resp_window_ms =
847846 cell.cell .prach_cfg .ra_resp_window .value () >> to_numerology_value (cell.cell .common_scs );
0 commit comments