Commit 51ca8ca8 authored by Thomas Schlichter's avatar Thomas Schlichter

fixes regarding feedback time

parent 463d71d6
......@@ -1216,11 +1216,8 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
current_harq->dl_slot = slot;
int scs = get_softmodem_params()->numerology;
int slots_per_frame = nr_slots_per_frame[scs];
slot += data_toul_fb;
if (slot >= slots_per_frame) {
frame = (frame + 1) % 1024;
slot %= slots_per_frame;
}
frame = (frame + (slot + data_toul_fb) / slots_per_frame) % MAX_FRAME_NUMBER;
slot = (slot + data_toul_fb) % slots_per_frame;
LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n",
harq_id, current_harq->dl_frame, current_harq->dl_slot, frame, slot);
......@@ -2173,13 +2170,9 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche
sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul;
sched_frame = current_harq->dl_frame;
int frame_offset = 1;
if (NTN_UE_k2 > 0)
frame_offset = NTN_UE_k2/slots_per_frame;
if (sched_slot >= slots_per_frame) {
sched_frame = (sched_frame + frame_offset) % MAX_FRAME_NUMBER;
sched_frame = (sched_frame + sched_slot/slots_per_frame) % MAX_FRAME_NUMBER;
sched_slot %= slots_per_frame;
}
AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot);
......
......@@ -2010,8 +2010,8 @@ void set_max_fb_time(NR_UE_UL_BWP_t *UL_BWP, const NR_UE_DL_BWP_t *DL_BWP)
if(*fb_times->list.array[i] > UL_BWP->max_fb_time)
UL_BWP->max_fb_time = *fb_times->list.array[i];
}
UL_BWP->max_fb_time += NTN_gNB_k2;
}
UL_BWP->max_fb_time += NTN_gNB_k2;
}
void reset_sched_ctrl(NR_UE_sched_ctrl_t *sched_ctrl)
......
......@@ -200,12 +200,6 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac,
NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index];
if (!curr_pucch->active)
continue;
if (!UE->Msg4_ACKed)
{
const NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs];
frameP += NTN_gNB_k2 / n_slots_frame;
}
DevAssert(frameP == curr_pucch->frame && slotP == curr_pucch->ul_slot);
const uint16_t O_ack = curr_pucch->dai_c;
......@@ -1055,7 +1049,7 @@ static NR_UE_harq_t *find_harq(frame_t frame, sub_frame_t slot, NR_UE_info_t * U
return NULL;
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[pid];
/* old feedbacks we missed: mark for retransmission */
while (harq->feedback_frame != frame
while ((harq->feedback_frame - frame + 1024 ) % 1024 > 512 // harq->feedback_frame < frame
|| (harq->feedback_frame == frame && harq->feedback_slot < slot)) {
LOG_W(NR_MAC,
"UE %04x expected HARQ pid %d feedback at %4d.%2d, but is at %4d.%2d instead (HARQ feedback is in the past)\n",
......@@ -1073,7 +1067,8 @@ static NR_UE_harq_t *find_harq(frame_t frame, sub_frame_t slot, NR_UE_info_t * U
harq = &sched_ctrl->harq_processes[pid];
}
/* feedbacks that we wait for in the future: don't do anything */
if (harq->feedback_slot > slot) {
if ((frame - harq->feedback_frame + 1024 ) % 1024 > 512 // harq->feedback_frame > frame
|| (harq->feedback_frame == frame && harq->feedback_slot > slot)) {
LOG_W(NR_MAC,
"UE %04x expected HARQ pid %d feedback at %4d.%2d, but is at %4d.%2d instead (HARQ feedback is in the future)\n",
UE->rnti,
......
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