Commit a1818dab authored by frtabu's avatar frtabu

Fix basic/L2 simulator not passing CI

parents e758a32f 89c07125
......@@ -21,7 +21,7 @@
# Author: laurent THOMAS, Lionel GAUTHIER
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.0)
#############################################
# Base directories, compatible with legacy OAI building
......@@ -169,11 +169,12 @@ endif()
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
# add autotools definitions that were maybe used!
set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}"
)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D${MKVER}"
)
add_definitions("-DASN_DISABLE_OER_SUPPORT")
......@@ -477,7 +478,11 @@ add_dependencies(X2AP_ENB rrc_flag x2_flag)
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR" "OAI_SIMU")
if (NOT ${RF_BOARD} STREQUAL "None")
add_definitions(-DMANAGED_RF=1)
endif()
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
......@@ -585,6 +590,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} )
set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
add_library(rfsimulator MODULE ${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c)
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
......@@ -607,7 +614,6 @@ add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmes
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
......@@ -617,11 +623,6 @@ add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION w
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
########################
# Include order
##########################
add_boolean_option(ENB_MODE True "Swap the include directories between openair2 and openair3" )
##########################
# SCHEDULING/REAL-TIME/PERF options
##########################
......@@ -722,19 +723,13 @@ include_directories("${OPENAIR_BIN_DIR}")
#include_directories("${include_dirs_all}")
# Legacy exact order
if(ENB_MODE)
include_directories("${OPENAIR2_DIR}/COMMON")
include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
include_directories("${OPENAIR3_DIR}/COMMON")
include_directories("${OPENAIR3_DIR}/UTILS")
else()
include_directories("${OPENAIR3_DIR}/COMMON")
include_directories("${OPENAIR3_DIR}/UTILS")
include_directories("${OPENAIR2_DIR}/COMMON")
include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
endif()
include_directories("${OPENAIR2_DIR}/COMMON")
include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
include_directories("${OPENAIR3_DIR}/COMMON")
include_directories("${OPENAIR3_DIR}/UTILS")
include_directories("${NFAPI_DIR}/nfapi/public_inc")
include_directories("${NFAPI_DIR}/common/public_inc")
include_directories("${NFAPI_DIR}/pnf/public_inc")
......@@ -1388,6 +1383,10 @@ add_library(L2_UE
${L2_SRC_UE}
${MAC_SRC_UE}
)
if (NOT ${NOS1})
target_compile_definitions(L2_UE PUBLIC -DPDCP_USE_NETLINK)
endif()
add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
include_directories(${NFAPI_USER_DIR})
......@@ -1675,6 +1674,9 @@ if(NAS_UE)
${libnas_ue_esm_sap_OBJS}
)
add_dependencies(LIB_NAS_UE rrc_flag)
if (NOT ${NOS1})
target_compile_definitions(LIB_NAS_UE PUBLIC -DPDCP_USE_NETLINK)
endif()
set(NAS_UE_LIB LIB_NAS_UE)
include_directories(${NAS_SRC}UE)
......@@ -2046,6 +2048,9 @@ add_executable(lte-uesoftmodem
)
add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag x2_flag)
if (NOT ${NOS1})
target_compile_definitions(lte-uesoftmodem PRIVATE -DPDCP_USE_NETLINK)
endif()
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
......@@ -2144,6 +2149,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
add_executable(${myExe}
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
${OPENAIR_DIR}/common/utils/backtrace.c
${XFORMS_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
......@@ -2281,7 +2287,7 @@ endfunction(make_driver name dir src)
# nashmesh module
################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK -D${MKVER}")
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if (OAI_NW_DRIVER_USE_NETLINK)
......
This diff is collapsed.
......@@ -23,9 +23,16 @@
#ifndef BACKTRACE_H_
#define BACKTRACE_H_
#ifdef __cplusplus
extern "C" {
#endif
void display_backtrace(void);
void backtrace_handle_signal(siginfo_t *info);
#ifdef __cplusplus
}
#endif
#endif /* BACKTRACE_H_ */
......@@ -384,6 +384,16 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
//LOG_D(PHY, "num_pdcch_symbols:%d mi:%d nquad:%d\n", num_pdcch_symbols, mi, get_nquad(num_pdcch_symbols, frame_parms, mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,1);
// Regular 0/1 alternates seems never detected as wrong DCI
// It should be better for spectrum measurements than all 0
// random value creates wrong DCI detection
// scrambler will do some randomization
if ( getenv("RFSIMULATOR") != NULL) {
uint8_t*end=e+8*get_nquad(num_pdcch_symbols, frame_parms, mi);
uint8_t dummy=0;
for (uint8_t* p=e_ptr; p < end ; p++)
*p=dummy++&1;
}
pdcch_scrambling(frame_parms,
subframe,
e,
......
......@@ -351,18 +351,6 @@ int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch,
/*! \brief DCI Encoding. This routine codes an arbitrary DCI PDU after appending the 8-bit 3GPP CRC. It then applied sub-block interleaving and rate matching.
\param a Pointer to DCI PDU (coded in bytes)
\param A Length of DCI PDU in bits
\param E Length of DCI PDU in coded bits
\param e Pointer to sequence
\param rnti RNTI for CRC scrambling*/
void dci_encoding(uint8_t *a,
uint8_t A,
uint16_t E,
uint8_t *e,
uint16_t rnti);
/*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping.
\param num_dci Number of pdcch symbols
\param num_dci Number of DCI pdus to encode
......
......@@ -547,7 +547,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
ue->frame_parms.nb_antenna_ports_eNB);
#endif
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
# if DISABLE_LOG_X
printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id,
......@@ -608,23 +608,14 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
#endif
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
#ifndef MANAGED_RF
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
}
else {
} else {
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
#ifndef MANAGED_RF
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
}
......
......@@ -56,7 +56,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
uint8_t preamble_index = ue->prach_resources[eNB_id]->ra_PreambleIndex;
uint8_t tdd_mapindex = ue->prach_resources[eNB_id]->ra_TDD_map_index;
int16_t *prachF = ue->prach_vars[eNB_id]->prachF;
static int16_t prach_tmp[45600*2] __attribute__((aligned(32)));
static int16_t prach_tmp[45600*4] __attribute__((aligned(32)));
int16_t *prach = prach_tmp;
int16_t *prach2;
int16_t amp = ue->prach_vars[eNB_id]->amp;
......@@ -82,7 +82,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
int i, prach_len;
uint16_t first_nonzero_root_idx=0;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(MANAGED_RF)
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
#ifdef PRACH_DEBUG
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
......@@ -488,7 +488,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
AssertFatal(prach_fmt<4,
"prach_fmt4 not fully implemented" );
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
int j;
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
......
......@@ -76,7 +76,7 @@ extern double cpuf;
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
#endif
......@@ -160,7 +160,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
}
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162};
/*
unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL)
......@@ -1130,7 +1130,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
int subframe_tx = proc->subframe_tx;
int ulsch_start;
int overflow=0;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
int k,l;
int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16)));
#endif
......@@ -1141,7 +1141,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
}
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case
#if defined(MANAGED_RF)
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
ue->hw_timing_advance-
ue->timing_advance-
......@@ -1177,7 +1177,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
......@@ -1188,7 +1188,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
CYCLIC_PREFIX);
else {
normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
......@@ -1196,7 +1196,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
nsymb>>1,
&ue->frame_parms);
normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
#else
&ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)],
......@@ -1205,14 +1205,14 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
&ue->frame_parms);
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
apply_7_5_kHz(ue,dummy_tx_buffer,0);
apply_7_5_kHz(ue,dummy_tx_buffer,1);
#else
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0);
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
#endif
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
......@@ -1310,7 +1310,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_resources[eNB_id]->ra_TDD_map_index,
ue->prach_resources[eNB_id]->ra_RNTI);
ue->tx_total_RE[subframe_tx] = 96;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
......@@ -1676,7 +1676,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
}
ue->tx_total_RE[subframe_tx] = nb_rb*12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
......@@ -1747,7 +1747,7 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8
Po_SRS = ue->tx_power_max_dBm;
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
if (ue->mac_enabled==1) {
tx_amp = get_tx_amp(Po_SRS,
......@@ -1986,7 +1986,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
......@@ -2067,7 +2067,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
......@@ -2311,12 +2311,8 @@ void ue_measurement_procedures(
if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) {
// AGC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN);
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
#ifndef MANAGED_RF
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
eNB_id = 0;
......@@ -2402,7 +2398,6 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
// if this is the first PBCH after initial synchronization and no timing correction is performed, make L1 state = PRACH
if (ue->UE_mode[eNB_id]==NOT_SYNCHED && ue->no_timing_correction == 1) ue->UE_mode[eNB_id] = PRACH;
if (first_run) {
first_run = 0;
proc->frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF);
......
......@@ -308,88 +308,6 @@ typedef struct {
} __attribute__ ((__packed__)) DEFAULT_CH_MEAS;
#define DEFAULT_eNB_MEAS_SIZE sizeof(DEFAULT_eNB_MEAS)
#ifndef OPENAIR2_IN
typedef struct { //RRC_INTERFACE_FUNCTIONS
unsigned int Frame_index;
unsigned short UE_index[NB_MODULES_MAX][NB_SIG_CNX_UE];
uint8_t eNB_id[NB_MODULES_MAX][NB_CNX_UE];
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(uint8_t );
char (*openair_rrc_UE_init)(uint8_t, uint8_t);
RRC_status_t (*rrc_rx_tx)(uint8_t,uint32_t,uint8_t,uint8_t);
uint8_t (*mac_rrc_data_ind)(uint8_t,uint32_t,uint16_t,uint8_t *,uint16_t,eNB_flag_t eNB_flag, uint8_t eNB_index);
uint8_t (*mac_rrc_data_req)(uint8_t,uint32_t,uint16_t,uint8_t,uint8_t *,eNB_flag_t eNB_flag, uint8_t eNB_index);
void (*mac_rrc_meas_ind)(uint8_t,MAC_MEAS_REQ_ENTRY*);
void (*def_meas_ind)(uint8_t, uint8_t);
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
void (*fn_rrc) (void);
uint8_t (*get_rrc_status)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t eNB_index);
double (*rrc_get_estimated_ue_distance) (module_id_t Mod_id, uint8_t UE_id, uint8_t CC_id, uint8_t loc_type);
} RRC_XFACE;
typedef struct {
//MAC_INTERFACE_FUNCTIONS
unsigned int frame;
unsigned short Node_id[NB_MODULES_MAX];
char Is_cluster_head[NB_MODULES_MAX];
void (*macphy_exit)(const char *); /* Pointer function that stops the low-level scheduler due an exit condition */
unsigned short (*mac_config_req)(uint8_t,uint8_t,MAC_CONFIG_REQ*);
MAC_MEAS_REQ_ENTRY* (*mac_meas_req)(uint8_t , MAC_MEAS_REQ*);
void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short);
//RLC_INTERFACE_FUNCTIONS
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated,
LTE_MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LTE_LogicalChannelConfig_t *logicalChannelConfig,
LTE_MeasGapConfig_t *measGapConfig,
LTE_TDD_Config_t *tdd_Config,
uint8_t *SIwindowsize,
uint16_t *SIperiod
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
,
MBMS_flag_t MBMS_Flag,
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct LTE_PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uint32_t
,uint32_t
#endif
);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uint32_t sourceL2Id
,uint32_t destinationL2Id
#endif
);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
void (*mrbch_phy_sync_failure) (uint8_t Mod_id, frame_t frame, uint8_t Free_ch_index);
void (*dl_phy_sync_success) (uint8_t Mod_id, frame_t frame, uint8_t eNB_index);
} MAC_RLC_XFACE;
#endif
#define IDLE 0
#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
......
......@@ -1815,7 +1815,6 @@ int RCconfig_S1(
paramdef_t S1Params[] = S1PARAMS_DESC;
paramlist_def_t S1ParamList = {ENB_CONFIG_STRING_MME_IP_ADDRESS, NULL, 0};
paramdef_t SCTPParams[] = SCTPPARAMS_DESC;
paramdef_t NETParams[] = NETPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
sprintf(aprefix, "%s.[%i]", ENB_CONFIG_STRING_ENB_LIST, k);
......@@ -1960,6 +1959,7 @@ int RCconfig_S1(
S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (EPC_MODE_ENABLED) {
paramdef_t SCTPParams[] = SCTPPARAMS_DESC;
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr);
......
......@@ -96,7 +96,6 @@ const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
uint32_t RRC_CONNECTION_FLAG;
UE_MAC_INST *UE_mac_inst = NULL; //[NB_MODULE_MAX];
MAC_RLC_XFACE *Mac_rlc_xface;
/// Primary component carrier index of eNB
int pCC_id[NUMBER_OF_eNB_MAX];
......
......@@ -66,7 +66,6 @@ mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t eNB_index)
{
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
}
......
......@@ -2565,8 +2565,6 @@ ue_scheduler(const module_id_t module_idP,
}
#endif
//Mac_rlc_xface->frameP=frameP;
//Rrc_xface->Frame_index=Mac_rlc_xface->frameP;
//if (subframe%5 == 0)
//LG#ifdef EXMIMO
......@@ -3436,7 +3434,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) {
mac_rlc_status_resp_t rlc_status; //, rlc_status_data;
mac_rlc_status_resp_t rlc_status={0}; //, rlc_status_data;
uint32_t absSF = (frameP*10)+subframeP;
UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1};
......@@ -3476,7 +3474,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
(ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC
// 10 PRBs, mcs 19
int TBS = 4584/8;
int req;
int req=0;
if (TBS <= rlc_status.bytes_in_buffer) req = TBS;
......
......@@ -104,6 +104,7 @@ void debug_pdcp_pc5s_sdu(sidelink_pc5s_element *sl_pc5s_msg, char *title) {
LOG_I(PDCP,"PC5-S message, destinationL1Id: 0x%08x\n)\n", sl_pc5s_msg->pc5s_header.destinationL2Id);
}
//-----------------------------------------------------------------------------
int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
mem_block_t *sdu_p;
int pdcp_nb_sdu_sent = 0;
......@@ -119,6 +120,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
debug_pdcp_pc5s_sdu((sidelink_pc5s_element *)&(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),
"pdcp_fifo_flush_sdus received aPC5S message");
}
ret = sendto(pdcp_pc5_sockfd, &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),
......@@ -136,7 +138,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
free_mem_block (sdu_p, __func__);
pdcp_nb_sdu_sent ++;
}
return pdcp_nb_sdu_sent;
}
......
......@@ -80,39 +80,6 @@ int find_inst(struct net_device *dev)
return(-1);
}
//---------------------------------------------------------------------------
#ifndef PDCP_USE_NETLINK
//void interrupt(void){
void *nas_interrupt(void)
{
//---------------------------------------------------------------------------
uint8_t cxi;
// struct nas_priv *priv=netdev_priv(dev_id);
// unsigned int flags;
// priv->lock = SPIN_LOCK_UNLOCKED;
#ifdef DEBUG_INTERRUPT
printk("INTERRUPT - begin\n");
#endif
// spin_lock_irqsave(&priv->lock,flags);
cxi=0;
// mesh_GC_receive();
// mesh_DC_receive(naspriv->cx+cxi);
#ifndef PDCP_USE_NETLINK
nas_COMMON_QOS_receive();
#endif
// spin_unlock_irqrestore(&priv->lock,flags);
#ifdef DEBUG_INTERRUPT
printk("INTERRUPT: end\n");
#endif
// return 0;
return NULL;
}
#endif //NETLINK
//---------------------------------------------------------------------------
// Called by ifconfig when the device is activated by ifconfig
int nas_open(struct net_device *dev)
......
......@@ -64,8 +64,6 @@
#include "rrc_nas_primitives.h"
#include "COMMON/platform_types.h"
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+(c))
struct rb_entity {
nasRadioBearerId_t rab_id;
nasSapId_t sapi;
......
......@@ -293,10 +293,6 @@ int nas_mesh_DC_send_cx_establish_request(struct cx_entity *cx,struct nas_priv *
nas_tool_print_buffer((char *)p,p->length);
#endif
++cx->retry;
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
cx->countimer=gpriv->timer_establishment;
if (bytes_wrote==p->length) {
......@@ -353,11 +349,6 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
p->length = NAS_TL_SIZE + sizeof(struct NASConnReleaseReq);
p->nasUEDCPrimitive.conn_release_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.conn_release_req.releaseCause = NAS_CX_RELEASE_UNDEF_CAUSE;
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote==p->length) {
cx->state=NAS_IDLE;
......@@ -441,22 +432,12 @@ void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb,
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (skb->len)+1; //adds category character
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_SEND_SIG: Header sent failure in DC-FIFO\n");
return;
}
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], skb->data, skb->len);
#endif
if (bytes_wrote != p->length + skb->len + 1) {
printk("NAS_MESH_DC_SEND_SIG: Data sent failure in DC-FIFO\n");
return;
......@@ -511,22 +492,12 @@ void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_ca
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (nas_length)+1; //adds category character
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Header sent failure in DC-FIFO\n");
return;
}
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], (char *)nas_data, nas_length);
#endif
if (bytes_wrote != p->length + nas_length + 1) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Data sent failure in DC-FIFO\n");
return;
......@@ -665,9 +636,6 @@ void nas_mesh_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_elem
}
// End debug information
#ifndef PDCP_USE_NETLINK
// nas_COMMON_receive(p->length, p->nasUEDCPrimitive.data_transfer_ind.nasDataLength, cx->sap[NAS_DC_OUTPUT_SAPI]);
#endif
#ifdef NAS_DEBUG_DC
printk("NAS_MESH_DC_RECEIVE: DATA_TRANSFER_IND reception\n");
printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef);
......@@ -842,20 +810,11 @@ int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv)
}
// End debug information
#ifdef PDCP_USE_NETLINK
#else
// bytes_read = rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI] , gpriv->rbuffer, NAS_TL_SIZE);
#endif
if (bytes_read>0) {
struct nas_ue_dc_element *p;
p= (struct nas_ue_dc_element *)(gpriv->rbuffer);
//get the rest of the primitive
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
#endif
if (bytes_read!=p->length) {
printk("NAS_MESH_DC_RECEIVE: Problem while reading primitive header\n");
......@@ -981,20 +940,11 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
#ifdef NAS_DEBUG_GC
printk("NAS_MESH_GC_RECEIVE - begin \n");
#endif
#ifdef PDCP_USE_NETLINK
#else
// bytes_read = rtf_get(gpriv->sap[NAS_GC_SAPI], gpriv->rbuffer, NAS_TL_SIZE);
#endif
if (bytes_read>0) {
struct nas_ue_gc_element *p;
p= (struct nas_ue_gc_element *)(gpriv->rbuffer);
//get the rest of the primitive
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
#endif
if (bytes_read!=p->length) {
printk("NAS_MESH_GC_RECEIVE: Problem while reading primitive's header\n");
return bytes_read;
......@@ -1003,10 +953,6 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
// start decoding message
switch (p->type) {
case INFO_BROADCAST_IND :
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
#endif
if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength) {
printk("NAS_MESH_GC_RECEIVE: INFO_BROADCAST_IND reception, Problem while reading primitive's data\n");
return bytes_read;
......
......@@ -349,7 +349,7 @@ static const struct net_device_ops ue_ip_netdev_ops = {
.ndo_set_mac_address = ue_ip_set_mac_address,
.ndo_set_config = ue_ip_set_config,
.ndo_do_ioctl = NULL,
#if RHEL_RELEASE_CODE>=1797
#if defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1797
.extended.ndo_change_mtu = ue_ip_change_mtu,
#else
.ndo_change_mtu = ue_ip_change_mtu,
......
......@@ -57,7 +57,6 @@
#include "platform_types.h"
#include "sap.h"
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+(c))
typedef struct ue_ip_priv_s {
int irq;
......
......@@ -534,7 +534,8 @@ mui_t rrc_mui=0;
/* NAS Attach request with IMSI */
static const char nas_attach_req_imsi[] = {
static const char nas_attach_req_imsi[] = {
0x07, 0x41,
/* EPS Mobile identity = IMSI */
0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87,
......@@ -803,6 +804,7 @@ rrc_ue_establish_drb(
//-----------------------------------------------------------------------------
{
// add descriptor from RRC PDU
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
/* avoid gcc warnings */
(void)oip_ifup;
......@@ -819,7 +821,7 @@ rrc_ue_establish_drb(
RADIO_ACCESS_BEARER,Rlc_info_um);
*/
if(PDCP_USE_NETLINK) {
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(MANAGED_RF) && !defined(ETHERNET)
ip_addr_offset3 = 0;
ip_addr_offset4 = 1;
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
......@@ -842,7 +844,6 @@ rrc_ue_establish_drb(
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
}
# endif
}
return(0);
......
......@@ -63,6 +63,7 @@
#include "LTE_PeriodicBSR-Timer-r12.h"
#include "LTE_RetxBSR-Timer-r12.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include <openair2/RRC/LTE/rrc_eNB_S1AP.h>
#include "T.h"
......@@ -6296,8 +6297,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
if (PDCP_USE_NETLINK && (!LINK_ENB_PDCP_TO_GTPV1U)) {
// can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET)
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n",
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(MANAGED_RF) && !defined(ETHERNET)
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n",
ctxt_pP->module_id,
ctxt_pP->module_id);
oip_ifup = nas_config(
......
/*
* 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
*/
/*!
*******************************************************************************
\file emul_interface.c
\brief RRM interface emulation, it sends message to the RRM interface
- RRC -> RRM
- CMM -> RRM
\author BURLOT Pascal
\date 10/07/08
\par Historique:
$Author$ $Date$ $Revision$
$Id$
$Log$
*******************************************************************************
*/
#include "defs.h"
#include "extern.h"
//#include "mac_lchan_interface.h"
//#include "openair_rrc_utils.h"
//#include "openair_rrc_main.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
extern EMULATION_VARS *Emul_vars;
extern CH_MAC_INST *CH_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
#endif
/******************************************************************************/
void fn_rrc (void)
{
/******************************************************************************/
msg_head_t *Header ;
char *Data;
L2_ID Mac_id;
while(1) {
Header = (msg_head_t *) recv_msg(&S_rrc) ;
if(Header==NULL) {
break;
}
Data_to_read=Header->size;
if (Data_to_read > 0 ) {
Data = (char *) (Header +1) ;
}
msg("Got MSG of Type %d on Inst %d\n",Header->msg_type,Header->inst);
switch ( Header->msg_type ) {
case RRM_INIT_CH_REQ: {
rrm_init_ch_req_t *p = (rrm_init_ch_req_t *) Data;
msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_CH_REQ\n",Header->inst);
rrc_init_ch_req(Header->inst,p);
break;
}
case RRCI_INIT_MR_REQ: {
rrci_init_mr_req_t *p = (rrci_init_mr_req_t *) Data;
msg( "[RRM]>[RRC][Inst %d]:RRCI_INIT_MR_REQ\n",Header->inst);
rrc_init_mr_req(Header->inst,p);
break;
}
case RRM_RB_ESTABLISH_REQ: {
send_msg((void *)&S_rrc,msg_rrc_rb_establish_resp(Header->inst,Header->Trans_id));
msg( "[RRM]>[RRC][Inst %d]:RRM_RB_ESTABLISH_REQ, size %d\n",Header->inst,sizeof(rrm_rb_establish_req_t));
rrc_config_req(Header->inst,(void*)Data,Header->msg_type,Header->Trans_id);
break ;
}
case RRM_RB_MODIFY_REQ: {
send_msg((void *)&S_rrc,msg_rrc_rb_modify_resp(Header->inst,Header->Trans_id));
msg( "[RRM]>[RRC][Inst %d]:RRM_RB_MODIFY_REQ\n",Header->inst);
rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id);
}
case RRM_RB_RELEASE_REQ: {
send_msg((void *)&S_rrc,msg_rrc_rb_release_resp(Header->inst,Header->Trans_id));
msg( "[RRM]>[RRC][Inst %d]:RRM_RB_RELEASE_REQ\n",Header->inst);
rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id);
}
case RRCI_CX_ESTABLISH_RESP: {
rrci_cx_establish_resp_t *p = (rrci_cx_establish_resp_t *) Data;
unsigned char CH_index,i;
msg( "[RRCI]>[RRC][Inst %d]:RRCI_CX_ESTABLISH_RESP\n",Header->inst);
for(i=0; i<NB_SIG_CNX_UE; i++)
if(!bcmp(&UE_rrc_inst[Header->inst-NB_CH_INST].Info[i].CH_mac_id,&p->L2_id,sizeof(L2_ID))) {
CH_index=i;
break;
}
if(i==NB_SIG_CNX_UE) {
msg("[RRC] FATAL: CH_INDEX NOT FOUND\n");
return;
}
UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr_type=p->L3_info_t;
if(p->L3_info_t == IPv4_ADDR) {
memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,4);
}
else {
memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,16);
}
}
break ;
case RRM_SENSING_MEAS_REQ: {
// rrm_sensing_meas_req_t *p = (rrm_sensing_meas_req_t *) sock_msg ;
send_msg((void *)&S_rrc,msg_rrc_sensing_meas_resp(Header->inst,Header->Trans_id));
msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_REQ\n",Header->inst);
// rrc_meas_req(header->inst,p,RRC_MEAS_ADD);
}
break ;
case RRM_SENSING_MEAS_RESP: {
msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_RESP\n",Header->inst);
//rrm_rrc_meas_resp(header->inst,header->Trans_id);
}
break ;
case RRM_SCAN_ORD:
msg( "[RRM]>[RRC][Inst %d]:RRM_SCAN_ORD\n",Header->inst);
//memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t));
//CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index;
///send over air
break;
case RRM_INIT_SCAN_REQ:
msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_SCAN_REQ\n",Header->inst);
memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t));
CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index;
///send over air
break;
case RRM_END_SCAN_REQ:
msg( "[RRM]>[RRC][Inst %d]:RRM_END_SCAN_REQ\n",Header->inst);
memcpy(&Mac_id.L2_id[0],Data,sizeof(L2_ID));
unsigned char UE_index=Mac_id.L2_id[0]-NB_CH_MAX+1;
UE_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload[0]=100;
msg("SRB_ID %d\n",CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id);
Mac_rlc_xface->rrc_rlc_data_req(0,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id,0,0,1,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload);
//CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index;
///send over air
break;
default :
msg("[L3_xface]WARNING: msg unknown %d\n",Header->msg_type) ;
}
}
}
......@@ -52,8 +52,7 @@ uint16_t find_free_dtch_position(uint8_t Mod_id, uint16_t UE_CH_index)
}
msg("NO FREE DTCH LCHAN, exit... \n");
Mac_rlc_xface->macphy_exit("NO FREE DTCH LCHAN, exit");
exit(1);
return 0;
}
......
......@@ -34,37 +34,39 @@
#include <dlfcn.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "common_lib.h"
#include "common/utils/load_module_shlib.h"
#include <common/utils/LOG/log.h>
int set_device(openair0_device *device) {
switch (device->type) {
case EXMIMO_DEV:
printf("[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case USRP_B200_DEV:
printf("[%s] has loaded USRP B200 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded USRP B200 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case USRP_X300_DEV:
printf("[%s] has loaded USRP X300 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded USRP X300 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case BLADERF_DEV:
printf("[%s] has loaded BLADERF device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded BLADERF device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case LMSSDR_DEV:
printf("[%s] has loaded LMSSDR device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded LMSSDR device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case IRIS_DEV:
printf("[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
case NONE_DEV:
printf("[%s] has not loaded a HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_W(HW,"[%s] has not loaded a HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break;
default:
printf("[%s] invalid HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_E(HW,"[%s] invalid HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return -1;
}
return 0;
......@@ -75,15 +77,15 @@ int set_transport(openair0_device *device) {
switch (device->transp_type) {
case ETHERNET_TP:
printf("[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_I(HW,"[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return 0;
break;
case NONE_TP:
printf("[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_W(HW,"[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return 0;
break;
default:
printf("[%s] invalid transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
LOG_E(HW,"[%s] invalid transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return -1;
break;
}
......@@ -97,15 +99,18 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
int ret=0;
char *libname;
if (flag == RAU_LOCAL_RADIO_HEAD) {
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
if (getenv("RFSIMULATOR") != NULL)
libname="rfsimulator";
else
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
} else {
libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init";
}
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) {
fprintf(stderr,"Library %s couldn't be loaded\n",libname);
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else {
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
}
......@@ -121,7 +126,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
if ( rc >= 0) {
if ( set_device(device) < 0) {
fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__);
LOG_E(HW,"Unsupported radio head\n");
return -1;
}
}
......@@ -133,7 +138,7 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0
rc=load_lib(device, openair0_cfg, eth_params, RAU_REMOTE_RADIO_HEAD);
if ( rc >= 0) {
if ( set_transport(device) < 0) {
fprintf(stderr, "%s %d:Unsupported transport protocol\n",__FILE__, __LINE__);
LOG_E(HW,"Unsupported transport protocol\n");
return -1;
}
}
......
......@@ -164,7 +164,7 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
*(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t))=1+(i<<1);
*(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp;
int sent_byte;
int sent_byte=0;
/*printf("[RRU]write mod_%d %d , len %d, buff %p \n",
......
......@@ -28,7 +28,12 @@
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <uhd/version.hpp>
#if UHD_VERSION < 3110000
#include <uhd/utils/thread_priority.hpp>
#else
#include <uhd/utils/thread.hpp>
#endif
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/version.hpp>
#include <boost/lexical_cast.hpp>
......@@ -183,7 +188,7 @@ static int sync_to_gps(openair0_device *device) {
num_gps_locked++;
std::cout << boost::format("GPS Locked\n");
} else {
std::cerr << "WARNING: GPS not locked - time will not be accurate until locked" << std::endl;
LOG_W(HW,"WARNING: GPS not locked - time will not be accurate until locked\n");
}
//Set to GPS time
......@@ -724,6 +729,7 @@ void *freq_thread(void *arg) {
usrp_state_t *s = (usrp_state_t *)device->priv;
s->usrp->set_tx_freq(device->openair0_cfg[0].tx_freq[0]);
s->usrp->set_rx_freq(device->openair0_cfg[0].rx_freq[0]);
return NULL;
}
/*! \brief Set frequencies (TX/RX). Spawns a thread to handle the frequency change to not block the calling thread
* \param device the hardware to use
......@@ -1073,16 +1079,16 @@ extern "C" {
uhd::device_addrs_t device_adds = uhd::device::find(args);
if (device_adds.size() == 0) {
std::cerr<<"No USRP Device Found. " << std::endl;
LOG_E(HW,"No USRP Device Found.\n ");
free(s);
return -1;
} else if (device_adds.size() > 1) {
std::cerr<<"More than one USRP Device Found. Please specify device more precisely in config file." << std::endl;
LOG_E(HW,"More than one USRP Device Found. Please specify device more precisely in config file.\n");
free(s);
return -1;
}
std::cerr << "Found USRP " << device_adds[0].get("type") << "\n";
LOG_I(HW,"Found USRP %s\n", device_adds[0].get("type").c_str());
double usrp_master_clock;
if (device_adds[0].get("type") == "b200") {
......@@ -1090,7 +1096,12 @@ extern "C" {
device->type = USRP_B200_DEV;
usrp_master_clock = 30.72e6;
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
#if UHD_VERSION < 3131000
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=15360, recv_frame_size=15360" ;
#else
LOG_W(HW,"Bug in UHD => 3.13.1, reduce paquet size until UHD is fixed\n");
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680" ;
#endif
}
if (device_adds[0].get("type") == "n3xx") {
......
#General
This is a RF simulator that allows to test OAI without a RF board.
It replaces a actual RF board driver.
As much as possible, it works like a RF board, but not in realtime: it can run faster than realtime if there is enough CPU or slower (it is CPU bound instead of real time RF sampling bound)
#build
You can build it the same way, and together with actual RF driver
Example:
```bash
./build_oai --ue-nas-use-tun --UE --eNB -w SIMU
```
It is also possible to build actual RF and use choose on each run:
```bash
./build_oai --ue-nas-use-tun --UE --eNB -w USRP --rfsimulator
```
Will build both the eNB (lte-softmodem) and the UE (lte-uesoftmodem)
We recommend to use the option --ue-nas-use-tun that is much simpler to use than the OAI kernel driver.
#usage
Setting the env variable RFSIMULATOR enables the RF board simulator
It should the set to "enb" in the eNB
For the UE, it should be set to the IP address of the eNB
example:
```bash
sudo RFSIMULATOR=192.168.2.200 ./lte-uesoftmodem -C 2685000000 -r 50
```
Except this, the UE and the eNB can be used as it the RF is real
If you reach 'RA not active' on UE, be careful to generate a valid SIM
```bash
$OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o .
```
#Caveacts
Still issues in power control: txgain, rxgain are not used
no S1 mode is currently broken, so we were not able to test the simulator in noS1 mode
This diff is collapsed.
#ifndef OPENAIRINTERFACE5G_LIMITS_H_
#define OPENAIRINTERFACE5G_LIMITS_H_
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR)
#if defined(MANAGED_RF)
# define NUMBER_OF_eNB_MAX 1
# define NUMBER_OF_RU_MAX 2
# ifndef UE_EXPANSION
......
This diff is collapsed.
......@@ -224,7 +224,6 @@ int main(int argc, char **argv)
char * g_log_level = "trace"; // by default global log level is set to trace
mac_xface = malloc(sizeof(MAC_xface));
Mac_rlc_xface = (MAC_RLC_XFACE*)malloc16(sizeof(MAC_RLC_XFACE));
rlc_module_init ();
pdcp_module_init();
......
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