Merge branch 'fhg-ta' into fhg-ra

This commit is contained in:
cig
2020-02-03 10:45:29 +01:00
359 changed files with 41429 additions and 5532 deletions
@@ -1147,7 +1147,6 @@ int device_init(openair0_device *device,
device->trx_set_gains_func = trx_brf_set_gains;
device->openair0_cfg = openair0_cfg;
device->priv = (void *)brf;
device->uhd_set_thread_priority = NULL;
calibrate_rf(device);
+2 -6
View File
@@ -56,7 +56,7 @@ typedef int64_t openair0_timestamp;
typedef volatile int64_t openair0_vtimestamp;
/*!\brief structrue holds the parameters to configure USRP devices*/
/*!\brief structure holds the parameters to configure USRP devices*/
typedef struct openair0_device_t openair0_device;
//#define USRP_GAIN_OFFSET (56.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output
@@ -287,7 +287,7 @@ struct openair0_device_t {
/*!brief Type of this device */
dev_type_t type;
/*!brief Transport protocol type that the device suppports (in case I/Q samples need to be transported) */
/*!brief Transport protocol type that the device supports (in case I/Q samples need to be transported) */
transport_type_t transp_type;
/*!brief Type of the device's host (RAU/RRU) */
@@ -400,10 +400,6 @@ struct openair0_device_t {
* \param arg pointer to capabilities or configuration
*/
void (*configure_rru)(int idx, void *arg);
/*! \brief set UHD thread priority
*/
void (*uhd_set_thread_priority)(void);
};
/* type of device init function, implemented in shared lib */
@@ -417,7 +417,6 @@ int transport_init(openair0_device *device,
device->trx_stop_func = trx_eth_stop;
device->trx_set_freq_func = trx_eth_set_freq;
device->trx_set_gains_func = trx_eth_set_gains;
device->uhd_set_thread_priority = NULL;
if (eth->flags == ETH_RAW_MODE) {
device->trx_write_func = trx_eth_write_raw;
@@ -405,7 +405,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
device->trx_stop_func = trx_lms_stop;
device->trx_set_freq_func = trx_lms_set_freq;
device->trx_set_gains_func = trx_lms_set_gains;
device->uhd_set_thread_priority = NULL;
device->openair0_cfg = openair0_cfg;
@@ -706,7 +706,6 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
device->trx_stop_func = trx_sodera_stop;
device->trx_set_freq_func = trx_sodera_set_freq;
device->trx_set_gains_func = trx_sodera_set_gains;
device->uhd_set_thread_priority = NULL;
s->sample_rate = openair0_cfg[0].sample_rate;
s->channelscount = openair0_cfg[0].rx_num_channels;
@@ -913,15 +913,6 @@ int trx_usrp_reset_stats(openair0_device *device) {
return(0);
}
/*! \brief Set uhd priority
*/
static void uhd_set_thread_priority(void) {
uhd::set_thread_priority_safe(1.0);
}
void noop_func(void) {
return;
}
extern "C" {
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
LOG_D(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs);
@@ -961,7 +952,6 @@ extern "C" {
set_rx_gain_offset(&openair0_cfg[0],0,bw_gain_adjust);
device->trx_write_func = trx_usrp_write_recplay;
device->trx_read_func = trx_usrp_read_recplay;
device->uhd_set_thread_priority = noop_func;
std::cerr << "USRP device initialized in subframes replay mode for " << s->recplay_state->u_sf_loops << " loops. Use mmap="
<< s->recplay_state->use_mmap << std::endl;
} else {
@@ -1314,7 +1304,6 @@ extern "C" {
LOG_I(HW,"Device timestamp: %f...\n", s->usrp->get_time_now().get_real_secs());
device->trx_write_func = trx_usrp_write;
device->trx_read_func = trx_usrp_read;
device->uhd_set_thread_priority = uhd_set_thread_priority;
s->sample_rate = openair0_cfg[0].sample_rate;
// TODO:
-1
View File
@@ -267,7 +267,6 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device->trx_set_gains_func = tcp_bridge_set_gains;
device->trx_write_func = tcp_bridge_write;
device->trx_read_func = tcp_bridge_read;
device->uhd_set_thread_priority = NULL;
device->priv = tcp_bridge;
-1
View File
@@ -413,7 +413,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_set_freq_func = tcp_bridge_set_freq;
device->trx_set_gains_func = tcp_bridge_set_gains;
device->trx_write_func = tcp_bridge_write;
device->uhd_set_thread_priority = NULL;
if (tcp_bridge->is_enb) {
device->trx_read_func = tcp_bridge_read;
+9 -11
View File
@@ -19,24 +19,22 @@
* contact@openairinterface.org
*/
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# include "create_nr_tasks.h"
# include "common/utils/LOG/log.h"
# ifdef OPENAIR2
# if defined(ENABLE_USE_MME)
# include "sctp_eNB_task.h"
# include "s1ap_eNB.h"
# include "nas_ue_task.h"
# include "udp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# endif
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
# if ENABLE_RAL
# include "lteRALue.h"
# include "lteRALenb.h"
# endif
# include "RRC/NR/nr_rrc_defs.h"
#include "RRC/NR/nr_rrc_defs.h"
# endif
# include "gnb_app.h"
@@ -61,7 +59,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
/*
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
if (gnb_nb > 0) {
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
@@ -85,7 +83,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
}
# endif
}
*/
if (gnb_nb > 0) {
+12 -6
View File
@@ -26,11 +26,11 @@
# include "common/ran_context.h"
#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
@@ -40,6 +40,7 @@
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
# include "openair2/LAYER2/MAC/mac_proto.h"
extern RAN_CONTEXT_t RC;
@@ -63,7 +64,6 @@ int create_tasks(uint32_t enb_nb) {
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
}
if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
@@ -91,5 +91,11 @@ int create_tasks(uint32_t enb_nb) {
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
}
if (!NODE_IS_CU(type)) {
LOG_I(MAC,"Creating MAC eNB Task\n");
rc = itti_create_task(TASK_MAC_ENB, mac_enb_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB failed\n");
}
return 0;
}
+1
View File
@@ -28,6 +28,7 @@ extern void *l2l1_task(void *arg);
int create_tasks(uint32_t enb_nb);
int create_tasks_ue(uint32_t ue_nb);
int create_tasks_mbms(uint32_t enb_nb);
#endif
#endif /* CREATE_TASKS_H_ */
+148
View File
@@ -0,0 +1,148 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "targets/RT/USER/lte-softmodem.h"
# include "common/ran_context.h"
#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#include "m2ap_eNB.h"
#include "m2ap_MCE.h"
#include "m3ap_MME.h"
#include "m3ap_MCE.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
#endif
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
# include "mce_app.h"
# include "mme_app.h"
//extern RAN_CONTEXT_t RC;
int create_tasks_mbms(uint32_t enb_nb) {
// LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
// ngran_node_t type = RC.rrc[0]->node_type;
int rc;
if (enb_nb == 0) return 0;
if(!EPC_MODE_ENABLED){
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
}
LOG_I(MME_APP, "Creating MME_APP eNB Task\n");
rc = itti_create_task (TASK_MME_APP, MME_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MME APP failed\n");
if (is_m3ap_MME_enabled()) {
rc = itti_create_task(TASK_M3AP_MME, m3ap_MME_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MME failed\n");
}
LOG_I(MCE_APP, "Creating MCE_APP eNB Task\n");
rc = itti_create_task (TASK_MCE_APP, MCE_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MCE APP failed\n");
// LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
// rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
// AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
//
// LOG_I(RRC,"Creating RRC eNB Task\n");
// rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
// AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
//
// if (EPC_MODE_ENABLED) {
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
// }
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
//
//
// if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) {
// rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for S1AP failed\n");
// if (!(get_softmodem_params()->emulate_rf)){
// rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for UDP failed\n");
// }
// rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
// if (is_x2ap_enabled()) {
// rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
// AssertFatal(rc >= 0, "Create task for X2AP failed\n");
// } else {
// LOG_I(X2AP, "X2AP is disabled.\n");
// }
// }
////
if(!EPC_MODE_ENABLED){
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
///
// if (NODE_IS_CU(type)) {
// rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
// AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
// }
//
// if (NODE_IS_DU(type)) {
// rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
// AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
// }
//
if (is_m3ap_MCE_enabled()) {
rc = itti_create_task(TASK_M3AP_MCE, m3ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MCE failed\n");
}
if (is_m2ap_MCE_enabled()) {
rc = itti_create_task(TASK_M2AP_MCE, m2ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
if (is_m2ap_eNB_enabled()) {
rc = itti_create_task(TASK_M2AP_ENB, m2ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
return 0;
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef CREATE_TASKS_H_
#define CREATE_TASKS_H_
#if defined(ENABLE_ITTI)
/* External declaration of L2L1 task that depend on the target */
extern void *l2l1_task(void *arg);
int create_tasks(uint32_t enb_nb);
int create_tasks_ue(uint32_t ue_nb);
int create_tasks_mbms(uint32_t enb_nb);
#endif
#endif /* CREATE_TASKS_H_ */
+4 -3
View File
@@ -512,17 +512,16 @@ int wakeup_txfh(PHY_VARS_eNB *eNB,
continue;//hacking only works when all RU_tx works on the same subframe #TODO: adding mask stuff
}
AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_eNBs))==0,"ERROR pthread_mutex_lock failed on mutex_eNBs L1_thread_tx with ret=%d\n",ret);
if (ru_proc->instance_cnt_eNBs == 0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->tti_tx, proc->frame_rx, proc->subframe_rx);
AssertFatal((ret=pthread_mutex_lock(&eNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
eNB->proc.RU_mask_tx = 0;
AssertFatal((ret=pthread_mutex_unlock(&eNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_eNBs ))==0,"mutex_unlock return %d\n",ret);
return(-1);
}
AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_eNBs))==0,"ERROR pthread_mutex_lock failed on mutex_eNBs L1_thread_tx with ret=%d\n",ret);
ru_proc->instance_cnt_eNBs = 0;
ru_proc->timestamp_tx = timestamp_tx;
ru_proc->tti_tx = subframe_tx;
@@ -1255,6 +1254,8 @@ void init_eNB(int single_thread_flag,
AssertFatal((eNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface");
eNB->if_inst->schedule_response = schedule_response;
eNB->if_inst->PHY_config_req = phy_config_request;
eNB->if_inst->PHY_config_update_sib2_req = phy_config_update_sib2_request;
eNB->if_inst->PHY_config_update_sib13_req = phy_config_update_sib13_request;
memset((void *)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
memset((void *)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
LOG_I(PHY,"Setting indication lists\n");
+15 -10
View File
@@ -97,6 +97,8 @@ static int DEFBFW[] = {0x00007fff};
#include "pdcp.h"
#define MBMS_EXPERIMENTAL
extern volatile int oai_exit;
extern int emulate_rf;
extern int numerology;
@@ -1881,10 +1883,19 @@ static void *ru_thread( void *param ) {
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_pre_scd))==0,"[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
#endif
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_L1s(ru);
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_L1s(ru);
#ifdef MBMS_EXPERIMENTAL
//Workaround ... this must be properly handled
if(ru->if_south==LOCAL_RF && ru->function==eNodeB_3GPP && RC.eNB[0][0]!=NULL){
if(ru->frame_parms->num_MBSFN_config!=RC.eNB[0][0]->frame_parms.num_MBSFN_config){
ru->frame_parms = &RC.eNB[0][0]->frame_parms;//->frame_parms;
LOG_W(PHY,"RU MBSFN SF PARAMS Updated\n");
}
}
#endif
#ifndef PHY_TX_THREAD
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0) {
@@ -2672,13 +2683,9 @@ void init_RU(char *rf_config_file, clock_source_t clock_source, clock_source_t t
PHY_VARS_eNB *eNB0 = (PHY_VARS_eNB *)NULL;
LTE_DL_FRAME_PARMS *fp = (LTE_DL_FRAME_PARMS *)NULL;
// create status mask
RC.ru_mask = 0;
RC.ru_mask= (1 << RC.nb_RU) - 1;
pthread_mutex_init(&RC.ru_mutex,NULL);
pthread_cond_init(&RC.ru_cond,NULL);
// read in configuration file)
printf("configuring RU from file\n");
RCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
if (RC.nb_CC != 0)
for (i=0; i<RC.nb_L1_inst; i++)
@@ -2908,8 +2915,6 @@ void RCconfig_RU(void) {
if ( RUParamList.numelt > 0) {
RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *));
RC.ru_mask=(1<<RC.nb_RU) - 1;
printf("Set RU mask to %lx\n",RC.ru_mask);
for (int j = 0; j < RC.nb_RU; j++) {
RC.ru[j] = (RU_t *)malloc(sizeof(RU_t));
+19 -5
View File
@@ -494,6 +494,8 @@ void init_pdcp(void) {
if (IS_SOFTMODEM_NOS1)
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_W_MBMS_BIT;
pdcp_module_init(pdcp_initmask);
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
@@ -583,9 +585,22 @@ int main ( int argc, char **argv )
/* Read configuration */
if (RC.nb_inst > 0) {
read_config_and_init();
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_flexran();
} else {
printf("RC.nb_inst = 0, Initializing L1\n");
RCconfig_L1();
}
/* We need to read RU configuration before FlexRAN starts so it knows what
* splits to report. Actual RU start comes later. */
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
RCconfig_RU();
LOG_I(PHY,
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
RC.nb_L1_inst, RC.nb_RU, get_nprocs());
}
if (RC.nb_inst > 0) {
/* Start the agent. If it is turned off in the configuration, it won't start */
for (i = 0; i < RC.nb_inst; i++) {
flexran_agent_start(i);
}
@@ -605,9 +620,6 @@ int main ( int argc, char **argv )
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
node_type = RC.rrc[0]->node_type;
} else {
printf("RC.nb_inst = 0, Initializing L1\n");
RCconfig_L1();
}
if (RC.nb_inst > 0 && NODE_IS_CU(node_type)) {
@@ -707,6 +719,8 @@ int main ( int argc, char **argv )
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
}
create_tasks_mbms(1);
// wait for end of program
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
// CI -- Flushing the std outputs for the previous marker to show on the eNB / DU / CU log file
+83 -42
View File
@@ -59,6 +59,7 @@
#include "UTIL/MATH/oml.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "lte-softmodem.h"
#include "common/config/config_userapi.h"
#include "T.h"
@@ -208,10 +209,10 @@ char uecap_xer[1024];
void init_thread(int sched_runtime,
int sched_deadline,
int sched_fifo,
cpu_set_t *cpuset,
char *name)
int sched_deadline,
int sched_fifo,
cpu_set_t *cpuset,
char *name)
{
#ifdef DEADLINE_SCHEDULER
@@ -255,16 +256,16 @@ void init_thread(int sched_runtime,
}
void init_UE(int nb_inst,
int eMBMS_active,
int uecap_xer_in,
int timing_correction,
int phy_test,
int UE_scan,
int UE_scan_carrier,
runmode_t mode,
int rxgain,
int txpowermax,
LTE_DL_FRAME_PARMS *fp0)
int eMBMS_active,
int uecap_xer_in,
int timing_correction,
int phy_test,
int UE_scan,
int UE_scan_carrier,
runmode_t mode,
int rxgain,
int txpowermax,
LTE_DL_FRAME_PARMS *fp0)
{
PHY_VARS_UE *UE;
int inst;
@@ -397,9 +398,9 @@ void init_UE(int nb_inst,
// Initiating all UEs within a single set of threads for PHY_STUB. Future extensions -> multiple
// set of threads for multiple UEs.
void init_UE_stub_single_thread(int nb_inst,
int eMBMS_active,
int uecap_xer_in,
char *emul_iface)
int eMBMS_active,
int uecap_xer_in,
char *emul_iface)
{
int inst;
LOG_I(PHY,"UE : Calling Layer 2 for initialization, nb_inst: %d \n", nb_inst);
@@ -423,9 +424,9 @@ void init_UE_stub_single_thread(int nb_inst,
void init_UE_stub(int nb_inst,
int eMBMS_active,
int uecap_xer_in,
char *emul_iface)
int eMBMS_active,
int uecap_xer_in,
char *emul_iface)
{
int inst;
LOG_I(PHY,"UE : Calling Layer 2 for initialization\n");
@@ -899,7 +900,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
unsigned int emulator_absSF;
void ue_stub_rx_handler(unsigned int num_bytes,
char *rx_buffer)
char *rx_buffer)
{
PHY_VARS_UE *UE;
UE = PHY_vars_UE_g[0][0];
@@ -1511,6 +1512,23 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
* \param arg unused
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
// we have to write to tell explicitly to the eNB, else it will wait for us forever
// we write the next subframe (always write in future of what we received)
//
struct complex16 v= {0};
void *samplesVoid[UE->frame_parms.nb_antennas_tx];
for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++)
samplesVoid[i]=(void *)&v;
AssertFatal(1 == UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+2*UE->frame_parms.samples_per_tti,
samplesVoid,
1,
UE->frame_parms.nb_antennas_tx,
1),"");
}
void *UE_thread(void *arg)
{
@@ -1564,16 +1582,32 @@ void *UE_thread(void *arg)
if (is_synchronized == 0) {
if (instance_cnt_synch < 0) { // we can invoke the synch
// grab 10 ms of signal and wakeup synch thread
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][0];
if (UE->mode != loop_through_memory)
AssertFatal( UE->frame_parms.samples_per_tti*10 ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
rxp,
UE->frame_parms.samples_per_tti*10,
UE->frame_parms.nb_antennas_rx), "");
if (UE->mode != loop_through_memory) {
if (IS_SOFTMODEM_RFSIM) {
for(int sf=0; sf<10; sf++) {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf];
AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
rxp,
UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_rx), "");
write_dummy(UE, timestamp);
}
} else {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][0];
AssertFatal( UE->frame_parms.samples_per_tti*10 ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
rxp,
UE->frame_parms.samples_per_tti*10,
UE->frame_parms.nb_antennas_rx), "");
}
}
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
instance_cnt_synch = ++UE->proc.instance_cnt_synch;
@@ -1591,21 +1625,22 @@ void *UE_thread(void *arg)
(void)dummy_rx; /* avoid gcc warnings */
usleep(500);
#else
// grab 10 ms of signal into dummy buffer
if (UE->mode != loop_through_memory) {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&dummy_rx[i][0];
for (int sf=0; sf<10; sf++)
for (int sf=0; sf<10; sf++) {
// printf("Reading dummy sf %d\n",sf);
UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
rxp,
UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_rx);
if (IS_SOFTMODEM_RFSIM )
write_dummy(UE, timestamp);
}
}
#endif
}
} // UE->is_synchronized==0
@@ -1616,12 +1651,17 @@ void *UE_thread(void *arg)
if (UE->mode != loop_through_memory) {
if (UE->no_timing_correction==0) {
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
AssertFatal(UE->rx_offset ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
(void **)UE->common_vars.rxdata,
UE->rx_offset,
UE->frame_parms.nb_antennas_rx),"");
while ( UE->rx_offset ) {
size_t s=min(UE->rx_offset,UE->frame_parms.samples_per_tti);
AssertFatal(s == UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
(void **)UE->common_vars.rxdata,
s,
UE->frame_parms.nb_antennas_rx),"");
if (IS_SOFTMODEM_RFSIM )
write_dummy(UE, timestamp);
UE->rx_offset-=s;
}
}
UE->rx_offset=0;
@@ -1662,6 +1702,7 @@ void *UE_thread(void *arg)
pthread_mutex_unlock(&proc->mutex_rxtx);
}
usleep(300);
}
LOG_D(PHY,"Process Subframe %d thread Idx %d \n", sub_frame, UE->current_thread_id[sub_frame]);
@@ -2014,7 +2055,7 @@ void fill_ue_band_info(void)
#endif
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue,
openair0_config_t *openair0_cfg)
openair0_config_t *openair0_cfg)
{
int i, CC_id;
LTE_DL_FRAME_PARMS *frame_parms;
@@ -2206,8 +2247,8 @@ int init_timer_thread(void)
* fix it somehow
*/
int8_t find_dlsch(uint16_t rnti,
PHY_VARS_eNB *eNB,
find_type_t type)
PHY_VARS_eNB *eNB,
find_type_t type)
{
printf("you cannot read this\n");
abort();
+56
View File
@@ -483,6 +483,27 @@ void configure_rru(int idx,
phy_init_RU(ru);
}
static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){
//ssize_t msg_len/*,len*/;
int i;
//LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
RRU_CONFIG_msg_t rru_config_msg;
memset((void *)&rru_config_msg,0,sizeof(rru_config_msg));
rru_config_msg.type = RRU_config_update;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_I(PHY,"Sending RAU tick to RRU %d %lu bytes\n",ru->idx,rru_config_msg.len);
RRU_config_t *config = (RRU_config_t *)&rru_config_msg.msg[0];
config->num_MBSFN_config=fp->num_MBSFN_config;
for(i=0; i < fp->num_MBSFN_config; i++){
config->MBSFN_config[i] = fp->MBSFN_config[i];
LOG_W(PHY,"Configuration send to RAU (num MBSFN %d, MBSFN_SubframeConfig[%d] pattern is %x )\n",config->num_MBSFN_config,i,config->MBSFN_config[i].mbsfn_SubframeConfig);
}
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
"RU %d cannot access remote radio\n",ru->idx);
return 0;
}
void* ru_thread_control( void* param )
{
@@ -491,6 +512,7 @@ void* ru_thread_control( void* param )
RRU_CONFIG_msg_t rru_config_msg;
ssize_t msg_len;
int len;
int ru_sf_update=0; // SF config update flag (MBSFN)
// Start IF device if any
if (ru->start_if) {
@@ -512,6 +534,16 @@ void* ru_thread_control( void* param )
if (ru->state == RU_IDLE && ru->if_south != LOCAL_RF)
send_tick(ru);
if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){
LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
LOG_D(PHY,"Check MBSFN SF changes\n");
if(fp->num_MBSFN_config != ru_sf_update){
ru_sf_update = fp->num_MBSFN_config;
LOG_W(PHY,"RU SF should be updated ... calling send_update_rru(ru)\n");
send_update_rru(ru,fp);
}
}
if ((len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice,
&rru_config_msg,
@@ -646,6 +678,30 @@ void* ru_thread_control( void* param )
}
}
break;
case RRU_config_update: //RRU
if (ru->if_south == LOCAL_RF){
LOG_W(PHY,"Configuration update received from RAU \n");
msg_len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_W(PHY,"New MBSFN config received from RAU --- num_MBSFN_config %d\n",((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config);
ru->frame_parms->num_MBSFN_config = ((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config;
for(int i=0; i < ((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config; i++){
ru->frame_parms->MBSFN_config[i].mbsfn_SubframeConfig=((RRU_config_t *)&rru_config_msg.msg[0])->MBSFN_config[i].mbsfn_SubframeConfig;
LOG_W(PHY,"Configuration received from RAU (num MBSFN %d, MBSFN_SubframeConfig[%d] pattern is %x )\n",
((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config,
i,
((RRU_config_t *)&rru_config_msg.msg[0])->MBSFN_config[i].mbsfn_SubframeConfig
);
}
} else LOG_E(PHY,"Received RRU_config msg...Ignoring\n");
break;
case RRU_config_update_ok: //RAU
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_config_update_ok msg...Ignoring\n");
else{
LOG_W(PHY,"Received RRU_config_update_ok msg...\n");
}
break;
case RRU_start: // RRU
if (ru->if_south == LOCAL_RF){