diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 9e27e26b31d52c4170987fa1b081b593d59d205c..1cb3fdb7084eeecd4a479a7dc0b66ec300a70402 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -613,19 +613,16 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - const int nrofHARQ = pdsch ? (pdsch->nrofHARQ_ProcessesForPDSCH ? - get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8) : 8; if (sched_ctrl->available_dl_harq.len == 0) { - // add all available DL HARQ processes for this UE - create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); - for (int harq = 0; harq < nrofHARQ; harq++) - add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); - create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); - create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + // add all available DL HARQ processes for this UE in SA + create_dl_harq_list(sched_ctrl, pdsch); } - else + else { + const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? + get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ, - "Nr of harq processes reconfiguration not yet supported\n"); + "Reconfiguration of available harq processes not yet supported\n"); + } // update coreset/searchspace void *bwpd = NULL; target_ss = NR_SearchSpace__searchSpaceType_PR_common; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7f296fe86c6906b35ee355097a48224ef1d0f0f1..f66cd532ee99af6962dc98f6f16922749fe80aa6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1992,17 +1992,12 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG "no pdsch-ServingCellConfig found for UE %d\n", UE_id); const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - if (pdsch) { - const int nrofHARQ = pdsch->nrofHARQ_ProcessesForPDSCH ? - get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; - // add all available DL HARQ processes for this UE - create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); - for (int harq = 0; harq < nrofHARQ; harq++) - add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); - create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); - create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); - } + // add DL HARQ processes for this UE only in NSA + // (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage) + if (!get_softmodem_params()->sa) + create_dl_harq_list(sched_ctrl,pdsch); // add all available UL HARQ processes for this UE + // nb of ul harq processes not configurable create_nr_list(&sched_ctrl->available_ul_harq, 16); for (int harq = 0; harq < 16; harq++) add_tail_nr_list(&sched_ctrl->available_ul_harq, harq); @@ -2022,6 +2017,19 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG return -1; } + +void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, + const NR_PDSCH_ServingCellConfig_t *pdsch) { + const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? + get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; + // add all available DL HARQ processes for this UE + create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + for (int harq = 0; harq < nrofHARQ; harq++) + add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); + create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); + create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); +} + /* hack data to remove UE in the phy */ int rnti_to_remove[10]; volatile int rnti_to_remove_count; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 2cabce57f29a9ca0d1d51a6fcce2954331e52d1e..741b40e4e88d4d29fd7390217961d34f48aa91c5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -411,6 +411,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, const uint8_t ul_cqi, const uint16_t rssi); +void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, + const NR_PDSCH_ServingCellConfig_t *pdsch); + void handle_nr_ul_harq(const int CC_idP, module_id_t mod_id, frame_t frame,