Commit Graph

149 Commits

Author SHA1 Message Date
Andreas Eversberg d88cc624ed ASCI: Add control of uplink access to osmo-bts-trx
An MPH-INFO message is used to turn detection of uplink access bursts on
or off. This is required for voice group/broadcast channels.

Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: I9045437d52984b7abe00fbc815d7f83c62c0fb5a
2023-10-27 10:35:21 +00:00
Pau Espin 1d53d231da bts-trx: Fix CCCH not enabled if BS_AG_BLKS_RES!=1 is provided by BSC
Other bts models like sysmo,lc15,oc2g properly handled
rel_act_kind=LCHAN_REL_ACT_REACT under the bts_model_lchan_deactivate()
implementation, but bts-trx didn't.

As a result, when BCCH_INFO(SYSINFO_TYPE_3) coming from BSC (RSL)
containing a different BS_AG_BLKS_RES triggers CCCH re-activation,
it would only deactivate it but not re-activate it.
That means no SIs were being scheduled if bts was configured with
"channel-descrption bs-ag-blks-res 2" in osmo-bsc.cfg, and phones would
not see the cell.

Related: OS#1575
Change-Id: I61e1681fbaa2c993b529d58b581c99166b62bda3
2023-09-07 18:15:03 +02:00
Andreas Eversberg 97d3bd3e62 ASCI: Enable UPLINK ACCESS on various BTS models
UPLINK ACCESS (RACH on TCH) was enabled for osmo-bts-sysmo only. Now it
is also enabled for:
* osmo-bts-lc15
* osmo-bts-oc2g
* osmo-bts-trx
* osmo-bts-virtual

Change-Id: Iae0db6bfcf6629c114436a79648e832c82835abe
2023-07-21 13:20:13 +02:00
Mychaela N. Falconia 676e9e5804 ECU in UL path: move state alloc/free to l1sap
In preparation for moving the now-optional application of ECU in UL
path from osmo-bts-trx model-specific code to the common layer,
move ECU state allocation and freeing from trx model to l1sap.

Related: OS#6040
Change-Id: Ic98a2eb26b5a99bc4a89ad07ae87c9a86b921418
2023-06-28 16:29:00 +00:00
Mychaela N. Falconia f0f91fc66c ECU in UL path: make it optional per vty config
Current osmo-bts-trx includes a provision for invoking ECUs from
libosmocodec in the UL path from the channel decoder to the RTP
output.  This pre-existing implementation is counter to the spirit
of 3GPP specs (a BTS should merely mark BFI conditions in its UL
output, as opposed to actively modifying the frame stream with an ECU),
inconsistent between different osmo-bts models (only in -trx and no
others), and inconsistent even within osmo-bts-trx itself, where
the link quality check in l1sap will sometimes suppress the output
of the ECU - a quirk which the designers of the current mechanism
most certainly did not intend.

The solution decided upon in OsmoDevCall on 2023-06-21 is to make
this ECU optional per vty config, and move it from the trx model
to the common layer to resolve the inconsistencies.  Implement the
first part: make the ECU application optional per vty config.

For backward compatibility with existing deployments, the new
"rtp internal-uplink-ecu" setting is enabled by default on osmo-bts-trx
but not on any other models.

Related: OS#6040
Change-Id: I0acca9c6d7da966a623287563e0789db9e0fae8e
2023-06-28 16:29:00 +00:00
Pau Espin 66543fe422 Introduce NM FSM for GPRS NSVC object
Change-Id: I684482064136a461d01cace3cd37afc8b68458cc
Related: OS#5994
2023-04-11 08:11:43 +00:00
Pau Espin d50d239914 Introduce NM FSM for GPRS Cell object
Change-Id: I5fd1d17da09a5f0eee3d69fcb4788c106a240e21
Related: OS#5994
2023-04-06 10:28:22 +00:00
Pau Espin 633bbf174a Introduce NM FSM for GPRS NSE object
Related: OS#5994
Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea
2023-04-06 10:28:22 +00:00
Pau Espin 92d1d1582b Simplify implementation of bts_model_opstart() in all bts types
Use mo->fi directly to avoid repeating code paths for each obj_class.

Change-Id: I54632201afe87eb3e02bc75cbade163917239ab6
2023-04-06 10:28:22 +00:00
Pau Espin 91a1295a5a bts_model_apply_oml(): Improve definition of parameter
The param is usually called obj_class, but here it is called kind.
In any case, change the param to pass the related struct gsm_abis_mo
(which still contains mo->obj_class), similar to what's done in other
bts_model functions such as bts_model_opstart().

Change-Id: Ife2e98a791455d5f7e7052356d559af2f1d4d185
2023-04-06 10:28:22 +00:00
Pau Espin 8894fe6f4c oml: Get rid of unused tlv_parsed param in bts_model_apply_oml()
This way we simplify the common lower level interface. It can be added
in the future again if it is really required at any point to pass/use
specific TLV values in the device-specific code.

Change-Id: I64c6c6834e277b1d75a97d6f408e7e1b7ca85832
2023-04-06 10:28:22 +00:00
Pau Espin aebd2a21b5 nm: Drop NM_EV_SETATTR_{ACK/NACK}
Simply return error codes from lower layer implementations, and do
the OML handling in the common NM TS 12.21 FSMs.

As a result, we simplify the logic in the lower layers.

Change-Id: I281c07bb5ad88ee03542f092141cebe036d10aee
2023-04-06 10:28:22 +00:00
Pau Espin c4a17d35ec nm: Apply BTS/TRX/TS OML Attributes through NM FSMs
This way we have further control on how to handle the SetAttr meessages
received. For instance, NACK them if the NM object FSMs are not at the expected
correct state.

The originating msgs are now kept owned and freed by the OML layer
(oml.c), and the NM FSMs only uses them and create new OML msgb when
answering with ACK/NACK.

Related: OS#5992
Change-Id: Id68868e25bbf96227ab6459fcd3c9181852ed28e
2023-04-05 13:21:14 +02:00
Pau Espin 7a646f963b bts_model_apply_oml(): Drop unneded code
Calls to bts_model_apply_oml() are done only for BTS, RCARRIER and
RCHANNEL NM Objects in their respective Rx code paths (and they will
be moved to respective FSMs in follow up patches). This function is
never called with any of the GPRS NM objects.

These NM Objectes have the NM_MT_IPACC_SET_ATTR msg ACKED/NACKED in its
own path:
oml_ipa_set_attr()
	rc = oml_ipa_mo_set_attr()
	return oml_fom_ack_nack(msg, rc);

Change-Id: I1a0d38a122f50ffe749ebc4f1cc11235ca516586
2023-04-04 20:26:23 +02:00
Pau Espin 0350824203 bts-trx: Drop unused param to internal function
Change-Id: Id7ad7629ec13bcec618055c41083cdac0a3102be
2023-04-04 12:50:19 +02:00
Vadim Yanitskiy 8e04613e4f osmo-bts-trx: properly activate [CBCH/]BCCH/CCCH
The timeslot carrying BCCH/CCCH on C0 is a bit special in a way that
it's being activated implicitly - there is no explicit RSL CHANnel
ACTIVation for that.  This is why we have TRX_CHAN_FLAG_AUTO_ACTIVE,
which marks sub-channels of BCCH/CCCH in the trx_chan_desc[].

The upcoming patch changes the burst buffer allocation strategy, so
that the memory is allocated on channel activation and then free()d
on channel release.  This patch facilitates that by making the
activation/deactivation logic consistent for all sub-channels.

Change-Id: Id0c70d6a2b777a5117c85149bfa1b3a997299d1d
Related: OS#1572
2023-03-22 12:14:25 +00:00
Vadim Yanitskiy fa109255ac osmo-bts-{trx,virtual}: set rc on error in bts_model_l1sap_down()
Change-Id: If3016bae9d03a9972c04b748fc9efab56a412e0e
Related: OS#1572
2023-03-07 09:43:21 +00:00
Vadim Yanitskiy 69bca44a84 osmo-bts-{trx,virtual}: check lchan against NULL in bts_model_l1sap_down()
Even though it's unlikely, get_lchan_by_chan_nr() *may* return NULL.

Change-Id: I1a815c9675eebc16640b62308499dd784fc206bd
Related: OS#1572
2023-03-07 09:43:21 +00:00
Vadim Yanitskiy 54840a203b osmo-bts-{trx,virtual}: clean up bts_model_l1sap_down()
Having a common body for PRIM_INFO_{ACTIVATE,DEACTIVATE,MODIFY},
but then branching using if-statements is a bit confusing.

Change-Id: I915c8a541249249e3c0b1f2eda4535e7c52db79f
Related: OS#1572
2023-03-07 09:43:21 +00:00
Daniel Willmann 63baf960c6 shutdown_fsm: Add power_ramp_force() to jump straight to the tgt power
Both power_ramp_start() and power_ramp_force() are now small macros
around _power_ramp_start()

The new behavior is:
* ramp down power when stopping bts through Ctrl-C
* the other shutdown causes skip power ramping

This will cause the bts to reconnect faster when the oml link is
dropped and power ramping is enabled.

Change-Id: Ida1d7bbf094958b9142af306dbf84206729a609e
Related: SYS#6237
2022-12-21 23:51:51 +00:00
Daniel Willmann 300b72b44c Revert "shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C"
This reverts commit c96d34f828.

Reason for revert: This breaks ramping up power since the power ramp logic still assumes the output is full power.

Change-Id: I47a16a4b3ba02d74473569c0f4350a41fc12a464
2022-12-17 13:21:17 +00:00
Daniel Willmann c96d34f828 shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C
For the other shutdown causes power ramping doesn't make sense. Instead
shutdown quickly so we can reconnect faster

Change-Id: I71c46478b8f3b236dba3e959fc75e58c0409517f
Related: SYS#6237
2022-12-15 11:26:22 +01:00
Vadim Yanitskiy 52da5b6f64 osmo-bts-trx: fix handling of ciphering params in PRIM_INFO_MODIFY
The PRIM_INFO_MODIFY is sent on receipt of the RSL MODE MODIFY message,
which may optionally contain new ciphering parameters.  Before this
patch, osmo-bts-trx would ignore the new parameters and continue using
the old ciphering key/algorithm.

* Modify l1if_set_ciphering() to allow updating ciphering params.
* Call l1if_set_ciphering() when handling PRIM_INFO_MODIFY.

This problem was uncovered by BTS_Tests.TC_rsl_modify_encr, which has
been failing ever since it was introduced [1].  This patch makes it pass.

Change-Id: I2278703b487374c0de4cfc42b22e70aaf6548589
Related: [1] I4cbea499bb6a331d314e6573548a4540945208b5 osmo-ttcn3-hacks.git
Related: OS#3750
2022-08-27 18:56:33 +07:00
Vadim Yanitskiy fe21e88630 struct amr_multirate_conf: remove ms_mode[], raname bts_mode[]
Looks like this structure was copied from openbsc/osmo-bsc as-is.
The ms_mode[] makes no sense in the context of BTS, so remove it
and rename bts_mode[] to mode[] for the sake of brevity.

Change-Id: I7442360ed857554440a0b9854f2d2bbab9dc5a71
Related: SYS#5917, OS#4984
2022-04-17 13:14:59 +00:00
Pau Espin d3e730c61d Move lchan_init_lapdm inside lchan_set_state(LCHAN_S_ACTIVE)
osmo-bts-trx/l1_if.c lchan_init_lapdm() for CCCH is already done when
trx_set_ts_as_pchan() calls:
"lchan_set_state(&ts->lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);"

Change-Id: I7a9c3660b9aab57ff8765e2f1526349599630cd9
2021-10-14 17:48:31 +02:00
Pau Espin 66f5fb0577 bts-trx: Keep the process ongoing trying to reconnect on Abis link down
Change-Id: I28cb36a43b44865caa409b3255c05963acc74848
2021-10-03 20:02:57 +00:00
Vadim Yanitskiy 7b80dde7b5 osmo-bts-trx: bts_model_l1sap_down(): remove chan_nr patching
Thanks to [1], there is no need to patch chan_nr for PDCH anymore.
The upper layers are now expected to use the correct values.

[1] I01680140c7201bf5284b278bceaea8ae01c122b2

Change-Id: I26eb2081eddb4ce900a7867897bc69c3f77dbd73
Related: OS#5238
2021-09-26 13:23:41 +06:00
Pau Espin 9a3a5cbc9c Revert "bts-trx: Keep the process ongoing trying to reconnect on Abis link down"
This reverts commit 0c44a92197.

Change-Id: Ib367d5ddfaccfad3f1b6acc53abf25a0f1834255
2021-09-23 22:23:47 +02:00
Pau Espin 0c44a92197 bts-trx: Keep the process ongoing trying to reconnect on Abis link down
Change-Id: If24c7d8d58875dd8baf4031a8fc2a8656702a2b5
2021-09-23 14:07:53 +02:00
Pau Espin ce9ec4963c bts-trx: Submit TRX SW_ACT when PHY becomes connected
Once the TRXC link is available, we can signal SW_ACT which will
transit rcarrier and bbtransc NM FSMs to Disabled Offline and announce
availability to be configured to the BSC through transmission of
Software Activated Report.

Change-Id: I6e62ec2fdd4cae58b52d83fa851552f7ed51c821
2021-09-23 11:09:15 +00:00
Pau Espin ddd357f3e3 bts-trx: Avoid race condition configuring TS-specific TSC values
In OML, if Set Attributes comes first for Channel object and then for
BTS object, BSIC will still not be set. Hence, when applying Channel
(TS) specific TSC, the code would compare against an unset value,
enabling use of TRXC extensions (which osmo-trx doesn't support)
without need for it, since actually the TSC of the TS matches the BSIC
of the BTS once both are set.

In order to fix it, don't check for the BSIC when receiving the OML
messages, but rather later when we apply the settings to the the lower
layers once trx_provision_fsm allows for it.

Fixes: 3c1151f945
Change-Id: I49fc7e35acb44ecc4f37ae71acd4c684248548e7
2021-09-23 11:09:15 +00:00
Pau Espin 137166fd5f bts-trx: Get rid of check_transceiver_availability_trx()
Get rid of this helper function, which is a remain of past epochs
(pre-FSM). In the current uses, there's only 2 real cases: the "if" path
upon SET BTS ATTR received (and even that one should be moved as per
what the code comment states), and the one happening when the TRX is
closed.

it really makes no sense to DISABLE the TRX as a result of SET BTS ATTR.

Change-Id: I48adfeecd722684152c589bcba827079b0a78c3a
2021-09-23 10:00:24 +00:00
Pau Espin 7c466d8cc7 bts-trx: Submit TRX_PROV_EV_CFG_ARFCN for C0 during SetBtsAttr
In oml_rx_set_bts_attr, arfcn for C0 is assigned from NM_ATT_BCCH_ARFCN.
The rest of the TRX get their arfcn from oml_rx_set_radio_attr()
NM_ATT_ARFCN_LIST.

Change-Id: I8aa9652622107fe0a707b2cbcbe8be6c71e19087
2021-09-23 10:00:24 +00:00
Pau Espin 68a39a8617 nm_*fsm: Make FSMs aware of object being properly configured or not
This will allow in the future advertising children objects that the
parent object has been configured. It is useful for instance to let TRX
know that the BTS is configured.

Change-Id: Ie319465fd0e991bab8451ea34ec72ff3702533d2
2021-09-22 12:56:58 +02:00
Pau Espin ea53ad454e Allow setting administrative state through oml_mo_state_chg()
This way it can be changed together with operative/availability state,
and changes announced to the BSC if present.

This commit presents no real change in osmo-bts behavior, since the only
place where adm_state is passed different than -1 is in
st_op_disabled_notinstalled_on_enter(), which is actually never called
(yet) since it's the initial state and no other states transition later
to it.

However, this will change in the future once we support re-connecting to
a (possibly different) BSC, which means objects will need to be moved to
that state to restart the whole OML install procedure on the new BSC.

Change-Id: Ifdc6a1dfb673c0ab915ddf2a9d372928f4f86b4c
2021-09-20 12:22:53 +02:00
Pau Espin a4b9073989 Rename osmo dyn ts enums to contain SDCCH8
They will gain support to be activated as SDCCH/8 soon too.

Related: SYS#5309
Depends: libosmocore.git I56dcfe4d17899630b17f80145c3ced72f1e91e68
Change-Id: Ia617d20fc52f09dbab8f4516c06fa1efac08e898
2021-07-05 08:03:08 +00:00
Vadim Yanitskiy 3c1151f945 [VAMOS] osmo-bts-trx: properly handle per-timeslot TSC values
Each timeslot can have its own Training Sequence Code value, which
may optionally be included in the NM_MT_SET_CHAN_ATTR message sent
over the A-bis/OML.  If it's not present, then the TSC value for a
timeslot is derived from the BCC part of BSIC, which is always
included in the NM_MT_SET_BTS_ATTR message.

On the TRXC interface, the BTS global TSC value is indicated to the
transceiver using either of the 'SETTSC' or 'SETBSIC' commands.
The transceiver then applies this value for all timeslots by default,
however it can be redefined for each timeslot individually using
additional arguments of the 'SETSLOT' command (see section 25.2.4.1
in the user manual [1] for more details).

Currently, trx_set_ts_as_pchan() sends TRX_PROV_EV_CFG_TSC to the
transceiver provisioning FSM, together with the per-timeslot TSC
value.  This event causes the FSM to modify the global TSC value,
that is going to be or has already been sent to the transceiver.
This is wrong, the global TSC value shall not be overwritten.

Remove the TRX_PROV_EV_CFG_TSC, and include per-timeslot Training
Sequence Code and Set in the data structure that gets passed together
with the TRX_PROV_EV_CFG_TS instead.  Implement handling of the
optional per-timeslot TSC in trx_if_cmd_setslot().

[1] https://downloads.osmocom.org/docs/latest/osmobts-usermanual.pdf

Change-Id: Idc5796151e3e83f42d60c2d4cb7c35890d76a7f5
Related: SYS#4895, OS#4941
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy 462bf0952a [VAMOS] Re-organize osmo-bts-trx specific structures
Together with the 'generic' structures which used to be shared between
osmo-bsc and osmo-bts some time ago, we also have the following
osmo-bts-trx specific structures (in hierarchical order):

  - struct l1sched_trx (struct gsm_bts_trx),
  - struct l1sched_ts (struct gsm_bts_trx_ts),
  - struct l1sched_chan_state (struct gsm_lchan).

These structures are not integrated into the tree of the generic
structures, but maintained in a _separate tree_ instead.  Until
recently, only the 'l1sched_trx' had a pointer to generic
'gsm_bts_trx', so in order to find the corresponding 'gsm_lchan' for
'l1sched_chan_state' one would need to traverse all the way up to
'l1sched_trx' and then tracerse another three backwards.

                                 + gsm_network
                                 |
                                 --+ gsm_bts (0..255)
                                   |
  --+ l1sched_trx --------------------> gsm_bts_trx (0..255)
    |                                |
    --+ l1sched_trx_ts               --+ gsm_bts_trx_ts (8)
      |                                |
      --+ l1sched_chan_state           --+ gsm_lchan (up to 8)

I find this architecture a bit over-complicated, especially given
that 'l1sched_trx' is kind of a dummy node containing nothing else
than a pointer to 'gsm_bts_trx' and the list of 'l1sched_trx_ts'.

In this path I slightly change the architecture as follows:

                                 + gsm_network
                                 |
                                 --+ gsm_bts (0..255)
                                   |
                                   --+ gsm_bts_trx (0..255)
                                     |
    --+ l1sched_trx_ts <----------------> gsm_bts_trx_ts (8)
      |                                |
      --+ l1sched_chan_state           --+ gsm_lchan (up to 8)

Note that unfortunately we cannot 1:1 map 'l1sched_chan_state' to
'gsm_lchan' (like we do for 'l1sched_trx_ts' and 'gsm_bts_trx_ts')
because there is no direct mapping.  The former is a higl-level
representation of a logical channel, while the later represents
one specific logical channel type like FCCH, SDCCH/0 or SACCH/0.

osmo-bts-virtual re-uses the osmo-bts-trx hierarchy, so it's also
affected by this change.

Change-Id: I7c4379e43a25e9d858d582a99bf6c4b65c9af481
2021-05-18 19:11:06 +00: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
Pau Espin 666adf6a97 Improve logging around failing to (de)activate chan_nr
Change-Id: Ibc398eb5d50851cbe48f2c92f14e746938a68720
2020-09-16 19:28:38 +02:00
Pau Espin c84b007efb bts-trx: Ensure RFMUTE state is set properly at startup
In general, it is always set to 1 (Locked) in
st_open_poweroff_on_enter() right after initial POWEROFF, and once the
BSC unlocks it (based on VTY cfg "rf_locked (0|1)") by sending an OML
message, the bts_model_chg_adm_state() call will update it sending
RFMUTE.

This basically fixes the case where osmo-bsc.cfg is configured with
"rf_locked 1" to start with a TRX locked until manually unlocked.

Related: SYS#4920
Change-Id: I96b64cdc901d6f216df628d7be57a67af4a21e25
2020-09-07 08:08:09 +00:00
Pau Espin af4015cb91 bts-trx: Use TRXC RFMUTE instead of resetting the scheduler
Since commit 221ee92551,
bts_model_trx_deact_rf() was being called when RF locking the TRX, which
was implemented by resetting the scheduler. This proved to be a messy
and wrong way to emulate disabling RF, since it modifies tate on lots of
structures from which it is later difficult to recover from, causing
bugs and issues like:
82a35a1dbf
be15a12c87
eef420d1ca
https://osmocom.org/issues/4694
https://osmocom.org/issues/4695
https://osmocom.org/issues/4696
https://osmocom.org/issues/4697

So for all these reasons, it is believed a good solution to avoid
resetting the scheduler and simply ask lower layers (osmo-trx) to take
care of disabling RF TX/RX on a given TRX. For TRX implementations not
supporting the newly added RFMUTE command, ramping down to -10dBm still
provides for a way to emulate RF locking. In any case, none of this was
supported until recently so it's not like we are breaking some feature
here.

Related: SYS#4920
Change-Id: I1423ddb390ef327ec7d4a27de2ac5dca663773a5
2020-09-07 08:08:09 +00:00
Vadim Yanitskiy 5a2262da64 osmo-bts-trx: fix trx_init(): do not send OPSTART ACK blindly
It was reported that both osmo-bsc and osmo-bts-trx may end up
running in a half-broken state, when everything looks good and
the UEs can see the network, but all channel requests get
rejected due to "trx not usable" error:

  lchan_select.c:173 (bts=0) lchan_select_by_type(SDCCH)
  lchan_select.c:48 looking for lchan CCCH+SDCCH4: (bts=0,trx=0) trx not usable
  lchan_select.c:48 looking for lchan SDCCH8: (bts=0,trx=0) trx not usable
  lchan_select.c:239 (bts=0) Failed to select SDCCH channel

  lchan_select.c:173 (bts=0) lchan_select_by_type(TCH_H)
  lchan_select.c:48 looking for lchan TCH/H: (bts=0,trx=0) trx not usable
  lchan_select.c:239 (bts=0) Failed to select TCH_H channel

  lchan_select.c:173 (bts=0) lchan_select_by_type(TCH_F)
  lchan_select.c:48 looking for lchan TCH/F: (bts=0,trx=0) trx not usable
  lchan_select.c:239 (bts=0) Failed to select TCH_F channel

As was then figured out, this happens because the Radio Carrier
MO (Managed Object) remains Disabled even after the BSC has
sent OPSTART and the BTS ACKed it:

  oml.c:986 OC=RADIO-CARRIER(02) INST=(00,00,ff): Rx OPSTART
  l1_if.c:614 Rx OPSTART for RADIO-CARRIER MO
  l1_if.c:201 TRX_PROV(phy0-0)[0x1238c0]{OPEN_POWERON}:
              Event TRX_PROV_EV_CFG_ENABLE not permitted
  oml.c:144 OC=RADIO-CARRIER(02) INST=(00,00,ff): Tx Opstart Ack

It remains a mistery why the TRX_PROV FSM is already in state
OPEN_POWERON, while it's expected to be in state OPEN_POWEROFF,
but we definitely should not ACKnowledge the OPSTART if this
happens.  Send a NACK instead with cause NM_NACK_CANT_PERFORM.

Change-Id: I8727460acbf850b84df67a9cbdc25b47dee1fadd
Related: SYS#5063
2020-09-05 20:03:46 +07:00
Vadim Yanitskiy 6f4db8c620 osmo-bts-trx/l1_if: drop redundant logging message
We already get quite informative message originated from oml.c:

  OC=RADIO-CARRIER(02) INST=(00,00,ff): Rx OPSTART

Change-Id: I3d4a4473541327488d3393b1fa7c6391afb3728a
2020-09-05 20:02:14 +07:00
Pau Espin eef420d1ca bts-trx: Fix assert hit when rf_locked in .cfg and TS TCH/F_PDCH
If TRX is administratively locked during startup, for TS conigured as
TCH/F_PDCH the BSC will send a ACT PDCH message, but osmo-bts-trx won't
apply it by signalling it as available to the PCU, since the TRX is
locked.
That means the ts->flags contains the pending action to activate
it until it is unlocked. As a result, calling trx_set_ts() on it was
hitting the assert inside which expects not to apply the TS until it has
been confirmed by the PCU.
Let's still skip setting the TS and let pcu_tx_info_ind() trigger the
activation confirmation from PCU, since the TRX has just been unlocked.

Fixes following assert:
Assert failed (ts->flags & TS_F_PDCH_PENDING_MASK) == 0 /osmo-bts/src/osmo-bts-trx/l1_if.c:34

Change-Id: Ie3cad15d31870346d03a6e2f6dd32a9d2dd3067e
2020-07-27 16:58:41 +02:00
Pau Espin be15a12c87 bts-trx: Fix handling ADM state change while previous one WIP
Fix power ramping if administrative state changes while previous
opposite change was already ACKED but power ramping was still ongoing.

With previous code, osmo-bts-trx would have sent a NACK and BSc would
drop the BTs link as a result.

Change-Id: I6c5240710ef6d223651dfb4a8db939b5d2f974ca
2020-07-27 12:40:11 +02:00