Commit 549e3a91 authored by francescomani's avatar francescomani

remove choice in CSI report structure

parent 0ec932b5
...@@ -142,7 +142,7 @@ void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, ...@@ -142,7 +142,7 @@ void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch,
// for now this should be enough // for now this should be enough
// if there is not csi report RI is 0 from initialization // if there is not csi report RI is 0 from initialization
sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri + 1; sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1;
} }
...@@ -151,12 +151,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, ...@@ -151,12 +151,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
uint8_t mcs_table_idx) { uint8_t mcs_table_idx) {
if (sched_ctrl->set_mcs) { if (sched_ctrl->set_mcs) {
// TODO for wideband case and multiple TB // TODO for wideband case and multiple TB
int cqi_idx = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; int cqi_idx = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb;
uint16_t target_coderate,target_qm; uint16_t target_coderate,target_qm;
if (cqi_idx>0) { if (cqi_idx>0) {
int cqi_table = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table; int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table;
AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n");
switch (cqi_table) { switch (cqi_table) {
case 0: case 0:
......
...@@ -921,14 +921,14 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { ...@@ -921,14 +921,14 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
idx: resource set index idx: resource set index
*/ */
nr_ssbri_cri = sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri; nr_ssbri_cri = sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri;
//extracting the ssb indexes //extracting the ssb indexes
for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) { for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[ssb_idx];
} }
//if strongest measured RSRP is configured //if strongest measured RSRP is configured
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP); strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
// including ssb rsrp in mac stats // including ssb rsrp in mac stats
stats->cumul_rsrp += strongest_ssb_rsrp; stats->cumul_rsrp += strongest_ssb_rsrp;
stats->num_rsrp_meas++; stats->num_rsrp_meas++;
...@@ -942,7 +942,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { ...@@ -942,7 +942,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
} }
for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) {
ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp);
//if current reported rsrp is greater than better rsrp //if current reported rsrp is greater than better rsrp
if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) {
...@@ -1100,35 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, ...@@ -1100,35 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
multiple simultaneous spatial domain receive filter multiple simultaneous spatial domain receive filter
*/ */
sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri;
for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits);
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
*(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
else else
sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
*(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
*cumul_bits += cri_ssbri_bitlen; *cumul_bits += cri_ssbri_bitlen;
LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
} }
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP = curr_payload & 0x7f; sched_ctrl->CSI_report.ssb_cri_report.RSRP = curr_payload & 0x7f;
*cumul_bits += 7; *cumul_bits += 7;
for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
curr_payload = pickandreverse_bits(payload, 4, *cumul_bits); curr_payload = pickandreverse_bits(payload, 4, *cumul_bits);
sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f;
*cumul_bits += 4; *cumul_bits += 4;
} }
csi_report->nb_of_csi_ssb_report++; csi_report->nb_of_csi_ssb_report++;
LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", LOG_D(MAC,"rsrp_id = %d rsrp = %d\n",
sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP, sched_ctrl->CSI_report.ssb_cri_report.RSRP,
get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP)); get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP));
} }
...@@ -1138,7 +1138,7 @@ void evaluate_cri_report(uint8_t *payload, ...@@ -1138,7 +1138,7 @@ void evaluate_cri_report(uint8_t *payload,
NR_UE_sched_ctrl_t *sched_ctrl){ NR_UE_sched_ctrl_t *sched_ctrl){
uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits); uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits);
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cri = temp_cri;
} }
int evaluate_ri_report(uint8_t *payload, int evaluate_ri_report(uint8_t *payload,
...@@ -1152,7 +1152,7 @@ int evaluate_ri_report(uint8_t *payload, ...@@ -1152,7 +1152,7 @@ int evaluate_ri_report(uint8_t *payload,
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
if ((ri_restriction>>i)&0x01) { if ((ri_restriction>>i)&0x01) {
if(count == ri_index) { if(count == ri_index) {
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri = i; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i;
LOG_I(MAC,"CSI Reported Rank %d\n", i+1); LOG_I(MAC,"CSI Reported Rank %d\n", i+1);
return i; return i;
} }
...@@ -1179,14 +1179,14 @@ void evaluate_cqi_report(uint8_t *payload, ...@@ -1179,14 +1179,14 @@ void evaluate_cqi_report(uint8_t *payload,
// NR_CSI_ReportConfig__cqi_Table_table2 = 1 // NR_CSI_ReportConfig__cqi_Table_table2 = 1
// NR_CSI_ReportConfig__cqi_Table_table3 = 2 // NR_CSI_ReportConfig__cqi_Table_table3 = 2
if (cqi_Table) if (cqi_Table)
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table;
else else
AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); AssertFatal(1==0,"CQI Table not present in RRC configuration\n");
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi;
LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); LOG_I(MAC,"Wide-band CQI for the first TB %d %p\n", temp_cqi,&sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb);
if (cqi_bitlen > 4) { if (cqi_bitlen > 4) {
temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); temp_cqi = pickandreverse_bits(payload, 4, cumul_bits);
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi;
LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi);
} }
sched_ctrl->set_mcs = TRUE; sched_ctrl->set_mcs = TRUE;
...@@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload, ...@@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload,
//in case of 2 port CSI configuration x1 is empty and the information bits are in x2 //in case of 2 port CSI configuration x1 is empty and the information bits are in x2
int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits);
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<<x1_bitlen)-1); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<<x1_bitlen)-1);
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<<x2_bitlen)-1); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<<x2_bitlen)-1);
LOG_I(MAC,"PMI Report: X1 %d X2 %d\n", LOG_I(MAC,"PMI Report: X1 %d X2 %d\n",
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1, sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1,
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2);
return tot_bitlen; return tot_bitlen;
...@@ -1228,7 +1228,7 @@ int evaluate_li_report(uint8_t *payload, ...@@ -1228,7 +1228,7 @@ int evaluate_li_report(uint8_t *payload,
if (li_bitlen>0) { if (li_bitlen>0) {
int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits);
LOG_I(MAC,"LI %d\n",temp_li); LOG_I(MAC,"LI %d\n",temp_li);
sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.li = temp_li; sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li;
} }
return li_bitlen; return li_bitlen;
......
...@@ -453,11 +453,8 @@ typedef struct CRI_SSB_RSRP { ...@@ -453,11 +453,8 @@ typedef struct CRI_SSB_RSRP {
} CRI_SSB_RSRP_t; } CRI_SSB_RSRP_t;
struct CSI_Report { struct CSI_Report {
NR_CSI_Report_Config_PR present;
union Config_CSI_Report {
struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report; struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report;
struct CRI_SSB_RSRP ssb_cri_report; struct CRI_SSB_RSRP ssb_cri_report;
} choice;
}; };
#define MAX_SR_BITLEN 8 #define MAX_SR_BITLEN 8
......
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