Commit 1fa6be2a authored by francescomani's avatar francescomani

fix procedure after T300 expiry

parent 122a5ce9
......@@ -538,7 +538,7 @@ void processSlotTX(void *arg)
{
nr_rxtx_thread_data_t *rxtxD = (nr_rxtx_thread_data_t *) arg;
const UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
PHY_VARS_NR_UE *UE = rxtxD->UE;
PHY_VARS_NR_UE *UE = rxtxD->UE;
nr_phy_data_tx_t phy_data = {0};
if (UE->if_inst)
......
......@@ -105,8 +105,7 @@ int nr_pbch_detection(const UE_nr_rxtx_proc_t *proc,
int pbch_initial_symbol,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{
NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
int ret =-1;
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
NR_UE_SSB *best_ssb = NULL;
NR_UE_SSB *current_ssb;
......@@ -138,8 +137,9 @@ int nr_pbch_detection(const UE_nr_rxtx_proc_t *proc,
}
}
NR_UE_SSB *temp_ptr=best_ssb;
while (ret!=0 && temp_ptr != NULL) {
NR_UE_SSB *temp_ptr = best_ssb;
int ret = -1;
while (ret != 0 && temp_ptr != NULL) {
start_meas(&ue->dlsch_channel_estimation_stats);
// computing channel estimation for selected best ssb
......@@ -165,14 +165,10 @@ int nr_pbch_detection(const UE_nr_rxtx_proc_t *proc,
free_list(best_ssb);
if (ret == 0)
if (ret == 0) {
frame_parms->nb_antenna_ports_gNB = 1; // pbch_tx_ant;
// set initial transmission mode to 1 or 2 depending on number of detected TX antennas
// frame_parms->mode1_flag = (pbch_tx_ant==1);
// openair_daq_vars.dlsch_transmission_mode = (pbch_tx_ant>1) ? 2 : 1;
LOG_I(PHY, "[UE%d] Initial sync: pbch decoded sucessfully, ssb index %d\n", ue->Mod_id, frame_parms->ssb_index);
LOG_I(PHY, "[UE%d] Initial sync: pbch decoded sucessfully, ssb index %d\n", ue->Mod_id, frame_parms->ssb_index);
}
return ret;
}
......@@ -429,6 +425,8 @@ nr_initial_sync_t nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, i
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY, "[UE%d] Initial sync : Estimated power: %d dB\n", ue->Mod_id, ue->measurements.rx_power_avg_dB[0]);
#endif
} else {
LOG_A(PHY, "Initial sync successful\n");
}
// exit_fun("debug exit");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_OUT);
......
......@@ -1358,7 +1358,6 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
NR_UE_MAC_reset_cause_t cause)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
switch (cause) {
case GO_TO_IDLE:
reset_ra(&mac->ra);
......
......@@ -86,26 +86,26 @@ void init_RA(NR_UE_MAC_INST_t *mac,
if (rach_ConfigDedicated) {
if (rach_ConfigDedicated->cfra){
LOG_I(MAC, "Initialization of 2-step contention-free random access procedure\n");
LOG_I(NR_MAC, "Initialization of 2-step contention-free random access procedure\n");
prach_resources->RA_TYPE = RA_2STEP;
ra->cfra = 1;
} else if (rach_ConfigDedicated->ext1){
if (rach_ConfigDedicated->ext1->cfra_TwoStep_r16){
LOG_I(MAC, "Setting RA type to 2-step...\n");
LOG_I(NR_MAC, "Setting RA type to 2-step...\n");
prach_resources->RA_TYPE = RA_2STEP;
ra->cfra = 1;
} else {
LOG_E(MAC, "Config not handled\n");
LOG_E(NR_MAC, "Config not handled\n");
}
} else {
LOG_E(MAC, "Config not handled\n");
LOG_E(NR_MAC, "Config not handled\n");
}
} else if (nr_rach_ConfigCommon){
LOG_I(MAC, "Initialization of 4-step contention-based random access procedure\n");
LOG_I(NR_MAC, "Initialization of 4-step contention-based random access procedure\n");
prach_resources->RA_TYPE = RA_4STEP;
ra->cfra = 0;
} else {
LOG_E(MAC, "Config not handled\n");
LOG_E(NR_MAC, "Config not handled\n");
}
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
......
......@@ -41,10 +41,8 @@
#include <asn_application.h>
#include "RRC/NR/nr_rrc_defs.h"
#include "RRC/NR/nr_rrc_config.h"
/*
* The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
* output into the chosen string buffer.
......
......@@ -616,7 +616,7 @@ static void nr_rrc_handle_msg3_indication(NR_UE_RRC_INST_t *rrc, rnti_t rnti)
{
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
switch (rrc->ra_trigger) {
case INITIAL_ACCESS_FROM_RRC_IDLE:
case RRC_CONNECTION_SETUP:
// After SIB1 is received, prepare RRCConnectionRequest
rrc->rnti = rnti;
// start timer T300
......@@ -744,7 +744,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(NR_UE_RRC_INST_t *rrc,
LOG_A(NR_RRC, "SIB1 decoded\n");
nr_timer_start(&SI_info->sib1_timer);
if (rrc->nrRrcState == RRC_STATE_IDLE_NR) {
rrc->ra_trigger = INITIAL_ACCESS_FROM_RRC_IDLE;
rrc->ra_trigger = RRC_CONNECTION_SETUP;
// preparing RRC setup request payload in advance
nr_rrc_ue_prepare_RRCSetupRequest(rrc);
}
......@@ -2221,6 +2221,9 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
void handle_t300_expiry(NR_UE_RRC_INST_t *rrc)
{
rrc->ra_trigger = RRC_CONNECTION_SETUP;
nr_rrc_ue_prepare_RRCSetupRequest(rrc);
// reset MAC, release the MAC configuration
NR_UE_MAC_reset_cause_t cause = T300_EXPIRY;
nr_rrc_mac_config_req_reset(rrc->ue_id, cause);
......
......@@ -105,7 +105,7 @@ typedef enum requested_SI_List_e {
// 3GPP TS 38.300 Section 9.2.6
typedef enum RA_trigger_e {
RA_NOT_RUNNING,
INITIAL_ACCESS_FROM_RRC_IDLE,
RRC_CONNECTION_SETUP,
RRC_CONNECTION_REESTABLISHMENT,
DURING_HANDOVER,
NON_SYNCHRONISED,
......
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