Commit Graph

101 Commits

Author SHA1 Message Date
Philipp Maier 05549ae252 vty: add attributes to VTY commands indicating when they apply
Change-Id: Ifcdfcd157e5067fa2e4296d7c7e93a74087f49ff
Related: SYS#4937, OS#1601
2020-10-08 07:16:55 +00:00
Harald Welte 90e0c205b5 bts: Add VTY command to manually override Radio Link Timeout
There are some situations where it is useful to be able to change the
Radio Link Timeout at runtime, without restarting the BTS.

This adds a new (hidden) command for this:
	"bts <0-255> radio-link-timeout (oml|infinite|<4-64>)"

Change-Id: I64674a432cf7751b16d5d0b52f66766fa6e37028
2020-10-05 18:23:06 +02:00
Vadim Yanitskiy 64bd96b3f8 vty: make most struct pointers const in show/write commands
Change-Id: Iacc32f7982c150d84ea4df7affa1f9e07806928f
2020-09-28 11:39:04 +07:00
Vadim Yanitskiy 6e725279ca vty: cosmetic: use osmo_talloc_replace_string()
Change-Id: Ic195cef2aafec55d37152045f7714335ded0a62b
2020-09-25 09:32:01 +07:00
Vadim Yanitskiy 7a95af61fe vty: fix bts_dump_vty_features(): properly check BTS model flags
bts_internal_flag_get() expects a flag value, not an integer.

Change-Id: I88de79cc45fb64144df33b0ac3e3b91537039953
2020-09-25 09:08:52 +07:00
Vadim Yanitskiy f68fa09376 vty: add 'gsmtap-sapi (enable-all|disable-all)' command
It's more convenient to use one command to enable/disable sending
of all kinds of UL/DL messages at once, rather than specifying
all of them individually.

Adjust config_write_bts_single(), so it would not print unknown
GSMTAP SAPI entries if gsmtap_sapi_mask is set to UINT32_MAX.

Change-Id: Icd7fce860ecdcf8ffa107bdfee7ec94ea9ea6cb2
2020-09-04 13:00:35 +07:00
Vadim Yanitskiy 49ad9f9375 vty: clarify documentation of '[no] gsmtap-sapi' command
Change-Id: I2030992da604f27fc8cd6f9695a8095fda801f82
2020-09-04 12:26:01 +07:00
Pau Espin f30440553c vty: Allow setting power-ramp max-initial to negative values
This allows for instance ramping up from -10 dBm -> -4 dBm if NOMTXPOWER
of SDR is really low (below 0dBm) or because the max_power_red is >=
NOMTXPOWER.

Related: SYS#4920
Change-Id: I0f27fb7b86b58c5a80f5342b66ff4f5d1b775498
2020-07-27 16:58:41 +02:00
Vadim Yanitskiy 2931fc337f vty: fix missing separator in help for power ramp commands
Change-Id: Id83fa562ba8496be8915573d2222dd64c7ca5eb9
2020-06-26 01:46:43 +07:00
Vadim Yanitskiy df26770d41 A-bis/RSL: refactor handling of BS Power IE (power reduction)
According to 3GPP TS 08.58, section 9.3.4, BS Power IE indicates
the transmission power attenuation on a particular channel:

  +--------------+---------+-----------------+
  | Reserved (3) | FPC (1) | Power level (4) |
  +--------------+---------+-----------------+

so let's change handling of this IE as follows:

  - s/bs_power/bs_power_red/g, so it reflects 'reduction';
  - store power attenuation value in dB, not in 2 db steps;
  - get rid of ms_power_ctrl.bts_tx_pwr, it's always 0 anyway;
    - fix rsl_tx_meas_res(): use lchan->bs_power_red;
  - always check if FPC (Fast Power Control) flag is set;
    - we don't support it, so reject messages containing it;
    - fix rsl_rx_chan_activ(): properly apply the bitmask.

Change-Id: I16cc50dfca102030380a06e16c234d5f6698f38f
2020-06-15 22:51:20 +07:00
Vadim Yanitskiy 578156b815 Do not mix public and private BTS features, use libosmocore's API
It was a very bad idea to mix "public" BTS features, that are
reported to the BSC via OML, and those features, that are used
locally (and exclusively) in osmo-bts.

Why? At least because we already have the BTS feature manipulation
API in libosmocore, that is used by osmo-bsc, but for some reason
not by osmo-bts. New features added to libosmocore would clash
with the existing "internal" ones like BTS_FEAT_MS_PWR_CTRL_DSP.

So what this change does can be described as follows:

  - remove duplicate definition of the "public" features,
  - use libosmocore's API for the "public" features,
  - separate both "internal" and "public" features:
    - the "public" features continue to live in bitvec,
    - the "internal" features become flags,
    - s/BTS_FEAT/BTS_INTERNAL_FLAG/g.

Change-Id: Icf792d02323bb73e3b8d46384c7890cb1eb4731e
2020-06-11 00:36:21 +07:00
Vadim Yanitskiy 301b218509 vty: fix bts_dump_vty(): properly print OML stream ID (TEI)
Change-Id: I80ceba60e4b48d5bc68de71a2b2a2036b1e78f57
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 14819d8053 vty: use gsm48_chan_mode_name() from libosmocore
Change-Id: I18cdaa26a674bd9279a4ea1946aefc6969404139
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 0a8642ab5c vty: cosmetic: make an error message more informative
Change-Id: I9aeb1780b6a64f7bec80ecb243bd01b47cf4ef24
2020-06-05 02:14:48 +07:00
Pau Espin f0171a9974 vty: Fix misleading define name
define contains strings about dB vs mdB, not dB vs dBm.

Change-Id: Ib2f1f9429d7d5ead585fb93195a890abd568e65c
2020-05-28 19:00:48 +02:00
Oliver Smith ae4d85d891 VTY: add "test send-failure-event-report"
Send test failure event report OML message to the BSC. I found this
useful while manually testing related handling code in OsmoBSC.

Related: OS#1605
Change-Id: I0c4eba1636d8faf5012db26643bdf1d9fb6bfa1e
2020-03-24 08:01:05 +00:00
Oliver Smith cb4340b8a4 rsl: make IP DSCP configurable
Related: OS#4438
Depends: libosmo-abis I41603db8c1286660ad57ac1c78a8fb393a2b080b
Change-Id: Icdef5d40243fefdeae23f3bcf9c6702e8487928a
2020-03-08 17:56:52 +01:00
Vadim Yanitskiy 7364ef15d9 vty: fix left shift by 31 cannot be represented in type 'int'
Change-Id: I3e5940e8f360bf6563f4c1b5ebd09579f9108c81
2020-02-27 23:35:09 +07:00
Vadim Yanitskiy f9115ae67a common/vty.c: get rid of generic exit / end commands
Those commands are now handled by libosmovty itself.

Change-Id: I425f9058ae15de929e2ba0283d4057bdf767aeeb
2020-01-11 00:17:10 +01:00
Vadim Yanitskiy a2392f0f9e osmo-bts-trx/vty: ensure backwards compatibility with older config files
osmo-bts-trx used to have its own (low-level) MS Power Control loop,
but recently it has been ripped out. Since [1], the process fails to
start if the configuration file still contains 'ms-power-control dsp'.

Let's be more tolerant: override 'dsp' by 'osmo' and print a warning.

[1] I49706926b1e962b18791174627bc3cc0cd0cd9d5

Change-Id: I4facd21bca3d8cb80d21e83ea267bc013e474533
2019-12-31 17:03:38 +00:00
Vadim Yanitskiy 3cb61d902c common/vty.c: fix: properly assert() the result of get_string_value()
Change-Id: I6ecd46371e601ad0fb629f9756b36c9c4758a958
Fixes: CID#205067, CID#205068
2019-11-26 17:14:39 +07:00
Pau Espin c693067b7e Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP
It indicates whether BTS model supports managing an MS Power Control
Loop over HW/DSP instead of using the software based osmocom algorithm
present in osmo-bts.
osmo-bts-trx own loop implementation is considered to be a "DSP/HW" one
since it acts on lower layers and interferes with osmocom algorithm
since it controls the same end variable "lchan->ms_power_ctrl.current",
this way we make sure both aren't enabled at the same time.
Old behavior in kept: if common upper-layer algo is not enabled
explicitly in VTY (ms-power-control osmo) and bts-trx specific lower
layer algo is neither enabled (osmotrx ms-power-loop <xyz>), then no
power control is done at all.

Related: OS#1851
Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
2019-11-14 20:02:45 +01:00
Pau Espin e717aec2f7 Move and rename gsm_lchan.ms_power field
Make it clear that it contains the maximum MS power level (TS 05.05) and
not the one to be used. The one aimed at is in ms_power_ctrl.current.
Since it's used in related code, move it inside the ms_power_ctrl struct
too.

Related: OS#1851
Change-Id: Ib264ec7dac87355cef6415461ed74bd8e9c8ca52
2019-11-14 16:36:00 +01:00
Pau Espin e5e1226301 Change gsm_bts_trx field to bool and rename it
Thies field is used to store and retrieve whether MS power needs to be
calculated and updated by osmo-bts software or autonomously by lower
layers. Previous name was not clear
and may have been understood as indicating whether MS Power Control loop
is done or not in general, and the responsible for that is located under
lchan's ms_power_ctrl.fixed.

Related: OS#1851
Change-Id: Ic690ab69866a7377f1597e24aa7b0214831c1cbe
2019-11-14 16:36:00 +01:00
Oliver Smith e4abc63e42 vty.c: avoid coverity BAD_SHIFT issues
Make it obvious for compilers and for coverity, that the sapi value used
to shift a bit for the sapi_mask is always <= 31. The sapi value is an
index of the value string l1sap_common_sapi_names, which has 24 entries.

Fixes: CID#205067, CID#205068
Change-Id: Id8be0ab67479b1f76a4f624bd3a5242e4fe59f4b
2019-10-21 11:09:08 +02:00
Oliver Smith 583f2b86c9 vty.c: don't ignore get_string_value() errors
Change uint8_t sapi to int, so we can properly assert on errors from
get_string_value().

Fixes: CID#205066, CID#205069
Change-Id: I4d30afacfab93051868ae8f462cee9ad3dbc7fd0
2019-10-21 11:08:50 +02:00
Oliver Smith b58fb35754 vty: add "logging filter l1-sapi"
Add VTY commands to filter by L1 SAPI. Allow to filter by multiple SAPIs
by running the filter command multiple times:

OsmoBTS> logging filter l1-sapi agch
OsmoBTS> logging filter l1-sapi pch

Related: OS#2356
Change-Id: I32d86d3d34757135b4cce59919c2fc2b67f0a889
2019-10-17 08:04:27 +00:00
Pau Espin b4d8f5cf13 Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.
API osmo_stats_vty_add_cmds never had a param list but has seem problem
(no "void"), so some users decided to pass a parameter to it.

Change-Id: Ia4d1a7914308d1481fe31fe0986265ead339e61e
Related: OS#4138
2019-08-05 16:13:09 +02:00
Vadim Yanitskiy 9649a42d5a Clarify and refactor link quality (C/I) handling
The radio link quality is defined by C/I (Carrier-to-Interference
ratio), which is computed from the training sequence of each
received burst, by comparing the "ideal" training sequence with
the actual (received) one.

Link quality measurements are used by L1SAP to filter out "ghost"
Access Bursts, and by the link quality adaptation algorithms. One
can define minimum link quality values using the VTY interface.

On the VTY interface we expect integer C/I values in centiBels
(cB, 10e-2 B), while the internal structures are using float
values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy,
oc2g, and litecell15) expose C/I measurements in deciBels,
while on the L1SAP interface we finally send then in centiBels.

Let's avoid this confusion and stick to a single format, that
will be used by the internal logic of OsmoBTS - integer values
(int16_t) in centiBels. This will give us the range of:

  -32768  .. 32767  centiBels, or
  -3276.8 .. 3276.7 deciBels,

which is certainly sufficient.

Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01
2019-07-21 13:51:57 +00:00
Harald Welte b24ef23570 l1sap: Compute statistics on FN advance in PH-RTS.ind
Let's keep some statistics about the min/max/average frame number
advance that we're observing above L1SAP when comparing the time in the
PH-RTS.ind and the frame number we observe in PH-DATA.ind of data
that was received on the uplink.

The statistics are currently only shown in the VTY, but this is a
precursor to using them to correctly advance the LAPDm timers in a
follow-up patch.

Change-Id: I8f739fdb808a614f080afbc4654641ec3df19eb2
Related: OS#2294
Related: OS#3906
2019-06-13 15:37:13 +00:00
Harald Welte 590b23ce3c cbch: Add counters; queue length limits and CBCH LOAD reporting
This adds the final missing part to full CBCH support:
* keep a tab on the current queue length for basic + extended CBCH
* keep rate counters about the number of sent / transmitted SMSCB
* send CBCH LOAD information via RSL to the BSC

Change-Id: I7068c7937a60a900c40439115bb84dc3ee0d061f
2019-05-23 19:16:11 +00:00
Harald Welte 0f9595f462 cbch: Keep SMSCB queue length counter
This avoids having to iterate the list to count the number of elements.

Change-Id: I72c47affeb87c9b898bc2290dc7ed113945f1805
2019-05-21 02:42:00 +02:00
Harald Welte 067824841f cbch: Support Extended CBCH
The logic for Extended CBCH are the same as for the Basic CBCH, we just
need to
* duplicate our related state
* parse the optional RSL_IE_SMSCB_CHAN_INDICATOR IE
* start to send data on the Extended CBCH (TB=4..7)

Change-Id: If2c6dc7da1e2185ab75fc957f8d305ad8db22429
Closes: OS#3535
2019-05-21 00:31:11 +02:00
Max f788aefe6f Enable statsd support
Change-Id: I9112d9fd527cdc29d89868df40c6845a751c4865
2019-02-18 13:40:03 +01:00
Vadim Yanitskiy e8ebbe300c common/vty.c: fix 'cfg_phy_no_inst_cmd' command description
A comma is needed to separate a command definition from its
description, not the parts of description. Let's fix this.

Before this patch:

  OsmoBTS# configure terminal
  OsmoBTS(config)# phy 0
  OsmoBTS(phy)# no?

    no  PHY Instance number

  OsmoBTS(phy)# no ?

    instance
    osmotrx   OsmoTRX Transceiver configuration

After this patch:

  OsmoBTS# configure terminal
  OsmoBTS(config)# phy 0
  OsmoBTS(phy)# no?

    no  Negate a command or set its defaults

  OsmoBTS(phy)# no ?

    instance  Select a PHY instance to remove
    osmotrx   OsmoTRX Transceiver configuration

Change-Id: If10d85abc6506118ba08c37e8101f423d6f838ea
2019-01-27 15:31:01 +03:00
Vadim Yanitskiy 07af4e1751 common/vty.c: fix deprecated osmo_str2lower() usage
Change-Id: I4f78bc13908c2d9dfbe24195ae6e35fae8575c59
2018-11-22 14:15:17 +07:00
Pau Espin 6dacc35c75 bts: Fix TRX0 param initialization
TRX0 is allocated in a different place than other TRX.

Commit that introduced the bug added an initialization step
(bts_trx_init) applied in VTY cmd "trx <0-254>", where TRX are allocated
since same commit, but doesn't initialize TRX0 for reasons explained in
first paragraph.

As a result, some parameters were not applied to TRX0, like
power ramping increment step, which prevented MS from finding the network in
osmo-gsm-tester tests.

Fixes: eebb6a4216 ("bts: Allocate TRX for BTS dynamically, deprecate -t")
Change-Id: I5afd66548634ff53e2af24dc7055d408ca8ca4e3
2018-11-21 19:59:21 +01:00
Pau Espin eebb6a4216 bts: Allocate TRX for BTS dynamically, deprecate -t
No need to pass -t num_trx anymore to specify number of TRX to use. It
is calculated based on dynamic allocation from VTY config.
Using parameter -t is flagged as deprecated and is transformed into a
NOOP por backward compatibility.

As a result, TRX now are allocated after the BTS is allocated and
initial config (pre-VTY) is applied.
A new function bts_trx_init() is added, to set default config on each
TRX during allocation and before setting VTY config on it.
A new per BTS model function bts_model_trx_init() is added, to allow
per model specific default configuration of each TRX.

Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
2018-11-18 20:29:40 +00:00
Neels Hofmeyr eeba57652a vty: mark 'rtp bind-ip' deprecated, not hidden
The command implementation says "deprecated", so then the vty command attribute
should also be DEPRECATED. It will be hidden from online docs and vty
reference.

Change-Id: I23e620f1b947e129989fe69c6380c91b9abf7021
2018-09-26 07:28:20 +00:00
Philipp Maier f1e2d08022 rtp: make port range configurable, assign correct port numbers
The current implementation does not allow the user to specify a port
range in which the BTS is allowed to allocate a local RTP port. Also
the ports the BTS picks do not match the policy described in RFC3550.
An RTP Port must be at an even port number and the matching RTCP
port must be at the following (odd) port number. The BTS currently
picks random port numbers for both.

- Add a VTY command to specify a port range in which the BTS may
  assign local ports.

- Pick ports as described in RFC3550.

Change-Id: Id75f1dfaf898ed8750d28b1c4840e188f4cfdc87
Related: OS#2825 OS#2635
2018-05-25 15:41:35 +02:00
Harald Welte d8cd756da4 Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure.  Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.

Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17 13:40:03 +01:00
Harald Welte 7c4a22dbc4 cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
Rathert han have 11 direct members of gsm_bts_role_bts, group them
into a sub-struct as ew do for other parts like interference, laod, ...

Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17 12:24:29 +01:00
Vadim Yanitskiy 7eed026efc common/vty.c: remove unused variables
Change-Id: I289dda64228e81ca4c608121e50146a71e19f1e2
2018-03-06 16:14:12 +07:00
Alexander Couzens f03a3a584c pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.h
PCU_SOCK_DEFAULT is defined in the pcu counterpart of the file pcuif_proto.h
To be consistent with the pcu move the definition pcuif_proto.h
The pcuif_proto.h will be exact the same in the pcu repo and bts repo.

Change-Id: I67f8ec036e219994cc296d0ed5409da7f3ec681e
2018-03-02 08:57:37 +00:00
Harald Welte 5bd6132c04 Add high-accuracy ToA value to Uplink Measurement Reports
Normal Abis RSL MEasurement Results contain only the "MS Timing Offset
IE" in units of full symbols.  In some use cases it is important to have
higher-accuracy timing information exposed to the BSC.

We do this by adding the average timing offset value during the last
measurement interval in 1/256th symbol accuracy to the "Supplementary
MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements
IE.

In order to avoid any compatibility issues, this feature is only enabled
if the new vty config command "supp-meas-info toa256" at the bts node
is enabled.

Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
2018-02-27 20:00:16 +01:00
Harald Welte b3a2a3e24f RACH decoding: Use BER threshold for RACH ghost detection
When decoding RACH bursts, we should use a BER threshold in order to
help distinguish 'ghost' RACH bursts from real RACH bursts.

The theoretical ideal threshold according to some papers is 7 out of 41
bits qhich aquals to Eb/N0 of 0 dB = 0.1707 (17.07%)

We add a new 'ber10k' parameter to the RACH indication l1sap primitive
(needs separate change for libosmocore), and then fill this value from
osmo-bts-{sysmo,lc15,trx,octphy}.  The common part above L1SAP then
applies the threshold, which can be changed from vty using the
	"max-ber10k-rach <0-10000>"
command available at the BTS node.  The unit is BER in 1/10000, i.e. a
value of 100 equals 1% bit error rate.

Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
2018-02-27 17:27:46 +01:00
Harald Welte d7f8a1c16e BTS: add rate_ctr about CCCH (paging, agch, pch)
Change-Id: Id6c833746150a3c2e32b00ea6604669f16b84bc4
2018-02-24 19:26:42 +01:00
Philipp Maier b93748a170 vty: display bts features in vty command show bts
The VTY command show bts does not display the bts specific
features yet.

- Also display the feature list in snow-bts

Change-Id: I509f2a7bbfa96c70bdfea4ff2488ee371e914620
2018-02-22 07:58:26 +00:00
Harald Welte efa55a4541 osmo-bts: Add talloc context introspection via VTY
This requires libosmocore with Change-Id
I43fc42880b22294d83c565ae600ac65e4f38b30d or later.

Change-Id: Ieed87b8109e0095a3d99c30f0b042aa3ee4b6384
2018-02-14 00:45:57 +01:00
Harald Welte aa0f964ce2 vty: don't print "Bound IP / Port" if it isn't bound [yet]
Change-Id: I28705b56582d334d568d98a371daa6bb9ef1f625
2018-02-05 23:18:56 +01:00