Commit 8d3e20ca authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'oairu' of https://gitlab.eurecom.fr/oai/openairinterface5g into oairu

parents 7620fe9b 881ac549
...@@ -46,6 +46,8 @@ uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 }; ...@@ -46,6 +46,8 @@ uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 };
int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 }; int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 };
extern RAN_CONTEXT_t RC;
int int
l1_north_init_eNB () { l1_north_init_eNB () {
int i,j; int i,j;
......
...@@ -362,6 +362,7 @@ typedef struct L1_proc_t_s { ...@@ -362,6 +362,7 @@ typedef struct L1_proc_t_s {
pthread_t process_stats_thread; pthread_t process_stats_thread;
/// for waking up tx procedure /// for waking up tx procedure
RU_proc_t *ru_proc; RU_proc_t *ru_proc;
struct PHY_VARS_eNB_s *eNB;
} L1_proc_t; } L1_proc_t;
......
...@@ -32,11 +32,15 @@ ...@@ -32,11 +32,15 @@
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "nfapi/oai_integration/vendor_ext.h" #include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi_pnf_interface.h" #include "nfapi_pnf_interface.h"
#include "fapi_l1.h" #include "fapi_l1.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req); int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req); int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req); int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
#define MBMS_NFAPI_SCHEDULER #define MBMS_NFAPI_SCHEDULER
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
nfapi_ue_release_request_body_t release_rntis; nfapi_ue_release_request_body_t release_rntis;
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor) { int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor) {
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
#include <dlfcn.h> #include <dlfcn.h>
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
/*Array containing the Agent-MAC interfaces*/ /*Array containing the Agent-MAC interfaces*/
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
#include "flexran_agent_mac_internal.h" #include "flexran_agent_mac_internal.h"
#include "flexran_agent_mac_slice_verification.h" #include "flexran_agent_mac_slice_verification.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
extern SLIST_HEAD(flexran_so_handle, extern SLIST_HEAD(flexran_so_handle,
flexran_agent_so_handle_s) flexran_handles[NUM_MAX_ENB]; flexran_agent_so_handle_s) flexran_handles[NUM_MAX_ENB];
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#define NBIOT_INTERFACE_SOURCE #define NBIOT_INTERFACE_SOURCE
#include "NB_IoT_interface.h" #include "NB_IoT_interface.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define NBIOT_MODULENAME "NB_IoT" #define NBIOT_MODULENAME "NB_IoT"
#include "common/ran_context.h"
typedef void(*RCConfig_NbIoT_f_t)(RAN_CONTEXT_t *RC); typedef void(*RCConfig_NbIoT_f_t)(RAN_CONTEXT_t *RC);
#define NBIOT_RCCONFIG_FNAME "RCConfig_NbIoT" #define NBIOT_RCCONFIG_FNAME "RCConfig_NbIoT"
......
...@@ -63,6 +63,8 @@ extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t ...@@ -63,6 +63,8 @@ extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t
extern char *parallel_config; extern char *parallel_config;
extern char *worker_config; extern char *worker_config;
RAN_CONTEXT_t RC;
void RCconfig_flexran() { void RCconfig_flexran() {
/* get number of eNBs */ /* get number of eNBs */
paramdef_t ENBSParams[] = ENBSPARAMS_DESC; paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
#include <pthread.h> #include <pthread.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
int agent_task_created = 0; int agent_task_created = 0;
/* /*
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller * enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
......
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "rrc_eNB_UE_context.h" #include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
/* /*
* message primitives * message primitives
*/ */
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#include "s1ap_eNB_management_procedures.h" #include "s1ap_eNB_management_procedures.h"
#include "openair2/LAYER2/MAC/slicing/slicing.h" #include "openair2/LAYER2/MAC/slicing/slicing.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
static inline int phy_is_present(mid_t mod_id, uint8_t cc_id) { static inline int phy_is_present(mid_t mod_id, uint8_t cc_id) {
return RC.eNB && RC.eNB[mod_id] && RC.eNB[mod_id][cc_id]; return RC.eNB && RC.eNB[mod_id] && RC.eNB[mod_id][cc_id];
} }
......
...@@ -77,4 +77,8 @@ extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; ...@@ -77,4 +77,8 @@ extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern mac_rlc_am_muilist_t rlc_am_mui; extern mac_rlc_am_muilist_t rlc_am_mui;
extern SCHEDULER_MODES global_scheduler_mode; extern SCHEDULER_MODES global_scheduler_mode;
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
#endif //DEF_H #endif //DEF_H
...@@ -19,6 +19,8 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); ...@@ -19,6 +19,8 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
extern UL_RCC_IND_t UL_RCC_INFO; extern UL_RCC_IND_t UL_RCC_INFO;
extern RAN_CONTEXT_t RC;
uint16_t frame_cnt=0; uint16_t frame_cnt=0;
void handle_rach(UL_IND_t *UL_info) { void handle_rach(UL_IND_t *UL_info) {
int i; int i;
......
...@@ -96,6 +96,9 @@ ...@@ -96,6 +96,9 @@
#include "T.h" #include "T.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
//#define DEBUG_THREADS 1 //#define DEBUG_THREADS 1
//#define USRP_DEBUG 1 //#define USRP_DEBUG 1
...@@ -323,7 +326,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -323,7 +326,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
static void *L1_thread_tx(void *param) { static void *L1_thread_tx(void *param) {
L1_proc_t *eNB_proc = (L1_proc_t *)param; L1_proc_t *eNB_proc = (L1_proc_t *)param;
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx; L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id]; PHY_VARS_eNB *eNB = eNB_proc->eNB;
char thread_name[100]; char thread_name[100];
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1); sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
thread_top_init(thread_name,1,470000,500000,500000); thread_top_init(thread_name,1,470000,500000,500000);
...@@ -858,6 +861,7 @@ void init_eNB_proc(int inst) { ...@@ -858,6 +861,7 @@ void init_eNB_proc(int inst) {
L1_proc_tx->instance_cnt = -1; L1_proc_tx->instance_cnt = -1;
L1_proc->instance_cnt_RUs = 0; L1_proc->instance_cnt_RUs = 0;
L1_proc_tx->instance_cnt_RUs = 0; L1_proc_tx->instance_cnt_RUs = 0;
proc->eNB = eNB;
proc->instance_cnt_prach = -1; proc->instance_cnt_prach = -1;
proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_asynch_rxtx = -1;
proc->instance_cnt_synch = -1; proc->instance_cnt_synch = -1;
......
...@@ -3041,6 +3041,7 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas ...@@ -3041,6 +3041,7 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas
ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
*ru_mask= (*ru_mask)|(1<<j);
}// j=0..num_rus }// j=0..num_rus
} }
......
...@@ -169,6 +169,8 @@ extern void print_opp_meas(void); ...@@ -169,6 +169,8 @@ extern void print_opp_meas(void);
extern void init_eNB_afterRU(void); extern void init_eNB_afterRU(void);
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
...@@ -426,7 +428,6 @@ int stop_L1L2(module_id_t enb_id) { ...@@ -426,7 +428,6 @@ int stop_L1L2(module_id_t enb_id) {
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2() * Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
*/ */
int restart_L1L2(module_id_t enb_id) { int restart_L1L2(module_id_t enb_id) {
RU_t *ru = RC.ru[enb_id];
int cc_id; int cc_id;
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL;
LOG_W(ENB_APP, "restarting lte-softmodem\n"); LOG_W(ENB_APP, "restarting lte-softmodem\n");
...@@ -437,10 +438,12 @@ int restart_L1L2(module_id_t enb_id) { ...@@ -437,10 +438,12 @@ int restart_L1L2(module_id_t enb_id) {
for (cc_id = 0; cc_id < RC.nb_L1_CC[enb_id]; cc_id++) { for (cc_id = 0; cc_id < RC.nb_L1_CC[enb_id]; cc_id++) {
RC.eNB[enb_id][cc_id]->configured = 0; RC.eNB[enb_id][cc_id]->configured = 0;
for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
RC.ru_mask |= (1 << ru_idx);
set_function_spec_param(RC.ru[ru_idx]);
}
} }
RC.ru_mask |= (1 << ru->idx);
set_function_spec_param(RC.ru[enb_id]);
/* reset the list of connected UEs in the MAC, since in this process with /* reset the list of connected UEs in the MAC, since in this process with
* loose all UEs (have to reconnect) */ * loose all UEs (have to reconnect) */
init_UE_info(&RC.mac[enb_id]->UE_info); init_UE_info(&RC.mac[enb_id]->UE_info);
...@@ -461,9 +464,15 @@ int restart_L1L2(module_id_t enb_id) { ...@@ -461,9 +464,15 @@ int restart_L1L2(module_id_t enb_id) {
/* TODO XForms might need to be restarted, but it is currently (09/02/18) /* TODO XForms might need to be restarted, but it is currently (09/02/18)
* broken, so we cannot test it */ * broken, so we cannot test it */
wait_eNBs(); wait_eNBs();
init_RU_proc(ru); for (int cc_id=0;cc_id<RC.nb_L1_CC[enb_id]; cc_id++) {
ru->rf_map.card = 0; for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/ int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
init_RU_proc(RC.ru[ru_idx]);
RC.ru[ru_idx]->rf_map.card = 0;
RC.ru[ru_idx]->rf_map.chain = 0; /* CC_id + chain_offset;*/
}
}
wait_RUs(); wait_RUs();
init_eNB_afterRU(); init_eNB_afterRU();
printf("Sending sync to all threads\n"); printf("Sending sync to all threads\n");
...@@ -576,7 +585,7 @@ int main ( int argc, char **argv ) ...@@ -576,7 +585,7 @@ int main ( int argc, char **argv )
/* We need to read RU configuration before FlexRAN starts so it knows what /* We need to read RU configuration before FlexRAN starts so it knows what
* splits to report. Actual RU start comes later. */ * splits to report. Actual RU start comes later. */
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) { if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
RCconfig_RU(); RC.ru = RCconfig_RU(RC.nb_RU,RC.nb_L1_inst,RC.eNB,&RC.ru_mask,&RC.ru_mutex,&RC.ru_cond);
LOG_I(PHY, LOG_I(PHY,
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n", "number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
RC.nb_L1_inst, RC.nb_RU, get_nprocs()); RC.nb_L1_inst, RC.nb_RU, get_nprocs());
...@@ -679,7 +688,7 @@ int main ( int argc, char **argv ) ...@@ -679,7 +688,7 @@ int main ( int argc, char **argv )
// some initialization is necessary and init_ru_vnf do this. // some initialization is necessary and init_ru_vnf do this.
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) { if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync); init_RU(RC.ru,RC.nb_RU,RC.eNB,RC.nb_L1_inst,RC.nb_L1_CC,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.card=0;
......
...@@ -171,7 +171,7 @@ extern void init_RU_proc(RU_t *ru); ...@@ -171,7 +171,7 @@ extern void init_RU_proc(RU_t *ru);
extern void stop_RU(int nb_ru); extern void stop_RU(int nb_ru);
extern void kill_RU_proc(RU_t *ru); extern void kill_RU_proc(RU_t *ru);
extern void set_function_spec_param(RU_t *ru); extern void set_function_spec_param(RU_t *ru);
extern void init_RU(char *, int send_dmrssync); extern void init_RU(RU_t **rup,int nb_RU,PHY_VARS_eNB ***eNBp,int nb_L1,int *nb_CC,char *rf_config_file, int send_dmrssync);
// In lte-ue.c // In lte-ue.c
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
......
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