NR UE: add MAC state UE_RECEIVING_SIB ensuring to start RA only after successfully receiving SIBs
This commit is contained in:
@@ -937,6 +937,8 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
|
||||
mac->get_sib1 = true;
|
||||
else if (sched_sib == 2)
|
||||
mac->get_otherSI = true;
|
||||
else if (sched_sib == 0 && mac->state == UE_RECEIVING_SIB)
|
||||
mac->state = UE_PERFORMING_RA;
|
||||
nr_ue_decode_mib(mac, cc_idP);
|
||||
ret = pthread_mutex_unlock(&mac->if_mutex);
|
||||
AssertFatal(!ret, "mutex failed %d\n", ret);
|
||||
@@ -1690,7 +1692,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t
|
||||
case T300_EXPIRY:
|
||||
reset_ra(mac, false);
|
||||
reset_mac_inst(mac);
|
||||
mac->state = UE_SYNC; // still in sync but need to restart RA
|
||||
mac->state = UE_PERFORMING_RA; // still in sync but need to restart RA
|
||||
break;
|
||||
case RE_ESTABLISHMENT:
|
||||
reset_mac_inst(mac);
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
// Define the UE L2 states with X-Macro
|
||||
#define NR_UE_L2_STATES \
|
||||
UE_STATE(UE_NOT_SYNC) \
|
||||
UE_STATE(UE_SYNC) \
|
||||
UE_STATE(UE_RECEIVING_SIB) \
|
||||
UE_STATE(UE_PERFORMING_RA) \
|
||||
UE_STATE(UE_CONNECTED) \
|
||||
UE_STATE(UE_DETACHING)
|
||||
|
||||
@@ -1041,7 +1041,7 @@ void nr_ra_failed(NR_UE_MAC_INST_t *mac, uint8_t CC_id, NR_PRACH_RESOURCES_t *pr
|
||||
void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac)
|
||||
{
|
||||
LOG_W(NR_MAC, "Triggering new RA procedure for UE with RNTI %x\n", mac->crnti);
|
||||
mac->state = UE_SYNC;
|
||||
mac->state = UE_PERFORMING_RA;
|
||||
reset_ra(mac, false);
|
||||
mac->ra.msg3_C_RNTI = true;
|
||||
}
|
||||
|
||||
@@ -223,10 +223,14 @@ void nr_ue_decode_mib(NR_UE_MAC_INST_t *mac, int cc_id)
|
||||
if (mac->first_sync_frame == -1)
|
||||
mac->first_sync_frame = frame;
|
||||
|
||||
if(get_softmodem_params()->phy_test)
|
||||
if (get_softmodem_params()->phy_test)
|
||||
mac->state = UE_CONNECTED;
|
||||
else if(mac->state == UE_NOT_SYNC)
|
||||
mac->state = UE_SYNC;
|
||||
else if (mac->state == UE_NOT_SYNC) {
|
||||
if (IS_SA_MODE(get_softmodem_params()))
|
||||
mac->state = UE_RECEIVING_SIB;
|
||||
else
|
||||
mac->state = UE_PERFORMING_RA;
|
||||
}
|
||||
}
|
||||
|
||||
static void configure_ratematching_csi(fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_pdu,
|
||||
|
||||
@@ -1565,7 +1565,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
uint32_t gNB_index = ul_info->gNB_index;
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
if(mac->state > UE_NOT_SYNC && mac->state < UE_CONNECTED) {
|
||||
if (mac->state == UE_PERFORMING_RA) {
|
||||
nr_ue_get_rach(mac, cc_id, frame_tx, gNB_index, slot_tx);
|
||||
nr_ue_prach_scheduler(mac, frame_tx, slot_tx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user