From e04ed98994ef48a7e4511de78c2550b2d9634f62 Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@openairinterface.org>
Date: Tue, 1 Oct 2024 10:52:20 +0200
Subject: [PATCH] Remove unused code

---
 nfapi/oai_integration/aerial/fapi_vnf_p7.c | 99 ----------------------
 1 file changed, 99 deletions(-)

diff --git a/nfapi/oai_integration/aerial/fapi_vnf_p7.c b/nfapi/oai_integration/aerial/fapi_vnf_p7.c
index 30f85165ea..f6179e06d4 100644
--- a/nfapi/oai_integration/aerial/fapi_vnf_p7.c
+++ b/nfapi/oai_integration/aerial/fapi_vnf_p7.c
@@ -35,105 +35,6 @@
 
 #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" // for handle_nr_srs_measurements()
 
-extern RAN_CONTEXT_t RC;
-extern UL_RCC_IND_t UL_RCC_INFO;
-extern uint16_t sf_ahead;
-
-int aerialwake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf)
-{
-  L1_proc_t *proc = &eNB->proc;
-  L1_rxtx_proc_t *L1_proc = (sf & 1) ? &proc->L1_proc : &proc->L1_proc_tx;
-  LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
-  // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
-  // int i;
-  struct timespec wait;
-  wait.tv_sec = 0;
-  wait.tv_nsec = 5000000L;
-
-  // wake up TX for subframe n+sf_ahead
-  // lock the TX mutex and make sure the thread is ready
-  // if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) {
-  //  LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt );
-  //  exit_fun( "error locking mutex_rxtx" );
-  //  return(-1);
-  //}
-
-  {
-    static uint16_t old_sf = 0;
-    static uint16_t old_sfn = 0;
-    proc->subframe_rx = old_sf;
-    proc->frame_rx = old_sfn;
-    // Try to be 1 frame back
-    old_sf = sf;
-    old_sfn = sfn;
-
-    if (old_sf == 0 && old_sfn % 100 == 0)
-      LOG_D(PHY, "[eNB] sfn/sf:%d%d old_sfn/sf:%d%d proc[rx:%d%d]\n", sfn, sf, old_sfn, old_sf, proc->frame_rx, proc->subframe_rx);
-  }
-  // wake up TX for subframe n+sf_ahead
-  // lock the TX mutex and make sure the thread is ready
-  if (pthread_mutex_timedlock(&L1_proc->mutex, &wait) != 0) {
-    LOG_E(PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx & 1, L1_proc->instance_cnt);
-    // exit_fun( "error locking mutex_rxtx" );
-    return (-1);
-  }
-  static int busy_log_cnt = 0;
-  if (L1_proc->instance_cnt < 0) {
-    ++L1_proc->instance_cnt;
-    if (busy_log_cnt != 0) {
-      LOG_E(MAC,
-            "RCC singal to rxtx frame %d subframe %d busy end %d (frame %d subframe %d)\n",
-            L1_proc->frame_rx,
-            L1_proc->subframe_rx,
-            busy_log_cnt,
-            proc->frame_rx,
-            proc->subframe_rx);
-    }
-    busy_log_cnt = 0;
-  } else {
-    if (busy_log_cnt == 0) {
-      LOG_E(MAC,
-            "RCC singal to rxtx frame %d subframe %d busy %d (frame %d subframe %d)\n",
-            L1_proc->frame_rx,
-            L1_proc->subframe_rx,
-            L1_proc->instance_cnt,
-            proc->frame_rx,
-            proc->subframe_rx);
-    }
-    pthread_mutex_unlock(&L1_proc->mutex);
-    busy_log_cnt++;
-    return (0);
-  }
-
-  pthread_mutex_unlock(&L1_proc->mutex);
-
-  // LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] L1_proc->instance_cnt_rxtx:%d \n", sfn, sf,
-  // proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx);
-  //  We have just received and processed the common part of a subframe, say n.
-  //  TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
-  //  transmitted timestamp of the next TX slot (first).
-  //  The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
-  //  we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti,
-  //  and proc->subframe_tx = proc->subframe_rx+sf_ahead
-  L1_proc->timestamp_tx = proc->timestamp_rx + (sf_ahead * fp->samples_per_tti);
-  L1_proc->frame_rx = proc->frame_rx;
-  L1_proc->subframe_rx = proc->subframe_rx;
-  L1_proc->frame_tx = (L1_proc->subframe_rx > (9 - sf_ahead)) ? (L1_proc->frame_rx + 1) & 1023 : L1_proc->frame_rx;
-  L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead) % 10;
-
-  // LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] L1_proc[instance_cnt_rxtx:%d rx:%d%d] About to wake rxtx thread\n\n", sfn, sf,
-  // proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx, L1_proc->frame_rx, L1_proc->subframe_rx);
-
-  // the thread can now be woken up
-  if (pthread_cond_signal(&L1_proc->cond) != 0) {
-    LOG_E(PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
-    exit_fun("ERROR pthread_cond_signal");
-    return (-1);
-  }
-
-  return (0);
-}
-
 extern pthread_cond_t nfapi_sync_cond;
 extern pthread_mutex_t nfapi_sync_mutex;
 extern int nfapi_sync_var;
-- 
2.26.2