Commit 2cb95d55 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/fix-segfault-srs-antenna-ports' into integration_2024_w29

parents 561119a2 101f178c
...@@ -987,7 +987,7 @@ void *UE_thread(void *arg) ...@@ -987,7 +987,7 @@ void *UE_thread(void *arg)
void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file) void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file)
{ {
NR_UE_RRC_INST_t *rrc_inst = nr_rrc_init_ue(uecap_file, nb_inst); NR_UE_RRC_INST_t *rrc_inst = nr_rrc_init_ue(uecap_file, nb_inst, get_nrUE_params()->nb_antennas_tx);
NR_UE_MAC_INST_t *mac_inst = nr_l2_init_ue(nb_inst); NR_UE_MAC_INST_t *mac_inst = nr_l2_init_ue(nb_inst);
AssertFatal(mac_inst, "Couldn't allocate MAC module\n"); AssertFatal(mac_inst, "Couldn't allocate MAC module\n");
......
...@@ -205,7 +205,9 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, ...@@ -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_SRS = srs_config_pdu->t_srs;
uint16_t T_offset = srs_config_pdu->t_offset; uint16_t T_offset = srs_config_pdu->t_offset;
uint8_t R = 1<<srs_config_pdu->num_repetitions; 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 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 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]; uint8_t n_SRS_cs_max = srs_max_number_cs[srs_config_pdu->comb_size];
......
...@@ -297,7 +297,19 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, ...@@ -297,7 +297,19 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
} }
} }
NR_UE_RRC_INST_t* nr_rrc_init_ue(char* uecap_file, int nb_inst) /**
* @brief Verify UE capabilities parameters against CL-fed params
* (e.g. number of physical TX antennas)
*/
static bool verify_ue_cap(NR_UE_NR_Capability_t *UE_NR_Capability, int nb_antennas_tx)
{
NR_FeatureSetUplink_t *ul_feature_setup = UE_NR_Capability->featureSets->featureSetsUplink->list.array[0];
int srs_ant_ports = 1 << ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource;
AssertFatal(srs_ant_ports <= nb_antennas_tx, "SRS antenna ports (%d) > nb_antennas_tx (%d)\n", srs_ant_ports, nb_antennas_tx);
return true;
}
NR_UE_RRC_INST_t* nr_rrc_init_ue(char* uecap_file, int nb_inst, int num_ant_tx)
{ {
NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)calloc(nb_inst, sizeof(NR_UE_RRC_INST_t)); NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)calloc(nb_inst, sizeof(NR_UE_RRC_INST_t));
AssertFatal(NR_UE_rrc_inst, "Couldn't allocate %d instances of RRC module\n", nb_inst); AssertFatal(NR_UE_rrc_inst, "Couldn't allocate %d instances of RRC module\n", nb_inst);
...@@ -328,6 +340,8 @@ NR_UE_RRC_INST_t* nr_rrc_init_ue(char* uecap_file, int nb_inst) ...@@ -328,6 +340,8 @@ NR_UE_RRC_INST_t* nr_rrc_init_ue(char* uecap_file, int nb_inst)
assert(dec_rval.code == RC_OK); assert(dec_rval.code == RC_OK);
} }
fclose(f); fclose(f);
/* Verify consistency of num PHY antennas vs UE Capabilities */
verify_ue_cap(rrc->UECap.UE_NR_Capability, num_ant_tx);
} }
memset(&rrc->timers_and_constants, 0, sizeof(rrc->timers_and_constants)); memset(&rrc->timers_and_constants, 0, sizeof(rrc->timers_and_constants));
......
...@@ -53,7 +53,7 @@ extern queue_t nr_tx_req_queue; ...@@ -53,7 +53,7 @@ extern queue_t nr_tx_req_queue;
extern queue_t nr_ul_dci_req_queue; extern queue_t nr_ul_dci_req_queue;
extern queue_t nr_ul_tti_req_queue; extern queue_t nr_ul_tti_req_queue;
NR_UE_RRC_INST_t *nr_rrc_init_ue(char* uecap_file, int nb_inst); NR_UE_RRC_INST_t *nr_rrc_init_ue(char* uecap_file, int nb_inst, int num_ant_tx);
void init_nsa_message (NR_UE_RRC_INST_t *rrc, char* reconfig_file, char* rbconfig_file); void init_nsa_message (NR_UE_RRC_INST_t *rrc, char* reconfig_file, char* rbconfig_file);
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message, int msg_len); void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message, int msg_len);
......
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