Commit ccb83d16 authored by Robert Schmidt's avatar Robert Schmidt

Add NR_UE_list_t type

parent adcd2949
...@@ -1592,26 +1592,9 @@ int extract_length(int startSymbolAndLength) { ...@@ -1592,26 +1592,9 @@ int extract_length(int startSymbolAndLength) {
/* /*
* Dump the UL or DL UE_info into LOG_T(MAC) * Dump the UL or DL UE_info into LOG_T(MAC)
*/ */
void void dump_nr_ue_list(NR_UE_list_t *listP) {
dump_nr_ue_list(NR_UE_info_t *listP, for (int j = listP->head; j >= 0; j = listP->next[j])
int ul_flag) LOG_T(MAC, "DL list node %d => %d\n", j, listP->next[j]);
//------------------------------------------------------------------------------
{
if (ul_flag == 0) {
for (int j = listP->head; j >= 0; j = listP->next[j]) {
LOG_T(MAC, "DL list node %d => %d\n",
j,
listP->next[j]);
}
} else {
for (int j = listP->head_ul; j >= 0; j = listP->next_ul[j]) {
LOG_T(MAC, "UL list node %d => %d\n",
j,
listP->next_ul[j]);
}
}
return;
} }
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)
...@@ -1641,12 +1624,11 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1641,12 +1624,11 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
int num_slots_ul = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; int num_slots_ul = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0)
num_slots_ul++; num_slots_ul++;
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_info->avail,
UE_info->num_UEs); UE_info->num_UEs);
dump_nr_ue_list(UE_info, 0); dump_nr_ue_list(&UE_info->list);
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_info->active[i]) if (UE_info->active[i])
...@@ -1674,15 +1656,13 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1674,15 +1656,13 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
mod_idP, mod_idP,
UE_id, UE_id,
rntiP); rntiP);
dump_nr_ue_list(UE_info, dump_nr_ue_list(&UE_info->list);
0);
return (UE_id); return (UE_id);
} }
// printf("MAC: cannot add new UE for rnti %x\n", rntiP); // printf("MAC: cannot add new UE for rnti %x\n", rntiP);
LOG_E(MAC, "error in add_new_ue(), could not find space in UE_info, Dumping UE list\n"); LOG_E(MAC, "error in add_new_ue(), could not find space in UE_info, Dumping UE list\n");
dump_nr_ue_list(UE_info, dump_nr_ue_list(&UE_info->list);
0);
return -1; return -1;
} }
......
...@@ -300,7 +300,7 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB); ...@@ -300,7 +300,7 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
void dump_nr_ue_list(NR_UE_info_t *listP, int ul_flag); void dump_nr_ue_list(NR_UE_list_t *listP);
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);
......
...@@ -106,13 +106,9 @@ void mac_top_init_gNB(void) ...@@ -106,13 +106,9 @@ void mac_top_init_gNB(void)
UE_info = &nrmac->UE_info; UE_info = &nrmac->UE_info;
UE_info->num_UEs = 0; UE_info->num_UEs = 0;
UE_info->head = -1; UE_info->list.head = -1;
UE_info->head_ul = -1; for (list_el = 0; list_el < MAX_MOBILES_PER_GNB; list_el++) {
UE_info->avail = 0; UE_info->list.next[list_el] = -1;
for (list_el = 0; list_el < MAX_MOBILES_PER_GNB - 1; list_el++) {
UE_info->next[list_el] = list_el + 1;
UE_info->next_ul[list_el] = list_el + 1;
UE_info->active[list_el] = FALSE; UE_info->active[list_el] = FALSE;
for (int list_harq = 0; list_harq < NR_MAX_NB_HARQ_PROCESSES; list_harq++) { for (int list_harq = 0; list_harq < NR_MAX_NB_HARQ_PROCESSES; list_harq++) {
UE_info->UE_sched_ctrl[list_el].harq_processes[list_harq].round = 0; UE_info->UE_sched_ctrl[list_el].harq_processes[list_harq].round = 0;
...@@ -123,10 +119,6 @@ void mac_top_init_gNB(void) ...@@ -123,10 +119,6 @@ void mac_top_init_gNB(void)
UE_info->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].state = 0; UE_info->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].state = 0;
} }
} }
UE_info->next[list_el] = -1;
UE_info->next_ul[list_el] = -1;
UE_info->active[list_el] = FALSE;
} }
srand48(0); srand48(0);
......
...@@ -343,17 +343,21 @@ typedef struct { ...@@ -343,17 +343,21 @@ typedef struct {
int ulsch_total_bytes_rx; int ulsch_total_bytes_rx;
} NR_mac_stats_t; } NR_mac_stats_t;
/*! \brief UNR_E_list_t is a "list" of users within UE_info_t. Especial useful in
* the scheduler and to keep "classes" of users. */
typedef struct {
int head;
int next[MAX_MOBILES_PER_GNB];
} NR_UE_list_t;
/*! \brief UE list used by gNB to order UEs/CC for scheduling*/ /*! \brief UE list used by gNB to order UEs/CC for scheduling*/
typedef struct { typedef struct {
DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB]; DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB];
/// scheduling control info /// scheduling control info
NR_UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_GNB]; NR_UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_GNB];
NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB];
int next[MAX_MOBILES_PER_GNB]; NR_UE_list_t list;
int head;
int next_ul[MAX_MOBILES_PER_GNB];
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];
boolean_t fiveG_connected[MAX_MOBILES_PER_GNB]; boolean_t fiveG_connected[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