Commit b91fd94b authored by Sakthivel Velumani's avatar Sakthivel Velumani

Fix Msg4 false feedback in UE

after msg4 successful reception, the UE for some time (5 frames)
continues to monitor the RA search space in case the gNB sends msg4
retransmission.
parent 883724b9
......@@ -245,11 +245,12 @@ typedef struct {
typedef enum {
nrRA_UE_IDLE = 0,
nrRA_GENERATE_PREAMBLE = 1,
nrRA_WAIT_RAR = 2,
nrRA_WAIT_CONTENTION_RESOLUTION = 3,
nrRA_SUCCEEDED = 4,
nrRA_FAILED = 5
nrRA_GENERATE_PREAMBLE,
nrRA_WAIT_RAR,
nrRA_WAIT_CONTENTION_RESOLUTION,
nrRA_MSG4_RETX,
nrRA_SUCCEEDED,
nrRA_FAILED
} nrRA_UE_state_t;
static const char *const nrra_ue_text[] =
......@@ -332,6 +333,8 @@ typedef struct {
/// Random-access Contention Resolution Timer
NR_timer_t contention_resolution_timer;
/// Msg4 complete timer. To wait for Msg4 false retx from gNB.
NR_timer_t msg4_retx_timer;
/// Transmitted UE Contention Resolution Identifier
uint8_t cont_res_id[6];
......
......@@ -821,13 +821,16 @@ void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const uint8_t gNB_index, const frame
LOG_A(MAC, "[UE %d][%d.%d][RAPROC] RA procedure succeeded. CB-RA: Contention Resolution is successful.\n", mac->ue_id, frame, slot);
nr_timer_stop(&ra->contention_resolution_timer);
mac->crnti = ra->t_crnti;
ra->t_crnti = 0;
LOG_D(MAC, "[UE %d][%d.%d] CB-RA: cleared contention resolution timer...\n", mac->ue_id, frame, slot);
}
LOG_D(MAC, "[UE %d] clearing RA_active flag...\n", mac->ue_id);
ra->RA_active = 0;
ra->ra_state = nrRA_SUCCEEDED;
ra->ra_state = nrRA_MSG4_RETX;
long mu = mac->current_UL_BWP->scs;
int slots_per_frame = nr_slots_per_frame[mu];
nr_timer_setup(&ra->msg4_retx_timer, 5 * slots_per_frame, 1);
nr_timer_start(&ra->msg4_retx_timer);
mac->state = UE_CONNECTED;
free_and_zero(ra->Msg3_buffer);
nr_mac_rrc_ra_ind(mac->ue_id, frame, true);
......
......@@ -514,6 +514,10 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
config_dci_pdu(mac, dl_config, rnti_type, slot, pdcch_config->ra_SS);
}
} else if (mac->state == UE_CONNECTED) {
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, pdcch_config->ra_SS) && mac->ra.ra_state == nrRA_MSG4_RETX) {
int rnti_type = TYPE_TC_RNTI_;
config_dci_pdu(mac, dl_config, rnti_type, slot, pdcch_config->ra_SS);
}
for (int i = 0; i < pdcch_config->list_SS.count; i++) {
NR_SearchSpace_t *ss = pdcch_config->list_SS.array[i];
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, ss))
......
......@@ -159,6 +159,11 @@ void update_mac_timers(NR_UE_MAC_INST_t *mac)
AssertFatal(!nr_timer_tick(&mac->scheduling_info.lc_sched_info[i].Bj_timer),
"Bj timer for LCID %d expired! That should never happen\n",
i);
if (nr_timer_tick(&mac->ra.msg4_retx_timer)) {
mac->ra.t_crnti = 0;
mac->ra.ra_state = nrRA_SUCCEEDED;
nr_timer_stop(&mac->ra.msg4_retx_timer);
}
}
void remove_ul_config_last_item(fapi_nr_ul_config_request_pdu_t *pdu)
......
......@@ -1119,9 +1119,9 @@ void update_harq_status(NR_UE_MAC_INST_t *mac, uint8_t harq_pid, uint8_t ack_nac
if (current_harq->active) {
LOG_D(PHY,"Updating harq_status for harq_id %d, ack/nak %d\n", harq_pid, current_harq->ack);
// we can prepare feedback for MSG4 in advance
if (mac->ra.ra_state == nrRA_WAIT_CONTENTION_RESOLUTION)
if ((mac->ra.ra_state == nrRA_WAIT_CONTENTION_RESOLUTION) || (mac->ra.ra_state == nrRA_MSG4_RETX)) {
prepare_msg4_feedback(mac, harq_pid, ack_nack);
else {
} else {
current_harq->ack = ack_nack;
current_harq->ack_received = true;
}
......
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