Commit d9215819 authored by Robert Schmidt's avatar Robert Schmidt

Remove fiveG_connected and use active

parent 793cbda9
...@@ -411,14 +411,16 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -411,14 +411,16 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
const int num_slots_per_tdd = slots_per_frame[*scc->ssbSubcarrierSpacing] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity); const int num_slots_per_tdd = slots_per_frame[*scc->ssbSubcarrierSpacing] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity);
const int nr_ulmix_slots = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0); const int nr_ulmix_slots = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0);
if (slot== 0 && (UE_info->fiveG_connected[UE_id] || get_softmodem_params()->phy_test)) { if (slot == 0 && UE_info->active[UE_id]) {
for (int k=0; k<nr_ulmix_slots; k++) { for (int k=0; k<nr_ulmix_slots; k++) {
memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pucch[k], /* Seems to be covered 384? */
/*memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pucch[k],
0, 0,
sizeof(NR_sched_pucch)); sizeof(NR_sched_pucch));*/
memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pusch[k], /* Seems to be covered in line 335? */
/*memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pusch[k],
0, 0,
sizeof(NR_sched_pusch)); sizeof(NR_sched_pusch));*/
} }
} }
...@@ -470,10 +472,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -470,10 +472,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (get_softmodem_params()->phy_test == 0) { if (get_softmodem_params()->phy_test == 0) {
nr_schedule_RA(module_idP, frame, slot); nr_schedule_RA(module_idP, frame, slot);
nr_schedule_reception_msg3(module_idP, 0, frame, slot); nr_schedule_reception_msg3(module_idP, 0, frame, slot);
} else }
UE_info->fiveG_connected[UE_id] = true;
if (UE_info->fiveG_connected[UE_id]) { if (UE_info->active[UE_id]) {
// TbD once RACH is available, start ta_timer when UE is connected // TbD once RACH is available, start ta_timer when UE is connected
if (ue_sched_ctl->ta_timer) if (ue_sched_ctl->ta_timer)
ue_sched_ctl->ta_timer--; ue_sched_ctl->ta_timer--;
...@@ -488,13 +489,13 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -488,13 +489,13 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// This schedules the DCI for Uplink and subsequently PUSCH // This schedules the DCI for Uplink and subsequently PUSCH
// The decision about whether to schedule is done for each UE independently // The decision about whether to schedule is done for each UE independently
// inside // inside
if (UE_info->fiveG_connected[UE_id]) { if (UE_info->active[UE_id]) {
int tda = 1; // time domain assignment hardcoded for now int tda = 1; // time domain assignment hardcoded for now
schedule_fapi_ul_pdu(module_idP, frame, slot, num_slots_per_tdd, nr_ulmix_slots, tda, ulsch_in_slot_bitmap); schedule_fapi_ul_pdu(module_idP, frame, slot, num_slots_per_tdd, nr_ulmix_slots, tda, ulsch_in_slot_bitmap);
nr_schedule_pusch(module_idP, UE_id, num_slots_per_tdd, nr_ulmix_slots, frame, slot); nr_schedule_pusch(module_idP, UE_id, num_slots_per_tdd, nr_ulmix_slots, frame, slot);
} }
if (UE_info->fiveG_connected[UE_id] if (UE_info->active[UE_id]
&& (is_xlsch_in_slot(dlsch_in_slot_bitmap, slot % num_slots_per_tdd)) && (is_xlsch_in_slot(dlsch_in_slot_bitmap, slot % num_slots_per_tdd))
&& (!get_softmodem_params()->phy_test || slot == 1)) { && (!get_softmodem_params()->phy_test || slot == 1)) {
ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd; ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd;
...@@ -505,7 +506,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -505,7 +506,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
ue_sched_ctl->ta_apply = false; ue_sched_ctl->ta_apply = false;
} }
if (UE_info->fiveG_connected[UE_id]) if (UE_info->active[UE_id])
nr_schedule_pucch(module_idP, UE_id, nr_ulmix_slots, frame, slot); nr_schedule_pucch(module_idP, UE_id, nr_ulmix_slots, frame, slot);
stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); stop_meas(&RC.nrmac[module_idP]->eNB_scheduler);
......
...@@ -268,9 +268,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -268,9 +268,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
break; break;
} }
} }
if (pr_found) if (!pr_found) {
UE_info->fiveG_connected[UE_id] = false;
else {
LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n", LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n",
module_idP, preamble_index, UE_id); module_idP, preamble_index, UE_id);
return; // if the PRACH preamble does not correspond to any of the ones sent through RRC abort RA proc return; // if the PRACH preamble does not correspond to any of the ones sent through RRC abort RA proc
...@@ -448,7 +446,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t ...@@ -448,7 +446,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t)); memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t));
AssertFatal(UE_info->active[UE_id],"Cannot find UE_id %d is not active\n", UE_id); AssertFatal(!UE_info->active[UE_id], "UE_id %d is already active\n", UE_id);
NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
......
...@@ -1626,7 +1626,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1626,7 +1626,7 @@ 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 (num_UEs %d)\n", LOG_W(MAC, "[gNB %d] Adding UE with rnti %x (num_UEs %d)\n",
mod_idP, mod_idP,
rntiP, rntiP,
UE_info->num_UEs); UE_info->num_UEs);
...@@ -1638,7 +1638,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1638,7 +1638,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
int UE_id = i; int UE_id = i;
UE_info->num_UEs++; UE_info->num_UEs++;
UE_info->active[UE_id] = true; UE_info->active[UE_id] = false; /* not yet active, we wait for RA! */
UE_info->rnti[UE_id] = rntiP; UE_info->rnti[UE_id] = rntiP;
add_nr_ue_list(&UE_info->list, UE_id); add_nr_ue_list(&UE_info->list, UE_id);
memset((void *) &UE_info->UE_sched_ctrl[UE_id], memset((void *) &UE_info->UE_sched_ctrl[UE_id],
...@@ -1691,7 +1691,6 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti) ...@@ -1691,7 +1691,6 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti)
/* UE found, remove it */ /* UE found, remove it */
UE_id = i; UE_id = i;
UE_info->num_UEs--; UE_info->num_UEs--;
UE_list->fiveG_connected[UE_id] = FALSE;
UE_info->active[UE_id] = FALSE; UE_info->active[UE_id] = FALSE;
UE_info->rnti[UE_id] = 0; UE_info->rnti[UE_id] = 0;
free(UE_info->UE_sched_ctrl[UE_id].sched_pucch); free(UE_info->UE_sched_ctrl[UE_id].sched_pucch);
......
...@@ -370,13 +370,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -370,13 +370,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
if (sduP != NULL) { // if the CRC passed if (sduP != NULL) { // if the CRC passed
for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) { for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) {
if (UE_info->active[i]) { if (UE_info->tc_rnti[i] == current_rnti) {
if (UE_info->tc_rnti[i] == current_rnti) { // for now the only thing we are doing is set the UE as active
// for now the only thing we are doing is set the UE as 5G connected UE_info->active[i] = true;
UE_info->fiveG_connected[i] = true; LOG_W(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n",
LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n", gnb_mod_idP, current_rnti, i);
gnb_mod_idP, current_rnti, i);
}
} }
} }
} }
......
...@@ -361,7 +361,6 @@ typedef struct { ...@@ -361,7 +361,6 @@ typedef struct {
NR_UE_list_t list; NR_UE_list_t list;
int num_UEs; int num_UEs;
bool active[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB];
boolean_t fiveG_connected[MAX_MOBILES_PER_GNB];
rnti_t rnti[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB];
rnti_t tc_rnti[MAX_MOBILES_PER_GNB]; rnti_t tc_rnti[MAX_MOBILES_PER_GNB];
NR_preamble_ue preambles[MAX_MOBILES_PER_GNB]; NR_preamble_ue preambles[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