From 681706b6da8f5f35a22234c645776b6a8383c819 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 18 Jan 2021 20:11:51 +0000 Subject: [PATCH] Define RA_trigger --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 13 +++++++++++++ openair2/LAYER2/NR_MAC_UE/config_ue.c | 3 ++- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 ++ openair2/RRC/NR_UE/rrc_UE.c | 9 ++++----- openair2/RRC/NR_UE/rrc_defs.h | 17 ++--------------- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index e41ca67229..e13ae1424c 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -160,6 +160,19 @@ typedef struct Type0_PDCCH_CSS_config_s { uint32_t cset_start_rb; } NR_Type0_PDCCH_CSS_config_t; +// 3GPP TS 38.300 Section 9.2.6 +typedef enum RA_trigger_e { + RA_NOT_RUNNING, + INITIAL_ACCESS_FROM_RRC_IDLE, + RRC_CONNECTION_REESTABLISHMENT, + DURING_HANDOVER, + NON_SYNCHRONISED, + TRANSITION_FROM_RRC_INACTIVE, + TO_ESTABLISH_TA, + REQUEST_FOR_OTHER_SI, + BEAM_FAILURE_RECOVERY, +} RA_trigger_t; + uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); void get_frame_type(uint16_t nr_bandP, uint8_t scs_index, lte_frame_type_t *current_type); diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 20fe84d819..e9ebd16d0f 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -272,8 +272,9 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } // PRACH configuration - uint8_t nb_preambles = 64; + mac->ra_trigger = RA_NOT_RUNNING; + if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL) nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 6bbbc00c00..fefe712e43 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -185,6 +185,8 @@ typedef struct { /* Random Access parameters */ /// state of RA procedure RA_state_t ra_state; + /// trigger of RA procedure + RA_trigger_t ra_trigger; /// RA rx frame offset: compensate RA rx offset introduced by OAI gNB. uint8_t RA_offset; /// RA-rnti diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index ef5a494c9f..2fcf9b93fc 100755 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -413,8 +413,6 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ NR_UE_rrc_inst[nr_ue].requested_SI_List.size= 4; NR_UE_rrc_inst[nr_ue].requested_SI_List.bits_unused= 0; - NR_UE_rrc_inst[nr_ue].do_ra = RA_NOT_RUNNING; - // init RRC lists RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].RLC_Bearer_Config_list, NR_maxLC_ID); RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].SchedulingRequest_list, NR_maxNrofSR_ConfigPerCellGroup); @@ -1531,13 +1529,14 @@ int8_t check_requested_SI_List(module_id_t module_id, BIT_STRING_t requested_SI_ if(do_ra) { - NR_UE_rrc_inst[module_id].do_ra = REQUEST_FOR_OTHER_SI; + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + mac->ra_trigger = REQUEST_FOR_OTHER_SI; get_softmodem_params()->do_ra = 1; if(sib1.si_SchedulingInfo->si_RequestConfig) { - LOG_I(RRC, "Trigger contention-free RA procedure (do_ra = %i)\n", NR_UE_rrc_inst[module_id].do_ra); + LOG_I(RRC, "Trigger contention-free RA procedure (ra_trigger = %i)\n", mac->ra_trigger); } else { - LOG_I(RRC, "Trigger contention-based RA procedure (do_ra = %i)\n", NR_UE_rrc_inst[module_id].do_ra); + LOG_I(RRC, "Trigger contention-based RA procedure (ra_trigger = %i)\n", mac->ra_trigger); } } diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index d736d507c8..0283ade69c 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -89,18 +89,6 @@ typedef enum requested_SI_List_e { SIB9 = 0x128 } requested_SI_List_t; -typedef enum trigger_RA_List_e { - RA_NOT_RUNNING, - INITIAL_ACCESS_FROM_RRC_IDLE, - RRC_CONNECTION_REESTABLISHMENT, - DURING_HANDOVER, - NON_SYNCHRONISED, - TRANSITION_FROM_RRC_INACTIVE, - TO_ESTABLISH_TA, - REQUEST_FOR_OTHER_SI, - BEAM_FAILURE_RECOVERY, -} trigger_RA_List_t; - typedef struct NR_UE_RRC_INST_s { NR_MeasConfig_t *meas_config; @@ -123,11 +111,10 @@ typedef struct NR_UE_RRC_INST_s { NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; uint8_t MBMS_flag; - OAI_NR_UECapability_t *UECap; - uint8_t *UECapability; + OAI_NR_UECapability_t *UECap; + uint8_t *UECapability; uint8_t UECapability_size; - trigger_RA_List_t do_ra; BIT_STRING_t requested_SI_List; NR_SystemInformation_t *si[NB_CNX_UE];