Commit Graph

2500 Commits

Author SHA1 Message Date
Vadim Yanitskiy ca9ab523e1 bts: rename MS_UL_PF_ALGO_{NONE,EWMA} to BTS_PF_ALGO_{NONE,EWMA}
Change-Id: I580512eea1d329a4d25ccbd6fc2ab98b083ec51d
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy af4eec056e struct gsm_bts: move ul_power_{target,hysteresis} to ul_power_ctrl
Change-Id: I3886c7aedf3870536f1750f864cf698302ddf2df
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy 5b25e8e7de osmo-bts-trx/scheduler: ensure no DL power attenuation on C0
When [baseband] frequency hopping is in use, Downlink bursts from
additional transceivers may end up being transmitted on TRX0/C0.
In this case, we must not apply per-lchan attenuation, because
the BTS shall maintain constant power level on that TRX.

Change-Id: Id171df70447283b00da965e1f81dfac20e35495c
Related: SYS#4918
2020-12-01 21:39:55 +00:00
Philipp Maier 7c87612b42 l1sap: add repeated uplink SACCH
3GPP TS 44.006, section 11 describes a method how the uplink
SACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I7e4cc33cc010866e41e3b594351a7f7bf93e08ac
Related: OS#4795, SYS#5114
2020-11-28 22:35:12 +01:00
Philipp Maier a36d6832a1 l1sap: add repeated downlink SACCH
3GPP TS 44.006, section 11 describes a method how the downlink
SACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I00806f936b15fbaf6a4e7bbd61f3bec262cdbb28
Related: OS#4794, SYS#5114
2020-11-27 16:02:45 +01:00
Philipp Maier 7e38cf4e66 l1sap: also include SRR bit in RSL l1 info field.
The SRR bit, which got specified in 3gpp release 6 to support repeated
ACCH capability is not yet included in the L1 Information IE on RSL
level. Also lets update the spec reference to more modern 3gpp spec ref
numbers.

Change-Id: I987c61608b737521ba36756dabf2f6215b34c2d6
Related: OS#4796 SYS#5114
2020-11-27 16:02:45 +01:00
Philipp Maier ff96c5d16c rsl.adoc: update documentation for RSL_IE_OSMO_REP_ACCH_CAP
The recently added IE (RSL_IE_OSMO_REP_ACCH_CAP) has been extended
with more options, update the documentation as well.

Change-Id: I3d95da588e863185bb62e92898c285d52bce9af4
Related: SYS#5114, OS#4796, OS#4794, OS#4795
2020-11-27 16:02:45 +01:00
Philipp Maier 33dfe2bcec l1sap: add repeated downlink FACCH
3GPP TS 44.006, section 10 describes a method how the downlink
FACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I72f0cf7eaaef9f80fc35e752c90ae0e2d24d0c75
Depends: libosmocore I6dda239e9cd7033297bed1deb5eb1d9f87b8433f
Related: OS#4796 SYS#5114
2020-11-27 16:02:45 +01:00
Neels Hofmeyr def24f0d9a part 5 of: fix SAPIs for handover, osmo-bts-oc2g
Change-Id: I2f1fd6e4620eec198912148cdc59fb4f02786c4d
2020-11-26 09:22:38 +00:00
Neels Hofmeyr 4ee4d6be2a part 4 of: fix SAPIs for handover, osmo-bts-lc15
Change-Id: I2ac6b0d498edb8facfac4feea7fccbba725d16e8
2020-11-26 09:22:38 +00:00
Neels Hofmeyr 6158525433 part 3 of: fix SAPIs for handover, osmo-bts-trx
Change-Id: I0b34855f0374e9ee7071ce14c1472eb3ead50970
2020-11-26 09:22:38 +00:00
Neels Hofmeyr 1c05ef15ec part 2 of: fix SAPIs for handover, osmo-bts-sysmo
Change-Id: I30e2ca003a3b15766d9d9dcf529fb2157523758f
2020-11-26 09:22:38 +00:00
Neels Hofmeyr f733cf8263 part 1 of: fix SAPIs for handover to match 48.058 4.1.{3,4}
This part adds the common lchan flags to indicate whether DL SACCH
should be activated.

Note that currently, osmo-bsc *always* sends the MS Power IE as well as
the TA IE, also for inter-cell HO, so in the osmoverse, nothing will
change until we also adjust osmo-bsc. See OS#4858.

Change-Id: Ibea973ccadf5d424213f141f97a61395856b76de
2020-11-26 09:22:38 +00:00
Neels Hofmeyr da680071a6 rename to release_sapi_ul_rach(), simplify
The sapis_for_ho have only one member, so it's silly to iterate. A
subsequent commit will drop sapis_for_ho.

Change-Id: I896fbca9876fd274ff9c426250b18b50faebfa89
2020-11-26 09:22:38 +00:00
Pau Espin 090f1cebe8 lc15-mgr: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I6ddc04c5815858c7dfab04ffdac52bce2e7940a1
Fixes: OS#4865
2020-11-25 20:21:21 +01:00
Pau Espin 44d72333ad oc2g-mgr: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I7a5756e106ac1061d37b42c22cc127fdacd87ce7
Fixes: OS#4865
2020-11-25 19:07:49 +01:00
Pau Espin 28d0a1db79 sysmobts-mgr: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I35ae930b59c48892e5ad9a2826e05d6c5d415abc
Fixes: OS#4865
2020-11-25 19:05:25 +01:00
Pau Espin 48ffeb8139 common: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: Ic3b7c223046a80b51f0bd70ef1b15e12e6487ad0
Fixes: OS#4865
2020-11-25 19:03:35 +01:00
Pau Espin 251fc3c06c common: Enable SIGABRT signal handler
The signal handler function was coded to expect SIGABRT but the signal
handler itself was never enabled for this signal.

Change-Id: Id95d64efe8765fcf19eb09cd3db7895166c6adab
2020-11-25 19:02:55 +01:00
Philipp Maier 2edf5cf47f l1sap: pre-initalize pointer with NULL to avoid gcc warning
Change-Id: Ibfd18ed5268740cc73fffdb950b96c7f0fad3164
2020-11-19 17:32:16 +01:00
Philipp Maier 70d78f21f2 rsl.adoc: add info about RSL_IE_OSMO_REP_ACCH_CAP
The RSL documentation should reflect some explanatory info about the
recently added RSL_IE_OSMO_REP_ACCH_CAP IE.

Depends: libosmocore I61ea6bf54ea90bd69b73ea0f0f3dc19a4214207b
Change-Id: I1d70846c2c184f7a189074c51137bc1f38fb3859
Related: OS#4796 SYS#5114
2020-11-10 21:25:40 +01:00
Vadim Yanitskiy 5e92f628ab doc/manuals: move osmobts-vty-reference.xml to vty/
This way we have everything VTY specific in a single directory.

Change-Id: Iaba5c42b39fa764cd38c903486617c3d9f9cdebb
Related: SYS#4937, OS#3036
2020-11-05 03:39:50 +07:00
Vadim Yanitskiy ace1ca46a7 doc/manuals: also generate VTY reference for osmo-bts-virtual
Change-Id: I12ac8cc13ce0caea2b63f94c407c01b4f00845e5
Related: SYS#4937, OS#3036
2020-11-05 03:39:50 +07:00
Vadim Yanitskiy a75b402f55 doc/manuals: generate XML VTY reference at build-time
Unfortunately, we cannot re-use the existing Makefile rules from:

  $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc

because they do not allow to generate the list of $(DOCBOOKS) from
a template, and require the project to store everything in separate
folders with specific names.  Also, those rules expect that the
target PDFs contain only a single word in their names (for example,
'osmoapp-vty-reference', not 'osmo-app-vty-reference'), while in a
project with multiple similarly named targets this would reduce
readability (imagine 'osmotrxuhd-vty-reference').

Change-Id: Idba84164b90e3d183a20b5eb69cbfe15745e447c
Depends: I6aac73d998c5937894233631e654a160d5623198
Related: SYS#4937, SYS#4910, OS#3036
2020-11-05 03:39:50 +07:00
Vadim Yanitskiy ef1671c6ed osmo-bts-lc15: use consistent name for containing directory
The binary is called 'osmo-bts-lc15', while the containing folder
is named 'osmo-bts-litecell15'.  This inconsistency complicates
automatic generation of the XML VTY reference - fix it.

Change-Id: I55c073fbd01aee42871101401d76d87e7c91832e
Related: SYS#4937, OS#3036
2020-11-05 03:39:50 +07:00
Vadim Yanitskiy 44d25af9cd main: do not print asciiart to stdout, use stderr instead
Otherwise it ends up in the generated XML VTY reference:

  $ head doc/manuals/vty/bts_trx_vty_reference.xml
    ((*))
      |
     / \ OsmoBTS
    <vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
      <node id='_common_cmds_'>
        <name>Common Commands</name>

Also, take a chance to move it below handle_options(), so it
will only be printed if all arguments are parsed successfully.

Change-Id: I5c35f36fdd2a8a80bd501b996f0b161c388d3510
Related: SYS#4937, OS#3036
2020-11-04 19:33:57 +00:00
Vadim Yanitskiy ffbe63f408 fixup: vty: call bts_model_vty_init() from bts_vty_init()
Now bts_model_vty_init() must be called only once, otherwise the
process would crash when bts_model_init() is called from main().

Change-Id: I262c39896b5db86c54ad9aa7042c7ca6657815d9
Related: SYS#4937, OS#3036
2020-11-03 05:44:28 +07:00
Vadim Yanitskiy 5c7b709027 vty: call bts_model_vty_init() from bts_vty_init()
Similar to bts_vty_init(), BTS specific bts_model_vty_init()
requires a pointer to 'struct gsm_bts'.  Not only it's used
as a parent talloc context, but also stored locally, so then
it can be used by some VTY commands.

Let's expose the global 'struct gsm_bts' from main, and pass
the application's talloc context like was done in [1].

This finally makes the BTS model specific options appear in
the automatically generated VTY reference (--vty-ref-xml).

[1] Ic356a950da85de02c82e9882a5fbadaaa6929680

Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf
Related: SYS#4937, OS#3036
2020-11-02 18:08:24 +00:00
Philipp Maier 484952a3e5 measurement.c: fix integer overflow problem
The variables num_meas_sub_expect - num_meas_sub must not be subtracted
without prior checking. Depending on the input (which might be
errornous), num_meas_sub might be greater then num_meas_sub_expect. This
eventually leads into odd behavior, which can be difficult to debug.

Change-Id: I381cc637d1c125f279ccf88db114609946fe24fe
Related: OS#4799
2020-11-02 15:46:10 +01:00
Vadim Yanitskiy 90e01e47cb vty: fix missing / wrong documentation for some commands
Change-Id: Ie2f9e401c0f8f55307d98fa5afe5eb4182add43a
Related: SYS#4937, OS#3036
2020-11-02 12:34:54 +00:00
Vadim Yanitskiy 9076b3947b vty: fix double '%' in description of some commands
Command description is not a format string => no need to escape.

Change-Id: Ib2e339efccec1fc5416ab4b9460a27fa1f8e8044
2020-11-02 12:33:42 +00:00
Vadim Yanitskiy fa3e22bc17 main: move general options from bts_vty_init()
These are not BTS specific options, so register them in main().

Change-Id: Ib6be66537791d489cb709d4d653c4cb434896f77
Related: SYS#4937, OS#3036
2020-11-02 11:17:05 +00:00
Vadim Yanitskiy a72a0765a4 main: register VTY commands before handle_options()
Otherwise only those commands that are registered by libosmocore
appear in the generated XML VTY reference - change the order.

Instead of a pointer to 'struct gsm_bts', pass the application's
talloc context, as it's only used for dynamic command allocation.

Change-Id: Ic356a950da85de02c82e9882a5fbadaaa6929680
Related: SYS#4937, OS#3036
2020-11-02 11:16:59 +00:00
Vadim Yanitskiy 850607295c osmo-bts-trx/scheduler: fix comments related to FACCH/H and BFI
Change-Id: I1c1d81ba5a54946089da6c32b0d42141ffe71ed8
Related: OS#4799
2020-10-30 16:45:43 +07:00
Philipp Maier 07aa8927e1 measurement: fix expected number of measurements
The logic in measurement.c checks the amount of collected measurement
values. This is done for the total amount of measurements and the amount
of SUB blocks measurements.

The functions that return the expected number of measurement values
currently do not take into account that the mode of a TCH/F or TCH/H has
an effect on the number of expected SUB blocks. (In signalling channels
all blocks count as SUB). Also a TCH/H in signalling mode generates only
half the amount of measurements because the blocks in signalling mode
are sepreded over 6 bursts instead of 4. This also needs to be taken
into account.

Change-Id: I01c7b6cc908c647263ab88f6b6281c4732f88779
Related: OS#4799
2020-10-26 17:53:57 +01:00
Philipp Maier 79294134dd measurement: count all blocks as SUB for TCH/F in signalling mode
SUB frames exist only in voice (or CSD) channels. When a TCH/F is in
signalling mode, all blocks must be counted as SUB blocks. (for TCH/H
the current implementation is correct.)

Change-Id: I04be21200afa1d03afa0d7e476c66fa79cf42249
Related: OS#4799
2020-10-26 15:11:27 +01:00
Philipp Maier 44fc252381 sched_lchan_tchf: count measurements for FACCH/F only once
When the FACCH is generated (while in SPEECH mode), there is also a
fake speech indication handed up to l1sap.c. We must make sure that only
one of the two indications carry a measurement value, so lets invalidate
the measurement values (RSSI in particular) for the generated TCH
indication.

Change-Id: Ie3f2e620ba2a2ab2fecdbae627ef01c6128fce0b
Related: OS#4799
2020-10-26 15:11:27 +01:00
Vadim Yanitskiy 1325443dc3 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: I744520199ef448ff095d0fe703d79ac08f08f7fe
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Related: SYS#4910
2020-10-24 05:08:49 +07:00
Vadim Yanitskiy 91652c8dbe main: separate model-specific arguments in help
Change-Id: I9646a45d61153499ad3d580a03d930ed20e23cda
2020-10-24 05:08:42 +07:00
Vadim Yanitskiy 0b6e568d05 main: increase spacing between commands and description
Otherwise it's hard to fit new options with long names.

Change-Id: If9a418545abff6d22602ba07cfd4447f5ace7742
Related: SYS#4910
2020-10-24 05:00:33 +07:00
Vadim Yanitskiy c3a293fde1 main: do not print deprecated '-r' / '--realtime' in help
Change-Id: I516a71124a49f6d6adb6db939a91da07576e63e7
2020-10-24 04:42:53 +07:00
Philipp Maier 5f95a16ec1 cosmetic: add missing semicolon after OSMO_ASSERT()
Change-Id: Ib886115418939990ecfb6ecc1a4528f7a015b913
2020-10-23 21:46:35 +02:00
Pau Espin 4d7c6ad860 oml: Set NM_OPSTATE_DISABLED by default
Otherwise, some objects are announced at startup of osmo-bts towards BSC
during State Changed Report as being "NULL".

According to TS 12.21:
"NULL(Operat. state not supported) FF"

Which doesn't make much sense in startup situation. They are in known
state Disabled until they are OPSTARTed.

Change-Id: I5ba6756ea069d0f995f453ee4b27e6839c914eb1
2020-10-21 18:32:08 +02:00
Pau Espin 26cc8580f6 bts_trx.c: Dispatch missing NM_EV_RSL_UP/DOWN to the bb_transc object
Previous commit 7810a91733 forgot to
introduce this line, though it was planned to be there.

Most of the time it worked fine anyway because the RSL link is not the last
event bb_transc waits for before switching to Enabled, so later events
would trigger inside the bb_transc fsm a recheck (polling) which wuld
allow to advance to Enabled state.
However, in the situation where RSL link UP is the last event to happen,
no more inside-FSM checks are triggered and hence BB Transeiver never
goes to Enabled state, and as a result no event is triggered towards
each RadioChannel which in turn don't go to Enabled state.

Fixes: 7810a91733
Change-Id: I8c777b946e7abcb4b607ec4d136c981a0716b120
2020-10-21 16:03:47 +02:00
Vadim Yanitskiy 6e27523d11 power_control: fix default EWMA smoothing coefficient (80% -> 50%)
80% (alpha=0.2) is clearly too much, let's use 50% (alpha=0.5).

Change-Id: Ib7aec6c7223ffb2d4a312eee77247925beb8c905
Fixes: Ib6dcadbf14ef59696c6a546bd323bda92d399f17
Related: SYS#4916
2020-10-20 22:42:24 +07:00
Pau Espin 22f59cd63a Introduce NM Channel FSM
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-20 13:45:57 +00:00
Pau Espin 7810a91733 Introduce NM Radio Carrier and Baseband Transceiver FSMs
All the Operative State logic to manage a RadioCarrier//BBTransc NM objects is
centralized in these FSM, where other parts of the code simply send
events to it.
This allows keeping state consistent and offloading logic from each bts
backend, since they are only required to submit events now.
The idea in the long run is to also replace other NM objects with
similar FSMs.

This improved logic fixes bug where PHY + RSL link became available before
OPSTART and hence op state changed to Enabled before receiving any OPSTART message.

Change-Id: Ifb249a821c4270918699b6375a72b3a618e8cfbe
2020-10-20 13:45:57 +00:00
Pau Espin ae6e3e8f8b Introduce NM BTS FSM
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
2020-10-20 13:45:57 +00:00
Pau Espin 88fe4b079d Introduce NM BTS Site Manager FSM
This fixes old behavior mimicing broken behavior in nanoBTS (according to TS 12.21)
where BTS Site Mgr NM object was announced as Enabled despite no OPSTART
was sent by the BSC.
With this new FSM, BTS SiteManager will be announced as Disabled Offline
during OML startup conversation, instead of Enabled.

The new osmo-bsc OML management FSMs use this change in behavior to find
out whether it should use the old broken management states (without
Offline state, as per nanoBTS) or use the new state transitions (which
allow fixing several race conditions).

Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
2020-10-20 13:45:57 +00:00
Pau Espin 6d117891c9 Change NM Channel availability Dependency->Offline when RadioCarrier becomes enabled
This fix allows osmo-bts to play fine with newer osmo-bsc NM OML FSMs,
which expectes for non-nanoBTS types to follow TS 12.21 guidelines.
Until now, BSC simply waited to received State Event Change Dependency
for each TS and then sent all required commands (Set Chan Attr, Adm
Unlock and Opstart). In newer osmo-bsc FSMs, Opstart is only sent when
in Offline state, so we need to transit to that state. For the above
mentioned reason, since we pass through the Dependency state anyway
after this patch, older osmo-bscs will work correctly too.

Change-Id: Id9e61f8d773e6e6170c68b5b836d276c747d8d69
2020-10-20 13:45:57 +00:00