Commit Graph

2051 Commits

Author SHA1 Message Date
Pau Espin cf65c9b297 assignment_fsm: Add assert to guard ptr access
Let's make sure the null pointer is caught by the assert if ever code
ends up here with conn->lchan being NULL.

Change-Id: I404df638da6a93caa535f10fd330ea24a775bfc3
2021-07-05 17:21:42 +02:00
Pau Espin 60bcba3bcf assignment_fsm: Fix null pointer dereference rx ASSIGNMENT_EV_LCHAN_ERROR
gsm_lchan_name always expects a valid lchan pointer.

This patch fixes a crash seen:
"""
<000f> lchan_fsm.c:99 lchan(12-2-5-TCH_H-1)[0x559b880f2980]{WAIT_RLL_RTP_ESTABLISH}: (type=TCH_H) Signalling Assignment FSM of error (lchan allocation failed in state WAIT_RLL_RTP_ESTABLISH: Timeout)
Assert failed lchan ../../include/osmocom/bsc/gsm_data.h:1034
"""

Related: SYS#5392
Change-Id: I23a337d411e857954008c6f8ae60be714509d351
2021-07-05 17:21:42 +02:00
Vadim Yanitskiy 997a257f8d power_control: constrain BS power reduction on BCCH carrier
BS Power Control is not allowed on the BCCH/CCCH carrier, unless
the BTS is operating in the BCCH carrier power reduction mode.

Allow constrained BS power reduction (up to 6 dB) on active logical
channels iff BCCH carrier power reduction mode is enabled.

Take into account that the maximum power difference between a timeslot
used for BCCH/CCCH and the timeslot preceding it shall not exceed 3 dB.

Change-Id: I2cc6a86731984f586ef35b43a8d3de631f7d8a2f
Related: SYS#4919, SYS#4918
2021-07-05 12:17:59 +00:00
Vadim Yanitskiy ced29cf94c power_control: implement BCCH carrier power reduction operation
The BCCH carrier (sometimes called C0) of a BTS shall maintain
discontinuous Downlink transmission at full power in order to
stay 'visible' to the mobile stations.  Because of that, early
versions of 3GPP TS 45.008 prohibited BS power reduction on C0.

However, starting from version 13.0.0 (2015-11) there is a feature
called 'BCCH carrier power reduction operation'.  This is a special
mode of operation, where the variation of RF level for some
timeslots is relaxed for the purpose of energy saving.

In BCCH carrier power reduction operation, for timeslots on the
C0 carrier, except timeslots carrying BCCH/CCCH, the output power
may be lower than the output power used for timeslots carrying
BCCH/CCCH.  In this case the maximum allowed difference in output
power actually transmitted by the BTS is 6 dB.

Introduce a VTY command to turn on and off the BCCH carrier power
reduction operation.  Also introduce a CTRL command.  On the
A-bis/RSL, abuse the BS POWER CONTROL message by setting
the Channel Number IE to 0x80 (RSL_CHAN_BCCH).

Currently, only osmo-bts-trx is supported.  A value greater than
zero makes it reduce the power on *inactive* timeslots of the
BCCH carrier.  Sending zero disables the BCCH power reduction
mode completely.

For more details, see 3GPP TS 45.008, section 7.1, and 3GPP TR 45.926.

Change-Id: I047fce33d4d3e4c569dd006ba17858467a2f4783
Related: SYS#4919
2021-07-05 12:17:59 +00:00
Neels Hofmeyr f15d236e3e vty: fix doc: default value for 'nri bitlen'
The constant is called OSMO_NRI_BITLEN_DEFAULT, NRI_BITLEN_DEFAULT does
not exist and got rendered as "NRI_BITLEN_DEFAULT" in the vty doc.

Add missing vty test for 'nri bitlen'.

Change-Id: I8af840a4589f47eaca6bf10e37e0859f9ae53dfa
2021-07-03 17:26:35 +02:00
Vadim Yanitskiy 419d8a296b power_control: omit BS Power Parameters IE if the maximum is 0 dB
If BS Power Parameters IE is present in the channel activation
message, the BTS shall employ dynamic BS power control for that
logical channel and interpret BS Power IE as the maximum value.

If the maximum value is 0 dB, then it does not make sense to send
BS Power Parameters IE to the BTS, because the power control loop
would never exceed the maximum.

Change-Id: If8507992dfd90ade1edda99b72bf2420a702ccd5
Related: SYS#4918, SYS#4919
2021-06-30 11:01:20 +00:00
Pau Espin eab874256e lchan-select: Avoid setting variable for no reason
That variable is never used after being set. Furthermore, it is being
set to the same value already stored, so there's no use in setting it
and it creates confusion.

Change-Id: Ib6ee28aa9a449992f5d3dea6df7dd2b7e30e73c9
2021-06-30 08:13:52 +00:00
Pau Espin a23eebb9a2 Support proto IPAC_PROTO_EXT_PCU BSC<->PCU
Related: SYS#5303
Change-Id: I4b3919f3098b9468e5e024db1e45427af24c1ad4
2021-06-30 08:13:37 +00:00
Neels Hofmeyr c44a27c672 hodec2: fix low rxqual tch/h<->tch/f oscillation
Related: SYS#5198
Change-Id: I96cd5a494e661ba3bb0b6d22d25a9968d2a6813c
2021-06-29 22:24:24 +02:00
Neels Hofmeyr 4011c54620 handover_decision_2.c: add current_rxqual()
Pre-empt code dup: this will be also used by an upcoming patch, so first
put it in a function.

Change-Id: I0d5bdaa9605f2bd4241cdd47ccf1ce1c697818a8
2021-06-29 22:24:24 +02:00
Neels Hofmeyr 4cff729353 hodec2: fix low rxlev tch/h<->tch/f oscillation
Related: SYS#5365
Change-Id: Ibc3ac7ce6190b4e854fa42d5376a7038ddfbd6e5
2021-06-29 22:24:24 +02:00
Neels Hofmeyr 26ce6b3aa4 handover_decision_2.c: add is_low_rxlev()
Remove code dup. Also this will be used another time by an upcoming
patch.

Change-Id: I4aaeb8bc35a142962ac8ca6401a76b0733f7979e
2021-06-29 22:24:24 +02:00
Neels Hofmeyr b7646e25b1 vty: allow 5 encryption algo entries
follow-up to
0256c89187
Icac06ed554fd61bf7c4bfb1d5c3739a01f2915a4

Previous patch increased the range, but let's also allow one more
argument so that the A5 mask can be fully enabled.

Change-Id: Ie8cd753e4425d7d51397e4dddc24108fa0392de4
2021-06-25 08:18:30 +00:00
Philipp Maier b9930bdf09 bsc_ctrl_commands: add command to write vty config
we recently added control commands to apply vty config files during
runtime using the control interface. However, there is no command that
allows us to store the config file modifications.

Change-Id: If17095bb86f82dd8feb86eb72c4133ea3aa1c3b3
Related: SYS#5369
2021-06-24 10:15:49 +02:00
Neels Hofmeyr 2644cd2d95 use osmo_select_shutdown to get rid of SIGTERM sleep
Change-Id: I9a4a629805c49240b8be412e9def298cdf5bc996
2021-06-23 23:45:52 +00:00
Vadim Yanitskiy e87f20f621 abis_rsl: fix rsl_rx_ccch_load(): properly check the message length
msg->data_len is the total number of bytes available in the buffer,
not the actual length of the payload.  Use msgb_length().

Change-Id: I35bf0827ff14e84a755c1aa24a6efc06bc7b9f9b
2021-06-23 11:44:43 +00:00
Neels Hofmeyr 68536ccf8b support A5/4 in inter-BSC Handover
inter-BSC into this BSC: from BSSMAP Handover Request, parse and store
Kc128. All else is already implemented: depending on the chosen
encryption algorithm, Kc128 will end up in the Channel Activation.

inter-BSC out of this BSC: nothing is needed to support A5/4, the BSSMAP
Handover Required message does not contain any encryption related
information. The MSC already knows the chosen algorithm.

Related: SYS#5324
Change-Id: I7e9590e8c96aa50086148863ad9a2741b978e614
2021-06-22 05:56:09 +00:00
Vadim Yanitskiy 5ec7b65eed VTY: fix typo in a command description: s/send/sent/
Change-Id: Idb2fda4c2bd8a4e7ee6c4d7c7dc08a7d4f20d00d
2021-06-21 04:21:57 +02:00
Neels Hofmeyr 498e55a9a4 implement A5/4 in Ciphering Mode procedure
Receive and store the Kc128 key from MSC, and use as key sent to BTS if
A5/4 is the chosen encryption algorithm.

(A5/4 in handover will follow in a separate patch)

Related: SYS#5324
Change-Id: I7c458c8a7350f34ff79531b3c891e1b367614469
2021-06-18 23:31:31 +02:00
Eric Wild 0256c89187 vty: allow A5/4 encryption in config
Add A5/4 to the internal mask of allowed algorithms.

(Not actually working yet, A5/4 implementation follows in other
patches.)

Related: SYS#5324
Change-Id: Icac06ed554fd61bf7c4bfb1d5c3739a01f2915a4
2021-06-18 23:31:31 +02:00
Neels Hofmeyr 230b88ab65 dissolve gsm0808_cipher_mode() into bssmap_handle_cipher_mode()
An upcoming patch for A5/4 would need to add a kc128 arg and reject
cause rc to gsm0808_cipher_mode(). Instead prepare for less cruft by
just having a single function.

Related: SYS#5324
Change-Id: I7f7c635943990a251ae28ae7a0d69cc3a239a154
2021-06-18 23:31:31 +02:00
Neels Hofmeyr 0022ca6453 rewire build_encr_info() to return errors
In build_encr_info(), validate the algorithm and key presence and return
negative if errors are encountered.

At all callers, handle the error case.

An upcoming patch will add handling of Kc128 for A5/4 encryption and
also wants to return error codes. This is a preparation for that patch:
I7c458c8a7350f34ff79531b3c891e1b367614469

Notice that osmo-bsc does send the key along even if A5/0 is chosen,
this patch keeps that behavior unchanged.

Related: SYS#5324
Change-Id: I125d8aabceddd5b34cb98978cee9b6d2fc8fd0f2
2021-06-18 23:31:23 +02:00
Neels Hofmeyr ca08701681 rsl_lchan_lookup: drop redundant condition
'vamos' is only set to true for osmobts types, hence no need to check
that condition again.

fixup for commit d37dcb9f68
'RSL: rx and tx VAMOS Channel Number cbits for VAMOS lchans'
I957eff0d2c33ec795eda75a4bff21965b0179f73

Related: CID#236318
Related: SYS#5315 OS#4940
Change-Id: I4d9afc2996d95fdc15ee1a04e31d781b595023e3
2021-06-18 09:58:14 +00:00
Neels Hofmeyr 14e043fbcf rsl_data_request() check lchan pointer before access
fixup for commit 43aeeaf05a
'RSL chan_nr: replace OSMO_ASSERT with error handling'
I71ed6437c403a3f9336e17a94b4948fca295d853

Related: CID#236319
Related: SYS#5315 OS#4940
Change-Id: I873c1a27f9449a56c525984ea50bfcf6daa4b5f8
2021-06-18 09:58:14 +00:00
Neels Hofmeyr 56c91b09b1 hodec2: don't apply AFS bias to same-cell lchans
The AFS bias actually should not apply to local cell lchans, because it
makes no sense for intra-cell considerations:

- same-cell lchans obviously have identical rxlev;
- any nonzero AFS bias thus always raises the TCH/F above the TCH/H;
- for intra-cell reassignment, the power budget hysteresis is,
  naturally, not applied.

So, before this patch, setting AFS bias even to only 1 would
unconditionally move all (AMR) TCH/H lchans over to free TCH/F lchans in
the same cell.

Recent patch Id40d1cf8b58410c7d4eb87407fe8b8106e352438 implements
explicit upgrade from TCH/H to TCH/F *if* the TCH/H is experiencing low
rxqual or low rxlev, as a proper replacement for intra-cell AFS bias.

Related: SYS#5198 SYS#5365
Change-Id: I315f24123ae016887ab91666870ce252e096f90f
2021-06-18 09:40:27 +00:00
Pau Espin f274976df3 Introduce counters to track SRVCC procedures
Related: SYS#5337
Change-Id: I5c20da56d465dbcf4366130394f7c42635a24cc7
2021-06-17 14:05:40 +00:00
Pau Espin b9a6263823 Introduce VTY command to disable srvcc fast-return on target BTS
Related: SYS#5337
Change-Id: I2ac91b5dffc9b6de60576aabe21a15f24fea38cb
2021-06-17 14:05:40 +00:00
Neels Hofmeyr 293076d9d1 vty: reassign: add missing check for valid target lchan
Make sure that the target lchan has been initialized before attempting
to reassign.

I ran into this in the VAMOS tests, forgetting to set the BTS_FEAT_VAMOS
in osmo-bts-omldummy: the vty command from ttcn attempts to reassign to
a non-initialized lchan, and aborts osmo-bsc.

Change-Id: Ia77a3312dde0e4b8df9ad2f33339266bae06439d
2021-06-15 00:31:25 +02:00
Neels Hofmeyr 519294d563 fixup for vamos: fix wrong cbits in rsl_lchan_lookup()
The RSL_CHAN_OSMO_VAMOS_MASK mask applies to the chan_nr,
but the cbits variable in rsl_lchan_lookup() is chan_nr >> 3.
So the mask didn't do its job. Now it does.

A bit embarrassing how i took the suggestion to use this mask and put it
into code without testing it. It looked good enough...

Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
2021-06-15 00:31:24 +02:00
Neels Hofmeyr a32431972d hodec2: implement upgrade TCH/H -> TCH/F (without AFS bias)
Pass flag into find_alternative_lchan() indicating that a TCH/H channel
has low ratings (rxqual or rxlev, doesn't matter).

Heed this flag in the last round, the requirement A check, and allow
candidates that have equal rxlev, if they result in an upgrade from
TCH/H to TCH/F. This allows intra-cell upgrades to TCH/F.

An important point is that this patch allows upgrade to TCH/F *without*
the AFS bias setting. See also I315f24123ae016887ab91666870ce252e096f90f.

Related: SYS#5198 SYS#5365
Change-Id: Id40d1cf8b58410c7d4eb87407fe8b8106e352438
2021-06-13 15:55:03 +00:00
Neels Hofmeyr f1b0bf5b2f lchan_fsm: lchan_fail() strings should not have a terminating newline
Change-Id: I063fd5598add75c39338d90798189c10a0714094
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 95ec269f0a RSL: set default TEI according to TRX number
Change-Id: I3c500f7a5afc9143d4ea7102ab96e52aeb67b4b6
2021-06-10 16:15:35 +02:00
Neels Hofmeyr dc2bcdacdd cosmetic loop simplification in gsm48_multirate_config()
Change-Id: I52424ad6a0bf499fe040cf0a1de00e636a0a40fe
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 6ca1c28d9c get_any_lchan(): reduce minor code dup
Change-Id: I304a7333adc265e156f04b42a10bac6912f58ad2
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 9de7717243 clarify bts_chan_load
Change-Id: I9bd80a08472018e69360ac5739979c7056d4f063
2021-06-10 16:15:35 +02:00
Neels Hofmeyr b3695df6ab log: assignment_fsm: tweak err msg for incompatible chan
Related: SYS#5315 OS#4940
Change-Id: Ifd8790923d54a27061708ff8077d509238b9c7dd
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 236e3b048c log: assignment_fsm: drop newline from assignment_fail
Drop terminating newline from an assignment_fail() call which causes an
erratic line feed in logging.

Change-Id: Ib56e1f6a45c7e2c235f8ef0c8dea7151481677ab
2021-06-10 16:15:35 +02:00
Neels Hofmeyr ee921cf903 VTY: add lchan re-assignment command
Add VTY command to trigger an intra-cell re-assignment, also allowing to
re-assign to a secondary VAMOS lchan.

Related: SYS#5315 OS#4940
Change-Id: If006f5caaf83b07675f57e5665cfa79328da55e6
2021-06-10 16:15:35 +02:00
Neels Hofmeyr a99899ea96 VTY: add 'vamos-subslot' to activate a secondary lchan
Related: SYS#5315 OS#4940
Change-Id: If44b6bdb78046502eb0b66529ae190a955d9978c
2021-06-10 16:15:35 +02:00
Neels Hofmeyr bb843d10a9 VTY: 'show lchan': show that lchan is in VAMOS mode
Related: SYS#5315 OS#4940
Change-Id: I9f38712f941d60531526cc3395875655455909d9
2021-06-10 16:15:35 +02:00
Neels Hofmeyr d37dcb9f68 RSL: rx and tx VAMOS Channel Number cbits for VAMOS lchans
Add the Osmocom-specific extension to indicate VAMOS shadow lchans in
RSL, in lchan lookup and RSL message transmission.

Note that RR messages containing cbits (Assignment Command, Handover
Command, ...) must *not* send Osmocom specific cbits to the MS. Only the
RSL messages directed to the BTS send Osmocom specific bits.

Related: SYS#5315 OS#4940
Depends: If33c1695922d110c0d2c60d5c0136caf2587194e (libosmocore)
Change-Id: I957eff0d2c33ec795eda75a4bff21965b0179f73
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 43aeeaf05a RSL chan_nr: replace OSMO_ASSERT with error handling
It's bad to abort the program for an incompatible chan_nr.  Instead of
OSMO_ASSERT(), make sure that error handling happens all they way to the
original callers of gsm_lchan2chan_nr etc.

This is also preparation to add further error causes: Osmocom specific
cbits needed for a non-Osmo BTS.

Related: SYS#5315 OS#4940
Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
2021-06-10 16:15:35 +02:00
Neels Hofmeyr e324badbb9 rsl_lchan_lookup(): add comment explaining ts_is_capable_of_pchan()
Change-Id: Ie3699db496cfb690ac9302ccd177cdd77dc57ebb
2021-06-10 16:15:35 +02:00
Neels Hofmeyr f24e61857a rsl_lchan_lookup(): turn cbits if-cascade into a switch()
There is some odd repetition of macros with all possible subslot
indexes, but now we are using the defined macros instead of magic
numbers, making it easier to see that it is correct.

Also this allows trivially adding VAMOS cbits cases to the existing
switch() in a subsequent patch.

Change-Id: I4c6ce2f4ca999c19a58909b9adb849a3b8b6ffc8
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 426941e87f update the lchan name to always reflect VAMOS shadowness
Change gsm_lchan_name_compute() to a function that in-place updates the
lchan->name. That allows calling it numerous times with the talloc
handled internally. Rename it to lchan_update_name().

Add 'shadow' to lchan_update_name() and lchan_fsm_update_id() for VAMOS
shadow lchans, and also print the lchan index that it is a shadow for,
instead of the index in the lchan array.

When set_pchan_is() updates the VAMOSness of the lchans, call
lchan_fsm_update_id(). From lchan_fsm_update_id() also call
lchan_update_name().

This is a bit convoluted for legacy reasons. There are utility programs
and C tests using bts_trx.c but not lchan_fsm.c. lchan_update_name()
lives in gsm_data.c for that reason. This patch calls
lchan_update_name() from lchan_fsm_update_id() and not vice versa to
avoid having to add stubbed lchan_fsm_update_id() functions to all
utility programs and C tests.

We can't easily unify the lchan->name and lchan->fi->id without lots of
refactoring rippling through all those little utility programs and C
tests.

Change-Id: I7c2bae3b895a91f1b99b4147ecc0e3009cb7439a
2021-06-10 16:15:35 +02:00
Neels Hofmeyr d163aa3805 add VAMOS secondary lchans to timeslot struct
So far there is a bunch of code setting a primary lchan in VAMOS mode.
This patch now adds the actual secondary "shadow" lchans that may be
combined with a primary lchan in VAMOS mode to form a multiplex.

VAMOS lchans are put in the same ts->lchan[] array that keeps the
primary lchans. They are at most two additional usable lchans (for a
TCH/H shadow) added to either TCH/F or TCH/H.

Keeping these in the same array allows looping over all lchans easily.
The ts->max_primary_lchans indicates the index of the first VAMOS shadow
lchan.

Related: SYS#5315 OS#4940
Change-Id: I928af99498bba488d317693f3144d4fccbbe9af3
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 52a6b2cebf RR Assignment for VAMOS: send TSC Set
We already send the TSC Set in the RSL Channel Activation, telling the
BTS about the TSC Set. The MS needs to be instructed of the TSC Set in
the RR Assignment Command.

The first code to actually do an Assignment to a VAMOS activated lchan
will follow in If006f5caaf83b07675f57e5665cfa79328da55e6.

Change-Id: Ibf3b6d276fadf724c16a5225c03e96a27a056153
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 2aac1765e6 implement CHANnel ACTIVate to VAMOS mode
Related: SYS#5315 OS#4940
Change-Id: If3ac584e4223ef7656c7fedc3bf11df87e4309ec
2021-06-10 16:15:35 +02:00
Neels Hofmeyr 3cb4ddd819 add missing AMR config for RTP activation after mode modify
Add function lchan_activate_set_ch_mode_rate_and_mr_config() and call it
for both plain channel activation and after a mode modify that needs RTP
activation. The AMR config was missing after Mode Modify.

Related: SYS#5315 OS#4940
Change-Id: I842fe7a14a91d1ec123cb4a3f52afe34456c03e3
2021-06-10 16:14:57 +02:00
Neels Hofmeyr 19d797c2fb lchan_fsm: introduce lchan.activate.ch_mode_rate to allow tweaking
lchan->activate.info.ch_mode_rate should remain unchanged, it is the
immutable request data. However, for VAMOS, we will want to
automatically see that the chan_mode is chosen correctly.

As a first step, place a mutable ch_mode_rate copy at
lchan->activate.ch_mode_rate, i.e. not in .activate.info, but in
.activate. Use that everywhere.

This is mostly a non-functional change, preparing for a subsequent patch
that adds handling of VAMOS shadow lchans.

As side effect of adding lchan_activate_set_ch_mode_rate_and_mr_config()
after MODE_MODIF_ACK (enabling the voice stream after a channel mode
modify), fix AMR config: the call to lchan_mr_config() was missing.

Change-Id: Icc9cc7481b3984fdca34eef49ea91ad3388c06fe
2021-06-10 16:14:57 +02:00
Neels Hofmeyr edd5f5158d add lchan->vamos.is_secondary flag
VAMOS shadow lchans do not exist yet, but add the indicator flag that
tells whether an lchan pointer is a primary or a shadow lchan.

In Mode Modify: based on the flag, choose a different default TSC Set
for shadow lchans; do BTS type compat checking for shadow lchan use.

Actual lchans with vamos.is_secondary == true will be introduced by
patch: 'add VAMOS secondary lchans to timeslot struct'
I928af99498bba488d317693f3144d4fccbbe9af3

Change-Id: I4072fc7703c592df699fe8e27c02df09acde0909
2021-06-10 16:14:57 +02:00
Neels Hofmeyr b9baf06e98 vty: add lchan modify '(vamos|non-vamos)' command
Change-Id: If44c3483d4d3d86f5822c5ad882aaeeaff27e3af
2021-06-10 16:14:57 +02:00
Neels Hofmeyr e3e317242c implement Channel Mode Modify to VAMOS mode
Put a (primary) lchan in VAMOS speech mode.
This is not yet about activating shadow lchans, this merely puts any
lchan in a VAMOS capable channel- and speech mode.

Protocol:

In RR Channel Mode Modify, send a spec conforming VAMOS channel mode as
well as an Extended TSC Set, wich adds the TSC Set to the training
sequence code value.

In RSL MODE MODIFY, send Osmocom specific extensions to indicate the TSC
Set and TSC, as well as the VAMOS channel mode; only to OsmoBTS type
cells.
- Set the Channel Mode's Channel Rate to Osmocom specific
  RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm / RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm
- Add the Osmocom specific Training Sequence IE containing both TSC Set
  and TSC.
(These are documented in the Abis manual.)

Implementation:

The internal API to request a Mode Modify is lchan_modify(info). Add to
this info the 'vamos' bool, set to true when the modification should put
the lchan in VAMOS channel mode or not.

When info.vamos == true, make sure the channel mode value is a VAMOS
one: in the copy of info->ch_mode_rate at lchan->modify.ch_mode_rate,
convert to the right VAMOS/non-VAMOS equivalent channel mode.

When the modification is through, set lchan->vamos.enabled
appropriately.

This patch also builds on Ic665125255d7354f5499d10dda1dd866ab243d24
'allow explixit TSC Set and TSC on chan activ / modif / assignment'
placing tsc_set and tsc values in the TSC related IEs.

Related: SYS#5315 OS#4940
Change-Id: Ibf53f4797d7491b17a33946fd7d920f038362b4c
2021-06-10 16:14:57 +02:00
Neels Hofmeyr 4906e48376 allow mode modify when RTP stream is active
Get rid of this artificial barrier, because Modify with active voice
stream is supported since commit
"lchan and assignment FSMs: make Channel Mode Modify more sane"
d5cb0eb8fd
I4986844f839b1c9672c61d916eb3d33d0042d747

Change-Id: I25f4a881fa32a07f97d7d6e6b812f8afc699d951
2021-06-09 00:06:01 +00:00
Neels Hofmeyr 9da036fe6e hodec2: fix is_upgrade_to_tchf() for requirement A
Add missing REQUIREMENT_A_TCHF to form a full REQUIREMENT_TCHF_MASK.
That allows detecting TCH/F -> TCH/H upgrades also in the requirement A
flags, where we look for any viable lchan.

Prepares for upcoming patch Id40d1cf8b58410c7d4eb87407fe8b8106e352438
which implements TCH/H to TCH/F upgrades within the same cell.

Related: SYS#5198 SYS#5365
Change-Id: Ic44615b314782423bab0ceef5810311776f92754
2021-06-08 03:02:01 +02:00
Neels Hofmeyr 9f913bec2c cosmetic prep: hodec2: move is_upgrade_to_tchf() further up
Preparation for Id40d1cf8b58410c7d4eb87407fe8b8106e352438

Related: SYS#5198 SYS#5365
Change-Id: I3fd0e257e033c573017ce62e3efc19b094acf73c
2021-06-08 03:01:58 +02:00
Oliver Smith b96f708fb5 src/utils/meas_vis.c: fix bs_power -> bs_power_db
Fix build error:
  meas_vis.c:196:16: error: 'struct gsm_meas_rep' has no member named 'bs_power'; did you mean 'bs_power_db'?

Output the value in the same format as before the change that introduced
this regression (dB / 2).

We didn't catch this regression with jenkins because meas_vis is only
built if libcdk is installed.

Related: OS#5173
Fixes: d9b7aedb ("change bs_power to bs_power_db")
Change-Id: I9ba9b491ccbde9aa14cfb14ecc551acb2bfd7674
2021-06-07 09:47:28 +02:00
Neels Hofmeyr 4d5604ad92 fixup: pass tsc = -1 for previous default training sequence code
An unintended change in default behavior was introduced in patch:
"allow explixit TSC Set and TSC on chan activ / modif / assignment"
Ic665125255d7354f5499d10dda1dd866ab243d24
c33eb8d569

Set tsc_set and tsc = -1 for all lchan_activate_info and
assignment_request requests to actually yield the default behavior of
selecting the TSC based on the timeslot cfg or the BSIC value.

By setting tsc = 0 implicitly, the patch caused all requests to ask for
tsc 0 instead of calling gsm_ts_tsc().

For a Channel Mode Modify in assignment_fsm, pass the lchan's current
TSC to keep it unchanged.

osmo-ttcn3-hacks Id67a949e0f61ec8123976eb8d336f04510c55c01 adds a test
to verify the expected TSC in all of the activation, assignment and
modify messages. Current osmo-bsc master fails, this patch fixes.

Related: SYS#5315 OS#4940 Ic665125255d7354f5499d10dda1dd866ab243d24
Change-Id: If12df11511fe22ea167782f776736a1a9c484b1f
2021-06-05 15:48:53 +00:00
Neels Hofmeyr 245465662e meas rep logging: use log_check_level() to skip a logging loop
A side effect is that the final cleanup part of that function is now
always called, also when num_cell == 7.

(Whether we should really clear that logging context at that place is a
different question, out of scope here.)

Change-Id: I71a402a0940857bbedbaf25d293429934706a83c
2021-06-05 14:35:16 +00:00
Neels Hofmeyr c1429f9cab meas rep logging: replace a dozen DEBUGPC() with one DEBUGP()
Instead of calling DEBUGPC() over and over, compose a string using
osmo_strbuf and then log it once.

Rationale:

a) DEBUGPC() is a bad idea for gsmtap_log, because each DEBUGPC()
dispatches a separate gsmtap_log packet, fragmenting the actual log line
in wireshark.

b) DEBUGPC() is a bad idea because it checks the logging categories for
every DEBUGPC() invocation.

c) using a separate function with osmo_strbuf and OTC_SELECT, we can
actually skip the entire string composition in case the DMEAS logging
category is disabled, with a single logging category check.

Change-Id: I4cb607ff43a1cb30408427d99d97c103776b6e69
2021-06-05 14:35:16 +00:00
Neels Hofmeyr d9b7aedb77 change bs_power to bs_power_db
The RSL BS Power IE in measurement reports is encoded as dB / 2.
Instead of using this coding all over the code, converting to dB and
often printing confusing values in logging etc, store as plain dB.

The conversions should be at the points where a "weird" format is
defined: the RSL encoding needs divided-by-two, so apply it there. The
meas_vis is (now unfortunately) defined as div-two, and so on. But
internally we now just store the plain dB value and calculate with it
without duplicating the wire decoding step everywhere.

Rename to bs_power_db to clarify the unit of the stored value.

Change-Id: I229db1d6bcf532af95aff56b2ad18b5ed9d81616
2021-06-05 14:35:16 +00:00
Neels Hofmeyr be161380a3 handover: apply meas report BS Power to RXLEV, fix ho oscillation
This fixes handover oscillation in the presence of power reduction on
the downlink: apply the reduced power to the cell's RXLEV in order to
not rate the current cell as weaker than it actually is.

Related: SYS#5339
Change-Id: Ifcf59964b5e2d550d79e4ba14d90962808f79dae
2021-06-05 14:35:16 +00:00
Vadim Yanitskiy cdaf3ec006 Make interference measurement parameters configurable
According to 3GPP TS 45.008, the BSS shall monitor the levels of
interference on its IDLE traffic channels.  The actual measurements
are performed in the BTS and then reported to the BSC over the
A-bis/RSL link(s) in RF RESource INDication messages.

3GPP TS 45.008 defines the following measurement parameters:

  * Intave: Interference Averaging period (see table A.1),
  * Interference level Boundaries (see table A.1).

Both parameters are sent to the BTS over the A-bis/OML, and can
now be configured via the VTY interface.  Only those BTS models
which 'speak' the OML protocol defined in 3GPP TS 52.021 will
actually get the configured parameters, others will keep using
the hard-coded parameters.

Change-Id: I99ebf57aac1f3ca7e0497c3b4f6b0738c6ed7e47
Related: SYS#5313, OS#1866
2021-06-04 19:42:43 +00:00
Vadim Yanitskiy 20e3358867 bts_uptime(): do not spam logs with 'OML link uptime unavailable'
This message periodically appears in the logs with subsys=DNM and
level=INFO for every disconnected BTS.  I find this message useless
and even annoying, so I propose to remove it in this patch.

Change-Id: I7e2498cc61d311ca08585b2f1c49de021b17a5a1
2021-06-04 19:39:58 +00:00
Vadim Yanitskiy ff5ceeadb8 VTY: fix NULL-pointer dereference in lchan_act_single()
Without this guard, a command like this can crash osmo-bsc:

  OsmoBSC# bts 0 trx 0 timeslot 0 sub-slot 0 activate fr

when timeslot 0 is configured as non-combined 'CCCH'.

Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288
CLoses: OS#5170
2021-06-04 19:39:58 +00:00
Pau Espin 8971d6b98f Use new stat item/ctr getter APIs
Generated with  following and similar spatch snippets:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""

Change-Id: I0b43f922a595d694ac0aeda80107ef9bf4e755e7
2021-06-04 17:48:43 +02:00
Neels Hofmeyr 063047ea7c fix rc handling in channel_mode_from_lchan()
chan_mode_to_rsl_cmod_spd() may actually return negative on error. To be
able to check for that, handle the returned value as a signed rc before
assigning to the unsigned spd_ind.

Related: SYS#5315 OS#4940 CID#236231
Change-Id: I52e13b24ce67e288ff32dbdaa1c1759089926f5c
2021-06-02 20:36:57 +02:00
Neels Hofmeyr 2f88133083 fixup for Mode Modify TSC
Use lchan->modify.tsc in gsm48_lchan_modify().

The TSC is chosen exactly once upon LCHAN_EV_REQUEST_MODE_MODIFY
(lchan_fsm.c), and that should be the only place calling gsm_ts_tsc().
All other mode modify code should just use the final lchan->modify.tsc.

This fixes an error in patch:
Ic665125255d7354f5499d10dda1dd866ab243d24
"allow explixit TSC Set and TSC on chan activ / modif / assignment"

Thanks to coverity for actually detecting this mistake.

Related: SYS#5315 OS#4940 CID#236233
Change-Id: I87ecf7d9266f37f4c775d029e277b614671a9401
2021-06-02 20:30:35 +02:00
Neels Hofmeyr 829c8e5052 Drop duplicated arfcn_range_encode.c available in libosmocore
This code is available in libosmocore since ~3 years ago
(fdf8b7b1beeb0cda262c5fb060a933aa7edb5e9a). Let's use it instead of
maintaining duplicated code which diverges over time.

Depends: osmo-bsc.git Iae058c35506bc25c9f4790889b89ac46aea664b6
(contains cherry-pick of bug fixed in osmo-bsc.git).

Change-Id: I53ad3067623077b6a8737c2a0aecc8b46bf71a15
2021-06-01 20:00:51 +02:00
Neels Hofmeyr 858a0211a0 lchan_fsm: introduce lchan.modify.ch_mode_rate to allow tweaking
lchan->modify.info.ch_mode_rate should remain unchanged, it is the
immutable request data. However, for VAMOS, we will want to
automatically see that the chan_mode is chosen correctly.

As a first step, place a mutable ch_mode_rate copy at
lchan->modify.ch_mode_rate, i.e. not in .modify.info, but in
.modify. Use that everywhere.

This is a non-functional change, preparing for a subsequent patch that
adds handling of VAMOS shadow lchans.

Change-Id: I8a3daac0287f15a59d3688388bb13e55facb2cea
2021-05-31 05:20:03 +00:00
Neels Hofmeyr e24da2ef95 ensure chan_mode comparisons in non-VAMOS mode
Both VAMOS- and non-VAMOS speech modes should result in indentical voice
handling. So make sure that all chan_modes are converted to non-vamos
before comparing / evaluating in switch statements.

Change-Id: I791e7966b1f8eaa3299a8a46abeb313cf5136e0b
2021-05-31 05:20:03 +00:00
Neels Hofmeyr 27c07690d9 replace ts_*_for_each_lchan() with ts_for_n_lchans()
So far we have a couple of macros iterating a specific number of lchans,
depending on dynamic timeslot state etc. With addition of VAMOS lchans,
this would become more complex and bloated.

Instead of separate iteration macros for each situation, only have one
that takes a number of lchans as argument. That allows to more clearly
pick the number of lchans, especially for non-trivial VAMOS scenarios.

Related: SYS#5315 OS#4940
Change-Id: Ib2c6baf73a81ba371143ba5adc912aef6f79238d
2021-05-31 05:20:03 +00:00
Neels Hofmeyr e262919892 add fields to reflect nr of lchans in ts struct
So far the number of usable lchans is determined on-the-fly by the
physical channel config. With VAMOS, this becomes more complex, namely
determining whether the BTS is vamos capable.

Instead of calling a function to determine the number of lchans for
every use, rather place the number of valid lchans in int members of the
timeslot struct, and initialize those during timeslot setup.

Actual use of these new fields will follow in a subsequent patch, which
introduces the ts_for_n_lchans() macro to replace current lchan
iteration macros.

Related: SYS#5315 OS#4940
Change-Id: I08027d79db71a23e874b729c4e6173b0f269ee4f
2021-05-31 05:20:03 +00:00
Neels Hofmeyr 6f5b1b1675 VTY: dump TSC Set and TSC for each timeslot
This is particularly interesting for VAMOS multiplexes, but also gives
more prominence to this rather central aspect of GSM RF.

Related: SYS#5315 OS#4940
Change-Id: I7842ff89bece6d88387dae056e350529bae6fc38
2021-05-31 05:20:03 +00:00
Neels Hofmeyr c33eb8d569 allow explixit TSC Set and TSC on chan activ / modif / assignment
Activating / modifying to a VAMOS mode will require picking specific TSC
Set / TSC. It is a bad idea to pick the TSC in each message encoding
function, rather make this choice centrally.

So far we pick the training sequence code to use based on the timeslot
configuration, and this TSC is determined only upon encoding the RSL
messages.

Instead, pick the TSC to use upon the initial lchan activation /
modification request; store this in the request structs and pass through
the activation / modification code paths.

For VAMOS modes, we also need to pick a TSC Set. Do so also upon activ /
modif request. Note that the TSC Set is not yet applied in this patch,
it will be applied in upcoming VAMOS patches.

The activ / modif request may pass -1 for tsc_set and/or tsc to indicate
no specific choice of TSC Set and TSC, resulting in the same behavior as
before this patch.

For example, lchan->activate.info.tsc* may be passed as -1. The exact
choice for tsc_set and tsc is then stored in lchan->activate.tsc*, i.e.
one level up (the .info sub-struct is considered as immutable input
args). The lchan->activate.tsc* are the values actually encoded in RSL
messages. After the ACK, the lchan->activate.tsc* is stored in
lchan->tsc* to indicate the TSC actually in use. Same for modif.

Note that in 3GPP TS 45.002, the TSC Set are numbered 1 to 4, while the
TSC are numbered 0 to 7. On the wire, though, TSC Set is sent as 0 to 3
value. This is a weird discrepancy, odd choice made by the spec authors.
For conformance with the spec wording, I decided to pass the TSC Set
number as a 1-4 ranged value, and only convert it to the 0-3 on-the-wire
format upon message encoding. So log messages and VTY output will
indicate the first TSC Set as "1", but the first TSC as "0", as defined
in 3GPP TS 45.002, even if that is somewhat weird.

Related: SYS#5315 OS#4940
Change-Id: Ic665125255d7354f5499d10dda1dd866ab243d24
2021-05-31 05:20:02 +00:00
Neels Hofmeyr 5df7e771a8 gsm48_lchan2chan_desc(): expose TSC as param
Expose the training sequence code used in the RSL Channel Description IE
as an input parameter.

So far the Channel Description IE is always composed with a training
sequence code from gsm_ts_tsc(). For RSL commands enabling VAMOS mode,
specific training sequence codes are required.

So far, all callers still use gsm_ts_tsc(), making this a patch without
any functional change. Upcoming patches will pass specific TSC as
configured for VAMOS instead, in specific places.

Related: SYS#5315 OS#4940
Change-Id: I49503a6f5d25bb3bc9a0505bd79ed1d5c4f50577
2021-05-28 17:22:59 +00:00
Neels Hofmeyr 7336e63a96 add chan_mode_to_chan_type()
Move the conversion from chan_mode to lchan type out of the
lchan_select_by_chan_mode() function, so that the conversion can be used
by other code paths, coming up in VAMOS patches.

Related: SYS#5315 OS#4940
Change-Id: I296651ebadba81f8b3db0d9bb5b5377877a43677
2021-05-28 17:22:59 +00:00
Neels Hofmeyr 1b277ec2a2 RSL link: explicitly select rsl_link based on lchan
Prepare for VAMOS, where there will be secondary "shadow" lchans serving
secondary MS on the same timeslots. For those, RSL messages will need to
reflect a different stream ID aka TEI, via an rsl_link_vamos.

Make sure that every code path that sends an RSL message for a specific
lchan selects the RSL link via the new function rsl_chan_link(). When
VAMOS is implemented, this function can select the proper RSL stream.

Rename gsm_bts_trx.rsl_link to rsl_link_primary. This makes sure I'm not
missing any uses of the RSL link, and clarifies the code.

Related: SYS#5315 OS#4940
Change-Id: Ifbf16bb296e91f151d19e15e39f5c953ad77ff17
2021-05-28 17:22:59 +00:00
Neels Hofmeyr 69def1f97e hodec 2: do intra-cell congestion resolution by Assignment
So far we do all channel reassignments by Handover Command. Since
osmo-bsc now supports rassignment of ongoing voice calls, do intra-cell
congestion resolution by Assignment Command.

In effect, add support for expecting an Assignment Command in
handover_test, and expect assignments instead of handovers for
intra-cell congestion resolution test cases.

Related: SYS#5330 OS#3277
Change-Id: Id56a890106b93fcee67ac9401b890e7b63bba421
2021-05-28 17:22:59 +00:00
Neels Hofmeyr 651fda903b vty: actually trigger Assignment for 'assignment', not HO
Related: SYS#5315 OS#4940
Change-Id: Iee11f1ae0533d7db844e68a5c4c48d0fe3e27297
2021-05-28 17:22:59 +00:00
Neels Hofmeyr cb0aaad5d4 assignment_fsm: allow assignment to a specific lchan
So far the assignment FSM always tried to satisfy the channel mode and
rate by either re-using the current lchan or finding a new, unused
lchan. For VAMOS however, we want to pick one specific lchan.

Add target_lchan to struct assignment_request and skip all mode matching
and lchan selection when a specific target_lchan is set.

Related: SYS#5315 OS#4940
Change-Id: I71e0d4ff4746706e0be5266e4574d70ca432e3d7
2021-05-28 17:22:59 +00:00
Neels Hofmeyr c2d3fe5da0 assignment_fsm: tweak state transitions (prep for reassignment)
It is better design to take state change actions in the onenter
function, instead of triggering a state change and then calling
lchan_mode_modify() or lchan_activate(). The reason is that in
principle, any state change may cause error handling to abort and
deallocate FSMs.

This is also preparation for reassignment to a specific lchan in an
upcoming patch.

Related: SYS#5315 OS#4940 OS#3277
Change-Id: I9a2e7eefd4196b80671311e5dfd275893ec0e275
2021-05-27 17:06:21 +02:00
Neels Hofmeyr d508143dd3 AMR config cleanup step 3: generate AMR LV on msg composition
Firstly, do not store the encoded AMR length-value bits in gsm_lchan->*
before an activation/modify has actually succeeded.

And secondly, do not store the AMR LV structure in struct gsm_lchan at
all, but only generate the TLV exactly when a message is being composed.

In gsm48_multirate_config(), generate the LV directly to a msgb instead
of a static buffer first. gsm0408_test.c expected output verifies that
the generated LV bytes remain unchanged.

In lchan_mr_config(), introduce a target mr_conf argument, so that Chan
Act and Mode Modify may generate the filtered AMR config to different
locations (lchan->{activate,modify}.mr_conf_filtered).

Only after receiving an ACK for Activate/Modify, set
lchan->current_mr_conf from lchan->{activate,modify}.mr_conf_filtered.

Use the properly scoped lchan->activate.mr_conf_filtered for Chan Act,
lchan->modify.mr_conf_filtered for Mode Modify and
new_lchan->current_mr_conf for Handover Command as appropriate.

Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Ie57f9d0e3912632903d9740291225bfd1634ed47
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 025d27a319 AMR config cleanup step 2: filter modes also for VTY
The previous patch reshuffled the code without having any functional
change. In this patch, a functional change follows:

It does not really make sense to decide on AMR mode filtering based on
whether an activation request came from the VTY:
a) BTS: There is no need to skip AMR mode filtering for the BTS config
   at all. There is always a BTS.
b) MSC: Instead of testing for a VTY origin of the request, rather skip
   the MSC AMR config filtering exactly when there is no conn associated
   with the lchan.

Move the bts filtering directly into mr_config_filter().

Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Ia7519d2fa9e7f0b61b222d27d077bde4660c40b9
2021-05-27 17:06:21 +02:00
Neels Hofmeyr fde6c71a03 AMR config cleanup step 1: split lchan_mr_config()
Split off two function from lchan_mr_config() which do not directly
manipulate struct gsm_lchan members. This allows subsequent patches to
re-use mr_config_filter() for Channel Mode Modify without depending on
lchan->activate.info; allows to filter AMR modes without modifying the
state of an already active lchan before sending a Channel Activation or
Channel Mode Modify; and allows to move mr_config_render_lv() to
gsm_04_08_rr.c so that the mr_ms_lv and mr_bts_lv no longer need to be
stored in struct gsm_lchan -- they essentially duplicate s15_s0.

Rationale:

This is a follow-up for the AMR configuration in the sense that previous
patch Ie0da36124d73efc28a8809b63d7c96e2167fc412 started for channel mode
and rate, and the s15_s0 bits:

The AMR mode filtering directly manipulates struct gsm_lchan members and
takes parameters from lchan->activate.info. This makes it hard to
separate lchan activation from the Channel Mode Modify procedure.

Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Iebac2dc26412d877e5364f90d6f2ed7a7952351e
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 08e072bae0 move lchan->csd_mode into channel_mode_and_rate
The GSM48_CMODE_DATA_* rates are completely unused in OsmoBSC anyway,
but there is some code in abis_rsl.c checking its value, and if we were
to start using it that is the place where it should be.

Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Ie0e065a5dca5f4a31d5d81e3528a539214a74170
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 3625c90c22 eliminate lchan->rsl_cmode
Related: SYS#5315 OS#4940
Change-Id: I1c167b22bb6638a929488d093bde0f1a5fb227ad
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 8a2156543b remove special case from assignment_count_result()
The single place that calls this special case is now actually doing the
exact same thing as the general case, and this is merely code dup.

Related: SYS#5315 OS#4940
Change-Id: Ic62e8a48d3c88a1966086240a41732d169328491
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 0951d75665 make sure channel mode and s15_s0 are updated only after an ACK
I noticed during testing that an lchan used as TCH/F in fact still had
its channel mode set to Signalling -- because on Assignment, the Speech
mode used to be placed in the *previous* lchan and the new lchan was
never updated after the Activ ACK. This is unbearable confusion which I
complained about numerous times, so far mostly for cosmetic reasons. But
implementing re-assignment properly actually requires this to be cleaned
up.

Keep all volatile chan mode settings in lchan->activate.* or
lchan->modify.*, and only update lchan->* members when an ACK has been
received for those settings. So a failed request keeps a sane state.

Make sure that those settings are in fact updated in the proper lchan,
upon an ACK, so that subsequent re-assignment or mode-modify know the
accurate lchan state.

Related are upcoming patches that sort out the AMR multirate
configuration in a similar fashion, see
Iebac2dc26412d877e5364f90d6f2ed7a7952351e
Ia7519d2fa9e7f0b61b222d27d077bde4660c40b9
Ie57f9d0e3912632903d9740291225bfd1634ed47.

Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Ie0da36124d73efc28a8809b63d7c96e2167fc412
2021-05-27 17:06:21 +02:00
Neels Hofmeyr d587574d7b potential segfault: vty chan act: do not set AMR bits for EFR
The amr_mode parameter may be passed as -1 and is directly used as an
array index in amr_modes[]. The AMR related switch case properly checks
against a -1 index, but the EFR does not -- and should not use s15_s0.

Change-Id: I9bae5b4fb8ab8c2002fe785e130dc9faeeda892c
2021-05-27 17:06:21 +02:00
Neels Hofmeyr 1de1c038cf cosmetic scoping in reuse_existing_lchan()
cosmetic prep for Ie0da36124d73efc28a8809b63d7c96e2167fc412

Related: SYS#5315 OS#4940
Change-Id: I0d1000cf108b0dfdc690f7a59d9bdf40de9043d2
2021-05-27 15:01:57 +00:00
Neels Hofmeyr 5234c64bd0 assignment_fsm: send BSSMAP response only after Assignment Request
So far, only the MSC asked for Assignment via Assignment Request, which
we answer with a BSSMAP Assignment Complete or Assignment Failure when
done.

When Assignment is triggered for any other reason (congestion
resolution, VAMOS, VTY), we will not send any such messages to the MSC.

Additional enum values will be added in subsequent commits:
Id56a890106b93fcee67ac9401b890e7b63bba421 ASSIGN_FOR_CONGESTION_RESOLUTION
If006f5caaf83b07675f57e5665cfa79328da55e6 ASSIGN_FOR_VTY

Related: SYS#5315 OS#4940
Change-Id: Ie0cddbdb00abcec78e153f4ae6d04ce75080a111
2021-05-27 15:01:57 +00:00
Neels Hofmeyr d514f639fc hodec2: remove code dup of rxlev averaging
Change-Id: Ic49b94ea243898535c82018c14df8a3ba216ea83
2021-05-26 22:01:46 +02:00
Pau Espin 7c4e6cc221 ctrl: Avoid fclose() on NULL pointer
Fixes: 25ff634b5e
Related: Coverity CID#236128
Change-Id: Ib23614c77ec039dd0812196fa4e5d1c3f8408087
2021-05-25 11:49:12 +02:00
Pau Espin 25ff634b5e ctrl: Introduce CTRL SET cmd to apply VTY cfg file
Depends: libosmocore.git Change-Id I720ac04386261628c0798a1bfcaa91e2490a86c3
Related: SYS#5369
Change-Id: I4c6c13418e5f7b4681b0e2a5cc8bb3bc6d8d17c3
2021-05-24 22:05:49 +02:00
Pau Espin b199851143 bsc: Use osmo_clock_gettime everywhere
Change-Id: I585910277f36d9d7950c9d7e435356eaf2a11ed7
2021-05-23 10:30:44 +00:00
Pau Espin 2270760325 bsc: Clean up TS selection in ipaccess_sign_link_up/down
Change-Id: I3e60ebc979010830a5c40112824893a640c58fd4
2021-05-23 10:30:44 +00:00
Pau Espin c328cade9b ipaccess-config: Clean up sign_link setup helper
Change-Id: I7a5231690c9f2f1c2378b1035900c6c246deb994
2021-05-23 10:30:44 +00:00
Neels Hofmeyr 4ab0555f39 assignment_fsm: tweak error log msg for mixed modes
Change-Id: Ic42b141012215f428066d739a2099b217f4e5d41
2021-05-21 15:43:30 +02:00
Neels Hofmeyr d5cb0eb8fd lchan and assignment FSMs: make Channel Mode Modify more sane
The Channel Mode Modify procedure is currently implemented for changing
a TCH lchan from signalling to voice mode. For that, however, it is
re-using (abusing) the channel activation structs and state transitions,
and thus always implies activating a voice stream when the mode
modification is done.

I will add a Channel Mode Modify to enable VAMOS mode soon, so I require
separate structs and state transitions which also work on an lchan that
already has a voice stream established: a struct lchan_modify_info and
LCHAN_EV_REQUEST_MODE_MODIFY, and dedicated assignment FSM state
ASSIGNMENT_ST_WAIT_LCHAN_MODIFIED.

For the part where a Channel Mode Modify enables a voice stream after
switching from signalling to speech mode, still use the channel
activation code path, but only once the mode modification is done.

General improvements:
- To ask for a mode modification, emit an FSM event that ensures a mode
  modify only happens when the lchan state allows it.
- The new lchan_modify_info struct reflects only those parts that have
  an effect during a mode modification (before the lchan_activate_info
  was fully populated, many values not having an effect).
- More accurate logging, indicating "Mode Modify" instead of "Channel
  Activation"

A TTCN3 test for the Channel Mode Modify procedure is added in
Idf4efaed986de0bbd2b663313e837352cc139f0f, and the test passes both
before and after this patch is applied.

Related: SYS#4895
Change-Id: I4986844f839b1c9672c61d916eb3d33d0042d747
2021-05-21 15:43:30 +02:00
Neels Hofmeyr 9607d09203 cosmetic: rename lchan_activate_mode to lchan_activate_for
In subsequent patches, I will add enum lchan_modify_for and enum
assignment_for, I prefer to have similar lchan_activate_for naming.

Change-Id: Ia4420fcd1234dbee92e768e5a32eab13fba29ea9
2021-05-21 15:43:30 +02:00
Neels Hofmeyr 794e1281d8 cosmetic: rename FOR_* to ACTIVATE_FOR_*
Soon, there will also be enums with ASSIGNMENT_FOR_* and MODIFY_FOR_*
naming. Add the ACTIVATE_ prefix to the existing enum to clarify.

Change-Id: I12190d4d154a1da6a9ebc9a755ccc2fe382ff188
2021-05-21 15:43:30 +02:00
Neels Hofmeyr a31beaeafd gscon MGCP: properly skip redundant MDCX towards MSC
So far we were comparing the requested MSC side RTP address+port with
the MGW side's address+port, which would practically always fail, and
hence we always issued redundant MDCX even if for unchanged MSC side.

Skip the MDCX if the MSC side remains unchanged.
Emit the success event immediately if the MDCX is skipped.

Depends: Ibb488925827d9dc0ccb1f8d6d84728745d086793 (osmo-mgw/libosmo-mgcp-client)
Change-Id: If994ecef9d4269a8120b0575de9b6d0c3be19146
2021-05-21 15:43:30 +02:00
Neels Hofmeyr d60b21cc6b log: show src file,line of lchan_set_last_error
Change lchan_set_last_error() to macro so that the error log reflects
where the error was encountered.

Change-Id: I571fdf2d418c52d120215cf19e57a3c96d67af07
2021-05-21 15:43:30 +02:00
Neels Hofmeyr f3cce79f14 gsm48_send_rr_ass_cmd(): rename lchan to new_lchan
Clarify that this is the lchan that is being assigned to the MS, in
contrast to the current lchan.

Change-Id: I0de017f7c43ec495c2cd0f05f313740f42ab0bb1
2021-05-21 13:13:15 +00:00
Neels Hofmeyr b6d064c94f gsm48_send_rr_ass_cmd(): rename dest_lchan to current_lchan
This variable is the lchan that the Assignment Command should be sent
to, i.e. the MS's current lchan. The "dest" could be interpreted as the
destination of the assignment, the lchan that the MS should move to.

Change-Id: If2c102a8f1d45f84b6a765555abf7cd7a4749b0f
2021-05-21 13:13:15 +00:00
Neels Hofmeyr 1605c8a18b select_codecs(): do not confuse bool 'true' with integer value 1
In practice, '+ true' may result in '+ 1', but that is not type safe. We
rely on the number of items added by summing up booleans, rather make it
explicitly 1.

Change-Id: I17a82f4f208203b748ba2d6ace0ddc06f87c1cef
2021-05-21 13:13:15 +00:00
Neels Hofmeyr 7fc58defab assignment_fsm: fix failure log message for lchan unavailable
Actually print the three different modes, and fix the length conditions.

Change-Id: Id381dbb7ff6f0d790a7a92021fd68f94fbec0568
2021-05-21 13:13:15 +00:00
Pau Espin 875f513183 Fix bts->description field not printed in config write
A recent commit removed the references to the per-TRX description, but
wrongly removed the per-BTS in this place too.

Fixes: defb5b1200
Change-Id: Iacaa2a25633a8706bfde9e0c196fee3e5bff1639
2021-05-18 16:32:30 +02:00
Pau Espin fcffaf7bdb osmo-bsc: Avoid erroring every few secs about unconnected BTS
I know my 2nd BTS is not connected, no need to get an error about it
every few seconds.

Change-Id: I7c991b49b4f474d8b324ac7ff3ddb6a9ec59751d
2021-05-11 18:06:24 +02:00
Michael Iedema 858ac62b88 stats: add BTS uptime counter
Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c
2021-05-04 16:09:46 +00:00
Neels Hofmeyr 496274b4ee lchan_fsm: mode modify: fix missing timeouts and error transitions
Change-Id: I6364cfb78f661f5f7473dcec488e361e6a1dc9e4
2021-04-28 16:32:19 +02:00
Neels Hofmeyr e8bb7438cb lchan_release(): do not release UNUSED lchan
I noticed that lchan_release() is generally called in varying error
situations, so it makes sense to generally skip the release procedure
when the lchan is already in the UNUSED state.

Change-Id: I6e9faf682d1668388d5470419110408a098b9900
2021-04-28 16:32:19 +02:00
Neels Hofmeyr 730fc73bd2 comment: tweak pchan_subslots() description
Change-Id: I4d3ca6efc7b4fadd6711ae80502027cec1b7b84e
2021-04-28 16:32:19 +02:00
Neels Hofmeyr 4289327241 log: drop duplicate logging in ts_setup_lchans()
Change-Id: I569229328229047d399033d1483d09d323826692
2021-04-28 16:32:19 +02:00
Neels Hofmeyr ef28721c16 gsm_lchan_name_compute with ctx
Use a talloc ctx directly without an intermediate static buffer.

A subsequent patch will add a name tweak for VAMOS secondary lchans, so
it felt appropriate to first clean this.

Change-Id: Idb922605c15242a2cdc7c34668c845a179a15660
2021-04-28 16:32:19 +02:00
Neels Hofmeyr 7a0bc6f881 Lb: make sure we never have missing timer configurability
After I found that X12 was missing from the VTY config, make sure that
no timers have been forgotten in lcs_ta_req.c: change the default
timeout to -1. We will notice missing timers during testing.

Change-Id: I7c0b098622548bf0f0374c304522e6a9db0331e3
2021-04-28 16:31:08 +02:00
Neels Hofmeyr 40257f47b8 Lb: add missing X12 timer configurability
While adding timers for Channel Mode Modify, I notice that X12 is
used in lcs_ta_req.c, but missing in net_init.c. Add it so that it is
exposed on the VTY configuration.

Change-Id: I19540f64de4937b39963bb66bebb1b5d433c2be2
2021-04-28 16:30:56 +02:00
Neels Hofmeyr d8e55223ec Lb: RESET FSM: never send sccp_user == NULL
A crash was reported in bssmap_le_tx_reset() sending a RESET with
sccp_user == NULL. A previous patch fixes what I infer as the root
cause, but I thought let's also have this additional safeguard.

Related: OS#5134
Change-Id: I13834c4e576e8d33e67cb63e222b41255cd94875
2021-04-27 17:34:23 +02:00
Neels Hofmeyr 18abd1a808 Lb: stop RESET FSM when sccp_user is unbound
A crash was reported in bssmap_le_tx_reset() sending a RESET with
sccp_user == NULL. Looking at the issue I noticed that when the
sccp_user is torn down, the RESET FSM should also be terminated.

Add bssmap_reset_term_and_free() to the generic RESET FSM implementation
and call from lb_stop() before sccp_user is set to NULL.

Related: OS#5134
Change-Id: If412ef990fcdde8ff88098a5169e86f05cd1c7f0
2021-04-27 17:34:23 +02:00
Neels Hofmeyr 5979f2bcce abis_nm_ipaccess_rsl_connect(): use msgb to compose attr
So far the function uses insane byte array magic numbers to compose the
OML "RSL Connect" message. For VAMOS, I intend to modify that message.
To ensure sanity, first change the attr composition to msgb_put*().

Related: OS#4940
Change-Id: Iba005635cf86aee1fde77d58ef203e28eed92281
2021-04-27 14:04:01 +00:00
Pau Espin 0ca738f4e3 SRVCC: Forward Last EUTRAN PLMN Id in Handover Required
"""
The old BSS shall inform the new BSS of the MS's last used E-UTRAN PLMN
in the "Last used E-UTRAN PLMN ID" information element included in the
"Old BSS to New BSS information" Information Element if this information
is present.
"""

Depends: libosmocore.git Change-Id I6280ce1abc283f1491bc6f391b2dd952df33a16b
Related: SYS#5337
Change-Id: I6cf54f9a16d598f98dc56b25f0fef56225a25a28
2021-04-24 08:49:08 +00:00
Pau Espin b0b76af0c3 SRVCC: Parse Last Used E-UTRAN PLMN Id in Handover Request
Whenever SRVCC EUTRAN->GERAN is performed by the CN, it will set the
Last Used E-UTRAN PLMN Id in order for the BSS to inform the MS
about EUTRAN neighbors once the call is over.
The last part (sending EUTRAN neighs) is already implemented, since same
thing is done as per CSFB. However, we lacked the first part, where the
EUTRAN PLMN Id is recorded for later use.

Actually, in both cases, we end up building the list of neighbors
without taking into accound the PLMN value (hence no filtering of
configured neighs), but it only sends such a list if any PLMN was stored
there, which means this patch is still necessary for a quick fallback to
4G after the call is over.

Related: SYS#5337
Depends: libosmocore.git Change-Id I0e55e947b6fef6dad0cf1a6c16b781bef4cc76c5
Change-Id: Ia5008f11a4c36ef8085a2037d4abddd131086e6e
2021-04-24 08:49:08 +00:00
Pau Espin 8831160631 Revert "update neighbor ARFCNs on startup and config changes"
This patch caused major breakage in my setup, with BSC printing at
startup: "(bts=0,trx=0) Failed to generate System Information".

And bts-trx printing all the time:
"sysinfo.c:162 PH-RTS-IND: Unable to determine actual BS_AG_BLKS_RES
value as SI3 is not available yet, fallback to 1"

This reverts commit c1a5310a3e.

Change-Id: I5da365c93aedc6668a77b82ee9b68cbec64967e3
2021-04-23 13:38:58 +02:00
Neels Hofmeyr c1a5310a3e update neighbor ARFCNs on startup and config changes
The effects of the neighbor configuration depend on the LAC, Cell
Identity, ARFCN, BSIC configuration of neighbor cells. Make sure that
the neighbor ARFCN list in the System Information is updated.

This may seem rather aggressive: updating the SI of all BTS if only one
config item changed. But indeed even modifying one config item of one
BTS may cause a change in the neighbor relations that many other BTS may
have to the changed BTS. For example, if many BTS configure a
'neighbor lac-ci 42 23', and this cell's config changes to LAC 43, all
of those other BTS need to update their neighbor ARFCNs.

Also update the system information even before the BTS are connected and
started up. The main benefit here is that the VTY 'show bts N' command
then already lists the correct neighbor ARFCNs.

In gsm_bts_trx_set_system_infos(), make sure that the updated SI is only
sent to TRXes that are actually usable, otherwise abis_rsl_sendmsg()
spams the log with complaints that a message's dst == NULL. Still return
an error rc in case a TRX is not connected, so that the CTRL command
bts.N.send-new-system-informations accurately returns whether SI were
actually sent to all TRXes.

The desire to have the ARFCNs listed in the VTY before starting up BTSes
came during analysis for Ifb54d9a91e9bca032c721f12c873c6216733e7b1,
which fixes a bug that is now much easier to verify being fixed.

Change-Id: I2222e029fc225152e124ed1e8887f1ffd4a107ef
2021-04-22 18:50:32 +00:00
Pau Espin 5bc54d6ce8 Send EUTRAN neighs based on whether Common Id msg contained Last used E-UTRAN PLMN ID
From 3GPP TS 48.008 sec 3.1.30 "Common ID":
"""
If the SCCP connection is established due to CSFB from E-UTRAN and the MSC supports
return to the last used PLMN after CS fallback, then it should send the COMMON ID message
to the BSS including the Last used E-UTRAN PLMN ID information element if available at
the MSC immediately following the successful SCCP connection setup.
"""

Furthermore, 3GPP TS 48.008 version 16.0.0 Release 16 "3.2.1.21 CLEAR COMMAND",
for field CSFB Indication, states:
"""
NOTE: This information element doesn't serve any useful purpose. MSCs should not send the
information element unless it is required by the recipients (due to the need to interwork
with older versions of the protocol). It is expected that in future versions of the present
document, this information element will be deleted from this message.
"""

Hence, build up the EUTRAN neighbor list based on whether we received
the Last E-UTRAN PLMN ID IE during Common Id. In the future, we should
probably filter the list while populating it based on the received IE.

This change will also allow reusing same mechanism for SRVCC
EUTRAN->GERAN support, where te Last E-UTRAN PLMN ID IE can be found
inside "Old BSS to New BSS information" IE in msg HANDOVER REQUEST.

Related: SYS#5337
Change-Id: I5d290ac55eca5adde1c33396422f4c10b83c03d5
2021-04-19 12:12:31 +02:00
Neels Hofmeyr 6be9e42a1d fix wrong ARFCNs in local-cell neighbor config
For neighbors configured without explicit ARFCN+BSIC ('neighbor bts N',
'neighbor lac-ci N M', ...), actually use the local neighbor cell's
ARFCN.

So far the code looked correct on first sight, but passed an unused part
of the struct neighbor union, always resulting in ARFCN 0.

Related: SYS#5367
Change-Id: Ifb54d9a91e9bca032c721f12c873c6216733e7b1
2021-04-18 16:23:20 +02:00
Pau Espin da6dae0daa bssap: pass whole tlv_parsed to event GSCON_EV_A_COMMON_ID_IND
This change will allow handling more IEs in the future, like
"Last used E-UTRAN PLMN ID" one.

Related: SYS#5337
Change-Id: I96a0e1a7491fabf7aaad62207886821ad6194927
2021-04-15 16:36:23 +02:00
Pau Espin 00ae402627 cosmetic: Fix typo in func description
Change-Id: I26cd31bc3e127cba17be508d10a5fd3cf6498901
2021-04-15 16:36:23 +02:00
Neels Hofmeyr 446e3c7869 deprecation: use osmo_bts_features_*()
For "reported feature '%s'...", use the short feature name, which better
matches the message.

Change-Id: Ie09506fbf3a1f0e899f9f4c8070e3139fd1d5e9d
2021-04-14 17:40:45 +00:00
Neels Hofmeyr defb5b1200 drop unused gsm_bts_trx->description
Change-Id: I3c0778322b8c630b0eb9d9cd3ac3cc71386c9c12
2021-04-14 17:40:45 +00:00
Vadim Yanitskiy d51d96c99c Replace all references to 'sysmobts' with 'osmo-bts'
sysmoBTS is a BTS model sold by Sysmocom, which runs osmo-bts.
The later may also work with some other back-ends, including
the genaral purpose SDR hardware.  Therefore, it's more
logical to call it 'osmo-bts'.

Change-Id: I93ab4dbf483e0786c35685b75ee4ea83bd591f7b
2021-04-12 18:54:40 +00:00
Vadim Yanitskiy 3fd19268ae vty: deprecate BTS type 'sysmobts' in favor of 'osmo-bts'
Change-Id: I60d5ff887a7c830180088904c2458f7e73ce3893
2021-04-12 18:54:40 +00:00
Alexander Chemeris e9a44fdedd stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR signal.
Change-Id: Ice3379020039dc3634aa3887939740729d720dee
2021-04-12 17:56:55 +00:00
Vadim Yanitskiy cd622e0f5f [hopping] bootstrap_rsl(): do not call generate_ma_for_ts() again
It's already being called in inp_sig_cb(), once the A-bis/OML link
is established.  There is no need to do this on the A-bis/RSL link
establishment again.

Change-Id: I435018f439181cdd046ca99fe7e01ac85e226cce
2021-04-12 12:17:40 +00:00
Vadim Yanitskiy 6a8536d4da [hopping] Rework generation of Cell/Mobile Allocation
Calculating the Cell Allocation (basically a bit-vector of all the
frequencies allocated to a cell) on the OML link establishment has
several downsides and potential problems:

  * Theoretically, more than 64 ARFCNs can be allocated for a cell
    via the VTY interface.  The problem here is that the Mobile
    Allocation IE cannot contain more than 64 channels.

  * The BSC's operator will neither be warned by the interactive
    VTY shell during configuration, nor during the startup.

  * The BSC will accept such a configuration, but then will be
    unable to encode the Mobile Allocation IEs at run-time.

This change aims to improve the situation by separating part of
the logic from generate_cell_chan_list(), and invoking this
part directly from the VTY commands.  This way it will become
impossible to configure more than 64 ARFCNs, neither via the
config file, nor interactively from the VTY.

Change-Id: I98211fb0684a973239f5760e1de52a24a1f4c33c
2021-04-12 12:17:40 +00:00
Neels Hofmeyr 711ac95c26 fixup for neighbor config for coverity
Check against NULL pointers to allow only resolving local or only remote
neighbors in resolve_neighbors(). (Though no caller exists currently
that would need this feature, it is trivial and more future-safe.)

Related: CID#220459 CID#220460
Change-Id: I8c2046335ec6f8a5d6b757446c98d8e630ee015f
2021-04-08 21:12:49 +00:00
Vadim Yanitskiy 2fbdc7c5de abis_nm: cosmetic: use osmo_bts_feature_name()
Change-Id: I15078ac030b0b824a554239b19bc501c624e2a87
2021-04-07 16:41:22 +00:00
Vadim Yanitskiy 23c1c975c0 abis_nm: rework warnings about unknown / not supported features
The reported feature vector may contain new features the BSC is
not aware of.  Report each of them individually as NOTICE.

It's normal when some BTS feature is considered as not supported
by the BSC, but a BTS reports that it is - do not log this.

Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
2021-04-07 16:41:22 +00:00
Vadim Yanitskiy 2b07628949 [hopping] generate_ma_for_ts() returns no meaningful value
Change-Id: Ic3ba3323459bba1336adb1f902cb2371edea1f71
2021-04-06 04:38:28 +02:00
Vadim Yanitskiy d63690e473 [hopping] gsm48_send_rr_ass_cmd(): use Cell Channel Description from SI1
Calling generate_cell_chan_list() on each Assignment Command is
quite expensive, because this function basically re-constructs
the Cell Allocation (using bitvec API) and the Frequency List
from scratch.  This IE can be borrowed from pre-calculated
SI1 message, so let's do this.

Change-Id: I9c8c5ae9059ff096765412b3f3c7181a94163afc
2021-04-06 04:38:28 +02:00
Vadim Yanitskiy b77c5eb0bc [hopping] generate_cell_chan_list(): make some pointers const
Change-Id: Ied4ee60224d71567ec613942ba1c03088e9b02f3
2021-04-06 04:38:28 +02:00
Vadim Yanitskiy e2034e0283 [hopping] vty: ensure no duplicate hopping ARFCN entries
Change-Id: Ie27c859e3f16ada08a5cdc8ab4ac6e20a885a378
2021-04-06 04:15:45 +02:00
Neels Hofmeyr 45c72350b3 debug log, lchan_fsm: explain leaving wait_rll_rtp_establish state
Before, it is not clear whether the RTP is already done setting up or
the RTP is skipped entirely. This log message clarifies that.

Change-Id: I18ffcf93e82ee47413e4b2f741ffbfbb18322e1d
2021-04-04 16:20:34 +00:00
Keith Whyte 1823f89c1e Ignore CHANnel ReQuireD with Access Delay IE > 63
It is observed that a CHANnel ReQuireD with access delay
greater than 63 can be received from the Ericsson RBS.
This results in osmo-bsc sending back a CHANnel ACTIVation with
a Timing Advance IE containing the access delay value.
The RBS NACKs this, leading to a BORKEN Channel.

This patch makes the maximum acceptable access delay vty-configurable
and Ignores CHANnel ReQuireD RSL Messages with Access Delay IE greater
than that configured. Default value is 63.

Related: OS#5096
Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
2021-04-04 15:39:53 +02:00
Neels Hofmeyr 764449ec2e fix/refactor neighbor config
The neighbor configuration storage is fundamentally broken: it requires
all local cells to be configured before being able to list them as
neighbors of each other. Upon config write-back, the neighbor config
however is placed back inline with the other config, and hence a
written-out neighbor config no longer works on program restart.

The cause of this problem is that the config is stored as explicit
pointers between local cells (struct gsm_bts), which of course requires
the pointer to exist before being able to reference it.

Instead, store the actual configuration that the user entered as-is,
without pointers or references to objects that need to be ready. Resolve
the neighbors every time a neighbor is needed.

Hence the user may enter any config at any place in the config file,
even non-working config (like a BTS number that doesn't exist), and the
relation to actual local or remote neighbor cells is made at runtime.

Abort program startup if the initial neighbor configuration contains
errors.

Related: OS#5018
Change-Id: I9ed992f8bfff888b3933733c0576f92d50f2625b
2021-03-24 21:22:21 +01:00
Neels Hofmeyr d88f9a5384 refactor handover penalty timers
So far the list of penalty timers was stored for an opaque target
pointer. That was either a gsm_bts pointer for a local BTS, or a cell
identifier list pointer for a remote-BSS cell.

Reasons to refactor penalty timers:

- The cell identifier list pointer came from the neighbor configuration
  storage, but the way cell neighbor config is stored will change in a
  subsequent patch. There will be no more cell identifier lists there.

- Storing object pointers is inherently unsafe -- if an object gets
  removed and another gets allocated, the penalty timer could
  theoretically remain in force for an unrelated object.

Rather store penalty timers for specific Cell IDs. Since remote-BSS
neighbors can be requested by a cell identifier *list*, use a
gsm0808_cell_id_list2 as key in the list of penalty timers.

Fix handover_test.c: have different CI for each local BTS. So far it was
the same LAC+CI for all BTSes, which now would make the test fail,
because any penalty timer would appear to apply to all local cells.

Related: OS#5018
Change-Id: I72dd6226a6d69c3f653a3174c6f55bf4eecc6885
2021-03-24 10:02:29 +01:00
Oliver Smith 3ac1278dcf stats: T3122 related: num_values 16 -> 60
Increase the number of values saved in the FIFO from 16 to 60, so there
is more time to read them out.

Related: SYS#4877
Change-Id: Ic5fd7c0fa030004fd88fee74f0028fb93c9f2d10
2021-03-17 16:21:21 +01:00
Javi 2d168bd1d7 Add command to enable RX diversity to RBS2000
Allow selection of RX diversity from VTY
Options are a,ab,b
Default is 'a' so there is no change from previous behavior

Change-Id: I430762b8cfa51060841d90ba4446de73bd557c6c
2021-03-15 18:50:32 +00:00
Javi 0a3913ee71 Add vty command for Ericsson RBS2000 sync
This commit adds support for Selection of syncronization source.
Options are internal for E1 and external for GPS

Change-Id: Ia3d1acd6b3442238b35fc911092e12a6ac989adb
2021-03-13 07:43:17 +01:00
Vadim Yanitskiy 3991ae5b87 abis_nm: enrich debug messages with contextual info
Change-Id: I68f64e6cae061a49733c4885ba383d2b9b4cfca9
2021-02-20 23:24:09 +01:00
Keith Whyte e4b52dff39 Disallow changing the type of an existing BTS from the vty
Changing the BTS type is not supported, so don't allow it.

For example, Changing from type sysmobts to type rbs2000
may hit an OSMO_ASSERT in om2k_bts_fsm_alloc()

The default BTS type if osmo-bsc is started with an empty
configuration and the operator issues config terminal->network->bts 0
will be "unknown". This type and only this type can be
changed from the vty config node.

Change-Id: I0df97ef128a1bbd84c787654d1d842dce4dad819
2021-02-19 08:29:32 +01:00
Pau Espin Pedrol cdbd7e3bf2 SI13: Enable sending GPRS Cell Options Extension Information on GPRS-only BTS
The EGPRS bits are anyway conditionally enabled by egprs_supported.

Change-Id: Ie7a438419eb416ce3d29794febab5f952661e5c5
2021-02-18 00:56:13 +00:00
Michael Iedema 456a962c7e stats: add SIGN/SPEECH assignment subcategories
Change-Id: I73f4dab6edb0951180f2bbcfc352ff34de647679
2021-02-17 15:13:25 +00:00
Pau Espin Pedrol 0cfed38f07 Fix neigh resolution service on local neighbours
Change-Id: I217e3550aa6d7f3c3cab4e545641d790ae12b23f
Related: SYS#4909
2021-02-13 08:15:01 +00:00
Pau Espin Pedrol a27e8a5c9a Move bts_ident_key to neighbor_ident.c
The function is not really handover specific, and will be used in other
places in subsequent patches.

Change-Id: Icae8b9045e497f850f22cb3b6f93acbf61b84746
2021-02-13 08:15:01 +00:00
Philipp Maier a2f21b3bc4 bsc_vty: mark repeat rxqual 4 (BER >= 1.6) as default
Change-Id: Iecc2395efab703cf3de8f8e16b9e4bc8c8baf260
Related: SYS#5114
2021-02-11 12:45:36 +01:00
Pau Espin Pedrol d01bc3e4c7 Introduce VTY cmd to configure Alpha in SI13
Related: SYS#5358
Change-Id: I8b97ea11bad5fe05f2f634945b5703ee9abde81d
2021-02-09 13:31:48 +01:00
Harald Welte c72c853a96 hide the "smscb-command" vty command; people should use osmo-cbc
Many years prior to the implementation of osmo-cbc, we introduced
a way how raw RSL SMSCB COMMANMD can be injected from the VTY.

These days, people should use the CBSP interface with osmo-cbc or any
other CBC.  We should not advertise the VTY command hack
as a standard feature anymore.

Change-Id: If5ddc3db989763a1f47d4cbc026e293e3134d8ef
Related: OS#4753
2021-02-08 17:21:20 +00:00
Vadim Yanitskiy ea8d6939e6 power_control: make P_CON_INTERVAL parameter configurable
Change-Id: I6e0fae81cc60f708e49d5eb8dfc0bbcad926b18f
Related: SYS#4918
2021-02-07 19:20:12 +01:00
Vadim Yanitskiy e1d2691e69 power_control: enable Uplink DPC by default if format is known
So far osmo-bsc would enable Uplink DPC (Dynamic Power Control) only
for osmo-bts, and the 'static' mode for all other BTS models.  This
decision dates back to the time when ip.access specific encoding for
dynamic power control parameters was not implemented, and the MS
Power Parameters IE was sent empty in the RSL messages.

Let's make a step forward by enabling Uplink DPC by default for
all BTS models which declare the API for vendor-specific encoding
of the power control parameters.  Currently this includes osmo-bts
and nanoBTS, both supporting ip.access specific format.

Change-Id: If86d27d4332af3d82f862737340d061e42e34eba
Related: SYS#4918
2021-02-07 04:38:15 +01:00
Vadim Yanitskiy d5a03a59b0 power_control: check BTS model in cfg_power_ctrl_avg_osmo_ewma()
Change-Id: I1c454f447d37cbc4d44b242dc4b2c62297ee3f67
Related: SYS#4918
2021-02-06 20:19:38 +01:00
Neels Hofmeyr b03e73f27b lchan activation: indicate whether TA is known
On lchan activation, we already know the Timing Advance in most
situations: from the Channel Request RACH, or from a previous lchan in
the same cell. Place this information in lchan->activate.info.ta.

So far, the lchan->last_ta (until recently called rqd_ta) was used to
store the initial TA for channel activation -- move the initial TA to
lchan->activate.info.ta, for proper scoping.

Only an inter-cell handover does not yet know a Timing Advance (until
the Handover Detection RACH is received), so indicate
activate.info.ta_known = false for that case.

If ta_known is false, do not include an Access Delay IE in the Channel
Activation message, ensuring that the BTS does not use an arbitrary TA
that is likely inaccurate.

The effect for OsmoBTS is that we will *not* start the downlink SACCH on
channel activation for inter-cell handover, but will wait for a HO RACH
first, and then use the correct TA when enabling downlink SACCH.

Related: OS#4008 SYS#5192
Change-Id: I986bf93e8acd6aef7eaf63ac962480b680aa894f
2021-02-05 20:24:43 +01:00
Neels Hofmeyr 980a28fdcb rename lchan->rqd_ta to last_ta
Originally, the lchan stored only the Timing Advance from the initial
channel request, hence it was called rqd_ta.

Since quite a while now, rqd_ta also stores the most recent Timing
Advance from each received Measurement Report. So rename to last_ta.

This is cosmetic preparation for an upcoming patch that clarifies
whether the Timing Advance is already known for Channel Activation.

Change-Id: I1049526a173819baeb4978db5bf018ba3f1006a0
2021-02-05 20:24:43 +01:00
Neels Hofmeyr 71b1bc4964 lchan assignment when RTP is set up: don't break on Mode Modify
Change-Id: I06d3f35fcc71d77e1f30c2b15ab221ef7d5f7f27
2021-02-05 20:24:40 +01:00
Michael Iedema 9a66b3f200 cosmetic: shorten deref chains where possible
Change-Id: Ic42db1a2d768c8ee7e07406ac5f77af757e52cdb
2021-02-04 20:25:52 +00:00
Vadim Yanitskiy e511c99052 assignment_fsm: assert the result of conn_get_bts()
Change-Id: I036f2d895e3569bd050ce574759f8371bd19cec9
Fixes: CID#216933
2021-02-04 14:22:50 +01:00
Harald Welte f1c82b8e12 BS-11: Send proprietary MRPCI message after assignment + HO complete
This is a non-standard RSL message that must be sent after each traffic
channel has been established.  Without it, any voice call will be
disconnected within seconds.

This is a hack; we need to store the subscribers classmark2 value and
use it here.

Change-Id: I6cb6d25e405aa888c4df4022d897330a6af9e946
Related: OS#2389
2021-02-03 08:50:07 +00:00
Neels Hofmeyr b4364a4adc hodec2: fix intra-cell congestion balancing with source lchan on dyn TS
Related: SYS#5301
Change-Id: I332477cbddf32cf6f057007b45cda8477227f0b1
2021-02-02 21:53:53 +01:00
Pau Espin Pedrol 1475aac8ed Allow configuring SI13 CCN_ACTIVE bit from VTY, enable by default on osmo-bts
This is required in order to tell MS that osmo-pcu now supports
Network Assisted Cell Change (NACC).

Other BTS are not enabled by default since NACC support is not known to
work nor tested there.

Depends: libosmocore.git Change-Id I61991266b95d0c13d51b47906cc07846e9cf1390
Related: SYS#4909
Change-Id: If91d85331d402c3ab9c32b70c2c66cd7ba6ceb28
2021-01-30 19:16:18 +00:00
Michael Iedema e3d0b93986 stats: Add granularity to chan:rf_fail stat.
Add additional counters to track TCH and SDCCH RF failures in separate subcategories.

Change-Id: I91fe6659fe9df33763f4070b4f505561b2005d38
2021-01-30 14:15:16 +00:00
Harald Welte 5e01039d79 select_best_cipher(): Prefer A5/1 over A5/2
We cannot simply use the highest 'x' in A5/x codecs.

For A5/7 through A5/3, larger 'x' means better.
But: A5/1 is better than A5/2, so we need to prefer the former
over the latter.

Change-Id: I399fff8d07d1bfcbc6b385e90914ff6d9e00eb73
Closes: OS#4975
2021-01-29 21:24:36 +00:00
Pau Espin f4db24c731 cosmetic: bts-sysmo: Fix whitespace indentation
Change-Id: Ia4594d8a98aee19f14e75449cfdfdc0fbcaf6e9f
2021-01-29 17:10:31 +01:00
Philipp Maier 80184ae171 abis_rsl: check if emergency calling is disabled before premption
If an emergency call arrives at the BSC while all TCH are busy, one TCH
is cleared in favor of the emergency call. However, if emergency calls
are disabled (system information), it is still possible that an MS might
try an emergency call anyway or that due to interference a regular call
might look like an emergency call (channel request reason). In those
cases the preemption must not happen and the emergency call must be
rejected.

Change-Id: I1af1f4fefcbe6a886bb5396901ce0cb2368a0e19
Related: OS#4976
2021-01-26 22:42:06 +01:00
Philipp Maier 20a90a9b86 bsc_vty: fix acch_repetition ber threshold strings
When setting the BER threshold for ACCH repetition the VTY displays
wrong threshold values in the online help.

Change-Id: I4c89ad130da328aba99663e5a2931a4007772bca
Related: SYS#5114
2021-01-22 20:46:48 +00:00
Neels Hofmeyr f7e25a1010 hodec2: fix congestion balancing on dyn TS
When balancing congestion, not only look at TCH/F or TCH/H separately,
but also to take into account the effects on the other TCH kind from
using/freeing dynamic TS.

Related: OS#5298
Change-Id: I433df6f343650f9056b1bab926bc19ac1d867ad5
2021-01-19 11:49:07 +01:00
Neels Hofmeyr 2eeef70310 lchan_avail(): omit logging for handover decision 2
Add bool log argument to lchan_avail_by_type() and omit logging when
passed as false. From handover_decision_2.c, pass 'log' as false, from
all other callers pass true, i.e. for unchanged behavior.

Rationale:

Usually, we use lchan_avail_by_type() to select a new lchan to initiate
actual service. For that, it is interesting to see how osmo-bsc decides
which lchan will be used.

For handover decision 2, we since recently call lchan_avail_by_type()
for each and every handover candidate, to determine whether it will
occupy a dynamic timeslot or not (to know whether we would congest the
other TCH kind). So this happens for each permutation of source lchan
and target cell. That produces a lot of logging, out of proportion of
being useful to the maintainer.

Change-Id: Ia403f8fc853ca9ea9e81f7a7395df6b23845ebed
2021-01-19 11:49:07 +01:00
Neels Hofmeyr 3025e69814 hodec2: fix congestion resolution on dyn TS
For handover algorithm 2, properly figure out what effects the target
cell will see for the *other* TCH kind when a handover would occupy a
dynamic timeslot.

Before this, only TCH/F or TCH/H would be regarded at a time. This
introduces detection of whether a dynamic timeslot would be occupied by
a handover, and how losing one unused dynamic timeslot affects the
congestion situation for the TCH kind that is not targeted by the
handover.

In other words, if a handover to TCH/F causes congestion in TCH/H
because of a dynamic timeslot becoming occupied, the handover will not
be performed. Before this, oscillation situations could occur.

A subsequent patch will do the same for congestion balancing.

Related: SYS#5297
Change-Id: I1536b60f03cb0aeb6ba14a72b518aec82fa572fe
2021-01-19 11:49:07 +01:00
Michael Iedema e42208c6ea stats: Add granularity to SDCCH/TCH/LU activity.
Change-Id: I4df275e4770c5ff3643c79ba828e736986f8bb47
2021-01-18 10:59:02 +00:00
Vadim Yanitskiy d2e0654ee4 gsm_data: return early if MS Power class remains the same
The following message makes no sense:

  DRLL DEBUG gsm_data.c:844 MS Power class update: 4 -> 4

because nothing really changed, MS Power class remains 4.  Neither
it makes sense to call lchan_update_ms_power_ctrl_level().

Change-Id: I519d2d1575cbb5352cc381a60513db8e0e2cb0a0
2021-01-15 22:55:48 +01:00
Vadim Yanitskiy 259e797a8a vty: fix 'codec-list' command: check all given arguments first
Allocating a new list of supported codecs *before* checking the
command arguments is a bad idea.  The operator may simply mistype
one of the codecs and will end up with a list of NULL pointers.

The functions calling audio_support_to_gsm88() assume that this
list always does contain valid pointers, so if a new subscriber
connection gets established, or the operator simply invokes
'show running-config', osmo-bsc would crash due to NULL pointer
dereference.

Steps to reproduce:

  1. In the VTY, do: 'en' -> 'configure terminal' -> 'msc';
  2. Configure any invalid codec list, e.g. 'codec-list Boom!';
  3. Invoke 'show running-config', boom!

Let's check the input before changing the internal structures.

Change-Id: I35b740a39c9cf3716d286e717486ef505bc61522
Fixes: OS#4946
2021-01-14 20:47:09 +00:00
Vadim Yanitskiy f5c8034bb7 power_control: fix: properly initialize per-lchan BS power
My assumption that lchan_reset() is called on CHANnel ACTIVation
was wrong - it's actually called on CHANnel RELease.  Therefore
(re)setting per-lchan BS power value must be done in the other
function that is responsible for channel activation.

Change-Id: I056c448ce017458dc4a004374ddca86d44dc35b4
Related: SYS#4918
2021-01-14 17:37:16 +01:00
Vadim Yanitskiy cbf1b931f2 vty: fix writing empty IP address for unconfigured NSVCs
config_write_bts_gprs() currently writes the remote address of an
NSVC even if osmo_sockaddr_str_from_sockaddr() returns non-zero
code.  Thus saving a configuration with only one configured NSVC
to a file would produce the following:

 bts N
  ...
  gprs nsvc 0 nsvci 101
  gprs nsvc 0 local udp port 23023
  gprs nsvc 0 remote ip 127.0.0.1
  gprs nsvc 0 remote udp port 23000
  gprs nsvc 1 nsvci 0
  gprs nsvc 1 local udp port 0
  gprs nsvc 1 remote ip

and next time osmo-bsc would refuse to start due to:

 Error occurred during reading the below line:
  gprs nsvc 1 remote ip

The related condition consists of the following two parts:

  - checking if osmo_sockaddr_str_from_sockaddr() != 0;
  - checking if 'remote.af != AF_UNSPEC'.

The first one is wrong, because osmo_sockaddr_str_from_sockaddr(),
like many other functions, returns 0 on success.  Let's fix this.

After the fix, the second part does not seem to make sense, because
remote.af would remain AF_UNSPEC (0) if the function call succeeds.

Printing the remote port alone does not make sense, let's avoid
printing it if the address cannot be parsed into a string.

Change-Id: I5d6cbde4f605c8184db4ade87de5644a849c05db
Fixes: I621360cab1e12c22248e33d62a9929995053ce04
2021-01-14 12:29:26 +00:00
Vadim Yanitskiy df1affded8 vty: use 'const' for *nsvc in config_write_bts_gprs()
Change-Id: I869944cc692c7954b2862ecff32c6034d20babef
2021-01-14 12:29:26 +00:00
Neels Hofmeyr 8e830dd136 hodec2: to balance congestion, use overload percent
For balancing load across congested cells and across congested TCH/*
kinds, instead of comparing the number of lchans above the configured
congestion threshold, compare the percent of lchans of overload.

In short, using a percentage prevents cells with less min-free-slots to
fill up 100% while neighbor cells still may have several free lchans
available.

An obvious example of why this is desirable is illustrated by
test_balance_congestion_by_percentage.ho_vty:

Cell A has min-free-slots 2, and has all slots occupied.
Cell B has min-free-slots 4, and has 2 slots remaining free.

If we count congested lchans as in current master: cell A has a
congestion count of 2: two more lchans in use than "allowed". If we move
one lchan over to cell B, it ends up with a congestion count of 3, which
is worse than 2. So when counting lchans, we decide that cell A should
remain full.

Instead, when comparing percentage of remaining lchans, we would see
that cell A is loaded 100% above congestion (2 of 2 remaining lchans in
use), but when moving one lchan to cell B, that would only be 75% loaded
above its treshold (3 of 4 remaining lchans in use). So a percentage
comparison would cause a handover to cell B.

Related: SYS#5259
Change-Id: I55234c6c99eb02ceee52be0d7388bea14304930f
2021-01-14 06:24:57 +00:00
Pau Espin Pedrol 55a015dddf Introduce Neighbor Resolution Service
This new CTRL interface allows users of this BSC (such as attached PCU)
to gather neighbor information.

This interface is needed for PCU to translate ARFCN+BSIC keys provided
by MS in the Um side into CGI + RAC keys used to identify target cells
in RIM procedures against SGSNs on the Gb interface.

This patch extends the already existing neighbor information storage in
the VTY by allowing storage of CGI + RAC (RAC couldn't be stored
beforehand).

Related: SYS#4909
Depends: libosmocore.git Change-Id If48f412c32e8e5a3e604a78d12b74787a4786374
Change-Id: Ib07c9d23026332a207d4b7a0f7b4e76c0094e379
2021-01-13 17:14:09 +01:00
Neels Hofmeyr 0096f27b61 hodec2: fix congestion oscillation bug
When evenly distributing congestion across cells, count the number of
occupied lchans surpassing congestion, and not the overall number of
free lchans -- which disregards congestion thresholds.

Fix the bugs shown by
 test_congestion_no_oscillation.ho_vty
 test_balance_congestion_tchf_tchh.ho_vty

This implements a simple calculation for congestion load by counting
lchans in use above congestion. An improvement of this calculation
using percent follows in I55234c6c99eb02ceee52be0d7388bea14304930f.

Related: SYS#5259
Change-Id: Icb373dc6bfc9819446db5e96f71921781fe2026d
2021-01-12 09:36:12 +01:00
Neels Hofmeyr d946e5b280 hodec2: add ho_candidate.{current,target}.free_tch
Store the number of free lchans and the min-free-slots settings in
ho_candidate, instead of figuring those out in various places, to make
it easier to read.

Prepare for upcoming patch which also requires these values to fix a
bug.

Change-Id: Ie6ca5af5e8d0ebb8deaaaa637e2728008ecba517
2021-01-12 08:30:15 +00:00
Neels Hofmeyr 1dc9a7f53d hodec2: reduce check_requirements() args
Instead of passing single args, pass the ho_candidate struct.

No functional change.

Change-Id: I086aef9cc47ad8a5376f18179024c486f6f8b779
2021-01-12 08:30:15 +00:00
Neels Hofmeyr d4f8a8bca1 hodec2: cosmetic: clarify ho_candidate.{current,target}
So far it is often confusing which cell a specific member refers to.
Clarify lchan, bts, ... to current.lchan, target.bts, ...

Also move the rxlev_{current,target} to {current,target}.rxlev.

Eliminate numerous local variables to make it easier to read which side
is being used (e.g. "c->target.bts" instead of just "bts").

No functional change.

Change-Id: I06898eb745a5be548df0b76fa760ce790cfab3ed
2021-01-12 08:30:15 +00:00
Vadim Yanitskiy 0a2541c3c3 power_control: add increase / reduce step size recommendations
Change-Id: I82e762c0c2b5e0dd739850ee494ab0a798e353de
Related: SYS#4918
2021-01-12 08:27:52 +00:00
Neels Hofmeyr 3f1c43e74b hodec2: fix candidate choices in congestion check
Fix flaws in picking a candidate for congestion resolution, shown in
recently added tests.

- For TCH/H->TCH/F upgrading, do not favor moving to a weaker neighbor
  cell.

- When comparing dynamic timeslots on the same cell, favor a dynamic
  timeslot that frees an entire dyn TS even though the target rxlev
  differs.

Do not separate the passes for inter-cell and intra-cell candidates:
before, the inter-cell pass would already pick a candidate and start
handover, even though the subsequent intra-cell pass would have revealed
a better candidate. Join the intra-cell considerations into
pick_better_lchan_to_move().

The intra-cell pass was separate, because it would find the *weakest*
current rxlev, to give a TCH/H to TCH/F upgrade to the currently weakest
lchan.

Instead of the separate pass for weakest rxlev, in addition to the
target cell's rxlev, also consider the rxlev *change* in
pick_better_lchan_to_move(): For candidates that do not change the rxlev
(usually those that stay in the same cell) and that upgrade to TCH/F,
favor a candidate with weaker current rxlev.

Completely revisit the conditions in pick_better_lchan_to_move() to
yield the desired prioritization of candidate preferences.

In three handover tests, remove the "FAIL" comments and adjust to now
expect the actually desired behavior.

Related: SYS#5032
Change-Id: I2704899c85c35dfd4eba43468452483f40016ca2
2021-01-11 14:35:34 +00:00
Neels Hofmeyr 305f21f9dc hodec2: cosmetic: clarify afs_bias, simplify pick_better_lchan_to_move()
Instead of passing the TCH/H -> TCH/F bias (AFS bias) in local
variables, rather store it in the ho_candidate struct next to the other
rxlev related values.

Add the AFS bias to the compared rxlev in pick_better_lchan_to_move().

Modify pick_better_lchan_to_move() to simpler semantics of returning
either a or b.

No functional change.

Change-Id: I73860abdf2a77270ca4851ad58c09767d1bb08f1
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 0c01ab6cbb hodec2: clarify current and target rxlev per candidate
Store the rxlev of the current lchan and the target BTS in the
ho_candidate, to clarify the code.

No functional change, cosmetically prepare for
I2704899c85c35dfd4eba43468452483f40016ca2.

Change-Id: Ie6c165e17bb3c99eebc967a6bb02529db8bdfc98
2021-01-05 23:27:26 +01:00
Neels Hofmeyr d15d672427 hodec2: code dup / cosmetics
In handover_decision_2.c, instead of repeating a similar loop four
times, put that loop in a function and parameterize it.

Prepare for a fix of two problems in handover decision 2, see
I2704899c85c35dfd4eba43468452483f40016ca2.

Change-Id: I7c32d08e490a88a7f044b0a71dc4b07d748dd572
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 23da99ddda hodec2: cosmetic: add dBm unit to rxval logging
Change-Id: I58a5ae721b674576339360b1f03e91b015a1bf46
2021-01-05 23:27:26 +01:00
Vadim Yanitskiy c137152947 ericsson_rbs2000: fix unreachable code in inp_sig_cb()
Change-Id: I20674945ddb80ceb1a1917e1be8572595764b370
Fixes: CID#215885
2021-01-05 12:20:13 +01:00
Harald Welte 71a21477fd smscb: Fix adding of SMSCB messages when no message with lower period exists
Adding SMSCB messages to a BTS so far only worked if there were
existing messages with a lower scheduling period than the new message.

Before this patch, it fails for new messages if they are of equal or
lower scheduling period than the existing messages.

Change-Id: I69a05b22200b3a1ee406b0673553e135603d723b
2021-01-04 21:48:03 +00:00
Vadim Yanitskiy a95a1e6783 vty: fix wrong attributes for UL/DL ACCH repetition commands
None of those commands apply immediately, they only affect newly
established logical channels.  The reason is that the related
IEs are only getting sent on channel activation / assignment.

Change-Id: I06c7851115fb31d1eb92c400d9724f4f051bd171
Related: SYS#5114
2021-01-04 11:53:13 +01:00
Vadim Yanitskiy e9bf271806 vty: join UL/DL SACCH repetition commands together
Both commands are basically doing the same thing, so we can merge
them into a single command by adding a parameter to the command
string.  The VTY syntax remains the same:

  do-something foo
  do-something bar

becomes:

  do-something (foo|bar)

This change reduces code duplication.

Change-Id: Ibe98718d8f4933926eed0e622109c9c82537f526
Related: SYS#5114
2021-01-04 11:48:04 +01:00