Commit Graph

16 Commits

Author SHA1 Message Date
Vadim Yanitskiy ae0bb5e1c7 trxcon: allocate memory in l1ctl_server_start()
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
2022-07-22 17:31:05 +07:00
Vadim Yanitskiy 5f47751ddb trxcon: call osmo_timer_del() unconditionally
osmo_timer_del() does check if a timer is active internally.

Change-Id: I4ede5b19eeb847fe8fdaed52a8b5c801b3de209a
2022-07-22 03:21:22 +07:00
Vadim Yanitskiy d451f0caea trxcon: cosmetic: rename 'trx->fsm' to 'trx->fi'
Make it cleaner that it's an FSM *instance*.

Change-Id: I688b903fe21086beca7fb86dcee90f6f751d7cc3
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy c9a801e05c trxcon: get rid of GEN_MASK macro, define it locally
Change-Id: I9504f022ef1767276479f21b8228ac094d28a858
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy 4c83590f1d trxcon: cosmetic: rename l1ctl_link.[ch] to l1ctl_server.[ch]
Change-Id: I91149087bac6c745253d99deae2e32275b446a39
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy 506e9085e3 trxcon: rework L1CTL socket API to support multiple clients
Change-Id: I1cfc49f36ead6e2ba0a6110b0fb65c55412ef5e3
2022-07-21 18:02:56 +07:00
Vadim Yanitskiy a89492a4dd trxcon: move FBSB state from struct l1ctl_link to trxcon_inst
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
2022-07-21 17:37:36 +07:00
Vadim Yanitskiy 27900b3a2d trxcon: introduce and use struct 'trxcon_inst'
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
2022-07-21 17:37:36 +07:00
Vadim Yanitskiy 94bb69ab3c trxcon: cosmetic: s/app_evt_names/trxcon_fsm_event_names/
Change-Id: Iae0e753eddb7e0a1767e555653c9e9fdb58b7a7b
2022-07-21 17:35:12 +07:00
Vadim Yanitskiy 93fe00d29c trxcon: tune hard-coded logging parameters (filename)
Change-Id: I241cff113a513799d3da0c9991354ea9ea889bb6
2022-07-20 13:48:58 +00:00
Vadim Yanitskiy 593beee3d8 trxcon: get rid of init_defaults(), init app_data in place
Change-Id: Id59df37b249f21cd7ea7a411ab2445ffc2dae8cc
2022-07-16 04:14:20 +07:00
Vadim Yanitskiy d6525cb172 trxcon: make trxcon_gsmtap_send() static
Change-Id: I632077af0d4cd16a9f27d5a6d07a0b12575b4350
2022-07-13 02:09:25 +07:00
Vadim Yanitskiy 8428b1ea0a trxcon: abstract out the scheduler API from L1CTL/TRXD/TRXC
Change-Id: I31f77976a7a225ef292fe6dcd583513aec97ed44
Related: OS#5599, OS#3761
2022-07-12 19:29:13 +07:00
Vadim Yanitskiy eff2d52e75 trxcon: merge 'sched_trx.h' and 'scheduler.h' into 'l1sched.h'
Change-Id: Ide1e3ccdf32fdc255acc943e0c0936d15cf0c680
Related: OS#5599, OS#3761
2022-07-11 05:12:16 +07:00
Vadim Yanitskiy 38373ee20f trxcon: use 'l1sched_' prefix for scheduler API
Change-Id: I370aa5084a4e3eb94168b96df94dbbee606adaab
Related: OS#5599, OS#3761
2022-07-11 05:12:16 +07:00
Vadim Yanitskiy 259314abae trxcon: group *.c files into 'src' directory
Change-Id: I1a3703e48507cd51cd8198f13b993f54c44bc41e
Related: OS#5599, OS#3761
2022-07-04 17:41:09 +07:00