From 454258d2e1177dcbae9c5b03086481415b6a736b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 12 Jul 2023 16:43:04 +0200 Subject: [PATCH 1/3] Remove unused preprocessor defines commit ddf549b1f38093dc127aef1ba46233bc7b9a668c moved the CMakeLists.txt for building radio libraries down to radio/. Previously, each option would also declare a constant (e.g., OAI_USRP for USRP). With the definition being below radio/, the executables don't have that define. This commits removes the couple of defines that were in place: - one that only shows a log, but it also applies for e.g., rfsimulator. It is also missing in the CI. Simply put it back - two other places guard a commented(!) function call, which can go out entirely --- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 35 +++---------------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 --- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 5a475b84ae..c9549b523b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -444,13 +444,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, } - -#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -#endif + LOG_I(PHY, + "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", + ue->Mod_id, + openair0_cfg[0].rx_freq[0] + ue->common_vars.freq_offset, + ue->common_vars.freq_offset); } else { #ifdef DEBUG_INITIAL_SYNC LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); @@ -486,29 +484,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, 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 OAI_ADRV9371_ZC706 - //phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); -#endif -#endif -#endif -#endif - - } - else { - -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR -#ifndef OAI_ADRV9371_ZC706 - //phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); -#endif -#endif -#endif -#endif - } if (ue->target_Nid_cell != -1) { diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index c903df6f6d..39ed35b3e7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -75,10 +75,6 @@ fifo_dump_emos_UE emos_dump_UE; #include "intertask_interface.h" #include "T.h" -#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) -extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; -#endif - 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}; void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, From eed29f8900acda437f522ceb512139472192063f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 12 Jul 2023 16:46:11 +0200 Subject: [PATCH 2/3] Remove commented, SDR ADRV9731-specific code --- executables/nr-ue.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 1b56dfccdb..2ef6e5a5bb 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -876,16 +876,6 @@ void *UE_thread(void *arg) { curMsg.proc.rx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx); curMsg.proc.tx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx); curMsg.proc.decoded_frame_rx=-1; - //LOG_I(PHY,"Process slot %d total gain %d\n", slot_nr, UE->rx_total_gain_dB); - -#ifdef OAI_ADRV9371_ZC706 - /*uint32_t total_gain_dB_prev = 0; - if (total_gain_dB_prev != UE->rx_total_gain_dB) { - total_gain_dB_prev = UE->rx_total_gain_dB; - openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB; - UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]); - }*/ -#endif int firstSymSamp = get_firstSymSamp(slot_nr, &UE->frame_parms); for (int i=0; iframe_parms.nb_antennas_rx; i++) From ec3acac9f806f9239f5522bbd2ce8becc4081df9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 12 Jul 2023 16:46:50 +0200 Subject: [PATCH 3/3] Remove functions present due to (non-existing) linking issues --- executables/nr-ue.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2ef6e5a5bb..456ddc151e 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -1000,16 +1000,3 @@ void init_NR_UE_threads(int nb_inst) { } } } - -/* HACK: this function is needed to compile the UE - * fix it somehow - */ -int find_dlsch(uint16_t rnti, - PHY_VARS_eNB *eNB, - find_type_t type) -{ - printf("you cannot read this\n"); - abort(); -} - -void multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP) {}