Commit 72aaf45f authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/race-ue-rrc-mac' into integration_2025_w02 (!3103)

Introduce ITTI queue in RRC-to-MAC direction

resolve ue rcc to mac race conditions by a itti queue, but it doesn't
resolve the problem of exact slot we should apply the new cell
configurtion
parents 4dfbd0dd 9d9902d8
......@@ -624,6 +624,14 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE,
if (UE->sl_mode == 2)
fp = &UE->SL_UE_PHY_PARAMS.sl_frame_params;
// process what RRC thread sent to MAC
MessageDef *msg = NULL;
do {
itti_poll_msg(TASK_MAC_UE, &msg);
if (msg)
process_msg_rcc_to_mac(msg);
} while (msg);
if (IS_SOFTMODEM_NOS1 || IS_SA_MODE(get_softmodem_params())) {
/* send tick to RLC and PDCP every ms */
if (proc->nr_slot_rx % fp->slots_per_subframe == 0) {
......@@ -868,10 +876,18 @@ void *UE_thread(void *arg)
syncRunning = false;
if (UE->is_synchronized) {
UE->synch_request.received_synch_request = 0;
if (UE->sl_mode == 2)
if (UE->sl_mode == SL_MODE2_SUPPORTED)
decoded_frame_rx = UE->SL_UE_PHY_PARAMS.sync_params.DFN;
else
else {
// We must wait the RRC layer decoded the MIB and sent us the frame number
MessageDef *msg = NULL;
itti_receive_msg(TASK_MAC_UE, &msg);
if (msg)
process_msg_rcc_to_mac(msg);
else
LOG_E(PHY, "It seems we arbort while trying to sync\n");
decoded_frame_rx = mac->mib_frame;
}
LOG_A(PHY,
"UE synchronized! decoded_frame_rx=%d UE->init_sync_frame=%d trashed_frames=%d\n",
decoded_frame_rx,
......
......@@ -52,6 +52,7 @@
#include "PHY_INTERFACE/phy_interface_vars.h"
#include "NR_IF_Module.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair2/RRC/NR_UE/L2_interface_ue.h"
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
......@@ -488,6 +489,12 @@ int main(int argc, char **argv)
get_softmodem_params()->numerology,
nr_band);
} else {
MessageDef *msg = NULL;
do {
itti_poll_msg(TASK_MAC_UE, &msg);
if (msg)
process_msg_rcc_to_mac(msg);
} while (msg);
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
}
......
......@@ -3,7 +3,7 @@
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "openair1/PHY/defs_nr_UE.h"
#include "position_interface.h"
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return (0); }
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) { return (0); }
......@@ -19,7 +19,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t
int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; }
int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { return 0; }
int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; }
void get_position_coordinates(int Mod_id, position_t *position) {}
int32_t get_uldl_offset(int nr_bandP) { return (0); }
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {}
......
......@@ -43,7 +43,6 @@ Description Defines the messages supported by the Access Stratum sublayer
#include "commonDef.h"
#include "networkDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
......
......@@ -82,6 +82,13 @@ MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, dl_info_transfer_ind_t,
MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process)
MESSAGE_DEF(NRRRC_FRAME_PROCESS, MESSAGE_PRIORITY_MED, NRRrcFrameProcess, nr_rrc_frame_process)
// UE: RRC -> MAC messages
MESSAGE_DEF(NR_MAC_RRC_CONFIG_RESET, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_reset_t, nr_mac_rrc_config_reset)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_CG, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_cg_t, nr_mac_rrc_config_cg)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_MIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_mib_t, nr_mac_rrc_config_mib)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_SIB1, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_sib1_t, nr_mac_rrc_config_sib1)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_OTHER_SIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_other_sib_t, nr_mac_rrc_config_other_sib)
// eNB: RLC -> RRC messages
MESSAGE_DEF(RLC_SDU_INDICATION, MESSAGE_PRIORITY_MED, RlcSduIndication, rlc_sdu_indication)
MESSAGE_DEF(NAS_PDU_SESSION_REQ, MESSAGE_PRIORITY_MED, nas_pdu_session_req_t, nas_pdu_session_req)
......
......@@ -96,12 +96,16 @@
#define NAS_OAI_TUN_NSA(mSGpTR) (mSGpTR)->ittiMsg.nas_oai_tun_nsa
#define NAS_PDU_SESSION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_pdu_session_req
#define NR_MAC_RRC_CONFIG_RESET(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_reset
#define NR_MAC_RRC_CONFIG_CG(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_cg
#define NR_MAC_RRC_CONFIG_MIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_mib
#define NR_MAC_RRC_CONFIG_SIB1(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_sib1
#define NR_MAC_RRC_CONFIG_OTHER_SIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_other_sib
#define NR_RRC_RLC_MAXRTX(mSGpTR) (mSGpTR)->ittiMsg.nr_rlc_maxrtx_indication
//-------------------------------------------------------------------------------------------//
typedef struct RrcStateInd_s {
Rrc_State_t state;
Rrc_State_t state;
Rrc_Sub_State_t sub_state;
} RrcStateInd;
......@@ -459,4 +463,23 @@ typedef struct {
int ue_id;
} RlcMaxRtxIndication;
#include "openair2/RRC/NR_UE/rrc_defs.h"
typedef struct {
NR_ReestablishmentCause_t cause;
} nr_mac_rrc_config_reset_t;
typedef struct {
NR_CellGroupConfig_t *cellGroupConfig;
NR_UE_NR_Capability_t *UE_NR_Capability;
} nr_mac_rrc_config_cg_t;
typedef struct {
NR_BCCH_BCH_Message_t *bcch;
int get_sib;
} nr_mac_rrc_config_mib_t;
typedef struct {
NR_SIB1_t *sib1;
} nr_mac_rrc_config_sib1_t;
typedef struct {
NR_SIB19_r17_t *sib19;
} nr_mac_rrc_config_other_sib_t;
#endif /* RRC_MESSAGES_TYPES_H_ */
......@@ -1704,17 +1704,19 @@ static void configure_si_schedulingInfo(NR_UE_MAC_INST_t *mac,
}
}
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP,
NR_SI_SchedulingInfo_t *si_SchedulingInfo,
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700,
NR_ServingCellConfigCommonSIB_t *scc)
void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
int ret = pthread_mutex_lock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
NR_SI_SchedulingInfo_t *si_SchedulingInfo = sib1->si_SchedulingInfo;
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700 = NULL;
if (sib1->nonCriticalExtension && sib1->nonCriticalExtension->nonCriticalExtension
&& sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension) {
si_SchedulingInfo_v1700 = sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700;
}
NR_ServingCellConfigCommonSIB_t *scc = sib1->servingCellConfigCommon;
AssertFatal(scc, "SIB1 SCC should not be NULL\n");
UPDATE_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t);
configure_si_schedulingInfo(mac, si_SchedulingInfo, si_SchedulingInfo_v1700);
mac->n_ta_offset = get_ta_offset(scc->n_TimingAdvanceOffset);
......@@ -1749,7 +1751,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
}
// computes delay between ue and sat based on SIB19 ephemeris data
static double calculate_ue_sat_ta(const position_t *position_params, struct NR_PositionVelocity_r17 *sat_pos)
static double calculate_ue_sat_ta(const position_t *position_params, NR_PositionVelocity_r17_t *sat_pos)
{
// get UE position coordinates
double posx = position_params->positionX;
......@@ -1768,39 +1770,45 @@ static double calculate_ue_sat_ta(const position_t *position_params, struct NR_P
return ta_ms;
}
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const position_t *pos, NR_SIB19_r17_t *sib19_r17)
void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
int ret = pthread_mutex_lock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
// update ntn_Config_r17 with received values
struct NR_NTN_Config_r17 *ntn_Config_r17 = mac->sc_info.ntn_Config_r17;
UPDATE_IE(ntn_Config_r17, sib19_r17->ntn_Config_r17, NR_NTN_Config_r17_t);
// populate ntn_ta structure from mac
// if ephemerisInfo_r17 present in SIB19
struct NR_EphemerisInfo_r17 *ephemeris_info = ntn_Config_r17->ephemerisInfo_r17;
if (ephemeris_info) {
struct NR_PositionVelocity_r17 *position_velocity = ephemeris_info->choice.positionVelocity_r17;
if (position_velocity
&& (position_velocity->positionX_r17 != 0 || position_velocity->positionY_r17 != 0
|| position_velocity->positionZ_r17 != 0)) {
mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(pos, position_velocity);
}
}
// if cellSpecificKoffset_r17 is present
if (ntn_Config_r17->cellSpecificKoffset_r17) {
mac->ntn_ta.cell_specific_k_offset = *ntn_Config_r17->cellSpecificKoffset_r17;
}
// Check if ta_Info_r17 is present and convert directly ta_Common_r17 (is in units of 4.072e-3 µs)
if (ntn_Config_r17->ta_Info_r17) {
mac->ntn_ta.N_common_ta_adj = ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6;
// ta_CommonDrift_r17 (is in units of 0.2e-3 µs/s)
if (ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17)
mac->ntn_ta.ntn_ta_commondrift = *ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17 * 0.2e-3;
}
mac->ntn_ta.ntn_params_changed = true;
if (sib19) {
// update ntn_Config_r17 with received values
NR_NTN_Config_r17_t *ntn_Config_r17 = mac->sc_info.ntn_Config_r17;
UPDATE_IE(ntn_Config_r17, sib19->ntn_Config_r17, NR_NTN_Config_r17_t);
position_t position_params = {0};
get_position_coordinates(module_id, &position_params);
// populate ntn_ta structure from mac
// if ephemerisInfo_r17 present in SIB19
NR_EphemerisInfo_r17_t *ephemeris_info = ntn_Config_r17->ephemerisInfo_r17;
if (ephemeris_info) {
NR_PositionVelocity_r17_t *position_velocity = ephemeris_info->choice.positionVelocity_r17;
if (position_velocity
&& (position_velocity->positionX_r17 != 0
|| position_velocity->positionY_r17 != 0
|| position_velocity->positionZ_r17 != 0)) {
mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(&position_params, position_velocity);
}
}
// if cellSpecificKoffset_r17 is present
if (ntn_Config_r17->cellSpecificKoffset_r17) {
mac->ntn_ta.cell_specific_k_offset = *ntn_Config_r17->cellSpecificKoffset_r17;
}
// Check if ta_Info_r17 is present and convert directly ta_Common_r17 (is in units of 4.072e-3 µs)
if (ntn_Config_r17->ta_Info_r17) {
mac->ntn_ta.N_common_ta_adj = ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6;
// ta_CommonDrift_r17 (is in units of 0.2e-3 µs/s)
if (ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17)
mac->ntn_ta.ntn_ta_commondrift = *ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17 * 0.2e-3;
}
mac->ntn_ta.ntn_params_changed = true;
}
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
......
......@@ -85,14 +85,10 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
NR_MIB_t *mibP,
int sched_sib1);
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP,
NR_SI_SchedulingInfo_t *si_SchedulingInfo,
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700,
NR_ServingCellConfigCommonSIB_t *scc);
void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1);
struct position; /* forward declaration */
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const struct position *pos, NR_SIB19_r17_t *sib19_r17);
void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19_r17);
void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause);
......
......@@ -597,6 +597,14 @@ static int nr_ue_process_dci_ul_01(NR_UE_MAC_INST_t *mac,
dci_ind->rnti,
dci_ind->ss_type,
NR_UL_DCI_FORMAT_0_1);
LOG_D(NR_MAC_DCI,
"add ul dci harq %d for %d.%d %d.%d round %d\n",
pdu->pusch_config_pdu.pusch_data.harq_process_id,
frame,
slot,
frame_tx,
slot_tx,
0);
if (ret != 0)
remove_ul_config_last_item(pdu);
release_ul_config(pdu, false);
......
......@@ -2629,7 +2629,15 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
dci_pdu_rel15_t uldci_payload;
memset(&uldci_payload, 0, sizeof(uldci_payload));
if (current_BWP->dci_format == NR_UL_DCI_FORMAT_0_1)
LOG_D(NR_MAC_DCI,
"add ul dci harq %d for %d.%d %d.%d round %d\n",
harq_id,
frame,
slot,
sched_pusch->frame,
sched_pusch->slot,
sched_ctrl->ul_harq_processes[harq_id].round);
config_uldci(&UE->sc_info,
pusch_pdu,
&uldci_payload,
......
......@@ -1206,11 +1206,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info)
return 0;
}
static uint32_t nr_ue_dl_processing(nr_downlink_indication_t *dl_info)
static uint32_t nr_ue_dl_processing(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info)
{
uint32_t ret_mask = 0x0;
DevAssert(dl_info != NULL);
NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id);
DevAssert(mac != NULL && dl_info != NULL);
// DL indication after reception of DCI or DL PDU
if (dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) {
......@@ -1322,7 +1321,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
nr_ue_dl_scheduler(mac, dl_info);
else
// DL indication to process data channels
ret2 = nr_ue_dl_processing(dl_info);
ret2 = nr_ue_dl_processing(mac, dl_info);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
return ret2;
......
......@@ -121,6 +121,34 @@ void nr_mac_rrc_data_ind_ue(const module_id_t module_id,
}
}
void process_msg_rcc_to_mac(MessageDef *msg)
{
instance_t ue_id = ITTI_MSG_DESTINATION_INSTANCE(msg);
switch (ITTI_MSG_ID(msg)) {
case NR_MAC_RRC_CONFIG_RESET:
nr_rrc_mac_config_req_reset(ue_id, NR_MAC_RRC_CONFIG_RESET(msg).cause);
break;
case NR_MAC_RRC_CONFIG_CG:
nr_rrc_mac_config_req_cg(ue_id, 0, NR_MAC_RRC_CONFIG_CG(msg).cellGroupConfig, NR_MAC_RRC_CONFIG_CG(msg).UE_NR_Capability);
asn1cFreeStruc(asn_DEF_NR_CellGroupConfig, NR_MAC_RRC_CONFIG_CG(msg).cellGroupConfig);
break;
case NR_MAC_RRC_CONFIG_MIB:
nr_rrc_mac_config_req_mib(ue_id, 0, NR_MAC_RRC_CONFIG_MIB(msg).bcch->message.choice.mib, NR_MAC_RRC_CONFIG_MIB(msg).get_sib);
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, NR_MAC_RRC_CONFIG_MIB(msg).bcch);
break;
case NR_MAC_RRC_CONFIG_SIB1: {
NR_SIB1_t *sib1 = NR_MAC_RRC_CONFIG_SIB1(msg).sib1;
nr_rrc_mac_config_req_sib1(ue_id, 0, sib1);
SEQUENCE_free(&asn_DEF_NR_SIB1, NR_MAC_RRC_CONFIG_SIB1(msg).sib1, ASFM_FREE_EVERYTHING);
} break;
case NR_MAC_RRC_CONFIG_OTHER_SIB:
nr_rrc_mac_config_other_sib(ue_id, NR_MAC_RRC_CONFIG_OTHER_SIB(msg).sib19);
break;
default:
LOG_E(NR_MAC, "Unexpected msg from RRC: %d\n", ITTI_MSG_ID(msg));
}
}
void nr_mac_rrc_inactivity_timer_ind(const module_id_t mod_id)
{
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_INAC_IND);
......
......@@ -41,5 +41,6 @@ void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, int gnb_id);
void nr_ue_rrc_timer_trigger(int instance, int frame, int gnb_id);
void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success);
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, Rrc_Msg_Type_t msg_type);
void process_msg_rcc_to_mac(MessageDef *msg);
#endif
This diff is collapsed.
......@@ -104,53 +104,59 @@ typedef enum RA_trigger_e {
BEAM_FAILURE_RECOVERY,
} RA_trigger_t;
typedef enum {
SIB_NOT_VALID,
SIB_VALID,
SIB_REQUESTED,
} SIB_validity_t;
typedef struct UE_RRC_SI_INFO_NR_r17_s {
uint32_t default_otherSI_map_r17;
bool sib15_validity;
SIB_validity_t sib15_validity;
NR_timer_t sib15_timer;
bool sib16_validity;
SIB_validity_t sib16_validity;
NR_timer_t sib16_timer;
bool sib17_validity;
SIB_validity_t sib17_validity;
NR_timer_t sib17_timer;
bool sib18_validity;
SIB_validity_t sib18_validity;
NR_timer_t sib18_timer;
bool sib19_validity;
SIB_validity_t sib19_validity;
NR_timer_t sib19_timer;
bool sib20_validity;
SIB_validity_t sib20_validity;
NR_timer_t sib20_timer;
bool sib21_validity;
SIB_validity_t sib21_validity;
NR_timer_t sib21_timer;
} NR_UE_RRC_SI_INFO_r17;
typedef struct UE_RRC_SI_INFO_NR_s {
uint32_t default_otherSI_map;
bool sib1_validity;
SIB_validity_t sib1_validity;
NR_timer_t sib1_timer;
bool sib2_validity;
SIB_validity_t sib2_validity;
NR_timer_t sib2_timer;
bool sib3_validity;
SIB_validity_t sib3_validity;
NR_timer_t sib3_timer;
bool sib4_validity;
SIB_validity_t sib4_validity;
NR_timer_t sib4_timer;
bool sib5_validity;
SIB_validity_t sib5_validity;
NR_timer_t sib5_timer;
bool sib6_validity;
SIB_validity_t sib6_validity;
NR_timer_t sib6_timer;
bool sib7_validity;
SIB_validity_t sib7_validity;
NR_timer_t sib7_timer;
bool sib8_validity;
SIB_validity_t sib8_validity;
NR_timer_t sib8_timer;
bool sib9_validity;
SIB_validity_t sib9_validity;
NR_timer_t sib9_timer;
bool sib10_validity;
SIB_validity_t sib10_validity;
NR_timer_t sib10_timer;
bool sib11_validity;
SIB_validity_t sib11_validity;
NR_timer_t sib11_timer;
bool sib12_validity;
SIB_validity_t sib12_validity;
NR_timer_t sib12_timer;
bool sib13_validity;
SIB_validity_t sib13_validity;
NR_timer_t sib13_timer;
bool sib14_validity;
SIB_validity_t sib14_validity;
NR_timer_t sib14_timer;
NR_UE_RRC_SI_INFO_r17 SInfo_r17;
} NR_UE_RRC_SI_INFO;
......@@ -196,8 +202,6 @@ typedef struct rrcPerNB {
NR_RSRP_Range_t s_measure;
} rrcPerNB_t;
/* forward declaration */
struct position;
typedef struct NR_UE_RRC_INST_s {
instance_t ue_id;
rrcPerNB_t perNB[NB_CNX_UE];
......@@ -237,9 +241,6 @@ typedef struct NR_UE_RRC_INST_s {
bool reconfig_after_reestab;
//Sidelink params
NR_SL_PreconfigurationNR_r16_t *sl_preconfig;
struct position *position_coordinates;
} NR_UE_RRC_INST_t;
#endif
......@@ -43,83 +43,33 @@ void init_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
nr_timer_setup(&SInfo->SInfo_r17.sib19_timer, 10800000, 10);
}
void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
static SIB_validity_t check_sib_timer_validity(SIB_validity_t sib_validity, NR_timer_t *sib_timer)
{
if (SInfo->sib1_validity) {
bool sib1_expired = nr_timer_tick(&SInfo->sib1_timer);
if (sib1_expired)
SInfo->sib1_validity = false;
}
if (SInfo->sib2_validity) {
bool sib2_expired = nr_timer_tick(&SInfo->sib2_timer);
if (sib2_expired)
SInfo->sib2_validity = false;
}
if (SInfo->sib3_validity) {
bool sib3_expired = nr_timer_tick(&SInfo->sib3_timer);
if (sib3_expired)
SInfo->sib3_validity = false;
}
if (SInfo->sib4_validity) {
bool sib4_expired = nr_timer_tick(&SInfo->sib4_timer);
if (sib4_expired)
SInfo->sib4_validity = false;
}
if (SInfo->sib5_validity) {
bool sib5_expired = nr_timer_tick(&SInfo->sib5_timer);
if (sib5_expired)
SInfo->sib5_validity = false;
}
if (SInfo->sib6_validity) {
bool sib6_expired = nr_timer_tick(&SInfo->sib6_timer);
if (sib6_expired)
SInfo->sib6_validity = false;
}
if (SInfo->sib7_validity) {
bool sib7_expired = nr_timer_tick(&SInfo->sib7_timer);
if (sib7_expired)
SInfo->sib7_validity = false;
}
if (SInfo->sib8_validity) {
bool sib8_expired = nr_timer_tick(&SInfo->sib8_timer);
if (sib8_expired)
SInfo->sib8_validity = false;
}
if (SInfo->sib9_validity) {
bool sib9_expired = nr_timer_tick(&SInfo->sib9_timer);
if (sib9_expired)
SInfo->sib9_validity = false;
}
if (SInfo->sib10_validity) {
bool sib10_expired = nr_timer_tick(&SInfo->sib10_timer);
if (sib10_expired)
SInfo->sib10_validity = false;
}
if (SInfo->sib11_validity) {
bool sib11_expired = nr_timer_tick(&SInfo->sib11_timer);
if (sib11_expired)
SInfo->sib11_validity = false;
}
if (SInfo->sib12_validity) {
bool sib12_expired = nr_timer_tick(&SInfo->sib12_timer);
if (sib12_expired)
SInfo->sib12_validity = false;
}
if (SInfo->sib13_validity) {
bool sib13_expired = nr_timer_tick(&SInfo->sib13_timer);
if (sib13_expired)
SInfo->sib13_validity = false;
}
if (SInfo->sib14_validity) {
bool sib14_expired = nr_timer_tick(&SInfo->sib14_timer);
if (sib14_expired)
SInfo->sib14_validity = false;
}
if (SInfo->SInfo_r17.sib19_validity) {
bool sib19_expired = nr_timer_tick(&SInfo->SInfo_r17.sib19_timer);
if (sib19_expired)
SInfo->SInfo_r17.sib19_validity = false;
if (sib_validity == SIB_VALID) {
bool sib_expired = nr_timer_tick(sib_timer);
if (sib_expired)
return SIB_NOT_VALID;
}
return sib_validity;
}
void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
{
SInfo->sib1_validity = check_sib_timer_validity(SInfo->sib1_validity, &SInfo->sib1_timer);
SInfo->sib2_validity = check_sib_timer_validity(SInfo->sib2_validity, &SInfo->sib2_timer);
SInfo->sib3_validity = check_sib_timer_validity(SInfo->sib3_validity, &SInfo->sib3_timer);
SInfo->sib4_validity = check_sib_timer_validity(SInfo->sib4_validity, &SInfo->sib4_timer);
SInfo->sib5_validity = check_sib_timer_validity(SInfo->sib5_validity, &SInfo->sib5_timer);
SInfo->sib6_validity = check_sib_timer_validity(SInfo->sib6_validity, &SInfo->sib6_timer);
SInfo->sib7_validity = check_sib_timer_validity(SInfo->sib7_validity, &SInfo->sib7_timer);
SInfo->sib8_validity = check_sib_timer_validity(SInfo->sib8_validity, &SInfo->sib8_timer);
SInfo->sib9_validity = check_sib_timer_validity(SInfo->sib9_validity, &SInfo->sib9_timer);
SInfo->sib10_validity = check_sib_timer_validity(SInfo->sib10_validity, &SInfo->sib10_timer);
SInfo->sib11_validity = check_sib_timer_validity(SInfo->sib11_validity, &SInfo->sib11_timer);
SInfo->sib12_validity = check_sib_timer_validity(SInfo->sib12_validity, &SInfo->sib12_timer);
SInfo->sib13_validity = check_sib_timer_validity(SInfo->sib13_validity, &SInfo->sib13_timer);
SInfo->sib14_validity = check_sib_timer_validity(SInfo->sib14_validity, &SInfo->sib14_timer);
SInfo->SInfo_r17.sib19_validity = check_sib_timer_validity(SInfo->SInfo_r17.sib19_validity, &SInfo->SInfo_r17.sib19_timer);
}
void nr_rrc_handle_timers(NR_UE_RRC_INST_t *rrc)
......
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