Commit bbfa23e9 authored by Francesco Mani's avatar Francesco Mani

fix for carrier frequency (now according to number of PRBs

parent d25a13fa
...@@ -405,14 +405,19 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { ...@@ -405,14 +405,19 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
*/ */
memcpy((void*)gNB_config,phy_config->cfg,sizeof(*phy_config->cfg)); memcpy((void*)gNB_config,phy_config->cfg,sizeof(*phy_config->cfg));
RC.gNB[Mod_id]->mac_enabled = 1; RC.gNB[Mod_id]->mac_enabled = 1;
fp->dl_CarrierFreq = (gNB_config->carrier_config.dl_frequency.value)*1e3 + (gNB_config->carrier_config.dl_bandwidth.value)*5e5;
uint64_t dl_bw_khz = (12*gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + gNB_config->carrier_config.dl_frequency.value)*1000 ;
int32_t dlul_offset = 0; int32_t dlul_offset = 0;
lte_frame_type_t frame_type = 0; lte_frame_type_t frame_type = 0;
get_band(fp->dl_CarrierFreq,&fp->nr_band,&dlul_offset,&frame_type); get_band(fp->dl_CarrierFreq,&fp->nr_band,&dlul_offset,&frame_type);
fp->ul_CarrierFreq = (gNB_config->carrier_config.uplink_frequency.value)*1e3 + (gNB_config->carrier_config.uplink_bandwidth.value)*5e5; uint64_t ul_bw_khz = (12*gNB_config->carrier_config.ul_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ;
AssertFatal(fp->ul_CarrierFreq==(fp->dl_CarrierFreq+dlul_offset), "Disagreement in uplink frequency for band %d\n", fp->nr_band);
fp->threequarter_fs = openair0_cfg[0].threequarter_fs; fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
LOG_I(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n", LOG_I(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
......
...@@ -290,8 +290,11 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, ...@@ -290,8 +290,11 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
int Ncp) int Ncp)
{ {
fp->dl_CarrierFreq = (config->carrier_config.dl_frequency)*1e3 + (config->carrier_config.dl_bandwidth)*5e5; uint64_t dl_bw_khz = (12*config->carrier_config.dl_grid_size[config->ssb_config.scs_common])*(15<<config->ssb_config.scs_common);
fp->ul_CarrierFreq = (config->carrier_config.uplink_frequency)*1e3 + (config->carrier_config.uplink_bandwidth)*5e5; fp->dl_CarrierFreq = ((dl_bw_khz>>1) + config->carrier_config.dl_frequency)*1000 ;
uint64_t ul_bw_khz = (12*config->carrier_config.ul_grid_size[config->ssb_config.scs_common])*(15<<config->ssb_config.scs_common);
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + config->carrier_config.uplink_frequency)*1000 ;
fp->numerology_index = config->ssb_config.scs_common; fp->numerology_index = config->ssb_config.scs_common;
fp->N_RB_UL = config->carrier_config.ul_grid_size[fp->numerology_index]; fp->N_RB_UL = config->carrier_config.ul_grid_size[fp->numerology_index];
...@@ -317,6 +320,8 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, ...@@ -317,6 +320,8 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
set_scs_parameters(fp,fp->numerology_index); set_scs_parameters(fp,fp->numerology_index);
fp->slots_per_frame = 10* fp->slots_per_subframe;
fp->nb_antenna_ports_gNB = 1; // default value until overwritten by RRCConnectionReconfiguration fp->nb_antenna_ports_gNB = 1; // default value until overwritten by RRCConnectionReconfiguration
fp->nb_antennas_rx = 1; // default value until overwritten by RRCConnectionReconfiguration fp->nb_antennas_rx = 1; // default value until overwritten by RRCConnectionReconfiguration
fp->nb_antennas_tx = 1; // default value until overwritten by RRCConnectionReconfiguration fp->nb_antennas_tx = 1; // default value until overwritten by RRCConnectionReconfiguration
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment