diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 40a3d16753..47ec046612 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -306,10 +306,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) process_queued_nr_nfapi_msgs(mac, sfn_slot); } - bool only_dl = false; - if (mac->scc == NULL && mac->scc_SIB == NULL) - only_dl = true; - int CC_id = 0; uint8_t gNB_id = 0; nr_uplink_indication_t ul_info; @@ -332,10 +328,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) free_and_zero(ch_info); } - if (only_dl || - is_nr_DL_slot(get_softmodem_params()->nsa ? - mac->scc->tdd_UL_DL_ConfigurationCommon : - mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, + bool default_dl = mac->tdd_UL_DL_ConfigurationCommon ? false : true; + if (default_dl || + is_nr_DL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info.slot_rx)) { memset(&mac->dl_info, 0, sizeof(mac->dl_info)); mac->dl_info.cc_id = CC_id; @@ -350,10 +345,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); - if (!only_dl && - is_nr_UL_slot(get_softmodem_params()->nsa ? - mac->scc->tdd_UL_DL_ConfigurationCommon : - mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, + if (!default_dl && + is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, mac->frame_type)) { LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind()\n", ul_info.slot_tx); nr_ue_ul_scheduler(&ul_info); @@ -517,16 +510,8 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD) { !get_softmodem_params()->continuous_tx) { uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots; - int nrofUplinkSlots, nrofUplinkSymbols; - if (mac->scc) { - nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - nrofUplinkSymbols = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; - } - else { - nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - nrofUplinkSymbols = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; - } - + int nrofUplinkSlots = mac->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; + int nrofUplinkSymbols = mac->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; int slot_tx_usrp = proc->nr_slot_tx; uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0); uint8_t first_tx_slot = tdd_period - num_UL_slots; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 29afb86a6f..1c147047c1 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -528,8 +528,7 @@ int main( int argc, char **argv ) { mac->phy_config_request_sent = true; 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->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]); + nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band); } init_nr_ue_vars(UE[CC_id], 0, abstraction_flag); diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index a04606b7e2..fccabf6c2e 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -118,12 +118,11 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } void config_common_ue_sa(NR_UE_MAC_INST_t *mac, + NR_ServingCellConfigCommonSIB_t *scc, module_id_t module_id, - int cc_idP) { - + int cc_idP) +{ fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; - NR_ServingCellConfigCommonSIB_t *scc = mac->scc_SIB; - mac->phy_config.Mod_id = module_id; mac->phy_config.CC_id = cc_idP; @@ -140,7 +139,7 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, (15 << frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing); cfg->carrier_config.dl_frequency = (downlink_frequency[cc_idP][0]/1000) - (dl_bw_khz>>1); - for (int i=0; i<5; i++) { + for (int i = 0; i < 5; i++) { if (i == frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) { cfg->carrier_config.dl_grid_size[i] = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; cfg->carrier_config.dl_k0[i] = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier; @@ -207,7 +206,7 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, if (cfg->cell_config.frame_duplex_type == TDD){ set_tdd_config_nr_ue(cfg, frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon); + mac->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration @@ -264,11 +263,11 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } void config_common_ue(NR_UE_MAC_INST_t *mac, + NR_ServingCellConfigCommon_t *scc, module_id_t module_id, int cc_idP) { - fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; - NR_ServingCellConfigCommon_t *scc = mac->scc; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; mac->phy_config.Mod_id = module_id; mac->phy_config.CC_id = cc_idP; @@ -378,7 +377,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, if (cfg->cell_config.frame_duplex_type == TDD){ set_tdd_config_nr_ue(cfg, frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon); + mac->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration @@ -537,35 +536,33 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, NR_UE_UL_BWP_t *UL_BWP = &mac->current_UL_BWP; NR_BWP_t dl_genericParameters = {0}; NR_BWP_t ul_genericParameters = {0}; - NR_BWP_DownlinkCommon_t *bwp_dlcommon = NULL; - NR_BWP_UplinkCommon_t *bwp_ulcommon = NULL; DL_BWP->n_dl_bwp = 0; UL_BWP->n_ul_bwp = 0; if(scc) { DL_BWP->bwp_id = 0; UL_BWP->bwp_id = 0; - bwp_dlcommon = &scc->downlinkConfigCommon.initialDownlinkBWP; - bwp_ulcommon = &scc->uplinkConfigCommon->initialUplinkBWP; - dl_genericParameters = bwp_dlcommon->genericParameters; + mac->bwp_dlcommon = &scc->downlinkConfigCommon.initialDownlinkBWP; + mac->bwp_ulcommon = &scc->uplinkConfigCommon->initialUplinkBWP; + dl_genericParameters = mac->bwp_dlcommon->genericParameters; if(scc->uplinkConfigCommon) ul_genericParameters = scc->uplinkConfigCommon->initialUplinkBWP.genericParameters; else - ul_genericParameters = bwp_dlcommon->genericParameters; + ul_genericParameters = mac->bwp_dlcommon->genericParameters; DL_BWP->pdsch_Config = NULL; - if (bwp_dlcommon->pdsch_ConfigCommon) - DL_BWP->tdaList_Common = bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - if (bwp_ulcommon->pusch_ConfigCommon) { - UL_BWP->tdaList_Common = bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; - UL_BWP->msg3_DeltaPreamble = bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble; + if (mac->bwp_dlcommon->pdsch_ConfigCommon) + DL_BWP->tdaList_Common = mac->bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + if (mac->bwp_ulcommon->pusch_ConfigCommon) { + UL_BWP->tdaList_Common = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + UL_BWP->msg3_DeltaPreamble = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble; } - if (bwp_ulcommon->pucch_ConfigCommon) - UL_BWP->pucch_ConfigCommon = bwp_ulcommon->pucch_ConfigCommon->choice.setup; - if (bwp_ulcommon->rach_ConfigCommon) - UL_BWP->rach_ConfigCommon = bwp_ulcommon->rach_ConfigCommon->choice.setup; - if (bwp_dlcommon->pdcch_ConfigCommon) - configure_ss_coreset(mac, bwp_dlcommon->pdcch_ConfigCommon->choice.setup, NULL); + if (mac->bwp_ulcommon->pucch_ConfigCommon) + UL_BWP->pucch_ConfigCommon = mac->bwp_ulcommon->pucch_ConfigCommon->choice.setup; + if (mac->bwp_ulcommon->rach_ConfigCommon) + UL_BWP->rach_ConfigCommon = mac->bwp_ulcommon->rach_ConfigCommon->choice.setup; + if (mac->bwp_dlcommon->pdcch_ConfigCommon) + configure_ss_coreset(mac, mac->bwp_dlcommon->pdcch_ConfigCommon->choice.setup, NULL); } if(cell_group_config) { @@ -586,17 +583,6 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, if (spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id) UL_BWP->bwp_id = *spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id; - if (mac->scc) { - bwp_dlcommon = mac->scc->downlinkConfigCommon->initialDownlinkBWP; - bwp_ulcommon = mac->scc->uplinkConfigCommon->initialUplinkBWP; - } - else if (mac->scc_SIB) { - bwp_dlcommon = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; - bwp_ulcommon = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP; - } - else - AssertFatal(false, "Either SCC or SCC SIB should be non-NULL\n"); - NR_BWP_Downlink_t *bwp_downlink = NULL; const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = spCellConfigDedicated->downlinkBWP_ToAddModList; if (bwpList) @@ -617,16 +603,16 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, } else { - dl_genericParameters = bwp_dlcommon->genericParameters; + dl_genericParameters = mac->bwp_dlcommon->genericParameters; DL_BWP->pdsch_Config = spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup; - DL_BWP->tdaList_Common = bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + DL_BWP->tdaList_Common = mac->bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; configure_ss_coreset(mac, - bwp_dlcommon->pdcch_ConfigCommon ? bwp_dlcommon->pdcch_ConfigCommon->choice.setup : NULL, + mac->bwp_dlcommon->pdcch_ConfigCommon ? mac->bwp_dlcommon->pdcch_ConfigCommon->choice.setup : NULL, spCellConfigDedicated->initialDownlinkBWP->pdcch_Config ? spCellConfigDedicated->initialDownlinkBWP->pdcch_Config->choice.setup : NULL); } - UL_BWP->msg3_DeltaPreamble = bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble; + UL_BWP->msg3_DeltaPreamble = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble; NR_BWP_Uplink_t *bwp_uplink = NULL; const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList; @@ -651,17 +637,17 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, UL_BWP->rach_ConfigCommon = bwp_uplink->bwp_Common->rach_ConfigCommon->choice.setup; } else { - UL_BWP->tdaList_Common = bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + UL_BWP->tdaList_Common = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; UL_BWP->pusch_Config = spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pusch_Config->choice.setup; UL_BWP->pucch_Config = spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; UL_BWP->srs_Config = spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config->choice.setup; UL_BWP->configuredGrantConfig = spCellConfigDedicated->uplinkConfig->initialUplinkBWP->configuredGrantConfig ? spCellConfigDedicated->uplinkConfig->initialUplinkBWP->configuredGrantConfig->choice.setup : NULL; - ul_genericParameters = bwp_ulcommon->genericParameters; - if (bwp_ulcommon->pucch_ConfigCommon) - UL_BWP->pucch_ConfigCommon = bwp_ulcommon->pucch_ConfigCommon->choice.setup; - if (bwp_ulcommon->rach_ConfigCommon) - UL_BWP->rach_ConfigCommon = bwp_ulcommon->rach_ConfigCommon->choice.setup; + ul_genericParameters = mac->bwp_ulcommon->genericParameters; + if (mac->bwp_ulcommon->pucch_ConfigCommon) + UL_BWP->pucch_ConfigCommon = mac->bwp_ulcommon->pucch_ConfigCommon->choice.setup; + if (mac->bwp_ulcommon->rach_ConfigCommon) + UL_BWP->rach_ConfigCommon = mac->bwp_ulcommon->rach_ConfigCommon->choice.setup; } } else @@ -677,14 +663,10 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, UL_BWP->BWPSize = NRRIV2BW(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); UL_BWP->BWPStart = NRRIV2PRBOFFSET(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - DL_BWP->initial_BWPSize = mac->scc ? NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : - NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - UL_BWP->initial_BWPSize = mac->scc ? NRRIV2BW(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : - NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - DL_BWP->initial_BWPStart = mac->scc ? NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : - NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - UL_BWP->initial_BWPStart = mac->scc ? NRRIV2PRBOFFSET(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : - NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->initial_BWPSize = NRRIV2BW(mac->bwp_dlcommon->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPSize = NRRIV2BW(mac->bwp_ulcommon->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->initial_BWPStart = NRRIV2PRBOFFSET(mac->bwp_dlcommon->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPStart = NRRIV2PRBOFFSET(mac->bwp_ulcommon->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); } @@ -724,10 +706,11 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, { NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); AssertFatal(scc, "SIB1 SCC should not be NULL\n"); - mac->scc_SIB = scc; + mac->tdd_UL_DL_ConfigurationCommon = scc->tdd_UL_DL_ConfigurationCommon; + mac->p_Max = scc->uplinkConfigCommon->frequencyInfoUL.p_Max; mac->si_SchedulingInfo = si_SchedulingInfo; mac->nr_band = *scc->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR; - config_common_ue_sa(mac, module_id, cc_idP); + config_common_ue_sa(mac, scc, module_id, cc_idP); configure_current_BWP(mac, scc, NULL); // Setup the SSB to Rach Occasionsif (cell_group_config->spCellConfig) { mapping according to the config @@ -764,15 +747,16 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id, if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } - mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - mac->nr_band = *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; - if (mac->scc_SIB) { - ASN_STRUCT_FREE(asn_DEF_NR_ServingCellConfigCommonSIB, mac->scc_SIB); - mac->scc_SIB = NULL; - } + NR_ServingCellConfigCommon_t *scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + mac->bwp_dlcommon = scc->downlinkConfigCommon->initialDownlinkBWP; + mac->bwp_ulcommon = scc->uplinkConfigCommon->initialUplinkBWP; + mac->dmrs_TypeA_Position = scc->dmrs_TypeA_Position; + mac->tdd_UL_DL_ConfigurationCommon = scc->tdd_UL_DL_ConfigurationCommon; + mac->p_Max = scc->uplinkConfigCommon->frequencyInfoUL->p_Max; + mac->nr_band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; mac->state = UE_NOT_SYNC; mac->ra.ra_state = RA_UE_IDLE; - mac->physCellId = *mac->scc->physCellId; + mac->physCellId = *scc->physCellId; if (!get_softmodem_params()->emulate_l1) { mac->synch_request.Mod_id = module_id; mac->synch_request.CC_id = cc_idP; @@ -783,7 +767,7 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id, LOG_I(NR_MAC, "Configuring CRNTI %x\n", mac->crnti); configure_current_BWP(mac, NULL, cell_group_config); - config_common_ue(mac, module_id, cc_idP); + config_common_ue(mac, scc, module_id, cc_idP); nr_ue_mac_default_configs(mac); if (!get_softmodem_params()->emulate_l1) { @@ -814,10 +798,15 @@ void nr_rrc_mac_config_req_scg(module_id_t module_id, if (scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } - mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - mac->nr_band = *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; - mac->physCellId = *mac->scc->physCellId; - config_common_ue(mac,module_id,cc_idP); + NR_ServingCellConfigCommon_t *scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + mac->bwp_dlcommon = scc->downlinkConfigCommon->initialDownlinkBWP; + mac->bwp_ulcommon = scc->uplinkConfigCommon->initialUplinkBWP; + mac->dmrs_TypeA_Position = scc->dmrs_TypeA_Position; + mac->tdd_UL_DL_ConfigurationCommon = scc->tdd_UL_DL_ConfigurationCommon; + mac->p_Max = scc->uplinkConfigCommon->frequencyInfoUL->p_Max; + mac->nr_band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + mac->physCellId = *scc->physCellId; + config_common_ue(mac, scc, module_id, cc_idP); mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 596354223f..7c6419a22b 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -422,8 +422,6 @@ typedef struct ssb_list_info { /*!\brief Top level UE MAC structure */ typedef struct { NR_UE_L2_STATE_t state; - NR_ServingCellConfigCommon_t *scc; - NR_ServingCellConfigCommonSIB_t *scc_SIB; NR_CellGroupConfig_t *cg; int servCellIndex; NR_CSI_ReportConfig_t *csirc; @@ -445,6 +443,9 @@ typedef struct { NR_UE_DL_BWP_t current_DL_BWP; NR_UE_UL_BWP_t current_UL_BWP; + NR_BWP_DownlinkCommon_t *bwp_dlcommon; + NR_BWP_UplinkCommon_t *bwp_ulcommon; + NR_UL_TIME_ALIGNMENT_t ul_time_alignment; NR_SearchSpace_t *otherSI_SS; @@ -455,6 +456,8 @@ typedef struct { NR_SearchSpace_t *BWP_searchspaces[FAPI_NR_MAX_SS]; NR_SearchSpace_t *search_space_zero; + NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon; + bool phy_config_request_sent; frame_type_t frame_type; @@ -508,6 +511,9 @@ typedef struct { /// PHR uint8_t PHR_reporting_active; + int dmrs_TypeA_Position; + NR_P_Max_t *p_Max; + NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config; frequency_range_t frequency_range; uint16_t nr_band; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 383880bcb2..5534e586b1 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -238,8 +238,6 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, const frame_t frame, const int slot); -NR_BWP_DownlinkCommon_t *get_bwp_downlink_common(NR_UE_MAC_INST_t *mac, NR_BWP_Id_t dl_bwp_id); - uint8_t nr_ue_get_sdu(module_id_t module_idP, int cc_id, frame_t frameP, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 9820e60107..54d91e9971 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -72,14 +72,14 @@ void init_RA(module_id_t mod_id, ra->starting_preamble_nb = 0; ra->RA_backoff_cnt = 0; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; + prach_resources->RA_PREAMBLE_BACKOFF = 0; NR_SubcarrierSpacing_t prach_scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing; int n_prbs = get_N_RA_RB (prach_scs, mac->current_UL_BWP.scs); int start_prb = rach_ConfigGeneric->msg1_FrequencyStart + mac->current_UL_BWP.BWPStart; - int carrier_bandwidth = mac->scc_SIB ? mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth : - mac->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; // PRACH shall be as specified for QPSK modulated DFT-s-OFDM of equivalent RB allocation (38.101-1) - prach_resources->RA_PCMAX = nr_get_Pcmax(mac, 2, false, prach_scs, carrier_bandwidth, true, n_prbs, start_prb); + prach_resources->RA_PCMAX = nr_get_Pcmax(mac, 2, false, prach_scs, cfg->carrier_config.dl_grid_size[prach_scs], true, n_prbs, start_prb); prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1; prach_resources->RA_PREAMBLE_POWER_RAMPING_COUNTER = 1; prach_resources->POWER_OFFSET_2STEP_RA = 0; @@ -810,25 +810,17 @@ uint8_t nr_ue_get_rach(module_id_t mod_id, return ra->ra_state; } -void nr_get_RA_window(NR_UE_MAC_INST_t *mac){ - - uint8_t mu, ra_ResponseWindow; +void nr_get_RA_window(NR_UE_MAC_INST_t *mac) +{ RA_config_t *ra = &mac->ra; NR_RACH_ConfigCommon_t *setup = mac->current_UL_BWP.rach_ConfigCommon; AssertFatal(&setup->rach_ConfigGeneric != NULL, "In %s: FATAL! rach_ConfigGeneric is NULL...\n", __FUNCTION__); NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric; - long scs = (mac->scc) ? - mac->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing : - mac->scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ra_ResponseWindow = rach_ConfigGeneric->ra_ResponseWindow; + int ra_ResponseWindow = rach_ConfigGeneric->ra_ResponseWindow; + int mu = mac->current_DL_BWP.scs; - if (setup->msg1_SubcarrierSpacing) - mu = *setup->msg1_SubcarrierSpacing; - else - mu = scs; - - ra->RA_window_cnt = ra->RA_offset*nr_slots_per_frame[mu]; // taking into account the 2 frames gap introduced by OAI gNB + ra->RA_window_cnt = ra->RA_offset * nr_slots_per_frame[mu]; // taking into account the 2 frames gap introduced by OAI gNB switch (ra_ResponseWindow) { case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1: diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c index 21c726336e..02c4881898 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c @@ -57,12 +57,11 @@ int nr_get_Pcmax(NR_UE_MAC_INST_t *mac, int Qm, bool powerBoostPi2BPSK, int scs, if(mac->frequency_range == FR1) { //TODO configure P-MAX from the upper layers according to 38.331 - long *p_emax = (mac->scc!=NULL) ? mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max : mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.p_Max; int p_powerclass = 23; // dBm assuming poweclass 3 UE - + int p_emax = mac->p_Max ? *mac->p_Max : 0; int delta_P_powerclass = 0; // for powerclass 2 needs to be changed - if(p_emax && Qm == 1 && powerBoostPi2BPSK && (nr_band == 40 || nr_band == 41 || nr_band == 77 || nr_band == 78 || nr_band == 79)) { - *p_emax += 3; + if(mac->p_Max && Qm == 1 && powerBoostPi2BPSK && (nr_band == 40 || nr_band == 41 || nr_band == 77 || nr_band == 78 || nr_band == 79)) { + p_emax += 3; delta_P_powerclass -= 3; } @@ -137,10 +136,10 @@ int nr_get_Pcmax(NR_UE_MAC_INST_t *mac, int Qm, bool powerBoostPi2BPSK, int scs, if (P_MPR > total_reduction) total_reduction = P_MPR; int pcmax_high, pcmax_low; - if(p_emax) { - pcmax_high = *p_emax < (p_powerclass - delta_P_powerclass) ? *p_emax : (p_powerclass - delta_P_powerclass); - pcmax_low = (*p_emax - delta_TC) < (p_powerclass - delta_P_powerclass - total_reduction) ? - (*p_emax - delta_TC) : (p_powerclass - delta_P_powerclass - total_reduction); + if(mac->p_Max) { + pcmax_high = p_emax < (p_powerclass - delta_P_powerclass) ? p_emax : (p_powerclass - delta_P_powerclass); + pcmax_low = (p_emax - delta_TC) < (p_powerclass - delta_P_powerclass - total_reduction) ? + (p_emax - delta_TC) : (p_powerclass - delta_P_powerclass - total_reduction); } else { pcmax_high = p_powerclass - delta_P_powerclass; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 0bc0546fe4..a51a0c53a3 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -207,18 +207,6 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac) memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment)); } -NR_BWP_DownlinkCommon_t *get_bwp_downlink_common(NR_UE_MAC_INST_t *mac, NR_BWP_Id_t dl_bwp_id) { - NR_BWP_DownlinkCommon_t *bwp_Common = NULL; - if (dl_bwp_id > 0 && mac->cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList) { - bwp_Common = mac->cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[dl_bwp_id-1]->bwp_Common; - } else if (mac->scc) { - bwp_Common = mac->scc->downlinkConfigCommon->initialDownlinkBWP; - } else if (mac->scc_SIB) { - bwp_Common = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; - } - return bwp_Common; -} - int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti) { @@ -288,6 +276,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id, #endif mac->ssb_subcarrier_offset = ssb_subcarrier_offset; + mac->dmrs_TypeA_Position = mac->mib->dmrs_TypeA_Position; if (mac->first_sync_frame == -1) mac->first_sync_frame = frame; @@ -647,7 +636,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->rb_offset -= dlsch_config_pdu_1_0->BWPStart; /* TIME_DOM_RESOURCE_ASSIGNMENT */ - int dmrs_typeA_pos = (mac->scc != NULL) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position; + int dmrs_typeA_pos = mac->dmrs_TypeA_Position; NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, dci_ind->ss_type, dci->time_domain_assignment.val, dmrs_typeA_pos, mux_pattern, get_rnti_type(mac, rnti), coreset_type, mac->get_sib1); @@ -669,7 +658,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr /* dmrs symbol positions*/ dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, NR_DL_DCI_FORMAT_1_0, - mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position, + mac->dmrs_TypeA_Position, dlsch_config_pdu_1_0->number_symbols, dlsch_config_pdu_1_0->start_symbol, tda_info.mapping_type, @@ -868,7 +857,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr } dlsch_config_pdu_1_1->rb_offset = dlsch_config_pdu_1_1->start_rb + dlsch_config_pdu_1_1->BWPStart; /* TIME_DOM_RESOURCE_ASSIGNMENT */ - int dmrs_typeA_pos = (mac->scc != NULL) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position; + int dmrs_typeA_pos = mac->dmrs_TypeA_Position; NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, dci_ind->ss_type, dci->time_domain_assignment.val, dmrs_typeA_pos, mux_pattern, get_rnti_type(mac, rnti), coreset_type, false); @@ -1059,7 +1048,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr /* dmrs symbol positions*/ dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config, NR_DL_DCI_FORMAT_1_1, - mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position, + mac->dmrs_TypeA_Position, dlsch_config_pdu_1_1->number_symbols, dlsch_config_pdu_1_1->start_symbol, tda_info.mapping_type, @@ -4138,17 +4127,13 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, int pdu_id) // - referenceSignalPower: dBm/RE (average EPRE of the resources elements that carry secondary synchronization signals in dBm) int16_t compute_nr_SSB_PL(NR_UE_MAC_INST_t *mac, short ssb_rsrp_dBm) { - - long referenceSignalPower; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; + int referenceSignalPower = cfg->ssb_config.ss_pbch_power; //TODO improve PL measurements. Probably not correct as it is. - if (mac->scc) - referenceSignalPower = mac->scc->ss_PBCH_BlockPower; - else - referenceSignalPower = mac->scc_SIB->ss_PBCH_BlockPower; int16_t pathloss = (int16_t)(referenceSignalPower - ssb_rsrp_dBm); - LOG_D(NR_MAC, "pathloss %d dB, referenceSignalPower %ld dBm/RE (%f mW), RSRP %d dBm (%f mW)\n", + LOG_D(NR_MAC, "pathloss %d dB, referenceSignalPower %d dBm/RE (%f mW), RSRP %d dBm (%f mW)\n", pathloss, referenceSignalPower, pow(10, referenceSignalPower/10), diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index defaf6c37d..94aff89a56 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -111,7 +111,7 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int slot, int fb_time) { - NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->scc==NULL ? mac->scc_SIB->tdd_UL_DL_ConfigurationCommon : mac->scc->tdd_UL_DL_ConfigurationCommon; + NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->tdd_UL_DL_ConfigurationCommon; //Check if requested on the right slot AssertFatal(is_nr_UL_slot(tdd_config, slot, mac->frame_type) != 0, "UL config_request called at wrong slot %d\n", slot); @@ -483,8 +483,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, pusch_config_pdu->start_symbol_index = tda_info->startSymbolIndex; pusch_config_pdu->nr_of_symbols = tda_info->nrOfSymbols; - l_prime_mask = - get_l_prime(tda_info->nrOfSymbols, tda_info->mapping_type, add_pos, dmrslength, tda_info->startSymbolIndex, mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position); + l_prime_mask = get_l_prime(tda_info->nrOfSymbols, + tda_info->mapping_type, + add_pos, + dmrslength, + tda_info->startSymbolIndex, + mac->dmrs_TypeA_Position); LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, tda_info->mapping_type, l_prime_mask); #ifdef DEBUG_MSG3 @@ -655,7 +659,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, l_prime_mask = get_l_prime(pusch_config_pdu->nr_of_symbols, mappingtype, add_pos, dmrslength, pusch_config_pdu->start_symbol_index, - mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position); + mac->dmrs_TypeA_Position); // Num PRB Overhead from PUSCH-ServingCellConfig if (current_UL_BWP->pusch_servingcellconfig && current_UL_BWP->pusch_servingcellconfig->xOverhead) @@ -859,7 +863,7 @@ void nr_ue_aperiodic_srs_scheduling(NR_UE_MAC_INST_t *mac, long resource_trigger slot_offset, DURATION_RX_TO_TX); int n_slots_frame = nr_slots_per_frame[current_UL_BWP->scs]; int sched_slot = (slot + slot_offset) % n_slots_frame; - NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->scc==NULL ? mac->scc_SIB->tdd_UL_DL_ConfigurationCommon : mac->scc->tdd_UL_DL_ConfigurationCommon; + NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->tdd_UL_DL_ConfigurationCommon; if (!is_nr_UL_slot(tdd_config, sched_slot, mac->frame_type)) { LOG_E(NR_MAC, "Slot for scheduling aperiodic SRS %d is not an UL slot\n", sched_slot); return; @@ -1655,84 +1659,20 @@ static void build_ssb_list(NR_UE_MAC_INST_t *mac) { // Create the list of transmitted SSBs // =================================== - BIT_STRING_t *ssb_bitmap; - uint64_t ssb_positionsInBurst; - uint8_t ssb_idx = 0; ssb_list_info_t *ssb_list = &mac->ssb_list; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; + ssb_list->nb_tx_ssb = 0; - if (mac->scc) { - NR_ServingCellConfigCommon_t *scc = mac->scc; - switch (scc->ssb_PositionsInBurst->present) { - case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap: - ssb_bitmap = &scc->ssb_PositionsInBurst->choice.shortBitmap; - - ssb_positionsInBurst = BIT_STRING_to_uint8(ssb_bitmap); - LOG_D(NR_MAC,"SSB config: SSB_positions_in_burst 0x%lx\n", ssb_positionsInBurst); - - for (uint8_t bit_nb=3; bit_nb<=3; bit_nb--) { - // If SSB is transmitted - if ((ssb_positionsInBurst>>bit_nb) & 0x01) { - ssb_list->nb_tx_ssb++; - ssb_list->tx_ssb[ssb_idx].transmitted = true; - LOG_D(NR_MAC,"SSB idx %d transmitted\n", ssb_idx); - } - ssb_idx++; - } - break; - case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap: - ssb_bitmap = &scc->ssb_PositionsInBurst->choice.mediumBitmap; - - ssb_positionsInBurst = BIT_STRING_to_uint8(ssb_bitmap); - LOG_D(NR_MAC,"SSB config: SSB_positions_in_burst 0x%lx\n", ssb_positionsInBurst); - - for (uint8_t bit_nb=7; bit_nb<=7; bit_nb--) { - // If SSB is transmitted - if ((ssb_positionsInBurst>>bit_nb) & 0x01) { - ssb_list->nb_tx_ssb++; - ssb_list->tx_ssb[ssb_idx].transmitted = true; - LOG_D(NR_MAC,"SSB idx %d transmitted\n", ssb_idx); - } - ssb_idx++; - } - break; - case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap: - ssb_bitmap = &scc->ssb_PositionsInBurst->choice.longBitmap; - - ssb_positionsInBurst = BIT_STRING_to_uint64(ssb_bitmap); - LOG_D(NR_MAC,"SSB config: SSB_positions_in_burst 0x%lx\n", ssb_positionsInBurst); - - for (uint8_t bit_nb=63; bit_nb<=63; bit_nb--) { - // If SSB is transmitted - if ((ssb_positionsInBurst>>bit_nb) & 0x01) { - ssb_list->nb_tx_ssb++; - ssb_list->tx_ssb[ssb_idx].transmitted = true; - LOG_D(NR_MAC,"SSB idx %d transmitted\n", ssb_idx); - } - ssb_idx++; - } - break; - default: - AssertFatal(false,"ssb_PositionsInBurst not present\n"); - break; - } - } else { // This is configuration from SIB1 - - AssertFatal(mac->scc_SIB->ssb_PositionsInBurst.groupPresence == NULL, "Handle case for >8 SSBs\n"); - ssb_bitmap = &mac->scc_SIB->ssb_PositionsInBurst.inOneGroup; - - ssb_positionsInBurst = BIT_STRING_to_uint8(ssb_bitmap); - - LOG_D(NR_MAC,"SSB config: SSB_positions_in_burst 0x%lx\n", ssb_positionsInBurst); - - for (uint8_t bit_nb=7; bit_nb<=7; bit_nb--) { - // If SSB is transmitted - if ((ssb_positionsInBurst>>bit_nb) & 0x01) { - ssb_list->nb_tx_ssb++; - ssb_list->tx_ssb[ssb_idx].transmitted = true; - LOG_D(NR_MAC,"SSB idx %d transmitted\n", ssb_idx); - } - ssb_idx++; + for(int ssb_index = 0; ssb_index < 64; ssb_index++) { + uint32_t curr_mask = cfg->ssb_table.ssb_mask_list[ssb_index / 32].ssb_mask; + // check if if current SSB is transmitted + if ((curr_mask >> (31 - (ssb_index % 32))) & 0x01) { + ssb_list->nb_tx_ssb++; + ssb_list->tx_ssb[ssb_index].transmitted = true; + LOG_D(NR_MAC,"SSB idx %d transmitted\n", ssb_index); } + else + ssb_list->tx_ssb[ssb_index].transmitted = false; } } @@ -2512,12 +2452,10 @@ static void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_fr fapi_nr_prach_config_t *prach_config = &cfg->prach_config; nr_scheduled_response_t scheduled_response; - NR_ServingCellConfigCommon_t *scc = mac->scc; - NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB; NR_RACH_ConfigCommon_t *setup = mac->current_UL_BWP.rach_ConfigCommon; NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric; - NR_TDD_UL_DL_ConfigCommon_t *tdd_config = scc==NULL ? scc_SIB->tdd_UL_DL_ConfigurationCommon : scc->tdd_UL_DL_ConfigurationCommon; + NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->tdd_UL_DL_ConfigurationCommon; if (is_nr_UL_slot(tdd_config, slotP, mac->frame_type)) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 8f269a5cd0..9f8b58f9ad 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -346,7 +346,7 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu if (get_softmodem_params()->sa) { if (mac->state == UE_NOT_SYNC) return false; - if (received_pdu->RNTI == 0xFFFF && mac->scc_SIB) + if (received_pdu->RNTI == 0xFFFF && mac->phy_config_request_sent) return false; if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED) return false; @@ -742,8 +742,8 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, int slots_per_frame = 20; //30 kHZ subcarrier spacing int slot_ahead = 2; // TODO: Make this dynamic - if (mac->scc || mac->scc_SIB) { - if (is_nr_UL_slot(mac->scc ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, + if (mac->tdd_UL_DL_ConfigurationCommon) { + if (is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, (slot + slot_ahead) % slots_per_frame, mac->frame_type) && mac->ra.ra_state != RA_SUCCEEDED) { @@ -1133,10 +1133,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info) LOG_T(NR_MAC, "In %s():%d not calling scheduler mac->ra.ra_state = %d\n", __FUNCTION__, __LINE__, mac->ra.ra_state); - NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = - mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon - : (mac->scc_SIB ? mac->scc_SIB->tdd_UL_DL_ConfigurationCommon : NULL); - if (mac->phy_config_request_sent && is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) + if (mac->phy_config_request_sent && is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) nr_ue_ul_scheduler(ul_info); pthread_mutex_unlock(&mac_IF_mutex);