Commit 2eb2f992 authored by Navid Nikaein's avatar Navid Nikaein

Merge branch 'feature-39-X2-handover' of...

Merge branch 'feature-39-X2-handover' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-39-X2-handover
parents 9e78a206 b444bba7
...@@ -931,6 +931,7 @@ set(L2_SRC ...@@ -931,6 +931,7 @@ set(L2_SRC
${RRC_DIR}/rrc_eNB.c ${RRC_DIR}/rrc_eNB.c
${RRC_DIR}/rrc_eNB_S1AP.c ${RRC_DIR}/rrc_eNB_S1AP.c
${RRC_DIR}/rrc_eNB_UE_context.c ${RRC_DIR}/rrc_eNB_UE_context.c
${RRC_DIR}/rrc_eNB_primitives.c
${RRC_DIR}/rrc_common.c ${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface.c ${RRC_DIR}/L2_interface.c
) )
......
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 False )
set ( EMOS False )
set ( ENABLE_FXP False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False )
set ( ENABLE_USE_CPU_EXECUTION_TIME False )
set ( ENABLE_USE_MME False )
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE False )
set ( EPC_BUILD True )
set ( EXMIMO_IOT False )
set ( HARD_RT False )
set ( JUMBO_FRAME False )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
set ( LINUX_LIST False )
set ( LINUX False )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD False )
set ( LOWLATENCY False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
set ( NAS_BUILT_IN_EPC True )
set ( NAS_MME True )
set ( NAS_NETLINK False )
set ( NAS_UE False )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT False )
set ( NO_RRM False )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK False )
set ( OPENAIR1 False )
set ( OPENAIR2 False )
set ( OPENAIR_EMU False )
set ( OPENAIR_LTE False )
set ( PACKAGE_NAME "EPC" )
set ( PBS_SIM False )
set ( PC_DSP False )
set ( PC_TARGET False )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION False )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM False )
set ( PUCCH False )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( UPDATE_RELEASE_9 True)
set ( UPDATE_RELEASE_10 True)
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
set(XFORMS True )
set(RRC_ASN1_VERSION "Rel10")
set(ENABLE_VCD_FIFO False )
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
...@@ -528,8 +528,10 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility ...@@ -528,8 +528,10 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
// uint8_t prach_fmt; // uint8_t prach_fmt;
// int u; // int u;
LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d\n", LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d, new RNTI %x, new Nid_cell %d\n",
Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,eNB_id); Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,eNB_id,
mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8),
mobilityControlInfo->targetPhysCellId);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex; lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1; lte_frame_parms->prach_config_common.prach_Config_enabled=1;
...@@ -607,6 +609,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility ...@@ -607,6 +609,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
//Target CellId //Target CellId
lte_frame_parms->Nid_cell = mobilityControlInfo->targetPhysCellId; lte_frame_parms->Nid_cell = mobilityControlInfo->targetPhysCellId;
lte_gold(lte_frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_table[0],lte_frame_parms->Nid_cell);
lte_frame_parms->nushift = lte_frame_parms->Nid_cell%6; lte_frame_parms->nushift = lte_frame_parms->Nid_cell%6;
// PUCCH // PUCCH
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define k1 ((long long int) 1000) #define k1 ((long long int) 1000)
#define k2 ((long long int) (1024-k1)) #define k2 ((long long int) (1024-k1))
//#define DEBUG_MEAS #define DEBUG_MEAS
#ifdef USER_MODE #ifdef USER_MODE
void print_shorts(char *s,short *x) void print_shorts(char *s,short *x)
...@@ -276,7 +276,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -276,7 +276,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
} }
// recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation // recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation
// printf("[PHY][UE %d] Frame %d slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, Nid2 %d, nushift %d, eNB_offset %d)\n",phy_vars_ue->Mod_id,phy_vars_ue->frame,slot,Nid_cell,Nid2,nushift,eNB_offset); // printf("[PHY][UE %d] Frame %d slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, Nid2 %d, nushift %d, eNB_offset %d)\n",phy_vars_ue->Mod_id,phy_vars_ue->frame,slot,Nid_cell,Nid2,nushift,eNB_offset);
if (eNB_offset > 0) if (eNB_offset >0)
Nid_cell = phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1]; Nid_cell = phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1];
...@@ -376,7 +376,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -376,7 +376,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
// if (slot == 0) { // if (slot == 0) {
if (eNB_offset == 0) if (eNB_offset == 0)
LOG_I(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",phy_vars_ue->Mod_id, LOG_I(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm/RE\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB, phy_vars_ue->frame_rx,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi), 10*log10(phy_vars_ue->PHY_measurements.rssi),
phy_vars_ue->rx_total_gain_dB, phy_vars_ue->rx_total_gain_dB,
...@@ -386,9 +386,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -386,9 +386,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->Mod_id, phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,slot,eNB_offset, phy_vars_ue->frame_rx,slot,eNB_offset,
(eNB_offset>0) ? phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1] : phy_vars_ue->lte_frame_parms.Nid_cell, (eNB_offset>0) ? phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1] : phy_vars_ue->lte_frame_parms.Nid_cell,
10*log10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])-phy_vars_ue->rx_total_gain_dB, 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[eNB_offset])-phy_vars_ue->rx_total_gain_dB,
phy_vars_ue->PHY_measurements.rsrp[eNB_offset], phy_vars_ue->PHY_measurements.rsrp[eNB_offset],
(10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset]))); (10*log10(1+phy_vars_ue->PHY_measurements.rsrq[eNB_offset])));
//LOG_D(PHY,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12)); //LOG_D(PHY,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12));
//LOG_D(PHY,"RSRP_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)); //LOG_D(PHY,"RSRP_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0));
......
...@@ -38,9 +38,15 @@ FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW}; ...@@ -38,9 +38,15 @@ FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
/*
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
*/
float rsrp_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp0_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp1_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp2_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
static void ia_receiver_on_off( FL_OBJECT *button, long arg) static void ia_receiver_on_off( FL_OBJECT *button, long arg)
{ {
...@@ -450,11 +456,18 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) ...@@ -450,11 +456,18 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdsch_comp,2); fl_set_xyplot_symbolsize( fdui->pdsch_comp,2);
/*
// Throughput on PDSCH // Throughput on PDSCH
fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" ); fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE ); fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE );
fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color
*/
// RSRP
fdui->rsrp = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "RSRP [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->rsrp, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->rsrp, FL_BLACK, FL_WHITE );
fl_set_object_lcolor( fdui->rsrp, FL_WHITE ); // Label color
// Generic UE Button // Generic UE Button
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" ); fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" );
...@@ -502,9 +515,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -502,9 +515,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx]; float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_ue->frame_rx; int frame = phy_vars_ue->frame_rx;
uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id]; uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id];
double rsrp0 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB;
double rsrp1 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[1])-phy_vars_ue->rx_total_gain_dB;
double rsrp2 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[2])-phy_vars_ue->rx_total_gain_dB;
int coded_bits_per_codeword = 0; int coded_bits_per_codeword = 0;
int mcs = 0; int mcs = 0;
unsigned char harq_pid = 0; unsigned char harq_pid = 0;
if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) { if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) {
...@@ -733,7 +751,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -733,7 +751,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","",""); fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","","");
} }
/*
// PDSCH Throughput // PDSCH Throughput
memmove( tput_time_ue[UE_id], &tput_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_time_ue[UE_id], &tput_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( tput_ue[UE_id], &tput_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_ue[UE_id], &tput_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
...@@ -748,6 +766,24 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -748,6 +766,24 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","",""); fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]); fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
*/
// RSRP
memmove( rsrp_time_ue[UE_id], &rsrp_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp0_ue[UE_id], &rsrp0_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp1_ue[UE_id], &rsrp1_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp2_ue[UE_id], &rsrp2_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
rsrp_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
rsrp0_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp0;
rsrp1_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp1;
rsrp2_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp2;
fl_set_xyplot_data(form->rsrp,rsrp_time_ue[UE_id],rsrp0_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
fl_add_xyplot_overlay(form->rsrp,1,rsrp_time_ue[UE_id],rsrp1_ue[UE_id],TPUT_WINDOW_LENGTH,FL_BLUE);
fl_add_xyplot_overlay(form->rsrp,2,rsrp_time_ue[UE_id],rsrp2_ue[UE_id],TPUT_WINDOW_LENGTH,FL_GREEN);
fl_set_xyplot_ybounds(form->rsrp,-130,-60);
fl_check_forms(); fl_check_forms();
......
...@@ -64,7 +64,8 @@ typedef struct { ...@@ -64,7 +64,8 @@ typedef struct {
FL_OBJECT * pdcch_llr; FL_OBJECT * pdcch_llr;
FL_OBJECT * pdsch_comp; FL_OBJECT * pdsch_comp;
FL_OBJECT * pdsch_llr; FL_OBJECT * pdsch_llr;
FL_OBJECT * pdsch_tput; // FL_OBJECT * pdsch_tput;
FL_OBJECT * rsrp;
FL_OBJECT * button_0; FL_OBJECT * button_0;
} FD_lte_phy_scope_ue; } FD_lte_phy_scope_ue;
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include "SCHED/phy_procedures_emos.h" #include "SCHED/phy_procedures_emos.h"
#endif #endif
//#define DEBUG_PHY_PROC (Already defined in cmake) #define DEBUG_PHY_PROC (Already defined in cmake)
//#define DEBUG_ULSCH //#define DEBUG_ULSCH
//#ifdef OPENAIR2 //#ifdef OPENAIR2
...@@ -296,7 +296,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -296,7 +296,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
return(0); return(0);
} }
int CCE_table[800]; int CCE_table[800];
void init_nCCE_table(void) void init_nCCE_table(void)
...@@ -3132,7 +3131,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t ...@@ -3132,7 +3131,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
preamble_delay_list[preamble_max]); preamble_delay_list[preamble_max]);
#endif #endif
if (preamble_energy_list[preamble_max] > 580) { if (preamble_energy_list[preamble_max] >= 580) {
/* /*
write_output("prach_ifft0.m","prach_t0",prach_ifft[0],2048,1,1); write_output("prach_ifft0.m","prach_t0",prach_ifft[0],2048,1,1);
write_output("prach_rx0.m","prach_rx0",&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],6144+792,1,1); write_output("prach_rx0.m","prach_rx0",&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],6144+792,1,1);
......
...@@ -59,7 +59,7 @@ extern int card; ...@@ -59,7 +59,7 @@ extern int card;
#endif #endif
#endif #endif
//#define DEBUG_PHY_PROC #define DEBUG_PHY_PROC
#define UE_TX_POWER (-10) #define UE_TX_POWER (-10)
//#ifdef OPENAIR2 //#ifdef OPENAIR2
...@@ -2062,7 +2062,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst ...@@ -2062,7 +2062,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
#endif #endif
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt); LOG_D(PHY,"[UE %d/%d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,phy_vars_ue->lte_frame_parms.Nid_cell,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt);
#endif #endif
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt; phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt;
......
...@@ -519,6 +519,10 @@ rrc_mac_config_req( ...@@ -519,6 +519,10 @@ rrc_mac_config_req(
return(0); return(0);
} }
// Assign the new c-rnti in the UE context (during HO)
void rrc_mac_get_new_crnti(protocol_ctxt_t* ctxt_pP,uint8_t eNB_index){
PROTOCOL_CTXT_SET_BY_MODULE_ID(ctxt_pP, ctxt_pP->module_id, ENB_FLAG_NO,UE_mac_inst[ctxt_pP->module_id].crnti, ctxt_pP->frame, 0, eNB_index);
}
#ifdef LOCALIZATION #ifdef LOCALIZATION
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
double double
......
...@@ -824,6 +824,18 @@ typedef struct { ...@@ -824,6 +824,18 @@ typedef struct {
boolean_t active[NUMBER_OF_UE_MAX]; boolean_t active[NUMBER_OF_UE_MAX];
} UE_list_t; } UE_list_t;
typedef struct {
long hys;
long ttt_ms;
long ofn;
long ocn;
long ofs;
long ocs;
long off;
float rsrp_filter_coeff;
float rsrq_filter_coeff;
}Handover_eNB_info;
/*! \brief eNB common channels */ /*! \brief eNB common channels */
typedef struct { typedef struct {
/// Outgoing DCI for PHY generated by eNB scheduler /// Outgoing DCI for PHY generated by eNB scheduler
...@@ -909,7 +921,7 @@ typedef struct { ...@@ -909,7 +921,7 @@ typedef struct {
time_stats_t schedule_mch; time_stats_t schedule_mch;
/// processing time of eNB ULSCH reception /// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind time_stats_t rx_ulsch_sdu; // include rlc_data_ind
Handover_eNB_info ho_info;
} eNB_MAC_INST; } eNB_MAC_INST;
/* /*
......
...@@ -754,6 +754,9 @@ int rrc_mac_config_req(module_id_t module_idP, ...@@ -754,6 +754,9 @@ int rrc_mac_config_req(module_id_t module_idP,
#endif #endif
); );
// Assign the new c-rnti in the UE context (during HO)
void rrc_mac_get_new_crnti(protocol_ctxt_t* ctxt_pP,uint8_t eNB_index);
/** \brief get the estimated UE distance from the PHY->MAC layer. /** \brief get the estimated UE distance from the PHY->MAC layer.
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
@param UE_id Index of UE if this is an eNB configuration @param UE_id Index of UE if this is an eNB configuration
......
...@@ -394,7 +394,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -394,7 +394,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
1); //post_padding 1); //post_padding
return(&UE_mac_inst[module_idP].RA_prach_resources); return(&UE_mac_inst[module_idP].RA_prach_resources);
} else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) { } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) {
// This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example) // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
......
...@@ -2396,6 +2396,12 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_ ...@@ -2396,6 +2396,12 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2); measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2);
#ifdef Rel10
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.ext1=NULL;
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.ext2=NULL;
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
(void*)&ul_dcch_msg, (void*)&ul_dcch_msg,
buffer, buffer,
......
...@@ -239,8 +239,8 @@ typedef struct HANDOVER_INFO_s { ...@@ -239,8 +239,8 @@ typedef struct HANDOVER_INFO_s {
uint8_t ho_complete; uint8_t ho_complete;
uint8_t modid_s; //module_idP of serving cell uint8_t modid_s; //module_idP of serving cell
uint8_t modid_t; //module_idP of target cell uint8_t modid_t; //module_idP of target cell
uint8_t ueid_s; //UE index in serving cell uint16_t ueid_s; //UE index in serving cell
uint8_t ueid_t; //UE index in target cell uint16_t ueid_t; //UE index in target cell
AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */ AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
AS_Context_t as_context; /* They are mandatory for HO */ AS_Context_t as_context; /* They are mandatory for HO */
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */ uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
......
...@@ -279,6 +279,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -279,6 +279,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
const uint32_t nas_length const uint32_t nas_length
); );
void rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s* ue_context_p, protocol_ctxt_t* const ctxt_pP);
void rrc_eNB_target_add_ue_handover(protocol_ctxt_t* const ctxt_pP);
//L2_interface.c //L2_interface.c
int8_t int8_t
mac_rrc_lite_data_req( mac_rrc_lite_data_req(
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "PHY/TOOLS/dB_routines.h" #include "PHY/TOOLS/dB_routines.h"
#include "extern.h" #include "extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "RRC/LITE/rrc_eNB_primitives.h"
#include "LAYER2/RLC/rlc.h" #include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
...@@ -463,7 +464,7 @@ static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol ...@@ -463,7 +464,7 @@ static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol
size = do_RRCConnectionReconfigurationComplete(ctxt_pP, buffer, Transaction_id); size = do_RRCConnectionReconfigurationComplete(ctxt_pP, buffer, Transaction_id);
LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel UL-DCCH (SRB1), Generating RRCConnectionReconfigurationComplete (bytes %d, eNB_index %d)\n", LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel UL-DCCH (SRB1), Generating RRCConnectionReconfigurationComplete (bytes %d, eNB_index %d)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), size, eNB_index); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), size, eNB_index);
LOG_D(RLC, LOG_D(RRC,
"[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionReconfigurationComplete to eNB %d MUI %d) --->][PDCP][INST %02d][RB %02d]\n", "[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionReconfigurationComplete to eNB %d MUI %d) --->][PDCP][INST %02d][RB %02d]\n",
ctxt_pP->frame, ctxt_pP->frame,
UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id),
...@@ -1695,13 +1696,13 @@ rrc_ue_process_mobilityControlInfo( ...@@ -1695,13 +1696,13 @@ rrc_ue_process_mobilityControlInfo(
} }
*/ */
//Removing SRB1 and SRB2 and DRB0 //Removing SRB1 and SRB2 and DRB0
LOG_N(RRC,"[UE %d] : Update needed for rrc_pdcp_config_req (deprecated) and rrc_rlc_config_req commands(deprecated)\n", ctxt_pP->module_id); //LOG_N(RRC,"[UE %d] : Update needed for rrc_pdcp_config_req (deprecated) and rrc_rlc_config_req commands(deprecated)\n", ctxt_pP->module_id);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH,UNDEF_SECURITY_MODE); //rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, CONFIG_ACTION_REMOVE,ctxt_pP->module_id+DCCH,Rlc_info_am_config); //rrc_rlc_config_req(ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, CONFIG_ACTION_REMOVE,ctxt_pP->module_id+DCCH,Rlc_info_am_config);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH1,UNDEF_SECURITY_MODE); //rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH1,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(ctxt_pP, SRB_FLAG_YES,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ctxt_pP->module_id+DCCH1,Rlc_info_am_config); //rrc_rlc_config_req(ctxt_pP, SRB_FLAG_YES,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ctxt_pP->module_id+DCCH1,Rlc_info_am_config);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_NO, CONFIG_ACTION_REMOVE, DTCH,UNDEF_SECURITY_MODE); //rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_NO, CONFIG_ACTION_REMOVE, DTCH,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(ctxt_pP, SRB_FLAG_NO,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ctxt_pP->module_id+DTCH,Rlc_info_um); //rrc_rlc_config_req(ctxt_pP, SRB_FLAG_NO,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ctxt_pP->module_id+DTCH,Rlc_info_um);
/* /*
rrc_pdcp_config_asn1_req(NB_eNB_INST+ue_mod_idP,frameP, 0,eNB_index, rrc_pdcp_config_asn1_req(NB_eNB_INST+ue_mod_idP,frameP, 0,eNB_index,
NULL, // SRB_ToAddModList NULL, // SRB_ToAddModList
...@@ -1795,6 +1796,7 @@ rrc_ue_process_mobilityControlInfo( ...@@ -1795,6 +1796,7 @@ rrc_ue_process_mobilityControlInfo(
// rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DCCH,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); // rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DCCH,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
// rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DCCH1,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); // rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DCCH1,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
// rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DTCH,RADIO_ACCESS_BEARER,Rlc_info_um); // rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,ue_mod_idP+DTCH,RADIO_ACCESS_BEARER,Rlc_info_um);
rrc_mac_get_new_crnti(ctxt_pP,eNB_index);
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_SI_RECEIVED; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_SI_RECEIVED;
} }
...@@ -3437,11 +3439,17 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in ...@@ -3437,11 +3439,17 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index ) void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{ {
float a = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp; // 'a' in 36.331 Sec. 5.5.3.2 float a;
float a1 = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq; float a1;
//float rsrp_db, rsrq_db; //float rsrp_db, rsrq_db;
uint8_t eNB_offset; uint8_t eNB_offset;
if(!((a=get_rsrp_filter_coeff(ctxt_pP->module_id))>=0))
a = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp; // 'a' in 36.331 Sec. 5.5.3.2
if(!((a1=get_rsrq_filter_coeff(ctxt_pP->module_id))>=0))
a1 = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq;
if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) { // Only consider 1 serving cell (index: 0) if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) { // Only consider 1 serving cell (index: 0)
if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA != NULL) { if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA != NULL) {
if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP != NULL) { if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP != NULL) {
...@@ -3601,8 +3609,8 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con ...@@ -3601,8 +3609,8 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
TimeToTrigger_t ttt_ms; TimeToTrigger_t ttt_ms;
Q_OffsetRange_t ofn; Q_OffsetRange_t ofn;
Q_OffsetRange_t ocn; Q_OffsetRange_t ocn;
Q_OffsetRange_t ofs = 0; Q_OffsetRange_t ofs;
Q_OffsetRange_t ocs = 0; Q_OffsetRange_t ocs;
long a3_offset; long a3_offset;
MeasObjectId_t measObjId; MeasObjectId_t measObjId;
ReportConfigId_t reportConfigId; ReportConfigId_t reportConfigId;
...@@ -3623,17 +3631,29 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con ...@@ -3623,17 +3631,29 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
(UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.present==ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA) && (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.present==ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA) &&
(UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.present == (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.present ==
ReportConfigEUTRA__triggerType_PR_event)) { ReportConfigEUTRA__triggerType_PR_event)) {
hys = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis; if(!((hys=get_hys(ctxt_pP->module_id))>=0))
hys = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis;
//LOG_D(RRC,"Hysteresis for eNB %d is set to %ld\n",ctxt_pP->module_id,hys);
//LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ctxt_pP->module_id, frameP); //LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ctxt_pP->module_id, frameP);
ttt_ms = timeToTrigger_ms[UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId if(!((ttt_ms=get_ttt_ms(ctxt_pP->module_id))>=0))
-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger]; ttt_ms = timeToTrigger_ms[UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger];
//LOG_D(RRC,"Time to trigger for eNB %d is set to %d\n",ctxt_pP->module_id,ttt_ms);
// Freq specific offset of neighbor cell freq // Freq specific offset of neighbor cell freq
ofn = 15;//((UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ? if(!((ofn=get_ofn(ctxt_pP->module_id))>=0))
ofn=5;
//LOG_D(RRC,"OFN for eNB %d is set to %d\n",ctxt_pP->module_id,ofn);
//((UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ?
// *UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */ // *UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */
// cellIndividualOffset of neighbor cell - not defined yet // cellIndividualOffset of neighbor cell - not defined yet
ocn = 0; if(!((ocn=get_ocn(ctxt_pP->module_id))>=0))
a3_offset = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId ocn = 0;
-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset; if(!((ofs=get_ofs(ctxt_pP->module_id))>=0))
ofs = 0;
if(!((ocs=get_ocs(ctxt_pP->module_id))>=0))
ocs = 0;
if(!((a3_offset=get_off(ctxt_pP->module_id))>=0))
a3_offset = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset;
switch (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.present) { switch (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.present) {
case ReportConfigEUTRA__triggerType__event__eventId_PR_eventA1: case ReportConfigEUTRA__triggerType__event__eventId_PR_eventA1:
......
...@@ -509,6 +509,7 @@ rrc_rx_tx( ...@@ -509,6 +509,7 @@ rrc_rx_tx(
if((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State == RRC_HO_EXECUTION) && if((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State == RRC_HO_EXECUTION) &&
(UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId != 0xFF)) { (UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId != 0xFF)) {
UE_rrc_inst[ctxt_pP->module_id].Srb0[enb_indexP].Tx_buffer.payload_size = 0;
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State= RRC_IDLE; UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State= RRC_IDLE;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return(RRC_HO_STARTED); return(RRC_HO_STARTED);
......
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2015 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file event_handler.h
* \brief primitives to handle event acting on oai
* \author Konstantinos Alexandris,
* \date 2015
* \version 0.5
* @ingroup _oai
*/
#include "targets/SIMU/USER/oaisim.h"
#include "rrc_eNB_primitives.h"
#include "UTIL/OCG/OCG.h"
// HO parameters initialization
void init_HO(Handover_info* ho_info)
{
int enb_module_id=0;
for(enb_module_id=0; enb_module_id<NUMBER_OF_eNB_MAX; enb_module_id++) {
// Set ofn parameter
set_hys(enb_module_id,ho_info->hys);
set_ttt_ms(enb_module_id,ho_info->ttt_ms);
set_ofn(enb_module_id,ho_info->ofn);
set_ocn(enb_module_id,ho_info->ocn);
set_ofs(enb_module_id,ho_info->ofs);
set_ocs(enb_module_id,ho_info->ocs);
set_off(enb_module_id,ho_info->off);
set_rsrp_filter_coeff(enb_module_id,ho_info->rsrp_filter_coeff);
set_rsrq_filter_coeff(enb_module_id,ho_info->rsrq_filter_coeff);
}
}
// Getters/setters for HO parameters
// Hysteresis
void set_hys(int enb_module_id,long hys){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.hys=hys;
printf("Hysteresis for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.hys);
}
long get_hys(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.hys;
}
// Time to trigger
void set_ttt_ms(int enb_module_id,long ttt_ms){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ttt_ms=ttt_ms;
printf("Time to trigger for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ttt_ms);
}
long get_ttt_ms(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ttt_ms;
}
// OFN
void set_ofn(int enb_module_id,long ofn){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ofn=ofn;
printf("OFN for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ofn);
}
long get_ofn(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ofn;
}
// OCN
void set_ocn(int enb_module_id,long ocn){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ocn=ocn;
printf("OCN for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ocn);
}
long get_ocn(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ocn;
}
// OFS
void set_ofs(int enb_module_id,long ofs){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ofs=ofs;
printf("OFS for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ofs);
}
long get_ofs(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ofs;
}
// OCS
void set_ocs(int enb_module_id,long ocs){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ocs=ocs;
printf("OCS for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ocs);
}
long get_ocs(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ocs;
}
// OFF (a3_offset)
void set_off(int enb_module_id,long off){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.off=off;
printf("OFF for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.off);
}
long get_off(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.off;
}
// L3 filtering coefficient RSRP
void set_rsrp_filter_coeff(int enb_module_id,float rsrp_filter_coeff){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.rsrp_filter_coeff=rsrp_filter_coeff;
printf("L3 RSRP filtering coefficient for eNB %d is set to %f\n",enb_module_id,eNB_mac_inst->ho_info.rsrp_filter_coeff);
}
float get_rsrp_filter_coeff(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.rsrp_filter_coeff;
}
// L3 filtering coefficient RSRP
void set_rsrq_filter_coeff(int enb_module_id,float rsrq_filter_coeff){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.rsrq_filter_coeff=rsrq_filter_coeff;
printf("L3 RSRQ filtering coefficient for eNB %d is set to %f\n",enb_module_id,eNB_mac_inst->ho_info.rsrq_filter_coeff);
}
float get_rsrq_filter_coeff(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.rsrq_filter_coeff;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2015 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file event_handler.h
* \brief primitives to handle event acting on oai
* \author Konstantinos Alexandris,
* \date 2015
* \version 0.5
* @ingroup _oai
*/
#include "UTIL/OCG/OCG.h"
// HO parameters initialization
void init_HO(Handover_info* ho_info);
// Getters/setters for HO parameters
void set_hys(int enb_module_id,long hys);
long get_hys(int enb_module_id);
void set_ttt_ms(int enb_module_id,long ttt_ms);
long get_ttt_ms(int enb_module_id);
void set_ofn(int enb_module_id,long ofn);
long get_ofn(int enb_module_id);
void set_ocn(int enb_module_id,long ocn);
long get_ocn(int enb_module_id);
void set_ofs(int enb_module_id,long ofs);
long get_ofs(int enb_module_id);
void set_ocs(int enb_module_id,long ocs);
long get_ocs(int enb_module_id);
void set_off(int enb_module_id,long off);
long get_off(int enb_module_id);
void set_rsrp_filter_coeff(int enb_module_id,float rsrp_filter_coeff);
float get_rsrp_filter_coeff(int enb_module_id);
void set_rsrq_filter_coeff(int enb_module_id,float rsrq_filter_coeff);
float get_rsrq_filter_coeff(int enb_module_id);
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "OCG_extern.h" #include "OCG_extern.h"
#include "log.h" #include "log.h"
#include "log_extern.h" #include "log_extern.h"
#include "rrc_eNB_primitives.h"
extern cli_config *cli_cfg; extern cli_config *cli_cfg;
...@@ -223,6 +224,8 @@ int process_argument(int optc, char* optv[]) ...@@ -223,6 +224,8 @@ int process_argument(int optc, char* optv[])
int index; int index;
int state; int state;
long value;
float value1;
int comp=0, level=0, flag=0x34, interval=0; int comp=0, level=0, flag=0x34, interval=0;
while (optc > 0) { while (optc > 0) {
...@@ -260,6 +263,160 @@ int process_argument(int optc, char* optv[]) ...@@ -260,6 +263,160 @@ int process_argument(int optc, char* optv[])
return ERR; return ERR;
} }
// Handover CLI
// Set hysteresis value
if ((strcmp(*optv, "hys") == 0) || (strcmp(*optv, "HYS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] Hysteresis is set to %ld for eNB %d\n",value,index);
set_hys(index,value);
} else
return ERR;
}
// Set time to trigger value
if ((strcmp(*optv, "ttt_ms") == 0) || (strcmp(*optv, "TTT_ms") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] Time to trigger is set to %ld for eNB %d\n",value,index);
set_ttt_ms(index,value);
} else
return ERR;
}
// Set ofn value
if ((strcmp(*optv, "ofn") == 0) || (strcmp(*optv, "OFN") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFN is set to %ld for eNB %d\n",value,index);
set_ofn(index,value);
} else
return ERR;
}
// Set ocn value
if ((strcmp(*optv, "ocn") == 0) || (strcmp(*optv, "OCN") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OCN is set to %ld for eNB %d\n",value,index);
set_ocn(index,value);
} else
return ERR;
}
// Set ofs value
if ((strcmp(*optv, "ofs") == 0) || (strcmp(*optv, "OFS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFS is set to %ld for eNB %d\n",value,index);
set_ofs(index,value);
} else
return ERR;
}
// Set ocs value
if ((strcmp(*optv, "ocs") == 0) || (strcmp(*optv, "OCS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OCS is set to %ld for eNB %d\n",value,index);
set_ocs(index,value);
} else
return ERR;
}
// Set off value
if ((strcmp(*optv, "off") == 0) || (strcmp(*optv, "OFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFF is set to %ld for eNB %d\n",value,index);
set_off(index,value);
} else
return ERR;
}
// Set L3 filtering coefficient RSRP value
if ((strcmp(*optv, "rsrp_filter_coeff") == 0) || (strcmp(*optv, "RSRP_FILTER_COEFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value1 = atoi (*optv);
printf("[CLI] L3 RSRP filtering coefficient is set to %f for eNB %d\n",value1,index);
set_rsrp_filter_coeff(index,value);
} else
return ERR;
}
// Set L3 filtering coefficient RSRQ value
if ((strcmp(*optv, "rsrq_filter_coeff") == 0) || (strcmp(*optv, "RSRQ_FILTER_COEFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value1 = atoi (*optv);
printf("[CLI] L3 RSRQ filtering coefficient is set to %f for eNB %d\n",value1,index);
set_rsrq_filter_coeff(index,value);
} else
return ERR;
}
// fixme // fixme
if ((strcmp(*optv, "log") == 0) || (strcmp(*optv, "LOG") == 0) ) { if ((strcmp(*optv, "log") == 0) || (strcmp(*optv, "LOG") == 0) ) {
......
...@@ -735,6 +735,18 @@ typedef struct { ...@@ -735,6 +735,18 @@ typedef struct {
} Info; } Info;
/* @}*/ /* @}*/
typedef struct {
long hys;
long ttt_ms;
long ofn;
long ocn;
long ofs;
long ocs;
long off;
float rsrp_filter_coeff;
float rsrq_filter_coeff;
}Handover_info;
/** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor /** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor
* @ingroup _OCG * @ingroup _OCG
* @brief OAI Emulation struct for OSD_basic * @brief OAI Emulation struct for OSD_basic
...@@ -747,6 +759,7 @@ typedef struct { ...@@ -747,6 +759,7 @@ typedef struct {
Emulation_Config emulation_config; /*!< \brief Emulation configuration */ Emulation_Config emulation_config; /*!< \brief Emulation configuration */
Protocol_Config protocol_config; /* specific protocol configuration*/ Protocol_Config protocol_config; /* specific protocol configuration*/
Info info; /*!< \brief Some important information which should be able to be reached by OAISIM */ Info info; /*!< \brief Some important information which should be able to be reached by OAISIM */
Handover_info ho_info; // Information for handover
char *profile; char *profile;
} OAI_Emulation; } OAI_Emulation;
/* @}*/ /* @}*/
......
0 0 1800 4700 200 0 0 1800 4800 1000
1 0 4700 4840 1000
2 0 6500 4880 1000
0 0 2680 4800 0 0 0 2680 4800 0
0 1 4648 4800 0 0 1 3880 4800 0
...@@ -94,6 +94,7 @@ char smbv_ip[16]; ...@@ -94,6 +94,7 @@ char smbv_ip[16];
#include "oaisim.h" #include "oaisim.h"
#include "oaisim_config.h" #include "oaisim_config.h"
#include "RRC/LITE/rrc_eNB_primitives.h"
#include "UTIL/OCG/OCG_extern.h" #include "UTIL/OCG/OCG_extern.h"
#include "cor_SF_sim.h" #include "cor_SF_sim.h"
#include "UTIL/OMG/omg_constants.h" #include "UTIL/OMG/omg_constants.h"
...@@ -160,7 +161,7 @@ extern uint8_t target_ul_mcs; ...@@ -160,7 +161,7 @@ extern uint8_t target_ul_mcs;
extern uint8_t abstraction_flag; extern uint8_t abstraction_flag;
extern uint8_t ethernet_flag; extern uint8_t ethernet_flag;
extern uint16_t Nid_cell; extern uint16_t Nid_cell;
extern uint8_t use_user_control_interface;
extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
#ifdef XFORMS #ifdef XFORMS
...@@ -210,6 +211,7 @@ help (void) ...@@ -210,6 +211,7 @@ help (void)
printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n"); printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n");
printf ("-G Enable background traffic \n"); printf ("-G Enable background traffic \n");
printf ("-H Enable handover operation (default disabled) \n"); printf ("-H Enable handover operation (default disabled) \n");
printf ("-i Run with user control interface");
printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n"); printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n");
printf ("-k Set the Ricean factor (linear)\n"); printf ("-k Set the Ricean factor (linear)\n");
printf ("-K [log_file] Enable ITTI logging into log_file\n"); printf ("-K [log_file] Enable ITTI logging into log_file\n");
...@@ -446,6 +448,7 @@ l2l1_task (void *args_p) ...@@ -446,6 +448,7 @@ l2l1_task (void *args_p)
char fname[64], vname[64]; char fname[64], vname[64];
int sf; int sf;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
int ret;
#ifdef XFORMS #ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE // at eNB 0, an UL scope for every UE
...@@ -1125,8 +1128,14 @@ l2l1_task (void *args_p) ...@@ -1125,8 +1128,14 @@ l2l1_task (void *args_p)
*/ */
} // if Channel_Flag==0 } // if Channel_Flag==0
if (slot % 2 == 1) if (slot % 2 == 1) {
stop_meas (&oaisim_stats_f); stop_meas (&oaisim_stats_f);
if (use_user_control_interface && (frame > 5))
if ( (ret = user_control_interface(10*frame + (slot>>1)))==-1) {
frame=oai_emulation.info.n_frames; // exit main loop
break;
}
}
} //end of slot } //end of slot
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0) if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
...@@ -1204,7 +1213,7 @@ l2l1_task (void *args_p) ...@@ -1204,7 +1213,7 @@ l2l1_task (void *args_p)
#endif #endif
} }
//end of frame //end of frame
stop_meas (&oaisim_stats); stop_meas (&oaisim_stats);
...@@ -1326,6 +1335,8 @@ main (int argc, char **argv) ...@@ -1326,6 +1335,8 @@ main (int argc, char **argv)
init_ocm (); init_ocm ();
init_HO(&oai_emulation.ho_info);
#ifdef SMBV #ifdef SMBV
// Rohde&Schwarz SMBV100A vector signal generator // Rohde&Schwarz SMBV100A vector signal generator
smbv_init_config(smbv_fname, smbv_nframes); smbv_init_config(smbv_fname, smbv_nframes);
......
...@@ -322,6 +322,9 @@ void init_oai_emulation(void) ...@@ -322,6 +322,9 @@ void init_oai_emulation(void)
oai_emulation.info.transmission_mode[CC_id]=2; oai_emulation.info.transmission_mode[CC_id]=2;
} }
// Handover initialization parameters
oai_emu_ho_init(&oai_emulation.ho_info);
oai_emulation.profile = "EURECOM"; oai_emulation.profile = "EURECOM";
} }
...@@ -458,7 +461,7 @@ int olg_config(void) ...@@ -458,7 +461,7 @@ int olg_config(void)
set_comp_log(RRC, LOG_DEBUG, 0x15,1); set_comp_log(RRC, LOG_DEBUG, 0x15,1);
set_comp_log(OCM, LOG_ERR, 0x15,20); set_comp_log(OCM, LOG_ERR, 0x15,20);
set_comp_log(OTG, LOG_DEBUG, 0x15,1); set_comp_log(OTG, LOG_DEBUG, 0x15,1);
set_comp_log(OMG, LOG_NOTICE, 0x15,1); set_comp_log(OMG, LOG_DEBUG, 0x15,1);
set_comp_log(OPT, LOG_ERR, 0x15,1); set_comp_log(OPT, LOG_ERR, 0x15,1);
...@@ -1354,3 +1357,15 @@ void ocg_config_proto(void) ...@@ -1354,3 +1357,15 @@ void ocg_config_proto(void)
} }
void oai_emu_ho_init(Handover_info* ho_info){
ho_info->hys=-1;
ho_info->ttt_ms=-1;
ho_info->ofn=-1;
ho_info->ocn=-1;
ho_info->ofs=-1;
ho_info->ocs=-1;
ho_info->off=-1;
ho_info->rsrp_filter_coeff=-1;
ho_info->rsrq_filter_coeff=-1;
}
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <time.h> #include <time.h>
#include <mcheck.h> #include <mcheck.h>
#include <sys/timerfd.h> #include <sys/timerfd.h>
#include <string.h>
#include "assertions.h" #include "assertions.h"
#include "oaisim_functions.h" #include "oaisim_functions.h"
...@@ -118,6 +119,8 @@ uint8_t beta_ACK = 0; ...@@ -118,6 +119,8 @@ uint8_t beta_ACK = 0;
uint8_t beta_RI = 0; uint8_t beta_RI = 0;
uint8_t beta_CQI = 2; uint8_t beta_CQI = 2;
uint8_t target_ul_mcs = 16; uint8_t target_ul_mcs = 16;
uint8_t use_user_control_interface = 0;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int map1,map2; int map1,map2;
double **ShaF = NULL; double **ShaF = NULL;
...@@ -206,6 +209,12 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -206,6 +209,12 @@ void get_simulation_options(int argc, char *argv[])
LONG_OPTION_MALLOC_TRACE_ENABLED, LONG_OPTION_MALLOC_TRACE_ENABLED,
LONG_OPTION_CBA_BACKOFF_TIMER, LONG_OPTION_CBA_BACKOFF_TIMER,
LONG_OPTION_HYS,
LONG_OPTION_TTT_MS,
LONG_OPTION_USER_CONTROL_INTERFACE
}; };
static struct option long_options[] = { static struct option long_options[] = {
...@@ -237,11 +246,40 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -237,11 +246,40 @@ void get_simulation_options(int argc, char *argv[])
{"cba-backoff", required_argument, 0, LONG_OPTION_CBA_BACKOFF_TIMER}, {"cba-backoff", required_argument, 0, LONG_OPTION_CBA_BACKOFF_TIMER},
{"hys", required_argument, 0, LONG_OPTION_HYS},
{"ttt_ms", required_argument, 0, LONG_OPTION_TTT_MS},
{"user-control-interface",no_argument,0,LONG_OPTION_USER_CONTROL_INTERFACE},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) { while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
switch (option) { switch (option) {
case LONG_OPTION_HYS:
if (optarg) {
oai_emulation.ho_info.hys = atoi(optarg);
//printf("Hysteresis is %ld \n",oai_emulation.ho_info.hys);
}
if(oai_emulation.ho_info.hys<0){
printf("Unsupported hysteresis value-Hysteresis should be non-negative\n");
exit(-1);
}
break;
case LONG_OPTION_TTT_MS:
if (optarg) {
oai_emulation.ho_info.ttt_ms = atoi(optarg);
//printf("Time to trigger is %ld \n",oai_emulation.ho_info.ttt_ms);
}
if(oai_emulation.ho_info.ttt_ms<0){
printf("Unsupported time to trigger value-Time to trigger should be non-negative\n");
exit(-1);
}
break;
case LONG_OPTION_ENB_CONF: case LONG_OPTION_ENB_CONF:
if (optarg) { if (optarg) {
free(conf_config_file_name); // prevent memory leak if option is used multiple times free(conf_config_file_name); // prevent memory leak if option is used multiple times
...@@ -395,6 +433,10 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -395,6 +433,10 @@ void get_simulation_options(int argc, char *argv[])
break; break;
#endif #endif
case LONG_OPTION_USER_CONTROL_INTERFACE:
use_user_control_interface=1;
break;
case 'a': case 'a':
abstraction_flag = 1; abstraction_flag = 1;
...@@ -1537,3 +1579,88 @@ void init_time() ...@@ -1537,3 +1579,88 @@ void init_time()
td_avg = TARGET_SF_TIME_NS; td_avg = TARGET_SF_TIME_NS;
} }
int user_control_interface(int sfn) {
static int wait_sfn = 1<<31;
int wait_sfn_new=0,not_done=1;
char string[100],cp[100],*token;
PHY_VARS_UE *UE;
int UEid,ret;
while (not_done) {
if (sfn < wait_sfn) {
not_done=0;
return(0);
}
else {
printf("oaisim (%d)> ",sfn);
ret=fgets(string, sizeof(string), stdin);
}
token = strtok (string, " \n");
if (token && (strcmp(token,"run")==0)) {
token = strtok(NULL," \n");
if (token) {
wait_sfn_new = atoi(token);
}
else
wait_sfn_new = sfn+1;
if (wait_sfn_new <= sfn)
printf("Illegal sfn %d\n",wait_sfn_new);
else {
wait_sfn = wait_sfn_new;
not_done=0;
return(0);
}
}
else if (token && (strcmp(token,"quit")==0)) {
not_done=0;
return(-1);
}
else if (token && (strcmp(token,"step")==0)) {
wait_sfn_new = sfn+1;
not_done=0;
return(0);
}
else if (token && (strcmp(token,"dump")==0)) {
token = strtok(NULL," \n");
if (token && (strcmp(token,"UEPHY")==0)) {
token = strtok(NULL," \n");
if (token)
UEid=atoi(token);
else
UEid=0;
UE = PHY_vars_UE_g[UEid][0]; // fix to CCid 0
printf("UE %d Frame %3d Subframe %2d\n----------------------\n",UEid,sfn/10,sfn%10);
printf("N_id_Cell %d\t",UE->lte_frame_parms.Nid_cell);
printf("N_RB_DL %d\t",UE->lte_frame_parms.N_RB_DL);
printf("RX Gain %d\t",UE->rx_total_gain_dB);
printf("N0 %d dBm/RE\t",UE->PHY_measurements.n0_power_tot_dBm);
printf("RSSI %f dBm/RE\t",10*log10(UE->PHY_measurements.rssi)-UE->rx_total_gain_dB);
printf("\n");
printf("RSRP 0 (%d) %f dBm/RE\t",UE->lte_frame_parms.Nid_cell,10*log10(1+UE->PHY_measurements.rsrp[0])-UE->rx_total_gain_dB);
printf("RSRP 1 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[0],10*log10(1+UE->PHY_measurements.rsrp[1])-UE->rx_total_gain_dB);
printf("RSRP 2 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[1],10*log10(1+UE->PHY_measurements.rsrp[2])-UE->rx_total_gain_dB);
printf("\n");
printf("RSRP 3 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[2],10*log10(1+UE->PHY_measurements.rsrp[3])-UE->rx_total_gain_dB);
printf("RSRP 4 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[3],10*log10(1+UE->PHY_measurements.rsrp[4])-UE->rx_total_gain_dB);
printf("RSRP 5 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[4],10*log10(1+UE->PHY_measurements.rsrp[5])-UE->rx_total_gain_dB);
printf("\n");
}
else {
printf("Frame %3d Subframe %2d\n-----------------",sfn/10,sfn%10);
}
}
else {
printf("Commands \n\n");
printf("run sfn\t\t\t run until subframe number\n");
printf("step\t\t\t run one subframe\n");
printf("dump [UEPHY] index\t dump UE information\n");
printf("quit\t\t\t quit oaisim\n");
}
}
return(0);
}
...@@ -75,4 +75,6 @@ int init_slot_isr(void); ...@@ -75,4 +75,6 @@ int init_slot_isr(void);
void wait_for_slot_isr(void); void wait_for_slot_isr(void);
int user_control_interface(int);
#endif /* OAISIM_FUNCTIONS_H_ */ #endif /* OAISIM_FUNCTIONS_H_ */
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