Commit bedee9e3 authored by Guy De Souza's avatar Guy De Souza
Browse files

RRC branch merge fix

parent 3e54d86e
...@@ -229,7 +229,7 @@ void phy_config_request(PHY_Config_t *phy_config) { ...@@ -229,7 +229,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
uint8_t Mod_id = phy_config->Mod_id; uint8_t Mod_id = phy_config->Mod_id;
int CC_id = phy_config->CC_id; int CC_id = phy_config->CC_id;
nfapi_config_request_t *cfg = phy_config->cfg; nfapi_nr_config_request_t *cfg = phy_config->cfg;
NR_DL_FRAME_PARMS *fp; NR_DL_FRAME_PARMS *fp;
PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two}; PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two};
...@@ -344,7 +344,7 @@ void install_schedule_handlers(IF_Module_t *if_inst) ...@@ -344,7 +344,7 @@ void install_schedule_handlers(IF_Module_t *if_inst)
/*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_nr_config_request_t *gNB_config = &gNB->gNB_config;
//overwrite for new NR parameters //overwrite for new NR parameters
gNB_config->nfapi_config.rf_bands.rf_band[0] = 22; gNB_config->nfapi_config.rf_bands.rf_band[0] = 22;
......
...@@ -151,7 +151,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config, ...@@ -151,7 +151,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
return 0; return 0;
} }
int nr_init_frame_parms_ue(nfapi_config_request_t* config, int nr_init_frame_parms_ue(nfapi_nr_config_request_t* config,
NR_DL_FRAME_PARMS *frame_parms) NR_DL_FRAME_PARMS *frame_parms)
{ {
......
...@@ -375,7 +375,7 @@ void phy_config_request(PHY_Config_t *phy_config); ...@@ -375,7 +375,7 @@ void phy_config_request(PHY_Config_t *phy_config);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms(nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms(nfapi_nr_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); int nr_init_frame_parms_ue(nfapi_nr_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(NR_PHY_Config_t *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB);
......
...@@ -130,7 +130,7 @@ uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc, ...@@ -130,7 +130,7 @@ uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
int32_t** txdataF, int32_t** txdataF,
int16_t amp, int16_t amp,
NR_DL_FRAME_PARMS* frame_parms, NR_DL_FRAME_PARMS* frame_parms,
nfapi_config_request_t* config) nfapi_nr_config_request_t* config)
{ {
return 0; return 0;
} }
...@@ -72,6 +72,6 @@ uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc, ...@@ -72,6 +72,6 @@ uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
int32_t** txdataF, int32_t** txdataF,
int16_t amp, int16_t amp,
NR_DL_FRAME_PARMS* frame_parms, NR_DL_FRAME_PARMS* frame_parms,
nfapi_config_request_t* config) nfapi_nr_config_request_t* config)
#endif //__PHY_NR_TRANSPORT_DCI__H #endif //__PHY_NR_TRANSPORT_DCI__H
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
#include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h"
extern openair0_config_t openair0_cfg[]; extern openair0_config_t openair0_cfg[];
static nfapi_config_request_t config_t; static nfapi_nr_config_request_t config_t;
static nfapi_config_request_t* config =&config_t; static nfapi_nr_config_request_t* config =&config_t;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms); void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms);
//#define DEBUG_INITIAL_SYNCH //#define DEBUG_INITIAL_SYNCH
...@@ -164,7 +164,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) ...@@ -164,7 +164,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int ret=-1; int ret=-1;
int aarx,rx_power=0; int aarx,rx_power=0;
//nfapi_config_request_t* config; //nfapi_nr_config_request_t* config;
/*offset parameters to be updated from higher layer */ /*offset parameters to be updated from higher layer */
k_ssb =0; k_ssb =0;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define __PHY_DEFS_NR_COMMON__H__ #define __PHY_DEFS_NR_COMMON__H__
#include "defs_common.h" #include "defs_common.h"
#include "nfapi_interface.h" #include "nfapi_nr_interface.h"
#include "impl_defs_nr.h" #include "impl_defs_nr.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include "PHY_INTERFACE/phy_interface.h" #include "PHY_INTERFACE/phy_interface.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
nr_subframe_t nr_subframe_select(nfapi_nr_config_request_t *cfg,unsigned char subframe);
lte_subframe_t nr_subframe_select (nfapi_nr_config_request_t *cfg, unsigned char subframe);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp); void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas); void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas);
void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx); void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx);
......
#ifndef _RRC_LIST_H_
#define _RRC_LIST_H_
#define RRC_LIST_TYPE(T, N) \
struct { \
T *entries[N]; \
int next[N]; \
int prev[N]; \
int start; \
int count; \
}
// initial function for the certain list, storage number of entry, initial pointer and corresponding links
#define RRC_LIST_INIT(list, c) \
do { \
int iterator; \
(list).count = (c); \
for(iterator=0; iterator<c; ++iterator){ \
(list).entries[iterator] = NULL; \
(list).next[iterator] = -1; \
(list).prev[iterator] = -1; \
(list).start = -1; \
} \
}while(0)
// check the entry by id first then update or create new entry.
#define RRC_LIST_MOD_ADD(list, new, id_name) \
do { \
int iterator; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
if((new)->id_name == (list).entries[iterator]->id_name){ \
(list).entries[iterator] = (new); \
break; \
} \
} \
if(iterator==-1){ \
for(iterator=0; iterator<(list).count; ++iterator){ \
if((list).entries[iterator] == NULL){ \
(list).next[iterator] = (list).start; \
(list).prev[iterator] = -1; \
if((list).start != -1){ \
(list).prev[list.start] = iterator; \
} \
(list).start = iterator; \
(list).entries[iterator] = (new); \
break; \
} \
} \
} \
}while(0)
// search entries by id, unlink from the list and output free pointer for upper function to release memory
#define RRC_LIST_MOD_REL(list, id_name, id, free) \
do{ \
int iterator; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
if(id == (list).entries[iterator]->id_name){ \
if((list).prev[iterator] == -1){ \
(list).start = (list).next[iterator]; \
}else{ \
(list).next[(list).prev[iterator]] = (list).next[iterator]; \
} \
if((list).next[iterator] != -1){ \
(list).prev[(list).next[iterator]] = (list).prev[iterator]; \
} \
(free) = (list).entries[iterator]; \
(list).entries[iterator] = NULL; \
break; \
} \
} \
}while(0)
#define RRC_LIST_FOREACH(list, i) \
for((i)=(list).start; (i) != -1; (i)=(list).next[i])
#define RRC_LIST_ENTRY(list, i) \
list.entries[i]
#endif
\ No newline at end of file
...@@ -600,7 +600,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { ...@@ -600,7 +600,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
uint16_t packet_type; uint16_t packet_type;
...@@ -782,7 +782,7 @@ void tx_rf(RU_t *ru) { ...@@ -782,7 +782,7 @@ void tx_rf(RU_t *ru) {
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
void *txp[ru->nb_tx]; void *txp[ru->nb_tx];
unsigned int txs; unsigned int txs;
int i; int i;
...@@ -1281,7 +1281,7 @@ int setup_RU_buffers(RU_t *ru) { ...@@ -1281,7 +1281,7 @@ int setup_RU_buffers(RU_t *ru) {
//uint16_t N_TA_offset = 0; //uint16_t N_TA_offset = 0;
NR_DL_FRAME_PARMS *frame_parms; NR_DL_FRAME_PARMS *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
if (ru) { if (ru) {
frame_parms = ru->nr_frame_parms; frame_parms = ru->nr_frame_parms;
...@@ -1841,7 +1841,7 @@ void configure_ru(int idx, ...@@ -1841,7 +1841,7 @@ void configure_ru(int idx,
RU_t *ru = RC.ru[idx]; RU_t *ru = RC.ru[idx];
RRU_config_t *config = (RRU_config_t *)arg; RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg; RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config;
int ret; int ret;
LOG_I(PHY, "Received capabilities from RRU %d\n",idx); LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
...@@ -1885,7 +1885,7 @@ void configure_rru(int idx, ...@@ -1885,7 +1885,7 @@ void configure_rru(int idx,
RRU_config_t *config = (RRU_config_t *)arg; RRU_config_t *config = (RRU_config_t *)arg;
RU_t *ru = RC.ru[idx]; RU_t *ru = RC.ru[idx];
nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config;
ru->nr_frame_parms->eutra_band = config->band_list[0]; ru->nr_frame_parms->eutra_band = config->band_list[0];
ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0]; ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0];
......
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
#include "T.h" #include "T.h"
extern double cpuf; extern double cpuf;
static nfapi_config_request_t config_t; static nfapi_nr_config_request_t config_t;
static nfapi_config_request_t* config =&config_t; static nfapi_nr_config_request_t* config =&config_t;
#define FRAME_PERIOD 100000000ULL #define FRAME_PERIOD 100000000ULL
#define DAQ_PERIOD 66667ULL #define DAQ_PERIOD 66667ULL
......
...@@ -181,7 +181,7 @@ int otg_enabled; ...@@ -181,7 +181,7 @@ int otg_enabled;
//int number_of_cards = 1; //int number_of_cards = 1;
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
static nfapi_config_request_t *config[MAX_NUM_CCs]; static nfapi_nr_config_request_t *config[MAX_NUM_CCs];
int16_t node_synch_ref[MAX_NUM_CCs]; int16_t node_synch_ref[MAX_NUM_CCs];
uint32_t target_dl_mcs = 28; //maximum allowed mcs uint32_t target_dl_mcs = 28; //maximum allowed mcs
...@@ -245,7 +245,7 @@ int emulate_rf = 0; ...@@ -245,7 +245,7 @@ int emulate_rf = 0;
threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
...@@ -551,7 +551,7 @@ static void get_options (int argc, char **argv) { ...@@ -551,7 +551,7 @@ static void get_options (int argc, char **argv) {
uint32_t online_log_messages; uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity; uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv; uint32_t start_telnetsrv;
nfapi_config_request_t *config[MAX_NUM_CCs]; nfapi_nr_config_request_t *config[MAX_NUM_CCs];
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
...@@ -628,7 +628,7 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */ ...@@ -628,7 +628,7 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
#endif #endif
void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
int CC_id; int CC_id;
...@@ -636,7 +636,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ ...@@ -636,7 +636,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS));
/* Set some default values that may be overwritten while reading options */ /* Set some default values that may be overwritten while reading options */
frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS));
config[CC_id] = (nfapi_config_request_t*) malloc(sizeof(nfapi_config_request_t)); config[CC_id] = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t));
config[CC_id]->subframe_config.numerology_index_mu.value =1; config[CC_id]->subframe_config.numerology_index_mu.value =1;
config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD
config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
...@@ -695,7 +695,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ ...@@ -695,7 +695,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
} }
void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms) { void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms) {
//int CC_id; //int CC_id;
...@@ -703,7 +703,7 @@ void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_ ...@@ -703,7 +703,7 @@ void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_
frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS));
/* Set some default values that may be overwritten while reading options */ /* Set some default values that may be overwritten while reading options */
frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS));
config = (nfapi_config_request_t*) malloc(sizeof(nfapi_config_request_t)); config = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t));
config->subframe_config.numerology_index_mu.value =1; config->subframe_config.numerology_index_mu.value =1;
config->subframe_config.duplex_mode.value = 1; //FDD config->subframe_config.duplex_mode.value = 1; //FDD
config->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL config->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
......
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