The original trxcon_fsm I wrote back in 2017 [1] was more like
a boolean flag, as there were only two states: IDLE and MANAGED.
Not surprising, given that until recently handling of multiple
L1CTL connections was not supported. Now that we have this
implemented, lifetime of a trxcon_fsm instance is limited by
lifetime of a L1CTL connection, what renders the FSM useless.
This change removes the old 'boolean' trxcon_fsm and introduces
the new one, which will allows us to abstract the L1CTL interface
from the TRXC/TRXD interfaces, as well as the scheduler. The new
FSM will also simplify development of the RLC/MAC layer for GPRS.
Change-Id: Ifaf63ead9dd180181358e771367b2a686ba159ca
Related: [1] I7ee6fc891abe5f775f5b7ebbf093181a97950dea
Related: OS#5599
Currently it may happen that the transceiver (e.g. fake_trx.py) remains
powered on when we loose a L1CTL client connection. This is going to
be fixed in change [1] re-implementing the trxcon_fsm. For now let's
ensure that the transceiver is properly powered off by sending
"CMD POWEROFF" from trx_if_close().
Change-Id: I9c5178907304b36ec3de0ee31b7f7a9ed2e31c16
Related: [1] Ifaf63ead9dd180181358e771367b2a686ba159ca
By default, powering on/off a parent transceiver (child_idx=0) will
automatically power on/off its child transceivers (if any). This
behavior is desirable for the BTS, but not for the MS Transceivers.
Additional MS Transceivers are going to be used by ttcn3-bts-test
for spawning multiple DCCH components in parallel. We don't want
situations when one component powers off transceivers of the other
DCCH components - they must be independent.
Change-Id: I0cd6bac616273bed0e246ad48edc44fff484c589
This change makes it possible to configure l1sched related logging:
* l1sched_logging_init() allows to configure logging categories for
common and data messages (by default, DLGLOBAL is used);
* struct l1sched_cfg allows to configure a logging prefix to be
used in l1sched messges (by default, 'l1sched[0x%p] is used)'.
Let's use osmo_fsm_inst_name(trxcon->fi) as the logging prefix.
Change-Id: I26da1a506b02502a3a6a887533c35fb09c13c429
Related: OS#5599, OS#3761
This should have been done in [1], but somehow I forgot about TRXD.
Change-Id: Ia5124061fe391644267a6117ac2627cad7adf873
Fixes: [1] Ic253903e7b8635bb13e210acfe929c73f8870632
Related: OS#5599
l1ctl_server_start() does not actually start the server, it simply
allocates memory and initializes it. l1ctl_server_shutdown() does
the opposite. Let's use more precise symbol names.
Change-Id: Ie039abdff3911c5b566c760b26c31203824c5764
Calling l1ctl_server_shutdown() whenever the server is not initialized
will result in accessing uninitialized values. This can happen if we
goto exit before l1ctl_server_start() was called.
Initializing the server with zeroes is not an option, because we need
to initilize llist_head and osmo_fd structures with proper values.
Allocate and initialize struct l1ctl_server in l1ctl_server_start(),
deinitialize and free() in l1ctl_server_shutdown().
Change-Id: Idf13914fd0b0ae09b2ce5ece1f4203ebcae05d6e
Related: CID#275254
Ideally, FBSB procedure should be implemented as a state of trxcon's
FSM. For now let's simply move the related fields to trxcon_inst.
Remove l1ctl_shutdown_cb() as it's not needed anymore.
Change-Id: I92b50cf1bb36886fbe3d6460af3c0b1c57256ae8
trxcon consists of the following three main components:
* the L1 TDMA scheduler (libl1sched),
* L1 interface (TRXC/TRXD over UDP),
* L2 interface (L1CTL).
In [1] and [2] the L1 scheduler was abstracted out from both L1
and L2 interfaces and separated into a library, so it does not
use the TRXC/TRXD nor L1CTL related API directly.
This change is the next step towards the goal of having all three
components abstracted from each other. Moreover, this patch brings
us closer to another goal of being able to support multiple L1CTL
connections (each having its own scheduler).
The idea is to give both L1 and L2 interfaces access to the
'trxcon_inst' structure, which basically groups all three components
mentioned above into a single piece. The end goal is to eliminate
direct interaction between the interfaces, and the scheduler, so that
one could easily replace TRXC/TRXD and/or L1CTL with something else.
Change-Id: I23319951c56577085e1092669b5534f9d6bda48d
Related: [1] I31f77976a7a225ef292fe6dcd583513aec97ed44
Related: [2] I001fb7bc2663eea308b5a8882746ed9863f2c2f8
Timeslot Number can never be negative, so let's use unsigned.
Rename the counter to 'tn' for consistency with other projects.
Change-Id: I93b5a91341e7f79ced0591e13250632ba5e5adef