Commit c064caaa authored by r.karey's avatar r.karey

Fixed the calculation of received csi payload size at MAC

parent ee703ad3
...@@ -869,7 +869,6 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, ...@@ -869,7 +869,6 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
pucch_pdu->sr_flag = O_sr; pucch_pdu->sr_flag = O_sr;
break; break;
case NR_PUCCH_Resource__format_PR_format2 : case NR_PUCCH_Resource__format_PR_format2 :
LOG_I(MAC,"UCI format2 is being scheduled\n");
pucch_pdu->format_type = 2; pucch_pdu->format_type = 2;
pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols; pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols;
pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex; pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex;
......
...@@ -89,8 +89,8 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -89,8 +89,8 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
) { ) {
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */ /** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
uint8_t idx = 0; uint8_t idx = 0;
uint8_t payload_size = ceil(uci_pdu->csi_part1.csi_part1_bit_len/8); uint8_t payload_size = ceil((double)uci_pdu->csi_part1.csi_part1_bit_len/8);
uint16_t *payload = calloc (1, payload_size); uint8_t *payload = calloc (payload_size, sizeof(uint8_t));
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING;
NR_UE_list_t *UE_list = &(RC.nrmac[Mod_idP]->UE_list); NR_UE_list_t *UE_list = &(RC.nrmac[Mod_idP]->UE_list);
long periodicity; long periodicity;
...@@ -119,7 +119,6 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -119,7 +119,6 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
uint8_t diff_rsrp_idx = 0; uint8_t diff_rsrp_idx = 0;
uint8_t cri_ssbri_bitlen = UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen; uint8_t cri_ssbri_bitlen = UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen;
LOG_I(MAC,"csi_payload = %d, cri_ssbri_bitlen = %d\n",payload_size, cri_ssbri_bitlen);
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report /*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
* the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE * the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE
* From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set * From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set
...@@ -145,12 +144,13 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -145,12 +144,13 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
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[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
*(UE_list->csi_report_template[UE_id][csi_report_id].SSB_Index_list [cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(UE_list->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
else else
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] =
*(UE_list->csi_report_template[UE_id][csi_report_id].CSI_Index_list [cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(UE_list->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
*payload >>= cri_ssbri_bitlen; *payload >>= cri_ssbri_bitlen;
LOG_I(PHY,"SSB_index = %d",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
} }
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f; sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f;
...@@ -161,6 +161,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -161,6 +161,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
*payload >>= 4; *payload >>= 4;
} }
UE_list->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++; UE_list->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
LOG_I(MAC,"csi_payload = %d, rsrp = %d\n",payload_size, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
} }
} }
...@@ -260,7 +261,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl, NR_mac_ ...@@ -260,7 +261,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl, NR_mac_
if ( uci_pdu -> pduBitmap & 0x01 ) { if ( uci_pdu -> pduBitmap & 0x01 ) {
///Handle SR PDU ///Handle SR PDU
uint8_t sr_id = 0; uint8_t sr_id = 0;
uint8_t payload_size = ceil(uci_pdu->sr.sr_bit_len/8); uint8_t payload_size = ceil((double)uci_pdu->sr.sr_bit_len/8);
uint8_t *payload = calloc (payload_size, sizeof (uint8_t)); uint8_t *payload = calloc (payload_size, sizeof (uint8_t));
memcpy (payload, uci_pdu->sr.sr_payload, payload_size); memcpy (payload, uci_pdu->sr.sr_payload, payload_size);
......
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