add check for input number of antennas to be compliant with NB_ANTENNAS_TX and NB_ANTENNAS_RX

This commit is contained in:
francescomani
2026-02-20 12:44:03 +01:00
parent cdfe069c34
commit 2bd3685d6b
2 changed files with 12 additions and 0 deletions

View File

@@ -1737,7 +1737,13 @@ static void NRRCconfig_RU(configmodule_interface_t *cfg)
} /* strcmp(local_rf, "yes") != 0 */
ru->nb_tx = *param[RU_NB_TX_IDX].uptr;
AssertFatal(ru->nb_tx <= NB_ANTENNAS_TX,
"Config file has %d TX antennas set, but the compile time max value in NB_ANTENNAS_TX\n",
ru->nb_tx);
ru->nb_rx = *param[RU_NB_RX_IDX].uptr;
AssertFatal(ru->nb_rx <= NB_ANTENNAS_RX,
"Config file has %d RX antennas set, but the compile time max value in NB_ANTENNAS_RX\n",
ru->nb_rx);
ru->att_tx = *param[RU_ATT_TX_IDX].uptr;
ru->att_rx = *param[RU_ATT_RX_IDX].uptr;
ru->if_frequency = *param[RU_IF_FREQUENCY].u64ptr;

View File

@@ -205,6 +205,12 @@ void nrue_set_ru_params(configmodule_interface_t *cfg)
if (RUParamList.numelt <= 0) {
nrue_ru_count = 1;
nrue_rus = calloc_or_fail(nrue_ru_count, sizeof(nrUE_RU_params_t));
AssertFatal(get_nrUE_params()->nb_antennas_tx <= NB_ANTENNAS_TX,
"Config file has %d TX antennas set, but the compile time max value in NB_ANTENNAS_TX\n",
get_nrUE_params()->nb_antennas_tx);
AssertFatal(get_nrUE_params()->nb_antennas_rx <= NB_ANTENNAS_RX,
"Config file has %d RX antennas set, but the compile time max value in NB_ANTENNAS_RX\n",
get_nrUE_params()->nb_antennas_tx);
nrue_rus[0] = (nrUE_RU_params_t){.nb_tx = get_nrUE_params()->nb_antennas_tx,
.nb_rx = get_nrUE_params()->nb_antennas_rx,
.att_tx = get_nrUE_params()->tx_gain,