Commit 6a34439c authored by Rúben Soares Silva's avatar Rúben Soares Silva Committed by Robert Schmidt

Fix SRS beamforming_report reported symbol list.

Renames nfapi_nr_srs_reported_symbol_t prgs into *reported_symbol_list for two reasons:
  So that the name is more representative of what the parameter represents.
  For it to actually be a list, and not assume only 1 reported symbol is used.

Allocate reported_symbol_list in unpack_nr_srs_beamforming_report.

Updated all references to prior prgs to point to the first position of reported_symbol_list, still only effectively using the first reported_symbol.

Rename fill_srs_reported_symbol_list into fill_srs_reported_symbol and update input parameter name, since it only fills the information related to one reported symbol
parent 3272225e
......@@ -1787,7 +1787,7 @@ typedef struct {
uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1.
uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid.
uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4.
nfapi_nr_srs_reported_symbol_t prgs;
nfapi_nr_srs_reported_symbol_t* reported_symbol_list;
} nfapi_nr_srs_beamforming_report_t;
// SRS indication
......
......@@ -2535,7 +2535,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t
return 0;
}
if (!pack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pWritePackedMessage, end)) {
if (!pack_nr_srs_reported_symbol(&nr_srs_beamforming_report->reported_symbol_list[0], &pWritePackedMessage, end)) {
return 0;
}
......@@ -4445,8 +4445,9 @@ int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen,
pull8(&pReadPackedMessage, &nr_srs_beamforming_report->num_reported_symbols, end))) {
return -1;
}
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pReadPackedMessage, end)) {
nr_srs_beamforming_report->reported_symbol_list =
calloc(nr_srs_beamforming_report->num_reported_symbols, sizeof(*nr_srs_beamforming_report->reported_symbol_list));
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->reported_symbol_list[0], &pReadPackedMessage, end)) {
return -1;
}
......
......@@ -660,22 +660,21 @@ static void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, uint32
}
}
int fill_srs_reported_symbol_list(nfapi_nr_srs_reported_symbol_t *prgs,
const nfapi_nr_srs_pdu_t *srs_pdu,
int fill_srs_reported_symbol(nfapi_nr_srs_reported_symbol_t *reported_symbol,
const nfapi_nr_srs_pdu_t *srs_pdu,
const int N_RB_UL,
const int8_t *snr_per_rb,
const int srs_est) {
prgs->num_prgs = srs_pdu->beamforming.num_prgs;
for(int prg_idx = 0; prg_idx < prgs->num_prgs; prg_idx++) {
reported_symbol->num_prgs = srs_pdu->beamforming.num_prgs;
for (int prg_idx = 0; prg_idx < reported_symbol->num_prgs; prg_idx++) {
if (srs_est<0) {
prgs->prg_list[prg_idx].rb_snr = 0xFF;
reported_symbol->prg_list[prg_idx].rb_snr = 0xFF;
} else if (snr_per_rb[prg_idx] < -64) {
prgs->prg_list[prg_idx].rb_snr = 0;
reported_symbol->prg_list[prg_idx].rb_snr = 0;
} else if (snr_per_rb[prg_idx] > 63) {
prgs->prg_list[prg_idx].rb_snr = 0xFE;
reported_symbol->prg_list[prg_idx].rb_snr = 0xFE;
} else {
prgs->prg_list[prg_idx].rb_snr = (snr_per_rb[prg_idx] + 64) << 1;
reported_symbol->prg_list[prg_idx].rb_snr = (snr_per_rb[prg_idx] + 64) << 1;
}
}
......@@ -1065,7 +1064,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
nr_srs_bf_report.num_symbols = 1 << srs_pdu->num_symbols;
nr_srs_bf_report.wide_band_snr = srs_est >= 0 ? (gNB->srs->snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid
nr_srs_bf_report.num_reported_symbols = 1 << srs_pdu->num_symbols;
fill_srs_reported_symbol_list(&nr_srs_bf_report.prgs, srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est);
fill_srs_reported_symbol(&nr_srs_bf_report.reported_symbol_list[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est);
#ifdef SRS_IND_DEBUG
LOG_I(NR_PHY, "nr_srs_bf_report.prg_size = %i\n", nr_srs_bf_report.prg_size);
......
......@@ -1407,10 +1407,10 @@ void handle_nr_srs_measurements(const module_id_t module_id,
const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold;
uint16_t *ulprbbl = nr_mac->ulprbbl;
uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.prgs.num_prgs;
uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.reported_symbol_list[0].num_prgs;
memset(ulprbbl, 0, num_rbs * sizeof(uint16_t));
for (int rb = 0; rb < num_rbs; rb++) {
int snr = (nr_srs_bf_report.prgs.prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64;
int snr = (nr_srs_bf_report.reported_symbol_list[0].prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64;
if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) {
ulprbbl[rb] = 0x3FFF; // all symbols taken
}
......
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