From 4fc24374d52699bf793c22f87797df082e170056 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 16 Aug 2021 17:42:07 +0200 Subject: [PATCH] fixes for contention resolution timer etc --- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 138b75ac74..d26ec672b3 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -470,12 +470,12 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, slot int subframes_per_slot = nr_slots_per_frame[mu]/10; // start contention resolution timer (cnt in slots) - int RA_contention_resolution_timer_subframes = (nr_rach_ConfigCommon->ra_ContentionResolutionTimer + 1) * 8; + int RA_contention_resolution_timer_subframes = (nr_rach_ConfigCommon->ra_ContentionResolutionTimer + 1)<<3; ra->RA_contention_resolution_target_frame = frameP + (RA_contention_resolution_timer_subframes/10); ra->RA_contention_resolution_target_slot = (slotP + (RA_contention_resolution_timer_subframes * subframes_per_slot)) % nr_slots_per_frame[mu]; - LOG_D(MAC,"In %s: [UE %d] CB-RA: starting contention resolution timer set in frame.slot %d.%d and expiring in %d.%d\n", + LOG_I(MAC,"In %s: [UE %d] CB-RA: contention resolution timer set in frame.slot %d.%d and expiring in %d.%d\n", __FUNCTION__, mod_id, frameP, slotP, ra->RA_contention_resolution_target_frame, ra->RA_contention_resolution_target_slot); ra->RA_contention_resolution_timer_active = 1; @@ -746,7 +746,7 @@ void nr_ue_contention_resolution(module_id_t module_id, int cc_id, frame_t frame if (ra->RA_contention_resolution_timer_active == 1) { if (frame >= ra->RA_contention_resolution_target_frame && - slot >= ra->RA_contention_resolution_target_frame) { + slot >= ra->RA_contention_resolution_target_slot) { ra->t_crnti = 0; ra->RA_active = 0; ra->RA_contention_resolution_timer_active = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 7d485616c9..f73d66e4fe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -793,7 +793,10 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]) bwp = ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]; - coreset = get_coreset(scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); + if (*ss->controlResourceSetId == 0) + coreset = nr_mac->sched_ctrlCommon->coreset; // this is coreset 0 + else + coreset = get_coreset(scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg3 retransmission\n"); nfapi_nr_ul_dci_request_t *ul_dci_req = &nr_mac->UL_dci_req[CC_id];