Commit 84f238fd authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

Solve the Segmentation Fault in fill_rf_config function in nr-ru.c

parent f767dea2
...@@ -76,8 +76,10 @@ typedef struct { ...@@ -76,8 +76,10 @@ typedef struct {
typedef struct { typedef struct {
nfapi_uint16_tlv_t tx_antenna_ports; nfapi_uint16_tlv_t tx_antenna_ports;
nfapi_uint16_tlv_t rx_antenna_ports; nfapi_uint16_tlv_t rx_antenna_ports;
nfapi_uint16_tlv_t dl_carrierBandwidth; nfapi_uint16_tlv_t dl_channel_bandwidth;
nfapi_uint16_tlv_t ul_carrierBandwidth; nfapi_uint16_tlv_t ul_channel_bandwidth;
nfapi_uint16_tlv_t dl_BWP_carrierBandwidth;
nfapi_uint16_tlv_t ul_BWP_carrierBandwidth;
nfapi_uint16_tlv_t dl_locationAndBandwidth; nfapi_uint16_tlv_t dl_locationAndBandwidth;
nfapi_uint16_tlv_t ul_locationAndBandwidth; nfapi_uint16_tlv_t ul_locationAndBandwidth;
nfapi_uint16_tlv_t dl_BWP_SubcarrierSpacing; nfapi_uint16_tlv_t dl_BWP_SubcarrierSpacing;
......
...@@ -387,8 +387,8 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -387,8 +387,8 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
gNB_config->nfapi_config.earfcn.value = phy_config->cfg->nfapi_config.earfcn.value; //6600 gNB_config->nfapi_config.earfcn.value = phy_config->cfg->nfapi_config.earfcn.value; //6600
gNB_config->subframe_config.numerology_index_mu.value = phy_config->cfg->subframe_config.numerology_index_mu.value;//1 gNB_config->subframe_config.numerology_index_mu.value = phy_config->cfg->subframe_config.numerology_index_mu.value;//1
gNB_config->rf_config.tx_antenna_ports.value = phy_config->cfg->rf_config.tx_antenna_ports.value; //1 gNB_config->rf_config.tx_antenna_ports.value = phy_config->cfg->rf_config.tx_antenna_ports.value; //1
gNB_config->rf_config.dl_carrierBandwidth.value = phy_config->cfg->rf_config.dl_carrierBandwidth.value;//106; gNB_config->rf_config.dl_channel_bandwidth.value = phy_config->cfg->rf_config.dl_channel_bandwidth.value;//106;
gNB_config->rf_config.ul_carrierBandwidth.value = phy_config->cfg->rf_config.ul_carrierBandwidth.value;//106; gNB_config->rf_config.ul_channel_bandwidth.value = phy_config->cfg->rf_config.ul_channel_bandwidth.value;//106;
gNB_config->sch_config.half_frame_index.value = 0; gNB_config->sch_config.half_frame_index.value = 0;
gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0; gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0;
gNB_config->sch_config.n_ssb_crb.value = 86; gNB_config->sch_config.n_ssb_crb.value = 86;
...@@ -411,8 +411,8 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -411,8 +411,8 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
Mod_id, Mod_id,
CC_id, CC_id,
gNB_config->nfapi_config.rf_bands.rf_band[0], gNB_config->nfapi_config.rf_bands.rf_band[0],
gNB_config->rf_config.dl_carrierBandwidth.value, gNB_config->rf_config.dl_channel_bandwidth.value,
gNB_config->rf_config.ul_carrierBandwidth.value, gNB_config->rf_config.ul_channel_bandwidth.value,
gNB_config->sch_config.physical_cell_id.value, gNB_config->sch_config.physical_cell_id.value,
gNB_config->rf_config.tx_antenna_ports.value, gNB_config->rf_config.tx_antenna_ports.value,
fp->dl_CarrierFreq ); fp->dl_CarrierFreq );
......
...@@ -162,13 +162,13 @@ void config_common(int Mod_idP, ...@@ -162,13 +162,13 @@ void config_common(int Mod_idP,
//cfg->subframe_config.tl.tag = //cfg->subframe_config.tl.tag =
//cfg->num_tlv++; //cfg->num_tlv++;
cfg->rf_config.dl_carrierBandwidth.value = dl_BandwidthP; cfg->rf_config.dl_channel_bandwidth.value = dl_BandwidthP;
cfg->rf_config.dl_carrierBandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary
cfg->num_tlv++; cfg->num_tlv++;
LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
cfg->rf_config.ul_carrierBandwidth.value = dl_BandwidthP; cfg->rf_config.ul_channel_bandwidth.value = dl_BandwidthP;
cfg->rf_config.ul_carrierBandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; //temporary cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; //temporary
cfg->num_tlv++; cfg->num_tlv++;
//cfg->sch_config.half_frame_index.value = 0; Fix in PHY //cfg->sch_config.half_frame_index.value = 0; Fix in PHY
......
...@@ -1178,7 +1178,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { ...@@ -1178,7 +1178,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
int i; int i;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index
openair0_config_t *cfg = &ru->openair0_cfg; openair0_config_t *cfg = &ru->openair0_cfg;
int N_RB = gNB_config->rf_config.dl_channel_bandwidth.value; int N_RB = gNB_config->rf_config.dl_channel_bandwidth.value;
int mu = gNB_config->subframe_config.numerology_index_mu.value; int mu = gNB_config->subframe_config.numerology_index_mu.value;
......
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