Commit c4570bc8 authored by Guido Casati's avatar Guido Casati

Avoid segfault in SRS modulation when ue-nb-ant-tx (fp) does not match UE capabilities

* the mismatch between UE capabilities, passed to PHY by NFAPI PDU, and --ue-nb-ant-tx
  causes a segfault in SRS modulation
* issue with indexing txdataF[p_index], which fails due to an out-of-bounds access
  since first dimension of txdataF is sized based on ue->frame_parms.nb_antennas_tx
* N_ap used in SRS modulation is based on the number of antenna ports
  in the SRS configuration (srs_config_pdu->num_ant_ports)
parent e1885f65
......@@ -205,7 +205,9 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
uint16_t T_SRS = srs_config_pdu->t_srs;
uint16_t T_offset = srs_config_pdu->t_offset;
uint8_t R = 1<<srs_config_pdu->num_repetitions;
uint8_t N_ap = 1<<srs_config_pdu->num_ant_ports; // Number of antenna port for transmission
/* Number of antenna ports (M) can't be higher than number of physical antennas (N): M <= N */
uint8_t num_ant_ports = 1 << srs_config_pdu->num_ant_ports; // Number of antenna port for transmission
int N_ap = num_ant_ports > frame_parms->nb_antennas_tx ? frame_parms->nb_antennas_tx : num_ant_ports;
uint8_t N_symb_SRS = 1<<srs_config_pdu->num_symbols; // Number of consecutive OFDM symbols
uint8_t l0 = frame_parms->symbols_per_slot - 1 - l_offset; // Starting symbol position in the time domain
uint8_t n_SRS_cs_max = srs_max_number_cs[srs_config_pdu->comb_size];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment