gNB: compute and store SSB-SINR in dB instead of just the SINR-index
This commit is contained in:
@@ -414,6 +414,25 @@ static void handle_dl_harq(NR_UE_info_t * UE,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Referred Table 10.1.16.1-1 in 38.133 V16.7.0.
|
||||||
|
static int get_measured_sinr(int index)
|
||||||
|
{
|
||||||
|
if (index < 0 || index > 127)
|
||||||
|
return INT_MAX;
|
||||||
|
|
||||||
|
return -235 + index * 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Referred Table 10.1.16.1-2 in 38.133 V16.7.0.
|
||||||
|
static int get_diff_sinr(int index, int best_SINRx10)
|
||||||
|
{
|
||||||
|
if (index <= 0)
|
||||||
|
return best_SINRx10;
|
||||||
|
if (index >= 15)
|
||||||
|
return best_SINRx10 - 150;
|
||||||
|
return best_SINRx10 - index * 10;
|
||||||
|
}
|
||||||
|
|
||||||
//returns the measured RSRP value (upper limit)
|
//returns the measured RSRP value (upper limit)
|
||||||
static bool get_measured_rsrp(uint8_t index, int *rsrp)
|
static bool get_measured_rsrp(uint8_t index, int *rsrp)
|
||||||
{
|
{
|
||||||
@@ -498,22 +517,24 @@ static void evaluate_sinr_report(gNB_MAC_INST *nrmac,
|
|||||||
}
|
}
|
||||||
|
|
||||||
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
|
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
|
||||||
sinr_report->SINR_index[0] = curr_payload & 0x7f;
|
int sinr_index = curr_payload & 0x7f;
|
||||||
*cumul_bits += 7;
|
*cumul_bits += 7;
|
||||||
|
|
||||||
csi_report->nb_of_csi_ssb_report++;
|
csi_report->nb_of_csi_ssb_report++;
|
||||||
if (sinr_report->SINR_index[0] < 0 || sinr_report->SINR_index[0] > 127) {
|
int SINRx10 = get_measured_sinr(sinr_index);
|
||||||
LOG_E(NR_MAC, "UE %04x: reported SINR index %d invalid\n", UE->rnti, sinr_report->SINR_index[0]);
|
if (SINRx10 == INT_MAX) {
|
||||||
|
LOG_E(NR_MAC, "UE %04x: reported SINR index %d invalid\n", UE->rnti, sinr_index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
sinr_report->SINRx10[0] = SINRx10;
|
||||||
|
|
||||||
for (int i = 1; i < sinr_report->nr_reports; i++) {
|
for (int i = 1; i < sinr_report->nr_reports; i++) {
|
||||||
curr_payload = pickandreverse_bits(payload, 4, *cumul_bits);
|
curr_payload = pickandreverse_bits(payload, 4, *cumul_bits);
|
||||||
sinr_report->SINR_index[i] = curr_payload & 0x0f;
|
sinr_report->SINRx10[i] = get_diff_sinr(curr_payload & 0x0f, sinr_report->SINRx10[0]);
|
||||||
*cumul_bits += 4;
|
*cumul_bits += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_D(MAC, "Reported SSB-SINR index = %d\n", sinr_report->SINR_index[0]);
|
LOG_D(MAC, "Reported SSB-SINR = %d.%d\n", sinr_report->SINRx10[0] / 10, sinr_report->SINRx10[0] % 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void evaluate_rsrp_report(gNB_MAC_INST *nrmac,
|
static void evaluate_rsrp_report(gNB_MAC_INST *nrmac,
|
||||||
|
|||||||
@@ -521,8 +521,7 @@ typedef struct RSRP_report {
|
|||||||
uint8_t nr_reports;
|
uint8_t nr_reports;
|
||||||
uint8_t resource_id[MAX_NR_OF_REPORTED_RS];
|
uint8_t resource_id[MAX_NR_OF_REPORTED_RS];
|
||||||
int RSRP[MAX_NR_OF_REPORTED_RS];
|
int RSRP[MAX_NR_OF_REPORTED_RS];
|
||||||
// SINR index according to tables 10.1.16.1-1, 10.1.16.1-2
|
int SINRx10[MAX_NR_OF_REPORTED_RS];
|
||||||
int SINR_index[MAX_NR_OF_REPORTED_RS];
|
|
||||||
} RSRP_report_t;
|
} RSRP_report_t;
|
||||||
|
|
||||||
struct CSI_Report {
|
struct CSI_Report {
|
||||||
|
|||||||
Reference in New Issue
Block a user