Some L1PHY targets (e.g. Calypso based Mot C1xx phones) have built in
microphone and speaker. Some targets do not have them. Currently we
unconditionally instruct the L1PHY to handle TCH frames internally.
Make this behavior configurable via the VTY interface.
Change-Id: I131f213ef7c2736f7310f0183b83f3bc3064cd98
Related: OS#5599
Since the mobile application is potentially able to maintain
multiple MS instances, it's better to have a possibility to
choose an MNCC (Call Control) handler per each MS separately.
This change removes the command-line option '-m', which was used
for enabling the external MNCC. Now it's possible configure the
MNCC handler for each MS via the VTY interface and settings.
The following MNCC-handlers are available:
- internal - built-in MNCC-handler (default);
- external - external MNCC-handler via UNIX-socket (e.g. LCR);
- dummy - dummy handler without CC support.
Change-Id: I2df91c7a79ba5c39bc6ceae900ef649129dd0346
Related: OS#3400
Similar to rsl_dec_chan_nr(), this function may also fail, leaving
the given struct tlv_parsed uninitialized.
Change-Id: I13f2a97eeff78ca8ed7d0a2844e4fca430ec7768
Related: OS#5599
The rsl_dec_chan_nr() may fail to decode RSL channel number, so
variables ch_type/chan_ss/chan_ts would remain uninitialized.
Change-Id: I9ab18bdaf41a29fcd32a7060668ef9db07b8cf7e
Related: OS#5599
Previously the MNCC socket path was generated automatically,
using concatenation of the '/tmp/ms_mncc_' prefix and MS name.
Let's allow the user to specify this manually, keeping the same
naming generation method for default value.
Change-Id: I643356ac579bc5e765f668265ec803b22a73739c
Related: OS#3400
The for-loop was moved above the initialization of bi and kept using
bi.burst_len, which is indeed uninitialized. Move it back.
Change-Id: I93a627233beef9157d47b35cafc42c53203619a7
Fixes: 178b92a108
Fixes: CID#300007
The trx_data_rx_cb() needs to be modified because it's accessing and
modifying the receive buffer via the bi.burst pointer, which
becomes const after this patch.
Change-Id: I68773d247725a6dc2cbbc58b63c0fd19ffdb1a16
Related: OS#5599
The key idea is to allow triggering the scheduler only for a specific
timeslot of a frame, while keeping the API for triggering all together.
Split off the main part from l1sched_trigger() to l1sched_pull_burst().
While at it, rename l1sched_trigger() to l1sched_pull_send_frame().
Change-Id: Ibb7f9d7de26733f21b0753a2c655a250286bf1f0
Related: OS#5599
Use the given Fn instead, no need to go that deep for it. The
sched->fn_counter_proc is an internal field of the scheduler,
which is not necessarily holding a valid value when pulling
Uplink bursts synchronously via the Ready-to-Send PHYIF API.
Change-Id: I56027876b50e53b474c2f54ac216cd141142020e
Related: OS#5599
This app will allow setting up a tun device to transmit/receive data
as a GPRS MS against a GSM network.
This is just the initial skeleton so that people can work on it further
in follow-up commits.
Related: OS#5503
Change-Id: I8a1121b3287da7d7330c30e3118affa8fd1da61b
Do not mix up Downlink burst handling with the clock delivery. Add
a separate PHYIF API function and call it from the TRXC/TRXD PHYIF.
This way calling trxcon_phyif_handle_burst_ind() would not trigger
the internal timer-driven Uplink scheduler in libl1sched, letting
the underlaying PHYIF logic to pull Uplink bursts synchronously.
Change-Id: Ieeee25573d1142aec2fee28d884127f14573b681
Related: OS#5599
This is needed for the integration with osmo-trx-ms. It was decided
to run the scheduler within the transceiver process, so that we can
reduce scheduling latency. The idea is to maintain trxcon as a sub-
module in osmo-trx.git and link osmo-trx-ms against the libtrxcon.
We cannot use hard-coded logging categoris in a library, so add new
API for setting them: trxcon_set_log_cfg(). Use DLGLOBAL by default.
Change-Id: Idf207947f620a7394e0a0e5bf2c37bcd8df64bbe
Related: OS#5599
The L1CTL codec (implemented in l1ctl.c) is going to be part of the
upcoming libtrxcon, so let's uncouple it from the l1ctl_server API.
Change-Id: I8d80af240b0e57f76263907c552288d4184876c0
Related: OS#5599
The l1ctl_client_read_cb() is using L1CTL_HEADROOM, so let's avoid
inconsistency and use L1CTL_HEADROOM in the l1ctl_alloc_msg() too.
Change-Id: I248f8c662ae0836cba61fb708a5dc73c57131f4c
Related: OS#5599
Currently the trxcon_fsm is simply passing start and stop ARFCN values
(as received from the L1CTL peer) over the PHYIF, and expecting the
PHY to perform the measurements within the given range. This approach
requires the PHY implementation to maintain some state internally.
Let's simplify the job of the PHY implementation(s) by maintaining the
power scan state in the trxcon_fsm and sending a PHYIF_CMDT_MEASURE
command for each ARFCN in the given start/stop boundaries separately.
Change-Id: Ic5f724a11e225b439ec10aed7697e3e03b7929e5
Related: OS#5599
If $CFLAGS is empty prior to calling the LT_INIT, this macro will
set $CFLAGS to "-g -O2". We don't want implicit flags out of
nowhere, so let's simply move the invocation of LT_INIT down below.
Change-Id: I8d8eb1e3428ffcb84ddd53230fada39328337d15
Related: OS#5749
Found this problem while trying to build with "-flto":
../include/osmocom/bb/trxcon/l1ctl.h:21:5: error: type of
'l1ctl_tx_dt_conf' does not match original declaration
[-Werror=lto-type-mismatch]
21 | int l1ctl_tx_dt_conf(struct l1ctl_client *l1c,
| ^
l1ctl.c:288:5: note: type mismatch in parameter 2
288 | int l1ctl_tx_dt_conf(struct l1ctl_client *l1c, bool traffic,
| ^
The trxcon_fsm is passing only two arguments to l1ctl_tx_dt_conf().
The 'traffic' flag is included in struct trxcon_param_tx_data_cnf,
so the 2rd argument is not needed and should have been removed.
Change-Id: Ifc538f940571172fa237ecb7000f3cfea3655edc
Allow TRXCON_ST_{FULL_POWER_SCAN->FULL_POWER_SCAN} state transition
so that we can call osmo_fsm_inst_state_chg() unconditionally.
Change-Id: I1ea69561a2d3cf73009c6244b1d0f090d744d7b2
Related: OS#5599
The PHYIF implementation shall not have direct access to the struct
trxcon_inst it belongs to. All communication shall be done via the
abstract PHYIF interface (see <include/osmocom/bb/trxcon/phyif.h>).
* Introduce struct trx_if_params containing all necessary params.
* Make trx_if_open() accept a struct trx_if_params pointer.
Change-Id: I1a97c4c783ab671636ca33700eca97dede2a4a09
Related: OS#5599
The PHYIF implementation shall not send events to the trxcon_fsm
directly. The measurement command is sent in form of an abstract
PHYIF primitive (PHYIF_CMDT_MEASURE), so it's more logical that
the response is sent in form of a PHYIF primitive too.
Change-Id: Ie20616c288c16559d0a566979b24d57b50369fab
Related: OS#5599
We already handle DATA.req/TRAFFIC.req via TRXCON_EV_TX_DATA_REQ,
so let's handle the respective *.cnf messages via the FSM too.
Change-Id: Ica7a25f0bf8c7f89037a776d711ac641c57c9ad5
Related: OS#5599
It's not really necessary to handle signalling and traffic via
different events, so let's reduce complexity by merging them.
Change-Id: I8c2b3274f32d4d52424512d988b93d6233dd09a0
Related: OS#5599
The trxcon_fsm should not be dealing with the L1CTL protocol, so
let's better hand over the trxcon_param_rx_traffic_data_ind to
l1ctl_tx_dt_ind() and compose the l1ctl_info_dl there.
Change-Id: Ie57d86ffd9ea7c44187aafba0df1f519d1c523fb
Related: OS#5599
It does not make sense to call function sched_frame_clck_cb() via
a configurable pointer in the l1sched_state. Make this function
public (thus rename) and call it directly. Remove the .clock_cb.
Having l1sched_trigger() globally available makes it possible to
call this function directly, bypassing the internal timer driven
clock module. This is needed for the integration with osmo-trx-ms.
Change-Id: Ied0eed6d514acabb94d819b2f9485868390c0f24
Related: OS#5599
In commit [1] I introduced a regression by removing the conditional
part completely. My intention was to remove the logging statement,
the return should be kept to prevent sending POWERON twice.
This regression affects the following TTCN-3 testcases:
* TC_sacch_chan_act_ho_async,
* TC_sacch_chan_act_ho_sync.
Change-Id: Iccd0bbac91a7899ef72df3dfe623b56eb66305fa
Fixes: [1] 1c75c0012b
With the introduction of the abstract PHYIF, the trxcon_fsm has lost
access to the internal state of the PHY, so now it may be sending the
PHYIF_CMDT_POWERON even if the PHY is already powered on.
Change-Id: Ib500c746430c9082a5fda342257cee7293f46ba0
Related: OS#5599
This change is aimed to simplify the integration of trxcon with
osmo-trx-ms by allowing to replace the TRXC/TRXD interface with
direct API calls.
Change-Id: I3d7c717cfc3616809d22efb1903abbf843594258
Related: OS#5599
We already have the lookup tables for Downlink, so let's also add
the respective tables for Uplink. This renders ul_amr_fn_is_cmi()
useless, so remove it together with the sched_utils.h file.
Change-Id: Ibc23b5a94bd37fba8d918ad6ee61b93a6290d8a3
This reverts commit 1a8a80aeae.
We currently get ALL SI messages wrong - the protocol disseminator is
accidentally being used as SI msg type, and
6=radio resources management - but 6 is also type=si5ter.. so all SI we
receive end up being parsed as SI5, what a coincidence!
Change-Id: I3822f74295920680a935f3031c642ba00162d09d
This reverts commit c5d9507b5d.
Using osmo_ubit2sbit() was a bad idea because this function treats
the input buffer as ubits (while we deal with usbits) and produces
absolute sbit values: either 127 or -127. This is wrong, because
all intermediate usbit values are getting converted to -127.
This bug remained unnoticed so far because trxcon is mostly used in
combination with fake_trx.py, a virtual Um interface which simulates
ideal RF conditions by default and feeds trxcon with 'perfect' bits.
Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
The remote L1CTL peer may send another L1CTL_PM_REQ message right
after getting L1CTL_PM_CONF from us. Handle this properly.
Change-Id: I8e5fd778467567e8ca69ed420b9815073daa7e16
The L1CTL interface logic currently gets access to the trxcon_fsm
via an associated struct trxcon_inst. No other fields are used,
so we can pass trxcon->fi directly. All communication shall be
done via the FSM anyway.
Change-Id: I5a15a676ce3917d2eddc44f1143cea8d3cd8781f
This allows TTCN3 L1CTL module (used in BTS_Tests) to transmit and
receive AMR payloads towards osmo-bts-trx.
Related: SYS#5987
Change-Id: Ia20bc96e39726a919a556c83c8be48cb31af7331
For consistency with trxcon_inst_alloc():
* first allocate an instance of trx_fsm as a child of trxcon->fi,
* then allocate a trx_instance as a child of the trx_fsm.
Change-Id: Iafc486347c6ca7a80da88be73c772397fa2deb7d
Calling l1sched_free() from trxcon_fsm_pre_term_cb() may result in
l1sched_handle_config_req() being called when trxcon->phyif is NULL.
Handling l1sched_config_req via TRXCON_EV_SET_PHY_CONFIG_REQ guards us
against NULL pointer dereference during teardown of a trxcon_fsm
instance, if it's caused by TRXCON_EV_PHYIF_FAILURE.
Change-Id: I44bbc695e8a406a7acb9c163bf223f4ea966ea12
Related: OS#5599
* trxcon_inst_alloc(): allocate trxcon_fsm as a child of the given ctx.
* trxcon_inst_alloc(): allocate trxcon_inst as a child of trxcon_fsm.
* trxcon_inst_free(): move the cleanup logic to .pre_term() callback
of the trxcon_fsm, represented by new trxcon_fsm_pre_term_cb().
* trxcon_allstate_action() properly handle TRXCON_EV_{PHYIF,L2IF}_FAILURE.
Change-Id: I5eb8ef6f62b1dc949dc60eaa558f123b3b93819c
Related: OS#5599
The underlying L1 implementation uses both chan_nr and link_id to
determine a logical channel for sending an Access Burst. If not
set (both 0x00), RSL_CHAN_RACH is assumed. Indicate it implicitly.
Change-Id: Ia40f67920bd712e572b8ea5219eb83064106bd5d
There is a time window between activation of a dedicated channel and
receipt of a L1CTL_DATA_REQ with the first RR Measurement Report, in
which trxcon may need to start transmission on Uplink SACCH.
In this case trxcon is using a dummy SACCH block with hard-coded L1
SACCH header values and hard-coded Measurement Results. This mimics
behavior of the layer1 implementation in firmware for Calypso phones.
When running the mobile application, this error can be seen:
DAPP ERROR trxcon(0)[0x55ee57bee1a0]{FBSB_SEARCH}:
Event TRXCON_EV_RX_DATA_IND not permitted
which means that the mobile is sending L1CTL_DATA_REQ *before*
establishing a dedicated channel. And this message contains an
RR Measurement Report. The idea behind this is to populate the
SACCH cache in advance and thus avoid sending dummy values.
Let's allow the L2 apps populating SACCH cache before establishing
a dedicated connection using new TRXCON_EV_UPDATE_SACCH_CACHE_REQ.
Change-Id: I0f467fc07cf844cc73465f235b36ba7d00788c9f
Related: OS#5635, OS#5599
Basically, everything below layer 2 is layer 1. Let's clarify the
domain of TRXCON_EV_L1IF_FAILURE by saying 'PHYIF' instead of 'L1IF'.
Change-Id: I9159492a04bc071b7b04d9b88d4e6fd13cc3af31
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