From 0ec932b57fb4fb16352626e2d1c3c362a7f0aaa5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 13:18:45 +0200 Subject: [PATCH] nb of layers from CSI Report --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 089096d1dc..8fcb544f18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -603,7 +603,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - sched_pdsch->nrOfLayers = 1; + set_dl_nrOfLayers(sched_pdsch,sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 316a6d4f49..0cf70e6ebc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -137,6 +137,15 @@ static inline uint8_t get_max_cces(uint8_t scs) { } +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl) { + + // for now this should be enough + // 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; + +} + void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 0c41c1dbdf..eba95b5cdc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -419,6 +419,9 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx); +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl); + void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);