Commit a9bfdb2d authored by Thomas Schlichter's avatar Thomas Schlichter

NR_UE: use 'do_ra' instead of 'mac_enabled' to enable RA procedure

parent 220c5b2d
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "executables/softmodem-common.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#define DEBUG_PHY #define DEBUG_PHY
...@@ -104,15 +105,14 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, ...@@ -104,15 +105,14 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
{ {
first_time = 0; first_time = 0;
ue->time_sync_cell = 1; ue->time_sync_cell = 1;
if (ue->mac_enabled==1) { if (get_softmodem_params()->do_ra) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch(); //mac_resynch();
//dl_phy_sync_success(ue->Mod_id,frame,0,1);//ue->common_vars.eNb_id); //dl_phy_sync_success(ue->Mod_id,frame,0,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH; ue->UE_mode[0] = PRACH;
ue->prach_resources[gNB_id]->sync_frame = frame; ue->prach_resources[gNB_id]->sync_frame = frame;
ue->prach_resources[gNB_id]->init_msg1 = 0; ue->prach_resources[gNB_id]->init_msg1 = 0;
} } else {
else {
ue->UE_mode[0] = PUSCH; ue->UE_mode[0] = PUSCH;
} }
} }
......
...@@ -238,7 +238,7 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){ ...@@ -238,7 +238,7 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){
int factor_mu = 1 << numerology; int factor_mu = 1 << numerology;
uint16_t bw_scaling = get_bw_scaling(bwp_ul_NB_RB); uint16_t bw_scaling = get_bw_scaling(bwp_ul_NB_RB);
LOG_D(PHY, "In %s: applying timing advance -- frame %d -- slot %d\n", __FUNCTION__, frame_tx, slot_tx); LOG_D(PHY, "In %s: applying timing advance -- frame %d -- slot %d -- UE_mode %d\n", __FUNCTION__, frame_tx, slot_tx, ue->UE_mode[gNB_id]);
if (ue->UE_mode[gNB_id] == RA_RESPONSE){ if (ue->UE_mode[gNB_id] == RA_RESPONSE){
...@@ -314,11 +314,9 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, ...@@ -314,11 +314,9 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
} }
if (get_softmodem_params()->do_ra==1) { if (ue->UE_mode[gNB_id] > NOT_SYNCHED && ue->UE_mode[gNB_id] < PUSCH) {
if ((ue->UE_mode[gNB_id] > NOT_SYNCHED && ue->UE_mode[gNB_id] < PUSCH) && ue->mac_enabled) {
nr_ue_prach_procedures(ue, proc, gNB_id); nr_ue_prach_procedures(ue, proc, gNB_id);
} }
}
LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
...@@ -410,9 +408,13 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, ...@@ -410,9 +408,13 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
// Switch to PRACH state if it is first PBCH after initial synch and no timing correction is performed // Switch to PRACH state if it is first PBCH after initial synch and no timing correction is performed
if (ue->UE_mode[gNB_id] == NOT_SYNCHED && ue->no_timing_correction == 1){ if (ue->UE_mode[gNB_id] == NOT_SYNCHED && ue->no_timing_correction == 1){
if (get_softmodem_params()->do_ra) {
ue->UE_mode[gNB_id] = PRACH; ue->UE_mode[gNB_id] = PRACH;
ue->prach_resources[gNB_id]->sync_frame = frame_rx; ue->prach_resources[gNB_id]->sync_frame = frame_rx;
ue->prach_resources[gNB_id]->init_msg1 = 0; ue->prach_resources[gNB_id]->init_msg1 = 0;
} else {
ue->UE_mode[gNB_id] = PUSCH;
}
} }
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
...@@ -1196,16 +1198,10 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -1196,16 +1198,10 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
switch (pdsch) { switch (pdsch) {
case RA_PDSCH: case RA_PDSCH:
if(!ue->mac_enabled){
return;
}
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, eNB_id); nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, eNB_id);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, eNB_id, ue, dlsch0, number_pdus); nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, eNB_id, ue, dlsch0, number_pdus);
ue->UE_mode[eNB_id] = RA_RESPONSE; ue->UE_mode[eNB_id] = RA_RESPONSE;
break; break;
case PDSCH: case PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, eNB_id); nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, eNB_id);
......
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