Commit Graph

2843 Commits

Author SHA1 Message Date
Pau Espin ae606d69a4 Reset CBCH state after BTS shutdown
Related: OS#5273
Change-Id: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
2021-10-20 16:13:03 +02:00
Pau Espin d9079b192b gsm_pchan2chan_nr(): Properly assert if unexpected pchan is passed
A bit of archeology, history & recap:
ec1b5a0e9e2b6549e0ede48e803095e569997355 (openbsc.git) Adds assert in gsm_ts2chan_nr()
2f44693fad8505255293d3ed37dbd4e7cabebd37 (openbsc.git) ASSERT is disabled due to reported hit in octphy and
						       litecell in gerrit for ec1b5a0e9e2b6549e0ede48e803095e569997355
5cef0623ef (osmo-bts,git) minor fixes to gsm_ts2chan_nr() regarding the pragma
c9079d9106 (osmo-bts.git) GSM_PCHAN_NONE case is introduced in gsm_ts2chan_nr()

This code has long evolved and robustness has improved, it's not even
part of openbsc.git for several years now. Let's always assert if we
receive an unexpected value there, since they are all internally handled
values and hence we have control over them.

Related: OS#2906
Change-Id: I25e2cf0c922bc9902336e9add75a47535b9355bf
2021-10-19 12:39:55 +02:00
Pau Espin 3b02b9ad53 bts_shutdown_fsm: Make sure pending power ramping are aborted before closing TRX
It can happen when using several TRX that all of them go alreadyunder
shutdown target tx power level, but that due to configuration the BTS
still may want to keep pushing the tx power level even lower. Hence, we
end up in a situation where the FSM is trying to close all the TRX while the
power ramp procedure is ongoing for some of them. As a result, race
conditions can happen where for instance the power ramping procedure for
one TRX ends and calls the cb to send SETPOWER after the TRX PHY has
been closed (and hence TRXC link is unavaialble).
If that happens, the trx_if lower layers store the SETPOWER and attempt
a later retransmit, which may take up to 2 seconds after TRX becomes
active if BTS reconnects immediatelly.
Hence, we end up in some test cases where BTS reconnects and configures
some TRX while others are kep unconfigured for a while due to the
mentioned delay, hence the test attempting to use the TS while it hasn't
been yet configured.

The solution is to avoid this kind of unexpected events with ongoing
powe ramp once we have decided tx power is lower enough to shutdown the
TRX completely. Hence we abort the pending power ramp procedure.

Change-Id: Ibca581131eb142d7c38c917a0d6990efec03123c
2021-10-18 18:45:37 +02:00
Pau Espin 3cd4745efe lchan: Call lapdm_channel_exit() when state changes to NONE
Fixes crash when TTCN3 BTS_Tests_LAPDm TC_rr_response_frame_loss
runs run after TC_t200_n200.

The BTS was shutdown after TC_t200_n200 failed (drop oml link), and
lchan was moved ACTIVE->NONE without lapdm_channel_exit() being called
on it. Hence, on next test (TC_rr_response_frame_loss), when
lchan_init_lapdm() was called again, some memory corruption was caused.

The lapdm_channel_exit can be dropped from gsm_lchan_release() and
rsl_tx_rf_rel_ack() since it's already called in the same path:
"""
rsl_rx_rf_chan_rel
	gsm_lchan_release(lchan, LCHAN_REL_ACT_RSL);
		l1sap_chan_rel(lchan->ts->trx, gsm_lchan2chan_nr(lchan));
			l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_DEACTIVATE)
				bts_model_l1sap_down
					bts_model_lchan_deactivate_sacch(lchan);
						-
					lchan_deactivate(lchan);
						bts_model_lchan_deactivate
							lchan_set_state(lchan, LCHAN_S_NONE); <---------
					mph_info_chan_confirm(trx, chan_nr, PRIM_INFO_DEACTIVATE, 0);
						l1sap_info_rel_cnf
							rsl_tx_rf_rel_ack(lchan);
								lapdm_channel_exit(&lchan->lapdm_ch);
		lapdm_channel_exit(&lchan->lapdm_ch);
"""

Related: SYS#5262
Change-Id: If0ec5f0c7be4d15c8d684d33e15e24d68bd5192e
2021-10-14 17:59:28 +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 07232521a9 Move lchan_deactivate() to lchan.c
Change-Id: If75ed432fa9dcb10159a0dac9b8ba7efe6958b35
2021-10-14 17:48:31 +02:00
Pau Espin ac81d2789a lchan: Avoid applying transition changes if state new==old
Let's avoid running over state change conditions or even printing log
lines if there's no state change.

Change-Id: I1ca86aa846084f53751076643665cb6dabc26a06
2021-10-14 17:04:24 +02:00
Pau Espin 578b540711 lchan: Update log line level to use macro and level INFO
Change-Id: Idd48fd8fbb13b715096a4765dcb08a18d85098a7
2021-10-14 17:03:45 +02:00
Pau Espin fd051b0f5c Move lchan related code to lchan.{c,h}
Change-Id: I17ebe6af69e31d1b4dbad7656bbf043f4c9243c1
2021-10-14 14:55:35 +02:00
Pau Espin 03cb50f809 lchan: Setup early_rr_ia timer only once during init
There's no need to re-setup it every time.

Mark the cb as static since its private to the module, and move it
above its use point so it can be referenced.

Change-Id: I90324f26d8ca09d425c7523a25b3e6c951fa49d6
2021-10-14 14:41:41 +02:00
Vadim Yanitskiy 72d9981cd0 osmo-bts-trx: refactor 'maxdly' / 'maxdlynb' commands
* Move way too verbose command description to the manuals.
* None of these commands apply immediately, correct the attributes.
** Remove meaningless call to l1if_provision_transceiver_trx().
* Make 'maxdlynb' hidden, so it only appears in the expert mode.
* One GMSK symbol actually corresponds to 550m.

Change-Id: I46839cf56bba2dcdc70303cd393e86d35aa2f3f5
2021-10-13 20:01:08 +00:00
Pau Espin 0e2a20bfb4 bts-trx: Guard call to trx_sched_clean with NULL trx ptr
trx_phy_inst_open() already guards against NULL trx ptr when calling
trx_sched_init(). Later on, in same path, trx_phy_inst_close() can be
called which ends up calling trx_sched_clean(trx), this time not being
guarded against NULL trx. This fixes Coverity CID#240498.

Fixes: CID#240498
Change-Id: I00afc739559d57dd98db68c76f2a85006c15e875
2021-10-13 17:47:25 +02:00
Eric Wild 7643be1d55 osmo-trx: fix maxdly
- one gsm symbol is 0,00000369 seconds
- 2*550m/c = 0,00000366 seconds
-> one ta symbol is a DISTANCE of 550m (or a RTT of 550m*2) between bts and ue.
-> no idea why this was constrained to TA/2.

Change-Id: I8d79080c82411e6427eec37d008614fa5d5e1ace
Related: OS#5140
2021-10-12 16:08:00 +00:00
Pau Espin 3e2b7faed6 rsl: Fix all shadow TS being Chan Act NACKed
The OML NM Channel FSM state only apply to primary timeslots, hence we
need to make sure we pick the primary TS (the non-shadow one).

Due to this bug, all channels on shadow TS where NACKed because the
related state was never "Enabled Ok".

Fixes: c97a7f51e1
Related: OS#5249
Related: OS#5251
Change-Id: If47e4bdd45a05ed1b5709b6e3d541f2830723e37
2021-10-11 13:53:27 +02:00
Pau Espin 074672b604 Make sure lchan allocated memory from shadow_ts is properly freed
Since non-shadow TS are currently not allocated as talloc contexts,
lchan objects tend to allocate their own memory on trx talloc ctx
instead. That's fine for non-shadow TS, since the TS follow trx lifecycle
since they are part of the same talloc context. However, shadow TS are
recreated (re-allocated) each time the BTS reconnects, hence when htey
are freed we need to free substructs (lchan) memory in order to avoid it
being kept in trx talloc ctx.

Related: OS#5248
Change-Id: I73742535eb3c40a6866731acbff782940dab06c3
2021-10-11 11:38:35 +02:00
Pau Espin 33b4b15f75 Add new gsm_bts_trx_free_shadow_ts() function
Use it as a counterpart of gsm_bts_trx_init_shadow_ts()

Change-Id: I38baa2b2cfcf6221325d45860b3c7dd53235b8ff
2021-10-11 11:19:11 +02:00
Vadim Yanitskiy 8e7d00f1ce trx_sched_clean(): also free() the shadow timeslot
Change-Id: Ic14e9de7487ba8152ffb1aa1bab508a2b9a11ea0
Related: OS#5248
2021-10-11 08:41:56 +00:00
Vadim Yanitskiy 0eb6891259 trx_sched_clean_ts(): also free() the associated 'struct l1sched_ts'
Change-Id: I44a8f18c81dd8bc76ca07dfaae7bcdb2fedc9261
Related: OS#5248
2021-10-11 08:41:56 +00:00
Pau Espin be688f1603 nm_*_fsm: reset mo.nm_attr from previous runs when entering state NOT_INSTALLED
Code in oml.c, upon receiving net attributes, merges the new attributes
with old ones (for some reason I don't really know). Hence, if we
disconnect from a BSC and go to NOT_INSTALLED state, we must free
previous nm_attr in order to avoid mixing them once we connect to a new
(potentially different) BSC upon reconnect.

Related: OS#5248
Change-Id: I45cc22dd68121a7930301581bfd0a8db37879c77
2021-10-08 20:58:50 +00:00
Pau Espin 9419319ab5 nm_*_fsm: Move reset state code to st_op_disabled_notinstalled_on_enter
Let's rather put it there instead of the shutdown code path, since we'll
be adding more and more reset coe there.

Change-Id: I43a136ade731a2c58c0a29d97875088e9b6d4414
2021-10-08 20:58:50 +00:00
Vadim Yanitskiy 556a966952 vty: show interference level / band in 'show lchan'
Change-Id: Ide45a0f7836bf35ffbe88070fa8367022311ca44
Related: SYS#5313
2021-10-08 16:54:20 +06:00
Vadim Yanitskiy ee5eb61694 l1sap: check if BTS model supports interference reporting
Currently, only osmo-bts-trx is capable of reporting the interference
levels to L1SAP.  Thus it does not make sense to trigger the averaging
logic and send empty reports over the A-bis/RSL and the PCUIF.

Change-Id: Ic17eb46bdca3c33ac4d6e560a093b635b75424a5
Related: SYS#5313
2021-10-08 16:54:20 +06:00
Vadim Yanitskiy 605cb85afd osmo-bts-trx: report PDCH interference levels to L1SAP
Starting from [1], interference levels on PDCH timeslots are also
reported over the A-bis/RSL.  They may be useful for the BSC to
determine whether dynamic PDCH timeslots might be better used for
new circuit switched connections, or whether alternative PDCH slots
should be allocated for interference reasons.

 * Handle GSM_LCHAN_PDTCH in lchan_report_interf_meas().
 * Rework pcu_tx_interf_ind() to accept 'struct gsm_bts_trx'.
 * Call pcu_tx_interf_ind() from l1sap_interf_meas_report().

Regarding pcu_tx_interf_ind(), it's better to call this function
from the upper layers once, rather than calling it from various
places in the model specific code.

[1] I5b4d1da0920e788ac8063cc765fe5b0223c76758

Change-Id: I3fbaad5dbc3bbd305b3ad4cb4bfb431a42cfbffc
Related: SYS#5313
2021-10-08 16:54:20 +06:00
Vadim Yanitskiy 187e099c3b rsl_tx_rf_res(): also report noise levels for PDTCH
This information may be useful for the BSC to determine whether
dynamic PDCH timeslots might be better used for new circuit
switched connections, or whether alternative PDCH slots should
be allocated for interference reasons.

Change-Id: I5b4d1da0920e788ac8063cc765fe5b0223c76758
Related: SYS#5313
2021-10-08 10:48:51 +00:00
Vadim Yanitskiy e73516ed00 rsl_tx_rf_res(): separate interference AVG / band calculation
It's cleaner from the architectural point of view to have the
interference measurements processed in a separate function.

Change-Id: I3981608e01a50585359cad673c38c8a305027d30
Related: SYS#5313
2021-10-08 10:48:51 +00:00
Vadim Yanitskiy 7726d23327 rsl: prevent race condition during timeslot re-configuration
It may happen that the BSC requests logical channel activation on a
dynamic timeslot, which is in a process of switching from one pchan
type to another due to a preceding channel activation request.

In this case 'struct gsm_bts_trx_ts' already holds an msgb with the
preceding RSL CHANnel ACTIVation message, that is normally handled
once the PHY completes the process of timeslot re-configuration.

On receipt of subsequent RSL CHANnel ACTIVation messages, in function
dyn_ts_l1_reconnect() we overwrite the preceeding msgb (memleak), by
the most recent one.  And once the timeslot re-configuration is done,
only the most recent CHANnel ACTIVation message gets ACKed.

In order to avoid this, let's move the msgb ownership to 'struct
gsm_lchan', so it cannot be overwritten by the CHANnel ACTIVation
message that is related to a different lchan on the same timeslot.

Change-Id: Ia625c2827fca883ea712076706d5ef21ed793ba6
Related: I3b602ac9dbe0ab3e80eb30de573c9b48a79872d8
Fixes: OS#5245
2021-10-08 05:23:08 +00:00
Vadim Yanitskiy 2e62159c8d .gitignore: add tests/amr/amr_test
Change-Id: Id1f8710f0d6b7511fff6ab221e6ec974a94c6f8b
Fixes: I94a934a6b3b397b4cd0e9da3577325de58814335
2021-10-08 05:21:32 +00:00
Pau Espin 715ff2900a nm_bts_fsm: Reset si_valid bitmask when BTS is shut down
Otherwise after reconnecting some SI are still marked as valid despite
the new BSC conn didn't set them.

Change-Id: I71e2a5cdf4e2e287db7b05df1a165a1e32c958ca
2021-10-07 16:25:19 +02:00
Pau Espin 15c23179dc nm_channel_fsm: Release lchans after BTS shutdown
This fixes some TTCN3 tests where some lchan resources were kept from
previous tests.

Change-Id: I78dca32cd061fba86cc88c4c4f323b33d51c58d0
2021-10-07 14:16:41 +02:00
Pau Espin b1409015fa Introduce gsm_lchan_release function helper
Change-Id: I0525beaba3c833f8d7adf9701fe373761a7720d3
2021-10-07 12:11:52 +00:00
Pau Espin db5bf829cd lchan.h: Add related ticket info to FIXME comment
Change-Id: I09ea92e843383d65c8033196814d345135ff918e
2021-10-07 12:11:52 +00:00
Pau Espin 36bbf1c328 Move lchan,power_control related code from gsm_data.c to their own files
We already have similar classification in osmo-bsc.

Change-Id: I1493f40d99f88a565f15d3e0943a512fb9b8719a
2021-10-07 12:11:52 +00:00
Pau Espin e525584f3a Move lchan,power_ctrl specific code from gsm_data.h to their own files
Let's split all lchan and power_control specific stuff into their own headers,
it helps finding out data and operations available related to them.

We already have similar classification in osmo-bsc.

Change-Id: I6424dcbd2e329fc1a516f8886359554ed7e9487e
2021-10-07 12:11:52 +00:00
Pau Espin e4d60ff8ff load_indication.c: Avoid sending if CCCH is still not operational
It makes no sense to transmit load information if the channel is still
not operational. This solves errors messages seen in osmo-bsc.

Related: OS#4872
Change-Id: I7ddda9776158eed0694df9e458f3f91df90bf674
2021-10-07 11:22:07 +00:00
Pau Espin 3c32cce087 MS Power Control Loop: Use P_CON_INTERVAL=2 by default
Have a more stable loop with less temporary oscillations at the expense
of increased reaction time.

4 SACCH blocks (P_CON_INTERVAL=2) is the minimum interval to get stable
measurements for the last requested MS Power level. With P_CON_INTERVAL=1,
are also made during a period with stable power being use to transmit,
but the MS Power level used (and announced in MR) is not the last one
requested by the BTS, but the one requested in the previous loop
iteration. This can make the MS and BTS bounce 2 values forth and back,
and create some temporary oscillation.

See osmo-bsc User manual section "Power Control" for more information.

Related: SYS#5371
Change-Id: I91c505447f68714239a4f033d4f06e91893df201
2021-10-07 10:47:00 +00:00
Pau Espin 77e014f061 Introduce gsm_lchan_init() function helper
Let's move lchan specific struct stuff into lchan.c

Change-Id: I9cb96707c63b8b7d76591d25fe906f02e34bb76b
2021-10-07 10:26:24 +00:00
Pau Espin c97a7f51e1 rsl: NACK Chan Activation for lchans on disabled TS
A broken BSC could send a Chan Activation on a TS which has not yet been
enabled (or even configured). This is the case with our TTCN3 tests,
where OML side is currently handled in parallel by an osmo-bsc while
TTCN3 takes care of the RSL side. This can actually be seen as a
malfunctioning BSC, but it was spotted that given this sequence of
events osmo-bts can crash (see ticket below).

Hence, let's NACK any attempt from a BSC to activate an lchan on a
disabled TS.

Related: OS#5249
Change-Id: I9c3b68487c12efc412a057728a561e061560c544
2021-10-07 11:12:21 +02:00
Pau Espin 93fbcdfb39 trx_provision_fsm: Fix shutdown while POWERON in transit
EV_CLOSE in state OPEN_WAIT_POWERON_CNF was not permitted, hence TRX0
was finally moved and kept to state OPEN_POWERON while other TRX were
moved OPEN_POWERON->OPEN_WAIT_POWER_CNF:

"""
20211004090637640 DL1C <0006> trx_provision_fsm.c:86 TRX_PROV(phy0-0)[0x55fddfb1fda0]{OPEN_POWEROFF}: Received Event TRX_PROV_EV_NOMTXPOWER_CNF
20211004090637640 DL1C <0006> trx_provision_fsm.c:498 TRX_PROV(phy0-0)[0x55fddfb1fda0]{OPEN_POWEROFF}: state_chg to OPEN_WAIT_POWERON_CNF
20211004090637640 DTRX <000b> trx_if.c:256 phy0.0: Enqueuing TRX control command 'CMD POWERON'
...
20211004090637641 DABIS <000d> abis.c:397 E1L(0) Signalling link down
...
20211004090637642 DOML <0001> bts_shutdown_fsm.c:74 BTS_SHUTDOWN(bts0)[0x55fddfb0b4e0]{NONE}: state_chg to WAIT_TRX_CLOSED
...
20211004090637642 DL1C <0006> l1_if.c:191 TRX_PROV(phy0-3)[0x55fddfb238b0]{OPEN_POWERON}: Received Event TRX_PROV_EV_CLOSE
20211004090637642 DL1C <0006> trx_provision_fsm.c:606 TRX_PROV(phy0-3)[0x55fddfb238b0]{OPEN_POWERON}: state_chg to OPEN_WAIT_POWEROFF_CNF
20211004090637642 DOML <0001> l1_if.c:194 NM_RCARRIER_OP(bts0-trx3)[0x55fddfb2ab20]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DOML <0001> l1_if.c:195 NM_BBTRANSC_OP(bts0-trx3)[0x55fddfb2ae00]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DL1C <0006> l1_if.c:191 TRX_PROV(phy0-2)[0x55fddfb22500]{OPEN_POWERON}: Received Event TRX_PROV_EV_CLOSE
20211004090637642 DL1C <0006> trx_provision_fsm.c:606 TRX_PROV(phy0-2)[0x55fddfb22500]{OPEN_POWERON}: state_chg to OPEN_WAIT_POWEROFF_CNF
20211004090637642 DOML <0001> l1_if.c:194 NM_RCARRIER_OP(bts0-trx2)[0x55fddfb27410]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DOML <0001> l1_if.c:195 NM_BBTRANSC_OP(bts0-trx2)[0x55fddfb27660]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DL1C <0006> l1_if.c:191 TRX_PROV(phy0-1)[0x55fddfb21150]{OPEN_POWERON}: Received Event TRX_PROV_EV_CLOSE
20211004090637642 DL1C <0006> trx_provision_fsm.c:606 TRX_PROV(phy0-1)[0x55fddfb21150]{OPEN_POWERON}: state_chg to OPEN_WAIT_POWEROFF_CNF
20211004090637642 DOML <0001> l1_if.c:194 NM_RCARRIER_OP(bts0-trx1)[0x55fddfb23b50]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DOML <0001> l1_if.c:195 NM_BBTRANSC_OP(bts0-trx1)[0x55fddfb23e60]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DL1C <0006> l1_if.c:191 TRX_PROV(phy0-0)[0x55fddfb1fda0]{OPEN_WAIT_POWERON_CNF}: Received Event TRX_PROV_EV_CLOSE
20211004090637642 DL1C <0006> l1_if.c:191 TRX_PROV(phy0-0)[0x55fddfb1fda0]{OPEN_WAIT_POWERON_CNF}: Event TRX_PROV_EV_CLOSE not permitted
20211004090637642 DOML <0001> l1_if.c:194 NM_RCARRIER_OP(bts0-trx0)[0x55fddfb0bb70]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DOML <0001> l1_if.c:195 NM_BBTRANSC_OP(bts0-trx0)[0x55fddfb0be50]{DISABLED_OFFLINE}: Received Event DISABLE
20211004090637642 DTRX <000b> trx_if.c:672 phy0.0: Response message: 'RSP POWERON 0'
20211004090637642 DL1C <0006> trx_provision_fsm.c:56 TRX_PROV(phy0-0)[0x55fddfb1fda0]{OPEN_WAIT_POWERON_CNF}: Received Event TRX_PROV_EV_POWERON_CNF
"""

This left the BTS in an unexpected broken state and TTCN3 tests after
this race condition failed.

Change-Id: Ic4831201a5be1bc9aff757a9a061c637d98582de
2021-10-04 14:33:09 +00:00
Pau Espin 0d8f51f1a5 trx_provision_fsm: poweronoff_sent flag: track POWERON and POWEROFF separately
It helps better understanding the code, and will allow handling
situations where for instance a POWERON in in transit while the BTS is
instructed to shutdown, hence a POWEROFF needs to be sent.

Change-Id: Iaf62217ceab7420afa4140cba61e1c2f983c61b4
2021-10-04 14:33:09 +00:00
Pau Espin 582d9cf0d5 trx_provision_fsm: Drop impossible paths
config.enabled is always true in that state. Hence, those paths can be
securely dropped since only add confusion.

Change-Id: Icf00c52e61ddedd8e32eb37223cea5686005e6a3
2021-10-04 14:33:09 +00:00
Pau Espin 3440104723 trx_provision_fsm: Drop unneeded reset of fields
Since recently, reset of all fields is already properly done in
trx_provision_reset().

Change-Id: I3e6bc8205704e425644507dd1f1b299dea4cd851
2021-10-04 14:33:09 +00:00
Vadim Yanitskiy fa9dd74d83 rsl: remove redundant logging in rsl_rx_chan_activ()
The first check in this function ensures that the state is NONE.
Therefore it does not make sense to print it below..

Change-Id: I62ea4117dd5e1eebb8774809134e5cb73774945c
2021-10-04 12:44:24 +00:00
Vadim Yanitskiy 61349d6f14 abis: fix memory leak in abis_oml_sendmsg()
Change-Id: Ifc46b94b4540705f7d9b4678a7398158f3aaf7c5
Fixes: Iecd3c7cb96f5fff3b4c7e04c74e031df0f7a6987
2021-10-04 12:44:04 +00: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
Eric Wild 87f48a1d38 lc15, oc2g, sysmo: fix show dsp-trace-flags
This was colliding with the global "show trx" command introduced a few
years ago, and prevented both command from working.

Change-Id: I57f9515292f7bd906599e2cc277542bfaf3b657b
Related: OS#5080
2021-09-30 19:30:00 +00:00
Vadim Yanitskiy 5fa08dee72 fix handle_ms_meas_report(): properly count measurement reports
Each RSL MEASurement RESult message contains a Measurement Number
IE, which is basically a monolithically increasing number.  We
shall not increase this counter if for whatever reason the report
has not been sent to the BSC.

Change-Id: I441adb4b202e94ddee8c0b6777849e36ea644b1d
Fixes: Id67259ec9ac4c2c33bd0eef3f64450affbe3fb9f
Fixes: OS#5243
2021-09-30 11:36:47 +00:00
Pau Espin 1c3431db95 Delay abis reconnect while bts is shutting down
Avoid re-connecting to a new BSC while BTS is in shutting down. All the
FSMs are complex enough to even try to re-start when stopping has not
yet finished...

Change-Id: I1727828a16f4ec8043b00cc6b2e02a4c35f71377
2021-09-30 13:15:24 +02:00
Pau Espin d17beeacde bts-trx: Delay power ramp up until RCARRIER is ENABLED
Prior to this patch, the power ramping started when the PHY is
available, but that doesn't necessarily mean the RCARRIER is enabled.

Due to this, it was spotted a situation where BTS bootstrap failed after
PHY turning up, when RSL connection establishment failed. Hence
bts_shutdown_fsm triggered a shutdown while an active power ramping up
was ongoing...

Change-Id: I17208b74ea2649b1bbb717aee0aa355e42b7e860
2021-09-30 13:14:08 +02:00
Pau Espin 134c999103 trx_provision_fsm: Support OPEN_POWEROFF->CLOSED transition
This may happen if bts_shutdown starts a poweroff procedure while
POWERON was still not sent to the TRX. In this case, we want to go back
to initial closed state to fullfill expected state when BTS is shutdown.

Change-Id: Id660fa1018ef175ab237733b37629c56313c061d
2021-09-30 11:12:43 +00:00
Pau Espin 304de2e115 trx_provision_fsm: Fix TRX!=0 never going back to CLOSED state
Change-Id: I39bef8b5776cbf1098753865c597b1c99d355bec
2021-09-30 11:12:43 +00:00