From 5616e6562c3478c1810cb2b3150f4009351ac913 Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Thu, 30 Apr 2015 09:12:23 +0000
Subject: [PATCH] Sebastian Held
 patches15/0006-changed-the-remaining-USRP-defines-to-OAI_USRP.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7308 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/LTE_TRANSPORT/initial_sync.c            |  2 +-
 openair1/PHY/MODULATION/slot_fep.c                   |  8 ++++----
 targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp         |  6 ------
 .../CONF/enb.band7.generic.oaisim.local_mme.conf     |  2 +-
 targets/RT/USER/lte-softmodem.c                      |  4 ++--
 targets/RT/USER/lte-ue.c                             | 12 ++++++------
 targets/SIMU/USER/oaisim_config.c                    | 10 +++++-----
 7 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
index c1b1b802e98..e1b5a208671 100644
--- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c
+++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
@@ -293,7 +293,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
     gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
 
 #else
-#ifndef USRP
+#ifndef OAI_USRP
   phy_adjust_gain(phy_vars_ue,0);
 #endif
 #endif
diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c
index dc23b5c3f00..670a852b675 100644
--- a/openair1/PHY/MODULATION/slot_fep.c
+++ b/openair1/PHY/MODULATION/slot_fep.c
@@ -140,7 +140,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
         memcpy((void *)tmp_dft_in,
                (void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
                frame_parms->ofdm_symbol_size*sizeof(int));
-#ifdef USRP
+#ifdef OAI_USRP
         rescale((int16_t *)tmp_dft_in,
                 frame_parms->ofdm_symbol_size);
 #endif
@@ -148,7 +148,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
             (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
       } else { // use dft input from RX buffer directly
         start_meas(&phy_vars_ue->rx_dft_stats);
-#ifdef USRP
+#ifdef OAI_USRP
         rescale((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
                 frame_parms->ofdm_symbol_size+nb_prefix_samples0);
 #endif
@@ -178,14 +178,14 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
         memcpy((void *)tmp_dft_in,
                (void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
                frame_parms->ofdm_symbol_size*sizeof(int));
-#ifdef USRP
+#ifdef OAI_USRP
         rescale((int16_t *)tmp_dft_in,
                 frame_parms->ofdm_symbol_size);
 #endif
         dft((int16_t *)tmp_dft_in,
             (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
       } else { // use dft input from RX buffer directly
-#ifdef USRP
+#ifdef OAI_USRP
         rescale((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples) % frame_length_samples],
                 frame_parms->ofdm_symbol_size+nb_prefix_samples);
 #endif
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index 2346bbcd665..6e6c3575ab5 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -32,12 +32,6 @@
  * Author: HongliangXU : hong-liang-xu@agilent.com
  */
 
-#ifdef USRP
-/* USRP is both an enum in ettus library and a define for OAI */
-/* This removes the define for OAI */
-#undef USRP
-#endif
-
 #include <string.h>
 #include <pthread.h>
 #include <unistd.h>
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf
index 6ab303e0a04..b1ff94735d1 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf
@@ -124,7 +124,7 @@ eNBs =
     {
     global_log_level                      ="trace";
     global_log_verbosity                  ="medium";
-    hw_log_level                          ="trace";
+    hw_log_level                          ="info";
     hw_log_verbosity                      ="medium";
     phy_log_level                         ="trace";
     phy_log_verbosity                     ="medium";
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 92d2de5c048..4d1d6db01c1 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -1828,7 +1828,7 @@ static void get_options (int argc, char **argv)
   //  char                          line[1000];
   //  int                           l;
   int k,i;//,j,k;
-#if defined(USRP) || defined(CPRIGW)
+#if defined(OAI_USRP) || defined(CPRIGW)
   int clock_src;
 #endif
   int CC_id;
@@ -2034,7 +2034,7 @@ static void get_options (int argc, char **argv)
       break;
 
     case 's':
-#if defined(USRP) || defined(CPRIGW)
+#if defined(OAI_USRP) || defined(CPRIGW)
 
       clock_src = atoi(optarg);
 
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 773ff1fc55d..8bd7e55f6f1 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -259,7 +259,7 @@ static void *UE_thread_synch(void *arg)
 
         openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i];
         openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i];
-#ifdef USRP
+#ifdef OAI_USRP
         openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB-USRP_GAIN_OFFSET;
 
         switch(UE->lte_frame_parms.N_RB_DL) {
@@ -289,7 +289,7 @@ static void *UE_thread_synch(void *arg)
 #endif
     }
 
-#ifdef USRP
+#ifdef OAI_USRP
 #ifndef USRP_DEBUG
     openair0_set_rx_frequencies(&openair0,&openair0_cfg[0]);
     openair0_set_gains(&openair0,&openair0_cfg[0]);
@@ -349,7 +349,7 @@ static void *UE_thread_synch(void *arg)
 
           openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+openair_daq_vars.freq_offset;
           openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+openair_daq_vars.freq_offset;
-#ifdef USRP
+#ifdef OAI_USRP
           openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB-USRP_GAIN_OFFSET;  // 65 calibrated for USRP B210 @ 2.6 GHz
 
           switch(UE->lte_frame_parms.N_RB_DL) {
@@ -380,7 +380,7 @@ static void *UE_thread_synch(void *arg)
 #endif
       }
 
-#ifdef USRP
+#ifdef OAI_USRP
 #ifndef USRP_DEBUG
       openair0_set_rx_frequencies(&openair0,&openair0_cfg[0]);
       //  openair0_set_gains(&openair0,&openair0_cfg[0]);
@@ -445,7 +445,7 @@ static void *UE_thread_synch(void *arg)
           for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
             openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+openair_daq_vars.freq_offset;
             openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+openair_daq_vars.freq_offset;
-#ifdef USRP
+#ifdef OAI_USRP
             openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB-USRP_GAIN_OFFSET;  // 65 calibrated for USRP B210 @ 2.6 GHz
 
             switch(UE->lte_frame_parms.N_RB_DL) {
@@ -476,7 +476,7 @@ static void *UE_thread_synch(void *arg)
 #endif
         }
 
-#ifdef USRP
+#ifdef OAI_USRP
 #ifndef USRP_DEBUG
         openair0_set_frequencies(&openair0,&openair0_cfg[0]);
         //      openair0_set_gains(&openair0,&openair0_cfg[0]);
diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c
index 9f6edf65e81..e39d1c74753 100644
--- a/targets/SIMU/USER/oaisim_config.c
+++ b/targets/SIMU/USER/oaisim_config.c
@@ -439,7 +439,7 @@ int olg_config(void)
   set_log(RAL_UE,  LOG_DEBUG, 1);
 #endif
 
-  /*
+
    //set_log(OCG,  LOG_DEBUG, 1);
    //set_log(EMU,  LOG_INFO,  20);
    set_log(MAC,  LOG_DEBUG, 1);
@@ -451,16 +451,16 @@ int olg_config(void)
    //set_log(OTG,  LOG_INFO, 1);
    set_comp_log(OCG,  LOG_ERR, 0x15,1);
    set_comp_log(EMU,  LOG_ERR,  0x15,20);
-   set_comp_log(MAC,  LOG_DEBUG, 0x15,1);
-   set_comp_log(RLC,  LOG_INFO, 0x15,1);
-   set_comp_log(PHY,  LOG_DEBUG, 0x15, 1);
+   set_comp_log(MAC,  LOG_TRACE, 0x15,1);
+   set_comp_log(RLC,  LOG_TRACE, 0x15,1);
+   set_comp_log(PHY,  LOG_TRACE, 0x15, 1);
    set_comp_log(PDCP, LOG_DEBUG, 0x15,1);
    set_comp_log(RRC,  LOG_DEBUG, 0x15,1);
    set_comp_log(OCM,  LOG_ERR, 0x15,20);
    set_comp_log(OTG,  LOG_ERR, 0x15,1);
    set_comp_log(OMG,  LOG_ERR, 0x15,1);
    set_comp_log(OPT,  LOG_ERR, 0x15,1);
-    */
+
 
   // set_comp_log(MAC, LOG_TRACE, LOG_FULL,1);
   return 1;
-- 
GitLab