Commit Graph

31 Commits

Author SHA1 Message Date
Eric Wild 19e134a626 transceiver: pass cfg struct instead of args
Passing 7 args is a bit much, just pass the config struct instead.

Change-Id: I48386900d15ff4d770c70a4efc246d32f921904b
2023-07-25 18:25:49 +02:00
Oliver Smith a98521ac05 USRPDevice:updateAlignment: remove byteswap code
After upgrading our CI environment to use Debian 12 with GCC 12, the
byteswap code fails the build with the following. I've talked to Eric
about this and he recommended to just remove the code as practically
nobody will use osmo-trx with a big endian system.

USRPDevice.cpp:591:30: error: 'data' is used uninitialized [-Werror=uninitialized]
  591 |   *wordPtr = host_to_usrp_u32(*wordPtr);
      |              ~~~~~~~~~~~~~~~~^~~~~~~~~~

Related: OS#6057
Change-Id: I806d8c1432cb20efca1830a2752a4cbc70384b54
2023-07-13 14:34:59 +02:00
Vadim Yanitskiy 24cb0c9948 device: drop unreasonable LIBOSMO{CTRL,VTY}_{CFLAGS,LIBS}
Neither VTY nor CTRL API is used in device specific code, excluding
the 'uhd' where osmo_cpu_sched_vty_apply_localthread() is called.

Change-Id: I568b443da4b96c005734d749faa22b9c7440f951
2020-10-24 23:41:57 +00:00
Pau Espin e91544d740 Calculate RSSI offset based on RxGain configuration
Prior to this patch, osmo-trx relied totally on proper VTY configuration
being set in "rssi-offset" together with the RxGain set through TRXC in
order to provide correct Uplink RSSI measurements to bts-trx.

With this patch, RSSI is now by default calculated (in LMS and UHD
backends) based on the currently set RxGain, by providing empirically
discovered values. Still, for backward compatibility, the old
"rssi-offset" command will overwrite completely the per-default
calculated rssi offset.
A new optional parameter "relative" is added at the end of the
"rssi-offset" VTY command to flag the value as relative to the newly
per-default calculated value. This way specific setups (like adding a
LNA / RF fronted) can still be expressed while still keeping the
automatic per-default offset.

Related: OS#4468
Change-Id: I8ef78fd20c22c60d61bfb18d80a4a36df4fd6c20
2020-10-14 12:53:04 +02:00
Pau Espin 5bd3d4263b Drop old TxGain APIs from parent radioDevice abstract class
All radioDevice subclasses except USRPDevice have already been reworked
to use the new SetPowerAttenuation() methods, hence we can drop the
compatibility layer that was added to transition from the old API to the
new one, and move those functions to USRPDevice.

This way we simplify the parent abstract class with methods not needed
by most devices and not used anymore by external users of those classes.

Change-Id: Ice005cd0a07c49b6e212c06f1228ef93c24db727
2020-06-25 13:07:22 +02:00
Pau Espin 992c9bd1ce radioInterface: Operate on real Tx power attenuation rather than on device specific gains
All the Tx gain related APIs are left out of reach from radioInterface,
and in there we simply interact with radioDevice passing the attenuation
received from TRXC.

Prior gain logic is moved in base radiodevice class, with the idea that
the setTxGain() and related functions will be dropped over time in each
sublcass in favour of an specific implementation of the
SetPowerAttenuation API.

Change-Id: I4f8a1bcbed74aa9310306b97b0b1bfb02f7855e6
2020-06-09 11:43:32 +02:00
Pau Espin 0e09e7c98a Transceiver: Implement TRXC cmd NOMTXPOWER
It allows the BTS to retrieve the nominal transmit output power value of
each TRX in order to compute attenuation later on and apply it through
SETPOWER or ADJPOWER TRXC commands.

Change-Id: I1d7efe56e008d8d60e23f9a85aa40809f7f84d9c
2020-06-08 15:49:36 +02:00
Pau Espin dfc6e5ffc7 radioDevice: Drop unused isControl param from WriteSamples API
The out "isControl" parameter is only used by internal callers of
USRPDevice, and not used at all by any user of the generic API
(radioInterface*.cpp). Hence, we can get rid of it and keep it as a flag
for an internal API of USRPDevice.

Change-Id: I843384e24b76cdd28a95f9ee4e95e6157098e4a3
2020-03-12 19:35:47 +01:00
Pau Espin f8c0c464b8 radioDevice: Drop unused RSSI param from readSamples API
The out "RSSI" parameter is only filled by USRPDevice, and not used at
all by any user of the API (radioInterface*.cpp).

RSSI seems to be computed nowadays in the common path in
Transceiver::pullRadioVector().

Change-Id: I06c2ea5a9891d170bc468f952bbf2a7e64d95784
2020-03-12 19:34:28 +01:00
Pau Espin b0e54265ad lms: Change radioDevice constructor arg name to avoid masking instance attr
channel number mangling based on multi-arfcn feature being enabled was
moved to generic radioDevice() to reuse code. Hence, the generic parent
constructor sets this->chans to 1 if multi-arfcn feature is requested.
However, LMSDevice constructor argument had same name as the class
instance attribute, taking preference. As a result, if multi-arfcn is
enabled in LMSDevice, the generic constructor first sets this->chans=1
but afterwards LMSDEvice constructor keeps calling .resize() with the
argument value "chans" instead of using this->chans.

Let's rename the argument in all radioDevice child class constructors to
avoid potential future bugs in all of them.

Change-Id: Id6c837e9133f22783dd92a81dfcc493e51bf2d21
2020-01-13 16:13:28 +01:00
Martin Hauke 066fd04f47 Fix common misspellings and typos
Change-Id: I4ec7accb1912c052b446be7c399bed32a8c62253
2019-10-17 08:06:19 +00:00
Pau Espin 2ab921812e radioDevice: Introduce getTxGain() API
It will be used in later commits by radioInterfaceMulti.

Change-Id: Ie3caca8971ed1e5370dfed6fb60716a24e7d82a5
2019-09-13 17:34:46 +02:00
Pau Espin 331c88ae82 USRPDevice: Return previous txGain if setting value failed
Change-Id: I0d8fd51586ef01141d4e5896f0fc3029a22743f8
2019-09-13 17:33:14 +02:00
Pau Espin ca0892d822 USRPDevice: Fix setRxGain return on error and getRxGain() returning always 0
field rxGain is set to 0 during constructor and never set after that
point.

Change-Id: I7fae7a315e5ab98a15c27628a88a92226ef89469
2019-09-13 17:32:03 +02:00
Pau Espin 67aa91b2c0 Drop old setPriority related code
This code is not needed anymore since we are setting SCHED_RR scheduler
with a real time priority in main thread during startup, so all threads
will inherit same rt priority, which should be enough to keep the
process working reliably even on high system loads (from non rt
processes).

osmo-trx was tested to be reliable during test with stress-ng as
explained in related ticket below.

Related: OS#2344
Change-Id: I3a88946dd71e9aeeaac9d19d396e2236c302b608
2019-08-21 13:00:41 +02:00
Pau Espin cbc02086d5 Move std_inband.rbf under device/usrp1/ dir
This file is only used by USRP1, so let's move it there and avoid
processing it in Makefiles if build for USRP1 is not requested at
configure time.

Change-Id: Ibb40ba487581e76d2ae3e8a420d631670f876cf0
2019-08-01 13:46:00 +02:00
Pau Espin 207911bcde usrp1: don't check for non-null underrun pointer
The pointer can't never be null, so avoid checking it.

Change-Id: I12e14641713a6494bc89570f02cecfc6f8fd4b5e
2019-07-29 20:42:56 +02:00
Pau Espin 21d03d3912 Add SPDX annotation
Related: OS#3515
Change-Id: I3719bd8dc015569ecd81928fc079e27593cdca09
2019-07-22 12:06:26 +02:00
Pau Espin b5def414b8 smpl_buf: Move it to device/common and create libdevice_common.la
Since in next commit osmo-trx-lms starts using smpl_buf.cpp, it seems
some automake step doesn't like including a cpp file twice from a
different directory, since race conditions can occur building it.
Instead we define the dependency by first building a static lib and then
using it on each libdevice.la (one per device type).

We already do the similar under arch/ subdir, where we have a common/
subdir and then one subdir and lib per architecture.

Change-Id: I465ad0f6d5569bb3006d711c8fd0df14391fcf35
2019-05-06 11:23:18 +02:00
Pau Espin 7214fde085 device: Drop unused numberRead/numberWritten APIs
It's really not used, so let's drop unused code and simplify work for
new to come device drivers implementation.

Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff
2019-05-03 13:50:50 +02:00
Harald Welte f97d75b355 usrp1: Fix formatting of log message (missing space)
Change-Id: I378a8081a224acda3ee2af9b6aa0d680de884695
2019-01-11 22:42:29 +01:00
Harald Welte a944001873 usrp1: Remove uninitialized skipRx logic
There appears to have been some logic to operate a USRP1 in
transmit-only GSM mode.  This is achieved using the skipRx member
of the transceiver object.  However, there's nobody that ever
initializes it properly, and hence the feature is not possible to
use anyway.

I don't think this has any valid use case, so let's remove it.

Change-Id: I616193f1e9aaefbf4ceb26761657811093f28b6f
2019-01-11 21:46:45 +01:00
Pau Espin 4d179abfd0 cosmetic: Use proper whitespace in several for loops
Change-Id: I82bdeb8a3fa38f3d125e8cbccc3eddbf2b8d8f58
2018-09-13 14:27:48 +00:00
Harald Welte 5cc8858d8f logging: Introduce new "DDEV" category for device-specific code
The DMAIN category got too overloaded.  Let's have the code in
Transceive52M/device/* use the new DDEV category.

Also, in some cases the log levels have been adjusted to ensure
that enabling INFO level should not result in a complete overflow
of messages during normal operation.

Change-Id: I844fe4a75bf277cd3cc5bd8fa06e06ad97b2ea95
2018-08-17 19:57:40 +02:00
Harald Welte b229439b31 usrp1: Fail in case of unsupported configuration
There might be some configuration that's not supported by osmo-bts-usrp1,
and we should reject that properly.

Change-Id: Ic7308ce0c57439fe97668bd31801c4bf76b797ad
Closes: OS#3348
2018-06-14 12:38:09 +02:00
Harald Welte 61707e8b23 radioDevice: better encapsulation in base class
It's not good style to have the derived classes initialize members
inherited from the base class using "this->foo = bar".  Rather, let's
make the base class have a constructor, and call that constructor to
initialize the members of the base class.

While doing this
* rename 'offset' to 'lo_offset' to avoid confusion with timestamp offset
* move 'InterfaceType' into the base class
* move 'chans' into the base class
* move 'rx_sps' into the base class
* mark base class members as 'protected'

Change-Id: Ib885675a7612a392aa7f75fca81269ddcff2f6ab
2018-06-14 12:38:04 +02:00
Harald Welte ce70ba529c radioDevice: Move tx_sps from derived into base class
All three derived classes use a tx_sps member, let's move this into
the base class.

Change-Id: I73b4aa2705c5049561e2d7b21301a0d2b3c96ced
2018-06-13 23:46:27 +02:00
Harald Welte 2407314f2e move set_antennas() from UHD to generic radioDevice base class
Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
2018-06-13 23:46:27 +02:00
Pau Espin e564f0fd84 Transceiver: Move device specific code to radioDevice class
Change-Id: Ibcf258d8bf8595e286682e0bc59391b239ea7642
2018-04-24 18:46:48 +02:00
Pau Espin 0fc20d14b3 Move device specific code out of radioInterface
This way code of radioInterface is independent of the device and doesn't
need to be rebuild for each device.

Change-Id: Id104e1edef02f863b6465ced5b4241050dc188f9
2018-04-24 18:46:48 +02:00
Pau Espin 2128a308eb Move device specific files to device subdir
Change-Id: Ib42fef14bf4c7b779f44d99711a35c18b32a4c21
2018-04-24 18:46:48 +02:00