diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index e1e9bfd982..63700d2a72 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -935,7 +935,8 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP, ra->Msg3_tda_id, ra->msg3_TPC, 1, // Not toggling NDI in msg3 retransmissions - ul_bwp); + ul_bwp, + ss->searchSpaceType->present); // Reset TPC to 0 dB to not request new gain multiple times before computing new value for SNR ra->msg3_TPC = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index acb84a78f0..ae819c4418 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -790,13 +790,20 @@ void config_uldci(const NR_UE_ServingCell_Info_t *sc_info, int time_domain_assignment, uint8_t tpc, uint8_t ndi, - NR_UE_UL_BWP_t *ul_bwp) + NR_UE_UL_BWP_t *ul_bwp, + NR_SearchSpace__searchSpaceType_PR ss_type) { int bwp_id = ul_bwp->bwp_id; nr_dci_format_t dci_format = ul_bwp->dci_format; + // 3GPP TS 38.214 Section 6.1.2.2.2 Uplink resource allocation type 1 + uint16_t riv_bwp_size = ul_bwp->BWPSize; + if (dci_format == NR_UL_DCI_FORMAT_0_0 && ss_type == NR_SearchSpace__searchSpaceType_PR_common && ul_bwp->pusch_Config + && ul_bwp->pusch_Config->resourceAllocation == NR_PUSCH_Config__resourceAllocation_resourceAllocationType1) { + riv_bwp_size = sc_info->initial_ul_BWPSize; + } dci_pdu_rel15->frequency_domain_assignment.val = - PRBalloc_to_locationandbandwidth0(pusch_pdu->rb_size, pusch_pdu->rb_start, ul_bwp->BWPSize); + PRBalloc_to_locationandbandwidth0(pusch_pdu->rb_size, pusch_pdu->rb_start, riv_bwp_size); dci_pdu_rel15->time_domain_assignment.val = time_domain_assignment; dci_pdu_rel15->frequency_hopping_flag.val = pusch_pdu->frequency_hopping; dci_pdu_rel15->mcs = pusch_pdu->mcs_index; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 5c6cb47797..35c817b975 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -2687,7 +2687,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, slot_t slot, nfapi_ sched_pusch->time_domain_allocation, UE->UE_sched_ctrl.tpc0, cur_harq->ndi, - current_BWP); + current_BWP, + ss->searchSpaceType->present); // Reset TPC to 0 dB to not request new gain multiple times before computing new value for SNR UE->UE_sched_ctrl.tpc0 = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index c78c061820..f0b59c73de 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -166,7 +166,8 @@ void config_uldci(const NR_UE_ServingCell_Info_t *sc_info, int time_domain_assignment, uint8_t tpc, uint8_t ndi, - NR_UE_UL_BWP_t *ul_bwp); + NR_UE_UL_BWP_t *ul_bwp, + NR_SearchSpace__searchSpaceType_PR ss_type); void nr_schedule_pucch(gNB_MAC_INST *nrmac, frame_t frameP, slot_t slotP);