From 01369343e6762896bb56b2b6c3c7b0af4a3b7758 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 16 Dec 2022 14:57:25 +0100 Subject: [PATCH] flag to set sib1 decoded status --- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index e5fe2e377f..cfab676865 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -385,6 +385,7 @@ typedef struct { long physCellId; //// MAC config int first_sync_frame; + bool sib1_decoded; NR_DRX_Config_t *drx_Config; NR_SchedulingRequestConfig_t *schedulingRequestConfig; NR_BSR_Config_t *bsr_Config; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 1e254ded42..e9eb77b9c1 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -51,6 +51,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { //init mac here nr_ue_mac_inst = (NR_UE_MAC_INST_t *)calloc(sizeof(NR_UE_MAC_INST_t),NB_NR_UE_MAC_INST); nr_ue_mac_inst->first_sync_frame = -1; + nr_ue_mac_inst->sib1_decoded = false; for (int j=0;jfirst_sync_frame == -1) + if (!mac->sib1_decoded) { nr_ue_sib1_scheduler(module_id, cc_id, ssb_start_symbol, @@ -384,18 +384,20 @@ int8_t nr_ue_decode_mib(module_id_t module_id, ssb_start_subcarrier, mac->frequency_range, phy_data); + mac->first_sync_frame = frame; + } } else { NR_ServingCellConfigCommon_t *scc = mac->scc; scs_ssb = *scc->ssbSubcarrierSpacing; band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index); + if (mac->first_sync_frame == -1) + mac->first_sync_frame = frame; } mac->dl_config_request.sfn = frame; mac->dl_config_request.slot = ssb_start_symbol/14; - if (mac->first_sync_frame == -1) - mac->first_sync_frame = frame; return 0; } @@ -408,6 +410,8 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id, uint32_t pdu_len) { if(ack_nack) { LOG_D(NR_MAC, "Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)\n"); + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + mac->sib1_decoded = true; nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len); } else @@ -425,11 +429,11 @@ uint32_t get_ssb_frame(uint32_t test){ * These tables and functions are going to be called by function nr_ue_process_dci */ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, - fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, - uint16_t n_RB_ULBWP, - uint16_t n_RB_DLBWP, - uint16_t riv - ){ + fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, + uint16_t n_RB_ULBWP, + uint16_t n_RB_DLBWP, + uint16_t riv) +{ /* * TS 38.214 subclause 5.1.2.2 Resource allocation in frequency domain (downlink)