Commit Graph

3056 Commits

Author SHA1 Message Date
Vadim Yanitskiy 4a4bc0ed6e trxcon: get rid of DEBUG_DEFAULT, give an example
Change-Id: If2d2afb18238df89aa4cdaed9a38810f647b3189
2022-07-25 19:53:51 +07:00
Vadim Yanitskiy c582aedd91 trxcon: rename DTRX logging sub-system to DTRXC
This sub-system is used for TRXC related logging, so reflect this.

Change-Id: I33c8f81e37de7ee61809610e51405a96c93536ff
2022-07-25 19:53:51 +07:00
Vadim Yanitskiy 4f2d6c40d0 trxcon: ensure TRXD logging is actually using LOGPFSMSL()
This should have been done in [1], but somehow I forgot about TRXD.

Change-Id: Ia5124061fe391644267a6117ac2627cad7adf873
Fixes: [1] Ic253903e7b8635bb13e210acfe929c73f8870632
Related: OS#5599
2022-07-25 19:53:51 +07:00
Vadim Yanitskiy a986c466f0 trxcon: move osmocom/bb/{trxcon->l1sched}/l1sched.h
Change-Id: I41348b738cce9954afafa0952da050306838b908
Related: OS#5599, OS#3761
2022-07-23 16:30:26 +07:00
Vadim Yanitskiy 504f0293df trxcon: remove unused #includes in sched_lchan_common.c
Change-Id: I623b9d57258e19e4dd9d25e7432138b1379e5f4c
2022-07-22 18:35:18 +07:00
Vadim Yanitskiy 71eb55f3f9 trxcon: l1ctl_server_{start,shutdown}() -> l1ctl_server_{alloc,free}()
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
2022-07-22 17:31:05 +07:00
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 28b5934663 trxcon: fix NULL pointer dereference in trx_if_open()
Change-Id: Id40e758f6736773f7695c02bdb8974ee422b2e63
Related: CID#275253
2022-07-22 17:31:05 +07:00
Vadim Yanitskiy 78e5668d52 trxcon: remove unused #imports in sched_clck.c
Change-Id: I41e08c2a970334f87fa9fca8d21a55295b9eddc5
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 2a2babbeac trxcon: fix trx_if_close(): delete TRXC timer if it's pending
Change-Id: I669355ec03f67de437df2d3b822ed0a728b405d5
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy 0e0d266812 trxcon: ensure are TRXC/TRXD logging is using LOGPFSML()
Change-Id: Ic253903e7b8635bb13e210acfe929c73f8870632
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy 2576be0f63 trxcon: trx_if_open(): allocate trx->fi as a child of trxcon->fi
Change-Id: I19579d2a76c38ca972a4ca132a8e5e3bba876c67
2022-07-21 18:03:17 +07:00
Vadim Yanitskiy 5a8b0ad0ac trxcon: cosmetic: remove the '_fsm' postfix in trx_fsm.name
Change-Id: Ie867f7a59b9d9f423944606d43f2f854313053f7
2022-07-21 18:03:17 +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 e1740e2fc8 trxcon: use 'unsigned int tn' for timeslot number
Timeslot Number can never be negative, so let's use unsigned.
Rename the counter to 'tn' for consistency with other projects.

Change-Id: I93b5a91341e7f79ced0591e13250632ba5e5adef
2022-07-21 17:35:12 +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 fd039d4571 trxcon: fix coding style in statements applying inverted mask
Change-Id: I28b9fc34e0d40b02d0ca56e9e0bf4463cf4ff336
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 682341738d trxcon: cosmetic: use ARRAY_SIZE() whenever appropriate
Change-Id: I2a246bad8d11ed45fbf849de961713ab96907d83
2022-07-18 20:34:02 +07:00
Vadim Yanitskiy c4aa60317d trxcon: cosmetic: s/ts_list/ts/ in struct l1sched_state
Change-Id: I182b2a3ae1dcb1671aaaed9394cdfea34f7966a9
2022-07-18 20:34:01 +07:00
Vadim Yanitskiy 43cd9f270d trxcon: cosmetic: s/state/clck_state/ in struct l1sched_state
Change-Id: I8a1b971abaf06c0b1339895cf1748c5eb21d45e6
2022-07-18 20:34:01 +07:00
Vadim Yanitskiy 68b6ef33ce trxcon: add missing #include for enum gsm_phys_chan_config
Change-Id: I850b9a5c34fc39829c464b563f1a78ef4e8a1dd5
2022-07-18 20:34:01 +07: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 9523cdd4d3 trxcon: send proper slot type in TRXC SETSLOT messages
Change-Id: I42f5620b50beb7df0a3463d70c1f48d041006371
Related: OS#5599
2022-07-12 19:29:13 +07:00
Vadim Yanitskiy fb26115d71 trxcon: separate the scheduler into libl1sched.la
Change-Id: I001fb7bc2663eea308b5a8882746ed9863f2c2f8
Related: OS#5599, OS#3761
2022-07-12 19:29:13 +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 97006ff1bd trxcon: make l1ctl_tx_dt_ind() accept const pointers
Change-Id: I34f665a39c7d036efd4cbe335084fbe21142a48c
Related: OS#5599, OS#3761
2022-07-12 03:03:17 +07:00
Vadim Yanitskiy f5804d7631 trxcon: use abstract API for RACH primitives
Using L1CTL specific structures as the primitive payload was a
beautiful hack in the early days of trxcon.  But since we're
going to separate the scheduler into an interface independent
library, we have to introduce and use an abstract API.

Change-Id: I84597d44ea7d74b8840a919ecb09988ba1980a73
Related: OS#5599, OS#3761
2022-07-12 03:03:17 +07:00
Vadim Yanitskiy bac9387bba trxcon: allocate a prim in l1sched_prim_push()
Make l1sched_prim_alloc() private and call it from l1sched_prim_push().
This makes the API more convinient, because both functions are always
used together.

Change-Id: Ia9c0170fb06efcef569e987b57ab9ab7f7c7e847
Related: OS#5599, OS#3761
2022-07-12 03:03:17 +07:00
Vadim Yanitskiy b1125910c1 trxcon: fix uint8_t used for length in l1sched_prim_alloc()
Using uint8_t makes it impossible to allocate primitives with payload
of size 255 - sizeof(struct l1sched_ts_prim) and greater.

Change-Id: Ic19b8433118798f57500119f1caf10e117e5db19
Related: OS#5599, OS#3761
2022-07-12 03:03:17 +07:00
Vadim Yanitskiy 8abb8026c2 trxcon: return prim pointer from l1sched_prim_alloc()
Returning prim pointer is more convinient from the API point of view.

Change-Id: I0fa41cf55e90d191d032bca1754941cca763b03e
Related: OS#5599, OS#3761
2022-07-12 03:02:31 +07:00
Vadim Yanitskiy 98b5895200 trxcon: rename l1sched_prim_init() to l1sched_prim_alloc()
The current function name is confusing, because l1sched_prim_init()
is not only initializing a primitive, but also allocating it on heap.
Let's use '_alloc' instead of '_init' to reflect that.

Change-Id: Ie1bebb6829ba9f640455685fcd7309b6aa442ef0
Related: OS#5599, OS#3761
2022-07-12 02:55:22 +07:00
Vadim Yanitskiy a699cc6846 trxcon: remove unused include of 'logging.h' from 'l1sched.h'
Change-Id: I52e1b93e3f1f5e52beeb17ff27c2a83e24d25a96
Related: OS#5599, OS#3761
2022-07-11 05:12:16 +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 f73db50f6b trxcon: rename 'enum trx_lchan_type' and its items
Change-Id: I76a7d9fed3d6ab47725fceb803aa16ddbfd2e1a2
Related: OS#5599, OS#3761
2022-07-09 23:56:18 +07:00
Vadim Yanitskiy 19ad5c9256 trxcon: remove '\brief' marker from the comments
This marker is not required to be present in Doxygen comments.

Change-Id: If793037e2b2bc9b708617867a4d4ddb0fa2f1ddb
2022-07-04 17:41:09 +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
Vadim Yanitskiy b7335dfe79 trxcon: group header files into 'include/osmocom/bb/trxcon'
This is the first step towards the goal of moving the scheduler
into a separate library.

Change-Id: Ifa6137c239c215a3d323213ee74d34b419622be4
Related: OS#5599, OS#3761
2022-07-02 19:02:49 +07:00
Vadim Yanitskiy 57ce62f4bc trxcon: Makefile.am: fix make {dist,distcheck} targets
File '.version' must be also listed in EXTRA_DIST, otherwise I get:

  echo 0.0.0 > ../../.version-t && mv ../../.version-t ../../.version
  /bin/sh: line 1: ../../.version-t: Permission denied

Change-Id: I65f7c505f5a231bab114c45f5fdd7421601dfbc0
Related: OS#5599, OS#3761
2022-07-01 19:34:21 +07:00
Vadim Yanitskiy d75cc116e2 trxcon: Makefile.am: move versioning magic to the bottom
This is a more usual place for manually added targets.

Change-Id: I69892f8689fd7062ca26b6f1337c972b11b1906e
Related: OS#5599, OS#3761
2022-07-01 19:19:23 +07:00
Harald Welte 58f7758379 update git URLs (git -> https; gitea)
Change-Id: Idfdfad0c32ae25311a0fc050e38429e001d0c5b7
2022-06-18 13:59:31 +02:00
Vadim Yanitskiy 095b360bc8 layer23: chantype_rsl2gsmtap() is deprecated, use chantype_rsl2gsmtap2()
Change-Id: Id54b973cec8479fc32775be260f8a9fac8f09bae
2022-05-13 23:16:42 +03:00