In tx_pdtch_fn(), delay sending DATA.cnf until bid=3. Otherwise we
send it too early (at bid=0) and trick the upper layers (RLC/MAC)
to believe that the whole block (all bursts) has been transmitted.
Change-Id: If32fafeef0ea347ed3800e6b67349bf12e66047f
This patch adds support for TCH/[FH]2.4, TCH/[FH]4.8, TCH/F9.6 and
TCH/F14.4 (including FACCH). Additional changes made:
* enlarge the maximum TCH burst buffer size to 24 * (2 * 58) bytes;
* enlarge per-l1cs UL/DL burst masks to hold up to 32 bits;
* enlarge per-l1cs DL meas ring buffer to 24 entries;
* enlarge L1SCHED_PRIM_TAILROOM from 256 to 512 bytes;
* enlarge L1CTL_LENGTH from 256 to 512 bytes;
Change-Id: I0d7389a9a5f7019b9316ab1c0115797ff54a0e41
Depends: libosmocore.git Ib482817b5f6a4e3c7299f6e0b3841143b60fc93d
Depends: libosmocore.git I0c7a9c180dcafe64e6aebe53518d3d11e1f29886
Depends: libosmocore.git I4685376c8deb04db670684c9ebf685ad6fc989fa
Related: OS#4396, OS#1572
trxcon's scheduler is currently emitting DATA.cnf whenever the last
burst of a DATA.req has been transmitted. This sounds logical, but
makes the implementation quite complex. It's even harder to implement
sending of DATA.cnf properly for CSD specific channel modes, which are
to be implemented in a follow-up patch.
The DATA.cnf prims trigger sending of L1CTL DATA.cnf/TRAFFIC.cnf,
which are interpreted as Ready-to-Send by the upper layers (layer23).
Additionally DATA.cnf prims trigger sending of GSMTAP PDUs containing
the respective Uplink frames.
This patch changes the l1sched logic, so that a DATA.cnf primitive
is emitted whenever the respective DATA.req is dequeued and encoded
using the lchan specific channel coding function. This simplifies
the code a lot and prepares for the upcoming CSD support.
As a bonus, this patch fixes an inconsistency between TDMA FNs reported
in Uplink and Downlink GSMTAP PDUs. Now we're indicating the first Fn
in both cases, so Uplink is consistent with Downlink.
Change-Id: Ie09a24cd950a93edd871a9fbc5b47ec96c24cceb
Related: OS#4396, OS#1572
Whenever decoding fails or a FACCH setaling happens, simply send an
empty DATA.ind to the upper layers. On the Uplink path, use a dummy
LAPDm func=UI frame (with random padding) whenever possible.
Crafting TCH frames with zeroes is not really needed and moreover makes
it hard to distinguish between valid speech frames and BFIs. This also
used to be the case for osmo-bts-trx, but not anymore (see the related
patch).
Change-Id: I20391b860fbc2ce8f0f03d7ba95ef7a098c0f9db
Related: osmo-bts.git I8f9fb5b8c5b2cad4b92ac693c0040779f811981a
Centralized dequeueing of Tx prims in l1sched_pull_burst() is a working
approach, but doing this in each logical channel handler individually
is a lot more flexible. This is how it's done in osmo-bts-trx, and
this allows implementing FACCH support for CSD channels.
Change-Id: I3d6c2136ff1855ab0aa9062b20b2a64fd0e5fe28
Related: OS#4396, OS#1572
In ad8f7794 I changed both tx_tch[fh]_fn() to use a switch statement
and introduced a regression by removing special treatment of FACCH:
@@ -238,10 +237,16 @@ int tx_tchf_fn(struct l1sched_lchan_state *lchan,
- if (msgb_l2len(lchan->prim) == GSM_MACBLOCK_LEN) {
- /* Encode payload */
- rc = gsm0503_tch_fr_encode(buffer, msgb_l2(lchan->prim), GSM_MACBLOCK_LEN, 1);
- } else if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
@@ -459,10 +458,15 @@ int tx_tchh_fn(struct l1sched_lchan_state *lchan,
- if (msgb_l2len(lchan->prim) == GSM_MACBLOCK_LEN) {
- rc = gsm0503_tch_hr_encode(buffer, msgb_l2(lchan->prim), GSM_MACBLOCK_LEN);
- lchan->ul_facch_blocks = 6;
- } else if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
Now if the channel mode is GSM48_CMODE_SPEECH_AMR, UL FACCH/[FH] frames
will be fed to osmo_amr_rtp_dec(), which is definitely wrong. Fix this
by doing all AMR specific checks in a separate function, which is
called only for speech frames.
Change-Id: Ie217bbb389b5abb95d241781ffe3f5c7b1c188c0
Fixes: ad8f7794 "trxcon/l1sched: remove redundant TCH/[FH] prim length checks"
Related: OS#4396
trxcon was heavily inspired by osmo-bts-trx, and among with many other
scheduling related parts also inherited the timer driven clock module.
This clock module is driving the Uplink burst scheduling, just like it
does drive the Downlink burst scheduling in osmo-bts-trx. Just like
in osmo-bts-trx, the clock module relies on periodic CLCK indications
from the PHY, which are needed to compensate for the clock drifting.
The key difference is that trxcon is using Downlink bursts as the CLCK
indications, see 'bi.fn % 51' in trx_data_rx_cb(). This is possible
because the MS is a clock slave of the BTS: the MS PHY needs to sync
its freq. and clock first, and only after that it can Rx and Tx.
So far we've had no problems with the clock module in trxcon until we
started adding GPRS support and integrated the l1gprs. While the CS
domain is quite flexible in terms of timings and delays, the PS domain
is a lot more sensetive to the timing issues.
Sometimes it happens that the trxcon's clock module is ticking quicker
than it should, resulting in Uplink PDCH blocks being scheduled earlier
than the respective Downlink PDCH blocks are received:
20230502021957724 l1sched_pull_burst(): PDTCH/U Tx time (fn=56103)
20230502021957744 (PDCH-7) Rx DL BLOCK.ind (fn=56103, len=23): ...
20230502021957747 l1sched_pull_burst(): PDTCH/U Tx time (fn=56108)
20230502021957765 l1sched_pull_burst(): PDTCH/U Tx time (fn=56112)
20230502021957767 (PDCH-7) Rx DL BLOCK.ind (fn=56108, len=23): ...
20230502021957768 (PDCH-7) Rx UL BLOCK.req (fn=56112, len=54): ...
20230502021957784 l1sched_pull_burst(): PDTCH/U Tx time (fn=56116)
20230502021957784 TS7-PDTCH dropping Tx primitive (current Fn=56116, prim Fn=56112)
This is impossible in reality, because Uplink is intentionally lagging
behind Downlink by 3 TDMA timeslot periods. In a virtual setup this
causes sporadic dropping of Uplink PDCH blocks, as can be seen from
the logging snippet above, and significantly degrades the RLC/MAC
performance for GPRS.
Let's remove the internal clock module and trigger the Uplink burst
transmission each time we receive a Downlink burst. This helps to
overcome the GPRS scheduling issues and replicates the approach of
osmo-trx-ms more closely.
Change-Id: Ic8a5b6277c6b16392026e0557376257d71c9d230
Related: OS#5500
When running trxcon with GSMTAP Um logging enabled (-g cmd line arg),
in handle_prim_rach_cnf() we msgb_put() one or two bytes to the given
msgb. This causes a segfault, because the L1SCHED_PRIM_T_RACH prims
have 0 tailroom bytes available.
While we could allocate L1SCHED_PRIM_T_RACH with a few extra bytes,
a more fundamental approach is to allocate all l1sched primitives with
a fixed tailroom.
Change-Id: Ica87b147e11744a69dcd7c056376dcf6b98f9ca6
Fixes: ff9db9de "trxcon/l1sched: rework the primitive API"
Related: OS#5500
The goal is to simplify primitive management, and allow passing data
between different components without having to re-allocate memory and
copy it over several times. This patch has been tested by running
ttcn3-bts-test, no regressions observed.
* Use msgb and prim API from libosmocore,
* Move l1sched_prim definitions to its own header file,
* Move Tx queue from per-timeslot to per-lchan state,
* Route prims via l1sched_prim_{to,from}_user() functions,
* Remove GSMTAP stuff from sched_lchan_desc[].
Change-Id: I73576bd0ea10a5663ba6254283812c275cc3fa46
Related: OS#5500
An upcoming patch will add a similar function taking chan_nr/link_id
as the search criteria, so let's clarify the existing API first.
Change-Id: Ib9f733c22d7fc6bd933219906ca680f246b07f4b
Related: OS#5500
Make it clear that this function operates on a logical channel.
Also take a chance to remove redundant comments and ws.
Change-Id: I0517bba2be5403d437d3879b2332196d872e11f2
Related: OS#5500
We shall never be transmitting Uplink PDCH blocks if the current
TDMA Fn does not match the requested TDMA Fn, because Tx timing
is critical for PDCH timeslots. Drop and log an error message.
Change-Id: I6b2d9cc93ce266524f56a1b6a97beecfc0ad042d
Related: OS#5500
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
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 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
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
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
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
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