diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index cc450cc4c0..de955e8494 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1714,7 +1714,9 @@ static void configure_maccellgroup(NR_UE_MAC_INST_t *mac, const NR_MAC_CellGroup si->sr_id == sr->schedulingRequestId, "Current implementation cannot handle more than 1 SR configuration\n"); si->sr_id = sr->schedulingRequestId; - si->sr_TransMax = sr->sr_TransMax; + // NR_SchedulingRequestToAddMod__sr_TransMax_n4 = 0 and so on + // to obtain the value to configure we need to right shift 4 by the RRC parameter + si->sr_MaxTransmissions = 4 << sr->sr_TransMax; int target_ms = 0; if (sr->sr_ProhibitTimer) target_ms = 1 << *sr->sr_ProhibitTimer; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 5990b4aecc..ac6a349be6 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -225,7 +225,7 @@ typedef struct { /// sr ProhibitTimer NR_timer_t sr_ProhibitTimer; // Maximum number of SR transmissions - uint32_t sr_TransMax; + uint32_t sr_MaxTransmissions; int sr_id; ///timer before triggering a periodic PHR uint16_t periodicPHR_Timer; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 4a910761be..77e1996956 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2484,23 +2484,22 @@ int8_t nr_ue_get_SR(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slot) { // no UL-SCH resources available for this tti && UE has a valid PUCCH resources for SR configuration for this tti NR_UE_SCHEDULING_INFO *si = &mac->scheduling_info; - int max_sr_transmissions = (1 << (2 + si->sr_TransMax)); LOG_D(NR_MAC, "[UE %d] Frame %d slot %d send SR indication (SR_COUNTER/sr_TransMax %d/%d), SR_pending %d\n", mac->ue_id, frameP, slot, si->SR_COUNTER, - max_sr_transmissions, + si->sr_MaxTransmissions, si->SR_pending); // todo if ((si->SR_pending == 1) && - (si->SR_COUNTER < max_sr_transmissions)) { + (si->SR_COUNTER < si->sr_MaxTransmissions)) { LOG_D(NR_MAC, "[UE %d] Frame %d slot %d PHY asks for SR (SR_COUNTER/sr_TransMax %d/%d), SR_pending %d, increment SR_COUNTER\n", mac->ue_id, frameP, slot, si->SR_COUNTER, - max_sr_transmissions, + si->sr_MaxTransmissions, si->SR_pending); // todo si->SR_COUNTER++;