move MSG3-C-RNTI flag from RA to MAC structure otherwise it would be reset by RA initialization

This commit is contained in:
francescomani
2025-03-12 10:30:18 +01:00
parent 96f1a2d474
commit fc0d762407
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -349,7 +349,6 @@ typedef struct {
// initial Random Access Preamble power
int preambleRxTargetPower;
int msg3_deltaPreamble;
bool msg3_C_RNTI;
int preambleReceivedTargetPower_config;
/// Random-access Contention Resolution Timer
NR_timer_t contention_resolution_timer;
@@ -637,6 +636,7 @@ typedef struct NR_UE_MAC_INST_s {
int f_b_f_c;
bool pusch_power_control_initialized;
int delta_msg2;
bool msg3_C_RNTI;
pthread_mutex_t if_mutex;
ue_mac_stats_t stats;
} NR_UE_MAC_INST_t;
+1
View File
@@ -69,6 +69,7 @@ void nr_ue_init_mac(NR_UE_MAC_INST_t *mac)
mac->p_Max = INT_MIN;
mac->p_Max_alt = INT_MIN;
mac->n_ta_offset = -1;
mac->msg3_C_RNTI = false;
mac->ntn_ta.ntn_params_changed = false;
reset_mac_inst(mac);
+3 -4
View File
@@ -879,7 +879,6 @@ bool init_RA(NR_UE_MAC_INST_t *mac, int frame)
// Random acces procedure initialization
mac->state = UE_PERFORMING_RA;
ra->RA_active = true;
ra->msg3_C_RNTI = false;
NR_PRACH_RESOURCES_t *prach_resources = &ra->prach_resources;
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
// flush MSG3 buffer
@@ -1142,7 +1141,7 @@ void nr_get_Msg3_MsgA_PUSCH_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS
}
uint8_t *pdu = buf;
if (ra->msg3_C_RNTI)
if (mac->msg3_C_RNTI)
pdu = fill_msg3_crnti_pdu(ra, pdu, mac->crnti);
else
pdu = fill_msg3_pdu_from_rlc(mac, pdu, TBS_max);
@@ -1189,7 +1188,7 @@ void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const uint8_t gNB_index, const frame
}
ra->RA_active = false;
ra->msg3_C_RNTI = false;
mac->msg3_C_RNTI = false;
ra->ra_state = nrRA_SUCCEEDED;
mac->state = UE_CONNECTED;
free_and_zero(ra->Msg3_buffer);
@@ -1257,7 +1256,7 @@ void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac, dci_pdu_rel15_t *pdcch_order)
mac->state = UE_PERFORMING_RA;
reset_ra(mac, false);
RA_config_t *ra = &mac->ra;
ra->msg3_C_RNTI = true;
mac->msg3_C_RNTI = true;
if (pdcch_order) {
ra->pdcch_order.active = true;
ra->pdcch_order.preamble_index = pdcch_order->ra_preamble_index;
+1 -1
View File
@@ -3952,7 +3952,7 @@ static void handle_rar_reception(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t
if (!ra->cfra) {
ra->t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
rnti = ra->t_crnti;
if (!ra->msg3_C_RNTI)
if (!mac->msg3_C_RNTI)
nr_mac_rrc_msg3_ind(mac->ue_id, rnti, dlinfo->gNB_index);
}
fapi_nr_ul_config_request_pdu_t *pdu = lockGet_ul_config(mac, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
+1 -1
View File
@@ -1121,7 +1121,7 @@ static nr_dci_format_t handle_dci(NR_UE_MAC_INST_t *mac,
// if notification of a reception of a PDCCH transmission of the SpCell is received from lower layers
// if the C-RNTI MAC CE was included in Msg3
// consider this Contention Resolution successful
if (mac->ra.msg3_C_RNTI && mac->ra.ra_state == nrRA_WAIT_CONTENTION_RESOLUTION)
if (mac->msg3_C_RNTI && mac->ra.ra_state == nrRA_WAIT_CONTENTION_RESOLUTION)
nr_ra_succeeded(mac, gNB_index, frame, slot);
// suspend RAR response window timer