Commit Graph

22 Commits

Author SHA1 Message Date
Oliver Smith 8630f898b2 model_init: order features alphabetically, part 2
Order the ones I've overlooked as well.

Related: SYS#5922, OS#5538
Change-Id: I0aa344de9ea4849de0fcd7b44bfaa70274af594b
2022-04-25 11:14:30 +02: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
Vadim Yanitskiy f50b684594 osmo-bts-omldummy: indicate BTS_FEAT_BCCH_POWER_RED as supported
This is required for ttcn3-bsc-test, see change [1].

Change-Id: I765d5e38cb0746e0458773abf3717ee9bf1cb7d1
Related: [1] I084f7736cd7d09b68ed49f8ba52a14de928d4c01
Related: SYS#4919
2021-06-30 23:45:12 +02: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
Vadim Yanitskiy 17de4e708f osmo-bts-omldummy: suppress 'Unimplemented bts_model_trx_deact_rf'
There is no PHY in case of osmo-bts-omldummy, so nothing to deactivate.

Change-Id: I4bae1c7ec677e22175aa5be67b41a357ba3c3cc1
2020-10-03 07:09:33 +00:00
Vadim Yanitskiy 7dd865badd osmo-bts-omldummy: fix: do not crash on OML connection drop/failure
This regression was introduced in 2ff4592ffc.
There is simply no PHY in case of osmo-bts-omldummy.

Change-Id: I864ac3f15e06462d6ce808b3f2188c5c39a5aad2
Fixes: Ic00df9e7278d42bc10c1e1a1c0edde7e13199299
2020-10-03 07:09:33 +00:00
Pau Espin 2ff4592ffc Fix RadioCarrier OML Operative State Change report not sent on some scenarios
Operative state is mainly maintained based on 2 requirements:
* phy_link being in CONNECTED state
* RSL connection being up and ready

However, state change report triggered over OMl towards BSC was only
done upon the first event of the two. That means that if for whatever
reason the RSL connection was established AFTER the phy_link became
CONNECTED (ie receiving RSP POWERON in osmo-bts-trx), then the status
towards the BSC would not be updated and hence the BSC would still see
the Radio Carrier object as DISABLED.

The trx_set_available() function is renamed to trx_operability_update()
to keep the logic conditions in one place, and different events
triggering a change in state simply call the function and let it handle
the new state.

Related: SYS#5063
Change-Id: Ic00df9e7278d42bc10c1e1a1c0edde7e13199299
2020-09-15 14:03:29 +02:00
Vadim Yanitskiy eecb97146e osmo-bts-omldummy: enable BTS_FEAT_{CBCH,HOPPING} support
Otherwise osmo-bts-omldummy would reject OML Set Channel Attributes
containing the hopping parameters.  This change is needed for the
new BSC_Tests.TC_fh_params_* test cases.

Change-Id: I38692252baa7a9fc23078121db0a17557950e4d4
Related: SYS#4868, OS#4545
2020-09-02 16:36:01 +07:00
Vadim Yanitskiy c14f1641c6 Constify the 'trx' argument of trx_get_hlayer1() everywhere
Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
2020-08-03 02:08:14 +07:00
Pau Espin 7a7168f0a8 bts-omldummy: Speed up shutdown (instantaneous ramp)
Change-Id: I4d4e7a5bfb899787605b3b25dcdc9e9470c438d9
2020-06-25 14:19:12 +02:00
Pau Espin 3612920ce7 bts-omldummy: Implement bts_model_trx_close
Change-Id: I13221e5dffe3290fc791f8866f25141fcc0821ff
2020-06-25 14:19:08 +02:00
Pau Espin a08685a576 Fix shutdown in osmo-bts-{omldummy,virtual}
Change-Id: Idadb62ec25181b140d9061dc7470da00d47d8336
2020-06-25 14:12:34 +02:00
Pau Espin 8090df2a81 bts_model: Convert bts_model_trx_close() to return asynchronously
Some backends like osmo-bts-trx require exchanging messages like
POWEROFF to close the TRX, and hence need some time. Switch the function
to expect result asynchronously by calling a callback.

This will be used later to wait until all TRX are really powered off
before exiting the process.

Change-Id: I7d76b600fc06e1114b35bf0c2d08eff5bbd1b69a
2020-06-23 14:53:37 +02:00
Pau Espin cec19e6324 Fix missing bts_model implementations in stubs.c and bts_model.c
These will be required by compiler/linker after next changes.

Change-Id: Icd20d64cf973f4cf4425b46d4102747db53d8990
2020-06-18 19:11:55 +02:00
Pau Espin e3cb8715f5 bts_model: Allow TS connect to be processed asynchronously
This commit doesn't change internal logic of any model, only the API to
be able to return result of connect TS asyncrhonously since some models
(like osmo-bts-trx) require some time to process the result. This way
PDCH ACT/DEACT (N)ACK can be sent once the result of this long process
is known. For instance, nowadays in osmo-bts-trx we PDCH (DE)ACT ACK
before getting the result from SETSLOT on the TRX iface.

With this new API, bts_model_ts_connect doesn't return any value
synchronously. Instead, it is expected to always end up calling
cb_ts_connected with the return code from the TS activation process. 0
is considered a successs, while any other value is considered an error.

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

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

Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
2018-11-18 20:29:40 +00:00
Harald Welte 553535f87b Add 'osmo-bts-omldummy' to bring up only OML without RSL
This is used only in integration testing, where in the TTCN-3 testsuite
we currently have no A-bis OML implementation, but only a RSL one.

Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2018-03-17 15:22:51 +01:00