Commit 8f28685c authored by rmagueta's avatar rmagueta

Fix in new RA attempts after fail

parent 8b5d5bbb
...@@ -800,7 +800,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res ...@@ -800,7 +800,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
RA_config_t *ra = &mac->ra; RA_config_t *ra = &mac->ra;
ra->first_Msg3 = 0; ra->first_Msg3 = 1;
ra->generate_nr_prach = RA_FAILED; ra->generate_nr_prach = RA_FAILED;
ra->ra_state = RA_UE_IDLE; ra->ra_state = RA_UE_IDLE;
......
...@@ -2291,7 +2291,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t ...@@ -2291,7 +2291,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
break; break;
} }
if (rarh->E == 0) { if (rarh->E == 0) {
LOG_W(NR_MAC,"[UE %d][RAPROC] Received RAR preamble (%d) doesn't match the intended RAPID (%d)\n", mod_id, rarh->RAPID, preamble_index); LOG_W(NR_MAC,"[UE %d][RAPROC][%d.%d] Received RAR preamble (%d) doesn't match the intended RAPID (%d)\n", mod_id, frame, slot, rarh->RAPID, preamble_index);
break; break;
} else { } else {
rarh += sizeof(NR_MAC_RAR) + 1; rarh += sizeof(NR_MAC_RAR) + 1;
......
...@@ -464,9 +464,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -464,9 +464,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
UE_scheduling_control->sched_ul_bytes = 0; UE_scheduling_control->sched_ul_bytes = 0;
} }
} }
} else { } else if(sduP) {
if (!sduP) // check that CRC passed
return; bool no_sig = true;
for (int k = 0; k < sdu_lenP; k++) {
if(sduP[k]!=0) {
no_sig = false;
break;
}
}
if(no_sig) {
LOG_W(NR_MAC, "No signal\n");
}
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP), T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */, T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
...@@ -480,6 +490,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -480,6 +490,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (ra->state != WAIT_Msg3) if (ra->state != WAIT_Msg3)
continue; continue;
if(no_sig) {
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE;
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
} else {
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
if (ra->rnti != current_rnti) { if (ra->rnti != current_rnti) {
LOG_W(NR_MAC, LOG_W(NR_MAC,
...@@ -521,6 +539,20 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -521,6 +539,20 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->Msg4_slot = 1; ra->Msg4_slot = 1;
LOG_I(MAC, "Scheduling RA-Msg4 for TC-RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot); LOG_I(MAC, "Scheduling RA-Msg4 for TC-RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
return; return;
}
}
} else {
for (int i = 0; i < NR_NB_RA_PROC_MAX; ++i) {
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[i];
if (ra->state != WAIT_Msg3)
continue;
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE;
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
} }
} }
} }
......
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