pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/42243?usp=email )
Change subject: build: add --disable-multi-arfcn configure option ......................................................................
build: add --disable-multi-arfcn configure option
- add configure flag to disable Multi ARFCN support - compile Channelizer, Synthesis, RadioInterfaceMulti and fft.c only when enabled - guard Multi ARFCN-specific code with ENABLE_MULTI_ARFCN - avoid requiring fftw3f when Multi ARFCN support is disabled
Change-Id: I2495c5b5c79f2fe74bef83902058e1d2207c1f3c --- M CommonLibs/trx_vty.c M Transceiver52M/Makefile.am M Transceiver52M/arch/common/Makefile.am M Transceiver52M/osmo-trx.cpp M Transceiver52M/radioBuffer.h M Transceiver52M/radioInterface.h M Transceiver52M/radioInterfaceMulti.cpp A Transceiver52M/radioInterfaceMulti.h M configure.ac M doc/manuals/chapters/configuration.adoc 10 files changed, 108 insertions(+), 45 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved
diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 9647722..b70b3fa 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -222,6 +222,12 @@ return CMD_SUCCESS; }
+#ifndef ENABLE_MULTI_ARFCN + vty_out(vty, "%% osmo-trx was built without multi-ARFCN support%s", + VTY_NEWLINE); + return CMD_WARNING; +#endif + if (trx->cfg.num_chans > TRX_MCHAN_MAX) { vty_out(vty, "Up to %i channels are supported for multi-TRX mode%s", TRX_MCHAN_MAX, VTY_NEWLINE); diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 0b63b16..74152b3 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -37,18 +37,26 @@ sigProcLib.cpp \ signalVector.cpp \ Transceiver.cpp \ - ChannelizerBase.cpp \ - Channelizer.cpp \ - Synthesis.cpp \ proto_trxd.c \ grgsm_vitac/grgsm_vitac.cpp \ grgsm_vitac/viterbi_detector.cc
+if ENABLE_MULTI_ARFCN +COMMON_SOURCES += \ + ChannelizerBase.cpp \ + Channelizer.cpp \ + Synthesis.cpp +endif + libtransceiver_common_la_SOURCES = \ $(COMMON_SOURCES) \ Resampler.cpp \ radioInterfaceResamp.cpp \ - radioInterfaceMulti.cpp + $(NULL) + +if ENABLE_MULTI_ARFCN +libtransceiver_common_la_SOURCES += radioInterfaceMulti.cpp +endif
noinst_HEADERS = \ Complex.h \ @@ -60,10 +68,15 @@ signalVector.h \ Transceiver.h \ Resampler.h \ + proto_trxd.h + +if ENABLE_MULTI_ARFCN +noinst_HEADERS += \ + radioInterfaceMulti.h \ ChannelizerBase.h \ Channelizer.h \ - Synthesis.h \ - proto_trxd.h + Synthesis.h +endif
COMMON_LDADD = \ libtransceiver_common.la \ diff --git a/Transceiver52M/arch/common/Makefile.am b/Transceiver52M/arch/common/Makefile.am index 6b37906..a27174d 100644 --- a/Transceiver52M/arch/common/Makefile.am +++ b/Transceiver52M/arch/common/Makefile.am @@ -7,9 +7,17 @@ convert.h \ scale.h \ mult.h \ - fft.h + $(NULL) + +if ENABLE_MULTI_ARFCN +noinst_HEADERS += fft.h +endif
libarch_common_la_SOURCES = \ convolve_base.c \ convert_base.c \ - fft.c + $(NULL) + +if ENABLE_MULTI_ARFCN +libarch_common_la_SOURCES += fft.c +endif diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 342c9eb..fbc1492 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -22,6 +22,10 @@ #include "radioDevice.h" #include "Utils.h"
+#ifdef ENABLE_MULTI_ARFCN +#include "radioInterfaceMulti.h" +#endif /* ENABLE_MULTI_ARFCN */ + #include <time.h> #include <signal.h> #include <stdlib.h> @@ -117,10 +121,12 @@ radio = new rif_va_wrapper<RadioInterfaceResamp>(trx->cfg.use_va, usrp, trx->cfg.tx_sps, trx->cfg.rx_sps); break; +#ifdef ENABLE_MULTI_ARFCN case RadioDevice::MULTI_ARFCN: radio = new rif_va_wrapper<RadioInterfaceMulti>(trx->cfg.use_va, usrp, trx->cfg.tx_sps, trx->cfg.rx_sps, trx->cfg.num_chans); break; +#endif /* ENABLE_MULTI_ARFCN */ default: LOG(ALERT) << "Unsupported radio interface configuration"; return NULL; diff --git a/Transceiver52M/radioBuffer.h b/Transceiver52M/radioBuffer.h index e5aa315..e2f455a 100644 --- a/Transceiver52M/radioBuffer.h +++ b/Transceiver52M/radioBuffer.h @@ -1,3 +1,6 @@ +#ifndef RADIO_BUFFER_H +#define RADIO_BUFFER_H + #include <stdlib.h> #include <stddef.h> #include <vector> @@ -43,3 +46,5 @@ std::vector<float *> segments; bool outDirection; }; + +#endif /* RADIO_BUFFER_H */ diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h index b05af78..cdcfd07 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -12,7 +12,8 @@
*/
- +#ifndef RADIO_INTERFACE_H +#define RADIO_INTERFACE_H
#include "sigProcLib.h" #include "GSMCommon.h" @@ -22,8 +23,6 @@ #include "radioClock.h" #include "radioBuffer.h" #include "Resampler.h" -#include "Channelizer.h" -#include "Synthesis.h"
static const unsigned gSlotLen = 148; ///< number of symbols per slot, not counting guard periods
@@ -162,35 +161,4 @@ double freq_hz; };
-class RadioInterfaceMulti : public RadioInterface { -private: - bool pushBuffer(); - int pullBuffer(); - bool verify_arfcn_consistency(double freq, size_t chan, bool tx); - virtual int setPowerAttenuation(int atten, size_t chan = 0); - - signalVector *outerSendBuffer; - signalVector *outerRecvBuffer; - std::vector<signalVector *> history; - std::vector<bool> active; - std::vector<struct freq_cfg_state> rx_freq_state; - std::vector<struct freq_cfg_state> tx_freq_state; - - Resampler *dnsampler; - Resampler *upsampler; - Channelizer *channelizer; - Synthesis *synthesis; - -public: - RadioInterfaceMulti(RadioDevice* radio, size_t tx_sps, - size_t rx_sps, size_t chans = 1); - virtual ~RadioInterfaceMulti(); - - bool init(int type); - void close(); - - bool tuneTx(double freq, size_t chan); - bool tuneRx(double freq, size_t chan); - virtual double setRxGain(double dB, size_t chan); - virtual double rssiOffset(size_t chan = 0); -}; +#endif /* RADIO_INTERFACE_H */ diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp index a7195b4..5450ec5 100644 --- a/Transceiver52M/radioInterfaceMulti.cpp +++ b/Transceiver52M/radioInterfaceMulti.cpp @@ -22,7 +22,7 @@ * See the COPYING file in the main directory for details. */
-#include <radioInterface.h> +#include <radioInterfaceMulti.h> #include <Logger.h>
#include "Resampler.h" diff --git a/Transceiver52M/radioInterfaceMulti.h b/Transceiver52M/radioInterfaceMulti.h new file mode 100644 index 0000000..f4d97ea --- /dev/null +++ b/Transceiver52M/radioInterfaceMulti.h @@ -0,0 +1,41 @@ +#ifndef RADIO_INTERFACE_MULTI_H +#define RADIO_INTERFACE_MULTI_H + +#include "radioInterface.h" +#include "Channelizer.h" +#include "Synthesis.h" + +class RadioInterfaceMulti : public RadioInterface { +public: + RadioInterfaceMulti(RadioDevice* radio, size_t tx_sps, + size_t rx_sps, size_t chans = 1); + virtual ~RadioInterfaceMulti(); + + bool init(int type); + void close(); + + bool tuneTx(double freq, size_t chan); + bool tuneRx(double freq, size_t chan); + virtual double setRxGain(double dB, size_t chan); + virtual double rssiOffset(size_t chan = 0); + +private: + bool pushBuffer(); + int pullBuffer(); + bool verify_arfcn_consistency(double freq, size_t chan, bool tx); + virtual int setPowerAttenuation(int atten, size_t chan = 0); + + signalVector *outerSendBuffer; + signalVector *outerRecvBuffer; + std::vector<signalVector *> history; + std::vector<bool> active; + std::vector<struct freq_cfg_state> rx_freq_state; + std::vector<struct freq_cfg_state> tx_freq_state; + + Resampler *dnsampler; + Resampler *upsampler; + Channelizer *channelizer; + Synthesis *synthesis; +}; + +#endif /* RADIO_INTERFACE_MULTI_H */ diff --git a/configure.ac b/configure.ac index c4f707b..01b2f34 100644 --- a/configure.ac +++ b/configure.ac @@ -286,7 +286,19 @@ AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) AM_CONDITIONAL(ENABLE_MS_TRX, [test "x$with_mstrx" = "xyes"])
-PKG_CHECK_MODULES(FFTWF, fftw3f) +# Disable Multi ARFCN support +AC_ARG_ENABLE(multi-arfcn, + [AS_HELP_STRING( + [--disable-multi-arfcn], + [Disable Multi ARFCN support [default=enabled]], + )], + [enable_multi_arfcn=$enableval], [enable_multi_arfcn="yes"]) +AM_CONDITIONAL(ENABLE_MULTI_ARFCN, [test "x$enable_multi_arfcn" = "xyes"]) + +if test "x$enable_multi_arfcn" = "xyes"; then + AC_DEFINE([ENABLE_MULTI_ARFCN],[1],[Building with enabled Multi ARFCN]) + PKG_CHECK_MODULES(FFTWF, fftw3f) +fi
# Generate manuals AC_ARG_ENABLE(manuals, diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index e1323ef..2f1b040 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -45,6 +45,10 @@ Multi-ARFCN support is available since osmo-trx release `0.2.0`, and it was added specifically in commit `76764278169d252980853251daeb9f1ba0c246e1`.
+osmo-trx must also be built with Multi-ARFCN support enabled, which is the +default build configuration. Builds configured with `--disable-multi-arfcn` do +not provide this feature. + This feature is useful for instance if you want to run more than 1 TRX with an Ettus B200 device, or more than 2 TRXs with an Ettus B210 device, since they support only 1 and 2 physical RF channels respectively. No device from other