Commit 13c3b043 authored by Robert Schmidt's avatar Robert Schmidt

Correctly reconfigure nrofHARQ processes

parent 6958f707
...@@ -1943,7 +1943,6 @@ void create_nr_list(NR_list_t *list, int len) ...@@ -1943,7 +1943,6 @@ void create_nr_list(NR_list_t *list, int len)
{ {
list->head = -1; list->head = -1;
list->next = malloc(len * sizeof(*list->next)); list->next = malloc(len * sizeof(*list->next));
LOG_W(NR_MAC, "NR list->next %p\n", list->next);
AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n"); AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n");
for (int i = 0; i < len; ++i) for (int i = 0; i < len; ++i)
list->next[i] = -1; list->next[i] = -1;
...@@ -2278,8 +2277,16 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, ...@@ -2278,8 +2277,16 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
} else if (sched_ctrl->available_dl_harq.len == nrofHARQ) {
LOG_D(NR_MAC, "nrofHARQ %d already configured\n", nrofHARQ);
} else { } else {
const int old_nrofHARQ = sched_ctrl->available_dl_harq.len;
AssertFatal(nrofHARQ > old_nrofHARQ,
"cannot resize HARQ list to be smaller (nrofHARQ %d, old_nrofHARQ %d)\n",
nrofHARQ, old_nrofHARQ);
resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
for (int harq = old_nrofHARQ; harq < nrofHARQ; harq++)
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
} }
......
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