Commit f7a34d42 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Rename some variables

parent 4c6a1c72
This diff is collapsed.
...@@ -1181,31 +1181,31 @@ void handle_nr_srs_measurements(const module_id_t module_id, ...@@ -1181,31 +1181,31 @@ void handle_nr_srs_measurements(const module_id_t module_id,
switch (srs_ind->srs_usage) { switch (srs_ind->srs_usage) {
case NR_SRS_ResourceSet__usage_beamManagement: { case NR_SRS_ResourceSet__usage_beamManagement: {
nfapi_nr_srs_beamforming_report_t nr_srs_beamforming_report; nfapi_nr_srs_beamforming_report_t nr_srs_bf_report;
unpack_nr_srs_beamforming_report(srs_ind->report_tlv->value, unpack_nr_srs_beamforming_report(srs_ind->report_tlv->value,
srs_ind->report_tlv->length, srs_ind->report_tlv->length,
&nr_srs_beamforming_report, &nr_srs_bf_report,
sizeof(nfapi_nr_srs_beamforming_report_t)); sizeof(nfapi_nr_srs_beamforming_report_t));
if (nr_srs_beamforming_report.wide_band_snr == 0xFF) { if (nr_srs_bf_report.wide_band_snr == 0xFF) {
LOG_W(NR_MAC, "Invalid wide_band_snr for RNTI %04x\n", srs_ind->rnti); LOG_W(NR_MAC, "Invalid wide_band_snr for RNTI %04x\n", srs_ind->rnti);
return; return;
} }
int wide_band_snr_dB = (nr_srs_beamforming_report.wide_band_snr >> 1) - 64; int wide_band_snr_dB = (nr_srs_bf_report.wide_band_snr >> 1) - 64;
#ifdef SRS_IND_DEBUG #ifdef SRS_IND_DEBUG
LOG_I(NR_MAC, "nr_srs_beamforming_report.prg_size = %i\n", nr_srs_beamforming_report.prg_size); LOG_I(NR_MAC, "nr_srs_bf_report.prg_size = %i\n", nr_srs_bf_report.prg_size);
LOG_I(NR_MAC, "nr_srs_beamforming_report.num_symbols = %i\n", nr_srs_beamforming_report.num_symbols); LOG_I(NR_MAC, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols);
LOG_I(NR_MAC, "nr_srs_beamforming_report.wide_band_snr = %i (%i dB)\n", nr_srs_beamforming_report.wide_band_snr, wide_band_snr_dB); LOG_I(NR_MAC, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, wide_band_snr_dB);
LOG_I(NR_MAC, "nr_srs_beamforming_report.num_reported_symbols = %i\n", nr_srs_beamforming_report.num_reported_symbols); LOG_I(NR_MAC, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols);
LOG_I(NR_MAC, "nr_srs_beamforming_report.prgs[0].num_prgs = %i\n", nr_srs_beamforming_report.prgs[0].num_prgs); LOG_I(NR_MAC, "nr_srs_bf_report.prgs[0].num_prgs = %i\n", nr_srs_bf_report.prgs[0].num_prgs);
for (int prg_idx = 0; prg_idx < nr_srs_beamforming_report.prgs[0].num_prgs; prg_idx++) { for (int prg_idx = 0; prg_idx < nr_srs_bf_report.prgs[0].num_prgs; prg_idx++) {
LOG_I(NR_MAC, LOG_I(NR_MAC,
"nr_srs_beamforming_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n", "nr_srs_bf_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n",
prg_idx, prg_idx,
nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr, nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr,
(nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64); (nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64);
} }
#endif #endif
...@@ -1214,10 +1214,10 @@ void handle_nr_srs_measurements(const module_id_t module_id, ...@@ -1214,10 +1214,10 @@ void handle_nr_srs_measurements(const module_id_t module_id,
const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold; const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold;
uint16_t *ulprbbl = nr_mac->ulprbbl; uint16_t *ulprbbl = nr_mac->ulprbbl;
uint16_t num_rbs = nr_srs_beamforming_report.prg_size * nr_srs_beamforming_report.prgs[0].num_prgs; uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.prgs[0].num_prgs;
memset(ulprbbl, 0, num_rbs * sizeof(uint16_t)); memset(ulprbbl, 0, num_rbs * sizeof(uint16_t));
for (int rb = 0; rb < num_rbs; rb++) { for (int rb = 0; rb < num_rbs; rb++) {
int snr = (nr_srs_beamforming_report.prgs[0].prg_list[rb / nr_srs_beamforming_report.prg_size].rb_snr >> 1) - 64; int snr = (nr_srs_bf_report.prgs[0].prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64;
if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) { if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) {
ulprbbl[rb] = 0x3FFF; // all symbols taken ulprbbl[rb] = 0x3FFF; // all symbols taken
} }
...@@ -1228,31 +1228,31 @@ void handle_nr_srs_measurements(const module_id_t module_id, ...@@ -1228,31 +1228,31 @@ void handle_nr_srs_measurements(const module_id_t module_id,
} }
case NR_SRS_ResourceSet__usage_codebook: { case NR_SRS_ResourceSet__usage_codebook: {
nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_normalized_channel_iq_matrix; nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_channel_iq_matrix;
unpack_nr_srs_normalized_channel_iq_matrix(srs_ind->report_tlv->value, unpack_nr_srs_normalized_channel_iq_matrix(srs_ind->report_tlv->value,
srs_ind->report_tlv->length, srs_ind->report_tlv->length,
&nr_srs_normalized_channel_iq_matrix, &nr_srs_channel_iq_matrix,
sizeof(nfapi_nr_srs_normalized_channel_iq_matrix_t)); sizeof(nfapi_nr_srs_normalized_channel_iq_matrix_t));
#ifdef SRS_IND_DEBUG #ifdef SRS_IND_DEBUG
LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_normalized_channel_iq_matrix.normalized_iq_representation); LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_channel_iq_matrix.normalized_iq_representation);
LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements); LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_channel_iq_matrix.num_gnb_antenna_elements);
LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports); LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_channel_iq_matrix.num_ue_srs_ports);
LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.prg_size = %i\n", nr_srs_normalized_channel_iq_matrix.prg_size); LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.prg_size = %i\n", nr_srs_channel_iq_matrix.prg_size);
LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_prgs = %i\n", nr_srs_normalized_channel_iq_matrix.num_prgs); LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_prgs = %i\n", nr_srs_channel_iq_matrix.num_prgs);
c16_t *channel_matrix16 = (c16_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; c16_t *channel_matrix16 = (c16_t *)nr_srs_channel_iq_matrix.channel_matrix;
c8_t *channel_matrix8 = (c8_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; c8_t *channel_matrix8 = (c8_t *)nr_srs_channel_iq_matrix.channel_matrix;
for (int uI = 0; uI < nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports; uI++) { for (int uI = 0; uI < nr_srs_channel_iq_matrix.num_ue_srs_ports; uI++) {
for (int gI = 0; gI < nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements; gI++) { for (int gI = 0; gI < nr_srs_channel_iq_matrix.num_gnb_antenna_elements; gI++) {
for (int pI = 0; pI < nr_srs_normalized_channel_iq_matrix.num_prgs; pI++) { for (int pI = 0; pI < nr_srs_channel_iq_matrix.num_prgs; pI++) {
uint16_t index = uI * nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_normalized_channel_iq_matrix.num_prgs + gI * nr_srs_normalized_channel_iq_matrix.num_prgs + pI; uint16_t index = uI * nr_srs_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_channel_iq_matrix.num_prgs + gI * nr_srs_channel_iq_matrix.num_prgs + pI;
LOG_I(NR_MAC, LOG_I(NR_MAC,
"(uI %i, gI %i, pI %i) channel_matrix --> real %i, imag %i\n", "(uI %i, gI %i, pI %i) channel_matrix --> real %i, imag %i\n",
uI, uI,
gI, gI,
pI, pI,
nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r, nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r,
nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i); nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i);
} }
} }
} }
...@@ -1262,16 +1262,16 @@ void handle_nr_srs_measurements(const module_id_t module_id, ...@@ -1262,16 +1262,16 @@ void handle_nr_srs_measurements(const module_id_t module_id,
NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP; NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP;
sched_ctrl->srs_feedback.sri = NR_SRS_SRI_0; sched_ctrl->srs_feedback.sri = NR_SRS_SRI_0;
nr_srs_ri_computation(&nr_srs_normalized_channel_iq_matrix, current_BWP, &sched_ctrl->srs_feedback.ul_ri); nr_srs_ri_computation(&nr_srs_channel_iq_matrix, current_BWP, &sched_ctrl->srs_feedback.ul_ri);
sched_ctrl->srs_feedback.tpmi = nr_srs_tpmi_estimation(current_BWP->pusch_Config, sched_ctrl->srs_feedback.tpmi = nr_srs_tpmi_estimation(current_BWP->pusch_Config,
current_BWP->transform_precoding, current_BWP->transform_precoding,
nr_srs_normalized_channel_iq_matrix.channel_matrix, nr_srs_channel_iq_matrix.channel_matrix,
nr_srs_normalized_channel_iq_matrix.normalized_iq_representation, nr_srs_channel_iq_matrix.normalized_iq_representation,
nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements, nr_srs_channel_iq_matrix.num_gnb_antenna_elements,
nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports, nr_srs_channel_iq_matrix.num_ue_srs_ports,
nr_srs_normalized_channel_iq_matrix.prg_size, nr_srs_channel_iq_matrix.prg_size,
nr_srs_normalized_channel_iq_matrix.num_prgs, nr_srs_channel_iq_matrix.num_prgs,
sched_ctrl->srs_feedback.ul_ri); sched_ctrl->srs_feedback.ul_ri);
sprintf(stats->srs_stats, "UL-RI %d, TPMI %d", sched_ctrl->srs_feedback.ul_ri + 1, sched_ctrl->srs_feedback.tpmi); sprintf(stats->srs_stats, "UL-RI %d, TPMI %d", sched_ctrl->srs_feedback.ul_ri + 1, sched_ctrl->srs_feedback.tpmi);
......
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