From 23695a52d7a916f124d56a0dccb2e80620fe5967 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Feb 2021 14:30:04 +0000 Subject: [PATCH 1/5] Fix stored node --- targets/ARCH/rfsimulator/stored_node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/ARCH/rfsimulator/stored_node.c b/targets/ARCH/rfsimulator/stored_node.c index dcea69b9dd..8b0b397995 100644 --- a/targets/ARCH/rfsimulator/stored_node.c +++ b/targets/ARCH/rfsimulator/stored_node.c @@ -186,14 +186,14 @@ int main(int argc, char *argv[]) { serviceSock=client_start(argv[2],atoi(argv[3])); } - uint64_t typeStamp=ENB_MAGICDL_FDD; + uint64_t typeStamp=ENB_MAGICDL; boolean_t raw=false; if ( argc == 5 ) { raw=true; if (strcmp(argv[4],"UL") == 0 ) - typeStamp=UE_MAGICDL_FDD; + typeStamp=UE_MAGICDL; } samplesBlockHeader_t header; From b6ab1eb9e1492d4666173a2cedee66b56716a92d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Feb 2021 15:34:15 +0000 Subject: [PATCH 2/5] Fix RA preamble shift at gNB --- openair1/PHY/NR_TRANSPORT/nr_prach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index b5a3c061e9..0fc2de2d0a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -681,7 +681,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, preamble_shift -= NCS; if (preamble_shift < 0) - preamble_shift+=N_ZC; + preamble_shift+=((N_ZC/NCS)*NCS); } } else { // This is the high-speed case new_dft = 0; From 4ea560f291a4cbead780228cfb1b8d5177d2ca92 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Feb 2021 16:01:05 +0000 Subject: [PATCH 3/5] Address review comments --- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/RRC/NR_UE/rrc_defs.h | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 61b5efe39c..8f234cb585 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -515,7 +515,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, uint8_t sdu_lcids[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0}; - int num_sdus, offset = 0; + int num_sdus = 0; + int offset = 0; // Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side if (!prach_resources->init_msg1) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 592086e2ba..06aa4e5699 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -465,7 +465,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, // random access pusch with TC-RNTI if (ra->rnti != current_rnti) { - LOG_W(MAC, + LOG_W(NR_MAC, "expected TC-RNTI %04x to match current RNTI %04x\n", ra->rnti, current_rnti); diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index fabc77399f..f4ce474657 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -78,14 +78,14 @@ typedef struct OAI_NR_UECapability_s { } OAI_NR_UECapability_t; typedef enum requested_SI_List_e { - SIB2 = 0x1, - SIB3 = 0x2, - SIB4 = 0x4, - SIB5 = 0x8, - SIB6 = 0x16, - SIB7 = 0x32, - SIB8 = 0x64, - SIB9 = 0x128 + SIB2 = 1, + SIB3 = 2, + SIB4 = 4, + SIB5 = 8, + SIB6 = 16, + SIB7 = 32, + SIB8 = 64, + SIB9 = 128 } requested_SI_List_t; // 3GPP TS 38.300 Section 9.2.6 From bed43a2a79fbe6dc476f12a47d5e41f9b5192cde Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Feb 2021 16:31:13 +0000 Subject: [PATCH 4/5] Address review comments --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 214abbce79..82855365c8 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1368,9 +1368,9 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) { rrcSetupRequest->rrcSetupRequest.spare.size=1; rrcSetupRequest->rrcSetupRequest.spare.bits_unused = 7; - //if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { + if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_ccch_msg); - //} + } enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_CCCH_Message, NULL, From 31cf9ab84760eea32a49f959420d46ef6645d286 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 23 Feb 2021 02:22:27 +0000 Subject: [PATCH 5/5] Fix ra->rnti --- openair1/PHY/defs_gNB.h | 1 + openair2/LAYER2/NR_MAC_gNB/config.c | 7 +++++++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 20 ++++++++++--------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index b7923adb0b..f3f212effb 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -655,6 +655,7 @@ typedef struct { int prach_I0; } PHY_MEASUREMENTS_gNB; +#define TOTAL_NUM_NR_PRACH_PREAMBLES 64 #define MAX_NUM_NR_RX_RACH_PDUS 4 #define MAX_NUM_NR_RX_PRACH_PREAMBLES 4 #define MAX_UL_PDUS_PER_SLOT 8 diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 6aa906b82b..6f6ea8a327 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -416,6 +416,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, for (int i = 0; i < num_preamble; i++) ra->preambles.preamble_list[i] = cfra.resources.choice.ssb->ssb_ResourceList.list.array[i]->ra_PreambleIndex; } + } else { + ra->cfra = false; + ra->rnti = rnti; + ra->preambles.num_preambles = TOTAL_NUM_NR_PRACH_PREAMBLES; + ra->preambles.preamble_list = (uint8_t *) malloc(TOTAL_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t)); + for (int i = 0; i < TOTAL_NUM_NR_PRACH_PREAMBLES; i++) + ra->preambles.preamble_list[i] = i; } LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti); } else { // secondaryCellGroup has been updated diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 037b0f16af..0b3492ccdc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -454,15 +454,11 @@ void nr_initiate_ra_proc(module_id_t module_idP, // if the preamble received correspond to one of the listed // the UE sent a RACH either for starting RA procedure or RA procedure failed and UE retries int pr_found=0; - if(ra->preambles.num_preambles > 0) { - for (int i = 0; i < ra->preambles.num_preambles; i++) { - if (preamble_index == ra->preambles.preamble_list[i]) { - pr_found=1; - break; - } + for (int i = 0; i < ra->preambles.num_preambles; i++) { + if (preamble_index == ra->preambles.preamble_list[i]) { + pr_found=1; + break; } - } else { - pr_found=1; } if (!pr_found) { @@ -487,7 +483,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, preamble_index, freq_index, symbol); - int loop = 0; + LOG_D(MAC, "Frame %d, Slot %d: Activating RA process \n", frameP, slotP); ra->state = Msg2; ra->timing_offset = timing_offset; @@ -514,6 +510,10 @@ void nr_initiate_ra_proc(module_id_t module_idP, ra->Msg2_slot = msg2_slot; LOG_I(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP); + + // TODO: Configure RRC with the new RNTI of the following commented lines + /* + int loop = 0; if (!ra->cfra) { do { ra->rnti = (taus() % 65518) + 1; @@ -525,6 +525,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, abort(); } } + */ + ra->RA_rnti = ra_rnti; ra->preamble_index = preamble_index; ra->beam_id = beam_index;