The event TRXCON_EV_TX_DATA_CNF is not premitted in state
TRXCON_ST_PACKET_DATA, and is not of any use for l1gprs.
Change-Id: Iee5ee404f1eb77091c388a641d0a78d01a8d7e7f
Related: OS#5500
TRXDv0 PDUs may have 2 additional dummy bytes at the end. Such
a PDU will crash trxcon if it contains an 8-PSK modulated burst:
Assert failed phybi->burst_len <= sizeof(bi.burst)
In this case phybi->burst_len would be 444 + 2, while size of the
burst buffer in struct l1sched_burst_ind is limited to the length
of an 8-PSK modulated burst (444).
Change-Id: Icfba986ccf0c696ba019b91575b4d69db001c14f
If the peer connected to trxcon restarts the process, read() on the unix
socket in trxcon fails, and triggers closing the conn (l1ctl_client),
which ends up freeing the struct. This all happens during read_cb() of
the l1ctl_client wqueue. If the kernel also flags WRITE event in the
same main loop iteration, the wqueue code would end up using the freed
struct again when running the write_cb.
Make sure the read_cb returns -EBADF in the code branch closing the conn
in read_cb, since it makes no sense to handle a write_cb after that.
This saves the code from accessing the potentially freed struct.
Related: OS#5872
Change-Id: I100a8ba056a09b4e52675e3539640da0c0f8d837
It's not really clear to me how the L1 is supposed to handle the
L1CTL_DM_REL_REQ message, which maps to the TRXCON_EV_DCH_REL_REQ
in our case. Lookig at the layer23 code I see that it's sent along
with the L1CTL_RESET_REQ (maps to the TRXCON_EV_RESET_SCHED_REQ).
The layer1 firmware does reset some parameters on receipt of the
L1CTL_DM_REL_REQ and some more parameters on the L1CTL_RESET_REQ.
It's clear though that we should not switch to the TRXCON_ST_RESET
on receipt of the L1CTL_DM_REL_REQ. The layer23 application
(e.g. mobile) may send L1CTL_DM_EST_REQ right after that, and we
won't be able to transition from the TRXCON_ST_RESET directly to
the TRXCON_ST_DEDICATED. Such transition is neither implemented
nor permitted by 3GPP TS 44.004, Figure 5.1.
Ideally, according to 3GPP TS 44.004, Figure 5.1, we should have
an additional transient state 'TUNING DCH' in the trxcon_fsm and
switch there on reciept of the L1CTL_DM_REL_REQ. But currently
it's not implemented and adding it would require some effort.
As a temporary solution, let's do not change the current state and
stay in the TRXCON_ST_DEDICATED. This workaround is needed to make
mobile terminated calls work in the mobile app.
Change-Id: I5bbe6ca4cc6299f9faf343822c992a6872a45081
Related: OS#5599
This is needed for SDR based PHYs, because for them it takes longer
to tune, flush the buffers and so on. Add a field to the trxcon_inst
structure and a command line option (-F) for the trxcon app.
Change-Id: Ia68954c5bdacda45fc871ffea0ccdf2460936408
Related: OS#5599
In the upcoming patches I am adding a possibility to enlarge the FBSB
timeout by providing API for that. This is needed for SDR based PHYs,
because for them it takes longer to tune and so on. The L1CTL codec
is not the right place for applying PHY specific quirks, so let's
move the TDMA FNs -> ms conversion to the FSM logic.
Change-Id: I685f48cfed000997b0d7c16073c6387bc05d2bbe
Related: OS#5599
The *cnf param of l1ctl_tx_dt_conf() was already declared as const
in the header file, however it was not in the actual function
definition. Take a chance to fix formatting in the header.
Change-Id: I842ac717a6959830c536cbf91efdbb6a4ee931ce
It may happen that the MS needs to go directly from a PDCH to a TCH
or SDCCH, e.g. in case of a Mobile Terminated call. I don't know
if the opposite transition is needed on practice, but let's simply
allow direct transitions for both TRXCON_ST_{DEDICATED,PACKET_DATA}.
Change-Id: I1a854e4683f102c40f1c174a291b6dc638f49b5c
Related: OS#5599
According to 3GPP TS 44.004, Figure 5.1, it's absolutely legal to
perform loop transitions in state 'DCH' (i.e. from 'DCH' to 'DCH').
This kind of transition is needed in the following cases:
* on reciept of RR FREQUENCY REDEFINITION,
* on reciept of RR ASSIGNMENT REQUEST,
* on reciept of RR HANDOVER REQUEST,
when going back from state 'DCH' to state 'BCH' is not required nor
actually desired. In context of the trxcon_fsm, this applies to
both TRXCON_ST_DEDICATED and TRXCON_ST_PACKET_DATA, as they both
represent what's defined as 'DCH' in the Figure 5.1.
Change-Id: I3b402ec84610a5df744d9b06e5f7dab7a9a3ddad
Related: OS#5599
This new function will be re-used in a follow up patch implementing
handling of TRXCON_EV_DCH_EST_REQ in TRXCON_ST_{DEDICATED,PACKET_DATA}.
Change-Id: I8db93fcdace7aaa8bc3876b14e441304349a36d5
Related: OS#5599
According to 3GPP TS 44.004, Figure 5.1, transitioning from state
'DCH' directly to state 'BCH' is not permitted. Speaking in terms
of the trxcon_fsm, the following state transitions are invalid:
* TRXCON_ST_DEDICATED -> TRXCON_ST_BCCH_CCCH,
* TRXCON_ST_PACKET_DATA -> TRXCON_ST_BCCH_CCCH.
We never do such transitions anyway, so we are good.
Change-Id: I14ebfc5c86d37765ad06fa91321a469dea46e50f
Related: OS#5599
This API is going to be used by osmo-trx-ms for inquiring the l1sched
about an lchan state before attempting to demodulate a Downlink burst.
Change-Id: I9a71b8a59733f4dd908b760c5e23ea3d624afb1a
Related: OS#5599
This API is going to be used by osmo-trx-ms for pulling Uplink bursts
from the scheduler in a synchronous way, without relying on the
timer driven libtrxcon's internal scheduler.
Change-Id: Ic8f74413f5fad277340e007dd4296f890155a2c1
Related: OS#5599
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
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