For RA 2-Step consider RA failed if MsgA-PUSCH not detected

Signed-off-by: Nuno Domingues <ndomingues@allbesmart.pt>
This commit is contained in:
ndomingues
2025-09-26 15:40:53 +01:00
committed by Nuno Domingues
parent 97ac8a5cd1
commit d95d911e96

View File

@@ -700,6 +700,18 @@ static void handle_nr_ul_harq(gNB_MAC_INST *nrmac, NR_UE_info_t *UE, rnti_t rnti
static void handle_msg3_failed_rx(gNB_MAC_INST *mac, NR_RA_t *ra, rnti_t rnti, int harq_round_max)
{
// for CFRA (NSA) do not schedule retransmission of msg3
// For RA 2-Step consider RA failed if MsgA-PUSCH not detected
if (ra->cfra || ra->ra_type == RA_2_STEP) {
LOG_W(NR_MAC,
"UE %04x RA failed at state %s (%s reception failed)\n",
rnti,
nrra_text[ra->ra_state],
ra->ra_type == RA_2_STEP ? "MsgA-PUSCH" : "NSA Msg3");
nr_release_ra_UE(mac, rnti);
return;
}
if (ra->msg3_round >= harq_round_max - 1) {
LOG_W(NR_MAC, "UE %04x RA failed at state %s (Reached msg3 max harq rounds)\n", rnti, nrra_text[ra->ra_state]);
nr_release_ra_UE(mac, rnti);
@@ -727,7 +739,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
NR_ServingCellConfigCommon_t *scc = mac->common_channels[0].ServingCellConfigCommon;
NR_UE_info_t *UE = find_ra_UE(&mac->UE_info, rnti);
if (!UE) {
LOG_E(NR_MAC, "UL SDU discarded. Couldn't finde UE with RNTI %04x \n", rnti);
LOG_D(NR_MAC, "UL SDU discarded. Couldn't find UE with RNTI %04x \n", rnti);
return;
}
@@ -771,16 +783,19 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
if (cfra) // no Msg3 on CFRA, no problem
return;
if (ra->ra_state != nrRA_WAIT_Msg3)
if (ra->ra_type == RA_4_STEP && ra->ra_state != nrRA_WAIT_Msg3)
return;
if((frame!=ra->Msg3_frame) || (slot!=ra->Msg3_slot))
if (ra->ra_type == RA_2_STEP && ra->ra_state != nrRA_WAIT_MsgA_PUSCH)
return;
if (ra->ra_type == RA_4_STEP && ((frame != ra->Msg3_frame) || (slot != ra->Msg3_slot)))
return;
if (ul_cqi != 0xff)
ra->msg3_TPC = nr_mac_get_tpc(&UE->UE_sched_ctrl.pusch_pc);
handle_msg3_failed_rx(mac, ra, rnti, mac->ul_bler.harq_round_max);
handle_msg3_failed_rx(mac, ra, UE->rnti, mac->ul_bler.harq_round_max);
return;
}
@@ -799,9 +814,9 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
if (no_sig) {
LOG_W(NR_MAC, "MSG3 ULSCH with no signal\n");
LOG_W(NR_MAC, "%s ULSCH with no signal\n", ra->ra_type == RA_2_STEP ? "MsgA-PUSCH" : "MSG3");
if (!cfra)
handle_msg3_failed_rx(mac, ra, rnti, mac->ul_bler.harq_round_max);
handle_msg3_failed_rx(mac, ra, UE->rnti, mac->ul_bler.harq_round_max);
return;
}
if (!cfra && ra->ra_type == RA_2_STEP) {