Commit 21d3a4ea authored by francescomani's avatar francescomani

improving the handling of sr_TransMax

parent 338426ed
......@@ -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;
......
......@@ -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;
......
......@@ -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++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment