From c8ed1a21a2cc609b2ce601d320367ca52fff16bd Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 26 Nov 2021 09:38:57 +0000 Subject: [PATCH] Minor cosmetic improvements --- openair2/LAYER2/NR_MAC_gNB/config.c | 14 +++++++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a0b7ef8f0d..d4ce9a077c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -520,13 +520,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[0]; RC.nrmac[Mod_idP]->sib1_tda = sib1_tda; for (int n=0;nra[n].cfra = false; - cc->ra[n].msg3_dcch_dtch = false; - cc->ra[n].rnti = 0; - cc->ra[n].preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES; - cc->ra[n].preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t)); - for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) - cc->ra[n].preambles.preamble_list[i] = i; + cc->ra[n].cfra = false; + cc->ra[n].msg3_dcch_dtch = false; + cc->ra[n].rnti = 0; + cc->ra[n].preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES; + cc->ra[n].preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t)); + for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) + cc->ra[n].preambles.preamble_list[i] = i; } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 843f2368bd..25aeea70a6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1405,8 +1405,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg4\n"); - // If UE is known by the network, to use C-RNTI instead of TC-RNTI rnti_t tc_rnti = ra->rnti; + // If UE is known by the network, C-RNTI to be used instead of TC-RNTI if(ra->msg3_dcch_dtch) { ra->rnti = ra->crnti; } @@ -1759,6 +1759,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra LOG_D(NR_MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); if(ra->msg3_dcch_dtch) { + // If the UE used MSG3 to transfer a DCCH or DTCH message, then contention resolution is successful upon transmission of PDCCH LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti); nr_clear_ra_proc(module_idP, CC_id, frameP, ra); UE_info->active[UE_id] = true;