Commit 7da7dda7 authored by francescomani's avatar francescomani Committed by alexjiao

new UE state to trigger RA after reconfiguration with sync

parent e3b0def6
......@@ -1060,7 +1060,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mib,
nr_ue_decode_mib(mac, cc_idP);
if (get_softmodem_params()->phy_test)
mac->state = UE_CONNECTED;
else if (mac->state == UE_NOT_SYNC && !IS_SA_MODE(get_softmodem_params()))
else if (mac->state == UE_NOT_SYNC_RECONF)
mac->state = UE_PERFORMING_RA;
ret = pthread_mutex_unlock(&mac->if_mutex);
......@@ -1811,7 +1811,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t
LOG_A(NR_MAC, "Received detach indication\n");
reset_ra(mac, true);
reset_mac_inst(mac);
nr_ue_reset_sync_state(mac);
nr_ue_reset_sync_state(mac, false);
release_mac_configuration(mac, cause);
mac->state = UE_DETACHING;
break;
......@@ -1828,7 +1828,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t
case RE_ESTABLISHMENT:
reset_mac_inst(mac);
nr_ue_mac_default_configs(mac);
nr_ue_reset_sync_state(mac);
nr_ue_reset_sync_state(mac, true);
release_mac_configuration(mac, cause);
// suspend all RBs except SRB0
for (int j = 0; j < mac->lc_ordered_list.count; j++) {
......@@ -1971,9 +1971,7 @@ void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19, b
AssertFatal(!ret, "mutex failed %d\n", ret);
}
static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
int cc_idP,
const NR_ReconfigurationWithSync_t *reconfWithSync)
static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, int cc_idP, const NR_ReconfigurationWithSync_t *reconfWithSync)
{
reset_mac_inst(mac);
mac->crnti = reconfWithSync->newUE_Identity;
......@@ -2015,7 +2013,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
configure_common_BWP_ul(mac, bwp_id, scc->uplinkConfigCommon->initialUplinkBWP);
}
mac->state = UE_NOT_SYNC;
mac->state = UE_NOT_SYNC_RECONF;
ra->ra_state = nrRA_UE_IDLE;
nr_ue_mac_default_configs(mac);
......
......@@ -252,7 +252,7 @@ void nr_get_RA_window(NR_UE_MAC_INST_t *mac);
void prepare_msg4_msgb_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack);
void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind);
void release_PUCCH_SRS(NR_UE_MAC_INST_t *mac);
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac);
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac, bool reconf);
void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, const fapi_nr_synch_request_t *sync_req);
bool is_ss_monitor_occasion(const int frame, const int slot, const int slots_per_frame, const NR_SearchSpace_t *ss);
......
......@@ -54,7 +54,7 @@ void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data
void nr_ue_init_mac(NR_UE_MAC_INST_t *mac)
{
LOG_I(NR_MAC, "[UE%d] Initializing MAC\n", mac->ue_id);
nr_ue_reset_sync_state(mac);
nr_ue_reset_sync_state(mac, false);
mac->get_sib1 = false;
for (int i = 0; i < MAX_SI_GROUPS; i++)
mac->get_otherSI[i] = false;
......@@ -117,10 +117,10 @@ void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int
mac->if_module->synch_request(&mac->synch_request);
}
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac)
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac, bool reconf)
{
// reset synchornization status
mac->state = UE_NOT_SYNC;
mac->state = reconf ? UE_NOT_SYNC_RECONF : UE_NOT_SYNC;
mac->ra.ra_state = nrRA_UE_IDLE;
}
......
......@@ -1146,7 +1146,7 @@ void nr_ue_dl_scheduler(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info
dl_config->slot = rx_slot;
dl_config->number_pdus = 0;
if (mac->state == UE_NOT_SYNC || mac->state == UE_DETACHING)
if (mac->state == UE_NOT_SYNC || mac->state == UE_NOT_SYNC_RECONF || mac->state == UE_DETACHING)
return;
if (mac->state == UE_CONNECTED) {
......
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