From 675ebb1f229707886814b6ce45d23f5fd11d222f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 27 Dec 2022 16:01:44 +0100 Subject: [PATCH] attempt to fix issues when starting with SFN > 0 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 5da2baa613..008e0c02fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -69,7 +69,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc = gNB->common_channels->ServingCellConfigCommon; const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - UL_tti_req_ahead_initialization(gNB, scc, num_slots, CC_idP); + UL_tti_req_ahead_initialization(gNB, scc, num_slots, CC_idP, frameP); nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; nfapi_nr_dl_tti_pdcch_pdu_rel15_t **pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t **)gNB->pdcch_pdu_idx[CC_idP]; @@ -178,7 +178,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } } - if ((slot == 0) && (frame & 127) == 0) { char stats_output[16000] = {0}; dump_mac_stats(RC.nrmac[module_idP], stats_output, sizeof(stats_output), true); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 403ae15df7..00a635fbd4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -3087,7 +3087,7 @@ void schedule_nr_bwp_switch(module_id_t module_id, } } -void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid) { +void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid, frame_t frameP) { if(gNB->UL_tti_req_ahead[CCid]) return; @@ -3099,7 +3099,7 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCom * already "in the past" and thus we put frame 1 instead of 0! */ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &gNB->UL_tti_req_ahead[CCid][i]; - req->SFN = i < (gNB->if_inst->sl_ahead-1); + req->SFN = frameP + (i < (gNB->if_inst->sl_ahead-1)); req->Slot = i; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index fc569c4eee..2fa395b7a7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -504,7 +504,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, int max_mcs, frame_t frame); -void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid); +void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid, frame_t frameP); void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP);