Commit Graph

28 Commits

Author SHA1 Message Date
Harald Welte d9a1cd994c CBCH: Implement CBCH support for osmo-bts-{trx,virtual}
This patch adds scheduler support for the channel combinations that
substitute SDCCH index 2 for a CBCH in either a SDCCH/8 or SDCCH/4.

Change-Id: Icc15603079a1709ec094f400a9bcf0008211890f
Closes: OS#1617
2018-09-09 15:40:58 +00:00
Vadim Yanitskiy 5d17b97a5b Clarify frame loss counter for l1sched_chan_state
Each logical channel (e.g. SACCH, SDCCH, etc.) has a counter of
lost L2 frames. Let's use a bit better name for it, and correct
its description in the 'l1sched_chan_state' struct definition.

Change-Id: I92ef95f6b3f647170cfd434a970701406b0a7c82
2018-08-01 02:35:07 +07:00
Pau Espin 20278252b5 scheduler: Log error on fn jump
Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9
2018-07-20 16:41:15 +02:00
Pau Espin e04e4d423d sched: Log RX->RTP packet like we do in add_l1sap_header
Other backends use already msgb in lower layers and eventually call
add_l1sap_header to push TCH data up the stack.
backends using common/scheduler.c (bts-trx, bts-virt) are the only ones
not yet using msgb in lower layer but only creating the msgb
immediatelly before sending it in _sched_compose_tch_ind. Let's add a
log message there too to have similar output in all BTS backends.

Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a
2018-07-20 16:41:15 +02:00
Harald Welte acefd0586e L1SAP: Increase resolution of reported burst timing
Before this patch we had:
* osmo-bts-trx internally using 1/256th bit/symbol period
* osmo-bts-sysmo internally using 1/4 bit/smbol period
* PCU interface using 1/4
* L1SAP interface using 1/4
* measurement processing code on top of L1SAP using 1/256

So for sysmo/lc15/octphy we are not loosing resolution, but for
osmo-bts-trx we're arbitrarily reducing the resolution via L1SAP
only then to compute with higher resolution again.

Let's change L1SAP to use 1/256 bits and hence not loose any resolution.
This requires a corresponding change in libosmocore for l1sap.h, which
is found in Change-Id Ibb58113c2819fe2d6d23ecbcfb8b3fce4055025d

Change-Id: If9b0f617845ba6c4aa47969f521734388197c9a7
2018-02-27 20:00:16 +01:00
Harald Welte d5bbd8ccf7 trx/scheduler: Use integer math for TOA (Timing of Arrival)
There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
2018-02-27 19:58:20 +01:00
Harald Welte b60d9e9464 scheduler: Add missing \n at end of LOG statement
Change-Id: I55419dfa884b4170dfed696a7e1334940a46ba82
2018-02-26 22:37:03 +01:00
Harald Welte 6381900677 split scheduler_mframe.c from scheduler.c
There are use cases for the multiframe scheduler tables outside the
context of the entire scheduler. Let's prepare for that.

Related: OS#2978
Change-Id: I6a501e66c47809ae3cdc55bef2cb6390ee0096b1
2018-02-26 15:01:08 +01:00
Harald Welte fc169ba7bb scheduler.c: Print message when burst substitution happens
Whenever we receive discontinuous frame numbers from the TRX socket,
osmo-bts-trx is substituting zero-filled bursts for those frame numbers
which we missed.  Don't just do this silently, but actually log about
it, as it is an error.

Note: This [currently] happens when using a virtual air interface with trxcon
as opposed to a real SDR receiver with osmo-trx.

Change-Id: If79eab37c80647c9ab64f399fa4676d97af3e9ad
2018-02-23 23:29:34 +01:00
Harald Welte b82b81b256 scheduler: add trx_sched_is_sacch_fn() function
For proper measurement processing of RX{LEV,QUAL}-SUB, we will
need this information.

Related: OS#2978
Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
2018-02-23 14:27:45 +00:00
Harald Welte a38deee5f1 scheduler.c: Factor out find_sched_mframe_idx() function
Let's split the look-up of the multiframe scheduler from the asignment
to a given l1ts in trx_sched_set_pchan.

Related: OS#2978
Change-Id: I79548b25aae647ce993a9d83c771d22b08cb1c74
2018-02-23 14:27:33 +00:00
Harald Welte 62a6a2680f scheduler: Harmonize log line format; Always print TS name + decoded FN
Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
2017-12-02 21:05:34 +01:00
Harald Welte de99be4afb L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific
code below L1SAP.  This is some kind of a hack/workaround, making code
and debug output / logs more difficult to understand.

So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and
remove the "hiding" code from the common l1sap.c code.

Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
2017-08-09 10:03:14 +00:00
Harald Welte 0e9dadc3d8 scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data
RTS.ind, DATA.* and TCH.* primitives are L1P, not L1C.

Change-Id: I4a32b83225e931ced561fdf457fa962e8ad44bd2
2017-07-19 16:02:25 +02:00
Vadim Yanitskiy 0227e4d04c cosmetic: fix some typos
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15 14:40:21 +00:00
Max 322252d793 osmo-bts-trx: cosmetic log fix
Print actual value causing error and the check range.

Change-Id: Ic36c0558cdbd1790c167f290a40007b42f5de65d
2017-04-28 08:47:21 +00:00
Max df75195666 scheduler: log lchan on which prim error occured
Log both lchan and trx_chan_type (using introduced value_string).

Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
2017-01-10 23:29:06 +00:00
Max 960dd993cd TRX: prevent segfault upon phy init
Previously if multiply phy instances were configured but not used
osmo-bts-trx would segfault. Terminate with clear error message instead
so user can correct configuration. Example configuration which caused
problem:
...
phy 0
 instance 0
 instance 1
...
 trx 0
  phy 0 instance 0

Note the 2nd instance of phy 0 which is not used in trx later on.

Change-Id: Id979506731ea92401458f1060e87aeb690901539
2016-12-05 18:55:49 +00:00
Max 66325aee71 Replace link_id constant with define
Instead of using constant for link_id directly, use shared define value.

Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-11 15:52:49 +01:00
Max 4b76a323b3 Fill measurements data for L1SAP
Fill in values for BER, BTO, Link quality in L1SAP and send them to
PCU. Note: this increases the version of BTS <-> PCU protocol. It also
requires corresponding changes in libosmocore.

All BTS models provide measurements data unless direct DSP access for
PCU is enabled. For BTS-specific notes see below.

Octphy: conversion from sSNRDb to Link Quality uses formulae which works
in practice instead of what's documented for sSNRDb value. Subject to
change in future revisions.

TRX: C / I link quality estimator is not computed.

Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c
Related: OS#1616
2016-08-08 17:41:27 +00:00
Tom Tsou dab54b9178 trx: Enable EGPRS handling through burst lengths
Existing interfaces are coded with the implicit expectation of using
a burst sequence length of 148, which is constant with GSM and GPRS.
That changes with EGPRS, where the burst length may be 444 due to
the use of 8-PSK instead of GMSK modulation.

Setup the interface to accept and return a length value with the
burst sequence. This allows 444 length bit vectors to/from the
EGPRS decoder/encoder. Length is explicitly used as a identifier for
8-PSK vs. GMSK modulated sequences.

Change-Id: I90b46b46b11b6ce280e7f8232d5a2fccec2d4f18
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-28 06:18:12 +00:00
Neels Hofmeyr a888e95efa log typo: trx_sched_set_pchan()
Change-Id: Icdb193ec6dbb95cf0c3e441c196b309aa599efe6
2016-07-27 16:24:47 +02:00
Tom Tsou 73cb583e51 trx: Add EGPRS tables, sequences, and mappings
Includes EGPRS specific convolutional codes, interleaving tables
and functions, burst mappings, training sequences, and parity
checks from 3GPP TS 44.060 needed to handle MCS codings 1-9.

Change-Id: Ie270398dd7a72f282ba53e646853d8de1eabee93
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-25 18:36:29 +00:00
Max cb20c83323 Fix ocmo-bts-octphy interaction with OsmoPCU
Previously osmo-bts-octphy have not provided in-band presence
information which cause off-by-one errors and misinterpretation of
ph_data_ind by PCU. This fixed now by adding support for explicitly
passing PH-DATA presence info. Corresponding check and in-band passing
of presence information are removed.

Note: this requires libosmocore version with osmo_ph_pres_info_type
support integrated.

[hfreyther/max: Remove + 1 from the decoded length]
2016-02-22 13:57:54 +01:00
Harald Welte 94bb3769f3 scheduler: Fix ARRAY_SIZE() in trx_sched_init()
We want the size of the array, not of the pointer to the array.

Found by coverity (CID 1351422).
2016-02-15 20:16:07 +01:00
Harald Welte e81cc6a158 use unsigned int to compare wih ARRAY_SIZE
This is not really an issue, but makes coverity happy (CID 1351422).
2016-02-15 20:13:04 +01:00
Harald Welte d784e50747 Introduce new phy_link and phy_instance abstraction
This way we can model a flexible mapping between any number of PHYs,
each having multiple instances, and then map BTSs with TRXx on top of
those PHYs.
2016-02-15 14:18:59 +01:00
Harald Welte 1a5b00ebe2 TRX: Move scheduler to src/common
This is the final step to make the L1 scheduler generally available
to other BTS models than OsmoTRX.
2016-02-15 14:17:55 +01:00