Commit 5eb919e2 authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

Modify nr_phy_config_request for testing config. module

parent d78218b2
...@@ -1452,7 +1452,7 @@ set (MAC_SRC ...@@ -1452,7 +1452,7 @@ set (MAC_SRC
${MAC_DIR}/pre_processor.c ${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c ${MAC_DIR}/config.c
${MAC_DIR}/config_ue.c ${MAC_DIR}/config_ue.c
${NR_PHY_INTERFACE_DIR}/IF_Module.c ${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_MAC_DIR}/main.c ${NR_MAC_DIR}/main.c
${NR_MAC_DIR}/config.c ${NR_MAC_DIR}/config.c
) )
......
...@@ -57,12 +57,12 @@ int l1_north_init_gNB() { ...@@ -57,12 +57,12 @@ int l1_north_init_gNB() {
for (j=0;j<RC.nb_L1_CC[i];j++) { for (j=0;j<RC.nb_L1_CC[i];j++) {
AssertFatal(RC.gNB[i][j]!=NULL,"RC.gNB[%d][%d] is null\n",i,j); AssertFatal(RC.gNB[i][j]!=NULL,"RC.gNB[%d][%d] is null\n",i,j);
if ((RC.gNB[i][j]->if_inst = IF_Module_init(i))<0) return(-1); if ((RC.gNB[i][j]->if_inst = NR_IF_Module_init(i))<0) return(-1);
LOG_I(PHY,"%s() RC.gNB[%d][%d] installing callbacks\n", __FUNCTION__, i, j); LOG_I(PHY,"%s() RC.gNB[%d][%d] installing callbacks\n", __FUNCTION__, i, j);
RC.gNB[i][j]->if_inst->PHY_config_req = phy_config_request; RC.gNB[i][j]->if_inst->PHY_config_req = nr_phy_config_request;
nr_phy_config_request(RC.gNB[i][j]); nr_phy_config_request(&RC.gNB[i][j]->gNB_config);
RC.gNB[i][j]->if_inst->schedule_response = schedule_response; RC.gNB[i][j]->if_inst->schedule_response = schedule_response;
} }
} }
...@@ -338,7 +338,8 @@ void install_schedule_handlers(IF_Module_t *if_inst) ...@@ -338,7 +338,8 @@ void install_schedule_handlers(IF_Module_t *if_inst)
}*/ }*/
/// this function is a temporary addition for NR configuration /// this function is a temporary addition for NR configuration
void nr_phy_config_request(PHY_VARS_gNB *gNB)
/*void nr_phy_config_request(PHY_VARS_gNB *gNB)
{ {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_config_request_t *gNB_config = &gNB->gNB_config; nfapi_config_request_t *gNB_config = &gNB->gNB_config;
...@@ -367,4 +368,63 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB) ...@@ -367,4 +368,63 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB)
gNB->configured = 1; gNB->configured = 1;
LOG_I(PHY,"gNB configured\n"); LOG_I(PHY,"gNB configured\n");
}*/
void nr_phy_config_request(NR_PHY_Config_t *phy_config)
{
uint8_t Mod_id = phy_config->Mod_id;
int CC_id = phy_config->CC_id;
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id][CC_id]->frame_parms;
nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id][CC_id]->gNB_config;
gNB_config->nfapi_config.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22
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->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.ul_carrierBandwidth.value = phy_config->cfg->rf_config.ul_carrierBandwidth.value;//106;
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.n_ssb_crb.value = 86;
gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value;
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
gNB_config->subframe_config.duplex_mode.value = TDD;
}
else {
gNB_config->subframe_config.duplex_mode.value = FDD;
}
RC.gNB[Mod_id][CC_id]->mac_enabled = 1;
fp->dl_CarrierFreq = from_earfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.earfcn.value);
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp->threequarter_fs = 0;
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,gNB_tx_antenna_ports %d,DL freq %u)\n",
Mod_id,
CC_id,
gNB_config->nfapi_config.rf_bands.rf_band[0],
gNB_config->rf_config.dl_carrierBandwidth.value,
gNB_config->rf_config.ul_carrierBandwidth.value,
gNB_config->sch_config.physical_cell_id.value,
gNB_config->rf_config.tx_antenna_ports.value,
fp->dl_CarrierFreq );
nr_init_frame_parms(gNB_config, fp);
if (RC.gNB[Mod_id][CC_id]->configured == 1){
LOG_E(PHY,"Already gNB already configured, do nothing\n");
return;
}
RC.gNB[Mod_id][CC_id]->configured = 1;
LOG_I(PHY,"gNB %d/%d configured\n",Mod_id,CC_id);
} }
...@@ -378,7 +378,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame ...@@ -378,7 +378,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame
int nr_init_frame_parms_ue(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms_ue(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
void nr_phy_config_request(PHY_VARS_gNB *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB);
void phy_free_nr_gNB(PHY_VARS_gNB *gNB); void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
/** @} */ /** @} */
......
...@@ -114,7 +114,7 @@ typedef struct PHY_VARS_gNB_s { ...@@ -114,7 +114,7 @@ typedef struct PHY_VARS_gNB_s {
int (*te)(struct PHY_VARS_gNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *); int (*te)(struct PHY_VARS_gNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_gNB_s *eNB); int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_gNB_s *eNB);
uint8_t local_flag; uint8_t local_flag;
nfapi_config_request_t gNB_config; nfapi_nr_config_request_t gNB_config;
NR_DL_FRAME_PARMS frame_parms; NR_DL_FRAME_PARMS frame_parms;
PHY_MEASUREMENTS_gNB measurements; PHY_MEASUREMENTS_gNB measurements;
IF_Module_t *if_inst; IF_Module_t *if_inst;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "defs_eNB.h" #include "defs_eNB.h"
#include "defs_nr_common.h" #include "defs_nr_common.h"
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
typedef struct { typedef struct {
uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS]; uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS];
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include "nfapi_nr_interface.h" #include "nfapi_nr_interface.h"
#include "NR_PHY_INTERFACE/IF_Module.h" #include "NR_PHY_INTERFACE/NR_IF_Module.h"
#include "PHY/TOOLS/time_meas.h" #include "PHY/TOOLS/time_meas.h"
......
#include "openair1/PHY/defs_eNB.h" #include "openair1/PHY/defs_eNB.h"
#include "openair2/NR_PHY_INTERFACE/IF_Module.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
#include "openair1/PHY/phy_extern.h" #include "openair1/PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "LAYER2/NR_MAC_gNB/mac_proto.h"
......
...@@ -132,7 +132,7 @@ extern volatile int oai_exit; ...@@ -132,7 +132,7 @@ extern volatile int oai_exit;
extern void nr_phy_init_RU(RU_t*); extern void nr_phy_init_RU(RU_t*);
extern void nr_phy_free_RU(RU_t*); extern void nr_phy_free_RU(RU_t*);
extern void nr_phy_config_request(PHY_VARS_gNB *gNB); extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
void init_RU(char*); void init_RU(char*);
void stop_RU(int nb_ru); void stop_RU(int nb_ru);
......
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