diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 99e4249bb2..69b139cb6e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -393,9 +393,7 @@ int get_ul_slot_offset(const frame_structure_t *fs, int idx, bool count_mixed) return ul_slot_idxs[ul_slot_idx_in_period] + period_idx * fs->numb_slots_period; } -static void config_common(gNB_MAC_INST *nrmac, - const nr_mac_config_t *config, - NR_ServingCellConfigCommon_t *scc) +static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR_ServingCellConfigCommon_t *scc) { nfapi_nr_config_request_scf_t *cfg = &nrmac->config[0]; nrmac->common_channels[0].ServingCellConfigCommon = scc; @@ -736,6 +734,39 @@ static void config_common(gNB_MAC_INST *nrmac, cfg->num_tlv++; } } + + if (IS_SA_MODE(get_softmodem_params())) { + int bw = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; + uint64_t bw_khz = (12 * bw) * (15 << mu); + uint64_t carr_dl = (cfg->carrier_config.dl_frequency.value + bw_khz / 2) * 1000; + uint64_t carr_ul = (cfg->carrier_config.uplink_frequency.value + bw_khz / 2) * 1000; + int prb_offset = (frequency_range == FR1) ? + cfg->ssb_table.ssb_offset_point_a.value >> scs : + cfg->ssb_table.ssb_offset_point_a.value >> (scs - 2); + int sc_offset = (frequency_range == FR1) ? + cfg->ssb_table.ssb_subcarrier_offset.value >> scs : + cfg->ssb_table.ssb_subcarrier_offset.value; + if (cfg->carrier_config.dl_frequency.value != cfg->carrier_config.uplink_frequency.value) { + LOG_I(NR_MAC, + "Command line parameters for OAI UE: -C %lu --CO %ld -r %d --numerology %d --band %ld --ssb %d %s\n", + carr_dl, + carr_ul - carr_dl, + bw, + mu, + band, + 12 * prb_offset + sc_offset, + get_softmodem_params()->threequarter_fs ? "-E" : ""); + } else { + LOG_I(NR_MAC, + "Command line parameters for OAI UE: -C %lu -r %d --numerology %d --band %ld --ssb %d %s\n", + carr_dl, + bw, + mu, + band, + 12 * prb_offset + sc_offset, + get_softmodem_params()->threequarter_fs ? "-E" : ""); + } + } } static void initialize_beam_information(NR_beam_info_t *beam_info, int mu, int slots_per_frame) diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index c4f0fad659..3a8ed58e85 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -242,9 +242,6 @@ void mac_top_init_gNB(ngran_node_t node_type, const nr_mac_config_t *config, const nr_rlc_configuration_t *default_rlc_config) { - module_id_t i; - gNB_MAC_INST *nrmac; - AssertFatal(RC.nb_nr_macrlc_inst == 1, "what is the point of calling %s() if you don't need exactly one MAC?\n", __func__); if (RC.nb_nr_macrlc_inst > 0) { @@ -255,7 +252,7 @@ void mac_top_init_gNB(ngran_node_t node_type, RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *), RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST)); - for (i = 0; i < RC.nb_nr_macrlc_inst; i++) { + for (module_id_t i = 0; i < RC.nb_nr_macrlc_inst; i++) { RC.nrmac[i] = (gNB_MAC_INST *) malloc16(sizeof(gNB_MAC_INST)); @@ -315,8 +312,8 @@ void mac_top_init_gNB(ngran_node_t node_type, } // Initialize Linked-List for Active UEs - for (i = 0; i < RC.nb_nr_macrlc_inst; i++) { - nrmac = RC.nrmac[i]; + for (module_id_t i = 0; i < RC.nb_nr_macrlc_inst; i++) { + gNB_MAC_INST *nrmac = RC.nrmac[i]; nrmac->if_inst = NR_IF_Module_init(i); memset(&nrmac->UE_info, 0, sizeof(nrmac->UE_info)); }