Commit Graph

29 Commits

Author SHA1 Message Date
Harald Welte 96263aa908 oc2g: Fix 'unused variable' compiler warning
oml.c: In function ‘bts_model_opstart’:
oml.c:1883:32: warning: variable ‘ts’ set but not used [-Wunused-but-set-variable]
 1883 |         struct gsm_bts_trx_ts *ts;
      |                                ^~

Change-Id: Ifd5552f2dd56f4f9bf4c17d25b741f694f4f2168
2023-03-29 12:02:10 +00:00
Harald Welte 362f2e50c2 lc15/oc2g: remove unused variables
oml.c: In function ‘l1if_rsl_chan_mod’:
oml.c:1980:22: error: unused variable ‘i’ [-Werror=unused-variable]
 1980 |         unsigned int i;
      |                      ^
oml.c:1979:35: error: unused variable ‘s4l’ [-Werror=unused-variable]
 1979 |         const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type];
      |                                   ^~~

oml.c: In function ‘l1if_rsl_chan_mod’:
oml.c:1985:22: warning: unused variable ‘i’ [-Wunused-variable]
 1985 |         unsigned int i;
      |                      ^
oml.c:1984:35: warning: unused variable ‘s4l’ [-Wunused-variable]
 1984 |         const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type];
      |                                   ^~~

Change-Id: Ieb8882bbade7f6d6628c9c00150bcf54e3a9dc75
2023-03-29 12:02:10 +00:00
Harald Welte 80c605dd0b cosmetic: use __func__ instead of __FUNCTION__
Our linter would complain about this these days:

	__func__ should be used instead of gcc specific __FUNCTION__

Change-Id: I80bf6d0a89ce6454ae063759d6088a28b04670c0
2023-03-29 12:02:10 +00:00
Harald Welte ac23ce2e03 bts-{sysmo,oc2g,lc15}: Dump logical channel params during MPH-ACTIVATE.req
So far we only printed it during later modification.  Let's print
it also during initial activation of a logical channel.

Change-Id: I6982a52905e4719e2e9c40630252ffef2ff9fbed
2023-03-28 15:13:34 +02: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 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 dd3b7d469e [VAMOS] common/oml: generalize checking BTS_FEAT_MULTI_TSC
Change-Id: Iaa5aced70e166963106c27ebdb09adaae22daea4
Related: SYS#4895, OS#4941
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy d4abdd80fe [VAMOS] gsm_data.h: introduce and use BTS_TSC macro
Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e
Related: SYS#5315, OS#4940
2021-05-23 10:09:27 +00:00
Vadim Yanitskiy 0b33ab8ac2 lchan2lch_par(): fix missing default branch in switch
New channel mode values have recently been added with change [1]
to 'enum gsm48_chan_mode'.  The lack of default branch in
lchan2lch_par() caused build failures on Jenkins:

  oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V2_VAMOS’
                      not handled in switch [-Werror=switch]
  oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V3_VAMOS’
                      not handled in switch [-Werror=switch]
  oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V5_VAMOS’
                      not handled in switch [-Werror=switch]

This function is duplicated in osmo-bts-{lc15,oc2g,octphy,sysmo},
so we unfortunately need to apply the same fix to all copy-pasted files.

Change-Id: I557ff8cac6564d22485c101fba9212f5f0e95bb7
Related: [1] Ie0ea592da5610ae70290106d004e549cf3212a89
2021-04-20 22:50:14 +02:00
Vadim Yanitskiy e8f857453d power_control: migrate MS/BS control loops to the new params
In change [1] the new power control structures and default params
were introduced.  In change [2], the existing VTY commands for MS
power control in the BTS were deprecated and changed to use the
new structures as storage.  Finally, in change [3], handling of
the power control parameters on the A-bis/RSL was implemented.

This change is the final logical step in the mentioned chain: it
makes both MS/BS power control loops use the new parameters, and
removes the old structures.  The actual implementation of both
power control loops remains the same, however the expected output
of some unit tests for the Downlink loop needs to be changed:

  - TC_fixed_mode: disabling dynamic power control becomes a separate
    step of the test script since the field 'fixed' is removed;

  - TC_rxlev_target: RxLev thresholds are printed 'as-is'.

Not all of the new parameters are used by the power control loops
yet.  Further improvements to be done in the follow up commits.

[1] I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8
[2] Icbd9a7d31ce6723294130a31a179a002fccb4612
[3] I5a901eca5a78a0335a6954064e602e65cda85390

Change-Id: Ib18f84c40227841d95a36063a6789bf63054fc2e
Related: SYS#4918
2021-01-08 02:05:27 +01:00
Vadim Yanitskiy 237ec6194b power_control: clarify units in 'struct bts_power_ctrl_params'
Change-Id: Icb059ca1f555397be116a424800e4536883b9106
Related: SYS#4918
2020-12-06 18:59:05 +01:00
Vadim Yanitskiy af4eec056e struct gsm_bts: move ul_power_{target,hysteresis} to ul_power_ctrl
Change-Id: I3886c7aedf3870536f1750f864cf698302ddf2df
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Neels Hofmeyr def24f0d9a part 5 of: fix SAPIs for handover, osmo-bts-oc2g
Change-Id: I2f1fd6e4620eec198912148cdc59fb4f02786c4d
2020-11-26 09:22:38 +00:00
Neels Hofmeyr da680071a6 rename to release_sapi_ul_rach(), simplify
The sapis_for_ho have only one member, so it's silly to iterate. A
subsequent commit will drop sapis_for_ho.

Change-Id: I896fbca9876fd274ff9c426250b18b50faebfa89
2020-11-26 09:22:38 +00:00
Pau Espin 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 c14f1641c6 Constify the 'trx' argument of trx_get_hlayer1() everywhere
Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
2020-08-03 02:08:14 +07: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 f5e22703e7 power_ramp: Add support to get callback when ramping process completes
It will be used in forthcoming commits to feed FSM events once the
ramping process completes.

Change-Id: I778dc215cf6055b93658670cc12e78ad2e51f85e
2020-06-18 19:11:55 +02:00
Martin Hauke b378fccef1 Fix common misspellings and typos
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-17 08:05:35 +00:00
Pau Espin 3713b59368 oc2g: Fix compilation error (comment mark inside comment)
Change-Id: Ib27b31825744ea397b5b4eb258da78f5f834895c
2019-02-19 23:21:07 +01: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
Vadim Yanitskiy 70eb683622 Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()
Change-Id: I45aae70f4bc3f4f85d267dafb757debdef1bb7d7
2018-11-22 15:30:46 +07:00
Omar Ramadan 9c75c387c0 Add OC-2G BTS sources
Change-Id: I327384fe5ac944dc3996a3f00932d6f1a10d5a35
2018-10-27 11:35:58 +00:00