Commit 367a6715 authored by Robert Schmidt's avatar Robert Schmidt

Add UE to UE list in add_new_nr_ue(), fixes

parent 29ccc58e
...@@ -971,6 +971,19 @@ dump_nr_ue_list(NR_UE_list_t *listP, ...@@ -971,6 +971,19 @@ dump_nr_ue_list(NR_UE_list_t *listP,
return; return;
} }
void add_nr_ue_list(NR_UE_list_t *listP, int UE_id) {
if (listP->head == -1) {
listP->head = UE_id;
listP->next[UE_id] = -1;
} else {
int i = listP->head;
while (listP->next[i] >= 0)
i = listP->next[i];
listP->next[i] = UE_id;
listP->next[UE_id] = -1;
}
}
int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP) int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
...@@ -993,10 +1006,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -993,10 +1006,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
int UE_id; int UE_id;
int i; int i;
NR_UE_list_t *UE_list = &RC.nrmac[mod_idP]->UE_list; NR_UE_list_t *UE_list = &RC.nrmac[mod_idP]->UE_list;
LOG_I(MAC, "[gNB %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n", LOG_I(MAC, "[gNB %d] Adding UE with rnti %x (num_UEs %d)\n",
mod_idP, mod_idP,
rntiP, rntiP,
UE_list->avail,
UE_list->num_UEs); UE_list->num_UEs);
dump_nr_ue_list(UE_list, 0); dump_nr_ue_list(UE_list, 0);
...@@ -1008,6 +1020,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1008,6 +1020,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
UE_list->num_UEs++; UE_list->num_UEs++;
UE_list->active[UE_id] = TRUE; UE_list->active[UE_id] = TRUE;
UE_list->rnti[UE_id] = rntiP; UE_list->rnti[UE_id] = rntiP;
add_nr_ue_list(UE_list, UE_id);
memset((void *) &UE_list->UE_sched_ctrl[UE_id], memset((void *) &UE_list->UE_sched_ctrl[UE_id],
0, 0,
sizeof(NR_UE_sched_ctrl_t)); sizeof(NR_UE_sched_ctrl_t));
......
...@@ -107,17 +107,12 @@ void mac_top_init_gNB(void) ...@@ -107,17 +107,12 @@ void mac_top_init_gNB(void)
UE_list->num_UEs = 0; UE_list->num_UEs = 0;
UE_list->head = -1; UE_list->head = -1;
UE_list->head_ul = -1; UE_list->head_ul = -1;
UE_list->avail = 0;
for (list_el = 0; list_el < MAX_MOBILES_PER_GNB - 1; list_el++) { for (list_el = 0; list_el < MAX_MOBILES_PER_GNB; list_el++) {
UE_list->next[list_el] = list_el + 1; UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = list_el + 1; UE_list->next_ul[list_el] = -1;
UE_list->active[list_el] = FALSE; UE_list->active[list_el] = FALSE;
} }
UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = -1;
UE_list->active[list_el] = FALSE;
} }
srand48(0); srand48(0);
......
...@@ -117,7 +117,6 @@ typedef struct { ...@@ -117,7 +117,6 @@ typedef struct {
int head; int head;
int next_ul[MAX_MOBILES_PER_GNB]; int next_ul[MAX_MOBILES_PER_GNB];
int head_ul; int head_ul;
int avail;
int num_UEs; int num_UEs;
boolean_t active[MAX_MOBILES_PER_GNB]; boolean_t active[MAX_MOBILES_PER_GNB];
rnti_t rnti[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB];
......
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