From 4fec7799e2b63f550176218aec4afb29fc2c3dba Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 7 Dec 2017 09:41:47 +0100 Subject: [PATCH] Fixed Aperiodic RI reporting for TM1-2 --- lib/include/srslte/phy/phch/cqi.h | 1 + lib/src/phy/phch/pusch.c | 6 ++++-- srsenb/src/phy/phch_worker.cc | 13 ++++++++++--- srsenb/src/upper/rrc.cc | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/phy/phch/cqi.h b/lib/include/srslte/phy/phch/cqi.h index 0d0c17fec..1560ef92c 100644 --- a/lib/include/srslte/phy/phch/cqi.h +++ b/lib/include/srslte/phy/phch/cqi.h @@ -68,6 +68,7 @@ typedef struct SRSLTE_API { uint32_t subband_diff_cqi_cw1; // if RI > 1 then 2N-bit width otherwise 0-bit width uint32_t pmi; // if RI > 1 then 2-bit width otherwise 1-bit width uint32_t N; + bool ri_present; bool pmi_present; bool four_antenna_ports; // If cell has 4 antenna ports then true otherwise false bool rank_is_not_one; // If rank > 1 then true otherwise false diff --git a/lib/src/phy/phch/pusch.c b/lib/src/phy/phch/pusch.c index 7876a4f86..c493555dd 100644 --- a/lib/src/phy/phch/pusch.c +++ b/lib/src/phy/phch/pusch.c @@ -609,11 +609,13 @@ int srslte_pusch_decode(srslte_pusch_t *q, // Set CQI len assuming RI = 1 (3GPP 36.212 Clause 5.2.4.1. Uplink control information on PUSCH without UL-SCH data) if (cqi_value) { - if (cqi_value->type == SRSLTE_CQI_TYPE_SUBBAND_HL) { + if (cqi_value->type == SRSLTE_CQI_TYPE_SUBBAND_HL && cqi_value->subband_hl.ri_present) { cqi_value->subband_hl.rank_is_not_one = false; + uci_data->uci_ri_len = (q->cell.nof_ports == 4) ? 2 : 1; + } else { + uci_data->uci_ri_len = 0; } uci_data->uci_cqi_len = (uint32_t) srslte_cqi_size(cqi_value); - uci_data->uci_ri_len = (q->cell.nof_ports == 4) ? 2 : 1; } // Decode RI/HARQ bits before descrambling diff --git a/srsenb/src/phy/phch_worker.cc b/srsenb/src/phy/phch_worker.cc index f71f023c4..aa1c128a0 100644 --- a/srsenb/src/phy/phch_worker.cc +++ b/srsenb/src/phy/phch_worker.cc @@ -488,6 +488,12 @@ int phch_worker::decode_pusch(srslte_enb_ul_pusch_t *grants, uint32_t nof_pusch) } } else if (grants[i].grant.cqi_request) { cqi_value.type = SRSLTE_CQI_TYPE_SUBBAND_HL; + if (ue_db[rnti].dedicated.antenna_info_present && ( + ue_db[rnti].dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_3 || + ue_db[rnti].dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4 + )) { + cqi_value.subband_hl.ri_present = true; + } cqi_value.subband_hl.N = (phy->cell.nof_prb > 7) ? srslte_cqi_hl_get_no_subbands(phy->cell.nof_prb) : 0; cqi_value.subband_hl.four_antenna_ports = (phy->cell.nof_ports == 4); cqi_value.subband_hl.pmi_present = (ue_db[rnti].dedicated.cqi_report_cnfg.report_mode_aperiodic == LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31); @@ -583,14 +589,15 @@ int phch_worker::decode_pusch(srslte_enb_ul_pusch_t *grants, uint32_t nof_pusch) } */ log_h->info_hex(grants[i].data, phy_grant.mcs.tbs/8, - "PUSCH: rnti=0x%x, prb=(%d,%d), tbs=%d, mcs=%d, rv=%d, snr=%.1f dB, n_iter=%d, crc=%s%s%s%s%s\n", + "PUSCH: rnti=0x%x, prb=(%d,%d), tbs=%d, mcs=%d, rv=%d, snr=%.1f dB, n_iter=%d, crc=%s%s%s%s%s%s\n", rnti, phy_grant.n_prb[0], phy_grant.n_prb[0]+phy_grant.L_prb, phy_grant.mcs.tbs/8, phy_grant.mcs.idx, grants[i].grant.rv_idx, snr_db, srslte_pusch_last_noi(&enb_ul.pusch), crc_res?"OK":"KO", - (uci_data.uci_ack_len)?(uci_data.uci_ack?"1":"0"):"", - (uci_data.uci_ack_len > 1)?(uci_data.uci_ack_2?"1":"0"):"", + (acks_pending[0] || acks_pending[1])?", ack=":"", + (acks_pending[0])?(uci_data.uci_ack?"1":"0"):"", + (acks_pending[1])?(uci_data.uci_ack_2?"1":"0"):"", uci_data.uci_cqi_len>0?cqi_str:"", uci_data.uci_ri_len>0?(uci_data.uci_ri?", ri=0":", ri=1"):"", timestr); diff --git a/srsenb/src/upper/rrc.cc b/srsenb/src/upper/rrc.cc index 8b07ce046..843c3e350 100644 --- a/srsenb/src/upper/rrc.cc +++ b/srsenb/src/upper/rrc.cc @@ -1165,7 +1165,7 @@ void rrc::ue::send_connection_setup(bool is_setup) phy_cfg->cqi_report_cnfg_present = true; if(parent->cfg.cqi_cfg.mode == RRC_CFG_CQI_MODE_APERIODIC) { phy_cfg->cqi_report_cnfg.report_mode_aperiodic_present = true; - phy_cfg->cqi_report_cnfg.report_mode_aperiodic = LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31; + phy_cfg->cqi_report_cnfg.report_mode_aperiodic = LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM30; } else { phy_cfg->cqi_report_cnfg.report_periodic_present = true; phy_cfg->cqi_report_cnfg.report_periodic_setup_present = true;